vine-context 0.0.0-stage → 0.1.0

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 (34) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +280 -2
  3. package/dist/apps/shell.html +134 -0
  4. package/dist/apps/views.html +124 -0
  5. package/dist/cli.js +7865 -0
  6. package/dist/cli.js.map +1 -0
  7. package/examples/data/graphs/party/.cypherlite/schema/schema.cypher +5 -0
  8. package/examples/data/graphs/party/.cypherlite.lock +1 -0
  9. package/examples/data/graphs/party/.cypherlite.writer +0 -0
  10. package/examples/data/graphs/party/manifest.json +215 -0
  11. package/examples/data/graphs/party/nodes/0-262144-7987dd27c85668d4810609133f705907.parquet +0 -0
  12. package/examples/data/graphs/party/wal/.cypherlite.lock +1 -0
  13. package/examples/data/graphs/party/wal/.cypherlite.writer +0 -0
  14. package/examples/data/graphs/party/wal/00000002.log +0 -0
  15. package/examples/data/hosts/party/changes.jsonl +19 -0
  16. package/examples/data/hosts/party/group.json +5 -0
  17. package/examples/data/hosts/party/sharing.json +1 -0
  18. package/examples/data/identity.json +4 -0
  19. package/models/temporal-claims/instructions.md +78 -0
  20. package/models/temporal-claims/model.yaml +99 -0
  21. package/models/temporal-claims/tools.yaml +348 -0
  22. package/package.json +79 -4
  23. package/plugin/.claude-plugin/plugin.json +8 -0
  24. package/plugin/.codex-plugin/plugin.json +17 -0
  25. package/plugin/.mcp.json +8 -0
  26. package/plugin/codex/hooks.json +11 -0
  27. package/plugin/commands/join.md +22 -0
  28. package/plugin/hooks/hooks.json +11 -0
  29. package/plugin/hooks/register.tsx +2310 -0
  30. package/plugin/hooks/vine-hook.mjs +25 -0
  31. package/plugin/skills/join-context-graph/SKILL.md +36 -0
  32. package/plugin/skills/vine-context/SKILL.md +232 -0
  33. package/plugin/tests/context-graph.test.tsx +830 -0
  34. package/plugin/types/index.d.ts +165 -0
@@ -0,0 +1,134 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="color-scheme" content="light dark">
7
+ <title>Vine Context</title>
8
+ <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMTc0IDIxNzQiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iVmluZSBDb250ZXh0Ij48dGl0bGU+VmluZSBDb250ZXh0PC90aXRsZT48cGF0aCBmaWxsPSIjMDA4NDNEIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1MCA4NykiIGQ9Ik04NjEgMTk5OUM4NTMgMjAwMCA4NDUgMjAwMCA4NDQgMjAwMEM4MzcgMTk5NyA4MjkgMTk3NSA4MDUgMTg5OUM3NzcgMTgwOCA3NTAgMTc4MSA2MjkgMTcyOEM2MjIgMTcyNCA2MDggMTcxOCA1OTggMTcxM0M1ODcgMTcwOCA1NjUgMTY5NyA1NDcgMTY4OUM1MDMgMTY2OSA0MDkgMTYxOSAzODMgMTYwM0MzNzEgMTU5NSAzNTggMTU4NyAzNTMgMTU4NEMzNDIgMTU3OCAzMDMgMTU1MyAyOTMgMTU0NkMyODkgMTU0MyAyODAgMTUzNiAyNzIgMTUzMEMyMzAgMTUwMCAxODIgMTQ1NyAxNTYgMTQyN0MxNTIgMTQyMyAxNDQgMTQxNCAxMzkgMTQwOEMxMTkgMTM4NiA4MyAxMzM2IDczIDEzMThDNzMgMTMxNyA2OSAxMzEwIDY2IDEzMDRDNTcgMTI4NiA1MSAxMjc1IDQ2IDEyNjNDNDMgMTI1NyA0MSAxMjUxIDQxIDEyNTFDNDAgMTI1MSAzNSAxMjM4IDMwIDEyMjNMMjAgMTE5NkwxMiAxMTUzQzEgMTA5NiAwIDEwNjUgNiAxMDE2QzE3IDkzMSAzOSA4NzIgOTIgNzg1Qzk5IDc3MiAxMTkgNzQ1IDEzMSA3MzFDMTY5IDY4NiAxODggNjY2IDIyMCA2MzVDMjU4IDYwMCAyOTEgNTcyIDMxNyA1NTJDMzIwIDU1MCAzMjcgNTQ0IDMzMyA1NDBDMzQyIDUzMiAzNTEgNTI2IDM3NiA1MDdDMzk1IDQ5MyA0MDYgNDg0IDQxNCA0NzhDNDE3IDQ3NSA0MjUgNDcwIDQzMSA0NjZDNDQ5IDQ1NCA0NjYgNDQxIDQ4NCA0MjdDNTAzIDQxMiA1MDggNDA3IDUyNiAzOTRDNTQwIDM4MyA2MDIgMzI2IDYxOSAzMDlDNzA4IDIxNCA3NjIgMTEwIDc3MCAxNkM3NzEgOCA3NzIgMSA3NzMgMUM3NzYgMCA4NDMgNDAgODY4IDU4Qzk0NCAxMTEgOTg2IDE0MiAxMDQzIDE4OUMxMDUxIDE5NiAxMDYxIDIwNCAxMDY1IDIwN0MxMDc1IDIxNSAxMDkwIDIyOCAxMTA1IDI0MUMxMTEwIDI0NyAxMTI0IDI1OSAxMTM0IDI2OEMxMTcxIDMwMSAxMTk4IDMyOCAxMjI0IDM1NkMxMjMyIDM2NSAxMjQ0IDM3OCAxMjUwIDM4NUMxMjczIDQwOSAxMjk4IDQzNyAxMzEyIDQ1NkMxMzE2IDQ2MSAxMzIyIDQ2OCAxMzI1IDQ3MkMxMzMzIDQ4MiAxMzc3IDU0MiAxMzkyIDU2NkMxNDA1IDU4NSAxNDM0IDYzNCAxNDQ1IDY1NUMxNDQ5IDY2MiAxNDUzIDY3MSAxNDU1IDY3NUMxNDU3IDY3OCAxNDYyIDY4OCAxNDY1IDY5NkMxNDY5IDcwMyAxNDc0IDcxMyAxNDc2IDcxN0MxNDc4IDcyMiAxNDgxIDczMCAxNDgzIDczNUMxNDg1IDc0MSAxNDg3IDc0NiAxNDg3IDc0NkMxNDg5IDc0OCAxNDk4IDc3NCAxNTA5IDgwOEMxNTM1IDg4OSAxNTQzIDEwMTYgMTUyNSAxMDc5QzE1MjQgMTA4MyAxNTIyIDEwOTUgMTUxOSAxMTA1QzE1MDkgMTE1NiAxNDgxIDEyMjIgMTQ0OSAxMjcwQzE0NDYgMTI3NSAxNDQxIDEyODMgMTQzOCAxMjg4QzE0MzUgMTI5MiAxNDI4IDEzMDEgMTQyNCAxMzA3QzE0MTkgMTMxNCAxNDEyIDEzMjIgMTQwOSAxMzI3QzE0MDYgMTMzMSAxMzk4IDEzNDAgMTM5MSAxMzQ3QzEzODUgMTM1NCAxMzc4IDEzNjEgMTM3NiAxMzYzQzEzNjcgMTM3NiAxMzA0IDE0MzQgMTI4MyAxNDUwQzEyNzYgMTQ1NiAxMjY1IDE0NjQgMTI1OSAxNDY5QzEyNDggMTQ3NyAxMjM1IDE0ODYgMTIxNCAxNTAwQzEyMDggMTUwNCAxMTk2IDE1MTMgMTE4NiAxNTE5QzExNzAgMTUzMCAxMTUwIDE1NDMgMTExMCAxNTY5QzEwOTIgMTU4MCAxMDU4IDE2MDQgMTA0NyAxNjEzQzEwNDIgMTYxNiAxMDM0IDE2MjMgMTAyNyAxNjI4Qzk3OSAxNjYzIDkzOSAxNzExIDkyOCAxNzQ2QzkyNSAxNzU2IDkyNCAxNzU5IDkyMCAxNzgzTDkxNyAxNzk5TDkyMiAxODMwQzkyNyAxODYyIDkzMSAxODc5IDkzNiAxODkxQzk0MiAxOTA2IDk0NCAxOTEwIDk0OSAxOTIwQzk1NiAxOTM1IDk2MyAxOTQ2IDk3MSAxOTU5Qzk3NSAxOTY2IDk4MSAxOTc0IDk4MyAxOTc4Qzk4NiAxOTg0IDk4NyAxOTg1IDk4NiAxOTg3Qzk4NCAxOTg4IDg4NyAxOTk4IDg2MSAxOTk5Wk03ODggMTczN0M3ODYgMTcyNSA3ODAgMTcwMSA3NzUgMTY4M0M3NTkgMTYyNyA3MzYgMTUwNiA3MzYgMTQ3OUM3MzUgMTQ3NSA3MzUgMTQ2NCA3MzQgMTQ1NkM3MjYgMTM3OSA3MjkgMTMyNiA3NDUgMTI0MEM3NTIgMTE5OSA3NzMgMTEzMCA3OTMgMTA4NUM3OTYgMTA3OCA4MDEgMTA2MyA4MDUgMTA1MkM4MDkgMTA0MSA4MTggMTAyMiA4MjQgMTAxMEM4MzAgOTk4IDgzNiA5ODMgODM5IDk3NkM4NDEgOTcwIDg0NyA5NTggODUxIDk1MEM4NTcgOTM2IDg2MyA5MjQgODcwIDkwNkM4NzIgOTAxIDg3NyA4ODggODgyIDg3OEM4ODYgODY3IDg5MyA4NTEgODk2IDg0MUM5MDQgODIwIDkwNyA4MTAgOTEwIDgwNUM5MTkgNzg3IDk0MSA2ODYgOTQ1IDY0MkM5NDYgNjI4IDk0NyA2MTcgOTQ4IDYwOEM5NDkgNjAyIDk0OSA1OTggOTQ5IDU3N0M5NTAgNTY0IDk0NyA1MzkgOTQ0IDUyNUM5NDAgNTA0IDkzOCA1MDggOTMwIDU0MkM5MjcgNTU4IDkyMCA1ODAgOTA0IDYyMkM4ODQgNjc2IDg0OCA3NDAgNzk1IDgxN0M3ODEgODM2IDc2NiA4NTkgNzYwIDg2N0M3NTUgODc2IDc0NiA4ODggNzQxIDg5NkM2NzUgOTg1IDYyMyAxMDc1IDYwMSAxMTM3QzU3OCAxMjAzIDU2OCAxMjcxIDU3MyAxMzMyQzU3OSAxMzk0IDU5NiAxNDYxIDYyNyAxNTM0QzYzOCAxNTU5IDY4MSAxNjMyIDcwMyAxNjYyQzczOSAxNzEwIDc4NiAxNzYyIDc5MSAxNzYwQzc5MyAxNzU5IDc5MiAxNzU0IDc4OCAxNzM3Wk0xNTg1IDE5OTlDMTUzNiAxOTk5IDE1NDAgMTk5OSAxNTMxIDE5OTRDMTUwNSAxOTgwIDE1MDcgMTkzNSAxNTM1IDE5MjRDMTU0MiAxOTIxIDE1NDMgMTkyMSAxNTg3IDE5MjBMMTYzMSAxOTIwTDE2MzUgMTkxOEMxNjQyIDE5MTQgMTY0NiAxOTA5IDE2NDkgMTkwMUMxNjUwIDE4OTggMTY1MCAxODQ5IDE2NTAgMTU2N0wxNjUwIDEwMkwxNjQ4IDk3QzE2NDYgOTIgMTY0MSA4NiAxNjM3IDgzQzE2MzEgODAgMTYzMSA4MCAxNTg4IDgwQzE1NDggODAgMTU0MiA3OSAxNTM3IDc3QzE1MTIgNjggMTUwNSAzMSAxNTI0IDEwQzE1MjkgNSAxNTM1IDIgMTU0MCAxQzE1NDIgMCAxNTkzIDAgMTY4OCAwTDE4MzMgMEwxODM4IDJDMTg3NCAxNCAxODcxIDcxIDE4MzUgNzlDMTgzMSA3OSAxODI0IDgwIDE3OTMgODBDMTc1MCA4MCAxNzQ1IDgwIDE3NDAgODNDMTczNCA4NiAxNzI4IDk0IDE3MjYgMTAyQzE3MjUgMTA2IDE3MjUgMTg0MCAxNzI1IDE4NzlDMTcyNiAxOTAwIDE3MjYgMTkwMSAxNzI3IDE5MDNDMTczMSAxOTExIDE3MzcgMTkxNyAxNzQzIDE5MTlDMTc0NSAxOTIwIDE3NTcgMTkyMCAxNzg5IDE5MjBDMTgzOCAxOTIxIDE4MzUgMTkyMSAxODQ1IDE5MjZDMTg1NyAxOTMyIDE4NjMgMTk0MyAxODYzIDE5NTlDMTg2MyAxOTgwIDE4NTMgMTk5NCAxODM2IDE5OThDMTgzMSAxOTk5IDE2NzYgMjAwMCAxNTg1IDE5OTlaIi8+PC9zdmc+">
9
+ <!--VINE_VIEW-->
10
+ <style>:root{--bg: var(--color-background-primary, #ffffff);--bg2: var(--color-background-secondary, #f5f5f3);--bg3: var(--color-background-tertiary, #ecebe7);--fg: var(--color-text-primary, #1d1c1a);--fg2: var(--color-text-secondary, #5f5d58);--fg3: var(--color-text-tertiary, #8d8a83);--line: var(--color-border-primary, #dddad3);--line2: var(--color-border-secondary, #ebe8e2);--accent: #2f6fdb;--accent-fg: #ffffff;--ok: var(--color-text-success, #1f7a46);--ok-bg: var(--color-background-success, #e6f4ea);--warn: var(--color-text-warning, #8a5a00);--warn-bg: var(--color-background-warning, #fdf2dc);--bad: var(--color-text-danger, #b3261e);--bad-bg: var(--color-background-danger, #fbe9e7);--radius: var(--border-radius-md, 8px);--font: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--mono: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);color-scheme:light dark}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: var(--color-background-primary, #1b1b1a);--bg2: var(--color-background-secondary, #242422);--bg3: var(--color-background-tertiary, #2e2d2b);--fg: var(--color-text-primary, #ecebe7);--fg2: var(--color-text-secondary, #b4b1aa);--fg3: var(--color-text-tertiary, #85827b);--line: var(--color-border-primary, #3a3936);--line2: var(--color-border-secondary, #2f2e2c);--accent: #6b9cf0;--accent-fg: #0d1626;--ok: var(--color-text-success, #7fd39d);--ok-bg: var(--color-background-success, #1b3324);--warn: var(--color-text-warning, #f0c36b);--warn-bg: var(--color-background-warning, #3a2e14);--bad: var(--color-text-danger, #f2a097);--bad-bg: var(--color-background-danger, #3d1f1c)}}:root[data-theme=dark]{--bg: var(--color-background-primary, #1b1b1a);--bg2: var(--color-background-secondary, #242422);--bg3: var(--color-background-tertiary, #2e2d2b);--fg: var(--color-text-primary, #ecebe7);--fg2: var(--color-text-secondary, #b4b1aa);--fg3: var(--color-text-tertiary, #85827b);--line: var(--color-border-primary, #3a3936);--line2: var(--color-border-secondary, #2f2e2c);--accent: #6b9cf0;--accent-fg: #0d1626;--ok: var(--color-text-success, #7fd39d);--ok-bg: var(--color-background-success, #1b3324);--warn: var(--color-text-warning, #f0c36b);--warn-bg: var(--color-background-warning, #3a2e14);--bad: var(--color-text-danger, #f2a097);--bad-bg: var(--color-background-danger, #3d1f1c)}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.45 var(--font)}body{padding:12px}h1{font-size:15px;font-weight:600;margin:0}h1.brand{display:flex;align-items:center;gap:6px}h1.brand svg{height:20px;width:auto;fill:var(--ok);flex:none}h2{font-size:12px;font-weight:600;margin:16px 0 6px;color:var(--fg2);text-transform:uppercase;letter-spacing:.04em}p{margin:4px 0}code,.mono{font-family:var(--mono);font-size:12px}.muted{color:var(--fg2)}.faint{color:var(--fg3);font-size:12px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.spread{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap}.grow{flex:1;min-width:0}.head{display:flex;align-items:center;gap:10px;justify-content:space-between;padding-bottom:10px;border-bottom:1px solid var(--line2);margin-bottom:4px;flex-wrap:wrap}button,select,input{font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:5px 10px;min-height:30px}input{min-width:0}button{cursor:pointer;white-space:nowrap}button:hover:not(:disabled){background:var(--bg2)}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg);font-weight:500}button.primary:hover:not(:disabled){filter:brightness(1.07);background:var(--accent)}button.danger{color:var(--bad)}button.link{border:0;background:none;color:var(--accent);padding:0 2px;min-height:0}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.card{border:1px solid var(--line2);border-radius:var(--radius);padding:10px 12px;background:var(--bg)}.list{display:flex;flex-direction:column;gap:6px}.pill{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:999px;font-size:12px;background:var(--bg3);color:var(--fg2)}.pill.ok{background:var(--ok-bg);color:var(--ok)}.pill.warn{background:var(--warn-bg);color:var(--warn)}.pill.bad{background:var(--bad-bg);color:var(--bad)}.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--fg3)}.dot.on{background:var(--ok);box-shadow:0 0 0 3px var(--ok-bg)}.notice{padding:8px 10px;border-radius:6px;background:var(--bg2);color:var(--fg2);font-size:13px}.notice.bad{background:var(--bad-bg);color:var(--bad)}.notice.ok{background:var(--ok-bg);color:var(--ok)}.linkbox{display:flex;gap:6px;align-items:center}.linkbox input{flex:1;font-family:var(--mono);font-size:12px;background:var(--bg2)}.fp{font-family:var(--mono);font-size:12px;padding:1px 6px;border-radius:4px;background:var(--bg3);letter-spacing:.03em}.empty{color:var(--fg3);font-size:13px;padding:6px 0}table{border-collapse:collapse;width:100%;font-size:13px}td,th{text-align:left;padding:4px 8px 4px 0;vertical-align:top;border-bottom:1px solid var(--line2)}th{font-weight:500;color:var(--fg2)}.kv{display:grid;grid-template-columns:max-content 1fr;gap:2px 12px;font-size:13px}.kv dt{color:var(--fg2)}.kv dd{margin:0;word-break:break-word}.tabs{display:flex;flex-wrap:wrap;gap:2px;border-bottom:1px solid var(--line2);margin:8px 0}.tabs button{border:0;border-bottom:2px solid transparent;border-radius:0;background:none;color:var(--fg2);padding:5px 8px}.tabs button[aria-selected=true]{color:var(--fg);border-bottom-color:var(--accent)}.explorer{display:grid;grid-template-columns:1fr 260px;gap:10px}@media(max-width:640px){.explorer{grid-template-columns:1fr}}.canvas{position:relative;border:1px solid var(--line2);border-radius:var(--radius);background:var(--bg2);height:420px;overflow:hidden;touch-action:none}.canvas svg{width:100%;height:100%;display:block;cursor:grab}.canvas svg:active{cursor:grabbing}.canvas .zoom{position:absolute;right:8px;bottom:8px;display:flex;gap:4px}.canvas .zoom button{width:30px;padding:0;background:var(--bg)}.legend{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;color:var(--fg2);margin-top:6px}.legend span{display:inline-flex;align-items:center;gap:5px}.swatch{width:10px;height:10px;border-radius:3px;display:inline-block}.edge-swatch{width:16px;height:0;border-top:2px solid;display:inline-block}.timebar{display:flex;align-items:center;gap:8px;margin:8px 0}.timebar input[type=range]{flex:1;padding:0;border:0;min-height:0}.side{display:flex;flex-direction:column;gap:8px;min-width:0}.ended{text-decoration:line-through;color:var(--fg3)}.pair{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:stretch}@media(max-width:560px){.pair{grid-template-columns:1fr}.pair .vs{justify-self:center}}.pair .vs{align-self:center;font-size:12px;color:var(--bad);font-weight:600}.side-item{border:1px solid var(--line2);border-radius:6px;padding:8px 10px;background:var(--bg2)}.you{margin:4px 0 12px}.you p{margin:0}.you .row{gap:8px;align-items:center}.you input{min-width:14em}button.link{background:none;border:0;padding:0;color:var(--accent);cursor:pointer;font:inherit;text-decoration:underline}.stack{display:flex;flex-direction:column;gap:8px}.stack.sm{gap:4px}.stack.lg{gap:14px}.stack>h2{margin:8px 0 0}h1.title{font-size:17px}.wrap{overflow-wrap:anywhere}.item{display:flex;gap:10px;align-items:flex-start;justify-content:space-between}.item.center{align-items:center}.item>.row{flex:none;flex-wrap:nowrap}.item p{margin:0}.card.warn{border-color:var(--warn)}.card.ok{border-color:var(--ok)}.card.bad{border-color:var(--bad)}.card.accent{border-color:var(--accent)}.t-warn{color:var(--warn)}.t-ok{color:var(--ok)}.t-bad{color:var(--bad)}.t-accent{color:var(--accent)}.chip{border-radius:999px;color:var(--fg2)}.chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-fg);font-weight:500}.chip.on:hover:not(:disabled){background:var(--accent);filter:brightness(1.07)}button.link.name{font-weight:600;font-size:14px}button.link.pin{align-self:flex-start;color:var(--fg2);font-size:12px}button.link.pin[aria-pressed=true]{color:var(--accent)}.reply{padding-left:16px}.who{gap:4px 12px;font-size:12px;color:var(--fg3)}.who .on{color:var(--fg2)}.field{display:flex;flex-direction:column;gap:4px}.field label{font-weight:600}.field .linkbox{align-items:flex-start}.field .linkbox input,.field .linkbox textarea{flex:1;font-family:inherit;font-size:inherit;background:var(--bg)}.field select{align-self:flex-start}textarea{font:inherit;color:var(--fg);background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:6px 10px;min-width:0;resize:vertical}button.link.more{align-self:flex-start;font-size:12px;margin:2px 0}
11
+ </style>
12
+ </head>
13
+ <body>
14
+ <div id="root"></div>
15
+ <script>"use strict";(()=>{var cz=Object.create;var Al=Object.defineProperty;var uz=Object.getOwnPropertyDescriptor;var lz=Object.getOwnPropertyNames;var dz=Object.getPrototypeOf,fz=Object.prototype.hasOwnProperty;var Ar=(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 ee=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var I=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Vt=(e,t)=>{for(var r in t)Al(e,r,{get:t[r],enumerable:!0})},pz=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lz(t))!fz.call(e,o)&&o!==r&&Al(e,o,{get:()=>t[o],enumerable:!(n=uz(t,o))||n.enumerable});return e};var Nl=(e,t,r)=>(r=e!=null?cz(dz(e)):{},pz(t||!e||!e.__esModule?Al(r,"default",{value:e,enumerable:!0}):r,e));var T={};Vt(T,{BIGINT_FORMAT_RANGES:()=>Fo,CONSTANT_CATCH:()=>ia,Class:()=>Ml,NUMBER_FORMAT_RANGES:()=>Uo,aborted:()=>Ke,allowsEval:()=>ql,assert:()=>yz,assertEqual:()=>mz,assertIs:()=>_z,assertNever:()=>gz,assertNotEqual:()=>hz,assignProp:()=>Te,attachSchema:()=>Vo,base64ToUint8Array:()=>gb,base64urlToUint8Array:()=>Dz,cached:()=>zn,captureStackTrace:()=>ra,cleanEnum:()=>jz,cleanRegex:()=>Bt,clone:()=>oe,cloneDef:()=>wz,codePointLength:()=>Dr,constantCatch:()=>Kl,createTransparentProxy:()=>Pz,defineLazy:()=>Zl,defineLazyInternal:()=>V,derived:()=>qz,esc:()=>Be,escapeRegex:()=>ht,explicitlyAborted:()=>Vl,extend:()=>Iz,finalizeIssue:()=>et,floatSafeRemainder:()=>Zo,getElementAtPath:()=>$z,getEnumValues:()=>kn,getLengthableOrigin:()=>Bo,getParsedType:()=>zz,getSizableOrigin:()=>Ho,hexToUint8Array:()=>Zz,hide:()=>Ko,installLazyProp:()=>Hz,isObject:()=>jr,isPlainObject:()=>mt,issue:()=>En,joinValues:()=>ea,jsonStringifyReplacer:()=>Sn,members:()=>Bl,merge:()=>Rz,mergeDefs:()=>kt,normalizeParams:()=>S,nullish:()=>ta,numKeys:()=>Sz,objectClone:()=>bz,omit:()=>Ez,optionalKeys:()=>Fl,own:()=>sr,parsedType:()=>Hl,partial:()=>Oz,pick:()=>Cz,prefixIssues:()=>Xe,primitiveTypes:()=>Ul,promiseAllObject:()=>xz,propertyKeyTypes:()=>qo,randomString:()=>kz,rawShape:()=>Pn,required:()=>Az,safeExtend:()=>Tz,shallowClone:()=>Lo,sizeCaps:()=>Cn,slugify:()=>Ll,stringifyPrimitive:()=>na,toZod:()=>Mo,uint8ArrayToBase64:()=>yb,uint8ArrayToBase64url:()=>Mz,uint8ArrayToHex:()=>Lz,unwrapMessage:()=>xn});function mz(e){return e}function hz(e){return e}function Mo(){return e=>e}function _z(e){}function gz(e){throw new Error("Unexpected value in exhaustive check")}function yz(e){}function kn(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function ea(e,t="|"){return e.map(r=>na(r)).join(t)}function Sn(e,t){return typeof t=="bigint"?t.toString():t}function zn(e){return new Dl(e)}function ta(e){return e==null}function Bt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Zo(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}function Zl(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==pb)return n===void 0&&(n=pb,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function bz(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Te(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Pn(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Ht(e){return Pn(e._zod.def)??e._zod.def.shape}function mb(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Te(this,t,n),n},enumerable:!0,configurable:!0})}function hb(e,t,r){t in e?Te(e,t,r):e[t]=r}function Nr(e,t,r,n){let o=Ht(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?mb(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a}):hb(e,i,n?n(s.value,i):s.value))}}function vz(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?mb(e,r,()=>t[r]):hb(e,r,n.value))}}function kt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function wz(e){return kt(e._zod.def)}function $z(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function xz(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function kz(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Be(e){return JSON.stringify(e)}function Ll(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function jr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mt(e){if(jr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(jr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Lo(e){return mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Sz(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function oe(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(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 Pz(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},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,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function na(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Fl(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function Cz(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 i={};return Nr(i,e,oa(e,t)),oe(e,kt(r,{shape:i,checks:[]}))}function oa(e,t){let r=Ht(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function Ez(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 i=new Set(oa(e,t)),s={};return Nr(s,e,Reflect.ownKeys(Ht(e)).filter(a=>!i.has(a))),oe(e,kt(r,{shape:s,checks:[]}))}function Iz(e,t){if(!mt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Ht(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return oe(e,kt(e._zod.def,{shape:_b(e,t)}))}function _b(e,t){let r={};return Nr(r,e,Reflect.ownKeys(Ht(e))),vz(r,t),r}function Tz(e,t){if(!mt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return oe(e,kt(e._zod.def,{shape:_b(e,t)}))}function Rz(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Nr(r,e,Reflect.ownKeys(Ht(e))),Nr(r,t,Reflect.ownKeys(Ht(t)));let n=kt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return oe(e,n)}function Oz(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(oa(t,r)):void 0,c={};return Nr(c,t,Reflect.ownKeys(Ht(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),oe(t,kt(t._zod.def,{shape:c,checks:[]}))}function Az(e,t,r){let n=r?new Set(oa(t,r)):void 0,o={};return Nr(o,t,Reflect.ownKeys(Ht(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),oe(t,kt(t._zod.def,{shape:o}))}function Ke(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 Vl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function xn(e){return typeof e=="string"?e:e?.message}function Cn(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&t.push([o,r])}return t}function Vo(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function et(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:xn(e.inst?._zod.def?.error?.(e))??xn(i?.(e))??xn(t?.error?.(e))??xn(r.customError?.(e))??xn(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function Ho(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dr(e){let t=e.length;if(!Nz.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Bo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Hl(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 En(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function jz(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function gb(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 yb(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Dz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return gb(t+r)}function Mz(e){return yb(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Zz(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 Lz(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function Bl(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Uz(e,r,n.value)}}function sr(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Ko(e,t,r){return sr(e,t,r,!1)}function qz(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return sr(this,r,n(this))},set(o){sr(this,r,o)}})}return t}function Uz(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:sr(this,t,r.bind(this))},set(n){sr(this,t,n)}})}function Fz(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function V(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&jl!==e._zod){jl=void 0;return}jl=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Vz);let o=ir;ir=!1;try{let i=r(this);return ir?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),ir=ir||o,i}catch(i){throw delete this[t],ir=ir||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Hz(e,t,r,n){let o=Fz(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}function Kl(e){let t=()=>e;return t[ia]=!0,t}var Dl,pb,ra,ql,zz,qo,Ul,Uo,Fo,Nz,Ml,jl,ir,Vz,ia,ke=ee(()=>{ar();Dl=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};pb=Symbol("evaluating");ra="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};ql=zn(()=>{if(Ie.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});zz=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}`)}},qo=new Set(["string","number","symbol"]),Ul=new Set(["string","number","bigint","boolean","symbol","undefined"]);Uo={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]},Fo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Nz=/[\uD800-\uDBFF]/;Ml=class{constructor(...t){}};ir=!1,Vz={configurable:!0,get(){ir=!0}};ia="~constantCatch"});function Bz(e){let t=vb;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return vb=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function b(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,a=s&&new WeakSet;function c(d,p){if(d._zod){if(d._zod.traits.has(e))return}else{Jl.value=new i(p);try{Object.defineProperty(d,"_zod",Jl)}finally{Jl.value=void 0}}if(d._zod.traits.add(e),t(d,p),a){let h=Object.getPrototypeOf(d),g=d._zod.constr.prototype,w=h;for(;w&&w!==g;)w=Object.getPrototypeOf(w);let v=w??h;a.has(v)||(a.add(v),Bl(v,s))}let m=f.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in d||(d[h]=m[h].bind(d)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function f(d){let p=n?.Parent?Bz(l):this;c(p,d);let m=p._zod.deferred;if(m){for(let g of m)g();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(f,"init",{value:c}),Object.defineProperty(f,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}function be(e){return e&&Object.assign(Ie,e),Ie}var bb,Jo,Jl,vb,Wl,tt,cr,Ie,ar=ee(()=>{ke();Jo=Object.freeze({status:"aborted"}),Jl={value:void 0,enumerable:!1},vb="captureStackTrace"in Error?Error:null;Wl=Symbol("zod_brand"),tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},cr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(bb=globalThis).__zod_globalConfig??(bb.__zod_globalConfig={});Ie=globalThis.__zod_globalConfig});function Kz(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Sn,2)),e.message}function Jz(e){this._zod.message=e}function Gz(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Wo(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Gz(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Go(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;for(;u<a.length;){let l=a[u],f=u===a.length-1;if(l==="_errors"){f&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=c[l];f&&d._errors.push(t(s)),c=d,u++}}}};return n(e),r}function Xl(e,t=r=>r.message){let r={errors:[]},n=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0){r.errors.push(t(a));continue}let u=r,l=0;for(;l<c.length;){let f=c[l],d=l===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,f)||Object.defineProperty(u.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[f]):(u.items??(u.items=[]),(s=u.items)[f]??(s[f]={errors:[]}),u=u.items[f]),d&&u.errors.push(t(a)),l++}}};return n(e),r}function xb(e){let t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function ed(e){let t=[],r=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of r)t.push(`\u2716 ${n.message}`),n.path?.length&&t.push(` \u2192 at ${xb(n.path)}`);return t.join(`
16
+ `)}var Wz,Ql,wb,$b,Yl,rt,td=ee(()=>{ar();ke();Wz={get:Kz,set:Jz,enumerable:!0,configurable:!0},Ql={value:void 0,enumerable:!1},wb=new WeakSet([Object.prototype,Error.prototype]),$b=(e,t)=>{e.name="$ZodError",Ql.value=t,Object.defineProperty(e,"issues",Ql),Ql.value=void 0,Object.defineProperty(e,"message",Wz);let r=Object.getPrototypeOf(e);wb.has(r)||(wb.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Yl=b("$ZodError",$b),rt=b("$ZodError",$b,void 0,{Parent:Error})});function sa(e,t){return{callee:t?.callee??e,Err:t?.Err}}function kb(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>et(o,r,be()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}function e1(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[Xz]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new tt;return i.issues.length===0}var In,Qo,Tn,Yo,Rn,aa,On,rd,Yz,Xz,An,Nn,ca,Sb,ua,zb,la,Pb,da,Cb,fa,Eb,pa,Ib,ma,Tb,ha,Rb,nd=ee(()=>{ar();td();ke();In=e=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new tt;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>et(u,s,be())));throw ra(c,i?.callee??t),c}return a.value};return t},Qo=In(rt),Tn=e=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>et(u,s,be())));throw ra(c,i?.callee??t),c}return a.value};return t},Yo=Tn(rt),Rn=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new tt;return i.issues.length?kb(e,i.issues,o):{success:!0,data:i.value}},aa=Rn(rt);On=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?kb(e,i.issues,o):{success:!0,data:i.value}},rd=On(rt),Yz=Symbol.for("zod.compile.invalid"),Xz=Symbol.for("zod.compile.fallback"),An=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Yz)return!0;if(n.definite===!0&&r===void 0)return!1}return e1(e,t,r)});Nn=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},ca=e=>{let t=In(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,sa(r,s))};return r},Sb=ca(rt),ua=e=>{let t=In(e),r=(n,o,i,s)=>t(n,o,i,sa(r,s));return r},zb=ua(rt),la=e=>{let t=Tn(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,sa(r,s))};return r},Pb=la(rt),da=e=>{let t=Tn(e),r=async(n,o,i,s)=>await t(n,o,i,sa(r,s));return r},Cb=da(rt),fa=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Rn(e)(t,r,o)},Eb=fa(rt),pa=e=>(t,r,n)=>Rn(e)(t,r,n),Ib=pa(rt),ma=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return On(e)(t,r,o)},Tb=ma(rt),ha=e=>async(t,r,n)=>On(e)(t,r,n),Rb=ha(rt)});var _t={};Vt(_t,{anyString:()=>Id,base64:()=>wd,base64url:()=>$d,bigint:()=>Rd,boolean:()=>Od,browserEmail:()=>c1,cidrv4:()=>bd,cidrv6:()=>vd,creditCard:()=>_a,cuid:()=>id,cuid2:()=>sd,currencyCode:()=>zd,date:()=>Pd,datetime:()=>Ed,domain:()=>kd,duration:()=>fd,e164:()=>Sd,email:()=>md,emoji:()=>hd,extendedDuration:()=>t1,guid:()=>pd,hex:()=>Md,hostname:()=>xd,html5Email:()=>i1,httpProtocol:()=>Xo,iban:()=>ga,idnEmail:()=>a1,integer:()=>ei,ipv4:()=>_d,ipv6:()=>gd,ksuid:()=>ud,lowercase:()=>jd,mac:()=>yd,md5_base64:()=>f1,md5_base64url:()=>p1,md5_hex:()=>d1,nanoid:()=>ld,nanoidOfLength:()=>dd,null:()=>Ad,number:()=>Kt,rfc5322Email:()=>s1,sha1_base64:()=>h1,sha1_base64url:()=>_1,sha1_hex:()=>m1,sha256_base64:()=>y1,sha256_base64url:()=>b1,sha256_hex:()=>g1,sha384_base64:()=>w1,sha384_base64url:()=>$1,sha384_hex:()=>v1,sha512_base64:()=>k1,sha512_base64url:()=>S1,sha512_hex:()=>x1,string:()=>Td,time:()=>Cd,ulid:()=>ad,undefined:()=>Nd,unicodeEmail:()=>Ob,uppercase:()=>Dd,uuid:()=>Mr,uuid4:()=>r1,uuid6:()=>n1,uuid7:()=>o1,xid:()=>cd});function dd(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function hd(){return new RegExp(u1,"u")}function l1(e){return new RegExp(`^${e}$`)}function od(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cd(e){return new RegExp(`^${od(e)}$`)}function Ed(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${od({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${od({precision:e.precision})}`:r;return new RegExp(`^${Ab}T(?:${n})$`)}function ti(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ri(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var id,sd,ad,cd,ud,ld,fd,t1,pd,Mr,r1,n1,o1,md,i1,s1,Ob,a1,c1,u1,_d,gd,yd,bd,vd,wd,$d,xd,kd,Xo,Sd,_a,zd,ga,Ab,Pd,Id,Td,Rd,ei,Kt,Od,Ad,Nd,jd,Dd,Md,d1,f1,p1,m1,h1,_1,g1,y1,b1,v1,w1,$1,x1,k1,S1,Zr=ee(()=>{ke();id=/^[cC][0-9a-z]{6,}$/,sd=/^[0-9a-z]+$/,ad=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,cd=/^[0-9a-vA-V]{20}$/,ud=/^[A-Za-z0-9]{27}$/,ld=/^[a-zA-Z0-9_-]{21}$/;fd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t1=/^[-+]?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)?)??$/,pd=/^([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})$/,Mr=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)$/,r1=Mr(4),n1=Mr(6),o1=Mr(7),md=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i1=/^[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])?)*$/,s1=/^(([^<>()\[\]\\.,;:\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,}))$/,Ob=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,a1=Ob,c1=/^[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])?)*$/,u1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";_d=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gd=/^(([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}|:))$/,yd=e=>{let t=ht(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},bd=/^((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])$/,vd=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xd=/^(?=.{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])?)*\.?$/,kd=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Xo=/^https?$/,Sd=/^\+[1-9]\d{6,14}$/,_a=/^\d(?:[ -]?\d){11,18}$/,zd=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,ga=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Ab="(?:(?:\\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])))";Pd=l1(Ab);Id=/^[\s\S]{0,}$/,Td=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Rd=/^-?\d+n?$/,ei=/^-?\d+$/,Kt=/^-?\d+(?:\.\d+)?$/,Od=/^(?:true|false)$/i,Ad=/^null$/i,Nd=/^undefined$/i,jd=/^[^A-Z]*$/,Dd=/^[^a-z]*$/,Md=/^[0-9a-fA-F]*$/;d1=/^[0-9a-fA-F]{32}$/,f1=ti(22,"=="),p1=ri(22),m1=/^[0-9a-fA-F]{40}$/,h1=ti(27,"="),_1=ri(27),g1=/^[0-9a-fA-F]{64}$/,y1=ti(43,"="),b1=ri(43),v1=/^[0-9a-fA-F]{96}$/,w1=ti(64,""),$1=ri(64),x1=/^[0-9a-fA-F]{128}$/,k1=ti(86,"=="),S1=ri(86)});function ba(e,t,r){e.issues.length&&t.issues.push(...Xe(r,e.issues))}var fe,Zd,Ld,ya,va,wa,qd,Ud,Fd,Vd,Hd,Bd,Kd,Jd,Wd,jn,Gd,Qd,Yd,Xd,ef,tf,rf,nf,of,sf,$a=ee(()=>{ar();Zr();ke();fe=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Zd=e=>{let t=e.value;return!ta(t)&&t.size!==void 0},Ld=e=>{let t=e.value;return!ta(t)&&t.length!==void 0},ya={number:"number",bigint:"bigint",object:"date"},va=b("$ZodCheckLessThan",(e,t)=>{fe.init(e,t);let r=ya[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ya[typeof n.value]??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})}}),wa=b("$ZodCheckGreaterThan",(e,t)=>{fe.init(e,t);let r=ya[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ya[typeof n.value]??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})}}),qd=b("$ZodCheckMultipleOf",(e,t)=>{fe.init(e,t),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"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Zo(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})}}),Ud=b("$ZodCheckNumberFormat",(e,t)=>{fe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Uo[t.format];e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Fd=b("$ZodCheckBigIntFormat",(e,t)=>{fe.init(e,t);let[r,n]=Fo[t.format];e._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Vd=b("$ZodCheckMaxSize",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Zd),e._zod.check=n=>{let o=n.value;o.size<=t.maximum||n.issues.push({origin:Ho(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Hd=b("$ZodCheckMinSize",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Zd),e._zod.check=n=>{let o=n.value;o.size>=t.minimum||n.issues.push({origin:Ho(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Bd=b("$ZodCheckSizeEquals",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Zd),e._zod.check=n=>{let o=n.value,i=o.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:Ho(o),...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})}}),Kd=b("$ZodCheckMaxLength",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Ld),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Dr(o):i)<=t.maximum)return;let a=Bo(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Jd=b("$ZodCheckMinLength",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Ld),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Dr(o):i)>=t.minimum)return;let a=Bo(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Wd=b("$ZodCheckLengthEquals",(e,t)=>{var r;fe.init(e,t),(r=e._zod.def).when??(r.when=Ld),e._zod.check=n=>{let o=n.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?Dr(o):i;if(s===t.length)return;let a=Bo(o),c=s>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jn=b("$ZodCheckStringFormat",(e,t)=>{var r,n;fe.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Gd=b("$ZodCheckRegex",(e,t)=>{jn.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})}}),Qd=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jd),jn.init(e,t)}),Yd=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Dd),jn.init(e,t)}),Xd=b("$ZodCheckIncludes",(e,t)=>{fe.init(e,t);let r=ht(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ef=b("$ZodCheckStartsWith",(e,t)=>{fe.init(e,t);let r=new RegExp(`^${ht(t.prefix)}.*`);t.pattern??(t.pattern=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})}}),tf=b("$ZodCheckEndsWith",(e,t)=>{fe.init(e,t);let r=new RegExp(`.*${ht(t.suffix)}$`);t.pattern??(t.pattern=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})}});rf=b("$ZodCheckProperty",(e,t)=>{fe.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(o=>ba(o,r,t.property));ba(n,r,t.property)}}),nf=b("$ZodCheckProperties",(e,t)=>{fe.init(e,t),Ko(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=n=>{if(n.value==null){n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=n.value,i;for(let[s,a]of r){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>ba(u,n,s)))):ba(c,n,s)}if(i)return Promise.all(i).then(()=>{})}}),of=b("$ZodCheckMimeType",(e,t)=>{fe.init(e,t);let r=new Set(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})}}),sf=b("$ZodCheckOverwrite",(e,t)=>{fe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Lr,xa=ee(()=>{Lr=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
17
+ `).filter(s=>s),o=Math.min(...n.map(s=>s.length-s.trimStart().length)),i=n.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
18
+ ${r.join(`
19
+ `)}
20
+ };`)(...Object.values(this.closed))}}});var af,cf=ee(()=>{af={major:4,minor:6,patch:7}});async function z1(e,t){let r={async:!0};return Qb(await e._zod.run({value:t,issues:[]},r),r)}function Ca(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Qb(n,r)}catch{}return z1(e,t)},vendor:"zod",version:1}}function mf(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ea(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?mf(e)||ni:Yb(e,t)}function Yb(e,t){if(!t.normalize&&t.protocol?.source===Xo.source&&!/^https?:\/\//i.test(e))return pf;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??ni}return new URL(e)}catch{return ni}}function oi(e){return e.replace(P1,"")}function Ia(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ta(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}function ii(e){return C1.test(e)?mf(`http://[${e}]`):!1}function Ra(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:ii(r)}function si(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Aa(e){if(!ai.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return si(r)}function I1(e){let t=e.length,r=1,n=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][o]:o}return n%10===0}function Na(e){return _a.test(e)?I1(e.replace(E1,"")):!1}function T1(e){let t=0,r=e.length;for(let n=4;n<r;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}for(let n=0;n<4;n++){let o=e.charCodeAt(n);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}return t===1}function ja(e){return ga.test(e)?T1(e):!1}function Da(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function Wf(e,t){let r=Cn(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(i=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let a=t(i.value);if(a>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,u]of Cn(e._zod.def.checks))if(a>c&&u._zod.def.when(i)){let l=i.issues.length;return u._zod.check(i),i.issues[l].continue=!1,Vo(i.issues,l,e),i}}return o(i,s)}}function jb(e,t,r){e.issues.length&&t.issues.push(...Xe(r,e.issues)),t.value[r]=e.value}function Pa(e,t,r,n,o,i){let s=r in n,a=i==="optional";if(!(!s&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!s)return;t.issues.push(...Xe(r,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!a)&&(t.value[r]=void 0):t.value[r]=e.value}}function Xb(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:N1,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Fl(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function ev(e,t,r,n,o,i,s){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,f=u.optin,d=u.optout,p=0;for(let m in t){if(s&&r.issues.length!==p){if(Ke(r,p))break;p=r.issues.length}if(c.has(m))continue;if(m==="__proto__"){l==="never"&&a.push(m);continue}if(l==="never"){a.push(m);continue}let h=u.run({value:t[m],issues:[]},n);h instanceof Promise?e.push(h.then(g=>Pa(g,r,m,t,f,d))):Pa(h,r,m,t,f,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}function Db(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Ke(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>et(s,n,be())))}),t)}function Mb(e,t,r,n){let o=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&o.push(i);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>et(s,n,be())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:o}),t)}function Xf(e,t){let r=e._zod,n=r.bag.optionsMap;n||(n=rv(r.def),r.bag.optionsMap=n);let o=n.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function rv(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}function Dn(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(mt(e)&&mt(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Dn(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}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 o=e[n],i=t[n],s=Dn(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Zb(e,t,r){let n=new Map,o,i=new Map,s=(u,l)=>{let f;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),f=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let d=String(u.path[0]);i.has(d)||i.set(d,u),f=[d]}else return!1;for(let d of f)n.has(d)||n.set(d,{}),n.get(d)[l]=!0;return!0};for(let u of t.issues)s(u,"l")||e.issues.push(u);for(let u of r.issues)s(u,"r")||e.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&e.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&i.has(l)&&e.issues.push(i.get(l))}let c=Dn(t.value,r.value);if(!c.valid){if(Ke(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}function Lb(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function qb(e,t,r){e.issues.length&&t.issues.push(...Xe(r,e.issues)),t.value[r]=e.value}function Ub(e,t,r,n,o){for(let i=0;i<r.length;i++){let s=e[i],a=i<n.length;if(!a&&i>=o&&r[i]._zod.optin==="optional"){t.value.length=i;break}if(s.issues.length){if(!a&&i>=o){t.value.length=i;break}t.issues.push(...Xe(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=n.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Fb(e,t,r,n,o,i,s){e.issues.length&&(qo.has(typeof n)?r.issues.push(...Xe(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:e.issues.map(a=>et(a,s,be()))})),t.issues.length&&(qo.has(typeof n)?r.issues.push(...Xe(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map(a=>et(a,s,be()))})),r.value.set(e.value,t.value)}function Vb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Hb(e,t){return e.value=t.issues.length?void 0:t.value,e}function Bb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Kb(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 Jb(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>et(o,n,be()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function ka(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function Sa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(i=>za(e,i,t.out,r)):za(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(i=>za(e,i,t.in,r)):za(e,o,t.in,r)}}function za(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}function Wb(e){return e.memo||(e.value=Object.freeze(e.value)),e}function j1(e){let t=e._zod.def,r=t.pattern,n=!!t.format?.includes("int"),o,i;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(r=c.pattern),n||(n=!!c.format?.includes("int"));let u=c.minimum??c.length,l=c.maximum??c.length;u!==void 0&&(o===void 0||u>o)&&(o=u),l!==void 0&&(i===void 0||l<i)&&(i=l)}if(r)return r.source;if(o!==void 0&&i!==void 0&&o>i)return"(?!)";if(o!==void 0||i!==void 0)return Td({minimum:o,maximum:i}).source;let s=e._zod.pattern;return(n&&s===Kt?ei:s)?.source}function uf(e){let t=e._zod.def,r=e._zod.pattern?.source,n=t.innerType??e._zod.innerType;if(n){let o=n._zod.pattern?.source,i=uf(n);return r&&o&&i&&i!==o?r.replace(Bt(o),()=>Bt(i)):r}if(t.options){let o=t.options.map(uf);if(o.every(Boolean))return`^(${o.map(i=>Bt(i)).join("|")})$`}return j1(e)}function Gb(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(En(o))}}var Z,Qb,qr,ie,lf,df,ff,pf,ni,P1,hf,_f,gf,yf,bf,vf,wf,$f,xf,kf,Sf,zf,Pf,C1,Cf,Ef,If,Tf,Oa,Rf,ai,Of,Af,E1,Nf,jf,Df,Mf,Ma,Zf,ci,Za,Lf,qf,Uf,Ff,Vf,Hf,Bf,Kf,Jf,R1,O1,A1,Gf,N1,tv,Qf,ui,Yf,ep,tp,La,rp,np,op,ip,sp,ap,cp,qa,up,lp,dp,fp,pp,mp,hp,_p,Ua,li,gp,yp,bp,vp,wp,di,$p,Mn=ee(()=>{$a();ar();xa();nd();Zr();ke();cf();ke();Z=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=af;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,c,u)=>{if(a.memo)return a;let l=Ke(a),f;for(let d of c){if(d._zod.def.when){if(Vl(a)||!d._zod.def.when(a))continue}else if(l)continue;let p=a.issues.length,m=d._zod.check(a);if(m instanceof Promise&&u?.async===!1)throw new tt;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(Vo(a.issues,p,e),l||(l=Ke(a,p)))});else{if(a.issues.length===p)continue;Vo(a.issues,p,e),l||(l=Ke(a,p))}}return f?f.then(()=>a):a},s=(a,c,u)=>{if(Ke(a))return a.aborted=!0,a;let l=i(c,o,u);if(l instanceof Promise){if(u.async===!1)throw new tt;return l.then(f=>e._zod.parse(f,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(f=>s(f,a,c)):s(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new tt;return u.then(l=>i(l,o,c))}return i(u,o,c)}}},{get"~standard"(){return Ko(this,"~standard",Ca(this))},set"~standard"(e){sr(this,"~standard",e)}}),Qb=(e,t)=>e.issues.length?{issues:e.issues.map(r=>et(r,t,be()))}:{value:e.value};qr=b("$ZodString",(e,t)=>{Z.init(e,t),e._zod.pattern=t.pattern??Id,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}}),ie=b("$ZodStringFormat",(e,t)=>{jn.init(e,t),qr.init(e,t)}),lf=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pd),ie.init(e,t)}),df=b("$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=Mr(n))}else t.pattern??(t.pattern=Mr());ie.init(e,t)}),ff=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=md),ie.init(e,t)}),pf=1,ni=2;P1=/[\t\n\r]/g;hf=b("$ZodURL",(e,t)=>{ie.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Ea(n,t);if(o===pf){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===ni){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=oi(n);return}t.hostname&&!Ia(o,t.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&&!Ta(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:oi(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),_f=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hd()),ie.init(e,t)}),gf=b("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?ld:dd(t.length)),ie.init(e,t)}),yf=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=id),ie.init(e,t)}),bf=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sd),ie.init(e,t)}),vf=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ad),ie.init(e,t)}),wf=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=cd),ie.init(e,t)}),$f=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ud),ie.init(e,t)}),xf=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ed(t)),ie.init(e,t)}),kf=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pd),ie.init(e,t)}),Sf=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Cd(t)),ie.init(e,t)}),zf=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fd),ie.init(e,t)}),Pf=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_d),ie.init(e,t)}),C1=/^[0-9a-fA-F:.]+$/;Cf=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gd),ie.init(e,t),e._zod.check=r=>{ii(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),Ef=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=yd(t.delimiter)),ie.init(e,t)}),If=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bd),ie.init(e,t)});Tf=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vd),ie.init(e,t),e._zod.check=r=>{Ra(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});Oa=/^[0-9a-zA-Z+/]*={0,2}$/,Rf=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Oa),ie.init(e,t),e._zod.check=r=>{si(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ai=/^[A-Za-z0-9_-]*$/;Of=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ai),ie.init(e,t),e._zod.check=r=>{Aa(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Af=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Sd),ie.init(e,t)}),E1=/[- ]/g;Nf=b("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=_a),ie.init(e,t),e._zod.check=r=>{Na(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});jf=b("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=ga),ie.init(e,t),e._zod.check=r=>{ja(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});Df=b("$ZodJWT",(e,t)=>{ie.init(e,t),e._zod.check=r=>{Da(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Mf=b("$ZodCustomStringFormat",(e,t)=>{ie.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})}}),Ma=b("$ZodNumber",(e,t)=>{Z.init(e,t),e._zod.pattern=Kt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),Zf=b("$ZodNumberFormat",(e,t)=>{Ud.init(e,t),Ma.init(e,t)}),ci=b("$ZodBoolean",(e,t)=>{Z.init(e,t),e._zod.pattern=Od,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Za=b("$ZodBigInt",(e,t)=>{Z.init(e,t),e._zod.pattern=Rd,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}}),Lf=b("$ZodBigIntFormat",(e,t)=>{Fd.init(e,t),Za.init(e,t)}),qf=b("$ZodSymbol",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r}}),Uf=b("$ZodUndefined",(e,t)=>{Z.init(e,t),e._zod.pattern=Nd,e._zod.values=new Set([void 0]),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),Ff=b("$ZodNull",(e,t)=>{Z.init(e,t),e._zod.pattern=Ad,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),Vf=b("$ZodAny",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r}),Hf=b("$ZodUnknown",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r}),Bf=b("$ZodNever",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Kf=b("$ZodVoid",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Jf=b("$ZodDate",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});R1=e=>Array.isArray(e)?e.length:-1,O1=e=>e instanceof Map?e.size:-1,A1=e=>e instanceof Set?e.size:-1;Gf=b("$ZodArray",(e,t)=>{Z.init(e,t);let r=Ie.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],a=o?.abortEarly;for(let c=0;c<i.length;c++){let u=i[c],l=t.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)s.push(l.then(f=>jb(f,n,c)));else if(jb(l,n,c),a&&l.issues.length!==0&&Ke(l))break}return s.length?Promise.all(s).then(()=>n):n},Wf(e,R1)});N1=[];tv=b("$ZodObject",(e,t)=>{Z.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(t,"shape",{get:u})}let o=zn(()=>Xb(t));V(e,"propValues",u=>{let l=u.def.shape,f={};for(let d in l){let p=l[d]._zod;if(p.values){Object.prototype.hasOwnProperty.call(f,d)||Te(f,d,new Set);for(let m of p.values)f[d].add(m);p.optin!==void 0&&f[d].add(void 0)}}return f});let i=jr,s=t.catchall,a,c=Ie.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=o.value);let f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let d=[],p=a.shape,m=l?.abortEarly,h=u.issues.length;for(let g of a.allKeys){if(m&&u.issues.length!==h){if(Ke(u,h))break;h=u.issues.length}if(g==="__proto__")continue;let w=p[g],v=w._zod.optin,x=w._zod.optout,C=w._zod.run({value:f[g],issues:[]},l);C instanceof Promise?d.push(C.then($=>Pa($,u,g,f,v,x))):Pa(C,u,g,f,v,x)}return s?ev(d,f,u,l,o.value,e,m===!0):d.length?Promise.all(d).then(()=>u):u}}),Qf=b("$ZodObjectJIT",(e,t)=>{tv.init(e,t);let r=e._zod.parse,n=zn(()=>Xb(t)),o=Ie.memoizer,i=p=>{let m=n.value,h=m.symbolKeys,g=new Lr(["payload","ctx"],{shape:p,inst:e,memo:o,syms:h}),w=$=>`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`,v=($,k)=>`
21
+ let ${$}_ab = false;
22
+ for (let i = 0; i < ${$}.issues.length; i++) {
23
+ const iss = ${$}.issues[i];
24
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
25
+ payload.issues.push(iss);
26
+ if (iss.continue !== true) ${$}_ab = true;
27
+ }
28
+ if (${$}_ab && ctx && ctx.abortEarly) {
29
+ payload.value = newResult;
30
+ return payload;
31
+ }`;g.write("const input = payload.value;");let x=Object.create(null),C=0;for(let $ of m.allKeys)x[$]=`key_${C++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let $ of m.allKeys){if($==="__proto__")continue;let k=x[$],R=typeof $=="symbol"?`syms[${h.indexOf($)}]`:Be($),X=`${R} in input`,U=p[$],Q=U?._zod?.optin,Le=Q!==void 0,Or=U?._zod?.optout==="optional";if(g.write(`const ${k} = ${w(R)};`),Le&&Or){let $n=Q==="optional"?`${k}_present`:`${k}.value !== undefined || ${k}_present`;g.write(`
32
+ const ${k}_present = ${X};
33
+ if (!${k}.issues.length || ${k}_present) {
34
+ if (${k}.issues.length) {${v(k,R)}
35
+ }
36
+
37
+ if (${$n}) {
38
+ newResult[${R}] = ${k}.value;
39
+ }
40
+ }
41
+
42
+ `)}else Le?(g.write(`
43
+ if (${k}.issues.length) {${v(k,R)}
44
+ }
45
+ `),Q==="defaulted"?g.write(`newResult[${R}] = ${k}.value;`):g.write(`
46
+ if (${k}.value !== undefined || ${X}) {
47
+ newResult[${R}] = ${k}.value;
48
+ }
49
+ `)):g.write(`
50
+ const ${k}_present = ${X};
51
+ if (${k}.issues.length) {${v(k,R)}
52
+ }
53
+ if (!${k}_present && !${k}.issues.length) {
54
+ payload.issues.push({
55
+ code: "invalid_type",
56
+ expected: "nonoptional",
57
+ input: undefined,
58
+ path: [${R}]
59
+ });
60
+ if (ctx && ctx.abortEarly) {
61
+ payload.value = newResult;
62
+ return payload;
63
+ }
64
+ }
65
+
66
+ if (${k}_present) {
67
+ newResult[${R}] = ${k}.value;
68
+ }
69
+
70
+ `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},s,a=jr,c=!Ie.jitless,l=c&&ql.value,f=t.catchall,d;e._zod.parse=(p,m)=>{d??(d=n.value);let h=p.value;return a(h)?c&&l&&m?.async===!1&&m.jitless!==!0?(s||(s=i(t.shape)),p=s(p,m),f?ev([],h,p,m,d,e,m?.abortEarly===!0):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p)}});ui=b("$ZodUnion",(e,t)=>{Z.init(e,t),V(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),V(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),V(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Bt(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}return i?Promise.all(s).then(a=>Db(a,n,e,o)):Db(s,n,e,o)}});Yf=b("$ZodXor",(e,t)=>{ui.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(s.push(c),i=!0):s.push(c)}return i?Promise.all(s).then(a=>Mb(a,n,e,o)):Mb(s,n,e,o)}});ep=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ui.init(e,t);let r=e._zod.parse;V(e,"propValues",o=>{let i={},s=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&s++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,u)||Te(i,u,new Set);for(let f of l)i[u].add(f)}}return!o.def.unionFallback&&s>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let s=Pn(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=zn(()=>rv(t));e._zod.parse=(o,i)=>{let s=o.value;if(!jr(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=s?.[t.discriminator],c=n.value.get(a);return c&&(a!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(u=>n.value.get(u)!==null),input:s,path:[t.discriminator],inst:e}),o)}}),tp=b("$ZodIntersection",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>Zb(r,c,u)):Zb(r,i,s)}});La=b("$ZodTuple",(e,t)=>{Z.init(e,t);let r=t.items,n=Ie.memoizer;n?.attach(e),e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=n?n.alloc(e,o,[],i):[];let a=[],c=Lb(r,"optin"),u=Lb(r,"optout");if(!t.rest){if(s.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:!0,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:e,origin:"array"})}let l=new Array(r.length),f=t.rest?i?.abortEarly:void 0,d=!1;for(let p=0;p<r.length;p++){let m=r[p]._zod.run({value:s[p],issues:[]},i);m instanceof Promise?a.push(m.then(h=>{l[p]=h})):(l[p]=m,f&&!d&&m.issues.length&&(d=Ke(m)))}if(t.rest&&!d){let p=r.length-1,m=s.slice(r.length),h=o.issues.length;for(let g of m){if(f&&o.issues.length!==h){if(Ke(o,h))break;h=o.issues.length}p++;let w=t.rest._zod.run({value:g,issues:[]},i);w instanceof Promise?a.push(w.then(v=>qb(v,o,p))):qb(w,o,p)}}return a.length?Promise.all(a).then(()=>Ub(l,o,r,s,u)):Ub(l,o,r,s,u)}});rp=b("$ZodRecord",(e,t)=>{Z.init(e,t);let r=Ie.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!mt(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(m=>et(m,o,be())),input:l,path:[l],inst:e});continue}let d=f.value;if(d==="__proto__")continue;let p=t.valueType._zod.run({value:i[l],issues:[]},o);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&n.issues.push(...Xe(l,m.issues)),n.value[d]=m.value})):(p.issues.length&&n.issues.push(...Xe(l,p.issues)),n.value[d]=p.value)}let u;for(let l in i)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;n.value[l]=i[l]}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:u,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let c;for(let u of Reflect.ownKeys(i)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Kt.test(u)&&l.issues.length){let m=t.keyType._zod.run({value:Number(u),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m)}if(l.issues.length){t.mode==="loose"?n.value[u]=i[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>et(m,o,be())),input:u,path:[u],inst:e});continue}let d=l.value;if(d==="__proto__")continue;let p=t.valueType._zod.run({value:i[u],issues:[]},o);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&n.issues.push(...Xe(u,m.issues)),n.value[d]=m.value})):(p.issues.length&&n.issues.push(...Xe(u,p.issues)),n.value[d]=p.value)}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>n):n}}),np=b("$ZodMap",(e,t)=>{Z.init(e,t);let r=Ie.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let s=[];n.value=r?r.alloc(e,n,new Map,o):new Map;let a=o?.abortEarly,c=n.issues.length;for(let[u,l]of i){if(a&&n.issues.length!==c){if(Ke(n,c))break;c=n.issues.length}let f=t.keyType._zod.run({value:u,issues:[]},o),d=t.valueType._zod.run({value:l,issues:[]},o);f instanceof Promise||d instanceof Promise?s.push(Promise.all([f,d]).then(([p,m])=>{Fb(p,m,n,u,i,e,o)})):Fb(f,d,n,u,i,e,o)}return s.length?Promise.all(s).then(()=>n):n},Wf(e,O1)});op=b("$ZodSet",(e,t)=>{Z.init(e,t);let r=Ie.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let s=[];n.value=r?r.alloc(e,n,new Set,o):new Set;let a=o?.abortEarly,c=n.issues.length;for(let u of i){if(a&&n.issues.length!==c){if(Ke(n,c))break;c=n.issues.length}let l=t.valueType._zod.run({value:u,issues:[]},o);l instanceof Promise?s.push(l.then(f=>Vb(f,n))):Vb(l,n)}return s.length?Promise.all(s).then(()=>n):n},Wf(e,A1)});ip=b("$ZodEnum",(e,t)=>{Z.init(e,t);let r=kn(t.entries),n=new Set(r);e._zod.values=n,V(e,"pattern",o=>{let i=kn(o.def.entries).filter(s=>qo.has(typeof s));return new RegExp(i.length?`^(${i.map(s=>ht(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),sp=b("$ZodLiteral",(e,t)=>{Z.init(e,t);let r=new Set(t.values);e._zod.values=r,V(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?ht(i):i?ht(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),ap=b("$ZodFile",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),cp=b("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.optin="optional",Ie.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cr(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new tt;return r.value=o,r}});qa=b("$ZodOptional",(e,t)=>{Z.init(e,t),V(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",V(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),V(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Bt(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Hb(r,i)):Hb(r,o)}return t.innerType._zod.run(r,n)}}),up=b("$ZodExactOptional",(e,t)=>{qa.init(e,t),V(e,"values",r=>r.def.innerType._zod.values),V(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),lp=b("$ZodNullable",(e,t)=>{Z.init(e,t),V(e,"optin",r=>r.def.innerType._zod.optin),V(e,"optout",r=>r.def.innerType._zod.optout),V(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Bt(n.source)}|null)$`):void 0}),V(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),dp=b("$ZodDefault",(e,t)=>{Z.init(e,t),e._zod.optin="defaulted",V(e,"values",r=>r.def.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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Bb(i,t)):Bb(o,t)}});fp=b("$ZodPrefault",(e,t)=>{Z.init(e,t),e._zod.optin="defaulted",V(e,"values",r=>r.def.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))}),pp=b("$ZodNonOptional",(e,t)=>{Z.init(e,t),V(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Kb(i,e)):Kb(o,e)}});mp=b("$ZodSuccess",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cr("ZodSuccess");let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}});hp=b("$ZodCatch",(e,t)=>{Z.init(e,t),V(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),V(e,"optout",r=>r.def.innerType._zod.optout),V(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>Jb(r,i,t,n)):Jb(r,o,t,n)}}),_p=b("$ZodNaN",(e,t)=>{Z.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)}),Ua=b("$ZodPipe",(e,t)=>{Z.init(e,t),V(e,"values",r=>r.def.in._zod.values),V(e,"optin",r=>r.def.in._zod.optin),V(e,"optout",r=>r.def.out._zod.optout),V(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>ka(s,t.in,n)):ka(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>ka(i,t.out,n)):ka(o,t.out,n)}});li=b("$ZodCodec",(e,t)=>{Z.init(e,t),V(e,"values",r=>r.def.in._zod.values),V(e,"optin",r=>r.def.in._zod.optin),V(e,"optout",r=>r.def.out._zod.optout),V(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Sa(s,t,n)):Sa(i,t,n)}else{let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>Sa(s,t,n)):Sa(i,t,n)}}});gp=b("$ZodPreprocess",(e,t)=>{Ua.init(e,t)}),yp=b("$ZodReadonly",(e,t)=>{Z.init(e,t),V(e,"propValues",r=>r.def.innerType._zod.propValues),V(e,"values",r=>r.def.innerType._zod.values),V(e,"optin",r=>r.def.innerType?._zod?.optin),V(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Wb):Wb(o)}});bp=b("$ZodTemplateLiteral",(e,t)=>{Z.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){let o=uf(n);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);r.push(Bt(o))}else if(n===null||Ul.has(typeof n))r.push(ht(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>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)}),vp=b("$ZodFunction",(e,t)=>(Z.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...n){let o=e._def.input?Qo(e._def.input,n):n,i=Reflect.apply(r,this,o);return e._def.output?Qo(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...n){let o=e._def.input?await Yo(e._def.input,n):n,i=await Reflect.apply(r,this,o);return e._def.output?await Yo(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},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 La({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)),wp=b("$ZodPromise",(e,t)=>{Z.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},n))}),di=b("$ZodLazy",(e,t)=>{Z.init(e,t),Zl(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),V(e,"pattern",r=>r.innerType?._zod?.pattern),V(e,"propValues",r=>r.innerType?._zod?.propValues),V(e,"optin",r=>r.innerType?._zod?.optin??void 0),V(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),$p=b("$ZodCustom",(e,t)=>{fe.init(e,t),Z.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Gb(i,r,n,e));Gb(o,r,n,e)}})});function iv(e){return e!==null&&typeof e=="object"}function xp(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}function pi(e,t,r){let n=sv.get(e);if(n!==void 0)return n?fi:Zn;if(t.has(e))return fi;t.add(e);let o=Zn,i=l=>{if(o!==fi&&l?._zod){let f=pi(l,t,r);f>o&&(o=f)}},s=(l,f)=>{let d=Zn;for(let p of Reflect.ownKeys(l)){let m=Object.getOwnPropertyDescriptor(l,p);if(f&&!m.enumerable)continue;let h=m.get?Ha:m.value?._zod?pi(m.value,t,r):Zn;h>d&&(d=h)}return d},a=l=>{l>o&&(o=l)},c=e._zod.def,u=c.type;switch(u){case"object":{let l=Pn(c);a(l?s(l,!0):Ha),i(c.catchall);break}case"array":i(c.element);break;case"tuple":for(let l of c.items)i(l);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(let l of c.options)i(l);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?pi(l,t,!1):Ha);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let f=Object.getOwnPropertyDescriptor(c,l);if(!f||f.get)continue;let d=f.value;if(!(!d||typeof d!="object")){if(d._zod)i(d);else if(Array.isArray(d))for(let p of d)i(p)}}}return t.delete(e),D1(e,o)}function D1(e,t){return t!==Ha&&sv.set(e,t===fi),t}function Ka(e){return pi(e,new Set,!0)!==Zn}function M1(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}function mi(){return Z1}function Ja(e,t){let r=e[kp]?.backEdges;return r!==void 0&&iv(t)&&r.has(t)}var Ba,kp,ov,sv,Zn,Ha,fi,Fa,Va,Z1,Sp=ee(()=>{ke();Ba=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},kp="~memo",ov=[];sv=new WeakMap,Zn=0,Ha=1,fi=2;Va=[],Z1={alloc(e,t,r){let n=Fa;if(!n)return r;Fa=void 0;let o={value:r,issues:null};return n.set(t.value,o),Va.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Ja(i,o.value))throw new Ba;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,u)=>{if(r===void 0){let w=pi(e,new Set,!1);if(w===Zn)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,u);w===fi||n?r=!0:n=!0}let l=c.value;if(!iv(l))return s(c,u);let f=u[kp];f||(f={buckets:new WeakMap,backEdges:void 0},u[kp]=f);let d;o===u?d=i:(d=M1(f,e),o=u,i=d);let p=d.get(l);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...xp(p.issues)):(c.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(p.value)),c;Fa=d;let m=Va.length,h=s(c,u);Fa=void 0;let g=Va.length>m?Va.pop():void 0;return h instanceof Promise?h.then(w=>(g&&(g.issues=w.issues.length?xp(w.issues):ov),w)):(g&&(g.issues=h.issues.length?xp(h.issues):ov),h)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}}});function Wa(){return{localeError:L1()}}var L1,zp=ee(()=>{ke();L1=()=>{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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){return i==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):n[i]??i}return i=>{switch(i.code){case"invalid_type":{let s=o(i.expected),a=Hl(i.input),c=o(a,i.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${na(i.values[0])}`:`Invalid option: expected one of ${ea(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.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":""}: ${ea(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});var hi={};Vt(hi,{en:()=>Wa});var Pp=ee(()=>{zp()});function Qa(){return new Ga}var av,Cp,Ep,Ga,Re,_i=ee(()=>{Cp=Symbol("ZodOutput"),Ep=Symbol("ZodInput"),Ga=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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(av=globalThis).__zod_globalRegistry??(av.__zod_globalRegistry=Qa());Re=globalThis.__zod_globalRegistry});function U1(e,t){try{return Xa(e,{assertOnly:!0})}catch{return t}}function Op(e,t){try{let r=Xa(e),n=Ya(e,r);return n._zod.bag.validator=U1(e,r),n}catch(r){if(t?.strict)throw r;return e}}function Ya(e,t){if(Ka(e))throw new J("a schema whose subtree contains a reference cycle");let r=oe(e),n=e._zod.run,o=n.__originalRun??n,i=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[cv]||a&&Ja(a,s.value))return o(s,a);let c=t(s.value);return c!==Je?(s.value=c,s):(a&&(a[cv]=!0),o(s,a))};return i.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=i,n.__originalRun||F1(r,e,t),r}function F1(e,t,r){let n=e,o=t;if(typeof o.safeParse=="function"){let i=o.safeParse;n.safeParse=(s,a)=>{let c=r(s);return c!==Je?{success:!0,data:c}:i(s,a)}}if(typeof o.parse=="function"){let i=o.parse;n.parse=(s,a)=>{let c=r(s);return c!==Je?c:i(s,a)}}}function Xa(e,t){let r=!0;try{r=Ka(e)}catch{}if(r)throw new J("a schema whose subtree contains a reference cycle");let n={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Lr(["input"]),i=ye(o,n,e,"input",!t?.assertOnly);o.write(i===null?"return true;":`return ${i};`);let s=["INVALID",...n.constants.keys()],a=[Je,...n.constants.values()],c=o.content.join(`
71
+ `),u=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
72
+ ${c}`:c:"",l=Function,f=`return (input) => {
73
+ ${c}
74
+ }`,d;try{d=new l(...s,f)(...a)}catch(p){throw new J(`this schema (generated code failed to evaluate: ${p.message})`)}return t?.debug&&(d.code=u),d.definite=n.definite,d}function M(e,t){for(let[n,o]of e.constants)if(o===t)return n;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function Fr(e,t){return e.definite=!1,M(e,t)}function j(e){return`v${e.varCounter++}`}function V1(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return Je;let n=r;return n.issues.length===0?n.value:Je}function qe(e,t,r,n,o=!0){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return ye(e,t,r,n,o)}catch(u){if(!(u instanceof J)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let f of l)t.constants.delete(f)}return t.constantCounter=a,t.varCounter=c,H1(e,t,r,n)}}function H1(e,t,r,n){t.definite=!1;let o=M(t,r),i=M(t,V1),s=j(t);return e.write(`const ${s} = ${i}(${o}, ${n});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function K1(e,t,r,n){let o=r._zod.def.checks;if(!o||o.length===0)return n;let i=n;for(let s of o){let a=s._zod.def;if(a.when&&!B1.has(a.check))throw new J('check with a custom "when" condition');switch(a.check){case"greater_than":J1(e,t,a,i);break;case"less_than":W1(e,t,a,i);break;case"multiple_of":G1(e,t,a,i);break;case"number_format":mv(e,a,i);break;case"min_length":{let c=ur(a.minimum,"min_length"),u=Ip(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=ur(a.maximum,"max_length"),u=Ip(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=ur(a.length,"length_equals"),u=Ip(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${ur(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${ur(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${ur(a.size,"size_equals")}) return INVALID;`);break;case"string_format":i=hv(e,t,a,i);break;case"custom":i=rP(e,t,s,i);break;case"bigint_format":Q1(e,a,i);break;case"mime_type":Y1(e,t,a,i);break;case"property":eP(e,t,a,i);break;case"properties":X1(e,t,a,i);break;case"overwrite":{let c=j(t);tP(e,t,s,i,c),i=c;break}default:throw new J(`check type ${a.check}`)}}return i}function Ip(e,t,r,n){let o=M(t,Dr),i=j(t);return e.write(`const ${i} = typeof ${r} === "string" && ${n} ? ${o}(${r}) : ${r}.length;`),i}function ur(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new J(`${t} bound of type ${typeof e}`);return`${e}`}function pv(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new J("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new J("comparison check with Invalid Date bound");return M(e,t)}throw new J(`comparison check bound of type ${typeof t}`)}function J1(e,t,r,n){let o=r.inclusive?"<":"<=";e.write(`if (${n} ${o} ${pv(t,r.value)}) return INVALID;`)}function W1(e,t,r,n){let o=r.inclusive?">":">=";e.write(`if (${n} ${o} ${pv(t,r.value)}) return INVALID;`)}function G1(e,t,r,n){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new J("multiple_of check with a zero divisor");e.write(`if (${n} % ${r.value}n !== 0n) return INVALID;`)}else{let o=M(t,Zo);e.write(`if (${o}(${n}, ${ur(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function mv(e,t,r){let n=t.format;switch(n){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new J(`number format ${n}`)}}function Q1(e,t,r){let n=t.format;if(n)switch(n){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new J(`bigint format ${n}`)}}function Y1(e,t,r,n){let o=r.mime;if(o&&o.length>0){let i=M(t,new Set(o));e.write(`if (!${i}.has(${n}.type)) return INVALID;`)}}function X1(e,t,r,n){if(r.when)throw new J('check with a custom "when" condition');e.write(`if (${n} == null) return INVALID;`);let o=r.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?M(t,i):Be(i),a=j(t);e.write(`const ${a} = ${n}[${s}];`),qe(e,t,o[i],a,!1)}}function eP(e,t,r,n){let o=`${n}[${JSON.stringify(r.property)}]`;ye(e,t,r.schema,o)}function tP(e,t,r,n,o){let i=r._zod.def.tx;if(!i)throw new J("overwrite check without a transform function");if(Vr(i))throw new St("z.compile: async overwrite transforms are not supported");let s=M(t,i);e.write(`const ${o} = ${s}(${n});`)}function Tp(){throw new tt}function Ap(e){this.issues.push(e)}function rP(e,t,r,n){let o=r._zod.def;if(o.fn){if(Vr(o.fn))throw new St("z.compile: async .refine() predicates are not supported");let i=Fr(t,o.fn),s=M(t,Tp),a=j(t);return e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),n}if(r._zod.check){if(Vr(r._zod.check))throw new St("z.compile: async .superRefine() / check functions are not supported");let i=r._zod.check,a=Fr(t,u=>{let l={value:u,issues:[],addIssue:Ap};return i(l)instanceof Promise&&Tp(),l.issues.length===0?l.value:Je}),c=j(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new J("custom check without a predicate or check function")}function hv(e,t,r,n,o=!0){let i=r.format;if(i==="base64"){let u=M(t,si);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="base64url"){let u=M(t,Aa);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="jwt"){let u=M(t,Da),l=M(t,r.alg??null);return e.write(`if (!${u}(${n}, ${l})) return INVALID;`),n}if(i==="ipv6"){let u=M(t,ii);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="cidrv6"){let u=M(t,Ra);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="credit_card"){let u=M(t,Na);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(i==="iban"){let u=M(t,ja);return e.write(`if (!${u}(${n})) return INVALID;`),n}let s=r;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=M(t,Ea),l=M(t,r),f=j(t),d=j(t);if(e.write(`const ${f} = ${n}.trim();`),e.write(`const ${d} = ${u}(${f}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),s.hostname!==void 0){let h=M(t,Ia);e.write(`if (!${h}(${d}, ${l}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let h=M(t,Ta);e.write(`if (!${h}(${d}, ${l}.protocol)) return INVALID;`)}if(!o)return null;let p=j(t),m=s.normalize?`${d}.href`:`${M(t,oi)}(${f})`;return e.write(`const ${p} = ${m};`),p}let a=r.fn;if(a){if(Vr(a))throw new J(`async string format ${i}`);let u=M(t,a);return e.write(`if (!${u}(${n})) return INVALID;`),n}if(nP.has(i)&&r.pattern){let u=M(t,r.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${n})) return INVALID;`),n}let c=r.format;switch(c){case"regex":throw new J("regex format without a pattern");case"lowercase":e.write(`if (${n} !== ${n}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${n} !== ${n}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${n}.includes(${Be(r.includes)})) return INVALID;`);break;case"starts_with":{let u=r.prefix;e.write(`if (${n}.slice(0, ${u.length}) !== ${Be(u)}) return INVALID;`);break}case"ends_with":{let u=r.suffix;e.write(`if (${n}.slice(-${u.length}) !== ${Be(u)}) return INVALID;`);break}default:throw new J(`string format ${c}`)}return n}function ye(e,t,r,n,o=!0){let i=r._zod.def,s=i.type;if(i.coerce)throw new J(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case"string":c=oP(e,t,r,n,a);break;case"number":c=iP(e,r,n);break;case"boolean":c=sP(e,n);break;case"bigint":c=aP(e,r,n);break;case"symbol":c=cP(e,n);break;case"undefined":c=uP(e,n);break;case"null":c=lP(e,n);break;case"any":case"unknown":c=n;break;case"never":e.write("return INVALID;"),c=n;break;case"void":c=dP(e,n);break;case"nan":c=fP(e,n);break;case"date":c=pP(e,n);break;case"object":c=mP(e,t,r,n,a);break;case"optional":c=hP(e,t,r,n,a);break;case"nullable":c=yP(e,t,r,n,a);break;case"array":c=bP(e,t,r,n,a);break;case"literal":c=vP(e,t,r,n);break;case"enum":c=wP(e,t,r,n);break;case"readonly":{let u=lv(e,t,r,n),l=j(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case"success":lv(e,t,r,n),c="true";break;case"default":case"prefault":c=$P(e,t,r,n);break;case"nonoptional":c=xP(e,t,r,n);break;case"tuple":c=kP(e,t,r,n);break;case"union":c=SP(e,t,r,n);break;case"intersection":c=CP(e,t,r,n);break;case"record":c=EP(e,t,r,n);break;case"map":c=TP(e,t,r,n);break;case"set":c=RP(e,t,r,n);break;case"file":c=OP(e,n);break;case"template_literal":c=AP(e,t,r,n);break;case"lazy":c=NP(e,t,r,n);break;case"pipe":c=jP(e,t,r,n);break;case"custom":c=DP(e,t,r,n);break;case"transform":c=LP(e,t,r,n);break;case"catch":c=ZP(e,t,r,n);break;default:throw new J(`schema type ${s}`)}return c===null?null:K1(e,t,r,c)}function oP(e,t,r,n,o=!0){e.write(`if (typeof ${n} !== "string") return INVALID;`);let i=r._zod.def;return i.format===void 0?n:hv(e,t,i,n,o)}function iP(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let n=t._zod.def;return n.check==="number_format"&&n.format&&mv(e,{format:n.format},r),r}function sP(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function aP(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let n=t._zod.def;if(n.format)switch(n.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function cP(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function uP(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function lP(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function dP(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function fP(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function pP(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function mP(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (typeof ${n} !== "object" || ${n} === null || Array.isArray(${n})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=v=>typeof v=="symbol"?M(t,v):Be(v),f=v=>typeof v=="symbol"?`[${l(v)}]`:Be(v),d=s;if(a.includes("__proto__"))throw new J('object shape key "__proto__"');let p=new Map;for(let v of u){let x=d[v],C=l(v),$=j(t);if(e.write(`const ${$} = ${n}[${C}];`),x._zod.optin!==void 0){let k=j(t);e.write(`let ${k} = (() => {`),e.indented(R=>{let X=qe(R,t,x,$);R.write(`return ${X};`)}),e.write("})();"),x._zod.optout==="optional"?(e.write(`if (${k} === INVALID) {`),e.indented(R=>{R.write(`if (${C} in ${n}) return INVALID;`),R.write(`${k} = undefined;`)}),e.write("}")):e.write(`if (${k} === INVALID) return INVALID;`),p.set(v,k)}else{gP(x)&&e.write(`if (!(${C} in ${n})) return INVALID;`);let k=qe(e,t,x,$,o);k!==null&&p.set(v,k)}}let m=i.catchall,h="none";if(m){let v=m._zod.def.type;if(v==="never"){let x=a.map(C=>`k !== ${Be(C)}`).join(" && ")||"true";e.write(`for (const k in ${n}) {`),e.indented(C=>{C.write(`if (${x}) return INVALID;`)}),e.write("}")}else(v==="unknown"||v==="any")&&!m._zod.def.checks?.length?h="passthrough":h="schema"}let g=j(t),w=u.some(v=>uv(d[v])||Rp(d[v]));if(!o){if(h==="schema"){let v=a.length>0?M(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(x=>{x.write('if (k === "__proto__") continue;'),v&&x.write(`if (${v}.has(k)) continue;`);let C=j(t);x.write(`const ${C} = ${n}[k];`),qe(x,t,m,C,!1)}),e.write("}")}return null}if(w){e.write(`const ${g} = {};`);for(let v of u){let x=l(v),C=p.get(v);Rp(d[v])?e.write(`if (${x} in ${n}) ${g}[${x}] = ${C};`):uv(d[v])?e.write(`if (${C} !== undefined || ${x} in ${n}) ${g}[${x}] = ${C};`):e.write(`${g}[${x}] = ${C};`)}}else{let v=u.map(x=>`${f(x)}: ${p.get(x)}`).join(", ");e.write(`const ${g} = { ${v} };`)}if(h!=="none"){let v=a.length>0?M(t,new Set(a)):null;e.write(`for (const k in ${n}) {`),e.indented(x=>{if(x.write('if (k === "__proto__") continue;'),v&&x.write(`if (${v}.has(k)) continue;`),h==="passthrough")x.write(`${g}[k] = ${n}[k];`);else{let C=j(t);x.write(`const ${C} = ${n}[k];`);let $=qe(x,t,m,C);x.write(`${g}[k] = ${$};`)}}),e.write("}")}return g}function hP(e,t,r,n,o=!0){let i=r._zod.def;if(_P(r))return ye(e,t,i.innerType,n,o);if(i.innerType._zod.optin==="defaulted"){let a=j(t),c=j(t);return e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let f=ye(l,t,i.innerType,n);l.write(`return ${f};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(u=>{let l=ye(u,t,i.innerType,n);u.write(`${a} = ${l};`)}),e.write("}"),a}let s=o?j(t):null;return s&&e.write(`let ${s};`),e.write(`if (${n} !== undefined) {`),e.indented(a=>{let c=ye(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function _P(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function gP(e){return e._zod.optin===void 0&&Ur(e)}function Ur(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Ur(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Ur(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Ur):!0;case"intersection":return!t.left||!t.right?!0:Ur(t.left)&&Ur(t.right);case"pipe":return t.in?Ur(t.in):!0;default:return!0}}function Rp(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function uv(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Ln(e)}function Ln(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?Ln(t.innerType):!0;case"union":return t.options?t.options.some(Ln):!0;case"intersection":return!t.left||!t.right||Ln(t.left)||Ln(t.right);case"pipe":return t.out?Ln(t.out):!0;default:return!0}}function yP(e,t,r,n,o=!0){let i=r._zod.def,s=o?j(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${n} !== null) {`),e.indented(a=>{let c=ye(a,t,i.innerType,n,o);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Np(e,t,r){for(let[n,o]of Cn(t._zod.def.checks))e.write(`if (${r} > ${ur(n,o._zod.def.check)}) return INVALID;`)}function bP(e,t,r,n,o=!0){let i=r._zod.def;e.write(`if (!Array.isArray(${n})) return INVALID;`),Np(e,r,`${n}.length`);let s=o?j(t):null,a=j(t),c=j(t);return s&&e.write(`const ${s} = new Array(${n}.length);`),e.write(`for (let ${a} = 0; ${a} < ${n}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${n}[${a}];`);let l=qe(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`)}),e.write("}"),s}function vP(e,t,r,n){let i=r._zod.def.values;if(i.length!==1){let a=M(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=M(t,new Set(i));return e.write(`if (!${a}.has(${n})) return INVALID;`),n}if(typeof s=="string")e.write(`if (${n} !== ${Be(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${n} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${n} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${n} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${n} !== ${s}n) return INVALID;`);else throw new J(`literal type ${typeof s}`);return n}function wP(e,t,r,n){let o=r._zod.values;if(!o)throw new J("enum schema without enumerated values");let i=M(t,o);return e.write(`if (!${i}.has(${n})) return INVALID;`),n}function lv(e,t,r,n){let o=r._zod.def;return ye(e,t,o.innerType,n)}function $P(e,t,r,n){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return ye(e,t,o.innerType,n);let c=M(t,s),u=j(t);return e.write(`let ${u} = ${n};`),e.write(`if (${n} === undefined) ${u} = ${c}();`),ye(e,t,o.innerType,u)}let a=j(t);if(s){let c=M(t,s),u=M(t,Lo);e.write(`let ${a};`),e.write(`if (${n} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`)}),e.write("} else {"),e.indented(l=>{let f=ye(l,t,o.innerType,n);l.write(`${a} = ${f} === undefined ? ${u}(${c}()) : ${f};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${n} !== undefined) {`),e.indented(c=>{let u=ye(c,t,o.innerType,n);c.write(`${a} = ${u};`)}),e.write("}");return a}function xP(e,t,r,n){let o=r._zod.def,i=ye(e,t,o.innerType,n),s=j(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function kP(e,t,r,n){let o=r._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${n})) return INVALID;`);let a=dv(i,"optin"),c=dv(i,"optout");s?e.write(`if (${n}.length < ${a}) return INVALID;`):e.write(`if (${n}.length < ${a} || ${n}.length > ${i.length}) return INVALID;`);let u=j(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let f=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(d=>{d.write(`if (${l} < ${n}.length) {`),d.indented(p=>{let m=j(t);p.write(`const ${m} = ${n}[${l}];`);let h=qe(p,t,f,m);p.write(`${u}[${l}] = ${h};`)}),d.write("} else {"),d.indented(p=>{if(Rp(f)){p.write(`${u}.length = ${l};`);return}let m=j(t),h=j(t);p.write(`const ${m} = undefined;`),p.write(`const ${h} = (() => {`),p.indented(g=>{let w=qe(g,t,f,m);g.write(`return ${w};`)}),p.write("})();"),p.write(`if (${h} === INVALID || ${h} === undefined) ${u}.length = ${l};`),p.write(`else ${u}[${l}] = ${h};`)}),d.write("}")}),e.write("}");else{let d=j(t);e.write(`const ${d} = ${n}[${l}];`);let p=qe(e,t,f,d);e.write(`${u}[${l}] = ${p};`)}}if(s){let l=j(t),f=j(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${n}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${f} = ${n}[${l}];`);let p=qe(d,t,s,f);d.write(`${u}[${l}] = ${p};`)}),e.write("}")}return u}function dv(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function SP(e,t,r,n){let o=r._zod.def,i=o.options;if(o.discriminator)return zP(e,t,o,n);if(o.inclusive===!1)throw new J("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),n;if(i.length===1)return ye(e,t,i[0],n);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=M(t,c);return e.write(`if (!${u}.has(${n})) return INVALID;`),n}let a=j(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let f=ye(l,t,u,n);l.write(`return ${f};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function zP(e,t,r,n){if(r.unionFallback)throw new J("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),n;let o=j(t),i=j(t);e.write(`const ${o} = ${n}?.[${Be(r.discriminator)}];`),e.write(`let ${i};`);let s=!0,a=new Set;for(let c of r.options){let u=c._zod.propValues?.[r.discriminator];if(!u||u.size===0)throw new J("discriminated union option without static discriminator values");for(let d of u){if(a.has(d))throw new J(`duplicate discriminator value ${String(d)}`);a.add(d)}let l=Array.from(u,d=>PP(t,o,d)),f=s?"if":"else if";e.write(`${f} (${l.join(" || ")}) {`),e.indented(d=>{let p=ye(d,t,c,n);d.write(`${i} = ${p};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),i}function PP(e,t,r){if(typeof r=="string")return`${t} === ${Be(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let n=M(e,r);return`${t} === ${n}`}throw new J(`literal discriminator value ${String(r)}`)}function CP(e,t,r,n){let o=r._zod.def;t.definite=!1;let i=qe(e,t,o.left,n),s=qe(e,t,o.right,n),a=M(t,Dn),c=j(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function EP(e,t,r,n){let o=r._zod.def,i=M(t,mt);e.write(`if (!${i}(${n})) return INVALID;`);let s=j(t),a=j(t),c=j(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let p=[];for(let h of l){if(!(typeof h=="string"||typeof h=="number"||typeof h=="symbol"))throw new J(`record key value ${String(h)}`);let g=typeof h=="number"?h.toString():h;if(g==="__proto__")throw new J('record key "__proto__"');p.push(g);let w=M(t,h),v=ye(e,t,o.keyType,w),x=j(t);e.write(`const ${x} = ${n}[${IP(t,g)}];`);let C=qe(e,t,o.valueType,x);e.write(`${s}[${v}] = ${C};`)}let m=M(t,new Set(p));return e.write(`for (const ${a} in ${n}) {`),e.indented(h=>{h.write(`if (${m}.has(${a})) continue;`),u.mode==="loose"?h.write(`if (${a} !== "__proto__") ${s}[${a}] = ${n}[${a}];`):h.write("return INVALID;")}),e.write("}"),s}let f=o.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let p=o.mode==="loose",m=Xa(o.keyType);m.definite===!1&&(t.definite=!1);let h=M(t,m),g=M(t,Kt),w=j(t);return fv(e,t,n,a,v=>{v.write(`let ${w} = ${h}(${a});`),v.write(`if (${w} === INVALID && typeof ${a} === "string" && ${g}.test(${a})) ${w} = ${h}(Number(${a}));`),p?v.write(`if (${w} === INVALID) { ${s}[${a}] = ${n}[${a}]; continue; }`):v.write(`if (${w} === INVALID) return INVALID;`),v.write(`if (${w} === "__proto__") continue;`);let x=j(t);v.write(`const ${x} = ${n}[${a}];`);let C=qe(v,t,o.valueType,x);v.write(`${s}[${w}] = ${C};`)}),s}return fv(e,t,n,a,p=>{p.write(`const ${c} = ${n}[${a}];`);let m=qe(p,t,o.valueType,c);p.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function fv(e,t,r,n,o,i){let s=M(t,Object.prototype.propertyIsEnumerable),a=j(t),c=j(t),u=j(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${c} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${c}[${u}];`),l.write(`if (${n} === "__proto__" || !${s}.call(${r}, ${n})) continue;`),o(l)}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${n} = ${a}[${u}];`),l.write(`if (!${s}.call(${r}, ${n})) continue;`),i?l.write(i):o(l)}),e.write("}")}function IP(e,t){return typeof t=="string"?Be(t):M(e,t)}function TP(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Map)) return INVALID;`),Np(e,r,`${n}.size`);let i=j(t),s=j(t),a=j(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${n}) {`),e.indented(c=>{let u=ye(c,t,o.keyType,s),l=ye(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`)}),e.write("}"),i}function RP(e,t,r,n){let o=r._zod.def;e.write(`if (!(${n} instanceof Set)) return INVALID;`),Np(e,r,`${n}.size`);let i=j(t),s=j(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${n}) {`),e.indented(a=>{let c=ye(a,t,o.valueType,s);a.write(`${i}.add(${c});`)}),e.write("}"),i}function OP(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function AP(e,t,r,n){e.write(`if (typeof ${n} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let i=M(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${n})) return INVALID;`)}return n}function NP(e,t,r,n){let o=r._zod.def,i=Fr(t,o.getter),s=M(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=j(t);return e.write(`const ${a} = ${s}.parser(${n});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function jP(e,t,r,n){let o=r._zod.def,i=ye(e,t,o.in,n);if(o.transform){if(Vr(o.transform))throw new St("z.compile: async transforms in pipes are not supported");let s=o.transform,c=Fr(t,l=>{let f={value:l,issues:[],addIssue:Ap},d=s(l,f);return d instanceof Promise?Je:f.issues.length===0?d:Je}),u=j(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),ye(e,t,o.out,u)}else return ye(e,t,o.out,i)}function Vr(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function DP(e,t,r,n){let o=r._zod.def;if(o.fn){if(Vr(o.fn))throw new St("z.compile: async custom predicates are not supported");let i=Fr(t,o.fn),s=M(t,Tp),a=j(t);e.write(`const ${a} = ${i}(${n});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new J("custom schema without a predicate function");return n}function MP(e,t,r){let n=e._zod.run({value:r,issues:[]},{});if(n&&typeof n.then=="function")return Je;let o=n;return o.issues.length===0?o.value:t()}function ZP(e,t,r,n){let o=r._zod.def;if(!o.catchValue[ia])throw new J("catch with a callback (only a constant catch value compiles)",!1);let i=j(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=qe(u,t,o.innerType,n);u.write(`return ${l};`)}),e.write("})();");let s=M(t,o.innerType),a=Fr(t,o.catchValue),c=M(t,MP);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${n});`),u.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}function LP(e,t,r,n){let o=r._zod.def;if(o.transform){if(Vr(o.transform))throw new St("z.compile: async transforms are not supported");let i=o.transform,a=Fr(t,u=>{let l={value:u,issues:[],addIssue:Ap},f=i(u,l);return f instanceof Promise?Je:l.issues.length===0?f:Je}),c=j(t);return e.write(`const ${c} = ${a}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return n}var Je,cv,St,J,B1,nP,_v=ee(()=>{ar();xa();Sp();Zr();Mn();ke();Je=Symbol.for("zod.compile.invalid"),cv=Symbol.for("zod.compile.fallback"),St=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},J=class extends Error{constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};B1=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);nP=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function ec(e){return e.checks&&(e.checks=[...e.checks]),e}function jp(e,t){return new e(ec({type:"string",...S(t)}))}function Dp(e,t){return new e(ec({type:"string",coerce:!0,...S(t)}))}function tc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(t)})}function rc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(t)})}function nc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(t)})}function oc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(t)})}function ic(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(t)})}function sc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(t)})}function gi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(t)})}function ac(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(t)})}function cc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(t)})}function uc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(t)})}function lc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(t)})}function dc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(t)})}function fc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(t)})}function pc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(t)})}function mc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(t)})}function hc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(t)})}function Mp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...S(t)})}function _c(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(t)})}function gc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(t)})}function yc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(t)})}function bc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(t)})}function vc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(t)})}function Zp(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...S(t)})}function Lp(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...S(t)})}function wc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(t)})}function yi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(t)})}function bi(e,t){return new e({type:"string",format:"date",check:"string_format",...S(t)})}function vi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(t)})}function wi(e,t){return new e({type:"string",format:"duration",check:"string_format",...S(t)})}function Up(e,t){return new e(ec({type:"number",checks:[],...S(t)}))}function Fp(e,t){return new e(ec({type:"number",coerce:!0,checks:[],...S(t)}))}function Vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(t)})}function Hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...S(t)})}function Bp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...S(t)})}function Kp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...S(t)})}function Jp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...S(t)})}function Wp(e,t){return new e({type:"boolean",...S(t)})}function Gp(e,t){return new e({type:"boolean",coerce:!0,...S(t)})}function Qp(e,t){return new e({type:"bigint",...S(t)})}function Yp(e,t){return new e({type:"bigint",coerce:!0,...S(t)})}function Xp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(t)})}function em(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(t)})}function tm(e,t){return new e({type:"symbol",...S(t)})}function rm(e,t){return new e({type:"undefined",...S(t)})}function nm(e,t){return new e({type:"null",...S(t)})}function om(e){return new e({type:"any"})}function im(e){return new e({type:"unknown"})}function sm(e,t){return new e({type:"never",...S(t)})}function am(e,t){return new e({type:"void",...S(t)})}function cm(e,t){return new e({type:"date",...S(t)})}function um(e,t){return new e({type:"date",coerce:!0,...S(t)})}function lm(e,t){return new e({type:"nan",...S(t)})}function At(e,t){return new va({check:"less_than",...S(t),value:e,inclusive:!1})}function lt(e,t){return new va({check:"less_than",...S(t),value:e,inclusive:!0})}function Nt(e,t){return new wa({check:"greater_than",...S(t),value:e,inclusive:!1})}function dt(e,t){return new wa({check:"greater_than",...S(t),value:e,inclusive:!0})}function $c(e){return Nt(0,e)}function xc(e){return At(0,e)}function kc(e){return lt(0,e)}function Sc(e){return dt(0,e)}function lr(e,t){return new qd({check:"multiple_of",...S(t),value:e})}function dr(e,t){return new Vd({check:"max_size",...S(t),maximum:e})}function jt(e,t){return new Hd({check:"min_size",...S(t),minimum:e})}function Hr(e,t){return new Bd({check:"size_equals",...S(t),size:e})}function Br(e,t){return new Kd({check:"max_length",...S(t),maximum:e})}function Jt(e,t){return new Jd({check:"min_length",...S(t),minimum:e})}function Kr(e,t){return new Wd({check:"length_equals",...S(t),length:e})}function qn(e,t){return new Gd({check:"string_format",format:"regex",...S(t),pattern:e})}function Un(e){return new Qd({check:"string_format",format:"lowercase",...S(e)})}function Fn(e){return new Yd({check:"string_format",format:"uppercase",...S(e)})}function Vn(e,t){return new Xd({check:"string_format",format:"includes",...S(t),includes:e})}function Hn(e,t){return new ef({check:"string_format",format:"starts_with",...S(t),prefix:e})}function Bn(e,t){return new tf({check:"string_format",format:"ends_with",...S(t),suffix:e})}function zc(e,t,r){return new rf({check:"property",property:e,schema:t,...S(r)})}function Kn(e,t){return new nf({check:"properties",shape:e,...S(t)})}function Jn(e,t){return new of({check:"mime_type",mime:e,...S(t)})}function zt(e){return new sf({check:"overwrite",tx:e})}function Wn(e){return zt(t=>t.normalize(e))}function Gn(){return zt(e=>e.trim())}function Qn(){return zt(e=>e.toLowerCase())}function Yn(){return zt(e=>e.toUpperCase())}function Xn(){return zt(e=>Ll(e))}function dm(e,t,r){return new e({type:"array",element:t,...S(r)})}function qP(e,t,r){return new e({type:"union",options:t,...S(r)})}function UP(e,t,r){return new e({type:"union",options:t,inclusive:!1,...S(r)})}function FP(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...S(n)})}function VP(e,t,r){return new e({type:"intersection",left:t,right:r})}function HP(e,t,r,n){let o=r instanceof Z,i=o?n:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...S(i)})}function BP(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...S(n)})}function KP(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...S(n)})}function JP(e,t,r){return new e({type:"set",valueType:t,...S(r)})}function WP(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:n,...S(r)})}function GP(e,t,r){return new e({type:"enum",entries:t,...S(r)})}function QP(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...S(r)})}function fm(e,t){return new e({type:"file",...S(t)})}function YP(e,t){return new e({type:"transform",transform:t})}function XP(e,t){return new e({type:"optional",innerType:t})}function eC(e,t){return new e({type:"nullable",innerType:t})}function tC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Lo(r)}})}function rC(e,t,r){return new e({type:"nonoptional",innerType:t,...S(r)})}function nC(e,t){return new e({type:"success",innerType:t})}function oC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:Kl(r)})}function iC(e,t,r){return new e({type:"pipe",in:t,out:r})}function sC(e,t){return new e({type:"readonly",innerType:t})}function aC(e,t,r){return new e({type:"template_literal",parts:t,...S(r)})}function cC(e,t){return new e({type:"lazy",getter:t})}function uC(e,t){return new e({type:"promise",innerType:t})}function pm(e,t,r){let n=S(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function mm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...S(r)})}function hm(e,t){let r=gv(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(En(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(En(i))}},e(n.value,n)),t);return r}function gv(e,t){let r=new fe({check:"custom",...S(t)});return r._zod.check=e,r}function _m(e){let t=new fe({check:"describe"});return t._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function gm(e){let t=new fe({check:"meta"});return t._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,...e})}],t._zod.check=()=>{},t}function ym(e,t){let r=S(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),o=o.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(n),s=new Set(o),a=e.Codec??li,c=e.Boolean??ci,u=e.String??qr,l=new u({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:l,out:f,transform:((p,m)=>{let h=p;return r.case!=="sensitive"&&(h=h.toLowerCase()),i.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:m.value,inst:d,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?n[0]||"true":o[0]||"false"),error:r.error});return d._zod.bag.truthy=n,d._zod.bag.falsy=o,d._zod.bag.case=r.case??"insensitive",d}function Jr(e,t,r,n={}){let o=S(n),i={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...o};return r instanceof RegExp&&(i.pattern=r),new e(i)}var qp,yv=ee(()=>{$a();_i();Mn();ke();qp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function $i(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Te(e,n,r[n]);return e}function fr(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??Re,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Pe(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function se(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let d=s.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,d,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),se(f,t,l),t.seen.get(f).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&$i(s.schema,c),t.io==="input"&&We(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function bv(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??(m=>m);if(f)return{ref:d(f)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${d("__shared")}#/${a}/${bv(p)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===r&&!s[1].schema.id)return{ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+bv(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let f in l)delete l[f];l.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
75
+
76
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function $v(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;$v(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}function wv(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function bm(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!xv.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??wv(u);l!=null&&(a.some(f=>JSON.stringify(f)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:bm(a)??{allOf:a};Te(r,s,c)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=wv(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function lC(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of xv)if(o in e)return;let r=t.filter(o=>vv.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=bm(t);else{let o=r[0],i=vv.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>bm([...s,c]));if(a.some(c=>!c))return;n={[i]:a}}n&&(delete e.allOf,$i(e,n))}function mr(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},f=c.ref;if(c.ref=null,f){n(f);let p=e.seen.get(f),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):$i(u,m),$i(u,l),a._zod.parent===f)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(m.$ref&&p.def)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let d=a._zod.parent;if(d&&d!==f){n(d);let p=e.seen.get(d);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())n(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())$v(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let f=a.get(l);f?f.push(u):a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])lC(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}$i(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Te(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:eo(t,"input",e.processors),output:eo(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function We(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 We(n.element,r);if(n.type==="set")return We(n.valueType,r);if(n.type==="lazy")return We(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"||n.type==="catch")return We(n.innerType,r);if(n.type==="intersection")return We(n.left,r)||We(n.right,r);if(n.type==="record"||n.type==="map")return We(n.keyType,r)||We(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:We(n.in,r)||We(n.out,r);if(n.type==="object"){for(let o in n.shape)if(We(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(We(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(We(o,r))return!0;return!!(n.rest&&We(n.rest,r))}return!1}var xv,vv,vm,eo,xi=ee(()=>{_i();ke();xv=new Set(["type","properties","required","additionalProperties"]),vv=["oneOf","anyOf"];vm=(e,t={})=>r=>{let n=fr({...r,processors:t});return se(e,n),pr(n,e),mr(n,e)},eo=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},s=fr({...o??{},target:i,io:t,processors:r});return se(e,s),pr(s,e),mr(s,e)}});function Ce(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)dC[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&to(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&to(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ro(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ro(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Cv(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Iv(t,o.mime);for(let i of o.patterns??[])Ev(t,i);return t}function ki(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ki(t.out):t.type==="catch"?ki(t.innerType):e._zod.optin}function wm(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let m=e.get(t)?.def;if(!m)return t;let h=wm(e,m,r);return h===m?t:h}for(let m of["anyOf","oneOf"]){let h=t[m];if(!Array.isArray(h))continue;let g=h.map(w=>wm(e,w,r));g.some((w,v)=>w!==h[v])&&(t={...t,[m]:g})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:f,id:d,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(n.includes("number")?Kt:ei).source)),p}function mC(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of $m.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let s=wm(t,i,new Set);s!==i&&r.set(i,s)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}function Ov(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(Pe(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Xm):JSON.parse(s)}function Ic(e,t){if("_idmap"in e){let n=e,o=fr({...t,processors:Pc}),i={};for(let c of n._idmap.entries()){let[u,l]=c;se(l,o)}let s={},a={registry:n,uri:t?.uri,defs:i};o.external=a;for(let c of n._idmap.entries()){let[u,l]=c;pr(o,l),Te(s,u,mr(o,l))}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let r=fr({...t,processors:Pc});return se(e,r),pr(r,e),mr(r,e)}var to,ro,kv,Cv,Ev,Iv,Tv,Sv,zv,Pv,dC,fC,pC,Rv,xm,km,Sm,zm,Pm,Cm,Em,Im,Tm,Rm,Om,Am,Nm,jm,Dm,Mm,Zm,Lm,qm,Um,Fm,Vm,Hm,Bm,Km,Cc,Jm,Wm,$m,Gm,Qm,Ym,Xm,eh,th,rh,nh,oh,ih,Ec,sh,Pc,Si=ee(()=>{Zr();Mn();xi();ke();to=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},ro=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},kv=(e,t)=>{to(e,"minimum",t),ro(e,"maximum",t)},Cv=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Ev=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Iv=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Tv=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},Sv=(e,t)=>to(e,"minimum",t.minimum),zv=(e,t)=>ro(e,"maximum",t.maximum),Pv=e=>(t,r)=>{Tv(t,r.format);let[n,o]=e[r.format];to(t,"minimum",n),ro(t,"maximum",o)},dC={greater_than:(e,t)=>to(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ro(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Cv(e,t.value),number_format:Pv(Uo),bigint_format:Pv(Fo),min_length:Sv,max_length:zv,length_equals:(e,t)=>kv(e,t.length),min_size:Sv,max_size:zv,size_equals:(e,t)=>kv(e,t.size),string_format:(e,t)=>{Tv(e,t.format),t.pattern&&Ev(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Iv(e,t.mime)};fC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pC=new Map([[Oa,wd],[ai,$d]]),Rv=e=>pC.get(e)??e,xm=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Ce(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=fC[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let f=[...c].map(Rv);f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},km=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Ce(e);o.type=l?"integer":"number";let f=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),d=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(f?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),d?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let m=new Set;for(let w of a)Number.isFinite(w)&&w!==0?m.add(Math.abs(w)):Pe(e,t,o,n,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[h,...g]=m;h!==void 0&&(o.multipleOf=h),g.length&&(o.allOf=[...o.allOf??[],...g.map(w=>({multipleOf:w}))])}},Sm=(e,t,r,n)=>{r.type="boolean"},zm=(e,t,r,n)=>{Pe(e,t,r,n,"BigInt cannot be represented in JSON Schema")},Pm=(e,t,r,n)=>{Pe(e,t,r,n,"Symbols cannot be represented in JSON Schema")},Cm=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Em=(e,t,r,n)=>{Pe(e,t,r,n,"Undefined cannot be represented in JSON Schema")},Im=(e,t,r,n)=>{Pe(e,t,r,n,"Void cannot be represented in JSON Schema")},Tm=(e,t,r,n)=>{r.not={}},Rm=(e,t,r,n)=>{},Om=(e,t,r,n)=>{},Am=(e,t,r,n)=>{Pe(e,t,r,n,"Date cannot be represented in JSON Schema")},Nm=(e,t,r,n)=>{let o=e._zod.def,i=kn(o.entries);if(i.length===0){r.not={};return}i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},jm=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Pe(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Pe(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},Dm=(e,t,r,n)=>{Pe(e,t,r,n,"NaN cannot be represented in JSON Schema")},Mm=(e,t,r,n)=>{let o=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},Zm=(e,t,r,n)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Ce(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})))},Lm=(e,t,r,n)=>{r.type="boolean"},qm=(e,t,r,n)=>{Pe(e,t,r,n,"Custom types cannot be represented in JSON Schema")},Um=(e,t,r,n)=>{Pe(e,t,r,n,"Function types cannot be represented in JSON Schema")},Fm=(e,t,r,n)=>{Pe(e,t,r,n,"Transforms cannot be represented in JSON Schema")},Vm=(e,t,r,n)=>{Pe(e,t,r,n,"Map cannot be represented in JSON Schema")},Hm=(e,t,r,n)=>{Pe(e,t,r,n,"Set cannot be represented in JSON Schema")},Bm=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:a}=Ce(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=se(i.element,t,{...n,path:[...n.path,"items"]})};Km=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Pe(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)Te(o.properties,u,se(s[u],t,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?ki(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=se(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Cc=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>se(a,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=s:r.anyOf=s},Jm=(e,t,r,n)=>{let o=e._zod.def,i=se(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=se(o.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c,t.intersections.push(c)},Wm=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((h,g)=>se(h,t,{...n,path:[...n.path,s,g]})),u=i.rest?se(i.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let h=i.items[l-1];if(!(t.io==="input"?ki(h)!==void 0:h._zod.optout==="optional"))break;l--}let f=i.items.length,d=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,d?o.items=!1:u&&(o.items=u),l>0&&(o.minItems=l),d&&(o.maxItems=f)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),d&&(o.maxItems=f)):(o.items=c,d?o.additionalItems=!1:u&&(o.additionalItems=u),l>0&&(o.minItems=l),d&&(o.maxItems=f));let{minimum:p,maximum:m}=Ce(e);typeof p=="number"&&(o.minItems=p),typeof m=="number"&&(o.maxItems=m)};$m=new WeakMap;Gm=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let s=i.keyType,a=Ce(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=se(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let f of a)Te(o.patternProperties,Rv(f).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=se(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let l=$m.get(t);l||(l=[],$m.set(t,l),t.deferred.push(()=>mC(t))),l.push(e)}o.additionalProperties=se(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let c=s._zod.values,u=t.io==="input"&&ki(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l.map(String))}},Qm=(e,t,r,n)=>{let o=e._zod.def,i=se(o.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Ym=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Xm=Symbol();eh=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=Ov(o.defaultValue,e,t,r,n);s!==Xm&&(r.default=s)},th=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Ov(o.defaultValue,e,t,r,n);s!==Xm&&(r._prefault=s)},rh=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{Pe(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},nh=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;se(s,t,n);let a=t.seen.get(e);a.ref=s},oh=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},ih=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Ec=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},sh=(e,t,r,n)=>{let o=e._zod.innerType;se(o,t,n);let i=t.seen.get(e);i.ref=o},Pc={string:xm,number:km,boolean:Sm,bigint:zm,symbol:Pm,null:Cm,undefined:Em,void:Im,never:Tm,any:Rm,unknown:Om,date:Am,enum:Nm,literal:jm,nan:Dm,template_literal:Mm,file:Zm,success:Lm,custom:qm,function:Um,transform:Fm,map:Vm,set:Hm,array:Bm,object:Km,union:Cc,intersection:Jm,tuple:Wm,record:Gm,nullable:Qm,nonoptional:Ym,default:eh,prefault:th,catch:rh,pipe:nh,readonly:oh,promise:ih,optional:Ec,lazy:sh}});var Tc,Av=ee(()=>{Si();xi();Tc=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=fr({processors:Pc,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return se(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pr(this.ctx,t);let n=mr(this.ctx,t),{"~standard":o,...i}=n;return i}}});var Nv={};var jv=ee(()=>{});var Wt={};Vt(Wt,{$ZodAny:()=>Vf,$ZodArray:()=>Gf,$ZodAsyncError:()=>tt,$ZodBase64:()=>Rf,$ZodBase64URL:()=>Of,$ZodBigInt:()=>Za,$ZodBigIntFormat:()=>Lf,$ZodBoolean:()=>ci,$ZodCIDRv4:()=>If,$ZodCIDRv6:()=>Tf,$ZodCUID:()=>yf,$ZodCUID2:()=>bf,$ZodCatch:()=>hp,$ZodCheck:()=>fe,$ZodCheckBigIntFormat:()=>Fd,$ZodCheckEndsWith:()=>tf,$ZodCheckGreaterThan:()=>wa,$ZodCheckIncludes:()=>Xd,$ZodCheckLengthEquals:()=>Wd,$ZodCheckLessThan:()=>va,$ZodCheckLowerCase:()=>Qd,$ZodCheckMaxLength:()=>Kd,$ZodCheckMaxSize:()=>Vd,$ZodCheckMimeType:()=>of,$ZodCheckMinLength:()=>Jd,$ZodCheckMinSize:()=>Hd,$ZodCheckMultipleOf:()=>qd,$ZodCheckNumberFormat:()=>Ud,$ZodCheckOverwrite:()=>sf,$ZodCheckProperties:()=>nf,$ZodCheckProperty:()=>rf,$ZodCheckRegex:()=>Gd,$ZodCheckSizeEquals:()=>Bd,$ZodCheckStartsWith:()=>ef,$ZodCheckStringFormat:()=>jn,$ZodCheckUpperCase:()=>Yd,$ZodCodec:()=>li,$ZodCreditCard:()=>Nf,$ZodCustom:()=>$p,$ZodCustomStringFormat:()=>Mf,$ZodCyclicError:()=>Ba,$ZodDate:()=>Jf,$ZodDefault:()=>dp,$ZodDiscriminatedUnion:()=>ep,$ZodE164:()=>Af,$ZodEmail:()=>ff,$ZodEmoji:()=>_f,$ZodEncodeError:()=>cr,$ZodEnum:()=>ip,$ZodError:()=>Yl,$ZodExactOptional:()=>up,$ZodFile:()=>ap,$ZodFunction:()=>vp,$ZodGUID:()=>lf,$ZodIBAN:()=>jf,$ZodIPv4:()=>Pf,$ZodIPv6:()=>Cf,$ZodISODate:()=>kf,$ZodISODateTime:()=>xf,$ZodISODuration:()=>zf,$ZodISOTime:()=>Sf,$ZodIntersection:()=>tp,$ZodJWT:()=>Df,$ZodKSUID:()=>$f,$ZodLazy:()=>di,$ZodLiteral:()=>sp,$ZodMAC:()=>Ef,$ZodMap:()=>np,$ZodNaN:()=>_p,$ZodNanoID:()=>gf,$ZodNever:()=>Bf,$ZodNonOptional:()=>pp,$ZodNull:()=>Ff,$ZodNullable:()=>lp,$ZodNumber:()=>Ma,$ZodNumberFormat:()=>Zf,$ZodObject:()=>tv,$ZodObjectJIT:()=>Qf,$ZodOptional:()=>qa,$ZodPipe:()=>Ua,$ZodPrefault:()=>fp,$ZodPreprocess:()=>gp,$ZodPromise:()=>wp,$ZodReadonly:()=>yp,$ZodRealError:()=>rt,$ZodRecord:()=>rp,$ZodRegistry:()=>Ga,$ZodSet:()=>op,$ZodString:()=>qr,$ZodStringFormat:()=>ie,$ZodSuccess:()=>mp,$ZodSymbol:()=>qf,$ZodTemplateLiteral:()=>bp,$ZodTransform:()=>cp,$ZodTuple:()=>La,$ZodType:()=>Z,$ZodULID:()=>vf,$ZodURL:()=>hf,$ZodUUID:()=>df,$ZodUndefined:()=>Uf,$ZodUnion:()=>ui,$ZodUnknown:()=>Hf,$ZodVoid:()=>Kf,$ZodXID:()=>wf,$ZodXor:()=>Yf,$brand:()=>Wl,$constructor:()=>b,$input:()=>Ep,$output:()=>Cp,Doc:()=>Lr,INVALID:()=>Je,JSONSchema:()=>Nv,JSONSchemaGenerator:()=>Tc,NEVER:()=>Jo,TimePrecision:()=>qp,URL_BAD_FORMAT:()=>pf,URL_UNPARSEABLE:()=>ni,ZodCompileAsyncError:()=>St,ZodCompileUnsupportedError:()=>J,_any:()=>om,_array:()=>dm,_base64:()=>yc,_base64url:()=>bc,_bigint:()=>Qp,_boolean:()=>Wp,_catch:()=>oC,_check:()=>gv,_cidrv4:()=>_c,_cidrv6:()=>gc,_coercedBigint:()=>Yp,_coercedBoolean:()=>Gp,_coercedDate:()=>um,_coercedNumber:()=>Fp,_coercedString:()=>Dp,_creditCard:()=>Zp,_cuid:()=>uc,_cuid2:()=>lc,_custom:()=>pm,_date:()=>cm,_decode:()=>ua,_decodeAsync:()=>da,_default:()=>tC,_discriminatedUnion:()=>FP,_e164:()=>vc,_email:()=>tc,_emoji:()=>ac,_encode:()=>ca,_encodeAsync:()=>la,_endsWith:()=>Bn,_enum:()=>WP,_file:()=>fm,_float32:()=>Hp,_float64:()=>Bp,_gt:()=>Nt,_gte:()=>dt,_guid:()=>rc,_iban:()=>Lp,_includes:()=>Vn,_int:()=>Vp,_int32:()=>Kp,_int64:()=>Xp,_intersection:()=>VP,_ipv4:()=>mc,_ipv6:()=>hc,_isoDate:()=>bi,_isoDateTime:()=>yi,_isoDuration:()=>wi,_isoTime:()=>vi,_jwt:()=>wc,_ksuid:()=>pc,_lazy:()=>cC,_length:()=>Kr,_literal:()=>QP,_lowercase:()=>Un,_lt:()=>At,_lte:()=>lt,_mac:()=>Mp,_map:()=>KP,_max:()=>lt,_maxLength:()=>Br,_maxSize:()=>dr,_mime:()=>Jn,_min:()=>dt,_minLength:()=>Jt,_minSize:()=>jt,_multipleOf:()=>lr,_nan:()=>lm,_nanoid:()=>cc,_nativeEnum:()=>GP,_negative:()=>xc,_never:()=>sm,_nonnegative:()=>Sc,_nonoptional:()=>rC,_nonpositive:()=>kc,_normalize:()=>Wn,_null:()=>nm,_nullable:()=>eC,_number:()=>Up,_optional:()=>XP,_overwrite:()=>zt,_parse:()=>In,_parseAsync:()=>Tn,_pipe:()=>iC,_positive:()=>$c,_promise:()=>uC,_properties:()=>Kn,_property:()=>zc,_readonly:()=>sC,_record:()=>BP,_refine:()=>mm,_regex:()=>qn,_safeDecode:()=>pa,_safeDecodeAsync:()=>ha,_safeEncode:()=>fa,_safeEncodeAsync:()=>ma,_safeParse:()=>Rn,_safeParseAsync:()=>On,_set:()=>JP,_size:()=>Hr,_slugify:()=>Xn,_startsWith:()=>Hn,_string:()=>jp,_stringFormat:()=>Jr,_stringbool:()=>ym,_success:()=>nC,_superRefine:()=>hm,_symbol:()=>tm,_templateLiteral:()=>aC,_toLowerCase:()=>Qn,_toUpperCase:()=>Yn,_transform:()=>YP,_trim:()=>Gn,_tuple:()=>HP,_uint32:()=>Jp,_uint64:()=>em,_ulid:()=>dc,_undefined:()=>rm,_union:()=>qP,_unknown:()=>im,_uppercase:()=>Fn,_url:()=>gi,_uuid:()=>nc,_uuidv4:()=>oc,_uuidv6:()=>ic,_uuidv7:()=>sc,_void:()=>am,_xid:()=>fc,_xor:()=>UP,base64Charset:()=>Oa,base64urlCharset:()=>ai,canParseURL:()=>mf,clone:()=>oe,compile:()=>Op,compileFn:()=>Xa,config:()=>be,createStandardJSONSchemaMethod:()=>eo,createToJSONSchemaMethod:()=>vm,decode:()=>zb,decodeAsync:()=>Cb,describe:()=>_m,encode:()=>Sb,encodeAsync:()=>Pb,extractDefs:()=>pr,finalize:()=>mr,flattenError:()=>Wo,formatError:()=>Go,getDiscriminatedOption:()=>Xf,globalConfig:()=>Ie,globalRegistry:()=>Re,handleUnrepresentable:()=>Pe,initializeContext:()=>fr,isBackEdge:()=>Ja,isRecursiveSchema:()=>Ka,isValidBase64:()=>si,isValidBase64URL:()=>Aa,isValidCIDRv6:()=>Ra,isValidCreditCard:()=>Na,isValidIBAN:()=>ja,isValidIPv6:()=>ii,isValidJWT:()=>Da,locales:()=>hi,memoizer:()=>mi,mergeValues:()=>Dn,meta:()=>gm,parse:()=>Qo,parseAsync:()=>Yo,parseURLObject:()=>Yb,prettifyError:()=>ed,process:()=>se,processSchema:()=>se,regexes:()=>_t,registry:()=>Qa,safeDecode:()=>Ib,safeDecodeAsync:()=>Rb,safeEncode:()=>Eb,safeEncodeAsync:()=>Tb,safeParse:()=>aa,safeParseAsync:()=>rd,standardProps:()=>Ca,stripTabAndNewline:()=>oi,toDotPath:()=>xb,toJSONSchema:()=>Ic,toZod:()=>Mo,treeifyError:()=>Xl,urlHostnameOk:()=>Ia,urlProtocolOk:()=>Ta,util:()=>T,validate:()=>An,validateAsync:()=>Nn,validateURL:()=>Ea,version:()=>af,withParser:()=>Ya});var nt=ee(()=>{ar();nd();td();Mn();Sp();$a();cf();ke();ke();Zr();Pp();_i();xa();_v();yv();xi();Si();Av();jv()});var Rc={};Vt(Rc,{endsWith:()=>Bn,gt:()=>Nt,gte:()=>dt,includes:()=>Vn,length:()=>Kr,lowercase:()=>Un,lt:()=>At,lte:()=>lt,maxLength:()=>Br,maxSize:()=>dr,mime:()=>Jn,minLength:()=>Jt,minSize:()=>jt,multipleOf:()=>lr,negative:()=>xc,nonnegative:()=>Sc,nonpositive:()=>kc,normalize:()=>Wn,overwrite:()=>zt,positive:()=>$c,properties:()=>Kn,property:()=>zc,regex:()=>qn,size:()=>Hr,slugify:()=>Xn,startsWith:()=>Hn,toLowerCase:()=>Qn,toUpperCase:()=>Yn,trim:()=>Gn,uppercase:()=>Fn});var Oc=ee(()=>{nt()});function Ac(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Dv,Mv,_C,ot,ah=ee(()=>{nt();nt();ke();Dv=new WeakSet([Object.prototype,Error.prototype]);Mv=(e,t)=>{Yl.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);Dv.has(r)||(Dv.add(r),Ac(r,"format",n=>o=>Go(n,o)),Ac(r,"flatten",n=>o=>Wo(n,o)),Ac(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Sn,2)}),Ac(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Sn,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},_C=b("ZodError",Mv),ot=b("ZodError",Mv,void 0,{Parent:Error})});var ch,uh,lh,dh,fh,ph,mh,hh,_h,gh,yh,bh,vh=ee(()=>{nt();ah();nt();ch=In(ot),uh=Tn(ot),lh=Rn(ot),dh=On(ot),fh=ca(ot),ph=ua(ot),mh=la(ot),hh=da(ot),_h=fa(ot),gh=pa(ot),yh=ma(ot),bh=ha(ot)});var lo={};Vt(lo,{ZodAny:()=>Ph,ZodArray:()=>Th,ZodBase64:()=>Yc,ZodBase64URL:()=>Xc,ZodBigInt:()=>co,ZodBigIntFormat:()=>ru,ZodBoolean:()=>ao,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Qc,ZodCUID:()=>Fc,ZodCUID2:()=>Vc,ZodCatch:()=>Gh,ZodCodec:()=>Ni,ZodCreditCard:()=>$h,ZodCustom:()=>ji,ZodCustomStringFormat:()=>Gr,ZodDate:()=>Ei,ZodDefault:()=>Vh,ZodDiscriminatedUnion:()=>Oh,ZodE164:()=>eu,ZodEmail:()=>Mc,ZodEmoji:()=>qc,ZodEnum:()=>oo,ZodExactOptional:()=>su,ZodFile:()=>Lh,ZodFunction:()=>s_,ZodGUID:()=>Zc,ZodIBAN:()=>xh,ZodIPv4:()=>Jc,ZodIPv6:()=>Wc,ZodISODate:()=>_r,ZodISODateTime:()=>hr,ZodISODuration:()=>yr,ZodISOTime:()=>gr,ZodInstanceOf:()=>u_,ZodIntersection:()=>Ah,ZodJWT:()=>tu,ZodKSUID:()=>Kc,ZodLazy:()=>n_,ZodLiteral:()=>Zh,ZodMAC:()=>wh,ZodMap:()=>Dh,ZodNaN:()=>Yh,ZodNanoID:()=>Uc,ZodNever:()=>Eh,ZodNonOptional:()=>au,ZodNull:()=>zh,ZodNullable:()=>Fh,ZodNumber:()=>so,ZodNumberFormat:()=>Qr,ZodObject:()=>Ii,ZodOptional:()=>Oi,ZodPipe:()=>Ai,ZodPrefault:()=>Bh,ZodPreprocess:()=>Xh,ZodPromise:()=>i_,ZodReadonly:()=>e_,ZodRecord:()=>no,ZodSet:()=>Mh,ZodString:()=>io,ZodStringFormat:()=>le,ZodSuccess:()=>Wh,ZodSymbol:()=>kh,ZodTemplateLiteral:()=>r_,ZodTransform:()=>qh,ZodTuple:()=>Nh,ZodType:()=>F,ZodULID:()=>Hc,ZodURL:()=>Pi,ZodUUID:()=>Dt,ZodUndefined:()=>Sh,ZodUnion:()=>Ti,ZodUnknown:()=>Ch,ZodVoid:()=>Ih,ZodXID:()=>Bc,ZodXor:()=>Rh,_ZodString:()=>Dc,_default:()=>Hh,_function:()=>Uw,any:()=>nu,array:()=>z,base64:()=>ow,base64url:()=>iw,bigint:()=>bw,boolean:()=>ae,catch:()=>Qh,check:()=>Fw,cidrv4:()=>rw,cidrv6:()=>nw,codec:()=>Mw,creditCard:()=>aw,cuid:()=>Jv,cuid2:()=>Wv,currencyCode:()=>pw,custom:()=>cu,date:()=>Sw,describe:()=>Vw,discriminatedUnion:()=>Ri,e164:()=>sw,email:()=>Zv,emoji:()=>Bv,enum:()=>Oe,exactOptional:()=>Uh,file:()=>Aw,float32:()=>hw,float64:()=>_w,function:()=>Uw,guid:()=>Lv,hash:()=>mw,hex:()=>fw,hostname:()=>dw,httpUrl:()=>Hv,iban:()=>cw,instanceof:()=>Bw,int:()=>Nc,int32:()=>gw,int64:()=>vw,intersection:()=>uo,invertCodec:()=>Zw,ipv4:()=>Xv,ipv6:()=>tw,json:()=>Jw,jwt:()=>uw,keyof:()=>zw,ksuid:()=>Yv,lazy:()=>o_,literal:()=>O,looseObject:()=>ve,looseRecord:()=>Iw,mac:()=>ew,map:()=>Tw,meta:()=>Hw,nan:()=>Dw,nanoid:()=>Kv,nativeEnum:()=>Ow,never:()=>ou,nonoptional:()=>Jh,null:()=>Ci,nullable:()=>zi,nullish:()=>Nw,number:()=>G,object:()=>P,optional:()=>ue,partialRecord:()=>Ew,pipe:()=>jc,prefault:()=>Kh,preprocess:()=>Di,promise:()=>qw,readonly:()=>t_,record:()=>de,refine:()=>a_,set:()=>Rw,strictObject:()=>Pw,string:()=>y,stringFormat:()=>lw,stringbool:()=>Kw,success:()=>jw,superRefine:()=>c_,symbol:()=>$w,templateLiteral:()=>Lw,transform:()=>iu,tuple:()=>jh,uint32:()=>yw,uint64:()=>ww,ulid:()=>Gv,undefined:()=>xw,union:()=>ce,unknown:()=>pe,url:()=>Lc,uuid:()=>qv,uuidv4:()=>Uv,uuidv6:()=>Fv,uuidv7:()=>Vv,void:()=>kw,xid:()=>Qv,xor:()=>Cw});function yC(){Ie.localeError||be(Wa())}function Wr(){Ie.memoizer||be({memoizer:mi()})}function y(e){return jp(io,e)}function Zv(e){return tc(Mc,e)}function Lv(e){return rc(Zc,e)}function qv(e){return nc(Dt,e)}function Uv(e){return oc(Dt,e)}function Fv(e){return ic(Dt,e)}function Vv(e){return sc(Dt,e)}function Lc(e){return gi(Pi,e)}function Hv(e){return gi(Pi,{protocol:Xo,hostname:kd,...T.normalizeParams(e)})}function Bv(e){return ac(qc,e)}function Kv(e){return cc(Uc,e)}function Jv(e){return uc(Fc,e)}function Wv(e){return lc(Vc,e)}function Gv(e){return dc(Hc,e)}function Qv(e){return fc(Bc,e)}function Yv(e){return pc(Kc,e)}function Xv(e){return mc(Jc,e)}function ew(e){return Mp(wh,e)}function tw(e){return hc(Wc,e)}function rw(e){return _c(Gc,e)}function nw(e){return gc(Qc,e)}function ow(e){return yc(Yc,e)}function iw(e){return bc(Xc,e)}function sw(e){return vc(eu,e)}function aw(e){return Zp($h,e)}function cw(e){return Lp(xh,e)}function uw(e){return wc(tu,e)}function lw(e,t,r={}){return Jr(Gr,e,t,r)}function dw(e){return Jr(Gr,"hostname",xd,e)}function fw(e){return Jr(Gr,"hex",Md,e)}function pw(e){return Jr(Gr,"currency_code",zd,e)}function mw(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,o=_t[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return Jr(Gr,n,o,t)}function G(e){return Up(so,e)}function Nc(e){return Vp(Qr,e)}function hw(e){return Hp(Qr,e)}function _w(e){return Bp(Qr,e)}function gw(e){return Kp(Qr,e)}function yw(e){return Jp(Qr,e)}function ae(e){return Wp(ao,e)}function bw(e){return Qp(co,e)}function vw(e){return Xp(ru,e)}function ww(e){return em(ru,e)}function $w(e){return tm(kh,e)}function xw(e){return rm(Sh,e)}function Ci(e){return nm(zh,e)}function nu(){return om(Ph)}function pe(){return im(Ch)}function ou(e){return sm(Eh,e)}function kw(e){return am(Ih,e)}function Sw(e){return cm(Ei,e)}function z(e,t){return dm(Th,e,t)}function zw(e){let t=e._zod.def.shape;return Oe(Object.keys(t))}function P(e,t){let r={type:"object",shape:e??{},...T.normalizeParams(t)};return new Ii(r)}function Pw(e,t){return new Ii({type:"object",shape:e,catchall:ou(),...T.normalizeParams(t)})}function ve(e,t){return new Ii({type:"object",shape:e,catchall:pe(),...T.normalizeParams(t)})}function ce(e,t){return new Ti({type:"union",options:e,...T.normalizeParams(t)})}function Cw(e,t){return new Rh({type:"union",options:e,inclusive:!1,...T.normalizeParams(t)})}function Ri(e,t,r){return new Oh({type:"union",options:t,discriminator:e,...T.normalizeParams(r)})}function uo(e,t){return new Ah({type:"intersection",left:e,right:t})}function jh(e,t,r){let n=t instanceof Z,o=n?r:t,i=n?t:null;return new Nh({type:"tuple",items:e,rest:i,...T.normalizeParams(o)})}function de(e,t,r){return!t||!t._zod?new no({type:"record",keyType:y(),valueType:e,...T.normalizeParams(t)}):new no({type:"record",keyType:e,valueType:t,...T.normalizeParams(r)})}function Ew(e,t,r){return new no({type:"record",keyType:e,valueType:t,...T.normalizeParams(r),partial:!0})}function Iw(e,t,r){return new no({type:"record",keyType:e,valueType:t,mode:"loose",...T.normalizeParams(r)})}function Tw(e,t,r){return new Dh({type:"map",keyType:e,valueType:t,...T.normalizeParams(r)})}function Rw(e,t){return new Mh({type:"set",valueType:e,...T.normalizeParams(t)})}function Oe(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new oo({type:"enum",entries:r,...T.normalizeParams(t)})}function Ow(e,t){return new oo({type:"enum",entries:e,...T.normalizeParams(t)})}function O(e,t){return new Zh({type:"literal",values:Array.isArray(e)?e:[e],...T.normalizeParams(t)})}function Aw(e){return fm(Lh,e)}function iu(e){return new qh({type:"transform",transform:e})}function ue(e){return new Oi({type:"optional",innerType:e})}function Uh(e){return new su({type:"optional",innerType:e})}function zi(e){return new Fh({type:"nullable",innerType:e})}function Nw(e){return ue(zi(e))}function Hh(e,t){return new Vh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}function Kh(e,t){return new Bh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}function Jh(e,t){return new au({type:"nonoptional",innerType:e,...T.normalizeParams(t)})}function jw(e){return new Wh({type:"success",innerType:e})}function Qh(e,t){return new Gh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:T.constantCatch(t)})}function Dw(e){return lm(Yh,e)}function jc(e,t){return new Ai({type:"pipe",in:e,out:t})}function Mw(e,t,r){return new Ni({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Zw(e){let t=e._zod.def;return new Ni({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function t_(e){return new e_({type:"readonly",innerType:e})}function Lw(e,t){return new r_({type:"template_literal",parts:e,...T.normalizeParams(t)})}function o_(e){return new n_({type:"lazy",getter:e})}function qw(e){return new i_({type:"promise",innerType:e})}function Uw(e){return new s_({type:"function",input:Array.isArray(e?.input)?jh(e?.input):e?.input??z(pe()),output:e?.output??pe()})}function Fw(e){let t=new fe({check:"custom"});return t._zod.check=e,t}function cu(e,t){return pm(ji,e??(()=>!0),t)}function a_(e,t={}){return mm(ji,e,t)}function c_(e,t){return hm(e,t)}function Bw(e,t={}){let r=new u_({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...T.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 Jw(e){let t=o_(()=>ce([y(e),G(),ae(),Ci(),z(t),de(y(),t)]));return t}function Di(e,t){return new Xh({type:"pipe",in:iu(e),out:t})}var F,Dc,io,le,hr,_r,gr,yr,Mc,Zc,Dt,Pi,qc,Uc,Fc,Vc,Hc,Bc,Kc,Jc,wh,Wc,Gc,Qc,Yc,Xc,eu,$h,xh,tu,Gr,so,Qr,ao,co,ru,kh,Sh,zh,Ph,Ch,Eh,Ih,Ei,Th,Ii,Ti,Rh,Oh,Ah,Nh,no,Dh,Mh,oo,Zh,Lh,qh,Oi,su,Fh,Vh,Bh,au,Wh,Gh,Yh,Ai,Ni,Xh,e_,r_,n_,i_,s_,ji,Vw,Hw,u_,Kw,br=ee(()=>{nt();nt();Si();Zr();xi();zp();Oc();vh();F=b("ZodType",(e,t)=>(yC(),Z.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return oe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(a_(e,t))},superRefine(e,t){return this.check(c_(e,t))},overwrite(e){return this.check(zt(e))},optional(){return ue(this)},exactOptional(){return Uh(this)},nullable(){return zi(this)},nullish(){return ue(zi(this))},nonoptional(e){return Jh(this,e)},array(){return z(this)},or(e){return ce([this,e])},and(e){return uo(this,e)},transform(e){return jc(this,iu(e))},default(e){return Hh(this,e)},prefault(e){return Kh(this,e)},catch(e){return Qh(this,e)},pipe(e){return jc(this,e)},readonly(){return t_(this)},describe(e){let t=this.clone();return Re.add(t,{description:e}),t},meta(...e){if(e.length===0)return Re.get(this);let t=this.clone();return Re.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return T.hide(this,"~standard",{...Ca(this),jsonSchema:{input:eo(this,"input"),output:eo(this,"output")}})},set"~standard"(e){T.own(this,"~standard",e)},parse:function e(t,r){return ch(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await uh(this,t,r,{callee:e})},safeParse(e,t){return lh(this,e,t)},async safeParseAsync(e,t){return dh(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){T.own(this,"spa",e)},validate(e,t){return An(this,e,t)},validateAsync(e,t){return Nn(this,e,t)},encode:function e(t,r){return fh(this,t,r,{callee:e})},decode:function e(t,r){return ph(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await mh(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await hh(this,t,r,{callee:e})},safeEncode(e,t){return _h(this,e,t)},safeDecode(e,t){return gh(this,e,t)},async safeEncodeAsync(e,t){return yh(this,e,t)},async safeDecodeAsync(e,t){return bh(this,e,t)},toJSONSchema(e){return vm(this,{})(e)},get description(){return Re.get(this)?.description},get _def(){return this._zod.def}}),Dc=b("_ZodString",(e,t)=>{qr.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xm(e,r,n,o)},T.derived({format:e=>Ce(e).format??null,minLength:e=>Ce(e).minimum??null,maxLength:e=>Ce(e).maximum??null},{regex(...e){return this.check(qn(...e))},includes(...e){return this.check(Vn(...e))},startsWith(...e){return this.check(Hn(...e))},endsWith(...e){return this.check(Bn(...e))},min(...e){return this.check(Jt(...e))},max(...e){return this.check(Br(...e))},length(...e){return this.check(Kr(...e))},nonempty(...e){return this.check(Jt(1,...e))},lowercase(e){return this.check(Un(e))},uppercase(e){return this.check(Fn(e))},trim(){return this.check(Gn())},normalize(...e){return this.check(Wn(...e))},toLowerCase(){return this.check(Qn())},toUpperCase(){return this.check(Yn())},slugify(){return this.check(Xn())}})),io=b("ZodString",(e,t)=>{qr.init(e,t),Dc.init(e,t)},{email(e){return this.check(tc(Mc,e))},url(e){return this.check(gi(Pi,e))},jwt(e){return this.check(wc(tu,e))},emoji(e){return this.check(ac(qc,e))},guid(e){return this.check(rc(Zc,e))},uuid(e){return this.check(nc(Dt,e))},uuidv4(e){return this.check(oc(Dt,e))},uuidv6(e){return this.check(ic(Dt,e))},uuidv7(e){return this.check(sc(Dt,e))},nanoid(e){return this.check(cc(Uc,e))},cuid(e){return this.check(uc(Fc,e))},cuid2(e){return this.check(lc(Vc,e))},ulid(e){return this.check(dc(Hc,e))},base64(e){return this.check(yc(Yc,e))},base64url(e){return this.check(bc(Xc,e))},xid(e){return this.check(fc(Bc,e))},ksuid(e){return this.check(pc(Kc,e))},ipv4(e){return this.check(mc(Jc,e))},ipv6(e){return this.check(hc(Wc,e))},cidrv4(e){return this.check(_c(Gc,e))},cidrv6(e){return this.check(gc(Qc,e))},e164(e){return this.check(vc(eu,e))},datetime(e){return this.check(yi(hr,e))},date(e){return this.check(bi(_r,e))},time(e){return this.check(vi(gr,e))},duration(e){return this.check(wi(yr,e))}});le=b("ZodStringFormat",(e,t)=>{ie.init(e,t),Dc.init(e,t)}),hr=b("ZodISODateTime",(e,t)=>{xf.init(e,t),le.init(e,t)}),_r=b("ZodISODate",(e,t)=>{kf.init(e,t),le.init(e,t)}),gr=b("ZodISOTime",(e,t)=>{Sf.init(e,t),le.init(e,t)}),yr=b("ZodISODuration",(e,t)=>{zf.init(e,t),le.init(e,t)}),Mc=b("ZodEmail",(e,t)=>{ff.init(e,t),le.init(e,t)});Zc=b("ZodGUID",(e,t)=>{lf.init(e,t),le.init(e,t)});Dt=b("ZodUUID",(e,t)=>{df.init(e,t),le.init(e,t)});Pi=b("ZodURL",(e,t)=>{hf.init(e,t),le.init(e,t)});qc=b("ZodEmoji",(e,t)=>{_f.init(e,t),le.init(e,t)});Uc=b("ZodNanoID",(e,t)=>{gf.init(e,t),le.init(e,t)});Fc=b("ZodCUID",(e,t)=>{yf.init(e,t),le.init(e,t)});Vc=b("ZodCUID2",(e,t)=>{bf.init(e,t),le.init(e,t)});Hc=b("ZodULID",(e,t)=>{vf.init(e,t),le.init(e,t)});Bc=b("ZodXID",(e,t)=>{wf.init(e,t),le.init(e,t)});Kc=b("ZodKSUID",(e,t)=>{$f.init(e,t),le.init(e,t)});Jc=b("ZodIPv4",(e,t)=>{Pf.init(e,t),le.init(e,t)});wh=b("ZodMAC",(e,t)=>{Ef.init(e,t),le.init(e,t)});Wc=b("ZodIPv6",(e,t)=>{Cf.init(e,t),le.init(e,t)});Gc=b("ZodCIDRv4",(e,t)=>{If.init(e,t),le.init(e,t)});Qc=b("ZodCIDRv6",(e,t)=>{Tf.init(e,t),le.init(e,t)});Yc=b("ZodBase64",(e,t)=>{Rf.init(e,t),le.init(e,t)});Xc=b("ZodBase64URL",(e,t)=>{Of.init(e,t),le.init(e,t)});eu=b("ZodE164",(e,t)=>{Af.init(e,t),le.init(e,t)});$h=b("ZodCreditCard",(e,t)=>{Nf.init(e,t),le.init(e,t)});xh=b("ZodIBAN",(e,t)=>{jf.init(e,t),le.init(e,t)});tu=b("ZodJWT",(e,t)=>{Df.init(e,t),le.init(e,t)});Gr=b("ZodCustomStringFormat",(e,t)=>{Mf.init(e,t),le.init(e,t)});so=b("ZodNumber",(e,t)=>{Ma.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>km(e,r,n,o),e.isFinite=!0},T.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=Ce(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=Ce(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=Ce(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>Ce(e).format??null},{gt(e,t){return this.check(Nt(e,t))},gte(e,t){return this.check(dt(e,t))},min(e,t){return this.check(dt(e,t))},lt(e,t){return this.check(At(e,t))},lte(e,t){return this.check(lt(e,t))},max(e,t){return this.check(lt(e,t))},int(e){return this.check(Nc(e))},safe(e){return this.check(Nc(e))},positive(e){return this.check(Nt(0,e))},nonnegative(e){return this.check(dt(0,e))},negative(e){return this.check(At(0,e))},nonpositive(e){return this.check(lt(0,e))},multipleOf(e,t){return this.check(lr(e,t))},step(e,t){return this.check(lr(e,t))},finite(){return this}}));Qr=b("ZodNumberFormat",(e,t)=>{Zf.init(e,t),so.init(e,t)});ao=b("ZodBoolean",(e,t)=>{ci.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sm(e,r,n,o)});co=b("ZodBigInt",(e,t)=>{Za.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zm(e,r,n,o)},T.derived({minValue:e=>Ce(e).minimum??null,maxValue:e=>Ce(e).maximum??null,format:e=>Ce(e).format??null},{gte(e,t){return this.check(dt(e,t))},min(e,t){return this.check(dt(e,t))},gt(e,t){return this.check(Nt(e,t))},lt(e,t){return this.check(At(e,t))},lte(e,t){return this.check(lt(e,t))},max(e,t){return this.check(lt(e,t))},positive(e){return this.check(Nt(BigInt(0),e))},negative(e){return this.check(At(BigInt(0),e))},nonpositive(e){return this.check(lt(BigInt(0),e))},nonnegative(e){return this.check(dt(BigInt(0),e))},multipleOf(e,t){return this.check(lr(e,t))}}));ru=b("ZodBigIntFormat",(e,t)=>{Lf.init(e,t),co.init(e,t)});kh=b("ZodSymbol",(e,t)=>{qf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pm(e,r,n,o)});Sh=b("ZodUndefined",(e,t)=>{Uf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Em(e,r,n,o)});zh=b("ZodNull",(e,t)=>{Ff.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cm(e,r,n,o)});Ph=b("ZodAny",(e,t)=>{Vf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rm(e,r,n,o)});Ch=b("ZodUnknown",(e,t)=>{Hf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Om(e,r,n,o)});Eh=b("ZodNever",(e,t)=>{Bf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tm(e,r,n,o)});Ih=b("ZodVoid",(e,t)=>{Kf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Im(e,r,n,o)});Ei=b("ZodDate",(e,t)=>{Jf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Am(e,r,n,o),e.min=(r,n)=>e.check(dt(r,n)),e.max=(r,n)=>e.check(lt(r,n))},T.derived({minDate:e=>{let{minimum:t}=Ce(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Ce(e);return t?new Date(t):null}},{}));Th=b("ZodArray",(e,t)=>{Wr(),Gf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bm(e,r,n,o),e.element=t.element},{min(e,t){return this.check(Jt(e,t))},nonempty(e){return this.check(Jt(1,e))},max(e,t){return this.check(Br(e,t))},length(e,t){return this.check(Kr(e,t))},unwrap(){return this.element}});Ii=b("ZodObject",(e,t)=>{Wr(),Qf.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Km(e,r,n,o),T.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Oe(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T.mergeDefs(this._zod.def,{catchall:pe()}))},loose(){return this.clone(T.mergeDefs(this._zod.def,{catchall:pe()}))},strict(){return this.clone(T.mergeDefs(this._zod.def,{catchall:ou()}))},strip(){return this.clone(T.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return T.extend(this,e)},safeExtend(e){return T.safeExtend(this,e)},merge(e){return T.merge(this,e)},pick(e){return T.pick(this,e)},omit(e){return T.omit(this,e)},partial(...e){return T.partial(Oi,this,e[0])},exactPartial(...e){return T.partial(su,this,e[0],"exactPartial")},required(...e){return T.required(au,this,e[0])}});Ti=b("ZodUnion",(e,t)=>{ui.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cc(e,r,n,o),e.options=t.options});Rh=b("ZodXor",(e,t)=>{Ti.init(e,t),Yf.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cc(e,r,n,o),e.options=t.options});Oh=b("ZodDiscriminatedUnion",(e,t)=>{Ti.init(e,t),ep.init(e,t)});Ah=b("ZodIntersection",(e,t)=>{tp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jm(e,r,n,o)});Nh=b("ZodTuple",(e,t)=>{Wr(),La.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wm(e,r,n,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Oi({type:"optional",innerType:t}))})}});no=b("ZodRecord",(e,t)=>{Wr(),rp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gm(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});Dh=b("ZodMap",(e,t)=>{Wr(),np.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vm(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(jt(...r)),e.nonempty=r=>e.check(jt(1,r)),e.max=(...r)=>e.check(dr(...r)),e.size=(...r)=>e.check(Hr(...r))});Mh=b("ZodSet",(e,t)=>{Wr(),op.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hm(e,r,n,o),e.min=(...r)=>e.check(jt(...r)),e.nonempty=r=>e.check(jt(1,r)),e.max=(...r)=>e.check(dr(...r)),e.size=(...r)=>e.check(Hr(...r))});oo=b("ZodEnum",(e,t)=>{ip.init(e,t),F.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Nm(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new oo({...t,checks:[],...T.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new oo({...t,checks:[],...T.normalizeParams(o),entries:i})}});Zh=b("ZodLiteral",(e,t)=>{sp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jm(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Lh=b("ZodFile",(e,t)=>{ap.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zm(e,r,n,o),e.min=(r,n)=>e.check(jt(r,n)),e.max=(r,n)=>e.check(dr(r,n)),e.mime=(r,n)=>e.check(Jn(Array.isArray(r)?r:[r],n))});qh=b("ZodTransform",(e,t)=>{Wr(),cp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fm(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new cr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(T.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(T.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});Oi=b("ZodOptional",(e,t)=>{qa.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ec(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});su=b("ZodExactOptional",(e,t)=>{up.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ec(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Fh=b("ZodNullable",(e,t)=>{lp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Vh=b("ZodDefault",(e,t)=>{dp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>eh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Bh=b("ZodPrefault",(e,t)=>{fp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>th(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});au=b("ZodNonOptional",(e,t)=>{pp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ym(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Wh=b("ZodSuccess",(e,t)=>{mp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});Gh=b("ZodCatch",(e,t)=>{hp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Yh=b("ZodNaN",(e,t)=>{_p.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dm(e,r,n,o)});Ai=b("ZodPipe",(e,t)=>{Ua.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nh(e,r,n,o),e.in=t.in,e.out=t.out});Ni=b("ZodCodec",(e,t)=>{Ai.init(e,t),li.init(e,t)});Xh=b("ZodPreprocess",(e,t)=>{Ai.init(e,t),gp.init(e,t)}),e_=b("ZodReadonly",(e,t)=>{yp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>oh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});r_=b("ZodTemplateLiteral",(e,t)=>{bp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mm(e,r,n,o)});n_=b("ZodLazy",(e,t)=>{di.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>sh(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});i_=b("ZodPromise",(e,t)=>{wp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ih(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});s_=b("ZodFunction",(e,t)=>{vp.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Um(e,r,n,o)});ji=b("ZodCustom",(e,t)=>{$p.init(e,t),F.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qm(e,r,n,o)});Vw=_m,Hw=gm,u_=b("ZodInstanceOf",(e,t)=>{ji.init(e,t)},{properties(e,t){return this.check(Kn(e,t))}});Kw=(...e)=>ym({Codec:Ni,Boolean:ao,String:io},...e)});function bC(e){be({customError:e})}function vC(){return be().customError}var d_,l_,Ww=ee(()=>{nt();d_={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"};l_||(l_={})});var Yr={};Vt(Yr,{ZodISODate:()=>_r,ZodISODateTime:()=>hr,ZodISODuration:()=>yr,ZodISOTime:()=>gr,date:()=>$C,datetime:()=>wC,duration:()=>kC,time:()=>xC});function wC(e){return yi(hr,e)}function $C(e){return bi(_r,e)}function xC(e){return vi(gr,e)}function kC(e){return wi(yr,e)}var uu=ee(()=>{nt();br();br()});function zC(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Gw(e,t){return e.map((r,n)=>n<t?r:r.optional())}function PC(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function CC(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let o=r[1]===void 0?void 0:PC(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function EC(e,t){return E.transform(n=>n).check(n=>{let o=n.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&n.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&n.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||n.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function f_(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let n=String(e);return`${r[0]}${n.length}:${n}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=f_(s,t);if(a===null)return null;i.push(a)}return`a${i.length}:[${i.join(",")}]`}let n=Object.keys(e).sort(),o=[];for(let i of n){let s=f_(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}function Mi(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Mi):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>IC.has(t)?Mi(r):!TC.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(Mi))}function Qw(e){return e===1?"element":"elements"}function RC(e,t){return E.transform(n=>n).check(n=>{let o=n.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let s=0;s<o.length;s++){let a=f_(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}n.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&n.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${Qw(i)}; found ${a}`,input:o,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&n.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${Qw(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function Yw(e,t){if(e!==!1)return e===void 0||e===!0?E.any():Ge(e,t)}function Xw(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return E.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return E.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=CC(o,t),s=Ge(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return E.null();if(o.length===0)return E.never();if(o.length===1)return E.literal(o[0]);if(o.every(s=>typeof s=="string"))return E.enum(o);let i=o.map(s=>E.literal(s));return i.length<2?i[0]:E.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return E.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(i=>{let s={...e,type:i};return Xw(s,t)});return o.length===0?E.never():o.length===1?o[0]:E.union(o)}if(!r)return E.any();let n;switch(r){case"string":{let o=E.string();if(e.format){let i=e.format;i==="email"?o=o.check(E.email()):i==="uri"||i==="uri-reference"?o=o.check(E.url()):i==="uuid"||i==="guid"?o=o.check(E.uuid()):i==="date-time"?o=o.check(E.iso.datetime({offset:!0})):i==="date"?o=o.check(E.iso.date()):i==="time"?o=o.check(E.regex(OC)):i==="duration"?o=o.check(E.iso.duration()):i==="hostname"?o=o.check(E.hostname()):i==="ipv4"?o=o.check(E.ipv4()):i==="ipv6"?o=o.check(E.ipv6()):i==="mac"?o=o.check(E.mac()):i==="cidr"?o=o.check(E.cidrv4()):i==="cidr-v6"?o=o.check(E.cidrv6()):i==="base64"?o=o.check(E.base64()):i==="base64url"?o=o.check(E.base64url()):i==="e164"?o=o.check(E.e164()):i==="credit_card"?o=o.check(E.creditCard()):i==="iban"?o=o.check(E.iban()):i==="jwt"?o=o.check(E.jwt()):i==="emoji"?o=o.check(E.emoji()):i==="nanoid"?o=o.check(E.nanoid()):i==="cuid"?o=o.check(E.cuid()):i==="cuid2"?o=o.check(E.cuid2()):i==="ulid"?o=o.check(E.ulid()):i==="xid"?o=o.check(E.xid()):i==="ksuid"&&(o=o.check(E.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),n=o;break}case"number":case"integer":{let o=r==="integer"?E.number().int():E.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),n=o;break}case"boolean":{n=E.boolean();break}case"null":{n=E.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?Ge(e.additionalProperties,t):void 0;for(let[f,d]of Object.entries(i)){let p=Ge(d,t);Te(o,f,s.has(f)?p:p.optional())}if(e.patternProperties){let f=e.patternProperties,d=Object.keys(f),p=[];for(let h of d){let g=Ge(f[h],t),w=E.string().regex(new RegExp(h));p.push(E.looseRecord(w,g))}let m=[];if(Object.keys(o).length>0&&m.push(E.object(o).passthrough()),m.push(...p),m.length===0)n=E.object({}).passthrough();else if(m.length===1)n=m[0];else{let h=E.intersection(m[0],m[1]);for(let g=2;g<m.length;g++)h=E.intersection(h,m[g]);n=h}if(e.additionalProperties===!1){let h=Object.keys(o),g=d.map(v=>new RegExp(v)),w=n;n=n.check(v=>{if(!mt(v.value))return;let x=[];for(let C of Object.keys(v.value))h.includes(C)||g.some($=>$.test(C))||x.push(C);x.length&&v.issues.push({code:"unrecognized_keys",keys:x,input:v.value,inst:w})})}}else{let f=E.object(o);e.additionalProperties===!1?n=f.strict():a?n=f.catchall(a):n=f.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let f;if(c){let d=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;f=Ge(d,t)}n=EC(n,{keySchema:f,minProperties:u,maxProperties:l})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(f=>Ge(f,t)),c=Gw(a,s),u=Array.isArray(i)?void 0:Yw(i,t),l=E.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(E.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(f=>Ge(f,t)),c=Gw(a,s),u=Yw(e.additionalItems,t),l=E.tuple(c);n=u?l.rest(u):l,typeof e.minItems=="number"&&(n=n.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(E.maxLength(e.maxItems)))}else if(i!==void 0){let s=Ge(i,t),a=E.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a}else n=E.array(E.any());(e.uniqueItems===!0||e.contains!==void 0)&&(n=RC(n,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Ge(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Ge(e,t){if(typeof e=="boolean")return e?E.any():E.never();let r=Xw(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Ge(u,t)),c=E.union(a);r=n?E.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Ge(u,t)),c=E.xor(a);r=n?E.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:E.any();else{let a=n?r:Ge(e.allOf[0],t),c=n?0:1;for(let u=c;u<e.allOf.length;u++)a=E.intersection(a,Ge(e.allOf[u],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=E.nullable(r)),e.readOnly===!0&&(r=E.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Mi(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Mi(e.contains)&&(o.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a])}for(let a of Object.keys(e))SC.has(a)||Te(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function e0(e,t){if(typeof e=="boolean")return e?E.any():E.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=zC(r,t?.defaultTarget),o=r.$defs||r.definitions||{},i={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Re};return Ge(r,i)}var E,SC,IC,TC,OC,t0=ee(()=>{_i();ke();Oc();uu();br();E={...lo,...Rc,iso:Yr},SC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);IC=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),TC=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);OC=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Zi(e,t){let r=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},n=new Map;function o(s){let a=n.get(s);if(a===r0)return new di({type:"lazy",getter:()=>n.get(s)});if(a!==void 0)return a;n.set(s,r0);let c=i(s),u=r(c,c!==s);return n.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let u=a.shape,l=Object.keys(u),f=!1,d={};for(let m of l){let h=o(u[m]);h!==u[m]&&(f=!0),d[m]=h}let p=a.catchall;return a.catchall&&(p=o(a.catchall),p!==a.catchall&&(f=!0)),f?oe(s,{...a,shape:d,catchall:p}):s}case"array":{let u=o(a.element);return u===a.element?s:oe(s,{...a,element:u})}case"tuple":{let u=a.items,l=!1,f=[];for(let p of u){let m=o(p);m!==p&&(l=!0),f.push(m)}let d=a.rest;return a.rest&&(d=o(a.rest),d!==a.rest&&(l=!0)),l?oe(s,{...a,items:f,rest:d}):s}case"record":case"map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:oe(s,{...a,keyType:u,valueType:l})}case"set":{let u=o(a.valueType);return u===a.valueType?s:oe(s,{...a,valueType:u})}case"union":{let u=a.options,l=!1,f=[];for(let d of u){let p=o(d);p!==d&&(l=!0),f.push(p)}return l?oe(s,{...a,options:f}):s}case"intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:oe(s,{...a,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=o(a.innerType);return u===a.innerType?s:oe(s,{...a,innerType:u})}case"pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:oe(s,{...a,in:u,out:l})}case"function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:oe(s,{...a,input:u,output:l})}case"lazy":{let u=a.getter,{_cachedInner:l,...f}=a;return oe(s,{...f,getter:()=>o(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return o(e)}var r0,p_=ee(()=>{Mn();ke();r0=Symbol("z.visit/resolving")});function n0(e){return Zi(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:ce(r.options)}})}var o0=ee(()=>{p_();br()});function AC(e,t){if(!t?.length)return e;let r=e._zod.def;return oe(e,kt(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function i0(e){return AC(e.out,e.checks)}function NC(e){return e.in._zod.traits.has("$ZodTransform")?i0(e):e.in}function s0(e){return Zi(e,{pipe:t=>NC(t._zod.def),default:(t,r)=>r?ue(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function a0(e){return Zi(e,{pipe:t=>i0(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var c0=ee(()=>{ke();p_();br()});var Li={};Vt(Li,{bigint:()=>ZC,boolean:()=>MC,date:()=>LC,number:()=>DC,string:()=>jC});function jC(e){return Dp(io,e)}function DC(e){return Fp(so,e)}function MC(e){return Gp(ao,e)}function ZC(e){return Yp(co,e)}function LC(e){return um(Ei,e)}var u0=ee(()=>{nt();br()});var _={};Vt(_,{$brand:()=>Wl,$input:()=>Ep,$output:()=>Cp,INVALID:()=>Je,NEVER:()=>Jo,TimePrecision:()=>qp,ZodAny:()=>Ph,ZodArray:()=>Th,ZodBase64:()=>Yc,ZodBase64URL:()=>Xc,ZodBigInt:()=>co,ZodBigIntFormat:()=>ru,ZodBoolean:()=>ao,ZodCIDRv4:()=>Gc,ZodCIDRv6:()=>Qc,ZodCUID:()=>Fc,ZodCUID2:()=>Vc,ZodCatch:()=>Gh,ZodCodec:()=>Ni,ZodCompileAsyncError:()=>St,ZodCompileUnsupportedError:()=>J,ZodCreditCard:()=>$h,ZodCustom:()=>ji,ZodCustomStringFormat:()=>Gr,ZodDate:()=>Ei,ZodDefault:()=>Vh,ZodDiscriminatedUnion:()=>Oh,ZodE164:()=>eu,ZodEmail:()=>Mc,ZodEmoji:()=>qc,ZodEnum:()=>oo,ZodError:()=>_C,ZodExactOptional:()=>su,ZodFile:()=>Lh,ZodFirstPartyTypeKind:()=>l_,ZodFunction:()=>s_,ZodGUID:()=>Zc,ZodIBAN:()=>xh,ZodIPv4:()=>Jc,ZodIPv6:()=>Wc,ZodISODate:()=>_r,ZodISODateTime:()=>hr,ZodISODuration:()=>yr,ZodISOTime:()=>gr,ZodInstanceOf:()=>u_,ZodIntersection:()=>Ah,ZodIssueCode:()=>d_,ZodJWT:()=>tu,ZodKSUID:()=>Kc,ZodLazy:()=>n_,ZodLiteral:()=>Zh,ZodMAC:()=>wh,ZodMap:()=>Dh,ZodNaN:()=>Yh,ZodNanoID:()=>Uc,ZodNever:()=>Eh,ZodNonOptional:()=>au,ZodNull:()=>zh,ZodNullable:()=>Fh,ZodNumber:()=>so,ZodNumberFormat:()=>Qr,ZodObject:()=>Ii,ZodOptional:()=>Oi,ZodPipe:()=>Ai,ZodPrefault:()=>Bh,ZodPreprocess:()=>Xh,ZodPromise:()=>i_,ZodReadonly:()=>e_,ZodRealError:()=>ot,ZodRecord:()=>no,ZodSet:()=>Mh,ZodString:()=>io,ZodStringFormat:()=>le,ZodSuccess:()=>Wh,ZodSymbol:()=>kh,ZodTemplateLiteral:()=>r_,ZodTransform:()=>qh,ZodTuple:()=>Nh,ZodType:()=>F,ZodULID:()=>Hc,ZodURL:()=>Pi,ZodUUID:()=>Dt,ZodUndefined:()=>Sh,ZodUnion:()=>Ti,ZodUnknown:()=>Ch,ZodVoid:()=>Ih,ZodXID:()=>Bc,ZodXor:()=>Rh,_ZodString:()=>Dc,_default:()=>Hh,_function:()=>Uw,any:()=>nu,array:()=>z,base64:()=>ow,base64url:()=>iw,bigint:()=>bw,boolean:()=>ae,catch:()=>Qh,check:()=>Fw,cidrv4:()=>rw,cidrv6:()=>nw,clone:()=>oe,codec:()=>Mw,coerce:()=>Li,compile:()=>Op,config:()=>be,core:()=>Wt,creditCard:()=>aw,cuid:()=>Jv,cuid2:()=>Wv,currencyCode:()=>pw,custom:()=>cu,date:()=>Sw,decode:()=>ph,decodeAsync:()=>hh,deepPartial:()=>n0,describe:()=>Vw,discriminatedUnion:()=>Ri,e164:()=>sw,email:()=>Zv,emoji:()=>Bv,encode:()=>fh,encodeAsync:()=>mh,endsWith:()=>Bn,enum:()=>Oe,exactOptional:()=>Uh,file:()=>Aw,flattenError:()=>Wo,float32:()=>hw,float64:()=>_w,formatError:()=>Go,fromJSONSchema:()=>e0,function:()=>Uw,getDiscriminatedOption:()=>Xf,getErrorMap:()=>vC,globalRegistry:()=>Re,gt:()=>Nt,gte:()=>dt,guid:()=>Lv,hash:()=>mw,hex:()=>fw,hostname:()=>dw,httpUrl:()=>Hv,iban:()=>cw,includes:()=>Vn,input:()=>s0,instanceof:()=>Bw,int:()=>Nc,int32:()=>gw,int64:()=>vw,intersection:()=>uo,invertCodec:()=>Zw,ipv4:()=>Xv,ipv6:()=>tw,iso:()=>Yr,json:()=>Jw,jwt:()=>uw,keyof:()=>zw,ksuid:()=>Yv,lazy:()=>o_,length:()=>Kr,literal:()=>O,locales:()=>hi,looseObject:()=>ve,looseRecord:()=>Iw,lowercase:()=>Un,lt:()=>At,lte:()=>lt,mac:()=>ew,map:()=>Tw,maxLength:()=>Br,maxSize:()=>dr,memoizer:()=>mi,meta:()=>Hw,mime:()=>Jn,minLength:()=>Jt,minSize:()=>jt,multipleOf:()=>lr,nan:()=>Dw,nanoid:()=>Kv,nativeEnum:()=>Ow,negative:()=>xc,never:()=>ou,nonnegative:()=>Sc,nonoptional:()=>Jh,nonpositive:()=>kc,normalize:()=>Wn,null:()=>Ci,nullable:()=>zi,nullish:()=>Nw,number:()=>G,object:()=>P,optional:()=>ue,output:()=>a0,overwrite:()=>zt,parse:()=>ch,parseAsync:()=>uh,partialRecord:()=>Ew,pipe:()=>jc,positive:()=>$c,prefault:()=>Kh,preprocess:()=>Di,prettifyError:()=>ed,promise:()=>qw,properties:()=>Kn,property:()=>zc,readonly:()=>t_,record:()=>de,refine:()=>a_,regex:()=>qn,regexes:()=>_t,registry:()=>Qa,safeDecode:()=>gh,safeDecodeAsync:()=>bh,safeEncode:()=>_h,safeEncodeAsync:()=>yh,safeParse:()=>lh,safeParseAsync:()=>dh,set:()=>Rw,setErrorMap:()=>bC,size:()=>Hr,slugify:()=>Xn,startsWith:()=>Hn,strictObject:()=>Pw,string:()=>y,stringFormat:()=>lw,stringbool:()=>Kw,success:()=>jw,superRefine:()=>c_,symbol:()=>$w,templateLiteral:()=>Lw,toJSONSchema:()=>Ic,toLowerCase:()=>Qn,toUpperCase:()=>Yn,toZod:()=>Mo,transform:()=>iu,treeifyError:()=>Xl,trim:()=>Gn,tuple:()=>jh,uint32:()=>yw,uint64:()=>ww,ulid:()=>Gv,undefined:()=>xw,union:()=>ce,unknown:()=>pe,uppercase:()=>Fn,url:()=>Lc,util:()=>T,uuid:()=>qv,uuidv4:()=>Uv,uuidv6:()=>Fv,uuidv7:()=>Vv,validate:()=>An,validateAsync:()=>Nn,void:()=>kw,withParser:()=>Ya,xid:()=>Qv,xor:()=>Cw});var m_=ee(()=>{nt();br();Oc();ah();vh();Ww();nt();Si();t0();o0();c0();Pp();uu();uu();u0()});var l0=ee(()=>{m_();m_()});var lu=ee(()=>{l0()});var as=I(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.regexpCode=ne.getEsmExportName=ne.getProperty=ne.safeStringify=ne.stringify=ne.strConcat=ne.addCodeArg=ne.str=ne._=ne.nil=ne._Code=ne.Name=ne.IDENTIFIER=ne._CodeOrName=void 0;var is=class{};ne._CodeOrName=is;ne.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var rn=class extends is{constructor(t){if(super(),!ne.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}}};ne.Name=rn;var vt=class extends is{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 rn&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ne._Code=vt;ne.nil=new vt("");function N0(e,...t){let r=[e[0]],n=0;for(;n<t.length;)F_(r,t[n]),r.push(e[++n]);return new vt(r)}ne._=N0;var U_=new vt("+");function j0(e,...t){let r=[ss(e[0])],n=0;for(;n<t.length;)r.push(U_),F_(r,t[n]),r.push(U_,ss(e[++n]));return EI(r),new vt(r)}ne.str=j0;function F_(e,t){t instanceof vt?e.push(...t._items):t instanceof rn?e.push(t):e.push(RI(t))}ne.addCodeArg=F_;function EI(e){let t=1;for(;t<e.length-1;){if(e[t]===U_){let r=II(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function II(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof rn||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 rn))return`"${e}${t.slice(1)}`}function TI(e,t){return t.emptyStr()?e:e.emptyStr()?t:j0`${e}${t}`}ne.strConcat=TI;function RI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:ss(Array.isArray(e)?e.join(","):e)}function OI(e){return new vt(ss(e))}ne.stringify=OI;function ss(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ne.safeStringify=ss;function AI(e){return typeof e=="string"&&ne.IDENTIFIER.test(e)?new vt(`.${e}`):N0`[${e}]`}ne.getProperty=AI;function NI(e){if(typeof e=="string"&&ne.IDENTIFIER.test(e))return new vt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}ne.getEsmExportName=NI;function jI(e){return new vt(e.toString())}ne.regexpCode=jI});var B_=I(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.ValueScope=st.ValueScopeName=st.Scope=st.varKinds=st.UsedValueState=void 0;var it=as(),V_=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Iu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Iu||(st.UsedValueState=Iu={}));st.varKinds={const:new it.Name("const"),let:new it.Name("let"),var:new it.Name("var")};var Tu=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof it.Name?t:this.name(t)}name(t){return new it.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}}};st.Scope=Tu;var Ru=class extends it.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,it._)`.${new it.Name(r)}[${n}]`}};st.ValueScopeName=Ru;var DI=(0,it._)`\n`,H_=class extends Tu{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?DI:it.nil}}get(){return this._scope}name(t){return new Ru(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 o=this.toName(t),{prefix:i}=o,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[i];if(a){let l=a.get(s);if(l)return l}else a=this._values[i]=new Map;a.set(s,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,itemIndex:u}),o}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,it._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=it.nil;for(let s in t){let a=t[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Iu.Started);let l=r(u);if(l){let f=this.opts.es5?st.varKinds.var:st.varKinds.const;i=(0,it._)`${i}${f} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))i=(0,it._)`${i}${l}${this.opts._n}`;else throw new V_(u);c.set(u,Iu.Completed)})}return i}};st.ValueScope=H_});var B=I(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.or=K.and=K.not=K.CodeGen=K.operators=K.varKinds=K.ValueScopeName=K.ValueScope=K.Scope=K.Name=K.regexpCode=K.stringify=K.getProperty=K.nil=K.strConcat=K.str=K._=void 0;var Y=as(),Ct=B_(),xr=as();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return xr._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return xr.str}});Object.defineProperty(K,"strConcat",{enumerable:!0,get:function(){return xr.strConcat}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return xr.nil}});Object.defineProperty(K,"getProperty",{enumerable:!0,get:function(){return xr.getProperty}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return xr.stringify}});Object.defineProperty(K,"regexpCode",{enumerable:!0,get:function(){return xr.regexpCode}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return xr.Name}});var ju=B_();Object.defineProperty(K,"Scope",{enumerable:!0,get:function(){return ju.Scope}});Object.defineProperty(K,"ValueScope",{enumerable:!0,get:function(){return ju.ValueScope}});Object.defineProperty(K,"ValueScopeName",{enumerable:!0,get:function(){return ju.ValueScopeName}});Object.defineProperty(K,"varKinds",{enumerable:!0,get:function(){return ju.varKinds}});K.operators={GT:new Y._Code(">"),GTE:new Y._Code(">="),LT:new Y._Code("<"),LTE:new Y._Code("<="),EQ:new Y._Code("==="),NEQ:new Y._Code("!=="),NOT:new Y._Code("!"),OR:new Y._Code("||"),AND:new Y._Code("&&"),ADD:new Y._Code("+")};var Qt=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},K_=class extends Qt{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ct.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=$o(this.rhs,t,r)),this}get names(){return this.rhs instanceof Y._CodeOrName?this.rhs.names:{}}},Ou=class extends Qt{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 Y.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=$o(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Y.Name?{}:{...this.lhs.names};return Nu(t,this.rhs)}},J_=class extends Ou{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},W_=class extends Qt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},G_=class extends Qt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Q_=class extends Qt{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Y_=class extends Qt{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=$o(this.code,t,r),this}get names(){return this.code instanceof Y._CodeOrName?this.code.names:{}}},cs=class extends Qt{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,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(MI(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>sn(t,r.names),{})}},Yt=class extends cs{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},X_=class extends cs{},wo=class extends Yt{};wo.kind="else";var nn=class e extends Yt{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 wo(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(D0(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=$o(this.condition,t,r),this}get names(){let t=super.names;return Nu(t,this.condition),this.else&&sn(t,this.else.names),t}};nn.kind="if";var on=class extends Yt{};on.kind="for";var eg=class extends on{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=$o(this.iteration,t,r),this}get names(){return sn(super.names,this.iteration.names)}},tg=class extends on{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Ct.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=Nu(super.names,this.from);return Nu(t,this.to)}},Au=class extends on{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}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=$o(this.iterable,t,r),this}get names(){return sn(super.names,this.iterable.names)}},us=class extends Yt{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)}};us.kind="func";var ls=class extends cs{render(t){return"return "+super.render(t)}};ls.kind="return";var rg=class extends Yt{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,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&sn(t,this.catch.names),this.finally&&sn(t,this.finally.names),t}},ds=class extends Yt{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};ds.kind="catch";var fs=class extends Yt{render(t){return"finally"+super.render(t)}};fs.kind="finally";var ng=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
77
+ `:""},this._extScope=t,this._scope=new Ct.Scope({parent:t}),this._nodes=[new X_]}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,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new K_(t,i,n)),i}const(t,r,n){return this._def(Ct.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ct.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ct.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Ou(t,r,n))}add(t,r){return this._leafNode(new J_(t,K.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Y.nil&&this._leafNode(new Y_(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Y.addCodeArg)(r,o));return r.push("}"),new Y._Code(r)}if(t,r,n){if(this._blockNode(new nn(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 nn(t))}else(){return this._elseNode(new wo)}endIf(){return this._endBlockNode(nn,wo)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new eg(t),r)}forRange(t,r,n,o,i=this.opts.es5?Ct.varKinds.var:Ct.varKinds.let){let s=this._scope.toName(t);return this._for(new tg(i,s,r,n),()=>o(s))}forOf(t,r,n,o=Ct.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof Y.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Y._)`${s}.length`,a=>{this.var(i,(0,Y._)`${s}[${a}]`),n(i)})}return this._for(new Au("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Y._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new Au("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(on)}label(t){return this._leafNode(new W_(t))}break(t){return this._leafNode(new G_(t))}return(t){let r=new ls;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ls)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new rg;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new ds(i),r(i)}return n&&(this._currNode=o.finally=new fs,this.code(n)),this._endBlockNode(ds,fs)}throw(t){return this._leafNode(new Q_(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=Y.nil,n,o){return this._blockNode(new us(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(us)}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 nn))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}};K.CodeGen=ng;function sn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Nu(e,t){return t instanceof Y._CodeOrName?sn(e,t.names):e}function $o(e,t,r){if(e instanceof Y.Name)return n(e);if(!o(e))return e;return new Y._Code(e._items.reduce((i,s)=>(s instanceof Y.Name&&(s=n(s)),s instanceof Y._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function o(i){return i instanceof Y._Code&&i._items.some(s=>s instanceof Y.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function MI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function D0(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Y._)`!${og(e)}`}K.not=D0;var ZI=M0(K.operators.AND);function LI(...e){return e.reduce(ZI)}K.and=LI;var qI=M0(K.operators.OR);function UI(...e){return e.reduce(qI)}K.or=UI;function M0(e){return(t,r)=>t===Y.nil?r:r===Y.nil?t:(0,Y._)`${og(t)} ${e} ${og(r)}`}function og(e){return e instanceof Y.Name?e:(0,Y._)`(${e})`}});var te=I(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.checkStrictMode=W.getErrorPath=W.Type=W.useFunc=W.setEvaluated=W.evaluatedPropsToName=W.mergeEvaluated=W.eachItem=W.unescapeJsonPointer=W.escapeJsonPointer=W.escapeFragment=W.unescapeFragment=W.schemaRefOrVal=W.schemaHasRulesButRef=W.schemaHasRules=W.checkUnknownRules=W.alwaysValidSchema=W.toHash=void 0;var he=B(),FI=as();function VI(e){let t={};for(let r of e)t[r]=!0;return t}W.toHash=VI;function HI(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(q0(e,t),!U0(t,e.self.RULES.all))}W.alwaysValidSchema=HI;function q0(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||H0(e,`unknown keyword: "${i}"`)}W.checkUnknownRules=q0;function U0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}W.schemaHasRules=U0;function BI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}W.schemaHasRulesButRef=BI;function KI({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,he._)`${r}`}return(0,he._)`${e}${t}${(0,he.getProperty)(n)}`}W.schemaRefOrVal=KI;function JI(e){return F0(decodeURIComponent(e))}W.unescapeFragment=JI;function WI(e){return encodeURIComponent(sg(e))}W.escapeFragment=WI;function sg(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}W.escapeJsonPointer=sg;function F0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}W.unescapeJsonPointer=F0;function GI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}W.eachItem=GI;function Z0({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,s,a)=>{let c=s===void 0?i:s instanceof he.Name?(i instanceof he.Name?e(o,i,s):t(o,i,s),s):i instanceof he.Name?(t(o,s,i),i):r(i,s);return a===he.Name&&!(c instanceof he.Name)?n(o,c):c}}W.mergeEvaluated={props:Z0({mergeNames:(e,t,r)=>e.if((0,he._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,he._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,he._)`${r} || {}`).code((0,he._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,he._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,he._)`${r} || {}`),ag(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:V0}),items:Z0({mergeNames:(e,t,r)=>e.if((0,he._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,he._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,he._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,he._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function V0(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,he._)`{}`);return t!==void 0&&ag(e,r,t),r}W.evaluatedPropsToName=V0;function ag(e,t,r){Object.keys(r).forEach(n=>e.assign((0,he._)`${t}${(0,he.getProperty)(n)}`,!0))}W.setEvaluated=ag;var L0={};function QI(e,t){return e.scopeValue("func",{ref:t,code:L0[t.code]||(L0[t.code]=new FI._Code(t.code))})}W.useFunc=QI;var ig;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ig||(W.Type=ig={}));function YI(e,t,r){if(e instanceof he.Name){let n=t===ig.Num;return r?n?(0,he._)`"[" + ${e} + "]"`:(0,he._)`"['" + ${e} + "']"`:n?(0,he._)`"/" + ${e}`:(0,he._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,he.getProperty)(e).toString():"/"+sg(e)}W.getErrorPath=YI;function H0(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}W.checkStrictMode=H0});var Xt=I(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});var Ue=B(),XI={data:new Ue.Name("data"),valCxt:new Ue.Name("valCxt"),instancePath:new Ue.Name("instancePath"),parentData:new Ue.Name("parentData"),parentDataProperty:new Ue.Name("parentDataProperty"),rootData:new Ue.Name("rootData"),dynamicAnchors:new Ue.Name("dynamicAnchors"),vErrors:new Ue.Name("vErrors"),errors:new Ue.Name("errors"),this:new Ue.Name("this"),self:new Ue.Name("self"),scope:new Ue.Name("scope"),json:new Ue.Name("json"),jsonPos:new Ue.Name("jsonPos"),jsonLen:new Ue.Name("jsonLen"),jsonPart:new Ue.Name("jsonPart")};cg.default=XI});var ps=I(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.extendErrors=Fe.resetErrorsCount=Fe.reportExtraError=Fe.reportError=Fe.keyword$DataError=Fe.keywordError=void 0;var re=B(),Du=te(),Qe=Xt();Fe.keywordError={message:({keyword:e})=>(0,re.str)`must pass "${e}" keyword validation`};Fe.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,re.str)`"${e}" keyword must be ${t} ($data)`:(0,re.str)`"${e}" keyword is invalid ($data)`};function eT(e,t=Fe.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:s,allErrors:a}=o,c=J0(e,t,r);n??(s||a)?B0(i,c):K0(o,(0,re._)`[${c}]`)}Fe.reportError=eT;function tT(e,t=Fe.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:s}=n,a=J0(e,t,r);B0(o,a),i||s||K0(n,Qe.default.vErrors)}Fe.reportExtraError=tT;function rT(e,t){e.assign(Qe.default.errors,t),e.if((0,re._)`${Qe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,re._)`${Qe.default.vErrors}.length`,t),()=>e.assign(Qe.default.vErrors,null)))}Fe.resetErrorsCount=rT;function nT({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",o,Qe.default.errors,a=>{e.const(s,(0,re._)`${Qe.default.vErrors}[${a}]`),e.if((0,re._)`${s}.instancePath === undefined`,()=>e.assign((0,re._)`${s}.instancePath`,(0,re.strConcat)(Qe.default.instancePath,i.errorPath))),e.assign((0,re._)`${s}.schemaPath`,(0,re.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,re._)`${s}.schema`,r),e.assign((0,re._)`${s}.data`,n))})}Fe.extendErrors=nT;function B0(e,t){let r=e.const("err",t);e.if((0,re._)`${Qe.default.vErrors} === null`,()=>e.assign(Qe.default.vErrors,(0,re._)`[${r}]`),(0,re._)`${Qe.default.vErrors}.push(${r})`),e.code((0,re._)`${Qe.default.errors}++`)}function K0(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,re._)`new ${e.ValidationError}(${t})`):(r.assign((0,re._)`${n}.errors`,t),r.return(!1))}var an={keyword:new re.Name("keyword"),schemaPath:new re.Name("schemaPath"),params:new re.Name("params"),propertyName:new re.Name("propertyName"),message:new re.Name("message"),schema:new re.Name("schema"),parentSchema:new re.Name("parentSchema")};function J0(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,re._)`{}`:oT(e,t,r)}function oT(e,t,r={}){let{gen:n,it:o}=e,i=[iT(o,r),sT(e,r)];return aT(e,t,i),n.object(...i)}function iT({errorPath:e},{instancePath:t}){let r=t?(0,re.str)`${e}${(0,Du.getErrorPath)(t,Du.Type.Str)}`:e;return[Qe.default.instancePath,(0,re.strConcat)(Qe.default.instancePath,r)]}function sT({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,re.str)`${t}/${e}`;return r&&(o=(0,re.str)`${o}${(0,Du.getErrorPath)(r,Du.Type.Str)}`),[an.schemaPath,o]}function aT(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:s,it:a}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:f}=a;n.push([an.keyword,o],[an.params,typeof t=="function"?t(e):t||(0,re._)`{}`]),c.messages&&n.push([an.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([an.schema,s],[an.parentSchema,(0,re._)`${l}${f}`],[Qe.default.data,i]),u&&n.push([an.propertyName,u])}});var G0=I(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.boolOrEmptySchema=xo.topBoolOrEmptySchema=void 0;var cT=ps(),uT=B(),lT=Xt(),dT={message:"boolean schema is false"};function fT(e){let{gen:t,schema:r,validateName:n}=e;r===!1?W0(e,!1):typeof r=="object"&&r.$async===!0?t.return(lT.default.data):(t.assign((0,uT._)`${n}.errors`,null),t.return(!0))}xo.topBoolOrEmptySchema=fT;function pT(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),W0(e)):r.var(t,!0)}xo.boolOrEmptySchema=pT;function W0(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,cT.reportError)(o,dT,void 0,t)}});var ug=I(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.getRules=ko.isJSONType=void 0;var mT=["string","number","integer","boolean","null","object","array"],hT=new Set(mT);function _T(e){return typeof e=="string"&&hT.has(e)}ko.isJSONType=_T;function gT(){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:{}}}ko.getRules=gT});var lg=I(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.shouldUseRule=kr.shouldUseGroup=kr.schemaHasRulesForType=void 0;function yT({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Q0(e,n)}kr.schemaHasRulesForType=yT;function Q0(e,t){return t.rules.some(r=>Y0(e,r))}kr.shouldUseGroup=Q0;function Y0(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))}kr.shouldUseRule=Y0});var ms=I(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.reportTypeError=Ve.checkDataTypes=Ve.checkDataType=Ve.coerceAndCheckDataType=Ve.getJSONTypes=Ve.getSchemaTypes=Ve.DataType=void 0;var bT=ug(),vT=lg(),wT=ps(),H=B(),X0=te(),So;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(So||(Ve.DataType=So={}));function $T(e){let t=e$(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}Ve.getSchemaTypes=$T;function e$(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(bT.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ve.getJSONTypes=e$;function xT(e,t){let{gen:r,data:n,opts:o}=e,i=kT(t,o.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,vT.schemaHasRulesForType)(e,t[0]));if(s){let a=fg(t,n,o.strictNumbers,So.Wrong);r.if(a,()=>{i.length?ST(e,t,i):pg(e)})}return s}Ve.coerceAndCheckDataType=xT;var t$=new Set(["string","number","integer","boolean","null"]);function kT(e,t){return t?e.filter(r=>t$.has(r)||t==="array"&&r==="array"):[]}function ST(e,t,r){let{gen:n,data:o,opts:i}=e,s=n.let("dataType",(0,H._)`typeof ${o}`),a=n.let("coerced",(0,H._)`undefined`);i.coerceTypes==="array"&&n.if((0,H._)`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,H._)`${o}[0]`).assign(s,(0,H._)`typeof ${o}`).if(fg(t,o,i.strictNumbers),()=>n.assign(a,o))),n.if((0,H._)`${a} !== undefined`);for(let u of r)(t$.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),pg(e),n.endIf(),n.if((0,H._)`${a} !== undefined`,()=>{n.assign(o,a),zT(e,a)});function c(u){switch(u){case"string":n.elseIf((0,H._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,H._)`"" + ${o}`).elseIf((0,H._)`${o} === null`).assign(a,(0,H._)`""`);return;case"number":n.elseIf((0,H._)`${s} == "boolean" || ${o} === null
78
+ || (${s} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,H._)`+${o}`);return;case"integer":n.elseIf((0,H._)`${s} === "boolean" || ${o} === null
79
+ || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,H._)`+${o}`);return;case"boolean":n.elseIf((0,H._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,H._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,H._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,H._)`${s} === "string" || ${s} === "number"
80
+ || ${s} === "boolean" || ${o} === null`).assign(a,(0,H._)`[${o}]`)}}}function zT({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,H._)`${t} !== undefined`,()=>e.assign((0,H._)`${t}[${r}]`,n))}function dg(e,t,r,n=So.Correct){let o=n===So.Correct?H.operators.EQ:H.operators.NEQ,i;switch(e){case"null":return(0,H._)`${t} ${o} null`;case"array":i=(0,H._)`Array.isArray(${t})`;break;case"object":i=(0,H._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s((0,H._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return(0,H._)`typeof ${t} ${o} ${e}`}return n===So.Correct?i:(0,H.not)(i);function s(a=H.nil){return(0,H.and)((0,H._)`typeof ${t} == "number"`,a,r?(0,H._)`isFinite(${t})`:H.nil)}}Ve.checkDataType=dg;function fg(e,t,r,n){if(e.length===1)return dg(e[0],t,r,n);let o,i=(0,X0.toHash)(e);if(i.array&&i.object){let s=(0,H._)`typeof ${t} != "object"`;o=i.null?s:(0,H._)`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=H.nil;i.number&&delete i.integer;for(let s in i)o=(0,H.and)(o,dg(s,t,r,n));return o}Ve.checkDataTypes=fg;var PT={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,H._)`{type: ${e}}`:(0,H._)`{type: ${t}}`};function pg(e){let t=CT(e);(0,wT.reportError)(t,PT)}Ve.reportTypeError=pg;function CT(e){let{gen:t,data:r,schema:n}=e,o=(0,X0.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var n$=I(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.assignDefaults=void 0;var zo=B(),ET=te();function IT(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)r$(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>r$(e,i,o.default))}Mu.assignDefaults=IT;function r$(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=(0,zo._)`${i}${(0,zo.getProperty)(t)}`;if(o){(0,ET.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=(0,zo._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,zo._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,zo._)`${a} = ${(0,zo.stringify)(r)}`)}});var wt=I(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.validateUnion=me.validateArray=me.usePattern=me.callValidateCode=me.schemaProperties=me.allSchemaProperties=me.noPropertyInData=me.propertyInData=me.isOwnProperty=me.hasPropFunc=me.reportMissingProp=me.checkMissingProp=me.checkReportMissingProp=void 0;var _e=B(),mg=te(),Sr=Xt(),TT=te();function RT(e,t){let{gen:r,data:n,it:o}=e;r.if(_g(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,_e._)`${t}`},!0),e.error()})}me.checkReportMissingProp=RT;function OT({gen:e,data:t,it:{opts:r}},n,o){return(0,_e.or)(...n.map(i=>(0,_e.and)(_g(e,t,i,r.ownProperties),(0,_e._)`${o} = ${i}`)))}me.checkMissingProp=OT;function AT(e,t){e.setParams({missingProperty:t},!0),e.error()}me.reportMissingProp=AT;function o$(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,_e._)`Object.prototype.hasOwnProperty`})}me.hasPropFunc=o$;function hg(e,t,r){return(0,_e._)`${o$(e)}.call(${t}, ${r})`}me.isOwnProperty=hg;function NT(e,t,r,n){let o=(0,_e._)`${t}${(0,_e.getProperty)(r)} !== undefined`;return n?(0,_e._)`${o} && ${hg(e,t,r)}`:o}me.propertyInData=NT;function _g(e,t,r,n){let o=(0,_e._)`${t}${(0,_e.getProperty)(r)} === undefined`;return n?(0,_e.or)(o,(0,_e.not)(hg(e,t,r))):o}me.noPropertyInData=_g;function i$(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}me.allSchemaProperties=i$;function jT(e,t){return i$(t).filter(r=>!(0,mg.alwaysValidSchema)(e,t[r]))}me.schemaProperties=jT;function DT({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let l=u?(0,_e._)`${e}, ${t}, ${n}${o}`:t,f=[[Sr.default.instancePath,(0,_e.strConcat)(Sr.default.instancePath,i)],[Sr.default.parentData,s.parentData],[Sr.default.parentDataProperty,s.parentDataProperty],[Sr.default.rootData,Sr.default.rootData]];s.opts.dynamicRef&&f.push([Sr.default.dynamicAnchors,Sr.default.dynamicAnchors]);let d=(0,_e._)`${l}, ${r.object(...f)}`;return c!==_e.nil?(0,_e._)`${a}.call(${c}, ${d})`:(0,_e._)`${a}(${d})`}me.callValidateCode=DT;var MT=(0,_e._)`new RegExp`;function ZT({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,_e._)`${o.code==="new RegExp"?MT:(0,TT.useFunc)(e,o)}(${r}, ${n})`})}me.usePattern=ZT;function LT(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",(0,_e._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:mg.Type.Num},i),t.if((0,_e.not)(i),a)})}}me.validateArray=LT;function qT(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,mg.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);t.assign(s,(0,_e._)`${s} || ${a}`),e.mergeValidEvaluated(l,a)||t.if((0,_e.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}me.validateUnion=qT});var c$=I(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.validateKeywordUsage=Mt.validSchemaType=Mt.funcKeywordCode=Mt.macroKeywordCode=void 0;var Ye=B(),cn=Xt(),UT=wt(),FT=ps();function VT(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=a$(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:Ye.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Mt.macroKeywordCode=VT;function HT(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;KT(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,l=a$(n,o,u),f=n.let("valid");e.block$data(f,d),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function d(){if(t.errors===!1)h(),t.modifying&&s$(e),g(()=>e.error());else{let w=t.async?p():m();t.modifying&&s$(e),g(()=>BT(e,w))}}function p(){let w=n.let("ruleErrs",null);return n.try(()=>h((0,Ye._)`await `),v=>n.assign(f,!1).if((0,Ye._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(w,(0,Ye._)`${v}.errors`),()=>n.throw(v))),w}function m(){let w=(0,Ye._)`${l}.errors`;return n.assign(w,null),h(Ye.nil),w}function h(w=t.async?(0,Ye._)`await `:Ye.nil){let v=c.opts.passContext?cn.default.this:cn.default.self,x=!("compile"in t&&!a||t.schema===!1);n.assign(f,(0,Ye._)`${w}${(0,UT.callValidateCode)(e,l,v,x)}`,t.modifying)}function g(w){var v;n.if((0,Ye.not)((v=t.valid)!==null&&v!==void 0?v:f),w)}}Mt.funcKeywordCode=HT;function s$(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Ye._)`${n.parentData}[${n.parentDataProperty}]`))}function BT(e,t){let{gen:r}=e;r.if((0,Ye._)`Array.isArray(${t})`,()=>{r.assign(cn.default.vErrors,(0,Ye._)`${cn.default.vErrors} === null ? ${t} : ${cn.default.vErrors}.concat(${t})`).assign(cn.default.errors,(0,Ye._)`${cn.default.vErrors}.length`),(0,FT.extendErrors)(e)},()=>e.error())}function KT({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function a$(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,Ye.stringify)(r)})}function JT(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")}Mt.validSchemaType=JT;function WT({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let s=o.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Mt.validateKeywordUsage=WT});var l$=I(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.extendSubschemaMode=zr.extendSubschemaData=zr.getSubschema=void 0;var Zt=B(),u$=te();function GT(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,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 a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,Zt._)`${e.schemaPath}${(0,Zt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,Zt._)`${e.schemaPath}${(0,Zt.getProperty)(t)}${(0,Zt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,u$.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}zr.getSubschema=GT;function QT(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:f}=t,d=a.let("data",(0,Zt._)`${t.data}${(0,Zt.getProperty)(r)}`,!0);c(d),e.errorPath=(0,Zt.str)`${u}${(0,u$.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,Zt._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Zt.Name?o:a.let("data",o,!0);c(u),s!==void 0&&(e.propertyName=s)}i&&(e.dataTypes=i);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}zr.extendSubschemaData=QT;function YT(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}zr.extendSubschemaMode=YT});var gg=I((oq,d$)=>{"use strict";d$.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,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))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(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var p$=I((iq,f$)=>{"use strict";var Pr=f$.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Zu(t,n,o,e,"",e)};Pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pr.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 Zu(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var l in n){var f=n[l];if(Array.isArray(f)){if(l in Pr.arrayKeywords)for(var d=0;d<f.length;d++)Zu(e,t,r,f[d],o+"/"+l+"/"+d,i,o,l,n,d)}else if(l in Pr.propsKeywords){if(f&&typeof f=="object")for(var p in f)Zu(e,t,r,f[p],o+"/"+l+"/"+XT(p),i,o,l,n,p)}else(l in Pr.keywords||e.allKeys&&!(l in Pr.skipKeywords))&&Zu(e,t,r,f,o+"/"+l,i,o,l,n)}r(n,o,i,s,a,c,u)}}function XT(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var hs=I(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.getSchemaRefs=at.resolveUrl=at.normalizeId=at._getFullPath=at.getFullPath=at.inlineRef=void 0;var eR=te(),tR=gg(),rR=p$(),nR=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function oR(e,t=!0){return typeof e=="boolean"?!0:t===!0?!yg(e):t?m$(e)<=t:!1}at.inlineRef=oR;var iR=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function yg(e){for(let t in e){if(iR.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(yg)||typeof r=="object"&&yg(r))return!0}return!1}function m$(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!nR.has(r)&&(typeof e[r]=="object"&&(0,eR.eachItem)(e[r],n=>t+=m$(n)),t===1/0))return 1/0}return t}function h$(e,t="",r){r!==!1&&(t=Po(t));let n=e.parse(t);return _$(e,n)}at.getFullPath=h$;function _$(e,t){return e.serialize(t).split("#")[0]+"#"}at._getFullPath=_$;var sR=/#\/?$/;function Po(e){return e?e.replace(sR,""):""}at.normalizeId=Po;function aR(e,t,r){return r=Po(r),e.resolve(t,r)}at.resolveUrl=aR;var cR=/^[a-z_][-a-z0-9._]*$/i;function uR(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Po(e[r]||t),i={"":o},s=h$(n,o,!1),a={},c=new Set;return rR(e,{allKeys:!0},(f,d,p,m)=>{if(m===void 0)return;let h=s+d,g=i[m];typeof f[r]=="string"&&(g=w.call(this,f[r])),v.call(this,f.$anchor),v.call(this,f.$dynamicAnchor),i[d]=g;function w(x){let C=this.opts.uriResolver.resolve;if(x=Po(g?C(g,x):x),c.has(x))throw l(x);c.add(x);let $=this.refs[x];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?u(f,$.schema,x):x!==Po(h)&&(x[0]==="#"?(u(f,a[x],x),a[x]=f):this.refs[x]=h),x}function v(x){if(typeof x=="string"){if(!cR.test(x))throw new Error(`invalid anchor "${x}"`);w.call(this,`#${x}`)}}}),a;function u(f,d,p){if(d!==void 0&&!tR(f,d))throw l(p)}function l(f){return new Error(`reference "${f}" resolves to more than one schema`)}}at.getSchemaRefs=uR});var ys=I(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.getData=Cr.KeywordCxt=Cr.validateFunctionCode=void 0;var w$=G0(),g$=ms(),vg=lg(),Lu=ms(),lR=n$(),gs=c$(),bg=l$(),A=B(),L=Xt(),dR=hs(),er=te(),_s=ps();function fR(e){if(k$(e)&&(S$(e),x$(e))){hR(e);return}$$(e,()=>(0,w$.topBoolOrEmptySchema)(e))}Cr.validateFunctionCode=fR;function $$({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,A._)`${L.default.data}, ${L.default.valCxt}`,n.$async,()=>{e.code((0,A._)`"use strict"; ${y$(r,o)}`),mR(e,o),e.code(i)}):e.func(t,(0,A._)`${L.default.data}, ${pR(o)}`,n.$async,()=>e.code(y$(r,o)).code(i))}function pR(e){return(0,A._)`{${L.default.instancePath}="", ${L.default.parentData}, ${L.default.parentDataProperty}, ${L.default.rootData}=${L.default.data}${e.dynamicRef?(0,A._)`, ${L.default.dynamicAnchors}={}`:A.nil}}={}`}function mR(e,t){e.if(L.default.valCxt,()=>{e.var(L.default.instancePath,(0,A._)`${L.default.valCxt}.${L.default.instancePath}`),e.var(L.default.parentData,(0,A._)`${L.default.valCxt}.${L.default.parentData}`),e.var(L.default.parentDataProperty,(0,A._)`${L.default.valCxt}.${L.default.parentDataProperty}`),e.var(L.default.rootData,(0,A._)`${L.default.valCxt}.${L.default.rootData}`),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,A._)`${L.default.valCxt}.${L.default.dynamicAnchors}`)},()=>{e.var(L.default.instancePath,(0,A._)`""`),e.var(L.default.parentData,(0,A._)`undefined`),e.var(L.default.parentDataProperty,(0,A._)`undefined`),e.var(L.default.rootData,L.default.data),t.dynamicRef&&e.var(L.default.dynamicAnchors,(0,A._)`{}`)})}function hR(e){let{schema:t,opts:r,gen:n}=e;$$(e,()=>{r.$comment&&t.$comment&&P$(e),vR(e),n.let(L.default.vErrors,null),n.let(L.default.errors,0),r.unevaluated&&_R(e),z$(e),xR(e)})}function _R(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,A._)`${r}.evaluated`),t.if((0,A._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,A._)`${e.evaluated}.props`,(0,A._)`undefined`)),t.if((0,A._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,A._)`${e.evaluated}.items`,(0,A._)`undefined`))}function y$(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,A._)`/*# sourceURL=${r} */`:A.nil}function gR(e,t){if(k$(e)&&(S$(e),x$(e))){yR(e,t);return}(0,w$.boolOrEmptySchema)(e,t)}function x$({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 k$(e){return typeof e.schema!="boolean"}function yR(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&P$(e),wR(e),$R(e);let i=n.const("_errs",L.default.errors);z$(e,i),n.var(t,(0,A._)`${i} === ${L.default.errors}`)}function S$(e){(0,er.checkUnknownRules)(e),bR(e)}function z$(e,t){if(e.opts.jtd)return b$(e,[],!1,t);let r=(0,g$.getSchemaTypes)(e.schema),n=(0,g$.coerceAndCheckDataType)(e,r);b$(e,r,!n,t)}function bR(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,er.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function vR(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,er.checkStrictMode)(e,"default is ignored in the schema root")}function wR(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,dR.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function $R(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function P$({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,A._)`${L.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=(0,A.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,A._)`${L.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function xR(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,A._)`${L.default.errors} === 0`,()=>t.return(L.default.data),()=>t.throw((0,A._)`new ${o}(${L.default.vErrors})`)):(t.assign((0,A._)`${n}.errors`,L.default.vErrors),i.unevaluated&&kR(e),t.return((0,A._)`${L.default.errors} === 0`))}function kR({gen:e,evaluated:t,props:r,items:n}){r instanceof A.Name&&e.assign((0,A._)`${t}.props`,r),n instanceof A.Name&&e.assign((0,A._)`${t}.items`,n)}function b$(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,er.schemaHasRulesButRef)(i,l))){o.block(()=>E$(e,"$ref",l.all.$ref.definition));return}c.jtd||SR(e,t),o.block(()=>{for(let d of l.rules)f(d);f(l.post)});function f(d){(0,vg.shouldUseGroup)(i,d)&&(d.type?(o.if((0,Lu.checkDataType)(d.type,s,c.strictNumbers)),v$(e,d),t.length===1&&t[0]===d.type&&r&&(o.else(),(0,Lu.reportTypeError)(e)),o.endIf()):v$(e,d),a||o.if((0,A._)`${L.default.errors} === ${n||0}`))}}function v$(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,lR.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,vg.shouldUseRule)(n,i)&&E$(e,i.keyword,i.definition,t.type)})}function SR(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(zR(e,t),e.opts.allowUnionTypes||PR(e,t),CR(e,e.dataTypes))}function zR(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{C$(e.dataTypes,r)||wg(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),IR(e,t)}}function PR(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&wg(e,"use allowUnionTypes to allow union type keyword")}function CR(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,vg.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(s=>ER(t,s))&&wg(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function ER(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function C$(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function IR(e,t){let r=[];for(let n of e.dataTypes)C$(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function wg(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,er.checkStrictMode)(e,t,e.opts.strictTypes)}var qu=class{constructor(t,r,n){if((0,gs.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,er.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",I$(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,gs.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",L.default.errors))}result(t,r,n){this.failResult((0,A.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,A.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,A._)`${r} !== undefined && (${(0,A.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?_s.reportExtraError:_s.reportError)(this,this.def.error,r)}$dataError(){(0,_s.reportError)(this,this.def.$dataError||_s.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,_s.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=A.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=A.nil,r=A.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:s}=this;n.if((0,A.or)((0,A._)`${o} === undefined`,r)),t!==A.nil&&n.assign(t,!0),(i.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==A.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,A.or)(s(),a());function s(){if(n.length){if(!(r instanceof A.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,A._)`${(0,Lu.checkDataTypes)(c,r,i.opts.strictNumbers,Lu.DataType.Wrong)}`}return A.nil}function a(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,A._)`!${c}(${r})`}return A.nil}}subschema(t,r){let n=(0,bg.getSubschema)(this.it,t);(0,bg.extendSubschemaData)(n,this.it,t),(0,bg.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return gR(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=er.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=er.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,A.Name)),!0}};Cr.KeywordCxt=qu;function E$(e,t,r,n){let o=new qu(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,gs.funcKeywordCode)(o,r):"macro"in r?(0,gs.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,gs.funcKeywordCode)(o,r)}var TR=/^\/(?:[^~]|~0|~1)*$/,RR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function I$(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return L.default.rootData;if(e[0]==="/"){if(!TR.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=L.default.rootData}else{let u=RR.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=t)throw new Error(c("property/index",l));return n[t-l]}if(l>t)throw new Error(c("data",l));if(i=r[t-l],!o)return i}let s=i,a=o.split("/");for(let u of a)u&&(i=(0,A._)`${i}${(0,A.getProperty)((0,er.unescapeJsonPointer)(u))}`,s=(0,A._)`${s} && ${i}`);return s;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Cr.getData=I$});var Uu=I(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var $g=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};xg.default=$g});var bs=I(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});var kg=hs(),Sg=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,kg.resolveUrl)(t,r,n),this.missingSchema=(0,kg.normalizeId)((0,kg.getFullPath)(t,this.missingRef))}};zg.default=Sg});var Vu=I($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.resolveSchema=$t.getCompilingSchema=$t.resolveRef=$t.compileSchema=$t.SchemaEnv=void 0;var Et=B(),OR=Uu(),un=Xt(),It=hs(),T$=te(),AR=ys(),Co=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,It.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};$t.SchemaEnv=Co;function Cg(e){let t=R$.call(this,e);if(t)return t;let r=(0,It.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new Et.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;e.$async&&(a=s.scopeValue("Error",{ref:OR.default,code:(0,Et._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:un.default.data,parentData:un.default.parentData,parentDataProperty:un.default.parentDataProperty,dataNames:[un.default.data],dataPathArr:[Et.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Et.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Et.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Et._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,AR.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let f=s.toString();l=`${s.scopeRefs(un.default.scope)}return ${f}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${un.default.self}`,`${un.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{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:c,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof Et.Name?void 0:m,items:h instanceof Et.Name?void 0:h,dynamicProps:m instanceof Et.Name,dynamicItems:h instanceof Et.Name},p.source&&(p.source.evaluated=(0,Et.stringify)(p.evaluated))}return e.validate=p,e}catch(f){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),f}finally{this._compilations.delete(e)}}$t.compileSchema=Cg;function NR(e,t,r){var n;r=(0,It.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=MR.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(i=new Co({schema:s,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=jR.call(this,i)}$t.resolveRef=NR;function jR(e){return(0,It.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Cg.call(this,e)}function R$(e){for(let t of this._compilations)if(DR(t,e))return t}$t.getCompilingSchema=R$;function DR(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function MR(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Fu.call(this,e,t)}function Fu(e,t){let r=this.opts.uriResolver.parse(t),n=(0,It._getFullPath)(this.opts.uriResolver,r),o=(0,It.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Pg.call(this,r,e);let i=(0,It.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=Fu.call(this,e,s);return typeof a?.schema!="object"?void 0:Pg.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||Cg.call(this,s),i===(0,It.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,It.resolveUrl)(this.opts.uriResolver,o,u)),new Co({schema:a,schemaId:c,root:e,baseId:o})}return Pg.call(this,r,s)}}$t.resolveSchema=Fu;var ZR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Pg(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,T$.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!ZR.has(a)&&u&&(t=(0,It.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,T$.schemaHasRulesButRef)(r,this.RULES)){let a=(0,It.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Fu.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new Co({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var O$=I((dq,LR)=>{LR.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 Ag=I((fq,q$)=>{"use strict";var qR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ig=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),UR=RegExp.prototype.test.bind(/^\d*$/u),ln=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Tg=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),N$=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Rg=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),FR=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),ct=new Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)ct[t]="%"+e[t>>4]+e[t&15]}function He(e){return e<2048?ct[192|e>>6]+ct[128|e&63]:e<65536?ct[224|e>>12]+ct[128|e>>6&63]+ct[128|e&63]:ct[240|e>>18]+ct[128|e>>12&63]+ct[128|e>>6&63]+ct[128|e&63]}function VR(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 HR=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),BR=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),KR=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),JR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function WR(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!KR(e[t])){if(e[t]==="%"&&t+2<e.length&&ln(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function A$(e){let t=-1,r=0,n=-1,o=0;for(let a=0;a<e.length;a++)e[a]==="0"?(n===-1&&(n=a),o++,o>r&&(r=o,t=n)):(n=-1,o=0);if(r<2)return e.join(":");let i=e.slice(0,t).join(":"),s=e.slice(t+r).join(":");return i+"::"+s}function GR(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));let o=r.concat(n),i=0;for(let a=0;a<o.length;a++){let c=o[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==o.length-1||t!==-1&&n.length===0||!Ig(c))return;i+=2;continue}if(!HR(c))return;o[a]=parseInt(c,16).toString(16),i++}if(t===-1)return i!==8?void 0:A$(o);if(i>=8)return;let s=o.slice(0,r.length);for(let a=i;a<8;a++)s.push("0");for(let a=r.length;a<o.length;a++)s.push(o[a]);return A$(s)}function Eg(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&BR(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(QR(n,":")<2)return{host:e,isIPV6:!1,error:t};let o="",i=n.indexOf("%");if(i!==-1){let a=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(o=n.slice(i+a),!WR(o))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}let s=GR(n);return s===void 0?{host:e,isIPV6:!1,error:!0}:{host:s+(o?"%"+o:""),escapedHost:s+(o?"%25"+o:""),isIPV6:!0}}function QR(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function j$(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===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(o===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 YR(e){if(e===""||e[0]==="/")return j$(e);let t=e.split("/"),r=t.length-1,n=[],o=!1;for(let i=0;i<=r;i++){let s=t[i];s==="."||s===".."?(s===".."&&(n.length!==0&&n[n.length-1]!==".."?n.pop():n.push("..")),o=i===r):n.push(s)}return o&&n[n.length-1]!==".."&&n.push(""),(n.length===0||n[0]===""||n[0].includes(":"))&&n.unshift("."),n.join("/")}var XR={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},eO=/[@/?#:]/g,tO=/[@/?#]/g;function D$(e,t){let r=t?tO:eO;return r.lastIndex=0,e.replace(r,n=>XR[n])}function M$(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(ln(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));t&&Tg(s)?r+=s:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function rO(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(ln(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&Tg(s)?t+=s:t+="%"+i,r+=2;continue}}if(N$(n))t+=n;else{let o=e.charCodeAt(r);if(o<128)t+=L$(o)?n:ct[o];else if(o<55296||o>57343)t+=He(o);else if(o<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=He(65536+(o-55296<<10)+(i-56320)),r++):t+=He(65533)}else t+=He(65533)}}return t}function nO(e,t=!1){let r="",n=t&&e[0]!=="/";for(let o=0;o<e.length;o++){let i=e[o];if(i==="%"&&o+2<e.length){let s=e.slice(o+1,o+3);if(ln(s)){r+="%"+s.toUpperCase(),o+=2;continue}}if(i==="/"&&(n=!1),N$(i)&&(i!==":"||!n))r+=i;else{let s=e.charCodeAt(o);if(s<128)r+=ct[s];else if(s<55296||s>57343)r+=He(s);else if(s<=56319&&o+1<e.length){let a=e.charCodeAt(o+1);a>=56320&&a<=57343?(r+=He(65536+(s-55296<<10)+(a-56320)),o++):r+=He(65533)}else r+=He(65533)}}return r}function Og(e,t){let r="";for(let n=0;n<e.length;n++){let o=e[n];if(o==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(ln(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(t(o))r+=o;else{let i=e.charCodeAt(n);if(i<128)r+=ct[i];else if(i<55296||i>57343)r+=He(i);else if(i<=56319&&n+1<e.length){let s=e.charCodeAt(n+1);s>=56320&&s<=57343?(r+=He(65536+(i-55296<<10)+(s-56320)),n++):r+=He(65533)}else r+=He(65533)}}return r}function Z$(e){return Og(e,FR)}function oO(e){return Og(e,Rg)}function iO(e){return Og(e,Rg)}function L$(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function sO(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(ln(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));Tg(s)?t+=s:t+="%"+i,r+=2;continue}}if(Rg(n))t+=n;else{let o=e.charCodeAt(r);if(o<128)t+=L$(o)?n:ct[o];else if(o<55296||o>57343)t+=He(o);else if(o<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=He(65536+(o-55296<<10)+(i-56320)),r++):t+=He(65533)}else t+=He(65533)}}return t}function aO(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(ln(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function cO(e){let t=[];if(e.userinfo!==void 0&&(t.push(Z$(e.userinfo)),t.push("@")),e.host!==void 0){let r=e.host;if(!Ig(r)){let n=Eg(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=M$(r,!0),n=Eg(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=D$(r,!1)}t.push(r)}if(typeof e.port=="number"||typeof e.port=="string"){let r=String(e.port);if(!UR(r))throw new TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}q$.exports={nonSimpleDomain:JR,recomposeAuthority:cO,reescapeHostDelimiters:D$,normalizePercentEncoding:M$,normalizePathEncoding:rO,serializePathEncoding:nO,normalizeQueryFragmentEncoding:sO,encodeUserinfo:Z$,encodeQuery:oO,encodeFragment:iO,escapePreservingEscapes:aO,removeDotSegments:j$,removeDotSegmentsRelative:YR,isIPv4:Ig,isUUID:qR,normalizeIPv6:Eg,stringArrayToHexStripped:VR}});var B$=I((pq,H$)=>{"use strict";var{isUUID:uO}=Ag(),lO=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,dO=["http","https","ws","wss","urn","urn:uuid"];function fO(e){return dO.indexOf(e)!==-1}function Ng(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 U$(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function F$(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 pO(e){return e.secure=Ng(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function mO(e){if((e.port===(Ng(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=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function hO(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(lO);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=jg(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function _O(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(),o=`${r}:${t.nid||n}`,i=jg(o);i&&(e=i.serialize(e,t));let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function gO(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!uO(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function yO(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var V$={scheme:"http",domainHost:!0,parse:U$,serialize:F$},bO={scheme:"https",domainHost:V$.domainHost,parse:U$,serialize:F$},Hu={scheme:"ws",domainHost:!0,parse:pO,serialize:mO},vO={scheme:"wss",domainHost:Hu.domainHost,parse:Hu.parse,serialize:Hu.serialize},wO={scheme:"urn",parse:hO,serialize:_O,skipNormalize:!0},$O={scheme:"urn:uuid",parse:gO,serialize:yO,skipNormalize:!0},Bu={http:V$,https:bO,ws:Hu,wss:vO,urn:wO,"urn:uuid":$O};Object.setPrototypeOf(Bu,null);function jg(e){return e&&(Bu[e]||Bu[e.toLowerCase()])||void 0}H$.exports={wsIsSecure:Ng,SCHEMES:Bu,isValidSchemeName:fO,getSchemeHandler:jg}});var ax=I((mq,Qu)=>{"use strict";var{normalizeIPv6:Q$,removeDotSegments:ws,removeDotSegmentsRelative:Y$,recomposeAuthority:xO,normalizePercentEncoding:Dg,normalizePathEncoding:kO,serializePathEncoding:K$,normalizeQueryFragmentEncoding:J$,encodeQuery:SO,encodeFragment:zO,reescapeHostDelimiters:PO,isIPv4:X$,nonSimpleDomain:CO}=Ag(),{SCHEMES:ex,getSchemeHandler:Mg}=B$(),tx=/^[A-Za-z][A-Za-z0-9+.-]*$/u,rx="URI scheme is malformed.",Ku="URI host is malformed.",EO=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function W$(e){let t=String(e);if(!tx.test(t))throw new TypeError(rx);return t}function IO(e,t){return typeof e=="string"?e=ZO(e,t):typeof e=="object"&&(e=Wu(dn(e,t),t)),e}function TO(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=Ju(e,n),{parsed:l,malformedAuthorityOrPort:f,malformedPercentEncoding:d,malformedSchemeSpecific:p,malformedHost:m,malformedScheme:h}=Ju(t,n);if(i||f||s||d||a||p||c||m||u||h)throw new Error(o.error||l.error||"URI is malformed.");let g=nx(o,l,n,!0),w=Mg(r&&r.scheme||g.scheme),v=g.host,x=v!==void 0&&v!==""&&(X$(v)||Q$(v).isIPV6);if(ix(g,r||{},w,x))throw new Error(Ku);ox(g,r||{},w,x);let C=v&&v.indexOf("%")!==-1&&!/\P{ASCII}/u.test(v);if(g.error&&!C)throw new Error(g.error);return n.skipEscape=!0,dn(g,n)}function nx(e,t,r,n){let o={};if(n||(e=Wu(dn(e,r),r),t=Wu(dn(t,r),r)),r=r||{},!r.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ws(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=ws(t.path||""),o.query=t.query;else{if(!t.path)o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query;else{if(t.path[0]==="/")o.path=ws(t.path);else{let i=e.userinfo!==void 0||e.host!==void 0||e.port!==void 0;i&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=e.scheme===void 0&&!i&&o.path[0]!=="/"?Y$(o.path):ws(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function RO(e,t,r){let n=G$(e,r),o=G$(t,r);return n!==void 0&&o!==void 0&&n===o}function dn(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),o=[];r.scheme&&(r.scheme=W$(r.scheme));let i=Mg(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n);let s=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=(r.scheme===void 0||n.reference==="suffix")&&!s,c=!n.skipEscape&&a;r.path!==void 0&&(n.skipEscape?r.path=Dg(r.path):r.path=K$(r.path,c)),n.reference!=="suffix"&&r.scheme&&(r.scheme=W$(r.scheme),o.push(r.scheme,":"));let u=xO(r);if(u!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(u),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(l=a&&l[0]!=="/"?Y$(l):ws(l)),a&&(l=K$(l,!0)),u===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",SO(r.query)),r.fragment!==void 0&&o.push("#",zO(r.fragment)),o.join("")}var OO=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,AO=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,NO=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function jO(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function vs(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Gu(e){return e[0]==="["&&e[e.length-1]==="]"}function DO(e){let t=e[4];return vs(e[3])||t!==void 0&&!Gu(t)&&vs(t)||vs(e[6])||vs(e[7])||vs(e[8])}function ox(e,t,r,n){if(ix(e,t,r,n))return e.error=e.error||Ku,!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Gu(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&CO(e.host)){let o;try{o=new URL("http://"+e.host)}catch(i){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+i,!0}if(!MO(o))return e.error=e.error||Ku,!0;e.host=o.hostname}return!1}function ix(e,t,r,n){return!!(e.host&&n===!1&&!Gu(e.host)&&(t.domainHost||r&&r.domainHost)&&EO.test(e.host))}function MO(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function Ju(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},o=!1,i=!1,s=!1,a=!1,c=!1,u=!1,l=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let f=e.match(AO);f!==null&&f[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let d=e.match(NO);if(d!==null){let m=d[1],h=m.replace(/[\t\n\r]/g,"");h.length>=2&&(h.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):m.length!==h.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let p=e.match(OO);if(p){n.scheme=p[1],n.userinfo=p[3],n.host=p[4],n.port=parseInt(p[5],10),n.path=p[6]||"",n.query=p[7],n.fragment=p[8],n.scheme!==void 0&&(tx.test(n.scheme)?n.scheme=n.scheme.toLowerCase():(n.error=n.error||rx,u=!0)),i=DO(p),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=p[5]);let m=jO(n,p);if(m!==void 0&&(n.error=n.error||m,o=!0),n.host)if(X$(n.host)===!1){let w=Gu(n.host),v=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,x=Q$(n.host);l=x.isIPV6||x.isIPVFuture===!0,c=v&&(!w||x.error===!0),n.host=l?x.host:x.host.toLowerCase(),c&&(n.error=n.error||Ku,o=!0)}else l=!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 h=Mg(r.scheme||n.scheme);if(c||(a=ox(n,r,h,l)),e.indexOf("%")!==-1&&n.host!==void 0&&!c){let g=l?n.host:Dg(n.host,!0);l||(g=Dg(g.toLowerCase())),n.host=l||r.scheme!=="null"?PO(g,l):g}(!h||h&&!h.skipNormalize)&&(n.path&&(n.path=kO(n.path)),n.query&&(n.query=J$(n.query)),n.fragment&&(n.fragment=J$(n.fragment))),h&&h.parse&&(h.parse(n,r),h===ex.urn&&n.nid===void 0&&(s=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:u}}function Wu(e,t){return Ju(e,t).parsed}function ZO(e,t){return sx(e,t).normalized}function sx(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:a}=Ju(e,t);return{normalized:n||o||i||s||a?e:dn(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:s,malformedScheme:a}}function G$(e,t){if(typeof e!="string"&&typeof e!="object")return;let r;try{r=typeof e=="string"?e:dn(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:a,malformedScheme:c}=sx(r,t);return o||i||s||a||c?void 0:n}var Zg={SCHEMES:ex,normalize:IO,resolve:TO,resolveComponent:nx,equal:RO,serialize:dn,parse:Wu};Qu.exports=Zg;Qu.exports.default=Zg;Qu.exports.fastUri=Zg});var ux=I(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var cx=ax();cx.code='require("ajv/dist/runtime/uri").default';Lg.default=cx});var gx=I(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.CodeGen=De.Name=De.nil=De.stringify=De.str=De._=De.KeywordCxt=void 0;var LO=ys();Object.defineProperty(De,"KeywordCxt",{enumerable:!0,get:function(){return LO.KeywordCxt}});var Eo=B();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return Eo._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return Eo.str}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return Eo.stringify}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return Eo.nil}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return Eo.Name}});Object.defineProperty(De,"CodeGen",{enumerable:!0,get:function(){return Eo.CodeGen}});var qO=Uu(),mx=bs(),UO=ug(),$s=Vu(),FO=B(),xs=hs(),Yu=ms(),Ug=te(),lx=O$(),VO=ux(),hx=(e,t)=>new RegExp(e,t);hx.code="new RegExp";var HO=["removeAdditional","useDefaults","coerceTypes"],BO=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),KO={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."},JO={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dx=200;function WO(e){var t,r,n,o,i,s,a,c,u,l,f,d,p,m,h,g,w,v,x,C,$,k,R,X,U;let Q=e.strict,Le=(t=e.code)===null||t===void 0?void 0:t.optimize,Or=Le===!0||Le===void 0?1:Le||0,$n=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hx,or=(o=e.uriResolver)!==null&&o!==void 0?o:VO.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:Q)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Q)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Q)!==null&&l!==void 0?l:"log",strictTuples:(d=(f=e.strictTuples)!==null&&f!==void 0?f:Q)!==null&&d!==void 0?d:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:Q)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Or,regExp:$n}:{optimize:Or,regExp:$n},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:dx,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:dx,meta:(w=e.meta)!==null&&w!==void 0?w:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:($=e.addUsedSchema)!==null&&$!==void 0?$:!0,validateSchema:(k=e.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(R=e.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(X=e.unicodeRegExp)!==null&&X!==void 0?X:!0,int32range:(U=e.int32range)!==null&&U!==void 0?U:!0,uriResolver:or}}var ks=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,...WO(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new FO.ValueScope({scope:{},prefixes:BO,es5:r,lines:n}),this.logger=tA(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,UO.getRules)(),fx.call(this,KO,t,"NOT SUPPORTED"),fx.call(this,JO,t,"DEPRECATED","warn"),this._metaOpts=XO.call(this),t.formats&&QO.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&YO.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),GO.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=lx;n==="id"&&(o={...lx},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[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 o=n(r);return"$async"in n||(this.errors=n.errors),o}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 o.call(this,t,r);async function o(l,f){await i.call(this,l.$schema);let d=this._addSchema(l,f);return d.validate||s.call(this,d)}async function i(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(f){if(!(f instanceof mx.default))throw f;return a.call(this,f),await c.call(this,f.missingSchema),s.call(this,l)}}function a({missingSchema:l,missingRef:f}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${f} cannot be resolved`)}async function c(l){let f=await u.call(this,l);this.refs[l]||await i.call(this,f.$schema),this.refs[l]||this.addSchema(f,l,r)}async function u(l){let f=this._loading[l];if(f)return f;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let s of t)this.addSchema(s,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:s}=this.opts;if(i=t[s],i!==void 0&&typeof i!="string")throw new Error(`schema ${s} must be string`)}return r=(0,xs.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!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 o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=px.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new $s.SchemaEnv({schema:{},schemaId:n});if(r=$s.resolveSchema.call(this,o,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=px.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,xs.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(nA.call(this,n,r),!r)return(0,Ug.eachItem)(n,i=>qg.call(this,i)),this;iA.call(this,r);let o={...r,type:(0,Yu.getJSONTypes)(r.type),schemaType:(0,Yu.getJSONTypes)(r.schemaType)};return(0,Ug.eachItem)(n,o.type.length===0?i=>qg.call(this,i,o):i=>o.type.forEach(s=>qg.call(this,i,o,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 o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,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(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),s=t;for(let a of i)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=s[a];u&&l&&(s[a]=_x(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof t=="object")s=t[a];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 c=this._cache.get(t);if(c!==void 0)return c;n=(0,xs.normalizeId)(s||n);let u=xs.getSchemaRefs.call(this,t,n);return c=new $s.SchemaEnv({schema:t,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_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):$s.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{$s.compileSchema.call(this,t)}finally{this.opts=r}}};ks.ValidationError=qO.default;ks.MissingRefError=mx.default;De.default=ks;function fx(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function px(e){return e=(0,xs.normalizeId)(e),this.schemas[e]||this.refs[e]}function GO(){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 QO(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function YO(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 XO(){let e={...this.opts};for(let t of HO)delete e[t];return e}var eA={log(){},warn(){},error(){}};function tA(e){if(e===!1)return eA;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 rA=/^[a-z_$][a-z0-9_$:-]*$/i;function nA(e,t){let{RULES:r}=this;if((0,Ug.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!rA.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 qg(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Yu.getJSONTypes)(t.type),schemaType:(0,Yu.getJSONTypes)(t.schemaType)}};t.before?oA.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function oA(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function iA(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=_x(t)),e.validateSchema=this.compile(t,!0))}var sA={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _x(e){return{anyOf:[e,sA]}}});var yx=I(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});var aA={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Fg.default=aA});var $x=I(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.callRef=fn.getValidate=void 0;var cA=bs(),bx=wt(),ut=B(),Io=Xt(),vx=Vu(),Xu=te(),uA={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return f();let l=vx.resolveRef.call(c,u,o,r);if(l===void 0)throw new cA.default(n.opts.uriResolver,o,r);if(l instanceof vx.SchemaEnv)return d(l);return p(l);function f(){if(i===u)return el(e,s,i,i.$async);let m=t.scopeValue("root",{ref:u});return el(e,(0,ut._)`${m}.validate`,u,u.$async)}function d(m){let h=wx(e,m);el(e,h,m,m.$async)}function p(m){let h=t.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,ut.stringify)(m)}:{ref:m}),g=t.name("valid"),w=e.subschema({schema:m,dataTypes:[],schemaPath:ut.nil,topSchemaRef:h,errSchemaPath:r},g);e.mergeEvaluated(w),e.ok(g)}}};function wx(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ut._)`${r.scopeValue("wrapper",{ref:t})}.validate`}fn.getValidate=wx;function el(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Io.default.this:ut.nil;n?l():f();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=o.let("valid");o.try(()=>{o.code((0,ut._)`await ${(0,bx.callValidateCode)(e,t,u)}`),p(t),s||o.assign(m,!0)},h=>{o.if((0,ut._)`!(${h} instanceof ${i.ValidationError})`,()=>o.throw(h)),d(h),s||o.assign(m,!1)}),e.ok(m)}function f(){e.result((0,bx.callValidateCode)(e,t,u),()=>p(t),()=>d(t))}function d(m){let h=(0,ut._)`${m}.errors`;o.assign(Io.default.vErrors,(0,ut._)`${Io.default.vErrors} === null ? ${h} : ${Io.default.vErrors}.concat(${h})`),o.assign(Io.default.errors,(0,ut._)`${Io.default.vErrors}.length`)}function p(m){var h;if(!i.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(i.props=Xu.mergeEvaluated.props(o,g.props,i.props));else{let w=o.var("props",(0,ut._)`${m}.evaluated.props`);i.props=Xu.mergeEvaluated.props(o,w,i.props,ut.Name)}if(i.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(i.items=Xu.mergeEvaluated.items(o,g.items,i.items));else{let w=o.var("items",(0,ut._)`${m}.evaluated.items`);i.items=Xu.mergeEvaluated.items(o,w,i.items,ut.Name)}}}fn.callRef=el;fn.default=uA});var xx=I(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var lA=yx(),dA=$x(),fA=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",lA.default,dA.default];Vg.default=fA});var kx=I(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});var tl=B(),Er=tl.operators,rl={maximum:{okStr:"<=",ok:Er.LTE,fail:Er.GT},minimum:{okStr:">=",ok:Er.GTE,fail:Er.LT},exclusiveMaximum:{okStr:"<",ok:Er.LT,fail:Er.GTE},exclusiveMinimum:{okStr:">",ok:Er.GT,fail:Er.LTE}},pA={message:({keyword:e,schemaCode:t})=>(0,tl.str)`must be ${rl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,tl._)`{comparison: ${rl[e].okStr}, limit: ${t}}`},mA={keyword:Object.keys(rl),type:"number",schemaType:"number",$data:!0,error:pA,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,tl._)`${r} ${rl[t].fail} ${n} || isNaN(${r})`)}};Hg.default=mA});var Sx=I(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});var Ss=B(),hA={message:({schemaCode:e})=>(0,Ss.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Ss._)`{multipleOf: ${e}}`},_A={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:hA,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?(0,Ss._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:(0,Ss._)`${s} !== parseInt(${s})`;e.fail$data((0,Ss._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};Bg.default=_A});var Px=I(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});function zx(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Kg.default=zx;zx.code='require("ajv/dist/runtime/ucs2length").default'});var Cx=I(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});var pn=B(),gA=te(),yA=Px(),bA={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,pn.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,pn._)`{limit: ${e}}`},vA={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bA,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?pn.operators.GT:pn.operators.LT,s=o.opts.unicode===!1?(0,pn._)`${r}.length`:(0,pn._)`${(0,gA.useFunc)(e.gen,yA.default)}(${r})`;e.fail$data((0,pn._)`${s} ${i} ${n}`)}};Jg.default=vA});var Ex=I(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});var wA=wt(),$A=te(),To=B(),xA={message:({schemaCode:e})=>(0,To.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,To._)`{pattern: ${e}}`},kA={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xA,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,u=c.code==="new RegExp"?(0,To._)`new RegExp`:(0,$A.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,To._)`${u}(${i}, ${a}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,To._)`!${l}`)}else{let c=(0,wA.usePattern)(e,o);e.fail$data((0,To._)`!${c}.test(${r})`)}}};Wg.default=kA});var Ix=I(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});var zs=B(),SA={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,zs.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,zs._)`{limit: ${e}}`},zA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:SA,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?zs.operators.GT:zs.operators.LT;e.fail$data((0,zs._)`Object.keys(${r}).length ${o} ${n}`)}};Gg.default=zA});var Tx=I(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});var Ps=wt(),Cs=B(),PA=te(),CA={message:({params:{missingProperty:e}})=>(0,Cs.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Cs._)`{missingProperty: ${e}}`},EA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:CA,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?u():l(),a.strictRequired){let p=e.parentSchema.properties,{definedProperties:m}=e.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,w=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,PA.checkStrictMode)(s,w,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(Cs.nil,f);else for(let p of r)(0,Ps.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(c||i){let m=t.let("valid",!0);e.block$data(m,()=>d(p,m)),e.ok(m)}else t.if((0,Ps.checkMissingProp)(e,r,p)),(0,Ps.reportMissingProp)(e,p),t.else()}function f(){t.forOf("prop",n,p=>{e.setParams({missingProperty:p}),t.if((0,Ps.noPropertyInData)(t,o,p,a.ownProperties),()=>e.error())})}function d(p,m){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(m,(0,Ps.propertyInData)(t,o,p,a.ownProperties)),t.if((0,Cs.not)(m),()=>{e.error(),t.break()})},Cs.nil)}}};Qg.default=EA});var Rx=I(Yg=>{"use strict";Object.defineProperty(Yg,"__esModule",{value:!0});var Es=B(),IA={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Es.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Es._)`{limit: ${e}}`},TA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IA,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Es.operators.GT:Es.operators.LT;e.fail$data((0,Es._)`${r}.length ${o} ${n}`)}};Yg.default=TA});var nl=I(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});var Ox=gg();Ox.code='require("ajv/dist/runtime/equal").default';Xg.default=Ox});var Ax=I(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});var ey=ms(),Me=B(),RA=te(),OA=nl(),AA={message:({params:{i:e,j:t}})=>(0,Me.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Me._)`{i: ${e}, j: ${t}}`},NA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:AA,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,ey.getSchemaTypes)(i.items):[];e.block$data(c,l,(0,Me._)`${s} === false`),e.ok(c);function l(){let m=t.let("i",(0,Me._)`${r}.length`),h=t.let("j");e.setParams({i:m,j:h}),t.assign(c,!0),t.if((0,Me._)`${m} > 1`,()=>(f()?d:p)(m,h))}function f(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function d(m,h){let g=t.name("item"),w=(0,ey.checkDataTypes)(u,g,a.opts.strictNumbers,ey.DataType.Wrong),v=t.const("indices",(0,Me._)`{}`);t.for((0,Me._)`;${m}--;`,()=>{t.let(g,(0,Me._)`${r}[${m}]`),t.if(w,(0,Me._)`continue`),u.length>1&&t.if((0,Me._)`typeof ${g} == "string"`,(0,Me._)`${g} += "_"`),t.if((0,Me._)`typeof ${v}[${g}] == "number"`,()=>{t.assign(h,(0,Me._)`${v}[${g}]`),e.error(),t.assign(c,!1).break()}).code((0,Me._)`${v}[${g}] = ${m}`)})}function p(m,h){let g=(0,RA.useFunc)(t,OA.default),w=t.name("outer");t.label(w).for((0,Me._)`;${m}--;`,()=>t.for((0,Me._)`${h} = ${m}; ${h}--;`,()=>t.if((0,Me._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(w)})))}}};ty.default=NA});var Nx=I(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});var ry=B(),jA=te(),DA=nl(),MA={message:"must be equal to constant",params:({schemaCode:e})=>(0,ry._)`{allowedValue: ${e}}`},ZA={keyword:"const",$data:!0,error:MA,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,ry._)`!${(0,jA.useFunc)(t,DA.default)}(${r}, ${o})`):e.fail((0,ry._)`${i} !== ${r}`)}};ny.default=ZA});var jx=I(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});var Is=B(),LA=te(),qA=nl(),UA={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Is._)`{allowedValues: ${e}}`},FA={keyword:"enum",schemaType:"array",$data:!0,error:UA,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c??(c=(0,LA.useFunc)(t,qA.default)),l;if(a||n)l=t.let("valid"),e.block$data(l,f);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=t.const("vSchema",i);l=(0,Is.or)(...o.map((m,h)=>d(p,h)))}e.pass(l);function f(){t.assign(l,!1),t.forOf("v",i,p=>t.if((0,Is._)`${u()}(${r}, ${p})`,()=>t.assign(l,!0).break()))}function d(p,m){let h=o[m];return typeof h=="object"&&h!==null?(0,Is._)`${u()}(${r}, ${p}[${m}])`:(0,Is._)`${r} === ${h}`}}};oy.default=FA});var Dx=I(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var VA=kx(),HA=Sx(),BA=Cx(),KA=Ex(),JA=Ix(),WA=Tx(),GA=Rx(),QA=Ax(),YA=Nx(),XA=jx(),eN=[VA.default,HA.default,BA.default,KA.default,JA.default,WA.default,GA.default,QA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},YA.default,XA.default];iy.default=eN});var ay=I(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.validateAdditionalItems=void 0;var mn=B(),sy=te(),tN={message:({params:{len:e}})=>(0,mn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,mn._)`{limit: ${e}}`},rN={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tN,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,sy.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Mx(e,n)}};function Mx(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",(0,mn._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,mn._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,sy.alwaysValidSchema)(s,n)){let u=r.var("valid",(0,mn._)`${a} <= ${t.length}`);r.if((0,mn.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:sy.Type.Num},u),s.allErrors||r.if((0,mn.not)(u),()=>r.break())})}}Ts.validateAdditionalItems=Mx;Ts.default=rN});var cy=I(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.validateTuple=void 0;var Zx=B(),ol=te(),nN=wt(),oN={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Lx(e,"additionalItems",t);r.items=!0,!(0,ol.alwaysValidSchema)(r,t)&&e.ok((0,nN.validateArray)(e))}};function Lx(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=ol.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,Zx._)`${i}.length`);r.forEach((f,d)=>{(0,ol.alwaysValidSchema)(a,f)||(n.if((0,Zx._)`${u} > ${d}`,()=>e.subschema({keyword:s,schemaProp:d,dataProp:d},c)),e.ok(c))});function l(f){let{opts:d,errSchemaPath:p}=a,m=r.length,h=m===f.minItems&&(m===f.maxItems||f[t]===!1);if(d.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,ol.checkStrictMode)(a,g,d.strictTuples)}}}Rs.validateTuple=Lx;Rs.default=oN});var qx=I(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});var iN=cy(),sN={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,iN.validateTuple)(e,"items")};uy.default=sN});var Fx=I(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});var Ux=B(),aN=te(),cN=wt(),uN=ay(),lN={message:({params:{len:e}})=>(0,Ux.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ux._)`{limit: ${e}}`},dN={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lN,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,aN.alwaysValidSchema)(n,t)&&(o?(0,uN.validateAdditionalItems)(e,o):e.ok((0,cN.validateArray)(e)))}};ly.default=dN});var Vx=I(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var xt=B(),il=te(),fN={message:({params:{min:e,max:t}})=>t===void 0?(0,xt.str)`must contain at least ${e} valid item(s)`:(0,xt.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,xt._)`{minContains: ${e}}`:(0,xt._)`{minContains: ${e}, maxContains: ${t}}`},pN={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:fN,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;i.opts.next?(s=c===void 0?1:c,a=u):s=1;let l=t.const("len",(0,xt._)`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,il.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,il.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,il.alwaysValidSchema)(i,r)){let h=(0,xt._)`${l} >= ${s}`;a!==void 0&&(h=(0,xt._)`${h} && ${l} <= ${a}`),e.pass(h);return}i.items=!0;let f=t.name("valid");a===void 0&&s===1?p(f,()=>t.if(f,()=>t.break())):s===0?(t.let(f,!0),a!==void 0&&t.if((0,xt._)`${o}.length > 0`,d)):(t.let(f,!1),d()),e.result(f,()=>e.reset());function d(){let h=t.name("_valid"),g=t.let("count",0);p(h,()=>t.if(h,()=>m(g)))}function p(h,g){t.forRange("i",0,l,w=>{e.subschema({keyword:"contains",dataProp:w,dataPropType:il.Type.Num,compositeRule:!0},h),g()})}function m(h){t.code((0,xt._)`${h}++`),a===void 0?t.if((0,xt._)`${h} >= ${s}`,()=>t.assign(f,!0).break()):(t.if((0,xt._)`${h} > ${a}`,()=>t.assign(f,!1).break()),s===1?t.assign(f,!0):t.if((0,xt._)`${h} >= ${s}`,()=>t.assign(f,!0)))}}};dy.default=pN});var Kx=I(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.validateSchemaDeps=Lt.validatePropertyDeps=Lt.error=void 0;var fy=B(),mN=te(),Os=wt();Lt.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,fy.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,fy._)`{property: ${e},
81
+ missingProperty: ${n},
82
+ depsCount: ${t},
83
+ deps: ${r}}`};var hN={keyword:"dependencies",type:"object",schemaType:"object",error:Lt.error,code(e){let[t,r]=_N(e);Hx(e,t),Bx(e,r)}};function _N({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function Hx(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,Os.propertyInData)(r,n,s,o.opts.ownProperties);e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,Os.checkReportMissingProp)(e,u)}):(r.if((0,fy._)`${c} && (${(0,Os.checkMissingProp)(e,a,i)})`),(0,Os.reportMissingProp)(e,i),r.else())}}Lt.validatePropertyDeps=Hx;function Bx(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t)(0,mN.alwaysValidSchema)(i,t[a])||(r.if((0,Os.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s))}Lt.validateSchemaDeps=Bx;Lt.default=hN});var Wx=I(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var Jx=B(),gN=te(),yN={message:"property name must be valid",params:({params:e})=>(0,Jx._)`{propertyName: ${e.propertyName}}`},bN={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:yN,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,gN.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,s=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Jx.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};py.default=bN});var hy=I(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});var sl=wt(),Tt=B(),vN=Xt(),al=te(),wN={message:"must NOT have additional properties",params:({params:e})=>(0,Tt._)`{additionalProperty: ${e.additionalProperty}}`},$N={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wN,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,al.alwaysValidSchema)(s,r))return;let u=(0,sl.allSchemaProperties)(n.properties),l=(0,sl.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Tt._)`${i} === ${vN.default.errors}`);function f(){t.forIn("key",o,g=>{!u.length&&!l.length?m(g):t.if(d(g),()=>m(g))})}function d(g){let w;if(u.length>8){let v=(0,al.schemaRefOrVal)(s,n.properties,"properties");w=(0,sl.isOwnProperty)(t,v,g)}else u.length?w=(0,Tt.or)(...u.map(v=>(0,Tt._)`${g} === ${v}`)):w=Tt.nil;return l.length&&(w=(0,Tt.or)(w,...l.map(v=>(0,Tt._)`${(0,sl.usePattern)(e,v)}.test(${g})`))),(0,Tt.not)(w)}function p(g){t.code((0,Tt._)`delete ${o}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){e.setParams({additionalProperty:g}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,al.alwaysValidSchema)(s,r)){let w=t.name("valid");c.removeAdditional==="failing"?(h(g,w,!1),t.if((0,Tt.not)(w),()=>{e.reset(),p(g)})):(h(g,w),a||t.if((0,Tt.not)(w),()=>t.break()))}}function h(g,w,v){let x={keyword:"additionalProperties",dataProp:g,dataPropType:al.Type.Str};v===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(x,w)}}};my.default=$N});var Yx=I(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var xN=ys(),Gx=wt(),_y=te(),Qx=hy(),kN={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Qx.default.code(new xN.KeywordCxt(i,Qx.default,"additionalProperties"));let s=(0,Gx.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=_y.mergeEvaluated.props(t,(0,_y.toHash)(s),i.props));let a=s.filter(f=>!(0,_y.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let c=t.name("valid");for(let f of a)u(f)?l(f):(t.if((0,Gx.propertyInData)(t,o,f,i.opts.ownProperties)),l(f),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(c);function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function l(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};gy.default=kN});var rk=I(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});var Xx=wt(),cl=B(),ek=te(),tk=te(),SN={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,Xx.allSchemaProperties)(r),c=a.filter(h=>(0,ek.alwaysValidSchema)(i,r[h]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,l=t.name("valid");i.props!==!0&&!(i.props instanceof cl.Name)&&(i.props=(0,tk.evaluatedPropsToName)(t,i.props));let{props:f}=i;d();function d(){for(let h of a)u&&p(h),i.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,ek.checkStrictMode)(i,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",n,g=>{t.if((0,cl._)`${(0,Xx.usePattern)(e,h)}.test(${g})`,()=>{let w=c.includes(h);w||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:tk.Type.Str},l),i.opts.unevaluated&&f!==!0?t.assign((0,cl._)`${f}[${g}]`,!0):!w&&!i.allErrors&&t.if((0,cl.not)(l),()=>t.break())})})}}};yy.default=SN});var nk=I(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var zN=te(),PN={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,zN.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};by.default=PN});var ok=I(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});var CN=wt(),EN={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:CN.validateUnion,error:{message:"must match a schema in anyOf"}};vy.default=EN});var ik=I(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var ul=B(),IN=te(),TN={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,ul._)`{passingSchemas: ${e.passing}}`},RN={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:TN,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((l,f)=>{let d;(0,IN.alwaysValidSchema)(o,l)?t.var(c,!0):d=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&t.if((0,ul._)`${c} && ${s}`).assign(s,!1).assign(a,(0,ul._)`[${a}, ${f}]`).else(),t.if(c,()=>{t.assign(s,!0),t.assign(a,f),d&&e.mergeEvaluated(d,ul.Name)})})}}};wy.default=RN});var sk=I($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});var ON=te(),AN={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 o=t.name("valid");r.forEach((i,s)=>{if((0,ON.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};$y.default=AN});var uk=I(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});var ll=B(),ck=te(),NN={message:({params:e})=>(0,ll.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,ll._)`{failingKeyword: ${e.ifClause}}`},jN={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:NN,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,ck.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=ak(n,"then"),i=ak(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(a,u("then",l),u("else",l))}else o?t.if(a,u("then")):t.if((0,ll.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(l)}function u(l,f){return()=>{let d=e.subschema({keyword:l},a);t.assign(s,a),e.mergeValidEvaluated(d,s),f?t.assign(f,(0,ll._)`${l}`):e.setParams({ifClause:l})}}}};function ak(e,t){let r=e.schema[t];return r!==void 0&&!(0,ck.alwaysValidSchema)(e,r)}xy.default=jN});var lk=I(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var DN=te(),MN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,DN.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};ky.default=MN});var dk=I(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});var ZN=ay(),LN=qx(),qN=cy(),UN=Fx(),FN=Vx(),VN=Kx(),HN=Wx(),BN=hy(),KN=Yx(),JN=rk(),WN=nk(),GN=ok(),QN=ik(),YN=sk(),XN=uk(),ej=lk();function tj(e=!1){let t=[WN.default,GN.default,QN.default,YN.default,XN.default,ej.default,HN.default,BN.default,VN.default,KN.default,JN.default];return e?t.push(LN.default,UN.default):t.push(ZN.default,qN.default),t.push(FN.default),t}Sy.default=tj});var fk=I(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var we=B(),rj={message:({schemaCode:e})=>(0,we.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,we._)`{format: ${e}}`},nj={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:rj,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:f}=a;if(!c.validateFormats)return;o?d():p();function d(){let m=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),h=r.const("fDef",(0,we._)`${m}[${s}]`),g=r.let("fType"),w=r.let("format");r.if((0,we._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,we._)`${h}.type || "string"`).assign(w,(0,we._)`${h}.validate`),()=>r.assign(g,(0,we._)`"string"`).assign(w,h)),e.fail$data((0,we.or)(v(),x()));function v(){return c.strictSchema===!1?we.nil:(0,we._)`${s} && !${w}`}function x(){let C=l.$async?(0,we._)`(${h}.async ? await ${w}(${n}) : ${w}(${n}))`:(0,we._)`${w}(${n})`,$=(0,we._)`(typeof ${w} == "function" ? ${C} : ${w}.test(${n}))`;return(0,we._)`${w} && ${w} !== true && ${g} === ${t} && !${$}`}}function p(){let m=f.formats[i];if(!m){v();return}if(m===!0)return;let[h,g,w]=x(m);h===t&&e.pass(C());function v(){if(c.strictSchema===!1){f.logger.warn($());return}throw new Error($());function $(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function x($){let k=$ instanceof RegExp?(0,we.regexpCode)($):c.code.formats?(0,we._)`${c.code.formats}${(0,we.getProperty)(i)}`:void 0,R=r.scopeValue("formats",{key:i,ref:$,code:k});return typeof $=="object"&&!($ instanceof RegExp)?[$.type||"string",$.validate,(0,we._)`${R}.validate`]:["string",$,R]}function C(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,we._)`await ${w}(${n})`}return typeof g=="function"?(0,we._)`${w}(${n})`:(0,we._)`${w}.test(${n})`}}}};zy.default=nj});var pk=I(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});var oj=fk(),ij=[oj.default];Py.default=ij});var mk=I(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.contentVocabulary=Ro.metadataVocabulary=void 0;Ro.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ro.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var _k=I(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});var sj=xx(),aj=Dx(),cj=dk(),uj=pk(),hk=mk(),lj=[sj.default,aj.default,(0,cj.default)(),uj.default,hk.metadataVocabulary,hk.contentVocabulary];Cy.default=lj});var yk=I(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.DiscrError=void 0;var gk;(function(e){e.Tag="tag",e.Mapping="mapping"})(gk||(dl.DiscrError=gk={}))});var vk=I(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});var Oo=B(),Ey=yk(),bk=Vu(),dj=bs(),fj=te(),pj={message:({params:{discrError:e,tagName:t}})=>e===Ey.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Oo._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},mj={keyword:"discriminator",type:"object",schemaType:"object",error:pj,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="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 c=t.let("valid",!1),u=t.const("tag",(0,Oo._)`${r}${(0,Oo.getProperty)(a)}`);t.if((0,Oo._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Ey.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function l(){let p=d();t.if(!1);for(let m in p)t.elseIf((0,Oo._)`${u} === ${m}`),t.assign(c,f(p[m]));t.else(),e.error(!1,{discrError:Ey.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,Oo.Name),m}function d(){var p;let m={},h=w(o),g=!0;for(let C=0;C<s.length;C++){let $=s[C];if($?.$ref&&!(0,fj.schemaHasRulesButRef)($,i.self.RULES)){let R=$.$ref;if($=bk.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,R),$ instanceof bk.SchemaEnv&&($=$.schema),$===void 0)throw new dj.default(i.opts.uriResolver,i.baseId,R)}let k=(p=$?.properties)===null||p===void 0?void 0:p[a];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||w($)),v(k,C)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return m;function w({required:C}){return Array.isArray(C)&&C.includes(a)}function v(C,$){if(C.const)x(C.const,$);else if(C.enum)for(let k of C.enum)x(k,$);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(C,$){if(typeof C!="string"||C in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[C]=$}}}};Iy.default=mj});var wk=I((rU,hj)=>{hj.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 Ry=I((ge,Ty)=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.MissingRefError=ge.ValidationError=ge.CodeGen=ge.Name=ge.nil=ge.stringify=ge.str=ge._=ge.KeywordCxt=ge.Ajv=void 0;var _j=gx(),gj=_k(),yj=vk(),$k=wk(),bj=["/properties"],fl="http://json-schema.org/draft-07/schema",Ao=class extends _j.default{_addVocabularies(){super._addVocabularies(),gj.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(yj.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema($k,bj):$k;this.addMetaSchema(t,fl,!1),this.refs["http://json-schema.org/schema"]=fl}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(fl)?fl:void 0)}};ge.Ajv=Ao;Ty.exports=ge=Ao;Ty.exports.Ajv=Ao;Object.defineProperty(ge,"__esModule",{value:!0});ge.default=Ao;var vj=ys();Object.defineProperty(ge,"KeywordCxt",{enumerable:!0,get:function(){return vj.KeywordCxt}});var No=B();Object.defineProperty(ge,"_",{enumerable:!0,get:function(){return No._}});Object.defineProperty(ge,"str",{enumerable:!0,get:function(){return No.str}});Object.defineProperty(ge,"stringify",{enumerable:!0,get:function(){return No.stringify}});Object.defineProperty(ge,"nil",{enumerable:!0,get:function(){return No.nil}});Object.defineProperty(ge,"Name",{enumerable:!0,get:function(){return No.Name}});Object.defineProperty(ge,"CodeGen",{enumerable:!0,get:function(){return No.CodeGen}});var wj=Uu();Object.defineProperty(ge,"ValidationError",{enumerable:!0,get:function(){return wj.default}});var $j=bs();Object.defineProperty(ge,"MissingRefError",{enumerable:!0,get:function(){return $j.default}})});var Ik=I(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.formatNames=Ut.fastFormats=Ut.fullFormats=void 0;function qt(e,t){return{validate:e,compare:t}}Ut.fullFormats={date:qt(zk,jy),time:qt(Ay(!0),Dy),"date-time":qt(xk(!0),Ck),"iso-time":qt(Ay(),Pk),"iso-date-time":qt(xk(),Ek),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Cj,"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:Nj,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:Ej,int32:{type:"number",validate:Rj},int64:{type:"number",validate:Oj},float:{type:"number",validate:Sk},double:{type:"number",validate:Sk},password:!0,binary:!0};Ut.fastFormats={...Ut.fullFormats,date:qt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,jy),time:qt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Dy),"date-time":qt(/^\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,Ck),"iso-time":qt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Pk),"iso-date-time":qt(/^\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,Ek),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};Ut.formatNames=Object.keys(Ut.fullFormats);function xj(e){return e%4===0&&(e%100!==0||e%400===0)}var kj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Sj=[0,31,28,31,30,31,30,31,31,30,31,30,31];function zk(e){let t=kj.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&xj(r)?29:Sj[n])}function jy(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Oy=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Ay(e){return function(r){let n=Oy.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let f=i-l*c,d=o-u*c-(f<0?1:0);return(d===23||d===-1)&&(f===59||f===-1)&&s<61}}function Dy(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 Pk(e,t){if(!(e&&t))return;let r=Oy.exec(e),n=Oy.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 Ny=/t|\s/i;function xk(e){let t=Ay(e);return function(n){let o=n.split(Ny);return o.length===2&&zk(o[0])&&t(o[1])}}function Ck(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function Ek(e,t){if(!(e&&t))return;let[r,n]=e.split(Ny),[o,i]=t.split(Ny),s=jy(r,o);if(s!==void 0)return s||Dy(n,i)}var zj=/\/|:/,Pj=/^(?:[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 Cj(e){return zj.test(e)&&Pj.test(e)}var kk=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Ej(e){return kk.lastIndex=0,kk.test(e)}var Ij=-(2**31),Tj=2**31-1;function Rj(e){return Number.isInteger(e)&&e<=Tj&&e>=Ij}function Oj(e){return Number.isInteger(e)}function Sk(){return!0}var Aj=/[^\\]\\Z/;function Nj(e){if(Aj.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var Tk=I(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.formatLimitDefinition=void 0;var jj=Ry(),Rt=B(),Ir=Rt.operators,pl={formatMaximum:{okStr:"<=",ok:Ir.LTE,fail:Ir.GT},formatMinimum:{okStr:">=",ok:Ir.GTE,fail:Ir.LT},formatExclusiveMaximum:{okStr:"<",ok:Ir.LT,fail:Ir.GTE},formatExclusiveMinimum:{okStr:">",ok:Ir.GT,fail:Ir.LTE}},Dj={message:({keyword:e,schemaCode:t})=>(0,Rt.str)`should be ${pl[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Rt._)`{comparison: ${pl[e].okStr}, limit: ${t}}`};jo.formatLimitDefinition={keyword:Object.keys(pl),type:"string",schemaType:"string",$data:!0,error:Dj,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new jj.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let d=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=t.const("fmt",(0,Rt._)`${d}[${c.schemaCode}]`);e.fail$data((0,Rt.or)((0,Rt._)`typeof ${p} != "object"`,(0,Rt._)`${p} instanceof RegExp`,(0,Rt._)`typeof ${p}.compare != "function"`,f(p)))}function l(){let d=c.schema,p=a.formats[d];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${d}" does not define "compare" function`);let m=t.scopeValue("formats",{key:d,ref:p,code:s.code.formats?(0,Rt._)`${s.code.formats}${(0,Rt.getProperty)(d)}`:void 0});e.fail$data(f(m))}function f(d){return(0,Rt._)`${d}.compare(${r}, ${n}) ${pl[o].fail} 0`}},dependencies:["format"]};var Mj=e=>(e.addKeyword(jo.formatLimitDefinition),e);jo.default=Mj});var Nk=I((As,Ak)=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var Do=Ik(),Zj=Tk(),My=B(),Rk=new My.Name("fullFormats"),Lj=new My.Name("fastFormats"),Zy=(e,t={keywords:!0})=>{if(Array.isArray(t))return Ok(e,t,Do.fullFormats,Rk),e;let[r,n]=t.mode==="fast"?[Do.fastFormats,Lj]:[Do.fullFormats,Rk],o=t.formats||Do.formatNames;return Ok(e,o,r,n),t.keywords&&(0,Zj.default)(e),e};Zy.get=(e,t="full")=>{let n=(t==="fast"?Do.fastFormats:Do.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function Ok(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,My._)`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}Ak.exports=As=Zy;Object.defineProperty(As,"__esModule",{value:!0});As.default=Zy});var Fk=I(Ly=>{"use strict";var Lk=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Fj=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,qk=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,Vj=/\\([\u000b\u0020-\u00ff])/g,Hj=/([\\"])/g,Uk=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Ly.format=Bj;Ly.parse=Kj;function Bj(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Uk.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,i=Object.keys(t).sort(),s=0;s<i.length;s++){if(o=i[s],!qk.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+Wj(t[o])}return n}function Kj(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?Jj(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!Uk.test(n))throw new TypeError("invalid media type");var o=new Gj(n.toLowerCase());if(r!==-1){var i,s,a;for(Lk.lastIndex=r;s=Lk.exec(t);){if(s.index!==r)throw new TypeError("invalid parameter format");r+=s[0].length,i=s[1].toLowerCase(),a=s[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(Vj,"$1"))),o.parameters[i]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function Jj(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function Wj(e){var t=String(e);if(qk.test(t))return t;if(t.length>0&&!Fj.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(Hj,"\\$1")+'"'}function Gj(e){this.parameters=Object.create(null),this.type=e}});lu();var po="2025-11-25";var f0=[po,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],vr="io.modelcontextprotocol/related-task",fu="2.0",Ee=cu(e=>e!==null&&(typeof e=="object"||typeof e=="function")),p0=ce([y(),G().int()]),m0=y(),PM=ve({ttl:G().optional(),pollInterval:G().optional()}),qC=P({ttl:G().optional()}),UC=P({taskId:y()}),__=ve({progressToken:p0.optional(),[vr]:UC.optional()}),ft=P({_meta:__.optional()}),qi=ft.extend({task:qC.optional()}),h0=e=>qi.safeParse(e).success,Ae=P({method:y(),params:ft.loose().optional()}),gt=P({_meta:__.optional()}),yt=P({method:y(),params:gt.loose().optional()}),Ne=ve({_meta:__.optional()}),mo=ce([y(),G().int()]),_0=P({jsonrpc:O(fu),id:mo,...Ae.shape}).strict(),Ui=e=>_0.safeParse(e).success,g0=P({jsonrpc:O(fu),...yt.shape}).strict(),y0=e=>g0.safeParse(e).success,g_=P({jsonrpc:O(fu),id:mo,result:Ne}).strict(),Xr=e=>g_.safeParse(e).success;var D;(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"})(D||(D={}));var y_=P({jsonrpc:O(fu),id:mo.optional(),error:P({code:G().int(),message:y(),data:pe().optional()})}).strict();var b0=e=>y_.safeParse(e).success;var ho=ce([_0,g0,g_,y_]),CM=ce([g_,y_]),wr=Ne.strict(),FC=gt.extend({requestId:mo.optional(),reason:y().optional()}),pu=yt.extend({method:O("notifications/cancelled"),params:FC}),VC=P({src:y(),mimeType:y().optional(),sizes:z(y()).optional(),theme:Oe(["light","dark"]).optional()}),Fi=P({icons:z(VC).optional()}),fo=P({name:y(),title:y().optional()}),Vi=fo.extend({...fo.shape,...Fi.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),HC=uo(P({applyDefaults:ae().optional()}),de(y(),pe())),BC=Di(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,uo(P({form:HC.optional(),url:Ee.optional()}),de(y(),pe()).optional())),KC=ve({list:Ee.optional(),cancel:Ee.optional(),requests:ve({sampling:ve({createMessage:Ee.optional()}).optional(),elicitation:ve({create:Ee.optional()}).optional()}).optional()}),JC=ve({list:Ee.optional(),cancel:Ee.optional(),requests:ve({tools:ve({call:Ee.optional()}).optional()}).optional()}),WC=P({experimental:de(y(),Ee).optional(),sampling:P({context:Ee.optional(),tools:Ee.optional()}).optional(),elicitation:BC.optional(),roots:P({listChanged:ae().optional()}).optional(),tasks:KC.optional(),extensions:de(y(),Ee).optional()}),GC=ft.extend({protocolVersion:y(),capabilities:WC,clientInfo:Vi}),QC=Ae.extend({method:O("initialize"),params:GC});var YC=P({experimental:de(y(),Ee).optional(),logging:Ee.optional(),completions:Ee.optional(),prompts:P({listChanged:ae().optional()}).optional(),resources:P({subscribe:ae().optional(),listChanged:ae().optional()}).optional(),tools:P({listChanged:ae().optional()}).optional(),tasks:JC.optional(),extensions:de(y(),Ee).optional()}),b_=Ne.extend({protocolVersion:y(),capabilities:YC,serverInfo:Vi,instructions:y().optional()}),v0=yt.extend({method:O("notifications/initialized"),params:gt.optional()}),w0=e=>v0.safeParse(e).success,en=Ae.extend({method:O("ping"),params:ft.optional()}),XC=P({progress:G(),total:ue(G()),message:ue(y())}),eE=P({...gt.shape,...XC.shape,progressToken:p0}),mu=yt.extend({method:O("notifications/progress"),params:eE}),tE=ft.extend({cursor:m0.optional()}),Hi=Ae.extend({params:tE.optional()}),Bi=Ne.extend({nextCursor:m0.optional()}),rE=Oe(["working","input_required","completed","failed","cancelled"]),Ki=P({taskId:y(),status:rE,ttl:ce([G(),Ci()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:ue(G()),statusMessage:ue(y())}),tn=Ne.extend({task:Ki}),nE=gt.merge(Ki),Ji=yt.extend({method:O("notifications/tasks/status"),params:nE}),hu=Ae.extend({method:O("tasks/get"),params:ft.extend({taskId:y()})}),_u=Ne.merge(Ki),gu=Ae.extend({method:O("tasks/result"),params:ft.extend({taskId:y()})}),EM=Ne.loose(),yu=Hi.extend({method:O("tasks/list")}),bu=Bi.extend({tasks:z(Ki)}),vu=Ae.extend({method:O("tasks/cancel"),params:ft.extend({taskId:y()})}),$0=Ne.merge(Ki),x0=P({uri:y(),mimeType:ue(y()),_meta:de(y(),pe()).optional()}),k0=x0.extend({text:y()}),v_=y().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),S0=x0.extend({blob:v_}),Wi=Oe(["user","assistant"]),_o=P({audience:z(Wi).optional(),priority:G().min(0).max(1).optional(),lastModified:Yr.datetime({offset:!0}).optional()}),z0=P({...fo.shape,...Fi.shape,uri:y(),description:ue(y()),mimeType:ue(y()),size:ue(G()),annotations:_o.optional(),_meta:ue(ve({}))}),oE=P({...fo.shape,...Fi.shape,uriTemplate:y(),description:ue(y()),mimeType:ue(y()),annotations:_o.optional(),_meta:ue(ve({}))}),w_=Hi.extend({method:O("resources/list")}),go=Bi.extend({resources:z(z0)}),$_=Hi.extend({method:O("resources/templates/list")}),Gi=Bi.extend({resourceTemplates:z(oE)}),x_=ft.extend({uri:y()}),iE=x_,k_=Ae.extend({method:O("resources/read"),params:iE}),yo=Ne.extend({contents:z(ce([k0,S0]))}),Qi=yt.extend({method:O("notifications/resources/list_changed"),params:gt.optional()}),sE=x_,aE=Ae.extend({method:O("resources/subscribe"),params:sE}),cE=x_,uE=Ae.extend({method:O("resources/unsubscribe"),params:cE}),lE=gt.extend({uri:y()}),dE=yt.extend({method:O("notifications/resources/updated"),params:lE}),fE=P({name:y(),description:ue(y()),required:ue(ae())}),pE=P({...fo.shape,...Fi.shape,description:ue(y()),arguments:ue(z(fE)),_meta:ue(ve({}))}),S_=Hi.extend({method:O("prompts/list")}),Yi=Bi.extend({prompts:z(pE)}),mE=ft.extend({name:y(),arguments:de(y(),y()).optional()}),hE=Ae.extend({method:O("prompts/get"),params:mE}),z_=P({type:O("text"),text:y(),annotations:_o.optional(),_meta:de(y(),pe()).optional()}),P_=P({type:O("image"),data:v_,mimeType:y(),annotations:_o.optional(),_meta:de(y(),pe()).optional()}),C_=P({type:O("audio"),data:v_,mimeType:y(),annotations:_o.optional(),_meta:de(y(),pe()).optional()}),_E=P({type:O("tool_use"),name:y(),id:y(),input:de(y(),pe()),_meta:de(y(),pe()).optional()}),E_=P({type:O("resource"),resource:ce([k0,S0]),annotations:_o.optional(),_meta:de(y(),pe()).optional()}),I_=z0.extend({type:O("resource_link")}),bo=ce([z_,P_,C_,I_,E_]),gE=P({role:Wi,content:bo}),T_=Ne.extend({description:y().optional(),messages:z(gE)}),Xi=yt.extend({method:O("notifications/prompts/list_changed"),params:gt.optional()}),yE=P({title:y().optional(),readOnlyHint:ae().optional(),destructiveHint:ae().optional(),idempotentHint:ae().optional(),openWorldHint:ae().optional()}),bE=P({taskSupport:Oe(["required","optional","forbidden"]).optional()}),wu=P({...fo.shape,...Fi.shape,description:y().optional(),inputSchema:P({type:O("object"),properties:de(y(),Ee).optional(),required:z(y()).optional()}).catchall(pe()),outputSchema:P({type:O("object"),properties:de(y(),Ee).optional(),required:z(y()).optional()}).catchall(pe()).optional(),annotations:yE.optional(),execution:bE.optional(),_meta:de(y(),pe()).optional()}),P0=Hi.extend({method:O("tools/list")}),es=Bi.extend({tools:z(wu)}),bt=Ne.extend({content:z(bo).default([]),structuredContent:de(y(),pe()).optional(),isError:ae().optional()}),IM=bt.or(Ne.extend({toolResult:pe()})),vE=qi.extend({name:y(),arguments:de(y(),pe()).optional()}),$u=Ae.extend({method:O("tools/call"),params:vE}),ts=yt.extend({method:O("notifications/tools/list_changed"),params:gt.optional()}),C0=P({autoRefresh:ae().default(!0),debounceMs:G().int().nonnegative().default(300)}),E0=Oe(["debug","info","notice","warning","error","critical","alert","emergency"]),wE=ft.extend({level:E0}),$E=Ae.extend({method:O("logging/setLevel"),params:wE}),xE=gt.extend({level:E0,logger:y().optional(),data:pe()}),R_=yt.extend({method:O("notifications/message"),params:xE}),kE=P({name:y().optional()}),SE=P({hints:z(kE).optional(),costPriority:G().min(0).max(1).optional(),speedPriority:G().min(0).max(1).optional(),intelligencePriority:G().min(0).max(1).optional()}),zE=P({mode:Oe(["auto","required","none"]).optional()}),PE=P({type:O("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:z(bo).default([]),structuredContent:P({}).loose().optional(),isError:ae().optional(),_meta:de(y(),pe()).optional()}),CE=Ri("type",[z_,P_,C_]),du=Ri("type",[z_,P_,C_,_E,PE]),EE=P({role:Wi,content:ce([du,z(du)]),_meta:de(y(),pe()).optional()}),IE=qi.extend({messages:z(EE),modelPreferences:SE.optional(),systemPrompt:y().optional(),includeContext:Oe(["none","thisServer","allServers"]).optional(),temperature:G().optional(),maxTokens:G().int(),stopSequences:z(y()).optional(),metadata:Ee.optional(),tools:z(wu).optional(),toolChoice:zE.optional()}),rs=Ae.extend({method:O("sampling/createMessage"),params:IE}),xu=Ne.extend({model:y(),stopReason:ue(Oe(["endTurn","stopSequence","maxTokens"]).or(y())),role:Wi,content:CE}),ku=Ne.extend({model:y(),stopReason:ue(Oe(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Wi,content:ce([du,z(du)])}),TE=P({type:O("boolean"),title:y().optional(),description:y().optional(),default:ae().optional()}),RE=P({type:O("string"),title:y().optional(),description:y().optional(),minLength:G().optional(),maxLength:G().optional(),format:Oe(["email","uri","date","date-time"]).optional(),default:y().optional()}),OE=P({type:Oe(["number","integer"]),title:y().optional(),description:y().optional(),minimum:G().optional(),maximum:G().optional(),default:G().optional()}),AE=P({type:O("string"),title:y().optional(),description:y().optional(),enum:z(y()),default:y().optional()}),NE=P({type:O("string"),title:y().optional(),description:y().optional(),oneOf:z(P({const:y(),title:y()})),default:y().optional()}),jE=P({type:O("string"),title:y().optional(),description:y().optional(),enum:z(y()),enumNames:z(y()).optional(),default:y().optional()}),DE=ce([AE,NE]),ME=P({type:O("array"),title:y().optional(),description:y().optional(),minItems:G().optional(),maxItems:G().optional(),items:P({type:O("string"),enum:z(y())}),default:z(y()).optional()}),ZE=P({type:O("array"),title:y().optional(),description:y().optional(),minItems:G().optional(),maxItems:G().optional(),items:P({anyOf:z(P({const:y(),title:y()}))}),default:z(y()).optional()}),LE=ce([ME,ZE]),qE=ce([jE,DE,LE]),UE=ce([qE,TE,RE,OE]),FE=qi.extend({mode:O("form").optional(),message:y(),requestedSchema:P({type:O("object"),properties:de(y(),UE),required:z(y()).optional()})}),VE=qi.extend({mode:O("url"),message:y(),elicitationId:y(),url:y().url()}),HE=ce([FE,VE]),O_=Ae.extend({method:O("elicitation/create"),params:HE}),BE=gt.extend({elicitationId:y()}),KE=yt.extend({method:O("notifications/elicitation/complete"),params:BE}),A_=Ne.extend({action:Oe(["accept","decline","cancel"]),content:Di(e=>e===null?void 0:e,de(y(),ce([y(),G(),ae(),z(y())])).optional())}),JE=P({type:O("ref/resource"),uri:y()});var WE=P({type:O("ref/prompt"),name:y()}),GE=ft.extend({ref:ce([WE,JE]),argument:P({name:y(),value:y()}),context:P({arguments:de(y(),y()).optional()}).optional()}),QE=Ae.extend({method:O("completion/complete"),params:GE});var N_=Ne.extend({completion:ve({values:z(y()).max(100),total:ue(G().int()),hasMore:ue(ae())})}),YE=P({uri:y().startsWith("file://"),name:y().optional(),_meta:de(y(),pe()).optional()}),XE=Ae.extend({method:O("roots/list"),params:ft.optional()}),eI=Ne.extend({roots:z(YE)}),tI=yt.extend({method:O("notifications/roots/list_changed"),params:gt.optional()}),TM=ce([en,QC,QE,$E,hE,S_,w_,$_,k_,aE,uE,$u,P0,hu,gu,yu,vu]),RM=ce([pu,mu,v0,tI,Ji]),OM=ce([wr,xu,ku,A_,eI,_u,bu,tn]),AM=ce([en,rs,O_,XE,hu,gu,yu,vu]),NM=ce([pu,mu,R_,dE,Qi,ts,Xi,Ji,KE]),jM=ce([wr,b_,N_,T_,Yi,go,Gi,yo,bt,es,_u,bu,tn]),N=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===D.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new h_(o.elicitations,r)}return new e(t,r,n)}},h_=class extends N{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(D.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};nt();function Su(e){return!!e._zod}function Pt(e,t){return Su(e)?aa(e,t):e.safeParse(t)}function zu(e){if(!e)return;let t;if(Su(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Pu(e){if(Su(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.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}function $r(e){return e==="completed"||e==="failed"||e==="cancelled"}var v4=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function j_(e){let r=zu(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Pu(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function D_(e,t){let r=Pt(e,t);if(!r.success)throw r.error;return r.data}var aI=6e4,vo=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(pu,r=>{this._oncancel(r)}),this.setNotificationHandler(mu,r=>{this._onprogress(r)}),this.setRequestHandler(en,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(hu,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new N(D.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(gu,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(!await this._taskStore.getTask(i,n.sessionId))throw new N(D.InvalidParams,`Task not found: ${i}`);if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let f=c,d=new N(f.error.code,f.error.message,f.error.data);l(d)}else{let f=a.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(i,n.sessionId);if(!s)throw new N(D.InvalidParams,`Task not found: ${i}`);if(!$r(s.status))return await this._waitForTaskUpdate(i,n.signal,n.sessionId),await o();if($r(s.status)){let a=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i,n.sessionId),{...a,_meta:{...a._meta,[vr]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(yu,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new N(D.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(vu,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new N(D.InvalidParams,`Task not found: ${r.params.taskId}`);if($r(o.status))throw new N(D.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId,n.sessionId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new N(D.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof N?o:new N(D.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_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),N.fromError(D.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=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{o?.(i,s),Xr(i)||b0(i)?this._onresponse(i):Ui(i)?this._onrequest(i,s):y0(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},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=N.fromError(D.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,o=this._transport,i=t.params?._meta?.[vr]?.taskId,s=o?.sessionId,a=this._taskStore,c=!0,u;if(i&&a&&this._taskMessageQueue&&s!==void 0&&(c=!1,u=(async()=>{if(!await a.getTask(i,s))throw new N(D.InvalidParams,`Task not found: ${i}`);c=!0})()),n===void 0){let m={jsonrpc:"2.0",id:t.id,error:{code:D.MethodNotFound,message:"Method not found"}};if(i&&u){let h={type:"error",message:m,timestamp:Date.now()};u.then(()=>this._enqueueTaskMessage(i,h,s),()=>o?.send(m)).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))}else i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:m,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(m).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(t.id,l);let f=h0(t.params)?t.params.task:void 0,d=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,p={signal:l.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async m=>{if(l.signal.aborted)return;let h={relatedRequestId:t.id};i&&(h.relatedTask={taskId:i}),await this.notification(m,h)},sendRequest:async(m,h,g)=>{if(l.signal.aborted)throw new N(D.ConnectionClosed,"Request was cancelled");let w={...g,relatedRequestId:t.id};i&&!w.relatedTask&&(w.relatedTask={taskId:i});let v=w.relatedTask?.taskId??i;return v&&d&&await d.updateTaskStatus(v,"input_required"),await this.request(m,h,w)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:d,taskRequestedTtl:f?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};(u??Promise.resolve()).then(()=>{if(u&&l.signal.aborted)throw new N(D.ConnectionClosed,"Request was cancelled");f&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,p)).then(async m=>{if(l.signal.aborted)return;let h={result:m,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async m=>{if(l.signal.aborted)return;let h={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(m.code)?m.code:D.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};i&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(i,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===l&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Xr(t))n(t);else{let s=new N(t.error.code,t.error.message,t.error.data);n(s)}return}let o=this._responseHandlers.get(r);if(o===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 i=!1;if(Xr(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,r))}}if(i||this._progressHandlers.delete(r),Xr(t))o(t);else{let s=N.fromError(t.error.code,t.error.message,t.error.data);o(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(s){yield{type:"error",error:s instanceof N?s:new N(D.InternalError,String(s))}}return}let i;try{let s=await this.request(t,tn,n);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new N(D.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:a},$r(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:a.status==="failed"?yield{type:"error",error:new N(D.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new N(D.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof N?s:new N(D.InternalError,String(s))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let f=v=>{l(v)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(v){f(v);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:d}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[vr]:c}});let m=v=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(v)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(C=>this._onerror(new Error(`Failed to send cancellation: ${C}`)));let x=v instanceof N?v:new N(D.RequestTimeout,String(v));l(x)};this._responseHandlers.set(d,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return l(v);try{let x=Pt(r,v.result);x.success?u(x.data):l(x.error)}catch(x){l(x)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??aI,g=()=>m(N.fromError(D.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(d,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let w=c?.taskId;if(w){let v=x=>{let C=this._responseHandlers.get(d);C?C(x):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,v),this._enqueueTaskMessage(w,{type:"request",message:p,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(d),l(x)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:s}).catch(v=>{this._cleanupTimeout(d),l(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},_u,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},bu,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},$0,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 a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[vr]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,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 a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[vr]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[vr]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(t,r){let n=j_(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let s=D_(t,o);return Promise.resolve(r(s,i))})}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=j_(t);this._notificationHandlers.set(n,o=>{let i=D_(t,o);return Promise.resolve(r(i))})}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 o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n??this._transport?.sessionId,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&Ui(o.message)){let i=o.message.id,s=this._requestResolvers.get(i);s?(s(new N(D.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r,n){let o=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(t,n);i?.pollInterval&&(o=i.pollInterval)}catch{}return new Promise((i,s)=>{if(r.aborted){s(new N(D.InvalidRequest,"Request cancelled"));return}let a=setTimeout(i,o);r.addEventListener("abort",()=>{clearTimeout(a),s(new N(D.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new N(D.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,s)=>{await n.storeTaskResult(o,i,s,r);let a=await n.getTask(o,r);if(a){let c=Ji.parse({method:"notifications/tasks/status",params:a});await this.notification(c),$r(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,s)=>{let a=await n.getTask(o,r);if(!a)throw new N(D.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if($r(a.status))throw new N(D.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,s,r);let c=await n.getTask(o,r);if(c){let u=Ji.parse({method:"notifications/tasks/status",params:c});await this.notification(u),$r(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function I0(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function M_(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let s=r[o];I0(s)&&I0(i)?r[o]={...s,...i}:r[o]=i}return r}lu();var bL=(e=>typeof Ar<"u"?Ar:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof Ar<"u"?Ar:t)[r]}):e)(function(e){if(typeof Ar<"u")return Ar.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Z_=class extends vo{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(t,r){}_ensureEventSlot(t){let r=this._eventSlots.get(t);if(!r){let n=this.eventSchemas[t];if(!n)throw Error(`Unknown event: ${String(t)}`);r={listeners:[]},this._eventSlots.set(t,r);let o=n.shape.method.value;this._registeredMethods.add(o);let i=r;super.setNotificationHandler(n,s=>{let a=s.params;this.onEventDispatch(t,a),i.onHandler?.(a);for(let c of[...i.listeners])c(a)})}return r}setEventHandler(t,r){let n=this._ensureEventSlot(t);n.onHandler&&r&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", \u2026) to add multiple listeners without replacing.`),n.onHandler=r}getEventHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,r){this._ensureEventSlot(t).listeners.push(r)}removeEventListener(t,r){let n=this._eventSlots.get(t);if(!n)return;let o=n.listeners.indexOf(r);o!==-1&&n.listeners.splice(o,1)}setRequestHandler=(t,r)=>{this._assertMethodNotRegistered(t,"setRequestHandler"),super.setRequestHandler(t,r)};setNotificationHandler=(t,r)=>{this._assertMethodNotRegistered(t,"setNotificationHandler"),super.setNotificationHandler(t,r)};warnIfRequestHandlerReplaced(t,r,n){r&&n&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(t,r)=>{let n=t.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(t,r)};_assertMethodNotRegistered(t,r){let n=t.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${r}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},O0="2026-01-26";var cI="ui/notifications/tool-input-partial";var uI=_.union([_.literal("light"),_.literal("dark")]).describe("Color theme preference for the host environment."),os=_.union([_.literal("inline"),_.literal("fullscreen"),_.literal("pip")]).describe("Display mode for UI presentation."),lI=_.union([_.literal("--color-background-primary"),_.literal("--color-background-secondary"),_.literal("--color-background-tertiary"),_.literal("--color-background-inverse"),_.literal("--color-background-ghost"),_.literal("--color-background-info"),_.literal("--color-background-danger"),_.literal("--color-background-success"),_.literal("--color-background-warning"),_.literal("--color-background-disabled"),_.literal("--color-text-primary"),_.literal("--color-text-secondary"),_.literal("--color-text-tertiary"),_.literal("--color-text-inverse"),_.literal("--color-text-ghost"),_.literal("--color-text-info"),_.literal("--color-text-danger"),_.literal("--color-text-success"),_.literal("--color-text-warning"),_.literal("--color-text-disabled"),_.literal("--color-border-primary"),_.literal("--color-border-secondary"),_.literal("--color-border-tertiary"),_.literal("--color-border-inverse"),_.literal("--color-border-ghost"),_.literal("--color-border-info"),_.literal("--color-border-danger"),_.literal("--color-border-success"),_.literal("--color-border-warning"),_.literal("--color-border-disabled"),_.literal("--color-ring-primary"),_.literal("--color-ring-secondary"),_.literal("--color-ring-inverse"),_.literal("--color-ring-info"),_.literal("--color-ring-danger"),_.literal("--color-ring-success"),_.literal("--color-ring-warning"),_.literal("--font-sans"),_.literal("--font-mono"),_.literal("--font-weight-normal"),_.literal("--font-weight-medium"),_.literal("--font-weight-semibold"),_.literal("--font-weight-bold"),_.literal("--font-text-xs-size"),_.literal("--font-text-sm-size"),_.literal("--font-text-md-size"),_.literal("--font-text-lg-size"),_.literal("--font-heading-xs-size"),_.literal("--font-heading-sm-size"),_.literal("--font-heading-md-size"),_.literal("--font-heading-lg-size"),_.literal("--font-heading-xl-size"),_.literal("--font-heading-2xl-size"),_.literal("--font-heading-3xl-size"),_.literal("--font-text-xs-line-height"),_.literal("--font-text-sm-line-height"),_.literal("--font-text-md-line-height"),_.literal("--font-text-lg-line-height"),_.literal("--font-heading-xs-line-height"),_.literal("--font-heading-sm-line-height"),_.literal("--font-heading-md-line-height"),_.literal("--font-heading-lg-line-height"),_.literal("--font-heading-xl-line-height"),_.literal("--font-heading-2xl-line-height"),_.literal("--font-heading-3xl-line-height"),_.literal("--border-radius-xs"),_.literal("--border-radius-sm"),_.literal("--border-radius-md"),_.literal("--border-radius-lg"),_.literal("--border-radius-xl"),_.literal("--border-radius-full"),_.literal("--border-width-regular"),_.literal("--shadow-hairline"),_.literal("--shadow-sm"),_.literal("--shadow-md"),_.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),dI=_.record(lI.describe(`Style variables for theming MCP apps.
84
+
85
+ Individual style keys are optional - hosts may provide any subset of these values.
86
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
87
+
88
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
89
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),_.union([_.string(),_.undefined()]).describe(`Style variables for theming MCP apps.
90
+
91
+ Individual style keys are optional - hosts may provide any subset of these values.
92
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
93
+
94
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
95
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
96
+
97
+ Individual style keys are optional - hosts may provide any subset of these values.
98
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
99
+
100
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
101
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),fI=_.object({method:_.literal("ui/open-link"),params:_.object({url:_.string().describe("URL to open in the host's browser")})}),kL=_.object({isError:_.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),SL=_.object({isError:_.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),zL=_.object({isError:_.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),pI=_.object({method:_.literal("ui/notifications/sandbox-proxy-ready"),params:_.object({})}),L_=_.object({connectDomains:_.array(_.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
102
+
103
+ - Maps to CSP \`connect-src\` directive
104
+ - Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:_.array(_.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:_.array(_.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:_.array(_.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),q_=_.object({camera:_.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:_.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:_.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:_.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),mI=_.object({method:_.literal("ui/notifications/size-changed"),params:_.object({width:_.number().optional().describe("New width in pixels."),height:_.number().optional().describe("New height in pixels.")})}),PL=_.object({method:_.literal("ui/notifications/tool-input"),params:_.object({arguments:_.record(_.string(),_.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),CL=_.object({method:_.literal("ui/notifications/tool-input-partial"),params:_.object({arguments:_.record(_.string(),_.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),EL=_.object({method:_.literal("ui/notifications/tool-cancelled"),params:_.object({reason:_.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),hI=_.object({fonts:_.string().optional()}),_I=_.object({variables:dI.optional().describe("CSS variables for theming the app."),css:hI.optional().describe("CSS blocks that apps can inject.")}),IL=_.object({method:_.literal("ui/resource-teardown"),params:_.object({})}),gI=_.record(_.string(),_.unknown()),T0=_.object({text:_.object({}).optional().describe("Host supports text content blocks."),image:_.object({}).optional().describe("Host supports image content blocks."),audio:_.object({}).optional().describe("Host supports audio content blocks."),resource:_.object({}).optional().describe("Host supports resource content blocks."),resourceLink:_.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:_.object({}).optional().describe("Host supports structured content.")}),yI=_.object({method:_.literal("ui/notifications/request-teardown"),params:_.object({}).optional()}),bI=_.object({experimental:_.record(_.string(),_.record(_.string(),_.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:_.object({}).optional().describe("Host supports opening external URLs."),downloadFile:_.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:_.object({listChanged:_.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:_.object({listChanged:_.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:_.object({}).optional().describe("Host accepts log messages."),sandbox:_.object({permissions:q_.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:L_.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:T0.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:T0.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:_.object({tools:_.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),vI=_.object({experimental:_.record(_.string(),_.record(_.string(),_.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:_.object({listChanged:_.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:_.array(os).optional().describe("Display modes the app supports.")}),wI=_.object({method:_.literal("ui/notifications/initialized"),params:_.object({}).optional()}),TL=_.object({csp:L_.optional().describe("Content Security Policy configuration for UI resources."),permissions:q_.optional().describe("Sandbox permissions requested by the UI resource."),domain:_.string().optional().describe(`Dedicated origin for view sandbox.
105
+
106
+ Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
107
+
108
+ **Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
109
+ - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
110
+ - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
111
+
112
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:_.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
113
+
114
+ Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
115
+
116
+ - \`true\`: request visible border + background
117
+ - \`false\`: request no visible border + background
118
+ - omitted: host decides border`)}),R0=_.object({method:_.literal("ui/request-display-mode"),params:_.object({mode:os.describe("The display mode being requested.")})}),RL=_.object({mode:os.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),$I=_.union([_.literal("model"),_.literal("app")]).describe("Tool visibility scope - who can access the tool."),OL=_.object({resourceUri:_.string().optional(),visibility:_.array($I).optional().describe(`Who can access this tool. Default: ["model", "app"]
119
+ - "model": Tool visible to and callable by the agent
120
+ - "app": Tool callable by the app from this server only`),csp:_.never().optional(),permissions:_.never().optional()}),AL=_.object({mimeTypes:_.array(_.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),xI=_.object({method:_.literal("ui/download-file"),params:_.object({contents:_.array(_.union([E_,I_])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),kI=_.object({method:_.literal("ui/message"),params:_.object({role:_.literal("user").describe('Message role, currently only "user" is supported.'),content:_.array(bo).describe("Message content blocks (text, image, etc.).")})}),NL=_.object({method:_.literal("ui/notifications/sandbox-resource-ready"),params:_.object({html:_.string().describe("HTML content to load into the inner iframe."),sandbox:_.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:L_.optional().describe("CSP configuration from resource metadata."),permissions:q_.optional().describe("Sandbox permissions from resource metadata.")})}),jL=_.object({method:_.literal("ui/notifications/tool-result"),params:bt.describe("Standard MCP tool execution result.")}),A0=_.object({toolInfo:_.object({id:mo.optional().describe("JSON-RPC id of the tools/call request."),tool:wu.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:uI.optional().describe("Current color theme preference."),styles:_I.optional().describe("Style configuration for theming the app."),displayMode:os.optional().describe("How the UI is currently displayed."),availableDisplayModes:_.array(os).optional().describe("Display modes the host supports."),containerDimensions:_.union([_.object({height:_.number().describe("Fixed container height in pixels.")}),_.object({maxHeight:_.union([_.number(),_.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(_.union([_.object({width:_.number().describe("Fixed container width in pixels.")}),_.object({maxWidth:_.union([_.number(),_.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
121
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:_.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:_.string().optional().describe("User's timezone in IANA format."),userAgent:_.string().optional().describe("Host application identifier."),platform:_.union([_.literal("web"),_.literal("desktop"),_.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:_.object({touch:_.boolean().optional().describe("Whether the device supports touch input."),hover:_.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:_.object({top:_.number().describe("Top safe area inset in pixels."),right:_.number().describe("Right safe area inset in pixels."),bottom:_.number().describe("Bottom safe area inset in pixels."),left:_.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),DL=_.object({method:_.literal("ui/notifications/host-context-changed"),params:A0.describe("Partial context update containing only changed fields.")}),SI=_.object({method:_.literal("ui/update-model-context"),params:_.object({content:_.array(bo).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:_.record(_.string(),_.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),zI=_.object({method:_.literal("ui/initialize"),params:_.object({appInfo:Vi.describe("App identification (name and version)."),appCapabilities:vI.describe("Features and capabilities this app provides."),protocolVersion:_.string().describe("Protocol version this app supports.")})}),ML=_.object({protocolVersion:_.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Vi.describe("Host application identification and version."),hostCapabilities:bI.describe("Features and capabilities provided by the host."),hostContext:A0.describe("Rich context about the host environment.")}).passthrough(),Cu=class{eventTarget;eventSource;messageListener;constructor(t=window.parent,r){this.eventTarget=t,this.eventSource=r,this.messageListener=n=>{if(r&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let o=ho.safeParse(n.data);o.success?(console.debug("Parsed message",o.data),this.onmessage?.(o.data)):n.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",o.error.message,n):(console.error("Failed to parse message",o.error.message,n),this.onerror?.(Error("Invalid JSON-RPC message received: "+o.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,r){t.method!==cI&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion};var PI=[O0],Eu=class extends Z_{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(t,r)=>{this._baseReplaceRequestHandler(t,(n,o)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${n.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),r(n,o)))};eventSchemas={sizechange:mI,sandboxready:pI,initialized:wI,requestteardown:yI,loggingmessage:R_};constructor(t,r,n,o){super(o),this._client=t,this._hostInfo=r,this._capabilities=n,this.addEventListener("initialized",()=>{this._initializedReceived=!0}),this._hostContext=o?.hostContext||{},this.setRequestHandler(zI,i=>this._oninitialize(i)),this.setRequestHandler(en,(i,s)=>(this.onping?.(i.params,s),{})),this.replaceRequestHandler(R0,i=>({mode:this._hostContext.displayMode??"inline"}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler("sizechange")}set onsizechange(t){this.setEventHandler("sizechange",t)}get onsandboxready(){return this.getEventHandler("sandboxready")}set onsandboxready(t){this.setEventHandler("sandboxready",t)}get oninitialized(){return this.getEventHandler("initialized")}set oninitialized(t){this.setEventHandler("initialized",t)}_onmessage;get onmessage(){return this._onmessage}set onmessage(t){this.warnIfRequestHandlerReplaced("onmessage",this._onmessage,t),this._onmessage=t,this.replaceRequestHandler(kI,async(r,n)=>{if(!this._onmessage)throw Error("No onmessage handler set");return this._onmessage(r.params,n)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(t){this.warnIfRequestHandlerReplaced("onopenlink",this._onopenlink,t),this._onopenlink=t,this.replaceRequestHandler(fI,async(r,n)=>{if(!this._onopenlink)throw Error("No onopenlink handler set");return this._onopenlink(r.params,n)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(t){this.warnIfRequestHandlerReplaced("ondownloadfile",this._ondownloadfile,t),this._ondownloadfile=t,this.replaceRequestHandler(xI,async(r,n)=>{if(!this._ondownloadfile)throw Error("No ondownloadfile handler set");return this._ondownloadfile(r.params,n)})}get onrequestteardown(){return this.getEventHandler("requestteardown")}set onrequestteardown(t){this.setEventHandler("requestteardown",t)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(t){this.warnIfRequestHandlerReplaced("onrequestdisplaymode",this._onrequestdisplaymode,t),this._onrequestdisplaymode=t,this.replaceRequestHandler(R0,async(r,n)=>{if(!this._onrequestdisplaymode)throw Error("No onrequestdisplaymode handler set");return this._onrequestdisplaymode(r.params,n)})}get onloggingmessage(){return this.getEventHandler("loggingmessage")}set onloggingmessage(t){this.setEventHandler("loggingmessage",t)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(t){this.warnIfRequestHandlerReplaced("onupdatemodelcontext",this._onupdatemodelcontext,t),this._onupdatemodelcontext=t,this.replaceRequestHandler(SI,async(r,n)=>{if(!this._onupdatemodelcontext)throw Error("No onupdatemodelcontext handler set");return this._onupdatemodelcontext(r.params,n)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler($u,async(r,n)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(r.params,n)})}set oncreatesamplingmessage(t){this.setRequestHandler(rs,async(r,n)=>t(r.params,n))}sendToolListChanged(t={}){return this.notification({method:"notifications/tools/list_changed",params:t})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(t){this.warnIfRequestHandlerReplaced("onlistresources",this._onlistresources,t),this._onlistresources=t,this.replaceRequestHandler(w_,async(r,n)=>{if(!this._onlistresources)throw Error("No onlistresources handler set");return this._onlistresources(r.params,n)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(t){this.warnIfRequestHandlerReplaced("onlistresourcetemplates",this._onlistresourcetemplates,t),this._onlistresourcetemplates=t,this.replaceRequestHandler($_,async(r,n)=>{if(!this._onlistresourcetemplates)throw Error("No onlistresourcetemplates handler set");return this._onlistresourcetemplates(r.params,n)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(t){this.warnIfRequestHandlerReplaced("onreadresource",this._onreadresource,t),this._onreadresource=t,this.replaceRequestHandler(k_,async(r,n)=>{if(!this._onreadresource)throw Error("No onreadresource handler set");return this._onreadresource(r.params,n)})}sendResourceListChanged(t={}){return this.notification({method:"notifications/resources/list_changed",params:t})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(t){this.warnIfRequestHandlerReplaced("onlistprompts",this._onlistprompts,t),this._onlistprompts=t,this.replaceRequestHandler(S_,async(r,n)=>{if(!this._onlistprompts)throw Error("No onlistprompts handler set");return this._onlistprompts(r.params,n)})}sendPromptListChanged(t={}){return this.notification({method:"notifications/prompts/list_changed",params:t})}assertCapabilityForMethod(t){}assertRequestHandlerCapability(t){}assertNotificationCapability(t){}assertTaskCapability(t){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(t){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize(t){let r=t.params.protocolVersion;return this._appInfo!==void 0&&console.warn("[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values."),this._appCapabilities=t.params.appCapabilities,this._appInfo=t.params.appInfo,{protocolVersion:PI.includes(r)?r:O0,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(t){let r={},n=!1;for(let o of Object.keys(t)){let i=this._hostContext[o],s=t[o];CI(i,s)||(r[o]=s,n=!0)}n&&(this._hostContext=t,this.sendHostContextChange(r))}sendHostContextChange(t){return this.notification({method:"ui/notifications/host-context-changed",params:t})}sendToolInput(t){return this.notification({method:"ui/notifications/tool-input",params:t})}sendToolInputPartial(t){return this.notification({method:"ui/notifications/tool-input-partial",params:t})}sendToolResult(t){return this.notification({method:"ui/notifications/tool-result",params:t})}sendToolCancelled(t){return this.notification({method:"ui/notifications/tool-cancelled",params:t})}sendSandboxResourceReady(t){return this.notification({method:"ui/notifications/sandbox-resource-ready",params:t})}teardownResource(t,r){return this.request({method:"ui/resource-teardown",params:t},gI,r)}sendResourceTeardown=this.teardownResource;callTool(t,r){return this.request({method:"tools/call",params:t},bt,r)}listTools(t,r){return this.request({method:"tools/list",params:t},es,r)}async connect(t){if(this.transport)throw Error("AppBridge is already connected. Call close() before connecting again.");if(this._initializedReceived=!1,this._client){let r=this._client.getServerCapabilities();if(!r)throw Error("Client server capabilities not available");r.tools&&(this.oncalltool=async(n,o)=>this._client.request({method:"tools/call",params:n},bt,{signal:o.signal}),r.tools.listChanged&&this._client.setNotificationHandler(ts,n=>this.sendToolListChanged(n.params))),r.resources&&(this.onlistresources=async(n,o)=>this._client.request({method:"resources/list",params:n},go,{signal:o.signal}),this.onlistresourcetemplates=async(n,o)=>this._client.request({method:"resources/templates/list",params:n},Gi,{signal:o.signal}),this.onreadresource=async(n,o)=>this._client.request({method:"resources/read",params:n},yo,{signal:o.signal}),r.resources.listChanged&&this._client.setNotificationHandler(Qi,n=>this.sendResourceListChanged(n.params))),r.prompts&&(this.onlistprompts=async(n,o)=>this._client.request({method:"prompts/list",params:n},Yi,{signal:o.signal}),r.prompts.listChanged&&this._client.setNotificationHandler(Xi,n=>this.sendPromptListChanged(n.params)))}return super.connect(t)}};function CI(e,t){return JSON.stringify(e)===JSON.stringify(t)}var jk=Nl(Ry(),1),Dk=Nl(Nk(),1);function qj(){let e=new jk.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Dk.default)(e),e}var ml=class{constructor(t){this._ajv=t??qj()}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 hl=class{constructor(t){this._client=t}async*callToolStream(t,r=bt,n){let o=this._client,i={...n,task:n?.task??(o.isToolTask(t.name)?{}:void 0)},s=o.requestStream({method:"tools/call",params:t},r,i),a=o.getToolOutputValidator(t.name);for await(let c of s){if(c.type==="result"&&a){let u=c.result;if(!u.structuredContent&&!u.isError){yield{type:"error",error:new N(D.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(u.structuredContent)try{let l=a(u.structuredContent);if(!l.valid){yield{type:"error",error:new N(D.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof N){yield{type:"error",error:l};return}yield{type:"error",error:new N(D.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield c}}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 Mk(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 Zk(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}}function _l(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 o of Object.keys(n)){let i=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(i,"default")&&(r[o]=i.default),r[o]!==void 0&&_l(i,r[o])}}if(Array.isArray(e.anyOf))for(let r of e.anyOf)typeof r!="boolean"&&_l(r,t);if(Array.isArray(e.oneOf))for(let r of e.oneOf)typeof r!="boolean"&&_l(r,t)}}function Uj(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 gl=class extends vo{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 ml,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(t){t.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",ts,t.tools,async()=>(await this.listTools()).tools),t.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Xi,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Qi,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new hl(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=M_(this._capabilities,t)}setRequestHandler(t,r){let o=zu(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i=Pu(o);if(typeof i!="string")throw new Error("Schema method literal must be a string");let s=i;if(s==="elicitation/create"){let a=async(c,u)=>{let l=Pt(O_,c);if(!l.success){let v=l.error instanceof Error?l.error.message:String(l.error);throw new N(D.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:f}=l.data;f.mode=f.mode??"form";let{supportsFormMode:d,supportsUrlMode:p}=Uj(this._capabilities.elicitation);if(f.mode==="form"&&!d)throw new N(D.InvalidParams,"Client does not support form-mode elicitation requests");if(f.mode==="url"&&!p)throw new N(D.InvalidParams,"Client does not support URL-mode elicitation requests");let m=await Promise.resolve(r(c,u));if(f.task){let v=Pt(tn,m);if(!v.success){let x=v.error instanceof Error?v.error.message:String(v.error);throw new N(D.InvalidParams,`Invalid task creation result: ${x}`)}return v.data}let h=Pt(A_,m);if(!h.success){let v=h.error instanceof Error?h.error.message:String(h.error);throw new N(D.InvalidParams,`Invalid elicitation result: ${v}`)}let g=h.data,w=f.mode==="form"?f.requestedSchema:void 0;if(f.mode==="form"&&g.action==="accept"&&g.content&&w&&this._capabilities.elicitation?.form?.applyDefaults)try{_l(w,g.content)}catch{}return g};return super.setRequestHandler(t,a)}if(s==="sampling/createMessage"){let a=async(c,u)=>{let l=Pt(rs,c);if(!l.success){let g=l.error instanceof Error?l.error.message:String(l.error);throw new N(D.InvalidParams,`Invalid sampling request: ${g}`)}let{params:f}=l.data,d=await Promise.resolve(r(c,u));if(f.task){let g=Pt(tn,d);if(!g.success){let w=g.error instanceof Error?g.error.message:String(g.error);throw new N(D.InvalidParams,`Invalid task creation result: ${w}`)}return g.data}let m=f.tools||f.toolChoice?ku:xu,h=Pt(m,d);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new N(D.InvalidParams,`Invalid sampling result: ${g}`)}return h.data};return super.setRequestHandler(t,a)}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:po,capabilities:this._capabilities,clientInfo:this._clientInfo}},b_,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!f0.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){Mk(this._serverCapabilities?.tasks?.requests,t,"Server")}assertTaskHandlerCapability(t){this._capabilities&&Zk(this._capabilities.tasks?.requests,t,"Client")}async ping(t){return this.request({method:"ping"},wr,t)}async complete(t,r){return this.request({method:"completion/complete",params:t},N_,r)}async setLoggingLevel(t,r){return this.request({method:"logging/setLevel",params:{level:t}},wr,r)}async getPrompt(t,r){return this.request({method:"prompts/get",params:t},T_,r)}async listPrompts(t,r){return this.request({method:"prompts/list",params:t},Yi,r)}async listResources(t,r){return this.request({method:"resources/list",params:t},go,r)}async listResourceTemplates(t,r){return this.request({method:"resources/templates/list",params:t},Gi,r)}async readResource(t,r){return this.request({method:"resources/read",params:t},yo,r)}async subscribeResource(t,r){return this.request({method:"resources/subscribe",params:t},wr,r)}async unsubscribeResource(t,r){return this.request({method:"resources/unsubscribe",params:t},wr,r)}async callTool(t,r=bt,n){if(this.isToolTaskRequired(t.name))throw new N(D.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:t},r,n),i=this.getToolOutputValidator(t.name);if(i){if(!o.structuredContent&&!o.isError)throw new N(D.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let s=i(o.structuredContent);if(!s.valid)throw new N(D.InvalidParams,`Structured content does not match the tool's output schema: ${s.errorMessage}`)}catch(s){throw s instanceof N?s:new N(D.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return o}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 o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}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},es,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(t,r,n,o){let i=C0.safeParse(n);if(!i.success)throw new Error(`Invalid ${t} listChanged options: ${i.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);let{autoRefresh:s,debounceMs:a}=i.data,{onChanged:c}=n,u=async()=>{if(!s){c(null,null);return}try{let f=await o();c(null,f)}catch(f){let d=f instanceof Error?f:new Error(String(f));c(d,null)}},l=()=>{if(a){let f=this._listChangedDebounceTimers.get(t);f&&clearTimeout(f);let d=setTimeout(u,a);this._listChangedDebounceTimers.set(t,d)}else u()};this.setNotificationHandler(r,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var Vk=Nl(Fk(),1);function Hk(e){if(e)try{return Vk.default.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}function yl(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function Bk(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...yl(t.headers),...yl(n.headers)}:t.headers};return e(r,o)}:e}var Qj=5,Yj=[301,302,303,307,308];function Xj(e,t){return e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port?!0:e.hostname===t.hostname&&e.protocol==="http:"&&e.port===""&&t.protocol==="https:"&&t.port===""}function Kk(e,t){let r=Yj.includes(e.status)?e.headers.get("location"):null;try{return r?new URL(r,t):void 0}catch{return}}function bl(e,t,r,n,o=0){let i=Kk(n,t),s=n.status===307||n.status===308||(r?.method??"GET").toUpperCase()==="GET";if(!i||o===Qj||!s)return;let a=new URL(t);if(!((i.username||i.password)&&(i.username!==a.username||i.password!==a.password)||!Xj(a,i)))return Promise.resolve(n.body?.cancel()).then(()=>e(i,{...r,redirect:"manual"})).then(u=>bl(e,i,r,u,o+1)??u)}var Jk=new WeakSet;function qy(e){let t=(r,n)=>(e??fetch)(r,n);return Jk.add(t),t}function hn(e=fetch){return Jk.has(e)?e:(t,r)=>r?.redirect==="error"||r?.redirect==="manual"?e(t,r):Promise.resolve(e(t,{...r,redirect:"manual"})).then(n=>bl(e,t,r,n)??n)}function vl(e,t){if(e.type==="opaqueredirect")return"Redirect not followed: this runtime does not expose the redirect target";let r=e.url||t,n=Kk(e,r);if(n)return n.username=n.password=n.search=n.hash="",n.protocol==="http:"&&new URL(r).protocol==="https:"?(n.protocol="https:",`Redirect to plain http not followed; try ${n.href} instead`):`Redirect to ${n.href} not followed`}var Uy;Uy=globalThis.crypto;async function eD(e){return(await Uy).getRandomValues(new Uint8Array(e))}async function tD(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await eD(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function rD(e){return await tD(e)}async function nD(e){let t=await(await Uy).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Fy(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await rD(e),r=await nD(t);return{code_verifier:t,code_challenge:r}}lu();var Ze=Lc().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:d_.custom,message:"URL must be parseable",fatal:!0}),Jo}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Gk=ve({resource:y().url(),authorization_servers:z(Ze).optional(),jwks_uri:y().url().optional(),scopes_supported:z(y()).optional(),bearer_methods_supported:z(y()).optional(),resource_signing_alg_values_supported:z(y()).optional(),resource_name:y().optional(),resource_documentation:y().optional(),resource_policy_uri:y().url().optional(),resource_tos_uri:y().url().optional(),tls_client_certificate_bound_access_tokens:ae().optional(),authorization_details_types_supported:z(y()).optional(),dpop_signing_alg_values_supported:z(y()).optional(),dpop_bound_access_tokens_required:ae().optional()}),Vy=ve({issuer:y(),authorization_endpoint:Ze,token_endpoint:Ze,registration_endpoint:Ze.optional(),scopes_supported:z(y()).optional(),response_types_supported:z(y()),response_modes_supported:z(y()).optional(),grant_types_supported:z(y()).optional(),token_endpoint_auth_methods_supported:z(y()).optional(),token_endpoint_auth_signing_alg_values_supported:z(y()).optional(),service_documentation:Ze.optional(),revocation_endpoint:Ze.optional(),revocation_endpoint_auth_methods_supported:z(y()).optional(),revocation_endpoint_auth_signing_alg_values_supported:z(y()).optional(),introspection_endpoint:y().optional(),introspection_endpoint_auth_methods_supported:z(y()).optional(),introspection_endpoint_auth_signing_alg_values_supported:z(y()).optional(),code_challenge_methods_supported:z(y()).optional(),client_id_metadata_document_supported:ae().optional()}),oD=ve({issuer:y(),authorization_endpoint:Ze,token_endpoint:Ze,userinfo_endpoint:Ze.optional(),jwks_uri:Ze,registration_endpoint:Ze.optional(),scopes_supported:z(y()).optional(),response_types_supported:z(y()),response_modes_supported:z(y()).optional(),grant_types_supported:z(y()).optional(),acr_values_supported:z(y()).optional(),subject_types_supported:z(y()),id_token_signing_alg_values_supported:z(y()),id_token_encryption_alg_values_supported:z(y()).optional(),id_token_encryption_enc_values_supported:z(y()).optional(),userinfo_signing_alg_values_supported:z(y()).optional(),userinfo_encryption_alg_values_supported:z(y()).optional(),userinfo_encryption_enc_values_supported:z(y()).optional(),request_object_signing_alg_values_supported:z(y()).optional(),request_object_encryption_alg_values_supported:z(y()).optional(),request_object_encryption_enc_values_supported:z(y()).optional(),token_endpoint_auth_methods_supported:z(y()).optional(),token_endpoint_auth_signing_alg_values_supported:z(y()).optional(),display_values_supported:z(y()).optional(),claim_types_supported:z(y()).optional(),claims_supported:z(y()).optional(),service_documentation:y().optional(),claims_locales_supported:z(y()).optional(),ui_locales_supported:z(y()).optional(),claims_parameter_supported:ae().optional(),request_parameter_supported:ae().optional(),request_uri_parameter_supported:ae().optional(),require_request_uri_registration:ae().optional(),op_policy_uri:Ze.optional(),op_tos_uri:Ze.optional(),client_id_metadata_document_supported:ae().optional()}),Qk=P({...oD.shape,...Vy.pick({code_challenge_methods_supported:!0}).shape}),Yk=P({access_token:y(),id_token:y().optional(),token_type:y(),expires_in:Li.number().optional(),scope:y().optional(),refresh_token:y().optional(),issuer:y().optional().catch(void 0)}).strip(),Xk=P({error:y(),error_description:y().optional(),error_uri:y().optional()}),Wk=Ze.optional().or(O("").transform(()=>{})),iD=P({redirect_uris:z(Ze),token_endpoint_auth_method:y().optional(),grant_types:z(y()).optional(),response_types:z(y()).optional(),client_name:y().optional(),client_uri:Ze.optional(),logo_uri:Wk,scope:y().optional(),contacts:z(y()).optional(),tos_uri:Wk,policy_uri:y().optional(),jwks_uri:Ze.optional(),jwks:nu().optional(),software_id:y().optional(),software_version:y().optional(),software_statement:y().optional()}).strip(),sD=P({client_id:y(),client_secret:y().optional(),client_id_issued_at:G().optional(),client_secret_expires_at:G().optional(),issuer:y().optional().catch(void 0)}).strip(),eS=iD.merge(sD),vU=P({error:y(),error_description:y().optional()}).strip(),wU=P({token:y(),token_type_hint:y().optional()}).strip();function tS(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function rS({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var $e=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Ns=class extends $e{};Ns.errorCode="invalid_request";var _n=class extends $e{};_n.errorCode="invalid_client";var gn=class extends $e{};gn.errorCode="invalid_grant";var yn=class extends $e{};yn.errorCode="unauthorized_client";var js=class extends $e{};js.errorCode="unsupported_grant_type";var Ds=class extends $e{};Ds.errorCode="invalid_scope";var Ms=class extends $e{};Ms.errorCode="access_denied";var tr=class extends $e{};tr.errorCode="server_error";var Zs=class extends $e{};Zs.errorCode="temporarily_unavailable";var Ls=class extends $e{};Ls.errorCode="unsupported_response_type";var qs=class extends $e{};qs.errorCode="unsupported_token_type";var Us=class extends $e{};Us.errorCode="invalid_token";var Fs=class extends $e{};Fs.errorCode="method_not_allowed";var Vs=class extends $e{};Vs.errorCode="too_many_requests";var bn=class extends $e{};bn.errorCode="invalid_client_metadata";var Hs=class extends $e{};Hs.errorCode="insufficient_scope";var Bs=class extends $e{};Bs.errorCode="invalid_target";var nS={[Ns.errorCode]:Ns,[_n.errorCode]:_n,[gn.errorCode]:gn,[yn.errorCode]:yn,[js.errorCode]:js,[Ds.errorCode]:Ds,[Ms.errorCode]:Ms,[tr.errorCode]:tr,[Zs.errorCode]:Zs,[Ls.errorCode]:Ls,[qs.errorCode]:qs,[Us.errorCode]:Us,[Fs.errorCode]:Fs,[Vs.errorCode]:Vs,[bn.errorCode]:bn,[Hs.errorCode]:Hs,[Bs.errorCode]:Bs};var rr=class extends Error{constructor(t){super(t??"Unauthorized")}};function aD(e){return["client_secret_basic","client_secret_post","none"].includes(e)}var Hy="code",By="S256";function cD(e,t){let r=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&aD(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?r?"client_secret_basic":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function uD(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":lD(o,i,r);return;case"client_secret_post":dD(o,i,n);return;case"none":fD(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function lD(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function dD(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function fD(e,t){t.set("client_id",e)}async function iS(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=Xk.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:s}=n,a=nS[o]||tr;return new a(i||"",s)}catch(n){let o=e instanceof Response?vl(e,e.url):void 0,i=`${t?`HTTP ${t}: `:""}${o??`Invalid OAuth error response: ${n}. Raw body: ${r}`}`;return new tr(i)}}function pD(e,t){let[r,n]=[e,t];try{[r,n]=[new URL(e).href,new URL(t).href]}catch{}return r===n||r.endsWith("/")&&r.slice(0,-1)===n||n.endsWith("/")&&n.slice(0,-1)===r}function Wy(e,t){if(e)return typeof e.issuer!="string"?e.issuer==null?e:{...e,issuer:void 0}:pD(e.issuer,t)?e:void 0}var mD=Yk.omit({issuer:!0}),hD=eS.omit({issuer:!0});function sS(e,t){return new Error(`OAuth client information is bound to authorization server ${e.issuer} and is not presented to ${t}. Clear the stored client information, or correct \`expectedIssuer\`, if the authorization server has moved.`)}async function Ks(e,t){try{return await Ky(e,t)}catch(r){if(r instanceof _n||r instanceof yn)return await e.invalidateCredentials?.("all"),await Ky(e,t);if(r instanceof gn)return await e.invalidateCredentials?.("tokens"),await Ky(e,t);throw r}}async function Ky(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let s=await e.discoveryState?.(),a,c,u,l=o;if(!l&&s?.resourceMetadataUrl&&(l=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,a=s.resourceMetadata,u=s.authorizationServerMetadata??await cS(c,{fetchFn:i}),!a)try{a=await aS(t,{resourceMetadataUrl:l},i)}catch{}(u!==s.authorizationServerMetadata||a!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:l?.toString(),resourceMetadata:a,authorizationServerMetadata:u})}else{let U=await $D(t,{resourceMetadataUrl:l,fetchFn:i});c=U.authorizationServerUrl,u=U.authorizationServerMetadata,a=U.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:l?.toString(),resourceMetadata:a,authorizationServerMetadata:u})}let f=String(c),d=await gD(t,e,a),p=d&&a&&!e.validateResourceURL?a.resource:d,m=n||a?.scopes_supported?.join(" ")||e.clientMetadata.scope,h=await Promise.resolve(e.clientInformation()),g=Wy(h,f),w=e.saveClientInformation!==void 0&&!!e.redirectUrl;if(h&&!g&&!w)throw sS(h,f);let v=g?.issuer==null?g:void 0,x=async()=>{try{v&&await e.saveClientInformation?.({...v,issuer:f})}catch{}};if(!g){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let U=u?.client_id_metadata_document_supported===!0,Q=e.clientMetadataUrl;if(Q&&!_D(Q))throw new bn(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${Q}`);if(U&&Q)g={client_id:Q,issuer:f},await e.saveClientInformation?.(g);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");g={...await PD(c,{metadata:u,clientMetadata:e.clientMetadata,scope:m,fetchFn:i}),issuer:f},await e.saveClientInformation(g)}}let C=!e.redirectUrl;if(r!==void 0||C){let U=await zD(e,c,{metadata:u,resource:p,authorizationCode:r,fetchFn:i});return await x(),await e.saveTokens({...U,issuer:f}),"AUTHORIZED"}let $=Wy(await e.tokens(),f);if($?.refresh_token&&$.issuer==null&&console.warn("[mcp-sdk] stored OAuth tokens have no 'issuer' property (saved by an earlier version, or by a provider that does not keep it) and are used as-is; make sure your OAuthClientProvider stores what saveTokens() and saveClientInformation() receive unchanged."),$?.refresh_token)try{let U=await SD(c,{metadata:u,clientInformation:g,refreshToken:$.refresh_token,resource:p,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await x(),await e.saveTokens({...U,issuer:f}),"AUTHORIZED"}catch(U){if(!(!(U instanceof $e)||U instanceof tr))throw U}let k=e.state?await e.state():void 0,{authorizationUrl:R,codeVerifier:X}=await xD(c,{metadata:u,clientInformation:g,state:k,redirectUrl:e.redirectUrl,scope:m,resource:p});return await e.saveCodeVerifier(X),await e.redirectToAuthorization(R),"REDIRECT"}function _D(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function gD(e,t,r){let n=tS(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!rS({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Gy(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Jy(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let s=Jy(e,"scope")||void 0,a=Jy(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:a}}function Jy(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function aS(e,t,r=fetch){let n=await vD(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return Gk.parse(await n.json())}async function Qy(e,t,r=fetch){try{return await hn(r)(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Qy(e,void 0,r):void 0;throw n}}function yD(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function oS(e,t,r=fetch){return await Qy(e,{"MCP-Protocol-Version":t},r)}function bD(e,t){return!e||!e.ok&&e.status<500&&t!=="/"}async function vD(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??po,s;if(n?.metadataUrl)s=new URL(n.metadataUrl);else{let c=yD(t,o.pathname);s=new URL(c,n?.metadataServerUrl??o),s.search=o.search}let a=await oS(s,i,r);if(!n?.metadataUrl&&bD(a,o.pathname)){let c=new URL(`/.well-known/${t}`,o);a=await oS(c,i,r)}return a}function wD(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function cS(e,{fetchFn:t=fetch,protocolVersion:r=po}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=wD(e);for(let{url:i,type:s}of o){let a=await Qy(i,n,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?Vy.parse(await a.json()):Qk.parse(await a.json())}}}async function $D(e,t){let r,n;try{r=await aS(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",e)));let o=await cS(n,{fetchFn:t?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}function uS(e){return typeof e=="string"?e:e.href}async function xD(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:s}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Hy))throw new Error(`Incompatible auth server: does not support response type ${Hy}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(By))throw new Error(`Incompatible auth server: does not support code challenge method ${By}`)}else a=new URL("/authorize",e);let c=await Fy(),u=c.code_verifier,l=c.code_challenge;return a.searchParams.set("response_type",Hy),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",l),a.searchParams.set("code_challenge_method",By),a.searchParams.set("redirect_uri",String(n)),i&&a.searchParams.set("state",i),o&&a.searchParams.set("scope",o),o?.includes("offline_access")&&a.searchParams.append("prompt","consent"),s&&a.searchParams.set("resource",uS(s)),{authorizationUrl:a,codeVerifier:u}}function kD(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function lS(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:s}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",uS(i)),o)await o(c,r,a,t);else if(n){let l=t?.token_endpoint_auth_methods_supported??[],f=cD(n,l);uD(f,n,c,r)}let u=await hn(s??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await iS(u);return mD.parse(await u.json())}async function SD(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:s}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await lS(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:s});return{refresh_token:n,...c}}async function zD(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let s=async()=>{let l=await e.clientInformation(),f=Wy(l,String(t));if(l&&!f)throw sS(l,String(t));return f},a=await s(),c=e.clientMetadata.scope,u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(c)),!u){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let l=await e.codeVerifier();u=kD(o,l,e.redirectUrl)}return a??(a=await s()),lS(t,{metadata:r,tokenRequestParams:u,clientInformation:a,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function PD(e,{metadata:t,clientMetadata:r,scope:n,fetchFn:o}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);let s=await hn(o??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!s.ok)throw await iS(s);return hD.parse(await s.json())}var Js=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}},dS=10,CD=13,vn=32;function Yy(e){}function mS(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Yy,onError:r=Yy,onRetry:n=Yy,onComment:o,maxBufferSize:i}=e,s=[],a=0,c=!0,u,l="",f=0,d,p=!1;function m($){if(p)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,$.charCodeAt(0)===239&&$.charCodeAt(1)===187&&$.charCodeAt(2)===191&&($=$.slice(3))),s.length===0){let X=g($);X!==""&&(s.push(X),a=X.length),h();return}if($.indexOf(`
122
+ `)===-1&&$.indexOf("\r")===-1){s.push($),a+=$.length,h();return}s.push($);let k=s.join("");s.length=0,a=0;let R=g(k);R!==""&&(s.push(R),a=R.length),h()}function h(){i!==void 0&&(a+l.length<=i||(p=!0,s.length=0,a=0,u=void 0,l="",f=0,d=void 0,r(new Js(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function g($){let k=0;if($.indexOf("\r")===-1){let R=$.indexOf(`
123
+ `,k);for(;R!==-1;){if(k===R){f>0&&t({id:u,event:d,data:l}),u=void 0,l="",f=0,d=void 0,k=R+1,R=$.indexOf(`
124
+ `,k);continue}let X=$.charCodeAt(k);if(fS($,k,X)){let U=$.charCodeAt(k+5)===vn?k+6:k+5,Q=$.slice(U,R);if(f===0&&$.charCodeAt(R+1)===dS){t({id:u,event:d,data:Q}),u=void 0,l="",d=void 0,k=R+2,R=$.indexOf(`
125
+ `,k);continue}l=f===0?Q:`${l}
126
+ ${Q}`,f++}else pS($,k,X)?d=$.slice($.charCodeAt(k+6)===vn?k+7:k+6,R)||void 0:w($,k,R);k=R+1,R=$.indexOf(`
127
+ `,k)}return $.slice(k)}for(;k<$.length;){let R=$.indexOf("\r",k),X=$.indexOf(`
128
+ `,k),U=-1;if(R!==-1&&X!==-1?U=R<X?R:X:R!==-1?R===$.length-1?U=-1:U=R:X!==-1&&(U=X),U===-1)break;w($,k,U),k=U+1,$.charCodeAt(k-1)===CD&&$.charCodeAt(k)===dS&&k++}return $.slice(k)}function w($,k,R){if(k===R){x();return}let X=$.charCodeAt(k);if(fS($,k,X)){let or=$.charCodeAt(k+5)===vn?k+6:k+5,fb=$.slice(or,R);l=f===0?fb:`${l}
129
+ ${fb}`,f++;return}if(pS($,k,X)){d=$.slice($.charCodeAt(k+6)===vn?k+7:k+6,R)||void 0;return}if(X===105&&$.charCodeAt(k+1)===100&&$.charCodeAt(k+2)===58){let or=$.slice($.charCodeAt(k+3)===vn?k+4:k+3,R);or.includes("\0")||(u=or);return}if(X===58){if(o){let or=$.slice(k,R);o(or.slice($.charCodeAt(k+1)===vn?2:1))}return}let U=$.slice(k,R),Q=U.indexOf(":");if(Q===-1){v(U,"",U);return}let Le=U.slice(0,Q),Or=U.charCodeAt(Q+1)===vn?2:1,$n=U.slice(Q+Or);v(Le,$n,U)}function v($,k,R){switch($){case"event":d=k||void 0;break;case"data":l=f===0?k:`${l}
130
+ ${k}`,f++;break;case"id":k.includes("\0")||(u=k);break;case"retry":/^\d+$/.test(k)?n(parseInt(k,10)):r(new Js(`Invalid \`retry\` value: "${k}"`,{type:"invalid-retry",value:k,line:R}));break;default:r(new Js(`Unknown field "${$.length>20?`${$.slice(0,20)}\u2026`:$}"`,{type:"unknown-field",field:$,value:k,line:R}));break}}function x(){f>0&&t({id:u,event:d,data:l}),u=void 0,l="",f=0,d=void 0}function C($={}){if($.consume&&s.length>0){let k=s.join("");w(k,0,k.length)}c=!0,u=void 0,l="",f=0,d=void 0,s.length=0,a=0,p=!1}return{feed:m,reset:C}}function fS(e,t,r){return r===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function pS(e,t,r){return r===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var wl=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n,maxBufferSize:o}={}){let i;super({start(s){i=mS({onEvent:a=>{s.enqueue(a)},onError(a){typeof t=="function"&&t(a),(t==="terminate"||a.type==="max-buffer-size-exceeded")&&s.error(a)},onRetry:r,onComment:n,maxBufferSize:o})},transform(s){i.feed(s)}})}};var ED={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Tr=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},$l=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Bk(r?.fetch,r?.requestInit),this._followRedirects=r?.redirectPolicy==="follow",this._followRedirects&&(this._fetch=qy(this._fetch),this._fetchWithInit=qy(this._fetchWithInit)),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??ED}_unfollowedRedirect(t,r){let n=vl(t,r);return n&&!this._followRedirects?`${n} (redirectPolicy: 'same-origin')`:n}async _authThenStart(){if(!this._authProvider)throw new rr("No auth provider");let t;try{t=await Ks(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new rr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=yl(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=this._fetch??fetch,i={method:"GET",headers:n,signal:this._abortController?.signal},s=await o(this._url,this._followRedirects?i:{...i,redirect:"manual"}),a=this._followRedirects?void 0:bl(o,this._url,i,s);if(a&&(s=await a),!s.ok){if(await s.body?.cancel(),s.status===401&&this._authProvider)return await this._authThenStart();if(s.status===405)return;throw new Tr(s.status,`Failed to open SSE stream: ${this._unfollowedRedirect(s,this._url)??s.statusText}`)}this._handleSseStream(s.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,s,a=!1,c=!1;(async()=>{try{let l=t.pipeThrough(new TextDecoderStream).pipeThrough(new wl({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){let{value:p,done:m}=await l.read();if(m)break;if(p.id&&(s=p.id,a=!0,o?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{let h=ho.parse(JSON.parse(p.data));Xr(h)&&(c=!0,i!==void 0&&(h.id=i)),this.onmessage?.(h)}catch(h){this.onerror?.(h)}}(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(n||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:o,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new rr("No auth provider");if(await Ks(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new rr("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:Ui(t)?t.id:void 0}).catch(p=>this.onerror?.(p));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let s={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},a=await hn(this._fetch??fetch)(this._url,s),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let p=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Tr(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:m,scope:h}=Gy(a);if(this._resourceMetadataUrl=m,this._scope=h,await Ks(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new rr;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:m,scope:h,error:g}=Gy(a);if(g==="insufficient_scope"){let w=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===w)throw new Tr(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),m&&(this._resourceMetadataUrl=m),this._lastUpscopingHeader=w??void 0,await Ks(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new rr;return this.send(t)}}throw new Tr(a.status,`Error POSTing to endpoint: ${this._unfollowedRedirect(a,this._url)??p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),w0(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}let l=(Array.isArray(t)?t:[t]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,f=a.headers.get("content-type"),d=Hk(f);if(l)if(d==="text/event-stream")this._handleSseStream(a.body,{onresumptiontoken:o},!1);else if(d==="application/json"){let p=await a.json(),m=Array.isArray(p)?p.map(h=>ho.parse(h)):[ho.parse(p)];for(let h of m)this.onmessage?.(h)}else throw await a.body?.cancel(),new Tr(-1,`Unexpected content type: ${f}`);else await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await hn(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Tr(n.status,`Failed to terminate session: ${this._unfollowedRedirect(n,this._url)??n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}};var El,q,bS,ID,Rr,hS,vS,wS,Xy,kl,Ws,$S,rb,eb,tb,TD,zl={},Pl=[],RD=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Gs=Array.isArray;function nr(e,t){for(var r in t)e[r]=t[r];return e}function nb(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Qs(e,t,r){var n,o,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?El.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return Sl(e,s,n,o,null)}function Sl(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++bS,__i:-1,__u:0};return o==null&&q.vnode!=null&&q.vnode(i),i}function pt(e){return e.children}function Ot(e,t){this.props=e,this.context=t}function wn(e,t){if(t==null)return e.__?wn(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?wn(e):null}function OD(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],o=[],i=nr({},t);i.__v=t.__v+1,q.vnode&&q.vnode(i),ob(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??wn(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,PS(n,i,o),t.__e=t.__=null,i.__e!=r&&xS(i)}}function xS(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),xS(e)}function _S(e){(!e.__d&&(e.__d=!0)&&Rr.push(e)&&!Cl.__r++||hS!=q.debounceRendering)&&((hS=q.debounceRendering)||vS)(Cl)}function Cl(){try{for(var e,t=1;Rr.length;)Rr.length>t&&Rr.sort(wS),e=Rr.shift(),t=Rr.length,OD(e)}finally{Rr.length=Cl.__r=0}}function kS(e,t,r,n,o,i,s,a,c,u,l){var f,d,p,m,h,g,w=n&&n.__k||Pl,v=t.length;for(c=AD(r,t,w,c,v),f=0;f<v;f++)(p=r.__k[f])!=null&&(d=p.__i!=-1&&w[p.__i]||zl,p.__i=f,g=ob(e,p,d,o,i,s,a,c,u,l),m=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&ib(d.ref,null,p),l.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=SS(p,c,e),d.__e&&(d.__e=null)):typeof p.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return r.__e=h,c}function AD(e,t,r,n,o){var i,s,a,c,u,l=r.length,f=l,d=0;for(e.__k=new Array(o),i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=Sl(null,s,null,null,null):Gs(s)?s=e.__k[i]=Sl(pt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=Sl(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,c=i+d,s.__=e,s.__b=e.__b+1,a=null,(u=s.__i=ND(s,r,c,f))!=-1&&(f--,(a=r[u])&&(a.__u|=2)),a==null||a.__v==null?(u==-1&&(o>l?d--:o<l&&d++),typeof s.type!="function"&&(s.__u|=4)):u!=c&&(u==c-1?d--:u==c+1?d++:(u>c?d--:d++,s.__u|=4))):e.__k[i]=null;if(f)for(i=0;i<l;i++)(a=r[i])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=wn(a)),ES(a,a));return n}function SS(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=SS(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=wn(e)),t=r.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ys(e,t){return t=t||[],e==null||typeof e=="boolean"||(Gs(e)?e.some(function(r){Ys(r,t)}):t.push(e)),t}function ND(e,t,r,n){var o,i,s,a=e.key,c=e.type,u=t[r],l=u!=null&&(2&u.__u)==0;if(u===null&&a==null||l&&a==u.key&&c==u.type)return r;if(n>(l?1:0)){for(o=r-1,i=r+1;o>=0||i<t.length;)if((u=t[s=o>=0?o--:i++])!=null&&(2&u.__u)==0&&a==u.key&&c==u.type)return s}return-1}function gS(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||RD.test(t)?r:r+"px"}function xl(e,t,r,n,o){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||gS(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||gS(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace($S,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r[Ws]=n[Ws]:(r[Ws]=rb,e.addEventListener(t,i?tb:eb,i)):e.removeEventListener(t,i?tb:eb,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function yS(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[kl]==null)t[kl]=rb++;else if(t[kl]<r[Ws])return;return r(q.event?q.event(t):t)}}}function ob(e,t,r,n,o,i,s,a,c,u){var l,f,d,p,m,h,g,w,v,x,C,$,k,R,X,U,Q=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(l=q.__b)&&l(t);e:if(typeof Q=="function"){f=s.length;try{if(v=t.props,x=Q.prototype&&Q.prototype.render,C=(l=Q.contextType)&&n[l.__c],$=l?C?C.props.value:l.__:n,r.__c?w=(d=t.__c=r.__c).__=d.__E:(x?t.__c=d=new Q(v,$):(t.__c=d=new Ot(v,$),d.constructor=Q,d.render=DD),C&&C.sub(d),d.state||(d.state={}),d.__n=n,p=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&Q.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=nr({},d.__s)),nr(d.__s,Q.getDerivedStateFromProps(v,d.__s))),m=d.props,h=d.state,d.__v=t,p)x&&Q.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&Q.getDerivedStateFromProps==null&&v!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,$),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,$)===!1){t.__v!=r.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(Le){Le&&(Le.__=t)}),Pl.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d),a=wn(r);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,$),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,h,g)})}if(d.context=$,d.props=v,d.__P=e,d.__e=!1,k=q.__r,R=0,x)d.state=d.__s,d.__d=!1,k&&k(t),l=d.render(d.props,d.state,d.context),Pl.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,k&&k(t),l=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++R<25);d.state=d.__s,d.getChildContext!=null&&(n=nr(nr({},n),d.getChildContext())),x&&!p&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(m,h)),X=l!=null&&l.type===pt&&l.key==null?CS(l.props.children):l,a=kS(e,Gs(X)?X:[X],t,r,n,o,i,s,a,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),w&&(d.__E=d.__=null)}catch(Le){if(s.length=f,t.__v=null,c||i!=null){if(Le.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i!=null&&(i[i.indexOf(a)]=null),t.__e=a}else if(i!=null)for(U=i.length;U--;)nb(i[U])}else t.__e=r.__e;t.__k==null&&(t.__k=r.__k||[]),Le.then||zS(t),q.__e(Le,t,r)}}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=jD(r.__e,t,r,n,o,i,s,c,u);return(l=q.diffed)&&l(t),128&t.__u?void 0:a}function zS(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(zS))}function PS(e,t,r){for(var n=0;n<r.length;n++)ib(r[n],r[++n],r[++n]);q.__c&&q.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){q.__e(i,o.__v)}})}function CS(e){return typeof e!="object"||e==null||e.__b>0?e:Gs(e)?e.map(CS):e.constructor!==void 0?null:nr({},e)}function jD(e,t,r,n,o,i,s,a,c){var u,l,f,d,p,m,h,g=r.props||zl,w=t.props,v=t.type;if(v=="svg"?o="http://www.w3.org/2000/svg":v=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,i[u]=null;break}}if(e==null){if(v==null)return document.createTextNode(w);e=document.createElementNS(o,v,w.is&&w),a&&(q.__m&&q.__m(t,i),a=!1),i=null}if(v==null)g===w||a&&e.data==w||(e.data=w);else{if(i=v=="textarea"&&w.defaultValue!=null?null:i&&El.call(e.childNodes),!a&&i!=null)for(g={},u=0;u<e.attributes.length;u++)g[(p=e.attributes[u]).name]=p.value;for(u in g)p=g[u],u=="dangerouslySetInnerHTML"?f=p:u=="children"||u in w||u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w||xl(e,u,null,p,o);for(u in w)p=w[u],u=="children"?d=p:u=="dangerouslySetInnerHTML"?l=p:u=="value"?m=p:u=="checked"?h=p:a&&typeof p!="function"||g[u]===p||xl(e,u,p,g[u],o);if(l)a||f&&(l.__html==f.__html||l.__html==e.innerHTML)||(e.innerHTML=l.__html),t.__k=[];else if(f&&(e.innerHTML=""),kS(t.type=="template"?e.content:e,Gs(d)?d:[d],t,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:r.__k&&wn(r,0),a,c),i!=null)for(u=i.length;u--;)nb(i[u]);a&&v!="textarea"||(u="value",v=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[u]||v=="progress"&&!m||v=="option"&&m!=g[u])&&xl(e,u,m,g[u],o),u="checked",h!=null&&h!=e[u]&&xl(e,u,h,g[u],o))}return e}function ib(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){q.__e(o,r)}}function ES(e,t,r){var n,o;if(q.unmount&&q.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ib(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){q.__e(i,t)}n.base=n.__P=n.__n=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&ES(n[o],t,r||typeof e.type!="function");r||nb(e.__e),e.__c=e.__=e.__e=void 0}function DD(e,t,r){return this.constructor(e,r)}function sb(e,t,r){var n,o,i,s;t==document&&(t=document.documentElement),q.__&&q.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],s=[],ob(t,e=(!n&&r||t).__k=Qs(pt,null,[e]),o||zl,zl,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?El.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,s),PS(i,e,s),e.props.children=null}El=Pl.slice,q={__e:function(e,t,r,n){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(a){e=a}throw e}},bS=0,ID=function(e){return e!=null&&e.constructor===void 0},Ot.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=nr({},this.state),typeof e=="function"&&(e=e(nr({},r),this.props)),e&&nr(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_S(this))},Ot.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_S(this))},Ot.prototype.render=pt,Rr=[],vS=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wS=function(e,t){return e.__v.__b-t.__v.__b},Cl.__r=0,Xy=Math.random().toString(8),kl="__d"+Xy,Ws="__a"+Xy,$S=/(PointerCapture)$|Capture$/i,rb=0,eb=yS(!1),tb=yS(!0),TD=0;var Xs,xe,ab,IS,Tl=0,MS=[],Se=q,TS=Se.__b,RS=Se.__r,OS=Se.diffed,AS=Se.__c,NS=Se.unmount,jS=Se.__;function ub(e,t){Se.__h&&Se.__h(xe,e,Tl||t),Tl=0;var r=xe.__H||(xe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ft(e){return Tl=1,ZS(US,e)}function ZS(e,t,r){var n=ub(Xs++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):US(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=xe,!xe.__f)){var o=function(a,c,u){if(!n.__c.__H)return!0;var l=!1,f=n.__c.props!==a;if(n.__c.__H.__.some(function(p){if(p.__N){l=!0;var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(f=!0)}}),i){var d=i.call(this,a,c,u);return l?d||f:d}return!l||f};xe.__f=!0;var i=xe.shouldComponentUpdate,s=xe.componentWillUpdate;xe.componentWillUpdate=function(a,c,u){if(this.__e){var l=i;i=void 0,o(a,c,u),i=l}s&&s.call(this,a,c,u)},xe.shouldComponentUpdate=o}return n.__N||n.__}function Rl(e,t){var r=ub(Xs++,3);!Se.__s&&qS(r.__H,t)&&(r.__=e,r.u=t,xe.__H.__h.push(r))}function lb(e){return Tl=5,LS(function(){return{current:e}},[])}function LS(e,t){var r=ub(Xs++,7);return qS(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function MD(){for(var e;e=MS.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Il),t.__h.some(cb),t.__h=[]}catch(r){t.__h=[],Se.__e(r,e.__v)}}}Se.__b=function(e){xe=null,TS&&TS(e)},Se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),jS&&jS(e,t)},Se.__r=function(e){RS&&RS(e),Xs=0;var t=(xe=e.__c).__H;t&&(ab===xe?(t.__h=[],xe.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(Il),t.__h.some(cb),t.__h=[],Xs=0)),ab=xe},Se.diffed=function(e){OS&&OS(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(MS.push(t)!==1&&IS===Se.requestAnimationFrame||((IS=Se.requestAnimationFrame)||ZD)(MD)),t.__H.__.some(function(r){r.u&&(r.__H=r.u,r.u=void 0)})),ab=xe=null},Se.__c=function(e,t){t.some(function(r){try{r.__h.some(Il),r.__h=r.__h.filter(function(n){return!n.__||cb(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Se.__e(n,r.__v)}}),AS&&AS(e,t)},Se.unmount=function(e){NS&&NS(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{Il(n)}catch(o){t=o}}),r.__H=void 0,t&&Se.__e(t,r.__v))};var DS=typeof requestAnimationFrame=="function";function ZD(e){var t,r=function(){clearTimeout(n),DS&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);DS&&(t=requestAnimationFrame(r))}function Il(e){var t=xe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),xe=t}function cb(e){var t=xe;e.__c=e.__(),xe=t}function qS(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function US(e,t){return typeof t=="function"?t(e):t}function UD(e,t){for(var r in t)e[r]=t[r];return e}function FS(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function VS(e,t){this.props=e,this.context=t}(VS.prototype=new Ot).isPureReactComponent=!0,VS.prototype.shouldComponentUpdate=function(e,t){return FS(this.props,e)||FS(this.state,t)};var HS=q.__b;q.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),HS&&HS(e)};var t6=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var FD=q.__e;q.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k||[]),o.__c(e,t)}FD(e,t,r,n)};var BS=q.unmount;function YS(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=UD({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return YS(n,t,r)})),e}function XS(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return XS(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function db(){this.__u=0,this.o=null,this.__b=null}function ez(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ol(){this.i=null,this.l=null}q.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),BS&&BS(e)},(db.prototype=new Ot).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=ez(n.__v),i=!1,s=function(){i||n.__z||(i=!0,r.__R=null,o?o(c):c())};r.__R=s;var a=r.__P;r.__P=null;var c=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=XS(u,u.__c.__P,u.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.o.pop();)l.__P=a,l.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},db.prototype.componentWillUnmount=function(){this.o=[]},db.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=YS(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&Qs(pt,null,e.fallback);return o&&(o.__u&=-33),[Qs(pt,null,t.__a?null:e.children),o]};var KS=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(Ol.prototype=new Ot).__a=function(e){var t=this,r=ez(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),KS(t,e,n)):o()};r?r(i):i()}},Ol.prototype.render=function(e){this.i=null,this.l=new Map;var t=Ys(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Ol.prototype.componentDidUpdate=Ol.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){KS(e,r,t)})};var VD=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,HD=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,BD=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,KD=/[A-Z0-9]/g,JD=typeof document<"u",WD=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function tz(e,t,r){return t.__k==null&&(t.textContent=""),sb(e,t),typeof r=="function"&&r(),e?e.__c:null}Ot.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ot.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var JS=q.event;q.event=function(e){return JS&&(e=JS(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var rz,GD={configurable:!0,get:function(){return this.class}},WS=q.vnode;q.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")==-1;for(var s in r){var a=r[s];if(!(s==="value"&&"defaultValue"in r&&a==null||JD&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&a===!0?a="":c==="translate"&&a==="no"?a=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||WD(r.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":BD.test(s)&&(s=c):c=s="oninput":i&&HD.test(s)?s=s.replace(KD,"-$&").toLowerCase():a===null&&(a=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=a}}n=="select"&&(o.multiple&&Array.isArray(o.value)&&(o.value=Ys(r.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),o.defaultValue!=null&&(o.value=Ys(r.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value}))),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",GD)):r.className&&(o.class=o.className=r.className),t.props=o})(e),e.$$typeof=VD,WS&&WS(e)};var GS=q.__r;q.__r=function(e){GS&&GS(e),rz=e.__c};var QS=q.diffed;q.diffed=function(e){QS&&QS(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),rz=null};function nz(e){return!!e.__k&&(sb(null,e),!0)}function oz(e){return{render:function(t){tz(t,e)},unmount:function(){nz(e)}}}var iz="0 0 1874 2000",sz="M861 1999C853 2000 845 2000 844 2000C837 1997 829 1975 805 1899C777 1808 750 1781 629 1728C622 1724 608 1718 598 1713C587 1708 565 1697 547 1689C503 1669 409 1619 383 1603C371 1595 358 1587 353 1584C342 1578 303 1553 293 1546C289 1543 280 1536 272 1530C230 1500 182 1457 156 1427C152 1423 144 1414 139 1408C119 1386 83 1336 73 1318C73 1317 69 1310 66 1304C57 1286 51 1275 46 1263C43 1257 41 1251 41 1251C40 1251 35 1238 30 1223L20 1196L12 1153C1 1096 0 1065 6 1016C17 931 39 872 92 785C99 772 119 745 131 731C169 686 188 666 220 635C258 600 291 572 317 552C320 550 327 544 333 540C342 532 351 526 376 507C395 493 406 484 414 478C417 475 425 470 431 466C449 454 466 441 484 427C503 412 508 407 526 394C540 383 602 326 619 309C708 214 762 110 770 16C771 8 772 1 773 1C776 0 843 40 868 58C944 111 986 142 1043 189C1051 196 1061 204 1065 207C1075 215 1090 228 1105 241C1110 247 1124 259 1134 268C1171 301 1198 328 1224 356C1232 365 1244 378 1250 385C1273 409 1298 437 1312 456C1316 461 1322 468 1325 472C1333 482 1377 542 1392 566C1405 585 1434 634 1445 655C1449 662 1453 671 1455 675C1457 678 1462 688 1465 696C1469 703 1474 713 1476 717C1478 722 1481 730 1483 735C1485 741 1487 746 1487 746C1489 748 1498 774 1509 808C1535 889 1543 1016 1525 1079C1524 1083 1522 1095 1519 1105C1509 1156 1481 1222 1449 1270C1446 1275 1441 1283 1438 1288C1435 1292 1428 1301 1424 1307C1419 1314 1412 1322 1409 1327C1406 1331 1398 1340 1391 1347C1385 1354 1378 1361 1376 1363C1367 1376 1304 1434 1283 1450C1276 1456 1265 1464 1259 1469C1248 1477 1235 1486 1214 1500C1208 1504 1196 1513 1186 1519C1170 1530 1150 1543 1110 1569C1092 1580 1058 1604 1047 1613C1042 1616 1034 1623 1027 1628C979 1663 939 1711 928 1746C925 1756 924 1759 920 1783L917 1799L922 1830C927 1862 931 1879 936 1891C942 1906 944 1910 949 1920C956 1935 963 1946 971 1959C975 1966 981 1974 983 1978C986 1984 987 1985 986 1987C984 1988 887 1998 861 1999ZM788 1737C786 1725 780 1701 775 1683C759 1627 736 1506 736 1479C735 1475 735 1464 734 1456C726 1379 729 1326 745 1240C752 1199 773 1130 793 1085C796 1078 801 1063 805 1052C809 1041 818 1022 824 1010C830 998 836 983 839 976C841 970 847 958 851 950C857 936 863 924 870 906C872 901 877 888 882 878C886 867 893 851 896 841C904 820 907 810 910 805C919 787 941 686 945 642C946 628 947 617 948 608C949 602 949 598 949 577C950 564 947 539 944 525C940 504 938 508 930 542C927 558 920 580 904 622C884 676 848 740 795 817C781 836 766 859 760 867C755 876 746 888 741 896C675 985 623 1075 601 1137C578 1203 568 1271 573 1332C579 1394 596 1461 627 1534C638 1559 681 1632 703 1662C739 1710 786 1762 791 1760C793 1759 792 1754 788 1737ZM1585 1999C1536 1999 1540 1999 1531 1994C1505 1980 1507 1935 1535 1924C1542 1921 1543 1921 1587 1920L1631 1920L1635 1918C1642 1914 1646 1909 1649 1901C1650 1898 1650 1849 1650 1567L1650 102L1648 97C1646 92 1641 86 1637 83C1631 80 1631 80 1588 80C1548 80 1542 79 1537 77C1512 68 1505 31 1524 10C1529 5 1535 2 1540 1C1542 0 1593 0 1688 0L1833 0L1838 2C1874 14 1871 71 1835 79C1831 79 1824 80 1793 80C1750 80 1745 80 1740 83C1734 86 1728 94 1726 102C1725 106 1725 1840 1725 1879C1726 1900 1726 1901 1727 1903C1731 1911 1737 1917 1743 1919C1745 1920 1757 1920 1789 1920C1838 1921 1835 1921 1845 1926C1857 1932 1863 1943 1863 1959C1863 1980 1853 1994 1836 1998C1831 1999 1676 2000 1585 1999Z";var QD=0;function ze(e,t,r,n,o,i){t||(t={});var s,a,c=t;if("ref"in c)for(a in c={},t)a=="ref"?s=t[a]:c[a]=t[a];var u={type:e,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--QD,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return q.vnode&&q.vnode(u),u}var YD=new URLSearchParams(location.hash.slice(1)).get("token")??"";async function XD(){let e=new gl({name:"vine-ui",version:"1"});return await e.connect(new $l(new URL("/mcp",location.origin),{requestInit:{headers:{Authorization:`Bearer ${YD}`}}})),e}async function az(e){let{tools:t}=await e.listTools();return t.filter(r=>typeof r._meta?.ui?.resourceUri=="string"&&!(r.inputSchema.required??[]).length).map(r=>({name:r.name,title:r.title??r.name,uri:r._meta.ui.resourceUri}))}function e2({client:e,tool:{name:t,title:r,uri:n},onMessage:o}){let i=lb(null),[s,a]=Ft(480),[c,u]=Ft();return Rl(()=>{let l,f=!1;return(async()=>{let p=(await e.readResource({uri:n})).contents[0].text??"",m=i.current,h=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l=new Eu(e,{name:"vine ui",version:"1"},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:h,platform:"web",displayMode:"inline"}}),l.onsizechange=({height:g})=>g&&a(Math.min(Math.max(g+4,200),4e3)),l.onmessage=async g=>{let w=g.content.map(v=>v.type==="text"?v.text:"").join(`
131
+ `);return o(w),{}},l.onopenlink=async({url:g})=>(/^https?:/.test(g)&&window.open(g,"_blank","noopener"),{}),l.oninitialized=async()=>{await l.sendToolInput({arguments:{}});let g=await e.callTool({name:t,arguments:{}});f||await l.sendToolResult(g)},m.srcdoc=p,await new Promise(g=>m.addEventListener("load",g,{once:!0})),await l.connect(new Cu(m.contentWindow,m.contentWindow))})().catch(d=>u(d.message)),()=>{f=!0,l?.close()}},[e,t,n,o]),ze(pt,{children:[c&&ze("p",{className:"notice bad",children:c}),ze("iframe",{ref:i,title:r,sandbox:"allow-scripts",style:{width:"100%",height:s,border:0,display:"block"}})]})}function t2(){let[e,t]=Ft(),[r,n]=Ft([]),[o,i]=Ft(new URLSearchParams(location.search).get("view")??"open_console"),[s,a]=Ft(),[c,u]=Ft(),[l,f]=Ft(0);Rl(()=>{XD().then(async m=>{t(m),n(await az(m))}).catch(m=>a(`Can't reach vine: ${m.message}. Is \`vine ui\` still running?`))},[]);let d=async m=>{i(m),f(h=>h+1),e&&n(await az(e)),history.replaceState(null,"",`?view=${m}${location.hash}`)},p=r.find(m=>m.name===o)??r[0];return ze("div",{style:{maxWidth:1e3,margin:"0 auto"},children:[ze("div",{className:"head",children:[ze("h1",{className:"brand",children:[ze("svg",{viewBox:iz,"aria-hidden":"true",children:ze("path",{fillRule:"evenodd",d:sz})}),"Vine Context"]}),ze("div",{className:"tabs",role:"tablist",style:{margin:0,border:0},children:r.map(m=>ze("button",{role:"tab","aria-selected":p?.name===m.name,onClick:()=>d(m.name),children:m.title.replace(/^Open the /,"").replace(/^./,h=>h.toUpperCase())},m.name))})]}),c&&ze("div",{className:"notice",style:{margin:"8px 0"},children:[ze("div",{className:"spread",children:[ze("strong",{children:"Paste this to your agent"}),ze("button",{className:"link",onClick:()=>u(void 0),children:"Dismiss"})]}),ze("textarea",{readOnly:!0,value:c,style:{width:"100%",minHeight:60,marginTop:6,font:"inherit"},onFocus:m=>m.currentTarget.select()})]}),s&&ze("p",{className:"notice bad",children:s}),e&&p&&ze(e2,{client:e,tool:p,onMessage:u},`${p.name}:${l}`)]})}oz(document.getElementById("root")).render(ze(t2,{}));})();
132
+ </script>
133
+ </body>
134
+ </html>