@zibby/core 0.1.33 → 0.1.36

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 (94) hide show
  1. package/dist/agents/base.js +286 -14
  2. package/dist/backend-client.js +1 -1
  3. package/dist/constants/tool-names.js +1 -1
  4. package/dist/constants/zibby-scratch.js +1 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/enrichment/base.js +1 -1
  7. package/dist/enrichment/enrichers/accessibility-enricher.js +1 -1
  8. package/dist/enrichment/enrichers/dom-enricher.js +1 -1
  9. package/dist/enrichment/enrichers/page-state-enricher.js +1 -1
  10. package/dist/enrichment/enrichers/position-enricher.js +1 -1
  11. package/dist/enrichment/index.js +4 -1
  12. package/dist/enrichment/mcp-integration.js +4 -1
  13. package/dist/enrichment/mcp-ref-enricher.js +1 -1
  14. package/dist/enrichment/pipeline.js +2 -2
  15. package/dist/enrichment/trace-text-enricher.js +2 -1
  16. package/dist/framework/agents/assistant-strategy.js +69 -5
  17. package/dist/framework/agents/base.js +1 -1
  18. package/dist/framework/agents/claude-strategy.js +106 -4
  19. package/dist/framework/agents/codex-strategy.js +23 -4
  20. package/dist/framework/agents/cursor-strategy.js +106 -20
  21. package/dist/framework/agents/gemini-strategy.js +34 -7
  22. package/dist/framework/agents/index.js +252 -6
  23. package/dist/framework/agents/middleware/assistant-round-pipeline.js +2 -2
  24. package/dist/framework/agents/providers/base.js +1 -1
  25. package/dist/framework/agents/providers/index.js +4 -1
  26. package/dist/framework/agents/providers/openai-transport.js +4 -2
  27. package/dist/framework/agents/providers/openai.js +1 -1
  28. package/dist/framework/agents/providers/transport-base.js +1 -1
  29. package/dist/framework/agents/utils/auth-resolver.js +1 -1
  30. package/dist/framework/agents/utils/cursor-output-formatter.js +25 -1
  31. package/dist/framework/agents/utils/openai-proxy-formatter.js +43 -5
  32. package/dist/framework/agents/utils/payload-budget.js +2 -2
  33. package/dist/framework/agents/utils/structured-output-formatter.js +8 -4
  34. package/dist/framework/code-generator.js +276 -10
  35. package/dist/framework/constants.js +1 -1
  36. package/dist/framework/context-loader.js +2 -2
  37. package/dist/framework/function-bridge.js +60 -1
  38. package/dist/framework/function-skill-registry.js +1 -1
  39. package/dist/framework/graph-compiler.js +281 -1
  40. package/dist/framework/graph.js +272 -4
  41. package/dist/framework/index.js +298 -1
  42. package/dist/framework/mcp-client.js +56 -2
  43. package/dist/framework/node-registry.js +262 -4
  44. package/dist/framework/node.js +264 -4
  45. package/dist/framework/output-parser.js +2 -2
  46. package/dist/framework/skill-registry.js +1 -1
  47. package/dist/framework/state-utils.js +5 -1
  48. package/dist/framework/state.js +1 -1
  49. package/dist/framework/tool-resolver.js +1 -1
  50. package/dist/index.js +479 -5
  51. package/dist/package.json +1 -1
  52. package/dist/runtime/generation/base.js +1 -1
  53. package/dist/runtime/generation/index.js +58 -3
  54. package/dist/runtime/generation/mcp-ref-strategy.js +17 -17
  55. package/dist/runtime/generation/stable-id-strategy.js +14 -14
  56. package/dist/runtime/stable-id-runtime.js +1 -1
  57. package/dist/runtime/verification/base.js +1 -1
  58. package/dist/runtime/verification/index.js +3 -3
  59. package/dist/runtime/verification/playwright-json-strategy.js +1 -1
  60. package/dist/runtime/zibby-runtime.js +1 -1
  61. package/dist/sync/index.js +1 -1
  62. package/dist/sync/uploader.js +1 -1
  63. package/dist/tools/run-playwright-test.js +3 -3
  64. package/dist/utils/adf-converter.js +1 -1
  65. package/dist/utils/ast-utils.js +9 -1
  66. package/dist/utils/ci-setup.js +4 -4
  67. package/dist/utils/cursor-mcp-isolated-home.js +1 -1
  68. package/dist/utils/cursor-utils.js +1 -1
  69. package/dist/utils/live-frame-discovery.js +1 -1
  70. package/dist/utils/logger.js +1 -1
  71. package/dist/utils/mcp-config-writer.js +4 -4
  72. package/dist/utils/mission-control-from-run-states.js +1 -1
  73. package/dist/utils/node-schema-parser.js +9 -1
  74. package/dist/utils/parallel-config.js +1 -1
  75. package/dist/utils/post-process-events.js +2 -1
  76. package/dist/utils/repo-clone.js +1 -0
  77. package/dist/utils/result-handler.js +1 -1
  78. package/dist/utils/ripple-effect.js +1 -1
  79. package/dist/utils/run-capacity-coordinator.js +3 -1
  80. package/dist/utils/run-capacity-queue.js +2 -2
  81. package/dist/utils/run-index-merge.js +1 -1
  82. package/dist/utils/run-index-post-cli.js +4 -1
  83. package/dist/utils/run-registry.js +3 -3
  84. package/dist/utils/run-state-session.js +2 -2
  85. package/dist/utils/selector-generator.js +4 -4
  86. package/dist/utils/session-state-constants.js +1 -1
  87. package/dist/utils/session-state-live-runs.js +1 -1
  88. package/dist/utils/streaming-parser.js +3 -3
  89. package/dist/utils/test-post-processor.js +14 -11
  90. package/dist/utils/timeline.js +6 -6
  91. package/dist/utils/trace-parser.js +2 -2
  92. package/dist/utils/video-organizer.js +3 -3
  93. package/package.json +1 -1
  94. package/templates/browser-test-automation/result-handler.mjs +4 -39
@@ -1 +1,298 @@
1
- import{WorkflowGraph as r}from"./graph.js";import{Node as l,ConditionalNode as p}from"./node.js";import{WorkflowState as a}from"./state.js";import{OutputParser as f,SchemaTypes as g}from"./output-parser.js";import{compileGraph as n,validateGraphConfig as d,extractSteps as x,CompilationError as S}from"./graph-compiler.js";import{registerNode as k,getNodeImpl as h,hasNode as T,listNodeTypes as A,getNodeTemplate as C}from"./node-registry.js";import{resolveNodeTools as y,getResolvedToolDefinitions as O,NODE_DEFAULT_TOOLS as c}from"./tool-resolver.js";import{registerSkill as D,getSkill as E,hasSkill as G,getAllSkills as W,listSkillIds as u}from"./skill-registry.js";import{generateWorkflowCode as L,generateNodeConfigsJson as _}from"./code-generator.js";import{hasAgentCall as J}from"../utils/ast-utils.js";import{AgentStrategy as R}from"./agents/base.js";import{invokeAgent as b,getAgentStrategy as j}from"./agents/index.js";export{R as AgentStrategy,S as CompilationError,p as ConditionalNode,c as NODE_DEFAULT_TOOLS,l as Node,f as OutputParser,g as SchemaTypes,r as WorkflowGraph,a as WorkflowState,n as compileGraph,x as extractSteps,_ as generateNodeConfigsJson,L as generateWorkflowCode,j as getAgentStrategy,W as getAllSkills,h as getNodeImpl,C as getNodeTemplate,O as getResolvedToolDefinitions,E as getSkill,J as hasAgentCall,T as hasNode,G as hasSkill,b as invokeAgent,A as listNodeTypes,u as listSkillIds,k as registerNode,D as registerSkill,y as resolveNodeTools,d as validateGraphConfig};
1
+ var N3=Object.create;var s_=Object.defineProperty;var z3=Object.getOwnPropertyDescriptor;var C3=Object.getOwnPropertyNames;var j3=Object.getPrototypeOf,A3=Object.prototype.hasOwnProperty;var wi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var z=(e,t)=>()=>(e&&(t=e(e=0)),t);var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fa=(e,t)=>{for(var r in t)s_(e,r,{get:t[r],enumerable:!0})},R3=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of C3(t))!A3.call(e,i)&&i!==r&&s_(e,i,{get:()=>t[i],enumerable:!(n=z3(t,i))||n.enumerable});return e};var o_=(e,t,r)=>(r=e!=null?N3(j3(e)):{},R3(t||!e||!e.__esModule?s_(r,"default",{value:e,enumerable:!0}):r,e));import rc from"chalk";var Ki,l_,M,xi=z(()=>{Ki={debug:0,info:1,warn:2,error:3,silent:4},l_=class{constructor(){this._level=this._getLogLevel()}_getLogLevel(){if(process.env.ZIBBY_DEBUG==="true")return Ki.debug;if(process.env.ZIBBY_VERBOSE==="true")return Ki.info;let t=process.env.LOG_LEVEL?.toLowerCase();return t&&t in Ki?Ki[t]:Ki.info}_shouldLog(t){return Ki[t]>=this._level}_formatMessage(t,r,n={}){let i=new Date().toISOString(),s=`${this._getPrefix(t)} ${r}`;return Object.keys(n).length>0&&(s+=rc.dim(` ${JSON.stringify(n)}`)),s}_getPrefix(t){return{debug:rc.gray("[DEBUG]"),info:rc.cyan("[INFO]"),warn:rc.yellow("[WARN]"),error:rc.red("\u274C [ERROR]")}[t]||""}debug(t,r){this._shouldLog("debug")&&console.log(this._formatMessage("debug",t,r))}info(t,r){this._shouldLog("info")&&console.log(this._formatMessage("info",t,r))}warn(t,r){this._shouldLog("warn")&&console.warn(this._formatMessage("warn",t,r))}error(t,r){this._shouldLog("error")&&console.error(this._formatMessage("error",t,r))}setLevel(t){t in Ki&&(this._level=Ki[t])}getLevel(){return Object.keys(Ki).find(t=>Ki[t]===this._level)}},M=new l_});import Pr from"chalk";function HO(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function JO(e,t){return(r,n,i)=>{if(typeof r!="string")return e(r,n,i);let a=process.stdout.columns||120,s="";for(let o=0;o<r.length;o++){let u=r[o];t.lineStart&&(s+=GO,t.col=KO,t.lineStart=!1),u===`
2
+ `?(s+=u,t.lineStart=!0,t.col=0,t.inEsc=!1):u==="\x1B"?(t.inEsc=!0,s+=u):t.inEsc?(s+=u,(u>="A"&&u<="Z"||u>="a"&&u<="z")&&(t.inEsc=!1)):(t.col++,s+=u,t.col>=a&&(s+=`
3
+ ${GO}`,t.col=KO))}return e(s,n,i)}}var M3,nc,L3,VO,c_,WO,BO,d_,GO,KO,f_,Ht,Uo=z(()=>{M3="__WORKFLOW_GRAPH_LOG__",nc=Pr.gray("\u2502"),L3=Pr.gray("\u250C"),VO=Pr.gray("\u2514"),c_=Pr.green("\u25C6"),WO=Pr.hex("#c084fc")("\u25C6"),BO=Pr.hex("#2dd4bf")("\u25C6"),d_=Pr.red("\u25C6"),GO=`${nc} `,KO=2;f_=class{constructor(){this._currentNode=null,this._origStdoutWrite=null,this._origStderrWrite=null;let t=String(process.env.ZIBBY_RUN_SOURCE||"").trim().toLowerCase(),r=String(process.env.ZIBBY_WORKFLOW_GRAPH_LOG_MARKERS||"").trim()==="1";this._emitWorkflowGraphMarkers=r||t==="studio"}get isInsideNode(){return this._currentNode!==null}_startIntercepting(){this._origStdoutWrite=process.stdout.write.bind(process.stdout),this._origStderrWrite=process.stderr.write.bind(process.stderr);let t={lineStart:!0,col:0,inEsc:!1},r={lineStart:!0,col:0,inEsc:!1};this._outState=t,this._errState=r,process.stdout.write=JO(this._origStdoutWrite,t),process.stderr.write=JO(this._origStderrWrite,r)}_stopIntercepting(){this._origStdoutWrite&&(this._outState&&!this._outState.lineStart&&this._origStdoutWrite(`
4
+ `),process.stdout.write=this._origStdoutWrite),this._origStderrWrite&&(this._errState&&!this._errState.lineStart&&this._origStderrWrite(`
5
+ `),process.stderr.write=this._origStderrWrite),this._origStdoutWrite=null,this._origStderrWrite=null}_rawWrite(t){(this._origStdoutWrite||process.stdout.write.bind(process.stdout))(`${t}
6
+ `)}_emitGraphLogMarker(t){if(!this._emitWorkflowGraphMarkers)return;let r=`${M3}${JSON.stringify(t)}
7
+ `;this._origStdoutWrite?this._origStdoutWrite(r):process.stdout.write(r)}_writeDot(t,r){this._origStdoutWrite?(this._outState&&!this._outState.lineStart&&(this._origStdoutWrite(`
8
+ `),this._outState.lineStart=!0,this._outState.col=0),this._origStdoutWrite(`${t} ${r}
9
+ `)):process.stdout.write.bind(process.stdout)(`${t} ${r}
10
+ `)}step(t){this._origStdoutWrite?this._writeDot(c_,t):process.stdout.write.bind(process.stdout)(`${nc} ${c_} ${t}
11
+ `)}stepTool(t){this._origStdoutWrite?this._writeDot(WO,t):process.stdout.write.bind(process.stdout)(`${nc} ${WO} ${t}
12
+ `)}stepMemory(t){let r=Pr.hex("#2dd4bf")(t);this._origStdoutWrite?this._writeDot(BO,r):process.stdout.write.bind(process.stdout)(`${nc} ${BO} ${r}
13
+ `)}stepFail(t){this._origStdoutWrite?this._writeDot(d_,Pr.red(t)):process.stdout.write.bind(process.stdout)(`${nc} ${d_} ${Pr.red(t)}
14
+ `)}nodeStart(t){this._currentNode=t,this._emitGraphLogMarker({phase:"node_begin",node:t}),this._rawWrite(`${L3} ${t}`),this._startIntercepting()}nodeComplete(t,r={}){this._stopIntercepting();let{duration:n,details:i}=r;if(i)for(let s of i)this._rawWrite(`${c_} ${s}`);let a=n?Pr.dim(` ${HO(n)}`):"";this._rawWrite(`${VO} ${Pr.green("done")}${a}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}nodeFailed(t,r,n={}){this._stopIntercepting();let{duration:i}=n,a=i?Pr.dim(` ${HO(i)}`):"";this._rawWrite(`${d_} ${Pr.red(r)}`),this._rawWrite(`${VO} ${Pr.red("failed")}${a}`),this._emitGraphLogMarker({phase:"node_end",node:t}),this._rawWrite("")}route(t,r){this._rawWrite(Pr.dim(` ${t} \u2192 ${r}`)),this._rawWrite("")}graphComplete(){this._rawWrite(Pr.green.bold("\u2713 Workflow completed"))}},Ht=new f_});var Mo,YO,Va,Vp,QO,Wp=z(()=>{Mo=".zibby/output",YO="sessions",Va=".session-info.json",Vp=".zibby-studio-stop",QO=["CI_JOB_ID","GITHUB_RUN_ID","CIRCLE_WORKFLOW_ID","BUILD_ID"]});var Jr,Wa=z(()=>{Jr=class{constructor(t,r,n=0){this.name=t,this.description=r,this.priority=n}async invoke(t,r={}){throw new Error("AgentStrategy.invoke() must be implemented by subclass")}canHandle(t){throw new Error("AgentStrategy.canHandle() must be implemented by subclass")}getName(){return this.name}getDescription(){return this.description}getPriority(){return this.priority}}});var Yr,p_,m_,XO,Bp,Cs=z(()=>{Yr={ASSISTANT:"gpt-5.4-nano-2026-03-17",CLAUDE:"claude-sonnet-4-6",CURSOR:"auto",CODEX:"o4-mini",GEMINI:"gemini-2.5-pro",OPENAI_POSTPROCESSING:"gpt-4o-mini"},p_={auto:"claude-sonnet-4-6","sonnet-4.6":"claude-sonnet-4-6","sonnet-4-6":"claude-sonnet-4-6","opus-4.6":"claude-opus-4-6","opus-4-6":"claude-opus-4-6","sonnet-4.5":"claude-sonnet-4-5-20250929","sonnet-4-5":"claude-sonnet-4-5-20250929","opus-4.5":"claude-opus-4-20250514","opus-4-5":"claude-opus-4-20250514","claude-sonnet-4-6":"claude-sonnet-4-6","claude-opus-4-6":"claude-opus-4-6","claude-sonnet-4-5-20250929":"claude-sonnet-4-5-20250929","claude-opus-4-20250514":"claude-opus-4-20250514"},m_={auto:"o4-mini","o4-mini":"o4-mini",o3:"o3","o3-mini":"o3-mini","codex-mini":"codex-mini-latest","gpt-4o":"gpt-4o","gpt-4o-mini":"gpt-4o-mini","gpt-5.2-codex":"gpt-5.2-codex","gpt-5.2":"gpt-5.2","gpt-5.3":"gpt-5.3","gpt-5.4":"gpt-5.4"},XO={auto:"gemini-2.5-pro","gemini-2.5-pro":"gemini-2.5-pro","gemini-2.5-flash":"gemini-2.5-flash"},Bp={CURSOR_AGENT_DEFAULT:1200*1e3,OPENAI_REQUEST:18e4}});var h_={};fa(h_,{getAllSkills:()=>Gp,getSkill:()=>Ir,hasSkill:()=>tN,listSkillIds:()=>rN,registerSkill:()=>eN});function eN(e){if(!e||typeof e.id!="string")throw new Error("Skill definition must include a string id");ic.set(e.id,Object.freeze({...e}))}function Ir(e){return ic.get(e)||null}function tN(e){return ic.has(e)}function Gp(){return new Map(ic)}function rN(){return Array.from(ic.keys())}var ic,Hi=z(()=>{ic=new Map});var Lo,g_=z(()=>{Lo=class e{constructor(){this.buffer="",this.extractedResult=null,this.rawText="",this.zodSchema=null,this.lastOutputLength=0,this.onToolCall=null,this._lastToolEmit=null}processChunk(t){if(!t)return null;this.buffer+=t;let r=this.buffer.split(`
15
+ `);this.buffer=r.pop()||"";let n="";for(let i of r)if(i.trim())try{let a=JSON.parse(i);this._emitToolCalls(a);let s=this.extractText(a);if(s){if(this.rawText&&s.startsWith(this.rawText)){let o=s.substring(this.rawText.length);this.rawText=s,n+=o}else(!this.rawText.includes(s)||s.length<20)&&(this.rawText+=s,n+=s);this.tryExtractResult(this.rawText)}else this.isValidResult(a)&&(this.rawText+=`${i}
16
+ `,n+=`${i}
17
+ `,this.extractedResult=a)}catch{if(i.includes('"text"')||i.includes('"content"')){let s=i.match(/"text"\s*:\s*"([^"]*)/),o=i.match(/"content"\s*:\s*"([^"]*)/),u=s?s[1]:o?o[1]:null;u&&!this.rawText.includes(u)&&(n+=u,this.rawText+=u)}}return n||null}flush(){if(!this.buffer.trim())return null;let t="";try{let r=JSON.parse(this.buffer);this._emitToolCalls(r);let n=this.extractText(r);n&&(this.rawText+=n,t+=n,this.tryExtractResult(n))}catch{this.rawText+=this.buffer,t+=this.buffer,this.tryExtractResult(this.buffer)}return this.buffer="",t||null}_emitToolCalls(t){if(!this.onToolCall)return;let r=(s,o)=>{if(!s)return;let u=`${s}:${JSON.stringify(o??{})}`;this._lastToolEmit!==u&&(this._lastToolEmit=u,this.onToolCall(s,o??void 0))},n=s=>{if(s!=null){if(typeof s=="object"&&!Array.isArray(s))return s;if(typeof s=="string")try{return JSON.parse(s)}catch{return}}};if(t.type==="tool_use"||t.type==="tool_call"){if(t.name){r(t.name,n(t.input??t.arguments));return}let s=t.tool_call;if(s&&typeof s=="object"&&!Array.isArray(s)){let o=Object.keys(s);if(o.length===1){let u=o[0],l=s[u],c=l&&typeof l=="object"?l.args??l.input??l:void 0;r(u,n(c))}return}return}if(Array.isArray(t.tool_calls)){for(let s of t.tool_calls)r(s.name,n(s.input??s.arguments));return}let i=t.message??t;if(Array.isArray(i?.tool_calls)){for(let s of i.tool_calls)r(s.name,n(s.input??s.arguments));return}let a=i?.content??t.content;if(Array.isArray(a))for(let s of a)(s.type==="tool_use"||s.type==="tool_call")&&s.name&&r(s.name,n(s.input??s.arguments))}extractText(t){if(t.type==="assistant"&&t.message?.content){let r=t.message.content;if(Array.isArray(r))return r.filter(n=>n.type==="text"&&n.text).map(n=>n.text).join("")}return t.type==="thinking"&&t.text||t.text?t.text:t.content&&typeof t.content=="string"?t.content:t.delta?t.delta:null}tryExtractResult(t){if(!t||typeof t!="string")return;let r=[],n=/```json\s*\n?([\s\S]*?)\n?```/g,i;for(;(i=n.exec(t))!==null;){let d=i[1].trim();try{JSON.parse(d),r.push({text:d,source:"markdown"})}catch{}}let a=0,s=0;for(;a<t.length&&(a=t.indexOf("{",a),a!==-1);){let d=0,f=a;for(let p=a;p<t.length;p++)if(t[p]==="{")d++;else if(t[p]==="}"&&(d--,d===0)){f=p,r.push({text:t.substring(a,f+1),source:"brace"}),s++;break}a=f+1}let o=this.extractedResult,u=o?JSON.stringify(o).length:0,l=0,c=-1;for(let d=0;d<r.length;d++){let f=r[d];try{let p=f.text.replace(/,(\s*[}\]])/g,"$1"),h=JSON.parse(p);this.isValidResult(h)&&(l++,u=JSON.stringify(h).length,o=h,c=d)}catch{}}o&&(this.extractedResult=o)}isValidResult(t){if(!t||typeof t!="object"||Array.isArray(t)||t.session_id||t.timestamp_ms||t.type||t.call_id||t.tool_call||t.result&&typeof t.result=="object"&&(t.result.success&&typeof t.result.success=="object"||t.result.error&&typeof t.result.error=="object")||t.args&&typeof t.args=="object")return!1;if(this.zodSchema)try{return this.zodSchema.parse(t),!0}catch{return!1}return!0}getResult(){return this.extractedResult}getRawText(){return this.rawText}static extractResult(t,r=null){let n=new e;n.zodSchema=r,n.processChunk(t),n.flush();let i=n.getResult();return!i&&process.env.LOG_LEVEL==="debug"&&console.error("[StreamingParser] No result extracted from",t?.length||0,"chars"),i}}});var y_,Z3,v_,__,Kp=z(()=>{y_=Symbol("Let zodToJsonSchema decide on which parser to use"),Z3=(e,t)=>{if(t.description)try{return{...e,...JSON.parse(t.description)}}catch{}return e},v_={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},__=e=>typeof e=="string"?{...v_,name:e}:{...v_,...e}});var b_,w_=z(()=>{Kp();b_=e=>{let t=__(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}}});function Hp(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function dt(e,t,r,n,i){e[t]=r,Hp(e,t,n,i)}var Ba=z(()=>{});var ac,Jp=z(()=>{ac=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")}});var ft,nN,ce,pa,sc=z(()=>{(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(let s of i)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(ft||(ft={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(nN||(nN={}));ce=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pa=e=>{switch(typeof e){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return Number.isNaN(e)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(e)?ce.array:e===null?ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ce.promise:typeof Map<"u"&&e instanceof Map?ce.map:typeof Set<"u"&&e instanceof Set?ce.set:typeof Date<"u"&&e instanceof Date?ce.date:ce.object;default:return ce.unknown}}});var Q,Cn,Yp=z(()=>{sc();Q=ft.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"]),Cn=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(s))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Cn.create=e=>new Cn(e)});var q3,Ga,x_=z(()=>{Yp();sc();q3=(e,t)=>{let r;switch(e.code){case Q.invalid_type:e.received===ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:r=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case Q.invalid_union:r="Invalid input";break;case Q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case Q.invalid_enum_value:r=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:r="Invalid function arguments";break;case Q.invalid_return_type:r="Invalid function return type";break;case Q.invalid_date:r="Invalid date";break;case Q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ft.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Q.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Q.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Q.custom:r="Invalid input";break;case Q.invalid_intersection_types:r="Intersection results could not be merged";break;case Q.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:r="Number must be finite";break;default:r=t.defaultError,ft.assertNever(e)}return{message:r}},Ga=q3});function oc(){return F3}var F3,Qp=z(()=>{x_();F3=Ga});function oe(e,t){let r=oc(),n=Xp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ga?void 0:Ga].filter(i=>!!i)});e.common.issues.push(n)}var Xp,Ur,ze,Zo,Qr,k_,S_,js,uc,I_=z(()=>{Qp();x_();Xp=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)o=l(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};Ur=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return ze;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let a=await i.key,s=await i.value;n.push({key:a,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return ze;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}},ze=Object.freeze({status:"aborted"}),Zo=e=>({status:"dirty",value:e}),Qr=e=>({status:"valid",value:e}),k_=e=>e.status==="aborted",S_=e=>e.status==="dirty",js=e=>e.status==="valid",uc=e=>typeof Promise<"u"&&e instanceof Promise});var iN=z(()=>{});var be,aN=z(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(be||(be={}))});function We(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,o)=>{let{message:u}=e;return s.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:u??r??o.defaultError}},description:i}}function uN(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function sW(e){return new RegExp(`^${uN(e)}$`)}function oW(e){let t=`${oN}T${uN(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function uW(e,t){return!!((t==="v4"||!t)&&X3.test(e)||(t==="v6"||!t)&&tW.test(e))}function lW(e,t){if(!H3.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function cW(e,t){return!!((t==="v4"||!t)&&eW.test(e)||(t==="v6"||!t)&&rW.test(e))}function dW(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}function qo(e){if(e instanceof jn){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ki.create(qo(n))}return new jn({...e._def,shape:()=>t})}else return e instanceof Ha?new Ha({...e._def,type:qo(e.element)}):e instanceof ki?ki.create(qo(e.unwrap())):e instanceof ga?ga.create(qo(e.unwrap())):e instanceof ha?ha.create(e.items.map(t=>qo(t))):e}function P_(e,t){let r=pa(e),n=pa(t);if(e===t)return{valid:!0,data:e};if(r===ce.object&&n===ce.object){let i=ft.objectKeys(t),a=ft.objectKeys(e).filter(o=>i.indexOf(o)!==-1),s={...e,...t};for(let o of a){let u=P_(e[o],t[o]);if(!u.valid)return{valid:!1};s[o]=u.data}return{valid:!0,data:s}}else if(r===ce.array&&n===ce.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let s=e[a],o=t[a],u=P_(s,o);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ce.date&&n===ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function lN(e,t){return new Jo({values:e,typeName:te.ZodEnum,...We(t)})}var Gn,sN,et,V3,W3,B3,G3,K3,H3,J3,Y3,Q3,$_,X3,eW,tW,rW,nW,iW,oN,aW,Fo,lc,cc,dc,fc,pc,Vo,Wo,mc,Ka,Ji,hc,Ha,jn,Bo,ma,E_,Go,ha,T_,gc,vc,O_,Ko,Ho,Jo,Yo,As,Si,ki,ga,Qo,Xo,yc,em,tm,eu,Aye,te,Rye,Dye,Uye,Mye,Lye,Zye,qye,Fye,Vye,Wye,Bye,Gye,Kye,Hye,fW,Jye,Yye,Qye,Xye,e_e,t_e,r_e,n_e,i_e,a_e,s_e,o_e,u_e,l_e,c_e,d_e,f_e,p_e,m_e,cN=z(()=>{Yp();Qp();aN();I_();sc();Gn=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},sN=(e,t)=>{if(js(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Cn(e.common.issues);return this._error=r,this._error}}};et=class{get description(){return this._def.description}_getType(t){return pa(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ur,ctx:{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(uc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},i=this._parseSync({data:t,path:n.path,parent:n});return sN(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return js(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>js(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(uc(i)?i:Promise.resolve(i));return sN(n,a)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let s=t(i),o=()=>a.addIssue({code:Q.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Si({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return ki.create(this,this._def)}nullable(){return ga.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return As.create(this,this._def)}or(t){return Bo.create([this,t],this._def)}and(t){return Go.create(this,t,this._def)}transform(t){return new Si({...We(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Qo({...We(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new em({typeName:te.ZodBranded,type:this,...We(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xo({...We(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return tm.create(this,t)}readonly(){return eu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},V3=/^c[^\s-]{8,}$/i,W3=/^[0-9a-z]+$/,B3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,G3=/^[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,K3=/^[a-z0-9_-]{21}$/i,H3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,J3=/^[-+]?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)?)??$/,Y3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Q3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",X3=/^(?:(?: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])$/,eW=/^(?:(?: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])$/,tW=/^(([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]))$/,rW=/^(([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])$/,nW=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iW=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oN="((\\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])))",aW=new RegExp(`^${oN}$`);Fo=class e extends et{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ce.string){let a=this._getOrReturnCtx(t);return oe(a,{code:Q.invalid_type,expected:ce.string,received:a.parsedType}),ze}let n=new Ur,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let s=t.data.length>a.value,o=t.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(t,i),s?oe(i,{code:Q.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&oe(i,{code:Q.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Y3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")$_||($_=new RegExp(Q3,"u")),$_.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")G3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")K3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"nanoid",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")V3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")W3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")B3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:Q.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:Q.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:Q.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?oW(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?aW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?sW(a).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?J3.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"duration",code:Q.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?uW(t.data,a.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:Q.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?lW(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"jwt",code:Q.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?cW(t.data,a.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cidr",code:Q.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?nW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"base64",code:Q.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?iW.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"base64url",code:Q.invalid_string,message:a.message}),n.dirty()):ft.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:Q.invalid_string,...be.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...be.errToObj(t)})}url(t){return this._addCheck({kind:"url",...be.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...be.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...be.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...be.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...be.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...be.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...be.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...be.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...be.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...be.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...be.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...be.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...be.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...be.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...be.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...be.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...be.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...be.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...be.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...be.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...be.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...be.errToObj(r)})}nonempty(t){return this.min(1,be.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Fo.create=e=>new Fo({checks:[],typeName:te.ZodString,coerce:e?.coerce??!1,...We(e)});lc=class e extends et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ce.number){let a=this._getOrReturnCtx(t);return oe(a,{code:Q.invalid_type,expected:ce.number,received:a.parsedType}),ze}let n,i=new Ur;for(let a of this._def.checks)a.kind==="int"?ft.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?dW(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.not_finite,message:a.message}),i.dirty()):ft.assertNever(a);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,be.toString(r))}gt(t,r){return this.setLimit("min",t,!1,be.toString(r))}lte(t,r){return this.setLimit("max",t,!0,be.toString(r))}lt(t,r){return this.setLimit("max",t,!1,be.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:be.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:be.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:be.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:be.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:be.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:be.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:be.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ft.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};lc.create=e=>new lc({checks:[],typeName:te.ZodNumber,coerce:e?.coerce||!1,...We(e)});cc=class e extends et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ce.bigint)return this._getInvalidInput(t);let n,i=new Ur;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Q.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):ft.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return oe(r,{code:Q.invalid_type,expected:ce.bigint,received:r.parsedType}),ze}gte(t,r){return this.setLimit("min",t,!0,be.toString(r))}gt(t,r){return this.setLimit("min",t,!1,be.toString(r))}lte(t,r){return this.setLimit("max",t,!0,be.toString(r))}lt(t,r){return this.setLimit("max",t,!1,be.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:be.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:be.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:be.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:be.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:be.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:be.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};cc.create=e=>new cc({checks:[],typeName:te.ZodBigInt,coerce:e?.coerce??!1,...We(e)});dc=class extends et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ce.boolean){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.boolean,received:n.parsedType}),ze}return Qr(t.data)}};dc.create=e=>new dc({typeName:te.ZodBoolean,coerce:e?.coerce||!1,...We(e)});fc=class e extends et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ce.date){let a=this._getOrReturnCtx(t);return oe(a,{code:Q.invalid_type,expected:ce.date,received:a.parsedType}),ze}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return oe(a,{code:Q.invalid_date}),ze}let n=new Ur,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Q.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ft.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:be.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:be.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};fc.create=e=>new fc({checks:[],coerce:e?.coerce||!1,typeName:te.ZodDate,...We(e)});pc=class extends et{_parse(t){if(this._getType(t)!==ce.symbol){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.symbol,received:n.parsedType}),ze}return Qr(t.data)}};pc.create=e=>new pc({typeName:te.ZodSymbol,...We(e)});Vo=class extends et{_parse(t){if(this._getType(t)!==ce.undefined){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.undefined,received:n.parsedType}),ze}return Qr(t.data)}};Vo.create=e=>new Vo({typeName:te.ZodUndefined,...We(e)});Wo=class extends et{_parse(t){if(this._getType(t)!==ce.null){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.null,received:n.parsedType}),ze}return Qr(t.data)}};Wo.create=e=>new Wo({typeName:te.ZodNull,...We(e)});mc=class extends et{constructor(){super(...arguments),this._any=!0}_parse(t){return Qr(t.data)}};mc.create=e=>new mc({typeName:te.ZodAny,...We(e)});Ka=class extends et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Qr(t.data)}};Ka.create=e=>new Ka({typeName:te.ZodUnknown,...We(e)});Ji=class extends et{_parse(t){let r=this._getOrReturnCtx(t);return oe(r,{code:Q.invalid_type,expected:ce.never,received:r.parsedType}),ze}};Ji.create=e=>new Ji({typeName:te.ZodNever,...We(e)});hc=class extends et{_parse(t){if(this._getType(t)!==ce.undefined){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.void,received:n.parsedType}),ze}return Qr(t.data)}};hc.create=e=>new hc({typeName:te.ZodVoid,...We(e)});Ha=class e extends et{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ce.array)return oe(r,{code:Q.invalid_type,expected:ce.array,received:r.parsedType}),ze;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(oe(r,{code:s?Q.too_big:Q.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(oe(r,{code:Q.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(oe(r,{code:Q.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new Gn(r,s,r.path,o)))).then(s=>Ur.mergeArray(n,s));let a=[...r.data].map((s,o)=>i.type._parseSync(new Gn(r,s,r.path,o)));return Ur.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:be.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:be.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:be.toString(r)}})}nonempty(t){return this.min(1,t)}};Ha.create=(e,t)=>new Ha({type:e,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...We(t)});jn=class e extends et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=ft.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ce.object){let l=this._getOrReturnCtx(t);return oe(l,{code:Q.invalid_type,expected:ce.object,received:l.parsedType}),ze}let{status:n,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ji&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||o.push(l);let u=[];for(let l of s){let c=a[l],d=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Gn(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ji){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of o)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")o.length>0&&(oe(i,{code:Q.unrecognized_keys,keys:o}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of o){let d=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Gn(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let d=await c.key,f=await c.value;l.push({key:d,value:f,alwaysSet:c.alwaysSet})}return l}).then(l=>Ur.mergeObjectSync(n,l)):Ur.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return be.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:be.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:te.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of ft.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of ft.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return qo(this)}partial(t){let r={};for(let n of ft.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of ft.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof ki;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return lN(ft.objectKeys(this.shape))}};jn.create=(e,t)=>new jn({shape:()=>e,unknownKeys:"strip",catchall:Ji.create(),typeName:te.ZodObject,...We(t)});jn.strictCreate=(e,t)=>new jn({shape:()=>e,unknownKeys:"strict",catchall:Ji.create(),typeName:te.ZodObject,...We(t)});jn.lazycreate=(e,t)=>new jn({shape:e,unknownKeys:"strip",catchall:Ji.create(),typeName:te.ZodObject,...We(t)});Bo=class extends et{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new Cn(o.ctx.common.issues));return oe(r,{code:Q.invalid_union,unionErrors:s}),ze}if(r.common.async)return Promise.all(n.map(async a=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(u=>new Cn(u));return oe(r,{code:Q.invalid_union,unionErrors:o}),ze}}get options(){return this._def.options}};Bo.create=(e,t)=>new Bo({options:e,typeName:te.ZodUnion,...We(t)});ma=e=>e instanceof Ko?ma(e.schema):e instanceof Si?ma(e.innerType()):e instanceof Ho?[e.value]:e instanceof Jo?e.options:e instanceof Yo?ft.objectValues(e.enum):e instanceof Qo?ma(e._def.innerType):e instanceof Vo?[void 0]:e instanceof Wo?[null]:e instanceof ki?[void 0,...ma(e.unwrap())]:e instanceof ga?[null,...ma(e.unwrap())]:e instanceof em||e instanceof eu?ma(e.unwrap()):e instanceof Xo?ma(e._def.innerType):[],E_=class e extends et{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.object)return oe(r,{code:Q.invalid_type,expected:ce.object,received:r.parsedType}),ze;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(oe(r,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let a of r){let s=ma(a.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of s){if(i.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);i.set(o,a)}}return new e({typeName:te.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...We(n)})}};Go=class extends et{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{if(k_(a)||k_(s))return ze;let o=P_(a.value,s.value);return o.valid?((S_(a)||S_(s))&&r.dirty(),{status:r.value,value:o.data}):(oe(n,{code:Q.invalid_intersection_types}),ze)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Go.create=(e,t,r)=>new Go({left:e,right:t,typeName:te.ZodIntersection,...We(r)});ha=class e extends et{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.array)return oe(n,{code:Q.invalid_type,expected:ce.array,received:n.parsedType}),ze;if(n.data.length<this._def.items.length)return oe(n,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&n.data.length>this._def.items.length&&(oe(n,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((s,o)=>{let u=this._def.items[o]||this._def.rest;return u?u._parse(new Gn(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>Ur.mergeArray(r,s)):Ur.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ha.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ha({items:e,typeName:te.ZodTuple,rest:null,...We(t)})};T_=class e extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.object)return oe(n,{code:Q.invalid_type,expected:ce.object,received:n.parsedType}),ze;let i=[],a=this._def.keyType,s=this._def.valueType;for(let o in n.data)i.push({key:a._parse(new Gn(n,o,n.path,o)),value:s._parse(new Gn(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Ur.mergeObjectAsync(r,i):Ur.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof et?new e({keyType:t,valueType:r,typeName:te.ZodRecord,...We(n)}):new e({keyType:Fo.create(),valueType:t,typeName:te.ZodRecord,...We(r)})}},gc=class extends et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.map)return oe(n,{code:Q.invalid_type,expected:ce.map,received:n.parsedType}),ze;let i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,u],l)=>({key:i._parse(new Gn(n,o,n.path,[l,"key"])),value:a._parse(new Gn(n,u,n.path,[l,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return ze;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(l.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return ze;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(l.value,c.value)}return{status:r.value,value:o}}}};gc.create=(e,t,r)=>new gc({valueType:t,keyType:e,typeName:te.ZodMap,...We(r)});vc=class e extends et{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.set)return oe(n,{code:Q.invalid_type,expected:ce.set,received:n.parsedType}),ze;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(oe(n,{code:Q.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(oe(n,{code:Q.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return ze;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let o=[...n.data.values()].map((u,l)=>a._parse(new Gn(n,u,n.path,l)));return n.common.async?Promise.all(o).then(u=>s(u)):s(o)}min(t,r){return new e({...this._def,minSize:{value:t,message:be.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:be.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};vc.create=(e,t)=>new vc({valueType:e,minSize:null,maxSize:null,typeName:te.ZodSet,...We(t)});O_=class e extends et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.function)return oe(r,{code:Q.invalid_type,expected:ce.function,received:r.parsedType}),ze;function n(o,u){return Xp({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oc(),Ga].filter(l=>!!l),issueData:{code:Q.invalid_arguments,argumentsError:u}})}function i(o,u){return Xp({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oc(),Ga].filter(l=>!!l),issueData:{code:Q.invalid_return_type,returnTypeError:u}})}let a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof As){let o=this;return Qr(async function(...u){let l=new Cn([]),c=await o._def.args.parseAsync(u,a).catch(p=>{throw l.addIssue(n(u,p)),l}),d=await Reflect.apply(s,this,c);return await o._def.returns._def.type.parseAsync(d,a).catch(p=>{throw l.addIssue(i(d,p)),l})})}else{let o=this;return Qr(function(...u){let l=o._def.args.safeParse(u,a);if(!l.success)throw new Cn([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),d=o._def.returns.safeParse(c,a);if(!d.success)throw new Cn([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ha.create(t).rest(Ka.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ha.create([]).rest(Ka.create()),returns:r||Ka.create(),typeName:te.ZodFunction,...We(n)})}},Ko=class extends et{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ko.create=(e,t)=>new Ko({getter:e,typeName:te.ZodLazy,...We(t)});Ho=class extends et{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:Q.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ho.create=(e,t)=>new Ho({value:e,typeName:te.ZodLiteral,...We(t)});Jo=class e extends et{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:ft.joinValues(n),received:r.parsedType,code:Q.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:Q.invalid_enum_value,options:n}),ze}return Qr(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Jo.create=lN;Yo=class extends et{_parse(t){let r=ft.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ce.string&&n.parsedType!==ce.number){let i=ft.objectValues(r);return oe(n,{expected:ft.joinValues(i),received:n.parsedType,code:Q.invalid_type}),ze}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=ft.objectValues(r);return oe(n,{received:n.data,code:Q.invalid_enum_value,options:i}),ze}return Qr(t.data)}get enum(){return this._def.values}};Yo.create=(e,t)=>new Yo({values:e,typeName:te.ZodNativeEnum,...We(t)});As=class extends et{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.promise&&r.common.async===!1)return oe(r,{code:Q.invalid_type,expected:ce.promise,received:r.parsedType}),ze;let n=r.parsedType===ce.promise?r.data:Promise.resolve(r.data);return Qr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};As.create=(e,t)=>new As({type:e,typeName:te.ZodPromise,...We(t)});Si=class extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:s=>{oe(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async o=>{if(r.value==="aborted")return ze;let u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?ze:u.status==="dirty"?Zo(u.value):r.value==="dirty"?Zo(u.value):u});{if(r.value==="aborted")return ze;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?ze:o.status==="dirty"?Zo(o.value):r.value==="dirty"?Zo(o.value):o}}if(i.type==="refinement"){let s=o=>{let u=i.refinement(o,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ze:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?ze:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!js(s))return ze;let o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>js(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):ze);ft.assertNever(i)}};Si.create=(e,t,r)=>new Si({schema:e,typeName:te.ZodEffects,effect:t,...We(r)});Si.createWithPreprocess=(e,t,r)=>new Si({schema:t,effect:{type:"preprocess",transform:e},typeName:te.ZodEffects,...We(r)});ki=class extends et{_parse(t){return this._getType(t)===ce.undefined?Qr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ki.create=(e,t)=>new ki({innerType:e,typeName:te.ZodOptional,...We(t)});ga=class extends et{_parse(t){return this._getType(t)===ce.null?Qr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ga.create=(e,t)=>new ga({innerType:e,typeName:te.ZodNullable,...We(t)});Qo=class extends et{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Qo.create=(e,t)=>new Qo({innerType:e,typeName:te.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...We(t)});Xo=class extends et{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return uc(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Cn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xo.create=(e,t)=>new Xo({innerType:e,typeName:te.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...We(t)});yc=class extends et{_parse(t){if(this._getType(t)!==ce.nan){let n=this._getOrReturnCtx(t);return oe(n,{code:Q.invalid_type,expected:ce.nan,received:n.parsedType}),ze}return{status:"valid",value:t.data}}};yc.create=e=>new yc({typeName:te.ZodNaN,...We(e)});em=class extends et{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},tm=class e extends et{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ze:a.status==="dirty"?(r.dirty(),Zo(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ze:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:te.ZodPipeline})}},eu=class extends et{_parse(t){let r=this._def.innerType._parse(t),n=i=>(js(i)&&(i.value=Object.freeze(i.value)),i);return uc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};eu.create=(e,t)=>new eu({innerType:e,typeName:te.ZodReadonly,...We(t)});Aye={object:jn.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(te||(te={}));Rye=Fo.create,Dye=lc.create,Uye=yc.create,Mye=cc.create,Lye=dc.create,Zye=fc.create,qye=pc.create,Fye=Vo.create,Vye=Wo.create,Wye=mc.create,Bye=Ka.create,Gye=Ji.create,Kye=hc.create,Hye=Ha.create,fW=jn.create,Jye=jn.strictCreate,Yye=Bo.create,Qye=E_.create,Xye=Go.create,e_e=ha.create,t_e=T_.create,r_e=gc.create,n_e=vc.create,i_e=O_.create,a_e=Ko.create,s_e=Ho.create,o_e=Jo.create,u_e=Yo.create,l_e=As.create,c_e=Si.create,d_e=ki.create,f_e=ga.create,p_e=Si.createWithPreprocess,m_e=tm.create});var N_=z(()=>{Qp();I_();iN();sc();cN();Yp()});var _c=z(()=>{N_();N_()});function Jt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?ac(t,e.currentPath):t.join("/")}}var Kn=z(()=>{Jp()});function z_(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==te.ZodAny&&(r.items=Te(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&dt(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&dt(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(dt(r,"minItems",e.exactLength.value,e.exactLength.message,t),dt(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}var C_=z(()=>{_c();Ba();mr()});function j_(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?dt(r,"minimum",n.value,n.message,t):dt(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),dt(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?dt(r,"maximum",n.value,n.message,t):dt(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),dt(r,"maximum",n.value,n.message,t));break;case"multipleOf":dt(r,"multipleOf",n.value,n.message,t);break}return r}var A_=z(()=>{Ba()});function R_(){return{type:"boolean"}}var D_=z(()=>{});function bc(e,t){return Te(e.type._def,t)}var rm=z(()=>{mr()});var U_,M_=z(()=>{mr();U_=(e,t)=>Te(e.innerType._def,t)});function nm(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,a)=>nm(e,t,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return hW(e,t)}}var hW,L_=z(()=>{Ba();hW=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":dt(r,"minimum",n.value,n.message,t);break;case"max":dt(r,"maximum",n.value,n.message,t);break}return r}});function Z_(e,t){return{...Te(e.innerType._def,t),default:e.defaultValue()}}var q_=z(()=>{mr()});function F_(e,t){return t.effectStrategy==="input"?Te(e.schema._def,t):Jt(t)}var V_=z(()=>{mr();Kn()});function W_(e){return{type:"string",enum:Array.from(e.values)}}var B_=z(()=>{});function G_(e,t){let r=[Te(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Te(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(a=>{if(gW(a))i.push(...a.allOf),a.unevaluatedProperties===void 0&&(n=void 0);else{let s=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:o,...u}=a;s=u}else n=void 0;i.push(s)}}),i.length?{allOf:i,...n}:void 0}var gW,K_=z(()=>{mr();gW=e=>"type"in e&&e.type==="string"?!1:"allOf"in e});function H_(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var J_=z(()=>{});function wc(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":dt(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":dt(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Ii(r,"email",n.message,t);break;case"format:idn-email":Ii(r,"idn-email",n.message,t);break;case"pattern:zod":Xr(r,Hn.email,n.message,t);break}break;case"url":Ii(r,"uri",n.message,t);break;case"uuid":Ii(r,"uuid",n.message,t);break;case"regex":Xr(r,n.regex,n.message,t);break;case"cuid":Xr(r,Hn.cuid,n.message,t);break;case"cuid2":Xr(r,Hn.cuid2,n.message,t);break;case"startsWith":Xr(r,RegExp(`^${Q_(n.value,t)}`),n.message,t);break;case"endsWith":Xr(r,RegExp(`${Q_(n.value,t)}$`),n.message,t);break;case"datetime":Ii(r,"date-time",n.message,t);break;case"date":Ii(r,"date",n.message,t);break;case"time":Ii(r,"time",n.message,t);break;case"duration":Ii(r,"duration",n.message,t);break;case"length":dt(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),dt(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":{Xr(r,RegExp(Q_(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Ii(r,"ipv4",n.message,t),n.version!=="v4"&&Ii(r,"ipv6",n.message,t);break}case"base64url":Xr(r,Hn.base64url,n.message,t);break;case"jwt":Xr(r,Hn.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Xr(r,Hn.ipv4Cidr,n.message,t),n.version!=="v4"&&Xr(r,Hn.ipv6Cidr,n.message,t);break}case"emoji":Xr(r,Hn.emoji(),n.message,t);break;case"ulid":{Xr(r,Hn.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Ii(r,"binary",n.message,t);break}case"contentEncoding:base64":{dt(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{Xr(r,Hn.base64,n.message,t);break}}break}case"nanoid":Xr(r,Hn.nanoid,n.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Q_(e,t){return t.patternStrategy==="escape"?yW(e):e}function yW(e){let t="";for(let r=0;r<e.length;r++)vW.has(e[r])||(t+="\\"),t+=e[r];return t}function Ii(e,t,r,n){e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):dt(e,"format",t,r,n)}function Xr(e,t,r,n){e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:dN(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):dt(e,"pattern",dN(t,n),r,n)}function dN(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,i="",a=!1,s=!1,o=!1;for(let u=0;u<n.length;u++){if(a){i+=n[u],a=!1;continue}if(r.i){if(s){if(n[u].match(/[a-z]/)){o?(i+=n[u],i+=`${n[u-2]}-${n[u]}`.toUpperCase(),o=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(i+=n[u],o=!0):i+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){i+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(r.m){if(n[u]==="^"){i+=`(^|(?<=[\r
18
+ ]))`;continue}else if(n[u]==="$"){i+=`($|(?=[\r
19
+ ]))`;continue}}if(r.s&&n[u]==="."){i+=s?`${n[u]}\r
20
+ `:`[${n[u]}\r
21
+ ]`;continue}i+=n[u],n[u]==="\\"?a=!0:s&&n[u]==="]"?s=!1:!s&&n[u]==="["&&(s=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}var Y_,Hn,vW,im=z(()=>{Ba();Hn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Y_===void 0&&(Y_=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Y_),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};vW=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function xc(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===te.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,i)=>({...n,[i]:Te(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??Jt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Te(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===te.ZodString&&e.keyType._def.checks?.length){let{type:n,...i}=wc(e.keyType._def,t);return{...r,propertyNames:i}}else{if(e.keyType?._def.typeName===te.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===te.ZodBranded&&e.keyType._def.type._def.typeName===te.ZodString&&e.keyType._def.type._def.checks?.length){let{type:n,...i}=bc(e.keyType._def,t);return{...r,propertyNames:i}}}return r}var am=z(()=>{_c();mr();im();rm();Kn()});function X_(e,t){if(t.mapStrategy==="record")return xc(e,t);let r=Te(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Jt(t),n=Te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Jt(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var eb=z(()=>{mr();am();Kn()});function tb(e){let t=e.values,n=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),i=Array.from(new Set(n.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}var rb=z(()=>{});function nb(e){return e.target==="openAi"?void 0:{not:Jt({...e,currentPath:[...e.currentPath,"not"]})}}var ib=z(()=>{Kn()});function ab(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var sb=z(()=>{});function ob(e,t){if(t.target==="openApi3")return fN(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in tu&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,a)=>{let s=tu[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,a)=>{let s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((a,s,o)=>o.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:r.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(a=>!n.includes(a))],[])};return fN(e,t)}var tu,fN,sm=z(()=>{mr();tu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};fN=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,i)=>Te(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function ub(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:tu[e.innerType._def.typeName],nullable:!0}:{type:[tu[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=Te(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var lb=z(()=>{mr();sm()});function cb(e,t){let r={type:"number"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"int":r.type="integer",Hp(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?dt(r,"minimum",n.value,n.message,t):dt(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),dt(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?dt(r,"maximum",n.value,n.message,t):dt(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),dt(r,"maximum",n.value,n.message,t));break;case"multipleOf":dt(r,"multipleOf",n.value,n.message,t);break}return r}var db=z(()=>{Ba()});function fb(e,t){let r=t.target==="openAi",n={type:"object",properties:{}},i=[],a=e.shape();for(let o in a){let u=a[o];if(u===void 0||u._def===void 0)continue;let l=bW(u);l&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),l=!1);let c=Te(u._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});c!==void 0&&(n.properties[o]=c,l||i.push(o))}i.length&&(n.required=i);let s=_W(e,t);return s!==void 0&&(n.additionalProperties=s),n}function _W(e,t){if(e.catchall._def.typeName!=="ZodNever")return Te(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function bW(e){try{return e.isOptional()}catch{return!0}}var pb=z(()=>{mr()});var mb,hb=z(()=>{mr();Kn();mb=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return Te(e.innerType._def,t);let r=Te(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Jt(t)},r]}:Jt(t)}});var gb,vb=z(()=>{mr();gb=(e,t)=>{if(t.pipeStrategy==="input")return Te(e.in._def,t);if(t.pipeStrategy==="output")return Te(e.out._def,t);let r=Te(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=Te(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}}});function yb(e,t){return Te(e.type._def,t)}var _b=z(()=>{mr()});function bb(e,t){let n={type:"array",uniqueItems:!0,items:Te(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&dt(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&dt(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}var wb=z(()=>{Ba();mr()});function xb(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>Te(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Te(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>Te(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var kb=z(()=>{mr()});function Sb(e){return{not:Jt(e)}}var Ib=z(()=>{Kn()});function $b(e){return Jt(e)}var Eb=z(()=>{Kn()});var Pb,Tb=z(()=>{mr();Pb=(e,t)=>Te(e.innerType._def,t)});var Ob,Nb=z(()=>{_c();Kn();C_();A_();D_();rm();M_();L_();q_();V_();B_();K_();J_();eb();rb();ib();sb();lb();db();pb();hb();vb();_b();am();wb();im();kb();Ib();sm();Eb();Tb();Ob=(e,t,r)=>{switch(t){case te.ZodString:return wc(e,r);case te.ZodNumber:return cb(e,r);case te.ZodObject:return fb(e,r);case te.ZodBigInt:return j_(e,r);case te.ZodBoolean:return R_();case te.ZodDate:return nm(e,r);case te.ZodUndefined:return Sb(r);case te.ZodNull:return ab(r);case te.ZodArray:return z_(e,r);case te.ZodUnion:case te.ZodDiscriminatedUnion:return ob(e,r);case te.ZodIntersection:return G_(e,r);case te.ZodTuple:return xb(e,r);case te.ZodRecord:return xc(e,r);case te.ZodLiteral:return H_(e,r);case te.ZodEnum:return W_(e);case te.ZodNativeEnum:return tb(e);case te.ZodNullable:return ub(e,r);case te.ZodOptional:return mb(e,r);case te.ZodMap:return X_(e,r);case te.ZodSet:return bb(e,r);case te.ZodLazy:return()=>e.getter()._def;case te.ZodPromise:return yb(e,r);case te.ZodNaN:case te.ZodNever:return nb(r);case te.ZodEffects:return F_(e,r);case te.ZodAny:return Jt(r);case te.ZodUnknown:return $b(r);case te.ZodDefault:return Z_(e,r);case te.ZodBranded:return bc(e,r);case te.ZodReadonly:return Pb(e,r);case te.ZodCatch:return U_(e,r);case te.ZodPipeline:return gb(e,r);case te.ZodFunction:case te.ZodVoid:case te.ZodSymbol:return;default:return(n=>{})(t)}}});function Te(e,t,r=!1){let n=t.seen.get(e);if(t.override){let o=t.override?.(e,t,n,r);if(o!==y_)return o}if(n&&!r){let o=wW(n,t);if(o!==void 0)return o}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=Ob(e,e.typeName,t),s=typeof a=="function"?Te(a(),t):a;if(s&&xW(e,t,s),t.postProcess){let o=t.postProcess(s,e,t);return i.jsonSchema=s,o}return i.jsonSchema=s,s}var wW,xW,mr=z(()=>{Kp();Nb();Jp();Kn();wW=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:ac(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Jt(t)):t.$refStrategy==="seen"?Jt(t):void 0}},xW=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r)});var pN=z(()=>{});var en,zb=z(()=>{mr();w_();Kn();en=(e,t)=>{let r=b_(t),n=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[l,c])=>({...u,[l]:Te(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??Jt(r)}),{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,a=Te(e._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??Jt(r),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(a.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let o=i===void 0?n?{...a,[r.definitionPath]:n}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:a}};return r.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o}});var mN={};fa(mN,{addErrorMessage:()=>Hp,default:()=>kW,defaultOptions:()=>v_,getDefaultOptions:()=>__,getRefs:()=>b_,getRelativePath:()=>ac,ignoreOverride:()=>y_,jsonDescription:()=>Z3,parseAnyDef:()=>Jt,parseArrayDef:()=>z_,parseBigintDef:()=>j_,parseBooleanDef:()=>R_,parseBrandedDef:()=>bc,parseCatchDef:()=>U_,parseDateDef:()=>nm,parseDef:()=>Te,parseDefaultDef:()=>Z_,parseEffectsDef:()=>F_,parseEnumDef:()=>W_,parseIntersectionDef:()=>G_,parseLiteralDef:()=>H_,parseMapDef:()=>X_,parseNativeEnumDef:()=>tb,parseNeverDef:()=>nb,parseNullDef:()=>ab,parseNullableDef:()=>ub,parseNumberDef:()=>cb,parseObjectDef:()=>fb,parseOptionalDef:()=>mb,parsePipelineDef:()=>gb,parsePromiseDef:()=>yb,parseReadonlyDef:()=>Pb,parseRecordDef:()=>xc,parseSetDef:()=>bb,parseStringDef:()=>wc,parseTupleDef:()=>xb,parseUndefinedDef:()=>Sb,parseUnionDef:()=>ob,parseUnknownDef:()=>$b,primitiveMappings:()=>tu,selectParser:()=>Ob,setResponseValueAndErrors:()=>dt,zodPatterns:()=>Hn,zodToJsonSchema:()=>en});var kW,Ja=z(()=>{Kp();w_();Ba();Jp();mr();pN();Kn();C_();A_();D_();rm();M_();L_();q_();V_();B_();K_();J_();eb();rb();ib();sb();lb();db();pb();hb();vb();_b();Tb();am();wb();im();kb();Ib();sm();Eb();Nb();zb();zb();kW=en});var ru,Cb=z(()=>{Ja();ru=class{static generateFileOutputInstructions(t,r){let n;typeof t?.parse=="function"?n=en(t,{target:"openApi3"}):n=t;let i=this._buildExample(n);return`
22
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
23
+ \u{1F6A8} MANDATORY: WRITE RESULT TO FILE \u{1F6A8}
24
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
25
+ You MUST write your final result as pure JSON to this EXACT file path:
26
+
27
+ ${r}
28
+
29
+ Use your file writing tool (WriteFile or ApplyPatch) to create this file.
30
+ DO NOT just output JSON to stdout. The file MUST exist when you finish.
31
+ DO NOT skip this step. The workflow WILL FAIL if the file is missing.
32
+
33
+ Required JSON structure:
34
+ ${JSON.stringify(i,null,2)}
35
+
36
+ JSON types (strict \u2014 validators reject wrong types):
37
+ - Use bare JSON numbers for numeric fields (e.g. 3000). Do NOT quote them as strings (wrong: "3000").
38
+ - Use true/false without quotes for booleans.
39
+ - Use unquoted null where a field may be null.
40
+
41
+ Rules: valid JSON only, no markdown wrapping, no extra text in the file.`}static _buildExample(t){if(!t)return{};let r=t.type;if(r==="object"&&t.properties){let n={};for(let[i,a]of Object.entries(t.properties))n[i]=this._buildExample(a);return n}if(r==="array"&&t.items)return[this._buildExample(t.items)];if(r==="string")return"<string>";if(r==="number"||r==="integer")return 0;if(r==="boolean")return!1;if(t.description)return`<${t.description}>`;if(t.nullable||t.oneOf||t.anyOf){let n=t.oneOf?.find(i=>i.type!=="null")||t.anyOf?.find(i=>i.type!=="null");return n?this._buildExample(n):null}return"<value>"}}});function N(e,t,r){function n(o,u){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,u);let l=s.prototype,c=Object.keys(l);for(let d=0;d<c.length;d++){let f=c[d];f in o||(o[f]=l[f].bind(o))}}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function s(o){var u;let l=r?.Parent?new a:this;n(l,o),(u=l._zod).deferred??(u.deferred=[]);for(let c of l._zod.deferred)c();return l}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function yr(e){return e&&Object.assign(om,e),om}var hN,Yi,Rs,om,nu=z(()=>{hN=Object.freeze({status:"aborted"});Yi=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Rs=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},om={}});var X={};fa(X,{BIGINT_FORMAT_RANGES:()=>Fb,Class:()=>Ab,NUMBER_FORMAT_RANGES:()=>qb,aborted:()=>es,allowsEval:()=>Ub,assert:()=>PW,assertEqual:()=>SW,assertIs:()=>$W,assertNever:()=>EW,assertNotEqual:()=>IW,assignProp:()=>Qa,base64ToUint8Array:()=>kN,base64urlToUint8Array:()=>MW,cached:()=>au,captureStackTrace:()=>lm,cleanEnum:()=>UW,cleanRegex:()=>Ic,clone:()=>tn,cloneDef:()=>OW,createTransparentProxy:()=>RW,defineLazy:()=>Ge,esc:()=>um,escapeRegex:()=>Jn,extend:()=>_N,finalizeIssue:()=>_n,floatSafeRemainder:()=>Rb,getElementAtPath:()=>NW,getEnumValues:()=>Sc,getLengthableOrigin:()=>Pc,getParsedType:()=>AW,getSizableOrigin:()=>Ec,hexToUint8Array:()=>ZW,isObject:()=>Ds,isPlainObject:()=>Xa,issue:()=>su,joinValues:()=>Oe,jsonStringifyReplacer:()=>iu,merge:()=>DW,mergeDefs:()=>va,normalizeParams:()=>ue,nullish:()=>Ya,numKeys:()=>jW,objectClone:()=>TW,omit:()=>yN,optionalKeys:()=>Zb,parsedType:()=>Ce,partial:()=>wN,pick:()=>vN,prefixIssues:()=>An,primitiveTypes:()=>Lb,promiseAllObject:()=>zW,propertyKeyTypes:()=>$c,randomString:()=>CW,required:()=>xN,safeExtend:()=>bN,shallowClone:()=>Mb,slugify:()=>Db,stringifyPrimitive:()=>Ne,uint8ArrayToBase64:()=>SN,uint8ArrayToBase64url:()=>LW,uint8ArrayToHex:()=>qW,unwrapMessage:()=>kc});function SW(e){return e}function IW(e){return e}function $W(e){}function EW(e){throw new Error("Unexpected value in exhaustive check")}function PW(e){}function Sc(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Oe(e,t="|"){return e.map(r=>Ne(r)).join(t)}function iu(e,t){return typeof t=="bigint"?t.toString():t}function au(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ya(e){return e==null}function Ic(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Rb(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let u=n.match(/\d?e-(\d?)/);u?.[1]&&(i=Number.parseInt(u[1]))}let a=r>i?r:i,s=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return s%o/10**a}function Ge(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==gN)return n===void 0&&(n=gN,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function TW(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Qa(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function va(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function OW(e){return va(e._zod.def)}function NW(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function zW(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<t.length;a++)i[t[a]]=n[a];return i})}function CW(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function um(e){return JSON.stringify(e)}function Db(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ds(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Xa(e){if(Ds(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ds(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Mb(e){return Xa(e)?{...e}:Array.isArray(e)?[...e]:e}function jW(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Jn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tn(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function RW(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,a){return t??(t=e()),Reflect.set(t,n,i,a)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function Ne(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Zb(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vN(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=va(e._zod.def,{get shape(){let s={};for(let o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=r.shape[o])}return Qa(this,"shape",s),s},checks:[]});return tn(e,a)}function yN(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=va(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete s[o]}return Qa(this,"shape",s),s},checks:[]});return tn(e,a)}function _N(e,t){if(!Xa(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let a=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=va(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Qa(this,"shape",a),a}});return tn(e,i)}function bN(e,t){if(!Xa(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=va(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Qa(this,"shape",n),n}});return tn(e,r)}function DW(e,t){let r=va(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Qa(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return tn(e,r)}function wN(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=va(t._zod.def,{get shape(){let o=t._zod.def.shape,u={...o};if(r)for(let l in r){if(!(l in o))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:o[l]}):o[l])}else for(let l in o)u[l]=e?new e({type:"optional",innerType:o[l]}):o[l];return Qa(this,"shape",u),u},checks:[]});return tn(t,s)}function xN(e,t,r){let n=va(t._zod.def,{get shape(){let i=t._zod.def.shape,a={...i};if(r)for(let s in r){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(a[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(let s in i)a[s]=new e({type:"nonoptional",innerType:i[s]});return Qa(this,"shape",a),a}});return tn(t,n)}function es(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function An(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function kc(e){return typeof e=="string"?e:e?.message}function _n(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=kc(e.inst?._zod.def?.error?.(e))??kc(t?.error?.(e))??kc(r.customError?.(e))??kc(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Ec(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Pc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ce(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function su(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function UW(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function kN(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function SN(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function MW(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return kN(t+r)}function LW(e){return SN(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ZW(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function qW(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var gN,lm,Ub,AW,$c,Lb,qb,Fb,Ab,ke=z(()=>{gN=Symbol("evaluating");lm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Ub=au(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});AW=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},$c=new Set(["string","number","symbol"]),Lb=new Set(["string","number","bigint","boolean","symbol","undefined"]);qb={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Ab=class{constructor(...t){}}});function dm(e,t=r=>r.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function fm(e,t=r=>r.message){let r={_errors:[]},n=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>n({issues:s}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)r._errors.push(t(a));else{let s=r,o=0;for(;o<a.path.length;){let u=a.path[o];o===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(t(a))):s[u]=s[u]||{_errors:[]},s=s[u],o++}}};return n(e),r}var IN,cm,Tc,Vb=z(()=>{nu();ke();IN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,iu,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cm=N("$ZodError",IN),Tc=N("$ZodError",IN,{Parent:Error})});var Oc,Nc,zc,Cc,jc,ou,Ac,Rc,$N,EN,PN,TN,ON,NN,zN,CN,Wb=z(()=>{nu();Vb();ke();Oc=e=>(t,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new Yi;if(s.issues.length){let o=new(i?.Err??e)(s.issues.map(u=>_n(u,a,yr())));throw lm(o,i?.callee),o}return s.value},Nc=Oc(Tc),zc=e=>async(t,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let o=new(i?.Err??e)(s.issues.map(u=>_n(u,a,yr())));throw lm(o,i?.callee),o}return s.value},Cc=zc(Tc),jc=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Yi;return a.issues.length?{success:!1,error:new(e??cm)(a.issues.map(s=>_n(s,i,yr())))}:{success:!0,data:a.value}},ou=jc(Tc),Ac=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>_n(s,i,yr())))}:{success:!0,data:a.value}},Rc=Ac(Tc),$N=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Oc(e)(t,r,i)},EN=e=>(t,r,n)=>Oc(e)(t,r,n),PN=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zc(e)(t,r,i)},TN=e=>async(t,r,n)=>zc(e)(t,r,n),ON=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return jc(e)(t,r,i)},NN=e=>(t,r,n)=>jc(e)(t,r,n),zN=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ac(e)(t,r,i)},CN=e=>async(t,r,n)=>Ac(e)(t,r,n)});var Yn={};fa(Yn,{base64:()=>o0,base64url:()=>pm,bigint:()=>p0,boolean:()=>h0,browserEmail:()=>YW,cidrv4:()=>a0,cidrv6:()=>s0,cuid:()=>Bb,cuid2:()=>Gb,date:()=>l0,datetime:()=>d0,domain:()=>e5,duration:()=>Qb,e164:()=>u0,email:()=>e0,emoji:()=>t0,extendedDuration:()=>VW,guid:()=>Xb,hex:()=>t5,hostname:()=>XW,html5Email:()=>KW,idnEmail:()=>JW,integer:()=>m0,ipv4:()=>r0,ipv6:()=>n0,ksuid:()=>Jb,lowercase:()=>y0,mac:()=>i0,md5_base64:()=>n5,md5_base64url:()=>i5,md5_hex:()=>r5,nanoid:()=>Yb,null:()=>g0,number:()=>mm,rfc5322Email:()=>HW,sha1_base64:()=>s5,sha1_base64url:()=>o5,sha1_hex:()=>a5,sha256_base64:()=>l5,sha256_base64url:()=>c5,sha256_hex:()=>u5,sha384_base64:()=>f5,sha384_base64url:()=>p5,sha384_hex:()=>d5,sha512_base64:()=>h5,sha512_base64url:()=>g5,sha512_hex:()=>m5,string:()=>f0,time:()=>c0,ulid:()=>Kb,undefined:()=>v0,unicodeEmail:()=>jN,uppercase:()=>_0,uuid:()=>Us,uuid4:()=>WW,uuid6:()=>BW,uuid7:()=>GW,xid:()=>Hb});function t0(){return new RegExp(QW,"u")}function RN(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function c0(e){return new RegExp(`^${RN(e)}$`)}function d0(e){let t=RN({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${AN}T(?:${n})$`)}function Dc(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Uc(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Bb,Gb,Kb,Hb,Jb,Yb,Qb,VW,Xb,Us,WW,BW,GW,e0,KW,HW,jN,JW,YW,QW,r0,n0,i0,a0,s0,o0,pm,XW,e5,u0,AN,l0,f0,p0,m0,mm,h0,g0,v0,y0,_0,t5,r5,n5,i5,a5,s5,o5,u5,l5,c5,d5,f5,p5,m5,h5,g5,hm=z(()=>{ke();Bb=/^[cC][^\s-]{8,}$/,Gb=/^[0-9a-z]+$/,Kb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hb=/^[0-9a-vA-V]{20}$/,Jb=/^[A-Za-z0-9]{27}$/,Yb=/^[a-zA-Z0-9_-]{21}$/,Qb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VW=/^[-+]?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)?)??$/,Xb=/^([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})$/,Us=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,WW=Us(4),BW=Us(6),GW=Us(7),e0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KW=/^[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])?)*$/,HW=/^(([^<>()\[\]\\.,;:\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,}))$/,jN=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,JW=jN,YW=/^[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])?)*$/,QW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";r0=/^(?:(?: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])$/,n0=/^(([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}|:))$/,i0=e=>{let t=Jn(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},a0=/^((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])$/,s0=/^(([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])$/,o0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pm=/^[A-Za-z0-9_-]*$/,XW=/^(?=.{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])?)*\.?$/,e5=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,u0=/^\+[1-9]\d{6,14}$/,AN="(?:(?:\\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])))",l0=new RegExp(`^${AN}$`);f0=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},p0=/^-?\d+n?$/,m0=/^-?\d+$/,mm=/^-?\d+(?:\.\d+)?$/,h0=/^(?:true|false)$/i,g0=/^null$/i,v0=/^undefined$/i,y0=/^[^A-Z]*$/,_0=/^[^a-z]*$/,t5=/^[0-9a-fA-F]*$/;r5=/^[0-9a-fA-F]{32}$/,n5=Dc(22,"=="),i5=Uc(22),a5=/^[0-9a-fA-F]{40}$/,s5=Dc(27,"="),o5=Uc(27),u5=/^[0-9a-fA-F]{64}$/,l5=Dc(43,"="),c5=Uc(43),d5=/^[0-9a-fA-F]{96}$/,f5=Dc(64,""),p5=Uc(64),m5=/^[0-9a-fA-F]{128}$/,h5=Dc(86,"=="),g5=Uc(86)});function DN(e,t,r){e.issues.length&&t.issues.push(...An(r,e.issues))}var Mt,UN,b0,w0,MN,LN,ZN,qN,FN,VN,WN,BN,GN,Mc,KN,HN,JN,YN,QN,XN,ez,tz,rz,gm=z(()=>{nu();hm();ke();Mt=N("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),UN={number:"number",bigint:"bigint",object:"date"},b0=N("$ZodCheckLessThan",(e,t)=>{Mt.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),w0=N("$ZodCheckGreaterThan",(e,t)=>{Mt.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),MN=N("$ZodCheckMultipleOf",(e,t)=>{Mt.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Rb(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),LN=N("$ZodCheckNumberFormat",(e,t)=>{Mt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=qb[t.format];e._zod.onattach.push(s=>{let o=s._zod.bag;o.format=t.format,o.minimum=i,o.maximum=a,r&&(o.pattern=m0)}),e._zod.check=s=>{let o=s.value;if(r){if(!Number.isInteger(o)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}o<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ZN=N("$ZodCheckBigIntFormat",(e,t)=>{Mt.init(e,t);let[r,n]=Fb[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=r,a.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),qN=N("$ZodCheckMaxSize",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;i.size<=t.maximum||n.issues.push({origin:Ec(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),FN=N("$ZodCheckMinSize",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;i.size>=t.minimum||n.issues.push({origin:Ec(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),VN=N("$ZodCheckSizeEquals",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=n=>{let i=n.value,a=i.size;if(a===t.size)return;let s=a>t.size;n.issues.push({origin:Ec(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),WN=N("$ZodCheckMaxLength",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;if(i.length<=t.maximum)return;let s=Pc(i);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),BN=N("$ZodCheckMinLength",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let s=Pc(i);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),GN=N("$ZodCheckLengthEquals",(e,t)=>{var r;Mt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Ya(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{let i=n.value,a=i.length;if(a===t.length)return;let s=Pc(i),o=a>t.length;n.issues.push({origin:s,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mc=N("$ZodCheckStringFormat",(e,t)=>{var r,n;Mt.init(e,t),e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),KN=N("$ZodCheckRegex",(e,t)=>{Mc.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),HN=N("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=y0),Mc.init(e,t)}),JN=N("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_0),Mc.init(e,t)}),YN=N("$ZodCheckIncludes",(e,t)=>{Mt.init(e,t);let r=Jn(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),QN=N("$ZodCheckStartsWith",(e,t)=>{Mt.init(e,t);let r=new RegExp(`^${Jn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),XN=N("$ZodCheckEndsWith",(e,t)=>{Mt.init(e,t);let r=new RegExp(`.*${Jn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});ez=N("$ZodCheckProperty",(e,t)=>{Mt.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>DN(i,r,t.property));DN(n,r,t.property)}}),tz=N("$ZodCheckMimeType",(e,t)=>{Mt.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),rz=N("$ZodCheckOverwrite",(e,t)=>{Mt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var vm,x0=z(()=>{vm=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
42
+ `).filter(s=>s),i=Math.min(...n.map(s=>s.length-s.trimStart().length)),a=n.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of a)this.content.push(s)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...r,i.join(`
43
+ `))}}});var iz,k0=z(()=>{iz={major:4,minor:3,patch:6}});function gz(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function v5(e){if(!pm.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return gz(r)}function y5(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}function az(e,t,r){e.issues.length&&t.issues.push(...An(r,e.issues)),t.value[r]=e.value}function xm(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...An(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function vz(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Zb(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function yz(e,t,r,n,i,a){let s=[],o=i.keySet,u=i.catchall._zod,l=u.def.type,c=u.optout==="optional";for(let d in t){if(o.has(d))continue;if(l==="never"){s.push(d);continue}let f=u.run({value:t[d],issues:[]},n);f instanceof Promise?e.push(f.then(p=>xm(p,r,d,t,c))):xm(f,r,d,t,c)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}function sz(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let i=e.filter(a=>!es(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(s=>_n(s,n,yr())))}),t)}function oz(e,t,r,n){let i=e.filter(a=>a.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(s=>_n(s,n,yr())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function S0(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Xa(e)&&Xa(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),i={...e,...t};for(let a of n){let s=S0(e[a],t[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n],s=S0(i,a);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function uz(e,t,r){let n=new Map,i;for(let o of t.issues)if(o.code==="unrecognized_keys"){i??(i=o);for(let u of o.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(o);for(let o of r.issues)if(o.code==="unrecognized_keys")for(let u of o.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(o);let a=[...n].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(a.length&&i&&e.issues.push({...i,keys:a}),es(e))return e;let s=S0(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}function ym(e,t,r){e.issues.length&&t.issues.push(...An(r,e.issues)),t.value[r]=e.value}function lz(e,t,r,n,i,a,s){e.issues.length&&($c.has(typeof n)?r.issues.push(...An(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:e.issues.map(o=>_n(o,s,yr()))})),t.issues.length&&($c.has(typeof n)?r.issues.push(...An(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:t.issues.map(o=>_n(o,s,yr()))})),r.value.set(e.value,t.value)}function cz(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function dz(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}function fz(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function pz(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function _m(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function bm(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(a=>wm(e,a,t.out,r)):wm(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(a=>wm(e,a,t.in,r)):wm(e,i,t.in,r)}}function wm(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}function mz(e){return e.value=Object.freeze(e.value),e}function hz(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(su(i))}}var qe,Ms,jt,I0,$0,E0,P0,T0,O0,N0,z0,C0,j0,A0,R0,D0,U0,M0,L0,Z0,q0,F0,V0,W0,B0,G0,K0,H0,km,J0,Lc,Sm,Y0,Q0,X0,ew,tw,rw,nw,iw,aw,sw,_z,bz,Zc,ow,uw,lw,Im,cw,dw,fw,pw,mw,hw,gw,$m,vw,yw,_w,bw,ww,xw,kw,Sw,Iw,qc,$w,Ew,Pw,Tw,Ow,Nw,zw=z(()=>{gm();nu();x0();Wb();hm();ke();k0();ke();qe=N("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=iz;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let a of i._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,o,u)=>{let l=es(s),c;for(let d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(l)continue;let f=s.issues.length,p=d._zod.check(s);if(p instanceof Promise&&u?.async===!1)throw new Yi;if(c||p instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await p,s.issues.length!==f&&(l||(l=es(s,f)))});else{if(s.issues.length===f)continue;l||(l=es(s,f))}}return c?c.then(()=>s):s},a=(s,o,u)=>{if(es(s))return s.aborted=!0,s;let l=i(o,n,u);if(l instanceof Promise){if(u.async===!1)throw new Yi;return l.then(c=>e._zod.parse(c,u))}return e._zod.parse(l,u)};e._zod.run=(s,o)=>{if(o.skipChecks)return e._zod.parse(s,o);if(o.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return l instanceof Promise?l.then(c=>a(c,s,o)):a(l,s,o)}let u=e._zod.parse(s,o);if(u instanceof Promise){if(o.async===!1)throw new Yi;return u.then(l=>i(l,n,o))}return i(u,n,o)}}Ge(e,"~standard",()=>({validate:i=>{try{let a=ou(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Rc(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Ms=N("$ZodString",(e,t)=>{qe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??f0(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),jt=N("$ZodStringFormat",(e,t)=>{Mc.init(e,t),Ms.init(e,t)}),I0=N("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Xb),jt.init(e,t)}),$0=N("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Us(n))}else t.pattern??(t.pattern=Us());jt.init(e,t)}),E0=N("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=e0),jt.init(e,t)}),P0=N("$ZodURL",(e,t)=>{jt.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),T0=N("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=t0()),jt.init(e,t)}),O0=N("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yb),jt.init(e,t)}),N0=N("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Bb),jt.init(e,t)}),z0=N("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gb),jt.init(e,t)}),C0=N("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Kb),jt.init(e,t)}),j0=N("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Hb),jt.init(e,t)}),A0=N("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jb),jt.init(e,t)}),R0=N("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=d0(t)),jt.init(e,t)}),D0=N("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=l0),jt.init(e,t)}),U0=N("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=c0(t)),jt.init(e,t)}),M0=N("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Qb),jt.init(e,t)}),L0=N("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=r0),jt.init(e,t),e._zod.bag.format="ipv4"}),Z0=N("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=n0),jt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),q0=N("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=i0(t.delimiter)),jt.init(e,t),e._zod.bag.format="mac"}),F0=N("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=a0),jt.init(e,t)}),V0=N("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=s0),jt.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,a]=n;if(!a)throw new Error;let s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});W0=N("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=o0),jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{gz(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});B0=N("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=pm),jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{v5(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),G0=N("$ZodE164",(e,t)=>{t.pattern??(t.pattern=u0),jt.init(e,t)});K0=N("$ZodJWT",(e,t)=>{jt.init(e,t),e._zod.check=r=>{y5(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),H0=N("$ZodCustomStringFormat",(e,t)=>{jt.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),km=N("$ZodNumber",(e,t)=>{qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??mm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),J0=N("$ZodNumberFormat",(e,t)=>{LN.init(e,t),km.init(e,t)}),Lc=N("$ZodBoolean",(e,t)=>{qe.init(e,t),e._zod.pattern=h0,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Sm=N("$ZodBigInt",(e,t)=>{qe.init(e,t),e._zod.pattern=p0,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Y0=N("$ZodBigIntFormat",(e,t)=>{ZN.init(e,t),Sm.init(e,t)}),Q0=N("$ZodSymbol",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),X0=N("$ZodUndefined",(e,t)=>{qe.init(e,t),e._zod.pattern=v0,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),ew=N("$ZodNull",(e,t)=>{qe.init(e,t),e._zod.pattern=g0,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),tw=N("$ZodAny",(e,t)=>{qe.init(e,t),e._zod.parse=r=>r}),rw=N("$ZodUnknown",(e,t)=>{qe.init(e,t),e._zod.parse=r=>r}),nw=N("$ZodNever",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),iw=N("$ZodVoid",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),aw=N("$ZodDate",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});sw=N("$ZodArray",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let s=0;s<i.length;s++){let o=i[s],u=t.element._zod.run({value:o,issues:[]},n);u instanceof Promise?a.push(u.then(l=>az(l,r,s))):az(u,r,s)}return a.length?Promise.all(a).then(()=>r):r}});_z=N("$ZodObject",(e,t)=>{if(qe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let o=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...o};return Object.defineProperty(t,"shape",{value:u}),u}})}let n=au(()=>vz(t));Ge(e._zod,"propValues",()=>{let o=t.shape,u={};for(let l in o){let c=o[l]._zod;if(c.values){u[l]??(u[l]=new Set);for(let d of c.values)u[l].add(d)}}return u});let i=Ds,a=t.catchall,s;e._zod.parse=(o,u)=>{s??(s=n.value);let l=o.value;if(!i(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),o;o.value={};let c=[],d=s.shape;for(let f of s.keys){let p=d[f],h=p._zod.optout==="optional",y=p._zod.run({value:l[f],issues:[]},u);y instanceof Promise?c.push(y.then(_=>xm(_,o,f,l,h))):xm(y,o,f,l,h)}return a?yz(c,l,o,u,n.value,e):c.length?Promise.all(c).then(()=>o):o}}),bz=N("$ZodObjectJIT",(e,t)=>{_z.init(e,t);let r=e._zod.parse,n=au(()=>vz(t)),i=f=>{let p=new vm(["shape","payload","ctx"]),h=n.value,y=v=>{let b=um(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let _=Object.create(null),m=0;for(let v of h.keys)_[v]=`key_${m++}`;p.write("const newResult = {};");for(let v of h.keys){let b=_[v],w=um(v),k=f[v]?._zod?.optout==="optional";p.write(`const ${b} = ${y(v)};`),k?p.write(`
44
+ if (${b}.issues.length) {
45
+ if (${w} in input) {
46
+ payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
47
+ ...iss,
48
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
49
+ })));
50
+ }
51
+ }
52
+
53
+ if (${b}.value === undefined) {
54
+ if (${w} in input) {
55
+ newResult[${w}] = undefined;
56
+ }
57
+ } else {
58
+ newResult[${w}] = ${b}.value;
59
+ }
60
+
61
+ `):p.write(`
62
+ if (${b}.issues.length) {
63
+ payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
64
+ ...iss,
65
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
66
+ })));
67
+ }
68
+
69
+ if (${b}.value === undefined) {
70
+ if (${w} in input) {
71
+ newResult[${w}] = undefined;
72
+ }
73
+ } else {
74
+ newResult[${w}] = ${b}.value;
75
+ }
76
+
77
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");let g=p.compile();return(v,b)=>g(f,v,b)},a,s=Ds,o=!om.jitless,l=o&&Ub.value,c=t.catchall,d;e._zod.parse=(f,p)=>{d??(d=n.value);let h=f.value;return s(h)?o&&l&&p?.async===!1&&p.jitless!==!0?(a||(a=i(t.shape)),f=a(f,p),c?yz([],h,f,p,d,e):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f)}});Zc=N("$ZodUnion",(e,t)=>{qe.init(e,t),Ge(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ge(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ge(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ge(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>Ic(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(r)return n(i,a);let s=!1,o=[];for(let u of t.options){let l=u._zod.run({value:i.value,issues:[]},a);if(l instanceof Promise)o.push(l),s=!0;else{if(l.issues.length===0)return l;o.push(l)}}return s?Promise.all(o).then(u=>sz(u,i,e,a)):sz(o,i,e,a)}});ow=N("$ZodXor",(e,t)=>{Zc.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(r)return n(i,a);let s=!1,o=[];for(let u of t.options){let l=u._zod.run({value:i.value,issues:[]},a);l instanceof Promise?(o.push(l),s=!0):o.push(l)}return s?Promise.all(o).then(u=>oz(u,i,e,a)):oz(o,i,e,a)}}),uw=N("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Zc.init(e,t);let r=e._zod.parse;Ge(e._zod,"propValues",()=>{let i={};for(let a of t.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[o,u]of Object.entries(s)){i[o]||(i[o]=new Set);for(let l of u)i[o].add(l)}}return i});let n=au(()=>{let i=t.options,a=new Map;for(let s of i){let o=s._zod.propValues?.[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of o){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,s)}}return a});e._zod.parse=(i,a)=>{let s=i.value;if(!Ds(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let o=n.value.get(s?.[t.discriminator]);return o?o._zod.run(i,a):t.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),i)}}),lw=N("$ZodIntersection",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,a=t.left._zod.run({value:i,issues:[]},n),s=t.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([u,l])=>uz(r,u,l)):uz(r,a,s)}});Im=N("$ZodTuple",(e,t)=>{qe.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],o=[...r].reverse().findIndex(c=>c._zod.optin!=="optional"),u=o===-1?0:r.length-o;if(!t.rest){let c=a.length>r.length,d=a.length<u-1;if(c||d)return n.issues.push({...c?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:a,inst:e,origin:"array"}),n}let l=-1;for(let c of r){if(l++,l>=a.length&&l>=u)continue;let d=c._zod.run({value:a[l],issues:[]},i);d instanceof Promise?s.push(d.then(f=>ym(f,n,l))):ym(d,n,l)}if(t.rest){let c=a.slice(r.length);for(let d of c){l++;let f=t.rest._zod.run({value:d,issues:[]},i);f instanceof Promise?s.push(f.then(p=>ym(p,n,l))):ym(f,n,l)}}return s.length?Promise.all(s).then(()=>n):n}});cw=N("$ZodRecord",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Xa(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let a=[],s=t.keyType._zod.values;if(s){r.value={};let o=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){o.add(typeof l=="number"?l.toString():l);let c=t.valueType._zod.run({value:i[l],issues:[]},n);c instanceof Promise?a.push(c.then(d=>{d.issues.length&&r.issues.push(...An(l,d.issues)),r.value[l]=d.value})):(c.issues.length&&r.issues.push(...An(l,c.issues)),r.value[l]=c.value)}let u;for(let l in i)o.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u})}else{r.value={};for(let o of Reflect.ownKeys(i)){if(o==="__proto__")continue;let u=t.keyType._zod.run({value:o,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof o=="string"&&mm.test(o)&&u.issues.length){let d=t.keyType._zod.run({value:Number(o),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){t.mode==="loose"?r.value[o]=i[o]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>_n(d,n,yr())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},n);c instanceof Promise?a.push(c.then(d=>{d.issues.length&&r.issues.push(...An(o,d.issues)),r.value[u.value]=d.value})):(c.issues.length&&r.issues.push(...An(o,c.issues)),r.value[u.value]=c.value)}}return a.length?Promise.all(a).then(()=>r):r}}),dw=N("$ZodMap",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let a=[];r.value=new Map;for(let[s,o]of i){let u=t.keyType._zod.run({value:s,issues:[]},n),l=t.valueType._zod.run({value:o,issues:[]},n);u instanceof Promise||l instanceof Promise?a.push(Promise.all([u,l]).then(([c,d])=>{lz(c,d,r,s,i,e,n)})):lz(u,l,r,s,i,e,n)}return a.length?Promise.all(a).then(()=>r):r}});fw=N("$ZodSet",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let s of i){let o=t.valueType._zod.run({value:s,issues:[]},n);o instanceof Promise?a.push(o.then(u=>cz(u,r))):cz(o,r)}return a.length?Promise.all(a).then(()=>r):r}});pw=N("$ZodEnum",(e,t)=>{qe.init(e,t);let r=Sc(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>$c.has(typeof i)).map(i=>typeof i=="string"?Jn(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),mw=N("$ZodLiteral",(e,t)=>{if(qe.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Jn(n):n?Jn(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),hw=N("$ZodFile",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),gw=N("$ZodTransform",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rs(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new Yi;return r.value=i,r}});$m=N("$ZodOptional",(e,t)=>{qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ic(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>dz(a,r.value)):dz(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),vw=N("$ZodExactOptional",(e,t)=>{$m.init(e,t),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),yw=N("$ZodNullable",(e,t)=>{qe.init(e,t),Ge(e._zod,"optin",()=>t.innerType._zod.optin),Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ic(r.source)}|null)$`):void 0}),Ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),_w=N("$ZodDefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>fz(a,t)):fz(i,t)}});bw=N("$ZodPrefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ww=N("$ZodNonOptional",(e,t)=>{qe.init(e,t),Ge(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>pz(a,e)):pz(i,e)}});xw=N("$ZodSuccess",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rs("ZodSuccess");let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),kw=N("$ZodCatch",(e,t)=>{qe.init(e,t),Ge(e._zod,"optin",()=>t.innerType._zod.optin),Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(s=>_n(s,n,yr()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>_n(a,n,yr()))},input:r.value}),r.issues=[]),r)}}),Sw=N("$ZodNaN",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Iw=N("$ZodPipe",(e,t)=>{qe.init(e,t),Ge(e._zod,"values",()=>t.in._zod.values),Ge(e._zod,"optin",()=>t.in._zod.optin),Ge(e._zod,"optout",()=>t.out._zod.optout),Ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(s=>_m(s,t.in,n)):_m(a,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(a=>_m(a,t.out,n)):_m(i,t.out,n)}});qc=N("$ZodCodec",(e,t)=>{qe.init(e,t),Ge(e._zod,"values",()=>t.in._zod.values),Ge(e._zod,"optin",()=>t.in._zod.optin),Ge(e._zod,"optout",()=>t.out._zod.optout),Ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=t.in._zod.run(r,n);return a instanceof Promise?a.then(s=>bm(s,t,n)):bm(a,t,n)}else{let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(s=>bm(s,t,n)):bm(a,t,n)}}});$w=N("$ZodReadonly",(e,t)=>{qe.init(e,t),Ge(e._zod,"propValues",()=>t.innerType._zod.propValues),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"optin",()=>t.innerType?._zod?.optin),Ge(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(mz):mz(i)}});Ew=N("$ZodTemplateLiteral",(e,t)=>{qe.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,s))}else if(n===null||Lb.has(typeof n))r.push(Jn(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Pw=N("$ZodFunction",(e,t)=>(qe.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=e._def.input?Nc(e._def.input,n):n,a=Reflect.apply(r,this,i);return e._def.output?Nc(e._def.output,a):a}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=e._def.input?await Cc(e._def.input,n):n,a=await Reflect.apply(r,this,i);return e._def.output?await Cc(e._def.output,a):a}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Im({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Tw=N("$ZodPromise",(e,t)=>{qe.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>t.innerType._zod.run({value:i,issues:[]},n))}),Ow=N("$ZodLazy",(e,t)=>{qe.init(e,t),Ge(e._zod,"innerType",()=>t.getter()),Ge(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ge(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ge(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ge(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Nw=N("$ZodCustom",(e,t)=>{Mt.init(e,t),qe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(a=>hz(a,r,n,e));hz(i,r,n,e)}})});var wz=z(()=>{ke()});var xz=z(()=>{ke()});var kz=z(()=>{ke()});var Sz=z(()=>{ke()});var Iz=z(()=>{ke()});var $z=z(()=>{ke()});var Ez=z(()=>{ke()});var Pz=z(()=>{ke()});function Cw(){return{localeError:b5()}}var b5,jw=z(()=>{ke();b5=()=>{let e={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 t(i){return e[i]??null}let r={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"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,s=Ce(i.input),o=n[s]??s;return`Invalid input: expected ${a}, received ${o}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Ne(i.values[0])}`:`Invalid option: expected one of ${Oe(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Oe(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});var Tz=z(()=>{ke()});var Oz=z(()=>{ke()});var Nz=z(()=>{ke()});var zz=z(()=>{ke()});var Cz=z(()=>{ke()});var jz=z(()=>{ke()});var Az=z(()=>{ke()});var Rz=z(()=>{ke()});var Dz=z(()=>{ke()});var Uz=z(()=>{ke()});var Mz=z(()=>{ke()});var Lz=z(()=>{ke()});var Zz=z(()=>{ke()});var qz=z(()=>{ke()});var Aw=z(()=>{ke()});var Fz=z(()=>{Aw()});var Vz=z(()=>{ke()});var Wz=z(()=>{ke()});var Bz=z(()=>{ke()});var Gz=z(()=>{ke()});var Kz=z(()=>{ke()});var Hz=z(()=>{ke()});var Jz=z(()=>{ke()});var Yz=z(()=>{ke()});var Qz=z(()=>{ke()});var Xz=z(()=>{ke()});var eC=z(()=>{ke()});var tC=z(()=>{ke()});var rC=z(()=>{ke()});var nC=z(()=>{ke()});var iC=z(()=>{ke()});var aC=z(()=>{ke()});var Rw=z(()=>{ke()});var sC=z(()=>{Rw()});var oC=z(()=>{ke()});var uC=z(()=>{ke()});var lC=z(()=>{ke()});var cC=z(()=>{ke()});var dC=z(()=>{ke()});var fC=z(()=>{ke()});var Em=z(()=>{wz();xz();kz();Sz();Iz();$z();Ez();Pz();jw();Tz();Oz();Nz();zz();Cz();jz();Az();Rz();Dz();Uz();Mz();Lz();Zz();qz();Fz();Aw();Vz();Wz();Bz();Gz();Kz();Hz();Jz();Yz();Qz();Xz();eC();tC();rC();nC();iC();aC();sC();Rw();oC();uC();lC();cC();dC();fC()});function Mw(){return new Uw}var pC,Uw,rn,Fc=z(()=>{Uw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(pC=globalThis).__zod_globalRegistry??(pC.__zod_globalRegistry=Mw());rn=globalThis.__zod_globalRegistry});function Lw(e,t){return new e({type:"string",...ue(t)})}function Pm(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ue(t)})}function Vc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ue(t)})}function Tm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ue(t)})}function Om(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ue(t)})}function Nm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ue(t)})}function zm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ue(t)})}function Wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}function Cm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ue(t)})}function jm(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ue(t)})}function Am(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ue(t)})}function Rm(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ue(t)})}function Dm(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ue(t)})}function Um(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ue(t)})}function Mm(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ue(t)})}function Lm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ue(t)})}function Zm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ue(t)})}function Zw(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ue(t)})}function qm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ue(t)})}function Fm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ue(t)})}function Vm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ue(t)})}function Wm(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ue(t)})}function Bm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ue(t)})}function Gm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ue(t)})}function qw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ue(t)})}function Fw(e,t){return new e({type:"string",format:"date",check:"string_format",...ue(t)})}function Vw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ue(t)})}function Ww(e,t){return new e({type:"string",format:"duration",check:"string_format",...ue(t)})}function Bw(e,t){return new e({type:"number",checks:[],...ue(t)})}function Gw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}function Kw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ue(t)})}function Hw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ue(t)})}function Jw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ue(t)})}function Yw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ue(t)})}function Qw(e,t){return new e({type:"boolean",...ue(t)})}function Xw(e,t){return new e({type:"bigint",...ue(t)})}function ex(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ue(t)})}function tx(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ue(t)})}function rx(e,t){return new e({type:"symbol",...ue(t)})}function nx(e,t){return new e({type:"undefined",...ue(t)})}function ix(e,t){return new e({type:"null",...ue(t)})}function ax(e){return new e({type:"any"})}function sx(e){return new e({type:"unknown"})}function ox(e,t){return new e({type:"never",...ue(t)})}function ux(e,t){return new e({type:"void",...ue(t)})}function lx(e,t){return new e({type:"date",...ue(t)})}function cx(e,t){return new e({type:"nan",...ue(t)})}function ya(e,t){return new b0({check:"less_than",...ue(t),value:e,inclusive:!1})}function Rn(e,t){return new b0({check:"less_than",...ue(t),value:e,inclusive:!0})}function _a(e,t){return new w0({check:"greater_than",...ue(t),value:e,inclusive:!1})}function nn(e,t){return new w0({check:"greater_than",...ue(t),value:e,inclusive:!0})}function dx(e){return _a(0,e)}function fx(e){return ya(0,e)}function px(e){return Rn(0,e)}function mx(e){return nn(0,e)}function Ls(e,t){return new MN({check:"multiple_of",...ue(t),value:e})}function Zs(e,t){return new qN({check:"max_size",...ue(t),maximum:e})}function ba(e,t){return new FN({check:"min_size",...ue(t),minimum:e})}function uu(e,t){return new VN({check:"size_equals",...ue(t),size:e})}function lu(e,t){return new WN({check:"max_length",...ue(t),maximum:e})}function ts(e,t){return new BN({check:"min_length",...ue(t),minimum:e})}function cu(e,t){return new GN({check:"length_equals",...ue(t),length:e})}function Bc(e,t){return new KN({check:"string_format",format:"regex",...ue(t),pattern:e})}function Gc(e){return new HN({check:"string_format",format:"lowercase",...ue(e)})}function Kc(e){return new JN({check:"string_format",format:"uppercase",...ue(e)})}function Hc(e,t){return new YN({check:"string_format",format:"includes",...ue(t),includes:e})}function Jc(e,t){return new QN({check:"string_format",format:"starts_with",...ue(t),prefix:e})}function Yc(e,t){return new XN({check:"string_format",format:"ends_with",...ue(t),suffix:e})}function hx(e,t,r){return new ez({check:"property",property:e,schema:t,...ue(r)})}function Qc(e,t){return new tz({check:"mime_type",mime:e,...ue(t)})}function Qi(e){return new rz({check:"overwrite",tx:e})}function Xc(e){return Qi(t=>t.normalize(e))}function ed(){return Qi(e=>e.trim())}function td(){return Qi(e=>e.toLowerCase())}function rd(){return Qi(e=>e.toUpperCase())}function Km(){return Qi(e=>Db(e))}function mC(e,t,r){return new e({type:"array",element:t,...ue(r)})}function gx(e,t){return new e({type:"file",...ue(t)})}function vx(e,t,r){let n=ue(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function yx(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ue(r)})}function _x(e){let t=S5(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(su(n,r.value,t._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),r.issues.push(su(i))}},e(r.value,r)));return t}function S5(e,t){let r=new Mt({check:"custom",...ue(t)});return r._zod.check=e,r}function bx(e){let t=new Mt({check:"describe"});return t._zod.onattach=[r=>{let n=rn.get(r)??{};rn.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function wx(e){let t=new Mt({check:"meta"});return t._zod.onattach=[r=>{let n=rn.get(r)??{};rn.add(r,{...n,...e})}],t._zod.check=()=>{},t}function xx(e,t){let r=ue(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),i=i.map(p=>typeof p=="string"?p.toLowerCase():p));let a=new Set(n),s=new Set(i),o=e.Codec??qc,u=e.Boolean??Lc,l=e.String??Ms,c=new l({type:"string",error:r.error}),d=new u({type:"boolean",error:r.error}),f=new o({type:"pipe",in:c,out:d,transform:((p,h)=>{let y=p;return r.case!=="sensitive"&&(y=y.toLowerCase()),a.has(y)?!0:s.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:h.value,inst:f,continue:!1}),{})}),reverseTransform:((p,h)=>p===!0?n[0]||"true":i[0]||"false"),error:r.error});return f}function du(e,t,r,n={}){let i=ue(n),a={...ue(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:o=>r.test(o),...i};return r instanceof RegExp&&(a.pattern=r),new e(a)}var hC=z(()=>{gm();Fc();zw();ke()});function fu(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function At(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{let c={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,c);else{let f=s.schema,p=t.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(e,t,f,c)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),At(d,t,c),t.seen.get(d).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&an(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function pu(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of e.seen.entries()){let o=e.metadataRegistry.get(s[0])?.id;if(o){let u=n.get(o);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(o,s[0])}}let i=s=>{let o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,f=e.external.uri??(h=>h);if(d)return{ref:f(d)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${f("__shared")}#/${o}/${p}`}}if(s[1]===r)return{ref:"#"};let l=`#/${o}/`,c=s[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:l+c}},a=s=>{if(s[1].schema.$ref)return;let o=s[1],{ref:u,defId:l}=i(s);o.def={...o.schema},l&&(o.defId=l);let c=o.schema;for(let d in c)delete c[d];c.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let o=s[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
78
+
79
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let o=s[1];if(t===s[0]){a(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){a(s);continue}}if(e.metadataRegistry.get(s[0])?.id){a(s);continue}if(o.cycle){a(s);continue}if(o.count>1&&e.reused==="ref"){a(s);continue}}}function mu(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let o=e.seen.get(s);if(o.ref===null)return;let u=o.def??o.schema,l={...u},c=o.ref;if(o.ref=null,c){n(c);let f=e.seen.get(c),p=f.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,l),s._zod.parent===c)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(p.$ref&&f.def)for(let y in u)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(u[y])===JSON.stringify(f.def[y])&&delete u[y]}let d=s._zod.parent;if(d&&d!==c){n(d);let f=e.seen.get(d);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let p in u)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(u[p])===JSON.stringify(f.def[p])&&delete u[p]}e.override({zodSchema:s,jsonSchema:u,path:o.path??[]})};for(let s of[...e.seen.entries()].reverse())n(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,r.def??r.schema);let a=e.external?.defs??{};for(let s of e.seen.entries()){let o=s[1];o.def&&o.defId&&(a[o.defId]=o.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:nd(t,"input",e.processors),output:nd(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function an(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return an(n.element,r);if(n.type==="set")return an(n.valueType,r);if(n.type==="lazy")return an(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return an(n.innerType,r);if(n.type==="intersection")return an(n.left,r)||an(n.right,r);if(n.type==="record"||n.type==="map")return an(n.keyType,r)||an(n.valueType,r);if(n.type==="pipe")return an(n.in,r)||an(n.out,r);if(n.type==="object"){for(let i in n.shape)if(an(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(an(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(an(i,r))return!0;return!!(n.rest&&an(n.rest,r))}return!1}var gC,nd,id=z(()=>{Fc();gC=(e,t={})=>r=>{let n=fu({...r,processors:t});return At(e,n),pu(n,e),mu(n,e)},nd=(e,t,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},s=fu({...i??{},target:a,io:t,processors:r});return At(e,s),pu(s,e),mu(s,e)}});function hu(e,t){if("_idmap"in e){let n=e,i=fu({...t,processors:kx}),a={};for(let u of n._idmap.entries()){let[l,c]=u;At(c,i)}let s={},o={registry:n,uri:t?.uri,defs:a};i.external=o;for(let u of n._idmap.entries()){let[l,c]=u;pu(i,c),s[l]=mu(i,c)}if(Object.keys(a).length>0){let u=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:a}}return{schemas:s}}let r=fu({...t,processors:kx});return At(e,r),pu(r,e),mu(r,e)}var I5,Sx,Ix,$x,Ex,Px,Tx,Ox,Nx,zx,Cx,jx,Ax,Rx,Dx,Ux,Mx,Lx,Zx,qx,Fx,Vx,Wx,Bx,Gx,Kx,Hm,Hx,Jx,Yx,Qx,Xx,ek,tk,rk,nk,ik,ak,Jm,sk,kx,gu=z(()=>{id();ke();I5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sx=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:s,format:o,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),o&&(i.format=I5[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),l&&(i.contentEncoding=l),u&&u.size>0){let c=[...u];c.length===1?i.pattern=c[0].source:c.length>1&&(i.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Ix=(e,t,r,n)=>{let i=r,{minimum:a,maximum:s,format:o,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=c,i.exclusiveMinimum=!0):i.exclusiveMinimum=c),typeof a=="number"&&(i.minimum=a,typeof c=="number"&&t.target!=="draft-04"&&(c>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof s=="number"&&(i.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof u=="number"&&(i.multipleOf=u)},$x=(e,t,r,n)=>{r.type="boolean"},Ex=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Px=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Tx=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Ox=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Nx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},zx=(e,t,r,n)=>{r.not={}},Cx=(e,t,r,n)=>{},jx=(e,t,r,n)=>{},Ax=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Rx=(e,t,r,n)=>{let i=e._zod.def,a=Sc(i.entries);a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},Dx=(e,t,r,n)=>{let i=e._zod.def,a=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){let s=a[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},Ux=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Mx=(e,t,r,n)=>{let i=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},Lx=(e,t,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:o,mime:u}=e._zod.bag;s!==void 0&&(a.minLength=s),o!==void 0&&(a.maxLength=o),u?u.length===1?(a.contentMediaType=u[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(i,a)},Zx=(e,t,r,n)=>{r.type="boolean"},qx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Fx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Vx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Wx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Bx=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Gx=(e,t,r,n)=>{let i=r,a=e._zod.def,{minimum:s,maximum:o}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=At(a.element,t,{...n,path:[...n.path,"items"]})},Kx=(e,t,r,n)=>{let i=r,a=e._zod.def;i.type="object",i.properties={};let s=a.shape;for(let l in s)i.properties[l]=At(s[l],t,{...n,path:[...n.path,"properties",l]});let o=new Set(Object.keys(s)),u=new Set([...o].filter(l=>{let c=a.shape[l]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));u.size>0&&(i.required=Array.from(u)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=At(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Hm=(e,t,r,n)=>{let i=e._zod.def,a=i.inclusive===!1,s=i.options.map((o,u)=>At(o,t,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?r.oneOf=s:r.anyOf=s},Hx=(e,t,r,n)=>{let i=e._zod.def,a=At(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=At(i.right,t,{...n,path:[...n.path,"allOf",1]}),o=l=>"allOf"in l&&Object.keys(l).length===1,u=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]];r.allOf=u},Jx=(e,t,r,n)=>{let i=r,a=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",o=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((f,p)=>At(f,t,{...n,path:[...n.path,s,p]})),l=a.rest?At(a.rest,t,{...n,path:[...n.path,o,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=u,l&&(i.items=l)):t.target==="openapi-3.0"?(i.items={anyOf:u},l&&i.items.anyOf.push(l),i.minItems=u.length,l||(i.maxItems=u.length)):(i.items=u,l&&(i.additionalItems=l));let{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(i.minItems=c),typeof d=="number"&&(i.maxItems=d)},Yx=(e,t,r,n)=>{let i=r,a=e._zod.def;i.type="object";let s=a.keyType,u=s._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){let c=At(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of u)i.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=At(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=At(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let c=[...l].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(i.required=c)}},Qx=(e,t,r,n)=>{let i=e._zod.def,a=At(i.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Xx=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType},ek=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},tk=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},rk=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},nk=(e,t,r,n)=>{let i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;At(a,t,n);let s=t.seen.get(e);s.ref=a},ik=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType,r.readOnly=!0},ak=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType},Jm=(e,t,r,n)=>{let i=e._zod.def;At(i.innerType,t,n);let a=t.seen.get(e);a.ref=i.innerType},sk=(e,t,r,n)=>{let i=e._zod.innerType;At(i,t,n);let a=t.seen.get(e);a.ref=i},kx={string:Sx,number:Ix,boolean:$x,bigint:Ex,symbol:Px,null:Tx,undefined:Ox,void:Nx,never:zx,any:Cx,unknown:jx,date:Ax,enum:Rx,literal:Dx,nan:Ux,template_literal:Mx,file:Lx,success:Zx,custom:qx,function:Fx,transform:Vx,map:Wx,set:Bx,array:Gx,object:Kx,union:Hm,intersection:Hx,tuple:Jx,record:Yx,nullable:Qx,nonoptional:Xx,default:ek,prefault:tk,catch:rk,pipe:nk,readonly:ik,promise:ak,optional:Jm,lazy:sk}});var vC=z(()=>{gu();id()});var yC=z(()=>{});var cr=z(()=>{nu();Wb();Vb();zw();gm();k0();ke();hm();Em();Fc();x0();hC();id();gu();vC();yC()});var Ym={};fa(Ym,{endsWith:()=>Yc,gt:()=>_a,gte:()=>nn,includes:()=>Hc,length:()=>cu,lowercase:()=>Gc,lt:()=>ya,lte:()=>Rn,maxLength:()=>lu,maxSize:()=>Zs,mime:()=>Qc,minLength:()=>ts,minSize:()=>ba,multipleOf:()=>Ls,negative:()=>fx,nonnegative:()=>mx,nonpositive:()=>px,normalize:()=>Xc,overwrite:()=>Qi,positive:()=>dx,property:()=>hx,regex:()=>Bc,size:()=>uu,slugify:()=>Km,startsWith:()=>Jc,toLowerCase:()=>td,toUpperCase:()=>rd,trim:()=>ed,uppercase:()=>Kc});var Qm=z(()=>{cr()});var qs={};fa(qs,{ZodISODate:()=>lk,ZodISODateTime:()=>ok,ZodISODuration:()=>pk,ZodISOTime:()=>dk,date:()=>ck,datetime:()=>uk,duration:()=>mk,time:()=>fk});function uk(e){return qw(ok,e)}function ck(e){return Fw(lk,e)}function fk(e){return Vw(dk,e)}function mk(e){return Ww(pk,e)}var ok,lk,dk,pk,ad=z(()=>{cr();od();ok=N("ZodISODateTime",(e,t)=>{R0.init(e,t),Lt.init(e,t)});lk=N("ZodISODate",(e,t)=>{D0.init(e,t),Lt.init(e,t)});dk=N("ZodISOTime",(e,t)=>{U0.init(e,t),Lt.init(e,t)});pk=N("ZodISODuration",(e,t)=>{M0.init(e,t),Lt.init(e,t)})});var _C,$Se,Dn,hk=z(()=>{cr();cr();ke();_C=(e,t)=>{cm.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>fm(e,r)},flatten:{value:r=>dm(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,iu,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,iu,2)}},isEmpty:{get(){return e.issues.length===0}}})},$Se=N("ZodError",_C),Dn=N("ZodError",_C,{Parent:Error})});var bC,wC,xC,kC,SC,IC,$C,EC,PC,TC,OC,NC,gk=z(()=>{cr();hk();bC=Oc(Dn),wC=zc(Dn),xC=jc(Dn),kC=Ac(Dn),SC=$N(Dn),IC=EN(Dn),$C=PN(Dn),EC=TN(Dn),PC=ON(Dn),TC=NN(Dn),OC=zN(Dn),NC=CN(Dn)});var sd={};fa(sd,{ZodAny:()=>RC,ZodArray:()=>LC,ZodBase64:()=>Nk,ZodBase64URL:()=>zk,ZodBigInt:()=>sh,ZodBigIntFormat:()=>Ak,ZodBoolean:()=>ah,ZodCIDRv4:()=>Tk,ZodCIDRv6:()=>Ok,ZodCUID:()=>xk,ZodCUID2:()=>kk,ZodCatch:()=>sj,ZodCodec:()=>qk,ZodCustom:()=>fh,ZodCustomStringFormat:()=>ld,ZodDate:()=>Dk,ZodDefault:()=>ej,ZodDiscriminatedUnion:()=>qC,ZodE164:()=>Ck,ZodEmail:()=>_k,ZodEmoji:()=>bk,ZodEnum:()=>ud,ZodExactOptional:()=>YC,ZodFile:()=>HC,ZodFunction:()=>hj,ZodGUID:()=>Xm,ZodIPv4:()=>Ek,ZodIPv6:()=>Pk,ZodIntersection:()=>FC,ZodJWT:()=>jk,ZodKSUID:()=>$k,ZodLazy:()=>fj,ZodLiteral:()=>KC,ZodMAC:()=>zC,ZodMap:()=>BC,ZodNaN:()=>uj,ZodNanoID:()=>wk,ZodNever:()=>UC,ZodNonOptional:()=>Lk,ZodNull:()=>AC,ZodNullable:()=>XC,ZodNumber:()=>ih,ZodNumberFormat:()=>vu,ZodObject:()=>uh,ZodOptional:()=>Mk,ZodPipe:()=>Zk,ZodPrefault:()=>rj,ZodPromise:()=>mj,ZodReadonly:()=>lj,ZodRecord:()=>dh,ZodSet:()=>GC,ZodString:()=>rh,ZodStringFormat:()=>Lt,ZodSuccess:()=>aj,ZodSymbol:()=>CC,ZodTemplateLiteral:()=>dj,ZodTransform:()=>JC,ZodTuple:()=>VC,ZodType:()=>Ke,ZodULID:()=>Sk,ZodURL:()=>nh,ZodUUID:()=>wa,ZodUndefined:()=>jC,ZodUnion:()=>lh,ZodUnknown:()=>DC,ZodVoid:()=>MC,ZodXID:()=>Ik,ZodXor:()=>ZC,_ZodString:()=>yk,_default:()=>tj,_function:()=>TB,any:()=>dB,array:()=>st,base64:()=>K5,base64url:()=>H5,bigint:()=>sB,boolean:()=>hr,catch:()=>oj,check:()=>OB,cidrv4:()=>B5,cidrv6:()=>G5,codec:()=>$B,cuid:()=>U5,cuid2:()=>M5,custom:()=>Fk,date:()=>pB,describe:()=>NB,discriminatedUnion:()=>ch,e164:()=>J5,email:()=>P5,emoji:()=>R5,enum:()=>Lr,exactOptional:()=>QC,file:()=>xB,float32:()=>rB,float64:()=>nB,function:()=>TB,guid:()=>T5,hash:()=>tB,hex:()=>eB,hostname:()=>X5,httpUrl:()=>A5,instanceof:()=>CB,int:()=>vk,int32:()=>iB,int64:()=>oB,intersection:()=>cd,ipv4:()=>F5,ipv6:()=>W5,json:()=>AB,jwt:()=>Y5,keyof:()=>mB,ksuid:()=>q5,lazy:()=>pj,literal:()=>Se,looseObject:()=>Mr,looseRecord:()=>yB,mac:()=>V5,map:()=>_B,meta:()=>zB,nan:()=>IB,nanoid:()=>D5,nativeEnum:()=>wB,never:()=>Rk,nonoptional:()=>ij,null:()=>oh,nullable:()=>eh,nullish:()=>kB,number:()=>Ot,object:()=>de,optional:()=>Gt,partialRecord:()=>vB,pipe:()=>th,prefault:()=>nj,preprocess:()=>ph,promise:()=>PB,readonly:()=>cj,record:()=>Rt,refine:()=>gj,set:()=>bB,strictObject:()=>hB,string:()=>F,stringFormat:()=>Q5,stringbool:()=>jB,success:()=>SB,superRefine:()=>vj,symbol:()=>lB,templateLiteral:()=>EB,transform:()=>Uk,tuple:()=>WC,uint32:()=>aB,uint64:()=>uB,ulid:()=>L5,undefined:()=>cB,union:()=>qt,unknown:()=>Zt,url:()=>j5,uuid:()=>O5,uuidv4:()=>N5,uuidv6:()=>z5,uuidv7:()=>C5,void:()=>fB,xid:()=>Z5,xor:()=>gB});function F(e){return Lw(rh,e)}function P5(e){return Pm(_k,e)}function T5(e){return Vc(Xm,e)}function O5(e){return Tm(wa,e)}function N5(e){return Om(wa,e)}function z5(e){return Nm(wa,e)}function C5(e){return zm(wa,e)}function j5(e){return Wc(nh,e)}function A5(e){return Wc(nh,{protocol:/^https?$/,hostname:Yn.domain,...X.normalizeParams(e)})}function R5(e){return Cm(bk,e)}function D5(e){return jm(wk,e)}function U5(e){return Am(xk,e)}function M5(e){return Rm(kk,e)}function L5(e){return Dm(Sk,e)}function Z5(e){return Um(Ik,e)}function q5(e){return Mm($k,e)}function F5(e){return Lm(Ek,e)}function V5(e){return Zw(zC,e)}function W5(e){return Zm(Pk,e)}function B5(e){return qm(Tk,e)}function G5(e){return Fm(Ok,e)}function K5(e){return Vm(Nk,e)}function H5(e){return Wm(zk,e)}function J5(e){return Bm(Ck,e)}function Y5(e){return Gm(jk,e)}function Q5(e,t,r={}){return du(ld,e,t,r)}function X5(e){return du(ld,"hostname",Yn.hostname,e)}function eB(e){return du(ld,"hex",Yn.hex,e)}function tB(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=Yn[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return du(ld,n,i,t)}function Ot(e){return Bw(ih,e)}function vk(e){return Gw(vu,e)}function rB(e){return Kw(vu,e)}function nB(e){return Hw(vu,e)}function iB(e){return Jw(vu,e)}function aB(e){return Yw(vu,e)}function hr(e){return Qw(ah,e)}function sB(e){return Xw(sh,e)}function oB(e){return ex(Ak,e)}function uB(e){return tx(Ak,e)}function lB(e){return rx(CC,e)}function cB(e){return nx(jC,e)}function oh(e){return ix(AC,e)}function dB(){return ax(RC)}function Zt(){return sx(DC)}function Rk(e){return ox(UC,e)}function fB(e){return ux(MC,e)}function pB(e){return lx(Dk,e)}function st(e,t){return mC(LC,e,t)}function mB(e){let t=e._zod.def.shape;return Lr(Object.keys(t))}function de(e,t){let r={type:"object",shape:e??{},...X.normalizeParams(t)};return new uh(r)}function hB(e,t){return new uh({type:"object",shape:e,catchall:Rk(),...X.normalizeParams(t)})}function Mr(e,t){return new uh({type:"object",shape:e,catchall:Zt(),...X.normalizeParams(t)})}function qt(e,t){return new lh({type:"union",options:e,...X.normalizeParams(t)})}function gB(e,t){return new ZC({type:"union",options:e,inclusive:!1,...X.normalizeParams(t)})}function ch(e,t,r){return new qC({type:"union",options:t,discriminator:e,...X.normalizeParams(r)})}function cd(e,t){return new FC({type:"intersection",left:e,right:t})}function WC(e,t,r){let n=t instanceof qe,i=n?r:t,a=n?t:null;return new VC({type:"tuple",items:e,rest:a,...X.normalizeParams(i)})}function Rt(e,t,r){return new dh({type:"record",keyType:e,valueType:t,...X.normalizeParams(r)})}function vB(e,t,r){let n=tn(e);return n._zod.values=void 0,new dh({type:"record",keyType:n,valueType:t,...X.normalizeParams(r)})}function yB(e,t,r){return new dh({type:"record",keyType:e,valueType:t,mode:"loose",...X.normalizeParams(r)})}function _B(e,t,r){return new BC({type:"map",keyType:e,valueType:t,...X.normalizeParams(r)})}function bB(e,t){return new GC({type:"set",valueType:e,...X.normalizeParams(t)})}function Lr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ud({type:"enum",entries:r,...X.normalizeParams(t)})}function wB(e,t){return new ud({type:"enum",entries:e,...X.normalizeParams(t)})}function Se(e,t){return new KC({type:"literal",values:Array.isArray(e)?e:[e],...X.normalizeParams(t)})}function xB(e){return gx(HC,e)}function Uk(e){return new JC({type:"transform",transform:e})}function Gt(e){return new Mk({type:"optional",innerType:e})}function QC(e){return new YC({type:"optional",innerType:e})}function eh(e){return new XC({type:"nullable",innerType:e})}function kB(e){return Gt(eh(e))}function tj(e,t){return new ej({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():X.shallowClone(t)}})}function nj(e,t){return new rj({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():X.shallowClone(t)}})}function ij(e,t){return new Lk({type:"nonoptional",innerType:e,...X.normalizeParams(t)})}function SB(e){return new aj({type:"success",innerType:e})}function oj(e,t){return new sj({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function IB(e){return cx(uj,e)}function th(e,t){return new Zk({type:"pipe",in:e,out:t})}function $B(e,t,r){return new qk({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function cj(e){return new lj({type:"readonly",innerType:e})}function EB(e,t){return new dj({type:"template_literal",parts:e,...X.normalizeParams(t)})}function pj(e){return new fj({type:"lazy",getter:e})}function PB(e){return new mj({type:"promise",innerType:e})}function TB(e){return new hj({type:"function",input:Array.isArray(e?.input)?WC(e?.input):e?.input??st(Zt()),output:e?.output??Zt()})}function OB(e){let t=new Mt({check:"custom"});return t._zod.check=e,t}function Fk(e,t){return vx(fh,e??(()=>!0),t)}function gj(e,t={}){return yx(fh,e,t)}function vj(e){return _x(e)}function CB(e,t={}){let r=new fh({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...X.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function AB(e){let t=pj(()=>qt([F(e),Ot(),hr(),oh(),st(t),Rt(F(),t)]));return t}function ph(e,t){return th(Uk(e),t)}var Ke,yk,rh,Lt,_k,Xm,wa,nh,bk,wk,xk,kk,Sk,Ik,$k,Ek,zC,Pk,Tk,Ok,Nk,zk,Ck,jk,ld,ih,vu,ah,sh,Ak,CC,jC,AC,RC,DC,UC,MC,Dk,LC,uh,lh,ZC,qC,FC,VC,dh,BC,GC,ud,KC,HC,JC,Mk,YC,XC,ej,rj,Lk,aj,sj,uj,Zk,qk,lj,dj,fj,mj,hj,fh,NB,zB,jB,od=z(()=>{cr();cr();gu();id();Qm();ad();gk();Ke=N("ZodType",(e,t)=>(qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nd(e,"input"),output:nd(e,"output")}}),e.toJSONSchema=gC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(X.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>tn(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>bC(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>xC(e,r,n),e.parseAsync=async(r,n)=>wC(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>kC(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>SC(e,r,n),e.decode=(r,n)=>IC(e,r,n),e.encodeAsync=async(r,n)=>$C(e,r,n),e.decodeAsync=async(r,n)=>EC(e,r,n),e.safeEncode=(r,n)=>PC(e,r,n),e.safeDecode=(r,n)=>TC(e,r,n),e.safeEncodeAsync=async(r,n)=>OC(e,r,n),e.safeDecodeAsync=async(r,n)=>NC(e,r,n),e.refine=(r,n)=>e.check(gj(r,n)),e.superRefine=r=>e.check(vj(r)),e.overwrite=r=>e.check(Qi(r)),e.optional=()=>Gt(e),e.exactOptional=()=>QC(e),e.nullable=()=>eh(e),e.nullish=()=>Gt(eh(e)),e.nonoptional=r=>ij(e,r),e.array=()=>st(e),e.or=r=>qt([e,r]),e.and=r=>cd(e,r),e.transform=r=>th(e,Uk(r)),e.default=r=>tj(e,r),e.prefault=r=>nj(e,r),e.catch=r=>oj(e,r),e.pipe=r=>th(e,r),e.readonly=()=>cj(e),e.describe=r=>{let n=e.clone();return rn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return rn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return rn.get(e);let n=e.clone();return rn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),yk=N("_ZodString",(e,t)=>{Ms.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(n,i,a)=>Sx(e,n,i,a);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Bc(...n)),e.includes=(...n)=>e.check(Hc(...n)),e.startsWith=(...n)=>e.check(Jc(...n)),e.endsWith=(...n)=>e.check(Yc(...n)),e.min=(...n)=>e.check(ts(...n)),e.max=(...n)=>e.check(lu(...n)),e.length=(...n)=>e.check(cu(...n)),e.nonempty=(...n)=>e.check(ts(1,...n)),e.lowercase=n=>e.check(Gc(n)),e.uppercase=n=>e.check(Kc(n)),e.trim=()=>e.check(ed()),e.normalize=(...n)=>e.check(Xc(...n)),e.toLowerCase=()=>e.check(td()),e.toUpperCase=()=>e.check(rd()),e.slugify=()=>e.check(Km())}),rh=N("ZodString",(e,t)=>{Ms.init(e,t),yk.init(e,t),e.email=r=>e.check(Pm(_k,r)),e.url=r=>e.check(Wc(nh,r)),e.jwt=r=>e.check(Gm(jk,r)),e.emoji=r=>e.check(Cm(bk,r)),e.guid=r=>e.check(Vc(Xm,r)),e.uuid=r=>e.check(Tm(wa,r)),e.uuidv4=r=>e.check(Om(wa,r)),e.uuidv6=r=>e.check(Nm(wa,r)),e.uuidv7=r=>e.check(zm(wa,r)),e.nanoid=r=>e.check(jm(wk,r)),e.guid=r=>e.check(Vc(Xm,r)),e.cuid=r=>e.check(Am(xk,r)),e.cuid2=r=>e.check(Rm(kk,r)),e.ulid=r=>e.check(Dm(Sk,r)),e.base64=r=>e.check(Vm(Nk,r)),e.base64url=r=>e.check(Wm(zk,r)),e.xid=r=>e.check(Um(Ik,r)),e.ksuid=r=>e.check(Mm($k,r)),e.ipv4=r=>e.check(Lm(Ek,r)),e.ipv6=r=>e.check(Zm(Pk,r)),e.cidrv4=r=>e.check(qm(Tk,r)),e.cidrv6=r=>e.check(Fm(Ok,r)),e.e164=r=>e.check(Bm(Ck,r)),e.datetime=r=>e.check(uk(r)),e.date=r=>e.check(ck(r)),e.time=r=>e.check(fk(r)),e.duration=r=>e.check(mk(r))});Lt=N("ZodStringFormat",(e,t)=>{jt.init(e,t),yk.init(e,t)}),_k=N("ZodEmail",(e,t)=>{E0.init(e,t),Lt.init(e,t)});Xm=N("ZodGUID",(e,t)=>{I0.init(e,t),Lt.init(e,t)});wa=N("ZodUUID",(e,t)=>{$0.init(e,t),Lt.init(e,t)});nh=N("ZodURL",(e,t)=>{P0.init(e,t),Lt.init(e,t)});bk=N("ZodEmoji",(e,t)=>{T0.init(e,t),Lt.init(e,t)});wk=N("ZodNanoID",(e,t)=>{O0.init(e,t),Lt.init(e,t)});xk=N("ZodCUID",(e,t)=>{N0.init(e,t),Lt.init(e,t)});kk=N("ZodCUID2",(e,t)=>{z0.init(e,t),Lt.init(e,t)});Sk=N("ZodULID",(e,t)=>{C0.init(e,t),Lt.init(e,t)});Ik=N("ZodXID",(e,t)=>{j0.init(e,t),Lt.init(e,t)});$k=N("ZodKSUID",(e,t)=>{A0.init(e,t),Lt.init(e,t)});Ek=N("ZodIPv4",(e,t)=>{L0.init(e,t),Lt.init(e,t)});zC=N("ZodMAC",(e,t)=>{q0.init(e,t),Lt.init(e,t)});Pk=N("ZodIPv6",(e,t)=>{Z0.init(e,t),Lt.init(e,t)});Tk=N("ZodCIDRv4",(e,t)=>{F0.init(e,t),Lt.init(e,t)});Ok=N("ZodCIDRv6",(e,t)=>{V0.init(e,t),Lt.init(e,t)});Nk=N("ZodBase64",(e,t)=>{W0.init(e,t),Lt.init(e,t)});zk=N("ZodBase64URL",(e,t)=>{B0.init(e,t),Lt.init(e,t)});Ck=N("ZodE164",(e,t)=>{G0.init(e,t),Lt.init(e,t)});jk=N("ZodJWT",(e,t)=>{K0.init(e,t),Lt.init(e,t)});ld=N("ZodCustomStringFormat",(e,t)=>{H0.init(e,t),Lt.init(e,t)});ih=N("ZodNumber",(e,t)=>{km.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(n,i,a)=>Ix(e,n,i,a),e.gt=(n,i)=>e.check(_a(n,i)),e.gte=(n,i)=>e.check(nn(n,i)),e.min=(n,i)=>e.check(nn(n,i)),e.lt=(n,i)=>e.check(ya(n,i)),e.lte=(n,i)=>e.check(Rn(n,i)),e.max=(n,i)=>e.check(Rn(n,i)),e.int=n=>e.check(vk(n)),e.safe=n=>e.check(vk(n)),e.positive=n=>e.check(_a(0,n)),e.nonnegative=n=>e.check(nn(0,n)),e.negative=n=>e.check(ya(0,n)),e.nonpositive=n=>e.check(Rn(0,n)),e.multipleOf=(n,i)=>e.check(Ls(n,i)),e.step=(n,i)=>e.check(Ls(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});vu=N("ZodNumberFormat",(e,t)=>{J0.init(e,t),ih.init(e,t)});ah=N("ZodBoolean",(e,t)=>{Lc.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$x(e,r,n,i)});sh=N("ZodBigInt",(e,t)=>{Sm.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(n,i,a)=>Ex(e,n,i,a),e.gte=(n,i)=>e.check(nn(n,i)),e.min=(n,i)=>e.check(nn(n,i)),e.gt=(n,i)=>e.check(_a(n,i)),e.gte=(n,i)=>e.check(nn(n,i)),e.min=(n,i)=>e.check(nn(n,i)),e.lt=(n,i)=>e.check(ya(n,i)),e.lte=(n,i)=>e.check(Rn(n,i)),e.max=(n,i)=>e.check(Rn(n,i)),e.positive=n=>e.check(_a(BigInt(0),n)),e.negative=n=>e.check(ya(BigInt(0),n)),e.nonpositive=n=>e.check(Rn(BigInt(0),n)),e.nonnegative=n=>e.check(nn(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(Ls(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ak=N("ZodBigIntFormat",(e,t)=>{Y0.init(e,t),sh.init(e,t)});CC=N("ZodSymbol",(e,t)=>{Q0.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Px(e,r,n,i)});jC=N("ZodUndefined",(e,t)=>{X0.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ox(e,r,n,i)});AC=N("ZodNull",(e,t)=>{ew.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Tx(e,r,n,i)});RC=N("ZodAny",(e,t)=>{tw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Cx(e,r,n,i)});DC=N("ZodUnknown",(e,t)=>{rw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>jx(e,r,n,i)});UC=N("ZodNever",(e,t)=>{nw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>zx(e,r,n,i)});MC=N("ZodVoid",(e,t)=>{iw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Nx(e,r,n,i)});Dk=N("ZodDate",(e,t)=>{aw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(n,i,a)=>Ax(e,n,i,a),e.min=(n,i)=>e.check(nn(n,i)),e.max=(n,i)=>e.check(Rn(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});LC=N("ZodArray",(e,t)=>{sw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Gx(e,r,n,i),e.element=t.element,e.min=(r,n)=>e.check(ts(r,n)),e.nonempty=r=>e.check(ts(1,r)),e.max=(r,n)=>e.check(lu(r,n)),e.length=(r,n)=>e.check(cu(r,n)),e.unwrap=()=>e.element});uh=N("ZodObject",(e,t)=>{bz.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Kx(e,r,n,i),X.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Lr(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rk()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>X.extend(e,r),e.safeExtend=r=>X.safeExtend(e,r),e.merge=r=>X.merge(e,r),e.pick=r=>X.pick(e,r),e.omit=r=>X.omit(e,r),e.partial=(...r)=>X.partial(Mk,e,r[0]),e.required=(...r)=>X.required(Lk,e,r[0])});lh=N("ZodUnion",(e,t)=>{Zc.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hm(e,r,n,i),e.options=t.options});ZC=N("ZodXor",(e,t)=>{lh.init(e,t),ow.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hm(e,r,n,i),e.options=t.options});qC=N("ZodDiscriminatedUnion",(e,t)=>{lh.init(e,t),uw.init(e,t)});FC=N("ZodIntersection",(e,t)=>{lw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hx(e,r,n,i)});VC=N("ZodTuple",(e,t)=>{Im.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jx(e,r,n,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});dh=N("ZodRecord",(e,t)=>{cw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Yx(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType});BC=N("ZodMap",(e,t)=>{dw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wx(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(ba(...r)),e.nonempty=r=>e.check(ba(1,r)),e.max=(...r)=>e.check(Zs(...r)),e.size=(...r)=>e.check(uu(...r))});GC=N("ZodSet",(e,t)=>{fw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Bx(e,r,n,i),e.min=(...r)=>e.check(ba(...r)),e.nonempty=r=>e.check(ba(1,r)),e.max=(...r)=>e.check(Zs(...r)),e.size=(...r)=>e.check(uu(...r))});ud=N("ZodEnum",(e,t)=>{pw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(n,i,a)=>Rx(e,n,i,a),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let a={};for(let s of n)if(r.has(s))a[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ud({...t,checks:[],...X.normalizeParams(i),entries:a})},e.exclude=(n,i)=>{let a={...t.entries};for(let s of n)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new ud({...t,checks:[],...X.normalizeParams(i),entries:a})}});KC=N("ZodLiteral",(e,t)=>{mw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Dx(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});HC=N("ZodFile",(e,t)=>{hw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Lx(e,r,n,i),e.min=(r,n)=>e.check(ba(r,n)),e.max=(r,n)=>e.check(Zs(r,n)),e.mime=(r,n)=>e.check(Qc(Array.isArray(r)?r:[r],n))});JC=N("ZodTransform",(e,t)=>{gw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Vx(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rs(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(X.issue(a,r.value,t));else{let s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(X.issue(s))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});Mk=N("ZodOptional",(e,t)=>{$m.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});YC=N("ZodExactOptional",(e,t)=>{vw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jm(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});XC=N("ZodNullable",(e,t)=>{yw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Qx(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});ej=N("ZodDefault",(e,t)=>{_w.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ek(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});rj=N("ZodPrefault",(e,t)=>{bw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>tk(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Lk=N("ZodNonOptional",(e,t)=>{ww.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Xx(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});aj=N("ZodSuccess",(e,t)=>{xw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Zx(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});sj=N("ZodCatch",(e,t)=>{kw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rk(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});uj=N("ZodNaN",(e,t)=>{Sw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ux(e,r,n,i)});Zk=N("ZodPipe",(e,t)=>{Iw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nk(e,r,n,i),e.in=t.in,e.out=t.out});qk=N("ZodCodec",(e,t)=>{Zk.init(e,t),qc.init(e,t)});lj=N("ZodReadonly",(e,t)=>{$w.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ik(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});dj=N("ZodTemplateLiteral",(e,t)=>{Ew.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Mx(e,r,n,i)});fj=N("ZodLazy",(e,t)=>{Ow.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>sk(e,r,n,i),e.unwrap=()=>e._zod.def.getter()});mj=N("ZodPromise",(e,t)=>{Tw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ak(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});hj=N("ZodFunction",(e,t)=>{Pw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Fx(e,r,n,i)});fh=N("ZodCustom",(e,t)=>{Nw.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,n,i)=>qx(e,r,n,i)});NB=bx,zB=wx;jB=(...e)=>xx({Codec:qk,Boolean:ah,String:rh},...e)});var yj,bj=z(()=>{cr();cr();yj||(yj={})});var jSe,wj=z(()=>{Fc();Qm();ad();od();jSe={...sd,...Ym,iso:qs}});var xj=z(()=>{cr();od()});var dd=z(()=>{cr();od();Qm();hk();gk();bj();cr();jw();cr();gu();wj();Em();ad();ad();xj();yr(Cw())});var Sj=z(()=>{dd();dd()});import GB from"axios";import{homedir as KB}from"node:os";import{join as HB}from"node:path";import{existsSync as JB,readFileSync as YB}from"node:fs";function QB(){if(process.env.OPENAI_PROXY_TOKEN)return M.debug("[Auth] Using OPENAI_PROXY_TOKEN (ECS execution)"),process.env.OPENAI_PROXY_TOKEN;if(process.env.ZIBBY_USER_TOKEN)return M.debug("[Auth] Using ZIBBY_USER_TOKEN (CI/CD PAT)"),process.env.ZIBBY_USER_TOKEN;try{let e=HB(KB(),".zibby","config.json");if(JB(e)){let t=JSON.parse(YB(e,"utf-8"));if(t.sessionToken)return M.debug("[Auth] Using session token from zibby login"),t.sessionToken}}catch(e){M.debug(`[Auth] Could not read zibby login session: ${e.message}`)}return null}function XB(){return process.env.OPENAI_PROXY_URL?process.env.OPENAI_PROXY_URL.replace(/\/v1\/?$/,""):"https://api-prod.zibby.app/openai-proxy"}function yu(e){if(!(typeof e!="object"||e===null)){if(Object.keys(e).length===0){e.type="object",e.additionalProperties=!0;return}if(e.type||(e.properties?e.type="object":e.items&&(e.type="array")),e.type==="object")if(e.properties){for(let[t,r]of Object.entries(e.properties))r.type==="object"&&r.additionalProperties&&r.additionalProperties!==!1&&(!r.properties||Object.keys(r.properties).length===0)&&(e.properties[t]={type:["object","null"]});e.additionalProperties=!1,e.required=Object.keys(e.properties),Object.values(e.properties).forEach(yu)}else"additionalProperties"in e||(e.additionalProperties=!0);e.type==="array"&&e.items&&yu(e.items),e.anyOf&&e.anyOf.forEach(yu),e.oneOf&&e.oneOf.forEach(yu),e.allOf&&e.allOf.forEach(yu)}}async function Ij(e,t){M.info("\u{1F527} [OpenAI Proxy] Formatting structured output...");let r=QB();if(!r)throw new Error("Authentication required for structured output processing.\n Local development: Run `zibby login`\n CI/CD: Set ZIBBY_USER_TOKEN environment variable (Personal Access Token from UI settings)");let n=XB();M.info(`\u{1F517} Using OpenAI proxy: ${n}`);let i=hu(t),a=i;if(i.$ref&&i.definitions){let c=i.$ref.split("/").pop();a=i.definitions[c]||i,M.debug(`Extracted schema from $ref: ${c}`)}delete a.$schema,yu(a);let s=4e5,o=e;e.length>s&&(M.warn(`\u26A0\uFE0F [OpenAI Proxy] Raw text (${e.length} chars) exceeds limit, keeping last ${s} chars`),o=`... [truncated early content] ...
80
+ ${e.slice(-s)}`);let u=`Extract and format the following information into structured JSON matching the schema.
81
+
82
+ RAW CONTENT:
83
+ ${o}
84
+
85
+ Extract all relevant information and format it according to the schema. If any required fields are missing, do your best to infer them from the content.`,l={model:Yr.OPENAI_POSTPROCESSING,messages:[{role:"user",content:u}],response_format:{type:"json_schema",json_schema:{name:"extract",schema:a,strict:!0}}};M.info(`\u{1F4E4} Sending to OpenAI proxy: model=${Yr.OPENAI_POSTPROCESSING}, schema keys=${Object.keys(a.properties||{}).join(", ")}`),M.debug(` Schema size: ${JSON.stringify(a).length} chars`),M.debug(` Prompt size: ${u.length} chars`);try{let c={"Content-Type":"application/json"};process.env.OPENAI_PROXY_TOKEN?(c["x-proxy-token"]=r,c["x-execution-id"]=process.env.EXECUTION_ID||""):(c.Authorization=`Bearer ${r}`,c["x-api-key"]=process.env.ZIBBY_API_KEY||"",c["x-execution-id"]=process.env.EXECUTION_ID||"");let f=(await GB.post(n,l,{headers:c,timeout:Bp.OPENAI_REQUEST})).data?.choices?.[0]?.message?.content;if(!f)throw new Error("OpenAI proxy returned empty response");let p=JSON.parse(f);return M.info("\u2705 Successfully formatted with OpenAI proxy"),{structured:p,raw:e}}catch(c){if(c.response){let d=c.response.status,f=c.response.data;throw M.error(`\u274C OpenAI proxy request failed: ${d}`),M.error(` Status: ${d}`),M.error(` Response: ${JSON.stringify(f,null,2)}`),d===401||d===403?new Error(`Authentication failed for OpenAI proxy.
86
+ Run \`zibby login\` or set ZIBBY_USER_TOKEN environment variable.
87
+ Response: ${JSON.stringify(f)}`,{cause:c}):new Error(`Failed to format Cursor output: ${f?.error?.message||"Unknown error"}`,{cause:c})}throw M.error(`\u274C OpenAI proxy request failed: ${c.message}`),new Error(`Failed to format output: ${c.message}`,{cause:c})}}var $j=z(()=>{Sj();xi();Cs()});import{copyFileSync as eG,existsSync as Vk,lstatSync as tG,mkdirSync as Ej,rmSync as rG,symlinkSync as nG,unlinkSync as iG}from"node:fs";import{join as xa}from"node:path";import{homedir as aG}from"node:os";import{randomBytes as sG}from"node:crypto";function Pj(e){return!(!e||typeof e!="string"||process.env.ZIBBY_CURSOR_USE_GLOBAL_MCP==="1"||process.env.ZIBBY_CURSOR_USE_GLOBAL_MCP==="true")}function Tj(e){let t=xa(e||process.cwd(),".zibby","tmp");Ej(t,{recursive:!0});let r=`${process.pid}-${Date.now()}-${sG(4).toString("hex")}`,n=xa(t,`cursor-agent-home-${r}`),i=xa(n,".cursor");Ej(i,{recursive:!0});let a=aG(),s=xa(a,".cursor");if(Vk(s))for(let o of oG){let u=xa(s,o);if(Vk(u))try{eG(u,xa(i,o))}catch{}}if(process.platform==="darwin"){let o=xa(a,"Library");if(Vk(o))try{nG(o,xa(n,"Library"))}catch{}}return n}function Oj(e){if(!(!e||typeof e!="string"))try{let t=xa(e,"Library");try{tG(t).isSymbolicLink()&&iG(t)}catch{}rG(e,{recursive:!0,force:!0})}catch{}}var oG,Nj=z(()=>{oG=["cli-config.json","config.json","auth.json","argv.json"]});import{spawn as uG,execSync as Fs}from"node:child_process";import{writeFileSync as zj,readFileSync as Cj,mkdirSync as jj,existsSync as fd,accessSync as Aj,constants as Rj,unlinkSync as lG}from"node:fs";import{join as Ei,resolve as cG}from"node:path";import{homedir as pd}from"node:os";var md,Dj=z(()=>{Wa();xi();Cs();Wp();Hi();g_();Cb();$j();Uo();Nj();md=class extends Jr{constructor(){super("cursor","Cursor (CLI)",100)}canHandle(t){let r=[Ei(pd(),".local","bin","cursor-agent"),Ei(pd(),".cursor","bin","cursor-agent"),"/usr/local/bin/cursor-agent","/usr/local/bin/agent","/Applications/Cursor.app/Contents/Resources/app/bin/cursor","agent","cursor-agent"];for(let n of r)try{if(n.startsWith("/")){Aj(n,Rj.X_OK);let i=Fs(`"${n}" --version 2>&1`,{encoding:"utf-8",timeout:3e3,stdio:"pipe"});if(i&&i.length>0)return M.debug(`[Cursor] Found agent at: ${n} (version: ${i.trim().slice(0,50)})`),!0}else{let i=Fs(`which ${n}`,{encoding:"utf-8",timeout:2e3,stdio:"pipe"}).trim();if(!i)continue;let a=Fs(`${n} --version 2>&1`,{encoding:"utf-8",timeout:3e3,stdio:"pipe"});if(a&&a.length>0)return M.debug(`[Cursor] Found '${n}' in PATH at ${i} (version: ${a.trim().slice(0,50)})`),!0}}catch{continue}return M.warn("[Cursor] \u274C Cursor Agent CLI not found or not working. Run: agent --version"),!1}async invoke(t,r={}){let{workspace:n=process.cwd(),print:i=!1,schema:a=null,skills:s=null,sessionPath:o=null,nodeName:u=null,timeout:l=Bp.CURSOR_AGENT_DEFAULT,config:c={}}=r,d=c?.agent?.strictMode||!1,f=r.model??c?.agent?.cursor?.model??Yr.CURSOR;M.debug(`[Cursor] Invoking (model: ${f}, timeout: ${l/1e3}s, skills: ${JSON.stringify(s)})`);let h=(this._setupMcpConfig(o,n,c,s,u)||{}).isolatedMcpHome??null,y=[Ei(pd(),".local","bin","cursor-agent"),Ei(pd(),".cursor","bin","cursor-agent"),"/usr/local/bin/cursor-agent","/usr/local/bin/agent","/Applications/Cursor.app/Contents/Resources/app/bin/cursor","agent","cursor-agent"],_=null;for(let j of y)try{if(j.startsWith("/"))Aj(j,Rj.X_OK),Fs(`"${j}" --version 2>&1`,{encoding:"utf-8",timeout:3e3,stdio:"pipe"});else{if(!Fs(`which ${j}`,{encoding:"utf-8",timeout:2e3}).trim())throw new Error("not in PATH");Fs(`${j} --version 2>&1`,{encoding:"utf-8",timeout:3e3,stdio:"pipe"})}_=j,M.debug(`[Agent] Using binary: ${j}`);break}catch(P){M.debug(`[Agent] Binary '${j}' check failed: ${P.message}`);continue}if(!_)throw new Error(`Cursor Agent CLI not found or not working.
88
+
89
+ Checked paths:
90
+ ${y.map(j=>` - ${j}`).join(`
91
+ `)}
92
+
93
+ Install cursor-agent:
94
+ curl https://cursor.com/install -fsS | bash
95
+
96
+ Then add to PATH:
97
+ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
98
+
99
+ Test with: agent --version`);let m=null;if(a){let j=`zibby-result-${Date.now()}.json`;m=Ei(n,".zibby","tmp",j);let P=Ei(n,".zibby","tmp");fd(P)||jj(P,{recursive:!0});let U=ru.generateFileOutputInstructions(a,m);t=`${t}
100
+
101
+ ${U}`}let g=process.env.CURSOR_API_KEY,v=g?` | key: ***${g.slice(-4)}`:" | key: not set";console.log(`
102
+ \u25C6 Model: ${f||"auto"}${v}
103
+ `);let b=(await import("chalk")).default;console.log(`
104
+ ${b.bold("Prompt sent to LLM:")}`),console.log(b.dim("\u2500".repeat(60))),console.log(b.dim(t)),console.log(b.dim("\u2500".repeat(60)));let w=["--print","--force","--approve-mcps","--output-format","stream-json","--stream-partial-output","--model",f||"auto"];if(process.env.CURSOR_API_KEY&&w.push("--api-key",process.env.CURSOR_API_KEY),w.push(t),M.debug(`[Agent] Prompt: ${t.length} chars, model: ${f||"auto"}`),M.debug(`[Agent] Workspace: ${n}`),process.env.LOG_LEVEL==="debug"||process.env.ZIBBY_LOG_CURSOR_CLI==="1")try{console.log(`\u{1F527} Cursor CLI --model ${f||"auto"} (from .zibby.config.js agent.cursor.model)
105
+ `)}catch{}let x,k=null;try{let j=o||(process.env.ZIBBY_SESSION_PATH?String(process.env.ZIBBY_SESSION_PATH).trim():null);x=await this._spawnWithStreaming(_,w,n,l,null,j,h)}catch(j){k=j}let $=x?.stdout||"";if(a){let j=typeof a.parse=="function",P=null,U=!!(m&&fd(m));if(m&&M.info(`[Agent] Result file: ${U?"present":"missing"} at ${m}`),U)try{let C=Cj(m,"utf-8").trim();P=JSON.parse(C),M.info(`[Agent] Parsed JSON from result file OK (${C.length} chars) \u2192 object ready for validation`),k&&M.debug("[Agent] Agent exited non-zero but result file was written \u2014 recovering")}catch(C){M.warn(`\u26A0\uFE0F [Agent] Result file exists on disk but is not valid JSON: ${C.message}`)}else if(k)M.warn(`[Agent] Result file missing at ${m} (agent process error \u2014 may still recover if strictMode repairs)`);else throw M.error(`\u274C [Agent] Result file was never created at ${m}`),new Error(`Agent did not write required result file at ${m}`);if(P&&j)try{let C=a.parse(P);return M.info("\u2705 [Agent] Zod validation passed for structured result file"),d&&M.debug("[Agent] strictMode enabled but not needed \u2014 agent wrote valid file"),{raw:$,structured:C}}catch(C){M.warn(`\u26A0\uFE0F [Agent] JSON parsed but Zod rejected it (wrong types/shape): ${C.message?.slice(0,400)}`)}else{if(P)return M.info("\u2705 [Agent] File-based output extracted (no Zod parse fn) \u2014 accepting as structured"),d&&M.debug("[Agent] strictMode enabled but not needed \u2014 agent wrote valid file"),{raw:$,structured:P};U&&M.error("\u274C [Agent] Result file exists but produced no in-memory JSON (parse failed earlier)")}if(d&&!k){let C=x.parsedText,ne=P?JSON.stringify(P):C;M.info(`[Agent] strictMode: calling OpenAI proxy to fix structured output (${ne.length} chars in)`);try{let H=await Ij(ne,a);if(j){let Ze=a.parse(H.structured);return M.info("\u2705 [Agent] Proxy output passed Zod validation"),{raw:$,structured:Ze}}return{raw:$,...H}}catch(H){if(M.warn(`\u26A0\uFE0F [Agent] strictMode proxy failed: ${H.message}`),P)return M.warn("[Agent] Using agent's original result file as fallback"),{raw:$,structured:P}}}if(k)throw k;let B=U?P==null?"file existed but JSON.parse failed \u2014 see WARN log above":j?"JSON was valid but Zod validation failed \u2014 see WARN log above":"no structured object after read (unexpected)":"file never appeared (agent may not have run Write tool to the path above)";throw M.error(`\u274C [Agent] No validated structured output: ${B}`),M.error("\u{1F4A1} Tip: Set strictMode=true in .zibby.config.js for OpenAI proxy fallback"),new Error(`Agent did not produce a valid result file at ${m}. Enable strictMode for proxy fallback.`)}if(k)throw k;return this._extractFinalResult($)||x?.parsedText||$}_extractFinalResult(t){if(!t)return null;let r=t.split(`
106
+ `),n=null;for(let i of r){let a=i.trim();if(a)try{let s=JSON.parse(a);if(s.type==="assistant"&&s.message?.content){let o=s.message.content;if(Array.isArray(o)){let u=o.filter(l=>l.type==="text"&&l.text).map(l=>l.text).join("");u&&(n=u)}else typeof o=="string"&&o&&(n=o)}}catch{}}return n?.trim()||null}_setupMcpConfig(t,r,n,i=null,a=null){let s=n?.headless,o=Ei(pd(),".cursor"),u=Ei(o,"mcp.json"),l={};if(fd(u))try{l=JSON.parse(Cj(u,"utf-8"))}catch{}let c=l.mcpServers||{},d=n?.paths?.output||Mo,f=Ei(r||process.cwd(),d,Va),p=Array.isArray(i)?i.map(_=>Ir(_)).filter(Boolean):[...Gp()].map(([,_])=>_),h=new Set;for(let _ of p)typeof _.resolve=="function"&&(h.has(_.serverName)||(h.add(_.serverName),this._ensureSkillConfigured(c,_,t,f,a,s)));if(t){let _=Ir("browser");_&&typeof _.resolve=="function"&&!h.has(_.serverName)&&this._ensureSkillConfigured(c,_,t,f,"execute_live",s)}if(Object.keys(c).length===0)return M.debug("[MCP] No MCP servers configured - agent will run without tool access"),{isolatedMcpHome:null};let y=`${JSON.stringify({mcpServers:c},null,2)}
107
+ `;if(Pj(t)){let _=Tj(r||process.cwd()),m=Ei(_,".cursor","mcp.json");return zj(m,y,"utf8"),M.debug(`[MCP] Isolated cursor-agent HOME (session-scoped mcp.json): ${_} | servers: ${Object.keys(c).join(", ")}`),{isolatedMcpHome:_}}return fd(o)||jj(o,{recursive:!0}),zj(u,y,"utf8"),M.debug(`[MCP] Global ~/.cursor/mcp.json | servers: ${Object.keys(c).join(", ")}`),{isolatedMcpHome:null}}_ensureSkillConfigured(t,r,n,i,a=null,s){let o=r.cursorKey||r.serverName,u=t[o]?o:t[r.serverName]?r.serverName:null;if(u&&n){let c=typeof r.resolve=="function"?r.resolve({sessionPath:n,nodeName:a,headless:s}):null;c?.args?t[u].args=c.args:t[u].args=(t[u].args||[]).map(p=>p.startsWith("--output-dir=")?`--output-dir=${n}`:p);let d=c?.env||{},f=r.sessionEnvKey?{[r.sessionEnvKey]:i}:{};t[u].env={...t[u].env||{},...d,...f},M.debug(`[MCP] Updated ${u} session \u2192 ${n}`);return}if(u)return;let l=r.resolve({sessionPath:n,nodeName:a,headless:s});l&&(t[o]={...l,...r.sessionEnvKey&&{env:{...l.env||{},[r.sessionEnvKey]:i}}},M.debug(`[MCP] Configured ${o}`))}_spawnWithStreaming(t,r,n,i,a=null,s=null,o=null){return new Promise((u,l)=>{let c=Date.now(),d="",f="",p=Date.now(),h=0,y=!1,_=null,m=!1,g=!1,v=null;if(s)try{v=Ei(cG(String(s)),Vp)}catch{v=null}let b=!1,w=()=>{b||(b=!0,Oj(o))},x={...process.env};o&&(x.HOME=o,process.platform==="win32"&&(x.USERPROFILE=o),M.debug(`[Agent] cursor-agent HOME=${o} (isolated MCP config)`));let k=uG(t,r,{cwd:n,shell:!1,stdio:["pipe","pipe","pipe"],env:x});M.debug(`[Agent] PID: ${k.pid}`),k.stdin.on("error",C=>{C.code!=="EPIPE"&&M.warn(`[Agent] stdin error: ${C.message}`)}),k.stdout.on("error",C=>{C.code!=="EPIPE"&&M.warn(`[Agent] stdout error: ${C.message}`)}),k.stderr.on("error",C=>{C.code!=="EPIPE"&&M.warn(`[Agent] stderr error: ${C.message}`)}),a?(k.stdin.write(a,C=>{C&&C.code!=="EPIPE"&&M.warn(`[Agent] Failed to write to stdin: ${C.message}`),k.stdin.end()}),M.debug(`[Agent] Prompt also piped to stdin (${a.length} chars)`)):k.stdin.end();let $=null;v&&($=setInterval(()=>{if(!(y||g))try{if(fd(v)){y=!0,_="studio-stop";try{lG(v)}catch{}M.warn("\u{1F6D1} Studio stop requested \u2014 terminating Cursor agent (and MCP browser session)"),k.kill("SIGTERM"),setTimeout(()=>{k.killed||k.kill("SIGKILL")},2e3)}}catch{}},600));let T=new Set,j=new Date(c).toISOString().replace(/\.\d+Z$/,""),P=setInterval(()=>{let C=Math.round((Date.now()-c)/1e3),ne=Math.round((Date.now()-p)/1e3),H=[];try{let zt=Math.ceil(C/60)+1,ge=Fs(`find "${n}" -type f -mmin -${zt} -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/target/*' 2>/dev/null | head -20`,{encoding:"utf-8",timeout:5e3}).trim();if(ge)for(let Y of ge.split(`
108
+ `)){let O=Y.replace(`${n}/`,"");T.has(O)||(T.add(O),H.push(O))}}catch{}let Ze="";H.length>0&&(Ze=` | \u{1F4C1} new: ${H.map(ge=>ge.split("/").pop()).join(", ")}`),T.size>0&&(Ze+=` | \u{1F4E6} total: ${T.size} files`),M.debug(`\u{1F493} [Agent] Running for ${C}s | ${h} lines output${Ze}`),h===0&&C>=30&&T.size===0&&(C<35&&M.warn(`\u26A0\uFE0F [Agent] No output after ${C}s \u2014 agent may be stuck. Check your CURSOR_API_KEY.`),C>=60&&(y=!0,_=_||"stall",M.error(`\u274C [Agent] No response after ${C}s \u2014 killing. Verify CURSOR_API_KEY is valid and agent CLI works: agent --version`),k.kill("SIGTERM"),setTimeout(()=>{k.killed||k.kill("SIGKILL")},3e3)))},3e4),U=setTimeout(()=>{y=!0,_=_||"timeout";let C=Math.round((Date.now()-c)/1e3);M.error(`\u23F1\uFE0F [Agent] Timeout after ${C}s \u2014 killing process (PID: ${k.pid})`),d.trim()&&M.warn(`\u{1F4E4} [Agent] Partial output (${d.length} chars) before timeout:
109
+ ${d.slice(-2e3)}`),k.kill("SIGTERM"),setTimeout(()=>{k.killed||k.kill("SIGKILL")},5e3)},i),B=new Lo;B.onToolCall=(C,ne)=>{let H=C,Ze=ne;if(C==="mcpToolCall"&&ne?.name)H=ne.name.replace(/^mcp_+[^_]+_+/,""),H.includes("-")&&H.split("-")[0]===H.split("-")[1]&&(H=H.split("-")[0]),Ze=ne.args??ne.input??ne;else{if(C==="readToolCall"||C==="editToolCall"||C==="writeToolCall")return;(C.startsWith("mcp__")||C.includes("ToolCall"))&&(H=C.replace(/^mcp_+[^_]+_+/,"").replace(/ToolCall$/,""))}if(H.includes("memory")?Ht.stepMemory(`Tool: ${H}`):Ht.stepTool(`Tool: ${H}`),Ze!=null&&typeof Ze=="object"&&Object.keys(Ze).length>0&&!g){let ge=JSON.stringify(Ze),Y=ge.length>100?`${ge.substring(0,100)}...`:ge;console.log(` Input: ${Y}`)}},k.stdout.on("data",C=>{let ne=C.toString();d+=ne,p=Date.now(),m||(m=!0);let H=B.processChunk(ne);H&&!g&&process.stdout.write(H);let Ze=ne.split(`
110
+ `).filter(zt=>zt.trim());h+=Ze.length}),k.stderr.on("data",C=>{let ne=C.toString();f+=ne,p=Date.now(),m||(m=!0);let H=ne.split(`
111
+ `).filter(Ze=>Ze.trim());for(let Ze of H)M.warn(`\u26A0\uFE0F [Agent stderr] ${Ze}`)}),k.on("close",(C,ne)=>{g=!0,w(),clearTimeout(U),clearInterval(P),$&&clearInterval($),B.flush();let H=Math.round((Date.now()-c)/1e3);if(M.debug(`[Agent] Exited: code=${C}, signal=${ne}, elapsed=${H}s, output=${d.length} chars`),y){if(_==="studio-stop"){l(new Error("Stopped from Zibby Studio"));return}l(new Error(`Cursor Agent timed out after ${H}s (limit: ${i/1e3}s). ${h} lines produced. Last output ${Math.round((Date.now()-p)/1e3)}s ago. ${d.trim()?`
112
+ Partial output (last 500 chars):
113
+ ${d.slice(-500)}`:"No output captured."}`));return}if(C!==0){l(new Error(`Cursor Agent failed: exit code ${C}, signal ${ne}. ${f.trim()?`
114
+ Stderr: ${f.slice(-1e3)}`:""}${d.trim()?`
115
+ Stdout (last 500 chars): ${d.slice(-500)}`:""}`));return}let Ze=B.getResult(),zt=Ze?JSON.stringify(Ze,null,2):B.getRawText()||d||"";u({stdout:d||f||"",parsedText:zt})}),k.on("error",C=>{w(),clearTimeout(U),clearInterval(P),$&&clearInterval($),l(new Error(`Cursor Agent spawn error: ${C.message}
116
+ Binary: ${t}
117
+ This usually means the binary is not in PATH. Try:
118
+ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc`))})})}}});import{execFile as KK}from"child_process";import{randomUUID as HK}from"crypto";import{createReadStream as EIe,realpathSync as JK}from"fs";import{copyFile as YK,mkdir as Wk,readdir as TIe,readFile as QK,rm as XK,writeFile as pR}from"fs/promises";import{createRequire as eH}from"module";import{homedir as sS,tmpdir as tH}from"os";import{dirname as Mj,isAbsolute as mR,join as Pi,relative as rH,resolve as Mh,sep as hR}from"path";import{fileURLToPath as nH}from"url";import{setMaxListeners as iH}from"events";import{spawn as oH}from"child_process";import{createInterface as uH}from"readline";import{homedir as G8}from"os";import{join as K8}from"path";import{randomUUID as UJ}from"crypto";import{appendFile as MJ,mkdir as LJ}from"fs/promises";import{join as gA}from"path";import{realpathSync as vA}from"fs";import{cwd as qJ}from"process";import{randomUUID as yS}from"crypto";import{appendFile as yA,mkdir as HJ,symlink as JJ,unlink as YJ}from"fs/promises";import{dirname as BR,join as XS}from"path";import*as Fe from"fs";import{mkdir as aY,open as sY,readdir as oY,readFile as bA,rename as uY,rmdir as lY,rm as cY,stat as dY,unlink as fY}from"fs/promises";import{fileURLToPath as e$e}from"url";import{readFile as r$e}from"fs/promises";import{once as kA}from"events";import{createWriteStream as DY}from"fs";import{open as s$e,readdir as o$e,realpath as u$e,stat as l$e}from"fs/promises";import{join as d$e}from"path";import{execFile as UY}from"child_process";import{promisify as MY}from"util";import{readdir as _$e,stat as b$e}from"fs/promises";import{basename as x$e,join as k$e}from"path";import{constants as I$e}from"fs";import{open as E$e,readdir as P$e,rm as T$e,stat as O$e}from"fs/promises";import{join as z$e}from"path";import{randomUUID as j$e}from"crypto";import{readdir as R$e,readFile as D$e}from"fs/promises";import{join as M$e}from"path";import{readdir as Z$e,readFile as q$e}from"fs/promises";import{join as V$e}from"path";import{createHash as BY}from"crypto";import{userInfo as GY}from"os";function hG(e){return this[e]}function _G(e,t){this[e]=yG.bind(null,t)}function gR(e=aH){let t=new AbortController;return iH(e,t.signal),t}function vR(e,t,r){return new Promise((n,i)=>{if(t?.aborted){r?.throwOnAbort||r?.abortError?i(r.abortError?.()??Error("aborted")):n();return}let a=setTimeout((o,u,l)=>{o?.removeEventListener("abort",u),l()},e,t,s,n);function s(){clearTimeout(a),r?.throwOnAbort||r?.abortError?i(r.abortError?.()??Error("aborted")):n()}t?.addEventListener("abort",s,{once:!0}),r?.unref&&a.unref()})}function sH(e,t){e(Error(t))}function Rd(e,t,r){let n,i=new Promise((a,s)=>{n=setTimeout(sH,t,s,r),typeof n=="object"&&n.unref?.()});return Promise.race([e,i]).finally(()=>{n!==void 0&&clearTimeout(n)})}function yR(){return process.versions.bun!==void 0}function Pu(e){if(!e)return!1;if(typeof e=="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function FS(){let e=new Set;return{subscribe(t){return e.add(t),()=>{e.delete(t)}},emit(...t){let r;for(let n of e)try{n(...t)}catch(i){(r??=[]).push(i)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}function gH(e){var t=mH.call(e,hd),r=e[hd];try{e[hd]=void 0;var n=!0}catch{}var i=hH.call(e);return n&&(t?e[hd]=r:delete e[hd]),i}function bH(e){return _H.call(e)}function SH(e){return e==null?e===void 0?kH:xH:Lj&&Lj in Object(e)?vH(e):wH(e)}function $H(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function NH(e){if(!bR(e))return!1;var t=IH(e);return t==PH||t==TH||t==EH||t==OH}function jH(e){return!!Zj&&Zj in e}function UH(e){if(e!=null){try{return DH.call(e)}catch{}try{return e+""}catch{}}return""}function GH(e){if(!bR(e)||AH(e))return!1;var t=zH(e)?BH:ZH;return t.test(MH(e))}function HH(e,t){return e?.[t]}function YH(e,t){var r=JH(e,t);return KH(r)?r:void 0}function XH(){this.__data__=Ud?Ud(null):{},this.size=0}function t8(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function s8(e){var t=this.__data__;if(Ud){var r=t[e];return r===n8?void 0:r}return a8.call(t,e)?t[e]:void 0}function c8(e){var t=this.__data__;return Ud?t[e]!==void 0:l8.call(t,e)}function p8(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ud&&t===void 0?f8:t,this}function Qu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function h8(){this.__data__=[],this.size=0}function v8(e,t){return e===t||e!==e&&t!==t}function _8(e,t){for(var r=e.length;r--;)if(y8(e[r][0],t))return r;return-1}function x8(e){var t=this.__data__,r=jg(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():w8.call(t,r,1),--this.size,!0}function S8(e){var t=this.__data__,r=jg(t,e);return r<0?void 0:t[r][1]}function $8(e){return jg(this.__data__,e)>-1}function P8(e,t){var r=this.__data__,n=jg(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Xu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function C8(){this.size=0,this.__data__={hash:new qj,map:new(z8||O8),string:new qj}}function A8(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function D8(e,t){var r=e.__data__;return R8(t)?r[typeof t=="string"?"string":"hash"]:r.map}function U8(e){var t=Ag(this,e).delete(e);return this.size-=t?1:0,t}function L8(e){return Ag(this,e).get(e)}function q8(e){return Ag(this,e).has(e)}function V8(e,t){var r=Ag(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function el(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function WS(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(B8);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(WS.Cache||xR),r}function fe(e,t,r,n,i){if(n==="m")throw TypeError("Private method is not writable");if(n==="a"&&!i)throw TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function L(e,t,r,n){if(r==="a"&&!n)throw TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Md(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}function lS(e){return typeof e!="object"?{}:e??{}}function Vj(e){if(!e)return!0;for(let t in e)return!1;return!0}function Y8(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tJ(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function nJ(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,a=n[2]||0,s=n[3]||0;return{browser:t,version:`${i}.${a}.${s}`}}}return null}function aJ(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function IR(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function $R(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return IR({start(){},async pull(r){let{done:n,value:i}=await t.next();n?r.close():r.enqueue(i)},async cancel(){await t.return?.()}})}function GS(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function sJ(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}function uJ(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new Re(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function lJ(e){let t=0;for(let i of e)t+=i.length;let r=new Uint8Array(t),n=0;for(let i of e)r.set(i,n),n+=i.length;return r}function KS(e){let t;return(Kj??(t=new globalThis.TextEncoder,Kj=t.encode.bind(t)))(e)}function Jj(e){let t;return(Hj??(t=new globalThis.TextDecoder,Hj=t.decode.bind(t)))(e)}function cJ(e,t){for(let r=t??0;r<e.length;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function dJ(e){for(let t=0;t<e.length-1;t++){if(e[t]===10&&e[t+1]===10||e[t]===13&&e[t+1]===13)return t+2;if(e[t]===13&&e[t+1]===10&&t+3<e.length&&e[t+2]===13&&e[t+3]===10)return t+4}return-1}function zd(){}function mh(e,t,r){return!t||Jh[e]>Jh[r]?zd:t[e].bind(t)}function sn(e){let t=e.logger,r=e.logLevel??"off";if(!t)return fJ;let n=Qj.get(t);if(n&&n[0]===r)return n[1];let i={error:mh("error",t,r),warn:mh("warn",t,r),info:mh("info",t,r),debug:mh("debug",t,r)};return Qj.set(t,[r,i]),i}async function*pJ(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Re("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Re("Attempted to iterate over a response with no body");let r=new cS,n=new Js,i=GS(e.body);for await(let a of mJ(i))for(let s of n.decode(a)){let o=r.decode(s);o&&(yield o)}for(let a of n.flush()){let s=r.decode(a);s&&(yield s)}}async function*mJ(e){let t=new Uint8Array;for await(let r of e){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?KS(r):r,i=new Uint8Array(t.length+n.length);i.set(t),i.set(n,t.length),t=i;let a;for(;(a=dJ(t))!==-1;)yield t.slice(0,a),t=t.slice(a)}t.length>0&&(yield t)}function hJ(e,t){let r=e.indexOf(t);return r!==-1?[e.substring(0,r),t,e.substring(r+t.length)]:[e,"",""]}async function ER(e,t){let{response:r,requestLogID:n,retryOfRequestLogID:i,startTime:a}=t,s=await(async()=>{if(t.options.stream)return sn(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(r,t.controller):Ys.fromSSEResponse(r,t.controller);if(r.status===204)return null;if(t.options.__binaryResponse)return r;let o=r.headers.get("content-type")?.split(";")[0]?.trim();if(o?.includes("application/json")||o?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return PR(u,r)}return await r.text()})();return sn(e).debug(`[${n}] response parsed`,Gs({retryOfRequestLogID:i,url:r.url,status:r.status,body:s,durationMs:Date.now()-a})),s}function PR(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}function Tu(e,t,r){return TR(),new File(e,t??"unknown_file",r)}function Ch(e,t){let r=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?r.split(/[\\/]/).pop()||void 0:r}function gJ(e){let t=typeof e=="function"?e:e.fetch,r=Xj.get(t);if(r)return r;let n=(async()=>{try{let i="Response"in t?t.Response:(await t("data:,")).constructor,a=new FormData;return a.toString()!==await new i(a).text()}catch{return!0}})();return Xj.set(t,n),n}async function wJ(e,t,r){if(TR(),e=await e,t||(t=Ch(e,!0)),_J(e))return e instanceof File&&t==null&&r==null?e:Tu([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...r});if(bJ(e)){let i=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),Tu(await pS(i),t,r)}let n=await pS(e);if(!r?.type){let i=n.find(a=>typeof a=="object"&&"type"in a&&a.type);typeof i=="string"&&(r={...r,type:i})}return Tu(n,t,r)}async function pS(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(NR(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(OR(e))for await(let r of e)t.push(...await pS(r));else{let r=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${r?`; constructor: ${r}`:""}${xJ(e)}`)}return t}function xJ(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(t=>`"${t}"`).join(", ")}]`}function*kJ(e){if(!e)return;if(zR in e){let{values:n,nulls:i}=e;yield*n.entries();for(let a of i)yield[a,null];return}let t=!1,r;e instanceof Headers?r=e.entries():Fj(e)?r=e:(t=!0,r=Object.entries(e??{}));for(let n of r){let i=n[0];if(typeof i!="string")throw TypeError("expected header name to be a string");let a=Fj(n[1])?n[1]:[n[1]],s=!1;for(let o of a)o!==void 0&&(t&&!s&&(s=!0,yield[i,null]),yield[i,o])}}function jh(e){return typeof e=="object"&&e!==null&&Dd in e}function CR(e,t){let r=new Set;if(e)for(let n of e)jh(n)&&r.add(n[Dd]);if(t){for(let n of t)if(jh(n)&&r.add(n[Dd]),Array.isArray(n.content))for(let i of n.content)jh(i)&&r.add(i[Dd])}return Array.from(r)}function jR(e,t){let r=CR(e,t);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function SJ(e){return jh(e)?{"x-stainless-helper":e[Dd]}:{}}function AR(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function DR(e){return e?.output_format??e?.output_config?.format}function tA(e,t,r){let n=DR(t);return!t||!("parse"in(n??{}))?{...e,content:e.content.map(i=>{if(i.type==="text"){let a=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:UR(e,t,r)}function UR(e,t,r){let n=null,i=e.content.map(a=>{if(a.type==="text"){let s=$J(t,a.text);n===null&&(n=s);let o=Object.defineProperty({...a},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return a});return{...e,content:i,parsed_output:n}}function $J(e,t){let r=DR(e);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(t):JSON.parse(t)}catch(n){throw new Re(`Failed to parse structured output: ${n}`)}}function aA(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}function oA(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}async function zJ(e,t=e.messages.at(-1)){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let r=t.content.filter(n=>n.type==="tool_use");return r.length===0?null:{role:"user",content:await Promise.all(r.map(async n=>{let i=e.tools.find(a=>("name"in a?a.name:a.mcp_server_name)===n.name);if(!i||!("run"in i))return{type:"tool_result",tool_use_id:n.id,content:`Error: Tool '${n.name}' not found`,is_error:!0};try{let a=n.input;"parse"in i&&i.parse&&(a=i.parse(a));let s=await i.run(a);return{type:"tool_result",tool_use_id:n.id,content:s}}catch(a){return{type:"tool_result",tool_use_id:n.id,content:a instanceof rg?a.content:`Error: ${a instanceof Error?a.message:String(a)}`,is_error:!0}}}))}}function lA(e){if(!e.output_format)return e;if(e.output_config?.format)throw new Re("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...r}=e;return{...r,output_config:{...e.output_config,format:t}}}function LR(e){return e?.output_config?.format}function cA(e,t,r){let n=LR(t);return!t||!("parse"in(n??{}))?{...e,content:e.content.map(i=>i.type==="text"?Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1}):i),parsed_output:null}:ZR(e,t,r)}function ZR(e,t,r){let n=null,i=e.content.map(a=>{if(a.type==="text"){let s=jJ(t,a.text);return n===null&&(n=s),Object.defineProperty({...a},"parsed_output",{value:s,enumerable:!1})}return a});return{...e,content:i,parsed_output:n}}function jJ(e,t){let r=LR(e);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(t):JSON.parse(t)}catch(n){throw new Re(`Failed to parse structured output: ${n}`)}}function mA(e){return e.type==="tool_use"||e.type==="server_tool_use"}function YS(e){return e instanceof Error?e:Error(String(e))}function Rh(e){return e instanceof Error?e.message:String(e)}function Ou(e){if(e&&typeof e=="object"&&"code"in e&&typeof e.code=="string")return e.code}function QS(e){return Ou(e)==="ENOENT"}function FR(e){return Ou(e)==="EISDIR"}function VR(){if(xu)return xu;if(!Pu(process.env.DEBUG_CLAUDE_AGENT_SDK))return Hs=null,xu=Promise.resolve(),xu;let e=gA(BS(),"debug");return Hs=gA(e,`sdk-${UJ()}.txt`),process.stderr.write(`SDK debug logs: ${Hs}
119
+ `),xu=LJ(e,{recursive:!0}).then(()=>{}).catch(()=>{}),xu}function ZJ(){return VR(),Hs??null}function Xi(e){if(Hs===null)return;let t=`${new Date().toISOString()} ${e}
120
+ `;VR().then(()=>{Hs&&MJ(Hs,t).catch(()=>{})})}function VJ(){let e="";if(typeof process<"u"&&typeof process.cwd=="function"&&typeof vA=="function"){let t=qJ();try{e=vA(t).normalize("NFC")}catch{e=t.normalize("NFC")}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,hasStreamingInput:!1,kairosActive:!1,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:yS(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,sdkOAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:FJ,replBridgeActive:!1,directConnectServerUrl:void 0,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],activeInputs:new Map,hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,cacheDiagnosisHeaderLatched:null,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}function WR(){return WJ.sessionId}function QJ({writeFn:e,flushIntervalMs:t=1e3,maxBufferSize:r=100,maxBufferBytes:n=1/0,immediateMode:i=!1}){let a=[],s=0,o=null,u=null;function l(){o&&(clearTimeout(o),o=null)}function c(){u&&(e(u.join("")),u=null),a.length!==0&&(e(a.join("")),a=[],s=0,l())}function d(){o||(o=setTimeout(c,t))}function f(){if(u){u.push(...a),a=[],s=0,l();return}let p=a;a=[],s=0,l(),u=p,setImmediate(()=>{let h=u;u=null,h&&e(h.join(""))})}return{write(p){if(i){e(p);return}a.push(p),s+=p.length,d(),(a.length>=r||s>=n)&&f()},flush:c,dispose(){c()}}}function XJ(e){return typeof e=="function"?e:Symbol.asyncDispose in e?()=>e[Symbol.asyncDispose]():()=>e[Symbol.dispose]()}function eY(e){let t=XJ(e);return _A.add(t),()=>_A.delete(t)}function rY(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let a=e.match(/^([^:[]+):/);a&&a[1]&&t.push(a[1].trim().toLowerCase())}let n=e.match(/^\[([^\]]+)]/);n&&n[1]&&t.push(n[1].trim().toLowerCase()),e.toLowerCase().includes("1p event:")&&t.push("1p");let i=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(i&&i[1]){let a=i[1].trim().toLowerCase();a.length<30&&!a.includes(" ")&&t.push(a)}return Array.from(new Set(t))}function nY(e,t){return t?e.length===0?!1:t.isExclusive?!e.some(r=>t.exclude.includes(r)):e.some(r=>t.include.includes(r)):!0}function iY(e,t){if(!t)return!0;let r=rY(e);return nY(r,t)}function rS(){return mY}function hY(e,t){e.destroyed||e.write(t)}function gY(e){hY(process.stderr,e)}function Rg(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function bY(e){if(!bS()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let t=_Y();return iY(e,t)}function HR(e){return wS=XS(e,`${WR()}.txt`),wS}async function xY(e,t,r,n){e&&await HJ(t,{recursive:!0}).catch(()=>{});try{await yA(r,n)}catch(i){if(!FR(i))throw i;await yA(HR(r),n)}YR()}function kY(){}function SY(){if(!Oh){let e=null;Oh=QJ({writeFn:t=>{let r=JR(),n=BR(r),i=e!==n;if(e=n,bS()){if(i)try{rS().mkdirSync(n)}catch{}try{rS().appendFileSync(r,t)}catch(a){if(!FR(a))throw a;rS().appendFileSync(HR(r),t)}YR();return}nS=nS.then(xY.bind(null,i,n,r,t)).catch(kY)},flushIntervalMs:1e3,maxBufferSize:100,immediateMode:bS()}),eY(async()=>{Oh?.dispose(),await nS})}return Oh}function Zr(e,{level:t}={level:"debug"}){if(_S[t]<_S[vY()]||!bY(e))return;wY&&e.includes(`
121
+ `)&&(e=on(e));let r=`${new Date().toISOString()} [${t.toUpperCase()}] ${e.trim()}
122
+ `;if(GR()){gY(r);return}SY().write(r)}function JR(){return KR()??wS??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??XS(BS(),"debug",`${WR()}.txt`)}function $Y(){return IY}function on(e,t,r){let n=[];try{let s=sr(n,ur`JSON.stringify(${e})`,0);return JSON.stringify(e,t,r)}catch(s){var i=s,a=1}finally{or(n,i,a)}}function EY(e){let t=e.trim();return t.startsWith("{")&&t.endsWith("}")}function PY(e,t){let r={...e};if(t){let n=t.enabled===!0&&t.failIfUnavailable===void 0?{...t,failIfUnavailable:!0}:t,i=r.settings;if(i&&!EY(i))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let a={sandbox:n};if(i)try{a={...eI(i),sandbox:n}}catch{}r.settings=on(a)}return r}function OY(){for(let e of cg)e.killed||e.kill("SIGTERM")}function NY(e){cg.add(e),!wA&&(wA=!0,process.on("exit",OY))}function zY(e){return![".js",".mjs",".tsx",".ts",".jsx"].some(t=>e.endsWith(t))}function CY(e,t=process.platform,r=process.arch){let n=t==="win32"?".exe":"",i=(t==="linux"?[`@anthropic-ai/claude-agent-sdk-linux-${r}-musl`,`@anthropic-ai/claude-agent-sdk-linux-${r}`]:[`@anthropic-ai/claude-agent-sdk-${t}-${r}`]).map(a=>`${a}/claude${n}`);for(let a of i)try{return e(a)}catch{}return null}function LY(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}function qY(e){return typeof e!="string"?null:ZY.test(e)?e:null}async function SA(e,t){let r=DY(e,{mode:384});try{for(let n of t)r.write(JSON.stringify(n)+`
123
+ `)||await kA(r,"drain");r.end(),await kA(r,"finish")}catch(n){throw r.destroy(),n}}function FY(e){return Math.abs(LY(e)).toString(36)}function VY(e){let t=e.replace(/[^a-zA-Z0-9]/g,"-");return t.length<=IA?t:`${t.slice(0,IA)}-${FY(e)}`}function KY(e){return[...new Set(e)]}function HY(){return"prod"}function t7(){let e=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",t=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:e,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${t}/oauth/authorize`,CLAUDE_AI_ORIGIN:t,TOKEN_URL:`${e}/v1/oauth/token`,API_KEY_URL:`${e}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${e}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function n7(){let e=(()=>{switch(HY()){case"local":return t7();case"staging":return e7??$A;case"prod":return $A}})(),t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let n=t.replace(/\/$/,"");if(!r7.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");e={...e,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(e={...e,CLIENT_ID:r}),e}function a7(e=""){let t=BS(),r=process.env.CLAUDE_CONFIG_DIR?`-${BY("sha256").update(t).digest("hex").substring(0,8)}`:"";return`Claude Code${n7().OAUTH_FILE_SUFFIX}${e}${r}`}function s7(){try{return process.env.USER||GY().username}catch{return"claude-code-user"}}function ES(){return u7}function le(e,t){let r=ES(),n=PS({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===qd?void 0:qd].filter(i=>!!i)});e.common.issues.push(n)}function Be(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{let{message:o}=e;return a.code==="invalid_enum_value"?{message:o??s.defaultError}:typeof s.data>"u"?{message:o??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:o??r??s.defaultError}},description:i}}function e4(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function I7(e){return new RegExp(`^${e4(e)}$`)}function $7(e){let t=`${XR}T${e4(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function E7(e,t){return!!((t==="v4"||!t)&&y7.test(e)||(t==="v6"||!t)&&b7.test(e))}function P7(e,t){if(!m7.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function T7(e,t){return!!((t==="v4"||!t)&&_7.test(e)||(t==="v6"||!t)&&w7.test(e))}function O7(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}function Iu(e){if(e instanceof Vn){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ti.create(Iu(n))}return new Vn({...e._def,shape:()=>t})}else return e instanceof ls?new ls({...e._def,type:Iu(e.element)}):e instanceof Ti?Ti.create(Iu(e.unwrap())):e instanceof Ta?Ta.create(Iu(e.unwrap())):e instanceof Pa?Pa.create(e.items.map(t=>Iu(t))):e}function OS(e,t){let r=as(e),n=as(t);if(e===t)return{valid:!0,data:e};if(r===me.object&&n===me.object){let i=It.objectKeys(t),a=It.objectKeys(e).filter(o=>i.indexOf(o)!==-1),s={...e,...t};for(let o of a){let u=OS(e[o],t[o]);if(!u.valid)return{valid:!1};s[o]=u.data}return{valid:!0,data:s}}else if(r===me.array&&n===me.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let s=e[a],o=t[a],u=OS(s,o);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===me.date&&n===me.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function t4(e,t){return new qu({values:e,typeName:Ae.ZodEnum,...Be(t)})}function R(e,t,r){function n(o,u){var l;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(l=o._zod).traits??(l.traits=new Set),o._zod.traits.add(e),t(o,u);for(let c in s.prototype)c in o||Object.defineProperty(o,c,{value:s.prototype[c].bind(o)});o._zod.constr=s,o._zod.def=u}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function s(o){var u;let l=r?.Parent?new a:this;n(l,o),(u=l._zod).deferred??(u.deferred=[]);for(let c of l._zod.deferred)c();return l}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function dn(e){return e&&Object.assign(mg,e),mg}function N7(e){return e}function z7(e){return e}function C7(e){}function j7(e){throw Error()}function A7(e){}function tI(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function se(e,t="|"){return e.map(r=>He(r)).join(t)}function a4(e,t){return typeof t=="bigint"?t.toString():t}function Dg(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error("cached value already set")}}}function io(e){return e==null}function Ug(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function s4(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}function Ct(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function rI(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function R7(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function D7(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<t.length;a++)i[t[a]]=n[a];return i})}function U7(e=10){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return t}function $u(e){return JSON.stringify(e)}function Xd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ef(e){if(Xd(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(Xd(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function M7(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function ao(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ji(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Z7(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,a){return t??(t=e()),Reflect.set(t,n,i,a)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function He(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function l4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function q7(e,t){let r={},n=e._zod.def;for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return ji(e,{...e._zod.def,shape:r,checks:[]})}function F7(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return ji(e,{...e._zod.def,shape:r,checks:[]})}function V7(e,t){if(!ef(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return rI(this,"shape",n),n},checks:[]};return ji(e,r)}function W7(e,t){return ji(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return rI(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function B7(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in n))throw Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)i[a]=e?new e({type:"optional",innerType:n[a]}):n[a];return ji(t,{...t._zod.def,shape:i,checks:[]})}function G7(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return ji(t,{...t._zod.def,shape:i,checks:[]})}function Nu(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ei(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ad(e){return typeof e=="string"?e:e?.message}function zi(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Ad(e.inst?._zod.def?.error?.(e))??Ad(t?.error?.(e))??Ad(r.customError?.(e))??Ad(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,!t?.reportInput&&delete n.input,n}function Mg(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Lg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function f4(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function K7(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function aI(e,t=r=>r.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function sI(e,t){let r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>i({issues:o}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let o=n,u=0;for(;u<s.path.length;){let l=s.path[u];u!==s.path.length-1?o[l]=o[l]||{_errors:[]}:(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(s))),o=o[l],u++}}};return i(e),n}function m4(e,t){let r=t||function(a){return a.message},n={errors:[]},i=(a,s=[])=>{var o,u;for(let l of a.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>i({issues:c},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let c=[...s,...l.path];if(c.length===0){n.errors.push(r(l));continue}let d=n,f=0;for(;f<c.length;){let p=c[f],h=f===c.length-1;typeof p=="string"?(d.properties??(d.properties={}),(o=d.properties)[p]??(o[p]={errors:[]}),d=d.properties[p]):(d.items??(d.items=[]),(u=d.items)[p]??(u[p]={errors:[]}),d=d.items[p]),h&&d.errors.push(r(l)),f++}}};return i(e),n}function h4(e){let t=[];for(let r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function g4(e){let t=[],r=[...e.issues].sort((n,i)=>n.path.length-i.path.length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${h4(n.path)}`);return t.join(`
124
+ `)}function $4(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function R4(e){return typeof e.precision=="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.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{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function D4(e){return new RegExp(`^${R4(e)}$`)}function U4(e){let t=R4({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${j4}T(?:${n})$`)}function NA(e,t,r){e.issues.length&&t.issues.push(...ei(r,e.issues))}function vI(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function jD(e){if(!mI.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return vI(r)}function DD(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}function zA(e,t,r){e.issues.length&&t.issues.push(...ei(r,e.issues)),t.value[r]=e.value}function Nh(e,t,r){e.issues.length&&t.issues.push(...ei(r,e.issues)),t.value[r]=e.value}function CA(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...ei(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function jA(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>zi(a,n,dn())))}),t}function jS(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ef(e)&&ef(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),i={...e,...t};for(let a of n){let s=jS(e[a],t[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n],s=jS(i,a);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function AA(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Nu(e))return e;let n=jS(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}function zh(e,t,r){e.issues.length&&t.issues.push(...ei(r,e.issues)),t.value[r]=e.value}function RA(e,t,r,n,i,a,s){e.issues.length&&(hg.has(typeof n)?r.issues.push(...ei(n,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:i,inst:a,issues:e.issues.map(o=>zi(o,s,dn()))})),t.issues.length&&(hg.has(typeof n)?r.issues.push(...ei(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:t.issues.map(o=>zi(o,s,dn()))})),r.value.set(e.value,t.value)}function DA(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function UA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function MA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function LA(e,t,r){return Nu(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function ZA(e){return e.value=Object.freeze(e.value),e}function qA(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(f4(i))}}function sQ(){return{localeError:aQ()}}function uQ(){return{localeError:oQ()}}function FA(e,t,r,n){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?n:a===1?t:a>=2&&a<=4?r:n}function cQ(){return{localeError:lQ()}}function fQ(){return{localeError:dQ()}}function mQ(){return{localeError:pQ()}}function gQ(){return{localeError:hQ()}}function gU(){return{localeError:yQ()}}function wQ(){return{localeError:bQ()}}function kQ(){return{localeError:xQ()}}function IQ(){return{localeError:SQ()}}function EQ(){return{localeError:$Q()}}function TQ(){return{localeError:PQ()}}function NQ(){return{localeError:OQ()}}function CQ(){return{localeError:zQ()}}function AQ(){return{localeError:jQ()}}function DQ(){return{localeError:RQ()}}function MQ(){return{localeError:UQ()}}function ZQ(){return{localeError:LQ()}}function FQ(){return{localeError:qQ()}}function WQ(){return{localeError:VQ()}}function GQ(){return{localeError:BQ()}}function HQ(){return{localeError:KQ()}}function YQ(){return{localeError:JQ()}}function XQ(){return{localeError:QQ()}}function tX(){return{localeError:eX()}}function nX(){return{localeError:rX()}}function aX(){return{localeError:iX()}}function oX(){return{localeError:sX()}}function VA(e,t,r,n){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?n:a===1?t:a>=2&&a<=4?r:n}function lX(){return{localeError:uX()}}function dX(){return{localeError:cX()}}function pX(){return{localeError:fX()}}function hX(){return{localeError:mX()}}function vX(){return{localeError:gX()}}function bX(){return{localeError:_X()}}function xX(){return{localeError:wX()}}function SX(){return{localeError:kX()}}function $X(){return{localeError:IX()}}function PX(){return{localeError:EX()}}function OX(){return{localeError:TX()}}function EI(){return new tf}function _U(e,t){return new e({type:"string",...re(t)})}function bU(e,t){return new e({type:"string",coerce:!0,...re(t)})}function PI(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...re(t)})}function bg(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...re(t)})}function TI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...re(t)})}function OI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(t)})}function NI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(t)})}function zI(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(t)})}function CI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...re(t)})}function jI(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...re(t)})}function AI(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(t)})}function RI(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...re(t)})}function DI(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(t)})}function UI(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...re(t)})}function MI(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...re(t)})}function LI(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(t)})}function ZI(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(t)})}function qI(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(t)})}function FI(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(t)})}function VI(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(t)})}function WI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...re(t)})}function BI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...re(t)})}function GI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...re(t)})}function KI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...re(t)})}function xU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(t)})}function kU(e,t){return new e({type:"string",format:"date",check:"string_format",...re(t)})}function SU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...re(t)})}function IU(e,t){return new e({type:"string",format:"duration",check:"string_format",...re(t)})}function $U(e,t){return new e({type:"number",checks:[],...re(t)})}function EU(e,t){return new e({type:"number",coerce:!0,checks:[],...re(t)})}function PU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...re(t)})}function TU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...re(t)})}function OU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...re(t)})}function NU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...re(t)})}function zU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...re(t)})}function CU(e,t){return new e({type:"boolean",...re(t)})}function jU(e,t){return new e({type:"boolean",coerce:!0,...re(t)})}function AU(e,t){return new e({type:"bigint",...re(t)})}function RU(e,t){return new e({type:"bigint",coerce:!0,...re(t)})}function DU(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...re(t)})}function UU(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...re(t)})}function MU(e,t){return new e({type:"symbol",...re(t)})}function LU(e,t){return new e({type:"undefined",...re(t)})}function ZU(e,t){return new e({type:"null",...re(t)})}function qU(e){return new e({type:"any"})}function wg(e){return new e({type:"unknown"})}function FU(e,t){return new e({type:"never",...re(t)})}function VU(e,t){return new e({type:"void",...re(t)})}function WU(e,t){return new e({type:"date",...re(t)})}function BU(e,t){return new e({type:"date",coerce:!0,...re(t)})}function GU(e,t){return new e({type:"nan",...re(t)})}function to(e,t){return new hI({check:"less_than",...re(t),value:e,inclusive:!1})}function Oi(e,t){return new hI({check:"less_than",...re(t),value:e,inclusive:!0})}function ro(e,t){return new gI({check:"greater_than",...re(t),value:e,inclusive:!1})}function Zn(e,t){return new gI({check:"greater_than",...re(t),value:e,inclusive:!0})}function KU(e){return ro(0,e)}function HU(e){return to(0,e)}function JU(e){return Oi(0,e)}function YU(e){return Zn(0,e)}function rf(e,t){return new H4({check:"multiple_of",...re(t),value:e})}function qg(e,t){return new Q4({check:"max_size",...re(t),maximum:e})}function nf(e,t){return new X4({check:"min_size",...re(t),minimum:e})}function HI(e,t){return new eD({check:"size_equals",...re(t),size:e})}function Fg(e,t){return new tD({check:"max_length",...re(t),maximum:e})}function Ku(e,t){return new rD({check:"min_length",...re(t),minimum:e})}function Vg(e,t){return new nD({check:"length_equals",...re(t),length:e})}function JI(e,t){return new iD({check:"string_format",format:"regex",...re(t),pattern:e})}function YI(e){return new aD({check:"string_format",format:"lowercase",...re(e)})}function QI(e){return new sD({check:"string_format",format:"uppercase",...re(e)})}function XI(e,t){return new oD({check:"string_format",format:"includes",...re(t),includes:e})}function e$(e,t){return new uD({check:"string_format",format:"starts_with",...re(t),prefix:e})}function t$(e,t){return new lD({check:"string_format",format:"ends_with",...re(t),suffix:e})}function QU(e,t,r){return new cD({check:"property",property:e,schema:t,...re(r)})}function r$(e,t){return new dD({check:"mime_type",mime:e,...re(t)})}function so(e){return new fD({check:"overwrite",tx:e})}function n$(e){return so(t=>t.normalize(e))}function i$(){return so(e=>e.trim())}function a$(){return so(e=>e.toLowerCase())}function s$(){return so(e=>e.toUpperCase())}function o$(e,t,r){return new e({type:"array",element:t,...re(r)})}function NX(e,t,r){return new e({type:"union",options:t,...re(r)})}function zX(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...re(n)})}function CX(e,t,r){return new e({type:"intersection",left:t,right:r})}function XU(e,t,r,n){let i=r instanceof Ve;return new e({type:"tuple",items:t,rest:i?r:null,...re(i?n:r)})}function jX(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...re(n)})}function AX(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...re(n)})}function RX(e,t,r){return new e({type:"set",valueType:t,...re(r)})}function DX(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:n,...re(r)})}function UX(e,t,r){return new e({type:"enum",entries:t,...re(r)})}function MX(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...re(r)})}function eM(e,t){return new e({type:"file",...re(t)})}function LX(e,t){return new e({type:"transform",transform:t})}function ZX(e,t){return new e({type:"optional",innerType:t})}function qX(e,t){return new e({type:"nullable",innerType:t})}function FX(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function VX(e,t,r){return new e({type:"nonoptional",innerType:t,...re(r)})}function WX(e,t){return new e({type:"success",innerType:t})}function BX(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function GX(e,t,r){return new e({type:"pipe",in:t,out:r})}function KX(e,t){return new e({type:"readonly",innerType:t})}function HX(e,t,r){return new e({type:"template_literal",parts:t,...re(r)})}function JX(e,t){return new e({type:"lazy",getter:t})}function YX(e,t){return new e({type:"promise",innerType:t})}function tM(e,t,r){let n=re(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function rM(e,t,r){return new e({type:"custom",check:"custom",fn:t,...re(r)})}function nM(e,t){let r=re(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let a=new Set(n),s=new Set(i),o=e.Pipe??II,u=e.Boolean??_I,l=e.String??lf,c=new(e.Transform??SI)({type:"transform",transform:(f,p)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),a.has(h)?!0:s.has(h)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:p.value,inst:c}),{})},error:r.error}),d=new o({type:"pipe",in:new l({type:"string",error:r.error}),out:c,error:r.error});return new o({type:"pipe",in:d,out:new u({type:"boolean",error:r.error}),error:r.error})}function iM(e,t,r,n={}){let i=re(n),a={...re(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(a.pattern=r),new e(a)}function aM(e){return new xg({type:"function",input:Array.isArray(e?.input)?XU(Zg,e?.input):e?.input??o$(wI,wg(_g)),output:e?.output??wg(_g)})}function sM(e,t){if(e instanceof tf){let n=new af(t),i={};for(let o of e._idmap.entries()){let[u,l]=o;n.process(l)}let a={},s={registry:e,uri:t?.uri||(o=>o),defs:i};for(let o of e._idmap.entries()){let[u,l]=o;a[u]=n.emit(l,{...t,external:s})}if(Object.keys(i).length>0){let o=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[o]:i}}return{schemas:a}}let r=new af(t);return r.process(e),r.emit(e,t)}function br(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return br(n.element,r);case"object":{for(let i in n.shape)if(br(n.shape[i],r))return!0;return!1}case"union":{for(let i of n.options)if(br(i,r))return!0;return!1}case"intersection":return br(n.left,r)||br(n.right,r);case"tuple":{for(let i of n.items)if(br(i,r))return!0;return!!(n.rest&&br(n.rest,r))}case"record":return br(n.keyType,r)||br(n.valueType,r);case"map":return br(n.keyType,r)||br(n.valueType,r);case"set":return br(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return br(n.innerType,r);case"lazy":return br(n.getter(),r);case"default":return br(n.innerType,r);case"prefault":return br(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return br(n.in,r)||br(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function oM(e){return xU(l$,e)}function uM(e){return kU(c$,e)}function lM(e){return SU(d$,e)}function cM(e){return IU(f$,e)}function V(e){return _U(Wg,e)}function tee(e){return PI(m$,e)}function ree(e){return bg(kg,e)}function nee(e){return TI(Ea,e)}function iee(e){return OI(Ea,e)}function aee(e){return NI(Ea,e)}function see(e){return zI(Ea,e)}function oee(e){return CI(h$,e)}function uee(e){return jI(g$,e)}function lee(e){return AI(v$,e)}function cee(e){return RI(y$,e)}function dee(e){return DI(_$,e)}function fee(e){return UI(b$,e)}function pee(e){return MI(w$,e)}function mee(e){return LI(x$,e)}function hee(e){return ZI(k$,e)}function gee(e){return qI(S$,e)}function vee(e){return FI(I$,e)}function yee(e){return VI($$,e)}function _ee(e){return WI(E$,e)}function bee(e){return BI(P$,e)}function wee(e){return GI(T$,e)}function xee(e){return KI(O$,e)}function kee(e,t,r={}){return iM(gM,e,t,r)}function Nt(e){return $U(Bg,e)}function AS(e){return PU(tl,e)}function See(e){return TU(tl,e)}function Iee(e){return OU(tl,e)}function $ee(e){return NU(tl,e)}function Eee(e){return zU(tl,e)}function wr(e){return CU(Gg,e)}function Pee(e){return AU(Kg,e)}function Tee(e){return DU(N$,e)}function Oee(e){return UU(N$,e)}function Nee(e){return MU(vM,e)}function zee(e){return LU(yM,e)}function z$(e){return ZU(_M,e)}function Cee(){return qU(bM)}function nr(){return wg(wM)}function Hg(e){return FU(xM,e)}function jee(e){return VU(kM,e)}function Aee(e){return WU(C$,e)}function mt(e,t){return o$(SM,e,t)}function Ree(e){let t=e._zod.def.shape;return Ie(Object.keys(t))}function pe(e,t){let r={type:"object",get shape(){return pt.assignProp(this,"shape",{...e}),this.shape},...pt.normalizeParams(t)};return new Jg(r)}function Dee(e,t){return new Jg({type:"object",get shape(){return pt.assignProp(this,"shape",{...e}),this.shape},catchall:Hg(),...pt.normalizeParams(t)})}function un(e,t){return new Jg({type:"object",get shape(){return pt.assignProp(this,"shape",{...e}),this.shape},catchall:nr(),...pt.normalizeParams(t)})}function Vt(e,t){return new j$({type:"union",options:e,...pt.normalizeParams(t)})}function A$(e,t,r){return new IM({type:"union",options:t,discriminator:e,...pt.normalizeParams(r)})}function Yg(e,t){return new $M({type:"intersection",left:e,right:t})}function Uee(e,t,r){let n=t instanceof Ve,i=n?r:t;return new EM({type:"tuple",items:e,rest:n?t:null,...pt.normalizeParams(i)})}function Ft(e,t,r){return new R$({type:"record",keyType:e,valueType:t,...pt.normalizeParams(r)})}function Mee(e,t,r){return new R$({type:"record",keyType:Vt([e,Hg()]),valueType:t,...pt.normalizeParams(r)})}function Lee(e,t,r){return new PM({type:"map",keyType:e,valueType:t,...pt.normalizeParams(r)})}function Zee(e,t){return new TM({type:"set",valueType:e,...pt.normalizeParams(t)})}function wn(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new sf({type:"enum",entries:r,...pt.normalizeParams(t)})}function qee(e,t){return new sf({type:"enum",entries:e,...pt.normalizeParams(t)})}function Ie(e,t){return new OM({type:"literal",values:Array.isArray(e)?e:[e],...pt.normalizeParams(t)})}function Fee(e){return eM(NM,e)}function U$(e){return new D$({type:"transform",transform:e})}function Yt(e){return new M$({type:"optional",innerType:e})}function Sg(e){return new zM({type:"nullable",innerType:e})}function Vee(e){return Yt(Sg(e))}function jM(e,t){return new CM({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function RM(e,t){return new AM({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function DM(e,t){return new L$({type:"nonoptional",innerType:e,...pt.normalizeParams(t)})}function Wee(e){return new UM({type:"success",innerType:e})}function LM(e,t){return new MM({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function Bee(e){return GU(ZM,e)}function Ig(e,t){return new Z$({type:"pipe",in:e,out:t})}function FM(e){return new qM({type:"readonly",innerType:e})}function Gee(e,t){return new VM({type:"template_literal",parts:e,...pt.normalizeParams(t)})}function BM(e){return new WM({type:"lazy",getter:e})}function Kee(e){return new GM({type:"promise",innerType:e})}function KM(e,t){let r=new dr({check:"custom",...pt.normalizeParams(t)});return r._zod.check=e,r}function HM(e,t){return tM(Qg,e??(()=>!0),t)}function JM(e,t={}){return rM(Qg,e,t)}function YM(e,t){let r=KM(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(pt.issue(i,n.value,r._zod.def));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(pt.issue(a))}},e(n.value,n)),t);return r}function Hee(e,t={error:`Input not instance of ${e.name}`}){let r=new Qg({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...pt.normalizeParams(t)});return r._zod.bag.Class=e,r}function Yee(e){let t=BM(()=>Vt([V(e),Nt(),wr(),z$(),mt(t),Ft(V(),t)]));return t}function q$(e,t){return Ig(U$(e),t)}function Xee(e){dn({customError:e})}function ete(){return dn().customError}function tte(e){return bU(Wg,e)}function rte(e){return EU(Bg,e)}function nte(e){return jU(Gg,e)}function ite(e){return RU(Kg,e)}function ate(e){return BU(C$,e)}function Jre(e){let t;return()=>t??=e()}async function Yre(e,t){try{await YK(e,t)}catch(r){if(!QS(r))throw r}}async function Qre(e,t){if(!e)return;let r=e;try{let n=eI(e);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=on(n))}catch{}await pR(t,r,{mode:384})}function Xre(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=a7(i7);return new Promise(t=>{KK("security",["find-generic-password","-a",s7(),"-w","-s",e],{encoding:"utf-8",timeout:5e3},(r,n)=>t(r?void 0:n.trim()||void 0))})}async function ene(e,t,r,n,i=6e4){if(!qY(t))return;let a=I2(r),s=await Rd(e.load({projectKey:a,sessionId:t}),i,`SessionStore.load() timed out after ${i}ms for session ${t}`);if(!s||s.length===0)return;let o=Pi(tH(),`claude-resume-${HK()}`);try{let u=Pi(o,"projects",a);await Wk(u,{recursive:!0});let l=Pi(u,`${t}.jsonl`);await SA(l,s);let c=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,d=c??Pi(sS(),".claude"),f;try{f=await QK(Pi(d,".credentials.json"),"utf-8")}catch(p){if(!QS(p))throw p}if(!c&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(f=await Xre()??f),await Qre(f,Pi(o,".credentials.json")),await Yre(Pi(c??sS(),".claude.json"),Pi(o,".claude.json")),e.listSubkeys){let p=Pi(u,t),h=await Rd(e.listSubkeys({projectKey:a,sessionId:t}),i,`SessionStore.listSubkeys() timed out after ${i}ms for session ${t}`);for(let y of h){let _=Mh(p,y+".jsonl");if(!y||mR(y)||y.split(/[\\/]/).includes("..")||!_.startsWith(p+hR)){Zr(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let m=await Rd(e.load({projectKey:a,sessionId:t,subpath:y}),i,`SessionStore.load() timed out after ${i}ms for session ${t} subpath ${y}`);if(!m||m.length===0)continue;let g=[],v=[];for(let b of m)ine(b)?g.push(b):v.push(b);if(v.length>0&&(await Wk(Mj(_),{recursive:!0}),await SA(_,v)),g.length>0){let b=g.at(-1),w=Mh(p,y+".meta.json");await Wk(Mj(w),{recursive:!0});let{type:x,...k}=b;await pR(w,on(k),{mode:384})}}}return o}catch(u){throw await k2(o),u}}function GA(e,t,r,n){let{systemPrompt:i,settings:a,managedSettings:s,settingSources:o,sandbox:u,...l}=e??{},c,d,f;i===void 0?c="":typeof i=="string"||Array.isArray(i)?c=i:i.type==="preset"&&(d=i.append,f=i.excludeDynamicSections);let p=l.pathToClaudeCodeExecutable;if(!p){let zn=nH(import.meta.url),bi=eH(zn),Gi=CY(Ql=>bi.resolve(Ql));if(Gi)p=Gi;else try{p=bi.resolve("./cli.js")}catch{throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`)}}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.119";let{abortController:h=gR(),additionalDirectories:y=[],agent:_,agents:m,allowedTools:g=[],betas:v,canUseTool:b,continue:w,cwd:x,debug:k,debugFile:$,disallowedTools:T=[],tools:j,env:P,executable:U=yR()?"bun":"node",executableArgs:B=[],extraArgs:C={},fallbackModel:ne,enableFileCheckpointing:H,toolConfig:Ze,forkSession:zt,hooks:ge,includeHookEvents:Y,includePartialMessages:O,forwardSubagentText:K,onElicitation:A,persistSession:I,sessionStore:E,thinking:W,effort:ve,maxThinkingTokens:he,maxTurns:St,maxBudgetUsd:ht,taskBudget:ar,mcpServers:D,model:Z,outputFormat:J,permissionMode:ie="default",allowDangerouslySkipPermissions:xe=!1,permissionPromptToolName:Qe,plugins:gr,getOAuthToken:vn,workload:$r,resume:Er,resumeSessionAt:vr,sessionId:qa,stderr:yn,strictMcpConfig:Hl}=l;if(E&&I===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(E&&w&&!Er&&!E.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(E&&H)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");E&&l.spawnClaudeCodeProcess&&Zr("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let Fa=J?.type==="json_schema"?J.schema:void 0,Hr=P?{...P}:{...process.env};Hr.CLAUDE_CODE_ENTRYPOINT||(Hr.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),H&&(Hr.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),vn&&(Hr.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ze?.askUserQuestion?.previewFormat&&(Hr.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=Ze.askUserQuestion.previewFormat);let Do={};if(xA.propagation.inject(xA.context.active(),Do),"traceparent"in Do)for(let zn of["TRACEPARENT","TRACESTATE"])zn in(P??{})||delete Hr[zn];for(let[zn,bi]of Object.entries(Do)){let Gi=zn.toUpperCase();Gi in(P??{})||(Hr[Gi]=bi)}let Jl={},Fp=new Map;if(D)for(let[zn,bi]of Object.entries(D))bi.type==="sdk"&&bi.instance?Fp.set(zn,bi.instance):Jl[zn]=bi;let Yl;if(W)switch(W.type){case"adaptive":Yl={type:"adaptive",display:W.display};break;case"enabled":Yl={type:"enabled",budgetTokens:W.budgetTokens,display:W.display};break;case"disabled":Yl={type:"disabled"};break}else he!==void 0&&(Yl=he===0?{type:"disabled"}:{type:"enabled",budgetTokens:he});r&&(Hr.CLAUDE_CONFIG_DIR=r);let FO=new xS({abortController:h,additionalDirectories:y,agent:_,betas:v,cwd:x,debug:k,debugFile:$,executable:U,executableArgs:B,extraArgs:$r?{...C,workload:$r}:C,pathToClaudeCodeExecutable:p,env:Hr,forkSession:zt,stderr:yn,thinkingConfig:Yl,effort:ve,maxTurns:St,maxBudgetUsd:ht,taskBudget:ar,model:Z,fallbackModel:ne,jsonSchema:Fa,permissionMode:ie,allowDangerouslySkipPermissions:xe,permissionPromptToolName:Qe,continueConversation:E?void 0:w,resume:Er,resumeSessionAt:vr,sessionId:qa,settings:typeof a=="object"?on(a):a,managedSettings:s?on(s):void 0,settingSources:o,allowedTools:g,disallowedTools:T,tools:j,mcpServers:Jl,strictMcpConfig:Hl,canUseTool:!!b,hooks:!!ge,includeHookEvents:Y,includePartialMessages:O,persistSession:I,sessionMirror:!!E,plugins:gr,sandbox:u,spawnClaudeCodeProcess:l.spawnClaudeCodeProcess,deferSpawn:n}),O3={systemPrompt:c,appendSystemPrompt:d,planModeInstructions:l.planModeInstructions,appendSubagentSystemPrompt:l.appendSubagentSystemPrompt,excludeDynamicSections:f,agents:m,title:l.title,promptSuggestions:l.promptSuggestions,agentProgressSummaries:l.agentProgressSummaries,forwardSubagentText:K},a_=new IS(FO,t,b,ge,h,Fp,Fa,O3,A,vn);if(E){let zn=()=>Pi(Hr.CLAUDE_CONFIG_DIR??Pi(sS(),".claude"),"projects"),bi=new $S(async(Gi,Ql)=>{let Xl=HA(Gi,zn());Xl?await E.append(Xl,Ql):Zr(`[SessionStore] dropping mirror frame: filePath ${Gi} is not under ${zn()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(Gi,Ql)=>{let Xl=HA(Gi,zn());Xl&&a_.reportMirrorError(Xl,Ql.message)});a_.setTranscriptMirrorBatcher(bi)}return{queryInstance:a_,transport:FO,abortController:h,processEnv:Hr}}function KA(e,t,r,n){typeof r=="string"?t.write(on({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+`
125
+ `):e.streamInput(r).catch(i=>n.abort(i))}async function k2(e){for(let t=0;;t++)try{return await XK(e,{recursive:!0,force:!0})}catch(r){if(t>=4||!tne.has(Ou(r)??""))return;await vR((t+1)*100)}}function rne(e,t){e.waitForExit().catch(()=>{}).finally(()=>k2(t))}function S2({prompt:e,options:t}){if((t?.resume||t?.continue)&&t?.sessionStore){let{queryInstance:a,transport:s,abortController:o,processEnv:u}=GA({...t},typeof e=="string",void 0,!0),l=Mh(t.cwd??"."),c=t.sessionStore,d=t.loadTimeoutMs??6e4,f=t.resume;return(async()=>{if(f||(f=(await Rd(c.listSessions(I2(l)),d,`SessionStore.listSessions() timed out after ${d}ms`)).slice().sort((p,h)=>h.mtime-p.mtime)[0]?.sessionId),!!f)return ene(c,f,l,t.env,t.loadTimeoutMs)})().then(p=>{p&&(s.updateResume(f),s.updateEnv({CLAUDE_CONFIG_DIR:p}),u.CLAUDE_CONFIG_DIR=p,a.addCleanupCallback(()=>rne(s,p))),a.isClosed()||s.spawn()}).catch(p=>{let h=YS(p);s.spawnAbort(h),a.setError(h)}),KA(a,s,e,o),a}let{queryInstance:r,transport:n,abortController:i}=GA(t,typeof e=="string");return KA(r,n,e,i),r}function nne(e){let t=Mh(e??"."),r;try{r=JK(t)}catch{r=t}return r.normalize("NFC")}function I2(e){return VY(nne(e))}function ine(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="agent_metadata"}function HA(e,t){let r=rH(t,e),n=r.split(hR);if(n[0]===".."||mR(r)||n.length<2)return null;let i=n[0],a=n[1];if(n.length===2&&a.endsWith(".jsonl"))return{projectKey:i,sessionId:a.replace(/\.jsonl$/,"")};if(n.length>=4){let s=n.slice(2),o=s.length-1;return s[o]=s.at(-1).replace(/\.jsonl$/,""),{projectKey:i,sessionId:a,subpath:s.join("/")}}return null}var dG,fG,aS,pG,mG,gG,vG,Eg,G,yG,no,bG,wG,sr,or,xG,kG,SG,JA,IG,Ju,$G,RS,EG,Yu,PG,TG,YA,Pg,OG,QA,NG,XA,zG,Tg,eR,DS,US,tR,MS,rR,nR,CG,iR,jG,AG,RG,DG,UG,MG,LG,ZG,qG,FG,VG,WG,BG,GG,KG,HG,JG,aR,Dh,Uj,tt,$t,ds,Og,YG,sR,oR,Uh,QG,Ci,XG,eK,uR,tK,Ng,zg,LS,Cg,ZS,rK,nK,iK,aK,sK,oK,uK,lK,cK,dK,fK,pK,mK,hK,gK,vK,yK,_K,qS,bK,wK,xK,kK,lR,cR,SK,IK,$K,EK,PK,dR,TK,OK,NK,zK,CK,jK,AK,RK,DK,UK,MK,LK,ZK,qK,FK,VK,fR,WK,BK,GK,aH,ss,lH,cH,dH,fH,VS,pH,Lh,_R,mH,hH,hd,vH,yH,_H,wH,xH,kH,Lj,IH,bR,EH,PH,TH,OH,zH,CH,Bk,Zj,AH,RH,DH,MH,LH,ZH,qH,FH,VH,WH,BH,KH,JH,wR,QH,Ud,e8,r8,n8,i8,a8,o8,u8,l8,d8,f8,m8,qj,g8,y8,jg,b8,w8,k8,I8,E8,T8,O8,N8,z8,j8,R8,Ag,M8,Z8,F8,W8,xR,B8,fs,BS,kR,oS,Re,ln,qn,zu,Zh,qh,Fh,Vh,Wh,Bh,Gh,Kh,Hh,H8,J8,uS,Fj,Q8,SR,X8,ku,eJ,rJ,Wj,Bj,Gj,iJ,oJ,Kj,Hj,Mn,Ln,Js,Jh,Yj,fJ,Qj,Gs,gd,Ys,cS,Cd,Yh,hh,Qh,dS,Qs,Xh,TR,OR,HS,Xj,vJ,yJ,fS,NR,_J,bJ,Fn,zR,gt,Dd,eA,IJ,Tr,eg,tg,RR,EJ,Su,PJ,TJ,MR,Qn,rs,_u,vd,gh,yd,_d,vh,bd,ka,wd,yh,_h,Vs,bh,wh,xd,Gk,rA,xh,Kk,Hk,Jk,nA,iA,mS,rg,OJ,NJ,kd,bu,Ws,_r,Sd,Un,$a,ns,Id,sA,hS,ng,ig,ag,uA,CJ,Xs,sg,Ld,us,og,Xn,is,wu,$d,kh,Ed,Pd,Sh,Td,Sa,Od,Ih,$h,Bs,Eh,Ph,Nd,Yk,dA,Qk,Xk,eS,tS,fA,pA,gS,ug,Zd,hA,AJ,lg,Th,vS,JS,Ah,qR,RJ,DJ,lr,Cu,Hs,xu,FJ,WJ,BJ,WIe,GJ,BIe,KJ,GIe,_A,tY,pY,mY,_S,vY,yY,bS,_Y,GR,KR,wY,Oh,nS,wS,YR,YIe,IY,ur,eI,TY,cg,wA,xS,kS,SS,IS,jY,AY,RY,$S,QIe,xA,m$e,ZY,IA,h$e,g$e,WY,v$e,JY,QR,YY,QY,XY,G$e,$A,e7,r7,i7,It,EA,me,as,ee,ti,o7,qd,u7,PS,cn,je,jd,bn,PA,TA,ju,dg,we,ri,OA,rt,l7,c7,d7,f7,p7,m7,h7,g7,v7,iS,y7,_7,b7,w7,x7,k7,XR,S7,Au,Fd,Vd,Wd,Bd,Gd,Ru,Du,Kd,os,ea,Hd,ls,Vn,Uu,Ia,TS,Mu,Pa,NS,Jd,Yd,zS,Lu,Zu,qu,Fu,eo,Ni,Ti,Ta,Vu,Wu,Qd,fg,pg,Bu,K$e,Ae,H$e,J$e,Y$e,Q$e,X$e,eEe,tEe,rEe,nEe,iEe,aEe,sEe,oEe,uEe,lEe,cEe,dEe,fEe,pEe,mEe,hEe,gEe,vEe,yEe,_Ee,bEe,wEe,xEe,kEe,SEe,IEe,$Ee,EEe,PEe,r4,n4,i4,cs,mg,pt,nI,o4,L7,hg,u4,c4,d4,CS,p4,iI,of,oI,gg,uI,vg,lI,cI,dI,fI,pI,v4,y4,_4,b4,w4,x4,k4,H7,S4,Gu,J7,Y7,Q7,I4,X7,eQ,tQ,rQ,nQ,E4,P4,T4,O4,N4,mI,z4,iQ,C4,j4,A4,M4,L4,Z4,q4,F4,V4,W4,B4,G4,dr,K4,hI,gI,H4,J4,Y4,Q4,X4,eD,tD,rD,nD,uf,iD,aD,sD,oD,uD,lD,cD,dD,fD,yg,pD,Ve,lf,Kt,mD,hD,gD,vD,yD,_D,bD,wD,xD,kD,SD,ID,$D,ED,PD,TD,OD,ND,zD,CD,AD,RD,UD,MD,yI,LD,_I,bI,ZD,qD,FD,VD,WD,_g,BD,GD,KD,wI,xI,kI,HD,JD,Zg,YD,QD,XD,eU,tU,rU,SI,nU,iU,aU,sU,oU,uU,lU,cU,II,dU,fU,pU,mU,hU,$I,aQ,oQ,lQ,dQ,pQ,hQ,vQ,yQ,_Q,bQ,xQ,SQ,$Q,PQ,OQ,zQ,jQ,RQ,UQ,LQ,qQ,VQ,BQ,KQ,JQ,QQ,eX,rX,iX,sX,uX,cX,fX,mX,gX,yX,_X,wX,kX,IX,EX,TX,vU,yU,tf,Ks,wU,xg,af,QX,XX,TEe,Eu,u$,l$,c$,d$,f$,dM,eee,cf,fM,pM,mM,hM,nt,p$,Wg,Qt,m$,kg,Ea,h$,g$,v$,y$,_$,b$,w$,x$,k$,S$,I$,$$,E$,P$,T$,O$,gM,Bg,tl,Gg,Kg,N$,vM,yM,_M,bM,wM,xM,kM,C$,SM,Jg,j$,IM,$M,EM,R$,PM,TM,sf,OM,NM,D$,M$,zM,CM,AM,L$,UM,MM,ZM,Z$,qM,VM,WM,GM,Qg,Jee,Qee,QM,ste,Xg,xr,XM,e2,OEe,ote,ute,F$,Wn,ev,Or,ni,ii,Nr,tv,lte,cte,t2,WA,r2,NEe,zEe,n2,dte,i2,fte,df,Hu,a2,pte,mte,hte,gte,vte,yte,_te,bte,wte,xte,s2,kte,Ste,o2,Ite,ff,pf,$te,mf,u2,Ete,l2,c2,d2,f2,CEe,p2,m2,h2,jEe,g2,v2,V$,y2,hf,rl,_2,Pte,Tte,Ote,Nte,zte,W$,Cte,jte,Ate,Rte,Dte,Ute,Mte,Lte,Zte,qte,Fte,Vte,Wte,Bte,Gte,Kte,B$,G$,K$,Hte,Jte,Yte,H$,Qte,Xte,ere,tre,rre,b2,nre,ire,w2,AEe,are,sre,ore,REe,x2,ure,lre,cre,dre,fre,pre,mre,hre,gre,$g,vre,yre,_re,bre,wre,xre,kre,Sre,Ire,$re,Ere,Pre,Tre,Ore,Nre,zre,Cre,jre,Are,Rre,Dre,Ure,Mre,Lre,Zre,qre,Fre,Vre,Wre,Bre,Gre,Kre,Hre,DEe,UEe,MEe,LEe,ZEe,qEe,FEe,VEe,WEe,BA,BEe,tne,$2=z(()=>{dG=Object.create,{getPrototypeOf:fG,defineProperty:aS,getOwnPropertyNames:pG}=Object,mG=Object.prototype.hasOwnProperty;Eg=(e,t,r)=>{var n=e!=null&&typeof e=="object";if(n){var i=t?gG??=new WeakMap:vG??=new WeakMap,a=i.get(e);if(a)return a}r=e!=null?dG(fG(e)):{};let s=t||!e||!e.__esModule?aS(r,"default",{value:e,enumerable:!0}):r;for(let o of pG(e))mG.call(s,o)||aS(s,o,{get:hG.bind(e,o),enumerable:!0});return n&&i.set(e,s),s},G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yG=e=>e;no=(e,t)=>{for(var r in t)aS(e,r,{get:t[r],enumerable:!0,configurable:!0,set:_G.bind(t,r)})},bG=Symbol.dispose||Symbol.for("Symbol.dispose"),wG=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),sr=(e,t,r)=>{if(t!=null){if(typeof t!="object"&&typeof t!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=t[wG]),n===void 0&&(n=t[bG]),typeof n!="function")throw TypeError("Object not disposable");e.push([r,n,t])}else r&&e.push([r]);return t},or=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,u,l){return l=Error(u),l.name="SuppressedError",l.error=s,l.suppressed=o,l},i=s=>t=r?new n(s,t,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=e.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()},xG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._globalThis=void 0,e._globalThis=typeof globalThis=="object"?globalThis:global}),kG=G(e=>{var t=e&&e.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a),Object.defineProperty(n,s,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=e&&e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(xG(),e)}),SG=G(e=>{var t=e&&e.__createBinding||(Object.create?function(n,i,a,s){s===void 0&&(s=a),Object.defineProperty(n,s,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,s){s===void 0&&(s=a),n[s]=i[a]}),r=e&&e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(e,"__esModule",{value:!0}),r(kG(),e)}),JA=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION="1.9.0"}),IG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isCompatible=e._makeCompatibilityCheck=void 0;var t=JA(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(i){let a=new Set([i]),s=new Set,o=i.match(r);if(!o)return()=>!1;let u={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(u.prerelease!=null)return function(d){return d===i};function l(d){return s.add(d),!1}function c(d){return a.add(d),!0}return function(d){if(a.has(d))return!0;if(s.has(d))return!1;let f=d.match(r);if(!f)return l(d);let p={major:+f[1],minor:+f[2],patch:+f[3],prerelease:f[4]};return p.prerelease!=null||u.major!==p.major?l(d):u.major===0?u.minor===p.minor&&u.patch<=p.patch?c(d):l(d):u.minor<=p.minor?c(d):l(d)}}e._makeCompatibilityCheck=n,e.isCompatible=n(t.VERSION)}),Ju=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unregisterGlobal=e.getGlobal=e.registerGlobal=void 0;var t=SG(),r=JA(),n=IG(),i=r.VERSION.split(".")[0],a=Symbol.for(`opentelemetry.js.api.${i}`),s=t._globalThis;function o(c,d,f,p=!1){var h;let y=s[a]=(h=s[a])!==null&&h!==void 0?h:{version:r.VERSION};if(!p&&y[c]){let _=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${c}`);return f.error(_.stack||_.message),!1}if(y.version!==r.VERSION){let _=Error(`@opentelemetry/api: Registration of version v${y.version} for ${c} does not match previously registered API v${r.VERSION}`);return f.error(_.stack||_.message),!1}return y[c]=d,f.debug(`@opentelemetry/api: Registered a global for ${c} v${r.VERSION}.`),!0}e.registerGlobal=o;function u(c){var d,f;let p=(d=s[a])===null||d===void 0?void 0:d.version;if(!(!p||!(0,n.isCompatible)(p)))return(f=s[a])===null||f===void 0?void 0:f[c]}e.getGlobal=u;function l(c,d){d.debug(`@opentelemetry/api: Unregistering a global for ${c} v${r.VERSION}.`);let f=s[a];f&&delete f[c]}e.unregisterGlobal=l}),$G=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagComponentLogger=void 0;var t=Ju();class r{constructor(a){this._namespace=a.namespace||"DiagComponentLogger"}debug(...a){return n("debug",this._namespace,a)}error(...a){return n("error",this._namespace,a)}info(...a){return n("info",this._namespace,a)}warn(...a){return n("warn",this._namespace,a)}verbose(...a){return n("verbose",this._namespace,a)}}e.DiagComponentLogger=r;function n(i,a,s){let o=(0,t.getGlobal)("diag");if(o)return s.unshift(a),o[i](...s)}}),RS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagLogLevel=void 0;var t;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(t=e.DiagLogLevel||(e.DiagLogLevel={}))}),EG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createLogLevelDiagLogger=void 0;var t=RS();function r(n,i){n<t.DiagLogLevel.NONE?n=t.DiagLogLevel.NONE:n>t.DiagLogLevel.ALL&&(n=t.DiagLogLevel.ALL),i=i||{};function a(s,o){let u=i[s];return typeof u=="function"&&n>=o?u.bind(i):function(){}}return{error:a("error",t.DiagLogLevel.ERROR),warn:a("warn",t.DiagLogLevel.WARN),info:a("info",t.DiagLogLevel.INFO),debug:a("debug",t.DiagLogLevel.DEBUG),verbose:a("verbose",t.DiagLogLevel.VERBOSE)}}e.createLogLevelDiagLogger=r}),Yu=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagAPI=void 0;var t=$G(),r=EG(),n=RS(),i=Ju(),a="diag";class s{constructor(){function u(d){return function(...f){let p=(0,i.getGlobal)("diag");if(p)return p[d](...f)}}let l=this,c=(d,f={logLevel:n.DiagLogLevel.INFO})=>{var p,h,y;if(d===l){let g=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return l.error((p=g.stack)!==null&&p!==void 0?p:g.message),!1}typeof f=="number"&&(f={logLevel:f});let _=(0,i.getGlobal)("diag"),m=(0,r.createLogLevelDiagLogger)((h=f.logLevel)!==null&&h!==void 0?h:n.DiagLogLevel.INFO,d);if(_&&!f.suppressOverrideMessage){let g=(y=Error().stack)!==null&&y!==void 0?y:"<failed to generate stacktrace>";_.warn(`Current logger will be overwritten from ${g}`),m.warn(`Current logger will overwrite one already registered from ${g}`)}return(0,i.registerGlobal)("diag",m,l,!0)};l.setLogger=c,l.disable=()=>{(0,i.unregisterGlobal)(a,l)},l.createComponentLogger=d=>new t.DiagComponentLogger(d),l.verbose=u("verbose"),l.debug=u("debug"),l.info=u("info"),l.warn=u("warn"),l.error=u("error")}static instance(){return this._instance||(this._instance=new s),this._instance}}e.DiagAPI=s}),PG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaggageImpl=void 0;class t{constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let i=this._entries.get(n);if(i)return Object.assign({},i)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,i])=>[n,i])}setEntry(n,i){let a=new t(this._entries);return a._entries.set(n,i),a}removeEntry(n){let i=new t(this._entries);return i._entries.delete(n),i}removeEntries(...n){let i=new t(this._entries);for(let a of n)i._entries.delete(a);return i}clear(){return new t}}e.BaggageImpl=t}),TG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.baggageEntryMetadataSymbol=void 0,e.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),YA=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.baggageEntryMetadataFromString=e.createBaggage=void 0;var t=Yu(),r=PG(),n=TG(),i=t.DiagAPI.instance();function a(o={}){return new r.BaggageImpl(new Map(Object.entries(o)))}e.createBaggage=a;function s(o){return typeof o!="string"&&(i.error(`Cannot create baggage metadata from unknown type: ${typeof o}`),o=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return o}}}e.baggageEntryMetadataFromString=s}),Pg=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ROOT_CONTEXT=e.createContextKey=void 0;function t(n){return Symbol.for(n)}e.createContextKey=t;class r{constructor(i){let a=this;a._currentContext=i?new Map(i):new Map,a.getValue=s=>a._currentContext.get(s),a.setValue=(s,o)=>{let u=new r(a._currentContext);return u._currentContext.set(s,o),u},a.deleteValue=s=>{let o=new r(a._currentContext);return o._currentContext.delete(s),o}}}e.ROOT_CONTEXT=new r}),OG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagConsoleLogger=void 0;var t=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{constructor(){function i(a){return function(...s){if(console){let o=console[a];if(typeof o!="function"&&(o=console.log),typeof o=="function")return o.apply(console,s)}}}for(let a=0;a<t.length;a++)this[t[a].n]=i(t[a].c)}}e.DiagConsoleLogger=r}),QA=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createNoopMeter=e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=e.NOOP_OBSERVABLE_GAUGE_METRIC=e.NOOP_OBSERVABLE_COUNTER_METRIC=e.NOOP_UP_DOWN_COUNTER_METRIC=e.NOOP_HISTOGRAM_METRIC=e.NOOP_GAUGE_METRIC=e.NOOP_COUNTER_METRIC=e.NOOP_METER=e.NoopObservableUpDownCounterMetric=e.NoopObservableGaugeMetric=e.NoopObservableCounterMetric=e.NoopObservableMetric=e.NoopHistogramMetric=e.NoopGaugeMetric=e.NoopUpDownCounterMetric=e.NoopCounterMetric=e.NoopMetric=e.NoopMeter=void 0;class t{constructor(){}createGauge(p,h){return e.NOOP_GAUGE_METRIC}createHistogram(p,h){return e.NOOP_HISTOGRAM_METRIC}createCounter(p,h){return e.NOOP_COUNTER_METRIC}createUpDownCounter(p,h){return e.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(p,h){return e.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(p,h){return e.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(p,h){return e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(p,h){}removeBatchObservableCallback(p){}}e.NoopMeter=t;class r{}e.NoopMetric=r;class n extends r{add(p,h){}}e.NoopCounterMetric=n;class i extends r{add(p,h){}}e.NoopUpDownCounterMetric=i;class a extends r{record(p,h){}}e.NoopGaugeMetric=a;class s extends r{record(p,h){}}e.NoopHistogramMetric=s;class o{addCallback(p){}removeCallback(p){}}e.NoopObservableMetric=o;class u extends o{}e.NoopObservableCounterMetric=u;class l extends o{}e.NoopObservableGaugeMetric=l;class c extends o{}e.NoopObservableUpDownCounterMetric=c,e.NOOP_METER=new t,e.NOOP_COUNTER_METRIC=new n,e.NOOP_GAUGE_METRIC=new a,e.NOOP_HISTOGRAM_METRIC=new s,e.NOOP_UP_DOWN_COUNTER_METRIC=new i,e.NOOP_OBSERVABLE_COUNTER_METRIC=new u,e.NOOP_OBSERVABLE_GAUGE_METRIC=new l,e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new c;function d(){return e.NOOP_METER}e.createNoopMeter=d}),NG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueType=void 0;var t;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(t=e.ValueType||(e.ValueType={}))}),XA=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultTextMapSetter=e.defaultTextMapGetter=void 0,e.defaultTextMapGetter={get(t,r){if(t!=null)return t[r]},keys(t){return t==null?[]:Object.keys(t)}},e.defaultTextMapSetter={set(t,r,n){t!=null&&(t[r]=n)}}}),zG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NoopContextManager=void 0;var t=Pg();class r{active(){return t.ROOT_CONTEXT}with(i,a,s,...o){return a.call(s,...o)}bind(i,a){return a}enable(){return this}disable(){return this}}e.NoopContextManager=r}),Tg=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContextAPI=void 0;var t=zG(),r=Ju(),n=Yu(),i="context",a=new t.NoopContextManager;class s{constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(i,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,l,c,...d){return this._getContextManager().with(u,l,c,...d)}bind(u,l){return this._getContextManager().bind(u,l)}_getContextManager(){return(0,r.getGlobal)(i)||a}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(i,n.DiagAPI.instance())}}e.ContextAPI=s}),eR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFlags=void 0;var t;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(t=e.TraceFlags||(e.TraceFlags={}))}),DS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=void 0;var t=eR();e.INVALID_SPANID="0000000000000000",e.INVALID_TRACEID="00000000000000000000000000000000",e.INVALID_SPAN_CONTEXT={traceId:e.INVALID_TRACEID,spanId:e.INVALID_SPANID,traceFlags:t.TraceFlags.NONE}}),US=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NonRecordingSpan=void 0;var t=DS();class r{constructor(i=t.INVALID_SPAN_CONTEXT){this._spanContext=i}spanContext(){return this._spanContext}setAttribute(i,a){return this}setAttributes(i){return this}addEvent(i,a){return this}addLink(i){return this}addLinks(i){return this}setStatus(i){return this}updateName(i){return this}end(i){}isRecording(){return!1}recordException(i,a){}}e.NonRecordingSpan=r}),tR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSpanContext=e.setSpanContext=e.deleteSpan=e.setSpan=e.getActiveSpan=e.getSpan=void 0;var t=Pg(),r=US(),n=Tg(),i=(0,t.createContextKey)("OpenTelemetry Context Key SPAN");function a(d){return d.getValue(i)||void 0}e.getSpan=a;function s(){return a(n.ContextAPI.getInstance().active())}e.getActiveSpan=s;function o(d,f){return d.setValue(i,f)}e.setSpan=o;function u(d){return d.deleteValue(i)}e.deleteSpan=u;function l(d,f){return o(d,new r.NonRecordingSpan(f))}e.setSpanContext=l;function c(d){var f;return(f=a(d))===null||f===void 0?void 0:f.spanContext()}e.getSpanContext=c}),MS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapSpanContext=e.isSpanContextValid=e.isValidSpanId=e.isValidTraceId=void 0;var t=DS(),r=US(),n=/^([0-9a-f]{32})$/i,i=/^[0-9a-f]{16}$/i;function a(l){return n.test(l)&&l!==t.INVALID_TRACEID}e.isValidTraceId=a;function s(l){return i.test(l)&&l!==t.INVALID_SPANID}e.isValidSpanId=s;function o(l){return a(l.traceId)&&s(l.spanId)}e.isSpanContextValid=o;function u(l){return new r.NonRecordingSpan(l)}e.wrapSpanContext=u}),rR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTracer=void 0;var t=Tg(),r=tR(),n=US(),i=MS(),a=t.ContextAPI.getInstance();class s{startSpan(l,c,d=a.active()){if(c?.root)return new n.NonRecordingSpan;let f=d&&(0,r.getSpanContext)(d);return o(f)&&(0,i.isSpanContextValid)(f)?new n.NonRecordingSpan(f):new n.NonRecordingSpan}startActiveSpan(l,c,d,f){let p,h,y;if(arguments.length<2)return;arguments.length===2?y=c:arguments.length===3?(p=c,y=d):(p=c,h=d,y=f);let _=h??a.active(),m=this.startSpan(l,p,_),g=(0,r.setSpan)(_,m);return a.with(g,y,void 0,m)}}e.NoopTracer=s;function o(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}}),nR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyTracer=void 0;var t=rR(),r=new t.NoopTracer;class n{constructor(a,s,o,u){this._provider=a,this.name=s,this.version=o,this.options=u}startSpan(a,s,o){return this._getTracer().startSpan(a,s,o)}startActiveSpan(a,s,o,u){let l=this._getTracer();return Reflect.apply(l.startActiveSpan,l,arguments)}_getTracer(){if(this._delegate)return this._delegate;let a=this._provider.getDelegateTracer(this.name,this.version,this.options);return a?(this._delegate=a,this._delegate):r}}e.ProxyTracer=n}),CG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTracerProvider=void 0;var t=rR();class r{getTracer(i,a,s){return new t.NoopTracer}}e.NoopTracerProvider=r}),iR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyTracerProvider=void 0;var t=nR(),r=CG(),n=new r.NoopTracerProvider;class i{getTracer(s,o,u){var l;return(l=this.getDelegateTracer(s,o,u))!==null&&l!==void 0?l:new t.ProxyTracer(this,s,o,u)}getDelegate(){var s;return(s=this._delegate)!==null&&s!==void 0?s:n}setDelegate(s){this._delegate=s}getDelegateTracer(s,o,u){var l;return(l=this._delegate)===null||l===void 0?void 0:l.getTracer(s,o,u)}}e.ProxyTracerProvider=i}),jG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SamplingDecision=void 0;var t;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(t=e.SamplingDecision||(e.SamplingDecision={}))}),AG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SpanKind=void 0;var t;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(t=e.SpanKind||(e.SpanKind={}))}),RG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SpanStatusCode=void 0;var t;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(t=e.SpanStatusCode||(e.SpanStatusCode={}))}),DG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateValue=e.validateKey=void 0;var t="[_0-9a-z-*/]",r=`[a-z]${t}{0,255}`,n=`[a-z0-9]${t}{0,240}@[a-z]${t}{0,13}`,i=new RegExp(`^(?:${r}|${n})$`),a=/^[ -~]{0,255}[!-~]$/,s=/,|=/;function o(l){return i.test(l)}e.validateKey=o;function u(l){return a.test(l)&&!s.test(l)}e.validateValue=u}),UG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TraceStateImpl=void 0;var t=DG(),r=32,n=512,i=",",a="=";class s{constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,l){let c=this._clone();return c._internalState.has(u)&&c._internalState.delete(u),c._internalState.set(u,l),c}unset(u){let l=this._clone();return l._internalState.delete(u),l}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,l)=>(u.push(l+a+this.get(l)),u),[]).join(i)}_parse(u){u.length>n||(this._internalState=u.split(i).reverse().reduce((l,c)=>{let d=c.trim(),f=d.indexOf(a);if(f!==-1){let p=d.slice(0,f),h=d.slice(f+1,c.length);(0,t.validateKey)(p)&&(0,t.validateValue)(h)&&l.set(p,h)}return l},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new s;return u._internalState=new Map(this._internalState),u}}e.TraceStateImpl=s}),MG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createTraceState=void 0;var t=UG();function r(n){return new t.TraceStateImpl(n)}e.createTraceState=r}),LG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.context=void 0;var t=Tg();e.context=t.ContextAPI.getInstance()}),ZG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.diag=void 0;var t=Yu();e.diag=t.DiagAPI.instance()}),qG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_METER_PROVIDER=e.NoopMeterProvider=void 0;var t=QA();class r{getMeter(i,a,s){return t.NOOP_METER}}e.NoopMeterProvider=r,e.NOOP_METER_PROVIDER=new r}),FG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsAPI=void 0;var t=qG(),r=Ju(),n=Yu(),i="metrics";class a{constructor(){}static getInstance(){return this._instance||(this._instance=new a),this._instance}setGlobalMeterProvider(o){return(0,r.registerGlobal)(i,o,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(i)||t.NOOP_METER_PROVIDER}getMeter(o,u,l){return this.getMeterProvider().getMeter(o,u,l)}disable(){(0,r.unregisterGlobal)(i,n.DiagAPI.instance())}}e.MetricsAPI=a}),VG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.metrics=void 0;var t=FG();e.metrics=t.MetricsAPI.getInstance()}),WG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NoopTextMapPropagator=void 0;class t{inject(n,i){}extract(n,i){return n}fields(){return[]}}e.NoopTextMapPropagator=t}),BG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deleteBaggage=e.setBaggage=e.getActiveBaggage=e.getBaggage=void 0;var t=Tg(),r=Pg(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function i(u){return u.getValue(n)||void 0}e.getBaggage=i;function a(){return i(t.ContextAPI.getInstance().active())}e.getActiveBaggage=a;function s(u,l){return u.setValue(n,l)}e.setBaggage=s;function o(u){return u.deleteValue(n)}e.deleteBaggage=o}),GG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PropagationAPI=void 0;var t=Ju(),r=WG(),n=XA(),i=BG(),a=YA(),s=Yu(),o="propagation",u=new r.NoopTextMapPropagator;class l{constructor(){this.createBaggage=a.createBaggage,this.getBaggage=i.getBaggage,this.getActiveBaggage=i.getActiveBaggage,this.setBaggage=i.setBaggage,this.deleteBaggage=i.deleteBaggage}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalPropagator(d){return(0,t.registerGlobal)(o,d,s.DiagAPI.instance())}inject(d,f,p=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(d,f,p)}extract(d,f,p=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(d,f,p)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,t.unregisterGlobal)(o,s.DiagAPI.instance())}_getGlobalPropagator(){return(0,t.getGlobal)(o)||u}}e.PropagationAPI=l}),KG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.propagation=void 0;var t=GG();e.propagation=t.PropagationAPI.getInstance()}),HG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TraceAPI=void 0;var t=Ju(),r=iR(),n=MS(),i=tR(),a=Yu(),s="trace";class o{constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=i.deleteSpan,this.getSpan=i.getSpan,this.getActiveSpan=i.getActiveSpan,this.getSpanContext=i.getSpanContext,this.setSpan=i.setSpan,this.setSpanContext=i.setSpanContext}static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalTracerProvider(l){let c=(0,t.registerGlobal)(s,this._proxyTracerProvider,a.DiagAPI.instance());return c&&this._proxyTracerProvider.setDelegate(l),c}getTracerProvider(){return(0,t.getGlobal)(s)||this._proxyTracerProvider}getTracer(l,c){return this.getTracerProvider().getTracer(l,c)}disable(){(0,t.unregisterGlobal)(s,a.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}e.TraceAPI=o}),JG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.trace=void 0;var t=HG();e.trace=t.TraceAPI.getInstance()}),aR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.trace=e.propagation=e.metrics=e.diag=e.context=e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=e.isValidSpanId=e.isValidTraceId=e.isSpanContextValid=e.createTraceState=e.TraceFlags=e.SpanStatusCode=e.SpanKind=e.SamplingDecision=e.ProxyTracerProvider=e.ProxyTracer=e.defaultTextMapSetter=e.defaultTextMapGetter=e.ValueType=e.createNoopMeter=e.DiagLogLevel=e.DiagConsoleLogger=e.ROOT_CONTEXT=e.createContextKey=e.baggageEntryMetadataFromString=void 0;var t=YA();Object.defineProperty(e,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return t.baggageEntryMetadataFromString}});var r=Pg();Object.defineProperty(e,"createContextKey",{enumerable:!0,get:function(){return r.createContextKey}}),Object.defineProperty(e,"ROOT_CONTEXT",{enumerable:!0,get:function(){return r.ROOT_CONTEXT}});var n=OG();Object.defineProperty(e,"DiagConsoleLogger",{enumerable:!0,get:function(){return n.DiagConsoleLogger}});var i=RS();Object.defineProperty(e,"DiagLogLevel",{enumerable:!0,get:function(){return i.DiagLogLevel}});var a=QA();Object.defineProperty(e,"createNoopMeter",{enumerable:!0,get:function(){return a.createNoopMeter}});var s=NG();Object.defineProperty(e,"ValueType",{enumerable:!0,get:function(){return s.ValueType}});var o=XA();Object.defineProperty(e,"defaultTextMapGetter",{enumerable:!0,get:function(){return o.defaultTextMapGetter}}),Object.defineProperty(e,"defaultTextMapSetter",{enumerable:!0,get:function(){return o.defaultTextMapSetter}});var u=nR();Object.defineProperty(e,"ProxyTracer",{enumerable:!0,get:function(){return u.ProxyTracer}});var l=iR();Object.defineProperty(e,"ProxyTracerProvider",{enumerable:!0,get:function(){return l.ProxyTracerProvider}});var c=jG();Object.defineProperty(e,"SamplingDecision",{enumerable:!0,get:function(){return c.SamplingDecision}});var d=AG();Object.defineProperty(e,"SpanKind",{enumerable:!0,get:function(){return d.SpanKind}});var f=RG();Object.defineProperty(e,"SpanStatusCode",{enumerable:!0,get:function(){return f.SpanStatusCode}});var p=eR();Object.defineProperty(e,"TraceFlags",{enumerable:!0,get:function(){return p.TraceFlags}});var h=MG();Object.defineProperty(e,"createTraceState",{enumerable:!0,get:function(){return h.createTraceState}});var y=MS();Object.defineProperty(e,"isSpanContextValid",{enumerable:!0,get:function(){return y.isSpanContextValid}}),Object.defineProperty(e,"isValidTraceId",{enumerable:!0,get:function(){return y.isValidTraceId}}),Object.defineProperty(e,"isValidSpanId",{enumerable:!0,get:function(){return y.isValidSpanId}});var _=DS();Object.defineProperty(e,"INVALID_SPANID",{enumerable:!0,get:function(){return _.INVALID_SPANID}}),Object.defineProperty(e,"INVALID_TRACEID",{enumerable:!0,get:function(){return _.INVALID_TRACEID}}),Object.defineProperty(e,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return _.INVALID_SPAN_CONTEXT}});var m=LG();Object.defineProperty(e,"context",{enumerable:!0,get:function(){return m.context}});var g=ZG();Object.defineProperty(e,"diag",{enumerable:!0,get:function(){return g.diag}});var v=VG();Object.defineProperty(e,"metrics",{enumerable:!0,get:function(){return v.metrics}});var b=KG();Object.defineProperty(e,"propagation",{enumerable:!0,get:function(){return b.propagation}});var w=JG();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return w.trace}}),e.default={context:m.context,diag:g.diag,metrics:v.metrics,propagation:b.propagation,trace:w.trace}}),Dh=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(g){if(super(),!e.IDENTIFIER.test(g))throw Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(g){super(),this._items=typeof g=="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((v,b)=>`${v}${b}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((v,b)=>(b instanceof r&&(v[b.str]=(v[b.str]||0)+1),v),{})}}e._Code=n,e.nil=new n("");function i(m,...g){let v=[m[0]],b=0;for(;b<g.length;)o(v,g[b]),v.push(m[++b]);return new n(v)}e._=i;var a=new n("+");function s(m,...g){let v=[p(m[0])],b=0;for(;b<g.length;)v.push(a),o(v,g[b]),v.push(a,p(m[++b]));return u(v),new n(v)}e.str=s;function o(m,g){g instanceof n?m.push(...g._items):g instanceof r?m.push(g):m.push(d(g))}e.addCodeArg=o;function u(m){let g=1;for(;g<m.length-1;){if(m[g]===a){let v=l(m[g-1],m[g+1]);if(v!==void 0){m.splice(g-1,3,v);continue}m[g++]="+"}g++}}function l(m,g){if(g==='""')return m;if(m==='""')return g;if(typeof m=="string")return g instanceof r||m[m.length-1]!=='"'?void 0:typeof g!="string"?`${m.slice(0,-1)}${g}"`:g[0]==='"'?m.slice(0,-1)+g.slice(1):void 0;if(typeof g=="string"&&g[0]==='"'&&!(m instanceof r))return`"${m}${g.slice(1)}`}function c(m,g){return g.emptyStr()?m:m.emptyStr()?g:s`${m}${g}`}e.strConcat=c;function d(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:p(Array.isArray(m)?m.join(","):m)}function f(m){return new n(p(m))}e.stringify=f;function p(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=p;function h(m){return typeof m=="string"&&e.IDENTIFIER.test(m)?new n(`.${m}`):i`[${m}]`}e.getProperty=h;function y(m){if(typeof m=="string"&&e.IDENTIFIER.test(m))return new n(`${m}`);throw Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}e.getEsmExportName=y;function _(m){return new n(m.toString())}e.regexpCode=_}),Uj=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=Dh();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:l,parent:c}={}){this._names={},this._prefixes=l,this._parent=c}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){let c=this._names[l]||this._nameGroup(l);return`${l}${c.index++}`}_nameGroup(l){var c,d;if(!((d=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||d===void 0)&&d.has(l)||this._prefixes&&!this._prefixes.has(l))throw Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=i;class a extends t.Name{constructor(l,c){super(c),this.prefix=l}setValue(l,{property:c,itemIndex:d}){this.value=l,this.scopePath=t._`.${new t.Name(c)}[${d}]`}}e.ValueScopeName=a;var s=t._`\n`;class o extends i{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?s:t.nil}}get(){return this._scope}name(l){return new a(l,this._newName(l))}value(l,c){var d;if(c.ref===void 0)throw Error("CodeGen: ref must be passed in value");let f=this.toName(l),{prefix:p}=f,h=(d=c.key)!==null&&d!==void 0?d:c.ref,y=this._values[p];if(y){let g=y.get(h);if(g)return g}else y=this._values[p]=new Map;y.set(h,f);let _=this._scope[p]||(this._scope[p]=[]),m=_.length;return _[m]=c.ref,f.setValue(c,{property:p,itemIndex:m}),f}getValue(l,c){let d=this._values[l];if(d)return d.get(c)}scopeRefs(l,c=this._values){return this._reduceValues(c,d=>{if(d.scopePath===void 0)throw Error(`CodeGen: name "${d}" has no value`);return t._`${l}${d.scopePath}`})}scopeCode(l=this._values,c,d){return this._reduceValues(l,f=>{if(f.value===void 0)throw Error(`CodeGen: name "${f}" has no value`);return f.value.code},c,d)}_reduceValues(l,c,d={},f){let p=t.nil;for(let h in l){let y=l[h];if(!y)continue;let _=d[h]=d[h]||new Map;y.forEach(m=>{if(_.has(m))return;_.set(m,n.Started);let g=c(m);if(g){let v=this.opts.es5?e.varKinds.var:e.varKinds.const;p=t._`${p}${v} ${m} = ${g};${this.opts._n}`}else if(g=f?.(m))p=t._`${p}${g}${this.opts._n}`;else throw new r(m);_.set(m,n.Completed)})}return p}}e.ValueScope=o}),tt=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=Dh(),r=Uj(),n=Dh();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=Uj();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(I,E){return this}}class s extends a{constructor(I,E,W){super(),this.varKind=I,this.name=E,this.rhs=W}render({es5:I,_n:E}){let W=I?r.varKinds.var:this.varKind,ve=this.rhs===void 0?"":` = ${this.rhs}`;return`${W} ${this.name}${ve};`+E}optimizeNames(I,E){if(I[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,I,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends a{constructor(I,E,W){super(),this.lhs=I,this.rhs=E,this.sideEffects=W}render({_n:I}){return`${this.lhs} = ${this.rhs};`+I}optimizeNames(I,E){if(!(this.lhs instanceof t.Name&&!I[this.lhs.str]&&!this.sideEffects))return this.rhs=C(this.rhs,I,E),this}get names(){let I=this.lhs instanceof t.Name?{}:{...this.lhs.names};return B(I,this.rhs)}}class u extends o{constructor(I,E,W,ve){super(I,W,ve),this.op=E}render({_n:I}){return`${this.lhs} ${this.op}= ${this.rhs};`+I}}class l extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`${this.label}:`+I}}class c extends a{constructor(I){super(),this.label=I,this.names={}}render({_n:I}){return`break${this.label?` ${this.label}`:""};`+I}}class d extends a{constructor(I){super(),this.error=I}render({_n:I}){return`throw ${this.error};`+I}get names(){return this.error.names}}class f extends a{constructor(I){super(),this.code=I}render({_n:I}){return`${this.code};`+I}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(I,E){return this.code=C(this.code,I,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends a{constructor(I=[]){super(),this.nodes=I}render(I){return this.nodes.reduce((E,W)=>E+W.render(I),"")}optimizeNodes(){let{nodes:I}=this,E=I.length;for(;E--;){let W=I[E].optimizeNodes();Array.isArray(W)?I.splice(E,1,...W):W?I[E]=W:I.splice(E,1)}return I.length>0?this:void 0}optimizeNames(I,E){let{nodes:W}=this,ve=W.length;for(;ve--;){let he=W[ve];he.optimizeNames(I,E)||(ne(I,he.names),W.splice(ve,1))}return W.length>0?this:void 0}get names(){return this.nodes.reduce((I,E)=>U(I,E.names),{})}}class h extends p{render(I){return"{"+I._n+super.render(I)+"}"+I._n}}class y extends p{}class _ extends h{}_.kind="else";class m extends h{constructor(I,E){super(E),this.condition=I}render(I){let E=`if(${this.condition})`+super.render(I);return this.else&&(E+="else "+this.else.render(I)),E}optimizeNodes(){super.optimizeNodes();let I=this.condition;if(I===!0)return this.nodes;let E=this.else;if(E){let W=E.optimizeNodes();E=this.else=Array.isArray(W)?new _(W):W}if(E)return I===!1?E instanceof m?E:E.nodes:this.nodes.length?this:new m(H(I),E instanceof m?[E]:E.nodes);if(!(I===!1||!this.nodes.length))return this}optimizeNames(I,E){var W;if(this.else=(W=this.else)===null||W===void 0?void 0:W.optimizeNames(I,E),!!(super.optimizeNames(I,E)||this.else))return this.condition=C(this.condition,I,E),this}get names(){let I=super.names;return B(I,this.condition),this.else&&U(I,this.else.names),I}}m.kind="if";class g extends h{}g.kind="for";class v extends g{constructor(I){super(),this.iteration=I}render(I){return`for(${this.iteration})`+super.render(I)}optimizeNames(I,E){if(super.optimizeNames(I,E))return this.iteration=C(this.iteration,I,E),this}get names(){return U(super.names,this.iteration.names)}}class b extends g{constructor(I,E,W,ve){super(),this.varKind=I,this.name=E,this.from=W,this.to=ve}render(I){let E=I.es5?r.varKinds.var:this.varKind,{name:W,from:ve,to:he}=this;return`for(${E} ${W}=${ve}; ${W}<${he}; ${W}++)`+super.render(I)}get names(){let I=B(super.names,this.from);return B(I,this.to)}}class w extends g{constructor(I,E,W,ve){super(),this.loop=I,this.varKind=E,this.name=W,this.iterable=ve}render(I){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(I)}optimizeNames(I,E){if(super.optimizeNames(I,E))return this.iterable=C(this.iterable,I,E),this}get names(){return U(super.names,this.iterable.names)}}class x extends h{constructor(I,E,W){super(),this.name=I,this.args=E,this.async=W}render(I){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(I)}}x.kind="func";class k extends p{render(I){return"return "+super.render(I)}}k.kind="return";class $ extends h{render(I){let E="try"+super.render(I);return this.catch&&(E+=this.catch.render(I)),this.finally&&(E+=this.finally.render(I)),E}optimizeNodes(){var I,E;return super.optimizeNodes(),(I=this.catch)===null||I===void 0||I.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(I,E){var W,ve;return super.optimizeNames(I,E),(W=this.catch)===null||W===void 0||W.optimizeNames(I,E),(ve=this.finally)===null||ve===void 0||ve.optimizeNames(I,E),this}get names(){let I=super.names;return this.catch&&U(I,this.catch.names),this.finally&&U(I,this.finally.names),I}}class T extends h{constructor(I){super(),this.error=I}render(I){return`catch(${this.error})`+super.render(I)}}T.kind="catch";class j extends h{render(I){return"finally"+super.render(I)}}j.kind="finally";class P{constructor(I,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
126
+ `:""},this._extScope=I,this._scope=new r.Scope({parent:I}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(I){return this._scope.name(I)}scopeName(I){return this._extScope.name(I)}scopeValue(I,E){let W=this._extScope.value(I,E);return(this._values[W.prefix]||(this._values[W.prefix]=new Set)).add(W),W}getScopeValue(I,E){return this._extScope.getValue(I,E)}scopeRefs(I){return this._extScope.scopeRefs(I,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(I,E,W,ve){let he=this._scope.toName(E);return W!==void 0&&ve&&(this._constants[he.str]=W),this._leafNode(new s(I,he,W)),he}const(I,E,W){return this._def(r.varKinds.const,I,E,W)}let(I,E,W){return this._def(r.varKinds.let,I,E,W)}var(I,E,W){return this._def(r.varKinds.var,I,E,W)}assign(I,E,W){return this._leafNode(new o(I,E,W))}add(I,E){return this._leafNode(new u(I,e.operators.ADD,E))}code(I){return typeof I=="function"?I():I!==t.nil&&this._leafNode(new f(I)),this}object(...I){let E=["{"];for(let[W,ve]of I)E.length>1&&E.push(","),E.push(W),(W!==ve||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,ve));return E.push("}"),new t._Code(E)}if(I,E,W){if(this._blockNode(new m(I)),E&&W)this.code(E).else().code(W).endIf();else if(E)this.code(E).endIf();else if(W)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(I){return this._elseNode(new m(I))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(m,_)}_for(I,E){return this._blockNode(I),E&&this.code(E).endFor(),this}for(I,E){return this._for(new v(I),E)}forRange(I,E,W,ve,he=this.opts.es5?r.varKinds.var:r.varKinds.let){let St=this._scope.toName(I);return this._for(new b(he,St,E,W),()=>ve(St))}forOf(I,E,W,ve=r.varKinds.const){let he=this._scope.toName(I);if(this.opts.es5){let St=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,t._`${St}.length`,ht=>{this.var(he,t._`${St}[${ht}]`),W(he)})}return this._for(new w("of",ve,he,E),()=>W(he))}forIn(I,E,W,ve=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(I,t._`Object.keys(${E})`,W);let he=this._scope.toName(I);return this._for(new w("in",ve,he,E),()=>W(he))}endFor(){return this._endBlockNode(g)}label(I){return this._leafNode(new l(I))}break(I){return this._leafNode(new c(I))}return(I){let E=new k;if(this._blockNode(E),this.code(I),E.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(I,E,W){if(!E&&!W)throw Error('CodeGen: "try" without "catch" and "finally"');let ve=new $;if(this._blockNode(ve),this.code(I),E){let he=this.name("e");this._currNode=ve.catch=new T(he),E(he)}return W&&(this._currNode=ve.finally=new j,this.code(W)),this._endBlockNode(T,j)}throw(I){return this._leafNode(new d(I))}block(I,E){return this._blockStarts.push(this._nodes.length),I&&this.code(I).endBlock(E),this}endBlock(I){let E=this._blockStarts.pop();if(E===void 0)throw Error("CodeGen: not in self-balancing block");let W=this._nodes.length-E;if(W<0||I!==void 0&&W!==I)throw Error(`CodeGen: wrong number of nodes: ${W} vs ${I} expected`);return this._nodes.length=E,this}func(I,E=t.nil,W,ve){return this._blockNode(new x(I,E,W)),ve&&this.code(ve).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(I=1){for(;I-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(I){return this._currNode.nodes.push(I),this}_blockNode(I){this._currNode.nodes.push(I),this._nodes.push(I)}_endBlockNode(I,E){let W=this._currNode;if(W instanceof I||E&&W instanceof E)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${E?`${I.kind}/${E.kind}`:I.kind}"`)}_elseNode(I){let E=this._currNode;if(!(E instanceof m))throw Error('CodeGen: "else" without "if"');return this._currNode=E.else=I,this}get _root(){return this._nodes[0]}get _currNode(){let I=this._nodes;return I[I.length-1]}set _currNode(I){let E=this._nodes;E[E.length-1]=I}}e.CodeGen=P;function U(A,I){for(let E in I)A[E]=(A[E]||0)+(I[E]||0);return A}function B(A,I){return I instanceof t._CodeOrName?U(A,I.names):A}function C(A,I,E){if(A instanceof t.Name)return W(A);if(!ve(A))return A;return new t._Code(A._items.reduce((he,St)=>(St instanceof t.Name&&(St=W(St)),St instanceof t._Code?he.push(...St._items):he.push(St),he),[]));function W(he){let St=E[he.str];return St===void 0||I[he.str]!==1?he:(delete I[he.str],St)}function ve(he){return he instanceof t._Code&&he._items.some(St=>St instanceof t.Name&&I[St.str]===1&&E[St.str]!==void 0)}}function ne(A,I){for(let E in I)A[E]=(A[E]||0)-(I[E]||0)}function H(A){return typeof A=="boolean"||typeof A=="number"||A===null?!A:t._`!${K(A)}`}e.not=H;var Ze=O(e.operators.AND);function zt(...A){return A.reduce(Ze)}e.and=zt;var ge=O(e.operators.OR);function Y(...A){return A.reduce(ge)}e.or=Y;function O(A){return(I,E)=>I===t.nil?E:E===t.nil?I:t._`${K(I)} ${A} ${K(E)}`}function K(A){return A instanceof t.Name?A:t._`(${A})`}}),$t=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=tt(),r=Dh();function n(x){let k={};for(let $ of x)k[$]=!0;return k}e.toHash=n;function i(x,k){return typeof k=="boolean"?k:Object.keys(k).length===0?!0:(a(x,k),!s(k,x.self.RULES.all))}e.alwaysValidSchema=i;function a(x,k=x.schema){let{opts:$,self:T}=x;if(!$.strictSchema||typeof k=="boolean")return;let j=T.RULES.keywords;for(let P in k)j[P]||w(x,`unknown keyword: "${P}"`)}e.checkUnknownRules=a;function s(x,k){if(typeof x=="boolean")return!x;for(let $ in x)if(k[$])return!0;return!1}e.schemaHasRules=s;function o(x,k){if(typeof x=="boolean")return!x;for(let $ in x)if($!=="$ref"&&k.all[$])return!0;return!1}e.schemaHasRulesButRef=o;function u({topSchemaRef:x,schemaPath:k},$,T,j){if(!j){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return t._`${$}`}return t._`${x}${k}${(0,t.getProperty)(T)}`}e.schemaRefOrVal=u;function l(x){return f(decodeURIComponent(x))}e.unescapeFragment=l;function c(x){return encodeURIComponent(d(x))}e.escapeFragment=c;function d(x){return typeof x=="number"?`${x}`:x.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function f(x){return x.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=f;function p(x,k){if(Array.isArray(x))for(let $ of x)k($);else k(x)}e.eachItem=p;function h({mergeNames:x,mergeToName:k,mergeValues:$,resultToName:T}){return(j,P,U,B)=>{let C=U===void 0?P:U instanceof t.Name?(P instanceof t.Name?x(j,P,U):k(j,P,U),U):P instanceof t.Name?(k(j,U,P),P):$(P,U);return B===t.Name&&!(C instanceof t.Name)?T(j,C):C}}e.mergeEvaluated={props:h({mergeNames:(x,k,$)=>x.if(t._`${$} !== true && ${k} !== undefined`,()=>{x.if(t._`${k} === true`,()=>x.assign($,!0),()=>x.assign($,t._`${$} || {}`).code(t._`Object.assign(${$}, ${k})`))}),mergeToName:(x,k,$)=>x.if(t._`${$} !== true`,()=>{k===!0?x.assign($,!0):(x.assign($,t._`${$} || {}`),_(x,$,k))}),mergeValues:(x,k)=>x===!0?!0:{...x,...k},resultToName:y}),items:h({mergeNames:(x,k,$)=>x.if(t._`${$} !== true && ${k} !== undefined`,()=>x.assign($,t._`${k} === true ? true : ${$} > ${k} ? ${$} : ${k}`)),mergeToName:(x,k,$)=>x.if(t._`${$} !== true`,()=>x.assign($,k===!0?!0:t._`${$} > ${k} ? ${$} : ${k}`)),mergeValues:(x,k)=>x===!0?!0:Math.max(x,k),resultToName:(x,k)=>x.var("items",k)})};function y(x,k){if(k===!0)return x.var("props",!0);let $=x.var("props",t._`{}`);return k!==void 0&&_(x,$,k),$}e.evaluatedPropsToName=y;function _(x,k,$){Object.keys($).forEach(T=>x.assign(t._`${k}${(0,t.getProperty)(T)}`,!0))}e.setEvaluated=_;var m={};function g(x,k){return x.scopeValue("func",{ref:k,code:m[k.code]||(m[k.code]=new r._Code(k.code))})}e.useFunc=g;var v;(function(x){x[x.Num=0]="Num",x[x.Str=1]="Str"})(v||(e.Type=v={}));function b(x,k,$){if(x instanceof t.Name){let T=k===v.Num;return $?T?t._`"[" + ${x} + "]"`:t._`"['" + ${x} + "']"`:T?t._`"/" + ${x}`:t._`"/" + ${x}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,t.getProperty)(x).toString():"/"+d(x)}e.getErrorPath=b;function w(x,k,$=x.opts.strictSchema){if($){if(k=`strict mode: ${k}`,$===!0)throw Error(k);x.self.logger.warn(k)}}e.checkStrictMode=w}),ds=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),Og=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=tt(),r=$t(),n=ds();e.keywordError={message:({keyword:_})=>t.str`must pass "${_}" keyword validation`},e.keyword$DataError={message:({keyword:_,schemaType:m})=>m?t.str`"${_}" keyword must be ${m} ($data)`:t.str`"${_}" keyword is invalid ($data)`};function i(_,m=e.keywordError,g,v){let{it:b}=_,{gen:w,compositeRule:x,allErrors:k}=b,$=d(_,m,g);v??(x||k)?u(w,$):l(b,t._`[${$}]`)}e.reportError=i;function a(_,m=e.keywordError,g){let{it:v}=_,{gen:b,compositeRule:w,allErrors:x}=v,k=d(_,m,g);u(b,k),!(w||x)&&l(v,n.default.vErrors)}e.reportExtraError=a;function s(_,m){_.assign(n.default.errors,m),_.if(t._`${n.default.vErrors} !== null`,()=>_.if(m,()=>_.assign(t._`${n.default.vErrors}.length`,m),()=>_.assign(n.default.vErrors,null)))}e.resetErrorsCount=s;function o({gen:_,keyword:m,schemaValue:g,data:v,errsCount:b,it:w}){if(b===void 0)throw Error("ajv implementation error");let x=_.name("err");_.forRange("i",b,n.default.errors,k=>{_.const(x,t._`${n.default.vErrors}[${k}]`),_.if(t._`${x}.instancePath === undefined`,()=>_.assign(t._`${x}.instancePath`,(0,t.strConcat)(n.default.instancePath,w.errorPath))),_.assign(t._`${x}.schemaPath`,t.str`${w.errSchemaPath}/${m}`),w.opts.verbose&&(_.assign(t._`${x}.schema`,g),_.assign(t._`${x}.data`,v))})}e.extendErrors=o;function u(_,m){let g=_.const("err",m);_.if(t._`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,t._`[${g}]`),t._`${n.default.vErrors}.push(${g})`),_.code(t._`${n.default.errors}++`)}function l(_,m){let{gen:g,validateName:v,schemaEnv:b}=_;b.$async?g.throw(t._`new ${_.ValidationError}(${m})`):(g.assign(t._`${v}.errors`,m),g.return(!1))}var c={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(_,m,g){let{createErrors:v}=_.it;return v===!1?t._`{}`:f(_,m,g)}function f(_,m,g={}){let{gen:v,it:b}=_,w=[p(b,g),h(_,g)];return y(_,m,w),v.object(...w)}function p({errorPath:_},{instancePath:m}){let g=m?t.str`${_}${(0,r.getErrorPath)(m,r.Type.Str)}`:_;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,g)]}function h({keyword:_,it:{errSchemaPath:m}},{schemaPath:g,parentSchema:v}){let b=v?m:t.str`${m}/${_}`;return g&&(b=t.str`${b}${(0,r.getErrorPath)(g,r.Type.Str)}`),[c.schemaPath,b]}function y(_,{params:m,message:g},v){let{keyword:b,data:w,schemaValue:x,it:k}=_,{opts:$,propertyName:T,topSchemaRef:j,schemaPath:P}=k;v.push([c.keyword,b],[c.params,typeof m=="function"?m(_):m||t._`{}`]),$.messages&&v.push([c.message,typeof g=="function"?g(_):g]),$.verbose&&v.push([c.schema,x],[c.parentSchema,t._`${j}${P}`],[n.default.data,w]),T&&v.push([c.propertyName,T])}}),YG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=Og(),r=tt(),n=ds(),i={message:"boolean schema is false"};function a(u){let{gen:l,schema:c,validateName:d}=u;c===!1?o(u,!1):typeof c=="object"&&c.$async===!0?l.return(n.default.data):(l.assign(r._`${d}.errors`,null),l.return(!0))}e.topBoolOrEmptySchema=a;function s(u,l){let{gen:c,schema:d}=u;d===!1?(c.var(l,!1),o(u)):c.var(l,!0)}e.boolOrEmptySchema=s;function o(u,l){let{gen:c,data:d}=u,f={gen:c,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,t.reportError)(f,i,void 0,l)}}),sR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=["string","number","integer","boolean","null","object","array"],r=new Set(t);function n(a){return typeof a=="string"&&r.has(a)}e.isJSONType=n;function i(){let a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=i}),oR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:i,self:a},s){let o=a.RULES.types[s];return o&&o!==!0&&r(i,o)}e.schemaHasRulesForType=t;function r(i,a){return a.rules.some(s=>n(i,s))}e.shouldUseGroup=r;function n(i,a){var s;return i[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(o=>i[o]!==void 0))}e.shouldUseRule=n}),Uh=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=sR(),r=oR(),n=Og(),i=tt(),a=$t(),s;(function(v){v[v.Correct=0]="Correct",v[v.Wrong=1]="Wrong"})(s||(e.DataType=s={}));function o(v){let b=u(v.type);if(b.includes("null")){if(v.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!b.length&&v.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');v.nullable===!0&&b.push("null")}return b}e.getSchemaTypes=o;function u(v){let b=Array.isArray(v)?v:v?[v]:[];if(b.every(t.isJSONType))return b;throw Error("type must be JSONType or JSONType[]: "+b.join(","))}e.getJSONTypes=u;function l(v,b){let{gen:w,data:x,opts:k}=v,$=d(b,k.coerceTypes),T=b.length>0&&!($.length===0&&b.length===1&&(0,r.schemaHasRulesForType)(v,b[0]));if(T){let j=y(b,x,k.strictNumbers,s.Wrong);w.if(j,()=>{$.length?f(v,b,$):m(v)})}return T}e.coerceAndCheckDataType=l;var c=new Set(["string","number","integer","boolean","null"]);function d(v,b){return b?v.filter(w=>c.has(w)||b==="array"&&w==="array"):[]}function f(v,b,w){let{gen:x,data:k,opts:$}=v,T=x.let("dataType",i._`typeof ${k}`),j=x.let("coerced",i._`undefined`);$.coerceTypes==="array"&&x.if(i._`${T} == 'object' && Array.isArray(${k}) && ${k}.length == 1`,()=>x.assign(k,i._`${k}[0]`).assign(T,i._`typeof ${k}`).if(y(b,k,$.strictNumbers),()=>x.assign(j,k))),x.if(i._`${j} !== undefined`);for(let U of w)(c.has(U)||U==="array"&&$.coerceTypes==="array")&&P(U);x.else(),m(v),x.endIf(),x.if(i._`${j} !== undefined`,()=>{x.assign(k,j),p(v,j)});function P(U){switch(U){case"string":x.elseIf(i._`${T} == "number" || ${T} == "boolean"`).assign(j,i._`"" + ${k}`).elseIf(i._`${k} === null`).assign(j,i._`""`);return;case"number":x.elseIf(i._`${T} == "boolean" || ${k} === null
127
+ || (${T} == "string" && ${k} && ${k} == +${k})`).assign(j,i._`+${k}`);return;case"integer":x.elseIf(i._`${T} === "boolean" || ${k} === null
128
+ || (${T} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(j,i._`+${k}`);return;case"boolean":x.elseIf(i._`${k} === "false" || ${k} === 0 || ${k} === null`).assign(j,!1).elseIf(i._`${k} === "true" || ${k} === 1`).assign(j,!0);return;case"null":x.elseIf(i._`${k} === "" || ${k} === 0 || ${k} === false`),x.assign(j,null);return;case"array":x.elseIf(i._`${T} === "string" || ${T} === "number"
129
+ || ${T} === "boolean" || ${k} === null`).assign(j,i._`[${k}]`)}}}function p({gen:v,parentData:b,parentDataProperty:w},x){v.if(i._`${b} !== undefined`,()=>v.assign(i._`${b}[${w}]`,x))}function h(v,b,w,x=s.Correct){let k=x===s.Correct?i.operators.EQ:i.operators.NEQ,$;switch(v){case"null":return i._`${b} ${k} null`;case"array":$=i._`Array.isArray(${b})`;break;case"object":$=i._`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":$=T(i._`!(${b} % 1) && !isNaN(${b})`);break;case"number":$=T();break;default:return i._`typeof ${b} ${k} ${v}`}return x===s.Correct?$:(0,i.not)($);function T(j=i.nil){return(0,i.and)(i._`typeof ${b} == "number"`,j,w?i._`isFinite(${b})`:i.nil)}}e.checkDataType=h;function y(v,b,w,x){if(v.length===1)return h(v[0],b,w,x);let k,$=(0,a.toHash)(v);if($.array&&$.object){let T=i._`typeof ${b} != "object"`;k=$.null?T:i._`!${b} || ${T}`,delete $.null,delete $.array,delete $.object}else k=i.nil;$.number&&delete $.integer;for(let T in $)k=(0,i.and)(k,h(T,b,w,x));return k}e.checkDataTypes=y;var _={message:({schema:v})=>`must be ${v}`,params:({schema:v,schemaValue:b})=>typeof v=="string"?i._`{type: ${v}}`:i._`{type: ${b}}`};function m(v){let b=g(v);(0,n.reportError)(b,_)}e.reportTypeError=m;function g(v){let{gen:b,data:w,schema:x}=v,k=(0,a.schemaRefOrVal)(v,x,"type");return{gen:b,keyword:"type",data:w,schema:x.type,schemaCode:k,schemaValue:k,parentSchema:x,params:{},it:v}}}),QG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=tt(),r=$t();function n(a,s){let{properties:o,items:u}=a.schema;if(s==="object"&&o)for(let l in o)i(a,l,o[l].default);else s==="array"&&Array.isArray(u)&&u.forEach((l,c)=>i(a,c,l.default))}e.assignDefaults=n;function i(a,s,o){let{gen:u,compositeRule:l,data:c,opts:d}=a;if(o===void 0)return;let f=t._`${c}${(0,t.getProperty)(s)}`;if(l){(0,r.checkStrictMode)(a,`default is ignored for: ${f}`);return}let p=t._`${f} === undefined`;d.useDefaults==="empty"&&(p=t._`${p} || ${f} === null || ${f} === ""`),u.if(p,t._`${f} = ${(0,t.stringify)(o)}`)}}),Ci=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=tt(),r=$t(),n=ds(),i=$t();function a(v,b){let{gen:w,data:x,it:k}=v;w.if(d(w,x,b,k.opts.ownProperties),()=>{v.setParams({missingProperty:t._`${b}`},!0),v.error()})}e.checkReportMissingProp=a;function s({gen:v,data:b,it:{opts:w}},x,k){return(0,t.or)(...x.map($=>(0,t.and)(d(v,b,$,w.ownProperties),t._`${k} = ${$}`)))}e.checkMissingProp=s;function o(v,b){v.setParams({missingProperty:b},!0),v.error()}e.reportMissingProp=o;function u(v){return v.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=u;function l(v,b,w){return t._`${u(v)}.call(${b}, ${w})`}e.isOwnProperty=l;function c(v,b,w,x){let k=t._`${b}${(0,t.getProperty)(w)} !== undefined`;return x?t._`${k} && ${l(v,b,w)}`:k}e.propertyInData=c;function d(v,b,w,x){let k=t._`${b}${(0,t.getProperty)(w)} === undefined`;return x?(0,t.or)(k,(0,t.not)(l(v,b,w))):k}e.noPropertyInData=d;function f(v){return v?Object.keys(v).filter(b=>b!=="__proto__"):[]}e.allSchemaProperties=f;function p(v,b){return f(b).filter(w=>!(0,r.alwaysValidSchema)(v,b[w]))}e.schemaProperties=p;function h({schemaCode:v,data:b,it:{gen:w,topSchemaRef:x,schemaPath:k,errorPath:$},it:T},j,P,U){let B=U?t._`${v}, ${b}, ${x}${k}`:b,C=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,$)],[n.default.parentData,T.parentData],[n.default.parentDataProperty,T.parentDataProperty],[n.default.rootData,n.default.rootData]];T.opts.dynamicRef&&C.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let ne=t._`${B}, ${w.object(...C)}`;return P!==t.nil?t._`${j}.call(${P}, ${ne})`:t._`${j}(${ne})`}e.callValidateCode=h;var y=t._`new RegExp`;function _({gen:v,it:{opts:b}},w){let x=b.unicodeRegExp?"u":"",{regExp:k}=b.code,$=k(w,x);return v.scopeValue("pattern",{key:$.toString(),ref:$,code:t._`${k.code==="new RegExp"?y:(0,i.useFunc)(v,k)}(${w}, ${x})`})}e.usePattern=_;function m(v){let{gen:b,data:w,keyword:x,it:k}=v,$=b.name("valid");if(k.allErrors){let j=b.let("valid",!0);return T(()=>b.assign(j,!1)),j}return b.var($,!0),T(()=>b.break()),$;function T(j){let P=b.const("len",t._`${w}.length`);b.forRange("i",0,P,U=>{v.subschema({keyword:x,dataProp:U,dataPropType:r.Type.Num},$),b.if((0,t.not)($),j)})}}e.validateArray=m;function g(v){let{gen:b,schema:w,keyword:x,it:k}=v;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(j=>(0,r.alwaysValidSchema)(k,j))&&!k.opts.unevaluated)return;let $=b.let("valid",!1),T=b.name("_valid");b.block(()=>w.forEach((j,P)=>{let U=v.subschema({keyword:x,schemaProp:P,compositeRule:!0},T);b.assign($,t._`${$} || ${T}`),!v.mergeValidEvaluated(U,T)&&b.if((0,t.not)($))})),v.result($,()=>v.reset(),()=>v.error(!0))}e.validateUnion=g}),XG=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=tt(),r=ds(),n=Ci(),i=Og();function a(p,h){let{gen:y,keyword:_,schema:m,parentSchema:g,it:v}=p,b=h.macro.call(v.self,m,g,v),w=c(y,_,b);v.opts.validateSchema!==!1&&v.self.validateSchema(b,!0);let x=y.name("valid");p.subschema({schema:b,schemaPath:t.nil,errSchemaPath:`${v.errSchemaPath}/${_}`,topSchemaRef:w,compositeRule:!0},x),p.pass(x,()=>p.error(!0))}e.macroKeywordCode=a;function s(p,h){var y;let{gen:_,keyword:m,schema:g,parentSchema:v,$data:b,it:w}=p;l(w,h);let x=!b&&h.compile?h.compile.call(w.self,g,v,w):h.validate,k=c(_,m,x),$=_.let("valid");p.block$data($,T),p.ok((y=h.valid)!==null&&y!==void 0?y:$);function T(){if(h.errors===!1)U(),h.modifying&&o(p),B(()=>p.error());else{let C=h.async?j():P();h.modifying&&o(p),B(()=>u(p,C))}}function j(){let C=_.let("ruleErrs",null);return _.try(()=>U(t._`await `),ne=>_.assign($,!1).if(t._`${ne} instanceof ${w.ValidationError}`,()=>_.assign(C,t._`${ne}.errors`),()=>_.throw(ne))),C}function P(){let C=t._`${k}.errors`;return _.assign(C,null),U(t.nil),C}function U(C=h.async?t._`await `:t.nil){let ne=w.opts.passContext?r.default.this:r.default.self,H=!("compile"in h&&!b||h.schema===!1);_.assign($,t._`${C}${(0,n.callValidateCode)(p,k,ne,H)}`,h.modifying)}function B(C){var ne;_.if((0,t.not)((ne=h.valid)!==null&&ne!==void 0?ne:$),C)}}e.funcKeywordCode=s;function o(p){let{gen:h,data:y,it:_}=p;h.if(_.parentData,()=>h.assign(y,t._`${_.parentData}[${_.parentDataProperty}]`))}function u(p,h){let{gen:y}=p;y.if(t._`Array.isArray(${h})`,()=>{y.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${h} : ${r.default.vErrors}.concat(${h})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,i.extendErrors)(p)},()=>p.error())}function l({schemaEnv:p},h){if(h.async&&!p.$async)throw Error("async keyword in sync schema")}function c(p,h,y){if(y===void 0)throw Error(`keyword "${h}" failed to compile`);return p.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,t.stringify)(y)})}function d(p,h,y=!1){return!h.length||h.some(_=>_==="array"?Array.isArray(p):_==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==_||y&&typeof p>"u")}e.validSchemaType=d;function f({schema:p,opts:h,self:y,errSchemaPath:_},m,g){if(Array.isArray(m.keyword)?!m.keyword.includes(g):m.keyword!==g)throw Error("ajv implementation error");let v=m.dependencies;if(v?.some(b=>!Object.prototype.hasOwnProperty.call(p,b)))throw Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(m.validateSchema&&!m.validateSchema(p[g])){let b=`keyword "${g}" value is invalid at path "${_}": `+y.errorsText(m.validateSchema.errors);if(h.validateSchema==="log")y.logger.error(b);else throw Error(b)}}e.validateKeywordUsage=f}),eK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=tt(),r=$t();function n(s,{keyword:o,schemaProp:u,schema:l,schemaPath:c,errSchemaPath:d,topSchemaRef:f}){if(o!==void 0&&l!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){let p=s.schema[o];return u===void 0?{schema:p,schemaPath:t._`${s.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${o}`}:{schema:p[u],schemaPath:t._`${s.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(u)}`,errSchemaPath:`${s.errSchemaPath}/${o}/${(0,r.escapeFragment)(u)}`}}if(l!==void 0){if(c===void 0||d===void 0||f===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:c,topSchemaRef:f,errSchemaPath:d}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=n;function i(s,o,{dataProp:u,dataPropType:l,data:c,dataTypes:d,propertyName:f}){if(c!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:p}=o;if(u!==void 0){let{errorPath:y,dataPathArr:_,opts:m}=o,g=p.let("data",t._`${o.data}${(0,t.getProperty)(u)}`,!0);h(g),s.errorPath=t.str`${y}${(0,r.getErrorPath)(u,l,m.jsPropertySyntax)}`,s.parentDataProperty=t._`${u}`,s.dataPathArr=[..._,s.parentDataProperty]}if(c!==void 0){let y=c instanceof t.Name?c:p.let("data",c,!0);h(y),f!==void 0&&(s.propertyName=f)}d&&(s.dataTypes=d);function h(y){s.data=y,s.dataLevel=o.dataLevel+1,s.dataTypes=[],o.definedProperties=new Set,s.parentData=o.data,s.dataNames=[...o.dataNames,y]}}e.extendSubschemaData=i;function a(s,{jtdDiscriminator:o,jtdMetadata:u,compositeRule:l,createErrors:c,allErrors:d}){l!==void 0&&(s.compositeRule=l),c!==void 0&&(s.createErrors=c),d!==void 0&&(s.allErrors=d),s.jtdDiscriminator=o,s.jtdMetadata=u}e.extendSubschemaMode=a}),uR=G((e,t)=>{t.exports=function r(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var a,s,o;if(Array.isArray(n)){if(a=n.length,a!=i.length)return!1;for(s=a;s--!==0;)if(!r(n[s],i[s]))return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(o=Object.keys(n),a=o.length,a!==Object.keys(i).length)return!1;for(s=a;s--!==0;)if(!Object.prototype.hasOwnProperty.call(i,o[s]))return!1;for(s=a;s--!==0;){var u=o[s];if(!r(n[u],i[u]))return!1}return!0}return n!==n&&i!==i}}),tK=G((e,t)=>{var r=t.exports=function(a,s,o){typeof s=="function"&&(o=s,s={}),o=s.cb||o;var u=typeof o=="function"?o:o.pre||function(){},l=o.post||function(){};n(s,u,l,a,"",a)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(a,s,o,u,l,c,d,f,p,h){if(u&&typeof u=="object"&&!Array.isArray(u)){s(u,l,c,d,f,p,h);for(var y in u){var _=u[y];if(Array.isArray(_)){if(y in r.arrayKeywords)for(var m=0;m<_.length;m++)n(a,s,o,_[m],l+"/"+y+"/"+m,c,l,y,u,m)}else if(y in r.propsKeywords){if(_&&typeof _=="object")for(var g in _)n(a,s,o,_[g],l+"/"+y+"/"+i(g),c,l,y,u,g)}else(y in r.keywords||a.allKeys&&!(y in r.skipKeywords))&&n(a,s,o,_,l+"/"+y,c,l,y,u)}o(u,l,c,d,f,p,h)}}function i(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ng=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=$t(),r=uR(),n=tK(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(_,m=!0){return typeof _=="boolean"?!0:m===!0?!o(_):m?u(_)<=m:!1}e.inlineRef=a;var s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(_){for(let m in _){if(s.has(m))return!0;let g=_[m];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function u(_){let m=0;for(let g in _){if(g==="$ref")return 1/0;if(m++,!i.has(g)&&(typeof _[g]=="object"&&(0,t.eachItem)(_[g],v=>m+=u(v)),m===1/0))return 1/0}return m}function l(_,m="",g){g!==!1&&(m=f(m));let v=_.parse(m);return c(_,v)}e.getFullPath=l;function c(_,m){return _.serialize(m).split("#")[0]+"#"}e._getFullPath=c;var d=/#\/?$/;function f(_){return _?_.replace(d,""):""}e.normalizeId=f;function p(_,m,g){return g=f(g),_.resolve(m,g)}e.resolveUrl=p;var h=/^[a-z_][-a-z0-9._]*$/i;function y(_,m){if(typeof _=="boolean")return{};let{schemaId:g,uriResolver:v}=this.opts,b=f(_[g]||m),w={"":b},x=l(v,b,!1),k={},$=new Set;return n(_,{allKeys:!0},(P,U,B,C)=>{if(C===void 0)return;let ne=x+U,H=w[C];typeof P[g]=="string"&&(H=Ze.call(this,P[g])),zt.call(this,P.$anchor),zt.call(this,P.$dynamicAnchor),w[U]=H;function Ze(ge){let Y=this.opts.uriResolver.resolve;if(ge=f(H?Y(H,ge):ge),$.has(ge))throw j(ge);$.add(ge);let O=this.refs[ge];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?T(P,O.schema,ge):ge!==f(ne)&&(ge[0]==="#"?(T(P,k[ge],ge),k[ge]=P):this.refs[ge]=ne),ge}function zt(ge){if(typeof ge=="string"){if(!h.test(ge))throw Error(`invalid anchor "${ge}"`);Ze.call(this,`#${ge}`)}}}),k;function T(P,U,B){if(U!==void 0&&!r(P,U))throw j(B)}function j(P){return Error(`reference "${P}" resolves to more than one schema`)}}e.getSchemaRefs=y}),zg=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=YG(),r=Uh(),n=oR(),i=Uh(),a=QG(),s=XG(),o=eK(),u=tt(),l=ds(),c=Ng(),d=$t(),f=Og();function p(D){if(x(D)&&($(D),w(D))){m(D);return}h(D,()=>(0,t.topBoolOrEmptySchema)(D))}e.validateFunctionCode=p;function h({gen:D,validateName:Z,schema:J,schemaEnv:ie,opts:xe},Qe){xe.code.es5?D.func(Z,u._`${l.default.data}, ${l.default.valCxt}`,ie.$async,()=>{D.code(u._`"use strict"; ${v(J,xe)}`),_(D,xe),D.code(Qe)}):D.func(Z,u._`${l.default.data}, ${y(xe)}`,ie.$async,()=>D.code(v(J,xe)).code(Qe))}function y(D){return u._`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${D.dynamicRef?u._`, ${l.default.dynamicAnchors}={}`:u.nil}}={}`}function _(D,Z){D.if(l.default.valCxt,()=>{D.var(l.default.instancePath,u._`${l.default.valCxt}.${l.default.instancePath}`),D.var(l.default.parentData,u._`${l.default.valCxt}.${l.default.parentData}`),D.var(l.default.parentDataProperty,u._`${l.default.valCxt}.${l.default.parentDataProperty}`),D.var(l.default.rootData,u._`${l.default.valCxt}.${l.default.rootData}`),Z.dynamicRef&&D.var(l.default.dynamicAnchors,u._`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{D.var(l.default.instancePath,u._`""`),D.var(l.default.parentData,u._`undefined`),D.var(l.default.parentDataProperty,u._`undefined`),D.var(l.default.rootData,l.default.data),Z.dynamicRef&&D.var(l.default.dynamicAnchors,u._`{}`)})}function m(D){let{schema:Z,opts:J,gen:ie}=D;h(D,()=>{J.$comment&&Z.$comment&&C(D),P(D),ie.let(l.default.vErrors,null),ie.let(l.default.errors,0),J.unevaluated&&g(D),T(D),ne(D)})}function g(D){let{gen:Z,validateName:J}=D;D.evaluated=Z.const("evaluated",u._`${J}.evaluated`),Z.if(u._`${D.evaluated}.dynamicProps`,()=>Z.assign(u._`${D.evaluated}.props`,u._`undefined`)),Z.if(u._`${D.evaluated}.dynamicItems`,()=>Z.assign(u._`${D.evaluated}.items`,u._`undefined`))}function v(D,Z){let J=typeof D=="object"&&D[Z.schemaId];return J&&(Z.code.source||Z.code.process)?u._`/*# sourceURL=${J} */`:u.nil}function b(D,Z){if(x(D)&&($(D),w(D))){k(D,Z);return}(0,t.boolOrEmptySchema)(D,Z)}function w({schema:D,self:Z}){if(typeof D=="boolean")return!D;for(let J in D)if(Z.RULES.all[J])return!0;return!1}function x(D){return typeof D.schema!="boolean"}function k(D,Z){let{schema:J,gen:ie,opts:xe}=D;xe.$comment&&J.$comment&&C(D),U(D),B(D);let Qe=ie.const("_errs",l.default.errors);T(D,Qe),ie.var(Z,u._`${Qe} === ${l.default.errors}`)}function $(D){(0,d.checkUnknownRules)(D),j(D)}function T(D,Z){if(D.opts.jtd)return Ze(D,[],!1,Z);let J=(0,r.getSchemaTypes)(D.schema),ie=(0,r.coerceAndCheckDataType)(D,J);Ze(D,J,!ie,Z)}function j(D){let{schema:Z,errSchemaPath:J,opts:ie,self:xe}=D;Z.$ref&&ie.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(Z,xe.RULES)&&xe.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function P(D){let{schema:Z,opts:J}=D;Z.default!==void 0&&J.useDefaults&&J.strictSchema&&(0,d.checkStrictMode)(D,"default is ignored in the schema root")}function U(D){let Z=D.schema[D.opts.schemaId];Z&&(D.baseId=(0,c.resolveUrl)(D.opts.uriResolver,D.baseId,Z))}function B(D){if(D.schema.$async&&!D.schemaEnv.$async)throw Error("async schema in sync schema")}function C({gen:D,schemaEnv:Z,schema:J,errSchemaPath:ie,opts:xe}){let Qe=J.$comment;if(xe.$comment===!0)D.code(u._`${l.default.self}.logger.log(${Qe})`);else if(typeof xe.$comment=="function"){let gr=u.str`${ie}/$comment`,vn=D.scopeValue("root",{ref:Z.root});D.code(u._`${l.default.self}.opts.$comment(${Qe}, ${gr}, ${vn}.schema)`)}}function ne(D){let{gen:Z,schemaEnv:J,validateName:ie,ValidationError:xe,opts:Qe}=D;J.$async?Z.if(u._`${l.default.errors} === 0`,()=>Z.return(l.default.data),()=>Z.throw(u._`new ${xe}(${l.default.vErrors})`)):(Z.assign(u._`${ie}.errors`,l.default.vErrors),Qe.unevaluated&&H(D),Z.return(u._`${l.default.errors} === 0`))}function H({gen:D,evaluated:Z,props:J,items:ie}){J instanceof u.Name&&D.assign(u._`${Z}.props`,J),ie instanceof u.Name&&D.assign(u._`${Z}.items`,ie)}function Ze(D,Z,J,ie){let{gen:xe,schema:Qe,data:gr,allErrors:vn,opts:$r,self:Er}=D,{RULES:vr}=Er;if(Qe.$ref&&($r.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(Qe,vr))){xe.block(()=>he(D,"$ref",vr.all.$ref.definition));return}$r.jtd||ge(D,Z),xe.block(()=>{for(let yn of vr.rules)qa(yn);qa(vr.post)});function qa(yn){(0,n.shouldUseGroup)(Qe,yn)&&(yn.type?(xe.if((0,i.checkDataType)(yn.type,gr,$r.strictNumbers)),zt(D,yn),Z.length===1&&Z[0]===yn.type&&J&&(xe.else(),(0,i.reportTypeError)(D)),xe.endIf()):zt(D,yn),vn||xe.if(u._`${l.default.errors} === ${ie||0}`))}}function zt(D,Z){let{gen:J,schema:ie,opts:{useDefaults:xe}}=D;xe&&(0,a.assignDefaults)(D,Z.type),J.block(()=>{for(let Qe of Z.rules)(0,n.shouldUseRule)(ie,Qe)&&he(D,Qe.keyword,Qe.definition,Z.type)})}function ge(D,Z){D.schemaEnv.meta||!D.opts.strictTypes||(Y(D,Z),!D.opts.allowUnionTypes&&O(D,Z),K(D,D.dataTypes))}function Y(D,Z){if(Z.length){if(!D.dataTypes.length){D.dataTypes=Z;return}Z.forEach(J=>{I(D.dataTypes,J)||W(D,`type "${J}" not allowed by context "${D.dataTypes.join(",")}"`)}),E(D,Z)}}function O(D,Z){Z.length>1&&!(Z.length===2&&Z.includes("null"))&&W(D,"use allowUnionTypes to allow union type keyword")}function K(D,Z){let J=D.self.RULES.all;for(let ie in J){let xe=J[ie];if(typeof xe=="object"&&(0,n.shouldUseRule)(D.schema,xe)){let{type:Qe}=xe.definition;Qe.length&&!Qe.some(gr=>A(Z,gr))&&W(D,`missing type "${Qe.join(",")}" for keyword "${ie}"`)}}}function A(D,Z){return D.includes(Z)||Z==="number"&&D.includes("integer")}function I(D,Z){return D.includes(Z)||Z==="integer"&&D.includes("number")}function E(D,Z){let J=[];for(let ie of D.dataTypes)I(Z,ie)?J.push(ie):Z.includes("integer")&&ie==="number"&&J.push("integer");D.dataTypes=J}function W(D,Z){let J=D.schemaEnv.baseId+D.errSchemaPath;Z+=` at "${J}" (strictTypes)`,(0,d.checkStrictMode)(D,Z,D.opts.strictTypes)}class ve{constructor(Z,J,ie){if((0,s.validateKeywordUsage)(Z,J,ie),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=ie,this.data=Z.data,this.schema=Z.schema[ie],this.$data=J.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(Z,this.schema,ie,this.$data),this.schemaType=J.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=J,this.$data)this.schemaCode=Z.gen.const("vSchema",ar(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,J.schemaType,J.allowUndefined))throw Error(`${ie} value must be ${JSON.stringify(J.schemaType)}`);("code"in J?J.trackErrors:J.errors!==!1)&&(this.errsCount=Z.gen.const("_errs",l.default.errors))}result(Z,J,ie){this.failResult((0,u.not)(Z),J,ie)}failResult(Z,J,ie){this.gen.if(Z),ie?ie():this.error(),J?(this.gen.else(),J(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(Z,J){this.failResult((0,u.not)(Z),void 0,J)}fail(Z){if(Z===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(Z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:J}=this;this.fail(u._`${J} !== undefined && (${(0,u.or)(this.invalid$data(),Z)})`)}error(Z,J,ie){if(J){this.setParams(J),this._error(Z,ie),this.setParams({});return}this._error(Z,ie)}_error(Z,J){(Z?f.reportExtraError:f.reportError)(this,this.def.error,J)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){this.allErrors||this.gen.if(Z)}setParams(Z,J){J?Object.assign(this.params,Z):this.params=Z}block$data(Z,J,ie=u.nil){this.gen.block(()=>{this.check$data(Z,ie),J()})}check$data(Z=u.nil,J=u.nil){if(!this.$data)return;let{gen:ie,schemaCode:xe,schemaType:Qe,def:gr}=this;ie.if((0,u.or)(u._`${xe} === undefined`,J)),Z!==u.nil&&ie.assign(Z,!0),(Qe.length||gr.validateSchema)&&(ie.elseIf(this.invalid$data()),this.$dataError(),Z!==u.nil&&ie.assign(Z,!1)),ie.else()}invalid$data(){let{gen:Z,schemaCode:J,schemaType:ie,def:xe,it:Qe}=this;return(0,u.or)(gr(),vn());function gr(){if(ie.length){if(!(J instanceof u.Name))throw Error("ajv implementation error");let $r=Array.isArray(ie)?ie:[ie];return u._`${(0,i.checkDataTypes)($r,J,Qe.opts.strictNumbers,i.DataType.Wrong)}`}return u.nil}function vn(){if(xe.validateSchema){let $r=Z.scopeValue("validate$data",{ref:xe.validateSchema});return u._`!${$r}(${J})`}return u.nil}}subschema(Z,J){let ie=(0,o.getSubschema)(this.it,Z);(0,o.extendSubschemaData)(ie,this.it,Z),(0,o.extendSubschemaMode)(ie,Z);let xe={...this.it,...ie,items:void 0,props:void 0};return b(xe,J),xe}mergeEvaluated(Z,J){let{it:ie,gen:xe}=this;ie.opts.unevaluated&&(ie.props!==!0&&Z.props!==void 0&&(ie.props=d.mergeEvaluated.props(xe,Z.props,ie.props,J)),ie.items!==!0&&Z.items!==void 0&&(ie.items=d.mergeEvaluated.items(xe,Z.items,ie.items,J)))}mergeValidEvaluated(Z,J){let{it:ie,gen:xe}=this;if(ie.opts.unevaluated&&(ie.props!==!0||ie.items!==!0))return xe.if(J,()=>this.mergeEvaluated(Z,u.Name)),!0}}e.KeywordCxt=ve;function he(D,Z,J,ie){let xe=new ve(D,J,Z);"code"in J?J.code(xe,ie):xe.$data&&J.validate?(0,s.funcKeywordCode)(xe,J):"macro"in J?(0,s.macroKeywordCode)(xe,J):(J.compile||J.validate)&&(0,s.funcKeywordCode)(xe,J)}var St=/^\/(?:[^~]|~0|~1)*$/,ht=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ar(D,{dataLevel:Z,dataNames:J,dataPathArr:ie}){let xe,Qe;if(D==="")return l.default.rootData;if(D[0]==="/"){if(!St.test(D))throw Error(`Invalid JSON-pointer: ${D}`);xe=D,Qe=l.default.rootData}else{let Er=ht.exec(D);if(!Er)throw Error(`Invalid JSON-pointer: ${D}`);let vr=+Er[1];if(xe=Er[2],xe==="#"){if(vr>=Z)throw Error($r("property/index",vr));return ie[Z-vr]}if(vr>Z)throw Error($r("data",vr));if(Qe=J[Z-vr],!xe)return Qe}let gr=Qe,vn=xe.split("/");for(let Er of vn)Er&&(Qe=u._`${Qe}${(0,u.getProperty)((0,d.unescapeJsonPointer)(Er))}`,gr=u._`${gr} && ${Qe}`);return gr;function $r(Er,vr){return`Cannot access ${Er} ${vr} levels up, current level is ${Z}`}}e.getData=ar}),LS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});class t extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}e.default=t}),Cg=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ng();class r extends Error{constructor(i,a,s,o){super(o||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,t.resolveUrl)(i,a,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(i,this.missingRef))}}e.default=r}),ZS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=tt(),r=LS(),n=ds(),i=Ng(),a=$t(),s=zg();class o{constructor(g){var v;this.refs={},this.dynamicAnchors={};let b;typeof g.schema=="object"&&(b=g.schema),this.schema=g.schema,this.schemaId=g.schemaId,this.root=g.root||this,this.baseId=(v=g.baseId)!==null&&v!==void 0?v:(0,i.normalizeId)(b?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=b?.$async,this.refs={}}}e.SchemaEnv=o;function u(m){let g=d.call(this,m);if(g)return g;let v=(0,i.getFullPath)(this.opts.uriResolver,m.root.baseId),{es5:b,lines:w}=this.opts.code,{ownProperties:x}=this.opts,k=new t.CodeGen(this.scope,{es5:b,lines:w,ownProperties:x}),$;m.$async&&($=k.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`}));let T=k.scopeName("validate");m.validateName=T;let j={gen:k,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:k.scopeValue("schema",this.opts.code.source===!0?{ref:m.schema,code:(0,t.stringify)(m.schema)}:{ref:m.schema}),validateName:T,ValidationError:$,schema:m.schema,schemaEnv:m,rootId:v,baseId:m.baseId||v,schemaPath:t.nil,errSchemaPath:m.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},P;try{this._compilations.add(m),(0,s.validateFunctionCode)(j),k.optimize(this.opts.code.optimize);let U=k.toString();P=`${k.scopeRefs(n.default.scope)}return ${U}`,this.opts.code.process&&(P=this.opts.code.process(P,m));let B=Function(`${n.default.self}`,`${n.default.scope}`,P)(this,this.scope.get());if(this.scope.value(T,{ref:B}),B.errors=null,B.schema=m.schema,B.schemaEnv=m,m.$async&&(B.$async=!0),this.opts.code.source===!0&&(B.source={validateName:T,validateCode:U,scopeValues:k._values}),this.opts.unevaluated){let{props:C,items:ne}=j;B.evaluated={props:C instanceof t.Name?void 0:C,items:ne instanceof t.Name?void 0:ne,dynamicProps:C instanceof t.Name,dynamicItems:ne instanceof t.Name},B.source&&(B.source.evaluated=(0,t.stringify)(B.evaluated))}return m.validate=B,m}catch(U){throw delete m.validate,delete m.validateName,P&&this.logger.error("Error compiling schema, function code:",P),U}finally{this._compilations.delete(m)}}e.compileSchema=u;function l(m,g,v){var b;v=(0,i.resolveUrl)(this.opts.uriResolver,g,v);let w=m.refs[v];if(w)return w;let x=p.call(this,m,v);if(x===void 0){let k=(b=m.localRefs)===null||b===void 0?void 0:b[v],{schemaId:$}=this.opts;k&&(x=new o({schema:k,schemaId:$,root:m,baseId:g}))}if(x!==void 0)return m.refs[v]=c.call(this,x)}e.resolveRef=l;function c(m){return(0,i.inlineRef)(m.schema,this.opts.inlineRefs)?m.schema:m.validate?m:u.call(this,m)}function d(m){for(let g of this._compilations)if(f(g,m))return g}e.getCompilingSchema=d;function f(m,g){return m.schema===g.schema&&m.root===g.root&&m.baseId===g.baseId}function p(m,g){let v;for(;typeof(v=this.refs[g])=="string";)g=v;return v||this.schemas[g]||h.call(this,m,g)}function h(m,g){let v=this.opts.uriResolver.parse(g),b=(0,i._getFullPath)(this.opts.uriResolver,v),w=(0,i.getFullPath)(this.opts.uriResolver,m.baseId,void 0);if(Object.keys(m.schema).length>0&&b===w)return _.call(this,v,m);let x=(0,i.normalizeId)(b),k=this.refs[x]||this.schemas[x];if(typeof k=="string"){let $=h.call(this,m,k);return typeof $?.schema!="object"?void 0:_.call(this,v,$)}if(typeof k?.schema=="object"){if(k.validate||u.call(this,k),x===(0,i.normalizeId)(g)){let{schema:$}=k,{schemaId:T}=this.opts,j=$[T];return j&&(w=(0,i.resolveUrl)(this.opts.uriResolver,w,j)),new o({schema:$,schemaId:T,root:m,baseId:w})}return _.call(this,v,k)}}e.resolveSchema=h;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _(m,{baseId:g,schema:v,root:b}){var w;if(((w=m.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let $ of m.fragment.slice(1).split("/")){if(typeof v=="boolean")return;let T=v[(0,a.unescapeFragment)($)];if(T===void 0)return;v=T;let j=typeof v=="object"&&v[this.opts.schemaId];!y.has($)&&j&&(g=(0,i.resolveUrl)(this.opts.uriResolver,g,j))}let x;if(typeof v!="boolean"&&v.$ref&&!(0,a.schemaHasRulesButRef)(v,this.RULES)){let $=(0,i.resolveUrl)(this.opts.uriResolver,g,v.$ref);x=h.call(this,b,$)}let{schemaId:k}=this.opts;if(x=x||new o({schema:v,schemaId:k,root:b,baseId:g}),x.schema!==x.root.schema)return x}}),rK=G((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),nK=G((e,t)=>{var r={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};t.exports={HEX:r}}),iK=G((e,t)=>{var{HEX:r}=nK(),n=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function i(m){if(l(m,".")<3)return{host:m,isIPV4:!1};let g=m.match(n)||[],[v]=g;return v?{host:u(v,"."),isIPV4:!0}:{host:m,isIPV4:!1}}function a(m,g=!1){let v="",b=!0;for(let w of m){if(r[w]===void 0)return;w!=="0"&&b===!0&&(b=!1),b||(v+=w)}return g&&v.length===0&&(v="0"),v}function s(m){let g=0,v={error:!1,address:"",zone:""},b=[],w=[],x=!1,k=!1,$=!1;function T(){if(w.length){if(x===!1){let j=a(w);if(j!==void 0)b.push(j);else return v.error=!0,!1}w.length=0}return!0}for(let j=0;j<m.length;j++){let P=m[j];if(!(P==="["||P==="]"))if(P===":"){if(k===!0&&($=!0),!T())break;if(g++,b.push(":"),g>7){v.error=!0;break}j-1>=0&&m[j-1]===":"&&(k=!0);continue}else if(P==="%"){if(!T())break;x=!0}else{w.push(P);continue}}return w.length&&(x?v.zone=w.join(""):$?b.push(w.join("")):b.push(a(w))),v.address=b.join(""),v}function o(m){if(l(m,":")<2)return{host:m,isIPV6:!1};let g=s(m);if(g.error)return{host:m,isIPV6:!1};{let{address:v,address:b}=g;return g.zone&&(v+="%"+g.zone,b+="%25"+g.zone),{host:v,escapedHost:b,isIPV6:!0}}}function u(m,g){let v="",b=!0,w=m.length;for(let x=0;x<w;x++){let k=m[x];k==="0"&&b?(x+1<=w&&m[x+1]===g||x+1===w)&&(v+=k,b=!1):(k===g?b=!0:b=!1,v+=k)}return v}function l(m,g){let v=0;for(let b=0;b<m.length;b++)m[b]===g&&v++;return v}var c=/^\.\.?\//u,d=/^\/\.(?:\/|$)/u,f=/^\/\.\.(?:\/|$)/u,p=/^\/?(?:.|\n)*?(?=\/|$)/u;function h(m){let g=[];for(;m.length;)if(m.match(c))m=m.replace(c,"");else if(m.match(d))m=m.replace(d,"/");else if(m.match(f))m=m.replace(f,"/"),g.pop();else if(m==="."||m==="..")m="";else{let v=m.match(p);if(v){let b=v[0];m=m.slice(b.length),g.push(b)}else throw Error("Unexpected dot segment condition")}return g.join("")}function y(m,g){let v=g!==!0?escape:unescape;return m.scheme!==void 0&&(m.scheme=v(m.scheme)),m.userinfo!==void 0&&(m.userinfo=v(m.userinfo)),m.host!==void 0&&(m.host=v(m.host)),m.path!==void 0&&(m.path=v(m.path)),m.query!==void 0&&(m.query=v(m.query)),m.fragment!==void 0&&(m.fragment=v(m.fragment)),m}function _(m){let g=[];if(m.userinfo!==void 0&&(g.push(m.userinfo),g.push("@")),m.host!==void 0){let v=unescape(m.host),b=i(v);if(b.isIPV4)v=b.host;else{let w=o(b.host);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=m.host}g.push(v)}return(typeof m.port=="number"||typeof m.port=="string")&&(g.push(":"),g.push(String(m.port))),g.length?g.join(""):void 0}t.exports={recomposeAuthority:_,normalizeComponentEncoding:y,removeDotSegments:h,normalizeIPv4:i,normalizeIPv6:o,stringArrayToHexStripped:a}}),aK=G((e,t)=>{var r=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function i(b){return typeof b.secure=="boolean"?b.secure:String(b.scheme).toLowerCase()==="wss"}function a(b){return b.host||(b.error=b.error||"HTTP URIs must have a host."),b}function s(b){let w=String(b.scheme).toLowerCase()==="https";return(b.port===(w?443:80)||b.port==="")&&(b.port=void 0),b.path||(b.path="/"),b}function o(b){return b.secure=i(b),b.resourceName=(b.path||"/")+(b.query?"?"+b.query:""),b.path=void 0,b.query=void 0,b}function u(b){if((b.port===(i(b)?443:80)||b.port==="")&&(b.port=void 0),typeof b.secure=="boolean"&&(b.scheme=b.secure?"wss":"ws",b.secure=void 0),b.resourceName){let[w,x]=b.resourceName.split("?");b.path=w&&w!=="/"?w:void 0,b.query=x,b.resourceName=void 0}return b.fragment=void 0,b}function l(b,w){if(!b.path)return b.error="URN can not be parsed",b;let x=b.path.match(n);if(x){let k=w.scheme||b.scheme||"urn";b.nid=x[1].toLowerCase(),b.nss=x[2];let $=`${k}:${w.nid||b.nid}`,T=v[$];b.path=void 0,T&&(b=T.parse(b,w))}else b.error=b.error||"URN can not be parsed.";return b}function c(b,w){let x=w.scheme||b.scheme||"urn",k=b.nid.toLowerCase(),$=`${x}:${w.nid||k}`,T=v[$];T&&(b=T.serialize(b,w));let j=b,P=b.nss;return j.path=`${k||w.nid}:${P}`,w.skipEscape=!0,j}function d(b,w){let x=b;return x.uuid=x.nss,x.nss=void 0,!w.tolerant&&(!x.uuid||!r.test(x.uuid))&&(x.error=x.error||"UUID is not valid."),x}function f(b){let w=b;return w.nss=(b.uuid||"").toLowerCase(),w}var p={scheme:"http",domainHost:!0,parse:a,serialize:s},h={scheme:"https",domainHost:p.domainHost,parse:a,serialize:s},y={scheme:"ws",domainHost:!0,parse:o,serialize:u},_={scheme:"wss",domainHost:y.domainHost,parse:y.parse,serialize:y.serialize},m={scheme:"urn",parse:l,serialize:c,skipNormalize:!0},g={scheme:"urn:uuid",parse:d,serialize:f,skipNormalize:!0},v={http:p,https:h,ws:y,wss:_,urn:m,"urn:uuid":g};t.exports=v}),sK=G((e,t)=>{var{normalizeIPv6:r,normalizeIPv4:n,removeDotSegments:i,recomposeAuthority:a,normalizeComponentEncoding:s}=iK(),o=aK();function u(g,v){return typeof g=="string"?g=f(_(g,v),v):typeof g=="object"&&(g=_(f(g,v),v)),g}function l(g,v,b){let w=Object.assign({scheme:"null"},b),x=c(_(g,w),_(v,w),w,!0);return f(x,{...w,skipEscape:!0})}function c(g,v,b,w){let x={};return w||(g=_(f(g,b),b),v=_(f(v,b),b)),b=b||{},!b.tolerant&&v.scheme?(x.scheme=v.scheme,x.userinfo=v.userinfo,x.host=v.host,x.port=v.port,x.path=i(v.path||""),x.query=v.query):(v.userinfo!==void 0||v.host!==void 0||v.port!==void 0?(x.userinfo=v.userinfo,x.host=v.host,x.port=v.port,x.path=i(v.path||""),x.query=v.query):(v.path?(v.path.charAt(0)==="/"?x.path=i(v.path):((g.userinfo!==void 0||g.host!==void 0||g.port!==void 0)&&!g.path?x.path="/"+v.path:g.path?x.path=g.path.slice(0,g.path.lastIndexOf("/")+1)+v.path:x.path=v.path,x.path=i(x.path)),x.query=v.query):(x.path=g.path,v.query!==void 0?x.query=v.query:x.query=g.query),x.userinfo=g.userinfo,x.host=g.host,x.port=g.port),x.scheme=g.scheme),x.fragment=v.fragment,x}function d(g,v,b){return typeof g=="string"?(g=unescape(g),g=f(s(_(g,b),!0),{...b,skipEscape:!0})):typeof g=="object"&&(g=f(s(g,!0),{...b,skipEscape:!0})),typeof v=="string"?(v=unescape(v),v=f(s(_(v,b),!0),{...b,skipEscape:!0})):typeof v=="object"&&(v=f(s(v,!0),{...b,skipEscape:!0})),g.toLowerCase()===v.toLowerCase()}function f(g,v){let b={host:g.host,scheme:g.scheme,userinfo:g.userinfo,port:g.port,path:g.path,query:g.query,nid:g.nid,nss:g.nss,uuid:g.uuid,fragment:g.fragment,reference:g.reference,resourceName:g.resourceName,secure:g.secure,error:""},w=Object.assign({},v),x=[],k=o[(w.scheme||b.scheme||"").toLowerCase()];k&&k.serialize&&k.serialize(b,w),b.path!==void 0&&(w.skipEscape?b.path=unescape(b.path):(b.path=escape(b.path),b.scheme!==void 0&&(b.path=b.path.split("%3A").join(":")))),w.reference!=="suffix"&&b.scheme&&x.push(b.scheme,":");let $=a(b);if($!==void 0&&(w.reference!=="suffix"&&x.push("//"),x.push($),b.path&&b.path.charAt(0)!=="/"&&x.push("/")),b.path!==void 0){let T=b.path;!w.absolutePath&&(!k||!k.absolutePath)&&(T=i(T)),$===void 0&&(T=T.replace(/^\/\//u,"/%2F")),x.push(T)}return b.query!==void 0&&x.push("?",b.query),b.fragment!==void 0&&x.push("#",b.fragment),x.join("")}var p=Array.from({length:127},(g,v)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(v)));function h(g){let v=0;for(let b=0,w=g.length;b<w;++b)if(v=g.charCodeAt(b),v>126||p[v])return!0;return!1}var y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _(g,v){let b=Object.assign({},v),w={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},x=g.indexOf("%")!==-1,k=!1;b.reference==="suffix"&&(g=(b.scheme?b.scheme+":":"")+"//"+g);let $=g.match(y);if($){if(w.scheme=$[1],w.userinfo=$[3],w.host=$[4],w.port=parseInt($[5],10),w.path=$[6]||"",w.query=$[7],w.fragment=$[8],isNaN(w.port)&&(w.port=$[5]),w.host){let j=n(w.host);if(j.isIPV4===!1){let P=r(j.host);w.host=P.host.toLowerCase(),k=P.isIPV6}else w.host=j.host,k=!0}w.scheme===void 0&&w.userinfo===void 0&&w.host===void 0&&w.port===void 0&&w.query===void 0&&!w.path?w.reference="same-document":w.scheme===void 0?w.reference="relative":w.fragment===void 0?w.reference="absolute":w.reference="uri",b.reference&&b.reference!=="suffix"&&b.reference!==w.reference&&(w.error=w.error||"URI is not a "+b.reference+" reference.");let T=o[(b.scheme||w.scheme||"").toLowerCase()];if(!b.unicodeSupport&&(!T||!T.unicodeSupport)&&w.host&&(b.domainHost||T&&T.domainHost)&&k===!1&&h(w.host))try{w.host=URL.domainToASCII(w.host.toLowerCase())}catch(j){w.error=w.error||"Host's domain name can not be converted to ASCII: "+j}(!T||T&&!T.skipNormalize)&&(x&&w.scheme!==void 0&&(w.scheme=unescape(w.scheme)),x&&w.host!==void 0&&(w.host=unescape(w.host)),w.path&&(w.path=escape(unescape(w.path))),w.fragment&&(w.fragment=encodeURI(decodeURIComponent(w.fragment)))),T&&T.parse&&T.parse(w,b)}else w.error=w.error||"URI can not be parsed.";return w}var m={SCHEMES:o,normalize:u,resolve:l,resolveComponents:c,equal:d,serialize:f,parse:_};t.exports=m,t.exports.default=m,t.exports.fastUri=m}),oK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=sK();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),uK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=zg();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=tt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});var n=LS(),i=Cg(),a=sR(),s=ZS(),o=tt(),u=Ng(),l=Uh(),c=$t(),d=rK(),f=oK(),p=(Y,O)=>new RegExp(Y,O);p.code="new RegExp";var h=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},g=200;function v(Y){var O,K,A,I,E,W,ve,he,St,ht,ar,D,Z,J,ie,xe,Qe,gr,vn,$r,Er,vr,qa,yn,Hl;let Fa=Y.strict,Hr=(O=Y.code)===null||O===void 0?void 0:O.optimize,Do=Hr===!0||Hr===void 0?1:Hr||0,Jl=(A=(K=Y.code)===null||K===void 0?void 0:K.regExp)!==null&&A!==void 0?A:p,Fp=(I=Y.uriResolver)!==null&&I!==void 0?I:f.default;return{strictSchema:(W=(E=Y.strictSchema)!==null&&E!==void 0?E:Fa)!==null&&W!==void 0?W:!0,strictNumbers:(he=(ve=Y.strictNumbers)!==null&&ve!==void 0?ve:Fa)!==null&&he!==void 0?he:!0,strictTypes:(ht=(St=Y.strictTypes)!==null&&St!==void 0?St:Fa)!==null&&ht!==void 0?ht:"log",strictTuples:(D=(ar=Y.strictTuples)!==null&&ar!==void 0?ar:Fa)!==null&&D!==void 0?D:"log",strictRequired:(J=(Z=Y.strictRequired)!==null&&Z!==void 0?Z:Fa)!==null&&J!==void 0?J:!1,code:Y.code?{...Y.code,optimize:Do,regExp:Jl}:{optimize:Do,regExp:Jl},loopRequired:(ie=Y.loopRequired)!==null&&ie!==void 0?ie:g,loopEnum:(xe=Y.loopEnum)!==null&&xe!==void 0?xe:g,meta:(Qe=Y.meta)!==null&&Qe!==void 0?Qe:!0,messages:(gr=Y.messages)!==null&&gr!==void 0?gr:!0,inlineRefs:(vn=Y.inlineRefs)!==null&&vn!==void 0?vn:!0,schemaId:($r=Y.schemaId)!==null&&$r!==void 0?$r:"$id",addUsedSchema:(Er=Y.addUsedSchema)!==null&&Er!==void 0?Er:!0,validateSchema:(vr=Y.validateSchema)!==null&&vr!==void 0?vr:!0,validateFormats:(qa=Y.validateFormats)!==null&&qa!==void 0?qa:!0,unicodeRegExp:(yn=Y.unicodeRegExp)!==null&&yn!==void 0?yn:!0,int32range:(Hl=Y.int32range)!==null&&Hl!==void 0?Hl:!0,uriResolver:Fp}}class b{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...v(O)};let{es5:K,lines:A}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:y,es5:K,lines:A}),this.logger=U(O.logger);let I=O.validateFormats;O.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,_,O,"NOT SUPPORTED"),w.call(this,m,O,"DEPRECATED","warn"),this._metaOpts=j.call(this),O.formats&&$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&T.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),k.call(this),O.validateFormats=I}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:O,meta:K,schemaId:A}=this.opts,I=d;A==="id"&&(I={...d},I.id=I.$id,delete I.$id),K&&O&&this.addMetaSchema(I,I[A],!1)}defaultMeta(){let{meta:O,schemaId:K}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[K]||O:void 0}validate(O,K){let A;if(typeof O=="string"){if(A=this.getSchema(O),!A)throw Error(`no schema with key or ref "${O}"`)}else A=this.compile(O);let I=A(K);return"$async"in A||(this.errors=A.errors),I}compile(O,K){let A=this._addSchema(O,K);return A.validate||this._compileSchemaEnv(A)}compileAsync(O,K){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:A}=this.opts;return I.call(this,O,K);async function I(ht,ar){await E.call(this,ht.$schema);let D=this._addSchema(ht,ar);return D.validate||W.call(this,D)}async function E(ht){ht&&!this.getSchema(ht)&&await I.call(this,{$ref:ht},!0)}async function W(ht){try{return this._compileSchemaEnv(ht)}catch(ar){if(!(ar instanceof i.default))throw ar;return ve.call(this,ar),await he.call(this,ar.missingSchema),W.call(this,ht)}}function ve({missingSchema:ht,missingRef:ar}){if(this.refs[ht])throw Error(`AnySchema ${ht} is loaded but ${ar} cannot be resolved`)}async function he(ht){let ar=await St.call(this,ht);this.refs[ht]||await E.call(this,ar.$schema),this.refs[ht]||this.addSchema(ar,ht,K)}async function St(ht){let ar=this._loading[ht];if(ar)return ar;try{return await(this._loading[ht]=A(ht))}finally{delete this._loading[ht]}}}addSchema(O,K,A,I=this.opts.validateSchema){if(Array.isArray(O)){for(let W of O)this.addSchema(W,void 0,A,I);return this}let E;if(typeof O=="object"){let{schemaId:W}=this.opts;if(E=O[W],E!==void 0&&typeof E!="string")throw Error(`schema ${W} must be string`)}return K=(0,u.normalizeId)(K||E),this._checkUnique(K),this.schemas[K]=this._addSchema(O,A,K,I,!0),this}addMetaSchema(O,K,A=this.opts.validateSchema){return this.addSchema(O,K,!0,A),this}validateSchema(O,K){if(typeof O=="boolean")return!0;let A;if(A=O.$schema,A!==void 0&&typeof A!="string")throw Error("$schema must be a string");if(A=A||this.opts.defaultMeta||this.defaultMeta(),!A)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let I=this.validate(A,O);if(!I&&K){let E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw Error(E)}return I}getSchema(O){let K;for(;typeof(K=x.call(this,O))=="string";)O=K;if(K===void 0){let{schemaId:A}=this.opts,I=new s.SchemaEnv({schema:{},schemaId:A});if(K=s.resolveSchema.call(this,I,O),!K)return;this.refs[O]=K}return K.validate||this._compileSchemaEnv(K)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let K=x.call(this,O);return typeof K=="object"&&this._cache.delete(K.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{let K=O;this._cache.delete(K);let A=O[this.opts.schemaId];return A&&(A=(0,u.normalizeId)(A),delete this.schemas[A],delete this.refs[A]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(let K of O)this.addKeyword(K);return this}addKeyword(O,K){let A;if(typeof O=="string")A=O,typeof K=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),K.keyword=A);else if(typeof O=="object"&&K===void 0){if(K=O,A=K.keyword,Array.isArray(A)&&!A.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(C.call(this,A,K),!K)return(0,c.eachItem)(A,E=>ne.call(this,E)),this;Ze.call(this,K);let I={...K,type:(0,l.getJSONTypes)(K.type),schemaType:(0,l.getJSONTypes)(K.schemaType)};return(0,c.eachItem)(A,I.type.length===0?E=>ne.call(this,E,I):E=>I.type.forEach(W=>ne.call(this,E,I,W))),this}getKeyword(O){let K=this.RULES.all[O];return typeof K=="object"?K.definition:!!K}removeKeyword(O){let{RULES:K}=this;delete K.keywords[O],delete K.all[O];for(let A of K.rules){let I=A.rules.findIndex(E=>E.keyword===O);I>=0&&A.rules.splice(I,1)}return this}addFormat(O,K){return typeof K=="string"&&(K=new RegExp(K)),this.formats[O]=K,this}errorsText(O=this.errors,{separator:K=", ",dataVar:A="data"}={}){return!O||O.length===0?"No errors":O.map(I=>`${A}${I.instancePath} ${I.message}`).reduce((I,E)=>I+K+E)}$dataMetaSchema(O,K){let A=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(let I of K){let E=I.split("/").slice(1),W=O;for(let ve of E)W=W[ve];for(let ve in A){let he=A[ve];if(typeof he!="object")continue;let{$data:St}=he.definition,ht=W[ve];St&&ht&&(W[ve]=ge(ht))}}return O}_removeAllSchemas(O,K){for(let A in O){let I=O[A];(!K||K.test(A))&&(typeof I=="string"?delete O[A]:I&&!I.meta&&(this._cache.delete(I.schema),delete O[A]))}}_addSchema(O,K,A,I=this.opts.validateSchema,E=this.opts.addUsedSchema){let W,{schemaId:ve}=this.opts;if(typeof O=="object")W=O[ve];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof O!="boolean")throw Error("schema must be object or boolean")}let he=this._cache.get(O);if(he!==void 0)return he;A=(0,u.normalizeId)(W||A);let St=u.getSchemaRefs.call(this,O,A);return he=new s.SchemaEnv({schema:O,schemaId:ve,meta:K,baseId:A,localRefs:St}),this._cache.set(he.schema,he),E&&!A.startsWith("#")&&(A&&this._checkUnique(A),this.refs[A]=he),I&&this.validateSchema(O,!0),he}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):s.compileSchema.call(this,O),!O.validate)throw Error("ajv implementation error");return O.validate}_compileMetaSchema(O){let K=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,O)}finally{this.opts=K}}}b.ValidationError=n.default,b.MissingRefError=i.default,e.default=b;function w(Y,O,K,A="error"){for(let I in Y){let E=I;E in O&&this.logger[A](`${K}: option ${I}. ${Y[E]}`)}}function x(Y){return Y=(0,u.normalizeId)(Y),this.schemas[Y]||this.refs[Y]}function k(){let Y=this.opts.schemas;if(Y)if(Array.isArray(Y))this.addSchema(Y);else for(let O in Y)this.addSchema(Y[O],O)}function $(){for(let Y in this.opts.formats){let O=this.opts.formats[Y];O&&this.addFormat(Y,O)}}function T(Y){if(Array.isArray(Y)){this.addVocabulary(Y);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let O in Y){let K=Y[O];K.keyword||(K.keyword=O),this.addKeyword(K)}}function j(){let Y={...this.opts};for(let O of h)delete Y[O];return Y}var P={log(){},warn(){},error(){}};function U(Y){if(Y===!1)return P;if(Y===void 0)return console;if(Y.log&&Y.warn&&Y.error)return Y;throw Error("logger must implement log, warn and error methods")}var B=/^[a-z_$][a-z0-9_$:-]*$/i;function C(Y,O){let{RULES:K}=this;if((0,c.eachItem)(Y,A=>{if(K.keywords[A])throw Error(`Keyword ${A} is already defined`);if(!B.test(A))throw Error(`Keyword ${A} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw Error('$data keyword must have "code" or "validate" function')}function ne(Y,O,K){var A;let I=O?.post;if(K&&I)throw Error('keyword with "post" flag cannot have "type"');let{RULES:E}=this,W=I?E.post:E.rules.find(({type:he})=>he===K);if(W||(W={type:K,rules:[]},E.rules.push(W)),E.keywords[Y]=!0,!O)return;let ve={keyword:Y,definition:{...O,type:(0,l.getJSONTypes)(O.type),schemaType:(0,l.getJSONTypes)(O.schemaType)}};O.before?H.call(this,W,ve,O.before):W.rules.push(ve),E.all[Y]=ve,(A=O.implements)===null||A===void 0||A.forEach(he=>this.addKeyword(he))}function H(Y,O,K){let A=Y.rules.findIndex(I=>I.keyword===K);A>=0?Y.rules.splice(A,0,O):(Y.rules.push(O),this.logger.warn(`rule ${K} is not defined`))}function Ze(Y){let{metaSchema:O}=Y;O!==void 0&&(Y.$data&&this.opts.$data&&(O=ge(O)),Y.validateSchema=this.compile(O,!0))}var zt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ge(Y){return{anyOf:[Y,zt]}}}),lK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),cK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;var t=Cg(),r=Ci(),n=tt(),i=ds(),a=ZS(),s=$t(),o={keyword:"$ref",schemaType:"string",code(c){let{gen:d,schema:f,it:p}=c,{baseId:h,schemaEnv:y,validateName:_,opts:m,self:g}=p,{root:v}=y;if((f==="#"||f==="#/")&&h===v.baseId)return w();let b=a.resolveRef.call(g,v,h,f);if(b===void 0)throw new t.default(p.opts.uriResolver,h,f);if(b instanceof a.SchemaEnv)return x(b);return k(b);function w(){if(y===v)return l(c,_,y,y.$async);let $=d.scopeValue("root",{ref:v});return l(c,n._`${$}.validate`,v,v.$async)}function x($){let T=u(c,$);l(c,T,$,$.$async)}function k($){let T=d.scopeValue("schema",m.code.source===!0?{ref:$,code:(0,n.stringify)($)}:{ref:$}),j=d.name("valid"),P=c.subschema({schema:$,dataTypes:[],schemaPath:n.nil,topSchemaRef:T,errSchemaPath:f},j);c.mergeEvaluated(P),c.ok(j)}}};function u(c,d){let{gen:f}=c;return d.validate?f.scopeValue("validate",{ref:d.validate}):n._`${f.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=u;function l(c,d,f,p){let{gen:h,it:y}=c,{allErrors:_,schemaEnv:m,opts:g}=y,v=g.passContext?i.default.this:n.nil;p?b():w();function b(){if(!m.$async)throw Error("async schema referenced by sync schema");let $=h.let("valid");h.try(()=>{h.code(n._`await ${(0,r.callValidateCode)(c,d,v)}`),k(d),!_&&h.assign($,!0)},T=>{h.if(n._`!(${T} instanceof ${y.ValidationError})`,()=>h.throw(T)),x(T),!_&&h.assign($,!1)}),c.ok($)}function w(){c.result((0,r.callValidateCode)(c,d,v),()=>k(d),()=>x(d))}function x($){let T=n._`${$}.errors`;h.assign(i.default.vErrors,n._`${i.default.vErrors} === null ? ${T} : ${i.default.vErrors}.concat(${T})`),h.assign(i.default.errors,n._`${i.default.vErrors}.length`)}function k($){var T;if(!y.opts.unevaluated)return;let j=(T=f?.validate)===null||T===void 0?void 0:T.evaluated;if(y.props!==!0)if(j&&!j.dynamicProps)j.props!==void 0&&(y.props=s.mergeEvaluated.props(h,j.props,y.props));else{let P=h.var("props",n._`${$}.evaluated.props`);y.props=s.mergeEvaluated.props(h,P,y.props,n.Name)}if(y.items!==!0)if(j&&!j.dynamicItems)j.items!==void 0&&(y.items=s.mergeEvaluated.items(h,j.items,y.items));else{let P=h.var("items",n._`${$}.evaluated.items`);y.items=s.mergeEvaluated.items(h,P,y.items,n.Name)}}}e.callRef=l,e.default=o}),dK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=lK(),r=cK(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=n}),fK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=t.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:s,schemaCode:o})=>t.str`must be ${n[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>t._`{comparison: ${n[s].okStr}, limit: ${o}}`},a={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:i,code(s){let{keyword:o,data:u,schemaCode:l}=s;s.fail$data(t._`${u} ${n[o].fail} ${l} || isNaN(${u})`)}};e.default=a}),pK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r={message:({schemaCode:i})=>t.str`must be multiple of ${i}`,params:({schemaCode:i})=>t._`{multipleOf: ${i}}`},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(i){let{gen:a,data:s,schemaCode:o,it:u}=i,l=u.opts.multipleOfPrecision,c=a.let("res"),d=l?t._`Math.abs(Math.round(${c}) - ${c}) > 1e-${l}`:t._`${c} !== parseInt(${c})`;i.fail$data(t._`(${o} === 0 || (${c} = ${s}/${o}, ${d}))`)}};e.default=n}),mK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let n=r.length,i=0,a=0,s;for(;a<n;)i++,s=r.charCodeAt(a++),s>=55296&&s<=56319&&a<n&&(s=r.charCodeAt(a),(s&64512)===56320&&a++);return i}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),hK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n=mK(),i={message({keyword:s,schemaCode:o}){let u=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${u} than ${o} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:i,code(s){let{keyword:o,data:u,schemaCode:l,it:c}=s,d=o==="maxLength"?t.operators.GT:t.operators.LT,f=c.opts.unicode===!1?t._`${u}.length`:t._`${(0,r.useFunc)(s.gen,n.default)}(${u})`;s.fail$data(t._`${f} ${d} ${l}`)}};e.default=a}),gK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ci(),r=$t(),n=tt(),i={message:({schemaCode:s})=>n.str`must match pattern "${s}"`,params:({schemaCode:s})=>n._`{pattern: ${s}}`},a={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:i,code(s){let{gen:o,data:u,$data:l,schema:c,schemaCode:d,it:f}=s,p=f.opts.unicodeRegExp?"u":"";if(l){let{regExp:h}=f.opts.code,y=h.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(o,h),_=o.let("valid");o.try(()=>o.assign(_,n._`${y}(${d}, ${p}).test(${u})`),()=>o.assign(_,!1)),s.fail$data(n._`!${_}`)}else{let h=(0,t.usePattern)(s,c);s.fail$data(n._`!${h}.test(${u})`)}}};e.default=a}),vK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r={message({keyword:i,schemaCode:a}){let s=i==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${a} properties`},params:({schemaCode:i})=>t._`{limit: ${i}}`},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(i){let{keyword:a,data:s,schemaCode:o}=i,u=a==="maxProperties"?t.operators.GT:t.operators.LT;i.fail$data(t._`Object.keys(${s}).length ${u} ${o}`)}};e.default=n}),yK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ci(),r=tt(),n=$t(),i={message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:i,code(s){let{gen:o,schema:u,schemaCode:l,data:c,$data:d,it:f}=s,{opts:p}=f;if(!d&&u.length===0)return;let h=u.length>=p.loopRequired;if(f.allErrors?y():_(),p.strictRequired){let v=s.parentSchema.properties,{definedProperties:b}=s.it;for(let w of u)if(v?.[w]===void 0&&!b.has(w)){let x=f.schemaEnv.baseId+f.errSchemaPath,k=`required property "${w}" is not defined at "${x}" (strictRequired)`;(0,n.checkStrictMode)(f,k,f.opts.strictRequired)}}function y(){if(h||d)s.block$data(r.nil,m);else for(let v of u)(0,t.checkReportMissingProp)(s,v)}function _(){let v=o.let("missing");if(h||d){let b=o.let("valid",!0);s.block$data(b,()=>g(v,b)),s.ok(b)}else o.if((0,t.checkMissingProp)(s,u,v)),(0,t.reportMissingProp)(s,v),o.else()}function m(){o.forOf("prop",l,v=>{s.setParams({missingProperty:v}),o.if((0,t.noPropertyInData)(o,c,v,p.ownProperties),()=>s.error())})}function g(v,b){s.setParams({missingProperty:v}),o.forOf(v,l,()=>{o.assign(b,(0,t.propertyInData)(o,c,v,p.ownProperties)),o.if((0,r.not)(b),()=>{s.error(),o.break()})},r.nil)}}};e.default=a}),_K=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r={message({keyword:i,schemaCode:a}){let s=i==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${a} items`},params:({schemaCode:i})=>t._`{limit: ${i}}`},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(i){let{keyword:a,data:s,schemaCode:o}=i,u=a==="maxItems"?t.operators.GT:t.operators.LT;i.fail$data(t._`${s}.length ${u} ${o}`)}};e.default=n}),qS=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=uR();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),bK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Uh(),r=tt(),n=$t(),i=qS(),a={message:({params:{i:o,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${o} are identical)`,params:({params:{i:o,j:u}})=>r._`{i: ${o}, j: ${u}}`},s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:a,code(o){let{gen:u,data:l,$data:c,schema:d,parentSchema:f,schemaCode:p,it:h}=o;if(!c&&!d)return;let y=u.let("valid"),_=f.items?(0,t.getSchemaTypes)(f.items):[];o.block$data(y,m,r._`${p} === false`),o.ok(y);function m(){let w=u.let("i",r._`${l}.length`),x=u.let("j");o.setParams({i:w,j:x}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(g()?v:b)(w,x))}function g(){return _.length>0&&!_.some(w=>w==="object"||w==="array")}function v(w,x){let k=u.name("item"),$=(0,t.checkDataTypes)(_,k,h.opts.strictNumbers,t.DataType.Wrong),T=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(k,r._`${l}[${w}]`),u.if($,r._`continue`),_.length>1&&u.if(r._`typeof ${k} == "string"`,r._`${k} += "_"`),u.if(r._`typeof ${T}[${k}] == "number"`,()=>{u.assign(x,r._`${T}[${k}]`),o.error(),u.assign(y,!1).break()}).code(r._`${T}[${k}] = ${w}`)})}function b(w,x){let k=(0,n.useFunc)(u,i.default),$=u.name("outer");u.label($).for(r._`;${w}--;`,()=>u.for(r._`${x} = ${w}; ${x}--;`,()=>u.if(r._`${k}(${l}[${w}], ${l}[${x}])`,()=>{o.error(),u.assign(y,!1).break($)})))}}};e.default=s}),wK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n=qS(),i={message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},a={keyword:"const",$data:!0,error:i,code(s){let{gen:o,data:u,$data:l,schemaCode:c,schema:d}=s;l||d&&typeof d=="object"?s.fail$data(t._`!${(0,r.useFunc)(o,n.default)}(${u}, ${c})`):s.fail(t._`${d} !== ${u}`)}};e.default=a}),xK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n=qS(),i={message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},a={keyword:"enum",schemaType:"array",$data:!0,error:i,code(s){let{gen:o,data:u,$data:l,schema:c,schemaCode:d,it:f}=s;if(!l&&c.length===0)throw Error("enum must have non-empty array");let p=c.length>=f.opts.loopEnum,h,y=()=>h??(h=(0,r.useFunc)(o,n.default)),_;if(p||l)_=o.let("valid"),s.block$data(_,m);else{if(!Array.isArray(c))throw Error("ajv implementation error");let v=o.const("vSchema",d);_=(0,t.or)(...c.map((b,w)=>g(v,w)))}s.pass(_);function m(){o.assign(_,!1),o.forOf("v",d,v=>o.if(t._`${y()}(${u}, ${v})`,()=>o.assign(_,!0).break()))}function g(v,b){let w=c[b];return typeof w=="object"&&w!==null?t._`${y()}(${u}, ${v}[${b}])`:t._`${u} === ${w}`}}};e.default=a}),kK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=fK(),r=pK(),n=hK(),i=gK(),a=vK(),s=yK(),o=_K(),u=bK(),l=wK(),c=xK(),d=[t.default,r.default,n.default,i.default,a.default,s.default,o.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,c.default];e.default=d}),lR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;var t=tt(),r=$t(),n={message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(s){let{parentSchema:o,it:u}=s,{items:l}=o;if(!Array.isArray(l)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,l)}};function a(s,o){let{gen:u,schema:l,data:c,keyword:d,it:f}=s;f.items=!0;let p=u.const("len",t._`${c}.length`);if(l===!1)s.setParams({len:o.length}),s.pass(t._`${p} <= ${o.length}`);else if(typeof l=="object"&&!(0,r.alwaysValidSchema)(f,l)){let y=u.var("valid",t._`${p} <= ${o.length}`);u.if((0,t.not)(y),()=>h(y)),s.ok(y)}function h(y){u.forRange("i",o.length,p,_=>{s.subschema({keyword:d,dataProp:_,dataPropType:r.Type.Num},y),!f.allErrors&&u.if((0,t.not)(y),()=>u.break())})}}e.validateAdditionalItems=a,e.default=i}),cR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;var t=tt(),r=$t(),n=Ci(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){let{schema:o,it:u}=s;if(Array.isArray(o))return a(s,"additionalItems",o);u.items=!0,!(0,r.alwaysValidSchema)(u,o)&&s.ok((0,n.validateArray)(s))}};function a(s,o,u=s.schema){let{gen:l,parentSchema:c,data:d,keyword:f,it:p}=s;_(c),p.opts.unevaluated&&u.length&&p.items!==!0&&(p.items=r.mergeEvaluated.items(l,u.length,p.items));let h=l.name("valid"),y=l.const("len",t._`${d}.length`);u.forEach((m,g)=>{(0,r.alwaysValidSchema)(p,m)||(l.if(t._`${y} > ${g}`,()=>s.subschema({keyword:f,schemaProp:g,dataProp:g},h)),s.ok(h))});function _(m){let{opts:g,errSchemaPath:v}=p,b=u.length,w=b===m.minItems&&(b===m.maxItems||m[o]===!1);if(g.strictTuples&&!w){let x=`"${f}" is ${b}-tuple, but minItems or maxItems/${o} are not specified or different at path "${v}"`;(0,r.checkStrictMode)(p,x,g.strictTuples)}}}e.validateTuple=a,e.default=i}),SK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=cR(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,t.validateTuple)(n,"items")};e.default=r}),IK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n=Ci(),i=lR(),a={message:({params:{len:o}})=>t.str`must NOT have more than ${o} items`,params:({params:{len:o}})=>t._`{limit: ${o}}`},s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:a,code(o){let{schema:u,parentSchema:l,it:c}=o,{prefixItems:d}=l;c.items=!0,!(0,r.alwaysValidSchema)(c,u)&&(d?(0,i.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};e.default=s}),$K=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n={message:({params:{min:a,max:s}})=>s===void 0?t.str`must contain at least ${a} valid item(s)`:t.str`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?t._`{minContains: ${a}}`:t._`{minContains: ${a}, maxContains: ${s}}`},i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(a){let{gen:s,schema:o,parentSchema:u,data:l,it:c}=a,d,f,{minContains:p,maxContains:h}=u;c.opts.next?(d=p===void 0?1:p,f=h):d=1;let y=s.const("len",t._`${l}.length`);if(a.setParams({min:d,max:f}),f===void 0&&d===0){(0,r.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&d>f){(0,r.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,r.alwaysValidSchema)(c,o)){let b=t._`${y} >= ${d}`;f!==void 0&&(b=t._`${b} && ${y} <= ${f}`),a.pass(b);return}c.items=!0;let _=s.name("valid");f===void 0&&d===1?g(_,()=>s.if(_,()=>s.break())):d===0?(s.let(_,!0),f!==void 0&&s.if(t._`${l}.length > 0`,m)):(s.let(_,!1),m()),a.result(_,()=>a.reset());function m(){let b=s.name("_valid"),w=s.let("count",0);g(b,()=>s.if(b,()=>v(w)))}function g(b,w){s.forRange("i",0,y,x=>{a.subschema({keyword:"contains",dataProp:x,dataPropType:r.Type.Num,compositeRule:!0},b),w()})}function v(b){s.code(t._`${b}++`),f===void 0?s.if(t._`${b} >= ${d}`,()=>s.assign(_,!0).break()):(s.if(t._`${b} > ${f}`,()=>s.assign(_,!1).break()),d===1?s.assign(_,!0):s.if(t._`${b} >= ${d}`,()=>s.assign(_,!0)))}}};e.default=i}),EK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=tt(),r=$t(),n=Ci();e.error={message:({params:{property:u,depsCount:l,deps:c}})=>{let d=l===1?"property":"properties";return t.str`must have ${d} ${c} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:c,missingProperty:d}})=>t._`{property: ${u},
130
+ missingProperty: ${d},
131
+ depsCount: ${l},
132
+ deps: ${c}}`};var i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){let[l,c]=a(u);s(u,l),o(u,c)}};function a({schema:u}){let l={},c={};for(let d in u){if(d==="__proto__")continue;let f=Array.isArray(u[d])?l:c;f[d]=u[d]}return[l,c]}function s(u,l=u.schema){let{gen:c,data:d,it:f}=u;if(Object.keys(l).length===0)return;let p=c.let("missing");for(let h in l){let y=l[h];if(y.length===0)continue;let _=(0,n.propertyInData)(c,d,h,f.opts.ownProperties);u.setParams({property:h,depsCount:y.length,deps:y.join(", ")}),f.allErrors?c.if(_,()=>{for(let m of y)(0,n.checkReportMissingProp)(u,m)}):(c.if(t._`${_} && (${(0,n.checkMissingProp)(u,y,p)})`),(0,n.reportMissingProp)(u,p),c.else())}}e.validatePropertyDeps=s;function o(u,l=u.schema){let{gen:c,data:d,keyword:f,it:p}=u,h=c.name("valid");for(let y in l)(0,r.alwaysValidSchema)(p,l[y])||(c.if((0,n.propertyInData)(c,d,y,p.opts.ownProperties),()=>{let _=u.subschema({keyword:f,schemaProp:y},h);u.mergeValidEvaluated(_,h)},()=>c.var(h,!0)),u.ok(h))}e.validateSchemaDeps=o,e.default=i}),PK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n={message:"property name must be valid",params:({params:a})=>t._`{propertyName: ${a.propertyName}}`},i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(a){let{gen:s,schema:o,data:u,it:l}=a;if((0,r.alwaysValidSchema)(l,o))return;let c=s.name("valid");s.forIn("key",u,d=>{a.setParams({propertyName:d}),a.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},c),s.if((0,t.not)(c),()=>{a.error(!0),!l.allErrors&&s.break()})}),a.ok(c)}};e.default=i}),dR=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ci(),r=tt(),n=ds(),i=$t(),a={message:"must NOT have additional properties",params:({params:o})=>r._`{additionalProperty: ${o.additionalProperty}}`},s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:a,code(o){let{gen:u,schema:l,parentSchema:c,data:d,errsCount:f,it:p}=o;if(!f)throw Error("ajv implementation error");let{allErrors:h,opts:y}=p;if(p.props=!0,y.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(p,l))return;let _=(0,t.allSchemaProperties)(c.properties),m=(0,t.allSchemaProperties)(c.patternProperties);g(),o.ok(r._`${f} === ${n.default.errors}`);function g(){u.forIn("key",d,k=>{!_.length&&!m.length?w(k):u.if(v(k),()=>w(k))})}function v(k){let $;if(_.length>8){let T=(0,i.schemaRefOrVal)(p,c.properties,"properties");$=(0,t.isOwnProperty)(u,T,k)}else _.length?$=(0,r.or)(..._.map(T=>r._`${k} === ${T}`)):$=r.nil;return m.length&&($=(0,r.or)($,...m.map(T=>r._`${(0,t.usePattern)(o,T)}.test(${k})`))),(0,r.not)($)}function b(k){u.code(r._`delete ${d}[${k}]`)}function w(k){if(y.removeAdditional==="all"||y.removeAdditional&&l===!1){b(k);return}if(l===!1){o.setParams({additionalProperty:k}),o.error(),!h&&u.break();return}if(typeof l=="object"&&!(0,i.alwaysValidSchema)(p,l)){let $=u.name("valid");y.removeAdditional==="failing"?(x(k,$,!1),u.if((0,r.not)($),()=>{o.reset(),b(k)})):(x(k,$),!h&&u.if((0,r.not)($),()=>u.break()))}}function x(k,$,T){let j={keyword:"additionalProperties",dataProp:k,dataPropType:i.Type.Str};T===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(j,$)}}};e.default=s}),TK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=zg(),r=Ci(),n=$t(),i=dR(),a={keyword:"properties",type:"object",schemaType:"object",code(s){let{gen:o,schema:u,parentSchema:l,data:c,it:d}=s;d.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(d,i.default,"additionalProperties"));let f=(0,r.allSchemaProperties)(u);for(let m of f)d.definedProperties.add(m);d.opts.unevaluated&&f.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(f),d.props));let p=f.filter(m=>!(0,n.alwaysValidSchema)(d,u[m]));if(p.length===0)return;let h=o.name("valid");for(let m of p)y(m)?_(m):(o.if((0,r.propertyInData)(o,c,m,d.opts.ownProperties)),_(m),!d.allErrors&&o.else().var(h,!0),o.endIf()),s.it.definedProperties.add(m),s.ok(h);function y(m){return d.opts.useDefaults&&!d.compositeRule&&u[m].default!==void 0}function _(m){s.subschema({keyword:"properties",schemaProp:m,dataProp:m},h)}}};e.default=a}),OK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ci(),r=tt(),n=$t(),i=$t(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){let{gen:o,schema:u,data:l,parentSchema:c,it:d}=s,{opts:f}=d,p=(0,t.allSchemaProperties)(u),h=p.filter(w=>(0,n.alwaysValidSchema)(d,u[w]));if(p.length===0||h.length===p.length&&(!d.opts.unevaluated||d.props===!0))return;let y=f.strictSchema&&!f.allowMatchingProperties&&c.properties,_=o.name("valid");d.props!==!0&&!(d.props instanceof r.Name)&&(d.props=(0,i.evaluatedPropsToName)(o,d.props));let{props:m}=d;g();function g(){for(let w of p)y&&v(w),d.allErrors?b(w):(o.var(_,!0),b(w),o.if(_))}function v(w){for(let x in y)new RegExp(w).test(x)&&(0,n.checkStrictMode)(d,`property ${x} matches pattern ${w} (use allowMatchingProperties)`)}function b(w){o.forIn("key",l,x=>{o.if(r._`${(0,t.usePattern)(s,w)}.test(${x})`,()=>{let k=h.includes(w);k||s.subschema({keyword:"patternProperties",schemaProp:w,dataProp:x,dataPropType:i.Type.Str},_),d.opts.unevaluated&&m!==!0?o.assign(r._`${m}[${x}]`,!0):!k&&!d.allErrors&&o.if((0,r.not)(_),()=>o.break())})})}}};e.default=a}),NK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=$t(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:i,schema:a,it:s}=n;if((0,t.alwaysValidSchema)(s,a)){n.fail();return}let o=i.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};e.default=r}),zK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ci(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:t.validateUnion,error:{message:"must match a schema in anyOf"}};e.default=r}),CK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n={message:"must match exactly one schema in oneOf",params:({params:a})=>t._`{passingSchemas: ${a.passing}}`},i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(a){let{gen:s,schema:o,parentSchema:u,it:l}=a;if(!Array.isArray(o))throw Error("ajv implementation error");if(l.opts.discriminator&&u.discriminator)return;let c=o,d=s.let("valid",!1),f=s.let("passing",null),p=s.name("_valid");a.setParams({passing:f}),s.block(h),a.result(d,()=>a.reset(),()=>a.error(!0));function h(){c.forEach((y,_)=>{let m;(0,r.alwaysValidSchema)(l,y)?s.var(p,!0):m=a.subschema({keyword:"oneOf",schemaProp:_,compositeRule:!0},p),_>0&&s.if(t._`${p} && ${d}`).assign(d,!1).assign(f,t._`[${f}, ${_}]`).else(),s.if(p,()=>{s.assign(d,!0),s.assign(f,_),m&&a.mergeEvaluated(m,t.Name)})})}}};e.default=i}),jK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=$t(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:i,schema:a,it:s}=n;if(!Array.isArray(a))throw Error("ajv implementation error");let o=i.name("valid");a.forEach((u,l)=>{if((0,t.alwaysValidSchema)(s,u))return;let c=n.subschema({keyword:"allOf",schemaProp:l},o);n.ok(o),n.mergeEvaluated(c)})}};e.default=r}),AK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=$t(),n={message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(s){let{gen:o,parentSchema:u,it:l}=s;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(l,'"if" without "then" and "else" is ignored');let c=a(l,"then"),d=a(l,"else");if(!c&&!d)return;let f=o.let("valid",!0),p=o.name("_valid");if(h(),s.reset(),c&&d){let _=o.let("ifClause");s.setParams({ifClause:_}),o.if(p,y("then",_),y("else",_))}else c?o.if(p,y("then")):o.if((0,t.not)(p),y("else"));s.pass(f,()=>s.error(!0));function h(){let _=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},p);s.mergeEvaluated(_)}function y(_,m){return()=>{let g=s.subschema({keyword:_},p);o.assign(f,p),s.mergeValidEvaluated(g,f),m?o.assign(m,t._`${_}`):s.setParams({ifClause:_})}}}};function a(s,o){let u=s.schema[o];return u!==void 0&&!(0,r.alwaysValidSchema)(s,u)}e.default=i}),RK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=$t(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:i,it:a}){i.if===void 0&&(0,t.checkStrictMode)(a,`"${n}" without "if" is ignored`)}};e.default=r}),DK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=lR(),r=SK(),n=cR(),i=IK(),a=$K(),s=EK(),o=PK(),u=dR(),l=TK(),c=OK(),d=NK(),f=zK(),p=CK(),h=jK(),y=AK(),_=RK();function m(g=!1){let v=[d.default,f.default,p.default,h.default,y.default,_.default,o.default,u.default,s.default,l.default,c.default];return g?v.push(r.default,i.default):v.push(t.default,n.default),v.push(a.default),v}e.default=m}),UK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r={message:({schemaCode:i})=>t.str`must match format "${i}"`,params:({schemaCode:i})=>t._`{format: ${i}}`},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(i,a){let{gen:s,data:o,$data:u,schema:l,schemaCode:c,it:d}=i,{opts:f,errSchemaPath:p,schemaEnv:h,self:y}=d;if(!f.validateFormats)return;u?_():m();function _(){let g=s.scopeValue("formats",{ref:y.formats,code:f.code.formats}),v=s.const("fDef",t._`${g}[${c}]`),b=s.let("fType"),w=s.let("format");s.if(t._`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>s.assign(b,t._`${v}.type || "string"`).assign(w,t._`${v}.validate`),()=>s.assign(b,t._`"string"`).assign(w,v)),i.fail$data((0,t.or)(x(),k()));function x(){return f.strictSchema===!1?t.nil:t._`${c} && !${w}`}function k(){let $=h.$async?t._`(${v}.async ? await ${w}(${o}) : ${w}(${o}))`:t._`${w}(${o})`,T=t._`(typeof ${w} == "function" ? ${$} : ${w}.test(${o}))`;return t._`${w} && ${w} !== true && ${b} === ${a} && !${T}`}}function m(){let g=y.formats[l];if(!g){x();return}if(g===!0)return;let[v,b,w]=k(g);v===a&&i.pass($());function x(){if(f.strictSchema===!1){y.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${l}" ignored in schema at path "${p}"`}}function k(T){let j=T instanceof RegExp?(0,t.regexpCode)(T):f.code.formats?t._`${f.code.formats}${(0,t.getProperty)(l)}`:void 0,P=s.scopeValue("formats",{key:l,ref:T,code:j});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,t._`${P}.validate`]:["string",T,P]}function $(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!h.$async)throw Error("async format in sync schema");return t._`await ${w}(${o})`}return typeof b=="function"?t._`${w}(${o})`:t._`${w}.test(${o})`}}}};e.default=n}),MK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=UK(),r=[t.default];e.default=r}),LK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),ZK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=dK(),r=kK(),n=DK(),i=MK(),a=LK(),s=[t.default,r.default,(0,n.default)(),i.default,a.metadataVocabulary,a.contentVocabulary];e.default=s}),qK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),FK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=tt(),r=qK(),n=ZS(),i=Cg(),a=$t(),s={message:({params:{discrError:u,tagName:l}})=>u===r.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:u,tag:l,tagName:c}})=>t._`{error: ${u}, tag: ${c}, tagValue: ${l}}`},o={keyword:"discriminator",type:"object",schemaType:"object",error:s,code(u){let{gen:l,data:c,schema:d,parentSchema:f,it:p}=u,{oneOf:h}=f;if(!p.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=d.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(d.mapping)throw Error("discriminator: mapping is not supported");if(!h)throw Error("discriminator: requires oneOf keyword");let _=l.let("valid",!1),m=l.const("tag",t._`${c}${(0,t.getProperty)(y)}`);l.if(t._`typeof ${m} == "string"`,()=>g(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:m,tagName:y})),u.ok(_);function g(){let w=b();l.if(!1);for(let x in w)l.elseIf(t._`${m} === ${x}`),l.assign(_,v(w[x]));l.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:m,tagName:y}),l.endIf()}function v(w){let x=l.name("valid"),k=u.subschema({keyword:"oneOf",schemaProp:w},x);return u.mergeEvaluated(k,t.Name),x}function b(){var w;let x={},k=T(f),$=!0;for(let U=0;U<h.length;U++){let B=h[U];if(B?.$ref&&!(0,a.schemaHasRulesButRef)(B,p.self.RULES)){let ne=B.$ref;if(B=n.resolveRef.call(p.self,p.schemaEnv.root,p.baseId,ne),B instanceof n.SchemaEnv&&(B=B.schema),B===void 0)throw new i.default(p.opts.uriResolver,p.baseId,ne)}let C=(w=B?.properties)===null||w===void 0?void 0:w[y];if(typeof C!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${y}"`);$=$&&(k||T(B)),j(C,U)}if(!$)throw Error(`discriminator: "${y}" must be required`);return x;function T({required:U}){return Array.isArray(U)&&U.includes(y)}function j(U,B){if(U.const)P(U.const,B);else if(U.enum)for(let C of U.enum)P(C,B);else throw Error(`discriminator: "properties/${y}" must have "const" or "enum"`)}function P(U,B){if(typeof U!="string"||U in x)throw Error(`discriminator: "${y}" values must be unique strings`);x[U]=B}}}};e.default=o}),VK=G((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),fR=G((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;var r=uK(),n=ZK(),i=FK(),a=VK(),s=["/properties"],o="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let h=this.opts.$data?this.$dataMetaSchema(a,s):a;this.addMetaSchema(h,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=zg();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=tt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var d=LS();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=Cg();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),WK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(P,U){return{validate:P,compare:U}}e.fullFormats={date:t(a,s),time:t(u(!0),l),"date-time":t(f(!0),p),"iso-time":t(u(),c),"iso-date-time":t(f(),h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:j,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:v,int32:{type:"number",validate:x},int64:{type:"number",validate:k},float:{type:"number",validate:$},double:{type:"number",validate:$},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(P){return P%4===0&&(P%100!==0||P%400===0)}var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(P){let U=n.exec(P);if(!U)return!1;let B=+U[1],C=+U[2],ne=+U[3];return C>=1&&C<=12&&ne>=1&&ne<=(C===2&&r(B)?29:i[C])}function s(P,U){if(P&&U)return P>U?1:P<U?-1:0}var o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function u(P){return function(U){let B=o.exec(U);if(!B)return!1;let C=+B[1],ne=+B[2],H=+B[3],Ze=B[4],zt=B[5]==="-"?-1:1,ge=+(B[6]||0),Y=+(B[7]||0);if(ge>23||Y>59||P&&!Ze)return!1;if(C<=23&&ne<=59&&H<60)return!0;let O=ne-Y*zt,K=C-ge*zt-(O<0?1:0);return(K===23||K===-1)&&(O===59||O===-1)&&H<61}}function l(P,U){if(!(P&&U))return;let B=new Date("2020-01-01T"+P).valueOf(),C=new Date("2020-01-01T"+U).valueOf();if(B&&C)return B-C}function c(P,U){if(!(P&&U))return;let B=o.exec(P),C=o.exec(U);if(B&&C)return P=B[1]+B[2]+B[3],U=C[1]+C[2]+C[3],P>U?1:P<U?-1:0}var d=/t|\s/i;function f(P){let U=u(P);return function(B){let C=B.split(d);return C.length===2&&a(C[0])&&U(C[1])}}function p(P,U){if(!(P&&U))return;let B=new Date(P).valueOf(),C=new Date(U).valueOf();if(B&&C)return B-C}function h(P,U){if(!(P&&U))return;let[B,C]=P.split(d),[ne,H]=U.split(d),Ze=s(B,ne);if(Ze!==void 0)return Ze||l(C,H)}var y=/\/|:/,_=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function m(P){return y.test(P)&&_.test(P)}var g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(P){return g.lastIndex=0,g.test(P)}var b=-2147483648,w=2147483647;function x(P){return Number.isInteger(P)&&P<=w&&P>=b}function k(P){return Number.isInteger(P)}function $(){return!0}var T=/[^\\]\\Z/;function j(P){if(T.test(P))return!1;try{return new RegExp(P),!0}catch{return!1}}}),BK=G(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=fR(),r=tt(),n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},a={message:({keyword:o,schemaCode:u})=>r.str`should be ${i[o].okStr} ${u}`,params:({keyword:o,schemaCode:u})=>r._`{comparison: ${i[o].okStr}, limit: ${u}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:a,code(o){let{gen:u,data:l,schemaCode:c,keyword:d,it:f}=o,{opts:p,self:h}=f;if(!p.validateFormats)return;let y=new t.KeywordCxt(f,h.RULES.all.format.definition,"format");y.$data?_():m();function _(){let v=u.scopeValue("formats",{ref:h.formats,code:p.code.formats}),b=u.const("fmt",r._`${v}[${y.schemaCode}]`);o.fail$data((0,r.or)(r._`typeof ${b} != "object"`,r._`${b} instanceof RegExp`,r._`typeof ${b}.compare != "function"`,g(b)))}function m(){let v=y.schema,b=h.formats[v];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw Error(`"${d}": format "${v}" does not define "compare" function`);let w=u.scopeValue("formats",{key:v,ref:b,code:p.code.formats?r._`${p.code.formats}${(0,r.getProperty)(v)}`:void 0});o.fail$data(g(w))}function g(v){return r._`${v}.compare(${l}, ${c}) ${i[d].fail} 0`}},dependencies:["format"]};var s=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=s}),GK=G((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=WK(),n=BK(),i=tt(),a=new i.Name("fullFormats"),s=new i.Name("fastFormats"),o=(l,c={keywords:!0})=>{if(Array.isArray(c))return u(l,c,r.fullFormats,a),l;let[d,f]=c.mode==="fast"?[r.fastFormats,s]:[r.fullFormats,a],p=c.formats||r.formatNames;return u(l,p,d,f),c.keywords&&(0,n.default)(l),l};o.get=(l,c="full")=>{let d=(c==="fast"?r.fastFormats:r.fullFormats)[l];if(!d)throw Error(`Unknown format "${l}"`);return d};function u(l,c,d,f){var p,h;(p=(h=l.opts.code).formats)!==null&&p!==void 0||(h.formats=i._`require("ajv-formats/dist/formats").${f}`);for(let y of c)l.addFormat(y,d[y])}t.exports=e=o,Object.defineProperty(e,"__esModule",{value:!0}),e.default=o}),aH=50;ss=class extends Error{};lH=typeof global=="object"&&global&&global.Object===Object&&global,cH=lH,dH=typeof self=="object"&&self&&self.Object===Object&&self,fH=cH||dH||Function("return this")(),VS=fH,pH=VS.Symbol,Lh=pH,_R=Object.prototype,mH=_R.hasOwnProperty,hH=_R.toString,hd=Lh?Lh.toStringTag:void 0;vH=gH,yH=Object.prototype,_H=yH.toString;wH=bH,xH="[object Null]",kH="[object Undefined]",Lj=Lh?Lh.toStringTag:void 0;IH=SH;bR=$H,EH="[object AsyncFunction]",PH="[object Function]",TH="[object GeneratorFunction]",OH="[object Proxy]";zH=NH,CH=VS["__core-js_shared__"],Bk=CH,Zj=(function(){var e=/[^.]+$/.exec(Bk&&Bk.keys&&Bk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();AH=jH,RH=Function.prototype,DH=RH.toString;MH=UH,LH=/[\\^$.*+?()[\]{}|]/g,ZH=/^\[object .+?Constructor\]$/,qH=Function.prototype,FH=Object.prototype,VH=qH.toString,WH=FH.hasOwnProperty,BH=RegExp("^"+VH.call(WH).replace(LH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");KH=GH;JH=HH;wR=YH,QH=wR(Object,"create"),Ud=QH;e8=XH;r8=t8,n8="__lodash_hash_undefined__",i8=Object.prototype,a8=i8.hasOwnProperty;o8=s8,u8=Object.prototype,l8=u8.hasOwnProperty;d8=c8,f8="__lodash_hash_undefined__";m8=p8;Qu.prototype.clear=e8;Qu.prototype.delete=r8;Qu.prototype.get=o8;Qu.prototype.has=d8;Qu.prototype.set=m8;qj=Qu;g8=h8;y8=v8;jg=_8,b8=Array.prototype,w8=b8.splice;k8=x8;I8=S8;E8=$8;T8=P8;Xu.prototype.clear=g8;Xu.prototype.delete=k8;Xu.prototype.get=I8;Xu.prototype.has=E8;Xu.prototype.set=T8;O8=Xu,N8=wR(VS,"Map"),z8=N8;j8=C8;R8=A8;Ag=D8;M8=U8;Z8=L8;F8=q8;W8=V8;el.prototype.clear=j8;el.prototype.delete=M8;el.prototype.get=Z8;el.prototype.has=F8;el.prototype.set=W8;xR=el,B8="Expected a function";WS.Cache=xR;fs=WS,BS=fs(()=>(process.env.CLAUDE_CONFIG_DIR??K8(G8(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR);kR=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return kR=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};oS=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},Re=class extends Error{},ln=class e extends Re{constructor(t,r,n,i,a){super(`${e.makeMessage(t,r,n)}`),this.status=t,this.headers=i,this.requestID=i?.get("request-id"),this.error=r,this.type=a??null}static makeMessage(t,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return t&&i?`${t} ${i}`:t?`${t} status code (no body)`:i||"(no status code or body)"}static generate(t,r,n,i){if(!t||!i)return new zu({message:n,cause:oS(r)});let a=r,s=a?.error?.type;return t===400?new qh(t,a,n,i,s):t===401?new Fh(t,a,n,i,s):t===403?new Vh(t,a,n,i,s):t===404?new Wh(t,a,n,i,s):t===409?new Bh(t,a,n,i,s):t===422?new Gh(t,a,n,i,s):t===429?new Kh(t,a,n,i,s):t>=500?new Hh(t,a,n,i,s):new e(t,a,n,i,s)}},qn=class extends ln{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},zu=class extends ln{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}},Zh=class extends zu{constructor({message:t}={}){super({message:t??"Request timed out."})}},qh=class extends ln{},Fh=class extends ln{},Vh=class extends ln{},Wh=class extends ln{},Bh=class extends ln{},Gh=class extends ln{},Kh=class extends ln{},Hh=class extends ln{},H8=/^[a-z][a-z0-9+.-]*:/i,J8=e=>H8.test(e),uS=e=>(uS=Array.isArray,uS(e)),Fj=uS;Q8=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Re(`${e} must be an integer`);if(t<0)throw new Re(`${e} must be a positive integer`);return t},SR=e=>{try{return JSON.parse(e)}catch{return}},X8=e=>new Promise(t=>setTimeout(t,e)),ku="0.81.0",eJ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";rJ=()=>{let e=tJ();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ku,"X-Stainless-OS":Bj(Deno.build.os),"X-Stainless-Arch":Wj(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ku,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ku,"X-Stainless-OS":Bj(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Wj(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=nJ();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ku,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ku,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};Wj=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",Bj=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),iJ=()=>Gj??(Gj=rJ());oJ=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});Js=class{constructor(){Mn.set(this,void 0),Ln.set(this,void 0),fe(this,Mn,new Uint8Array,"f"),fe(this,Ln,null,"f")}decode(t){if(t==null)return[];let r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?KS(t):t;fe(this,Mn,lJ([L(this,Mn,"f"),r]),"f");let n=[],i;for(;(i=cJ(L(this,Mn,"f"),L(this,Ln,"f")))!=null;){if(i.carriage&&L(this,Ln,"f")==null){fe(this,Ln,i.index,"f");continue}if(L(this,Ln,"f")!=null&&(i.index!==L(this,Ln,"f")+1||i.carriage)){n.push(Jj(L(this,Mn,"f").subarray(0,L(this,Ln,"f")-1))),fe(this,Mn,L(this,Mn,"f").subarray(L(this,Ln,"f")),"f"),fe(this,Ln,null,"f");continue}let a=L(this,Ln,"f")!==null?i.preceding-1:i.preceding,s=Jj(L(this,Mn,"f").subarray(0,a));n.push(s),fe(this,Mn,L(this,Mn,"f").subarray(i.index),"f"),fe(this,Ln,null,"f")}return n}flush(){return L(this,Mn,"f").length?this.decode(`
133
+ `):[]}};Mn=new WeakMap,Ln=new WeakMap;Js.NEWLINE_CHARS=new Set([`
134
+ `,"\r"]);Js.NEWLINE_REGEXP=/\r\n|[\n\r]/g;Jh={off:0,error:200,warn:300,info:400,debug:500},Yj=(e,t,r)=>{if(e){if(Y8(Jh,e))return e;sn(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Jh))}`)}};fJ={error:zd,warn:zd,info:zd,debug:zd},Qj=new WeakMap;Gs=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),Ys=class e{constructor(t,r,n){this.iterator=t,gd.set(this,void 0),this.controller=r,fe(this,gd,n,"f")}static fromSSEResponse(t,r,n){let i=!1,a=n?sn(n):console;async function*s(){if(i)throw new Re("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let o=!1;try{for await(let u of pJ(t,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(l){throw a.error("Could not parse message into JSON:",u.data),a.error("From chunk:",u.raw),l}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop")try{yield JSON.parse(u.data)}catch(l){throw a.error("Could not parse message into JSON:",u.data),a.error("From chunk:",u.raw),l}if(u.event!=="ping"&&u.event==="error"){let l=SR(u.data)??u.data,c=l?.error?.type;throw new ln(void 0,l,void 0,t.headers,c)}}o=!0}catch(u){if(Md(u))return;throw u}finally{o||r.abort()}}return new e(s,r,n)}static fromReadableStream(t,r,n){let i=!1;async function*a(){let o=new Js,u=GS(t);for await(let l of u)for(let c of o.decode(l))yield c;for(let l of o.flush())yield l}async function*s(){if(i)throw new Re("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let o=!1;try{for await(let u of a())o||u&&(yield JSON.parse(u));o=!0}catch(u){if(Md(u))return;throw u}finally{o||r.abort()}}return new e(s,r,n)}[(gd=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],r=[],n=this.iterator(),i=a=>({next:()=>{if(a.length===0){let s=n.next();t.push(s),r.push(s)}return a.shift()}});return[new e(()=>i(t),this.controller,L(this,gd,"f")),new e(()=>i(r),this.controller,L(this,gd,"f"))]}toReadableStream(){let t=this,r;return IR({async start(){r=t[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:a}=await r.next();if(a)return n.close();let s=KS(JSON.stringify(i)+`
135
+ `);n.enqueue(s)}catch(i){n.error(i)}},async cancel(){await r.return?.()}})}};cS=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(`
136
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(t),t.startsWith(":"))return null;let[r,n,i]=hJ(t,":");return i.startsWith(" ")&&(i=i.substring(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}};Yh=class e extends Promise{constructor(t,r,n=ER){super(i=>{i(null)}),this.responsePromise=r,this.parseResponse=n,Cd.set(this,void 0),fe(this,Cd,t,"f")}_thenUnwrap(t){return new e(L(this,Cd,"f"),this.responsePromise,async(r,n)=>PR(t(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(L(this,Cd,"f"),t))),this.parsedPromise}then(t,r){return this.parse().then(t,r)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};Cd=new WeakMap;Qh=class{constructor(t,r,n,i){hh.set(this,void 0),fe(this,hh,t,"f"),this.options=i,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new Re("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await L(this,hh,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(hh=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let r of t.getPaginatedItems())yield r}},dS=class extends Yh{constructor(t,r,n){super(t,r,async(i,a)=>new n(i,a.response,await ER(i,a),a.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let r of t)yield r}},Qs=class extends Qh{constructor(t,r,n,i){super(t,r,n,i),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...lS(this.options.query),before_id:r}}:null}let t=this.last_id;return t?{...this.options,query:{...lS(this.options.query),after_id:t}}:null}},Xh=class extends Qh{constructor(t,r,n,i){super(t,r,n,i),this.data=n.data||[],this.has_more=n.has_more||!1,this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...lS(this.options.query),page:t}}:null}},TR=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};OR=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",HS=async(e,t,r=!0)=>({...e,body:await vJ(e.body,t,r)}),Xj=new WeakMap;vJ=async(e,t,r=!0)=>{if(!await gJ(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([i,a])=>fS(n,i,a,r))),n},yJ=e=>e instanceof Blob&&"name"in e,fS=async(e,t,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")e.append(t,String(r));else if(r instanceof Response){let i={},a=r.headers.get("Content-Type");a&&(i={type:a}),e.append(t,Tu([await r.blob()],Ch(r,n),i))}else if(OR(r))e.append(t,Tu([await new Response($R(r)).blob()],Ch(r,n)));else if(yJ(r))e.append(t,Tu([r],Ch(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(i=>fS(e,t+"[]",i,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([i,a])=>fS(e,`${t}[${i}]`,a,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},NR=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",_J=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&NR(e),bJ=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";Fn=class{constructor(t){this._client=t}},zR=Symbol.for("brand.privateNullableHeaders");gt=e=>{let t=new Headers,r=new Set;for(let n of e){let i=new Set;for(let[a,s]of kJ(n)){let o=a.toLowerCase();i.has(o)||(t.delete(a),i.add(o)),s===null?(t.delete(a),r.add(o)):(t.append(a,s),r.delete(o))}}return{[zR]:!0,values:t,nulls:r}},Dd=Symbol("anthropic.sdk.stainlessHelper");eA=Object.freeze(Object.create(null)),IJ=(e=AR)=>function(t,...r){if(t.length===1)return t[0];let n=!1,i=[],a=t.reduce((l,c,d)=>{/[?#]/.test(c)&&(n=!0);let f=r[d],p=(n?encodeURIComponent:e)(""+f);return d!==r.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??eA)??eA)?.toString)&&(p=f+"",i.push({start:l.length+c.length,length:p.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),l+c+(d===r.length?"":p)},""),s=a.split(/[?#]/,1)[0],o=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=o.exec(s))!==null;)i.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(i.sort((l,c)=>l.start-c.start),i.length>0){let l=0,c=i.reduce((d,f)=>{let p=" ".repeat(f.start-l),h="^".repeat(f.length);return l=f.start+f.length,d+p+h},"");throw new Re(`Path parameters result in path with invalid segments:
137
+ ${i.map(d=>d.error).join(`
138
+ `)}
139
+ ${a}
140
+ ${c}`)}return a},Tr=IJ(AR),eg=class extends Fn{list(t={},r){let{betas:n,...i}=t??{};return this._client.getAPIList("/v1/files",Qs,{query:i,...r,headers:gt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(t,r={},n){let{betas:i}=r??{};return this._client.delete(Tr`/v1/files/${t}`,{...n,headers:gt([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/files/${t}/content`,{...n,headers:gt([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/files/${t}`,{...n,headers:gt([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(t,r){let{betas:n,...i}=t;return this._client.post("/v1/files",HS({body:i,...r,headers:gt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},SJ(i.file),r?.headers])},this._client))}},tg=class extends Fn{retrieve(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/models/${t}?beta=true`,{...n,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(t={},r){let{betas:n,...i}=t??{};return this._client.getAPIList("/v1/models?beta=true",Qs,{query:i,...r,headers:gt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},RR={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};EJ=e=>{let t=0,r=[];for(;t<e.length;){let n=e[t];if(n==="\\"){t++;continue}if(n==="{"){r.push({type:"brace",value:"{"}),t++;continue}if(n==="}"){r.push({type:"brace",value:"}"}),t++;continue}if(n==="["){r.push({type:"paren",value:"["}),t++;continue}if(n==="]"){r.push({type:"paren",value:"]"}),t++;continue}if(n===":"){r.push({type:"separator",value:":"}),t++;continue}if(n===","){r.push({type:"delimiter",value:","}),t++;continue}if(n==='"'){let s="",o=!1;for(n=e[++t];n!=='"';){if(t===e.length){o=!0;break}if(n==="\\"){if(t++,t===e.length){o=!0;break}s+=n+e[t],n=e[++t]}else s+=n,n=e[++t]}n=e[++t],!o&&r.push({type:"string",value:s});continue}if(n&&/\s/.test(n)){t++;continue}let i=/[0-9]/;if(n&&i.test(n)||n==="-"||n==="."){let s="";for(n==="-"&&(s+=n,n=e[++t]);n&&i.test(n)||n===".";)s+=n,n=e[++t];r.push({type:"number",value:s});continue}let a=/[a-z]/i;if(n&&a.test(n)){let s="";for(;n&&a.test(n)&&t!==e.length;)s+=n,n=e[++t];if(s=="true"||s=="false"||s==="null")r.push({type:"name",value:s});else{t++;continue}continue}t++}return r},Su=e=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Su(e);case"number":let r=t.value[t.value.length-1];if(r==="."||r==="-")return e=e.slice(0,e.length-1),Su(e);case"string":let n=e[e.length-2];if(n?.type==="delimiter")return e=e.slice(0,e.length-1),Su(e);if(n?.type==="brace"&&n.value==="{")return e=e.slice(0,e.length-1),Su(e);break;case"delimiter":return e=e.slice(0,e.length-1),Su(e)}return e},PJ=e=>{let t=[];return e.map(r=>{r.type==="brace"&&(r.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(r=>{r==="}"?e.push({type:"brace",value:"}"}):r==="]"&&e.push({type:"paren",value:"]"})}),e},TJ=e=>{let t="";return e.map(r=>{r.type==="string"?t+='"'+r.value+'"':t+=r.value}),t},MR=e=>JSON.parse(TJ(PJ(Su(EJ(e))))),iA="__json_buf";mS=class e{constructor(t,r){Qn.add(this),this.messages=[],this.receivedMessages=[],rs.set(this,void 0),_u.set(this,null),this.controller=new AbortController,vd.set(this,void 0),gh.set(this,()=>{}),yd.set(this,()=>{}),_d.set(this,void 0),vh.set(this,()=>{}),bd.set(this,()=>{}),ka.set(this,{}),wd.set(this,!1),yh.set(this,!1),_h.set(this,!1),Vs.set(this,!1),bh.set(this,void 0),wh.set(this,void 0),xd.set(this,void 0),xh.set(this,n=>{if(fe(this,yh,!0,"f"),Md(n)&&(n=new qn),n instanceof qn)return fe(this,_h,!0,"f"),this._emit("abort",n);if(n instanceof Re)return this._emit("error",n);if(n instanceof Error){let i=new Re(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Re(String(n)))}),fe(this,vd,new Promise((n,i)=>{fe(this,gh,n,"f"),fe(this,yd,i,"f")}),"f"),fe(this,_d,new Promise((n,i)=>{fe(this,vh,n,"f"),fe(this,bd,i,"f")}),"f"),L(this,vd,"f").catch(()=>{}),L(this,_d,"f").catch(()=>{}),fe(this,_u,t,"f"),fe(this,xd,r?.logger??console,"f")}get response(){return L(this,bh,"f")}get request_id(){return L(this,wh,"f")}async withResponse(){fe(this,Vs,!0,"f");let t=await L(this,vd,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let r=new e(null);return r._run(()=>r._fromReadableStream(t)),r}static createMessage(t,r,n,{logger:i}={}){let a=new e(r,{logger:i});for(let s of r.messages)a._addMessageParam(s);return fe(a,_u,{...r,stream:!0},"f"),a._run(()=>a._createMessage(t,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},L(this,xh,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,r=!0){this.receivedMessages.push(t),r&&this._emit("message",t)}async _createMessage(t,r,n){let i=n?.signal,a;i&&(i.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),i.addEventListener("abort",a));try{L(this,Qn,"m",Kk).call(this);let{response:s,data:o}=await t.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let u of o)L(this,Qn,"m",Hk).call(this,u);if(o.controller.signal?.aborted)throw new qn;L(this,Qn,"m",Jk).call(this)}finally{i&&a&&i.removeEventListener("abort",a)}}_connected(t){this.ended||(fe(this,bh,t,"f"),fe(this,wh,t?.headers.get("request-id"),"f"),L(this,gh,"f").call(this,t),this._emit("connect"))}get ended(){return L(this,wd,"f")}get errored(){return L(this,yh,"f")}get aborted(){return L(this,_h,"f")}abort(){this.controller.abort()}on(t,r){return(L(this,ka,"f")[t]||(L(this,ka,"f")[t]=[])).push({listener:r}),this}off(t,r){let n=L(this,ka,"f")[t];if(!n)return this;let i=n.findIndex(a=>a.listener===r);return i>=0&&n.splice(i,1),this}once(t,r){return(L(this,ka,"f")[t]||(L(this,ka,"f")[t]=[])).push({listener:r,once:!0}),this}emitted(t){return new Promise((r,n)=>{fe(this,Vs,!0,"f"),t!=="error"&&this.once("error",n),this.once(t,r)})}async done(){fe(this,Vs,!0,"f"),await L(this,_d,"f")}get currentMessage(){return L(this,rs,"f")}async finalMessage(){return await this.done(),L(this,Qn,"m",Gk).call(this)}async finalText(){return await this.done(),L(this,Qn,"m",rA).call(this)}_emit(t,...r){if(L(this,wd,"f"))return;t==="end"&&(fe(this,wd,!0,"f"),L(this,vh,"f").call(this));let n=L(this,ka,"f")[t];if(n&&(L(this,ka,"f")[t]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),t==="abort"){let i=r[0];!L(this,Vs,"f")&&!n?.length&&Promise.reject(i),L(this,yd,"f").call(this,i),L(this,bd,"f").call(this,i),this._emit("end");return}if(t==="error"){let i=r[0];!L(this,Vs,"f")&&!n?.length&&Promise.reject(i),L(this,yd,"f").call(this,i),L(this,bd,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",L(this,Qn,"m",Gk).call(this))}async _fromReadableStream(t,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{L(this,Qn,"m",Kk).call(this),this._connected(null);let a=Ys.fromReadableStream(t,this.controller);for await(let s of a)L(this,Qn,"m",Hk).call(this,s);if(a.controller.signal?.aborted)throw new qn;L(this,Qn,"m",Jk).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(rs=new WeakMap,_u=new WeakMap,vd=new WeakMap,gh=new WeakMap,yd=new WeakMap,_d=new WeakMap,vh=new WeakMap,bd=new WeakMap,ka=new WeakMap,wd=new WeakMap,yh=new WeakMap,_h=new WeakMap,Vs=new WeakMap,bh=new WeakMap,wh=new WeakMap,xd=new WeakMap,xh=new WeakMap,Qn=new WeakSet,Gk=function(){if(this.receivedMessages.length===0)throw new Re("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},rA=function(){if(this.receivedMessages.length===0)throw new Re("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new Re("stream ended without producing a content block with type=text");return t.join(" ")},Kk=function(){this.ended||fe(this,rs,void 0,"f")},Hk=function(t){if(this.ended)return;let r=L(this,Qn,"m",nA).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let n=r.content.at(-1);switch(t.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",t.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",t.delta.citation,n.citations??[]);break}case"input_json_delta":{aA(n)&&n.input&&this._emit("inputJson",t.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",t.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(tA(r,L(this,_u,"f"),{logger:L(this,xd,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{fe(this,rs,r,"f");break}case"content_block_start":case"message_delta":break}},Jk=function(){if(this.ended)throw new Re("stream has ended, this shouldn't happen");let t=L(this,rs,"f");if(!t)throw new Re("request ended without sending any chunks");return fe(this,rs,void 0,"f"),tA(t,L(this,_u,"f"),{logger:L(this,xd,"f")})},nA=function(t){let r=L(this,rs,"f");if(t.type==="message_start"){if(r)throw new Re(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new Re(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.container=t.delta.container,r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,r.context_management=t.context_management,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),t.usage.iterations!=null&&(r.usage.iterations=t.usage.iterations),r;case"content_block_start":return r.content.push(t.content_block),r;case"content_block_delta":{let n=r.content.at(t.index);switch(t.delta.type){case"text_delta":{n?.type==="text"&&(r.content[t.index]={...n,text:(n.text||"")+t.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[t.index]={...n,citations:[...n.citations??[],t.delta.citation]});break}case"input_json_delta":{if(n&&aA(n)){let i=n[iA]||"";i+=t.delta.partial_json;let a={...n};if(Object.defineProperty(a,iA,{value:i,enumerable:!1,writable:!0}),i)try{a.input=MR(i)}catch(s){let o=new Re(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${s}. JSON: ${i}`);L(this,xh,"f").call(this,o)}r.content[t.index]=a}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,thinking:n.thinking+t.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,signature:t.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[t.index]={...n,content:(n.content||"")+t.delta.content});break}default:t.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let t=[],r=[],n=!1;return this.on("streamEvent",i=>{let a=r.shift();a?a.resolve(i):t.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let a of r)a.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let a of r)a.reject(i);r.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((i,a)=>r.push({resolve:i,reject:a})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ys(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},rg=class extends Error{constructor(t){let r=typeof t=="string"?t:t.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=t}},OJ=1e5,NJ=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
141
+ 1. Task Overview
142
+ The user's core request and success criteria
143
+ Any clarifications or constraints they specified
144
+ 2. Current State
145
+ What has been completed so far
146
+ Files created, modified, or analyzed (with paths if relevant)
147
+ Key outputs or artifacts produced
148
+ 3. Important Discoveries
149
+ Technical constraints or requirements uncovered
150
+ Decisions made and their rationale
151
+ Errors encountered and how they were resolved
152
+ What approaches were tried that didn't work (and why)
153
+ 4. Next Steps
154
+ Specific actions needed to complete the task
155
+ Any blockers or open questions to resolve
156
+ Priority order if multiple steps remain
157
+ 5. Context to Preserve
158
+ User preferences or style requirements
159
+ Domain-specific details that aren't obvious
160
+ Any promises made to the user
161
+ Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
162
+ Wrap your summary in <summary></summary> tags.`;ng=class{constructor(t,r,n){kd.add(this),this.client=t,bu.set(this,!1),Ws.set(this,!1),_r.set(this,void 0),Sd.set(this,void 0),Un.set(this,void 0),$a.set(this,void 0),ns.set(this,void 0),Id.set(this,0),fe(this,_r,{params:{...r,messages:structuredClone(r.messages)}},"f");let i=["BetaToolRunner",...CR(r.tools,r.messages)].join(", ");fe(this,Sd,{...n,headers:gt([{"x-stainless-helper":i},n?.headers])},"f"),fe(this,ns,oA(),"f")}async*[(bu=new WeakMap,Ws=new WeakMap,_r=new WeakMap,Sd=new WeakMap,Un=new WeakMap,$a=new WeakMap,ns=new WeakMap,Id=new WeakMap,kd=new WeakSet,sA=async function(){let t=L(this,_r,"f").params.compactionControl;if(!t||!t.enabled)return!1;let r=0;if(L(this,Un,"f")!==void 0)try{let u=await L(this,Un,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=t.contextTokenThreshold??OJ;if(r<n)return!1;let i=t.model??L(this,_r,"f").params.model,a=t.summaryPrompt??NJ,s=L(this,_r,"f").params.messages;if(s[s.length-1].role==="assistant"){let u=s[s.length-1];if(Array.isArray(u.content)){let l=u.content.filter(c=>c.type!=="tool_use");l.length===0?s.pop():u.content=l}}let o=await this.client.beta.messages.create({model:i,messages:[...s,{role:"user",content:[{type:"text",text:a}]}],max_tokens:L(this,_r,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(o.content[0]?.type!=="text")throw new Re("Expected text response for compaction");return L(this,_r,"f").params.messages=[{role:"user",content:o.content}],!0},Symbol.asyncIterator)](){var t;if(L(this,bu,"f"))throw new Re("Cannot iterate over a consumed stream");fe(this,bu,!0,"f"),fe(this,Ws,!0,"f"),fe(this,$a,void 0,"f");try{for(;;){let r;try{if(L(this,_r,"f").params.max_iterations&&L(this,Id,"f")>=L(this,_r,"f").params.max_iterations)break;fe(this,Ws,!1,"f"),fe(this,$a,void 0,"f"),fe(this,Id,(t=L(this,Id,"f"),t++,t),"f"),fe(this,Un,void 0,"f");let{max_iterations:n,compactionControl:i,...a}=L(this,_r,"f").params;if(a.stream?(r=this.client.beta.messages.stream({...a},L(this,Sd,"f")),fe(this,Un,r.finalMessage(),"f"),L(this,Un,"f").catch(()=>{}),yield r):(fe(this,Un,this.client.beta.messages.create({...a,stream:!1},L(this,Sd,"f")),"f"),yield L(this,Un,"f")),!await L(this,kd,"m",sA).call(this)){if(!L(this,Ws,"f")){let{role:o,content:u}=await L(this,Un,"f");L(this,_r,"f").params.messages.push({role:o,content:u})}let s=await L(this,kd,"m",hS).call(this,L(this,_r,"f").params.messages.at(-1));if(s)L(this,_r,"f").params.messages.push(s);else if(!L(this,Ws,"f"))break}}finally{r&&r.abort()}}if(!L(this,Un,"f"))throw new Re("ToolRunner concluded without a message from the server");L(this,ns,"f").resolve(await L(this,Un,"f"))}catch(r){throw fe(this,bu,!1,"f"),L(this,ns,"f").promise.catch(()=>{}),L(this,ns,"f").reject(r),fe(this,ns,oA(),"f"),r}}setMessagesParams(t){typeof t=="function"?L(this,_r,"f").params=t(L(this,_r,"f").params):L(this,_r,"f").params=t,fe(this,Ws,!0,"f"),fe(this,$a,void 0,"f")}async generateToolResponse(){let t=await L(this,Un,"f")??this.params.messages.at(-1);return t?L(this,kd,"m",hS).call(this,t):null}done(){return L(this,ns,"f").promise}async runUntilDone(){if(!L(this,bu,"f"))for await(let t of this);return this.done()}get params(){return L(this,_r,"f").params}pushMessages(...t){this.setMessagesParams(r=>({...r,messages:[...r.messages,...t]}))}then(t,r){return this.runUntilDone().then(t,r)}};hS=async function(e){return L(this,$a,"f")!==void 0?L(this,$a,"f"):(fe(this,$a,zJ(L(this,_r,"f").params,e),"f"),L(this,$a,"f"))};ig=class e{constructor(t,r){this.iterator=t,this.controller=r}async*decoder(){let t=new Js;for await(let r of this.iterator)for(let n of t.decode(r))yield JSON.parse(n);for(let r of t.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,r){if(!t.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Re("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Re("Attempted to iterate over a response with no body");return new e(GS(t.body),r)}},ag=class extends Fn{create(t,r){let{betas:n,...i}=t;return this._client.post("/v1/messages/batches?beta=true",{body:i,...r,headers:gt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/messages/batches/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(t={},r){let{betas:n,...i}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Qs,{query:i,...r,headers:gt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(t,r={},n){let{betas:i}=r??{};return this._client.delete(Tr`/v1/messages/batches/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(t,r={},n){let{betas:i}=r??{};return this._client.post(Tr`/v1/messages/batches/${t}/cancel?beta=true`,{...n,headers:gt([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(t,r={},n){let i=await this.retrieve(t);if(!i.results_url)throw new Re(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:a}=r??{};return this._client.get(i.results_url,{...n,headers:gt([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,o)=>ig.fromResponse(o.response,o.controller))}},uA={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},CJ=["claude-opus-4-6"],Xs=class extends Fn{constructor(){super(...arguments),this.batches=new ag(this._client)}create(t,r){let n=lA(t),{betas:i,...a}=n;a.model in uA&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${uA[a.model]}
163
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),a.model in CJ&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=this._client._options.timeout;if(!a.stream&&s==null){let u=RR[a.model]??void 0;s=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}let o=jR(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:s??6e5,...r,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},o,r?.headers]),stream:n.stream??!1})}parse(t,r){return r={...r,headers:gt([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(t,r).then(n=>UR(n,t,{logger:this._client.logger??console}))}stream(t,r){return mS.createMessage(this,t,r)}countTokens(t,r){let n=lA(t),{betas:i,...a}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...r,headers:gt([{"anthropic-beta":[...i??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(t,r){return new ng(this._client,t,r)}};Xs.Batches=ag;Xs.BetaToolRunner=ng;Xs.ToolError=rg;sg=class extends Fn{create(t,r={},n){let{betas:i,...a}=r??{};return this._client.post(Tr`/v1/skills/${t}/versions?beta=true`,HS({body:a,...n,headers:gt([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(t,r,n){let{skill_id:i,betas:a}=r;return this._client.get(Tr`/v1/skills/${i}/versions/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},n?.headers])})}list(t,r={},n){let{betas:i,...a}=r??{};return this._client.getAPIList(Tr`/v1/skills/${t}/versions?beta=true`,Xh,{query:a,...n,headers:gt([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(t,r,n){let{skill_id:i,betas:a}=r;return this._client.delete(Tr`/v1/skills/${i}/versions/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},n?.headers])})}},Ld=class extends Fn{constructor(){super(...arguments),this.versions=new sg(this._client)}create(t={},r){let{betas:n,...i}=t??{};return this._client.post("/v1/skills?beta=true",HS({body:i,...r,headers:gt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/skills/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},n?.headers])})}list(t={},r){let{betas:n,...i}=t??{};return this._client.getAPIList("/v1/skills?beta=true",Xh,{query:i,...r,headers:gt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(t,r={},n){let{betas:i}=r??{};return this._client.delete(Tr`/v1/skills/${t}?beta=true`,{...n,headers:gt([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},n?.headers])})}};Ld.Versions=sg;us=class extends Fn{constructor(){super(...arguments),this.models=new tg(this._client),this.messages=new Xs(this._client),this.files=new eg(this._client),this.skills=new Ld(this._client)}};us.Models=tg;us.Messages=Xs;us.Files=eg;us.Skills=Ld;og=class extends Fn{create(t,r){let{betas:n,...i}=t;return this._client.post("/v1/complete",{body:i,timeout:this._client._options.timeout??6e5,...r,headers:gt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:t.stream??!1})}};pA="__json_buf";gS=class e{constructor(t,r){Xn.add(this),this.messages=[],this.receivedMessages=[],is.set(this,void 0),wu.set(this,null),this.controller=new AbortController,$d.set(this,void 0),kh.set(this,()=>{}),Ed.set(this,()=>{}),Pd.set(this,void 0),Sh.set(this,()=>{}),Td.set(this,()=>{}),Sa.set(this,{}),Od.set(this,!1),Ih.set(this,!1),$h.set(this,!1),Bs.set(this,!1),Eh.set(this,void 0),Ph.set(this,void 0),Nd.set(this,void 0),Qk.set(this,n=>{if(fe(this,Ih,!0,"f"),Md(n)&&(n=new qn),n instanceof qn)return fe(this,$h,!0,"f"),this._emit("abort",n);if(n instanceof Re)return this._emit("error",n);if(n instanceof Error){let i=new Re(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new Re(String(n)))}),fe(this,$d,new Promise((n,i)=>{fe(this,kh,n,"f"),fe(this,Ed,i,"f")}),"f"),fe(this,Pd,new Promise((n,i)=>{fe(this,Sh,n,"f"),fe(this,Td,i,"f")}),"f"),L(this,$d,"f").catch(()=>{}),L(this,Pd,"f").catch(()=>{}),fe(this,wu,t,"f"),fe(this,Nd,r?.logger??console,"f")}get response(){return L(this,Eh,"f")}get request_id(){return L(this,Ph,"f")}async withResponse(){fe(this,Bs,!0,"f");let t=await L(this,$d,"f");if(!t)throw Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){let r=new e(null);return r._run(()=>r._fromReadableStream(t)),r}static createMessage(t,r,n,{logger:i}={}){let a=new e(r,{logger:i});for(let s of r.messages)a._addMessageParam(s);return fe(a,wu,{...r,stream:!0},"f"),a._run(()=>a._createMessage(t,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},L(this,Qk,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,r=!0){this.receivedMessages.push(t),r&&this._emit("message",t)}async _createMessage(t,r,n){let i=n?.signal,a;i&&(i.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),i.addEventListener("abort",a));try{L(this,Xn,"m",Xk).call(this);let{response:s,data:o}=await t.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let u of o)L(this,Xn,"m",eS).call(this,u);if(o.controller.signal?.aborted)throw new qn;L(this,Xn,"m",tS).call(this)}finally{i&&a&&i.removeEventListener("abort",a)}}_connected(t){this.ended||(fe(this,Eh,t,"f"),fe(this,Ph,t?.headers.get("request-id"),"f"),L(this,kh,"f").call(this,t),this._emit("connect"))}get ended(){return L(this,Od,"f")}get errored(){return L(this,Ih,"f")}get aborted(){return L(this,$h,"f")}abort(){this.controller.abort()}on(t,r){return(L(this,Sa,"f")[t]||(L(this,Sa,"f")[t]=[])).push({listener:r}),this}off(t,r){let n=L(this,Sa,"f")[t];if(!n)return this;let i=n.findIndex(a=>a.listener===r);return i>=0&&n.splice(i,1),this}once(t,r){return(L(this,Sa,"f")[t]||(L(this,Sa,"f")[t]=[])).push({listener:r,once:!0}),this}emitted(t){return new Promise((r,n)=>{fe(this,Bs,!0,"f"),t!=="error"&&this.once("error",n),this.once(t,r)})}async done(){fe(this,Bs,!0,"f"),await L(this,Pd,"f")}get currentMessage(){return L(this,is,"f")}async finalMessage(){return await this.done(),L(this,Xn,"m",Yk).call(this)}async finalText(){return await this.done(),L(this,Xn,"m",dA).call(this)}_emit(t,...r){if(L(this,Od,"f"))return;t==="end"&&(fe(this,Od,!0,"f"),L(this,Sh,"f").call(this));let n=L(this,Sa,"f")[t];if(n&&(L(this,Sa,"f")[t]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),t==="abort"){let i=r[0];!L(this,Bs,"f")&&!n?.length&&Promise.reject(i),L(this,Ed,"f").call(this,i),L(this,Td,"f").call(this,i),this._emit("end");return}if(t==="error"){let i=r[0];!L(this,Bs,"f")&&!n?.length&&Promise.reject(i),L(this,Ed,"f").call(this,i),L(this,Td,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",L(this,Xn,"m",Yk).call(this))}async _fromReadableStream(t,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{L(this,Xn,"m",Xk).call(this),this._connected(null);let a=Ys.fromReadableStream(t,this.controller);for await(let s of a)L(this,Xn,"m",eS).call(this,s);if(a.controller.signal?.aborted)throw new qn;L(this,Xn,"m",tS).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(is=new WeakMap,wu=new WeakMap,$d=new WeakMap,kh=new WeakMap,Ed=new WeakMap,Pd=new WeakMap,Sh=new WeakMap,Td=new WeakMap,Sa=new WeakMap,Od=new WeakMap,Ih=new WeakMap,$h=new WeakMap,Bs=new WeakMap,Eh=new WeakMap,Ph=new WeakMap,Nd=new WeakMap,Qk=new WeakMap,Xn=new WeakSet,Yk=function(){if(this.receivedMessages.length===0)throw new Re("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},dA=function(){if(this.receivedMessages.length===0)throw new Re("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(t.length===0)throw new Re("stream ended without producing a content block with type=text");return t.join(" ")},Xk=function(){this.ended||fe(this,is,void 0,"f")},eS=function(t){if(this.ended)return;let r=L(this,Xn,"m",fA).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let n=r.content.at(-1);switch(t.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",t.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",t.delta.citation,n.citations??[]);break}case"input_json_delta":{mA(n)&&n.input&&this._emit("inputJson",t.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",t.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:t.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(cA(r,L(this,wu,"f"),{logger:L(this,Nd,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{fe(this,is,r,"f");break}case"content_block_start":case"message_delta":break}},tS=function(){if(this.ended)throw new Re("stream has ended, this shouldn't happen");let t=L(this,is,"f");if(!t)throw new Re("request ended without sending any chunks");return fe(this,is,void 0,"f"),cA(t,L(this,wu,"f"),{logger:L(this,Nd,"f")})},fA=function(t){let r=L(this,is,"f");if(t.type==="message_start"){if(r)throw new Re(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new Re(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":return r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null&&(r.usage.input_tokens=t.usage.input_tokens),t.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens),t.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens),t.usage.server_tool_use!=null&&(r.usage.server_tool_use=t.usage.server_tool_use),r;case"content_block_start":return r.content.push({...t.content_block}),r;case"content_block_delta":{let n=r.content.at(t.index);switch(t.delta.type){case"text_delta":{n?.type==="text"&&(r.content[t.index]={...n,text:(n.text||"")+t.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[t.index]={...n,citations:[...n.citations??[],t.delta.citation]});break}case"input_json_delta":{if(n&&mA(n)){let i=n[pA]||"";i+=t.delta.partial_json;let a={...n};Object.defineProperty(a,pA,{value:i,enumerable:!1,writable:!0}),i&&(a.input=MR(i)),r.content[t.index]=a}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,thinking:n.thinking+t.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[t.index]={...n,signature:t.delta.signature});break}default:t.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let t=[],r=[],n=!1;return this.on("streamEvent",i=>{let a=r.shift();a?a.resolve(i):t.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let a of r)a.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let a of r)a.reject(i);r.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((i,a)=>r.push({resolve:i,reject:a})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Ys(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},ug=class extends Fn{create(t,r){return this._client.post("/v1/messages/batches",{body:t,...r})}retrieve(t,r){return this._client.get(Tr`/v1/messages/batches/${t}`,r)}list(t={},r){return this._client.getAPIList("/v1/messages/batches",Qs,{query:t,...r})}delete(t,r){return this._client.delete(Tr`/v1/messages/batches/${t}`,r)}cancel(t,r){return this._client.post(Tr`/v1/messages/batches/${t}/cancel`,r)}async results(t,r){let n=await this.retrieve(t);if(!n.results_url)throw new Re(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:gt([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((i,a)=>ig.fromResponse(a.response,a.controller))}},Zd=class extends Fn{constructor(){super(...arguments),this.batches=new ug(this._client)}create(t,r){t.model in hA&&console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${hA[t.model]}
164
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),t.model in AJ&&t.thinking&&t.thinking.type==="enabled"&&console.warn(`Using Claude with ${t.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!t.stream&&n==null){let a=RR[t.model]??void 0;n=this._client.calculateNonstreamingTimeout(t.max_tokens,a)}let i=jR(t.tools,t.messages);return this._client.post("/v1/messages",{body:t,timeout:n??6e5,...r,headers:gt([i,r?.headers]),stream:t.stream??!1})}parse(t,r){return this.create(t,r).then(n=>ZR(n,t,{logger:this._client.logger??console}))}stream(t,r){return gS.createMessage(this,t,r,{logger:this._client.logger??console})}countTokens(t,r){return this._client.post("/v1/messages/count_tokens",{body:t,...r})}},hA={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},AJ=["claude-opus-4-6"];Zd.Batches=ug;lg=class extends Fn{retrieve(t,r={},n){let{betas:i}=r??{};return this._client.get(Tr`/v1/models/${t}`,{...n,headers:gt([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(t={},r){let{betas:n,...i}=t??{};return this._client.getAPIList("/v1/models",Qs,{query:i,...r,headers:gt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},Th=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()},RJ="\\n\\nHuman:",DJ="\\n\\nAssistant:",lr=class{constructor({baseURL:t=Th("ANTHROPIC_BASE_URL"),apiKey:r=Th("ANTHROPIC_API_KEY")??null,authToken:n=Th("ANTHROPIC_AUTH_TOKEN")??null,...i}={}){vS.add(this),Ah.set(this,void 0);let a={apiKey:r,authToken:n,...i,baseURL:t||"https://api.anthropic.com"};if(!a.dangerouslyAllowBrowser&&eJ())throw new Re(`It looks like you're running in a browser-like environment.
165
+
166
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
167
+ If you understand the risks and have appropriate mitigations in place,
168
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
169
+
170
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
171
+ `);this.baseURL=a.baseURL,this.timeout=a.timeout??JS.DEFAULT_TIMEOUT,this.logger=a.logger??console;let s="warn";this.logLevel=s,this.logLevel=Yj(a.logLevel,"ClientOptions.logLevel",this)??Yj(Th("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??s,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??aJ(),fe(this,Ah,oJ,"f"),this._options=a,this.apiKey=typeof r=="string"?r:null,this.authToken=n}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:r}){if(!(t.get("x-api-key")||t.get("authorization"))&&!(this.apiKey&&t.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(t){return gt([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey!=null)return gt([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return gt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return uJ(t)}getUserAgent(){return`${this.constructor.name}/JS ${ku}`}defaultIdempotencyKey(){return`stainless-node-retry-${kR()}`}makeStatusError(t,r,n,i){return ln.generate(t,r,n,i)}buildURL(t,r,n){let i=!L(this,vS,"m",qR).call(this)&&n||this.baseURL,a=J8(t)?new URL(t):new URL(i+(i.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),o=Object.fromEntries(a.searchParams);return(!Vj(s)||!Vj(o))&&(r={...o,...s,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(a.search=this.stringifyQuery(r)),a.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new Re("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(t){}async prepareRequest(t,{url:r,options:n}){}get(t,r){return this.methodRequest("get",t,r)}post(t,r){return this.methodRequest("post",t,r)}patch(t,r){return this.methodRequest("patch",t,r)}put(t,r){return this.methodRequest("put",t,r)}delete(t,r){return this.methodRequest("delete",t,r)}methodRequest(t,r,n){return this.request(Promise.resolve(n).then(i=>({method:t,path:r,...i})))}request(t,r=null){return new Yh(this,this.makeRequest(t,r,void 0))}async makeRequest(t,r,n){let i=await t,a=i.maxRetries??this.maxRetries;r==null&&(r=a),await this.prepareOptions(i);let{req:s,url:o,timeout:u}=await this.buildRequest(i,{retryCount:a-r});await this.prepareRequest(s,{url:o,options:i});let l="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),c=n===void 0?"":`, retryOf: ${n}`,d=Date.now();if(sn(this).debug(`[${l}] sending request`,Gs({retryOfRequestLogID:n,method:i.method,url:o,options:i,headers:s.headers})),i.signal?.aborted)throw new qn;let f=new AbortController,p=await this.fetchWithTimeout(o,s,u,f).catch(oS),h=Date.now();if(p instanceof globalThis.Error){let m=`retrying, ${r} attempts remaining`;if(i.signal?.aborted)throw new qn;let g=Md(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(r)return sn(this).info(`[${l}] connection ${g?"timed out":"failed"} - ${m}`),sn(this).debug(`[${l}] connection ${g?"timed out":"failed"} (${m})`,Gs({retryOfRequestLogID:n,url:o,durationMs:h-d,message:p.message})),this.retryRequest(i,r,n??l);throw sn(this).info(`[${l}] connection ${g?"timed out":"failed"} - error; no more retries left`),sn(this).debug(`[${l}] connection ${g?"timed out":"failed"} (error; no more retries left)`,Gs({retryOfRequestLogID:n,url:o,durationMs:h-d,message:p.message})),g?new Zh:new zu({cause:p})}let y=[...p.headers.entries()].filter(([m])=>m==="request-id").map(([m,g])=>", "+m+": "+JSON.stringify(g)).join(""),_=`[${l}${c}${y}] ${s.method} ${o} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${h-d}ms`;if(!p.ok){let m=await this.shouldRetry(p);if(r&&m){let x=`retrying, ${r} attempts remaining`;return await sJ(p.body),sn(this).info(`${_} - ${x}`),sn(this).debug(`[${l}] response error (${x})`,Gs({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),this.retryRequest(i,r,n??l,p.headers)}let g=m?"error; no more retries left":"error; not retryable";sn(this).info(`${_} - ${g}`);let v=await p.text().catch(x=>oS(x).message),b=SR(v),w=b?void 0:v;throw sn(this).debug(`[${l}] response error (${g})`,Gs({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,message:w,durationMs:Date.now()-d})),this.makeStatusError(p.status,b,w,p.headers)}return sn(this).info(_),sn(this).debug(`[${l}] response start`,Gs({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),{response:p,options:i,controller:f,requestLogID:l,retryOfRequestLogID:n,startTime:d}}getAPIList(t,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(i=>({method:"get",path:t,...i})):{method:"get",path:t,...n})}requestAPIList(t,r){let n=this.makeRequest(r,null,void 0);return new dS(this,n,t)}async fetchWithTimeout(t,r,n,i){let{signal:a,method:s,...o}=r||{},u=this._makeAbort(i);a&&a.addEventListener("abort",u,{once:!0});let l=setTimeout(u,n),c=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||typeof o.body=="object"&&o.body!==null&&Symbol.asyncIterator in o.body,d={signal:i.signal,...c?{duplex:"half"}:{},method:"GET",...o};s&&(d.method=s.toUpperCase());try{return await this.fetch.call(void 0,t,d)}finally{clearTimeout(l)}}async shouldRetry(t){let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,r,n,i){let a,s=i?.get("retry-after-ms");if(s){let u=parseFloat(s);Number.isNaN(u)||(a=u)}let o=i?.get("retry-after");if(o&&!a){let u=parseFloat(o);Number.isNaN(u)?a=Date.parse(o)-Date.now():a=u*1e3}if(a===void 0){let u=t.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(r,u)}return await X8(a),this.makeRequest(t,r-1,n)}calculateDefaultRetryTimeoutMillis(t,r){let n=r-t,i=Math.min(.5*Math.pow(2,n),8),a=1-Math.random()*.25;return i*a*1e3}calculateNonstreamingTimeout(t,r){if(36e5*t/128e3>6e5||r!=null&&t>r)throw new Re("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:r=0}={}){let n={...t},{method:i,path:a,query:s,defaultBaseURL:o}=n,u=this.buildURL(a,s,o);"timeout"in n&&Q8("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:c}=this.buildBody({options:n}),d=await this.buildHeaders({options:t,method:i,bodyHeaders:l,retryCount:r});return{req:{method:i,headers:d,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:t,method:r,bodyHeaders:n,retryCount:i}){let a={};this.idempotencyHeader&&r!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=t.idempotencyKey);let s=gt([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...iJ(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,n,t.headers]);return this.validateHeaders(s),s.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:r}}){if(!t)return{bodyHeaders:void 0,body:void 0};let n=gt([r]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&n.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:$R(t)}:typeof t=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:L(this,Ah,"f").call(this,{body:t,headers:n})}};JS=lr,Ah=new WeakMap,vS=new WeakSet,qR=function(){return this.baseURL!=="https://api.anthropic.com"};lr.Anthropic=JS;lr.HUMAN_PROMPT=RJ;lr.AI_PROMPT=DJ;lr.DEFAULT_TIMEOUT=6e5;lr.AnthropicError=Re;lr.APIError=ln;lr.APIConnectionError=zu;lr.APIConnectionTimeoutError=Zh;lr.APIUserAbortError=qn;lr.NotFoundError=Wh;lr.ConflictError=Bh;lr.RateLimitError=Kh;lr.BadRequestError=qh;lr.AuthenticationError=Fh;lr.InternalServerError=Hh;lr.PermissionDeniedError=Vh;lr.UnprocessableEntityError=Gh;lr.toFile=wJ;Cu=class extends lr{constructor(){super(...arguments),this.completions=new og(this),this.messages=new Zd(this),this.models=new lg(this),this.beta=new us(this)}};Cu.Completions=og;Cu.Messages=Zd;Cu.Models=lg;Cu.Beta=us;xu=null;FJ={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};WJ=VJ();BJ=FS(),WIe=BJ.subscribe,GJ=FS(),BIe=GJ.subscribe,KJ=FS(),GIe=KJ.subscribe;_A=new Set;tY=fs(e=>{if(!e||e.trim()==="")return null;let t=e.split(",").map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.some(a=>a.startsWith("!")),n=t.some(a=>!a.startsWith("!"));if(r&&n)return null;let i=t.map(a=>a.replace(/^!/,"").toLowerCase());return{include:r?[]:i,exclude:r?i:[],isExclusive:r}});pY={cwd(){return process.cwd()},existsSync(e){let t=[];try{let i=sr(t,ur`fs.existsSync(${e})`,0);return Fe.existsSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},async stat(e){return dY(e)},async readdir(e){return oY(e,{withFileTypes:!0})},async unlink(e){return fY(e)},async rmdir(e){return lY(e)},async rm(e,t){return cY(e,t)},async mkdir(e,t){try{await aY(e,{recursive:!0,...t})}catch(r){if(Ou(r)!=="EEXIST")throw r}},async readFile(e,t){return bA(e,{encoding:t.encoding})},async rename(e,t){return uY(e,t)},statSync(e){let t=[];try{let i=sr(t,ur`fs.statSync(${e})`,0);return Fe.statSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},lstatSync(e){let t=[];try{let i=sr(t,ur`fs.lstatSync(${e})`,0);return Fe.lstatSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},readFileSync(e,t){let r=[];try{let a=sr(r,ur`fs.readFileSync(${e})`,0);return Fe.readFileSync(e,{encoding:t.encoding})}catch(a){var n=a,i=1}finally{or(r,n,i)}},readFileBytesSync(e){let t=[];try{let i=sr(t,ur`fs.readFileBytesSync(${e})`,0);return Fe.readFileSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},readSync(e,t){let r=[];try{let a=sr(r,ur`fs.readSync(${e}, ${t.length} bytes)`,0),s;try{s=Fe.openSync(e,"r");let o=Buffer.alloc(t.length),u=Fe.readSync(s,o,0,t.length,0);return{buffer:o,bytesRead:u}}finally{s&&Fe.closeSync(s)}}catch(a){var n=a,i=1}finally{or(r,n,i)}},appendFileSync(e,t,r){let n=[];try{let s=sr(n,ur`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(r?.mode!==void 0)try{let o=Fe.openSync(e,"ax",r.mode);try{Fe.appendFileSync(o,t)}finally{Fe.closeSync(o)}return}catch(o){if(Ou(o)!=="EEXIST")throw o}Fe.appendFileSync(e,t)}catch(s){var i=s,a=1}finally{or(n,i,a)}},copyFileSync(e,t){let r=[];try{let a=sr(r,ur`fs.copyFileSync(${e} → ${t})`,0);Fe.copyFileSync(e,t)}catch(a){var n=a,i=1}finally{or(r,n,i)}},unlinkSync(e){let t=[];try{let i=sr(t,ur`fs.unlinkSync(${e})`,0);Fe.unlinkSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},renameSync(e,t){let r=[];try{let a=sr(r,ur`fs.renameSync(${e} → ${t})`,0);Fe.renameSync(e,t)}catch(a){var n=a,i=1}finally{or(r,n,i)}},linkSync(e,t){let r=[];try{let a=sr(r,ur`fs.linkSync(${e} → ${t})`,0);Fe.linkSync(e,t)}catch(a){var n=a,i=1}finally{or(r,n,i)}},symlinkSync(e,t,r){let n=[];try{let s=sr(n,ur`fs.symlinkSync(${e} → ${t})`,0);Fe.symlinkSync(e,t,r)}catch(s){var i=s,a=1}finally{or(n,i,a)}},readlinkSync(e){let t=[];try{let i=sr(t,ur`fs.readlinkSync(${e})`,0);return Fe.readlinkSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},realpathSync(e){let t=[];try{let i=sr(t,ur`fs.realpathSync(${e})`,0);return Fe.realpathSync(e).normalize("NFC")}catch(i){var r=i,n=1}finally{or(t,r,n)}},mkdirSync(e,t){let r=[];try{let a=sr(r,ur`fs.mkdirSync(${e})`,0),s={recursive:!0};t?.mode!==void 0&&(s.mode=t.mode);try{Fe.mkdirSync(e,s)}catch(o){if(Ou(o)!=="EEXIST")throw o}}catch(a){var n=a,i=1}finally{or(r,n,i)}},readdirSync(e){let t=[];try{let i=sr(t,ur`fs.readdirSync(${e})`,0);return Fe.readdirSync(e,{withFileTypes:!0})}catch(i){var r=i,n=1}finally{or(t,r,n)}},readdirStringSync(e){let t=[];try{let i=sr(t,ur`fs.readdirStringSync(${e})`,0);return Fe.readdirSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},isDirEmptySync(e){let t=[];try{let i=sr(t,ur`fs.isDirEmptySync(${e})`,0);return this.readdirSync(e).length===0}catch(i){var r=i,n=1}finally{or(t,r,n)}},rmdirSync(e){let t=[];try{let i=sr(t,ur`fs.rmdirSync(${e})`,0);Fe.rmdirSync(e)}catch(i){var r=i,n=1}finally{or(t,r,n)}},rmSync(e,t){let r=[];try{let a=sr(r,ur`fs.rmSync(${e})`,0);Fe.rmSync(e,t)}catch(a){var n=a,i=1}finally{or(r,n,i)}},createWriteStream(e){return Fe.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return bA(e);let r=await sY(e,"r");try{let{size:n}=await r.stat(),i=Math.min(n,t),a=Buffer.allocUnsafe(i),s=0;for(;s<i;){let{bytesRead:o}=await r.read(a,s,i-s,s);if(o===0)break;s+=o}return s<i?a.subarray(0,s):a}finally{await r.close()}}},mY=pY;_S={verbose:0,debug:1,info:2,warn:3,error:4},vY=fs(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return e&&Object.hasOwn(_S,e)?e:"debug"}),yY=!1;bS=fs(()=>{let e=Rg();return yY||Pu(process.env.DEBUG)||Pu(process.env.DEBUG_SDK)||e.includes("--debug")||e.includes("-d")||GR()||e.some(t=>t.startsWith("--debug="))||KR()!==null}),_Y=fs(()=>{let e=Rg().find(r=>r.startsWith("--debug="));if(!e)return null;let t=e.substring(8);return tY(t)}),GR=fs(()=>{let e=Rg();return e.includes("--debug-to-stderr")||e.includes("-d2e")}),KR=fs(()=>{let e=Rg();for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("--debug-file="))return r.substring(13);if(r==="--debug-file"&&t+1<e.length)return e[t+1]}return null});wY=!1,Oh=null,nS=Promise.resolve(),wS=null;YR=fs(async()=>{try{let e=JR(),t=BR(e),r=XS(t,"latest");await YJ(r).catch(()=>{}),await JJ(e,r)}catch{}}),YIe=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})(),IY={[Symbol.dispose](){}};ur=$Y;eI=(e,t)=>{let r=[];try{let a=sr(r,ur`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(a){var n=a,i=1}finally{or(r,n,i)}};TY=2e3,cg=new Set,wA=!1;xS=class{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(t){this.options=t,this.abortController=t.abortController||gR(),t.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(YS(r)),r}let t=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of t)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(t){this.spawnReject&&(this.spawnReject(t),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(t){this.options.env?Object.assign(this.options.env,t):this.options.env={...t}}updateResume(t){this.options.resume=t}getDefaultExecutable(){return yR()?"bun":"node"}spawnLocalProcess(t){let{command:r,args:n,cwd:i,env:a,signal:s}=t,o=Pu(a.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=oH(r,n,{cwd:i,stdio:["pipe","pipe",o],signal:s,env:a,windowsHide:!0});return(Pu(a.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",l=>{let c=l.toString();Xi(c),this.options.stderr&&this.options.stderr(c)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:t=[],agent:r,betas:n,cwd:i,executable:a=this.getDefaultExecutable(),executableArgs:s=[],extraArgs:o={},pathToClaudeCodeExecutable:u,env:l={...process.env},thinkingConfig:c,maxTurns:d,maxBudgetUsd:f,taskBudget:p,model:h,fallbackModel:y,jsonSchema:_,permissionMode:m,allowDangerouslySkipPermissions:g,permissionPromptToolName:v,continueConversation:b,resume:w,settingSources:x,allowedTools:k=[],disallowedTools:$=[],tools:T,mcpServers:j,strictMcpConfig:P,canUseTool:U,includePartialMessages:B,plugins:C,sandbox:ne}=this.options,H=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(c){switch(c.type){case"enabled":c.budgetTokens===void 0?H.push("--thinking","adaptive"):H.push("--max-thinking-tokens",c.budgetTokens.toString());break;case"disabled":H.push("--thinking","disabled");break;case"adaptive":H.push("--thinking","adaptive");break}c.type!=="disabled"&&c.display&&H.push("--thinking-display",c.display)}if(this.options.effort&&H.push("--effort",this.options.effort),d&&H.push("--max-turns",d.toString()),f!==void 0&&H.push("--max-budget-usd",f.toString()),p&&H.push("--task-budget",p.total.toString()),h&&H.push("--model",h),r&&H.push("--agent",r),n&&n.length>0&&H.push("--betas",n.join(",")),_&&H.push("--json-schema",on(_)),this.options.debugFile?H.push("--debug-file",this.options.debugFile):this.options.debug&&H.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let A=ZJ();A&&H.push("--debug-file",A)}if(U){if(v)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");H.push("--permission-prompt-tool","stdio")}else v&&H.push("--permission-prompt-tool",v);if(b&&H.push("--continue"),w&&H.push("--resume",w),this.options.assistant&&H.push("--assistant"),this.options.channels&&this.options.channels.length>0&&H.push("--channels",...this.options.channels),k.length>0&&H.push("--allowedTools",k.join(",")),$.length>0&&H.push("--disallowedTools",$.join(",")),T!==void 0&&(Array.isArray(T)?T.length===0?H.push("--tools",""):H.push("--tools",T.join(",")):H.push("--tools","default")),j&&Object.keys(j).length>0&&H.push("--mcp-config",on({mcpServers:j})),x!==void 0&&H.push(`--setting-sources=${x.join(",")}`),P&&H.push("--strict-mcp-config"),m&&H.push("--permission-mode",m),g&&H.push("--allow-dangerously-skip-permissions"),y){if(h&&y===h)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");H.push("--fallback-model",y)}this.options.includeHookEvents&&H.push("--include-hook-events"),B&&H.push("--include-partial-messages"),this.options.sessionMirror&&H.push("--session-mirror");for(let A of t)H.push("--add-dir",A);if(C&&C.length>0)for(let A of C)if(A.type==="local")H.push("--plugin-dir",A.path);else throw Error(`Unsupported plugin type: ${A.type}`);this.options.forkSession&&H.push("--fork-session"),this.options.resumeSessionAt&&H.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&H.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&H.push("--no-session-persistence"),this.options.managedSettings&&H.push("--managed-settings",this.options.managedSettings);let Ze={...o??{}};this.options.settings&&(Ze.settings=this.options.settings);let zt=PY(Ze,ne);for(let[A,I]of Object.entries(zt))I===null?H.push(`--${A}`):H.push(`--${A}`,I);l.CLAUDE_CODE_ENTRYPOINT||(l.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete l.NODE_OPTIONS,Pu(l.DEBUG_CLAUDE_AGENT_SDK)?l.DEBUG="1":delete l.DEBUG;let ge=zY(u),Y=ge?u:a,O=ge?[...s,...H]:[...s,u,...H],K={command:Y,args:O,cwd:i,env:l,signal:this.abortController.signal};this.options.spawnClaudeCodeProcess?(Xi(`Spawning Claude Code (custom): ${Y} ${O.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(K)):(Xi(`Spawning Claude Code: ${Y} ${O.join(" ")}`),this.process=this.spawnLocalProcess(K)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,NY(this.process),this.abortHandler=()=>{this.process&&!this.process.killed&&this.process.kill("SIGTERM")},this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",A=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new ss("Claude Code process aborted by user");else if(QS(A)){let I=ge?`Claude Code native binary not found at ${u}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${u}. Is options.pathToClaudeCodeExecutable set?`;this.exitError=ReferenceError(I),Xi(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${A.message}`),Xi(this.exitError.message)}),this.process.on("exit",(A,I)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new ss("Claude Code process aborted by user");else{let E=this.getProcessExitError(A,I);E&&(this.exitError=E,Xi(E.message))}}),this.ready=!0}catch(t){throw this.ready=!1,t}}getProcessExitError(t,r){if(t!==0&&t!==null)return Error(`Claude Code process exited with code ${t}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(t){if(this.abortController.signal.aborted)throw new ss("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(t);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){Xi("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);Xi(`[ProcessTransport] Writing to stdin: ${t.substring(0,100)}`);try{this.processStdin.write(t)||Xi("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${Rh(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:r}of this.exitListeners)this.process?.off("exit",r);this.exitListeners=[];let t=this.process;t&&!t.killed&&t.exitCode===null?(setTimeout(r=>{r.killed||r.exitCode!==null||(r.kill("SIGTERM"),setTimeout(n=>{n.exitCode===null&&n.kill("SIGKILL")},5e3,r).unref())},TY,t).unref(),t.once("exit",()=>cg.delete(t))):t&&cg.delete(t),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let t=uH({input:this.processStdout}),r=this.process?(()=>{let n=this.process,i=()=>t.close();return n.on("error",i),()=>n.off("error",i)})():void 0;this.exitError&&t.close();try{for await(let n of t)if(n.trim()){let i;try{i=eI(n)}catch{Xi(`Non-JSON stdout: ${n}`);continue}yield i}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),t.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(t){if(!this.process)return()=>{};let r=(n,i)=>{let a=this.getProcessExitError(n,i);t(a)};return this.process.on("exit",r),this.exitListeners.push({callback:t,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(i=>i.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((t,r)=>{let n=(a,s)=>{if(this.abortController.signal.aborted){r(new ss("Operation aborted"));return}let o=this.getProcessExitError(a,s);o?r(o):t()};this.process.once("exit",n);let i=a=>{this.process.off("exit",n),r(a)};this.process.once("error",i),this.process.once("exit",()=>{this.process.off("error",i)})})}};kS=class{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(t){this.returned=t}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((t,r)=>{this.readResolve=t,this.readReject=r})}enqueue(t){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:t})}else this.queue.push(t)}done(){if(this.isDone=!0,this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!0,value:void 0})}}error(t){if(this.hasError=t,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(t)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}},SS=class{sendMcpMessage;isClosed=!1;constructor(t){this.sendMcpMessage=t}onclose;onerror;onmessage;async start(){}async send(t){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(t)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},IS=class{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new kS;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(t){this.isSingleUserTurn=t}setTranscriptMirrorBatcher(t){this.transcriptMirrorBatcher=t}reportMirrorError(t,r){let n={type:"system",subtype:"mirror_error",error:r,key:t,uuid:yS(),session_id:t.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(t){this.cleanupPerformed?t():this.cleanupCallbacks.push(t)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0}constructor(t,r,n,i,a,s=new Map,o,u,l,c){this.transport=t,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=i,this.abortController=a,this.jsonSchema=o,this.initConfig=u,this.onElicitation=l,this.getOAuthToken=c;for(let[d,f]of s)this.connectSdkMcpServer(d,f);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(t){this.inputStream.error(t)}async stopTask(t){await this.request({subtype:"stop_task",task_id:t})}close(){this.cleanup()}cleanup(t){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(t),this.cleanupPromise)}async performCleanup(t){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=t??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),t?this.inputStream.error(t):this.inputStream.done()}catch{}}next(...[t]){return this.sdkMessages.next(t)}async return(t){return await this.cleanup(),this.sdkMessages.return(t)}async throw(t){return await this.cleanup(),this.sdkMessages.throw(t)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let t of this.transport.readMessages()){if(t.type==="control_response"){let r=this.pendingControlResponses.get(t.response.request_id);r&&r.handler(t.response);continue}else if(t.type==="control_request"){this.handleControlRequest(t);continue}else if(t.type==="control_cancel_request"){this.handleControlCancelRequest(t);continue}else{if(t.type==="keep_alive")continue;if(t.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(t.filePath,t.entries);continue}}if(t.type==="system"&&(t.subtype==="post_turn_summary"||t.subtype==="task_summary")){this.inputStream.enqueue(t);continue}t.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=t.is_error?t.subtype==="success"?t.result:t.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(Zr("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):t.type==="system"&&t.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(t)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(t){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(t instanceof ss)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Zr(`[Query.readMessages] Replacing exit error with result text. Original: ${Rh(t)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(t),this.cleanup(t)}}async handleControlRequest(t){let r=new AbortController;this.cancelControllers.set(t.request_id,r);try{let n=await this.processControlRequest(t,r.signal);if(this.cleanupPerformed)return;let i={type:"control_response",response:{subtype:"success",request_id:t.request_id,response:n}};await Promise.resolve(this.transport.write(on(i)+`
172
+ `))}catch(n){if(this.cleanupPerformed)return;let i={type:"control_response",response:{subtype:"error",request_id:t.request_id,error:Rh(n)}};try{await Promise.resolve(this.transport.write(on(i)+`
173
+ `))}catch(a){Zr(`[Query.handleControlRequest] Error-response write failed: ${Rh(a)}`,{level:"error"})}}finally{this.cancelControllers.delete(t.request_id)}}handleControlCancelRequest(t){let r=this.cancelControllers.get(t.request_id);r&&(r.abort(),this.cancelControllers.delete(t.request_id))}async processControlRequest(t,r){if(t.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(t.request.tool_name,t.request.input,{signal:r,suggestions:t.request.permission_suggestions,blockedPath:t.request.blocked_path,decisionReason:t.request.decision_reason,title:t.request.title,displayName:t.request.display_name,description:t.request.description,toolUseID:t.request.tool_use_id,agentID:t.request.agent_id}),toolUseID:t.request.tool_use_id}}else{if(t.request.subtype==="hook_callback")return await this.handleHookCallbacks(t.request.callback_id,t.request.input,t.request.tool_use_id,r);if(t.request.subtype==="mcp_message"){let n=t.request,i=this.sdkMcpTransports.get(n.server_name);if(!i)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,i)}:(i.onmessage&&i.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(t.request.subtype==="elicitation"){let n=t.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(t.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+t.request.subtype)}async*readSdkMessages(){try{for await(let t of this.inputStream)yield t}finally{await this.cleanup()}}async initialize(){let t;if(this.hooks){t={};for(let[i,a]of Object.entries(this.hooks))a.length>0&&(t[i]=a.map(s=>{let o=[];for(let u of s.hooks){let l=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(l,u),o.push(l)}return{matcher:s.matcher,hookCallbackIds:o,timeout:s.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:t,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(t){await this.request({subtype:"set_permission_mode",mode:t})}async setModel(t){await this.request({subtype:"set_model",model:t})}async setMaxThinkingTokens(t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:t})}async applyFlagSettings(t){await this.request({subtype:"apply_flag_settings",settings:t})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(t,r){return(await this.request({subtype:"rewind_files",user_message_id:t,dry_run:r?.dryRun})).response}async cancelAsyncMessage(t){return(await this.request({subtype:"cancel_async_message",message_uuid:t})).response.cancelled}async seedReadState(t,r){await this.request({subtype:"seed_read_state",path:t,mtime:r})}async enableRemoteControl(t,r){return(await this.request({subtype:"remote_control",enabled:t,...r!==void 0&&{name:r}})).response}async generateSessionTitle(t,r){return(await this.request({subtype:"generate_session_title",description:t,persist:r?.persist})).response.title}async askSideQuestion(t){let r=(await this.request({subtype:"side_question",question:t})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}}async launchUltrareview(t,r){return(await this.request({subtype:"ultrareview_launch",args:t,confirm:r?.confirm??!1})).response}async messageRated(t){await this.request({subtype:"message_rated",messageUuid:t.messageUuid,sentiment:t.sentiment,surface:t.surface,cleared:t.cleared??!1})}processPendingPermissionRequests(t){for(let r of t)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(t){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:t};return new Promise((i,a)=>{this.pendingControlResponses.set(r,{handler:s=>{this.pendingControlResponses.delete(r),s.subtype==="success"?i(s):(a(Error(s.error)),s.pending_permission_requests&&this.processPendingPermissionRequests(s.pending_permission_requests))},reject:a}),Promise.resolve(this.transport.write(on(n)+`
174
+ `)).catch(s=>{this.pendingControlResponses.delete(r),a(s)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(t){await this.request({subtype:"mcp_reconnect",serverName:t})}async toggleMcpServer(t,r){await this.request({subtype:"mcp_toggle",serverName:t,enabled:r})}async enableChannel(t){await this.request({subtype:"channel_enable",serverName:t})}async mcpAuthenticate(t){return(await this.request({subtype:"mcp_authenticate",serverName:t})).response}async mcpClearAuth(t){return(await this.request({subtype:"mcp_clear_auth",serverName:t})).response}async mcpSubmitOAuthCallbackUrl(t,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:t,callbackUrl:r})).response}async claudeAuthenticate(t){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:t})).response}async claudeOAuthCallback(t,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:t,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(t,r){try{return(await this.request({subtype:"read_file",path:t,max_bytes:r?.maxBytes})).response}catch{return null}}async reloadPlugins(){return(await this.request({subtype:"reload_plugins"})).response}async setMcpServers(t){let r={},n={};for(let[o,u]of Object.entries(t))u.type==="sdk"&&"instance"in u?r[o]=u.instance:n[o]=u;let i=new Set(this.sdkMcpServerInstances.keys()),a=new Set(Object.keys(r));for(let o of i)a.has(o)||await this.disconnectSdkMcpServer(o);for(let[o,u]of Object.entries(r))i.has(o)||this.connectSdkMcpServer(o,u);let s={};for(let o of Object.keys(r))s[o]={type:"sdk",name:o};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...s}})).response}async accountInfo(){return(await this.initialization).account}async streamInput(t){Zr("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of t){if(r++,Zr(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(on(n)+`
175
+ `))}Zr(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Zr("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Zr("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof ss))throw r}}waitForFirstResult(){return this.firstResultReceived?(Zr("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(t=>{if(this.abortController?.signal.aborted){t();return}this.abortController?.signal.addEventListener("abort",()=>t(),{once:!0}),this.firstResultReceivedResolve=t})}handleHookCallbacks(t,r,n,i){let a=this.hookCallbacks.get(t);if(!a)throw Error(`No hook callback found for ID: ${t}`);return a(r,n,{signal:i})}connectSdkMcpServer(t,r){let n=new SS(i=>this.sendMcpServerMessageToCli(t,i));this.sdkMcpTransports.set(t,n),this.sdkMcpServerInstances.set(t,r),r.connect(n).catch(i=>{this.sdkMcpTransports.get(t)===n&&this.sdkMcpTransports.delete(t),this.sdkMcpServerInstances.get(t)===r&&this.sdkMcpServerInstances.delete(t),Zr(`[Query.connectSdkMcpServer] Failed to connect MCP server '${t}': ${i}`,{level:"error"})})}async disconnectSdkMcpServer(t){let r=this.sdkMcpTransports.get(t);r&&(await r.close(),this.sdkMcpTransports.delete(t)),this.sdkMcpServerInstances.delete(t)}sendMcpServerMessageToCli(t,r){if("id"in r&&r.id!==null&&r.id!==void 0){let i=`${t}:${r.id}`,a=this.pendingMcpResponses.get(i);if(a){a.resolve(r),this.pendingMcpResponses.delete(i);return}}let n={type:"control_request",request_id:yS(),request:{subtype:"mcp_message",server_name:t,message:r}};Promise.resolve(this.transport.write(on(n)+`
176
+ `)).catch(i=>{Zr(`[Query.sendMcpServerMessageToCli] Transport write failed: ${i}`,{level:"error"})})}handleMcpControlRequest(t,r,n){let i="id"in r.message?r.message.id:null,a=`${t}:${i}`;return new Promise((s,o)=>{let u=()=>{this.pendingMcpResponses.delete(a)},l=d=>{u(),s(d)},c=d=>{u(),o(d)};if(this.pendingMcpResponses.set(a,{resolve:l,reject:c}),n.onmessage)n.onmessage(r.message);else{u(),o(Error("No message handler registered"));return}})}},jY=500,AY=1048576,RY=[200,800],$S=class{send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(t,r=6e4,n,i=jY,a=AY,s=RY){this.send=t,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=i,this.maxPendingBytes=a,this.backoffMs=s}enqueue(t,r){let n=on(r).length;this.pending.push({filePath:t,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let t=this.drain();this.flushPromise=t,await t,this.flushPromise===t&&(this.flushPromise=null)}async drain(){let t=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,t&&await t,r.length!==0&&await this.doFlush(r)}async doFlush(t){let r=new Map;for(let i of t){let a=r.get(i.filePath);a?a.push(...i.entries):r.set(i.filePath,i.entries.slice())}let n=this.backoffMs.length+1;for(let[i,a]of r){let s=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${i}`,o,u=1;for(;u<=n;u++)try{await Rd(this.send(i,a),this.sendTimeoutMs,s),o=void 0;break}catch(l){if(o=YS(l),o.message===s)break;let c=this.backoffMs[u-1];if(c===void 0)break;await vR(c)}if(o){Zr(`[TranscriptMirrorBatcher] flush failed for ${i} after ${u} attempt(s): ${o}`,{level:"error"});try{this.onError?.(i,o)}catch(l){Zr(`[TranscriptMirrorBatcher] onError callback threw: ${l}`,{level:"error"})}}}}},QIe=Eg(aR(),1),xA=Eg(aR(),1),m$e=MY(UY);ZY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;IA=200;h$e=Buffer.from('{"type":"attribution-snapshot"'),g$e=Buffer.from('{"type":"system"'),WY=10,v$e=Buffer.from([WY]);JY="user:inference",QR="user:profile",YY="org:create_api_key",QY=[YY,QR],XY=[QR,JY,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],G$e=KY([...QY,...XY]),$A={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},e7=void 0;r7=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];i7="-credentials";(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw Error()}e.assertNever=r,e.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(let s of i)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(It||(It={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(EA||(EA={}));me=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),as=e=>{switch(typeof e){case"undefined":return me.undefined;case"string":return me.string;case"number":return Number.isNaN(e)?me.nan:me.number;case"boolean":return me.boolean;case"function":return me.function;case"bigint":return me.bigint;case"symbol":return me.symbol;case"object":return Array.isArray(e)?me.array:e===null?me.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?me.promise:typeof Map<"u"&&e instanceof Map?me.map:typeof Set<"u"&&e instanceof Set?me.set:typeof Date<"u"&&e instanceof Date?me.date:me.object;default:return me.unknown}},ee=It.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"]),ti=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,u=0;for(;u<s.path.length;){let l=s.path[u];u!==s.path.length-1?o[l]=o[l]||{_errors:[]}:(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(s))),o=o[l],u++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,It.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};ti.create=e=>new ti(e);o7=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===me.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,It.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${It.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${It.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${It.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:It.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,It.assertNever(e)}return{message:r}},qd=o7,u7=qd;PS=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,a=[...r,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)o=l(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};cn=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return je;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let a=await i.key,s=await i.value;n.push({key:a,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return je;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:t.value,value:n}}},je=Object.freeze({status:"aborted"}),jd=e=>({status:"dirty",value:e}),bn=e=>({status:"valid",value:e}),PA=e=>e.status==="aborted",TA=e=>e.status==="dirty",ju=e=>e.status==="valid",dg=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(we||(we={}));ri=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},OA=(e,t)=>{if(ju(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ti(e.common.issues);return this._error=r,this._error}}};rt=class{get description(){return this._def.description}_getType(t){return as(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:as(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cn,ctx:{common:t.parent.common,data:t.data,parsedType:as(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(dg(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:as(t)},i=this._parseSync({data:t,path:n.path,parent:n});return OA(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:as(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return ju(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>ju(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:as(t)},i=this._parse({data:t,path:n.path,parent:n}),a=await(dg(i)?i:Promise.resolve(i));return OA(n,a)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let s=t(i),o=()=>a.addIssue({code:ee.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Ni({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Ti.create(this,this._def)}nullable(){return Ta.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ls.create(this)}promise(){return eo.create(this,this._def)}or(t){return Uu.create([this,t],this._def)}and(t){return Mu.create(this,t,this._def)}transform(t){return new Ni({...Be(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Vu({...Be(this._def),innerType:this,defaultValue:r,typeName:Ae.ZodDefault})}brand(){return new fg({typeName:Ae.ZodBranded,type:this,...Be(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Wu({...Be(this._def),innerType:this,catchValue:r,typeName:Ae.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return pg.create(this,t)}readonly(){return Bu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},l7=/^c[^\s-]{8,}$/i,c7=/^[0-9a-z]+$/,d7=/^[0-9A-HJKMNP-TV-Z]{26}$/i,f7=/^[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,p7=/^[a-z0-9_-]{21}$/i,m7=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,h7=/^[-+]?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)?)??$/,g7=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,v7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",y7=/^(?:(?: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])$/,_7=/^(?:(?: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])$/,b7=/^(([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]))$/,w7=/^(([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])$/,x7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,k7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,XR="((\\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])))",S7=new RegExp(`^${XR}$`);Au=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==me.string){let i=this._getOrReturnCtx(t);return le(i,{code:ee.invalid_type,expected:me.string,received:i.parsedType}),je}let r=new cn,n;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),le(n,{code:ee.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),le(n,{code:ee.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(n=this._getOrReturnCtx(t,n),a?le(n,{code:ee.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&le(n,{code:ee.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")g7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"email",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")iS||(iS=new RegExp(v7,"u")),iS.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"emoji",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")f7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"uuid",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")p7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"nanoid",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")l7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"cuid",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")c7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"cuid2",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")d7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"ulid",code:ee.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),le(n,{validation:"url",code:ee.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,!i.regex.test(t.data)&&(n=this._getOrReturnCtx(t,n),le(n,{validation:"regex",code:ee.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?$7(i).test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?S7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?I7(i).test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{code:ee.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?h7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"duration",code:ee.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?E7(t.data,i.version)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"ip",code:ee.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?P7(t.data,i.alg)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"jwt",code:ee.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?T7(t.data,i.version)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"cidr",code:ee.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?x7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"base64",code:ee.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?k7.test(t.data)||(n=this._getOrReturnCtx(t,n),le(n,{validation:"base64url",code:ee.invalid_string,message:i.message}),r.dirty()):It.assertNever(i);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:ee.invalid_string,...we.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...we.errToObj(t)})}url(t){return this._addCheck({kind:"url",...we.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...we.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...we.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...we.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...we.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...we.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...we.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...we.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...we.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...we.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...we.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...we.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...we.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...we.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...we.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...we.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...we.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...we.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...we.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...we.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...we.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...we.errToObj(r)})}nonempty(t){return this.min(1,we.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Au.create=e=>new Au({checks:[],typeName:Ae.ZodString,coerce:e?.coerce??!1,...Be(e)});Fd=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==me.number){let i=this._getOrReturnCtx(t);return le(i,{code:ee.invalid_type,expected:me.number,received:i.parsedType}),je}let r,n=new cn;for(let i of this._def.checks)i.kind==="int"?It.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),le(r,{code:ee.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?O7(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),le(r,{code:ee.not_finite,message:i.message}),n.dirty()):It.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,we.toString(r))}gt(t,r){return this.setLimit("min",t,!1,we.toString(r))}lte(t,r){return this.setLimit("max",t,!0,we.toString(r))}lt(t,r){return this.setLimit("max",t,!1,we.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:we.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:we.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:we.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:we.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:we.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:we.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:we.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:we.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:we.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:we.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&It.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Fd.create=e=>new Fd({checks:[],typeName:Ae.ZodNumber,coerce:e?.coerce||!1,...Be(e)});Vd=class e extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==me.bigint)return this._getInvalidInput(t);let r,n=new cn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),le(r,{code:ee.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):It.assertNever(i);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.bigint,received:r.parsedType}),je}gte(t,r){return this.setLimit("min",t,!0,we.toString(r))}gt(t,r){return this.setLimit("min",t,!1,we.toString(r))}lte(t,r){return this.setLimit("max",t,!0,we.toString(r))}lt(t,r){return this.setLimit("max",t,!1,we.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:we.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:we.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:we.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:we.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:we.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:we.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Vd.create=e=>new Vd({checks:[],typeName:Ae.ZodBigInt,coerce:e?.coerce??!1,...Be(e)});Wd=class extends rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==me.boolean){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.boolean,received:r.parsedType}),je}return bn(t.data)}};Wd.create=e=>new Wd({typeName:Ae.ZodBoolean,coerce:e?.coerce||!1,...Be(e)});Bd=class e extends rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==me.date){let i=this._getOrReturnCtx(t);return le(i,{code:ee.invalid_type,expected:me.date,received:i.parsedType}),je}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return le(i,{code:ee.invalid_date}),je}let r=new cn,n;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),le(n,{code:ee.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),le(n,{code:ee.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):It.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:we.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:we.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Bd.create=e=>new Bd({checks:[],coerce:e?.coerce||!1,typeName:Ae.ZodDate,...Be(e)});Gd=class extends rt{_parse(t){if(this._getType(t)!==me.symbol){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.symbol,received:r.parsedType}),je}return bn(t.data)}};Gd.create=e=>new Gd({typeName:Ae.ZodSymbol,...Be(e)});Ru=class extends rt{_parse(t){if(this._getType(t)!==me.undefined){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.undefined,received:r.parsedType}),je}return bn(t.data)}};Ru.create=e=>new Ru({typeName:Ae.ZodUndefined,...Be(e)});Du=class extends rt{_parse(t){if(this._getType(t)!==me.null){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.null,received:r.parsedType}),je}return bn(t.data)}};Du.create=e=>new Du({typeName:Ae.ZodNull,...Be(e)});Kd=class extends rt{constructor(){super(...arguments),this._any=!0}_parse(t){return bn(t.data)}};Kd.create=e=>new Kd({typeName:Ae.ZodAny,...Be(e)});os=class extends rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bn(t.data)}};os.create=e=>new os({typeName:Ae.ZodUnknown,...Be(e)});ea=class extends rt{_parse(t){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.never,received:r.parsedType}),je}};ea.create=e=>new ea({typeName:Ae.ZodNever,...Be(e)});Hd=class extends rt{_parse(t){if(this._getType(t)!==me.undefined){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.void,received:r.parsedType}),je}return bn(t.data)}};Hd.create=e=>new Hd({typeName:Ae.ZodVoid,...Be(e)});ls=class e extends rt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==me.array)return le(r,{code:ee.invalid_type,expected:me.array,received:r.parsedType}),je;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(le(r,{code:s?ee.too_big:ee.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(le(r,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(le(r,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new ri(r,s,r.path,o)))).then(s=>cn.mergeArray(n,s));let a=[...r.data].map((s,o)=>i.type._parseSync(new ri(r,s,r.path,o)));return cn.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:we.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:we.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:we.toString(r)}})}nonempty(t){return this.min(1,t)}};ls.create=(e,t)=>new ls({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Be(t)});Vn=class e extends rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=It.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==me.object){let u=this._getOrReturnCtx(t);return le(u,{code:ee.invalid_type,expected:me.object,received:u.parsedType}),je}let{status:r,ctx:n}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ea&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||s.push(u);let o=[];for(let u of a){let l=i[u],c=n.data[u];o.push({key:{status:"valid",value:u},value:l._parse(new ri(n,c,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ea){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)o.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(u==="strict")s.length>0&&(le(n,{code:ee.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let c=n.data[l];o.push({key:{status:"valid",value:l},value:u._parse(new ri(n,c,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of o){let c=await l.key,d=await l.value;u.push({key:c,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>cn.mergeObjectSync(r,u)):cn.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return we.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:we.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of It.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of It.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Iu(this)}partial(t){let r={};for(let n of It.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of It.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ti;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return t4(It.objectKeys(this.shape))}};Vn.create=(e,t)=>new Vn({shape:()=>e,unknownKeys:"strip",catchall:ea.create(),typeName:Ae.ZodObject,...Be(t)});Vn.strictCreate=(e,t)=>new Vn({shape:()=>e,unknownKeys:"strict",catchall:ea.create(),typeName:Ae.ZodObject,...Be(t)});Vn.lazycreate=(e,t)=>new Vn({shape:e,unknownKeys:"strip",catchall:ea.create(),typeName:Ae.ZodObject,...Be(t)});Uu=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new ti(o.ctx.common.issues));return le(r,{code:ee.invalid_union,unionErrors:s}),je}if(r.common.async)return Promise.all(n.map(async a=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(u=>new ti(u));return le(r,{code:ee.invalid_union,unionErrors:o}),je}}get options(){return this._def.options}};Uu.create=(e,t)=>new Uu({options:e,typeName:Ae.ZodUnion,...Be(t)});Ia=e=>e instanceof Lu?Ia(e.schema):e instanceof Ni?Ia(e.innerType()):e instanceof Zu?[e.value]:e instanceof qu?e.options:e instanceof Fu?It.objectValues(e.enum):e instanceof Vu?Ia(e._def.innerType):e instanceof Ru?[void 0]:e instanceof Du?[null]:e instanceof Ti?[void 0,...Ia(e.unwrap())]:e instanceof Ta?[null,...Ia(e.unwrap())]:e instanceof fg||e instanceof Bu?Ia(e.unwrap()):e instanceof Wu?Ia(e._def.innerType):[],TS=class e extends rt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.object)return le(r,{code:ee.invalid_type,expected:me.object,received:r.parsedType}),je;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(le(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),je)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let a of r){let s=Ia(a.shape[t]);if(!s.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of s){if(i.has(o))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);i.set(o,a)}}return new e({typeName:Ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Be(n)})}};Mu=class extends rt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(a,s)=>{if(PA(a)||PA(s))return je;let o=OS(a.value,s.value);return o.valid?((TA(a)||TA(s))&&r.dirty(),{status:r.value,value:o.data}):(le(n,{code:ee.invalid_intersection_types}),je)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Mu.create=(e,t,r)=>new Mu({left:e,right:t,typeName:Ae.ZodIntersection,...Be(r)});Pa=class e extends rt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.array)return le(n,{code:ee.invalid_type,expected:me.array,received:n.parsedType}),je;if(n.data.length<this._def.items.length)return le(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),je;!this._def.rest&&n.data.length>this._def.items.length&&(le(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let o=this._def.items[s]||this._def.rest;return o?o._parse(new ri(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>cn.mergeArray(r,a)):cn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Pa.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pa({items:e,typeName:Ae.ZodTuple,rest:null,...Be(t)})};NS=class e extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.object)return le(n,{code:ee.invalid_type,expected:me.object,received:n.parsedType}),je;let i=[],a=this._def.keyType,s=this._def.valueType;for(let o in n.data)i.push({key:a._parse(new ri(n,o,n.path,o)),value:s._parse(new ri(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?cn.mergeObjectAsync(r,i):cn.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof rt?new e({keyType:t,valueType:r,typeName:Ae.ZodRecord,...Be(n)}):new e({keyType:Au.create(),valueType:t,typeName:Ae.ZodRecord,...Be(r)})}},Jd=class extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.map)return le(n,{code:ee.invalid_type,expected:me.map,received:n.parsedType}),je;let i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,u],l)=>({key:i._parse(new ri(n,o,n.path,[l,"key"])),value:a._parse(new ri(n,u,n.path,[l,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return je;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(l.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let u of s){let{key:l,value:c}=u;if(l.status==="aborted"||c.status==="aborted")return je;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(l.value,c.value)}return{status:r.value,value:o}}}};Jd.create=(e,t,r)=>new Jd({valueType:t,keyType:e,typeName:Ae.ZodMap,...Be(r)});Yd=class e extends rt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.set)return le(n,{code:ee.invalid_type,expected:me.set,received:n.parsedType}),je;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(le(n,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(le(n,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return je;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let o=[...n.data.values()].map((u,l)=>a._parse(new ri(n,u,n.path,l)));return n.common.async?Promise.all(o).then(u=>s(u)):s(o)}min(t,r){return new e({...this._def,minSize:{value:t,message:we.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:we.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Yd.create=(e,t)=>new Yd({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Be(t)});zS=class e extends rt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.function)return le(r,{code:ee.invalid_type,expected:me.function,received:r.parsedType}),je;function n(o,u){return PS({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ES(),qd].filter(l=>!!l),issueData:{code:ee.invalid_arguments,argumentsError:u}})}function i(o,u){return PS({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ES(),qd].filter(l=>!!l),issueData:{code:ee.invalid_return_type,returnTypeError:u}})}let a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof eo){let o=this;return bn(async function(...u){let l=new ti([]),c=await o._def.args.parseAsync(u,a).catch(f=>{throw l.addIssue(n(u,f)),l}),d=await Reflect.apply(s,this,c);return await o._def.returns._def.type.parseAsync(d,a).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{let o=this;return bn(function(...u){let l=o._def.args.safeParse(u,a);if(!l.success)throw new ti([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),d=o._def.returns.safeParse(c,a);if(!d.success)throw new ti([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Pa.create(t).rest(os.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Pa.create([]).rest(os.create()),returns:r||os.create(),typeName:Ae.ZodFunction,...Be(n)})}},Lu=class extends rt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Lu.create=(e,t)=>new Lu({getter:e,typeName:Ae.ZodLazy,...Be(t)});Zu=class extends rt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return le(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),je}return{status:"valid",value:t.data}}get value(){return this._def.value}};Zu.create=(e,t)=>new Zu({value:e,typeName:Ae.ZodLiteral,...Be(t)});qu=class e extends rt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return le(r,{expected:It.joinValues(n),received:r.parsedType,code:ee.invalid_type}),je}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return le(r,{received:r.data,code:ee.invalid_enum_value,options:n}),je}return bn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};qu.create=t4;Fu=class extends rt{_parse(t){let r=It.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==me.string&&n.parsedType!==me.number){let i=It.objectValues(r);return le(n,{expected:It.joinValues(i),received:n.parsedType,code:ee.invalid_type}),je}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=It.objectValues(r);return le(n,{received:n.data,code:ee.invalid_enum_value,options:i}),je}return bn(t.data)}get enum(){return this._def.values}};Fu.create=(e,t)=>new Fu({values:e,typeName:Ae.ZodNativeEnum,...Be(t)});eo=class extends rt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.promise&&r.common.async===!1)return le(r,{code:ee.invalid_type,expected:me.promise,received:r.parsedType}),je;let n=r.parsedType===me.promise?r.data:Promise.resolve(r.data);return bn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};eo.create=(e,t)=>new eo({type:e,typeName:Ae.ZodPromise,...Be(t)});Ni=class extends rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:s=>{le(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async o=>{if(r.value==="aborted")return je;let u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?je:u.status==="dirty"||r.value==="dirty"?jd(u.value):u});{if(r.value==="aborted")return je;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?je:o.status==="dirty"||r.value==="dirty"?jd(o.value):o}}if(i.type==="refinement"){let s=o=>{let u=i.refinement(o,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?je:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?je:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ju(s))return je;let o=i.transform(s.value,a);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ju(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):je);It.assertNever(i)}};Ni.create=(e,t,r)=>new Ni({schema:e,typeName:Ae.ZodEffects,effect:t,...Be(r)});Ni.createWithPreprocess=(e,t,r)=>new Ni({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...Be(r)});Ti=class extends rt{_parse(t){return this._getType(t)===me.undefined?bn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ti.create=(e,t)=>new Ti({innerType:e,typeName:Ae.ZodOptional,...Be(t)});Ta=class extends rt{_parse(t){return this._getType(t)===me.null?bn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ta.create=(e,t)=>new Ta({innerType:e,typeName:Ae.ZodNullable,...Be(t)});Vu=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Vu.create=(e,t)=>new Vu({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Be(t)});Wu=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return dg(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Wu.create=(e,t)=>new Wu({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Be(t)});Qd=class extends rt{_parse(t){if(this._getType(t)!==me.nan){let r=this._getOrReturnCtx(t);return le(r,{code:ee.invalid_type,expected:me.nan,received:r.parsedType}),je}return{status:"valid",value:t.data}}};Qd.create=e=>new Qd({typeName:Ae.ZodNaN,...Be(e)});fg=class extends rt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},pg=class e extends rt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?je:i.status==="dirty"?(r.dirty(),jd(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?je:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ae.ZodPipeline})}},Bu=class extends rt{_parse(t){let r=this._def.innerType._parse(t),n=i=>(ju(i)&&(i.value=Object.freeze(i.value)),i);return dg(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Bu.create=(e,t)=>new Bu({innerType:e,typeName:Ae.ZodReadonly,...Be(t)});K$e={object:Vn.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));H$e=Au.create,J$e=Fd.create,Y$e=Qd.create,Q$e=Vd.create,X$e=Wd.create,eEe=Bd.create,tEe=Gd.create,rEe=Ru.create,nEe=Du.create,iEe=Kd.create,aEe=os.create,sEe=ea.create,oEe=Hd.create,uEe=ls.create,lEe=Vn.create,cEe=Vn.strictCreate,dEe=Uu.create,fEe=TS.create,pEe=Mu.create,mEe=Pa.create,hEe=NS.create,gEe=Jd.create,vEe=Yd.create,yEe=zS.create,_Ee=Lu.create,bEe=Zu.create,wEe=qu.create,xEe=Fu.create,kEe=eo.create,SEe=Ni.create,IEe=Ti.create,$Ee=Ta.create,EEe=Ni.createWithPreprocess,PEe=pg.create,r4={};no(r4,{version:()=>pD,util:()=>pt,treeifyError:()=>m4,toJSONSchema:()=>sM,toDotPath:()=>h4,safeParseAsync:()=>fI,safeParse:()=>cI,registry:()=>EI,regexes:()=>pI,prettifyError:()=>g4,parseAsync:()=>vg,parse:()=>gg,locales:()=>$I,isValidJWT:()=>DD,isValidBase64URL:()=>jD,isValidBase64:()=>vI,globalRegistry:()=>Ks,globalConfig:()=>mg,function:()=>aM,formatError:()=>sI,flattenError:()=>aI,config:()=>dn,clone:()=>ji,_xid:()=>MI,_void:()=>VU,_uuidv7:()=>zI,_uuidv6:()=>NI,_uuidv4:()=>OI,_uuid:()=>TI,_url:()=>CI,_uppercase:()=>QI,_unknown:()=>wg,_union:()=>NX,_undefined:()=>LU,_ulid:()=>UI,_uint64:()=>UU,_uint32:()=>zU,_tuple:()=>XU,_trim:()=>i$,_transform:()=>LX,_toUpperCase:()=>s$,_toLowerCase:()=>a$,_templateLiteral:()=>HX,_symbol:()=>MU,_success:()=>WX,_stringbool:()=>nM,_stringFormat:()=>iM,_string:()=>_U,_startsWith:()=>e$,_size:()=>HI,_set:()=>RX,_safeParseAsync:()=>dI,_safeParse:()=>lI,_regex:()=>JI,_refine:()=>rM,_record:()=>jX,_readonly:()=>KX,_property:()=>QU,_promise:()=>YX,_positive:()=>KU,_pipe:()=>GX,_parseAsync:()=>uI,_parse:()=>oI,_overwrite:()=>so,_optional:()=>ZX,_number:()=>$U,_nullable:()=>qX,_null:()=>ZU,_normalize:()=>n$,_nonpositive:()=>JU,_nonoptional:()=>VX,_nonnegative:()=>YU,_never:()=>FU,_negative:()=>HU,_nativeEnum:()=>UX,_nanoid:()=>AI,_nan:()=>GU,_multipleOf:()=>rf,_minSize:()=>nf,_minLength:()=>Ku,_min:()=>Zn,_mime:()=>r$,_maxSize:()=>qg,_maxLength:()=>Fg,_max:()=>Oi,_map:()=>AX,_lte:()=>Oi,_lt:()=>to,_lowercase:()=>YI,_literal:()=>MX,_length:()=>Vg,_lazy:()=>JX,_ksuid:()=>LI,_jwt:()=>KI,_isoTime:()=>SU,_isoDuration:()=>IU,_isoDateTime:()=>xU,_isoDate:()=>kU,_ipv6:()=>qI,_ipv4:()=>ZI,_intersection:()=>CX,_int64:()=>DU,_int32:()=>NU,_int:()=>PU,_includes:()=>XI,_guid:()=>bg,_gte:()=>Zn,_gt:()=>ro,_float64:()=>OU,_float32:()=>TU,_file:()=>eM,_enum:()=>DX,_endsWith:()=>t$,_emoji:()=>jI,_email:()=>PI,_e164:()=>GI,_discriminatedUnion:()=>zX,_default:()=>FX,_date:()=>WU,_custom:()=>tM,_cuid2:()=>DI,_cuid:()=>RI,_coercedString:()=>bU,_coercedNumber:()=>EU,_coercedDate:()=>BU,_coercedBoolean:()=>jU,_coercedBigint:()=>RU,_cidrv6:()=>VI,_cidrv4:()=>FI,_catch:()=>BX,_boolean:()=>CU,_bigint:()=>AU,_base64url:()=>BI,_base64:()=>WI,_array:()=>o$,_any:()=>qU,TimePrecision:()=>wU,NEVER:()=>n4,JSONSchemaGenerator:()=>af,JSONSchema:()=>QX,Doc:()=>yg,$output:()=>vU,$input:()=>yU,$constructor:()=>R,$brand:()=>i4,$ZodXID:()=>kD,$ZodVoid:()=>GD,$ZodUnknown:()=>_g,$ZodUnion:()=>kI,$ZodUndefined:()=>FD,$ZodUUID:()=>hD,$ZodURL:()=>vD,$ZodULID:()=>xD,$ZodType:()=>Ve,$ZodTuple:()=>Zg,$ZodTransform:()=>SI,$ZodTemplateLiteral:()=>fU,$ZodSymbol:()=>qD,$ZodSuccess:()=>uU,$ZodStringFormat:()=>Kt,$ZodString:()=>lf,$ZodSet:()=>XD,$ZodRegistry:()=>tf,$ZodRecord:()=>YD,$ZodRealError:()=>of,$ZodReadonly:()=>dU,$ZodPromise:()=>pU,$ZodPrefault:()=>sU,$ZodPipe:()=>II,$ZodOptional:()=>nU,$ZodObject:()=>xI,$ZodNumberFormat:()=>LD,$ZodNumber:()=>yI,$ZodNullable:()=>iU,$ZodNull:()=>VD,$ZodNonOptional:()=>oU,$ZodNever:()=>BD,$ZodNanoID:()=>_D,$ZodNaN:()=>cU,$ZodMap:()=>QD,$ZodLiteral:()=>tU,$ZodLazy:()=>mU,$ZodKSUID:()=>SD,$ZodJWT:()=>UD,$ZodIntersection:()=>JD,$ZodISOTime:()=>ED,$ZodISODuration:()=>PD,$ZodISODateTime:()=>ID,$ZodISODate:()=>$D,$ZodIPv6:()=>OD,$ZodIPv4:()=>TD,$ZodGUID:()=>mD,$ZodFunction:()=>xg,$ZodFile:()=>rU,$ZodError:()=>iI,$ZodEnum:()=>eU,$ZodEmoji:()=>yD,$ZodEmail:()=>gD,$ZodE164:()=>RD,$ZodDiscriminatedUnion:()=>HD,$ZodDefault:()=>aU,$ZodDate:()=>KD,$ZodCustomStringFormat:()=>MD,$ZodCustom:()=>hU,$ZodCheckUpperCase:()=>sD,$ZodCheckStringFormat:()=>uf,$ZodCheckStartsWith:()=>uD,$ZodCheckSizeEquals:()=>eD,$ZodCheckRegex:()=>iD,$ZodCheckProperty:()=>cD,$ZodCheckOverwrite:()=>fD,$ZodCheckNumberFormat:()=>J4,$ZodCheckMultipleOf:()=>H4,$ZodCheckMinSize:()=>X4,$ZodCheckMinLength:()=>rD,$ZodCheckMimeType:()=>dD,$ZodCheckMaxSize:()=>Q4,$ZodCheckMaxLength:()=>tD,$ZodCheckLowerCase:()=>aD,$ZodCheckLessThan:()=>hI,$ZodCheckLengthEquals:()=>nD,$ZodCheckIncludes:()=>oD,$ZodCheckGreaterThan:()=>gI,$ZodCheckEndsWith:()=>lD,$ZodCheckBigIntFormat:()=>Y4,$ZodCheck:()=>dr,$ZodCatch:()=>lU,$ZodCUID2:()=>wD,$ZodCUID:()=>bD,$ZodCIDRv6:()=>zD,$ZodCIDRv4:()=>ND,$ZodBoolean:()=>_I,$ZodBigIntFormat:()=>ZD,$ZodBigInt:()=>bI,$ZodBase64URL:()=>AD,$ZodBase64:()=>CD,$ZodAsyncError:()=>cs,$ZodArray:()=>wI,$ZodAny:()=>WD});n4=Object.freeze({status:"aborted"});i4=Symbol("zod_brand"),cs=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},mg={};pt={};no(pt,{unwrapMessage:()=>Ad,stringifyPrimitive:()=>He,required:()=>G7,randomString:()=>U7,propertyKeyTypes:()=>hg,promiseAllObject:()=>D7,primitiveTypes:()=>u4,prefixIssues:()=>ei,pick:()=>q7,partial:()=>B7,optionalKeys:()=>l4,omit:()=>F7,numKeys:()=>M7,nullish:()=>io,normalizeParams:()=>re,merge:()=>W7,jsonStringifyReplacer:()=>a4,joinValues:()=>se,issue:()=>f4,isPlainObject:()=>ef,isObject:()=>Xd,getSizableOrigin:()=>Mg,getParsedType:()=>L7,getLengthableOrigin:()=>Lg,getEnumValues:()=>tI,getElementAtPath:()=>R7,floatSafeRemainder:()=>s4,finalizeIssue:()=>zi,extend:()=>V7,escapeRegex:()=>ao,esc:()=>$u,defineLazy:()=>Ct,createTransparentProxy:()=>Z7,clone:()=>ji,cleanRegex:()=>Ug,cleanEnum:()=>K7,captureStackTrace:()=>nI,cached:()=>Dg,assignProp:()=>rI,assertNotEqual:()=>z7,assertNever:()=>j7,assertIs:()=>C7,assertEqual:()=>N7,assert:()=>A7,allowsEval:()=>o4,aborted:()=>Nu,NUMBER_FORMAT_RANGES:()=>c4,Class:()=>CS,BIGINT_FORMAT_RANGES:()=>d4});nI=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};o4=Dg(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});L7=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw Error(`Unknown data type: ${t}`)}},hg=new Set(["string","number","symbol"]),u4=new Set(["string","number","bigint","boolean","symbol","undefined"]);c4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},d4={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};CS=class{constructor(...t){}},p4=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,a4,2)},enumerable:!0})},iI=R("$ZodError",p4),of=R("$ZodError",p4,{Parent:Error});oI=e=>(t,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new cs;if(s.issues.length){let o=new(i?.Err??e)(s.issues.map(u=>zi(u,a,dn())));throw nI(o,i?.callee),o}return s.value},gg=oI(of),uI=e=>async(t,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let o=new(i?.Err??e)(s.issues.map(u=>zi(u,a,dn())));throw nI(o,i?.callee),o}return s.value},vg=uI(of),lI=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new cs;return a.issues.length?{success:!1,error:new(e??iI)(a.issues.map(s=>zi(s,i,dn())))}:{success:!0,data:a.value}},cI=lI(of),dI=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>zi(s,i,dn())))}:{success:!0,data:a.value}},fI=dI(of),pI={};no(pI,{xid:()=>b4,uuid7:()=>Q7,uuid6:()=>Y7,uuid4:()=>J7,uuid:()=>Gu,uppercase:()=>G4,unicodeEmail:()=>tQ,undefined:()=>W4,ulid:()=>_4,time:()=>D4,string:()=>M4,rfc5322Email:()=>eQ,number:()=>q4,null:()=>V4,nanoid:()=>x4,lowercase:()=>B4,ksuid:()=>w4,ipv6:()=>P4,ipv4:()=>E4,integer:()=>Z4,html5Email:()=>X7,hostname:()=>z4,guid:()=>S4,extendedDuration:()=>H7,emoji:()=>$4,email:()=>I4,e164:()=>C4,duration:()=>k4,domain:()=>iQ,datetime:()=>U4,date:()=>A4,cuid2:()=>y4,cuid:()=>v4,cidrv6:()=>O4,cidrv4:()=>T4,browserEmail:()=>rQ,boolean:()=>F4,bigint:()=>L4,base64url:()=>mI,base64:()=>N4,_emoji:()=>nQ});v4=/^[cC][^\s-]{8,}$/,y4=/^[0-9a-z]+$/,_4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,b4=/^[0-9a-vA-V]{20}$/,w4=/^[A-Za-z0-9]{27}$/,x4=/^[a-zA-Z0-9_-]{21}$/,k4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H7=/^[-+]?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)?)??$/,S4=/^([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})$/,Gu=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,J7=Gu(4),Y7=Gu(6),Q7=Gu(7),I4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,X7=/^[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])?)*$/,eQ=/^(([^<>()\[\]\\.,;:\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,}))$/,tQ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,rQ=/^[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])?)*$/,nQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";E4=/^(?:(?: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])$/,P4=/^(([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})$/,T4=/^((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])$/,O4=/^(([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])$/,N4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mI=/^[A-Za-z0-9_-]*$/,z4=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,iQ=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,C4=/^\+(?:[0-9]){6,14}[0-9]$/,j4="(?:(?:\\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])))",A4=new RegExp(`^${j4}$`);M4=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},L4=/^\d+n?$/,Z4=/^\d+$/,q4=/^-?\d+(?:\.\d+)?/i,F4=/true|false/i,V4=/null/i,W4=/undefined/i,B4=/^[^A-Z]*$/,G4=/^[^a-z]*$/,dr=R("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),K4={number:"number",bigint:"bigint",object:"date"},hI=R("$ZodCheckLessThan",(e,t)=>{dr.init(e,t);let r=K4[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gI=R("$ZodCheckGreaterThan",(e,t)=>{dr.init(e,t);let r=K4[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),H4=R("$ZodCheckMultipleOf",(e,t)=>{dr.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):s4(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),J4=R("$ZodCheckNumberFormat",(e,t)=>{dr.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=c4[t.format];e._zod.onattach.push(s=>{let o=s._zod.bag;o.format=t.format,o.minimum=i,o.maximum=a,r&&(o.pattern=Z4)}),e._zod.check=s=>{let o=s.value;if(r){if(!Number.isInteger(o)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}o<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inst:e})}}),Y4=R("$ZodCheckBigIntFormat",(e,t)=>{dr.init(e,t);let[r,n]=d4[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=r,a.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inst:e})}}),Q4=R("$ZodCheckMaxSize",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.size!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Mg(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),X4=R("$ZodCheckMinSize",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.size!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Mg(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),eD=R("$ZodCheckSizeEquals",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.size!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:Mg(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tD=R("$ZodCheckMaxLength",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.length!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=Lg(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rD=R("$ZodCheckMinLength",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.length!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=Lg(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nD=R("$ZodCheckLengthEquals",(e,t)=>{dr.init(e,t),e._zod.when=r=>{let n=r.value;return!io(n)&&n.length!==void 0},e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let a=Lg(n),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),uf=R("$ZodCheckStringFormat",(e,t)=>{var r,n;dr.init(e,t),e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),iD=R("$ZodCheckRegex",(e,t)=>{uf.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),aD=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=B4),uf.init(e,t)}),sD=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=G4),uf.init(e,t)}),oD=R("$ZodCheckIncludes",(e,t)=>{dr.init(e,t);let r=ao(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),uD=R("$ZodCheckStartsWith",(e,t)=>{dr.init(e,t);let r=new RegExp(`^${ao(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),lD=R("$ZodCheckEndsWith",(e,t)=>{dr.init(e,t);let r=new RegExp(`.*${ao(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});cD=R("$ZodCheckProperty",(e,t)=>{dr.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>NA(i,r,t.property));NA(n,r,t.property)}}),dD=R("$ZodCheckMimeType",(e,t)=>{dr.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e})}}),fD=R("$ZodCheckOverwrite",(e,t)=>{dr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),yg=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
177
+ `).filter(a=>a),n=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
178
+ `))}},pD={major:4,minor:0,patch:0},Ve=R("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pD;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let a of i._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,s,o)=>{let u=Nu(a),l;for(let c of s){if(c._zod.when){if(!c._zod.when(a))continue}else if(u)continue;let d=a.issues.length,f=c._zod.check(a);if(f instanceof Promise&&o?.async===!1)throw new cs;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==d&&(u||(u=Nu(a,d)))});else{if(a.issues.length===d)continue;u||(u=Nu(a,d))}}return l?l.then(()=>a):a};e._zod.run=(a,s)=>{let o=e._zod.parse(a,s);if(o instanceof Promise){if(s.async===!1)throw new cs;return o.then(u=>i(u,n,s))}return i(o,n,s)}}e["~standard"]={validate:i=>{try{let a=cI(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return fI(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),lf=R("$ZodString",(e,t)=>{Ve.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??M4(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Kt=R("$ZodStringFormat",(e,t)=>{uf.init(e,t),lf.init(e,t)}),mD=R("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=S4),Kt.init(e,t)}),hD=R("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Gu(r))}else t.pattern??(t.pattern=Gu());Kt.init(e,t)}),gD=R("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=I4),Kt.init(e,t)}),vD=R("$ZodURL",(e,t)=>{Kt.init(e,t),e._zod.check=r=>{try{let n=r.value,i=new URL(n),a=i.href;t.hostname&&(t.hostname.lastIndex=0,!t.hostname.test(i.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:z4.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,!t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&a.endsWith("/")?r.value=a.slice(0,-1):r.value=a;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),yD=R("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=$4()),Kt.init(e,t)}),_D=R("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=x4),Kt.init(e,t)}),bD=R("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=v4),Kt.init(e,t)}),wD=R("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=y4),Kt.init(e,t)}),xD=R("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_4),Kt.init(e,t)}),kD=R("$ZodXID",(e,t)=>{t.pattern??(t.pattern=b4),Kt.init(e,t)}),SD=R("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=w4),Kt.init(e,t)}),ID=R("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=U4(t)),Kt.init(e,t)}),$D=R("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=A4),Kt.init(e,t)}),ED=R("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=D4(t)),Kt.init(e,t)}),PD=R("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=k4),Kt.init(e,t)}),TD=R("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=E4),Kt.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),OD=R("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=P4),Kt.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ND=R("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=T4),Kt.init(e,t)}),zD=R("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=O4),Kt.init(e,t),e._zod.check=r=>{let[n,i]=r.value.split("/");try{if(!i)throw Error();let a=Number(i);if(`${a}`!==i||a<0||a>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});CD=R("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=N4),Kt.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{vI(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});AD=R("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mI),Kt.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{jD(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),RD=R("$ZodE164",(e,t)=>{t.pattern??(t.pattern=C4),Kt.init(e,t)});UD=R("$ZodJWT",(e,t)=>{Kt.init(e,t),e._zod.check=r=>{DD(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),MD=R("$ZodCustomStringFormat",(e,t)=>{Kt.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),yI=R("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??q4,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),LD=R("$ZodNumber",(e,t)=>{J4.init(e,t),yI.init(e,t)}),_I=R("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=F4,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),bI=R("$ZodBigInt",(e,t)=>{Ve.init(e,t),e._zod.pattern=L4,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),ZD=R("$ZodBigInt",(e,t)=>{Y4.init(e,t),bI.init(e,t)}),qD=R("$ZodSymbol",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),FD=R("$ZodUndefined",(e,t)=>{Ve.init(e,t),e._zod.pattern=W4,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),VD=R("$ZodNull",(e,t)=>{Ve.init(e,t),e._zod.pattern=V4,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),WD=R("$ZodAny",(e,t)=>{Ve.init(e,t),e._zod.parse=r=>r}),_g=R("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=r=>r}),BD=R("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),GD=R("$ZodVoid",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),KD=R("$ZodDate",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}});wI=R("$ZodArray",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let s=0;s<i.length;s++){let o=i[s],u=t.element._zod.run({value:o,issues:[]},n);u instanceof Promise?a.push(u.then(l=>zA(l,r,s))):zA(u,r,s)}return a.length?Promise.all(a).then(()=>r):r}});xI=R("$ZodObject",(e,t)=>{Ve.init(e,t);let r=Dg(()=>{let c=Object.keys(t.shape);for(let f of c)if(!(t.shape[f]instanceof Ve))throw Error(`Invalid element at key "${f}": expected a Zod schema`);let d=l4(t.shape);return{shape:t.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(d)}});Ct(e._zod,"propValues",()=>{let c=t.shape,d={};for(let f in c){let p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(let h of p.values)d[f].add(h)}}return d});let n=c=>{let d=new yg(["shape","payload","ctx"]),f=r.value,p=m=>{let g=$u(m);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");let h=Object.create(null),y=0;for(let m of f.keys)h[m]=`key_${y++}`;d.write("const newResult = {}");for(let m of f.keys)if(f.optionalKeys.has(m)){let g=h[m];d.write(`const ${g} = ${p(m)};`);let v=$u(m);d.write(`
179
+ if (${g}.issues.length) {
180
+ if (input[${v}] === undefined) {
181
+ if (${v} in input) {
182
+ newResult[${v}] = undefined;
183
+ }
184
+ } else {
185
+ payload.issues = payload.issues.concat(
186
+ ${g}.issues.map((iss) => ({
187
+ ...iss,
188
+ path: iss.path ? [${v}, ...iss.path] : [${v}],
189
+ }))
190
+ );
191
+ }
192
+ } else if (${g}.value === undefined) {
193
+ if (${v} in input) newResult[${v}] = undefined;
194
+ } else {
195
+ newResult[${v}] = ${g}.value;
196
+ }
197
+ `)}else{let g=h[m];d.write(`const ${g} = ${p(m)};`),d.write(`
198
+ if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
199
+ ...iss,
200
+ path: iss.path ? [${$u(m)}, ...iss.path] : [${$u(m)}]
201
+ })));`),d.write(`newResult[${$u(m)}] = ${g}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");let _=d.compile();return(m,g)=>_(c,m,g)},i,a=Xd,s=!mg.jitless,o=s&&o4.value,u=t.catchall,l;e._zod.parse=(c,d)=>{l??(l=r.value);let f=c.value;if(!a(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;let p=[];if(s&&o&&d?.async===!1&&d.jitless!==!0)i||(i=n(t.shape)),c=i(c,d);else{c.value={};let g=l.shape;for(let v of l.keys){let b=g[v],w=b._zod.run({value:f[v],issues:[]},d),x=b._zod.optin==="optional"&&b._zod.optout==="optional";w instanceof Promise?p.push(w.then(k=>x?CA(k,c,v,f):Nh(k,c,v))):x?CA(w,c,v,f):Nh(w,c,v)}}if(!u)return p.length?Promise.all(p).then(()=>c):c;let h=[],y=l.keySet,_=u._zod,m=_.def.type;for(let g of Object.keys(f)){if(y.has(g))continue;if(m==="never"){h.push(g);continue}let v=_.run({value:f[g],issues:[]},d);v instanceof Promise?p.push(v.then(b=>Nh(b,c,g))):Nh(v,c,g)}return h.length&&c.issues.push({code:"unrecognized_keys",keys:h,input:f,inst:e}),p.length?Promise.all(p).then(()=>c):c}});kI=R("$ZodUnion",(e,t)=>{Ve.init(e,t),Ct(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Ct(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ct(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Ct(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Ug(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let i=!1,a=[];for(let s of t.options){let o=s._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)a.push(o),i=!0;else{if(o.issues.length===0)return o;a.push(o)}}return i?Promise.all(a).then(s=>jA(s,r,e,n)):jA(a,r,e,n)}}),HD=R("$ZodDiscriminatedUnion",(e,t)=>{kI.init(e,t);let r=e._zod.parse;Ct(e._zod,"propValues",()=>{let i={};for(let a of t.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[o,u]of Object.entries(s)){i[o]||(i[o]=new Set);for(let l of u)i[o].add(l)}}return i});let n=Dg(()=>{let i=t.options,a=new Map;for(let s of i){let o=s._zod.propValues[t.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of o){if(a.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,s)}}return a});e._zod.parse=(i,a)=>{let s=i.value;if(!Xd(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let o=n.value.get(s?.[t.discriminator]);return o?o._zod.run(i,a):t.unionFallback?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),i)}}),JD=R("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,a=t.left._zod.run({value:i,issues:[]},n),s=t.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([o,u])=>AA(r,o,u)):AA(r,a,s)}});Zg=R("$ZodTuple",(e,t)=>{Ve.init(e,t);let r=t.items,n=r.length-[...r].reverse().findIndex(i=>i._zod.optin!=="optional");e._zod.parse=(i,a)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let o=[];if(!t.rest){let l=s.length>r.length,c=s.length<n-1;if(l||c)return i.issues.push({input:s,inst:e,origin:"array",...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),i}let u=-1;for(let l of r){if(u++,u>=s.length&&u>=n)continue;let c=l._zod.run({value:s[u],issues:[]},a);c instanceof Promise?o.push(c.then(d=>zh(d,i,u))):zh(c,i,u)}if(t.rest){let l=s.slice(r.length);for(let c of l){u++;let d=t.rest._zod.run({value:c,issues:[]},a);d instanceof Promise?o.push(d.then(f=>zh(f,i,u))):zh(d,i,u)}}return o.length?Promise.all(o).then(()=>i):i}});YD=R("$ZodRecord",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!ef(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let a=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let l=t.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?a.push(l.then(c=>{c.issues.length&&r.issues.push(...ei(u,c.issues)),r.value[u]=c.value})):(l.issues.length&&r.issues.push(...ei(u,l.issues)),r.value[u]=l.value)}let o;for(let u in i)s.has(u)||(o=o??[],o.push(u));o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:o})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let o=t.keyType._zod.run({value:s,issues:[]},n);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(l=>zi(l,n,dn())),input:s,path:[s],inst:e}),r.value[o.value]=o.value;continue}let u=t.valueType._zod.run({value:i[s],issues:[]},n);u instanceof Promise?a.push(u.then(l=>{l.issues.length&&r.issues.push(...ei(s,l.issues)),r.value[o.value]=l.value})):(u.issues.length&&r.issues.push(...ei(s,u.issues)),r.value[o.value]=u.value)}}return a.length?Promise.all(a).then(()=>r):r}}),QD=R("$ZodMap",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let a=[];r.value=new Map;for(let[s,o]of i){let u=t.keyType._zod.run({value:s,issues:[]},n),l=t.valueType._zod.run({value:o,issues:[]},n);u instanceof Promise||l instanceof Promise?a.push(Promise.all([u,l]).then(([c,d])=>{RA(c,d,r,s,i,e,n)})):RA(u,l,r,s,i,e,n)}return a.length?Promise.all(a).then(()=>r):r}});XD=R("$ZodSet",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let s of i){let o=t.valueType._zod.run({value:s,issues:[]},n);o instanceof Promise?a.push(o.then(u=>DA(u,r))):DA(o,r)}return a.length?Promise.all(a).then(()=>r):r}});eU=R("$ZodEnum",(e,t)=>{Ve.init(e,t);let r=tI(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(n=>hg.has(typeof n)).map(n=>typeof n=="string"?ao(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return e._zod.values.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),tU=R("$ZodLiteral",(e,t)=>{Ve.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ao(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),rU=R("$ZodFile",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),SI=R("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r));if(i instanceof Promise)throw new cs;return r.value=i,r}}),nU=R("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ct(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ug(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),iU=R("$ZodNullable",(e,t)=>{Ve.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ug(r.source)}|null)$`):void 0}),Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),aU=R("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>UA(a,t)):UA(i,t)}});sU=R("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),oU=R("$ZodNonOptional",(e,t)=>{Ve.init(e,t),Ct(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>MA(a,e)):MA(i,e)}});uU=R("$ZodSuccess",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),lU=R("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(s=>zi(s,n,dn()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>zi(a,n,dn()))},input:r.value}),r.issues=[]),r)}}),cU=R("$ZodNaN",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),II=R("$ZodPipe",(e,t)=>{Ve.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(a=>LA(a,t,n)):LA(i,t,n)}});dU=R("$ZodReadonly",(e,t)=>{Ve.init(e,t),Ct(e._zod,"propValues",()=>t.innerType._zod.propValues),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(ZA):ZA(i)}});fU=R("$ZodTemplateLiteral",(e,t)=>{Ve.init(e,t);let r=[];for(let n of t.parts)if(n instanceof Ve){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw Error(`Invalid template literal part: ${n._zod.traits}`);let a=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,s))}else if(n===null||u4.has(typeof n))r.push(ao(`${n}`));else throw Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"template_literal",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),n)}),pU=R("$ZodPromise",(e,t)=>{Ve.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>t.innerType._zod.run({value:i,issues:[]},n))}),mU=R("$ZodLazy",(e,t)=>{Ve.init(e,t),Ct(e._zod,"innerType",()=>t.getter()),Ct(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Ct(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Ct(e._zod,"optin",()=>e._zod.innerType._zod.optin),Ct(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),hU=R("$ZodCustom",(e,t)=>{dr.init(e,t),Ve.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(a=>qA(a,r,n,e));qA(i,r,n,e)}});$I={};no($I,{zhTW:()=>OX,zhCN:()=>PX,vi:()=>$X,ur:()=>SX,ua:()=>xX,tr:()=>bX,th:()=>vX,ta:()=>hX,sv:()=>pX,sl:()=>dX,ru:()=>lX,pt:()=>oX,ps:()=>nX,pl:()=>aX,ota:()=>tX,no:()=>XQ,nl:()=>YQ,ms:()=>HQ,mk:()=>GQ,ko:()=>WQ,kh:()=>FQ,ja:()=>ZQ,it:()=>MQ,id:()=>DQ,hu:()=>AQ,he:()=>CQ,frCA:()=>NQ,fr:()=>TQ,fi:()=>EQ,fa:()=>IQ,es:()=>kQ,eo:()=>wQ,en:()=>gU,de:()=>gQ,cs:()=>mQ,ca:()=>fQ,be:()=>cQ,az:()=>uQ,ar:()=>sQ});aQ=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return i=>{switch(i.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${He(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${n[a.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${se(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};oQ=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i.expected}, daxil olan ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${He(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[a.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${se(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};lQ=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0456\u045E";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${He(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);if(s){let o=Number(i.maximum),u=FA(o,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${a}${i.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);if(s){let o=Number(i.minimum),u=FA(o,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${a}${i.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${se(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};dQ=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${i.expected}, s'ha rebut ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${He(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${se(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a m\xE0xim":"menys de",s=t(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${a} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${a} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${n[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};pQ=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(i))return"pole";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return i=>{switch(i.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i.expected}, obdr\u017Eeno ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${He(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${n[a.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${se(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};hQ=()=>{let e={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 t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"Zahl";case"object":{if(Array.isArray(i))return"Array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${i.expected}, erhalten ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${He(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${n[a.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${se(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};vQ=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},yQ=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={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"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${vQ(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${He(n.values[0])}`:`Invalid option: expected one of ${se(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${se(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};_Q=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},bQ=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${_Q(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${He(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${se(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${se(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};xQ=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(i))return"arreglo";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype)return i.constructor.name}}return a},n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${i.expected}, recibido ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${He(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Demasiado grande: se esperaba que ${i.origin??"valor"} tuviera ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${i.origin??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Demasiado peque\xF1o: se esperaba que ${i.origin} tuviera ${a}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${i.origin} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${n[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i.origin}`;default:return"Entrada inv\xE1lida"}}};SQ=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0622\u0631\u0627\u06CC\u0647";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return i=>{switch(i.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(i.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${He(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${se(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[a.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${se(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};$Q=()=>{let e={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"};return i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${He(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${a}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${a}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${n[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${se(i.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\xF6te"}}};PQ=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"nombre";case"object":{if(Array.isArray(i))return"tableau";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : ${i.expected} attendu, ${r(i.input)} re\xE7u`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${He(i.values[0])} attendu`:`Option invalide : une valeur parmi ${se(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${n[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${se(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};OQ=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${i.expected}, re\xE7u ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${He(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u2264":"<",s=t(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u2265":">",s=t(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${n[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${se(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};zQ=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return i=>{switch(i.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${i.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${He(i.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${a}${i.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${i.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${a}${i.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${i.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${a.prefix}"`:a.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${a.suffix}"`:a.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${a.includes}"`:a.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${a.pattern}`:`${n[a.format]??i.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${i.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${i.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${i.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${se(i.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};jQ=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(i))return"t\xF6mb";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return i=>{switch(i.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i.expected}, a kapott \xE9rt\xE9k ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${He(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${a}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[a.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};RQ=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${He(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${n[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};UQ=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"numero";case"object":{if(Array.isArray(i))return"vettore";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Input non valido: atteso ${He(i.values[0])}`:`Opzione non valida: atteso uno tra ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${se(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};LQ=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(i))return"\u914D\u5217";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return i=>{switch(i.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(i.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${He(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${se(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${se(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};qQ=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(i))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(i===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return i=>{switch(i.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${He(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${se(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};VQ=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return i=>{switch(i.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(i.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${He(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${se(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",o=t(i.origin),u=o?.unit??"\uC694\uC18C";return o?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${u} ${a}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${a}${s}`}case"too_small":{let a=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",o=t(i.origin),u=o?.unit??"\uC694\uC18C";return o?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${u} ${a}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${a}${s}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[a.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${se(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};BQ=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(i))return"\u043D\u0438\u0437\u0430";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return i=>{switch(i.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${He(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${se(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};KQ=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"nombor";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${He(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${n[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${se(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};JQ=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"getal";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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"};return i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${He(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Te lang: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Te kort: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${n[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};QQ=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"tall";case"object":{if(Array.isArray(i))return"liste";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={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\xE5de",ipv6:"IPv6-omr\xE5de",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"};return i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${He(i.values[0])}`:`Ugyldig valg: forventet en av ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${se(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};eX=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"numara";case"object":{if(Array.isArray(i))return"saf";if(i===null)return"gayb";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return i=>{switch(i.code){case"invalid_type":return`F\xE2sit giren: umulan ${i.expected}, al\u0131nan ${r(i.input)}`;case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${He(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[a.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};rX=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0627\u0631\u06D0";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return i=>{switch(i.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(i.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${He(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${se(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[a.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${se(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};iX=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"liczba";case"object":{if(Array.isArray(i))return"tablica";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return i=>{switch(i.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i.expected}, otrzymano ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${He(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[a.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};sX=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(i))return"array";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return i=>{switch(i.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${i.expected}, recebido ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${He(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${n[a.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${se(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};uX=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${He(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);if(s){let o=Number(i.maximum),u=VA(o,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);if(s){let o=Number(i.minimum),u=VA(o,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${se(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};cX=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(i))return"tabela";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${i.expected}, prejeto ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${He(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${n[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${se(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};fX=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"antal";case"object":{if(Array.isArray(i))return"lista";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${i.expected}, fick ${r(i.input)}`;case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${He(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${n[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${se(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};mX=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(i))return"\u0B85\u0BA3\u0BBF";if(i===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${He(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${se(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${se(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};gX=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(i))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(i===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return i=>{switch(i.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${He(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${se(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};yX=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},_X=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${yX(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${He(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${se(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${se(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};wX=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${He(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${se(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};kX=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(i))return"\u0622\u0631\u06D2";if(i===null)return"\u0646\u0644";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return i=>{switch(i.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(i.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${He(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${se(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${a}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${a}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${se(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};IX=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(i))return"m\u1EA3ng";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return i=>{switch(i.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${He(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${n[a.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${se(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};EX=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(i))return"\u6570\u7EC4";if(i===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return i=>{switch(i.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${He(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${n[a.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${se(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};TX=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(i){return e[i]??null}let r=i=>{let a=typeof i;switch(a){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return a},n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return i=>{switch(i.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i.expected}\uFF0C\u4F46\u6536\u5230 ${r(i.input)}`;case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${He(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${se(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${se(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};vU=Symbol("ZodOutput"),yU=Symbol("ZodInput"),tf=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};Ks=EI();wU={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};xg=class{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw Error("implement() must be called with a function");let r=(...n)=>{let i=this._def.input?gg(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=t(...i);return this._def.output?gg(this._def.output,a,void 0,{callee:r}):a};return r}implementAsync(t){if(typeof t!="function")throw Error("implement() must be called with a function");let r=async(...n)=>{let i=this._def.input?await vg(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=await t(...i);return this._def.output?vg(this._def.output,a,void 0,{callee:r}):a};return r}input(...t){let r=this.constructor;return Array.isArray(t[0])?new r({type:"function",input:new Zg({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new r({type:"function",input:t[0],output:this._def.output})}output(t){return new this.constructor({type:"function",input:this._def.input,output:t})}};af=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Ks,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,a={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,o);let u=t._zod.toJSONSchema?.();if(u)o.schema=u;else{let c={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)o.ref=d,this.process(d,c),this.seen.get(d).isParent=!0;else{let f=o.schema;switch(i.type){case"string":{let p=f;p.type="string";let{minimum:h,maximum:y,format:_,patterns:m,contentEncoding:g}=t._zod.bag;if(typeof h=="number"&&(p.minLength=h),typeof y=="number"&&(p.maxLength=y),_&&(p.format=a[_]??_,p.format===""&&delete p.format),g&&(p.contentEncoding=g),m&&m.size>0){let v=[...m];v.length===1?p.pattern=v[0].source:v.length>1&&(o.schema.allOf=[...v.map(b=>({...this.target==="draft-7"?{type:"string"}:{},pattern:b.source}))])}break}case"number":{let p=f,{minimum:h,maximum:y,format:_,multipleOf:m,exclusiveMaximum:g,exclusiveMinimum:v}=t._zod.bag;typeof _=="string"&&_.includes("int")?p.type="integer":p.type="number",typeof v=="number"&&(p.exclusiveMinimum=v),typeof h=="number"&&(p.minimum=h,typeof v=="number"&&(v>=h?delete p.minimum:delete p.exclusiveMinimum)),typeof g=="number"&&(p.exclusiveMaximum=g),typeof y=="number"&&(p.maximum=y,typeof g=="number"&&(g<=y?delete p.maximum:delete p.exclusiveMaximum)),typeof m=="number"&&(p.multipleOf=m);break}case"boolean":{let p=f;p.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{f.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let p=f,{minimum:h,maximum:y}=t._zod.bag;typeof h=="number"&&(p.minItems=h),typeof y=="number"&&(p.maxItems=y),p.type="array",p.items=this.process(i.element,{...c,path:[...c.path,"items"]});break}case"object":{let p=f;p.type="object",p.properties={};let h=i.shape;for(let m in h)p.properties[m]=this.process(h[m],{...c,path:[...c.path,"properties",m]});let y=new Set(Object.keys(h)),_=new Set([...y].filter(m=>{let g=i.shape[m]._zod;return this.io==="input"?g.optin===void 0:g.optout===void 0}));_.size>0&&(p.required=Array.from(_)),i.catchall?._zod.def.type==="never"?p.additionalProperties=!1:i.catchall?i.catchall&&(p.additionalProperties=this.process(i.catchall,{...c,path:[...c.path,"additionalProperties"]})):this.io==="output"&&(p.additionalProperties=!1);break}case"union":{let p=f;p.anyOf=i.options.map((h,y)=>this.process(h,{...c,path:[...c.path,"anyOf",y]}));break}case"intersection":{let p=f,h=this.process(i.left,{...c,path:[...c.path,"allOf",0]}),y=this.process(i.right,{...c,path:[...c.path,"allOf",1]}),_=g=>"allOf"in g&&Object.keys(g).length===1,m=[..._(h)?h.allOf:[h],..._(y)?y.allOf:[y]];p.allOf=m;break}case"tuple":{let p=f;p.type="array";let h=i.items.map((m,g)=>this.process(m,{...c,path:[...c.path,"prefixItems",g]}));if(this.target==="draft-2020-12"?p.prefixItems=h:p.items=h,i.rest){let m=this.process(i.rest,{...c,path:[...c.path,"items"]});this.target==="draft-2020-12"?p.items=m:p.additionalItems=m}i.rest&&(p.items=this.process(i.rest,{...c,path:[...c.path,"items"]}));let{minimum:y,maximum:_}=t._zod.bag;typeof y=="number"&&(p.minItems=y),typeof _=="number"&&(p.maxItems=_);break}case"record":{let p=f;p.type="object",p.propertyNames=this.process(i.keyType,{...c,path:[...c.path,"propertyNames"]}),p.additionalProperties=this.process(i.valueType,{...c,path:[...c.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let p=f,h=tI(i.entries);h.every(y=>typeof y=="number")&&(p.type="number"),h.every(y=>typeof y=="string")&&(p.type="string"),p.enum=h;break}case"literal":{let p=f,h=[];for(let y of i.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");h.push(Number(y))}else h.push(y);if(h.length!==0)if(h.length===1){let y=h[0];p.type=y===null?"null":typeof y,p.const=y}else h.every(y=>typeof y=="number")&&(p.type="number"),h.every(y=>typeof y=="string")&&(p.type="string"),h.every(y=>typeof y=="boolean")&&(p.type="string"),h.every(y=>y===null)&&(p.type="null"),p.enum=h;break}case"file":{let p=f,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:_,mime:m}=t._zod.bag;y!==void 0&&(h.minLength=y),_!==void 0&&(h.maxLength=_),m?m.length===1?(h.contentMediaType=m[0],Object.assign(p,h)):p.anyOf=m.map(g=>({...h,contentMediaType:g})):Object.assign(p,h);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(i.innerType,c);f.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"success":{let p=f;p.type="boolean";break}case"default":{this.process(i.innerType,c),o.ref=i.innerType,f.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,c),o.ref=i.innerType,this.io==="input"&&(f._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,c),o.ref=i.innerType;let p;try{p=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}f.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=f,h=t._zod.pattern;if(!h)throw Error("Pattern not found in template literal");p.type="string",p.pattern=h.source;break}case"pipe":{let p=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(p,c),o.ref=p;break}case"readonly":{this.process(i.innerType,c),o.ref=i.innerType,f.readOnly=!0;break}case"promise":{this.process(i.innerType,c),o.ref=i.innerType;break}case"optional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"lazy":{let p=t._zod.innerType;this.process(p,c),o.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(t);return l&&Object.assign(o.schema,l),this.io==="input"&&br(t)&&(delete o.schema.examples,delete o.schema.default),this.io==="input"&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(t).schema}emit(t,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},i=this.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let a=c=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let h=n.external.registry.get(c[0])?.id;if(h)return{ref:n.external.uri(h)};let y=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${d}/${y}`}}if(c[1]===i)return{ref:"#"};let f=`#/${d}/`,p=c[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:f+p}},s=c=>{if(c[1].schema.$ref)return;let d=c[1],{ref:f,defId:p}=a(c);d.def={...d.schema},p&&(d.defId=p);let h=d.schema;for(let y in h)delete h[y];h.$ref=f};for(let c of this.seen.entries()){let d=c[1];if(t===c[0]){s(c);continue}if(n.external){let f=n.external.registry.get(c[0])?.id;if(t!==c[0]&&f){s(c);continue}}if(this.metadataRegistry.get(c[0])?.id){s(c);continue}if(d.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
202
+
203
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&s(c);continue}if(d.count>1&&n.reused==="ref"){s(c);continue}}let o=(c,d)=>{let f=this.seen.get(c),p=f.def??f.schema,h={...p};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){o(y,d);let _=this.seen.get(y).schema;_.$ref&&d.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(_)):(Object.assign(p,_),Object.assign(p,h))}f.isParent||this.override({zodSchema:c,jsonSchema:p,path:f.path??[]})};for(let c of[...this.seen.entries()].reverse())o(c[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,i.def);let l=n.external?.defs??{};for(let c of this.seen.entries()){let d=c[1];d.def&&d.defId&&(l[d.defId]=d.def)}!n.external&&Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};QX={},XX=R("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");Ve.init(e,t),e.def=t,e.parse=(r,n)=>gg(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>cI(e,r,n),e.parseAsync=async(r,n)=>vg(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>fI(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>ji(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e)}),TEe=R("ZodMiniObject",(e,t)=>{xI.init(e,t),XX.init(e,t),pt.defineLazy(e,"shape",()=>t.shape)}),Eu={};no(Eu,{xid:()=>pee,void:()=>jee,uuidv7:()=>see,uuidv6:()=>aee,uuidv4:()=>iee,uuid:()=>nee,url:()=>oee,uppercase:()=>QI,unknown:()=>nr,union:()=>Vt,undefined:()=>zee,ulid:()=>fee,uint64:()=>Oee,uint32:()=>Eee,tuple:()=>Uee,trim:()=>i$,treeifyError:()=>m4,transform:()=>U$,toUpperCase:()=>s$,toLowerCase:()=>a$,toJSONSchema:()=>sM,templateLiteral:()=>Gee,symbol:()=>Nee,superRefine:()=>YM,success:()=>Wee,stringbool:()=>Jee,stringFormat:()=>kee,string:()=>V,strictObject:()=>Dee,startsWith:()=>e$,size:()=>HI,setErrorMap:()=>Xee,set:()=>Zee,safeParseAsync:()=>hM,safeParse:()=>mM,registry:()=>EI,regexes:()=>pI,regex:()=>JI,refine:()=>JM,record:()=>Ft,readonly:()=>FM,property:()=>QU,promise:()=>Kee,prettifyError:()=>g4,preprocess:()=>q$,prefault:()=>RM,positive:()=>KU,pipe:()=>Ig,partialRecord:()=>Mee,parseAsync:()=>pM,parse:()=>fM,overwrite:()=>so,optional:()=>Yt,object:()=>pe,number:()=>Nt,nullish:()=>Vee,nullable:()=>Sg,null:()=>z$,normalize:()=>n$,nonpositive:()=>JU,nonoptional:()=>DM,nonnegative:()=>YU,never:()=>Hg,negative:()=>HU,nativeEnum:()=>qee,nanoid:()=>lee,nan:()=>Bee,multipleOf:()=>rf,minSize:()=>nf,minLength:()=>Ku,mime:()=>r$,maxSize:()=>qg,maxLength:()=>Fg,map:()=>Lee,lte:()=>Oi,lt:()=>to,lowercase:()=>YI,looseObject:()=>un,locales:()=>$I,literal:()=>Ie,length:()=>Vg,lazy:()=>BM,ksuid:()=>mee,keyof:()=>Ree,jwt:()=>xee,json:()=>Yee,iso:()=>u$,ipv6:()=>gee,ipv4:()=>hee,intersection:()=>Yg,int64:()=>Tee,int32:()=>$ee,int:()=>AS,instanceof:()=>Hee,includes:()=>XI,guid:()=>ree,gte:()=>Zn,gt:()=>ro,globalRegistry:()=>Ks,getErrorMap:()=>ete,function:()=>aM,formatError:()=>sI,float64:()=>Iee,float32:()=>See,flattenError:()=>aI,file:()=>Fee,enum:()=>wn,endsWith:()=>t$,emoji:()=>uee,email:()=>tee,e164:()=>wee,discriminatedUnion:()=>A$,date:()=>Aee,custom:()=>HM,cuid2:()=>dee,cuid:()=>cee,core:()=>r4,config:()=>dn,coerce:()=>QM,clone:()=>ji,cidrv6:()=>yee,cidrv4:()=>vee,check:()=>KM,catch:()=>LM,boolean:()=>wr,bigint:()=>Pee,base64url:()=>bee,base64:()=>_ee,array:()=>mt,any:()=>Cee,_default:()=>jM,_ZodString:()=>p$,ZodXID:()=>w$,ZodVoid:()=>kM,ZodUnknown:()=>wM,ZodUnion:()=>j$,ZodUndefined:()=>yM,ZodUUID:()=>Ea,ZodURL:()=>h$,ZodULID:()=>b$,ZodType:()=>nt,ZodTuple:()=>EM,ZodTransform:()=>D$,ZodTemplateLiteral:()=>VM,ZodSymbol:()=>vM,ZodSuccess:()=>UM,ZodStringFormat:()=>Qt,ZodString:()=>Wg,ZodSet:()=>TM,ZodRecord:()=>R$,ZodRealError:()=>cf,ZodReadonly:()=>qM,ZodPromise:()=>GM,ZodPrefault:()=>AM,ZodPipe:()=>Z$,ZodOptional:()=>M$,ZodObject:()=>Jg,ZodNumberFormat:()=>tl,ZodNumber:()=>Bg,ZodNullable:()=>zM,ZodNull:()=>_M,ZodNonOptional:()=>L$,ZodNever:()=>xM,ZodNanoID:()=>v$,ZodNaN:()=>ZM,ZodMap:()=>PM,ZodLiteral:()=>OM,ZodLazy:()=>WM,ZodKSUID:()=>x$,ZodJWT:()=>O$,ZodIssueCode:()=>Qee,ZodIntersection:()=>$M,ZodISOTime:()=>d$,ZodISODuration:()=>f$,ZodISODateTime:()=>l$,ZodISODate:()=>c$,ZodIPv6:()=>S$,ZodIPv4:()=>k$,ZodGUID:()=>kg,ZodFile:()=>NM,ZodError:()=>eee,ZodEnum:()=>sf,ZodEmoji:()=>g$,ZodEmail:()=>m$,ZodE164:()=>T$,ZodDiscriminatedUnion:()=>IM,ZodDefault:()=>CM,ZodDate:()=>C$,ZodCustomStringFormat:()=>gM,ZodCustom:()=>Qg,ZodCatch:()=>MM,ZodCUID2:()=>_$,ZodCUID:()=>y$,ZodCIDRv6:()=>$$,ZodCIDRv4:()=>I$,ZodBoolean:()=>Gg,ZodBigIntFormat:()=>N$,ZodBigInt:()=>Kg,ZodBase64URL:()=>P$,ZodBase64:()=>E$,ZodArray:()=>SM,ZodAny:()=>bM,TimePrecision:()=>wU,NEVER:()=>n4,$output:()=>vU,$input:()=>yU,$brand:()=>i4});u$={};no(u$,{time:()=>lM,duration:()=>cM,datetime:()=>oM,date:()=>uM,ZodISOTime:()=>d$,ZodISODuration:()=>f$,ZodISODateTime:()=>l$,ZodISODate:()=>c$});l$=R("ZodISODateTime",(e,t)=>{ID.init(e,t),Qt.init(e,t)});c$=R("ZodISODate",(e,t)=>{$D.init(e,t),Qt.init(e,t)});d$=R("ZodISOTime",(e,t)=>{ED.init(e,t),Qt.init(e,t)});f$=R("ZodISODuration",(e,t)=>{PD.init(e,t),Qt.init(e,t)});dM=(e,t)=>{iI.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>sI(e,r)},flatten:{value:r=>aI(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},eee=R("ZodError",dM),cf=R("ZodError",dM,{Parent:Error}),fM=oI(cf),pM=uI(cf),mM=lI(cf),hM=dI(cf),nt=R("ZodType",(e,t)=>(Ve.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>ji(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>fM(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>mM(e,r,n),e.parseAsync=async(r,n)=>pM(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>hM(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(JM(r,n)),e.superRefine=r=>e.check(YM(r)),e.overwrite=r=>e.check(so(r)),e.optional=()=>Yt(e),e.nullable=()=>Sg(e),e.nullish=()=>Yt(Sg(e)),e.nonoptional=r=>DM(e,r),e.array=()=>mt(e),e.or=r=>Vt([e,r]),e.and=r=>Yg(e,r),e.transform=r=>Ig(e,U$(r)),e.default=r=>jM(e,r),e.prefault=r=>RM(e,r),e.catch=r=>LM(e,r),e.pipe=r=>Ig(e,r),e.readonly=()=>FM(e),e.describe=r=>{let n=e.clone();return Ks.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ks.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ks.get(e);let n=e.clone();return Ks.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),p$=R("_ZodString",(e,t)=>{lf.init(e,t),nt.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(JI(...n)),e.includes=(...n)=>e.check(XI(...n)),e.startsWith=(...n)=>e.check(e$(...n)),e.endsWith=(...n)=>e.check(t$(...n)),e.min=(...n)=>e.check(Ku(...n)),e.max=(...n)=>e.check(Fg(...n)),e.length=(...n)=>e.check(Vg(...n)),e.nonempty=(...n)=>e.check(Ku(1,...n)),e.lowercase=n=>e.check(YI(n)),e.uppercase=n=>e.check(QI(n)),e.trim=()=>e.check(i$()),e.normalize=(...n)=>e.check(n$(...n)),e.toLowerCase=()=>e.check(a$()),e.toUpperCase=()=>e.check(s$())}),Wg=R("ZodString",(e,t)=>{lf.init(e,t),p$.init(e,t),e.email=r=>e.check(PI(m$,r)),e.url=r=>e.check(CI(h$,r)),e.jwt=r=>e.check(KI(O$,r)),e.emoji=r=>e.check(jI(g$,r)),e.guid=r=>e.check(bg(kg,r)),e.uuid=r=>e.check(TI(Ea,r)),e.uuidv4=r=>e.check(OI(Ea,r)),e.uuidv6=r=>e.check(NI(Ea,r)),e.uuidv7=r=>e.check(zI(Ea,r)),e.nanoid=r=>e.check(AI(v$,r)),e.guid=r=>e.check(bg(kg,r)),e.cuid=r=>e.check(RI(y$,r)),e.cuid2=r=>e.check(DI(_$,r)),e.ulid=r=>e.check(UI(b$,r)),e.base64=r=>e.check(WI(E$,r)),e.base64url=r=>e.check(BI(P$,r)),e.xid=r=>e.check(MI(w$,r)),e.ksuid=r=>e.check(LI(x$,r)),e.ipv4=r=>e.check(ZI(k$,r)),e.ipv6=r=>e.check(qI(S$,r)),e.cidrv4=r=>e.check(FI(I$,r)),e.cidrv6=r=>e.check(VI($$,r)),e.e164=r=>e.check(GI(T$,r)),e.datetime=r=>e.check(oM(r)),e.date=r=>e.check(uM(r)),e.time=r=>e.check(lM(r)),e.duration=r=>e.check(cM(r))});Qt=R("ZodStringFormat",(e,t)=>{Kt.init(e,t),p$.init(e,t)}),m$=R("ZodEmail",(e,t)=>{gD.init(e,t),Qt.init(e,t)});kg=R("ZodGUID",(e,t)=>{mD.init(e,t),Qt.init(e,t)});Ea=R("ZodUUID",(e,t)=>{hD.init(e,t),Qt.init(e,t)});h$=R("ZodURL",(e,t)=>{vD.init(e,t),Qt.init(e,t)});g$=R("ZodEmoji",(e,t)=>{yD.init(e,t),Qt.init(e,t)});v$=R("ZodNanoID",(e,t)=>{_D.init(e,t),Qt.init(e,t)});y$=R("ZodCUID",(e,t)=>{bD.init(e,t),Qt.init(e,t)});_$=R("ZodCUID2",(e,t)=>{wD.init(e,t),Qt.init(e,t)});b$=R("ZodULID",(e,t)=>{xD.init(e,t),Qt.init(e,t)});w$=R("ZodXID",(e,t)=>{kD.init(e,t),Qt.init(e,t)});x$=R("ZodKSUID",(e,t)=>{SD.init(e,t),Qt.init(e,t)});k$=R("ZodIPv4",(e,t)=>{TD.init(e,t),Qt.init(e,t)});S$=R("ZodIPv6",(e,t)=>{OD.init(e,t),Qt.init(e,t)});I$=R("ZodCIDRv4",(e,t)=>{ND.init(e,t),Qt.init(e,t)});$$=R("ZodCIDRv6",(e,t)=>{zD.init(e,t),Qt.init(e,t)});E$=R("ZodBase64",(e,t)=>{CD.init(e,t),Qt.init(e,t)});P$=R("ZodBase64URL",(e,t)=>{AD.init(e,t),Qt.init(e,t)});T$=R("ZodE164",(e,t)=>{RD.init(e,t),Qt.init(e,t)});O$=R("ZodJWT",(e,t)=>{UD.init(e,t),Qt.init(e,t)});gM=R("ZodCustomStringFormat",(e,t)=>{MD.init(e,t),Qt.init(e,t)});Bg=R("ZodNumber",(e,t)=>{yI.init(e,t),nt.init(e,t),e.gt=(n,i)=>e.check(ro(n,i)),e.gte=(n,i)=>e.check(Zn(n,i)),e.min=(n,i)=>e.check(Zn(n,i)),e.lt=(n,i)=>e.check(to(n,i)),e.lte=(n,i)=>e.check(Oi(n,i)),e.max=(n,i)=>e.check(Oi(n,i)),e.int=n=>e.check(AS(n)),e.safe=n=>e.check(AS(n)),e.positive=n=>e.check(ro(0,n)),e.nonnegative=n=>e.check(Zn(0,n)),e.negative=n=>e.check(to(0,n)),e.nonpositive=n=>e.check(Oi(0,n)),e.multipleOf=(n,i)=>e.check(rf(n,i)),e.step=(n,i)=>e.check(rf(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});tl=R("ZodNumberFormat",(e,t)=>{LD.init(e,t),Bg.init(e,t)});Gg=R("ZodBoolean",(e,t)=>{_I.init(e,t),nt.init(e,t)});Kg=R("ZodBigInt",(e,t)=>{bI.init(e,t),nt.init(e,t),e.gte=(n,i)=>e.check(Zn(n,i)),e.min=(n,i)=>e.check(Zn(n,i)),e.gt=(n,i)=>e.check(ro(n,i)),e.gte=(n,i)=>e.check(Zn(n,i)),e.min=(n,i)=>e.check(Zn(n,i)),e.lt=(n,i)=>e.check(to(n,i)),e.lte=(n,i)=>e.check(Oi(n,i)),e.max=(n,i)=>e.check(Oi(n,i)),e.positive=n=>e.check(ro(BigInt(0),n)),e.negative=n=>e.check(to(BigInt(0),n)),e.nonpositive=n=>e.check(Oi(BigInt(0),n)),e.nonnegative=n=>e.check(Zn(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(rf(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});N$=R("ZodBigIntFormat",(e,t)=>{ZD.init(e,t),Kg.init(e,t)});vM=R("ZodSymbol",(e,t)=>{qD.init(e,t),nt.init(e,t)});yM=R("ZodUndefined",(e,t)=>{FD.init(e,t),nt.init(e,t)});_M=R("ZodNull",(e,t)=>{VD.init(e,t),nt.init(e,t)});bM=R("ZodAny",(e,t)=>{WD.init(e,t),nt.init(e,t)});wM=R("ZodUnknown",(e,t)=>{_g.init(e,t),nt.init(e,t)});xM=R("ZodNever",(e,t)=>{BD.init(e,t),nt.init(e,t)});kM=R("ZodVoid",(e,t)=>{GD.init(e,t),nt.init(e,t)});C$=R("ZodDate",(e,t)=>{KD.init(e,t),nt.init(e,t),e.min=(n,i)=>e.check(Zn(n,i)),e.max=(n,i)=>e.check(Oi(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});SM=R("ZodArray",(e,t)=>{wI.init(e,t),nt.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Ku(r,n)),e.nonempty=r=>e.check(Ku(1,r)),e.max=(r,n)=>e.check(Fg(r,n)),e.length=(r,n)=>e.check(Vg(r,n)),e.unwrap=()=>e.element});Jg=R("ZodObject",(e,t)=>{xI.init(e,t),nt.init(e,t),pt.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>wn(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:nr()}),e.loose=()=>e.clone({...e._zod.def,catchall:nr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hg()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pt.extend(e,r),e.merge=r=>pt.merge(e,r),e.pick=r=>pt.pick(e,r),e.omit=r=>pt.omit(e,r),e.partial=(...r)=>pt.partial(M$,e,r[0]),e.required=(...r)=>pt.required(L$,e,r[0])});j$=R("ZodUnion",(e,t)=>{kI.init(e,t),nt.init(e,t),e.options=t.options});IM=R("ZodDiscriminatedUnion",(e,t)=>{j$.init(e,t),HD.init(e,t)});$M=R("ZodIntersection",(e,t)=>{JD.init(e,t),nt.init(e,t)});EM=R("ZodTuple",(e,t)=>{Zg.init(e,t),nt.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});R$=R("ZodRecord",(e,t)=>{YD.init(e,t),nt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});PM=R("ZodMap",(e,t)=>{QD.init(e,t),nt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});TM=R("ZodSet",(e,t)=>{XD.init(e,t),nt.init(e,t),e.min=(...r)=>e.check(nf(...r)),e.nonempty=r=>e.check(nf(1,r)),e.max=(...r)=>e.check(qg(...r)),e.size=(...r)=>e.check(HI(...r))});sf=R("ZodEnum",(e,t)=>{eU.init(e,t),nt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let a={};for(let s of n)if(r.has(s))a[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new sf({...t,checks:[],...pt.normalizeParams(i),entries:a})},e.exclude=(n,i)=>{let a={...t.entries};for(let s of n)if(r.has(s))delete a[s];else throw Error(`Key ${s} not found in enum`);return new sf({...t,checks:[],...pt.normalizeParams(i),entries:a})}});OM=R("ZodLiteral",(e,t)=>{tU.init(e,t),nt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});NM=R("ZodFile",(e,t)=>{rU.init(e,t),nt.init(e,t),e.min=(r,n)=>e.check(nf(r,n)),e.max=(r,n)=>e.check(qg(r,n)),e.mime=(r,n)=>e.check(r$(Array.isArray(r)?r:[r],n))});D$=R("ZodTransform",(e,t)=>{SI.init(e,t),nt.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=a=>{if(typeof a=="string")r.issues.push(pt.issue(a,r.value,t));else{let s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(pt.issue(s))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});M$=R("ZodOptional",(e,t)=>{nU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});zM=R("ZodNullable",(e,t)=>{iU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});CM=R("ZodDefault",(e,t)=>{aU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});AM=R("ZodPrefault",(e,t)=>{sU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});L$=R("ZodNonOptional",(e,t)=>{oU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});UM=R("ZodSuccess",(e,t)=>{uU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});MM=R("ZodCatch",(e,t)=>{lU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});ZM=R("ZodNaN",(e,t)=>{cU.init(e,t),nt.init(e,t)});Z$=R("ZodPipe",(e,t)=>{II.init(e,t),nt.init(e,t),e.in=t.in,e.out=t.out});qM=R("ZodReadonly",(e,t)=>{dU.init(e,t),nt.init(e,t)});VM=R("ZodTemplateLiteral",(e,t)=>{fU.init(e,t),nt.init(e,t)});WM=R("ZodLazy",(e,t)=>{mU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.getter()});GM=R("ZodPromise",(e,t)=>{pU.init(e,t),nt.init(e,t),e.unwrap=()=>e._zod.def.innerType});Qg=R("ZodCustom",(e,t)=>{hU.init(e,t),nt.init(e,t)});Jee=(...e)=>nM({Pipe:Z$,Boolean:Gg,String:Wg,Transform:D$},...e);Qee={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"};QM={};no(QM,{string:()=>tte,number:()=>rte,date:()=>ate,boolean:()=>nte,bigint:()=>ite});dn(gU());ste="io.modelcontextprotocol/related-task",Xg="2.0",xr=HM(e=>e!==null&&(typeof e=="object"||typeof e=="function")),XM=Vt([V(),Nt().int()]),e2=V(),OEe=un({ttl:Nt().optional(),pollInterval:Nt().optional()}),ote=pe({ttl:Nt().optional()}),ute=pe({taskId:V()}),F$=un({progressToken:XM.optional(),[ste]:ute.optional()}),Wn=pe({_meta:F$.optional()}),ev=Wn.extend({task:ote.optional()}),Or=pe({method:V(),params:Wn.loose().optional()}),ni=pe({_meta:F$.optional()}),ii=pe({method:V(),params:ni.loose().optional()}),Nr=un({_meta:F$.optional()}),tv=Vt([V(),Nt().int()]),lte=pe({jsonrpc:Ie(Xg),id:tv,...Or.shape}).strict(),cte=pe({jsonrpc:Ie(Xg),...ii.shape}).strict(),t2=pe({jsonrpc:Ie(Xg),id:tv,result:Nr}).strict();(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(WA||(WA={}));r2=pe({jsonrpc:Ie(Xg),id:tv.optional(),error:pe({code:Nt().int(),message:V(),data:nr().optional()})}).strict(),NEe=Vt([lte,cte,t2,r2]),zEe=Vt([t2,r2]),n2=Nr.strict(),dte=ni.extend({requestId:tv.optional(),reason:V().optional()}),i2=ii.extend({method:Ie("notifications/cancelled"),params:dte}),fte=pe({src:V(),mimeType:V().optional(),sizes:mt(V()).optional(),theme:wn(["light","dark"]).optional()}),df=pe({icons:mt(fte).optional()}),Hu=pe({name:V(),title:V().optional()}),a2=Hu.extend({...Hu.shape,...df.shape,version:V(),websiteUrl:V().optional(),description:V().optional()}),pte=Yg(pe({applyDefaults:wr().optional()}),Ft(V(),nr())),mte=q$(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Yg(pe({form:pte.optional(),url:xr.optional()}),Ft(V(),nr()).optional())),hte=un({list:xr.optional(),cancel:xr.optional(),requests:un({sampling:un({createMessage:xr.optional()}).optional(),elicitation:un({create:xr.optional()}).optional()}).optional()}),gte=un({list:xr.optional(),cancel:xr.optional(),requests:un({tools:un({call:xr.optional()}).optional()}).optional()}),vte=pe({experimental:Ft(V(),xr).optional(),sampling:pe({context:xr.optional(),tools:xr.optional()}).optional(),elicitation:mte.optional(),roots:pe({listChanged:wr().optional()}).optional(),tasks:hte.optional(),extensions:Ft(V(),xr).optional()}),yte=Wn.extend({protocolVersion:V(),capabilities:vte,clientInfo:a2}),_te=Or.extend({method:Ie("initialize"),params:yte}),bte=pe({experimental:Ft(V(),xr).optional(),logging:xr.optional(),completions:xr.optional(),prompts:pe({listChanged:wr().optional()}).optional(),resources:pe({subscribe:wr().optional(),listChanged:wr().optional()}).optional(),tools:pe({listChanged:wr().optional()}).optional(),tasks:gte.optional(),extensions:Ft(V(),xr).optional()}),wte=Nr.extend({protocolVersion:V(),capabilities:bte,serverInfo:a2,instructions:V().optional()}),xte=ii.extend({method:Ie("notifications/initialized"),params:ni.optional()}),s2=Or.extend({method:Ie("ping"),params:Wn.optional()}),kte=pe({progress:Nt(),total:Yt(Nt()),message:Yt(V())}),Ste=pe({...ni.shape,...kte.shape,progressToken:XM}),o2=ii.extend({method:Ie("notifications/progress"),params:Ste}),Ite=Wn.extend({cursor:e2.optional()}),ff=Or.extend({params:Ite.optional()}),pf=Nr.extend({nextCursor:e2.optional()}),$te=wn(["working","input_required","completed","failed","cancelled"]),mf=pe({taskId:V(),status:$te,ttl:Vt([Nt(),z$()]),createdAt:V(),lastUpdatedAt:V(),pollInterval:Yt(Nt()),statusMessage:Yt(V())}),u2=Nr.extend({task:mf}),Ete=ni.merge(mf),l2=ii.extend({method:Ie("notifications/tasks/status"),params:Ete}),c2=Or.extend({method:Ie("tasks/get"),params:Wn.extend({taskId:V()})}),d2=Nr.merge(mf),f2=Or.extend({method:Ie("tasks/result"),params:Wn.extend({taskId:V()})}),CEe=Nr.loose(),p2=ff.extend({method:Ie("tasks/list")}),m2=pf.extend({tasks:mt(mf)}),h2=Or.extend({method:Ie("tasks/cancel"),params:Wn.extend({taskId:V()})}),jEe=Nr.merge(mf),g2=pe({uri:V(),mimeType:Yt(V()),_meta:Ft(V(),nr()).optional()}),v2=g2.extend({text:V()}),V$=V().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),y2=g2.extend({blob:V$}),hf=wn(["user","assistant"]),rl=pe({audience:mt(hf).optional(),priority:Nt().min(0).max(1).optional(),lastModified:u$.datetime({offset:!0}).optional()}),_2=pe({...Hu.shape,...df.shape,uri:V(),description:Yt(V()),mimeType:Yt(V()),size:Yt(Nt()),annotations:rl.optional(),_meta:Yt(un({}))}),Pte=pe({...Hu.shape,...df.shape,uriTemplate:V(),description:Yt(V()),mimeType:Yt(V()),annotations:rl.optional(),_meta:Yt(un({}))}),Tte=ff.extend({method:Ie("resources/list")}),Ote=pf.extend({resources:mt(_2)}),Nte=ff.extend({method:Ie("resources/templates/list")}),zte=pf.extend({resourceTemplates:mt(Pte)}),W$=Wn.extend({uri:V()}),Cte=W$,jte=Or.extend({method:Ie("resources/read"),params:Cte}),Ate=Nr.extend({contents:mt(Vt([v2,y2]))}),Rte=ii.extend({method:Ie("notifications/resources/list_changed"),params:ni.optional()}),Dte=W$,Ute=Or.extend({method:Ie("resources/subscribe"),params:Dte}),Mte=W$,Lte=Or.extend({method:Ie("resources/unsubscribe"),params:Mte}),Zte=ni.extend({uri:V()}),qte=ii.extend({method:Ie("notifications/resources/updated"),params:Zte}),Fte=pe({name:V(),description:Yt(V()),required:Yt(wr())}),Vte=pe({...Hu.shape,...df.shape,description:Yt(V()),arguments:Yt(mt(Fte)),_meta:Yt(un({}))}),Wte=ff.extend({method:Ie("prompts/list")}),Bte=pf.extend({prompts:mt(Vte)}),Gte=Wn.extend({name:V(),arguments:Ft(V(),V()).optional()}),Kte=Or.extend({method:Ie("prompts/get"),params:Gte}),B$=pe({type:Ie("text"),text:V(),annotations:rl.optional(),_meta:Ft(V(),nr()).optional()}),G$=pe({type:Ie("image"),data:V$,mimeType:V(),annotations:rl.optional(),_meta:Ft(V(),nr()).optional()}),K$=pe({type:Ie("audio"),data:V$,mimeType:V(),annotations:rl.optional(),_meta:Ft(V(),nr()).optional()}),Hte=pe({type:Ie("tool_use"),name:V(),id:V(),input:Ft(V(),nr()),_meta:Ft(V(),nr()).optional()}),Jte=pe({type:Ie("resource"),resource:Vt([v2,y2]),annotations:rl.optional(),_meta:Ft(V(),nr()).optional()}),Yte=_2.extend({type:Ie("resource_link")}),H$=Vt([B$,G$,K$,Yte,Jte]),Qte=pe({role:hf,content:H$}),Xte=Nr.extend({description:V().optional(),messages:mt(Qte)}),ere=ii.extend({method:Ie("notifications/prompts/list_changed"),params:ni.optional()}),tre=pe({title:V().optional(),readOnlyHint:wr().optional(),destructiveHint:wr().optional(),idempotentHint:wr().optional(),openWorldHint:wr().optional()}),rre=pe({taskSupport:wn(["required","optional","forbidden"]).optional()}),b2=pe({...Hu.shape,...df.shape,description:V().optional(),inputSchema:pe({type:Ie("object"),properties:Ft(V(),xr).optional(),required:mt(V()).optional()}).catchall(nr()),outputSchema:pe({type:Ie("object"),properties:Ft(V(),xr).optional(),required:mt(V()).optional()}).catchall(nr()).optional(),annotations:tre.optional(),execution:rre.optional(),_meta:Ft(V(),nr()).optional()}),nre=ff.extend({method:Ie("tools/list")}),ire=pf.extend({tools:mt(b2)}),w2=Nr.extend({content:mt(H$).default([]),structuredContent:Ft(V(),nr()).optional(),isError:wr().optional()}),AEe=w2.or(Nr.extend({toolResult:nr()})),are=ev.extend({name:V(),arguments:Ft(V(),nr()).optional()}),sre=Or.extend({method:Ie("tools/call"),params:are}),ore=ii.extend({method:Ie("notifications/tools/list_changed"),params:ni.optional()}),REe=pe({autoRefresh:wr().default(!0),debounceMs:Nt().int().nonnegative().default(300)}),x2=wn(["debug","info","notice","warning","error","critical","alert","emergency"]),ure=Wn.extend({level:x2}),lre=Or.extend({method:Ie("logging/setLevel"),params:ure}),cre=ni.extend({level:x2,logger:V().optional(),data:nr()}),dre=ii.extend({method:Ie("notifications/message"),params:cre}),fre=pe({name:V().optional()}),pre=pe({hints:mt(fre).optional(),costPriority:Nt().min(0).max(1).optional(),speedPriority:Nt().min(0).max(1).optional(),intelligencePriority:Nt().min(0).max(1).optional()}),mre=pe({mode:wn(["auto","required","none"]).optional()}),hre=pe({type:Ie("tool_result"),toolUseId:V().describe("The unique identifier for the corresponding tool call."),content:mt(H$).default([]),structuredContent:pe({}).loose().optional(),isError:wr().optional(),_meta:Ft(V(),nr()).optional()}),gre=A$("type",[B$,G$,K$]),$g=A$("type",[B$,G$,K$,Hte,hre]),vre=pe({role:hf,content:Vt([$g,mt($g)]),_meta:Ft(V(),nr()).optional()}),yre=ev.extend({messages:mt(vre),modelPreferences:pre.optional(),systemPrompt:V().optional(),includeContext:wn(["none","thisServer","allServers"]).optional(),temperature:Nt().optional(),maxTokens:Nt().int(),stopSequences:mt(V()).optional(),metadata:xr.optional(),tools:mt(b2).optional(),toolChoice:mre.optional()}),_re=Or.extend({method:Ie("sampling/createMessage"),params:yre}),bre=Nr.extend({model:V(),stopReason:Yt(wn(["endTurn","stopSequence","maxTokens"]).or(V())),role:hf,content:gre}),wre=Nr.extend({model:V(),stopReason:Yt(wn(["endTurn","stopSequence","maxTokens","toolUse"]).or(V())),role:hf,content:Vt([$g,mt($g)])}),xre=pe({type:Ie("boolean"),title:V().optional(),description:V().optional(),default:wr().optional()}),kre=pe({type:Ie("string"),title:V().optional(),description:V().optional(),minLength:Nt().optional(),maxLength:Nt().optional(),format:wn(["email","uri","date","date-time"]).optional(),default:V().optional()}),Sre=pe({type:wn(["number","integer"]),title:V().optional(),description:V().optional(),minimum:Nt().optional(),maximum:Nt().optional(),default:Nt().optional()}),Ire=pe({type:Ie("string"),title:V().optional(),description:V().optional(),enum:mt(V()),default:V().optional()}),$re=pe({type:Ie("string"),title:V().optional(),description:V().optional(),oneOf:mt(pe({const:V(),title:V()})),default:V().optional()}),Ere=pe({type:Ie("string"),title:V().optional(),description:V().optional(),enum:mt(V()),enumNames:mt(V()).optional(),default:V().optional()}),Pre=Vt([Ire,$re]),Tre=pe({type:Ie("array"),title:V().optional(),description:V().optional(),minItems:Nt().optional(),maxItems:Nt().optional(),items:pe({type:Ie("string"),enum:mt(V())}),default:mt(V()).optional()}),Ore=pe({type:Ie("array"),title:V().optional(),description:V().optional(),minItems:Nt().optional(),maxItems:Nt().optional(),items:pe({anyOf:mt(pe({const:V(),title:V()}))}),default:mt(V()).optional()}),Nre=Vt([Tre,Ore]),zre=Vt([Ere,Pre,Nre]),Cre=Vt([zre,xre,kre,Sre]),jre=ev.extend({mode:Ie("form").optional(),message:V(),requestedSchema:pe({type:Ie("object"),properties:Ft(V(),Cre),required:mt(V()).optional()})}),Are=ev.extend({mode:Ie("url"),message:V(),elicitationId:V(),url:V().url()}),Rre=Vt([jre,Are]),Dre=Or.extend({method:Ie("elicitation/create"),params:Rre}),Ure=ni.extend({elicitationId:V()}),Mre=ii.extend({method:Ie("notifications/elicitation/complete"),params:Ure}),Lre=Nr.extend({action:wn(["accept","decline","cancel"]),content:q$(e=>e===null?void 0:e,Ft(V(),Vt([V(),Nt(),wr(),mt(V())])).optional())}),Zre=pe({type:Ie("ref/resource"),uri:V()}),qre=pe({type:Ie("ref/prompt"),name:V()}),Fre=Wn.extend({ref:Vt([qre,Zre]),argument:pe({name:V(),value:V()}),context:pe({arguments:Ft(V(),V()).optional()}).optional()}),Vre=Or.extend({method:Ie("completion/complete"),params:Fre}),Wre=Nr.extend({completion:un({values:mt(V()).max(100),total:Yt(Nt().int()),hasMore:Yt(wr())})}),Bre=pe({uri:V().startsWith("file://"),name:V().optional(),_meta:Ft(V(),nr()).optional()}),Gre=Or.extend({method:Ie("roots/list"),params:Wn.optional()}),Kre=Nr.extend({roots:mt(Bre)}),Hre=ii.extend({method:Ie("notifications/roots/list_changed"),params:ni.optional()}),DEe=Vt([s2,_te,Vre,lre,Kte,Wte,Tte,Nte,jte,Ute,Lte,sre,nre,c2,f2,p2,h2]),UEe=Vt([i2,o2,xte,Hre,l2]),MEe=Vt([n2,bre,wre,Lre,Kre,d2,m2,u2]),LEe=Vt([s2,_re,Dre,Gre,c2,f2,p2,h2]),ZEe=Vt([i2,o2,dre,qte,Rte,ore,ere,l2,Mre]),qEe=Vt([n2,wte,Wre,Xte,Bte,Ote,zte,Ate,w2,ire,d2,m2,u2]),FEe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"),VEe=Eg(fR(),1),WEe=Eg(GK(),1);(function(e){e.Completable="McpCompletable"})(BA||(BA={}));BEe=Jre(()=>Eu.object({session_id:Eu.string(),ws_url:Eu.string(),work_dir:Eu.string().optional(),session_key:Eu.string().optional()}));tne=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"])});var gf,E2=z(()=>{Wa();$2();Ja();xi();Uo();Cs();Hi();gf=class extends Jr{constructor(){super("claude","Claude (Anthropic API)",50)}canHandle(t){let r=!!process.env.ANTHROPIC_API_KEY;return r||M.debug("ClaudeAgentStrategy: ANTHROPIC_API_KEY not set"),r}async invoke(t,r={}){let{model:n,workspace:i=process.cwd(),schema:a=null,images:s=[],skills:o=null,sessionPath:u=null,nodeName:l=null,timeout:c,config:d={}}=r,f=n;(!f||f==="auto")&&(M.debug(`Model is '${f||"undefined"}', using default: ${Yr.CLAUDE}`),f=Yr.CLAUDE);let p=p_[f]||f;p_[f]&&f!==p&&M.debug(`Mapped model: ${f} \u2192 ${p}`),M.debug(`Invoking Claude Agent SDK with model: ${p}, skills: ${JSON.stringify(o)}`);let h=process.env.ANTHROPIC_API_KEY,y=h?` | key: ***${h.slice(-4)}`:" | key: not set";console.log(`
204
+ \u25C6 Model: ${p}${y}
205
+ `);let _=(await import("chalk")).default;console.log(`
206
+ ${_.bold("Prompt sent to LLM:")}`),console.log(_.dim("\u2500".repeat(60))),console.log(_.dim(t)),console.log(_.dim("\u2500".repeat(60)));let{allowedTools:m,mcpServers:g}=this._resolveSkills(o,{sessionPath:u,workspace:i,nodeName:l});try{let v={cwd:i,allowedTools:m,permissionMode:"bypassPermissions",model:p,...Object.keys(g).length>0&&{mcpServers:g}};if(a){let U=typeof a.parse=="function"?en(a,{target:"openApi3"}):a;v.outputFormat={type:"json_schema",schema:U},M.debug("Structured output enforced via SDK outputFormat")}M.debug(`Agent SDK options: ${JSON.stringify({cwd:v.cwd,toolCount:m.length,permissionMode:v.permissionMode,model:v.model,hasOutputFormat:!!v.outputFormat})}`);let b="",w=0,x=[];M.debug("Starting Claude Agent SDK query stream");let k;try{k=S2({prompt:t,options:v})}catch(P){throw M.error(`Failed to initialize Claude Agent SDK: ${P.message}`),P}let $=null,T=0,j=3;try{for await(let P of k){if(x.push(P),P.type==="error"||P.error){let B=P.error?.message||P.error||P.message||"Unknown API error";throw new Error(typeof B=="string"?B:JSON.stringify(B))}let U=JSON.stringify(P.message?.content||P.text||"").slice(0,200);if(U===$){if(T++,T>=j){let B=(P.message?.content?.[0]?.text||P.text||"unknown").slice(0,100);throw new Error(`API stuck in loop (${T}x repeated): ${B}`)}}else $=U,T=1;if(P.type==="assistant"||P.constructor?.name==="AssistantMessage"){let B=P.message?.content||P.content||[];for(let C of B)if(C.type==="thinking"&&C.thinking)console.log(`${C.thinking.substring(0,200)}${C.thinking.length>200?"...":""}`);else if(C.type==="text"&&C.text)b+=C.text,C.text.length<500?console.log(`${C.text}`):console.log(`${C.text.substring(0,200)}... (${C.text.length} chars)`);else if(C.type==="tool_use"){w++,C.name.includes("memory")?Ht.stepMemory(`Tool: ${C.name}`):Ht.stepTool(`Tool: ${C.name}`);let H=JSON.stringify(C.input).substring(0,100);console.log(` Input: ${H}${JSON.stringify(C.input).length>100?"...":""}`)}}else if(!(P.type==="user"&&P.tool_use_result)){if(P.type==="result"||P.constructor?.name==="ResultMessage"){let B=P.result||P.text||P.content||b;if(a){if(P.structured_output){M.debug("Using SDK native structured_output");let ne=typeof a.parse=="function"?a.parse(P.structured_output):P.structured_output;return{raw:B,structured:ne}}if(B){let C=this._extractJson(B,a);if(C)return{raw:B,structured:C}}M.warn(`Could not extract structured output \u2014 returning raw text (${(B||"").length} chars)`)}return B||""}}}if(M.warn(`Agent SDK ended without result. Collected ${x.length} messages`),b.length>0)return M.debug("Returning accumulated text from messages"),b;throw new Error("Claude Agent SDK query ended without result")}catch(P){throw M.error(`Error during query stream: ${P.message}`),P}}catch(v){throw M.error("Claude Agent SDK call failed",{error:v.message}),v}}_resolveSkills(t,r){if(t===null)return M.debug("No skills \u2014 pure LLM mode"),{allowedTools:[],mcpServers:{}};if(!Array.isArray(t)||t.length===0)return M.debug("Default IDE skills for code generation"),{allowedTools:["Read","Write","Bash","Grep","Glob"],mcpServers:{}};let n=[],i={};for(let a of t){let s=Ir(a);if(!s){M.warn(`Unknown skill "${a}" \u2014 skipping`);continue}if(s.allowedTools&&n.push(...s.allowedTools),typeof s.resolve=="function"){let o=s.resolve(r);o&&(i[s.serverName]=o,M.debug(`MCP: ${s.serverName} \u2192 ${o.command} ${o.args[0]}`))}}return{allowedTools:n,mcpServers:i}}_extractJson(t,r){let n=[()=>{if(t.includes("===JSON_START===")){let i=t.indexOf("===JSON_START===")+16,a=t.indexOf("===JSON_END===");return t.substring(i,a).trim()}},()=>t.match(/```json\s*\n([\s\S]*?)\n```/)?.[1]?.trim(),()=>{if(!t.startsWith("{"))return t.match(/```\s*\n([\s\S]*?)\n```/)?.[1]?.trim()},()=>t.trim(),()=>{let i=t.indexOf("{"),a=t.lastIndexOf("}");if(i!==-1&&a>i)return t.substring(i,a+1)}];for(let i of n)try{let a=i();if(!a)continue;let s=JSON.parse(a);if(typeof s!="object"||s===null)continue;return typeof r.parse=="function"?r.parse(s):s}catch{}return null}}});var C2={};fa(C2,{Codex:()=>_ne,Thread:()=>Y$});import{promises as J$}from"fs";import ane from"os";import P2 from"path";import{spawn as lne}from"child_process";import rv from"path";import cne from"readline";import{createRequire as N2}from"module";async function sne(e){if(e===void 0)return{cleanup:async()=>{}};if(!one(e))throw new Error("outputSchema must be a plain JSON object");let t=await J$.mkdtemp(P2.join(ane.tmpdir(),"codex-output-schema-")),r=P2.join(t,"schema.json"),n=async()=>{try{await J$.rm(t,{recursive:!0,force:!0})}catch{}};try{return await J$.writeFile(r,JSON.stringify(e),"utf8"),{schemaPath:r,cleanup:n}}catch(i){throw await n(),i}}function one(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function une(e){if(typeof e=="string")return{prompt:e,images:[]};let t=[],r=[];for(let n of e)n.type==="text"?t.push(n.text):n.type==="local_image"&&r.push(n.path);return{prompt:t.join(`
207
+
208
+ `),images:r}}function hne(e){let t=[];return z2(e,"",t),t}function z2(e,t,r){if(!Q$(e))if(t){r.push(`${t}=${vf(e,t)}`);return}else throw new Error("Codex config overrides must be a plain object");let n=Object.entries(e);if(!(!t&&n.length===0)){if(t&&n.length===0){r.push(`${t}={}`);return}for(let[i,a]of n){if(!i)throw new Error("Codex config override keys must be non-empty strings");if(a===void 0)continue;let s=t?`${t}.${i}`:i;Q$(a)?z2(a,s,r):r.push(`${s}=${vf(a,s)}`)}}}function vf(e,t){if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Codex config override at ${t} must be a finite number`);return`${e}`}else{if(typeof e=="boolean")return e?"true":"false";if(Array.isArray(e))return`[${e.map((n,i)=>vf(n,`${t}[${i}]`)).join(", ")}]`;if(Q$(e)){let r=[];for(let[n,i]of Object.entries(e)){if(!n)throw new Error("Codex config override keys must be non-empty strings");i!==void 0&&r.push(`${vne(n)} = ${vf(i,`${t}.${n}`)}`)}return`{${r.join(", ")}}`}else{if(e===null)throw new Error(`Codex config override at ${t} cannot be null`);{let r=typeof e;throw new Error(`Unsupported Codex config override value at ${t}: ${r}`)}}}}function vne(e){return gne.test(e)?e:JSON.stringify(e)}function Q$(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function yne(){let{platform:e,arch:t}=process,r=null;switch(e){case"linux":case"android":switch(t){case"x64":r="x86_64-unknown-linux-musl";break;case"arm64":r="aarch64-unknown-linux-musl";break;default:break}break;case"darwin":switch(t){case"x64":r="x86_64-apple-darwin";break;case"arm64":r="aarch64-apple-darwin";break;default:break}break;case"win32":switch(t){case"x64":r="x86_64-pc-windows-msvc";break;case"arm64":r="aarch64-pc-windows-msvc";break;default:break}break;default:break}if(!r)throw new Error(`Unsupported platform: ${e} (${t})`);let n=fne[r];if(!n)throw new Error(`Unsupported target triple: ${r}`);let i;try{let u=pne.resolve(`${O2}/package.json`),c=N2(u).resolve(`${n}/package.json`);i=rv.join(rv.dirname(c),"vendor")}catch{throw new Error(`Unable to locate Codex CLI binaries. Ensure ${O2} is installed with optional dependencies.`)}let a=rv.join(i,r),s=process.platform==="win32"?"codex.exe":"codex";return rv.join(a,"codex",s)}var Y$,T2,dne,O2,fne,pne,mne,gne,_ne,j2=z(()=>{Y$=class{_exec;_options;_id;_threadOptions;get id(){return this._id}constructor(e,t,r,n=null){this._exec=e,this._options=t,this._id=n,this._threadOptions=r}async runStreamed(e,t={}){return{events:this.runStreamedInternal(e,t)}}async*runStreamedInternal(e,t={}){let{schemaPath:r,cleanup:n}=await sne(t.outputSchema),i=this._threadOptions,{prompt:a,images:s}=une(e),o=this._exec.run({input:a,baseUrl:this._options.baseUrl,apiKey:this._options.apiKey,threadId:this._id,images:s,model:i?.model,sandboxMode:i?.sandboxMode,workingDirectory:i?.workingDirectory,skipGitRepoCheck:i?.skipGitRepoCheck,outputSchemaFile:r,modelReasoningEffort:i?.modelReasoningEffort,signal:t.signal,networkAccessEnabled:i?.networkAccessEnabled,webSearchMode:i?.webSearchMode,webSearchEnabled:i?.webSearchEnabled,approvalPolicy:i?.approvalPolicy,additionalDirectories:i?.additionalDirectories});try{for await(let u of o){let l;try{l=JSON.parse(u)}catch(c){throw new Error(`Failed to parse item: ${u}`,{cause:c})}l.type==="thread.started"&&(this._id=l.thread_id),yield l}}finally{await n()}}async run(e,t={}){let r=this.runStreamedInternal(e,t),n=[],i="",a=null,s=null;for await(let o of r)if(o.type==="item.completed")o.item.type==="agent_message"&&(i=o.item.text),n.push(o.item);else if(o.type==="turn.completed")a=o.usage;else if(o.type==="turn.failed"){s=o.error;break}if(s)throw new Error(s.message);return{items:n,finalResponse:i,usage:a}}};T2="CODEX_INTERNAL_ORIGINATOR_OVERRIDE",dne="codex_sdk_ts",O2="@openai/codex",fne={"x86_64-unknown-linux-musl":"@openai/codex-linux-x64","aarch64-unknown-linux-musl":"@openai/codex-linux-arm64","x86_64-apple-darwin":"@openai/codex-darwin-x64","aarch64-apple-darwin":"@openai/codex-darwin-arm64","x86_64-pc-windows-msvc":"@openai/codex-win32-x64","aarch64-pc-windows-msvc":"@openai/codex-win32-arm64"},pne=N2(import.meta.url),mne=class{executablePath;envOverride;configOverrides;constructor(e=null,t,r){this.executablePath=e||yne(),this.envOverride=t,this.configOverrides=r}async*run(e){let t=["exec","--experimental-json"];if(this.configOverrides)for(let u of hne(this.configOverrides))t.push("--config",u);if(e.baseUrl&&t.push("--config",`openai_base_url=${vf(e.baseUrl,"openai_base_url")}`),e.model&&t.push("--model",e.model),e.sandboxMode&&t.push("--sandbox",e.sandboxMode),e.workingDirectory&&t.push("--cd",e.workingDirectory),e.additionalDirectories?.length)for(let u of e.additionalDirectories)t.push("--add-dir",u);if(e.skipGitRepoCheck&&t.push("--skip-git-repo-check"),e.outputSchemaFile&&t.push("--output-schema",e.outputSchemaFile),e.modelReasoningEffort&&t.push("--config",`model_reasoning_effort="${e.modelReasoningEffort}"`),e.networkAccessEnabled!==void 0&&t.push("--config",`sandbox_workspace_write.network_access=${e.networkAccessEnabled}`),e.webSearchMode?t.push("--config",`web_search="${e.webSearchMode}"`):e.webSearchEnabled===!0?t.push("--config",'web_search="live"'):e.webSearchEnabled===!1&&t.push("--config",'web_search="disabled"'),e.approvalPolicy&&t.push("--config",`approval_policy="${e.approvalPolicy}"`),e.threadId&&t.push("resume",e.threadId),e.images?.length)for(let u of e.images)t.push("--image",u);let r={};if(this.envOverride)Object.assign(r,this.envOverride);else for(let[u,l]of Object.entries(process.env))l!==void 0&&(r[u]=l);r[T2]||(r[T2]=dne),e.apiKey&&(r.CODEX_API_KEY=e.apiKey);let n=lne(this.executablePath,t,{env:r,signal:e.signal}),i=null;if(n.once("error",u=>i=u),!n.stdin)throw n.kill(),new Error("Child process has no stdin");if(n.stdin.write(e.input),n.stdin.end(),!n.stdout)throw n.kill(),new Error("Child process has no stdout");let a=[];n.stderr&&n.stderr.on("data",u=>{a.push(u)});let s=new Promise(u=>{n.once("exit",(l,c)=>{u({code:l,signal:c})})}),o=cne.createInterface({input:n.stdout,crlfDelay:1/0});try{for await(let c of o)yield c;if(i)throw i;let{code:u,signal:l}=await s;if(u!==0||l){let c=Buffer.concat(a),d=l?`signal ${l}`:`code ${u??1}`;throw new Error(`Codex Exec exited with ${d}: ${c.toString("utf8")}`)}}finally{o.close(),n.removeAllListeners();try{n.killed||n.kill()}catch{}}}};gne=/^[A-Za-z0-9_-]+$/;_ne=class{exec;options;constructor(e={}){let{codexPathOverride:t,env:r,config:n}=e;this.exec=new mne(t,r,n),this.options=e}startThread(e={}){return new Y$(this.exec,this.options,e)}resumeThread(e,t={}){return new Y$(this.exec,this.options,t,e)}}});import{execSync as bne}from"node:child_process";var yf,A2=z(()=>{Wa();Ja();xi();Uo();Cs();Hi();yf=class extends Jr{constructor(){super("codex","Codex (OpenAI)",75)}canHandle(t){if(!!!(process.env.OPENAI_API_KEY||process.env.CODEX_API_KEY))return M.debug("CodexAgentStrategy: OPENAI_API_KEY or CODEX_API_KEY not set"),!1;try{return bne("codex --version",{encoding:"utf-8",timeout:5e3,stdio:"pipe"}),!0}catch{return M.warn("[Codex] codex CLI not found. Install: npm install -g @openai/codex"),!1}}async invoke(t,r={}){let{model:n,workspace:i=process.cwd(),schema:a=null,skills:s=null,sessionPath:o=null,nodeName:u=null,timeout:l,config:c={}}=r,{Codex:d}=await Promise.resolve().then(()=>(j2(),C2)),f=n;(!f||f==="auto")&&(M.debug(`Model is '${f||"undefined"}', using default: ${Yr.CODEX}`),f=Yr.CODEX);let p=m_[f]||f;m_[f]&&f!==p&&M.debug(`Mapped model: ${f} \u2192 ${p}`),M.debug(`Invoking Codex SDK with model: ${p}, skills: ${JSON.stringify(s)}`);let h=process.env.CODEX_API_KEY||process.env.OPENAI_API_KEY;h&&!process.env.CODEX_API_KEY&&(process.env.CODEX_API_KEY=h);let y=h?` | key: ***${h.slice(-4)}`:" | key: not set";console.log(`
209
+ \u25C6 Model: ${p}${y}
210
+ `);let _=(await import("chalk")).default;console.log(`
211
+ ${_.bold("Prompt sent to LLM:")}`),console.log(_.dim("\u2500".repeat(60))),console.log(_.dim(t)),console.log(_.dim("\u2500".repeat(60)));let m=this._resolveSkillsToMcp(s,{sessionPath:o,workspace:i,nodeName:u}),g={};Object.keys(m).length>0&&(g.mcp_servers=m,M.debug(`[Codex] MCP servers: ${Object.keys(m).join(", ")}`));let b=new d({...Object.keys(g).length>0&&{config:g}}).startThread({workingDirectory:i,skipGitRepoCheck:!0,approvalPolicy:"never",sandboxMode:"danger-full-access",networkAccessEnabled:!0}),w=a&&typeof a.parse=="function",x={};if(a)try{let k=w?en(a,{target:"openAi"}):a;x.outputSchema=k,M.debug("Structured output via SDK outputSchema")}catch(k){M.warn(`[Codex] Schema conversion failed, will extract from text: ${k.message}`)}try{let{events:k}=await b.runStreamed(t,x),$=0,T="";for await(let j of k){let P=j.type;if(P==="item.completed"){let U=j.item,B=U?.type;if(B==="mcp_tool_call"){$++;let C=`${U.server}/${U.tool}`;if(Ht.stepTool(`Tool: ${C}`),U.arguments){let ne=JSON.stringify(U.arguments),H=ne.length>100?`${ne.substring(0,100)}...`:ne;console.log(` Input: ${H}`)}}else if(B==="tool_call"||B==="function_call"||B==="command_execution"){$++;let C=U.name||U.tool||U.command||"unknown";Ht.stepTool(`Tool: ${C}`)}else B==="agent_message"&&(T=U.text||"",T.length<500?console.log(T):console.log(`${T.substring(0,200)}... (${T.length} chars)`))}else P==="turn.completed"?M.debug(`[Codex] Turn completed. Usage: ${JSON.stringify(j.usage||{})}`):M.debug(`[Codex] Event: ${P} ${JSON.stringify(j).slice(0,300)}`)}if(M.debug(`[Codex] Last agent message (${T.length} chars): ${T.slice(0,500)}`),a){if(!T)throw new Error("Codex agent returned no response");let j=JSON.parse(T),P=w?a.parse(j):j;return M.debug("\u2705 [Codex] Structured output validated"),{raw:T,structured:P}}return T||""}catch(k){let $=k.message||String(k);throw M.error(`\u274C [Codex] SDK call failed: ${$}`),$.includes("exited with code")&&(M.error("\u{1F4A1} [Codex] Verify: codex --version && echo $OPENAI_API_KEY"),M.error("\u{1F4A1} [Codex] If codex is missing: npm install -g @openai/codex")),k}}_resolveSkillsToMcp(t,r={}){if(!Array.isArray(t)||t.length===0)return{};let n={};for(let i of t){let a=Ir(i);if(!a){M.warn(`[Codex] Unknown skill "${i}" \u2014 skipping`);continue}if(typeof a.resolve!="function")continue;let s=a.resolve(r);if(!s)continue;let o=a.serverName||i,u={command:s.command};s.args?.length&&(u.args=s.args),s.env&&Object.keys(s.env).length>0&&(u.env=s.env),n[o]=u,M.debug(`[Codex] MCP: ${o} \u2192 ${s.command} ${(s.args||[]).join(" ")}`)}return n}}});import{execSync as wne,spawn as xne}from"node:child_process";import{existsSync as R2,mkdirSync as D2,readFileSync as U2,rmSync as kne,writeFileSync as M2}from"node:fs";import{join as oo}from"node:path";function Sne(e){if(!e)return null;let t=String(e),r=t.match(/```(?:json)?\s*([\s\S]*?)```/i);if(r?.[1])try{return JSON.parse(r[1].trim())}catch{}let n=t.indexOf("{");if(n<0)return null;let i=0,a=!1,s=!1,o=-1;for(let u=n;u<t.length;u++){let l=t[u];if(a){s?s=!1:l==="\\"?s=!0:l==='"'&&(a=!1);continue}if(l==='"'){a=!0;continue}if(l==="{"){i===0&&(o=u),i+=1;continue}if(l==="}"){if(i===0)continue;if(i-=1,i===0&&o>=0){let c=t.slice(o,u+1);try{return JSON.parse(c)}catch{o=-1}}}}return null}function Ine(e){let t=String(e||"").trim();if(!t)return null;try{return JSON.parse(t)}catch{return Sne(t)}}function $ne(e){try{let t=JSON.parse(e);if(typeof t=="string")return t;if(typeof t?.response=="string")return t.response;if(typeof t?.text=="string")return t.text;if(typeof t?.output=="string")return t.output;if(Array.isArray(t?.candidates)&&t.candidates.length>0){let r=t.candidates[0];if(typeof r?.content=="string")return r.content;if(Array.isArray(r?.content?.parts)){let n=r.content.parts.map(i=>typeof i?.text=="string"?i.text:"").join("");if(n.trim())return n}}}catch{}return e}var _f,L2=z(()=>{Wa();Ja();xi();Cs();Hi();Cb();g_();_f=class extends Jr{constructor(){super("gemini","Gemini (Google)",70)}canHandle(t){if(!!!(process.env.GEMINI_API_KEY||process.env.GOOGLE_API_KEY))return M.debug("GeminiAgentStrategy: GEMINI_API_KEY or GOOGLE_API_KEY not set"),!1;try{return wne("gemini --version",{encoding:"utf-8",timeout:5e3,stdio:"pipe"}),!0}catch{return M.warn("[Gemini] gemini CLI not found. Install: npm install -g @google/gemini-cli"),!1}}async invoke(t,r={}){let{model:n,workspace:i=process.cwd(),schema:a=null,skills:s=null,sessionPath:o=null,nodeName:u=null,timeout:l=600*1e3}=r,c=n;(!c||c==="auto")&&(c=Yr.GEMINI);let d=XO[c]||c,f=String(process.env.GEMINI_API_KEY||"").trim(),p=String(process.env.GOOGLE_API_KEY||"").trim(),h=this._resolveSkillsToMcp(s,{sessionPath:o,workspace:i,nodeName:u}),y=Object.keys(h).length>0,_=t,m=a&&typeof a.parse=="function",g=null;if(a){let U;try{let B=m?en(a,{target:"openAi"}):a;U=JSON.stringify(B,null,2)}catch{U="{}"}if(y){_+=`
212
+
213
+ Write valid JSON that matches this schema:
214
+ ${U}`;let B=`zibby-result-${Date.now()}.json`,C=oo(i,".zibby","tmp");g=oo(C,B),D2(C,{recursive:!0}),_+=ru.generateFileOutputInstructions(a,g)}else _+=`
215
+
216
+ Return ONLY valid JSON (no markdown, no commentary) that matches this schema:
217
+ ${U}`}let v=this._createGeminiConfigDir(i,h),b=["--output-format","json"];d&&d!=="auto"&&b.push("--model",d);let w=Object.keys(h);if(w.length>0){b.push("--approval-mode","yolo");for(let U of w)b.push("--allowed-mcp-server-names",U);M.info(`[Gemini] Enabling MCP servers: ${w.join(", ")}`)}else s&&s.length>0&&M.warn(`[Gemini] Skills requested but no MCP servers configured: ${s.join(", ")}`);b.push("-p",_);let x={...process.env,GEMINI_CLI_HOME:v};f?(x.GEMINI_API_KEY=f,delete x.GOOGLE_API_KEY):p&&(x.GOOGLE_API_KEY=p,delete x.GEMINI_API_KEY),M.debug(`[Gemini] Command: gemini ${b.slice(0,8).join(" ")}... (${b.length} total args)`),M.debug(`[Gemini] Config home: ${v}`),M.debug(`[Gemini] GEMINI_CLI_HOME env: ${x.GEMINI_CLI_HOME}`);let k="",$=null;try{k=await new Promise((B,C)=>{let ne=xne("gemini",b,{cwd:i,env:x,stdio:["ignore","pipe","pipe"]}),H="",Ze="",zt=setTimeout(()=>{try{ne.kill("SIGTERM")}catch{}},l);ne.stdout.on("data",ge=>{H+=ge.toString()}),ne.stderr.on("data",ge=>{Ze+=ge.toString()}),ne.on("error",ge=>{clearTimeout(zt),C(ge)}),ne.on("close",ge=>{if(clearTimeout(zt),ge===0)return B(H.trim());C(new Error(`gemini failed with code ${ge}: ${(Ze||H).trim()}`))})})}catch(U){$=U}finally{try{kne(v,{recursive:!0,force:!0})}catch{}}let T=$ne(k).trim();if(!a){if($)throw $;return T}if(g){let U=R2(g);if(M.info(`[Gemini] Result file: ${U?"present":"missing"} at ${g}`),U)try{let B=U2(g,"utf-8").trim(),C=JSON.parse(B),ne=m?a.parse(C):C;return M.info("[Gemini] Structured output recovered from result file"),{raw:T,structured:ne}}catch(B){M.warn(`[Gemini] Result file parse/validation failed: ${B.message}`)}else $||M.warn("[Gemini] Result file missing; falling back to stream-parsed JSON")}let j=null;if(a){let U=new Lo;U.zodSchema=a,U.processChunk(T),U.flush(),j=U.getResult()}if(M.info(`[Gemini] Raw stdout length: ${k.length} chars`),M.info(`[Gemini] Extracted text length: ${T.length} chars`),M.info(`[Gemini] StreamParser result: ${j?"extracted":"null"}`),j||(T.length<2e3?M.info(`[Gemini] Raw text preview:
218
+ ${T}`):M.info(`[Gemini] Raw text preview (first 1000 chars):
219
+ ${T.slice(0,1e3)}`),j=Ine(T)),!j)throw $||(M.error("[Gemini] Failed to extract valid JSON from output"),M.error("\u{1F4A1} Tip: Set strictMode=true in .zibby.config.js for OpenAI proxy fallback"),new Error("Gemini did not return valid JSON for structured output. Enable strictMode for proxy fallback."));let P=m?a.parse(j):j;return{raw:T,structured:P}}_resolveSkillsToMcp(t,r={}){if(!Array.isArray(t)||t.length===0)return{};let n={};for(let i of t){let a=Ir(i);if(!a||typeof a.resolve!="function")continue;let s=a.resolve(r);if(!s)continue;let o=a.cursorKey||a.serverName||i,u={command:s.command};s.args?.length&&(u.args=s.args),s.env&&Object.keys(s.env).length>0&&(u.env=s.env),s.cwd&&(u.cwd=s.cwd),n[o]=u}return n}_createGeminiConfigDir(t,r){let n=`${Date.now()}-${Math.random().toString(16).slice(2,10)}`,i=oo(t||process.cwd(),".zibby","tmp",`gemini-home-${n}`),a=oo(i,".gemini");D2(a,{recursive:!0});let s=oo(a,"settings.json"),o={},u=oo(process.env.HOME||"",".gemini","settings.json");if(R2(u))try{o=JSON.parse(U2(u,"utf-8"))}catch{o={}}let l={...o,mcpServers:{...o.mcpServers&&typeof o.mcpServers=="object"?o.mcpServers:{},...r||{}}};M2(s,`${JSON.stringify(l,null,2)}
220
+ `,"utf-8");let c=oo(t||process.cwd(),".zibby","tmp","gemini-settings-debug.json");try{M2(c,`${JSON.stringify(l,null,2)}
221
+ `,"utf-8")}catch{}return M.debug(`[Gemini] Created isolated config with ${Object.keys(l.mcpServers||{}).length} MCP servers`),M.debug(`[Gemini] MCP servers: ${JSON.stringify(Object.keys(l.mcpServers||{}),null,2)}`),i}}});var bf,X$=z(()=>{bf=class{formatTools(t){throw new Error("formatTools() must be implemented")}hasToolCalls(t){throw new Error("hasToolCalls() must be implemented")}parseToolCalls(t){throw new Error("parseToolCalls() must be implemented")}getTextContent(t){throw new Error("getTextContent() must be implemented")}buildAssistantMessage(t){throw new Error("buildAssistantMessage() must be implemented")}buildToolResultMessage(t,r){throw new Error("buildToolResultMessage() must be implemented")}injectToolsIntoBody(t,r){throw new Error("injectToolsIntoBody() must be implemented")}}});var nl,Z2=z(()=>{X$();nl=class extends bf{formatTools(t){return t.map(r=>({type:"function",function:{name:r.name,description:r.description,parameters:r.parameters||r.input_schema||{type:"object",properties:{}}}}))}hasToolCalls(t){let r=t.choices?.[0]?.message;return!!(r?.tool_calls&&r.tool_calls.length>0)}parseToolCalls(t){return(t.choices?.[0]?.message?.tool_calls||[]).map(n=>({id:n.id,name:n.function.name,args:JSON.parse(n.function.arguments||"{}")}))}getTextContent(t){return t.choices?.[0]?.message?.content||""}buildAssistantMessage(t){return t.choices?.[0]?.message}buildToolResultMessage(t,r){return{role:"tool",tool_call_id:t,content:typeof r=="string"?r:JSON.stringify(r)}}injectToolsIntoBody(t,r){return r.length>0&&(t.tools=r),t}}});var wf,eE=z(()=>{wf=class{async fetchCompletion(t,r,n={}){throw new Error("fetchCompletion() must be implemented")}async fetchStreamingCompletion(t,r,n={}){throw new Error("fetchStreamingCompletion() must be implemented")}}});function nv(e){return Buffer.byteLength(JSON.stringify(e),"utf8")}function iv(e,t){let r=String(e||"");if(r.length<=t)return r;let n=Math.max(0,t-28);return`${r.slice(0,n)}
222
+
223
+ [truncated for size budget]`}function tE(e,t=0){if(!e||typeof e!="object"||t>8)return e;if(Array.isArray(e))return e.map(n=>tE(n,t+1));let r={};for(let[n,i]of Object.entries(e))n==="description"||n==="title"||n==="examples"||n==="default"||(r[n]=tE(i,t+1));return r}function Ene(e=[]){return e.map(t=>({...t,function:{...t.function,description:iv(t.function?.description||"",180),parameters:tE(t.function?.parameters||{type:"object",properties:{}})}}))}function q2(e){let t=new Set;for(let i of e)if(i.role==="assistant"&&Array.isArray(i.tool_calls))for(let a of i.tool_calls)t.add(a.id);let r=e.filter(i=>i.role==="tool"?t.has(i.tool_call_id):!0),n=new Set;for(let i of r)i.role==="tool"&&n.add(i.tool_call_id);return r.map(i=>{if(i.role!=="assistant"||!Array.isArray(i.tool_calls)||i.tool_calls.every(u=>n.has(u.id)))return i;let{tool_calls:s,...o}=i;return{...o,content:o.content||""}})}function rE(e,t={}){let r=t.maxBytes||49e3,n=t.systemMaxChars||12e3,i={...e,messages:Array.isArray(e.messages)?[...e.messages]:[],tools:Array.isArray(e.tools)?Ene(e.tools):e.tools};i.messages.length>0&&i.messages[0]?.role==="system"&&(i.messages[0]={...i.messages[0],content:iv(i.messages[0].content,n)});let a=!1;for(;nv(i)>r&&i.messages.length>2;)i.messages.splice(1,1),a=!0;if(a&&(i.messages=q2(i.messages)),nv(i)>r&&i.messages.length>0&&(i.messages[0]={...i.messages[0],content:iv(i.messages[0].content,6e3)},a=!0),nv(i)>r){let s=i.messages.find(u=>u.role==="system")||i.messages[0],o=i.messages.slice(-2);i.messages=q2([s,...o].filter(Boolean).map((u,l)=>({...u,content:iv(u.content,l===0?4e3:8e3)}))),a=!0}return{body:i,meta:{bytes:nv(i),trimmed:a,maxBytes:r,messageCount:i.messages.length}}}var F2=z(()=>{});var V2,il,W2=z(()=>{eE();F2();V2=e=>Buffer.byteLength(JSON.stringify(e),"utf8"),il=class extends wf{async fetchCompletion(t,r,n={}){let i=V2(t),{body:a,meta:s}=rE(t,n.payloadCompaction);n.onBudget?.({streaming:!1,beforeBytes:i,meta:s});let o=this.#e(n),u=`${r.baseUrl}${n.chatCompletionsPath||"/v1/chat/completions"}`,l=await fetch(u,{method:"POST",headers:r.headers,body:JSON.stringify(a),signal:o});if(!l.ok){let c=await l.text();throw l.status===401||l.status===403?new Error("Session expired. Run `zibby login` to re-authenticate."):new Error(`Proxy error ${l.status}: ${c}`)}return l.json()}async fetchStreamingCompletion(t,r,n={}){let i={...t,stream:!0},a=V2(i),{body:s,meta:o}=rE(i,n.payloadCompaction);n.onBudget?.({streaming:!0,beforeBytes:a,meta:o});let u=this.#e(n),l=`${r.baseUrl}${n.chatCompletionsPath||"/v1/chat/completions"}`,c=await fetch(l,{method:"POST",headers:r.headers,body:JSON.stringify(s),signal:u});if(!c.ok){let _=await c.text();throw c.status===401||c.status===403?new Error("Session expired. Run `zibby login` to re-authenticate."):new Error(`Proxy error ${c.status}: ${_}`)}let d=c.body.getReader(),f=new TextDecoder,p="",h="",y=new Map;for(;;){let{done:_,value:m}=await d.read();if(_)break;p+=f.decode(m,{stream:!0});let g=p.split(`
224
+ `);p=g.pop();for(let v of g){if(!v.startsWith("data: "))continue;let b=v.slice(6).trim();if(b==="[DONE]")continue;let w;try{w=JSON.parse(b)}catch{continue}let x=w.choices?.[0]?.delta;if(x&&(x.content&&(h+=x.content,n.onToken&&n.onToken(x.content)),x.tool_calls))for(let k of x.tool_calls){let $=k.index??0;y.has($)||y.set($,{id:"",name:"",args:""});let T=y.get($);k.id&&(T.id=k.id),k.function?.name&&(T.name=k.function.name),k.function?.arguments!=null&&(T.args+=k.function.arguments)}}}if(y.size>0){let _=[...y.entries()].sort(([m],[g])=>m-g).map(([,m])=>({id:m.id,type:"function",function:{name:m.name,arguments:m.args}}));return{choices:[{message:{role:"assistant",content:h||null,tool_calls:_}}]}}return{choices:[{message:{role:"assistant",content:h}}]}}#e(t={}){let r=[t.signal,t.timeout?AbortSignal.timeout(t.timeout):null].filter(Boolean);return r.length>1?AbortSignal.any(r):r[0]||void 0}}});var B2=z(()=>{X$();Z2();eE();W2()});var nE=z(()=>{cr()});var av=z(()=>{cr();ke();nE()});var K2=z(()=>{cr()});var iE=z(()=>{cr();av()});var H2=z(()=>{cr();av()});var aE=z(()=>{cr();nE();av();K2();cr();gu();Em();iE();iE();H2()});var sE=z(()=>{aE();aE()});function al(e){return!!e._zod}function Ai(e,t){return al(e)?ou(e,t):e.safeParse(t)}function sv(e){if(!e)return;let t;if(al(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Y2(e){if(al(e)){let a=e._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var ov=z(()=>{_c();sE()});var oE=z(()=>{dd();dd()});var Q2=z(()=>{oE();oE()});var lE,X2,ps,lv,kr,e6,t6,I1e,Cne,jne,cE,Bn,xf,r6,zr,ai,si,Cr,cv,n6,dE,i6,a6,fE,kf,De,pE,s6,o6,$1e,uo,Ane,dv,Rne,Sf,sl,u6,Dne,Une,Mne,Lne,Zne,qne,Fne,Vne,mE,Wne,fv,Bne,Gne,pv,Kne,If,$f,Hne,Ef,lo,Jne,Pf,mv,hv,gv,E1e,vv,yv,_v,l6,c6,d6,hE,f6,Tf,ol,p6,Yne,Qne,gE,Xne,vE,yE,eie,tie,_E,bE,rie,nie,iie,aie,sie,oie,uie,lie,cie,wE,die,fie,xE,kE,SE,pie,mie,hie,IE,gie,$E,EE,vie,yie,m6,_ie,PE,ul,P1e,bie,wie,TE,h6,g6,xie,kie,Sie,Iie,$ie,Eie,Pie,Tie,Oie,uv,Nie,zie,OE,NE,zE,Cie,jie,Aie,Rie,Die,Uie,Mie,Lie,Zie,qie,Fie,Vie,Wie,Bie,Gie,CE,Kie,Hie,jE,Jie,Yie,Qie,Xie,AE,eae,tae,rae,nae,T1e,O1e,N1e,z1e,C1e,j1e,Pe,uE,Of=z(()=>{Q2();lE="2025-11-25",X2=[lE,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ps="io.modelcontextprotocol/related-task",lv="2.0",kr=Fk(e=>e!==null&&(typeof e=="object"||typeof e=="function")),e6=qt([F(),Ot().int()]),t6=F(),I1e=Mr({ttl:Ot().optional(),pollInterval:Ot().optional()}),Cne=de({ttl:Ot().optional()}),jne=de({taskId:F()}),cE=Mr({progressToken:e6.optional(),[ps]:jne.optional()}),Bn=de({_meta:cE.optional()}),xf=Bn.extend({task:Cne.optional()}),r6=e=>xf.safeParse(e).success,zr=de({method:F(),params:Bn.loose().optional()}),ai=de({_meta:cE.optional()}),si=de({method:F(),params:ai.loose().optional()}),Cr=Mr({_meta:cE.optional()}),cv=qt([F(),Ot().int()]),n6=de({jsonrpc:Se(lv),id:cv,...zr.shape}).strict(),dE=e=>n6.safeParse(e).success,i6=de({jsonrpc:Se(lv),...si.shape}).strict(),a6=e=>i6.safeParse(e).success,fE=de({jsonrpc:Se(lv),id:cv,result:Cr}).strict(),kf=e=>fE.safeParse(e).success;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(De||(De={}));pE=de({jsonrpc:Se(lv),id:cv.optional(),error:de({code:Ot().int(),message:F(),data:Zt().optional()})}).strict(),s6=e=>pE.safeParse(e).success,o6=qt([n6,i6,fE,pE]),$1e=qt([fE,pE]),uo=Cr.strict(),Ane=ai.extend({requestId:cv.optional(),reason:F().optional()}),dv=si.extend({method:Se("notifications/cancelled"),params:Ane}),Rne=de({src:F(),mimeType:F().optional(),sizes:st(F()).optional(),theme:Lr(["light","dark"]).optional()}),Sf=de({icons:st(Rne).optional()}),sl=de({name:F(),title:F().optional()}),u6=sl.extend({...sl.shape,...Sf.shape,version:F(),websiteUrl:F().optional(),description:F().optional()}),Dne=cd(de({applyDefaults:hr().optional()}),Rt(F(),Zt())),Une=ph(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,cd(de({form:Dne.optional(),url:kr.optional()}),Rt(F(),Zt()).optional())),Mne=Mr({list:kr.optional(),cancel:kr.optional(),requests:Mr({sampling:Mr({createMessage:kr.optional()}).optional(),elicitation:Mr({create:kr.optional()}).optional()}).optional()}),Lne=Mr({list:kr.optional(),cancel:kr.optional(),requests:Mr({tools:Mr({call:kr.optional()}).optional()}).optional()}),Zne=de({experimental:Rt(F(),kr).optional(),sampling:de({context:kr.optional(),tools:kr.optional()}).optional(),elicitation:Une.optional(),roots:de({listChanged:hr().optional()}).optional(),tasks:Mne.optional(),extensions:Rt(F(),kr).optional()}),qne=Bn.extend({protocolVersion:F(),capabilities:Zne,clientInfo:u6}),Fne=zr.extend({method:Se("initialize"),params:qne}),Vne=de({experimental:Rt(F(),kr).optional(),logging:kr.optional(),completions:kr.optional(),prompts:de({listChanged:hr().optional()}).optional(),resources:de({subscribe:hr().optional(),listChanged:hr().optional()}).optional(),tools:de({listChanged:hr().optional()}).optional(),tasks:Lne.optional(),extensions:Rt(F(),kr).optional()}),mE=Cr.extend({protocolVersion:F(),capabilities:Vne,serverInfo:u6,instructions:F().optional()}),Wne=si.extend({method:Se("notifications/initialized"),params:ai.optional()}),fv=zr.extend({method:Se("ping"),params:Bn.optional()}),Bne=de({progress:Ot(),total:Gt(Ot()),message:Gt(F())}),Gne=de({...ai.shape,...Bne.shape,progressToken:e6}),pv=si.extend({method:Se("notifications/progress"),params:Gne}),Kne=Bn.extend({cursor:t6.optional()}),If=zr.extend({params:Kne.optional()}),$f=Cr.extend({nextCursor:t6.optional()}),Hne=Lr(["working","input_required","completed","failed","cancelled"]),Ef=de({taskId:F(),status:Hne,ttl:qt([Ot(),oh()]),createdAt:F(),lastUpdatedAt:F(),pollInterval:Gt(Ot()),statusMessage:Gt(F())}),lo=Cr.extend({task:Ef}),Jne=ai.merge(Ef),Pf=si.extend({method:Se("notifications/tasks/status"),params:Jne}),mv=zr.extend({method:Se("tasks/get"),params:Bn.extend({taskId:F()})}),hv=Cr.merge(Ef),gv=zr.extend({method:Se("tasks/result"),params:Bn.extend({taskId:F()})}),E1e=Cr.loose(),vv=If.extend({method:Se("tasks/list")}),yv=$f.extend({tasks:st(Ef)}),_v=zr.extend({method:Se("tasks/cancel"),params:Bn.extend({taskId:F()})}),l6=Cr.merge(Ef),c6=de({uri:F(),mimeType:Gt(F()),_meta:Rt(F(),Zt()).optional()}),d6=c6.extend({text:F()}),hE=F().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),f6=c6.extend({blob:hE}),Tf=Lr(["user","assistant"]),ol=de({audience:st(Tf).optional(),priority:Ot().min(0).max(1).optional(),lastModified:qs.datetime({offset:!0}).optional()}),p6=de({...sl.shape,...Sf.shape,uri:F(),description:Gt(F()),mimeType:Gt(F()),size:Gt(Ot()),annotations:ol.optional(),_meta:Gt(Mr({}))}),Yne=de({...sl.shape,...Sf.shape,uriTemplate:F(),description:Gt(F()),mimeType:Gt(F()),annotations:ol.optional(),_meta:Gt(Mr({}))}),Qne=If.extend({method:Se("resources/list")}),gE=$f.extend({resources:st(p6)}),Xne=If.extend({method:Se("resources/templates/list")}),vE=$f.extend({resourceTemplates:st(Yne)}),yE=Bn.extend({uri:F()}),eie=yE,tie=zr.extend({method:Se("resources/read"),params:eie}),_E=Cr.extend({contents:st(qt([d6,f6]))}),bE=si.extend({method:Se("notifications/resources/list_changed"),params:ai.optional()}),rie=yE,nie=zr.extend({method:Se("resources/subscribe"),params:rie}),iie=yE,aie=zr.extend({method:Se("resources/unsubscribe"),params:iie}),sie=ai.extend({uri:F()}),oie=si.extend({method:Se("notifications/resources/updated"),params:sie}),uie=de({name:F(),description:Gt(F()),required:Gt(hr())}),lie=de({...sl.shape,...Sf.shape,description:Gt(F()),arguments:Gt(st(uie)),_meta:Gt(Mr({}))}),cie=If.extend({method:Se("prompts/list")}),wE=$f.extend({prompts:st(lie)}),die=Bn.extend({name:F(),arguments:Rt(F(),F()).optional()}),fie=zr.extend({method:Se("prompts/get"),params:die}),xE=de({type:Se("text"),text:F(),annotations:ol.optional(),_meta:Rt(F(),Zt()).optional()}),kE=de({type:Se("image"),data:hE,mimeType:F(),annotations:ol.optional(),_meta:Rt(F(),Zt()).optional()}),SE=de({type:Se("audio"),data:hE,mimeType:F(),annotations:ol.optional(),_meta:Rt(F(),Zt()).optional()}),pie=de({type:Se("tool_use"),name:F(),id:F(),input:Rt(F(),Zt()),_meta:Rt(F(),Zt()).optional()}),mie=de({type:Se("resource"),resource:qt([d6,f6]),annotations:ol.optional(),_meta:Rt(F(),Zt()).optional()}),hie=p6.extend({type:Se("resource_link")}),IE=qt([xE,kE,SE,hie,mie]),gie=de({role:Tf,content:IE}),$E=Cr.extend({description:F().optional(),messages:st(gie)}),EE=si.extend({method:Se("notifications/prompts/list_changed"),params:ai.optional()}),vie=de({title:F().optional(),readOnlyHint:hr().optional(),destructiveHint:hr().optional(),idempotentHint:hr().optional(),openWorldHint:hr().optional()}),yie=de({taskSupport:Lr(["required","optional","forbidden"]).optional()}),m6=de({...sl.shape,...Sf.shape,description:F().optional(),inputSchema:de({type:Se("object"),properties:Rt(F(),kr).optional(),required:st(F()).optional()}).catchall(Zt()),outputSchema:de({type:Se("object"),properties:Rt(F(),kr).optional(),required:st(F()).optional()}).catchall(Zt()).optional(),annotations:vie.optional(),execution:yie.optional(),_meta:Rt(F(),Zt()).optional()}),_ie=If.extend({method:Se("tools/list")}),PE=$f.extend({tools:st(m6)}),ul=Cr.extend({content:st(IE).default([]),structuredContent:Rt(F(),Zt()).optional(),isError:hr().optional()}),P1e=ul.or(Cr.extend({toolResult:Zt()})),bie=xf.extend({name:F(),arguments:Rt(F(),Zt()).optional()}),wie=zr.extend({method:Se("tools/call"),params:bie}),TE=si.extend({method:Se("notifications/tools/list_changed"),params:ai.optional()}),h6=de({autoRefresh:hr().default(!0),debounceMs:Ot().int().nonnegative().default(300)}),g6=Lr(["debug","info","notice","warning","error","critical","alert","emergency"]),xie=Bn.extend({level:g6}),kie=zr.extend({method:Se("logging/setLevel"),params:xie}),Sie=ai.extend({level:g6,logger:F().optional(),data:Zt()}),Iie=si.extend({method:Se("notifications/message"),params:Sie}),$ie=de({name:F().optional()}),Eie=de({hints:st($ie).optional(),costPriority:Ot().min(0).max(1).optional(),speedPriority:Ot().min(0).max(1).optional(),intelligencePriority:Ot().min(0).max(1).optional()}),Pie=de({mode:Lr(["auto","required","none"]).optional()}),Tie=de({type:Se("tool_result"),toolUseId:F().describe("The unique identifier for the corresponding tool call."),content:st(IE).default([]),structuredContent:de({}).loose().optional(),isError:hr().optional(),_meta:Rt(F(),Zt()).optional()}),Oie=ch("type",[xE,kE,SE]),uv=ch("type",[xE,kE,SE,pie,Tie]),Nie=de({role:Tf,content:qt([uv,st(uv)]),_meta:Rt(F(),Zt()).optional()}),zie=xf.extend({messages:st(Nie),modelPreferences:Eie.optional(),systemPrompt:F().optional(),includeContext:Lr(["none","thisServer","allServers"]).optional(),temperature:Ot().optional(),maxTokens:Ot().int(),stopSequences:st(F()).optional(),metadata:kr.optional(),tools:st(m6).optional(),toolChoice:Pie.optional()}),OE=zr.extend({method:Se("sampling/createMessage"),params:zie}),NE=Cr.extend({model:F(),stopReason:Gt(Lr(["endTurn","stopSequence","maxTokens"]).or(F())),role:Tf,content:Oie}),zE=Cr.extend({model:F(),stopReason:Gt(Lr(["endTurn","stopSequence","maxTokens","toolUse"]).or(F())),role:Tf,content:qt([uv,st(uv)])}),Cie=de({type:Se("boolean"),title:F().optional(),description:F().optional(),default:hr().optional()}),jie=de({type:Se("string"),title:F().optional(),description:F().optional(),minLength:Ot().optional(),maxLength:Ot().optional(),format:Lr(["email","uri","date","date-time"]).optional(),default:F().optional()}),Aie=de({type:Lr(["number","integer"]),title:F().optional(),description:F().optional(),minimum:Ot().optional(),maximum:Ot().optional(),default:Ot().optional()}),Rie=de({type:Se("string"),title:F().optional(),description:F().optional(),enum:st(F()),default:F().optional()}),Die=de({type:Se("string"),title:F().optional(),description:F().optional(),oneOf:st(de({const:F(),title:F()})),default:F().optional()}),Uie=de({type:Se("string"),title:F().optional(),description:F().optional(),enum:st(F()),enumNames:st(F()).optional(),default:F().optional()}),Mie=qt([Rie,Die]),Lie=de({type:Se("array"),title:F().optional(),description:F().optional(),minItems:Ot().optional(),maxItems:Ot().optional(),items:de({type:Se("string"),enum:st(F())}),default:st(F()).optional()}),Zie=de({type:Se("array"),title:F().optional(),description:F().optional(),minItems:Ot().optional(),maxItems:Ot().optional(),items:de({anyOf:st(de({const:F(),title:F()}))}),default:st(F()).optional()}),qie=qt([Lie,Zie]),Fie=qt([Uie,Mie,qie]),Vie=qt([Fie,Cie,jie,Aie]),Wie=xf.extend({mode:Se("form").optional(),message:F(),requestedSchema:de({type:Se("object"),properties:Rt(F(),Vie),required:st(F()).optional()})}),Bie=xf.extend({mode:Se("url"),message:F(),elicitationId:F(),url:F().url()}),Gie=qt([Wie,Bie]),CE=zr.extend({method:Se("elicitation/create"),params:Gie}),Kie=ai.extend({elicitationId:F()}),Hie=si.extend({method:Se("notifications/elicitation/complete"),params:Kie}),jE=Cr.extend({action:Lr(["accept","decline","cancel"]),content:ph(e=>e===null?void 0:e,Rt(F(),qt([F(),Ot(),hr(),st(F())])).optional())}),Jie=de({type:Se("ref/resource"),uri:F()}),Yie=de({type:Se("ref/prompt"),name:F()}),Qie=Bn.extend({ref:qt([Yie,Jie]),argument:de({name:F(),value:F()}),context:de({arguments:Rt(F(),F()).optional()}).optional()}),Xie=zr.extend({method:Se("completion/complete"),params:Qie}),AE=Cr.extend({completion:Mr({values:st(F()).max(100),total:Gt(Ot().int()),hasMore:Gt(hr())})}),eae=de({uri:F().startsWith("file://"),name:F().optional(),_meta:Rt(F(),Zt()).optional()}),tae=zr.extend({method:Se("roots/list"),params:Bn.optional()}),rae=Cr.extend({roots:st(eae)}),nae=si.extend({method:Se("notifications/roots/list_changed"),params:ai.optional()}),T1e=qt([fv,Fne,Xie,kie,fie,cie,Qne,Xne,tie,nie,aie,wie,_ie,mv,gv,vv,_v]),O1e=qt([dv,pv,Wne,nae,Pf]),N1e=qt([uo,NE,zE,jE,rae,hv,yv,lo]),z1e=qt([fv,OE,CE,tae,mv,gv,vv,_v]),C1e=qt([dv,pv,Iie,oie,bE,TE,EE,Pf,Hie]),j1e=qt([uo,mE,AE,$E,wE,gE,vE,_E,ul,PE,hv,yv,lo]),Pe=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===De.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new uE(i.elicitations,r)}return new e(t,r,n)}},uE=class extends Pe{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(De.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}});function ms(e){return e==="completed"||e==="failed"||e==="cancelled"}var v6=z(()=>{});function RE(e){let r=sv(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Y2(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function DE(e,t){let r=Ai(e,t);if(!r.success)throw r.error;return r.data}var y6=z(()=>{sE();ov();Ja()});function _6(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function b6(e,t){let r={...e};for(let n in t){let i=n,a=t[i];if(a===void 0)continue;let s=r[i];_6(s)&&_6(a)?r[i]={...s,...a}:r[i]=a}return r}var iae,bv,w6=z(()=>{ov();Of();v6();y6();iae=6e4,bv=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(dv,r=>{this._oncancel(r)}),this.setNotificationHandler(pv,r=>{this._onprogress(r)}),this.setRequestHandler(fv,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(mv,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Pe(De.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(gv,async(r,n)=>{let i=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let o;for(;o=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(o.type==="response"||o.type==="error"){let u=o.message,l=u.id,c=this._requestResolvers.get(l);if(c)if(this._requestResolvers.delete(l),o.type==="response")c(u);else{let d=u,f=new Pe(d.error.code,d.error.message,d.error.data);c(f)}else{let d=o.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(o.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(a,n.sessionId);if(!s)throw new Pe(De.InvalidParams,`Task not found: ${a}`);if(!ms(s.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(ms(s.status)){let o=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...o,_meta:{...o._meta,[ps]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(vv,async(r,n)=>{try{let{tasks:i,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:a,_meta:{}}}catch(i){throw new Pe(De.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(_v,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Pe(De.InvalidParams,`Task not found: ${r.params.taskId}`);if(ms(i.status))throw new Pe(De.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new Pe(De.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof Pe?i:new Pe(De.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,i,a=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),Pe.fromError(De.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let i=this._transport?.onmessage;this._transport.onmessage=(a,s)=>{i?.(a,s),kf(a)||s6(a)?this._onresponse(a):dE(a)?this._onrequest(a,s):a6(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Pe.fromError(De.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,i=this._transport,a=t.params?._meta?.[ps]?.taskId;if(n===void 0){let c={jsonrpc:"2.0",id:t.id,error:{code:De.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:c,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(c).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);let o=r6(t.params)?t.params.task:void 0,u=this._taskStore?this.requestTaskStore(t,i?.sessionId):void 0,l={signal:s.signal,sessionId:i?.sessionId,_meta:t.params?._meta,sendNotification:async c=>{if(s.signal.aborted)return;let d={relatedRequestId:t.id};a&&(d.relatedTask={taskId:a}),await this.notification(c,d)},sendRequest:async(c,d,f)=>{if(s.signal.aborted)throw new Pe(De.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:t.id};a&&!p.relatedTask&&(p.relatedTask={taskId:a});let h=p.relatedTask?.taskId??a;return h&&u&&await u.updateTaskStatus(h,"input_required"),await this.request(c,d,p)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:a,taskStore:u,taskRequestedTtl:o?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,l)).then(async c=>{if(s.signal.aborted)return;let d={result:c,jsonrpc:"2.0",id:t.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async c=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(c.code)?c.code:De.InternalError,message:c.message??"Internal error",...c.data!==void 0&&{data:c.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(c=>this._onerror(new Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===s&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(i),o=this._timeoutInfo.get(i);if(o&&s&&o.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(u){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(u);return}a(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),kf(t))n(t);else{let s=new Pe(t.error.code,t.error.message,t.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(kf(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let o=s.task;typeof o.taskId=="string"&&(a=!0,this._taskProgressTokens.set(o.taskId,r))}}if(a||this._progressHandlers.delete(r),kf(t))i(t);else{let s=Pe.fromError(t.error.code,t.error.message,t.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof Pe?s:new Pe(De.InternalError,String(s))}}return}let a;try{let s=await this.request(t,lo,n);if(s.task)a=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new Pe(De.InternalError,"Task creation did not return a task");for(;;){let o=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:o},ms(o.status)){o.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:o.status==="failed"?yield{type:"error",error:new Pe(De.InternalError,`Task ${a} failed`)}:o.status==="cancelled"&&(yield{type:"error",error:new Pe(De.InternalError,`Task ${a} was cancelled`)});return}if(o.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let u=o.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,u)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof Pe?s:new Pe(De.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s,task:o,relatedTask:u}=n??{};return new Promise((l,c)=>{let d=g=>{c(g)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),o&&this.assertTaskCapability(t.method)}catch(g){d(g);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),o&&(p.params={...p.params,task:o}),u&&(p.params={...p.params,_meta:{...p.params?._meta||{},[ps]:u}});let h=g=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(g)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s}).catch(b=>this._onerror(new Error(`Failed to send cancellation: ${b}`)));let v=g instanceof Pe?g:new Pe(De.RequestTimeout,String(g));c(v)};this._responseHandlers.set(f,g=>{if(!n?.signal?.aborted){if(g instanceof Error)return c(g);try{let v=Ai(r,g.result);v.success?l(v.data):c(v.error)}catch(v){c(v)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let y=n?.timeout??iae,_=()=>h(Pe.fromError(De.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let m=u?.taskId;if(m){let g=v=>{let b=this._responseHandlers.get(f);b?b(v):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,g),this._enqueueTaskMessage(m,{type:"request",message:p,timestamp:Date.now()}).catch(v=>{this._cleanupTimeout(f),c(v)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:s}).catch(g=>{this._cleanupTimeout(f),c(g)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},hv,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},yv,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},l6,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let o={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[ps]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:o,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let o={...t,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[ps]:r.relatedTask}}}),this._transport?.send(o,r).catch(u=>this._onerror(u))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[ps]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=RE(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let s=DE(t,i);return Promise.resolve(r(s,a))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=RE(t);this._notificationHandlers.set(n,i=>{let a=DE(t,i);return Promise.resolve(r(a))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,i)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let i of n)if(i.type==="request"&&dE(i.message)){let a=i.message.id,s=this._requestResolvers.get(a);s?(s(new Pe(De.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(t);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,a)=>{if(r.aborted){a(new Pe(De.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),a(new Pe(De.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!t)throw new Error("No request provided");return await n.createTask(i,t.id,{method:t.method,params:t.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new Pe(De.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,s)=>{await n.storeTaskResult(i,a,s,r);let o=await n.getTask(i,r);if(o){let u=Pf.parse({method:"notifications/tasks/status",params:o});await this.notification(u),ms(o.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,s)=>{let o=await n.getTask(i,r);if(!o)throw new Pe(De.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(ms(o.status))throw new Pe(De.InvalidParams,`Cannot update task "${i}" from terminal status "${o.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,s,r);let u=await n.getTask(i,r);if(u){let l=Pf.parse({method:"notifications/tasks/status",params:u});await this.notification(l),ms(u.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var Cf=q(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.regexpCode=Et.getEsmExportName=Et.getProperty=Et.safeStringify=Et.stringify=Et.strConcat=Et.addCodeArg=Et.str=Et._=Et.nil=Et._Code=Et.Name=Et.IDENTIFIER=Et._CodeOrName=void 0;var Nf=class{};Et._CodeOrName=Nf;Et.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var co=class extends Nf{constructor(t){if(super(),!Et.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Et.Name=co;var oi=class extends Nf{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof co&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Et._Code=oi;Et.nil=new oi("");function x6(e,...t){let r=[e[0]],n=0;for(;n<t.length;)ME(r,t[n]),r.push(e[++n]);return new oi(r)}Et._=x6;var UE=new oi("+");function k6(e,...t){let r=[zf(e[0])],n=0;for(;n<t.length;)r.push(UE),ME(r,t[n]),r.push(UE,zf(e[++n]));return aae(r),new oi(r)}Et.str=k6;function ME(e,t){t instanceof oi?e.push(...t._items):t instanceof co?e.push(t):e.push(uae(t))}Et.addCodeArg=ME;function aae(e){let t=1;for(;t<e.length-1;){if(e[t]===UE){let r=sae(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function sae(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof co||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof co))return`"${e}${t.slice(1)}`}function oae(e,t){return t.emptyStr()?e:e.emptyStr()?t:k6`${e}${t}`}Et.strConcat=oae;function uae(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:zf(Array.isArray(e)?e.join(","):e)}function lae(e){return new oi(zf(e))}Et.stringify=lae;function zf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Et.safeStringify=zf;function cae(e){return typeof e=="string"&&Et.IDENTIFIER.test(e)?new oi(`.${e}`):x6`[${e}]`}Et.getProperty=cae;function dae(e){if(typeof e=="string"&&Et.IDENTIFIER.test(e))return new oi(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Et.getEsmExportName=dae;function fae(e){return new oi(e.toString())}Et.regexpCode=fae});var qE=q(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ValueScope=kn.ValueScopeName=kn.Scope=kn.varKinds=kn.UsedValueState=void 0;var xn=Cf(),LE=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},wv;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(wv||(kn.UsedValueState=wv={}));kn.varKinds={const:new xn.Name("const"),let:new xn.Name("let"),var:new xn.Name("var")};var xv=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof xn.Name?t:this.name(t)}name(t){return new xn.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};kn.Scope=xv;var kv=class extends xn.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,xn._)`.${new xn.Name(r)}[${n}]`}};kn.ValueScopeName=kv;var pae=(0,xn._)`\n`,ZE=class extends xv{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?pae:xn.nil}}get(){return this._scope}name(t){return new kv(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:a}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,o=this._values[a];if(o){let c=o.get(s);if(c)return c}else o=this._values[a]=new Map;o.set(s,i);let u=this._scope[a]||(this._scope[a]=[]),l=u.length;return u[l]=r.ref,i.setValue(r,{property:a,itemIndex:l}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,xn._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let a=xn.nil;for(let s in t){let o=t[s];if(!o)continue;let u=n[s]=n[s]||new Map;o.forEach(l=>{if(u.has(l))return;u.set(l,wv.Started);let c=r(l);if(c){let d=this.opts.es5?kn.varKinds.var:kn.varKinds.const;a=(0,xn._)`${a}${d} ${l} = ${c};${this.opts._n}`}else if(c=i?.(l))a=(0,xn._)`${a}${c}${this.opts._n}`;else throw new LE(l);u.set(l,wv.Completed)})}return a}};kn.ValueScope=ZE});var ot=q(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.or=it.and=it.not=it.CodeGen=it.operators=it.varKinds=it.ValueScopeName=it.ValueScope=it.Scope=it.Name=it.regexpCode=it.stringify=it.getProperty=it.nil=it.strConcat=it.str=it._=void 0;var vt=Cf(),Ri=qE(),hs=Cf();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return hs._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return hs.str}});Object.defineProperty(it,"strConcat",{enumerable:!0,get:function(){return hs.strConcat}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return hs.nil}});Object.defineProperty(it,"getProperty",{enumerable:!0,get:function(){return hs.getProperty}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return hs.stringify}});Object.defineProperty(it,"regexpCode",{enumerable:!0,get:function(){return hs.regexpCode}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return hs.Name}});var Ev=qE();Object.defineProperty(it,"Scope",{enumerable:!0,get:function(){return Ev.Scope}});Object.defineProperty(it,"ValueScope",{enumerable:!0,get:function(){return Ev.ValueScope}});Object.defineProperty(it,"ValueScopeName",{enumerable:!0,get:function(){return Ev.ValueScopeName}});Object.defineProperty(it,"varKinds",{enumerable:!0,get:function(){return Ev.varKinds}});it.operators={GT:new vt._Code(">"),GTE:new vt._Code(">="),LT:new vt._Code("<"),LTE:new vt._Code("<="),EQ:new vt._Code("==="),NEQ:new vt._Code("!=="),NOT:new vt._Code("!"),OR:new vt._Code("||"),AND:new vt._Code("&&"),ADD:new vt._Code("+")};var Oa=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},FE=class extends Oa{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ri.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=cl(this.rhs,t,r)),this}get names(){return this.rhs instanceof vt._CodeOrName?this.rhs.names:{}}},Sv=class extends Oa{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof vt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=cl(this.rhs,t,r),this}get names(){let t=this.lhs instanceof vt.Name?{}:{...this.lhs.names};return $v(t,this.rhs)}},VE=class extends Sv{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},WE=class extends Oa{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},BE=class extends Oa{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},GE=class extends Oa{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},KE=class extends Oa{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=cl(this.code,t,r),this}get names(){return this.code instanceof vt._CodeOrName?this.code.names:{}}},jf=class extends Oa{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let a=n[i];a.optimizeNames(t,r)||(mae(t,a.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>mo(t,r.names),{})}},Na=class extends jf{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},HE=class extends jf{},ll=class extends Na{};ll.kind="else";var fo=class e extends Na{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new ll(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(S6(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=cl(this.condition,t,r),this}get names(){let t=super.names;return $v(t,this.condition),this.else&&mo(t,this.else.names),t}};fo.kind="if";var po=class extends Na{};po.kind="for";var JE=class extends po{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=cl(this.iteration,t,r),this}get names(){return mo(super.names,this.iteration.names)}},YE=class extends po{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?Ri.varKinds.var:this.varKind,{name:n,from:i,to:a}=this;return`for(${r} ${n}=${i}; ${n}<${a}; ${n}++)`+super.render(t)}get names(){let t=$v(super.names,this.from);return $v(t,this.to)}},Iv=class extends po{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=cl(this.iterable,t,r),this}get names(){return mo(super.names,this.iterable.names)}},Af=class extends Na{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Af.kind="func";var Rf=class extends jf{render(t){return"return "+super.render(t)}};Rf.kind="return";var QE=class extends Na{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&mo(t,this.catch.names),this.finally&&mo(t,this.finally.names),t}},Df=class extends Na{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Df.kind="catch";var Uf=class extends Na{render(t){return"finally"+super.render(t)}};Uf.kind="finally";var XE=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
225
+ `:""},this._extScope=t,this._scope=new Ri.Scope({parent:t}),this._nodes=[new HE]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let a=this._scope.toName(r);return n!==void 0&&i&&(this._constants[a.str]=n),this._leafNode(new FE(t,a,n)),a}const(t,r,n){return this._def(Ri.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ri.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ri.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Sv(t,r,n))}add(t,r){return this._leafNode(new VE(t,it.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==vt.nil&&this._leafNode(new KE(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,vt.addCodeArg)(r,i));return r.push("}"),new vt._Code(r)}if(t,r,n){if(this._blockNode(new fo(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new fo(t))}else(){return this._elseNode(new ll)}endIf(){return this._endBlockNode(fo,ll)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new JE(t),r)}forRange(t,r,n,i,a=this.opts.es5?Ri.varKinds.var:Ri.varKinds.let){let s=this._scope.toName(t);return this._for(new YE(a,s,r,n),()=>i(s))}forOf(t,r,n,i=Ri.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let s=r instanceof vt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,vt._)`${s}.length`,o=>{this.var(a,(0,vt._)`${s}[${o}]`),n(a)})}return this._for(new Iv("of",i,a,r),()=>n(a))}forIn(t,r,n,i=this.opts.es5?Ri.varKinds.var:Ri.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,vt._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new Iv("in",i,a,r),()=>n(a))}endFor(){return this._endBlockNode(po)}label(t){return this._leafNode(new WE(t))}break(t){return this._leafNode(new BE(t))}return(t){let r=new Rf;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Rf)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new QE;if(this._blockNode(i),this.code(t),r){let a=this.name("e");this._currNode=i.catch=new Df(a),r(a)}return n&&(this._currNode=i.finally=new Uf,this.code(n)),this._endBlockNode(Df,Uf)}throw(t){return this._leafNode(new GE(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=vt.nil,n,i){return this._blockNode(new Af(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Af)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof fo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};it.CodeGen=XE;function mo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function $v(e,t){return t instanceof vt._CodeOrName?mo(e,t.names):e}function cl(e,t,r){if(e instanceof vt.Name)return n(e);if(!i(e))return e;return new vt._Code(e._items.reduce((a,s)=>(s instanceof vt.Name&&(s=n(s)),s instanceof vt._Code?a.push(...s._items):a.push(s),a),[]));function n(a){let s=r[a.str];return s===void 0||t[a.str]!==1?a:(delete t[a.str],s)}function i(a){return a instanceof vt._Code&&a._items.some(s=>s instanceof vt.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function mae(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function S6(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,vt._)`!${eP(e)}`}it.not=S6;var hae=I6(it.operators.AND);function gae(...e){return e.reduce(hae)}it.and=gae;var vae=I6(it.operators.OR);function yae(...e){return e.reduce(vae)}it.or=yae;function I6(e){return(t,r)=>t===vt.nil?r:r===vt.nil?t:(0,vt._)`${eP(t)} ${e} ${eP(r)}`}function eP(e){return e instanceof vt.Name?e:(0,vt._)`(${e})`}});var bt=q(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.checkStrictMode=ut.getErrorPath=ut.Type=ut.useFunc=ut.setEvaluated=ut.evaluatedPropsToName=ut.mergeEvaluated=ut.eachItem=ut.unescapeJsonPointer=ut.escapeJsonPointer=ut.escapeFragment=ut.unescapeFragment=ut.schemaRefOrVal=ut.schemaHasRulesButRef=ut.schemaHasRules=ut.checkUnknownRules=ut.alwaysValidSchema=ut.toHash=void 0;var Wt=ot(),_ae=Cf();function bae(e){let t={};for(let r of e)t[r]=!0;return t}ut.toHash=bae;function wae(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(P6(e,t),!T6(t,e.self.RULES.all))}ut.alwaysValidSchema=wae;function P6(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let a in t)i[a]||z6(e,`unknown keyword: "${a}"`)}ut.checkUnknownRules=P6;function T6(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}ut.schemaHasRules=T6;function xae(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}ut.schemaHasRulesButRef=xae;function kae({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Wt._)`${r}`}return(0,Wt._)`${e}${t}${(0,Wt.getProperty)(n)}`}ut.schemaRefOrVal=kae;function Sae(e){return O6(decodeURIComponent(e))}ut.unescapeFragment=Sae;function Iae(e){return encodeURIComponent(rP(e))}ut.escapeFragment=Iae;function rP(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ut.escapeJsonPointer=rP;function O6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ut.unescapeJsonPointer=O6;function $ae(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}ut.eachItem=$ae;function $6({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,a,s,o)=>{let u=s===void 0?a:s instanceof Wt.Name?(a instanceof Wt.Name?e(i,a,s):t(i,a,s),s):a instanceof Wt.Name?(t(i,s,a),a):r(a,s);return o===Wt.Name&&!(u instanceof Wt.Name)?n(i,u):u}}ut.mergeEvaluated={props:$6({mergeNames:(e,t,r)=>e.if((0,Wt._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Wt._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Wt._)`${r} || {}`).code((0,Wt._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Wt._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Wt._)`${r} || {}`),nP(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:N6}),items:$6({mergeNames:(e,t,r)=>e.if((0,Wt._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Wt._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Wt._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Wt._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function N6(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Wt._)`{}`);return t!==void 0&&nP(e,r,t),r}ut.evaluatedPropsToName=N6;function nP(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Wt._)`${t}${(0,Wt.getProperty)(n)}`,!0))}ut.setEvaluated=nP;var E6={};function Eae(e,t){return e.scopeValue("func",{ref:t,code:E6[t.code]||(E6[t.code]=new _ae._Code(t.code))})}ut.useFunc=Eae;var tP;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(tP||(ut.Type=tP={}));function Pae(e,t,r){if(e instanceof Wt.Name){let n=t===tP.Num;return r?n?(0,Wt._)`"[" + ${e} + "]"`:(0,Wt._)`"['" + ${e} + "']"`:n?(0,Wt._)`"/" + ${e}`:(0,Wt._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Wt.getProperty)(e).toString():"/"+rP(e)}ut.getErrorPath=Pae;function z6(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}ut.checkStrictMode=z6});var za=q(iP=>{"use strict";Object.defineProperty(iP,"__esModule",{value:!0});var qr=ot(),Tae={data:new qr.Name("data"),valCxt:new qr.Name("valCxt"),instancePath:new qr.Name("instancePath"),parentData:new qr.Name("parentData"),parentDataProperty:new qr.Name("parentDataProperty"),rootData:new qr.Name("rootData"),dynamicAnchors:new qr.Name("dynamicAnchors"),vErrors:new qr.Name("vErrors"),errors:new qr.Name("errors"),this:new qr.Name("this"),self:new qr.Name("self"),scope:new qr.Name("scope"),json:new qr.Name("json"),jsonPos:new qr.Name("jsonPos"),jsonLen:new qr.Name("jsonLen"),jsonPart:new qr.Name("jsonPart")};iP.default=Tae});var Mf=q(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.extendErrors=Fr.resetErrorsCount=Fr.reportExtraError=Fr.reportError=Fr.keyword$DataError=Fr.keywordError=void 0;var wt=ot(),Pv=bt(),fn=za();Fr.keywordError={message:({keyword:e})=>(0,wt.str)`must pass "${e}" keyword validation`};Fr.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,wt.str)`"${e}" keyword must be ${t} ($data)`:(0,wt.str)`"${e}" keyword is invalid ($data)`};function Oae(e,t=Fr.keywordError,r,n){let{it:i}=e,{gen:a,compositeRule:s,allErrors:o}=i,u=A6(e,t,r);n??(s||o)?C6(a,u):j6(i,(0,wt._)`[${u}]`)}Fr.reportError=Oae;function Nae(e,t=Fr.keywordError,r){let{it:n}=e,{gen:i,compositeRule:a,allErrors:s}=n,o=A6(e,t,r);C6(i,o),a||s||j6(n,fn.default.vErrors)}Fr.reportExtraError=Nae;function zae(e,t){e.assign(fn.default.errors,t),e.if((0,wt._)`${fn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,wt._)`${fn.default.vErrors}.length`,t),()=>e.assign(fn.default.vErrors,null)))}Fr.resetErrorsCount=zae;function Cae({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:a}){if(i===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",i,fn.default.errors,o=>{e.const(s,(0,wt._)`${fn.default.vErrors}[${o}]`),e.if((0,wt._)`${s}.instancePath === undefined`,()=>e.assign((0,wt._)`${s}.instancePath`,(0,wt.strConcat)(fn.default.instancePath,a.errorPath))),e.assign((0,wt._)`${s}.schemaPath`,(0,wt.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,wt._)`${s}.schema`,r),e.assign((0,wt._)`${s}.data`,n))})}Fr.extendErrors=Cae;function C6(e,t){let r=e.const("err",t);e.if((0,wt._)`${fn.default.vErrors} === null`,()=>e.assign(fn.default.vErrors,(0,wt._)`[${r}]`),(0,wt._)`${fn.default.vErrors}.push(${r})`),e.code((0,wt._)`${fn.default.errors}++`)}function j6(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,wt._)`new ${e.ValidationError}(${t})`):(r.assign((0,wt._)`${n}.errors`,t),r.return(!1))}var ho={keyword:new wt.Name("keyword"),schemaPath:new wt.Name("schemaPath"),params:new wt.Name("params"),propertyName:new wt.Name("propertyName"),message:new wt.Name("message"),schema:new wt.Name("schema"),parentSchema:new wt.Name("parentSchema")};function A6(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,wt._)`{}`:jae(e,t,r)}function jae(e,t,r={}){let{gen:n,it:i}=e,a=[Aae(i,r),Rae(e,r)];return Dae(e,t,a),n.object(...a)}function Aae({errorPath:e},{instancePath:t}){let r=t?(0,wt.str)`${e}${(0,Pv.getErrorPath)(t,Pv.Type.Str)}`:e;return[fn.default.instancePath,(0,wt.strConcat)(fn.default.instancePath,r)]}function Rae({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,wt.str)`${t}/${e}`;return r&&(i=(0,wt.str)`${i}${(0,Pv.getErrorPath)(r,Pv.Type.Str)}`),[ho.schemaPath,i]}function Dae(e,{params:t,message:r},n){let{keyword:i,data:a,schemaValue:s,it:o}=e,{opts:u,propertyName:l,topSchemaRef:c,schemaPath:d}=o;n.push([ho.keyword,i],[ho.params,typeof t=="function"?t(e):t||(0,wt._)`{}`]),u.messages&&n.push([ho.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([ho.schema,s],[ho.parentSchema,(0,wt._)`${c}${d}`],[fn.default.data,a]),l&&n.push([ho.propertyName,l])}});var D6=q(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.boolOrEmptySchema=dl.topBoolOrEmptySchema=void 0;var Uae=Mf(),Mae=ot(),Lae=za(),Zae={message:"boolean schema is false"};function qae(e){let{gen:t,schema:r,validateName:n}=e;r===!1?R6(e,!1):typeof r=="object"&&r.$async===!0?t.return(Lae.default.data):(t.assign((0,Mae._)`${n}.errors`,null),t.return(!0))}dl.topBoolOrEmptySchema=qae;function Fae(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),R6(e)):r.var(t,!0)}dl.boolOrEmptySchema=Fae;function R6(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Uae.reportError)(i,Zae,void 0,t)}});var aP=q(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.getRules=fl.isJSONType=void 0;var Vae=["string","number","integer","boolean","null","object","array"],Wae=new Set(Vae);function Bae(e){return typeof e=="string"&&Wae.has(e)}fl.isJSONType=Bae;function Gae(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}fl.getRules=Gae});var sP=q(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.shouldUseRule=gs.shouldUseGroup=gs.schemaHasRulesForType=void 0;function Kae({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&U6(e,n)}gs.schemaHasRulesForType=Kae;function U6(e,t){return t.rules.some(r=>M6(e,r))}gs.shouldUseGroup=U6;function M6(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}gs.shouldUseRule=M6});var Lf=q(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.reportTypeError=Vr.checkDataTypes=Vr.checkDataType=Vr.coerceAndCheckDataType=Vr.getJSONTypes=Vr.getSchemaTypes=Vr.DataType=void 0;var Hae=aP(),Jae=sP(),Yae=Mf(),Je=ot(),L6=bt(),pl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(pl||(Vr.DataType=pl={}));function Qae(e){let t=Z6(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Vr.getSchemaTypes=Qae;function Z6(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Hae.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Vr.getJSONTypes=Z6;function Xae(e,t){let{gen:r,data:n,opts:i}=e,a=ese(t,i.coerceTypes),s=t.length>0&&!(a.length===0&&t.length===1&&(0,Jae.schemaHasRulesForType)(e,t[0]));if(s){let o=uP(t,n,i.strictNumbers,pl.Wrong);r.if(o,()=>{a.length?tse(e,t,a):lP(e)})}return s}Vr.coerceAndCheckDataType=Xae;var q6=new Set(["string","number","integer","boolean","null"]);function ese(e,t){return t?e.filter(r=>q6.has(r)||t==="array"&&r==="array"):[]}function tse(e,t,r){let{gen:n,data:i,opts:a}=e,s=n.let("dataType",(0,Je._)`typeof ${i}`),o=n.let("coerced",(0,Je._)`undefined`);a.coerceTypes==="array"&&n.if((0,Je._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Je._)`${i}[0]`).assign(s,(0,Je._)`typeof ${i}`).if(uP(t,i,a.strictNumbers),()=>n.assign(o,i))),n.if((0,Je._)`${o} !== undefined`);for(let l of r)(q6.has(l)||l==="array"&&a.coerceTypes==="array")&&u(l);n.else(),lP(e),n.endIf(),n.if((0,Je._)`${o} !== undefined`,()=>{n.assign(i,o),rse(e,o)});function u(l){switch(l){case"string":n.elseIf((0,Je._)`${s} == "number" || ${s} == "boolean"`).assign(o,(0,Je._)`"" + ${i}`).elseIf((0,Je._)`${i} === null`).assign(o,(0,Je._)`""`);return;case"number":n.elseIf((0,Je._)`${s} == "boolean" || ${i} === null
226
+ || (${s} == "string" && ${i} && ${i} == +${i})`).assign(o,(0,Je._)`+${i}`);return;case"integer":n.elseIf((0,Je._)`${s} === "boolean" || ${i} === null
227
+ || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(o,(0,Je._)`+${i}`);return;case"boolean":n.elseIf((0,Je._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(o,!1).elseIf((0,Je._)`${i} === "true" || ${i} === 1`).assign(o,!0);return;case"null":n.elseIf((0,Je._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(o,null);return;case"array":n.elseIf((0,Je._)`${s} === "string" || ${s} === "number"
228
+ || ${s} === "boolean" || ${i} === null`).assign(o,(0,Je._)`[${i}]`)}}}function rse({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Je._)`${t} !== undefined`,()=>e.assign((0,Je._)`${t}[${r}]`,n))}function oP(e,t,r,n=pl.Correct){let i=n===pl.Correct?Je.operators.EQ:Je.operators.NEQ,a;switch(e){case"null":return(0,Je._)`${t} ${i} null`;case"array":a=(0,Je._)`Array.isArray(${t})`;break;case"object":a=(0,Je._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=s((0,Je._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=s();break;default:return(0,Je._)`typeof ${t} ${i} ${e}`}return n===pl.Correct?a:(0,Je.not)(a);function s(o=Je.nil){return(0,Je.and)((0,Je._)`typeof ${t} == "number"`,o,r?(0,Je._)`isFinite(${t})`:Je.nil)}}Vr.checkDataType=oP;function uP(e,t,r,n){if(e.length===1)return oP(e[0],t,r,n);let i,a=(0,L6.toHash)(e);if(a.array&&a.object){let s=(0,Je._)`typeof ${t} != "object"`;i=a.null?s:(0,Je._)`!${t} || ${s}`,delete a.null,delete a.array,delete a.object}else i=Je.nil;a.number&&delete a.integer;for(let s in a)i=(0,Je.and)(i,oP(s,t,r,n));return i}Vr.checkDataTypes=uP;var nse={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Je._)`{type: ${e}}`:(0,Je._)`{type: ${t}}`};function lP(e){let t=ise(e);(0,Yae.reportError)(t,nse)}Vr.reportTypeError=lP;function ise(e){let{gen:t,data:r,schema:n}=e,i=(0,L6.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var V6=q(Tv=>{"use strict";Object.defineProperty(Tv,"__esModule",{value:!0});Tv.assignDefaults=void 0;var ml=ot(),ase=bt();function sse(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)F6(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,a)=>F6(e,a,i.default))}Tv.assignDefaults=sse;function F6(e,t,r){let{gen:n,compositeRule:i,data:a,opts:s}=e;if(r===void 0)return;let o=(0,ml._)`${a}${(0,ml.getProperty)(t)}`;if(i){(0,ase.checkStrictMode)(e,`default is ignored for: ${o}`);return}let u=(0,ml._)`${o} === undefined`;s.useDefaults==="empty"&&(u=(0,ml._)`${u} || ${o} === null || ${o} === ""`),n.if(u,(0,ml._)`${o} = ${(0,ml.stringify)(r)}`)}});var ui=q(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.validateUnion=Dt.validateArray=Dt.usePattern=Dt.callValidateCode=Dt.schemaProperties=Dt.allSchemaProperties=Dt.noPropertyInData=Dt.propertyInData=Dt.isOwnProperty=Dt.hasPropFunc=Dt.reportMissingProp=Dt.checkMissingProp=Dt.checkReportMissingProp=void 0;var Xt=ot(),cP=bt(),vs=za(),ose=bt();function use(e,t){let{gen:r,data:n,it:i}=e;r.if(fP(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Xt._)`${t}`},!0),e.error()})}Dt.checkReportMissingProp=use;function lse({gen:e,data:t,it:{opts:r}},n,i){return(0,Xt.or)(...n.map(a=>(0,Xt.and)(fP(e,t,a,r.ownProperties),(0,Xt._)`${i} = ${a}`)))}Dt.checkMissingProp=lse;function cse(e,t){e.setParams({missingProperty:t},!0),e.error()}Dt.reportMissingProp=cse;function W6(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Xt._)`Object.prototype.hasOwnProperty`})}Dt.hasPropFunc=W6;function dP(e,t,r){return(0,Xt._)`${W6(e)}.call(${t}, ${r})`}Dt.isOwnProperty=dP;function dse(e,t,r,n){let i=(0,Xt._)`${t}${(0,Xt.getProperty)(r)} !== undefined`;return n?(0,Xt._)`${i} && ${dP(e,t,r)}`:i}Dt.propertyInData=dse;function fP(e,t,r,n){let i=(0,Xt._)`${t}${(0,Xt.getProperty)(r)} === undefined`;return n?(0,Xt.or)(i,(0,Xt.not)(dP(e,t,r))):i}Dt.noPropertyInData=fP;function B6(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Dt.allSchemaProperties=B6;function fse(e,t){return B6(t).filter(r=>!(0,cP.alwaysValidSchema)(e,t[r]))}Dt.schemaProperties=fse;function pse({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:a},it:s},o,u,l){let c=l?(0,Xt._)`${e}, ${t}, ${n}${i}`:t,d=[[vs.default.instancePath,(0,Xt.strConcat)(vs.default.instancePath,a)],[vs.default.parentData,s.parentData],[vs.default.parentDataProperty,s.parentDataProperty],[vs.default.rootData,vs.default.rootData]];s.opts.dynamicRef&&d.push([vs.default.dynamicAnchors,vs.default.dynamicAnchors]);let f=(0,Xt._)`${c}, ${r.object(...d)}`;return u!==Xt.nil?(0,Xt._)`${o}.call(${u}, ${f})`:(0,Xt._)`${o}(${f})`}Dt.callValidateCode=pse;var mse=(0,Xt._)`new RegExp`;function hse({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Xt._)`${i.code==="new RegExp"?mse:(0,ose.useFunc)(e,i)}(${r}, ${n})`})}Dt.usePattern=hse;function gse(e){let{gen:t,data:r,keyword:n,it:i}=e,a=t.name("valid");if(i.allErrors){let o=t.let("valid",!0);return s(()=>t.assign(o,!1)),o}return t.var(a,!0),s(()=>t.break()),a;function s(o){let u=t.const("len",(0,Xt._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:cP.Type.Num},a),t.if((0,Xt.not)(a),o)})}}Dt.validateArray=gse;function vse(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,cP.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let s=t.let("valid",!1),o=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let c=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},o);t.assign(s,(0,Xt._)`${s} || ${o}`),e.mergeValidEvaluated(c,o)||t.if((0,Xt.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}Dt.validateUnion=vse});var H6=q(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.validateKeywordUsage=ta.validSchemaType=ta.funcKeywordCode=ta.macroKeywordCode=void 0;var pn=ot(),go=za(),yse=ui(),_se=Mf();function bse(e,t){let{gen:r,keyword:n,schema:i,parentSchema:a,it:s}=e,o=t.macro.call(s.self,i,a,s),u=K6(r,n,o);s.opts.validateSchema!==!1&&s.self.validateSchema(o,!0);let l=r.name("valid");e.subschema({schema:o,schemaPath:pn.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}ta.macroKeywordCode=bse;function wse(e,t){var r;let{gen:n,keyword:i,schema:a,parentSchema:s,$data:o,it:u}=e;kse(u,t);let l=!o&&t.compile?t.compile.call(u.self,a,s,u):t.validate,c=K6(n,i,l),d=n.let("valid");e.block$data(d,f),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function f(){if(t.errors===!1)y(),t.modifying&&G6(e),_(()=>e.error());else{let m=t.async?p():h();t.modifying&&G6(e),_(()=>xse(e,m))}}function p(){let m=n.let("ruleErrs",null);return n.try(()=>y((0,pn._)`await `),g=>n.assign(d,!1).if((0,pn._)`${g} instanceof ${u.ValidationError}`,()=>n.assign(m,(0,pn._)`${g}.errors`),()=>n.throw(g))),m}function h(){let m=(0,pn._)`${c}.errors`;return n.assign(m,null),y(pn.nil),m}function y(m=t.async?(0,pn._)`await `:pn.nil){let g=u.opts.passContext?go.default.this:go.default.self,v=!("compile"in t&&!o||t.schema===!1);n.assign(d,(0,pn._)`${m}${(0,yse.callValidateCode)(e,c,g,v)}`,t.modifying)}function _(m){var g;n.if((0,pn.not)((g=t.valid)!==null&&g!==void 0?g:d),m)}}ta.funcKeywordCode=wse;function G6(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,pn._)`${n.parentData}[${n.parentDataProperty}]`))}function xse(e,t){let{gen:r}=e;r.if((0,pn._)`Array.isArray(${t})`,()=>{r.assign(go.default.vErrors,(0,pn._)`${go.default.vErrors} === null ? ${t} : ${go.default.vErrors}.concat(${t})`).assign(go.default.errors,(0,pn._)`${go.default.vErrors}.length`),(0,_se.extendErrors)(e)},()=>e.error())}function kse({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function K6(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,pn.stringify)(r)})}function Sse(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}ta.validSchemaType=Sse;function Ise({schema:e,opts:t,self:r,errSchemaPath:n},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(o=>!Object.prototype.hasOwnProperty.call(e,o)))throw new Error(`parent schema must have dependencies of ${a}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[a])){let u=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}ta.validateKeywordUsage=Ise});var Y6=q(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.extendSubschemaMode=ys.extendSubschemaData=ys.getSubschema=void 0;var ra=ot(),J6=bt();function $se(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:a,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let o=e.schema[t];return r===void 0?{schema:o,schemaPath:(0,ra._)`${e.schemaPath}${(0,ra.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:(0,ra._)`${e.schemaPath}${(0,ra.getProperty)(t)}${(0,ra.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,J6.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||a===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}ys.getSubschema=$se;function Ese(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:a,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=t;if(r!==void 0){let{errorPath:l,dataPathArr:c,opts:d}=t,f=o.let("data",(0,ra._)`${t.data}${(0,ra.getProperty)(r)}`,!0);u(f),e.errorPath=(0,ra.str)`${l}${(0,J6.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,ra._)`${r}`,e.dataPathArr=[...c,e.parentDataProperty]}if(i!==void 0){let l=i instanceof ra.Name?i:o.let("data",i,!0);u(l),s!==void 0&&(e.propertyName=s)}a&&(e.dataTypes=a);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}ys.extendSubschemaData=Ese;function Pse(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:a}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}ys.extendSubschemaMode=Pse});var Zf=q((aTe,Q6)=>{"use strict";Q6.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;i--!==0;){var s=a[i];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var eL=q((sTe,X6)=>{"use strict";var _s=X6.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Ov(t,n,i,e,"",e)};_s.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};_s.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_s.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_s.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ov(e,t,r,n,i,a,s,o,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,a,s,o,u,l);for(var c in n){var d=n[c];if(Array.isArray(d)){if(c in _s.arrayKeywords)for(var f=0;f<d.length;f++)Ov(e,t,r,d[f],i+"/"+c+"/"+f,a,i,c,n,f)}else if(c in _s.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ov(e,t,r,d[p],i+"/"+c+"/"+Tse(p),a,i,c,n,p)}else(c in _s.keywords||e.allKeys&&!(c in _s.skipKeywords))&&Ov(e,t,r,d,i+"/"+c,a,i,c,n)}r(n,i,a,s,o,u,l)}}function Tse(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var qf=q(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getSchemaRefs=Sn.resolveUrl=Sn.normalizeId=Sn._getFullPath=Sn.getFullPath=Sn.inlineRef=void 0;var Ose=bt(),Nse=Zf(),zse=eL(),Cse=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function jse(e,t=!0){return typeof e=="boolean"?!0:t===!0?!pP(e):t?tL(e)<=t:!1}Sn.inlineRef=jse;var Ase=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function pP(e){for(let t in e){if(Ase.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(pP)||typeof r=="object"&&pP(r))return!0}return!1}function tL(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Cse.has(r)&&(typeof e[r]=="object"&&(0,Ose.eachItem)(e[r],n=>t+=tL(n)),t===1/0))return 1/0}return t}function rL(e,t="",r){r!==!1&&(t=hl(t));let n=e.parse(t);return nL(e,n)}Sn.getFullPath=rL;function nL(e,t){return e.serialize(t).split("#")[0]+"#"}Sn._getFullPath=nL;var Rse=/#\/?$/;function hl(e){return e?e.replace(Rse,""):""}Sn.normalizeId=hl;function Dse(e,t,r){return r=hl(r),e.resolve(t,r)}Sn.resolveUrl=Dse;var Use=/^[a-z_][-a-z0-9._]*$/i;function Mse(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=hl(e[r]||t),a={"":i},s=rL(n,i,!1),o={},u=new Set;return zse(e,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let y=s+f,_=a[h];typeof d[r]=="string"&&(_=m.call(this,d[r])),g.call(this,d.$anchor),g.call(this,d.$dynamicAnchor),a[f]=_;function m(v){let b=this.opts.uriResolver.resolve;if(v=hl(_?b(_,v):v),u.has(v))throw c(v);u.add(v);let w=this.refs[v];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,v):v!==hl(y)&&(v[0]==="#"?(l(d,o[v],v),o[v]=d):this.refs[v]=y),v}function g(v){if(typeof v=="string"){if(!Use.test(v))throw new Error(`invalid anchor "${v}"`);m.call(this,`#${v}`)}}}),o;function l(d,f,p){if(f!==void 0&&!Nse(d,f))throw c(p)}function c(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Sn.getSchemaRefs=Mse});var Wf=q(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.getData=bs.KeywordCxt=bs.validateFunctionCode=void 0;var uL=D6(),iL=Lf(),hP=sP(),Nv=Lf(),Lse=V6(),Vf=H6(),mP=Y6(),$e=ot(),Ue=za(),Zse=qf(),Ca=bt(),Ff=Mf();function qse(e){if(dL(e)&&(fL(e),cL(e))){Wse(e);return}lL(e,()=>(0,uL.topBoolOrEmptySchema)(e))}bs.validateFunctionCode=qse;function lL({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},a){i.code.es5?e.func(t,(0,$e._)`${Ue.default.data}, ${Ue.default.valCxt}`,n.$async,()=>{e.code((0,$e._)`"use strict"; ${aL(r,i)}`),Vse(e,i),e.code(a)}):e.func(t,(0,$e._)`${Ue.default.data}, ${Fse(i)}`,n.$async,()=>e.code(aL(r,i)).code(a))}function Fse(e){return(0,$e._)`{${Ue.default.instancePath}="", ${Ue.default.parentData}, ${Ue.default.parentDataProperty}, ${Ue.default.rootData}=${Ue.default.data}${e.dynamicRef?(0,$e._)`, ${Ue.default.dynamicAnchors}={}`:$e.nil}}={}`}function Vse(e,t){e.if(Ue.default.valCxt,()=>{e.var(Ue.default.instancePath,(0,$e._)`${Ue.default.valCxt}.${Ue.default.instancePath}`),e.var(Ue.default.parentData,(0,$e._)`${Ue.default.valCxt}.${Ue.default.parentData}`),e.var(Ue.default.parentDataProperty,(0,$e._)`${Ue.default.valCxt}.${Ue.default.parentDataProperty}`),e.var(Ue.default.rootData,(0,$e._)`${Ue.default.valCxt}.${Ue.default.rootData}`),t.dynamicRef&&e.var(Ue.default.dynamicAnchors,(0,$e._)`${Ue.default.valCxt}.${Ue.default.dynamicAnchors}`)},()=>{e.var(Ue.default.instancePath,(0,$e._)`""`),e.var(Ue.default.parentData,(0,$e._)`undefined`),e.var(Ue.default.parentDataProperty,(0,$e._)`undefined`),e.var(Ue.default.rootData,Ue.default.data),t.dynamicRef&&e.var(Ue.default.dynamicAnchors,(0,$e._)`{}`)})}function Wse(e){let{schema:t,opts:r,gen:n}=e;lL(e,()=>{r.$comment&&t.$comment&&mL(e),Jse(e),n.let(Ue.default.vErrors,null),n.let(Ue.default.errors,0),r.unevaluated&&Bse(e),pL(e),Xse(e)})}function Bse(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,$e._)`${r}.evaluated`),t.if((0,$e._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,$e._)`${e.evaluated}.props`,(0,$e._)`undefined`)),t.if((0,$e._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,$e._)`${e.evaluated}.items`,(0,$e._)`undefined`))}function aL(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,$e._)`/*# sourceURL=${r} */`:$e.nil}function Gse(e,t){if(dL(e)&&(fL(e),cL(e))){Kse(e,t);return}(0,uL.boolOrEmptySchema)(e,t)}function cL({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function dL(e){return typeof e.schema!="boolean"}function Kse(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&mL(e),Yse(e),Qse(e);let a=n.const("_errs",Ue.default.errors);pL(e,a),n.var(t,(0,$e._)`${a} === ${Ue.default.errors}`)}function fL(e){(0,Ca.checkUnknownRules)(e),Hse(e)}function pL(e,t){if(e.opts.jtd)return sL(e,[],!1,t);let r=(0,iL.getSchemaTypes)(e.schema),n=(0,iL.coerceAndCheckDataType)(e,r);sL(e,r,!n,t)}function Hse(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ca.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Jse(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ca.checkStrictMode)(e,"default is ignored in the schema root")}function Yse(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Zse.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Qse(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function mL({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let a=r.$comment;if(i.$comment===!0)e.code((0,$e._)`${Ue.default.self}.logger.log(${a})`);else if(typeof i.$comment=="function"){let s=(0,$e.str)`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code((0,$e._)`${Ue.default.self}.opts.$comment(${a}, ${s}, ${o}.schema)`)}}function Xse(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:a}=e;r.$async?t.if((0,$e._)`${Ue.default.errors} === 0`,()=>t.return(Ue.default.data),()=>t.throw((0,$e._)`new ${i}(${Ue.default.vErrors})`)):(t.assign((0,$e._)`${n}.errors`,Ue.default.vErrors),a.unevaluated&&eoe(e),t.return((0,$e._)`${Ue.default.errors} === 0`))}function eoe({gen:e,evaluated:t,props:r,items:n}){r instanceof $e.Name&&e.assign((0,$e._)`${t}.props`,r),n instanceof $e.Name&&e.assign((0,$e._)`${t}.items`,n)}function sL(e,t,r,n){let{gen:i,schema:a,data:s,allErrors:o,opts:u,self:l}=e,{RULES:c}=l;if(a.$ref&&(u.ignoreKeywordsWithRef||!(0,Ca.schemaHasRulesButRef)(a,c))){i.block(()=>gL(e,"$ref",c.all.$ref.definition));return}u.jtd||toe(e,t),i.block(()=>{for(let f of c.rules)d(f);d(c.post)});function d(f){(0,hP.shouldUseGroup)(a,f)&&(f.type?(i.if((0,Nv.checkDataType)(f.type,s,u.strictNumbers)),oL(e,f),t.length===1&&t[0]===f.type&&r&&(i.else(),(0,Nv.reportTypeError)(e)),i.endIf()):oL(e,f),o||i.if((0,$e._)`${Ue.default.errors} === ${n||0}`))}}function oL(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Lse.assignDefaults)(e,t.type),r.block(()=>{for(let a of t.rules)(0,hP.shouldUseRule)(n,a)&&gL(e,a.keyword,a.definition,t.type)})}function toe(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(roe(e,t),e.opts.allowUnionTypes||noe(e,t),ioe(e,e.dataTypes))}function roe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{hL(e.dataTypes,r)||gP(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),soe(e,t)}}function noe(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&gP(e,"use allowUnionTypes to allow union type keyword")}function ioe(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,hP.shouldUseRule)(e.schema,i)){let{type:a}=i.definition;a.length&&!a.some(s=>aoe(t,s))&&gP(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function aoe(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function hL(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function soe(e,t){let r=[];for(let n of e.dataTypes)hL(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function gP(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ca.checkStrictMode)(e,t,e.opts.strictTypes)}var zv=class{constructor(t,r,n){if((0,Vf.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ca.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",vL(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Vf.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Ue.default.errors))}result(t,r,n){this.failResult((0,$e.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,$e.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,$e._)`${r} !== undefined && (${(0,$e.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Ff.reportExtraError:Ff.reportError)(this,this.def.error,r)}$dataError(){(0,Ff.reportError)(this,this.def.$dataError||Ff.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ff.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=$e.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=$e.nil,r=$e.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:a,def:s}=this;n.if((0,$e.or)((0,$e._)`${i} === undefined`,r)),t!==$e.nil&&n.assign(t,!0),(a.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==$e.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:a}=this;return(0,$e.or)(s(),o());function s(){if(n.length){if(!(r instanceof $e.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,$e._)`${(0,Nv.checkDataTypes)(u,r,a.opts.strictNumbers,Nv.DataType.Wrong)}`}return $e.nil}function o(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,$e._)`!${u}(${r})`}return $e.nil}}subschema(t,r){let n=(0,mP.getSubschema)(this.it,t);(0,mP.extendSubschemaData)(n,this.it,t),(0,mP.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return Gse(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ca.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ca.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,$e.Name)),!0}};bs.KeywordCxt=zv;function gL(e,t,r,n){let i=new zv(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Vf.funcKeywordCode)(i,r):"macro"in r?(0,Vf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Vf.funcKeywordCode)(i,r)}var ooe=/^\/(?:[^~]|~0|~1)*$/,uoe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vL(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,a;if(e==="")return Ue.default.rootData;if(e[0]==="/"){if(!ooe.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,a=Ue.default.rootData}else{let l=uoe.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let c=+l[1];if(i=l[2],i==="#"){if(c>=t)throw new Error(u("property/index",c));return n[t-c]}if(c>t)throw new Error(u("data",c));if(a=r[t-c],!i)return a}let s=a,o=i.split("/");for(let l of o)l&&(a=(0,$e._)`${a}${(0,$e.getProperty)((0,Ca.unescapeJsonPointer)(l))}`,s=(0,$e._)`${s} && ${a}`);return s;function u(l,c){return`Cannot access ${l} ${c} levels up, current level is ${t}`}}bs.getData=vL});var Cv=q(yP=>{"use strict";Object.defineProperty(yP,"__esModule",{value:!0});var vP=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};yP.default=vP});var Bf=q(wP=>{"use strict";Object.defineProperty(wP,"__esModule",{value:!0});var _P=qf(),bP=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,_P.resolveUrl)(t,r,n),this.missingSchema=(0,_P.normalizeId)((0,_P.getFullPath)(t,this.missingRef))}};wP.default=bP});var Av=q(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.resolveSchema=li.getCompilingSchema=li.resolveRef=li.compileSchema=li.SchemaEnv=void 0;var Di=ot(),loe=Cv(),vo=za(),Ui=qf(),yL=bt(),coe=Wf(),gl=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ui.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};li.SchemaEnv=gl;function kP(e){let t=_L.call(this,e);if(t)return t;let r=(0,Ui.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:a}=this.opts,s=new Di.CodeGen(this.scope,{es5:n,lines:i,ownProperties:a}),o;e.$async&&(o=s.scopeValue("Error",{ref:loe.default,code:(0,Di._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");e.validateName=u;let l={gen:s,allErrors:this.opts.allErrors,data:vo.default.data,parentData:vo.default.parentData,parentDataProperty:vo.default.parentDataProperty,dataNames:[vo.default.data],dataPathArr:[Di.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Di.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:o,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Di.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Di._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(e),(0,coe.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();c=`${s.scopeRefs(vo.default.scope)}return ${d}`,this.opts.code.process&&(c=this.opts.code.process(c,e));let p=new Function(`${vo.default.self}`,`${vo.default.scope}`,c)(this,this.scope.get());if(this.scope.value(u,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:u,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:y}=l;p.evaluated={props:h instanceof Di.Name?void 0:h,items:y instanceof Di.Name?void 0:y,dynamicProps:h instanceof Di.Name,dynamicItems:y instanceof Di.Name},p.source&&(p.source.evaluated=(0,Di.stringify)(p.evaluated))}return e.validate=p,e}catch(d){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(e)}}li.compileSchema=kP;function doe(e,t,r){var n;r=(0,Ui.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let a=moe.call(this,e,r);if(a===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:o}=this.opts;s&&(a=new gl({schema:s,schemaId:o,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=foe.call(this,a)}li.resolveRef=doe;function foe(e){return(0,Ui.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:kP.call(this,e)}function _L(e){for(let t of this._compilations)if(poe(t,e))return t}li.getCompilingSchema=_L;function poe(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function moe(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||jv.call(this,e,t)}function jv(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Ui._getFullPath)(this.opts.uriResolver,r),i=(0,Ui.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return xP.call(this,r,e);let a=(0,Ui.normalizeId)(n),s=this.refs[a]||this.schemas[a];if(typeof s=="string"){let o=jv.call(this,e,s);return typeof o?.schema!="object"?void 0:xP.call(this,r,o)}if(typeof s?.schema=="object"){if(s.validate||kP.call(this,s),a===(0,Ui.normalizeId)(t)){let{schema:o}=s,{schemaId:u}=this.opts,l=o[u];return l&&(i=(0,Ui.resolveUrl)(this.opts.uriResolver,i,l)),new gl({schema:o,schemaId:u,root:e,baseId:i})}return xP.call(this,r,s)}}li.resolveSchema=jv;var hoe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function xP(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,yL.unescapeFragment)(o)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!hoe.has(o)&&l&&(t=(0,Ui.resolveUrl)(this.opts.uriResolver,t,l))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,yL.schemaHasRulesButRef)(r,this.RULES)){let o=(0,Ui.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=jv.call(this,n,o)}let{schemaId:s}=this.opts;if(a=a||new gl({schema:r,schemaId:s,root:n,baseId:t}),a.schema!==a.root.schema)return a}});var bL=q((fTe,goe)=>{goe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var IP=q((pTe,SL)=>{"use strict";var voe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),xL=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function SP(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var yoe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function wL(e){return e.length=0,!0}function _oe(e,t,r){if(e.length){let n=SP(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function boe(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],a=!1,s=!1,o=_oe;for(let u=0;u<e.length;u++){let l=e[u];if(!(l==="["||l==="]"))if(l===":"){if(a===!0&&(s=!0),!o(i,n,r))break;if(++t>7){r.error=!0;break}u>0&&e[u-1]===":"&&(a=!0),n.push(":");continue}else if(l==="%"){if(!o(i,n,r))break;o=wL}else{i.push(l);continue}}return i.length&&(o===wL?r.zone=i.join(""):s?n.push(i.join("")):n.push(SP(i))),r.address=n.join(""),r}function kL(e){if(woe(e,":")<2)return{host:e,isIPV6:!1};let t=boe(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function woe(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function xoe(e){let t=e,r=[],n=-1,i=0;for(;i=t.length;){if(i===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(i===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(i===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function koe(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function Soe(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!xL(r)){let n=kL(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}SL.exports={nonSimpleDomain:yoe,recomposeAuthority:Soe,normalizeComponentEncoding:koe,removeDotSegments:xoe,isIPv4:xL,isUUID:voe,normalizeIPv6:kL,stringArrayToHexStripped:SP}});var TL=q((mTe,PL)=>{"use strict";var{isUUID:Ioe}=IP(),$oe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Eoe=["http","https","ws","wss","urn","urn:uuid"];function Poe(e){return Eoe.indexOf(e)!==-1}function $P(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function IL(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function $L(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function Toe(e){return e.secure=$P(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Ooe(e){if((e.port===($P(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function Noe(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match($oe);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,a=EP(i);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function zoe(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,a=EP(i);a&&(e=a.serialize(e,t));let s=e,o=e.nss;return s.path=`${n||t.nid}:${o}`,t.skipEscape=!0,s}function Coe(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Ioe(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function joe(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var EL={scheme:"http",domainHost:!0,parse:IL,serialize:$L},Aoe={scheme:"https",domainHost:EL.domainHost,parse:IL,serialize:$L},Rv={scheme:"ws",domainHost:!0,parse:Toe,serialize:Ooe},Roe={scheme:"wss",domainHost:Rv.domainHost,parse:Rv.parse,serialize:Rv.serialize},Doe={scheme:"urn",parse:Noe,serialize:zoe,skipNormalize:!0},Uoe={scheme:"urn:uuid",parse:Coe,serialize:joe,skipNormalize:!0},Dv={http:EL,https:Aoe,ws:Rv,wss:Roe,urn:Doe,"urn:uuid":Uoe};Object.setPrototypeOf(Dv,null);function EP(e){return e&&(Dv[e]||Dv[e.toLowerCase()])||void 0}PL.exports={wsIsSecure:$P,SCHEMES:Dv,isValidSchemeName:Poe,getSchemeHandler:EP}});var TP=q((hTe,Mv)=>{"use strict";var{normalizeIPv6:Moe,removeDotSegments:Gf,recomposeAuthority:Loe,normalizeComponentEncoding:Uv,isIPv4:Zoe,nonSimpleDomain:qoe}=IP(),{SCHEMES:Foe,getSchemeHandler:OL}=TL();function Voe(e,t){return typeof e=="string"?e=na(ja(e,t),t):typeof e=="object"&&(e=ja(na(e,t),t)),e}function Woe(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=NL(ja(e,n),ja(t,n),n,!0);return n.skipEscape=!0,na(i,n)}function NL(e,t,r,n){let i={};return n||(e=ja(na(e,r),r),t=ja(na(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Gf(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Gf(t.path||""),i.query=t.query):(t.path?(t.path[0]==="/"?i.path=Gf(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Gf(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function Boe(e,t,r){return typeof e=="string"?(e=unescape(e),e=na(Uv(ja(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=na(Uv(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=na(Uv(ja(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=na(Uv(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function na(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],a=OL(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=Loe(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let o=r.path;!n.absolutePath&&(!a||!a.absolutePath)&&(o=Gf(o)),s===void 0&&o[0]==="/"&&o[1]==="/"&&(o="/%2F"+o.slice(2)),i.push(o)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var Goe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ja(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let a=e.match(Goe);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host)if(Zoe(n.host)===!1){let u=Moe(n.host);n.host=u.host.toLowerCase(),i=u.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let s=OL(r.scheme||n.scheme);if(!r.unicodeSupport&&(!s||!s.unicodeSupport)&&n.host&&(r.domainHost||s&&s.domainHost)&&i===!1&&qoe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(o){n.error=n.error||"Host's domain name can not be converted to ASCII: "+o}(!s||s&&!s.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),s&&s.parse&&s.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var PP={SCHEMES:Foe,normalize:Voe,resolve:Woe,resolveComponent:NL,equal:Boe,serialize:na,parse:ja};Mv.exports=PP;Mv.exports.default=PP;Mv.exports.fastUri=PP});var CL=q(OP=>{"use strict";Object.defineProperty(OP,"__esModule",{value:!0});var zL=TP();zL.code='require("ajv/dist/runtime/uri").default';OP.default=zL});var ZL=q(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.CodeGen=jr.Name=jr.nil=jr.stringify=jr.str=jr._=jr.KeywordCxt=void 0;var Koe=Wf();Object.defineProperty(jr,"KeywordCxt",{enumerable:!0,get:function(){return Koe.KeywordCxt}});var vl=ot();Object.defineProperty(jr,"_",{enumerable:!0,get:function(){return vl._}});Object.defineProperty(jr,"str",{enumerable:!0,get:function(){return vl.str}});Object.defineProperty(jr,"stringify",{enumerable:!0,get:function(){return vl.stringify}});Object.defineProperty(jr,"nil",{enumerable:!0,get:function(){return vl.nil}});Object.defineProperty(jr,"Name",{enumerable:!0,get:function(){return vl.Name}});Object.defineProperty(jr,"CodeGen",{enumerable:!0,get:function(){return vl.CodeGen}});var Hoe=Cv(),UL=Bf(),Joe=aP(),Kf=Av(),Yoe=ot(),Hf=qf(),Lv=Lf(),zP=bt(),jL=bL(),Qoe=CL(),ML=(e,t)=>new RegExp(e,t);ML.code="new RegExp";var Xoe=["removeAdditional","useDefaults","coerceTypes"],eue=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),tue={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},rue={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},AL=200;function nue(e){var t,r,n,i,a,s,o,u,l,c,d,f,p,h,y,_,m,g,v,b,w,x,k,$,T;let j=e.strict,P=(t=e.code)===null||t===void 0?void 0:t.optimize,U=P===!0||P===void 0?1:P||0,B=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ML,C=(i=e.uriResolver)!==null&&i!==void 0?i:Qoe.default;return{strictSchema:(s=(a=e.strictSchema)!==null&&a!==void 0?a:j)!==null&&s!==void 0?s:!0,strictNumbers:(u=(o=e.strictNumbers)!==null&&o!==void 0?o:j)!==null&&u!==void 0?u:!0,strictTypes:(c=(l=e.strictTypes)!==null&&l!==void 0?l:j)!==null&&c!==void 0?c:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:j)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=e.strictRequired)!==null&&p!==void 0?p:j)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:U,regExp:B}:{optimize:U,regExp:B},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:AL,loopEnum:(_=e.loopEnum)!==null&&_!==void 0?_:AL,meta:(m=e.meta)!==null&&m!==void 0?m:!0,messages:(g=e.messages)!==null&&g!==void 0?g:!0,inlineRefs:(v=e.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(b=e.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(x=e.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:($=e.unicodeRegExp)!==null&&$!==void 0?$:!0,int32range:(T=e.int32range)!==null&&T!==void 0?T:!0,uriResolver:C}}var Jf=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...nue(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new Yoe.ValueScope({scope:{},prefixes:eue,es5:r,lines:n}),this.logger=lue(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,Joe.getRules)(),RL.call(this,tue,t,"NOT SUPPORTED"),RL.call(this,rue,t,"DEPRECATED","warn"),this._metaOpts=oue.call(this),t.formats&&aue.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&sue.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),iue.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=jL;n==="id"&&(i={...jL},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(c,d){await a.call(this,c.$schema);let f=this._addSchema(c,d);return f.validate||s.call(this,f)}async function a(c){c&&!this.getSchema(c)&&await i.call(this,{$ref:c},!0)}async function s(c){try{return this._compileSchemaEnv(c)}catch(d){if(!(d instanceof UL.default))throw d;return o.call(this,d),await u.call(this,d.missingSchema),s.call(this,c)}}function o({missingSchema:c,missingRef:d}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${d} cannot be resolved`)}async function u(c){let d=await l.call(this,c);this.refs[c]||await a.call(this,d.$schema),this.refs[c]||this.addSchema(d,c,r)}async function l(c){let d=this._loading[c];if(d)return d;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,i);return this}let a;if(typeof t=="object"){let{schemaId:s}=this.opts;if(a=t[s],a!==void 0&&typeof a!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Hf.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return i}getSchema(t){let r;for(;typeof(r=DL.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Kf.SchemaEnv({schema:{},schemaId:n});if(r=Kf.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=DL.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Hf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(due.call(this,n,r),!r)return(0,zP.eachItem)(n,a=>NP.call(this,a)),this;pue.call(this,r);let i={...r,type:(0,Lv.getJSONTypes)(r.type),schemaType:(0,Lv.getJSONTypes)(r.schemaType)};return(0,zP.eachItem)(n,i.type.length===0?a=>NP.call(this,a,i):a=>i.type.forEach(s=>NP.call(this,a,i,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(a=>a.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,a)=>i+r+a)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let a=i.split("/").slice(1),s=t;for(let o of a)s=s[o];for(let o in n){let u=n[o];if(typeof u!="object")continue;let{$data:l}=u.definition,c=s[o];l&&c&&(s[o]=LL(c))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,a=this.opts.addUsedSchema){let s,{schemaId:o}=this.opts;if(typeof t=="object")s=t[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,Hf.normalizeId)(s||n);let l=Hf.getSchemaRefs.call(this,t,n);return u=new Kf.SchemaEnv({schema:t,schemaId:o,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),a&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Kf.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Kf.compileSchema.call(this,t)}finally{this.opts=r}}};Jf.ValidationError=Hoe.default;Jf.MissingRefError=UL.default;jr.default=Jf;function RL(e,t,r,n="error"){for(let i in e){let a=i;a in t&&this.logger[n](`${r}: option ${i}. ${e[a]}`)}}function DL(e){return e=(0,Hf.normalizeId)(e),this.schemas[e]||this.refs[e]}function iue(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function aue(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function sue(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function oue(){let e={...this.opts};for(let t of Xoe)delete e[t];return e}var uue={log(){},warn(){},error(){}};function lue(e){if(e===!1)return uue;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var cue=/^[a-z_$][a-z0-9_$:-]*$/i;function due(e,t){let{RULES:r}=this;if((0,zP.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!cue.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function NP(e,t,r){var n;let i=t?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,s=i?a.post:a.rules.find(({type:u})=>u===r);if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,Lv.getJSONTypes)(t.type),schemaType:(0,Lv.getJSONTypes)(t.schemaType)}};t.before?fue.call(this,s,o,t.before):s.rules.push(o),a.all[e]=o,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}function fue(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function pue(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=LL(t)),e.validateSchema=this.compile(t,!0))}var mue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function LL(e){return{anyOf:[e,mue]}}});var qL=q(CP=>{"use strict";Object.defineProperty(CP,"__esModule",{value:!0});var hue={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};CP.default=hue});var BL=q(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.callRef=yo.getValidate=void 0;var gue=Bf(),FL=ui(),In=ot(),yl=za(),VL=Av(),Zv=bt(),vue={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:a,validateName:s,opts:o,self:u}=n,{root:l}=a;if((r==="#"||r==="#/")&&i===l.baseId)return d();let c=VL.resolveRef.call(u,l,i,r);if(c===void 0)throw new gue.default(n.opts.uriResolver,i,r);if(c instanceof VL.SchemaEnv)return f(c);return p(c);function d(){if(a===l)return qv(e,s,a,a.$async);let h=t.scopeValue("root",{ref:l});return qv(e,(0,In._)`${h}.validate`,l,l.$async)}function f(h){let y=WL(e,h);qv(e,y,h,h.$async)}function p(h){let y=t.scopeValue("schema",o.code.source===!0?{ref:h,code:(0,In.stringify)(h)}:{ref:h}),_=t.name("valid"),m=e.subschema({schema:h,dataTypes:[],schemaPath:In.nil,topSchemaRef:y,errSchemaPath:r},_);e.mergeEvaluated(m),e.ok(_)}}};function WL(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,In._)`${r.scopeValue("wrapper",{ref:t})}.validate`}yo.getValidate=WL;function qv(e,t,r,n){let{gen:i,it:a}=e,{allErrors:s,schemaEnv:o,opts:u}=a,l=u.passContext?yl.default.this:In.nil;n?c():d();function c(){if(!o.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,In._)`await ${(0,FL.callValidateCode)(e,t,l)}`),p(t),s||i.assign(h,!0)},y=>{i.if((0,In._)`!(${y} instanceof ${a.ValidationError})`,()=>i.throw(y)),f(y),s||i.assign(h,!1)}),e.ok(h)}function d(){e.result((0,FL.callValidateCode)(e,t,l),()=>p(t),()=>f(t))}function f(h){let y=(0,In._)`${h}.errors`;i.assign(yl.default.vErrors,(0,In._)`${yl.default.vErrors} === null ? ${y} : ${yl.default.vErrors}.concat(${y})`),i.assign(yl.default.errors,(0,In._)`${yl.default.vErrors}.length`)}function p(h){var y;if(!a.opts.unevaluated)return;let _=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(a.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(a.props=Zv.mergeEvaluated.props(i,_.props,a.props));else{let m=i.var("props",(0,In._)`${h}.evaluated.props`);a.props=Zv.mergeEvaluated.props(i,m,a.props,In.Name)}if(a.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(a.items=Zv.mergeEvaluated.items(i,_.items,a.items));else{let m=i.var("items",(0,In._)`${h}.evaluated.items`);a.items=Zv.mergeEvaluated.items(i,m,a.items,In.Name)}}}yo.callRef=qv;yo.default=vue});var GL=q(jP=>{"use strict";Object.defineProperty(jP,"__esModule",{value:!0});var yue=qL(),_ue=BL(),bue=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yue.default,_ue.default];jP.default=bue});var KL=q(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:!0});var Fv=ot(),ws=Fv.operators,Vv={maximum:{okStr:"<=",ok:ws.LTE,fail:ws.GT},minimum:{okStr:">=",ok:ws.GTE,fail:ws.LT},exclusiveMaximum:{okStr:"<",ok:ws.LT,fail:ws.GTE},exclusiveMinimum:{okStr:">",ok:ws.GT,fail:ws.LTE}},wue={message:({keyword:e,schemaCode:t})=>(0,Fv.str)`must be ${Vv[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Fv._)`{comparison: ${Vv[e].okStr}, limit: ${t}}`},xue={keyword:Object.keys(Vv),type:"number",schemaType:"number",$data:!0,error:wue,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Fv._)`${r} ${Vv[t].fail} ${n} || isNaN(${r})`)}};AP.default=xue});var HL=q(RP=>{"use strict";Object.defineProperty(RP,"__esModule",{value:!0});var Yf=ot(),kue={message:({schemaCode:e})=>(0,Yf.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Yf._)`{multipleOf: ${e}}`},Sue={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kue,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,a=i.opts.multipleOfPrecision,s=t.let("res"),o=a?(0,Yf._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${a}`:(0,Yf._)`${s} !== parseInt(${s})`;e.fail$data((0,Yf._)`(${n} === 0 || (${s} = ${r}/${n}, ${o}))`)}};RP.default=Sue});var YL=q(DP=>{"use strict";Object.defineProperty(DP,"__esModule",{value:!0});function JL(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}DP.default=JL;JL.code='require("ajv/dist/runtime/ucs2length").default'});var QL=q(UP=>{"use strict";Object.defineProperty(UP,"__esModule",{value:!0});var _o=ot(),Iue=bt(),$ue=YL(),Eue={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,_o.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,_o._)`{limit: ${e}}`},Pue={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Eue,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,a=t==="maxLength"?_o.operators.GT:_o.operators.LT,s=i.opts.unicode===!1?(0,_o._)`${r}.length`:(0,_o._)`${(0,Iue.useFunc)(e.gen,$ue.default)}(${r})`;e.fail$data((0,_o._)`${s} ${a} ${n}`)}};UP.default=Pue});var XL=q(MP=>{"use strict";Object.defineProperty(MP,"__esModule",{value:!0});var Tue=ui(),Oue=bt(),_l=ot(),Nue={message:({schemaCode:e})=>(0,_l.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,_l._)`{pattern: ${e}}`},zue={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Nue,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:a,it:s}=e,o=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=s.opts.code,l=u.code==="new RegExp"?(0,_l._)`new RegExp`:(0,Oue.useFunc)(t,u),c=t.let("valid");t.try(()=>t.assign(c,(0,_l._)`${l}(${a}, ${o}).test(${r})`),()=>t.assign(c,!1)),e.fail$data((0,_l._)`!${c}`)}else{let u=(0,Tue.usePattern)(e,i);e.fail$data((0,_l._)`!${u}.test(${r})`)}}};MP.default=zue});var eZ=q(LP=>{"use strict";Object.defineProperty(LP,"__esModule",{value:!0});var Qf=ot(),Cue={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Qf.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Qf._)`{limit: ${e}}`},jue={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Cue,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Qf.operators.GT:Qf.operators.LT;e.fail$data((0,Qf._)`Object.keys(${r}).length ${i} ${n}`)}};LP.default=jue});var tZ=q(ZP=>{"use strict";Object.defineProperty(ZP,"__esModule",{value:!0});var Xf=ui(),ep=ot(),Aue=bt(),Rue={message:({params:{missingProperty:e}})=>(0,ep.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ep._)`{missingProperty: ${e}}`},Due={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Rue,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:a,it:s}=e,{opts:o}=s;if(!a&&r.length===0)return;let u=r.length>=o.loopRequired;if(s.allErrors?l():c(),o.strictRequired){let p=e.parentSchema.properties,{definedProperties:h}=e.it;for(let y of r)if(p?.[y]===void 0&&!h.has(y)){let _=s.schemaEnv.baseId+s.errSchemaPath,m=`required property "${y}" is not defined at "${_}" (strictRequired)`;(0,Aue.checkStrictMode)(s,m,s.opts.strictRequired)}}function l(){if(u||a)e.block$data(ep.nil,d);else for(let p of r)(0,Xf.checkReportMissingProp)(e,p)}function c(){let p=t.let("missing");if(u||a){let h=t.let("valid",!0);e.block$data(h,()=>f(p,h)),e.ok(h)}else t.if((0,Xf.checkMissingProp)(e,r,p)),(0,Xf.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",n,p=>{e.setParams({missingProperty:p}),t.if((0,Xf.noPropertyInData)(t,i,p,o.ownProperties),()=>e.error())})}function f(p,h){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(h,(0,Xf.propertyInData)(t,i,p,o.ownProperties)),t.if((0,ep.not)(h),()=>{e.error(),t.break()})},ep.nil)}}};ZP.default=Due});var rZ=q(qP=>{"use strict";Object.defineProperty(qP,"__esModule",{value:!0});var tp=ot(),Uue={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,tp.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,tp._)`{limit: ${e}}`},Mue={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Uue,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?tp.operators.GT:tp.operators.LT;e.fail$data((0,tp._)`${r}.length ${i} ${n}`)}};qP.default=Mue});var Wv=q(FP=>{"use strict";Object.defineProperty(FP,"__esModule",{value:!0});var nZ=Zf();nZ.code='require("ajv/dist/runtime/equal").default';FP.default=nZ});var iZ=q(WP=>{"use strict";Object.defineProperty(WP,"__esModule",{value:!0});var VP=Lf(),Ar=ot(),Lue=bt(),Zue=Wv(),que={message:({params:{i:e,j:t}})=>(0,Ar.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ar._)`{i: ${e}, j: ${t}}`},Fue={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:que,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:a,schemaCode:s,it:o}=e;if(!n&&!i)return;let u=t.let("valid"),l=a.items?(0,VP.getSchemaTypes)(a.items):[];e.block$data(u,c,(0,Ar._)`${s} === false`),e.ok(u);function c(){let h=t.let("i",(0,Ar._)`${r}.length`),y=t.let("j");e.setParams({i:h,j:y}),t.assign(u,!0),t.if((0,Ar._)`${h} > 1`,()=>(d()?f:p)(h,y))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,y){let _=t.name("item"),m=(0,VP.checkDataTypes)(l,_,o.opts.strictNumbers,VP.DataType.Wrong),g=t.const("indices",(0,Ar._)`{}`);t.for((0,Ar._)`;${h}--;`,()=>{t.let(_,(0,Ar._)`${r}[${h}]`),t.if(m,(0,Ar._)`continue`),l.length>1&&t.if((0,Ar._)`typeof ${_} == "string"`,(0,Ar._)`${_} += "_"`),t.if((0,Ar._)`typeof ${g}[${_}] == "number"`,()=>{t.assign(y,(0,Ar._)`${g}[${_}]`),e.error(),t.assign(u,!1).break()}).code((0,Ar._)`${g}[${_}] = ${h}`)})}function p(h,y){let _=(0,Lue.useFunc)(t,Zue.default),m=t.name("outer");t.label(m).for((0,Ar._)`;${h}--;`,()=>t.for((0,Ar._)`${y} = ${h}; ${y}--;`,()=>t.if((0,Ar._)`${_}(${r}[${h}], ${r}[${y}])`,()=>{e.error(),t.assign(u,!1).break(m)})))}}};WP.default=Fue});var aZ=q(GP=>{"use strict";Object.defineProperty(GP,"__esModule",{value:!0});var BP=ot(),Vue=bt(),Wue=Wv(),Bue={message:"must be equal to constant",params:({schemaCode:e})=>(0,BP._)`{allowedValue: ${e}}`},Gue={keyword:"const",$data:!0,error:Bue,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:a}=e;n||a&&typeof a=="object"?e.fail$data((0,BP._)`!${(0,Vue.useFunc)(t,Wue.default)}(${r}, ${i})`):e.fail((0,BP._)`${a} !== ${r}`)}};GP.default=Gue});var sZ=q(KP=>{"use strict";Object.defineProperty(KP,"__esModule",{value:!0});var rp=ot(),Kue=bt(),Hue=Wv(),Jue={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,rp._)`{allowedValues: ${e}}`},Yue={keyword:"enum",schemaType:"array",$data:!0,error:Jue,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:a,it:s}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let o=i.length>=s.opts.loopEnum,u,l=()=>u??(u=(0,Kue.useFunc)(t,Hue.default)),c;if(o||n)c=t.let("valid"),e.block$data(c,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=t.const("vSchema",a);c=(0,rp.or)(...i.map((h,y)=>f(p,y)))}e.pass(c);function d(){t.assign(c,!1),t.forOf("v",a,p=>t.if((0,rp._)`${l()}(${r}, ${p})`,()=>t.assign(c,!0).break()))}function f(p,h){let y=i[h];return typeof y=="object"&&y!==null?(0,rp._)`${l()}(${r}, ${p}[${h}])`:(0,rp._)`${r} === ${y}`}}};KP.default=Yue});var oZ=q(HP=>{"use strict";Object.defineProperty(HP,"__esModule",{value:!0});var Que=KL(),Xue=HL(),ele=QL(),tle=XL(),rle=eZ(),nle=tZ(),ile=rZ(),ale=iZ(),sle=aZ(),ole=sZ(),ule=[Que.default,Xue.default,ele.default,tle.default,rle.default,nle.default,ile.default,ale.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},sle.default,ole.default];HP.default=ule});var YP=q(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.validateAdditionalItems=void 0;var bo=ot(),JP=bt(),lle={message:({params:{len:e}})=>(0,bo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,bo._)`{limit: ${e}}`},cle={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:lle,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,JP.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}uZ(e,n)}};function uZ(e,t){let{gen:r,schema:n,data:i,keyword:a,it:s}=e;s.items=!0;let o=r.const("len",(0,bo._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,bo._)`${o} <= ${t.length}`);else if(typeof n=="object"&&!(0,JP.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,bo._)`${o} <= ${t.length}`);r.if((0,bo.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,o,c=>{e.subschema({keyword:a,dataProp:c,dataPropType:JP.Type.Num},l),s.allErrors||r.if((0,bo.not)(l),()=>r.break())})}}np.validateAdditionalItems=uZ;np.default=cle});var QP=q(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.validateTuple=void 0;var lZ=ot(),Bv=bt(),dle=ui(),fle={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return cZ(e,"additionalItems",t);r.items=!0,!(0,Bv.alwaysValidSchema)(r,t)&&e.ok((0,dle.validateArray)(e))}};function cZ(e,t,r=e.schema){let{gen:n,parentSchema:i,data:a,keyword:s,it:o}=e;c(i),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=Bv.mergeEvaluated.items(n,r.length,o.items));let u=n.name("valid"),l=n.const("len",(0,lZ._)`${a}.length`);r.forEach((d,f)=>{(0,Bv.alwaysValidSchema)(o,d)||(n.if((0,lZ._)`${l} > ${f}`,()=>e.subschema({keyword:s,schemaProp:f,dataProp:f},u)),e.ok(u))});function c(d){let{opts:f,errSchemaPath:p}=o,h=r.length,y=h===d.minItems&&(h===d.maxItems||d[t]===!1);if(f.strictTuples&&!y){let _=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Bv.checkStrictMode)(o,_,f.strictTuples)}}}ip.validateTuple=cZ;ip.default=fle});var dZ=q(XP=>{"use strict";Object.defineProperty(XP,"__esModule",{value:!0});var ple=QP(),mle={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ple.validateTuple)(e,"items")};XP.default=mle});var pZ=q(e1=>{"use strict";Object.defineProperty(e1,"__esModule",{value:!0});var fZ=ot(),hle=bt(),gle=ui(),vle=YP(),yle={message:({params:{len:e}})=>(0,fZ.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,fZ._)`{limit: ${e}}`},_le={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yle,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,hle.alwaysValidSchema)(n,t)&&(i?(0,vle.validateAdditionalItems)(e,i):e.ok((0,gle.validateArray)(e)))}};e1.default=_le});var mZ=q(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});var ci=ot(),Gv=bt(),ble={message:({params:{min:e,max:t}})=>t===void 0?(0,ci.str)`must contain at least ${e} valid item(s)`:(0,ci.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,ci._)`{minContains: ${e}}`:(0,ci._)`{minContains: ${e}, maxContains: ${t}}`},wle={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ble,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e,s,o,{minContains:u,maxContains:l}=n;a.opts.next?(s=u===void 0?1:u,o=l):s=1;let c=t.const("len",(0,ci._)`${i}.length`);if(e.setParams({min:s,max:o}),o===void 0&&s===0){(0,Gv.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&s>o){(0,Gv.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Gv.alwaysValidSchema)(a,r)){let y=(0,ci._)`${c} >= ${s}`;o!==void 0&&(y=(0,ci._)`${y} && ${c} <= ${o}`),e.pass(y);return}a.items=!0;let d=t.name("valid");o===void 0&&s===1?p(d,()=>t.if(d,()=>t.break())):s===0?(t.let(d,!0),o!==void 0&&t.if((0,ci._)`${i}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let y=t.name("_valid"),_=t.let("count",0);p(y,()=>t.if(y,()=>h(_)))}function p(y,_){t.forRange("i",0,c,m=>{e.subschema({keyword:"contains",dataProp:m,dataPropType:Gv.Type.Num,compositeRule:!0},y),_()})}function h(y){t.code((0,ci._)`${y}++`),o===void 0?t.if((0,ci._)`${y} >= ${s}`,()=>t.assign(d,!0).break()):(t.if((0,ci._)`${y} > ${o}`,()=>t.assign(d,!1).break()),s===1?t.assign(d,!0):t.if((0,ci._)`${y} >= ${s}`,()=>t.assign(d,!0)))}}};t1.default=wle});var vZ=q(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.validateSchemaDeps=ia.validatePropertyDeps=ia.error=void 0;var r1=ot(),xle=bt(),ap=ui();ia.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,r1.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,r1._)`{property: ${e},
229
+ missingProperty: ${n},
230
+ depsCount: ${t},
231
+ deps: ${r}}`};var kle={keyword:"dependencies",type:"object",schemaType:"object",error:ia.error,code(e){let[t,r]=Sle(e);hZ(e,t),gZ(e,r)}};function Sle({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function hZ(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let s in t){let o=t[s];if(o.length===0)continue;let u=(0,ap.propertyInData)(r,n,s,i.opts.ownProperties);e.setParams({property:s,depsCount:o.length,deps:o.join(", ")}),i.allErrors?r.if(u,()=>{for(let l of o)(0,ap.checkReportMissingProp)(e,l)}):(r.if((0,r1._)`${u} && (${(0,ap.checkMissingProp)(e,o,a)})`),(0,ap.reportMissingProp)(e,a),r.else())}}ia.validatePropertyDeps=hZ;function gZ(e,t=e.schema){let{gen:r,data:n,keyword:i,it:a}=e,s=r.name("valid");for(let o in t)(0,xle.alwaysValidSchema)(a,t[o])||(r.if((0,ap.propertyInData)(r,n,o,a.opts.ownProperties),()=>{let u=e.subschema({keyword:i,schemaProp:o},s);e.mergeValidEvaluated(u,s)},()=>r.var(s,!0)),e.ok(s))}ia.validateSchemaDeps=gZ;ia.default=kle});var _Z=q(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});var yZ=ot(),Ile=bt(),$le={message:"property name must be valid",params:({params:e})=>(0,yZ._)`{propertyName: ${e.propertyName}}`},Ele={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:$le,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,Ile.alwaysValidSchema)(i,r))return;let a=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},a),t.if((0,yZ.not)(a),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(a)}};n1.default=Ele});var a1=q(i1=>{"use strict";Object.defineProperty(i1,"__esModule",{value:!0});var Kv=ui(),Mi=ot(),Ple=za(),Hv=bt(),Tle={message:"must NOT have additional properties",params:({params:e})=>(0,Mi._)`{additionalProperty: ${e.additionalProperty}}`},Ole={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Tle,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:a,it:s}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:o,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,Hv.alwaysValidSchema)(s,r))return;let l=(0,Kv.allSchemaProperties)(n.properties),c=(0,Kv.allSchemaProperties)(n.patternProperties);d(),e.ok((0,Mi._)`${a} === ${Ple.default.errors}`);function d(){t.forIn("key",i,_=>{!l.length&&!c.length?h(_):t.if(f(_),()=>h(_))})}function f(_){let m;if(l.length>8){let g=(0,Hv.schemaRefOrVal)(s,n.properties,"properties");m=(0,Kv.isOwnProperty)(t,g,_)}else l.length?m=(0,Mi.or)(...l.map(g=>(0,Mi._)`${_} === ${g}`)):m=Mi.nil;return c.length&&(m=(0,Mi.or)(m,...c.map(g=>(0,Mi._)`${(0,Kv.usePattern)(e,g)}.test(${_})`))),(0,Mi.not)(m)}function p(_){t.code((0,Mi._)`delete ${i}[${_}]`)}function h(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){p(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),o||t.break();return}if(typeof r=="object"&&!(0,Hv.alwaysValidSchema)(s,r)){let m=t.name("valid");u.removeAdditional==="failing"?(y(_,m,!1),t.if((0,Mi.not)(m),()=>{e.reset(),p(_)})):(y(_,m),o||t.if((0,Mi.not)(m),()=>t.break()))}}function y(_,m,g){let v={keyword:"additionalProperties",dataProp:_,dataPropType:Hv.Type.Str};g===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(v,m)}}};i1.default=Ole});var xZ=q(o1=>{"use strict";Object.defineProperty(o1,"__esModule",{value:!0});var Nle=Wf(),bZ=ui(),s1=bt(),wZ=a1(),zle={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e;a.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&wZ.default.code(new Nle.KeywordCxt(a,wZ.default,"additionalProperties"));let s=(0,bZ.allSchemaProperties)(r);for(let d of s)a.definedProperties.add(d);a.opts.unevaluated&&s.length&&a.props!==!0&&(a.props=s1.mergeEvaluated.props(t,(0,s1.toHash)(s),a.props));let o=s.filter(d=>!(0,s1.alwaysValidSchema)(a,r[d]));if(o.length===0)return;let u=t.name("valid");for(let d of o)l(d)?c(d):(t.if((0,bZ.propertyInData)(t,i,d,a.opts.ownProperties)),c(d),a.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(u);function l(d){return a.opts.useDefaults&&!a.compositeRule&&r[d].default!==void 0}function c(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},u)}}};o1.default=zle});var $Z=q(u1=>{"use strict";Object.defineProperty(u1,"__esModule",{value:!0});var kZ=ui(),Jv=ot(),SZ=bt(),IZ=bt(),Cle={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:a}=e,{opts:s}=a,o=(0,kZ.allSchemaProperties)(r),u=o.filter(y=>(0,SZ.alwaysValidSchema)(a,r[y]));if(o.length===0||u.length===o.length&&(!a.opts.unevaluated||a.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,c=t.name("valid");a.props!==!0&&!(a.props instanceof Jv.Name)&&(a.props=(0,IZ.evaluatedPropsToName)(t,a.props));let{props:d}=a;f();function f(){for(let y of o)l&&p(y),a.allErrors?h(y):(t.var(c,!0),h(y),t.if(c))}function p(y){for(let _ in l)new RegExp(y).test(_)&&(0,SZ.checkStrictMode)(a,`property ${_} matches pattern ${y} (use allowMatchingProperties)`)}function h(y){t.forIn("key",n,_=>{t.if((0,Jv._)`${(0,kZ.usePattern)(e,y)}.test(${_})`,()=>{let m=u.includes(y);m||e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:_,dataPropType:IZ.Type.Str},c),a.opts.unevaluated&&d!==!0?t.assign((0,Jv._)`${d}[${_}]`,!0):!m&&!a.allErrors&&t.if((0,Jv.not)(c),()=>t.break())})})}}};u1.default=Cle});var EZ=q(l1=>{"use strict";Object.defineProperty(l1,"__esModule",{value:!0});var jle=bt(),Ale={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,jle.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};l1.default=Ale});var PZ=q(c1=>{"use strict";Object.defineProperty(c1,"__esModule",{value:!0});var Rle=ui(),Dle={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Rle.validateUnion,error:{message:"must match a schema in anyOf"}};c1.default=Dle});var TZ=q(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});var Yv=ot(),Ule=bt(),Mle={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Yv._)`{passingSchemas: ${e.passing}}`},Lle={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Mle,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let a=r,s=t.let("valid",!1),o=t.let("passing",null),u=t.name("_valid");e.setParams({passing:o}),t.block(l),e.result(s,()=>e.reset(),()=>e.error(!0));function l(){a.forEach((c,d)=>{let f;(0,Ule.alwaysValidSchema)(i,c)?t.var(u,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},u),d>0&&t.if((0,Yv._)`${u} && ${s}`).assign(s,!1).assign(o,(0,Yv._)`[${o}, ${d}]`).else(),t.if(u,()=>{t.assign(s,!0),t.assign(o,d),f&&e.mergeEvaluated(f,Yv.Name)})})}}};d1.default=Lle});var OZ=q(f1=>{"use strict";Object.defineProperty(f1,"__esModule",{value:!0});var Zle=bt(),qle={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((a,s)=>{if((0,Zle.alwaysValidSchema)(n,a))return;let o=e.subschema({keyword:"allOf",schemaProp:s},i);e.ok(i),e.mergeEvaluated(o)})}};f1.default=qle});var CZ=q(p1=>{"use strict";Object.defineProperty(p1,"__esModule",{value:!0});var Qv=ot(),zZ=bt(),Fle={message:({params:e})=>(0,Qv.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Qv._)`{failingKeyword: ${e.ifClause}}`},Vle={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Fle,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,zZ.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=NZ(n,"then"),a=NZ(n,"else");if(!i&&!a)return;let s=t.let("valid",!0),o=t.name("_valid");if(u(),e.reset(),i&&a){let c=t.let("ifClause");e.setParams({ifClause:c}),t.if(o,l("then",c),l("else",c))}else i?t.if(o,l("then")):t.if((0,Qv.not)(o),l("else"));e.pass(s,()=>e.error(!0));function u(){let c=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(c)}function l(c,d){return()=>{let f=e.subschema({keyword:c},o);t.assign(s,o),e.mergeValidEvaluated(f,s),d?t.assign(d,(0,Qv._)`${c}`):e.setParams({ifClause:c})}}}};function NZ(e,t){let r=e.schema[t];return r!==void 0&&!(0,zZ.alwaysValidSchema)(e,r)}p1.default=Vle});var jZ=q(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});var Wle=bt(),Ble={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Wle.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};m1.default=Ble});var AZ=q(h1=>{"use strict";Object.defineProperty(h1,"__esModule",{value:!0});var Gle=YP(),Kle=dZ(),Hle=QP(),Jle=pZ(),Yle=mZ(),Qle=vZ(),Xle=_Z(),ece=a1(),tce=xZ(),rce=$Z(),nce=EZ(),ice=PZ(),ace=TZ(),sce=OZ(),oce=CZ(),uce=jZ();function lce(e=!1){let t=[nce.default,ice.default,ace.default,sce.default,oce.default,uce.default,Xle.default,ece.default,Qle.default,tce.default,rce.default];return e?t.push(Kle.default,Jle.default):t.push(Gle.default,Hle.default),t.push(Yle.default),t}h1.default=lce});var RZ=q(g1=>{"use strict";Object.defineProperty(g1,"__esModule",{value:!0});var fr=ot(),cce={message:({schemaCode:e})=>(0,fr.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,fr._)`{format: ${e}}`},dce={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:cce,code(e,t){let{gen:r,data:n,$data:i,schema:a,schemaCode:s,it:o}=e,{opts:u,errSchemaPath:l,schemaEnv:c,self:d}=o;if(!u.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:u.code.formats}),y=r.const("fDef",(0,fr._)`${h}[${s}]`),_=r.let("fType"),m=r.let("format");r.if((0,fr._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(_,(0,fr._)`${y}.type || "string"`).assign(m,(0,fr._)`${y}.validate`),()=>r.assign(_,(0,fr._)`"string"`).assign(m,y)),e.fail$data((0,fr.or)(g(),v()));function g(){return u.strictSchema===!1?fr.nil:(0,fr._)`${s} && !${m}`}function v(){let b=c.$async?(0,fr._)`(${y}.async ? await ${m}(${n}) : ${m}(${n}))`:(0,fr._)`${m}(${n})`,w=(0,fr._)`(typeof ${m} == "function" ? ${b} : ${m}.test(${n}))`;return(0,fr._)`${m} && ${m} !== true && ${_} === ${t} && !${w}`}}function p(){let h=d.formats[a];if(!h){g();return}if(h===!0)return;let[y,_,m]=v(h);y===t&&e.pass(b());function g(){if(u.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${a}" ignored in schema at path "${l}"`}}function v(w){let x=w instanceof RegExp?(0,fr.regexpCode)(w):u.code.formats?(0,fr._)`${u.code.formats}${(0,fr.getProperty)(a)}`:void 0,k=r.scopeValue("formats",{key:a,ref:w,code:x});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,fr._)`${k}.validate`]:["string",w,k]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!c.$async)throw new Error("async format in sync schema");return(0,fr._)`await ${m}(${n})`}return typeof _=="function"?(0,fr._)`${m}(${n})`:(0,fr._)`${m}.test(${n})`}}}};g1.default=dce});var DZ=q(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});var fce=RZ(),pce=[fce.default];v1.default=pce});var UZ=q(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.contentVocabulary=bl.metadataVocabulary=void 0;bl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];bl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var LZ=q(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});var mce=GL(),hce=oZ(),gce=AZ(),vce=DZ(),MZ=UZ(),yce=[mce.default,hce.default,(0,gce.default)(),vce.default,MZ.metadataVocabulary,MZ.contentVocabulary];y1.default=yce});var qZ=q(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});Xv.DiscrError=void 0;var ZZ;(function(e){e.Tag="tag",e.Mapping="mapping"})(ZZ||(Xv.DiscrError=ZZ={}))});var VZ=q(b1=>{"use strict";Object.defineProperty(b1,"__esModule",{value:!0});var wl=ot(),_1=qZ(),FZ=Av(),_ce=Bf(),bce=bt(),wce={message:({params:{discrError:e,tagName:t}})=>e===_1.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,wl._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},xce={keyword:"discriminator",type:"object",schemaType:"object",error:wce,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:a}=e,{oneOf:s}=i;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let o=n.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),l=t.const("tag",(0,wl._)`${r}${(0,wl.getProperty)(o)}`);t.if((0,wl._)`typeof ${l} == "string"`,()=>c(),()=>e.error(!1,{discrError:_1.DiscrError.Tag,tag:l,tagName:o})),e.ok(u);function c(){let p=f();t.if(!1);for(let h in p)t.elseIf((0,wl._)`${l} === ${h}`),t.assign(u,d(p[h]));t.else(),e.error(!1,{discrError:_1.DiscrError.Mapping,tag:l,tagName:o}),t.endIf()}function d(p){let h=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:p},h);return e.mergeEvaluated(y,wl.Name),h}function f(){var p;let h={},y=m(i),_=!0;for(let b=0;b<s.length;b++){let w=s[b];if(w?.$ref&&!(0,bce.schemaHasRulesButRef)(w,a.self.RULES)){let k=w.$ref;if(w=FZ.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,k),w instanceof FZ.SchemaEnv&&(w=w.schema),w===void 0)throw new _ce.default(a.opts.uriResolver,a.baseId,k)}let x=(p=w?.properties)===null||p===void 0?void 0:p[o];if(typeof x!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);_=_&&(y||m(w)),g(x,b)}if(!_)throw new Error(`discriminator: "${o}" must be required`);return h;function m({required:b}){return Array.isArray(b)&&b.includes(o)}function g(b,w){if(b.const)v(b.const,w);else if(b.enum)for(let x of b.enum)v(x,w);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function v(b,w){if(typeof b!="string"||b in h)throw new Error(`discriminator: "${o}" values must be unique strings`);h[b]=w}}}};b1.default=xce});var WZ=q((nOe,kce)=>{kce.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var GZ=q((er,w1)=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.MissingRefError=er.ValidationError=er.CodeGen=er.Name=er.nil=er.stringify=er.str=er._=er.KeywordCxt=er.Ajv=void 0;var Sce=ZL(),Ice=LZ(),$ce=VZ(),BZ=WZ(),Ece=["/properties"],ey="http://json-schema.org/draft-07/schema",xl=class extends Sce.default{_addVocabularies(){super._addVocabularies(),Ice.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword($ce.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(BZ,Ece):BZ;this.addMetaSchema(t,ey,!1),this.refs["http://json-schema.org/schema"]=ey}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ey)?ey:void 0)}};er.Ajv=xl;w1.exports=er=xl;w1.exports.Ajv=xl;Object.defineProperty(er,"__esModule",{value:!0});er.default=xl;var Pce=Wf();Object.defineProperty(er,"KeywordCxt",{enumerable:!0,get:function(){return Pce.KeywordCxt}});var kl=ot();Object.defineProperty(er,"_",{enumerable:!0,get:function(){return kl._}});Object.defineProperty(er,"str",{enumerable:!0,get:function(){return kl.str}});Object.defineProperty(er,"stringify",{enumerable:!0,get:function(){return kl.stringify}});Object.defineProperty(er,"nil",{enumerable:!0,get:function(){return kl.nil}});Object.defineProperty(er,"Name",{enumerable:!0,get:function(){return kl.Name}});Object.defineProperty(er,"CodeGen",{enumerable:!0,get:function(){return kl.CodeGen}});var Tce=Cv();Object.defineProperty(er,"ValidationError",{enumerable:!0,get:function(){return Tce.default}});var Oce=Bf();Object.defineProperty(er,"MissingRefError",{enumerable:!0,get:function(){return Oce.default}})});var tq=q(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.formatNames=sa.fastFormats=sa.fullFormats=void 0;function aa(e,t){return{validate:e,compare:t}}sa.fullFormats={date:aa(YZ,I1),time:aa(k1(!0),$1),"date-time":aa(KZ(!0),XZ),"iso-time":aa(k1(),QZ),"iso-date-time":aa(KZ(),eq),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Rce,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Fce,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Dce,int32:{type:"number",validate:Lce},int64:{type:"number",validate:Zce},float:{type:"number",validate:JZ},double:{type:"number",validate:JZ},password:!0,binary:!0};sa.fastFormats={...sa.fullFormats,date:aa(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I1),time:aa(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$1),"date-time":aa(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,XZ),"iso-time":aa(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,QZ),"iso-date-time":aa(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,eq),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};sa.formatNames=Object.keys(sa.fullFormats);function Nce(e){return e%4===0&&(e%100!==0||e%400===0)}var zce=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cce=[0,31,28,31,30,31,30,31,31,30,31,30,31];function YZ(e){let t=zce.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Nce(r)?29:Cce[n])}function I1(e,t){if(e&&t)return e>t?1:e<t?-1:0}var x1=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function k1(e){return function(r){let n=x1.exec(r);if(!n)return!1;let i=+n[1],a=+n[2],s=+n[3],o=n[4],u=n[5]==="-"?-1:1,l=+(n[6]||0),c=+(n[7]||0);if(l>23||c>59||e&&!o)return!1;if(i<=23&&a<=59&&s<60)return!0;let d=a-c*u,f=i-l*u-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function $1(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function QZ(e,t){if(!(e&&t))return;let r=x1.exec(e),n=x1.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var S1=/t|\s/i;function KZ(e){let t=k1(e);return function(n){let i=n.split(S1);return i.length===2&&YZ(i[0])&&t(i[1])}}function XZ(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function eq(e,t){if(!(e&&t))return;let[r,n]=e.split(S1),[i,a]=t.split(S1),s=I1(r,i);if(s!==void 0)return s||$1(n,a)}var jce=/\/|:/,Ace=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Rce(e){return jce.test(e)&&Ace.test(e)}var HZ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Dce(e){return HZ.lastIndex=0,HZ.test(e)}var Uce=-(2**31),Mce=2**31-1;function Lce(e){return Number.isInteger(e)&&e<=Mce&&e>=Uce}function Zce(e){return Number.isInteger(e)}function JZ(){return!0}var qce=/[^\\]\\Z/;function Fce(e){if(qce.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var up=q(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.regexpCode=Pt.getEsmExportName=Pt.getProperty=Pt.safeStringify=Pt.stringify=Pt.strConcat=Pt.addCodeArg=Pt.str=Pt._=Pt.nil=Pt._Code=Pt.Name=Pt.IDENTIFIER=Pt._CodeOrName=void 0;var sp=class{};Pt._CodeOrName=sp;Pt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var wo=class extends sp{constructor(t){if(super(),!Pt.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Pt.Name=wo;var di=class extends sp{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof wo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Pt._Code=di;Pt.nil=new di("");function rq(e,...t){let r=[e[0]],n=0;for(;n<t.length;)P1(r,t[n]),r.push(e[++n]);return new di(r)}Pt._=rq;var E1=new di("+");function nq(e,...t){let r=[op(e[0])],n=0;for(;n<t.length;)r.push(E1),P1(r,t[n]),r.push(E1,op(e[++n]));return Vce(r),new di(r)}Pt.str=nq;function P1(e,t){t instanceof di?e.push(...t._items):t instanceof wo?e.push(t):e.push(Gce(t))}Pt.addCodeArg=P1;function Vce(e){let t=1;for(;t<e.length-1;){if(e[t]===E1){let r=Wce(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Wce(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof wo||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof wo))return`"${e}${t.slice(1)}`}function Bce(e,t){return t.emptyStr()?e:e.emptyStr()?t:nq`${e}${t}`}Pt.strConcat=Bce;function Gce(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:op(Array.isArray(e)?e.join(","):e)}function Kce(e){return new di(op(e))}Pt.stringify=Kce;function op(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Pt.safeStringify=op;function Hce(e){return typeof e=="string"&&Pt.IDENTIFIER.test(e)?new di(`.${e}`):rq`[${e}]`}Pt.getProperty=Hce;function Jce(e){if(typeof e=="string"&&Pt.IDENTIFIER.test(e))return new di(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Pt.getEsmExportName=Jce;function Yce(e){return new di(e.toString())}Pt.regexpCode=Yce});var N1=q(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.ValueScope=En.ValueScopeName=En.Scope=En.varKinds=En.UsedValueState=void 0;var $n=up(),T1=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},ty;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ty||(En.UsedValueState=ty={}));En.varKinds={const:new $n.Name("const"),let:new $n.Name("let"),var:new $n.Name("var")};var ry=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof $n.Name?t:this.name(t)}name(t){return new $n.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};En.Scope=ry;var ny=class extends $n.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,$n._)`.${new $n.Name(r)}[${n}]`}};En.ValueScopeName=ny;var Qce=(0,$n._)`\n`,O1=class extends ry{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Qce:$n.nil}}get(){return this._scope}name(t){return new ny(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:a}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,o=this._values[a];if(o){let c=o.get(s);if(c)return c}else o=this._values[a]=new Map;o.set(s,i);let u=this._scope[a]||(this._scope[a]=[]),l=u.length;return u[l]=r.ref,i.setValue(r,{property:a,itemIndex:l}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,$n._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let a=$n.nil;for(let s in t){let o=t[s];if(!o)continue;let u=n[s]=n[s]||new Map;o.forEach(l=>{if(u.has(l))return;u.set(l,ty.Started);let c=r(l);if(c){let d=this.opts.es5?En.varKinds.var:En.varKinds.const;a=(0,$n._)`${a}${d} ${l} = ${c};${this.opts._n}`}else if(c=i?.(l))a=(0,$n._)`${a}${c}${this.opts._n}`;else throw new T1(l);u.set(l,ty.Completed)})}return a}};En.ValueScope=O1});var Xe=q(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.or=at.and=at.not=at.CodeGen=at.operators=at.varKinds=at.ValueScopeName=at.ValueScope=at.Scope=at.Name=at.regexpCode=at.stringify=at.getProperty=at.nil=at.strConcat=at.str=at._=void 0;var yt=up(),Li=N1(),xs=up();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return xs._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return xs.str}});Object.defineProperty(at,"strConcat",{enumerable:!0,get:function(){return xs.strConcat}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return xs.nil}});Object.defineProperty(at,"getProperty",{enumerable:!0,get:function(){return xs.getProperty}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return xs.stringify}});Object.defineProperty(at,"regexpCode",{enumerable:!0,get:function(){return xs.regexpCode}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return xs.Name}});var oy=N1();Object.defineProperty(at,"Scope",{enumerable:!0,get:function(){return oy.Scope}});Object.defineProperty(at,"ValueScope",{enumerable:!0,get:function(){return oy.ValueScope}});Object.defineProperty(at,"ValueScopeName",{enumerable:!0,get:function(){return oy.ValueScopeName}});Object.defineProperty(at,"varKinds",{enumerable:!0,get:function(){return oy.varKinds}});at.operators={GT:new yt._Code(">"),GTE:new yt._Code(">="),LT:new yt._Code("<"),LTE:new yt._Code("<="),EQ:new yt._Code("==="),NEQ:new yt._Code("!=="),NOT:new yt._Code("!"),OR:new yt._Code("||"),AND:new yt._Code("&&"),ADD:new yt._Code("+")};var Aa=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},z1=class extends Aa{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Li.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Il(this.rhs,t,r)),this}get names(){return this.rhs instanceof yt._CodeOrName?this.rhs.names:{}}},iy=class extends Aa{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof yt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Il(this.rhs,t,r),this}get names(){let t=this.lhs instanceof yt.Name?{}:{...this.lhs.names};return sy(t,this.rhs)}},C1=class extends iy{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},j1=class extends Aa{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},A1=class extends Aa{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},R1=class extends Aa{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},D1=class extends Aa{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Il(this.code,t,r),this}get names(){return this.code instanceof yt._CodeOrName?this.code.names:{}}},lp=class extends Aa{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let a=n[i];a.optimizeNames(t,r)||(Xce(t,a.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>So(t,r.names),{})}},Ra=class extends lp{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},U1=class extends lp{},Sl=class extends Ra{};Sl.kind="else";var xo=class e extends Ra{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Sl(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(iq(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Il(this.condition,t,r),this}get names(){let t=super.names;return sy(t,this.condition),this.else&&So(t,this.else.names),t}};xo.kind="if";var ko=class extends Ra{};ko.kind="for";var M1=class extends ko{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Il(this.iteration,t,r),this}get names(){return So(super.names,this.iteration.names)}},L1=class extends ko{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?Li.varKinds.var:this.varKind,{name:n,from:i,to:a}=this;return`for(${r} ${n}=${i}; ${n}<${a}; ${n}++)`+super.render(t)}get names(){let t=sy(super.names,this.from);return sy(t,this.to)}},ay=class extends ko{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Il(this.iterable,t,r),this}get names(){return So(super.names,this.iterable.names)}},cp=class extends Ra{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};cp.kind="func";var dp=class extends lp{render(t){return"return "+super.render(t)}};dp.kind="return";var Z1=class extends Ra{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&So(t,this.catch.names),this.finally&&So(t,this.finally.names),t}},fp=class extends Ra{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};fp.kind="catch";var pp=class extends Ra{render(t){return"finally"+super.render(t)}};pp.kind="finally";var q1=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
232
+ `:""},this._extScope=t,this._scope=new Li.Scope({parent:t}),this._nodes=[new U1]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let a=this._scope.toName(r);return n!==void 0&&i&&(this._constants[a.str]=n),this._leafNode(new z1(t,a,n)),a}const(t,r,n){return this._def(Li.varKinds.const,t,r,n)}let(t,r,n){return this._def(Li.varKinds.let,t,r,n)}var(t,r,n){return this._def(Li.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new iy(t,r,n))}add(t,r){return this._leafNode(new C1(t,at.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==yt.nil&&this._leafNode(new D1(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,yt.addCodeArg)(r,i));return r.push("}"),new yt._Code(r)}if(t,r,n){if(this._blockNode(new xo(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new xo(t))}else(){return this._elseNode(new Sl)}endIf(){return this._endBlockNode(xo,Sl)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new M1(t),r)}forRange(t,r,n,i,a=this.opts.es5?Li.varKinds.var:Li.varKinds.let){let s=this._scope.toName(t);return this._for(new L1(a,s,r,n),()=>i(s))}forOf(t,r,n,i=Li.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let s=r instanceof yt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,yt._)`${s}.length`,o=>{this.var(a,(0,yt._)`${s}[${o}]`),n(a)})}return this._for(new ay("of",i,a,r),()=>n(a))}forIn(t,r,n,i=this.opts.es5?Li.varKinds.var:Li.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,yt._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new ay("in",i,a,r),()=>n(a))}endFor(){return this._endBlockNode(ko)}label(t){return this._leafNode(new j1(t))}break(t){return this._leafNode(new A1(t))}return(t){let r=new dp;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(dp)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Z1;if(this._blockNode(i),this.code(t),r){let a=this.name("e");this._currNode=i.catch=new fp(a),r(a)}return n&&(this._currNode=i.finally=new pp,this.code(n)),this._endBlockNode(fp,pp)}throw(t){return this._leafNode(new R1(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=yt.nil,n,i){return this._blockNode(new cp(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(cp)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof xo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};at.CodeGen=q1;function So(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function sy(e,t){return t instanceof yt._CodeOrName?So(e,t.names):e}function Il(e,t,r){if(e instanceof yt.Name)return n(e);if(!i(e))return e;return new yt._Code(e._items.reduce((a,s)=>(s instanceof yt.Name&&(s=n(s)),s instanceof yt._Code?a.push(...s._items):a.push(s),a),[]));function n(a){let s=r[a.str];return s===void 0||t[a.str]!==1?a:(delete t[a.str],s)}function i(a){return a instanceof yt._Code&&a._items.some(s=>s instanceof yt.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function Xce(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function iq(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,yt._)`!${F1(e)}`}at.not=iq;var ede=aq(at.operators.AND);function tde(...e){return e.reduce(ede)}at.and=tde;var rde=aq(at.operators.OR);function nde(...e){return e.reduce(rde)}at.or=nde;function aq(e){return(t,r)=>t===yt.nil?r:r===yt.nil?t:(0,yt._)`${F1(t)} ${e} ${F1(r)}`}function F1(e){return e instanceof yt.Name?e:(0,yt._)`(${e})`}});var xt=q(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.checkStrictMode=lt.getErrorPath=lt.Type=lt.useFunc=lt.setEvaluated=lt.evaluatedPropsToName=lt.mergeEvaluated=lt.eachItem=lt.unescapeJsonPointer=lt.escapeJsonPointer=lt.escapeFragment=lt.unescapeFragment=lt.schemaRefOrVal=lt.schemaHasRulesButRef=lt.schemaHasRules=lt.checkUnknownRules=lt.alwaysValidSchema=lt.toHash=void 0;var Bt=Xe(),ide=up();function ade(e){let t={};for(let r of e)t[r]=!0;return t}lt.toHash=ade;function sde(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(uq(e,t),!lq(t,e.self.RULES.all))}lt.alwaysValidSchema=sde;function uq(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let a in t)i[a]||fq(e,`unknown keyword: "${a}"`)}lt.checkUnknownRules=uq;function lq(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}lt.schemaHasRules=lq;function ode(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}lt.schemaHasRulesButRef=ode;function ude({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Bt._)`${r}`}return(0,Bt._)`${e}${t}${(0,Bt.getProperty)(n)}`}lt.schemaRefOrVal=ude;function lde(e){return cq(decodeURIComponent(e))}lt.unescapeFragment=lde;function cde(e){return encodeURIComponent(W1(e))}lt.escapeFragment=cde;function W1(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}lt.escapeJsonPointer=W1;function cq(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}lt.unescapeJsonPointer=cq;function dde(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}lt.eachItem=dde;function sq({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,a,s,o)=>{let u=s===void 0?a:s instanceof Bt.Name?(a instanceof Bt.Name?e(i,a,s):t(i,a,s),s):a instanceof Bt.Name?(t(i,s,a),a):r(a,s);return o===Bt.Name&&!(u instanceof Bt.Name)?n(i,u):u}}lt.mergeEvaluated={props:sq({mergeNames:(e,t,r)=>e.if((0,Bt._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Bt._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,Bt._)`${r} || {}`).code((0,Bt._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Bt._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Bt._)`${r} || {}`),B1(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:dq}),items:sq({mergeNames:(e,t,r)=>e.if((0,Bt._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Bt._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Bt._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,Bt._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function dq(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Bt._)`{}`);return t!==void 0&&B1(e,r,t),r}lt.evaluatedPropsToName=dq;function B1(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Bt._)`${t}${(0,Bt.getProperty)(n)}`,!0))}lt.setEvaluated=B1;var oq={};function fde(e,t){return e.scopeValue("func",{ref:t,code:oq[t.code]||(oq[t.code]=new ide._Code(t.code))})}lt.useFunc=fde;var V1;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(V1||(lt.Type=V1={}));function pde(e,t,r){if(e instanceof Bt.Name){let n=t===V1.Num;return r?n?(0,Bt._)`"[" + ${e} + "]"`:(0,Bt._)`"['" + ${e} + "']"`:n?(0,Bt._)`"/" + ${e}`:(0,Bt._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Bt.getProperty)(e).toString():"/"+W1(e)}lt.getErrorPath=pde;function fq(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}lt.checkStrictMode=fq});var Da=q(G1=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});var Wr=Xe(),mde={data:new Wr.Name("data"),valCxt:new Wr.Name("valCxt"),instancePath:new Wr.Name("instancePath"),parentData:new Wr.Name("parentData"),parentDataProperty:new Wr.Name("parentDataProperty"),rootData:new Wr.Name("rootData"),dynamicAnchors:new Wr.Name("dynamicAnchors"),vErrors:new Wr.Name("vErrors"),errors:new Wr.Name("errors"),this:new Wr.Name("this"),self:new Wr.Name("self"),scope:new Wr.Name("scope"),json:new Wr.Name("json"),jsonPos:new Wr.Name("jsonPos"),jsonLen:new Wr.Name("jsonLen"),jsonPart:new Wr.Name("jsonPart")};G1.default=mde});var mp=q(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.extendErrors=Br.resetErrorsCount=Br.reportExtraError=Br.reportError=Br.keyword$DataError=Br.keywordError=void 0;var kt=Xe(),uy=xt(),mn=Da();Br.keywordError={message:({keyword:e})=>(0,kt.str)`must pass "${e}" keyword validation`};Br.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,kt.str)`"${e}" keyword must be ${t} ($data)`:(0,kt.str)`"${e}" keyword is invalid ($data)`};function hde(e,t=Br.keywordError,r,n){let{it:i}=e,{gen:a,compositeRule:s,allErrors:o}=i,u=hq(e,t,r);n??(s||o)?pq(a,u):mq(i,(0,kt._)`[${u}]`)}Br.reportError=hde;function gde(e,t=Br.keywordError,r){let{it:n}=e,{gen:i,compositeRule:a,allErrors:s}=n,o=hq(e,t,r);pq(i,o),a||s||mq(n,mn.default.vErrors)}Br.reportExtraError=gde;function vde(e,t){e.assign(mn.default.errors,t),e.if((0,kt._)`${mn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,kt._)`${mn.default.vErrors}.length`,t),()=>e.assign(mn.default.vErrors,null)))}Br.resetErrorsCount=vde;function yde({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:a}){if(i===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",i,mn.default.errors,o=>{e.const(s,(0,kt._)`${mn.default.vErrors}[${o}]`),e.if((0,kt._)`${s}.instancePath === undefined`,()=>e.assign((0,kt._)`${s}.instancePath`,(0,kt.strConcat)(mn.default.instancePath,a.errorPath))),e.assign((0,kt._)`${s}.schemaPath`,(0,kt.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,kt._)`${s}.schema`,r),e.assign((0,kt._)`${s}.data`,n))})}Br.extendErrors=yde;function pq(e,t){let r=e.const("err",t);e.if((0,kt._)`${mn.default.vErrors} === null`,()=>e.assign(mn.default.vErrors,(0,kt._)`[${r}]`),(0,kt._)`${mn.default.vErrors}.push(${r})`),e.code((0,kt._)`${mn.default.errors}++`)}function mq(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,kt._)`new ${e.ValidationError}(${t})`):(r.assign((0,kt._)`${n}.errors`,t),r.return(!1))}var Io={keyword:new kt.Name("keyword"),schemaPath:new kt.Name("schemaPath"),params:new kt.Name("params"),propertyName:new kt.Name("propertyName"),message:new kt.Name("message"),schema:new kt.Name("schema"),parentSchema:new kt.Name("parentSchema")};function hq(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,kt._)`{}`:_de(e,t,r)}function _de(e,t,r={}){let{gen:n,it:i}=e,a=[bde(i,r),wde(e,r)];return xde(e,t,a),n.object(...a)}function bde({errorPath:e},{instancePath:t}){let r=t?(0,kt.str)`${e}${(0,uy.getErrorPath)(t,uy.Type.Str)}`:e;return[mn.default.instancePath,(0,kt.strConcat)(mn.default.instancePath,r)]}function wde({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,kt.str)`${t}/${e}`;return r&&(i=(0,kt.str)`${i}${(0,uy.getErrorPath)(r,uy.Type.Str)}`),[Io.schemaPath,i]}function xde(e,{params:t,message:r},n){let{keyword:i,data:a,schemaValue:s,it:o}=e,{opts:u,propertyName:l,topSchemaRef:c,schemaPath:d}=o;n.push([Io.keyword,i],[Io.params,typeof t=="function"?t(e):t||(0,kt._)`{}`]),u.messages&&n.push([Io.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([Io.schema,s],[Io.parentSchema,(0,kt._)`${c}${d}`],[mn.default.data,a]),l&&n.push([Io.propertyName,l])}});var vq=q($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.boolOrEmptySchema=$l.topBoolOrEmptySchema=void 0;var kde=mp(),Sde=Xe(),Ide=Da(),$de={message:"boolean schema is false"};function Ede(e){let{gen:t,schema:r,validateName:n}=e;r===!1?gq(e,!1):typeof r=="object"&&r.$async===!0?t.return(Ide.default.data):(t.assign((0,Sde._)`${n}.errors`,null),t.return(!0))}$l.topBoolOrEmptySchema=Ede;function Pde(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),gq(e)):r.var(t,!0)}$l.boolOrEmptySchema=Pde;function gq(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,kde.reportError)(i,$de,void 0,t)}});var K1=q(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.getRules=El.isJSONType=void 0;var Tde=["string","number","integer","boolean","null","object","array"],Ode=new Set(Tde);function Nde(e){return typeof e=="string"&&Ode.has(e)}El.isJSONType=Nde;function zde(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}El.getRules=zde});var H1=q(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.shouldUseRule=ks.shouldUseGroup=ks.schemaHasRulesForType=void 0;function Cde({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&yq(e,n)}ks.schemaHasRulesForType=Cde;function yq(e,t){return t.rules.some(r=>_q(e,r))}ks.shouldUseGroup=yq;function _q(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}ks.shouldUseRule=_q});var hp=q(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.reportTypeError=Gr.checkDataTypes=Gr.checkDataType=Gr.coerceAndCheckDataType=Gr.getJSONTypes=Gr.getSchemaTypes=Gr.DataType=void 0;var jde=K1(),Ade=H1(),Rde=mp(),Ye=Xe(),bq=xt(),Pl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Pl||(Gr.DataType=Pl={}));function Dde(e){let t=wq(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Gr.getSchemaTypes=Dde;function wq(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(jde.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Gr.getJSONTypes=wq;function Ude(e,t){let{gen:r,data:n,opts:i}=e,a=Mde(t,i.coerceTypes),s=t.length>0&&!(a.length===0&&t.length===1&&(0,Ade.schemaHasRulesForType)(e,t[0]));if(s){let o=Y1(t,n,i.strictNumbers,Pl.Wrong);r.if(o,()=>{a.length?Lde(e,t,a):Q1(e)})}return s}Gr.coerceAndCheckDataType=Ude;var xq=new Set(["string","number","integer","boolean","null"]);function Mde(e,t){return t?e.filter(r=>xq.has(r)||t==="array"&&r==="array"):[]}function Lde(e,t,r){let{gen:n,data:i,opts:a}=e,s=n.let("dataType",(0,Ye._)`typeof ${i}`),o=n.let("coerced",(0,Ye._)`undefined`);a.coerceTypes==="array"&&n.if((0,Ye._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ye._)`${i}[0]`).assign(s,(0,Ye._)`typeof ${i}`).if(Y1(t,i,a.strictNumbers),()=>n.assign(o,i))),n.if((0,Ye._)`${o} !== undefined`);for(let l of r)(xq.has(l)||l==="array"&&a.coerceTypes==="array")&&u(l);n.else(),Q1(e),n.endIf(),n.if((0,Ye._)`${o} !== undefined`,()=>{n.assign(i,o),Zde(e,o)});function u(l){switch(l){case"string":n.elseIf((0,Ye._)`${s} == "number" || ${s} == "boolean"`).assign(o,(0,Ye._)`"" + ${i}`).elseIf((0,Ye._)`${i} === null`).assign(o,(0,Ye._)`""`);return;case"number":n.elseIf((0,Ye._)`${s} == "boolean" || ${i} === null
233
+ || (${s} == "string" && ${i} && ${i} == +${i})`).assign(o,(0,Ye._)`+${i}`);return;case"integer":n.elseIf((0,Ye._)`${s} === "boolean" || ${i} === null
234
+ || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(o,(0,Ye._)`+${i}`);return;case"boolean":n.elseIf((0,Ye._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(o,!1).elseIf((0,Ye._)`${i} === "true" || ${i} === 1`).assign(o,!0);return;case"null":n.elseIf((0,Ye._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(o,null);return;case"array":n.elseIf((0,Ye._)`${s} === "string" || ${s} === "number"
235
+ || ${s} === "boolean" || ${i} === null`).assign(o,(0,Ye._)`[${i}]`)}}}function Zde({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ye._)`${t} !== undefined`,()=>e.assign((0,Ye._)`${t}[${r}]`,n))}function J1(e,t,r,n=Pl.Correct){let i=n===Pl.Correct?Ye.operators.EQ:Ye.operators.NEQ,a;switch(e){case"null":return(0,Ye._)`${t} ${i} null`;case"array":a=(0,Ye._)`Array.isArray(${t})`;break;case"object":a=(0,Ye._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=s((0,Ye._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=s();break;default:return(0,Ye._)`typeof ${t} ${i} ${e}`}return n===Pl.Correct?a:(0,Ye.not)(a);function s(o=Ye.nil){return(0,Ye.and)((0,Ye._)`typeof ${t} == "number"`,o,r?(0,Ye._)`isFinite(${t})`:Ye.nil)}}Gr.checkDataType=J1;function Y1(e,t,r,n){if(e.length===1)return J1(e[0],t,r,n);let i,a=(0,bq.toHash)(e);if(a.array&&a.object){let s=(0,Ye._)`typeof ${t} != "object"`;i=a.null?s:(0,Ye._)`!${t} || ${s}`,delete a.null,delete a.array,delete a.object}else i=Ye.nil;a.number&&delete a.integer;for(let s in a)i=(0,Ye.and)(i,J1(s,t,r,n));return i}Gr.checkDataTypes=Y1;var qde={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ye._)`{type: ${e}}`:(0,Ye._)`{type: ${t}}`};function Q1(e){let t=Fde(e);(0,Rde.reportError)(t,qde)}Gr.reportTypeError=Q1;function Fde(e){let{gen:t,data:r,schema:n}=e,i=(0,bq.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var Sq=q(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.assignDefaults=void 0;var Tl=Xe(),Vde=xt();function Wde(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)kq(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,a)=>kq(e,a,i.default))}ly.assignDefaults=Wde;function kq(e,t,r){let{gen:n,compositeRule:i,data:a,opts:s}=e;if(r===void 0)return;let o=(0,Tl._)`${a}${(0,Tl.getProperty)(t)}`;if(i){(0,Vde.checkStrictMode)(e,`default is ignored for: ${o}`);return}let u=(0,Tl._)`${o} === undefined`;s.useDefaults==="empty"&&(u=(0,Tl._)`${u} || ${o} === null || ${o} === ""`),n.if(u,(0,Tl._)`${o} = ${(0,Tl.stringify)(r)}`)}});var fi=q(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.validateUnion=Ut.validateArray=Ut.usePattern=Ut.callValidateCode=Ut.schemaProperties=Ut.allSchemaProperties=Ut.noPropertyInData=Ut.propertyInData=Ut.isOwnProperty=Ut.hasPropFunc=Ut.reportMissingProp=Ut.checkMissingProp=Ut.checkReportMissingProp=void 0;var tr=Xe(),X1=xt(),Ss=Da(),Bde=xt();function Gde(e,t){let{gen:r,data:n,it:i}=e;r.if(tT(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,tr._)`${t}`},!0),e.error()})}Ut.checkReportMissingProp=Gde;function Kde({gen:e,data:t,it:{opts:r}},n,i){return(0,tr.or)(...n.map(a=>(0,tr.and)(tT(e,t,a,r.ownProperties),(0,tr._)`${i} = ${a}`)))}Ut.checkMissingProp=Kde;function Hde(e,t){e.setParams({missingProperty:t},!0),e.error()}Ut.reportMissingProp=Hde;function Iq(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,tr._)`Object.prototype.hasOwnProperty`})}Ut.hasPropFunc=Iq;function eT(e,t,r){return(0,tr._)`${Iq(e)}.call(${t}, ${r})`}Ut.isOwnProperty=eT;function Jde(e,t,r,n){let i=(0,tr._)`${t}${(0,tr.getProperty)(r)} !== undefined`;return n?(0,tr._)`${i} && ${eT(e,t,r)}`:i}Ut.propertyInData=Jde;function tT(e,t,r,n){let i=(0,tr._)`${t}${(0,tr.getProperty)(r)} === undefined`;return n?(0,tr.or)(i,(0,tr.not)(eT(e,t,r))):i}Ut.noPropertyInData=tT;function $q(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}Ut.allSchemaProperties=$q;function Yde(e,t){return $q(t).filter(r=>!(0,X1.alwaysValidSchema)(e,t[r]))}Ut.schemaProperties=Yde;function Qde({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:a},it:s},o,u,l){let c=l?(0,tr._)`${e}, ${t}, ${n}${i}`:t,d=[[Ss.default.instancePath,(0,tr.strConcat)(Ss.default.instancePath,a)],[Ss.default.parentData,s.parentData],[Ss.default.parentDataProperty,s.parentDataProperty],[Ss.default.rootData,Ss.default.rootData]];s.opts.dynamicRef&&d.push([Ss.default.dynamicAnchors,Ss.default.dynamicAnchors]);let f=(0,tr._)`${c}, ${r.object(...d)}`;return u!==tr.nil?(0,tr._)`${o}.call(${u}, ${f})`:(0,tr._)`${o}(${f})`}Ut.callValidateCode=Qde;var Xde=(0,tr._)`new RegExp`;function efe({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,tr._)`${i.code==="new RegExp"?Xde:(0,Bde.useFunc)(e,i)}(${r}, ${n})`})}Ut.usePattern=efe;function tfe(e){let{gen:t,data:r,keyword:n,it:i}=e,a=t.name("valid");if(i.allErrors){let o=t.let("valid",!0);return s(()=>t.assign(o,!1)),o}return t.var(a,!0),s(()=>t.break()),a;function s(o){let u=t.const("len",(0,tr._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:X1.Type.Num},a),t.if((0,tr.not)(a),o)})}}Ut.validateArray=tfe;function rfe(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,X1.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let s=t.let("valid",!1),o=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let c=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},o);t.assign(s,(0,tr._)`${s} || ${o}`),e.mergeValidEvaluated(c,o)||t.if((0,tr.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}Ut.validateUnion=rfe});var Tq=q(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.validateKeywordUsage=oa.validSchemaType=oa.funcKeywordCode=oa.macroKeywordCode=void 0;var hn=Xe(),$o=Da(),nfe=fi(),ife=mp();function afe(e,t){let{gen:r,keyword:n,schema:i,parentSchema:a,it:s}=e,o=t.macro.call(s.self,i,a,s),u=Pq(r,n,o);s.opts.validateSchema!==!1&&s.self.validateSchema(o,!0);let l=r.name("valid");e.subschema({schema:o,schemaPath:hn.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}oa.macroKeywordCode=afe;function sfe(e,t){var r;let{gen:n,keyword:i,schema:a,parentSchema:s,$data:o,it:u}=e;ufe(u,t);let l=!o&&t.compile?t.compile.call(u.self,a,s,u):t.validate,c=Pq(n,i,l),d=n.let("valid");e.block$data(d,f),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function f(){if(t.errors===!1)y(),t.modifying&&Eq(e),_(()=>e.error());else{let m=t.async?p():h();t.modifying&&Eq(e),_(()=>ofe(e,m))}}function p(){let m=n.let("ruleErrs",null);return n.try(()=>y((0,hn._)`await `),g=>n.assign(d,!1).if((0,hn._)`${g} instanceof ${u.ValidationError}`,()=>n.assign(m,(0,hn._)`${g}.errors`),()=>n.throw(g))),m}function h(){let m=(0,hn._)`${c}.errors`;return n.assign(m,null),y(hn.nil),m}function y(m=t.async?(0,hn._)`await `:hn.nil){let g=u.opts.passContext?$o.default.this:$o.default.self,v=!("compile"in t&&!o||t.schema===!1);n.assign(d,(0,hn._)`${m}${(0,nfe.callValidateCode)(e,c,g,v)}`,t.modifying)}function _(m){var g;n.if((0,hn.not)((g=t.valid)!==null&&g!==void 0?g:d),m)}}oa.funcKeywordCode=sfe;function Eq(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,hn._)`${n.parentData}[${n.parentDataProperty}]`))}function ofe(e,t){let{gen:r}=e;r.if((0,hn._)`Array.isArray(${t})`,()=>{r.assign($o.default.vErrors,(0,hn._)`${$o.default.vErrors} === null ? ${t} : ${$o.default.vErrors}.concat(${t})`).assign($o.default.errors,(0,hn._)`${$o.default.vErrors}.length`),(0,ife.extendErrors)(e)},()=>e.error())}function ufe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Pq(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,hn.stringify)(r)})}function lfe(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}oa.validSchemaType=lfe;function cfe({schema:e,opts:t,self:r,errSchemaPath:n},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(o=>!Object.prototype.hasOwnProperty.call(e,o)))throw new Error(`parent schema must have dependencies of ${a}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[a])){let u=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}oa.validateKeywordUsage=cfe});var Nq=q(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.extendSubschemaMode=Is.extendSubschemaData=Is.getSubschema=void 0;var ua=Xe(),Oq=xt();function dfe(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:a,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let o=e.schema[t];return r===void 0?{schema:o,schemaPath:(0,ua._)`${e.schemaPath}${(0,ua.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:(0,ua._)`${e.schemaPath}${(0,ua.getProperty)(t)}${(0,ua.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Oq.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||a===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}Is.getSubschema=dfe;function ffe(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:a,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=t;if(r!==void 0){let{errorPath:l,dataPathArr:c,opts:d}=t,f=o.let("data",(0,ua._)`${t.data}${(0,ua.getProperty)(r)}`,!0);u(f),e.errorPath=(0,ua.str)`${l}${(0,Oq.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,ua._)`${r}`,e.dataPathArr=[...c,e.parentDataProperty]}if(i!==void 0){let l=i instanceof ua.Name?i:o.let("data",i,!0);u(l),s!==void 0&&(e.propertyName=s)}a&&(e.dataTypes=a);function u(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Is.extendSubschemaData=ffe;function pfe(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:a}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}Is.extendSubschemaMode=pfe});var Cq=q((_Oe,zq)=>{"use strict";var $s=zq.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};cy(t,n,i,e,"",e)};$s.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};$s.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};$s.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};$s.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function cy(e,t,r,n,i,a,s,o,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,a,s,o,u,l);for(var c in n){var d=n[c];if(Array.isArray(d)){if(c in $s.arrayKeywords)for(var f=0;f<d.length;f++)cy(e,t,r,d[f],i+"/"+c+"/"+f,a,i,c,n,f)}else if(c in $s.propsKeywords){if(d&&typeof d=="object")for(var p in d)cy(e,t,r,d[p],i+"/"+c+"/"+mfe(p),a,i,c,n,p)}else(c in $s.keywords||e.allKeys&&!(c in $s.skipKeywords))&&cy(e,t,r,d,i+"/"+c,a,i,c,n)}r(n,i,a,s,o,u,l)}}function mfe(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var gp=q(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.getSchemaRefs=Pn.resolveUrl=Pn.normalizeId=Pn._getFullPath=Pn.getFullPath=Pn.inlineRef=void 0;var hfe=xt(),gfe=Zf(),vfe=Cq(),yfe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function _fe(e,t=!0){return typeof e=="boolean"?!0:t===!0?!rT(e):t?jq(e)<=t:!1}Pn.inlineRef=_fe;var bfe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function rT(e){for(let t in e){if(bfe.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(rT)||typeof r=="object"&&rT(r))return!0}return!1}function jq(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!yfe.has(r)&&(typeof e[r]=="object"&&(0,hfe.eachItem)(e[r],n=>t+=jq(n)),t===1/0))return 1/0}return t}function Aq(e,t="",r){r!==!1&&(t=Ol(t));let n=e.parse(t);return Rq(e,n)}Pn.getFullPath=Aq;function Rq(e,t){return e.serialize(t).split("#")[0]+"#"}Pn._getFullPath=Rq;var wfe=/#\/?$/;function Ol(e){return e?e.replace(wfe,""):""}Pn.normalizeId=Ol;function xfe(e,t,r){return r=Ol(r),e.resolve(t,r)}Pn.resolveUrl=xfe;var kfe=/^[a-z_][-a-z0-9._]*$/i;function Sfe(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ol(e[r]||t),a={"":i},s=Aq(n,i,!1),o={},u=new Set;return vfe(e,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let y=s+f,_=a[h];typeof d[r]=="string"&&(_=m.call(this,d[r])),g.call(this,d.$anchor),g.call(this,d.$dynamicAnchor),a[f]=_;function m(v){let b=this.opts.uriResolver.resolve;if(v=Ol(_?b(_,v):v),u.has(v))throw c(v);u.add(v);let w=this.refs[v];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,v):v!==Ol(y)&&(v[0]==="#"?(l(d,o[v],v),o[v]=d):this.refs[v]=y),v}function g(v){if(typeof v=="string"){if(!kfe.test(v))throw new Error(`invalid anchor "${v}"`);m.call(this,`#${v}`)}}}),o;function l(d,f,p){if(f!==void 0&&!gfe(d,f))throw c(p)}function c(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Pn.getSchemaRefs=Sfe});var _p=q(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.getData=Es.KeywordCxt=Es.validateFunctionCode=void 0;var Zq=vq(),Dq=hp(),iT=H1(),dy=hp(),Ife=Sq(),yp=Tq(),nT=Nq(),Ee=Xe(),Me=Da(),$fe=gp(),Ua=xt(),vp=mp();function Efe(e){if(Vq(e)&&(Wq(e),Fq(e))){Ofe(e);return}qq(e,()=>(0,Zq.topBoolOrEmptySchema)(e))}Es.validateFunctionCode=Efe;function qq({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},a){i.code.es5?e.func(t,(0,Ee._)`${Me.default.data}, ${Me.default.valCxt}`,n.$async,()=>{e.code((0,Ee._)`"use strict"; ${Uq(r,i)}`),Tfe(e,i),e.code(a)}):e.func(t,(0,Ee._)`${Me.default.data}, ${Pfe(i)}`,n.$async,()=>e.code(Uq(r,i)).code(a))}function Pfe(e){return(0,Ee._)`{${Me.default.instancePath}="", ${Me.default.parentData}, ${Me.default.parentDataProperty}, ${Me.default.rootData}=${Me.default.data}${e.dynamicRef?(0,Ee._)`, ${Me.default.dynamicAnchors}={}`:Ee.nil}}={}`}function Tfe(e,t){e.if(Me.default.valCxt,()=>{e.var(Me.default.instancePath,(0,Ee._)`${Me.default.valCxt}.${Me.default.instancePath}`),e.var(Me.default.parentData,(0,Ee._)`${Me.default.valCxt}.${Me.default.parentData}`),e.var(Me.default.parentDataProperty,(0,Ee._)`${Me.default.valCxt}.${Me.default.parentDataProperty}`),e.var(Me.default.rootData,(0,Ee._)`${Me.default.valCxt}.${Me.default.rootData}`),t.dynamicRef&&e.var(Me.default.dynamicAnchors,(0,Ee._)`${Me.default.valCxt}.${Me.default.dynamicAnchors}`)},()=>{e.var(Me.default.instancePath,(0,Ee._)`""`),e.var(Me.default.parentData,(0,Ee._)`undefined`),e.var(Me.default.parentDataProperty,(0,Ee._)`undefined`),e.var(Me.default.rootData,Me.default.data),t.dynamicRef&&e.var(Me.default.dynamicAnchors,(0,Ee._)`{}`)})}function Ofe(e){let{schema:t,opts:r,gen:n}=e;qq(e,()=>{r.$comment&&t.$comment&&Gq(e),Afe(e),n.let(Me.default.vErrors,null),n.let(Me.default.errors,0),r.unevaluated&&Nfe(e),Bq(e),Ufe(e)})}function Nfe(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Ee._)`${r}.evaluated`),t.if((0,Ee._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,Ee._)`${e.evaluated}.props`,(0,Ee._)`undefined`)),t.if((0,Ee._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,Ee._)`${e.evaluated}.items`,(0,Ee._)`undefined`))}function Uq(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Ee._)`/*# sourceURL=${r} */`:Ee.nil}function zfe(e,t){if(Vq(e)&&(Wq(e),Fq(e))){Cfe(e,t);return}(0,Zq.boolOrEmptySchema)(e,t)}function Fq({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Vq(e){return typeof e.schema!="boolean"}function Cfe(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&Gq(e),Rfe(e),Dfe(e);let a=n.const("_errs",Me.default.errors);Bq(e,a),n.var(t,(0,Ee._)`${a} === ${Me.default.errors}`)}function Wq(e){(0,Ua.checkUnknownRules)(e),jfe(e)}function Bq(e,t){if(e.opts.jtd)return Mq(e,[],!1,t);let r=(0,Dq.getSchemaTypes)(e.schema),n=(0,Dq.coerceAndCheckDataType)(e,r);Mq(e,r,!n,t)}function jfe(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ua.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Afe(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ua.checkStrictMode)(e,"default is ignored in the schema root")}function Rfe(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,$fe.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Dfe(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Gq({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let a=r.$comment;if(i.$comment===!0)e.code((0,Ee._)`${Me.default.self}.logger.log(${a})`);else if(typeof i.$comment=="function"){let s=(0,Ee.str)`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code((0,Ee._)`${Me.default.self}.opts.$comment(${a}, ${s}, ${o}.schema)`)}}function Ufe(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:a}=e;r.$async?t.if((0,Ee._)`${Me.default.errors} === 0`,()=>t.return(Me.default.data),()=>t.throw((0,Ee._)`new ${i}(${Me.default.vErrors})`)):(t.assign((0,Ee._)`${n}.errors`,Me.default.vErrors),a.unevaluated&&Mfe(e),t.return((0,Ee._)`${Me.default.errors} === 0`))}function Mfe({gen:e,evaluated:t,props:r,items:n}){r instanceof Ee.Name&&e.assign((0,Ee._)`${t}.props`,r),n instanceof Ee.Name&&e.assign((0,Ee._)`${t}.items`,n)}function Mq(e,t,r,n){let{gen:i,schema:a,data:s,allErrors:o,opts:u,self:l}=e,{RULES:c}=l;if(a.$ref&&(u.ignoreKeywordsWithRef||!(0,Ua.schemaHasRulesButRef)(a,c))){i.block(()=>Hq(e,"$ref",c.all.$ref.definition));return}u.jtd||Lfe(e,t),i.block(()=>{for(let f of c.rules)d(f);d(c.post)});function d(f){(0,iT.shouldUseGroup)(a,f)&&(f.type?(i.if((0,dy.checkDataType)(f.type,s,u.strictNumbers)),Lq(e,f),t.length===1&&t[0]===f.type&&r&&(i.else(),(0,dy.reportTypeError)(e)),i.endIf()):Lq(e,f),o||i.if((0,Ee._)`${Me.default.errors} === ${n||0}`))}}function Lq(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Ife.assignDefaults)(e,t.type),r.block(()=>{for(let a of t.rules)(0,iT.shouldUseRule)(n,a)&&Hq(e,a.keyword,a.definition,t.type)})}function Lfe(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Zfe(e,t),e.opts.allowUnionTypes||qfe(e,t),Ffe(e,e.dataTypes))}function Zfe(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Kq(e.dataTypes,r)||aT(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Wfe(e,t)}}function qfe(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&aT(e,"use allowUnionTypes to allow union type keyword")}function Ffe(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,iT.shouldUseRule)(e.schema,i)){let{type:a}=i.definition;a.length&&!a.some(s=>Vfe(t,s))&&aT(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function Vfe(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Kq(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Wfe(e,t){let r=[];for(let n of e.dataTypes)Kq(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function aT(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ua.checkStrictMode)(e,t,e.opts.strictTypes)}var fy=class{constructor(t,r,n){if((0,yp.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ua.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Jq(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,yp.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Me.default.errors))}result(t,r,n){this.failResult((0,Ee.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Ee.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Ee._)`${r} !== undefined && (${(0,Ee.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?vp.reportExtraError:vp.reportError)(this,this.def.error,r)}$dataError(){(0,vp.reportError)(this,this.def.$dataError||vp.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,vp.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=Ee.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Ee.nil,r=Ee.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:a,def:s}=this;n.if((0,Ee.or)((0,Ee._)`${i} === undefined`,r)),t!==Ee.nil&&n.assign(t,!0),(a.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Ee.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:a}=this;return(0,Ee.or)(s(),o());function s(){if(n.length){if(!(r instanceof Ee.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,Ee._)`${(0,dy.checkDataTypes)(u,r,a.opts.strictNumbers,dy.DataType.Wrong)}`}return Ee.nil}function o(){if(i.validateSchema){let u=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,Ee._)`!${u}(${r})`}return Ee.nil}}subschema(t,r){let n=(0,nT.getSubschema)(this.it,t);(0,nT.extendSubschemaData)(n,this.it,t),(0,nT.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return zfe(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ua.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ua.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,Ee.Name)),!0}};Es.KeywordCxt=fy;function Hq(e,t,r,n){let i=new fy(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,yp.funcKeywordCode)(i,r):"macro"in r?(0,yp.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,yp.funcKeywordCode)(i,r)}var Bfe=/^\/(?:[^~]|~0|~1)*$/,Gfe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Jq(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,a;if(e==="")return Me.default.rootData;if(e[0]==="/"){if(!Bfe.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,a=Me.default.rootData}else{let l=Gfe.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let c=+l[1];if(i=l[2],i==="#"){if(c>=t)throw new Error(u("property/index",c));return n[t-c]}if(c>t)throw new Error(u("data",c));if(a=r[t-c],!i)return a}let s=a,o=i.split("/");for(let l of o)l&&(a=(0,Ee._)`${a}${(0,Ee.getProperty)((0,Ua.unescapeJsonPointer)(l))}`,s=(0,Ee._)`${s} && ${a}`);return s;function u(l,c){return`Cannot access ${l} ${c} levels up, current level is ${t}`}}Es.getData=Jq});var py=q(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var sT=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};oT.default=sT});var bp=q(cT=>{"use strict";Object.defineProperty(cT,"__esModule",{value:!0});var uT=gp(),lT=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,uT.resolveUrl)(t,r,n),this.missingSchema=(0,uT.normalizeId)((0,uT.getFullPath)(t,this.missingRef))}};cT.default=lT});var hy=q(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.resolveSchema=pi.getCompilingSchema=pi.resolveRef=pi.compileSchema=pi.SchemaEnv=void 0;var Zi=Xe(),Kfe=py(),Eo=Da(),qi=gp(),Yq=xt(),Hfe=_p(),Nl=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,qi.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};pi.SchemaEnv=Nl;function fT(e){let t=Qq.call(this,e);if(t)return t;let r=(0,qi.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:a}=this.opts,s=new Zi.CodeGen(this.scope,{es5:n,lines:i,ownProperties:a}),o;e.$async&&(o=s.scopeValue("Error",{ref:Kfe.default,code:(0,Zi._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");e.validateName=u;let l={gen:s,allErrors:this.opts.allErrors,data:Eo.default.data,parentData:Eo.default.parentData,parentDataProperty:Eo.default.parentDataProperty,dataNames:[Eo.default.data],dataPathArr:[Zi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Zi.stringify)(e.schema)}:{ref:e.schema}),validateName:u,ValidationError:o,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Zi.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Zi._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(e),(0,Hfe.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();c=`${s.scopeRefs(Eo.default.scope)}return ${d}`,this.opts.code.process&&(c=this.opts.code.process(c,e));let p=new Function(`${Eo.default.self}`,`${Eo.default.scope}`,c)(this,this.scope.get());if(this.scope.value(u,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:u,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:y}=l;p.evaluated={props:h instanceof Zi.Name?void 0:h,items:y instanceof Zi.Name?void 0:y,dynamicProps:h instanceof Zi.Name,dynamicItems:y instanceof Zi.Name},p.source&&(p.source.evaluated=(0,Zi.stringify)(p.evaluated))}return e.validate=p,e}catch(d){throw delete e.validate,delete e.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(e)}}pi.compileSchema=fT;function Jfe(e,t,r){var n;r=(0,qi.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let a=Xfe.call(this,e,r);if(a===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:o}=this.opts;s&&(a=new Nl({schema:s,schemaId:o,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=Yfe.call(this,a)}pi.resolveRef=Jfe;function Yfe(e){return(0,qi.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:fT.call(this,e)}function Qq(e){for(let t of this._compilations)if(Qfe(t,e))return t}pi.getCompilingSchema=Qq;function Qfe(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Xfe(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||my.call(this,e,t)}function my(e,t){let r=this.opts.uriResolver.parse(t),n=(0,qi._getFullPath)(this.opts.uriResolver,r),i=(0,qi.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return dT.call(this,r,e);let a=(0,qi.normalizeId)(n),s=this.refs[a]||this.schemas[a];if(typeof s=="string"){let o=my.call(this,e,s);return typeof o?.schema!="object"?void 0:dT.call(this,r,o)}if(typeof s?.schema=="object"){if(s.validate||fT.call(this,s),a===(0,qi.normalizeId)(t)){let{schema:o}=s,{schemaId:u}=this.opts,l=o[u];return l&&(i=(0,qi.resolveUrl)(this.opts.uriResolver,i,l)),new Nl({schema:o,schemaId:u,root:e,baseId:i})}return dT.call(this,r,s)}}pi.resolveSchema=my;var epe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function dT(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let o of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,Yq.unescapeFragment)(o)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!epe.has(o)&&l&&(t=(0,qi.resolveUrl)(this.opts.uriResolver,t,l))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,Yq.schemaHasRulesButRef)(r,this.RULES)){let o=(0,qi.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=my.call(this,n,o)}let{schemaId:s}=this.opts;if(a=a||new Nl({schema:r,schemaId:s,root:n,baseId:t}),a.schema!==a.root.schema)return a}});var Xq=q((IOe,tpe)=>{tpe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var t9=q(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0});var e9=TP();e9.code='require("ajv/dist/runtime/uri").default';pT.default=e9});var l9=q(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.CodeGen=Rr.Name=Rr.nil=Rr.stringify=Rr.str=Rr._=Rr.KeywordCxt=void 0;var rpe=_p();Object.defineProperty(Rr,"KeywordCxt",{enumerable:!0,get:function(){return rpe.KeywordCxt}});var zl=Xe();Object.defineProperty(Rr,"_",{enumerable:!0,get:function(){return zl._}});Object.defineProperty(Rr,"str",{enumerable:!0,get:function(){return zl.str}});Object.defineProperty(Rr,"stringify",{enumerable:!0,get:function(){return zl.stringify}});Object.defineProperty(Rr,"nil",{enumerable:!0,get:function(){return zl.nil}});Object.defineProperty(Rr,"Name",{enumerable:!0,get:function(){return zl.Name}});Object.defineProperty(Rr,"CodeGen",{enumerable:!0,get:function(){return zl.CodeGen}});var npe=py(),s9=bp(),ipe=K1(),wp=hy(),ape=Xe(),xp=gp(),gy=hp(),hT=xt(),r9=Xq(),spe=t9(),o9=(e,t)=>new RegExp(e,t);o9.code="new RegExp";var ope=["removeAdditional","useDefaults","coerceTypes"],upe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),lpe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},cpe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},n9=200;function dpe(e){var t,r,n,i,a,s,o,u,l,c,d,f,p,h,y,_,m,g,v,b,w,x,k,$,T;let j=e.strict,P=(t=e.code)===null||t===void 0?void 0:t.optimize,U=P===!0||P===void 0?1:P||0,B=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:o9,C=(i=e.uriResolver)!==null&&i!==void 0?i:spe.default;return{strictSchema:(s=(a=e.strictSchema)!==null&&a!==void 0?a:j)!==null&&s!==void 0?s:!0,strictNumbers:(u=(o=e.strictNumbers)!==null&&o!==void 0?o:j)!==null&&u!==void 0?u:!0,strictTypes:(c=(l=e.strictTypes)!==null&&l!==void 0?l:j)!==null&&c!==void 0?c:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:j)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=e.strictRequired)!==null&&p!==void 0?p:j)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:U,regExp:B}:{optimize:U,regExp:B},loopRequired:(y=e.loopRequired)!==null&&y!==void 0?y:n9,loopEnum:(_=e.loopEnum)!==null&&_!==void 0?_:n9,meta:(m=e.meta)!==null&&m!==void 0?m:!0,messages:(g=e.messages)!==null&&g!==void 0?g:!0,inlineRefs:(v=e.inlineRefs)!==null&&v!==void 0?v:!0,schemaId:(b=e.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(x=e.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(k=e.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:($=e.unicodeRegExp)!==null&&$!==void 0?$:!0,int32range:(T=e.int32range)!==null&&T!==void 0?T:!0,uriResolver:C}}var kp=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...dpe(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new ape.ValueScope({scope:{},prefixes:upe,es5:r,lines:n}),this.logger=vpe(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,ipe.getRules)(),i9.call(this,lpe,t,"NOT SUPPORTED"),i9.call(this,cpe,t,"DEPRECATED","warn"),this._metaOpts=hpe.call(this),t.formats&&ppe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&mpe.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),fpe.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=r9;n==="id"&&(i={...r9},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(c,d){await a.call(this,c.$schema);let f=this._addSchema(c,d);return f.validate||s.call(this,f)}async function a(c){c&&!this.getSchema(c)&&await i.call(this,{$ref:c},!0)}async function s(c){try{return this._compileSchemaEnv(c)}catch(d){if(!(d instanceof s9.default))throw d;return o.call(this,d),await u.call(this,d.missingSchema),s.call(this,c)}}function o({missingSchema:c,missingRef:d}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${d} cannot be resolved`)}async function u(c){let d=await l.call(this,c);this.refs[c]||await a.call(this,d.$schema),this.refs[c]||this.addSchema(d,c,r)}async function l(c){let d=this._loading[c];if(d)return d;try{return await(this._loading[c]=n(c))}finally{delete this._loading[c]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,i);return this}let a;if(typeof t=="object"){let{schemaId:s}=this.opts;if(a=t[s],a!==void 0&&typeof a!="string")throw new Error(`schema ${s} must be string`)}return r=(0,xp.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return i}getSchema(t){let r;for(;typeof(r=a9.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new wp.SchemaEnv({schema:{},schemaId:n});if(r=wp.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=a9.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,xp.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(_pe.call(this,n,r),!r)return(0,hT.eachItem)(n,a=>mT.call(this,a)),this;wpe.call(this,r);let i={...r,type:(0,gy.getJSONTypes)(r.type),schemaType:(0,gy.getJSONTypes)(r.schemaType)};return(0,hT.eachItem)(n,i.type.length===0?a=>mT.call(this,a,i):a=>i.type.forEach(s=>mT.call(this,a,i,s))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(a=>a.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,a)=>i+r+a)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let a=i.split("/").slice(1),s=t;for(let o of a)s=s[o];for(let o in n){let u=n[o];if(typeof u!="object")continue;let{$data:l}=u.definition,c=s[o];l&&c&&(s[o]=u9(c))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,a=this.opts.addUsedSchema){let s,{schemaId:o}=this.opts;if(typeof t=="object")s=t[o];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(t);if(u!==void 0)return u;n=(0,xp.normalizeId)(s||n);let l=xp.getSchemaRefs.call(this,t,n);return u=new wp.SchemaEnv({schema:t,schemaId:o,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),a&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),i&&this.validateSchema(t,!0),u}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):wp.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{wp.compileSchema.call(this,t)}finally{this.opts=r}}};kp.ValidationError=npe.default;kp.MissingRefError=s9.default;Rr.default=kp;function i9(e,t,r,n="error"){for(let i in e){let a=i;a in t&&this.logger[n](`${r}: option ${i}. ${e[a]}`)}}function a9(e){return e=(0,xp.normalizeId)(e),this.schemas[e]||this.refs[e]}function fpe(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function ppe(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function mpe(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function hpe(){let e={...this.opts};for(let t of ope)delete e[t];return e}var gpe={log(){},warn(){},error(){}};function vpe(e){if(e===!1)return gpe;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var ype=/^[a-z_$][a-z0-9_$:-]*$/i;function _pe(e,t){let{RULES:r}=this;if((0,hT.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!ype.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function mT(e,t,r){var n;let i=t?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,s=i?a.post:a.rules.find(({type:u})=>u===r);if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,gy.getJSONTypes)(t.type),schemaType:(0,gy.getJSONTypes)(t.schemaType)}};t.before?bpe.call(this,s,o,t.before):s.rules.push(o),a.all[e]=o,(n=t.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}function bpe(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function wpe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=u9(t)),e.validateSchema=this.compile(t,!0))}var xpe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function u9(e){return{anyOf:[e,xpe]}}});var c9=q(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var kpe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gT.default=kpe});var m9=q(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.callRef=Po.getValidate=void 0;var Spe=bp(),d9=fi(),Tn=Xe(),Cl=Da(),f9=hy(),vy=xt(),Ipe={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:a,validateName:s,opts:o,self:u}=n,{root:l}=a;if((r==="#"||r==="#/")&&i===l.baseId)return d();let c=f9.resolveRef.call(u,l,i,r);if(c===void 0)throw new Spe.default(n.opts.uriResolver,i,r);if(c instanceof f9.SchemaEnv)return f(c);return p(c);function d(){if(a===l)return yy(e,s,a,a.$async);let h=t.scopeValue("root",{ref:l});return yy(e,(0,Tn._)`${h}.validate`,l,l.$async)}function f(h){let y=p9(e,h);yy(e,y,h,h.$async)}function p(h){let y=t.scopeValue("schema",o.code.source===!0?{ref:h,code:(0,Tn.stringify)(h)}:{ref:h}),_=t.name("valid"),m=e.subschema({schema:h,dataTypes:[],schemaPath:Tn.nil,topSchemaRef:y,errSchemaPath:r},_);e.mergeEvaluated(m),e.ok(_)}}};function p9(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Tn._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Po.getValidate=p9;function yy(e,t,r,n){let{gen:i,it:a}=e,{allErrors:s,schemaEnv:o,opts:u}=a,l=u.passContext?Cl.default.this:Tn.nil;n?c():d();function c(){if(!o.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,Tn._)`await ${(0,d9.callValidateCode)(e,t,l)}`),p(t),s||i.assign(h,!0)},y=>{i.if((0,Tn._)`!(${y} instanceof ${a.ValidationError})`,()=>i.throw(y)),f(y),s||i.assign(h,!1)}),e.ok(h)}function d(){e.result((0,d9.callValidateCode)(e,t,l),()=>p(t),()=>f(t))}function f(h){let y=(0,Tn._)`${h}.errors`;i.assign(Cl.default.vErrors,(0,Tn._)`${Cl.default.vErrors} === null ? ${y} : ${Cl.default.vErrors}.concat(${y})`),i.assign(Cl.default.errors,(0,Tn._)`${Cl.default.vErrors}.length`)}function p(h){var y;if(!a.opts.unevaluated)return;let _=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(a.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(a.props=vy.mergeEvaluated.props(i,_.props,a.props));else{let m=i.var("props",(0,Tn._)`${h}.evaluated.props`);a.props=vy.mergeEvaluated.props(i,m,a.props,Tn.Name)}if(a.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(a.items=vy.mergeEvaluated.items(i,_.items,a.items));else{let m=i.var("items",(0,Tn._)`${h}.evaluated.items`);a.items=vy.mergeEvaluated.items(i,m,a.items,Tn.Name)}}}Po.callRef=yy;Po.default=Ipe});var h9=q(vT=>{"use strict";Object.defineProperty(vT,"__esModule",{value:!0});var $pe=c9(),Epe=m9(),Ppe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",$pe.default,Epe.default];vT.default=Ppe});var g9=q(yT=>{"use strict";Object.defineProperty(yT,"__esModule",{value:!0});var _y=Xe(),Ps=_y.operators,by={maximum:{okStr:"<=",ok:Ps.LTE,fail:Ps.GT},minimum:{okStr:">=",ok:Ps.GTE,fail:Ps.LT},exclusiveMaximum:{okStr:"<",ok:Ps.LT,fail:Ps.GTE},exclusiveMinimum:{okStr:">",ok:Ps.GT,fail:Ps.LTE}},Tpe={message:({keyword:e,schemaCode:t})=>(0,_y.str)`must be ${by[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,_y._)`{comparison: ${by[e].okStr}, limit: ${t}}`},Ope={keyword:Object.keys(by),type:"number",schemaType:"number",$data:!0,error:Tpe,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,_y._)`${r} ${by[t].fail} ${n} || isNaN(${r})`)}};yT.default=Ope});var v9=q(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0});var Sp=Xe(),Npe={message:({schemaCode:e})=>(0,Sp.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Sp._)`{multipleOf: ${e}}`},zpe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Npe,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,a=i.opts.multipleOfPrecision,s=t.let("res"),o=a?(0,Sp._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${a}`:(0,Sp._)`${s} !== parseInt(${s})`;e.fail$data((0,Sp._)`(${n} === 0 || (${s} = ${r}/${n}, ${o}))`)}};_T.default=zpe});var _9=q(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});function y9(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}bT.default=y9;y9.code='require("ajv/dist/runtime/ucs2length").default'});var b9=q(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});var To=Xe(),Cpe=xt(),jpe=_9(),Ape={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,To.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,To._)`{limit: ${e}}`},Rpe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ape,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,a=t==="maxLength"?To.operators.GT:To.operators.LT,s=i.opts.unicode===!1?(0,To._)`${r}.length`:(0,To._)`${(0,Cpe.useFunc)(e.gen,jpe.default)}(${r})`;e.fail$data((0,To._)`${s} ${a} ${n}`)}};wT.default=Rpe});var w9=q(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});var Dpe=fi(),Upe=xt(),jl=Xe(),Mpe={message:({schemaCode:e})=>(0,jl.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,jl._)`{pattern: ${e}}`},Lpe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Mpe,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:a,it:s}=e,o=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=s.opts.code,l=u.code==="new RegExp"?(0,jl._)`new RegExp`:(0,Upe.useFunc)(t,u),c=t.let("valid");t.try(()=>t.assign(c,(0,jl._)`${l}(${a}, ${o}).test(${r})`),()=>t.assign(c,!1)),e.fail$data((0,jl._)`!${c}`)}else{let u=(0,Dpe.usePattern)(e,i);e.fail$data((0,jl._)`!${u}.test(${r})`)}}};xT.default=Lpe});var x9=q(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});var Ip=Xe(),Zpe={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Ip.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Ip._)`{limit: ${e}}`},qpe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Zpe,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Ip.operators.GT:Ip.operators.LT;e.fail$data((0,Ip._)`Object.keys(${r}).length ${i} ${n}`)}};kT.default=qpe});var k9=q(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0});var $p=fi(),Ep=Xe(),Fpe=xt(),Vpe={message:({params:{missingProperty:e}})=>(0,Ep.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Ep._)`{missingProperty: ${e}}`},Wpe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Vpe,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:a,it:s}=e,{opts:o}=s;if(!a&&r.length===0)return;let u=r.length>=o.loopRequired;if(s.allErrors?l():c(),o.strictRequired){let p=e.parentSchema.properties,{definedProperties:h}=e.it;for(let y of r)if(p?.[y]===void 0&&!h.has(y)){let _=s.schemaEnv.baseId+s.errSchemaPath,m=`required property "${y}" is not defined at "${_}" (strictRequired)`;(0,Fpe.checkStrictMode)(s,m,s.opts.strictRequired)}}function l(){if(u||a)e.block$data(Ep.nil,d);else for(let p of r)(0,$p.checkReportMissingProp)(e,p)}function c(){let p=t.let("missing");if(u||a){let h=t.let("valid",!0);e.block$data(h,()=>f(p,h)),e.ok(h)}else t.if((0,$p.checkMissingProp)(e,r,p)),(0,$p.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",n,p=>{e.setParams({missingProperty:p}),t.if((0,$p.noPropertyInData)(t,i,p,o.ownProperties),()=>e.error())})}function f(p,h){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(h,(0,$p.propertyInData)(t,i,p,o.ownProperties)),t.if((0,Ep.not)(h),()=>{e.error(),t.break()})},Ep.nil)}}};ST.default=Wpe});var S9=q(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});var Pp=Xe(),Bpe={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Pp.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Pp._)`{limit: ${e}}`},Gpe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Bpe,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Pp.operators.GT:Pp.operators.LT;e.fail$data((0,Pp._)`${r}.length ${i} ${n}`)}};IT.default=Gpe});var wy=q($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var I9=Zf();I9.code='require("ajv/dist/runtime/equal").default';$T.default=I9});var $9=q(PT=>{"use strict";Object.defineProperty(PT,"__esModule",{value:!0});var ET=hp(),Dr=Xe(),Kpe=xt(),Hpe=wy(),Jpe={message:({params:{i:e,j:t}})=>(0,Dr.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Dr._)`{i: ${e}, j: ${t}}`},Ype={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Jpe,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:a,schemaCode:s,it:o}=e;if(!n&&!i)return;let u=t.let("valid"),l=a.items?(0,ET.getSchemaTypes)(a.items):[];e.block$data(u,c,(0,Dr._)`${s} === false`),e.ok(u);function c(){let h=t.let("i",(0,Dr._)`${r}.length`),y=t.let("j");e.setParams({i:h,j:y}),t.assign(u,!0),t.if((0,Dr._)`${h} > 1`,()=>(d()?f:p)(h,y))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,y){let _=t.name("item"),m=(0,ET.checkDataTypes)(l,_,o.opts.strictNumbers,ET.DataType.Wrong),g=t.const("indices",(0,Dr._)`{}`);t.for((0,Dr._)`;${h}--;`,()=>{t.let(_,(0,Dr._)`${r}[${h}]`),t.if(m,(0,Dr._)`continue`),l.length>1&&t.if((0,Dr._)`typeof ${_} == "string"`,(0,Dr._)`${_} += "_"`),t.if((0,Dr._)`typeof ${g}[${_}] == "number"`,()=>{t.assign(y,(0,Dr._)`${g}[${_}]`),e.error(),t.assign(u,!1).break()}).code((0,Dr._)`${g}[${_}] = ${h}`)})}function p(h,y){let _=(0,Kpe.useFunc)(t,Hpe.default),m=t.name("outer");t.label(m).for((0,Dr._)`;${h}--;`,()=>t.for((0,Dr._)`${y} = ${h}; ${y}--;`,()=>t.if((0,Dr._)`${_}(${r}[${h}], ${r}[${y}])`,()=>{e.error(),t.assign(u,!1).break(m)})))}}};PT.default=Ype});var E9=q(OT=>{"use strict";Object.defineProperty(OT,"__esModule",{value:!0});var TT=Xe(),Qpe=xt(),Xpe=wy(),eme={message:"must be equal to constant",params:({schemaCode:e})=>(0,TT._)`{allowedValue: ${e}}`},tme={keyword:"const",$data:!0,error:eme,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:a}=e;n||a&&typeof a=="object"?e.fail$data((0,TT._)`!${(0,Qpe.useFunc)(t,Xpe.default)}(${r}, ${i})`):e.fail((0,TT._)`${a} !== ${r}`)}};OT.default=tme});var P9=q(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0});var Tp=Xe(),rme=xt(),nme=wy(),ime={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Tp._)`{allowedValues: ${e}}`},ame={keyword:"enum",schemaType:"array",$data:!0,error:ime,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:a,it:s}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let o=i.length>=s.opts.loopEnum,u,l=()=>u??(u=(0,rme.useFunc)(t,nme.default)),c;if(o||n)c=t.let("valid"),e.block$data(c,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=t.const("vSchema",a);c=(0,Tp.or)(...i.map((h,y)=>f(p,y)))}e.pass(c);function d(){t.assign(c,!1),t.forOf("v",a,p=>t.if((0,Tp._)`${l()}(${r}, ${p})`,()=>t.assign(c,!0).break()))}function f(p,h){let y=i[h];return typeof y=="object"&&y!==null?(0,Tp._)`${l()}(${r}, ${p}[${h}])`:(0,Tp._)`${r} === ${y}`}}};NT.default=ame});var T9=q(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});var sme=g9(),ome=v9(),ume=b9(),lme=w9(),cme=x9(),dme=k9(),fme=S9(),pme=$9(),mme=E9(),hme=P9(),gme=[sme.default,ome.default,ume.default,lme.default,cme.default,dme.default,fme.default,pme.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},mme.default,hme.default];zT.default=gme});var jT=q(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.validateAdditionalItems=void 0;var Oo=Xe(),CT=xt(),vme={message:({params:{len:e}})=>(0,Oo.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Oo._)`{limit: ${e}}`},yme={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vme,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,CT.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}O9(e,n)}};function O9(e,t){let{gen:r,schema:n,data:i,keyword:a,it:s}=e;s.items=!0;let o=r.const("len",(0,Oo._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,Oo._)`${o} <= ${t.length}`);else if(typeof n=="object"&&!(0,CT.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Oo._)`${o} <= ${t.length}`);r.if((0,Oo.not)(l),()=>u(l)),e.ok(l)}function u(l){r.forRange("i",t.length,o,c=>{e.subschema({keyword:a,dataProp:c,dataPropType:CT.Type.Num},l),s.allErrors||r.if((0,Oo.not)(l),()=>r.break())})}}Op.validateAdditionalItems=O9;Op.default=yme});var AT=q(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.validateTuple=void 0;var N9=Xe(),xy=xt(),_me=fi(),bme={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return z9(e,"additionalItems",t);r.items=!0,!(0,xy.alwaysValidSchema)(r,t)&&e.ok((0,_me.validateArray)(e))}};function z9(e,t,r=e.schema){let{gen:n,parentSchema:i,data:a,keyword:s,it:o}=e;c(i),o.opts.unevaluated&&r.length&&o.items!==!0&&(o.items=xy.mergeEvaluated.items(n,r.length,o.items));let u=n.name("valid"),l=n.const("len",(0,N9._)`${a}.length`);r.forEach((d,f)=>{(0,xy.alwaysValidSchema)(o,d)||(n.if((0,N9._)`${l} > ${f}`,()=>e.subschema({keyword:s,schemaProp:f,dataProp:f},u)),e.ok(u))});function c(d){let{opts:f,errSchemaPath:p}=o,h=r.length,y=h===d.minItems&&(h===d.maxItems||d[t]===!1);if(f.strictTuples&&!y){let _=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,xy.checkStrictMode)(o,_,f.strictTuples)}}}Np.validateTuple=z9;Np.default=bme});var C9=q(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:!0});var wme=AT(),xme={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,wme.validateTuple)(e,"items")};RT.default=xme});var A9=q(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});var j9=Xe(),kme=xt(),Sme=fi(),Ime=jT(),$me={message:({params:{len:e}})=>(0,j9.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,j9._)`{limit: ${e}}`},Eme={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:$me,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,kme.alwaysValidSchema)(n,t)&&(i?(0,Ime.validateAdditionalItems)(e,i):e.ok((0,Sme.validateArray)(e)))}};DT.default=Eme});var R9=q(UT=>{"use strict";Object.defineProperty(UT,"__esModule",{value:!0});var mi=Xe(),ky=xt(),Pme={message:({params:{min:e,max:t}})=>t===void 0?(0,mi.str)`must contain at least ${e} valid item(s)`:(0,mi.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,mi._)`{minContains: ${e}}`:(0,mi._)`{minContains: ${e}, maxContains: ${t}}`},Tme={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Pme,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e,s,o,{minContains:u,maxContains:l}=n;a.opts.next?(s=u===void 0?1:u,o=l):s=1;let c=t.const("len",(0,mi._)`${i}.length`);if(e.setParams({min:s,max:o}),o===void 0&&s===0){(0,ky.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(o!==void 0&&s>o){(0,ky.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ky.alwaysValidSchema)(a,r)){let y=(0,mi._)`${c} >= ${s}`;o!==void 0&&(y=(0,mi._)`${y} && ${c} <= ${o}`),e.pass(y);return}a.items=!0;let d=t.name("valid");o===void 0&&s===1?p(d,()=>t.if(d,()=>t.break())):s===0?(t.let(d,!0),o!==void 0&&t.if((0,mi._)`${i}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let y=t.name("_valid"),_=t.let("count",0);p(y,()=>t.if(y,()=>h(_)))}function p(y,_){t.forRange("i",0,c,m=>{e.subschema({keyword:"contains",dataProp:m,dataPropType:ky.Type.Num,compositeRule:!0},y),_()})}function h(y){t.code((0,mi._)`${y}++`),o===void 0?t.if((0,mi._)`${y} >= ${s}`,()=>t.assign(d,!0).break()):(t.if((0,mi._)`${y} > ${o}`,()=>t.assign(d,!1).break()),s===1?t.assign(d,!0):t.if((0,mi._)`${y} >= ${s}`,()=>t.assign(d,!0)))}}};UT.default=Tme});var M9=q(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.validateSchemaDeps=la.validatePropertyDeps=la.error=void 0;var MT=Xe(),Ome=xt(),zp=fi();la.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,MT.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,MT._)`{property: ${e},
236
+ missingProperty: ${n},
237
+ depsCount: ${t},
238
+ deps: ${r}}`};var Nme={keyword:"dependencies",type:"object",schemaType:"object",error:la.error,code(e){let[t,r]=zme(e);D9(e,t),U9(e,r)}};function zme({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function D9(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let s in t){let o=t[s];if(o.length===0)continue;let u=(0,zp.propertyInData)(r,n,s,i.opts.ownProperties);e.setParams({property:s,depsCount:o.length,deps:o.join(", ")}),i.allErrors?r.if(u,()=>{for(let l of o)(0,zp.checkReportMissingProp)(e,l)}):(r.if((0,MT._)`${u} && (${(0,zp.checkMissingProp)(e,o,a)})`),(0,zp.reportMissingProp)(e,a),r.else())}}la.validatePropertyDeps=D9;function U9(e,t=e.schema){let{gen:r,data:n,keyword:i,it:a}=e,s=r.name("valid");for(let o in t)(0,Ome.alwaysValidSchema)(a,t[o])||(r.if((0,zp.propertyInData)(r,n,o,a.opts.ownProperties),()=>{let u=e.subschema({keyword:i,schemaProp:o},s);e.mergeValidEvaluated(u,s)},()=>r.var(s,!0)),e.ok(s))}la.validateSchemaDeps=U9;la.default=Nme});var Z9=q(LT=>{"use strict";Object.defineProperty(LT,"__esModule",{value:!0});var L9=Xe(),Cme=xt(),jme={message:"property name must be valid",params:({params:e})=>(0,L9._)`{propertyName: ${e.propertyName}}`},Ame={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:jme,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,Cme.alwaysValidSchema)(i,r))return;let a=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},a),t.if((0,L9.not)(a),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(a)}};LT.default=Ame});var qT=q(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});var Sy=fi(),Fi=Xe(),Rme=Da(),Iy=xt(),Dme={message:"must NOT have additional properties",params:({params:e})=>(0,Fi._)`{additionalProperty: ${e.additionalProperty}}`},Ume={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dme,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:a,it:s}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:o,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,Iy.alwaysValidSchema)(s,r))return;let l=(0,Sy.allSchemaProperties)(n.properties),c=(0,Sy.allSchemaProperties)(n.patternProperties);d(),e.ok((0,Fi._)`${a} === ${Rme.default.errors}`);function d(){t.forIn("key",i,_=>{!l.length&&!c.length?h(_):t.if(f(_),()=>h(_))})}function f(_){let m;if(l.length>8){let g=(0,Iy.schemaRefOrVal)(s,n.properties,"properties");m=(0,Sy.isOwnProperty)(t,g,_)}else l.length?m=(0,Fi.or)(...l.map(g=>(0,Fi._)`${_} === ${g}`)):m=Fi.nil;return c.length&&(m=(0,Fi.or)(m,...c.map(g=>(0,Fi._)`${(0,Sy.usePattern)(e,g)}.test(${_})`))),(0,Fi.not)(m)}function p(_){t.code((0,Fi._)`delete ${i}[${_}]`)}function h(_){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){p(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),o||t.break();return}if(typeof r=="object"&&!(0,Iy.alwaysValidSchema)(s,r)){let m=t.name("valid");u.removeAdditional==="failing"?(y(_,m,!1),t.if((0,Fi.not)(m),()=>{e.reset(),p(_)})):(y(_,m),o||t.if((0,Fi.not)(m),()=>t.break()))}}function y(_,m,g){let v={keyword:"additionalProperties",dataProp:_,dataPropType:Iy.Type.Str};g===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(v,m)}}};ZT.default=Ume});var V9=q(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});var Mme=_p(),q9=fi(),FT=xt(),F9=qT(),Lme={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:a}=e;a.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&F9.default.code(new Mme.KeywordCxt(a,F9.default,"additionalProperties"));let s=(0,q9.allSchemaProperties)(r);for(let d of s)a.definedProperties.add(d);a.opts.unevaluated&&s.length&&a.props!==!0&&(a.props=FT.mergeEvaluated.props(t,(0,FT.toHash)(s),a.props));let o=s.filter(d=>!(0,FT.alwaysValidSchema)(a,r[d]));if(o.length===0)return;let u=t.name("valid");for(let d of o)l(d)?c(d):(t.if((0,q9.propertyInData)(t,i,d,a.opts.ownProperties)),c(d),a.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(u);function l(d){return a.opts.useDefaults&&!a.compositeRule&&r[d].default!==void 0}function c(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},u)}}};VT.default=Lme});var K9=q(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});var W9=fi(),$y=Xe(),B9=xt(),G9=xt(),Zme={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:a}=e,{opts:s}=a,o=(0,W9.allSchemaProperties)(r),u=o.filter(y=>(0,B9.alwaysValidSchema)(a,r[y]));if(o.length===0||u.length===o.length&&(!a.opts.unevaluated||a.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,c=t.name("valid");a.props!==!0&&!(a.props instanceof $y.Name)&&(a.props=(0,G9.evaluatedPropsToName)(t,a.props));let{props:d}=a;f();function f(){for(let y of o)l&&p(y),a.allErrors?h(y):(t.var(c,!0),h(y),t.if(c))}function p(y){for(let _ in l)new RegExp(y).test(_)&&(0,B9.checkStrictMode)(a,`property ${_} matches pattern ${y} (use allowMatchingProperties)`)}function h(y){t.forIn("key",n,_=>{t.if((0,$y._)`${(0,W9.usePattern)(e,y)}.test(${_})`,()=>{let m=u.includes(y);m||e.subschema({keyword:"patternProperties",schemaProp:y,dataProp:_,dataPropType:G9.Type.Str},c),a.opts.unevaluated&&d!==!0?t.assign((0,$y._)`${d}[${_}]`,!0):!m&&!a.allErrors&&t.if((0,$y.not)(c),()=>t.break())})})}}};WT.default=Zme});var H9=q(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});var qme=xt(),Fme={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,qme.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};BT.default=Fme});var J9=q(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});var Vme=fi(),Wme={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Vme.validateUnion,error:{message:"must match a schema in anyOf"}};GT.default=Wme});var Y9=q(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});var Ey=Xe(),Bme=xt(),Gme={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ey._)`{passingSchemas: ${e.passing}}`},Kme={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Gme,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let a=r,s=t.let("valid",!1),o=t.let("passing",null),u=t.name("_valid");e.setParams({passing:o}),t.block(l),e.result(s,()=>e.reset(),()=>e.error(!0));function l(){a.forEach((c,d)=>{let f;(0,Bme.alwaysValidSchema)(i,c)?t.var(u,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},u),d>0&&t.if((0,Ey._)`${u} && ${s}`).assign(s,!1).assign(o,(0,Ey._)`[${o}, ${d}]`).else(),t.if(u,()=>{t.assign(s,!0),t.assign(o,d),f&&e.mergeEvaluated(f,Ey.Name)})})}}};KT.default=Kme});var Q9=q(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});var Hme=xt(),Jme={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((a,s)=>{if((0,Hme.alwaysValidSchema)(n,a))return;let o=e.subschema({keyword:"allOf",schemaProp:s},i);e.ok(i),e.mergeEvaluated(o)})}};HT.default=Jme});var tF=q(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});var Py=Xe(),eF=xt(),Yme={message:({params:e})=>(0,Py.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Py._)`{failingKeyword: ${e.ifClause}}`},Qme={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Yme,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,eF.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=X9(n,"then"),a=X9(n,"else");if(!i&&!a)return;let s=t.let("valid",!0),o=t.name("_valid");if(u(),e.reset(),i&&a){let c=t.let("ifClause");e.setParams({ifClause:c}),t.if(o,l("then",c),l("else",c))}else i?t.if(o,l("then")):t.if((0,Py.not)(o),l("else"));e.pass(s,()=>e.error(!0));function u(){let c=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},o);e.mergeEvaluated(c)}function l(c,d){return()=>{let f=e.subschema({keyword:c},o);t.assign(s,o),e.mergeValidEvaluated(f,s),d?t.assign(d,(0,Py._)`${c}`):e.setParams({ifClause:c})}}}};function X9(e,t){let r=e.schema[t];return r!==void 0&&!(0,eF.alwaysValidSchema)(e,r)}JT.default=Qme});var rF=q(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});var Xme=xt(),ehe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Xme.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};YT.default=ehe});var nF=q(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});var the=jT(),rhe=C9(),nhe=AT(),ihe=A9(),ahe=R9(),she=M9(),ohe=Z9(),uhe=qT(),lhe=V9(),che=K9(),dhe=H9(),fhe=J9(),phe=Y9(),mhe=Q9(),hhe=tF(),ghe=rF();function vhe(e=!1){let t=[dhe.default,fhe.default,phe.default,mhe.default,hhe.default,ghe.default,ohe.default,uhe.default,she.default,lhe.default,che.default];return e?t.push(rhe.default,ihe.default):t.push(the.default,nhe.default),t.push(ahe.default),t}QT.default=vhe});var iF=q(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var pr=Xe(),yhe={message:({schemaCode:e})=>(0,pr.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,pr._)`{format: ${e}}`},_he={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:yhe,code(e,t){let{gen:r,data:n,$data:i,schema:a,schemaCode:s,it:o}=e,{opts:u,errSchemaPath:l,schemaEnv:c,self:d}=o;if(!u.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:u.code.formats}),y=r.const("fDef",(0,pr._)`${h}[${s}]`),_=r.let("fType"),m=r.let("format");r.if((0,pr._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(_,(0,pr._)`${y}.type || "string"`).assign(m,(0,pr._)`${y}.validate`),()=>r.assign(_,(0,pr._)`"string"`).assign(m,y)),e.fail$data((0,pr.or)(g(),v()));function g(){return u.strictSchema===!1?pr.nil:(0,pr._)`${s} && !${m}`}function v(){let b=c.$async?(0,pr._)`(${y}.async ? await ${m}(${n}) : ${m}(${n}))`:(0,pr._)`${m}(${n})`,w=(0,pr._)`(typeof ${m} == "function" ? ${b} : ${m}.test(${n}))`;return(0,pr._)`${m} && ${m} !== true && ${_} === ${t} && !${w}`}}function p(){let h=d.formats[a];if(!h){g();return}if(h===!0)return;let[y,_,m]=v(h);y===t&&e.pass(b());function g(){if(u.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${a}" ignored in schema at path "${l}"`}}function v(w){let x=w instanceof RegExp?(0,pr.regexpCode)(w):u.code.formats?(0,pr._)`${u.code.formats}${(0,pr.getProperty)(a)}`:void 0,k=r.scopeValue("formats",{key:a,ref:w,code:x});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,pr._)`${k}.validate`]:["string",w,k]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!c.$async)throw new Error("async format in sync schema");return(0,pr._)`await ${m}(${n})`}return typeof _=="function"?(0,pr._)`${m}(${n})`:(0,pr._)`${m}.test(${n})`}}}};XT.default=_he});var aF=q(eO=>{"use strict";Object.defineProperty(eO,"__esModule",{value:!0});var bhe=iF(),whe=[bhe.default];eO.default=whe});var sF=q(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.contentVocabulary=Al.metadataVocabulary=void 0;Al.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Al.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var uF=q(tO=>{"use strict";Object.defineProperty(tO,"__esModule",{value:!0});var xhe=h9(),khe=T9(),She=nF(),Ihe=aF(),oF=sF(),$he=[xhe.default,khe.default,(0,She.default)(),Ihe.default,oF.metadataVocabulary,oF.contentVocabulary];tO.default=$he});var cF=q(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.DiscrError=void 0;var lF;(function(e){e.Tag="tag",e.Mapping="mapping"})(lF||(Ty.DiscrError=lF={}))});var fF=q(nO=>{"use strict";Object.defineProperty(nO,"__esModule",{value:!0});var Rl=Xe(),rO=cF(),dF=hy(),Ehe=bp(),Phe=xt(),The={message:({params:{discrError:e,tagName:t}})=>e===rO.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Rl._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Ohe={keyword:"discriminator",type:"object",schemaType:"object",error:The,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:a}=e,{oneOf:s}=i;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let o=n.propertyName;if(typeof o!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=t.let("valid",!1),l=t.const("tag",(0,Rl._)`${r}${(0,Rl.getProperty)(o)}`);t.if((0,Rl._)`typeof ${l} == "string"`,()=>c(),()=>e.error(!1,{discrError:rO.DiscrError.Tag,tag:l,tagName:o})),e.ok(u);function c(){let p=f();t.if(!1);for(let h in p)t.elseIf((0,Rl._)`${l} === ${h}`),t.assign(u,d(p[h]));t.else(),e.error(!1,{discrError:rO.DiscrError.Mapping,tag:l,tagName:o}),t.endIf()}function d(p){let h=t.name("valid"),y=e.subschema({keyword:"oneOf",schemaProp:p},h);return e.mergeEvaluated(y,Rl.Name),h}function f(){var p;let h={},y=m(i),_=!0;for(let b=0;b<s.length;b++){let w=s[b];if(w?.$ref&&!(0,Phe.schemaHasRulesButRef)(w,a.self.RULES)){let k=w.$ref;if(w=dF.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,k),w instanceof dF.SchemaEnv&&(w=w.schema),w===void 0)throw new Ehe.default(a.opts.uriResolver,a.baseId,k)}let x=(p=w?.properties)===null||p===void 0?void 0:p[o];if(typeof x!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${o}"`);_=_&&(y||m(w)),g(x,b)}if(!_)throw new Error(`discriminator: "${o}" must be required`);return h;function m({required:b}){return Array.isArray(b)&&b.includes(o)}function g(b,w){if(b.const)v(b.const,w);else if(b.enum)for(let x of b.enum)v(x,w);else throw new Error(`discriminator: "properties/${o}" must have "const" or "enum"`)}function v(b,w){if(typeof b!="string"||b in h)throw new Error(`discriminator: "${o}" values must be unique strings`);h[b]=w}}}};nO.default=Ohe});var pF=q((pNe,Nhe)=>{Nhe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var hF=q((rr,iO)=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.MissingRefError=rr.ValidationError=rr.CodeGen=rr.Name=rr.nil=rr.stringify=rr.str=rr._=rr.KeywordCxt=rr.Ajv=void 0;var zhe=l9(),Che=uF(),jhe=fF(),mF=pF(),Ahe=["/properties"],Oy="http://json-schema.org/draft-07/schema",Dl=class extends zhe.default{_addVocabularies(){super._addVocabularies(),Che.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(jhe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(mF,Ahe):mF;this.addMetaSchema(t,Oy,!1),this.refs["http://json-schema.org/schema"]=Oy}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Oy)?Oy:void 0)}};rr.Ajv=Dl;iO.exports=rr=Dl;iO.exports.Ajv=Dl;Object.defineProperty(rr,"__esModule",{value:!0});rr.default=Dl;var Rhe=_p();Object.defineProperty(rr,"KeywordCxt",{enumerable:!0,get:function(){return Rhe.KeywordCxt}});var Ul=Xe();Object.defineProperty(rr,"_",{enumerable:!0,get:function(){return Ul._}});Object.defineProperty(rr,"str",{enumerable:!0,get:function(){return Ul.str}});Object.defineProperty(rr,"stringify",{enumerable:!0,get:function(){return Ul.stringify}});Object.defineProperty(rr,"nil",{enumerable:!0,get:function(){return Ul.nil}});Object.defineProperty(rr,"Name",{enumerable:!0,get:function(){return Ul.Name}});Object.defineProperty(rr,"CodeGen",{enumerable:!0,get:function(){return Ul.CodeGen}});var Dhe=py();Object.defineProperty(rr,"ValidationError",{enumerable:!0,get:function(){return Dhe.default}});var Uhe=bp();Object.defineProperty(rr,"MissingRefError",{enumerable:!0,get:function(){return Uhe.default}})});var gF=q(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.formatLimitDefinition=void 0;var Mhe=hF(),Vi=Xe(),Ts=Vi.operators,Ny={formatMaximum:{okStr:"<=",ok:Ts.LTE,fail:Ts.GT},formatMinimum:{okStr:">=",ok:Ts.GTE,fail:Ts.LT},formatExclusiveMaximum:{okStr:"<",ok:Ts.LT,fail:Ts.GTE},formatExclusiveMinimum:{okStr:">",ok:Ts.GT,fail:Ts.LTE}},Lhe={message:({keyword:e,schemaCode:t})=>(0,Vi.str)`should be ${Ny[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Vi._)`{comparison: ${Ny[e].okStr}, limit: ${t}}`};Ml.formatLimitDefinition={keyword:Object.keys(Ny),type:"string",schemaType:"string",$data:!0,error:Lhe,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:a}=e,{opts:s,self:o}=a;if(!s.validateFormats)return;let u=new Mhe.KeywordCxt(a,o.RULES.all.format.definition,"format");u.$data?l():c();function l(){let f=t.scopeValue("formats",{ref:o.formats,code:s.code.formats}),p=t.const("fmt",(0,Vi._)`${f}[${u.schemaCode}]`);e.fail$data((0,Vi.or)((0,Vi._)`typeof ${p} != "object"`,(0,Vi._)`${p} instanceof RegExp`,(0,Vi._)`typeof ${p}.compare != "function"`,d(p)))}function c(){let f=u.schema,p=o.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let h=t.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Vi._)`${s.code.formats}${(0,Vi.getProperty)(f)}`:void 0});e.fail$data(d(h))}function d(f){return(0,Vi._)`${f}.compare(${r}, ${n}) ${Ny[i].fail} 0`}},dependencies:["format"]};var Zhe=e=>(e.addKeyword(Ml.formatLimitDefinition),e);Ml.default=Zhe});var bF=q((Cp,_F)=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});var Ll=tq(),qhe=gF(),aO=Xe(),vF=new aO.Name("fullFormats"),Fhe=new aO.Name("fastFormats"),sO=(e,t={keywords:!0})=>{if(Array.isArray(t))return yF(e,t,Ll.fullFormats,vF),e;let[r,n]=t.mode==="fast"?[Ll.fastFormats,Fhe]:[Ll.fullFormats,vF],i=t.formats||Ll.formatNames;return yF(e,i,r,n),t.keywords&&(0,qhe.default)(e),e};sO.get=(e,t="full")=>{let n=(t==="fast"?Ll.fastFormats:Ll.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function yF(e,t,r,n){var i,a;(i=(a=e.opts.code).formats)!==null&&i!==void 0||(a.formats=(0,aO._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}_F.exports=Cp=sO;Object.defineProperty(Cp,"__esModule",{value:!0});Cp.default=sO});function Vhe(){let e=new wF.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,xF.default)(e),e}var wF,xF,zy,kF=z(()=>{wF=o_(GZ(),1),xF=o_(bF(),1);zy=class{constructor(t){this._ajv=t??Vhe()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var Cy,SF=z(()=>{Of();Cy=class{constructor(t){this._client=t}async*callToolStream(t,r=ul,n){let i=this._client,a={...n,task:n?.task??(i.isToolTask(t.name)?{}:void 0)},s=i.requestStream({method:"tools/call",params:t},r,a),o=i.getToolOutputValidator(t.name);for await(let u of s){if(u.type==="result"&&o){let l=u.result;if(!l.structuredContent&&!l.isError){yield{type:"error",error:new Pe(De.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(l.structuredContent)try{let c=o(l.structuredContent);if(!c.valid){yield{type:"error",error:new Pe(De.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)};return}}catch(c){if(c instanceof Pe){yield{type:"error",error:c};return}yield{type:"error",error:new Pe(De.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)};return}}yield u}}async getTask(t,r){return this._client.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._client.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._client.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._client.cancelTask({taskId:t},r)}requestStream(t,r,n){return this._client.requestStream(t,r,n)}}});function IF(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function $F(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var EF=z(()=>{});function jy(e,t){if(!(!e||t===null||typeof t!="object")){if(e.type==="object"&&e.properties&&typeof e.properties=="object"){let r=t,n=e.properties;for(let i of Object.keys(n)){let a=n[i];r[i]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(r[i]=a.default),r[i]!==void 0&&jy(a,r[i])}}if(Array.isArray(e.anyOf))for(let r of e.anyOf)typeof r!="boolean"&&jy(r,t);if(Array.isArray(e.oneOf))for(let r of e.oneOf)typeof r!="boolean"&&jy(r,t)}}function Whe(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}var Ay,PF=z(()=>{w6();Of();kF();ov();SF();EF();Ay=class extends bv{constructor(t,r){super(r),this._clientInfo=t,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new zy,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(t){t.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",TE,t.tools,async()=>(await this.listTools()).tools),t.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",EE,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",bE,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Cy(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=b6(this._capabilities,t)}setRequestHandler(t,r){let i=sv(t)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(al(i)){let o=i;a=o._zod?.def?.value??o.value}else{let o=i;a=o._def?.value??o.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");let s=a;if(s==="elicitation/create"){let o=async(u,l)=>{let c=Ai(CE,u);if(!c.success){let g=c.error instanceof Error?c.error.message:String(c.error);throw new Pe(De.InvalidParams,`Invalid elicitation request: ${g}`)}let{params:d}=c.data;d.mode=d.mode??"form";let{supportsFormMode:f,supportsUrlMode:p}=Whe(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new Pe(De.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!p)throw new Pe(De.InvalidParams,"Client does not support URL-mode elicitation requests");let h=await Promise.resolve(r(u,l));if(d.task){let g=Ai(lo,h);if(!g.success){let v=g.error instanceof Error?g.error.message:String(g.error);throw new Pe(De.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}let y=Ai(jE,h);if(!y.success){let g=y.error instanceof Error?y.error.message:String(y.error);throw new Pe(De.InvalidParams,`Invalid elicitation result: ${g}`)}let _=y.data,m=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&_.action==="accept"&&_.content&&m&&this._capabilities.elicitation?.form?.applyDefaults)try{jy(m,_.content)}catch{}return _};return super.setRequestHandler(t,o)}if(s==="sampling/createMessage"){let o=async(u,l)=>{let c=Ai(OE,u);if(!c.success){let _=c.error instanceof Error?c.error.message:String(c.error);throw new Pe(De.InvalidParams,`Invalid sampling request: ${_}`)}let{params:d}=c.data,f=await Promise.resolve(r(u,l));if(d.task){let _=Ai(lo,f);if(!_.success){let m=_.error instanceof Error?_.error.message:String(_.error);throw new Pe(De.InvalidParams,`Invalid task creation result: ${m}`)}return _.data}let h=d.tools||d.toolChoice?zE:NE,y=Ai(h,f);if(!y.success){let _=y.error instanceof Error?y.error.message:String(y.error);throw new Pe(De.InvalidParams,`Invalid sampling result: ${_}`)}return y.data};return super.setRequestHandler(t,o)}return super.setRequestHandler(t,r)}assertCapability(t,r){if(!this._serverCapabilities?.[t])throw new Error(`Server does not support ${t} (required for ${r})`)}async connect(t,r){if(await super.connect(t),t.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:lE,capabilities:this._capabilities,clientInfo:this._clientInfo}},mE,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!X2.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(t){switch(t){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${t})`);if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${t})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${t})`);break;case"ping":break}}assertTaskCapability(t){IF(this._serverCapabilities?.tasks?.requests,t,"Server")}assertTaskHandlerCapability(t){this._capabilities&&$F(this._capabilities.tasks?.requests,t,"Client")}async ping(t){return this.request({method:"ping"},uo,t)}async complete(t,r){return this.request({method:"completion/complete",params:t},AE,r)}async setLoggingLevel(t,r){return this.request({method:"logging/setLevel",params:{level:t}},uo,r)}async getPrompt(t,r){return this.request({method:"prompts/get",params:t},$E,r)}async listPrompts(t,r){return this.request({method:"prompts/list",params:t},wE,r)}async listResources(t,r){return this.request({method:"resources/list",params:t},gE,r)}async listResourceTemplates(t,r){return this.request({method:"resources/templates/list",params:t},vE,r)}async readResource(t,r){return this.request({method:"resources/read",params:t},_E,r)}async subscribeResource(t,r){return this.request({method:"resources/subscribe",params:t},uo,r)}async unsubscribeResource(t,r){return this.request({method:"resources/unsubscribe",params:t},uo,r)}async callTool(t,r=ul,n){if(this.isToolTaskRequired(t.name))throw new Pe(De.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let i=await this.request({method:"tools/call",params:t},r,n),a=this.getToolOutputValidator(t.name);if(a){if(!i.structuredContent&&!i.isError)throw new Pe(De.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(i.structuredContent)try{let s=a(i.structuredContent);if(!s.valid)throw new Pe(De.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof Pe?s:new Pe(De.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return i}isToolTask(t){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(t):!1}isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}cacheToolMetadata(t){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of t){if(r.outputSchema){let i=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,i)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}async listTools(t,r){let n=await this.request({method:"tools/list",params:t},PE,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(t,r,n,i){let a=h6.safeParse(n);if(!a.success)throw new Error(`Invalid ${t} listChanged options: ${a.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:o}=a.data,{onChanged:u}=n,l=async()=>{if(!s){u(null,null);return}try{let d=await i();u(null,d)}catch(d){let f=d instanceof Error?d:new Error(String(d));u(f,null)}},c=()=>{if(o){let d=this._listChangedDebounceTimers.get(t);d&&clearTimeout(d);let f=setTimeout(l,o);this._listChangedDebounceTimers.set(t,f)}else l()};this.setNotificationHandler(r,c)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var CF=q(($Ne,zF)=>{zF.exports=NF;NF.sync=Ghe;var TF=wi("fs");function Bhe(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function OF(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Bhe(t,r)}function NF(e,t,r){TF.stat(e,function(n,i){r(n,n?!1:OF(i,e,t))})}function Ghe(e,t){return OF(TF.statSync(e),e,t)}});var UF=q((ENe,DF)=>{DF.exports=AF;AF.sync=Khe;var jF=wi("fs");function AF(e,t,r){jF.stat(e,function(n,i){r(n,n?!1:RF(i,t))})}function Khe(e,t){return RF(jF.statSync(e),t)}function RF(e,t){return e.isFile()&&Hhe(e,t)}function Hhe(e,t){var r=e.mode,n=e.uid,i=e.gid,a=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),o=parseInt("100",8),u=parseInt("010",8),l=parseInt("001",8),c=o|u,d=r&l||r&u&&i===s||r&o&&n===a||r&c&&a===0;return d}});var LF=q((TNe,MF)=>{var PNe=wi("fs"),Ry;process.platform==="win32"||global.TESTING_WINDOWS?Ry=CF():Ry=UF();MF.exports=oO;oO.sync=Jhe;function oO(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){oO(e,t||{},function(a,s){a?i(a):n(s)})})}Ry(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Jhe(e,t){try{return Ry.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var GF=q((ONe,BF)=>{var Zl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ZF=wi("path"),Yhe=Zl?";":":",qF=LF(),FF=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),VF=(e,t)=>{let r=t.colon||Yhe,n=e.match(/\//)||Zl&&e.match(/\\/)?[""]:[...Zl?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],i=Zl?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=Zl?i.split(r):[""];return Zl&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:i}},WF=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:a}=VF(e,t),s=[],o=l=>new Promise((c,d)=>{if(l===n.length)return t.all&&s.length?c(s):d(FF(e));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=ZF.join(p,e),y=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(u(y,l,0))}),u=(l,c,d)=>new Promise((f,p)=>{if(d===i.length)return f(o(c+1));let h=i[d];qF(l+h,{pathExt:a},(y,_)=>{if(!y&&_)if(t.all)s.push(l+h);else return f(l+h);return f(u(l,c,d+1))})});return r?o(0).then(l=>r(null,l),r):o(0)},Qhe=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=VF(e,t),a=[];for(let s=0;s<r.length;s++){let o=r[s],u=/^".*"$/.test(o)?o.slice(1,-1):o,l=ZF.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let f=c+n[d];try{if(qF.sync(f,{pathExt:i}))if(t.all)a.push(f);else return f}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw FF(e)};BF.exports=WF;WF.sync=Qhe});var HF=q((NNe,uO)=>{"use strict";var KF=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};uO.exports=KF;uO.exports.default=KF});var XF=q((zNe,QF)=>{"use strict";var JF=wi("path"),Xhe=GF(),ege=HF();function YF(e,t){let r=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Xhe.sync(e.command,{path:r[ege({env:r})],pathExt:t?JF.delimiter:void 0})}catch{}finally{a&&process.chdir(n)}return s&&(s=JF.resolve(i?e.options.cwd:"",s)),s}function tge(e){return YF(e)||YF(e,!0)}QF.exports=tge});var eV=q((CNe,cO)=>{"use strict";var lO=/([()\][%!^"`<>&|;, *?])/g;function rge(e){return e=e.replace(lO,"^$1"),e}function nge(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(lO,"^$1"),t&&(e=e.replace(lO,"^$1")),e}cO.exports.command=rge;cO.exports.argument=nge});var rV=q((jNe,tV)=>{"use strict";tV.exports=/^#!(.*)/});var iV=q((ANe,nV)=>{"use strict";var ige=rV();nV.exports=(e="")=>{let t=e.match(ige);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var sV=q((RNe,aV)=>{"use strict";var dO=wi("fs"),age=iV();function sge(e){let r=Buffer.alloc(150),n;try{n=dO.openSync(e,"r"),dO.readSync(n,r,0,150,0),dO.closeSync(n)}catch{}return age(r.toString())}aV.exports=sge});var cV=q((DNe,lV)=>{"use strict";var oge=wi("path"),oV=XF(),uV=eV(),uge=sV(),lge=process.platform==="win32",cge=/\.(?:com|exe)$/i,dge=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function fge(e){e.file=oV(e);let t=e.file&&uge(e.file);return t?(e.args.unshift(e.file),e.command=t,oV(e)):e.file}function pge(e){if(!lge)return e;let t=fge(e),r=!cge.test(t);if(e.options.forceShell||r){let n=dge.test(t);e.command=oge.normalize(e.command),e.command=uV.command(e.command),e.args=e.args.map(a=>uV.argument(a,n));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function mge(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:pge(n)}lV.exports=mge});var pV=q((UNe,fV)=>{"use strict";var fO=process.platform==="win32";function pO(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hge(e,t){if(!fO)return;let r=e.emit;e.emit=function(n,i){if(n==="exit"){let a=dV(i,t);if(a)return r.call(e,"error",a)}return r.apply(e,arguments)}}function dV(e,t){return fO&&e===1&&!t.file?pO(t.original,"spawn"):null}function gge(e,t){return fO&&e===1&&!t.file?pO(t.original,"spawnSync"):null}fV.exports={hookChildProcess:hge,verifyENOENT:dV,verifyENOENTSync:gge,notFoundError:pO}});var gV=q((MNe,ql)=>{"use strict";var mV=wi("child_process"),mO=cV(),hO=pV();function hV(e,t,r){let n=mO(e,t,r),i=mV.spawn(n.command,n.args,n.options);return hO.hookChildProcess(i,n),i}function vge(e,t,r){let n=mO(e,t,r),i=mV.spawnSync(n.command,n.args,n.options);return i.error=i.error||hO.verifyENOENTSync(i.status,n),i}ql.exports=hV;ql.exports.spawn=hV;ql.exports.sync=vge;ql.exports._parse=mO;ql.exports._enoent=hO});function yge(e){return o6.parse(JSON.parse(e))}function vV(e){return JSON.stringify(e)+`
239
+ `}var Dy,yV=z(()=>{Of();Dy=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
240
+ `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),yge(r)}clear(){this._buffer=void 0}}});import gO from"node:process";import{PassThrough as _ge}from"node:stream";function wge(){let e={};for(let t of bge){let r=gO.env[t];r!==void 0&&(r.startsWith("()")||(e[t]=r))}return e}var _V,bge,Uy,bV=z(()=>{_V=o_(gV(),1);yV();bge=gO.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];Uy=class{constructor(t){this._readBuffer=new Dy,this._stderrStream=null,this._serverParams=t,(t.stderr==="pipe"||t.stderr==="overlapped")&&(this._stderrStream=new _ge)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,r)=>{this._process=(0,_V.default)(this._serverParams.command,this._serverParams.args??[],{env:{...wge(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:gO.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{t()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){if(this._process){let t=this._process;this._process=void 0;let r=new Promise(n=>{t.once("close",()=>{n()})});try{t.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),t.exitCode===null){try{t.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(t.exitCode===null)try{t.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(t){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=vV(t);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}}});var My,wV=z(()=>{PF();bV();xi();My=class{#e=new Map;async ensureServer(t,r){if(this.#e.has(t))return this.#e.get(t);let{command:n,args:i=[],env:a={}}=r;M.debug(`[MCP] Starting ${t}: ${n} ${i.join(" ")}`);let s=new Uy({command:n,args:i,env:{...process.env,...a}}),o=new Ay({name:`zibby-chat-${t}`,version:"1.0.0"},{capabilities:{}});await o.connect(s);let u={client:o,transport:s,serverConfig:r};return this.#e.set(t,u),u}async callTool(t,r,n={}){let i=this.#e.get(t);if(!i)throw new Error(`MCP server "${t}" not running`);M.debug(`[MCP] ${t}.${r}(${JSON.stringify(n).slice(0,200)})`);let a=await i.client.callTool({name:r,arguments:n});return{text:a.content?.filter(o=>o.type==="text").map(o=>o.text).join(`
241
+ `)||"",isError:a.isError||!1}}isRunning(t){return this.#e.has(t)}async stopServer(t){let r=this.#e.get(t);if(r){try{await r.client.close()}catch(n){M.debug(`[MCP] Error closing ${t}: ${n.message}`)}this.#e.delete(t)}}async stopAll(){let t=[...this.#e.keys()];await Promise.allSettled(t.map(r=>this.stopServer(r)))}}});import{existsSync as xge,readFileSync as kge}from"node:fs";import{join as Sge}from"node:path";import{homedir as Ige}from"node:os";function $ge(){try{let e=Sge(Ige(),".zibby","config.json");return xge(e)?JSON.parse(kge(e,"utf-8")):{}}catch{return{}}}function Ly(e){return String(e||"").replace(/\/v1\/?$/,"")}function Ege(e,t){let r=process.env.OPENAI_PROXY_URL;if(r)return Ly(r);if(e==="session")return t.proxyUrl?Ly(t.proxyUrl):`${(process.env.ZIBBY_API_URL||"https://api-prod.zibby.app").replace(/\/$/,"")}/openai-proxy`;if(e==="byok"){let n=process.env.OPENAI_BASE_URL;return Ly(n||"https://api.openai.com")}return Ly(r||"")}function vO(){let e=$ge(),t=process.env.ZIBBY_USER_TOKEN||e.sessionToken||null,r=process.env.OPENAI_API_KEY||null,n=(process.env.ASSISTANT_AUTH_MODE||"").trim().toLowerCase(),i=process.env.OPENAI_PROXY_NO_AUTH==="true",a=process.env.OPENAI_PROXY_URL,s="session";n==="byok"||n==="local"||n==="session"?s=n:t?s="session":r?s="byok":a&&i&&(s="local");let o=Ege(s,e),u={"Content-Type":"application/json"};if(s==="session"){if(!t)return{ok:!1,mode:s,reason:"missing_session_token"};u.Authorization=`Bearer ${t}`}else if(s==="byok"){if(!r)return{ok:!1,mode:s,reason:"missing_openai_api_key"};u.Authorization=`Bearer ${r}`}else if(s==="local"){if(!o)return{ok:!1,mode:s,reason:"missing_openai_proxy_url"};!i&&r&&(u.Authorization=`Bearer ${r}`)}return o?{ok:!0,mode:s,baseUrl:o,headers:u,tokenPreview:u.Authorization?`***${u.Authorization.slice(-4)}`:"none"}:{ok:!1,mode:s,reason:"missing_base_url"}}var xV=z(()=>{});function Zy(e,t){let r=String(e??"");return r.length<=t?r:`${r.slice(0,Math.max(0,t-30))}
242
+
243
+ [tool result truncated for size]`}function Pge(e,t){if(typeof e=="string")return Zy(e,t);try{return Zy(JSON.stringify(e),t)}catch{return Zy(String(e),t)}}function kV(e){let t=new Set;for(let i of e)if(i.role==="assistant"&&Array.isArray(i.tool_calls))for(let a of i.tool_calls)t.add(a.id);let r=e.filter(i=>i.role==="tool"?t.has(i.tool_call_id):!0),n=new Set;for(let i of r)i.role==="tool"&&n.add(i.tool_call_id);return r.map(i=>{if(i.role!=="assistant"||!Array.isArray(i.tool_calls)||i.tool_calls.every(u=>n.has(u.id)))return i;let{tool_calls:s,...o}=i;return{...o,content:o.content||""}})}function Tge(e){let t=Array.isArray(e?.messages)?e.messages:[],r=t.find(a=>a.role==="system"),n=t.slice(-4).map(a=>({...a,content:Zy(a.content,a.role==="tool"?1200:2500)}));n=kV(n);let i={...e,messages:[r,...n].filter(Boolean)};return delete i.tools,i}async function Oge({body:e,streaming:t,auth:r,options:n,fetchCompletion:i,fetchStreamingCompletion:a,onFallbackLog:s}){try{return t?await a(e,r,n):await i(e,r,n)}catch(o){let u=String(o?.message||o||"");if(!/proxy error 413|payload too large/i.test(u))throw o;let l=Tge(e);return typeof s=="function"&&s(e,l),{data:t?await a(l,r,n):await i(l,r,n),fallback:l}}}async function SV({body:e,auth:t,options:r,streaming:n,toolContext:i,activeSkills:a,round:s,verbose:o,dependencies:u,config:l={}}){let c=l.maxToolResultChars||3e3,{fetchCompletion:d,fetchStreamingCompletion:f,onFallbackLog:p,hasToolCalls:h,getTextContent:y,parseToolCalls:_,buildAssistantMessage:m,buildToolResultMessage:g,executeTool:v,onToolCallLog:b,injectTools:w}=u;Array.isArray(e?.messages)&&(e.messages=kV(e.messages));let x=await Oge({body:e,streaming:n,auth:t,options:r,fetchCompletion:d,fetchStreamingCompletion:f,onFallbackLog:p}),k=x?.data||x;if(!h(k))return{done:!0,text:y(k),body:x?.fallback||e};let $=_(k),T=x?.fallback||e;T.messages.push(m(k)),o&&typeof b=="function"&&b($);let j=await Promise.all($.map((P,U)=>(typeof r.onToolCall=="function"&&r.onToolCall(P.name,P.args,{round:s,index:U,total:$.length}),v(P,i))));for(let P=0;P<$.length;P++){let B=$[P].name==="get_skill_context"?typeof j[P]=="string"?j[P]:JSON.stringify(j[P]):Pge(j[P],c);T.messages.push(g($[P].id,B))}return typeof r.onToolCall=="function"&&r.onToolCall(null),w(T,a),{done:!1,body:T}}var IV=z(()=>{});function Vl(e){!e||typeof e!="object"||(e.type==="object"&&e.properties&&(e.required=Object.keys(e.properties),e.additionalProperties=!1,Object.values(e.properties).forEach(Vl)),e.type==="array"&&e.items&&Vl(e.items),e.anyOf&&e.anyOf.forEach(Vl),e.oneOf&&e.oneOf.forEach(Vl),e.allOf&&e.allOf.forEach(Vl))}function qy(e){return Array.isArray(e)?new Set(e.map(t=>String(t||"").trim()).filter(Boolean)):new Set}function jge(e){return Array.isArray(e)?e.map(t=>String(t||"").trim()).filter(Boolean):[]}var Nge,zge,yO,$V,Fl,Cge,jp,EV=z(()=>{Wa();xi();Cs();B2();wV();Hi();xV();IV();Nge=Yr.ASSISTANT,zge=15,yO="get_skill_context";$V={maxBytes:49e3,systemMaxChars:12e3},Fl=()=>process.env.ZIBBY_VERBOSE==="true"||process.env.ZIBBY_DEBUG==="true",Cge=e=>Buffer.byteLength(JSON.stringify(e),"utf8");jp=class extends Jr{#e;#t;#r=new My;constructor(t=null){super("assistant","Zibby Assistant",200),t&&typeof t=="object"&&(t.toolProvider||t.completionProvider)?(this.#e=t.toolProvider||new nl,this.#t=t.completionProvider||new il):(this.#e=t||new nl,this.#t=new il)}canHandle(t){return vO().ok}async invoke(t,r={}){let n=r.model&&r.model!=="auto"?r.model:Nge,i=vO();if(!i.ok)throw i.reason==="missing_session_token"?new Error("Login required. Run `zibby login` to authenticate."):i.reason==="missing_openai_api_key"?new Error("Missing OPENAI_API_KEY for BYOK mode."):i.reason==="missing_openai_proxy_url"?new Error("Missing OPENAI_PROXY_URL for local mode."):new Error(`Assistant auth unavailable (${i.reason}).`);let a=r.messages||[{role:"user",content:t}],s=i.baseUrl,o=Fl();if(o?await this.#m(a,n,s,i.tokenPreview||"none"):M.debug(`[Assistant] ${s} | model: ${n} | messages: ${a.length}`),r.schema)return this.#l(n,a,i,r);let u=r.activeSkills||[],l=this.#d(r),c=this.#f(u,l),d=this.#p(c),f=this.#c(r),p={...r,payloadCompaction:f},h={activeSkills:c,options:p,executionRegistry:d,capabilityPolicy:l},y=!!r.stream,_={model:n,messages:[...a],stream:!1};this.#i(_,c,l);for(let m=0;m<zge;m++){if(r.signal?.aborted)throw new Error("Aborted");let g=await SV({body:_,auth:i,options:p,streaming:y,toolContext:h,activeSkills:c,round:m,verbose:o,dependencies:{fetchCompletion:this.#a.bind(this),fetchStreamingCompletion:this.#u.bind(this),onFallbackLog:(v,b)=>{Fl()&&console.log(`413 fallback: messages ${v.messages.length} -> ${b.messages.length}, bytes=${Cge(b)}`)},hasToolCalls:v=>this.#e.hasToolCalls(v),getTextContent:v=>this.#e.getTextContent(v),parseToolCalls:v=>this.#e.parseToolCalls(v),buildAssistantMessage:v=>this.#e.buildAssistantMessage(v),buildToolResultMessage:(v,b)=>this.#e.buildToolResultMessage(v,b),executeTool:(v,b)=>this.#o(v,b),onToolCallLog:async v=>{let b=(await import("chalk")).default;console.log(b.dim(` ${v.map(w=>`${w.name}(${JSON.stringify(w.args).slice(0,80)})`).join(", ")}`))},injectTools:(v,b)=>this.#i(v,b,l)},config:{maxToolResultChars:r.maxToolResultChars||3e3}});if(g.done)return g.text;_.messages=g.body.messages,g.body.tools?_.tools=g.body.tools:delete _.tools}return"I hit my tool-calling limit for this turn. Please try again."}async cleanup(){await this.#r.stopAll()}#i(t,r,n=null){let i=this.#s(r,n),a=this.#e.formatTools(i);this.#e.injectToolsIntoBody(t,a)}#s(t,r=null){let n=[],i=new Set;for(let a of t){let s=Ir(a);if(s?.tools?.length)for(let o of s.tools)this.#n(o.name,r)&&(i.has(o.name)||(i.add(o.name),n.push({name:o.name,description:o.description,parameters:o.parameters||o.input_schema||{type:"object",properties:{}}})))}return!r?.disableSkillContextTool&&this.#n(yO,r)&&n.push({name:yO,description:"Fetch full prompt guidance/instructions for one installed skill on demand. Use this before making complex tool decisions if guidance is needed.",parameters:{type:"object",properties:{skillId:{type:"string",description:"Installed skill id to inspect (e.g. jira, github, runner, chat-memory)"}},required:["skillId"]}}),n}async#o(t,r){let{activeSkills:n,options:i,executionRegistry:a,capabilityPolicy:s}=r;if(!this.#n(t.name,s))return`Tool "${t.name}" blocked by policy`;if(t.name===yO){let l=String(t.args?.skillId||"").trim();if(!l)return JSON.stringify({error:"skillId is required"});if(!n.includes(l))return JSON.stringify({error:`Skill "${l}" is not active`,activeSkills:n});let c=Ir(l);if(!c)return JSON.stringify({error:`Skill "${l}" not found`});let d=typeof c.promptFragment=="function"?c.promptFragment():c.promptFragment||"",f=(c.tools||[]).map(h=>h.name),p=JSON.stringify({skillId:l,description:c.description||"",toolNames:f,promptFragment:d||""});return Fl()&&(console.log(`
244
+ \u{1F4D6} get_skill_context("${l}") \u2192 ${p.length} chars (fragment: ${d.length} chars)`),console.log(` tools: [${f.join(", ")}]`),console.log(` fragment preview: ${d.slice(0,200).replace(/\n/g,"\\n")}\u2026
245
+ `)),p}let o=a?.get(t.name)||null;if(!o)return`Unknown tool: ${t.name}`;let u=Ir(o.skillId);if(!u)return`Skill "${o.skillId}" not found for tool "${t.name}"`;if(o.mode==="handler")try{return u.handleToolCall(t.name,t.args,r)}catch(l){return`Error in ${t.name}: ${l.message}`}if(o.mode==="mcp")try{if(!this.#r.isRunning(u.serverName)){let c=u.resolve(i);if(!c)return`Skill "${o.skillId}" is not available (cannot start server)`;await this.#r.ensureServer(u.serverName,c)}let l=await this.#r.callTool(u.serverName,t.name,t.args);return l.text||(l.isError?"Tool call failed":"Done")}catch(l){return`MCP error (${u.serverName}): ${l.message}`}return`Skill "${o.skillId}" owns tool "${t.name}" but has no execution mode`}async#u(t,r,n){return this.#t.fetchStreamingCompletion(t,r,{...n,onBudget:({beforeBytes:i,meta:a})=>{Fl()&&console.log(`payload bytes (stream) before=${i} after=${a.bytes} trimmed=${a.trimmed} messages=${a.messageCount}`)}})}async#a(t,r,n){return this.#t.fetchCompletion(t,r,{...n,onBudget:({beforeBytes:i,meta:a})=>{Fl()&&console.log(`payload bytes before=${i} after=${a.bytes} trimmed=${a.trimmed} messages=${a.messageCount}`)}})}async#l(t,r,n,i){let{zodToJsonSchema:a}=await Promise.resolve().then(()=>(Ja(),mN)),s=typeof i.schema?.parse=="function",o=s?a(i.schema):i.schema;delete o.$schema,Vl(o);let u={model:t,messages:r,stream:!1,response_format:{type:"json_schema",json_schema:{name:"extract",schema:o,strict:!0}}},l=await this.#a(u,n,i),c=this.#e.getTextContent(l),d=JSON.parse(c),f=s?i.schema.parse(d):d;return{raw:c,structured:f}}#c(t={}){let r=t?.config?.agent?.assistant?.payloadCompaction||{};return{maxBytes:Number(r.maxBytes||t.maxPayloadBytes||$V.maxBytes),systemMaxChars:Number(r.systemMaxChars||$V.systemMaxChars)}}#d(t={}){let r=t?.config?.agent?.assistant?.toolPolicy||{};return{allowTools:qy(r.allowTools||t.allowTools),denyTools:qy(r.denyTools||t.denyTools),denyPrefixes:jge(r.denyPrefixes||t.denyToolPrefixes),includeSkills:qy(r.includeSkills||t.includeSkills),excludeSkills:qy(r.excludeSkills||t.excludeSkills),disableSkillContextTool:!!(r.disableSkillContextTool||t.disableSkillContextTool)}}#f(t,r){let n=r?.includeSkills||new Set,i=r?.excludeSkills||new Set;return n.size===0&&i.size===0?t:t.filter(a=>!(n.size>0&&!n.has(a)||i.has(a)))}#n(t,r){let n=String(t||"").trim();if(!n)return!1;let i=r?.allowTools;if(i&&i.size>0&&!i.has(n))return!1;let a=r?.denyTools;return!(a&&a.has(n)||(r?.denyPrefixes||[]).some(o=>n.startsWith(o)))}#p(t){let r=new Map,n=[];for(let i of t){let a=Ir(i);if(!a?.tools?.length)continue;let s=typeof a.handleToolCall=="function"?"handler":a.serverName&&typeof a.resolve=="function"?"mcp":null;if(s)for(let o of a.tools){let u=String(o?.name||"").trim();if(u){if(r.has(u)){n.push({tool:u,winner:r.get(u).skillId,skipped:i});continue}r.set(u,{skillId:i,mode:s})}}}if(n.length>0&&Fl()){let i=n.slice(0,5).map(a=>`${a.tool}:${a.winner}>${a.skipped}`).join(", ");console.log(`tool registry collisions: ${i}${n.length>5?" ...":""}`)}return r}async#m(t,r,n,i){console.log(`
246
+ \u25C6 Model: ${r} | proxy: ${n} | token: ${i||"none"}
247
+ `);let a=(await import("chalk")).default;console.log(a.bold("Prompt sent to LLM:")),console.log(a.dim("\u2500".repeat(60)));let s=!1;for(let o of t)if(o.role==="system")console.log(a.dim(`[System] ${o.content||""}`));else{s||(console.log(a.dim("\u2500\u2500\u2500 chat history \u2500\u2500\u2500")),s=!0);let u=o.role==="user"?"Human":"AI",l=o.content?.length>200?`${o.content.slice(0,200)}...`:o.content||"";console.log(a.dim(`[${u}] ${l}`))}console.log(a.dim("\u2500".repeat(60)))}}});var Ap={};fa(Ap,{AgentStrategy:()=>Jr,AssistantStrategy:()=>jp,ClaudeAgentStrategy:()=>gf,CodexAgentStrategy:()=>yf,CursorAgentStrategy:()=>md,GeminiAgentStrategy:()=>_f,getAgentStrategy:()=>_O,invokeAgent:()=>TV});function _O(e={}){let{state:t={},preferredAgent:r=null}=e,n=r||t.agentType||process.env.AGENT_TYPE;if(!n)throw new Error("No agent specified. Set agent.claude, agent.cursor, agent.codex, or agent.gemini in .zibby.config.js");M.debug(`Agent selection: requested=${n}`);let i=PV.find(a=>a.getName()===n);if(!i)throw new Error(`Unknown agent '${n}'. Available: ${PV.map(a=>a.getName()).join(", ")}`);if(M.debug(`Checking if ${n} can handle this environment...`),!i.canHandle(e)){let s={assistant:"Run `zibby login` to authenticate",claude:"Set ANTHROPIC_API_KEY in .env",cursor:"Install cursor-agent CLI or set CURSOR_API_KEY",codex:"Install codex CLI (npm i -g @openai/codex) and set OPENAI_API_KEY in .env",gemini:"Install gemini CLI (npm i -g @google/gemini-cli) and set GEMINI_API_KEY in .env"}[n]||"Check your environment configuration";throw new Error(`Agent '${n}' is not available. ${s}`)}return M.debug(`Using agent: ${i.getName()}`),i}async function TV(e,t={},r={}){try{await import("@zibby/skills")}catch{}let n=_O(t),i=t.state?.config||r.config||{},a=i.models||{},s=r.nodeName&&a[r.nodeName]||null,o=a.default||null,u=n.name,l=i.agent?.[u]?.model||null,c=s||o||l||r.model||null,d={...r,model:c,workspace:t.state?.workspace||r.workspace,schema:r.schema||t.schema,images:r.images||t.images||[],skills:r.skills||t.skills||[],config:i},f=d.skills||[];if(f.length>0&&!r.skipPromptFragments){let{getSkill:h}=await Promise.resolve().then(()=>(Hi(),h_)),y=f.map(_=>{let m=h(_)?.promptFragment;return typeof m=="function"?m():m}).filter(Boolean);y.length>0&&(e+=`
248
+
249
+ ${y.join(`
250
+
251
+ `)}`)}let p=t.state?._currentNodeConfig?.extraPromptInstructions?.trim();return p&&(e+=`
252
+
253
+ \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
254
+ \u26A0\uFE0F PRIORITY OVERRIDE \u2014 THE FOLLOWING INSTRUCTIONS TAKE PRECEDENCE OVER ALL PREVIOUS CONTENT
255
+ \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
256
+
257
+ ${p}
258
+ `),M.debug(`Prompt length: ${e.length} chars`),process.env.STAGE!=="prod"&&M.debug(`Full prompt:
259
+ ${e}`),n.invoke(e,d)}var PV,Wl=z(()=>{Dj();E2();A2();L2();EV();xi();Wa();PV=[new jp,new md,new gf,new yf,new _f]});var D3=new Set(["__proto__","constructor","prototype"]);function u_(e){if(D3.has(e))throw new Error(`Invalid state key: "${e}"`)}var ec=class{constructor(t={}){this._state=Object.create(null),Object.assign(this._state,{messages:[],errors:[],artifacts:{},metadata:{},...t}),this._history=[]}get(t){return this._state[t]}set(t,r){u_(t),this._history.push({...this._state}),this._state[t]=r}update(t){let r=Object.getOwnPropertyNames(t);for(let n of r)u_(n);this._history.push({...this._state});for(let n of r)this._state[n]=t[n]}append(t,r){u_(t),this._history.push({...this._state}),Array.isArray(this._state[t])||(this._state[t]=[]),this._state[t].push(r)}getAll(){return{...this._state}}rollback(){this._history.length>0&&(this._state=this._history.pop())}};var tc=class{constructor(t){this.schema=t}parse(t){let r=t.match(/```json\s*([\s\S]*?)\s*```/);if(r)return this.validate(JSON.parse(r[1]));let n=t.match(/\{[\s\S]*\}/);return n?this.validate(JSON.parse(n[0])):this.validate({result:t.trim()})}validate(t){let r=[];for(let[n,i]of Object.entries(this.schema)){if(i.required&&!(n in t)&&r.push(`Missing required field: ${n}`),n in t&&i.type){let a=typeof t[n];a!==i.type&&r.push(`Field '${n}' expected ${i.type}, got ${a}`)}if(i.validate&&n in t){let a=i.validate(t[n]);a&&r.push(`Field '${n}': ${a}`)}}if(r.length>0)throw new Error(`Output validation failed:
260
+ ${r.join(`
261
+ `)}`);return t}},U3={string:(e=!0)=>({type:"string",required:e}),number:(e=!0)=>({type:"number",required:e}),boolean:(e=!0)=>({type:"boolean",required:e}),array:(e=!0)=>({type:"object",required:e,validate:t=>Array.isArray(t)?null:"must be an array"}),enum:(e,t=!0)=>({type:"string",required:t,validate:r=>e.includes(r)?null:`must be one of: ${e.join(", ")}`})};xi();Uo();Wp();import{writeFileSync as bO,readFileSync as OV,existsSync as NV,mkdirSync as Age}from"node:fs";import{join as wO,dirname as Rge}from"node:path";import Fy from"chalk";var No=class{constructor(t){if(this.config=t,this.name=t.name,this.prompt=t.prompt,this.outputSchema=t.outputSchema,!this.outputSchema&&!t._isCustomCode)throw new Error(`Node '${this.name}' must define outputSchema (Zod schema). This defines the contract for what the node returns to state.`);this.isZodSchema=this.outputSchema&&typeof this.outputSchema._def<"u",this.parser=t.outputSchema&&!this.isZodSchema?new tc(t.outputSchema):null,this.retries=t.retries||0,this.onComplete=t.onComplete,this.customExecute=t.execute}async execute(t,r){let n=()=>r&&typeof r.getAll=="function"?r.getAll():t,i=d=>r&&typeof r.get=="function"?r.get(d):t?.[d];if(typeof this.customExecute=="function"){M.info("\u26A1 Using custom execute method (skipping LLM)");try{let d=await this.customExecute(t);return typeof d=="object"&&d!==null&&d.success===!1?{success:!1,error:d.error||"Node execution failed",raw:d.raw||null}:this.isZodSchema?(M.debug("Validating return value against outputSchema..."),{success:!0,output:this.outputSchema.parse(d),raw:null}):{success:!0,output:d,raw:null}}catch(d){return M.error(`\u274C Node '${this.name}' execution failed: ${d.message}`),d.name==="ZodError"&&M.error(`Schema validation errors: ${JSON.stringify(d.errors,null,2)}`),{success:!1,error:d.message,raw:null}}}let a=typeof this.prompt=="function"?this.prompt(n()):this.prompt,s=i("_skillHints");s&&(a=`${s}
262
+
263
+ ${a}`);let o=n(),u=o.cwd||process.cwd(),l=o.sessionPath;try{if(l){let d=wO(l,Va);if(NV(d)){let p=JSON.parse(OV(d,"utf-8"));p.currentNode=this.name,bO(d,JSON.stringify(p,null,2),"utf-8")}let f=wO(l,"..",Va);if(NV(f))try{let p=JSON.parse(OV(f,"utf-8"));p.currentNode=this.name,bO(f,JSON.stringify(p,null,2),"utf-8")}catch{}}}catch(d){M.debug(`Could not update session info: ${d.message}`)}let c=null;for(let d=0;d<=this.retries;d++)try{M.debug(`Node.execute attempt ${d} for '${this.name}'`);let f=n(),p=f.config||{},h={state:f},y={workspace:u,schema:this.isZodSchema?this.outputSchema:null,skills:this.config.skills||[],sessionPath:l,config:p,nodeName:this.name,timeout:this.config?.timeout||3e5},_=t?._coreInvokeAgent;_||(_=(await Promise.resolve().then(()=>(Wl(),Ap))).invokeAgent);let m=await _(a,h,y),g,v;if(typeof m=="string"?(g=m,v=null):m.structured?(g=m.raw||JSON.stringify(m.structured,null,2),v=m.structured):(g=m.raw||JSON.stringify(m,null,2),v=m.extracted||null),l)try{let b=wO(l,this.name,"raw_stream_output.txt");Age(Rge(b),{recursive:!0}),bO(b,typeof g=="string"?g:JSON.stringify(g),"utf-8")}catch(b){M.debug(`Could not save raw output: ${b.message}`)}if(this.isZodSchema&&v){console.log(`
264
+ \u{1F50D} ${Fy.cyan("Validated output:")} ${Fy.white(JSON.stringify(v,null,2))}`);let b=v;if(typeof this.onComplete=="function")try{b=await this.onComplete(n(),v)}catch(w){M.warn(`onComplete hook failed: ${w.message}`)}return{success:!0,output:b,raw:g}}if(typeof this.onComplete=="function")try{return{success:!0,output:await this.onComplete(n(),{raw:g}),raw:g}}catch(b){throw new Error(`onComplete failed: ${b.message}`,{cause:b})}if(this.parser){let b=this.parser.parse(g);return console.log(`
265
+ \u{1F50D} ${Fy.cyan("Parsed output:")} ${Fy.white(JSON.stringify(b,null,2))}`),Ht.step("Output parsed"),{success:!0,output:b,raw:g}}return{success:!0,output:g,raw:g}}catch(f){c=f,d<this.retries&&M.info(`Node '${this.name}' failed, retrying (${d+1}/${this.retries})...`)}return{success:!1,error:c.message,raw:null}}},Rp=class extends No{constructor(t){super({...t,_isCustomCode:!0}),this.condition=t.condition}async execute(t,r){let n=r&&typeof r.getAll=="function"?r.getAll():t;return{success:!0,output:{nextNode:this.condition(n)},raw:null}}};import{existsSync as zV,readFileSync as Dge}from"node:fs";import{join as xO,dirname as CV}from"node:path";var Vy=class{static async loadContext(t,r,n={}){let i={},a=n.filenames||["CONTEXT.md","AGENTS.md"];if(t){let o=CV(xO(r,t));for(let u of a){let l=await this.findAndMergeContextFiles(u,o,r);if(l){let c=u.replace(/\.[^.]+$/,"").toLowerCase();i[c]=l}}}let s=n.discovery||{};for(let[o,u]of Object.entries(s))try{let l=xO(r,u);if(zV(l)){let c=await this.loadFile(l);i[o]=c}}catch(l){console.warn(`\u26A0\uFE0F Could not load context '${o}' from '${u}': ${l.message}`)}return i}static async findAndMergeContextFiles(t,r,n){let i=[],a=r;for(;a.startsWith(n);){let s=xO(a,t);if(zV(s))try{let u=await this.loadFile(s);i.unshift(u)}catch(u){console.warn(`\u26A0\uFE0F Could not load ${t} from ${s}: ${u.message}`)}let o=CV(a);if(o===a)break;a=o}return i.length===0?null:i.every(s=>typeof s=="string")?i.join(`
266
+
267
+ ---
268
+
269
+ `):i.every(s=>typeof s=="object")?Object.assign({},...i):i[i.length-1]}static async loadFile(t){let r=Dge(t,"utf-8");if(t.endsWith(".json"))return JSON.parse(r);if(t.endsWith(".js")||t.endsWith(".mjs")){let{pathToFileURL:n}=await import("url"),i=await import(n(t).href);return i.default||i}return r}};Ja();Wp();Uo();import{mkdirSync as AV,existsSync as kO,writeFileSync as jV,unlinkSync as Uge}from"node:fs";import{join as zo,resolve as RV}from"node:path";import{config as Mge}from"dotenv";import Lge from"handlebars";function Zge({traceFrom:e,sessionId:t,sessionPath:r,idSource:n,mkdirFresh:i}){if(process.env.ZIBBY_SESSION_LOG==="0"||process.env.ZIBBY_SESSION_LOG==="false")return;let a=typeof process.ppid=="number"?process.ppid:"n/a",s=`[zibby:session] from=${e} pid=${process.pid} ppid=${a} sessionId=${t} source=${n} mkdir=${i?"yes":"no"} path=${r}`;if(console.log(s),(process.env.ZIBBY_TRACE_SESSION==="1"||process.env.ZIBBY_TRACE_SESSION==="true")&&process.env.ZIBBY_SESSION_LOG!=="0"&&process.env.ZIBBY_SESSION_LOG!=="false"){let l=(new Error("session trace").stack||"").split(`
270
+ `).slice(2,14).join(`
271
+ `);console.log(`[zibby:session] stack (${e}):
272
+ ${l}`)}}function qge(){return process.env.ZIBBY_RUN_SOURCE==="studio"||process.env.ZIBBY_KEEP_SESSION_ENV==="1"||process.env.ZIBBY_KEEP_SESSION_ENV==="true"}function Fge(){if(process.env.ZIBBY_RUN_SOURCE!=="studio")return;let e=process.env.ZIBBY_SESSION_PATH;if(!(e==null||String(e).trim()===""))try{return RV(String(e).trim())}catch{return String(e).trim()}}function Vge(){qge()||(delete process.env.ZIBBY_SESSION_PATH,delete process.env.ZIBBY_SESSION_ID)}function Wge({sessionPath:e,sessionId:t}){e&&typeof e=="string"&&(process.env.ZIBBY_SESSION_PATH=e),t!=null&&String(t).trim()!==""&&(process.env.ZIBBY_SESSION_ID=String(t).trim())}function Bge(e={}){let t=QO.map(a=>process.env[a]).find(Boolean),r=Math.random().toString(36).slice(2,6),n=t||`${Date.now()}_${r}`,i=e.paths?.sessionPrefix;return i?`${i}_${n}`:n}function Gge({cwd:e=process.cwd(),config:t={},initialState:r={},traceFrom:n="resolveWorkflowSession"}={}){let i=r.sessionPath,a=r.sessionTimestamp,s="initialState.sessionPath";if(!i&&process.env.ZIBBY_SESSION_PATH)try{let l=RV(String(process.env.ZIBBY_SESSION_PATH));l&&(i=l,s="ZIBBY_SESSION_PATH")}catch{}let o;if(i)o=String(i).split(/[/\\]/).filter(Boolean).pop(),a==null&&(a=Date.now());else{let l=process.env.ZIBBY_SESSION_ID&&String(process.env.ZIBBY_SESSION_ID).trim();if(l)o=l,s="ZIBBY_SESSION_ID";else{let d=t.sessionId!=null?String(t.sessionId).trim():"";d&&d!=="last"?(o=d,s="config.sessionId"):(o=Bge(t),s="generated")}a=a??Date.now();let c=t.paths?.output||Mo;i=zo(e,c,YO,o)}let u=!kO(i);return u&&AV(i,{recursive:!0}),Zge({traceFrom:n,sessionId:o,sessionPath:i,idSource:s,mkdirFresh:u}),Wge({sessionPath:i,sessionId:o}),{sessionPath:i,sessionId:o,sessionTimestamp:a}}var Dp=class{constructor(t={}){this.nodes=new Map,this.edges=new Map,this.entryPoint=null,this.middleware=Array.isArray(t.middleware)?[...t.middleware]:[],t.nodeMiddleware&&this.middleware.push(t.nodeMiddleware),this.nodeTypeMap=new Map,this.conditionalCodeMap=new Map,this.stateSchema=t.stateSchema||null,this.nodePrompts=new Map,this.nodeOptions=new Map,this._invokeAgent=t.invokeAgent||null}setStateSchema(t){return this.stateSchema=t,this}getStateSchema(){return this.stateSchema}addNode(t,r,n={}){let i=r instanceof No?r:new No(r);return i.name=t,this.nodes.set(t,i),n.prompt&&this.nodePrompts.set(t,n.prompt),Object.keys(n).length>0&&this.nodeOptions.set(t,n),this}addConditionalNode(t,r){let n=new Rp({...r,name:t});return this.nodes.set(t,n),this}addEdge(t,r){return this.edges.set(t,r),this}setNodeType(t,r){return this.nodeTypeMap.set(t,r),this}addConditionalEdges(t,r,{labels:n}={}){return this.edges.set(t,{conditional:!0,routes:r,labels:n}),typeof r=="function"&&this.conditionalCodeMap.set(t,r.toString()),this}setEntryPoint(t){return this.entryPoint=t,this}use(t){return typeof t=="function"&&this.middleware.push(t),this}_composeMiddleware(t,r,n,i,a){let s=n;for(let o=t.length-1;o>=0;o--){let u=t[o],l=s;s=()=>u(r,l,i,a)}return s()}serialize(){let t=[],r={};for(let[a,s]of this.nodes){let o=this.nodeTypeMap.get(a)||a;t.push({id:a,type:o,data:{nodeType:o,label:a}});let u=s._isCustomCode||!1,l={};u&&typeof s.execute=="function"&&(l.customCode=s.execute.toString());let c=this.nodePrompts.get(a);if(c&&(l.prompt=c),typeof s.customExecute=="function"&&(l.executeCode=s.customExecute.toString()),s.outputSchema)try{if(typeof s.outputSchema._def<"u"){let p=en(s.outputSchema,{target:"openApi3"}),h=this._flattenJsonSchemaToVariables(p);l.outputSchema={jsonSchema:p,variables:h}}else l.outputSchema={schema:s.outputSchema}}catch(f){console.warn(`Failed to convert schema for ${a}:`,f.message)}let d=(this.resolvedToolsMap||{})[a];d?.toolIds&&(l.tools=d.toolIds),Object.keys(l).length>0&&(r[a]=l)}let n=[];for(let[a,s]of this.edges)if(typeof s=="string")n.push({source:a,target:s});else if(s.conditional){let o=this.conditionalCodeMap.get(a)||s.routes.toString(),u=this._inferConditionalTargets(s.routes),l=s.labels||{};for(let c of u){let d={source:a,target:c,data:{conditionalCode:o}};l[c]&&(d.label=l[c]),n.push(d)}}let i=null;if(this.stateSchema)try{i=en(this.stateSchema,{target:"openApi3"})}catch{i=this.stateSchema}return{nodes:t,edges:n,nodeConfigs:r,stateSchema:i}}_inferConditionalTargets(t){let r=t.toString(),n=new Set,i=/return\s+['"]([^'"]+)['"]/g,a;for(;(a=i.exec(r))!==null;)n.add(a[1]);return[...n]}_flattenJsonSchemaToVariables(t,r=""){let n=t;if(t.$ref&&t.definitions){let i=t.$ref.replace("#/definitions/","");n=t.definitions[i]||t}return this._flattenSchema(n,r)}_flattenSchema(t,r=""){if(!t||typeof t!="object")return[];let n=[],i=t.properties||{},a=t.required||[];for(let[s,o]of Object.entries(i)){let u=r?`${r}.${s}`:s,l=!a.includes(s);if(n.push({path:u,type:o.type||"unknown",label:o.description||this._formatLabel(s),optional:l}),o.type==="object"&&o.properties){let c=this._flattenSchema(o,u);n.push(...c)}if(o.type==="array"&&o.items?.type==="object"&&o.items.properties){let c=this._flattenSchema(o.items,`${u}[]`);n.push(...c)}}return n}_formatLabel(t){return t.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim()}_summarizeNodeOutput(t,r){if(!r||typeof r!="object")return[];let n=[];r.success!==void 0&&n.push(`Result: ${r.success?"passed":"failed"}`);for(let[i,a]of Object.entries(r))if(!(i==="success"||i==="raw"||i==="nextNode")){if(typeof a=="string"&&a.length<=80)n.push(`${i}: ${a}`);else if(Array.isArray(a)){let s=a.length,o=a.filter(l=>l?.passed===!0).length;if(a.some(l=>l?.passed!==void 0)){let l=s-o;n.push(`${i}: ${o}/${s} passed${l?`, ${l} failed`:""}`)}else n.push(`${i}: ${s} items`)}if(n.length>=4)break}return n}async run(t,r={}){if(!this.entryPoint)throw new Error("No entry point set for graph");let n=r.cwd||process.cwd();Mge({path:zo(n,".env")});let i=r.config||{};if(!i||Object.keys(i).length===0)try{let w=zo(n,".zibby.config.js");kO(w)&&(i=(await import(w)).default||{})}catch{}process.env.EXECUTION_ID&&!i.agent?.strictMode&&(i.agent={...i.agent,strictMode:!0});let a=r.agentType;if(!a){let w=i?.agent;w?.provider?a=w.provider:w?.gemini?a="gemini":w?.claude?a="claude":w?.cursor?a="cursor":w?.codex?a="codex":a=process.env.AGENT_TYPE||"cursor"}let s=r.contextConfig||t?.config?.contextConfig||t?.config?.context||i?.context||{};if(this.stateSchema){let w=this.stateSchema.safeParse(r);if(!w.success){let x=w.error.issues.map(k=>`${k.path.join(".")}: ${k.message}`);throw console.error("\u274C Initial state validation failed:"),x.forEach(k=>console.error(` - ${k}`)),new Error(`State validation failed: ${x.join(", ")}`)}Ht.step("State validated against schema")}let o=Fge(),u=r.sessionPath||o;u||Vge();let{sessionPath:l,sessionTimestamp:c,sessionId:d}=Gge({cwd:n,config:i,traceFrom:"WorkflowGraph.run",initialState:{sessionPath:u,sessionTimestamp:r.sessionTimestamp}});Ht.step(`Session ${d}`);let f=await Vy.loadContext(r.specPath||"",n,s);Object.keys(f).length>0&&Ht.step(`Context loaded: ${Object.keys(f).join(", ")}`);let p=r.outputPath;!p&&r.specPath&&(t?.calculateOutputPath?p=t.calculateOutputPath(r.specPath):console.warn(`\u26A0\uFE0F outputPath not resolved (specPath=${r.specPath})`));let h=new ec({...r,config:i,agentType:a,outputPath:p,sessionPath:l,sessionTimestamp:c,context:f,resolvedTools:this.resolvedToolsMap||{}}),y=new Map;try{await import("@zibby/skills")}catch{}let{getSkill:_}=await Promise.resolve().then(()=>(Hi(),h_)),m=new Set;for(let[,w]of this.nodes)for(let x of w.config?.skills||[])m.add(x);for(let w of m){let x=_(w);if(typeof x?.middleware=="function")try{let k=await x.middleware();typeof k=="function"&&y.set(w,k)}catch{}}let g=this.entryPoint,v=[];for(;g&&g!=="END";){let w=zo(l,Vp);if(kO(w)){console.warn(`
273
+ \u{1F6D1} Studio stop requested \u2014 ending workflow.`);try{Uge(w)}catch{}if(t&&typeof t.cleanup=="function")try{await t.cleanup()}catch{}return Ht.step("Workflow stopped by Studio"),{success:!0,state:h.getAll(),executionLog:v,stoppedByStudio:!0}}let x=this.nodes.get(g);if(!x)throw new Error(`Node '${g}' not found in graph`);let k=JSON.stringify({sessionPath:l,sessionTimestamp:c,currentNode:g,createdAt:new Date().toISOString(),config:h.get("config")}),$=zo(l,Va);jV($,k,"utf-8");let T=h.get("config")?.paths?.output||Mo,j=zo(n,T,Va);AV(zo(n,T),{recursive:!0});try{jV(j,k,"utf-8")}catch{}let P=r.onPipelineProgress;if(typeof P=="function")try{P({cwd:n,sessionPath:l,sessionId:d,outputBase:h.get("config")?.paths?.output||Mo,currentNode:g})}catch{}let U=(this.resolvedToolsMap||{})[g]||null;h.set("_currentNodeTools",U);let B=h.get("nodeConfigs")||{};h.set("_currentNodeConfig",B[g]||{}),Ht.nodeStart(g);let C=Date.now(),ne=this.nodePrompts.get(g);if(!this._invokeAgent){let ge=await Promise.resolve().then(()=>(Wl(),Ap));this._invokeAgent=ge.invokeAgent}let H=this._invokeAgent,zt={state:h,invokeAgent:async(ge={},Y={})=>{let O=Y.prompt||"";if(ne)try{O=Lge.compile(ne,{noEscape:!0})(ge)}catch(I){throw console.error(`\u274C Template rendering failed for node '${g}':`,I.message),new Error(`Template rendering failed: ${I.message}`,{cause:I})}else if(!O)throw new Error(`No prompt template configured for node '${g}' and no prompt provided in options`);let K={state:h.getAll(),images:Y.images||[]},A={model:Y.model||h.get("model"),workspace:h.get("workspace"),schema:Y.schema,...Y};return H(O,K,A)},_coreInvokeAgent:H,agent:t,nodeId:g,promptTemplate:ne,getPromptTemplate:()=>ne,...h.getAll()};try{let ge=(x.config?.skills||[]).map(E=>y.get(E)).filter(Boolean),Y=[...this.middleware,...ge],O;Y.length>0?O=await this._composeMiddleware(Y,g,async()=>x.execute(zt,h),h.getAll(),h):O=await x.execute(zt,h);let K=Date.now()-C;if(v.push({node:g,success:O.success,duration:K,timestamp:new Date().toISOString()}),!O.success){if(String(O.error||"").includes("Stopped from Zibby Studio")){if(Ht.step("Workflow stopped by Studio"),h.set("stoppedByStudio",!0),t&&typeof t.cleanup=="function")try{await t.cleanup()}catch{}return{success:!0,state:h.getAll(),executionLog:v,stoppedByStudio:!0}}h.append("errors",{node:g,error:O.error});let W=x.config?.retries||0,ve=`${g}_retries`,he=h.getAll()[ve]||0;if(he<W){Ht.stepInfo(`Retrying (attempt ${he+1}/${W})`),h.update({[ve]:he+1,[`${g}_raw`]:O.raw});continue}throw Ht.nodeFailed(g,O.error,{duration:K}),new Error(`Node '${g}' failed after ${he} attempts: ${O.error}`)}h.update({[g]:O.output});let A=this._summarizeNodeOutput(g,O.output);Ht.nodeComplete(g,{duration:K,details:A});let I=this.edges.get(g);if(!I)g="END";else if(I.conditional){let E=h.getAll(),W=I.routes(E);Ht.route(g,W),g=W}else g=I}catch(ge){throw Ht.isInsideNode&&Ht.nodeFailed(g,ge.message,{duration:Date.now()-C}),h.set("failed",!0),h.set("failedAt",g),ge}}Ht.graphComplete();let b={success:!0,state:h.getAll(),executionLog:v};return t&&typeof t.onComplete=="function"&&await t.onComplete(b),b}};var Up=new Map;function DV(e,t){Up.set(e,t)}function SO(e){return Up.get(e)}function Wy(e){return Up.has(e)}function Kge(){return Array.from(Up.keys())}function IO(e){let t=Up.get(e);return t?t.factory&&typeof t.create=="function"?t.create.toString():typeof t.execute=="function"?t.execute.toString():typeof t=="function"?t.toString():null:null}DV("ai_agent",{name:"ai_agent",factory:!0,create:(e,t={})=>({name:e,execute:async r=>{let n=r?._coreInvokeAgent;n||(n=(await Promise.resolve().then(()=>(Wl(),Ap))).invokeAgent);let i=t.extraPromptInstructions||"Execute the task based on the current state.",a=Qge(i,r),s=await n(a,{cwd:r.workspace||process.cwd(),model:r.model,tools:t.resolvedTools||null});return{success:!0,output:{raw:s,nodeId:e},raw:typeof s=="string"?s:s.raw}}})});function Hge(e){let t=/@([\w.]+)/g,r=new Set,n;for(;(n=t.exec(e))!==null;)r.add(n[1]);return Array.from(r)}function Jge(e,t){let r=t.split("."),n=e;for(let i of r){if(n==null)return;n=n[i]}return n}function Yge(e){return e==null?"[not available]":typeof e=="string"?e:typeof e=="object"?e.raw&&typeof e.raw=="string"?e.raw:JSON.stringify(e,null,2):String(e)}function Qge(e,t){let r=Hge(e);if(r.length===0)return e;let n=[],i=new Set;for(let a of r){let s=a.split(".")[0];if(i.has(s))continue;let o=Jge(t,a);if(o!==void 0){let u=Yge(o),l=a.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase());n.push(`## ${l}
274
+ ${u}`),a.includes(".")||i.add(s)}}return n.length===0?e:`${e}
275
+
276
+ ---
277
+ # Referenced Context
278
+
279
+ ${n.join(`
280
+
281
+ `)}`}Hi();var By={};function EO(e,t){if(Array.isArray(t))return $O(t);let r=By[e];return!r||r.length===0?null:$O(r)}function $O(e){if(!Array.isArray(e)||e.length===0)return null;let t=[],r={},n=[];for(let i of e){let a=Ir(i);if(!a){console.warn(`[ToolResolver] Unknown skill "${i}" \u2014 skipping`);continue}n.push(i);for(let s of a.tools||[])t.push({name:s.name,description:s.description,input_schema:s.input_schema||{type:"object",properties:{}}});if(!r[a.serverName])if(typeof a.resolve=="function"){let s=a.resolve();s&&(r[a.serverName]={...s,toolPrefix:i})}else{let s={};for(let o of a.envKeys||[]){let u=process.env[o];u&&(s[o]=u)}r[a.serverName]={command:a.command,args:[...a.args||[]],env:s,toolPrefix:i}}}return n.length===0?null:{toolIds:n,claudeTools:t,mcpServers:r}}xi();function Xge(e,t={}){let{nodes:r,edges:n,nodeConfigs:i={}}=e;if(!Array.isArray(r)||r.length===0)throw new Wi("Graph must have at least one node");if(!Array.isArray(n))throw new Wi("Graph edges must be an array");let a=new Dp(t);t.stateSchema&&a.setStateSchema(t.stateSchema);let s=new Set,o=new Map,u={};for(let f of r){let p=Gy(f);o.set(f.id,{...f,resolvedType:p}),p==="decision"&&s.add(f.id)}for(let[f,p]of o){if(s.has(f))continue;let h=p.resolvedType,y=i[f]||{},_=y.tools,m=EO(h,_);m&&(u[f]=m);let g={};y.prompt&&(g.prompt=y.prompt);let v=Wy(h);if(M.debug(`[compiler] Node "${f}" type="${h}" registered=${v} hasCustomCode=${!!y.customCode} hasExecuteCode=${!!y.executeCode}`),y.customCode&&!v)M.debug("[compiler] \u2192 using customCode (unregistered node)"),a.addNode(f,UV(f,y.customCode,y),g),a.setNodeType(f,h);else if(v){M.debug("[compiler] \u2192 using registered implementation");let b=SO(h);b.factory?a.addNode(f,b.create(f,{...y,resolvedTools:m}),g):a.addNode(f,b,g),a.setNodeType(f,h)}else if(y.executeCode)M.debug("[compiler] \u2192 using executeCode (fallback)"),a.addNode(f,UV(f,y.executeCode,y),g),a.setNodeType(f,h);else throw new Wi(`Unknown node type "${h}" for node "${f}". Did you forget to register it?`)}a.resolvedToolsMap=u;let l=new Set;for(let f of n)s.has(f.target)||l.add(f.target);let c=r.find(f=>!s.has(f.id)&&!l.has(f.id));if(!c)throw new Wi("Could not determine entry point: no node without incoming edges found");a.setEntryPoint(c.id);let d=rve(n,"source");for(let f of n){let p=s.has(f.source),h=s.has(f.target);if(!p)if(h){let y=f.target,_=d.get(y)||[];if(_.length===0)throw new Wi(`Decision node "${y}" has no outgoing edges`);let m=nve(y,_,s);a.addConditionalEdges(f.source,m)}else a.addEdge(f.source,f.target)}return a}function eve(e){let t=[];if(!e||typeof e!="object")return{valid:!1,errors:["Config must be a non-null object"]};if((!Array.isArray(e.nodes)||e.nodes.length===0)&&t.push("Graph must have at least one node"),Array.isArray(e.edges)||t.push("Graph edges must be an array"),t.length>0)return{valid:!1,errors:t};let r=e.nodeConfigs||{};for(let o of e.nodes){let u=Gy(o);if(u==="decision"||Wy(u))continue;let l=r[o.id]||{};l.customCode||l.executeCode||t.push(`Unknown node type "${u}" for node "${o.id}". Register it or provide customCode/executeCode.`)}let n=new Set(e.nodes.map(o=>o.id));for(let o of e.edges)n.has(o.source)||t.push(`Edge references unknown source node "${o.source}"`),n.has(o.target)||t.push(`Edge references unknown target node "${o.target}"`);let i=new Set(e.nodes.filter(o=>Gy(o)==="decision").map(o=>o.id)),a=new Set;for(let o of e.edges)i.has(o.target)||a.add(o.target);let s=e.nodes.filter(o=>!i.has(o.id)&&!a.has(o.id));s.length===0?t.push("No entry point found (every node has incoming edges)"):s.length>1&&t.push(`Multiple entry points found: ${s.map(o=>o.id).join(", ")}. Graph must have exactly one.`);for(let o of i){let u=e.edges.filter(c=>c.source===o);u.length===0&&t.push(`Decision node "${o}" has no outgoing edges`),u.some(c=>c.data?.conditionalCode||c.conditionalCode)||t.push(`Decision node "${o}" outgoing edges have no conditionalCode`)}return{valid:t.length===0,errors:t}}function tve(e){return!e||!Array.isArray(e.nodes)?[]:e.nodes.filter(t=>Gy(t)!=="decision").map(t=>t.id)}function Gy(e){let t=e.data?.nodeType||e.data?.type||e.type;return t==="workflowNode"||t==="custom"||t==="default"?e.id:t}function rve(e,t){let r=new Map;for(let n of e){let i=n[t];r.has(i)||r.set(i,[]),r.get(i).push(n)}return r}function nve(e,t,r){let n=t.find(o=>o.data?.conditionalCode||o.conditionalCode);if(!n)throw new Wi(`Decision node "${e}" has no conditionalCode on its outgoing edges`);let i=n.data?.conditionalCode||n.conditionalCode,a=new Set(t.map(o=>o.target).filter(o=>!r.has(o))),s;try{let u=new Function(`return (${i})`)();s=l=>{let c=u(l);return a.has(c)||M.warn(`Conditional route from "${e}" returned "${c}" which is not a valid target. Valid: ${[...a].join(", ")}`),c}}catch(o){throw new Wi(`Failed to compile conditionalCode for decision "${e}": ${o.message}`)}return s}function UV(e,t,r={}){let n;try{n=new Function("invokeAgent","require","console",`return (${t})`)}catch(s){throw new Wi(`Failed to compile customCode for node "${e}": ${s.message}`)}let i=n(async(...s)=>{let{invokeAgent:o}=await Promise.resolve().then(()=>(Wl(),Ap));return o(...s)},typeof wi<"u"?wi:void 0,console),a=null;return r.outputSchema&&(a=r.outputSchema.jsonSchema||r.outputSchema),{name:e,_isCustomCode:!0,outputSchema:a,execute:async s=>{try{let o=await i(s);return typeof o=="object"&&"success"in o?o:{success:!0,output:o,raw:null}}catch(o){return{success:!1,error:o.message,raw:null}}}}}var Wi=class extends Error{constructor(t){super(t),this.name="CompilationError"}};Hi();function ive(e,t={}){let{nodes:r,edges:n,nodeConfigs:i={}}=e,a=new Set,s=[],o=new Map;for(let _ of r){let m=_.data?.nodeType||_.type;o.set(_.id,m),m==="decision"?a.add(_.id):s.push({id:_.id,nodeType:m,label:_.data?.label||_.id})}let u=s.some(_=>{let m=i[_.id]||{};return!m.customCode&&!m.executeCode}),{toolsPerNode:l,toolIdsByVar:c}=fve(s,i),{simpleEdges:d,conditionalEdges:f}=pve(n,a),p=mve(s,n,a),h=[],y=t.workflowType||"workflow";return h.push(sve(t)),h.push(ove(y,{usesRegisteredNodes:u})),h.push(uve(c)),h.push(lve(y)),h.push(cve(s,i)),h.push(dve(s,p,d,f,l,y)),h.filter(Boolean).join(`
282
+ `)}function ave(e){let t={};for(let[r,n]of Object.entries(e)){let{tools:i,...a}=n;Object.keys(a).length>0&&(t[r]=a)}return t}function sve(e){let t=e.workflowType||"workflow";return["// Generated by Zibby Visual Workflow Editor",`// ${e.projectId?`Project: ${e.projectId} | `:""}Type: ${t} | Version: ${e.version??0}`,`// Downloaded: ${new Date().toISOString()}`,"//",`// Upload back: zibby workflow upload --project <id> --type ${t}`,""].join(`
283
+ `)}function ove(e,{usesRegisteredNodes:t=!0}={}){let r=["import '@zibby/skills';","import { WorkflowGraph } from '@zibby/core/framework/graph.js';","import { invokeAgent } from '@zibby/core';","import { getResolvedToolDefinitions } from '@zibby/core/framework/tool-resolver.js';"];return t&&r.push("import '@zibby/core/templates/register-nodes.js';"),r.push("import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';","import { join, dirname } from 'node:path';","import { fileURLToPath } from 'node:url';",""),r.join(`
284
+ `)}function uve(e){if(e.size===0)return"";let t=["// \u2500\u2500 Tool Bindings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","// Each call resolves skill IDs \u2192 full schemas + MCP server configs","// from the skill registry (populated by @zibby/skills import above)."];for(let[r,n]of e){let i=n.join(", ");t.push(`const ${r} = getResolvedToolDefinitions(${JSON.stringify(n)}); // ${i}`)}return t.push(""),t.join(`
285
+ `)}function lve(e){return["// \u2500\u2500 Node Configs (extra instructions, runtime settings) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","const __filename = fileURLToPath(import.meta.url);","const __dirname = dirname(__filename);",`const configPath = join(__dirname, 'workflow-${e}.config.json');`,"const nodeConfigs = existsSync(configPath)"," ? JSON.parse(readFileSync(configPath, 'utf-8'))"," : {};",""].join(`
286
+ `)}function cve(e,t){let r=["// \u2500\u2500 Node Implementations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","// Each node's execute function is inlined below.","// Edit any function to customize behavior. The upload command detects","// changes via // @custom markers and persists them to the cloud.",""];for(let n of e){let i=MV(n.id),a=t[n.id]?.customCode;if(a)r.push(`// @custom \u2014 modified from default "${n.nodeType}" template`),r.push(`const ${i}_execute = ${a};`);else{let s=IO(n.nodeType);s?(r.push(`// Default "${n.nodeType}" implementation`),r.push(`const ${i}_execute = ${s};`)):(r.push(`// No template available for "${n.nodeType}" \u2014 using passthrough`),r.push(`const ${i}_execute = async (state) => ({ success: true, output: {}, raw: null });`))}r.push("")}return r.join(`
287
+ `)}function dve(e,t,r,n,i,a="workflow"){let s=[];s.push("// \u2500\u2500 Graph Builder \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),s.push("export function buildGraph(options = {}) {"),s.push(" const graph = new WorkflowGraph(options);"),s.push(""),s.push(" // Nodes");for(let u of e){let l=MV(u.id);s.push(` graph.addNode('${u.id}', { name: '${u.id}', execute: ${l}_execute });`),s.push(` graph.setNodeType('${u.id}', '${u.nodeType}');`)}s.push(""),s.push(" // Entry point"),s.push(` graph.setEntryPoint('${t}');`),s.push(""),(r.length>0||n.length>0)&&s.push(" // Edges");for(let u of r)s.push(` graph.addEdge('${u.source}', '${u.target}');`);for(let u of n){let l=u.code.split(`
288
+ `).map((c,d)=>d===0?c:` ${c}`).join(`
289
+ `);s.push(` graph.addConditionalEdges('${u.source}', ${l});`)}let o=[];for(let u of e){let l=i.get(u.id);l&&o.push(` '${u.id}': ${l},`)}if(o.length>0){s.push(""),s.push(" graph.resolvedToolsMap = {");for(let u of o)s.push(` ${u}`);s.push(" };")}return s.push(""),s.push(" return graph;"),s.push("}"),s.push(""),s.push("// \u2500\u2500 Exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),s.push("export { nodeConfigs };"),s.push(""),s.join(`
290
+ `)}function fve(e,t){let r=new Map,n=new Map;for(let i of e){let a=t[i.id]?.tools,s;if(Array.isArray(a)&&a.length>0)s=[...a].sort();else{let o=By[i.nodeType];o&&o.length>0&&(s=[...o].sort())}if(s){let o=`${s.map(u=>u.replace(/[^a-zA-Z0-9]/g,"")).join("And")}Tools`;r.set(i.id,o),n.has(o)||n.set(o,s)}}return{toolsPerNode:r,toolIdsByVar:n}}function pve(e,t){let r=[],n=[],i=new Map,a=new Set;for(let s of e){let o=s.source;i.has(o)||i.set(o,[]),i.get(o).push(s)}for(let s of e)if(!t.has(s.source))if(t.has(s.target)){if(a.has(s.target))continue;a.add(s.target);let u=(i.get(s.target)||[]).find(l=>l.data?.conditionalCode||l.conditionalCode);if(u){let l=u.data?.conditionalCode||u.conditionalCode;n.push({source:s.source,code:l})}}else r.push({source:s.source,target:s.target});return{simpleEdges:r,conditionalEdges:n}}function mve(e,t,r){let n=new Set;for(let a of t)r.has(a.target)||n.add(a.target);let i=e.find(a=>!n.has(a.id));return i?i.id:e[0]?.id}function MV(e){return e.replace(/[^a-zA-Z0-9]/g,"_")}var hve=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],WV=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],gve="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",BV="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",PO={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},TO="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",vve={5:TO,"5module":TO+" export import",6:TO+" const class extends export import super"},GV=/^in(stanceof)?$/,yve=new RegExp("["+BV+"]"),_ve=new RegExp("["+BV+gve+"]");function NO(e,t){for(var r=65536,n=0;n<t.length;n+=2){if(r+=t[n],r>e)return!1;if(r+=t[n+1],r>=e)return!0}return!1}function ca(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&yve.test(String.fromCharCode(e)):t===!1?!1:NO(e,WV)}function Ns(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&_ve.test(String.fromCharCode(e)):t===!1?!1:NO(e,WV)||NO(e,hve)}var Tt=function(t,r){r===void 0&&(r={}),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null};function hi(e,t){return new Tt(e,{beforeExpr:!0,binop:t})}var gi={beforeExpr:!0},On={startsExpr:!0},AO={};function _t(e,t){return t===void 0&&(t={}),t.keyword=e,AO[e]=new Tt(e,t)}var S={num:new Tt("num",On),regexp:new Tt("regexp",On),string:new Tt("string",On),name:new Tt("name",On),privateId:new Tt("privateId",On),eof:new Tt("eof"),bracketL:new Tt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new Tt("]"),braceL:new Tt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new Tt("}"),parenL:new Tt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new Tt(")"),comma:new Tt(",",gi),semi:new Tt(";",gi),colon:new Tt(":",gi),dot:new Tt("."),question:new Tt("?",gi),questionDot:new Tt("?."),arrow:new Tt("=>",gi),template:new Tt("template"),invalidTemplate:new Tt("invalidTemplate"),ellipsis:new Tt("...",gi),backQuote:new Tt("`",On),dollarBraceL:new Tt("${",{beforeExpr:!0,startsExpr:!0}),eq:new Tt("=",{beforeExpr:!0,isAssign:!0}),assign:new Tt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new Tt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Tt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:hi("||",1),logicalAND:hi("&&",2),bitwiseOR:hi("|",3),bitwiseXOR:hi("^",4),bitwiseAND:hi("&",5),equality:hi("==/!=/===/!==",6),relational:hi("</>/<=/>=",7),bitShift:hi("<</>>/>>>",8),plusMin:new Tt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:hi("%",10),star:hi("*",10),slash:hi("/",10),starstar:new Tt("**",{beforeExpr:!0}),coalesce:hi("??",1),_break:_t("break"),_case:_t("case",gi),_catch:_t("catch"),_continue:_t("continue"),_debugger:_t("debugger"),_default:_t("default",gi),_do:_t("do",{isLoop:!0,beforeExpr:!0}),_else:_t("else",gi),_finally:_t("finally"),_for:_t("for",{isLoop:!0}),_function:_t("function",On),_if:_t("if"),_return:_t("return",gi),_switch:_t("switch"),_throw:_t("throw",gi),_try:_t("try"),_var:_t("var"),_const:_t("const"),_while:_t("while",{isLoop:!0}),_with:_t("with"),_new:_t("new",{beforeExpr:!0,startsExpr:!0}),_this:_t("this",On),_super:_t("super",On),_class:_t("class",On),_extends:_t("extends",gi),_export:_t("export"),_import:_t("import",On),_null:_t("null",On),_true:_t("true",On),_false:_t("false",On),_in:_t("in",{beforeExpr:!0,binop:7}),_instanceof:_t("instanceof",{beforeExpr:!0,binop:7}),_typeof:_t("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_t("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_t("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Nn=/\r\n?|\n|\u2028|\u2029/,bve=new RegExp(Nn.source,"g");function Bl(e){return e===10||e===13||e===8232||e===8233}function KV(e,t,r){r===void 0&&(r=e.length);for(var n=t;n<r;n++){var i=e.charCodeAt(n);if(Bl(i))return n<r-1&&i===13&&e.charCodeAt(n+1)===10?n+2:n+1}return-1}var HV=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Kr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,JV=Object.prototype,wve=JV.hasOwnProperty,xve=JV.toString,Gl=Object.hasOwn||(function(e,t){return wve.call(e,t)}),LV=Array.isArray||(function(e){return xve.call(e)==="[object Array]"}),ZV=Object.create(null);function Os(e){return ZV[e]||(ZV[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Ma(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var kve=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Lp=function(t,r){this.line=t,this.column=r};Lp.prototype.offset=function(t){return new Lp(this.line,this.column+t)};var Xy=function(t,r,n){this.start=r,this.end=n,t.sourceFile!==null&&(this.source=t.sourceFile)};function YV(e,t){for(var r=1,n=0;;){var i=KV(e,n,t);if(i<0)return new Lp(r,t-n);++r,n=i}}var zO={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},qV=!1;function Sve(e){var t={};for(var r in zO)t[r]=e&&Gl(e,r)?e[r]:zO[r];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!qV&&typeof console=="object"&&console.warn&&(qV=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
291
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),LV(t.onToken)){var n=t.onToken;t.onToken=function(i){return n.push(i)}}if(LV(t.onComment)&&(t.onComment=Ive(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function Ive(e,t){return function(r,n,i,a,s,o){var u={type:r?"Block":"Line",value:n,start:i,end:a};e.locations&&(u.loc=new Xy(this,s,o)),e.ranges&&(u.range=[i,a]),t.push(u)}}var Co=1,jo=2,RO=4,QV=8,DO=16,XV=32,e_=64,e3=128,Ao=256,Zp=512,t3=1024,t_=Co|jo|Ao;function UO(e,t){return jo|(e?RO:0)|(t?QV:0)}var Hy=0,MO=1,Za=2,r3=3,n3=4,i3=5,Sr=function(t,r,n){this.options=t=Sve(t),this.sourceFile=t.sourceFile,this.keywords=Os(vve[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var i="";t.allowReserved!==!0&&(i=PO[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(i+=" await")),this.reservedWords=Os(i);var a=(i?i+" ":"")+PO.strict;this.reservedWordsStrict=Os(a),this.reservedWordsStrictBind=Os(a+" "+PO.strictBind),this.input=String(r),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
292
+ `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Nn).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?jo:Co),this.regexpState=null,this.privateNameStack=[]},yi={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Sr.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};yi.inFunction.get=function(){return(this.currentVarScope().flags&jo)>0};yi.inGenerator.get=function(){return(this.currentVarScope().flags&QV)>0};yi.inAsync.get=function(){return(this.currentVarScope().flags&RO)>0};yi.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],r=t.flags;if(r&(Ao|Zp))return!1;if(r&jo)return(r&RO)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};yi.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Co)};yi.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&e_)>0||this.options.allowSuperOutsideMethod};yi.allowDirectSuper.get=function(){return(this.currentThisScope().flags&e3)>0};yi.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};yi.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],r=t.flags;if(r&(Ao|Zp)||r&jo&&!(r&DO))return!0}return!1};yi.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return!(t&t3||!this.inModule&&t&Co)};yi.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Ao)>0};Sr.extend=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var n=this,i=0;i<t.length;i++)n=t[i](n);return n};Sr.parse=function(t,r){return new this(r,t).parse()};Sr.parseExpressionAt=function(t,r,n){var i=new this(n,t,r);return i.nextToken(),i.parseExpression()};Sr.tokenizer=function(t,r){return new this(r,t)};Object.defineProperties(Sr.prototype,yi);var gn=Sr.prototype,$ve=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;gn.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Kr.lastIndex=e,e+=Kr.exec(this.input)[0].length;var t=$ve.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){Kr.lastIndex=e+t[0].length;var r=Kr.exec(this.input),n=r.index+r[0].length,i=this.input.charAt(n);return i===";"||i==="}"||Nn.test(r[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=t[0].length,Kr.lastIndex=e,e+=Kr.exec(this.input)[0].length,this.input[e]===";"&&e++}};gn.eat=function(e){return this.type===e?(this.next(),!0):!1};gn.isContextual=function(e){return this.type===S.name&&this.value===e&&!this.containsEsc};gn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};gn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};gn.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||Nn.test(this.input.slice(this.lastTokEnd,this.start))};gn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};gn.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()};gn.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};gn.expect=function(e){this.eat(e)||this.unexpected()};gn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var r_=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};gn.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,t?"Assigning to rvalue":"Parenthesized pattern")}};gn.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};gn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};gn.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var _e=Sr.prototype;_e.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==S.eof;){var r=this.parseStatement(null,!0,t);e.body.push(r)}if(this.inModule)for(var n=0,i=Object.keys(this.undefinedExports);n<i.length;n+=1){var a=i[n];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var LO={kind:"loop"},Eve={kind:"switch"};_e.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;Kr.lastIndex=this.pos;var t=Kr.exec(this.input),r=this.pos+t[0].length,n=this.fullCharCodeAt(r);if(n===91||n===92)return!0;if(e)return!1;if(n===123)return!0;if(ca(n)){var i=r;do r+=n<=65535?1:2;while(Ns(n=this.fullCharCodeAt(r)));if(n===92)return!0;var a=this.input.slice(i,r);if(!GV.test(a))return!0}return!1};_e.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;Kr.lastIndex=this.pos;var e=Kr.exec(this.input),t=this.pos+e[0].length,r;return!Nn.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(Ns(r=this.fullCharCodeAt(t+8))||r===92))};_e.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;Kr.lastIndex=this.pos;var r=Kr.exec(this.input),n=this.pos+r[0].length;if(Nn.test(this.input.slice(this.pos,n)))return!1;if(e){var i=n+5,a;if(this.input.slice(n,i)!=="using"||i===this.input.length||Ns(a=this.fullCharCodeAt(i))||a===92)return!1;Kr.lastIndex=i;var s=Kr.exec(this.input);if(n=i+s[0].length,s&&Nn.test(this.input.slice(i,n)))return!1}var o=this.fullCharCodeAt(n);if(!ca(o)&&o!==92)return!1;var u=n;do n+=o<=65535?1:2;while(Ns(o=this.fullCharCodeAt(n)));if(o===92)return!0;var l=this.input.slice(u,n);return!(GV.test(l)||t&&l==="of")};_e.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};_e.isUsing=function(e){return this.isUsingKeyword(!1,e)};_e.parseStatement=function(e,t,r){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=S._var,a="let"),n){case S._break:case S._continue:return this.parseBreakContinueStatement(i,n.keyword);case S._debugger:return this.parseDebuggerStatement(i);case S._do:return this.parseDoStatement(i);case S._for:return this.parseForStatement(i);case S._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case S._class:return e&&this.unexpected(),this.parseClass(i,!0);case S._if:return this.parseIfStatement(i);case S._return:return this.parseReturnStatement(i);case S._switch:return this.parseSwitchStatement(i);case S._throw:return this.parseThrowStatement(i);case S._try:return this.parseTryStatement(i);case S._const:case S._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case S._while:return this.parseWhileStatement(i);case S._with:return this.parseWithStatement(i);case S.braceL:return this.parseBlock(!0,i);case S.semi:return this.parseEmptyStatement(i);case S._export:case S._import:if(this.options.ecmaVersion>10&&n===S._import){Kr.lastIndex=this.pos;var s=Kr.exec(this.input),o=this.pos+s[0].length,u=this.input.charCodeAt(o);if(u===40||u===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===S._import?this.parseImport(i):this.parseExport(i,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,"VariableDeclaration");var c=this.value,d=this.parseExpression();return n===S.name&&d.type==="Identifier"&&this.eat(S.colon)?this.parseLabeledStatement(i,c,d,e):this.parseExpressionStatement(i,d)}};_e.parseBreakContinueStatement=function(e,t){var r=t==="break";this.next(),this.eat(S.semi)||this.insertSemicolon()?e.label=null:this.type!==S.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var i=this.labels[n];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(r||i.kind==="loop")||e.label&&r))break}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")};_e.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};_e.parseDoStatement=function(e){return this.next(),this.labels.push(LO),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};_e.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(LO),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===S._var||this.type===S._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),this.parseForAfterInit(e,n,t)}var a=this.isContextual("let"),s=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var u=this.startNode();return this.next(),o==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(u,!0,o),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(e,u,t)}var l=this.containsEsc,c=new r_,d=this.start,f=t>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===S._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===S._in&&this.unexpected(t),e.await=!0):s&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type==="Identifier"&&f.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(c,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))};_e.parseForAfterInit=function(e,t,r){return(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===S._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,t)):(r>-1&&this.unexpected(r),this.parseFor(e,t))};_e.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Mp|(r?0:CO),!1,t)};_e.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};_e.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};_e.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(S.braceL),this.labels.push(Eve),this.enterScope(t3);for(var t,r=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var n=this.type===S._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(S.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};_e.parseThrowStatement=function(e){return this.next(),Nn.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Pve=[];_e.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?XV:0),this.checkLValPattern(e,t?n3:Za),this.expect(S.parenR),e};_e.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===S._catch){var t=this.startNode();this.next(),this.eat(S.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(S._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};_e.parseVarStatement=function(e,t,r){return this.next(),this.parseVar(e,!1,t,r),this.semicolon(),this.finishNode(e,"VariableDeclaration")};_e.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(LO),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};_e.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};_e.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};_e.parseLabeledStatement=function(e,t,r,n){for(var i=0,a=this.labels;i<a.length;i+=1){var s=a[i];s.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===S._switch?"switch":null,u=this.labels.length-1;u>=0;u--){var l=this.labels[u];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")};_e.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};_e.parseBlock=function(e,t,r){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(S.braceL),e&&this.enterScope(0);this.type!==S.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};_e.parseFor=function(e,t){return e.init=t,this.expect(S.semi),e.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),e.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};_e.parseForIn=function(e,t){var r=this.type===S._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!r||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")};_e.parseVar=function(e,t,r,n){for(e.declarations=[],e.kind=r;;){var i=this.startNode();if(this.parseVarId(i,r),this.eat(S.eq)?i.init=this.parseMaybeAssign(t):!n&&r==="const"&&!(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&(r==="using"||r==="await using")&&this.options.ecmaVersion>=17&&this.type!==S._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+r+" declaration"):!n&&i.id.type!=="Identifier"&&!(t&&(this.type===S._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(S.comma))break}return e};_e.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?MO:Za,!1)};var Mp=1,CO=2,a3=4;_e.parseFunction=function(e,t,r,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===S.star&&t&CO&&this.unexpected(),e.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Mp&&(e.id=t&a3&&this.type!==S.name?null:this.parseIdent(),e.id&&!(t&CO)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?MO:Za:r3));var a=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(UO(e.async,e.generator)),t&Mp||(e.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&Mp?"FunctionDeclaration":"FunctionExpression")};_e.parseFunctionParams=function(e){this.expect(S.parenL),e.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};_e.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(S.braceL);this.type!==S.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&Tve(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=r,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};_e.parseClassElement=function(e){if(this.eat(S.semi))return null;var t=this.options.ecmaVersion,r=this.startNode(),n="",i=!1,a=!1,s="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(S.braceL))return this.parseClassStaticBlock(r),r;this.isClassElementNameStart()||this.type===S.star?o=!0:n="static"}if(r.static=o,!n&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===S.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(t>=9||!a)&&this.eat(S.star)&&(i=!0),!n&&!a&&!i){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=u:n=u)}if(n?(r.computed=!1,r.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),r.key.name=n,this.finishNode(r.key,"Identifier")):this.parseClassElementName(r),t<13||this.type===S.parenL||s!=="method"||i||a){var l=!r.static&&Jy(r,"constructor"),c=l&&e;l&&s!=="method"&&this.raise(r.key.start,"Constructor can't have get/set modifier"),r.kind=l?"constructor":s,this.parseClassMethod(r,i,a,c)}else this.parseClassField(r);return r};_e.isClassElementNameStart=function(){return this.type===S.name||this.type===S.privateId||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword};_e.parseClassElementName=function(e){this.type===S.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};_e.parseClassMethod=function(e,t,r,n){var i=e.key;e.kind==="constructor"?(t&&this.raise(i.start,"Constructor can't be a generator"),r&&this.raise(i.start,"Constructor can't be an async method")):e.static&&Jy(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,r,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};_e.parseClassField=function(e){return Jy(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Jy(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Zp|e_),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};_e.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Ao|e_);this.type!==S.braceR;){var r=this.parseStatement(null);e.body.push(r)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};_e.parseClassId=function(e,t){this.type===S.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Za,!1)):(t===!0&&this.unexpected(),e.id=null)};_e.parseClassSuper=function(e){e.superClass=this.eat(S._extends)?this.parseExprSubscripts(null,!1):null};_e.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};_e.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,r=e.used;if(this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a<r.length;++a){var s=r[a];Gl(t,s.name)||(i?i.used.push(s):this.raiseRecoverable(s.start,"Private field '#"+s.name+"' must be declared in an enclosing class"))}};function Tve(e,t){var r=t.key.name,n=e[r],i="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(i=(t.static?"s":"i")+t.kind),n==="iget"&&i==="iset"||n==="iset"&&i==="iget"||n==="sget"&&i==="sset"||n==="sset"&&i==="sget"?(e[r]="true",!1):n?!0:(e[r]=i,!1)}function Jy(e,t){var r=e.computed,n=e.key;return!r&&(n.type==="Identifier"&&n.name===t||n.type==="Literal"&&n.value===t)}_e.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};_e.parseExport=function(e,t){if(this.next(),this.eat(S.star))return this.parseExportAllDeclaration(e,t);if(this.eat(S._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var r=0,n=e.specifiers;r<n.length;r+=1){var i=n[r];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type==="Literal"&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};_e.parseExportDeclaration=function(e){return this.parseStatement(null)};_e.parseExportDefaultDeclaration=function(){var e;if(this.type===S._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Mp|a3,!1,e)}else if(this.type===S._class){var r=this.startNode();return this.parseClass(r,"nullableID")}else{var n=this.parseMaybeAssign();return this.semicolon(),n}};_e.checkExport=function(e,t,r){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),Gl(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)};_e.checkPatternExport=function(e,t){var r=t.type;if(r==="Identifier")this.checkExport(e,t,t.start);else if(r==="ObjectPattern")for(var n=0,i=t.properties;n<i.length;n+=1){var a=i[n];this.checkPatternExport(e,a)}else if(r==="ArrayPattern")for(var s=0,o=t.elements;s<o.length;s+=1){var u=o[s];u&&this.checkPatternExport(e,u)}else r==="Property"?this.checkPatternExport(e,t.value):r==="AssignmentPattern"?this.checkPatternExport(e,t.left):r==="RestElement"&&this.checkPatternExport(e,t.argument)};_e.checkVariableExport=function(e,t){if(e)for(var r=0,n=t;r<n.length;r+=1){var i=n[r];this.checkPatternExport(e,i.id)}};_e.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};_e.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};_e.parseExportSpecifiers=function(e){var t=[],r=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(r)r=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;t.push(this.parseExportSpecifier(e))}return t};_e.parseImport=function(e){return this.next(),this.type===S.string?(e.specifiers=Pve,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};_e.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Za),this.finishNode(e,"ImportSpecifier")};_e.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Za),this.finishNode(e,"ImportDefaultSpecifier")};_e.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Za),this.finishNode(e,"ImportNamespaceSpecifier")};_e.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===S.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(S.comma)))return e;if(this.type===S.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(S.braceL);!this.eat(S.braceR);){if(t)t=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;e.push(this.parseImportSpecifier())}return e};_e.parseWithClause=function(){var e=[];if(!this.eat(S._with))return e;this.expect(S.braceL);for(var t={},r=!0;!this.eat(S.braceR);){if(r)r=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var n=this.parseImportAttribute(),i=n.key.type==="Identifier"?n.key.name:n.key.value;Gl(t,i)&&this.raiseRecoverable(n.key.start,"Duplicate attribute key '"+i+"'"),t[i]=!0,e.push(n)}return e};_e.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(S.colon),this.type!==S.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};_e.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===S.string){var e=this.parseLiteral(this.value);return kve.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};_e.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};_e.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var _i=Sr.prototype;_i.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n<i.length;n+=1){var a=i[n];this.toAssignable(a,t),a.type==="RestElement"&&(a.argument.type==="ArrayPattern"||a.argument.type==="ObjectPattern")&&this.raise(a.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",r&&this.checkPatternErrors(r,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,r);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else r&&this.checkPatternErrors(r,!0);return e};_i.toAssignableList=function(e,t){for(var r=e.length,n=0;n<r;n++){var i=e[n];i&&this.toAssignable(i,t)}if(r){var a=e[r-1];this.options.ecmaVersion===6&&t&&a&&a.type==="RestElement"&&a.argument.type!=="Identifier"&&this.unexpected(a.argument.start)}return e};_i.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};_i.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==S.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};_i.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()};_i.parseBindingList=function(e,t,r,n){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(S.comma),t&&this.type===S.comma)i.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===S.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),i.push(s),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else i.push(this.parseAssignableListItem(n))}return i};_i.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};_i.parseBindingListItem=function(e){return e};_i.parseMaybeDefault=function(e,t,r){if(r=r||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return r;var n=this.startNodeAt(e,t);return n.left=r,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")};_i.checkLValSimple=function(e,t,r){t===void 0&&(t=Hy);var n=t!==Hy;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(n?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(t===Za&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),r&&(Gl(r,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),r[e.name]=!0),t!==i3&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":n&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return n&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,r);default:this.raise(e.start,(n?"Binding":"Assigning to")+" rvalue")}};_i.checkLValPattern=function(e,t,r){switch(t===void 0&&(t=Hy),e.type){case"ObjectPattern":for(var n=0,i=e.properties;n<i.length;n+=1){var a=i[n];this.checkLValInnerPattern(a,t,r)}break;case"ArrayPattern":for(var s=0,o=e.elements;s<o.length;s+=1){var u=o[s];u&&this.checkLValInnerPattern(u,t,r)}break;default:this.checkLValSimple(e,t,r)}};_i.checkLValInnerPattern=function(e,t,r){switch(t===void 0&&(t=Hy),e.type){case"Property":this.checkLValInnerPattern(e.value,t,r);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,r);break;case"RestElement":this.checkLValPattern(e.argument,t,r);break;default:this.checkLValPattern(e,t,r)}};var Bi=function(t,r,n,i,a){this.token=t,this.isExpr=!!r,this.preserveSpace=!!n,this.override=i,this.generator=!!a},ir={b_stat:new Bi("{",!1),b_expr:new Bi("{",!0),b_tmpl:new Bi("${",!1),p_stat:new Bi("(",!1),p_expr:new Bi("(",!0),q_tmpl:new Bi("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Bi("function",!1),f_expr:new Bi("function",!0),f_expr_gen:new Bi("function",!0,!1,null,!0),f_gen:new Bi("function",!1,!1,null,!0)},Kl=Sr.prototype;Kl.initialContext=function(){return[ir.b_stat]};Kl.curContext=function(){return this.context[this.context.length-1]};Kl.braceIsBlock=function(e){var t=this.curContext();return t===ir.f_expr||t===ir.f_stat?!0:e===S.colon&&(t===ir.b_stat||t===ir.b_expr)?!t.isExpr:e===S._return||e===S.name&&this.exprAllowed?Nn.test(this.input.slice(this.lastTokEnd,this.start)):e===S._else||e===S.semi||e===S.eof||e===S.parenR||e===S.arrow?!0:e===S.braceL?t===ir.b_stat:e===S._var||e===S._const||e===S.name?!1:!this.exprAllowed};Kl.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};Kl.updateContext=function(e){var t,r=this.type;r.keyword&&e===S.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr};Kl.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};S.parenR.updateContext=S.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===ir.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};S.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ir.b_stat:ir.b_expr),this.exprAllowed=!0};S.dollarBraceL.updateContext=function(){this.context.push(ir.b_tmpl),this.exprAllowed=!0};S.parenL.updateContext=function(e){var t=e===S._if||e===S._for||e===S._with||e===S._while;this.context.push(t?ir.p_stat:ir.p_expr),this.exprAllowed=!0};S.incDec.updateContext=function(){};S._function.updateContext=S._class.updateContext=function(e){e.beforeExpr&&e!==S._else&&!(e===S.semi&&this.curContext()!==ir.p_stat)&&!(e===S._return&&Nn.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===S.colon||e===S.braceL)&&this.curContext()===ir.b_stat)?this.context.push(ir.f_expr):this.context.push(ir.f_stat),this.exprAllowed=!1};S.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};S.backQuote.updateContext=function(){this.curContext()===ir.q_tmpl?this.context.pop():this.context.push(ir.q_tmpl),this.exprAllowed=!1};S.star.updateContext=function(e){if(e===S._function){var t=this.context.length-1;this.context[t]===ir.f_expr?this.context[t]=ir.f_expr_gen:this.context[t]=ir.f_gen}this.exprAllowed=!0};S.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==S.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Le=Sr.prototype;Le.checkPropClash=function(e,t,r){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n=e.key,i;switch(n.type){case"Identifier":i=n.name;break;case"Literal":i=String(n.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i==="__proto__"&&a==="init"&&(t.proto&&(r?r.doubleProto<0&&(r.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0);return}i="$"+i;var s=t[i];if(s){var o;a==="init"?o=this.strict&&s.init||s.get||s.set:o=s.init||s[a],o&&this.raiseRecoverable(n.start,"Redefinition of property")}else s=t[i]={init:!1,get:!1,set:!1};s[a]=!0}};Le.parseExpression=function(e,t){var r=this.start,n=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===S.comma){var a=this.startNodeAt(r,n);for(a.expressions=[i];this.eat(S.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return i};Le.parseMaybeAssign=function(e,t,r){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,i=-1,a=-1,s=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,s=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new r_,n=!0);var o=this.start,u=this.startLoc;(this.type===S.parenL||this.type===S.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(r&&(l=r.call(this,l,o,u)),this.type.isAssign){var c=this.startNodeAt(o,u);return c.operator=this.value,this.type===S.eq&&(l=this.toAssignable(l,!1,t)),n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===S.eq?this.checkLValPattern(l):this.checkLValSimple(l),c.left=l,this.next(),c.right=this.parseMaybeAssign(e),s>-1&&(t.doubleProto=s),this.finishNode(c,"AssignmentExpression")}else n&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l};Le.parseMaybeConditional=function(e,t){var r=this.start,n=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(S.question)){var a=this.startNodeAt(r,n);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(S.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return i};Le.parseExprOps=function(e,t){var r=this.start,n=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===r&&i.type==="ArrowFunctionExpression"?i:this.parseExprOp(i,r,n,-1,e)};Le.parseExprOp=function(e,t,r,n,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==S._in)&&a>n){var s=this.type===S.logicalOR||this.type===S.logicalAND,o=this.type===S.coalesce;o&&(a=S.logicalAND.binop);var u=this.value;this.next();var l=this.start,c=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,c,a,i),f=this.buildBinary(t,r,e,d,u,s||o);return(s&&this.type===S.coalesce||o&&(this.type===S.logicalOR||this.type===S.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(f,t,r,n,i)}return e};Le.buildBinary=function(e,t,r,n,i,a){n.type==="PrivateIdentifier"&&this.raise(n.start,"Private identifier can only be left side of binary expression");var s=this.startNodeAt(e,t);return s.left=r,s.operator=i,s.right=n,this.finishNode(s,a?"LogicalExpression":"BinaryExpression")};Le.parseMaybeUnary=function(e,t,r,n){var i=this.start,a=this.startLoc,s;if(this.isContextual("await")&&this.canAwait)s=this.parseAwait(n),t=!0;else if(this.type.prefix){var o=this.startNode(),u=this.type===S.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,u,n),this.checkExpressionErrors(e,!0),u?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&s3(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&jO(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,s=this.finishNode(o,u?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===S.privateId)(n||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),s=this.parsePrivateIdent(),this.type!==S._in&&this.unexpected();else{if(s=this.parseExprSubscripts(e,n),this.checkExpressionErrors(e))return s;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=s,this.checkLValSimple(s),this.next(),s=this.finishNode(l,"UpdateExpression")}}if(!r&&this.eat(S.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,s,this.parseMaybeUnary(null,!1,!1,n),"**",!1);else return s};function s3(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&s3(e.expression)}function jO(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&jO(e.expression)||e.type==="ParenthesizedExpression"&&jO(e.expression)}Le.parseExprSubscripts=function(e,t){var r=this.start,n=this.startLoc,i=this.parseExprAtom(e,t);if(i.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return i;var a=this.parseSubscripts(i,r,n,!1,t);return e&&a.type==="MemberExpression"&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a};Le.parseSubscripts=function(e,t,r,n,i){for(var a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,s=!1;;){var o=this.parseSubscript(e,t,r,n,a,s,i);if(o.optional&&(s=!0),o===e||o.type==="ArrowFunctionExpression"){if(s){var u=this.startNodeAt(t,r);u.expression=o,o=this.finishNode(u,"ChainExpression")}return o}e=o}};Le.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)};Le.parseSubscriptAsyncArrow=function(e,t,r,n){return this.parseArrowExpression(this.startNodeAt(e,t),r,!0,n)};Le.parseSubscript=function(e,t,r,n,i,a,s){var o=this.options.ecmaVersion>=11,u=o&&this.eat(S.questionDot);n&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(S.bracketL);if(l||u&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var c=this.startNodeAt(t,r);c.object=e,l?(c.property=this.parseExpression(),this.expect(S.bracketR)):this.type===S.privateId&&e.type!=="Super"?c.property=this.parsePrivateIdent():c.property=this.parseIdent(this.options.allowReserved!=="never"),c.computed=!!l,o&&(c.optional=u),e=this.finishNode(c,"MemberExpression")}else if(!n&&this.eat(S.parenL)){var d=new r_,f=this.yieldPos,p=this.awaitPos,h=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var y=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=h,this.parseSubscriptAsyncArrow(t,r,y,s);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=h||this.awaitIdentPos;var _=this.startNodeAt(t,r);_.callee=e,_.arguments=y,o&&(_.optional=u),e=this.finishNode(_,"CallExpression")}else if(this.type===S.backQuote){(u||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var m=this.startNodeAt(t,r);m.tag=e,m.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(m,"TaggedTemplateExpression")}return e};Le.parseExprAtom=function(e,t,r){this.type===S.slash&&this.readRegexp();var n,i=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),n=this.startNode(),this.next(),this.type===S.parenL&&!this.allowDirectSuper&&this.raise(n.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(n,"Super");case S._this:return n=this.startNode(),this.next(),this.finishNode(n,"ThisExpression");case S.name:var a=this.start,s=this.startLoc,o=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(S._function))return this.overrideContext(ir.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[u],!1,t);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===S.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return u=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(S.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[u],!0,t)}return u;case S.regexp:var l=this.value;return n=this.parseLiteral(l.value),n.regex={pattern:l.pattern,flags:l.flags},n;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return n=this.startNode(),n.value=this.type===S._null?null:this.type===S._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case S.parenL:var c=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),d;case S.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(S.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case S.braceL:return this.overrideContext(ir.b_expr),this.parseObj(!1,e);case S._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>=11?this.parseExprImport(r):this.unexpected();default:return this.parseExprAtomDefault()}};Le.parseExprAtomDefault=function(){this.unexpected()};Le.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===S.parenL&&!e)return this.parseDynamicImport(t);if(this.type===S.dot){var r=this.startNodeAt(t.start,t.loc&&t.loc.start);return r.name="import",t.meta=this.finishNode(r,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};Le.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(S.parenR)?e.options=null:(this.expect(S.comma),this.afterTrailingComma(S.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(S.parenR)||(this.expect(S.comma),this.afterTrailingComma(S.parenR)||this.unexpected())));else if(!this.eat(S.parenR)){var t=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};Le.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Le.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};Le.parseParenExpression=function(){this.expect(S.parenL);var e=this.parseExpression();return this.expect(S.parenR),e};Le.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Le.parseParenAndDistinguishExpression=function(e,t){var r=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,o=this.startLoc,u=[],l=!0,c=!1,d=new r_,f=this.yieldPos,p=this.awaitPos,h;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;)if(l?l=!1:this.expect(S.comma),a&&this.afterTrailingComma(S.parenR,!0)){c=!0;break}else if(this.type===S.ellipsis){h=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var y=this.lastTokEnd,_=this.lastTokEndLoc;if(this.expect(S.parenR),e&&this.shouldParseArrow(u)&&this.eat(S.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(r,n,u,t);(!u.length||c)&&this.unexpected(this.lastTokStart),h&&this.unexpected(h),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,u.length>1?(i=this.startNodeAt(s,o),i.expressions=u,this.finishNodeAt(i,"SequenceExpression",y,_)):i=u[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var m=this.startNodeAt(r,n);return m.expression=i,this.finishNode(m,"ParenthesizedExpression")}else return i};Le.parseParenItem=function(e){return e};Le.parseParenArrowList=function(e,t,r,n){return this.parseArrowExpression(this.startNodeAt(e,t),r,!1,n)};var Ove=[];Le.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===S.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(S.parenL)?e.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ove,this.finishNode(e,"NewExpression")};Le.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===S.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value.replace(/\r\n?/g,`
293
+ `),cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
294
+ `),cooked:this.value},this.next(),r.tail=this.type===S.backQuote,this.finishNode(r,"TemplateElement")};Le.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(S.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")};Le.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!Nn.test(this.input.slice(this.lastTokEnd,this.start))};Le.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(S.braceR);){if(n)n=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),r.properties.push(a)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")};Le.parseProperty=function(e,t){var r=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return e?(r.argument=this.parseIdent(!1),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(r,"RestElement")):(r.argument=this.parseMaybeAssign(!1,t),this.type===S.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(r,"SpreadElement"));this.options.ecmaVersion>=6&&(r.method=!1,r.shorthand=!1,(e||t)&&(a=this.start,s=this.startLoc),e||(n=this.eat(S.star)));var o=this.containsEsc;return this.parsePropertyName(r),!e&&!o&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(r)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(r)):i=!1,this.parsePropertyValue(r,e,n,i,a,s,t,o),this.finishNode(r,"Property")};Le.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var n=e.value.start;e.kind==="get"?this.raiseRecoverable(n,"getter should have no params"):this.raiseRecoverable(n,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Le.parsePropertyValue=function(e,t,r,n,i,a,s,o){(r||n)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===S.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(r,n),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==S.comma&&this.type!==S.braceR&&this.type!==S.eq?((r||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===S.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};Le.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(S.bracketR),e.key;e.computed=!1}return e.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Le.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Le.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(UO(t,n.generator)|e_|(r?e3:0)),this.expect(S.parenL),n.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Le.parseArrowExpression=function(e,t,r,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(UO(r,!1)|DO),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Le.parseFunctionBody=function(e,t,r,n){var i=t&&this.type!==S.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||o)&&(s=this.strictDirective(this.end),s&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var u=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,i3),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};Le.isSimpleParamList=function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t];if(n.type!=="Identifier")return!1}return!0};Le.checkParams=function(e,t){for(var r=Object.create(null),n=0,i=e.params;n<i.length;n+=1){var a=i[n];this.checkLValInnerPattern(a,MO,t?null:r)}};Le.parseExprList=function(e,t,r,n){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(S.comma),t&&this.afterTrailingComma(e))break;var s=void 0;r&&this.type===S.comma?s=null:this.type===S.ellipsis?(s=this.parseSpread(n),n&&this.type===S.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):s=this.parseMaybeAssign(!1,n),i.push(s)}return i};Le.checkUnreserved=function(e){var t=e.start,r=e.end,n=e.name;if(this.inGenerator&&n==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&n==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&t_)&&n==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(n==="arguments"||n==="await")&&this.raise(t,"Cannot use "+n+" in class static initialization block"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,r).indexOf("\\")!==-1)){var i=this.strict?this.reservedWordsStrict:this.reservedWords;i.test(n)&&(!this.inAsync&&n==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))}};Le.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};Le.parseIdentNode=function(){var e=this.startNode();return this.type===S.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=S.name):this.unexpected(),e};Le.parsePrivateIdent=function(){var e=this.startNode();return this.type===S.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};Le.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(S.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};Le.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Yy=Sr.prototype;Yy.raise=function(e,t){var r=YV(this.input,e);t+=" ("+r.line+":"+r.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var n=new SyntaxError(t);throw n.pos=e,n.loc=r,n.raisedAt=this.pos,n};Yy.raiseRecoverable=Yy.raise;Yy.curPosition=function(){if(this.options.locations)return new Lp(this.curLine,this.pos-this.lineStart)};var zs=Sr.prototype,Nve=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};zs.enterScope=function(e){this.scopeStack.push(new Nve(e))};zs.exitScope=function(){this.scopeStack.pop()};zs.treatFunctionsAsVarInScope=function(e){return e.flags&jo||!this.inModule&&e.flags&Co};zs.declareName=function(e,t,r){var n=!1;if(t===Za){var i=this.currentScope();n=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&Co&&delete this.undefinedExports[e]}else if(t===n3){var a=this.currentScope();a.lexical.push(e)}else if(t===r3){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var u=this.scopeStack[o];if(u.lexical.indexOf(e)>-1&&!(u.flags&XV&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){n=!0;break}if(u.var.push(e),this.inModule&&u.flags&Co&&delete this.undefinedExports[e],u.flags&t_)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")};zs.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};zs.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};zs.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(t_|Zp|Ao))return t}};zs.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(t_|Zp|Ao)&&!(t.flags&DO))return t}};var n_=function(t,r,n){this.type="",this.start=r,this.end=0,t.options.locations&&(this.loc=new Xy(t,n)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[r,0])},qp=Sr.prototype;qp.startNode=function(){return new n_(this,this.start,this.startLoc)};qp.startNodeAt=function(e,t){return new n_(this,e,t)};function o3(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}qp.finishNode=function(e,t){return o3.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};qp.finishNodeAt=function(e,t,r,n){return o3.call(this,e,t,r,n)};qp.copyNode=function(e){var t=new n_(this,e.start,this.startLoc);for(var r in e)t[r]=e[r];return t};var zve="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",u3="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",l3=u3+" Extended_Pictographic",c3=l3,d3=c3+" EBase EComp EMod EPres ExtPict",f3=d3,Cve=f3,jve={9:u3,10:l3,11:c3,12:d3,13:f3,14:Cve},Ave="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Rve={9:"",10:"",11:"",12:"",13:"",14:Ave},FV="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",p3="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",m3=p3+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",h3=m3+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",g3=h3+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",v3=g3+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Dve=v3+" "+zve,Uve={9:p3,10:m3,11:h3,12:g3,13:v3,14:Dve},y3={};function Mve(e){var t=y3[e]={binary:Os(jve[e]+" "+FV),binaryOfStrings:Os(Rve[e]),nonBinary:{General_Category:Os(FV),Script:Os(Uve[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Ky=0,OO=[9,10,11,12,13,14];Ky<OO.length;Ky+=1)VV=OO[Ky],Mve(VV);var VV,Ky,OO,ye=Sr.prototype,Qy=function(t,r){this.parent=t,this.base=r||this};Qy.prototype.separatedFrom=function(t){for(var r=this;r;r=r.parent)for(var n=t;n;n=n.parent)if(r.base===n.base&&r!==n)return!0;return!1};Qy.prototype.sibling=function(){return new Qy(this.parent,this.base)};var da=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=y3[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};da.prototype.reset=function(t,r,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=t|0,this.source=r+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};da.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};da.prototype.at=function(t,r){r===void 0&&(r=!1);var n=this.source,i=n.length;if(t>=i)return-1;var a=n.charCodeAt(t);if(!(r||this.switchU)||a<=55295||a>=57344||t+1>=i)return a;var s=n.charCodeAt(t+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};da.prototype.nextIndex=function(t,r){r===void 0&&(r=!1);var n=this.source,i=n.length;if(t>=i)return i;var a=n.charCodeAt(t),s;return!(r||this.switchU)||a<=55295||a>=57344||t+1>=i||(s=n.charCodeAt(t+1))<56320||s>57343?t+1:t+2};da.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};da.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};da.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};da.prototype.eat=function(t,r){return r===void 0&&(r=!1),this.current(r)===t?(this.advance(r),!0):!1};da.prototype.eatChars=function(t,r){r===void 0&&(r=!1);for(var n=this.pos,i=0,a=t;i<a.length;i+=1){var s=a[i],o=this.at(n,r);if(o===-1||o!==s)return!1;n=this.nextIndex(n,r)}return this.pos=n,!0};ye.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=!1,i=!1,a=0;a<r.length;a++){var s=r.charAt(a);t.indexOf(s)===-1&&this.raise(e.start,"Invalid regular expression flag"),r.indexOf(s,a+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};function Lve(e){for(var t in e)return!0;return!1}ye.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Lve(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};ye.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t<r.length;t+=1){var n=r[t];e.groupNames[n]||e.raise("Invalid named capture referenced")}};ye.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Qy(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};ye.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};ye.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};ye.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var r=!1;if(this.options.ecmaVersion>=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1};ye.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};ye.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};ye.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=r}return!1};ye.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};ye.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};ye.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var r=this.regexp_eatModifiers(e),n=e.eat(45);if(r||n){for(var i=0;i<r.length;i++){var a=r.charAt(i);r.indexOf(a,i+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(n){var s=this.regexp_eatModifiers(e);!r&&!s&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<s.length;o++){var u=s.charAt(o);(s.indexOf(u,o+1)>-1||r.indexOf(u)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};ye.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};ye.regexp_eatModifiers=function(e){for(var t="",r=0;(r=e.current())!==-1&&Zve(r);)t+=Ma(r),e.advance();return t};function Zve(e){return e===105||e===109||e===115}ye.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};ye.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};ye.regexp_eatSyntaxCharacter=function(e){var t=e.current();return _3(t)?(e.lastIntValue=t,e.advance(),!0):!1};function _3(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}ye.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;(r=e.current())!==-1&&!_3(r);)e.advance();return e.pos!==t};ye.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};ye.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,r=e.groupNames[e.lastStringValue];if(r)if(t)for(var n=0,i=r;n<i.length;n+=1){var a=i[n];a.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(r||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};ye.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};ye.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ma(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ma(e.lastIntValue);return!0}return!1};ye.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),qve(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)};function qve(e){return ca(e,!0)||e===36||e===95}ye.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),Fve(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)};function Fve(e){return Ns(e,!0)||e===36||e===95||e===8204||e===8205}ye.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};ye.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1};ye.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};ye.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};ye.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};ye.regexp_eatZero=function(e){return e.current()===48&&!i_(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};ye.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};ye.regexp_eatControlLetter=function(e){var t=e.current();return b3(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function b3(e){return e>=65&&e<=90||e>=97&&e<=122}ye.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var r=e.pos,n=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Vve(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=r}return!1};function Vve(e){return e>=0&&e<=1114111}ye.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};ye.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var w3=0,La=1,vi=2;ye.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Wve(t))return e.lastIntValue=-1,e.advance(),La;var r=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((r=t===80)||t===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return r&&n===vi&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return w3};function Wve(e){return e===100||e===68||e===115||e===83||e===119||e===87}ye.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),La}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return w3};ye.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){Gl(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")};ye.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return La;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return vi;e.raise("Invalid property name")};ye.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";x3(t=e.current());)e.lastStringValue+=Ma(t),e.advance();return e.lastStringValue!==""};function x3(e){return b3(e)||e===95}ye.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Bve(t=e.current());)e.lastStringValue+=Ma(t),e.advance();return e.lastStringValue!==""};function Bve(e){return x3(e)||i_(e)}ye.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};ye.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),r=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&r===vi&&e.raise("Negated character class may contain strings"),!0}return!1};ye.regexp_classContents=function(e){return e.current()===93?La:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),La)};ye.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;e.switchU&&(t===-1||r===-1)&&e.raise("Invalid character class"),t!==-1&&r!==-1&&t>r&&e.raise("Range out of order in character class")}}};ye.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(r===99||I3(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};ye.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};ye.regexp_classSetExpression=function(e){var t=La,r;if(!this.regexp_eatClassSetRange(e))if(r=this.regexp_eatClassSetOperand(e)){r===vi&&(t=vi);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(r=this.regexp_eatClassSetOperand(e))){r!==vi&&(t=La);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(r=this.regexp_eatClassSetOperand(e),!r)return t;r===vi&&(t=vi)}};ye.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return r!==-1&&n!==-1&&r>n&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};ye.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?La:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};ye.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var r=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return r&&n===vi&&e.raise("Negated character class may contain strings"),n;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null};ye.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var r=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return r}else e.raise("Invalid escape");e.pos=t}return null};ye.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===vi&&(t=vi);return t};ye.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?La:vi};ye.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var r=e.current();return r<0||r===e.lookahead()&&Gve(r)||Kve(r)?!1:(e.advance(),e.lastIntValue=r,!0)};function Gve(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Kve(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}ye.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Hve(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Hve(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}ye.regexp_eatClassControlLetter=function(e){var t=e.current();return i_(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};ye.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};ye.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;i_(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t};function i_(e){return e>=48&&e<=57}ye.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;k3(r=e.current());)e.lastIntValue=16*e.lastIntValue+S3(r),e.advance();return e.pos!==t};function k3(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function S3(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}ye.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+r*8+e.lastIntValue:e.lastIntValue=t*8+r}else e.lastIntValue=t;return!0}return!1};ye.regexp_eatOctalDigit=function(e){var t=e.current();return I3(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function I3(e){return e>=48&&e<=55}ye.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var i=e.current();if(!k3(i))return e.pos=r,!1;e.lastIntValue=16*e.lastIntValue+S3(i),e.advance()}return!0};var ZO=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Xy(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},ct=Sr.prototype;ct.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ZO(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};ct.getToken=function(){return this.next(),new ZO(this)};typeof Symbol<"u"&&(ct[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===S.eof,value:t}}}});ct.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(S.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};ct.readToken=function(e){return ca(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};ct.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var r=this.input.charCodeAt(e+1);return r<=56319||r>=57344?t:(t<<10)+r-56613888};ct.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};ct.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(r===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(var n=void 0,i=t;(n=KV(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,r),t,this.pos,e,this.curPosition())};ct.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Bl(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,r,this.curPosition())};ct.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&HV.test(String.fromCharCode(e)))++this.pos;else break e}}};ct.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)};ct.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))};ct.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(S.assign,2):this.finishOp(S.slash,1)};ct.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=e===42?S.star:S.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++r,n=S.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(S.assign,r+1):this.finishOp(n,r)};ct.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(S.assign,3)}return this.finishOp(e===124?S.logicalOR:S.logicalAND,2)}return t===61?this.finishOp(S.assign,2):this.finishOp(e===124?S.bitwiseOR:S.bitwiseAND,1)};ct.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)};ct.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Nn.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(S.incDec,2):t===61?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)};ct.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+r)===61?this.finishOp(S.assign,r+1):this.finishOp(S.bitShift,r)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(r=2),this.finishOp(S.relational,r))};ct.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(S.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(e===61?S.eq:S.prefix,1)};ct.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(S.questionDot,2)}if(t===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(S.assign,3)}return this.finishOp(S.coalesce,2)}}return this.finishOp(S.question,1)};ct.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),ca(t,!0)||t===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Ma(t)+"'")};ct.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(S.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Ma(e)+"'")};ct.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)};ct.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(Nn.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if(n==="[")t=!0;else if(n==="]"&&t)t=!1;else if(n==="/"&&!t)break;e=n==="\\"}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new da(this));o.reset(r,i,s),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var u=null;try{u=new RegExp(i,s)}catch{}return this.finishToken(S.regexp,{pattern:i,flags:s,value:u})};ct.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&t===void 0,i=r&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,o=0,u=0,l=t??1/0;u<l;++u,++this.pos){var c=this.input.charCodeAt(this.pos),d=void 0;if(n&&c===95){i&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),u===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;continue}if(c>=97?d=c-97+10:c>=65?d=c-65+10:c>=48&&c<=57?d=c-48:d=1/0,d>=e)break;o=c,s=s*e+d}return n&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||t!=null&&this.pos-a!==t?null:s};function Jve(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function $3(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}ct.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return r==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(r=$3(this.input.slice(t,this.pos)),++this.pos):ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,r)};ct.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var r=this.pos-t>=2&&this.input.charCodeAt(t)===48;r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&n===110){var i=$3(this.input.slice(t,this.pos));return++this.pos,ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),n===46&&!r&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!r&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),ca(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Jve(this.input.slice(t,this.pos),r);return this.finishToken(S.num,a)};ct.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var r=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(r,"Code point out of bounds")}else t=this.readHexChar(4);return t};ct.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Bl(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(S.string,t)};var E3={};ct.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===E3)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};ct.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw E3;this.raise(e,t)};ct.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(r===96||r===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===S.template||this.type===S.invalidTemplate)?r===36?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(S.template,e));if(r===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Bl(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
295
+ `;break;default:e+=String.fromCharCode(r);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};ct.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
296
+ `&&++this.pos;case`
297
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};ct.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
298
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Ma(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var r=this.pos-1;this.invalidStringToken(r,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),(n!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return Bl(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};ct.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return r===null&&this.invalidStringToken(t,"Bad character escape sequence"),r};ct.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(Ns(i,n))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(r,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var s=this.readCodePoint();(t?ca:Ns)(s,n)||this.invalidStringToken(a,"Invalid Unicode escape"),e+=Ma(s),r=this.pos}else break;t=!1}return e+this.input.slice(r,this.pos)};ct.readWord=function(){var e=this.readWord1(),t=S.name;return this.keywords.test(e)&&(t=AO[e]),this.finishToken(t,e)};var Yve="8.16.0";Sr.acorn={Parser:Sr,version:Yve,defaultOptions:zO,Position:Lp,SourceLocation:Xy,getLineInfo:YV,Node:n_,TokenType:Tt,tokTypes:S,keywordTypes:AO,TokContext:Bi,tokContexts:ir,isIdentifierChar:Ns,isIdentifierStart:ca,Token:ZO,isNewLine:Bl,lineBreak:Nn,lineBreakG:bve,nonASCIIwhitespace:HV};function P3(e,t){return Sr.parse(e,t)}function T3(e,t,r,n,i){r||(r=ae),(function a(s,o,u){var l=u||s.type;Xve(r,l,s,o,a),t[l]&&t[l](s,o)})(e,n,i)}function qO(e,t,r){r(e,t)}function Ro(e,t,r){}function Xve(e,t,r,n,i){if(e[t]==null)throw new Error("No walker function defined for node type "+t);e[t](r,n,i)}var ae={};ae.Program=ae.BlockStatement=ae.StaticBlock=function(e,t,r){for(var n=0,i=e.body;n<i.length;n+=1){var a=i[n];r(a,t,"Statement")}};ae.Statement=qO;ae.EmptyStatement=Ro;ae.ExpressionStatement=ae.ParenthesizedExpression=ae.ChainExpression=function(e,t,r){return r(e.expression,t,"Expression")};ae.IfStatement=function(e,t,r){r(e.test,t,"Expression"),r(e.consequent,t,"Statement"),e.alternate&&r(e.alternate,t,"Statement")};ae.LabeledStatement=function(e,t,r){return r(e.body,t,"Statement")};ae.BreakStatement=ae.ContinueStatement=Ro;ae.WithStatement=function(e,t,r){r(e.object,t,"Expression"),r(e.body,t,"Statement")};ae.SwitchStatement=function(e,t,r){r(e.discriminant,t,"Expression");for(var n=0,i=e.cases;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.SwitchCase=function(e,t,r){e.test&&r(e.test,t,"Expression");for(var n=0,i=e.consequent;n<i.length;n+=1){var a=i[n];r(a,t,"Statement")}};ae.ReturnStatement=ae.YieldExpression=ae.AwaitExpression=function(e,t,r){e.argument&&r(e.argument,t,"Expression")};ae.ThrowStatement=ae.SpreadElement=function(e,t,r){return r(e.argument,t,"Expression")};ae.TryStatement=function(e,t,r){r(e.block,t,"Statement"),e.handler&&r(e.handler,t),e.finalizer&&r(e.finalizer,t,"Statement")};ae.CatchClause=function(e,t,r){e.param&&r(e.param,t,"Pattern"),r(e.body,t,"Statement")};ae.WhileStatement=ae.DoWhileStatement=function(e,t,r){r(e.test,t,"Expression"),r(e.body,t,"Statement")};ae.ForStatement=function(e,t,r){e.init&&r(e.init,t,"ForInit"),e.test&&r(e.test,t,"Expression"),e.update&&r(e.update,t,"Expression"),r(e.body,t,"Statement")};ae.ForInStatement=ae.ForOfStatement=function(e,t,r){r(e.left,t,"ForInit"),r(e.right,t,"Expression"),r(e.body,t,"Statement")};ae.ForInit=function(e,t,r){e.type==="VariableDeclaration"?r(e,t):r(e,t,"Expression")};ae.DebuggerStatement=Ro;ae.FunctionDeclaration=function(e,t,r){return r(e,t,"Function")};ae.VariableDeclaration=function(e,t,r){for(var n=0,i=e.declarations;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.VariableDeclarator=function(e,t,r){r(e.id,t,"Pattern"),e.init&&r(e.init,t,"Expression")};ae.Function=function(e,t,r){e.id&&r(e.id,t,"Pattern");for(var n=0,i=e.params;n<i.length;n+=1){var a=i[n];r(a,t,"Pattern")}r(e.body,t,e.expression?"Expression":"Statement")};ae.Pattern=function(e,t,r){e.type==="Identifier"?r(e,t,"VariablePattern"):e.type==="MemberExpression"?r(e,t,"MemberPattern"):r(e,t)};ae.VariablePattern=Ro;ae.MemberPattern=qO;ae.RestElement=function(e,t,r){return r(e.argument,t,"Pattern")};ae.ArrayPattern=function(e,t,r){for(var n=0,i=e.elements;n<i.length;n+=1){var a=i[n];a&&r(a,t,"Pattern")}};ae.ObjectPattern=function(e,t,r){for(var n=0,i=e.properties;n<i.length;n+=1){var a=i[n];a.type==="Property"?(a.computed&&r(a.key,t,"Expression"),r(a.value,t,"Pattern")):a.type==="RestElement"&&r(a.argument,t,"Pattern")}};ae.Expression=qO;ae.ThisExpression=ae.Super=ae.MetaProperty=Ro;ae.ArrayExpression=function(e,t,r){for(var n=0,i=e.elements;n<i.length;n+=1){var a=i[n];a&&r(a,t,"Expression")}};ae.ObjectExpression=function(e,t,r){for(var n=0,i=e.properties;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.FunctionExpression=ae.ArrowFunctionExpression=ae.FunctionDeclaration;ae.SequenceExpression=function(e,t,r){for(var n=0,i=e.expressions;n<i.length;n+=1){var a=i[n];r(a,t,"Expression")}};ae.TemplateLiteral=function(e,t,r){for(var n=0,i=e.quasis;n<i.length;n+=1){var a=i[n];r(a,t)}for(var s=0,o=e.expressions;s<o.length;s+=1){var u=o[s];r(u,t,"Expression")}};ae.TemplateElement=Ro;ae.UnaryExpression=ae.UpdateExpression=function(e,t,r){r(e.argument,t,"Expression")};ae.BinaryExpression=ae.LogicalExpression=function(e,t,r){r(e.left,t,"Expression"),r(e.right,t,"Expression")};ae.AssignmentExpression=ae.AssignmentPattern=function(e,t,r){r(e.left,t,"Pattern"),r(e.right,t,"Expression")};ae.ConditionalExpression=function(e,t,r){r(e.test,t,"Expression"),r(e.consequent,t,"Expression"),r(e.alternate,t,"Expression")};ae.NewExpression=ae.CallExpression=function(e,t,r){if(r(e.callee,t,"Expression"),e.arguments)for(var n=0,i=e.arguments;n<i.length;n+=1){var a=i[n];r(a,t,"Expression")}};ae.MemberExpression=function(e,t,r){r(e.object,t,"Expression"),e.computed&&r(e.property,t,"Expression")};ae.ExportNamedDeclaration=ae.ExportDefaultDeclaration=function(e,t,r){if(e.declaration&&r(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&r(e.source,t,"Expression"),e.attributes)for(var n=0,i=e.attributes;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.ExportAllDeclaration=function(e,t,r){if(e.exported&&r(e.exported,t),r(e.source,t,"Expression"),e.attributes)for(var n=0,i=e.attributes;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.ImportAttribute=function(e,t,r){r(e.value,t,"Expression")};ae.ImportDeclaration=function(e,t,r){for(var n=0,i=e.specifiers;n<i.length;n+=1){var a=i[n];r(a,t)}if(r(e.source,t,"Expression"),e.attributes)for(var s=0,o=e.attributes;s<o.length;s+=1){var u=o[s];r(u,t)}};ae.ImportExpression=function(e,t,r){r(e.source,t,"Expression"),e.options&&r(e.options,t,"Expression")};ae.ImportSpecifier=ae.ImportDefaultSpecifier=ae.ImportNamespaceSpecifier=ae.Identifier=ae.PrivateIdentifier=ae.Literal=Ro;ae.TaggedTemplateExpression=function(e,t,r){r(e.tag,t,"Expression"),r(e.quasi,t,"Expression")};ae.ClassDeclaration=ae.ClassExpression=function(e,t,r){return r(e,t,"Class")};ae.Class=function(e,t,r){e.id&&r(e.id,t,"Pattern"),e.superClass&&r(e.superClass,t,"Expression"),r(e.body,t)};ae.ClassBody=function(e,t,r){for(var n=0,i=e.body;n<i.length;n+=1){var a=i[n];r(a,t)}};ae.MethodDefinition=ae.PropertyDefinition=ae.Property=function(e,t,r){e.computed&&r(e.key,t,"Expression"),e.value&&r(e.value,t,"Expression")};function tye(e){if(!e||typeof e!="string")return!1;try{let t=e.trimStart().startsWith("async")?`const __fn = ${e}`:e,r=P3(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideModules:!0}),n=!1;return T3(r,{CallExpression(i){if(n)return;let a=i.callee;a.type==="Identifier"&&a.name==="invokeAgent"&&(n=!0),a.type==="MemberExpression"&&a.property.type==="Identifier"&&a.property.name==="invokeAgent"&&(n=!0)}}),n}catch{return!0}}Wa();Wl();export{Jr as AgentStrategy,Wi as CompilationError,Rp as ConditionalNode,By as NODE_DEFAULT_TOOLS,No as Node,tc as OutputParser,U3 as SchemaTypes,Dp as WorkflowGraph,ec as WorkflowState,Xge as compileGraph,tve as extractSteps,ave as generateNodeConfigsJson,ive as generateWorkflowCode,_O as getAgentStrategy,Gp as getAllSkills,SO as getNodeImpl,IO as getNodeTemplate,$O as getResolvedToolDefinitions,Ir as getSkill,tye as hasAgentCall,Wy as hasNode,tN as hasSkill,TV as invokeAgent,Kge as listNodeTypes,rN as listSkillIds,DV as registerNode,eN as registerSkill,EO as resolveNodeTools,eve as validateGraphConfig};