@madarco/agentbox 0.24.3 → 0.24.5

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 (153) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{_cloud-attach-D5OC7DCC.js → _cloud-attach-ESCPOKG5.js} +5 -5
  3. package/dist/{chunk-DEDTPG2D.js → chunk-3MDYQROX.js} +5 -5
  4. package/dist/{chunk-SS6ZEKLL.js → chunk-4HPLS5HJ.js} +7 -4
  5. package/dist/chunk-4HPLS5HJ.js.map +1 -0
  6. package/dist/{chunk-3253DDXI.js → chunk-5JDOTQTM.js} +4 -4
  7. package/dist/{chunk-5KHEH47T.js → chunk-7DPDUZ7L.js} +2 -2
  8. package/dist/{chunk-24PXPJI3.js → chunk-CE3S7UDQ.js} +10 -10
  9. package/dist/chunk-G3H2L3O2.js +0 -0
  10. package/dist/{chunk-UIRBYL4G.js → chunk-H6A4BQMG.js} +9 -1
  11. package/dist/chunk-H6A4BQMG.js.map +1 -0
  12. package/dist/{chunk-WLHJZPFJ.js → chunk-LJMGHFLZ.js} +152 -3
  13. package/dist/chunk-LJMGHFLZ.js.map +1 -0
  14. package/dist/{chunk-5WF7PAH2.js → chunk-OSPM4Q5V.js} +3 -3
  15. package/dist/{chunk-QMA3DB5L.js → chunk-QHISF6O6.js} +3 -3
  16. package/dist/{chunk-LC4E2EIZ.js → chunk-RFRWS5CD.js} +2 -2
  17. package/dist/chunk-WJFZJZIM.js +0 -0
  18. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  19. package/dist/{dist-UWUTNRCK.js → dist-2N3XHMBQ.js} +6 -6
  20. package/dist/{dist-FWB3MIQ5.js → dist-3M53BF4E.js} +39 -58
  21. package/dist/dist-3M53BF4E.js.map +1 -0
  22. package/dist/{dist-TK3STVUP.js → dist-FGXCG4JY.js} +6 -6
  23. package/dist/{dist-T5MXBZGP.js → dist-HPPHBZTO.js} +2 -2
  24. package/dist/{dist-2JWYYJZR.js → dist-NOUPH5E6.js} +4 -4
  25. package/dist/{dist-3NFY6M53.js → dist-TRKHS6I7.js} +6 -6
  26. package/dist/{dist-72EYR5DW.js → dist-VFPT5TDH.js} +6 -6
  27. package/dist/index.js +116 -90
  28. package/dist/index.js.map +1 -1
  29. package/dist/{prepared-state-BUO75YLZ-RQRFFBJW.js → prepared-state-BUO75YLZ-46W2PAHH.js} +2 -2
  30. package/package.json +29 -28
  31. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  32. package/runtime/_shared/agentbox-dockerd-start +0 -0
  33. package/runtime/_shared/agentbox-open +0 -0
  34. package/runtime/_shared/agentbox-portless-trust +0 -0
  35. package/runtime/_shared/agentbox-vnc-start +0 -0
  36. package/runtime/_shared/ctl.cjs +8 -0
  37. package/runtime/_shared/gh-shim +0 -0
  38. package/runtime/_shared/git-shim +0 -0
  39. package/runtime/_shared/linear-shim +0 -0
  40. package/runtime/_shared/ntn-shim +0 -0
  41. package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
  42. package/runtime/digitalocean/agentbox-dockerd-start +0 -0
  43. package/runtime/digitalocean/agentbox-open +0 -0
  44. package/runtime/digitalocean/agentbox-portless-trust +0 -0
  45. package/runtime/digitalocean/agentbox-vnc-start +0 -0
  46. package/runtime/digitalocean/ctl.cjs +8 -0
  47. package/runtime/digitalocean/gh-shim +0 -0
  48. package/runtime/digitalocean/git-shim +0 -0
  49. package/runtime/digitalocean/linear-shim +0 -0
  50. package/runtime/digitalocean/ntn-shim +0 -0
  51. package/runtime/digitalocean/scripts/install-box.sh +0 -0
  52. package/runtime/docker/packages/ctl/dist/bin.cjs +8 -0
  53. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  54. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  55. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  56. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  57. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  58. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  59. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  60. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  61. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  62. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  63. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  64. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  65. package/runtime/e2b/agentbox-dockerd-start +0 -0
  66. package/runtime/e2b/agentbox-open +0 -0
  67. package/runtime/e2b/agentbox-vnc-start +0 -0
  68. package/runtime/e2b/ctl.cjs +8 -0
  69. package/runtime/e2b/gh-shim +0 -0
  70. package/runtime/e2b/git-shim +0 -0
  71. package/runtime/e2b/linear-shim +0 -0
  72. package/runtime/e2b/ntn-shim +0 -0
  73. package/runtime/e2b/scripts/build-template.sh +0 -0
  74. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  75. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  76. package/runtime/hetzner/agentbox-open +0 -0
  77. package/runtime/hetzner/agentbox-portless-trust +0 -0
  78. package/runtime/hetzner/agentbox-vnc-start +0 -0
  79. package/runtime/hetzner/ctl.cjs +8 -0
  80. package/runtime/hetzner/gh-shim +0 -0
  81. package/runtime/hetzner/git-shim +0 -0
  82. package/runtime/hetzner/linear-shim +0 -0
  83. package/runtime/hetzner/ntn-shim +0 -0
  84. package/runtime/hetzner/scripts/install-box.sh +0 -0
  85. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  86. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  87. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  88. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  89. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  90. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  91. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  92. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  93. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  95. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +1 -1
  96. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +1 -1
  97. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  98. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  99. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  100. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  101. package/runtime/hub/apps/hub/.next/static/chunks/1z4elhg8gyq98.js +1 -0
  102. package/runtime/hub/apps/hub/{auth-Q447765C.js → auth-HY5K55Y5.js} +2 -2
  103. package/runtime/hub/apps/hub/{auth-config-SIL635ZD.js → auth-config-MNW2XGKK.js} +2 -2
  104. package/runtime/hub/apps/hub/{chunk-OJAHNFNV.js → chunk-5KMJIVZC.js} +6 -3
  105. package/runtime/hub/apps/hub/{chunk-IRIK4DQF.js → chunk-DNR2YM2G.js} +2 -2
  106. package/runtime/hub/apps/hub/{chunk-3VE7AYVK.js → chunk-EY6HEDTK.js} +4 -4
  107. package/runtime/hub/apps/hub/{chunk-DZPQB2JZ.js → chunk-PROXBLRJ.js} +1 -1
  108. package/runtime/hub/apps/hub/{chunk-64WEKO34.js → chunk-TRUQCO4U.js} +8 -0
  109. package/runtime/hub/apps/hub/{dist-PWBKGUDG.js → dist-3DCKZYID.js} +4 -4
  110. package/runtime/hub/apps/hub/{dist-6AEQJL7W.js → dist-KV5ESR24.js} +4 -4
  111. package/runtime/hub/apps/hub/{dist-PRUR2E5L.js → dist-M73U3ZDH.js} +4 -4
  112. package/runtime/hub/apps/hub/{dist-GF5EBRNG.js → dist-NTKPAYA3.js} +1 -1
  113. package/runtime/hub/apps/hub/{dist-7GTRUGLC.js → dist-RSWTJWRN.js} +3 -3
  114. package/runtime/hub/apps/hub/{dist-HHHK5LRX.js → dist-SX2NXGI6.js} +177 -57
  115. package/runtime/hub/apps/hub/{dist-DLPVQMKD.js → dist-YCRESLWD.js} +4 -4
  116. package/runtime/hub/apps/hub/{hub-token-UITZEWVP.js → hub-token-QKQWV2I6.js} +2 -2
  117. package/runtime/hub/apps/hub/{prepared-state-BUO75YLZ-O4GZMDRF.js → prepared-state-BUO75YLZ-KR4YLKDC.js} +1 -1
  118. package/runtime/hub/apps/hub/server.js +15 -15
  119. package/runtime/relay/bin.cjs +8 -0
  120. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  121. package/runtime/vercel/agentbox-dockerd-start +0 -0
  122. package/runtime/vercel/agentbox-open +0 -0
  123. package/runtime/vercel/agentbox-vnc-start +0 -0
  124. package/runtime/vercel/ctl.cjs +8 -0
  125. package/runtime/vercel/gh-shim +0 -0
  126. package/runtime/vercel/git-shim +0 -0
  127. package/runtime/vercel/linear-shim +0 -0
  128. package/runtime/vercel/ntn-shim +0 -0
  129. package/runtime/vercel/scripts/provision.sh +0 -0
  130. package/LICENSE +0 -21
  131. package/dist/chunk-SS6ZEKLL.js.map +0 -1
  132. package/dist/chunk-UIRBYL4G.js.map +0 -1
  133. package/dist/chunk-WLHJZPFJ.js.map +0 -1
  134. package/dist/dist-FWB3MIQ5.js.map +0 -1
  135. package/runtime/hub/apps/hub/.next/static/chunks/380qcmusmigzz.js +0 -1
  136. /package/dist/{_cloud-attach-D5OC7DCC.js.map → _cloud-attach-ESCPOKG5.js.map} +0 -0
  137. /package/dist/{chunk-DEDTPG2D.js.map → chunk-3MDYQROX.js.map} +0 -0
  138. /package/dist/{chunk-3253DDXI.js.map → chunk-5JDOTQTM.js.map} +0 -0
  139. /package/dist/{chunk-5KHEH47T.js.map → chunk-7DPDUZ7L.js.map} +0 -0
  140. /package/dist/{chunk-24PXPJI3.js.map → chunk-CE3S7UDQ.js.map} +0 -0
  141. /package/dist/{chunk-5WF7PAH2.js.map → chunk-OSPM4Q5V.js.map} +0 -0
  142. /package/dist/{chunk-QMA3DB5L.js.map → chunk-QHISF6O6.js.map} +0 -0
  143. /package/dist/{chunk-LC4E2EIZ.js.map → chunk-RFRWS5CD.js.map} +0 -0
  144. /package/dist/{dist-UWUTNRCK.js.map → dist-2N3XHMBQ.js.map} +0 -0
  145. /package/dist/{dist-TK3STVUP.js.map → dist-FGXCG4JY.js.map} +0 -0
  146. /package/dist/{dist-2JWYYJZR.js.map → dist-HPPHBZTO.js.map} +0 -0
  147. /package/dist/{dist-3NFY6M53.js.map → dist-NOUPH5E6.js.map} +0 -0
  148. /package/dist/{dist-72EYR5DW.js.map → dist-TRKHS6I7.js.map} +0 -0
  149. /package/dist/{dist-T5MXBZGP.js.map → dist-VFPT5TDH.js.map} +0 -0
  150. /package/dist/{prepared-state-BUO75YLZ-RQRFFBJW.js.map → prepared-state-BUO75YLZ-46W2PAHH.js.map} +0 -0
  151. /package/runtime/hub/apps/hub/.next/static/{4CStLAgdl_oxCRh8votRw → 43_nml7FKErUxJXpspAhb}/_buildManifest.js +0 -0
  152. /package/runtime/hub/apps/hub/.next/static/{4CStLAgdl_oxCRh8votRw → 43_nml7FKErUxJXpspAhb}/_clientMiddlewareManifest.js +0 -0
  153. /package/runtime/hub/apps/hub/.next/static/{4CStLAgdl_oxCRh8votRw → 43_nml7FKErUxJXpspAhb}/_ssgManifest.js +0 -0
@@ -6,7 +6,7 @@
6
6
  8:I[43645,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"ViewportBoundary"]
7
7
  a:I[43645,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"MetadataBoundary"]
8
8
  c:I[17506,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"default",1]
9
- 0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldn’t load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldn’t load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"4CStLAgdl_oxCRh8votRw"}
9
+ 0:{"P":null,"c":["","_global-error"],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]}],[["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","html",null,{"id":"__next_error__","children":[["$","head",null,{"children":[["$","title",null,{"children":"500: This page couldn’t load"}],["$","style",null,{"dangerouslySetInnerHTML":{"__html":":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }"}}]]}],["$","body",null,{"children":["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","display":"flex","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"style":{"marginTop":"-32px","maxWidth":"325px","padding":"32px 28px","textAlign":"left"},"children":[["$","svg",null,{"width":"32","height":"32","viewBox":"-0.2 -1.5 32 32","fill":"none","style":{"marginBottom":"24px"},"children":["$","path",null,{"d":"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z","fill":"var(--next-error-title)"}]}],["$","h1",null,{"style":{"fontSize":"24px","fontWeight":500,"letterSpacing":"-0.02em","lineHeight":"32px","margin":"0 0 12px 0","color":"var(--next-error-title)"},"children":"This page couldn’t load"}],["$","p",null,{"style":{"fontSize":"14px","fontWeight":400,"lineHeight":"21px","margin":"0 0 20px 0","color":"var(--next-error-message)"},"children":"A server error occurred. Reload to try again."}],["$","form",null,{"style":{"margin":0},"children":["$","button",null,{"type":"submit","style":{"display":"inline-flex","alignItems":"center","justifyContent":"center","height":"32px","padding":"0 12px","fontSize":"14px","fontWeight":500,"lineHeight":"20px","borderRadius":"6px","cursor":"pointer","color":"var(--next-error-btn-text)","background":"var(--next-error-btn-bg)","border":"var(--next-error-btn-border)"},"children":"Reload"}]}]]}]}]}]]}],null,["$","$L4",null,{"children":["$","$5",null,{"name":"Next.MetadataOutlet","children":"$@6"}]}]]}],{},null,false,null]},null,false,"$@7"],["$","$1","h",{"children":[null,["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$5",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$c",[]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"43_nml7FKErUxJXpspAhb"}
10
10
  d:[]
11
11
  7:"$Wd"
12
12
  9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
@@ -2,4 +2,4 @@
2
2
  2:I[43645,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"ViewportBoundary"]
3
3
  3:I[43645,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"MetadataBoundary"]
4
4
  4:"$Sreact.suspense"
5
- 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"4CStLAgdl_oxCRh8votRw"}
5
+ 0:{"rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[]}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"43_nml7FKErUxJXpspAhb"}
@@ -2,4 +2,4 @@
2
2
  2:I[20699,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"default"]
3
3
  3:I[92242,["/_next/static/chunks/2x7nfpuaaba_a.js","/_next/static/chunks/3c49t4evjq8hf.js"],"default"]
4
4
  4:[]
5
- 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"4CStLAgdl_oxCRh8votRw"}
5
+ 0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"43_nml7FKErUxJXpspAhb"}
@@ -1 +1 @@
1
- 0:{"tree":{"name":"","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"4CStLAgdl_oxCRh8votRw"}
1
+ 0:{"tree":{"name":"","param":null,"prefetchHints":0,"slots":{"children":{"name":"__PAGE__","param":null,"prefetchHints":0,"slots":null}}},"staleTime":300,"buildId":"43_nml7FKErUxJXpspAhb"}
@@ -100,6 +100,6 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
100
100
 
101
101
  `)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),c=r(c,u),l)?sU([],d,c,u,n,e):c:i(c,u):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function sF(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!nD(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>n$(e,n,nl())))}),t)}let sH=ni("$ZodUnion",(e,t)=>{sr.init(e,t),ng(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),ng(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),ng(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ng(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>nf(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>sF(t,n,e,i)):sF(a,n,e,i)}});function sV(e,t,r,n){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>n$(e,n,nl())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}(e,t)=>{sH.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);t instanceof Promise?(a.push(t),s=!0):a.push(t)}return s?Promise.all(a).then(t=>sV(t,n,e,i)):sV(a,n,e,i)}},(e,t)=>{t.inclusive=!1,sH.init(e,t);let r=e._zod.parse;ng(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=nd(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,s)=>{let a=i.value;if(!nE(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let o=n.value.get(a?.[t.discriminator]);return o?o._zod.run(i,s):t.unionFallback||"backward"===s.direction?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:a,path:[t.discriminator],inst:e}),i)}};let sG=ni("$ZodIntersection",(e,t)=>{sr.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,r])=>sW(e,t,r)):sW(e,i,s)}});function sW(e,t,r){let n,i=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(n??(n=r),r.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&n&&e.issues.push({...n,keys:s}),nD(e))return e;let a=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(nS(t)&&nS(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),s={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};s[n]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let s=e(t[i],r[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let sK=ni("$ZodTuple",(e,t)=>{sr.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],o=sX(r,"optin"),l=sX(r,"optout");if(!t.rest){if(s.length<o)return n.issues.push({code:"too_small",minimum:o,inclusive:!0,input:s,inst:e,origin:"array"}),n;s.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:e,origin:"array"})}let c=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:s[e],issues:[]},i);t instanceof Promise?a.push(t.then(t=>{c[e]=t})):c[e]=t}if(t.rest){let e=r.length-1;for(let o of s.slice(r.length)){e++;let r=t.rest._zod.run({value:o,issues:[]},i);r instanceof Promise?a.push(r.then(t=>sZ(t,n,e))):sZ(r,n,e)}}return a.length?Promise.all(a).then(()=>sY(c,n,r,s,l)):sY(c,n,r,s,l)}});function sX(e,t){for(let r=e.length-1;r>=0;r--)if("optional"!==e[r]._zod[t])return r+1;return 0}function sZ(e,t,r){e.issues.length&&t.issues.push(...nM(r,e.issues)),t.value[r]=e.value}function sY(e,t,r,n,i){for(let s=0;s<r.length;s++){let r=e[s],a=s<n.length;if(r.issues.length){if(!a&&s>=i){t.value.length=s;break}t.issues.push(...nM(s,r.issues))}t.value[s]=r.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function sJ(e,t,r,n,i,s,a){e.issues.length&&(nO.has(typeof n)?r.issues.push(...nM(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:e.issues.map(e=>n$(e,a,nl()))})),t.issues.length&&(nO.has(typeof n)?r.issues.push(...nM(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:n,issues:t.issues.map(e=>n$(e,a,nl()))})),r.value.set(e.value,t.value)}function sQ(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{sr.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!nS(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],a=t.keyType._zod.values;if(a){let o;r.value={};let l=new Set;for(let o of a)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){l.add("number"==typeof o?o.toString():o);let a=t.keyType._zod.run({value:o,issues:[]},n);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>n$(e,n,nl())),input:o,path:[o],inst:e});continue}let c=a.value,u=t.valueType._zod.run({value:i[o],issues:[]},n);u instanceof Promise?s.push(u.then(e=>{e.issues.length&&r.issues.push(...nM(o,e.issues)),r.value[c]=e.value})):(u.issues.length&&r.issues.push(...nM(o,u.issues)),r.value[c]=u.value)}for(let e in i)l.has(e)||(o=o??[]).push(e);o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:o})}else for(let a of(r.value={},Reflect.ownKeys(i))){if("__proto__"===a||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let o=t.keyType._zod.run({value:a,issues:[]},n);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof a&&ip.test(a)&&o.issues.length){let e=t.keyType._zod.run({value:Number(a),issues:[]},n);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(o=e)}if(o.issues.length){"loose"===t.mode?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>n$(e,n,nl())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:i[a],issues:[]},n);l instanceof Promise?s.push(l.then(e=>{e.issues.length&&r.issues.push(...nM(a,e.issues)),r.value[o.value]=e.value})):(l.issues.length&&r.issues.push(...nM(a,l.issues)),r.value[o.value]=l.value)}return s.length?Promise.all(s).then(()=>r):r}},(e,t)=>{sr.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let s=[];for(let e of(r.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},n);i instanceof Promise?s.push(i.then(e=>sQ(e,r))):sQ(i,r)}return s.length?Promise.all(s).then(()=>r):r}};let s0=ni("$ZodEnum",(e,t)=>{sr.init(e,t);let r=nc(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>nO.has(typeof e)).map(e=>"string"==typeof e?nT(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),s1=((e,t)=>{if(sr.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?nT(e):e?nT(e.toString()):String(e)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}},ni("$ZodTransform",(e,t)=>{sr.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new na(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r.fallback=!0,r));if(i instanceof Promise)throw new ns;return r.value=i,r.fallback=!0,r}}));function s2(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let s4=ni("$ZodOptional",(e,t)=>{sr.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ng(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ng(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nf(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=e.value,i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(e=>s2(e,n)):s2(i,n)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),s9=ni("$ZodExactOptional",(e,t)=>{s4.init(e,t),ng(e._zod,"values",()=>t.innerType._zod.values),ng(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),s3=ni("$ZodNullable",(e,t)=>{sr.init(e,t),ng(e._zod,"optin",()=>t.innerType._zod.optin),ng(e._zod,"optout",()=>t.innerType._zod.optout),ng(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nf(e.source)}|null)$`):void 0}),ng(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),s6=ni("$ZodDefault",(e,t)=>{sr.init(e,t),e._zod.optin="optional",ng(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>s5(e,t)):s5(n,t)}});function s5(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let s7=ni("$ZodPrefault",(e,t)=>{sr.init(e,t),e._zod.optin="optional",ng(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),s8=ni("$ZodNonOptional",(e,t)=>{sr.init(e,t),ng(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>ae(t,e)):ae(i,e)}});function ae(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}(e,t)=>{sr.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new na("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let at=ni("$ZodCatch",(e,t)=>{sr.init(e,t),e._zod.optin="optional",ng(e._zod,"optout",()=>t.innerType._zod.optout),ng(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>n$(e,r,nl()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>n$(e,r,nl()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),ar=((e,t)=>{sr.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},ni("$ZodPipe",(e,t)=>{sr.init(e,t),ng(e._zod,"values",()=>t.in._zod.values),ng(e._zod,"optin",()=>t.in._zod.optin),ng(e._zod,"optout",()=>t.out._zod.optout),ng(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>an(e,t.in,r)):an(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>an(e,t.out,r)):an(n,t.out,r)}}));function an(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function ai(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>as(e,n,t.out,r)):as(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>as(e,n,t.in,r)):as(e,n,t.in,r)}}function as(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{sr.init(e,t),ng(e._zod,"values",()=>t.in._zod.values),ng(e._zod,"optin",()=>t.in._zod.optin),ng(e._zod,"optout",()=>t.out._zod.optout),ng(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>ai(e,t,r)):ai(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>ai(e,t,r)):ai(n,t,r)}}},(e,t)=>{ar.init(e,t)};let aa=ni("$ZodReadonly",(e,t)=>{sr.init(e,t),ng(e._zod,"propValues",()=>t.innerType._zod.propValues),ng(e._zod,"values",()=>t.innerType._zod.values),ng(e._zod,"optin",()=>t.innerType?._zod?.optin),ng(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(ao):ao(n)}});function ao(e){return e.value=Object.freeze(e.value),e}(e,t)=>{sr.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(n,i))}else if(null===e||nk.has(typeof e))r.push(nT(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{sr.init(e,t),ng(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),ng(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ng(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ng(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ng(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let al=ni("$ZodCustom",(e,t)=>{iC.init(e,t),sr.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>ac(t,r,n,e));ac(i,r,n,e)}});function ac(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(nB(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(eo=globalThis).__zod_globalRegistry??(eo.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let au=globalThis.__zod_globalRegistry;function ad(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...nA(t)})}function ah(e,t){return new iD({check:"less_than",...nA(t),value:e,inclusive:!1})}function af(e,t){return new iD({check:"less_than",...nA(t),value:e,inclusive:!0})}function ap(e,t){return new iL({check:"greater_than",...nA(t),value:e,inclusive:!1})}function am(e,t){return new iL({check:"greater_than",...nA(t),value:e,inclusive:!0})}function ag(e,t){return new iM({check:"multiple_of",...nA(t),value:e})}function ay(e,t){return new iq({check:"max_length",...nA(t),maximum:e})}function ab(e,t){return new iF({check:"min_length",...nA(t),minimum:e})}function av(e,t){return new iH({check:"length_equals",...nA(t),length:e})}function a_(e){return new iJ({check:"overwrite",tx:e})}e.i(31639);var aw=e.i(21266),aw=aw;function aE(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??au,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ax(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,s=t.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,r,n)}let s=e._zod.parent;s&&(a.ref||(a.ref=s),ax(s,t,n),t.seen.get(s).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function aS(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:s}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let s=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${n}/${s}`}}if(t[1]===r)return{ref:"#"};let i=`#/${n}/`,s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:i+s}})(t);n.def={...n.schema},s&&(n.defId=s);let a=n.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
102
102
 
103
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){i(r);continue}}}function aO(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,s={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(o)):Object.assign(i,o),Object.assign(i,s),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(o.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let o=t._zod.parent;if(o&&o!==a){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}Object.assign(i,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:ak(t,"input",e.processors),output:ak(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let ak=(e,t,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},a=aE({...i??{},target:s,io:t,processors:r});return ax(e,a),aS(a,e),aO(a,e)},aT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aR=(e,t,r,n)=>{let i=e._zod.def;ax(i.innerType,t,n),t.seen.get(e).ref=i.innerType},aA=ni("ZodISODateTime",(e,t)=>{sg.init(e,t),aY.init(e,t)}),aP=ni("ZodISODate",(e,t)=>{sy.init(e,t),aY.init(e,t)}),aN=ni("ZodISOTime",(e,t)=>{sb.init(e,t),aY.init(e,t)}),aC=ni("ZodISODuration",(e,t)=>{sv.init(e,t),aY.init(e,t)}),aI=ni("ZodError",(e,t)=>{i1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>n({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)n({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)n({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)r._errors.push(t(s));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(s))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nu,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nu,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),aD=i4(aI),aL=i3(aI),aM=i5(aI),aj=i8(aI),a$=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i4(aI)(e,t,n)},az=(e,t,r)=>i4(aI)(e,t,r),aU=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i3(aI)(e,t,n)},aB=async(e,t,r)=>i3(aI)(e,t,r),aq=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i5(aI)(e,t,n)},aF=(e,t,r)=>i5(aI)(e,t,r),aH=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i8(aI)(e,t,n)},aV=async(e,t,r)=>i8(aI)(e,t,r),aG=new WeakMap;function aW(e,t,r){let n=Object.getPrototypeOf(e),i=aG.get(n);if(i||(i=new Set,aG.set(n,i)),!i.has(t))for(let e in i.add(t),r){let t=r[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let aK=ni("ZodType",(e,t)=>(sr.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ak(e,"input"),output:ak(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let n=aE({...r,processors:t});return ax(e,n),aS(n,e),aO(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>aD(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>aM(e,t,r),e.parseAsync=async(t,r)=>aL(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>aj(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>a$(e,t,r),e.decode=(t,r)=>az(e,t,r),e.encodeAsync=async(t,r)=>aU(e,t,r),e.decodeAsync=async(t,r)=>aB(e,t,r),e.safeEncode=(t,r)=>aq(e,t,r),e.safeDecode=(t,r)=>aF(e,t,r),e.safeEncodeAsync=async(t,r)=>aH(e,t,r),e.safeDecodeAsync=async(t,r)=>aV(e,t,r),aW(e,"ZodType",{check(...e){let t=this.def;return this.clone(aw.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return nR(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new oD({type:"custom",check:"custom",fn:e,...nA(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(nB(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(nB(e)))},e(t.value,t)),(i=new iC({check:"custom",...nA(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(a_(e))},optional(){return ox(this)},exactOptional(){var e;return e=this,new oS({type:"optional",innerType:e})},nullable(){return ok(this)},nullish(){return ox(ok(this))},nonoptional(e){var t,r;return t=this,r=e,new oA({type:"nonoptional",innerType:t,...aw.normalizeParams(r)})},array(){return function(e){return new og({type:"array",element:e,...nA(void 0)})}(this)},or(e){return new ob({type:"union",options:[this,e],...aw.normalizeParams(void 0)})},and(e){var t;return t=this,new ov({type:"intersection",left:t,right:e})},transform(e){return oC(this,new ow({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new oT({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():aw.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new oR({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():aw.shallowClone(r)}})},catch(e){var t,r;return t=this,new oP({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return oC(this,e)},readonly(){var e;return e=this,new oI({type:"readonly",innerType:e})},describe(e){let t=this.clone();return au.add(t,{description:e}),t},meta(...e){if(0===e.length)return au.get(this);let t=this.clone();return au.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>au.get(e)?.description,configurable:!0}),e)),aX=ni("_ZodString",(e,t)=>{sn.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{r.type="string";let{minimum:i,maximum:s,format:a,patterns:o,contentEncoding:l}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof s&&(r.maxLength=s),a&&(r.format=aT[a]??a,""===r.format&&delete r.format,"time"===a&&delete r.format),l&&(r.contentEncoding=l),o&&o.size>0){let e=[...o];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r,0);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,aW(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new iG({check:"string_format",format:"regex",...nA(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new iX({check:"string_format",format:"includes",...nA(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new iZ({check:"string_format",format:"starts_with",...nA(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new iY({check:"string_format",format:"ends_with",...nA(t),suffix:e})}(...e))},min(...e){return this.check(ab(...e))},max(...e){return this.check(ay(...e))},length(...e){return this.check(av(...e))},nonempty(...e){return this.check(ab(1,...e))},lowercase(e){return this.check(new iW({check:"string_format",format:"lowercase",...nA(e)}))},uppercase(e){return this.check(new iK({check:"string_format",format:"uppercase",...nA(e)}))},trim(){return this.check(a_(e=>e.trim()))},normalize(...e){return this.check(function(e){return a_(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(a_(e=>e.toLowerCase()))},toUpperCase(){return this.check(a_(e=>e.toUpperCase()))},slugify(){return this.check(a_(e=>n_(e)))}})}),aZ=ni("ZodString",(e,t)=>{sn.init(e,t),aX.init(e,t),e.email=t=>e.check(new aJ({type:"string",format:"email",check:"string_format",abort:!1,...nA(t)})),e.url=t=>e.check(new a1({type:"string",format:"url",check:"string_format",abort:!1,...nA(t)})),e.jwt=t=>e.check(new oa({type:"string",format:"jwt",check:"string_format",abort:!1,...nA(t)})),e.emoji=t=>e.check(new a2({type:"string",format:"emoji",check:"string_format",abort:!1,...nA(t)})),e.guid=t=>e.check(ad(aQ,t)),e.uuid=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,...nA(t)})),e.uuidv4=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nA(t)})),e.uuidv6=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nA(t)})),e.uuidv7=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nA(t)})),e.nanoid=t=>e.check(new a4({type:"string",format:"nanoid",check:"string_format",abort:!1,...nA(t)})),e.guid=t=>e.check(ad(aQ,t)),e.cuid=t=>e.check(new a9({type:"string",format:"cuid",check:"string_format",abort:!1,...nA(t)})),e.cuid2=t=>e.check(new a3({type:"string",format:"cuid2",check:"string_format",abort:!1,...nA(t)})),e.ulid=t=>e.check(new a6({type:"string",format:"ulid",check:"string_format",abort:!1,...nA(t)})),e.base64=t=>e.check(new on({type:"string",format:"base64",check:"string_format",abort:!1,...nA(t)})),e.base64url=t=>e.check(new oi({type:"string",format:"base64url",check:"string_format",abort:!1,...nA(t)})),e.xid=t=>e.check(new a5({type:"string",format:"xid",check:"string_format",abort:!1,...nA(t)})),e.ksuid=t=>e.check(new a7({type:"string",format:"ksuid",check:"string_format",abort:!1,...nA(t)})),e.ipv4=t=>e.check(new a8({type:"string",format:"ipv4",check:"string_format",abort:!1,...nA(t)})),e.ipv6=t=>e.check(new oe({type:"string",format:"ipv6",check:"string_format",abort:!1,...nA(t)})),e.cidrv4=t=>e.check(new ot({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nA(t)})),e.cidrv6=t=>e.check(new or({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nA(t)})),e.e164=t=>e.check(new os({type:"string",format:"e164",check:"string_format",abort:!1,...nA(t)})),e.datetime=t=>e.check(new aA({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nA(t)})),e.date=t=>e.check(new aP({type:"string",format:"date",check:"string_format",...nA(t)})),e.time=t=>e.check(new aN({type:"string",format:"time",check:"string_format",precision:null,...nA(t)})),e.duration=t=>e.check(new aC({type:"string",format:"duration",check:"string_format",...nA(t)}))}),aY=ni("ZodStringFormat",(e,t)=>{si.init(e,t),aX.init(e,t)}),aJ=ni("ZodEmail",(e,t)=>{so.init(e,t),aY.init(e,t)}),aQ=ni("ZodGUID",(e,t)=>{ss.init(e,t),aY.init(e,t)}),a0=ni("ZodUUID",(e,t)=>{sa.init(e,t),aY.init(e,t)}),a1=ni("ZodURL",(e,t)=>{sl.init(e,t),aY.init(e,t)}),a2=ni("ZodEmoji",(e,t)=>{sc.init(e,t),aY.init(e,t)}),a4=ni("ZodNanoID",(e,t)=>{su.init(e,t),aY.init(e,t)}),a9=ni("ZodCUID",(e,t)=>{sd.init(e,t),aY.init(e,t)}),a3=ni("ZodCUID2",(e,t)=>{sh.init(e,t),aY.init(e,t)}),a6=ni("ZodULID",(e,t)=>{sf.init(e,t),aY.init(e,t)}),a5=ni("ZodXID",(e,t)=>{sp.init(e,t),aY.init(e,t)}),a7=ni("ZodKSUID",(e,t)=>{sm.init(e,t),aY.init(e,t)}),a8=ni("ZodIPv4",(e,t)=>{s_.init(e,t),aY.init(e,t)}),oe=ni("ZodIPv6",(e,t)=>{sw.init(e,t),aY.init(e,t)}),ot=ni("ZodCIDRv4",(e,t)=>{sE.init(e,t),aY.init(e,t)}),or=ni("ZodCIDRv6",(e,t)=>{sx.init(e,t),aY.init(e,t)}),on=ni("ZodBase64",(e,t)=>{sO.init(e,t),aY.init(e,t)}),oi=ni("ZodBase64URL",(e,t)=>{sk.init(e,t),aY.init(e,t)}),os=ni("ZodE164",(e,t)=>{sT.init(e,t),aY.init(e,t)}),oa=ni("ZodJWT",(e,t)=>{sR.init(e,t),aY.init(e,t)}),oo=ni("ZodNumber",(e,t)=>{sA.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:s,format:a,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof a&&a.includes("int")?r.type="integer":r.type="number";let u="number"==typeof c&&c>=(i??-1/0),d="number"==typeof l&&l<=(s??1/0),h="draft-04"===t.target||"openapi-3.0"===t.target;u?h?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof i&&(r.minimum=i),d?h?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof s&&(r.maximum=s),"number"==typeof o&&(r.multipleOf=o)})(e,t,r,0),aW(e,"ZodNumber",{gt(e,t){return this.check(ap(e,t))},gte(e,t){return this.check(am(e,t))},min(e,t){return this.check(am(e,t))},lt(e,t){return this.check(ah(e,t))},lte(e,t){return this.check(af(e,t))},max(e,t){return this.check(af(e,t))},int(e){return this.check(oc(e))},safe(e){return this.check(oc(e))},positive(e){return this.check(ap(0,e))},nonnegative(e){return this.check(am(0,e))},negative(e){return this.check(ah(0,e))},nonpositive(e){return this.check(af(0,e))},multipleOf(e,t){return this.check(ag(e,t))},step(e,t){return this.check(ag(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null}),ol=ni("ZodNumberFormat",(e,t)=>{sP.init(e,t),oo.init(e,t)});function oc(e){return new ol({type:"number",check:"number_format",abort:!1,format:"safeint",...nA(e)})}let ou=ni("ZodBoolean",(e,t)=>{sN.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}}),od=ni("ZodBigInt",(e,t)=>{sC.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,r)=>e.check(am(t,r)),e.min=(t,r)=>e.check(am(t,r)),e.gt=(t,r)=>e.check(ap(t,r)),e.gte=(t,r)=>e.check(am(t,r)),e.min=(t,r)=>e.check(am(t,r)),e.lt=(t,r)=>e.check(ah(t,r)),e.lte=(t,r)=>e.check(af(t,r)),e.max=(t,r)=>e.check(af(t,r)),e.positive=t=>e.check(ap(BigInt(0),t)),e.negative=t=>e.check(ah(BigInt(0),t)),e.nonpositive=t=>e.check(af(BigInt(0),t)),e.nonnegative=t=>e.check(am(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(ag(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),oh=ni("ZodUnknown",(e,t)=>{sI.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function of(){return new oh({type:"unknown"})}let op=ni("ZodNever",(e,t)=>{sD.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),om=ni("ZodDate",(e,t)=>{sL.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,r)=>e.check(am(t,r)),e.max=(t,r)=>e.check(af(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),og=ni("ZodArray",(e,t)=>{sj.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=ax(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,aW(e,"ZodArray",{min(e,t){return this.check(ab(e,t))},nonempty(e){return this.check(ab(1,e))},max(e,t){return this.check(ay(e,t))},length(e,t){return this.check(av(e,t))},unwrap(){return this.element}})}),oy=ni("ZodObject",(e,t)=>{sq.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object",r.properties={};let s=i.shape;for(let e in s)r.properties[e]=ax(s[e],t,{...n,path:[...n.path,"properties",e]});let a=new Set([...new Set(Object.keys(s))].filter(e=>{let r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));a.size>0&&(r.required=Array.from(a)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=ax(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),aw.defineLazy(e,"shape",()=>t.shape),aW(e,"ZodObject",{keyof(){var e;return new o_({type:"enum",entries:Array.isArray(e=Object.keys(this._zod.def.shape))?Object.fromEntries(e.map(e=>[e,e])):e,...aw.normalizeParams(void 0)})},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:of()})},loose(){return this.clone({...this._zod.def,catchall:of()})},strict(){return this.clone({...this._zod.def,catchall:new op({type:"never",...nA(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return aw.extend(this,e)},safeExtend(e){return aw.safeExtend(this,e)},merge(e){return aw.merge(this,e)},pick(e){return aw.pick(this,e)},omit(e){return aw.omit(this,e)},partial(...e){return aw.partial(oE,this,e[0])},required(...e){return aw.required(oA,this,e[0])}})}),ob=ni("ZodUnion",(e,t)=>{sH.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,s,a,o;let l,c,u;return i=e,s=t,a=r,o=n,c=!1===(l=i._zod.def).inclusive,u=l.options.map((e,t)=>ax(e,s,{...o,path:[...o.path,c?"oneOf":"anyOf",t]})),void(c?a.oneOf=u:a.anyOf=u)},e.options=t.options}),ov=ni("ZodIntersection",(e,t)=>{sG.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a,o;return s=ax((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=ax(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...o(a)?a.allOf:[a]])}}),o_=ni("ZodEnum",(e,t)=>{s0.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;(i=nc(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new o_({...t,checks:[],...aw.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new o_({...t,checks:[],...aw.normalizeParams(n),entries:i})}}),ow=ni("ZodTransform",(e,t)=>{s1.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new na(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(aw.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(aw.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}}),oE=ni("ZodOptional",(e,t)=>{s4.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>aR(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new oE({type:"optional",innerType:e})}let oS=ni("ZodExactOptional",(e,t)=>{s9.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>aR(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),oO=ni("ZodNullable",(e,t)=>{s3.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=ax((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function ok(e){return new oO({type:"nullable",innerType:e})}let oT=ni("ZodDefault",(e,t)=>{s6.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),oR=ni("ZodPrefault",(e,t)=>{s7.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),oA=ni("ZodNonOptional",(e,t)=>{s8.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),oP=ni("ZodCatch",(e,t)=>{at.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,s=e._zod.def;ax(s.innerType,t,n),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),oN=ni("ZodPipe",(e,t)=>{ar.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(ax(a="input"===t.io?s?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function oC(e,t){return new oN({type:"pipe",in:e,out:t})}let oI=ni("ZodReadonly",(e,t)=>{aa.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),oD=ni("ZodCustom",(e,t)=>{al.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});e.s(["bigint",0,function(e){return new od({type:"bigint",coerce:!0,...nA(e)})},"boolean",0,function(e){return new ou({type:"boolean",coerce:!0,...nA(e)})},"date",0,function(e){return new om({type:"date",coerce:!0,...nA(e)})},"number",0,function(e){return new oo({type:"number",coerce:!0,checks:[],...nA(e)})},"string",0,function(e){return new aZ({type:"string",coerce:!0,...nA(e)})}],52982);var oL=e.i(52982),oL=oL;let oM=e=>(t,r,n)=>{let i=function(e,t){let r={};for(let[n,i]of rM(t.headers?.get("cookie")||""))n.startsWith(e)&&(r[n]=i);return r}(t,n),s=n.context.logger,a=()=>{let e=function(e,t){let r={};for(let n in e)r[n]={name:n,value:"",attributes:{...t,maxAge:0}};return r}(i,r);for(let e in i)delete i[e];return e};return{chunk(n,o){let l=a();for(let a of function(e,t,r,n){let i=4050-r5(`${t.name}.99`,"",{...t.attributes}).length,s=i>0?Math.ceil(t.value.length/i):1/0;if(s<=1)return r[t.name]=t.value,[t];if(s>100)return n.warn(`${e} cookie is too large to store even after chunking, so the cache was skipped. Reduce the cached data or use a database session.`),[];let a=[];for(let e=0;e<s;e++){let n=`${t.name}.${e}`,s=e*i,o=t.value.substring(s,s+i);a.push({...t,name:n,value:o}),r[n]=o}return n.debug(`CHUNKING_${e.toUpperCase()}_COOKIE`,{message:`${e} cookie exceeds the 4050 byte limit and was split into ${s} chunks.`,valueSize:t.value.length,chunkCount:s,chunkSizes:a.map(e=>e.value.length)}),a}(e,{name:t,value:n,attributes:{...r,...o}},i,s))l[a.name]=a;return Object.values(l)},clean:()=>Object.values(a()),setCookies(e){for(let t of e)n.setCookie(t.name,t.value,t.attributes)}}};oM("Session"),oM("Account"),ox(new oy({type:"object",shape:{disableCookieCache:oL.boolean().meta({description:"Disable cookie cache and fetch session from database"}).optional(),disableRefresh:oL.boolean().meta({description:"Disable session refresh. Useful for checking session status, without updating the session"}).optional()}??{},...aw.normalizeParams(void 0)})),new TextEncoder().encode;let oj=(e,t)=>{let r=(e instanceof Headers||!("headers"in e)?e:e.headers).get("cookie");if(!r)return null;let{cookieName:n="session_token",cookiePrefix:i="better-auth"}=t||{},s=rM(r),a=e=>s.get(`__Secure-${e}`)??s.get(e),o=a(`${i}.${n}`)||a(`${i}-${n}`);return o||null};var o$=e.i(90133),oz=e.i(50227);e.i(73539),e.i(54799),e.i(24868);var oU=e.i(46786),oB=e.i(14747),oq=[{name:"docker",kind:"local",label:"Docker (local)",loginHint:"builds a ~1GB local image; no login needed",rebuildMinutes:"1",blurb:"local Docker containers",sizeDesc:"Per-provider override of `box.size` for docker. Reserved — docker sizing is controlled via `box.memory` / `box.cpus` / `box.disk`.",imageDesc:"Per-provider override of `box.image` for docker (local docker image ref, e.g. `agentbox/box:dev`). Wins over the generic when set."},{name:"daytona",kind:"cloud",label:"Daytona (cloud sandbox)",loginHint:"approve a browser sign-in link",rebuildMinutes:"7",blurb:"Daytona Cloud sandboxes",sizeDesc:"Per-provider override of `box.size` for daytona. `cpu-memory-disk` GB spec (e.g. `4-8-20`). Only honored on the image/Dockerfile create path; on the snapshot path the size is fixed at bake time (Daytona rejects custom resources on snapshot-resume).",imageDesc:"Per-provider override of `box.image` for daytona (named snapshot, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider daytona`."},{name:"hetzner",kind:"cloud",label:"Hetzner (cloud VPS)",loginHint:"paste an API token from the Hetzner Console",rebuildMinutes:"7-10",blurb:"Hetzner Cloud VPSes",sizeDesc:"Per-provider override of `box.size` for hetzner. Server type string (e.g. `cx23`, `cx33`, `cx43`).",imageDesc:"Per-provider override of `box.image` for hetzner (image description, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider hetzner`."},{name:"vercel",kind:"cloud",label:"Vercel (cloud microVM)",loginHint:"installs the Vercel sandbox CLI, then a browser sign-in",rebuildMinutes:"5-10",blurb:"Vercel Sandboxes",sizeDesc:"Per-provider override of `box.size` for vercel. vCPU count — one of `1`, `2`, `4`, `8` (Vercel couples RAM at 2048 MB/vCPU). Default 2.",imageDesc:"Per-provider override of `box.image` for vercel (snapshot id, e.g. `snap_…`). Written by `agentbox prepare --provider vercel`."},{name:"e2b",kind:"cloud",label:"E2B (cloud microVM)",loginHint:"paste an API key from the E2B dashboard",rebuildMinutes:"2",blurb:"E2B microVMs",sizeDesc:"Per-provider override of `box.size` for e2b. `cpu-memory` GB spec (e.g. `4-8`). Template-level: baked by `agentbox prepare --provider e2b --size <spec>`; E2B rejects per-create resources.",imageDesc:"Per-provider override of `box.image` for e2b (template id or `name:tag`, e.g. `agentbox-base:latest`). Written by `agentbox prepare --provider e2b`."},{name:"digitalocean",kind:"cloud",label:"DigitalOcean (cloud VPS)",loginHint:"paste a Personal Access Token from the DigitalOcean Console",rebuildMinutes:"7-10",blurb:"DigitalOcean Droplets",sizeDesc:"Per-provider override of `box.size` for digitalocean. Droplet size slug (e.g. `s-2vcpu-4gb`, `s-4vcpu-8gb`).",imageDesc:"Per-provider override of `box.image` for digitalocean (numeric snapshot id). Written by `agentbox prepare --provider digitalocean`."}],oF=oq.map(e=>e.name);function oH(e,t){return`box.${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}oq.filter(e=>"cloud"===e.kind).map(e=>e.name);var oV=[{key:"box.provider",type:"enum",enumValues:oF,description:`Sandbox backend new boxes are created on: ${(ei=oq.map(e=>e.blurb)).length<=1?ei.join(""):`${ei.slice(0,-1).join(", ")}, or ${ei[ei.length-1]}`}.`},{key:"box.hostSnapshot",type:"bool",description:"Use a frozen APFS clone of the host workspace as the overlay lower (default: prompt). Was box.snapshot."},{key:"box.defaultCheckpoint",type:"string",description:"Checkpoint ref new boxes in this project start from when --snapshot is not given (set via `agentbox checkpoint set-default`). Used as fallback when no per-provider override is set."},...oq.map(e=>({key:oH("defaultCheckpoint",e.name),type:"string",description:`Per-provider override of \`box.defaultCheckpoint\` for ${e.name}. Wins over the global when set; set via \`agentbox checkpoint set-default --provider ${e.name}\`.`,advanced:!0})),{key:"box.size",type:"string",description:"Default VM size for cloud providers. Provider-interpreted: hetzner = server type (e.g. `cx33`); daytona = `cpu-memory-disk` GB (e.g. `4-8-20`); vercel = vCPU count (1, 2, 4, 8); e2b = `cpu-memory` GB (e.g. `4-8`). Used as fallback when no per-provider override is set. Docker ignores it."},...oq.map(e=>({key:oH("size",e.name),type:"string",description:e.sizeDesc,advanced:!0})),{key:"checkpoint.maxLayers",type:"int",description:"Max stacked checkpoint layers before a new checkpoint is materialized merged (flattened) instead of layered.",advanced:!0},{key:"box.withPlaywright",type:"bool",description:"Install @playwright/cli@latest in the box at create time."},{key:"box.claudeInstall",type:"enum",enumValues:["native","npm"],description:"How `agentbox prepare` installs Claude Code into the base image/snapshot: `native` (Anthropic's installer, the default) or `npm` (@anthropic-ai/claude-code). A fallback for cloud egress IPs the native installer's CDN 403s. Bake-time only — change it, then re-run `agentbox prepare --provider <name>`."},{key:"box.withEnv",type:"bool",description:"Copy host env/config files (.env*, secrets.toml, agentbox.yaml, ...) into /workspace at box create time (gitignore-bypassing)."},{key:"box.resyncOnStart",type:"bool",description:"Merge the host's current branch into the box and overlay the host's uncommitted/untracked changes when starting an agent session (keeps the box's version on conflict and warns the agent)."},{key:"box.vnc",type:"bool",description:"Run the per-box Xvnc + noVNC stack."},{key:"box.autoApproveHostActions",type:"bool",description:"Auto-approve host-action confirmations (git push, cp host<->box, gh PR writes, checkpoint) for this box without an interactive prompt. Off by default; intended for unattended orchestration of trusted boxes. Each auto-approval is recorded as a relay event (visible in `agentbox agent` / the dashboard)."},{key:"box.autoApproveSafeHostActions",type:"bool",description:"Auto-approve the SAFE subset of host actions without a prompt: opening a PR, PR/review comments, re-running CI, pushing to the box's scratch or host-sanctioned branch, checkpoints, integration writes, and file copy/download that stays inside the box project folder (non-secret). Uncontained or secret file transfers, non-sanctioned-branch pushes, and PR merge/checkout still prompt. On by default; set false to prompt for every host action (the pre-relax behavior). Superseded by box.autoApproveHostActions, which approves everything. Each auto-approval is recorded as a relay event."},{key:"box.isolateClaudeConfig",type:"bool",description:"Use a per-box ~/.claude volume instead of the shared one."},{key:"box.isolateCodexConfig",type:"bool",description:"Use a per-box ~/.codex volume instead of the shared one."},{key:"box.isolateOpencodeConfig",type:"bool",description:"Use a per-box OpenCode config/data volume instead of the shared one."},{key:"box.image",type:"string",description:"Generic box image ref (fallback). Used as fallback when no per-provider override is set; the default `agentbox/box:dev` is treated as a sentinel by cloud backends (boot from their prepared base snapshot instead).",advanced:!0},...oq.map(e=>({key:oH("image",e.name),type:"string",description:e.imageDesc,advanced:!0})),{key:"box.imageRegistry",type:"string",description:"Registry repo to pull the prebuilt docker base image from before building locally. Empty = always build. Docker only (advanced).",advanced:!0},{key:"box.dockerCacheShared",type:"bool",description:"Share the in-box docker image cache across boxes via the 'agentbox-docker-cache' volume (preserved on destroy/prune; only one box can run at a time when set)."},{key:"box.memory",type:"int",description:"Hard memory ceiling in MiB for new boxes (0 = unlimited). Use --memory on create/claude for byte/k/m/g strings."},{key:"box.cpus",type:"int",description:"CPU count cap for new boxes (0 = unlimited). Whole cores via config; use --cpus for fractional (e.g. 1.5)."},{key:"box.pidsLimit",type:"int",description:"Max process count (PIDs cgroup) for new boxes (0 = unlimited)."},{key:"box.disk",type:"string",description:"Best-effort writable-layer size for new boxes, e.g. '10G'. No-op on overlay2 / the macOS engines.",advanced:!0},{key:"box.bundleDepth",type:"int",description:"Cap git bundle history shipped to cloud sandboxes (daytona, hetzner). 0 = full history. Unset = adaptive default (last 200 commits; re-bundle at 100 if the bundle exceeds 20 MB). Ignored for docker (which bind-mounts .git/)."},{key:"box.hetznerLocation",type:"string",description:"Hetzner datacenter location new --provider hetzner boxes are created in (e.g. `nbg1`, `fsn1`, `hel1`, `ash`). Default `nbg1`. Overridable per-create with `--location`. Hetzner-only; ignored by other providers."},{key:"box.digitaloceanRegion",type:"string",description:"DigitalOcean region new --provider digitalocean boxes are created in (e.g. `nyc3`, `nyc1`, `sfo3`, `ams3`, `fra1`). Default `nyc3`. Overridable per-create with `--location`. DigitalOcean-only; ignored by other providers."},{key:"box.vercelTimeoutMs",type:"int",description:"Max session length (ms) for new --provider vercel boxes before the VM auto-snapshots; persistent mode auto-resumes on the next call. Default 2700000 (45 min, the Hobby ceiling). Vercel-only."},{key:"box.e2bTimeoutMs",type:"int",description:"Session timeout (ms) a new --provider e2b box is created with, before E2B auto-pauses it on inactivity. The host keepalive loop pushes this forward while the agent is working. Default 2700000 (45 min); the Hobby tier caps total session at ~1 h regardless. E2B-only."},{key:"box.cpMaxBytes",type:"int",description:"Max bytes a single host→box copy may transfer after excludes, shared by `agentbox cp` (blocked with a size breakdown unless --yes) and each `carry:` entry (rejected at resolve time). Default 104857600 (100 MiB).",advanced:!0},{key:"box.credentialSync",type:"bool",description:"Automatically sync refreshed agent credentials (claude/codex/opencode) from boxes to the host backup and out to all other running boxes. Claude OAuth refresh rotates the refresh token, so without this every other copy 401s after any box refreshes. Default true; --no-credential-sync at create disables the in-box watcher for that box."},{key:"box.inbound",type:"string",description:"Inbound-access policy for VPS boxes (hetzner, digitalocean per-box firewall). `locked` (default) = SSH reachable only from your host's egress IP; `open` = SSH reachable from anywhere (0.0.0.0/0, key-only — to drive a box from a phone with the laptop off); a CIDR list (e.g. `203.0.113.5/32`) = host egress plus those. Override per box with `--inbound` or after create with `agentbox inbound <box>`. Ignored by non-VPS providers."},{key:"box.vercelNetworkPolicy",type:"string",description:"Egress lock for new --provider vercel boxes: 'allow-all' (default, unset), 'deny-all', or a comma-separated domain allowlist (e.g. 'github.com,*.npmjs.org') that denies everything else. Vercel-only; ignored by other providers."},{key:"claude.sessionName",type:"string",description:"tmux session name for `agentbox claude`."},{key:"claude.dangerouslySkipPermissions",type:"bool",description:"Launch claude in new boxes with --dangerously-skip-permissions (auto-accept tool use). Safe because boxes are isolated; on by default. Override per-box with --no-dangerously-skip-permissions."},{key:"codex.sessionName",type:"string",description:"tmux session name for `agentbox codex`."},{key:"codex.dangerouslySkipPermissions",type:"bool",description:"Launch codex in new boxes with --dangerously-bypass-approvals-and-sandbox (never prompt for approval). Safe because boxes are isolated; on by default. Override per-box with --no-dangerously-skip-permissions."},{key:"opencode.sessionName",type:"string",description:"tmux session name for `agentbox opencode`."},{key:"attach.openIn",type:"enum",enumValues:["split","window","tab","same"],description:"Where `agentbox claude|codex|opencode` opens the attached session when run from tmux, cmux, Herdr, or iTerm2: `split` (tmux split-window / cmux new-split / Herdr pane.split / iTerm2 vertical split, default — same workspace), `window` (tmux new-window / cmux new-workspace / Herdr workspace.create / new iTerm2 window), `tab` (tmux new-window / cmux new-surface / Herdr tab.create in the current workspace / new iTerm2 tab), or `same` (attach inline in the current terminal). Outside tmux/cmux/Herdr/iTerm2 every value behaves like `same`."},{key:"attach.cmuxStatus",type:"bool",description:"When attached inside cmux, reflect the box agent's live activity on its cmux workspace (colour + description: blue=working, amber=needs input, idle clears; restored on detach) and, when the agent needs input, flag the box's own tab via a cmux notification (tab badge + reorder + desktop notification) so it stands out among sibling tabs. cmux only; no-op in other terminals."},{key:"attach.herdrStatus",type:"bool",description:"When attached inside Herdr, report the box agent's live activity to its Herdr pane (pane.report_agent: working / blocked / idle) so it looks like a normal agent pane and Herdr handles needs-input natively, and fire a Herdr notification for AgentBox's own host-relay approval prompts (git push / PR / checkpoint …) which Herdr can't otherwise see. Herdr only; no-op in other terminals."},{key:"code.ide",type:"enum",enumValues:["vscode","cursor","auto"],description:'Which IDE `agentbox code` launches; "auto" prefers code, falls back to cursor.'},{key:"code.wait",type:"bool",description:"Block on agentbox-ctl wait-ready before opening the IDE."},{key:"code.timeoutMs",type:"int",description:"wait-ready timeout in milliseconds."},{key:"code.autoTerminals",type:"bool",description:"Generate /workspace/.vscode/tasks.json so the IDE auto-opens log panels."},{key:"shell.user",type:"string",description:"Default in-container user for `agentbox shell`."},{key:"shell.login",type:"bool",description:"Pass `-l` to bash so the login profile loads."},{key:"shell.tmux",type:"bool",description:"Run `agentbox shell` inside a detachable tmux session (Ctrl+a d to detach)."},{key:"ssh.autoConfig",type:"bool",description:"Automatically write a `~/.agentbox/ssh/config` entry (Include'd from `~/.ssh/config`) for SSH-capable cloud boxes on create and start/resume, so `ssh <box>` just works. On by default; set false if you manage `~/.ssh/config` yourself. Explicit `agentbox shell --ssh-config`/`code`/`open` still write on demand regardless."},{key:"engine.kind",type:"enum",enumValues:["orbstack","docker-desktop","other","auto"],description:"Override the docker-engine auto-detection (used for OrbStack-only optimisations)."},{key:"browser.default",type:"enum",enumValues:["agent-browser","playwright","both"],description:'Default browser stack inside the box. "playwright" or "both" implies box.withPlaywright.'},{key:"relay.port",type:"int",description:"Host relay TCP port (advanced).",advanced:!0},{key:"relay.controlPlaneUrl",type:"string",description:"Public HTTPS URL of a deployed control plane (hosted Next.js + Postgres app). When set, new cloud boxes point at it for git-token leasing, permission state, and the box registry/events, and push to GitHub directly with a leased token so they keep working with the laptop off. Set via `agentbox control-plane set-url`."},{key:"git.pushMode",type:"enum",enumValues:["auto","relay","lease","direct"],description:"How a box's `git push` reaches GitHub: `relay` (the host relay pushes with your host credentials — they never enter the box), `lease` (the relay/plane leases a short-lived GitHub-App token and the box pushes directly, so it works with the laptop off), `direct` (the box holds a COPY of your git credentials and pushes/pulls/signs entirely on its own — needs no host or hub, but the credentials live inside the box and its snapshots; set via `--with-credentials`, which copies them in behind a confirmation), or `auto` (default — lease when `relay.controlPlaneUrl` is set for the box, else relay). Only affects cloud boxes; docker boxes always use `relay`. Forcing `relay` needs a reachable host relay for the box; forcing `lease` needs a reachable relay/plane with a GitHub App; `direct` needs credentials to have been copied into the box at create time."},{key:"vnc.containerPort",type:"int",description:"Container-side noVNC port (advanced).",advanced:!0},{key:"portless.enabled",type:"bool",description:"Map each box web app to a https://<box-name>.localhost URL via the Portless proxy (Docker Desktop only; OrbStack already has .orb.local). Default: prompt."},{key:"portless.stateDir",type:"string",description:"Host Portless state directory to share into boxes (advanced; default: Portless’s own location).",advanced:!0},{key:"autopause.enabled",type:"bool",description:"Let the host relay periodically pause idle boxes when more than autopause.maxRunningBoxes are running."},{key:"autopause.maxRunningBoxes",type:"int",description:"Target maximum number of simultaneously-running boxes before idle ones get auto-paused."},{key:"autopause.idleMinutes",type:"int",description:"Minutes a box must be continuously idle (claude state) before it is eligible for auto-pause."},{key:"queue.enabled",type:"bool",description:"Run `agentbox claude|codex|opencode -i <prompt>` jobs through the host-wide background queue (FIFO, capped by queue.maxConcurrent)."},{key:"queue.maxConcurrent",type:"int",description:"Max number of simultaneously-running boxes (across providers) before background `-i` jobs queue up instead of starting immediately. Per-invocation override: `--max-running <n>`."},{key:"queue.maxWorking",type:"int",description:"Max agents actively working/thinking (quota-consuming) at once before background `-i` jobs queue. 0 = disabled (use the queue.maxConcurrent running-box gate). Counts all boxes, foreground + queued. Per-invocation override: `--max-working <n>`."},{key:"queue.idleGraceSeconds",type:"int",description:"Seconds an agent must stay non-working before it frees its working slot (debounce against brief idle flaps between turns). Only used when queue.maxWorking > 0."},{key:"queue.openIn",type:"enum",enumValues:["none","split","window","tab"],description:"When a background `-i` job finishes creating its box, where the host relay opens an attached terminal onto it: `none` (default — open nothing, just queue), `split`, `window`, or `tab`. Honored only when the submitting shell runs inside tmux, cmux, Herdr, or iTerm2 (the targeting is captured at submit time). Under cmux, `split` splits the pane you submitted from (falling back to the parent workspace, then a new workspace), `tab` adds a tab in the parent workspace, and `window` opens a separate workspace; under Herdr, `split` splits the pane you submitted from, `tab` adds a tab in the parent workspace, and `window` opens a separate workspace; iTerm2 opens relative to the frontmost window. Unlike `attach.openIn` there is no `same` mode — the box is created asynchronously, so it is always a fresh terminal."},{key:"cloud.useCurrentBranch",type:"bool",description:"On cloud providers (daytona/hetzner), start new boxes on the host's current branch instead of forking a new agentbox/<box-name> branch. Overridden by an explicit --use-branch / --from-branch."},{key:"maintenance.pruneProjectConfigs",type:"bool",description:"Periodically delete ~/.agentbox/projects/<hash>/ dirs whose source workspace folder no longer exists."},{key:"maintenance.pruneProjectConfigsEvery",type:"int",description:"Run the orphan project-config sweep every N successful `agentbox create`."},{key:"update.check",type:"bool",description:'Daily background check for a newer published agentbox (npm registry) and menu-bar app (release sha sidecar), plus the "newer version available" nudge. At most one network probe per 24h; false disables both.'},{key:"integrations.notion.enabled",type:"bool",description:'Enable the in-box Notion integration shim (`ntn`/`notion` commands routed via the host relay). When false (default), the relay refuses dispatch with a clear "disabled" error and no host process is touched.'},{key:"integrations.linear.enabled",type:"bool",description:'Enable the in-box Linear integration shim (`linear` commands routed via the host relay; backed by `@schpet/linear-cli`). When false (default), the relay refuses dispatch with a clear "disabled" error and no host process is touched.'}];oV.map(e=>[e.key,e]),(()=>{let e=new Map;for(let t of oV){let r=t.key.indexOf(".");if(r<0)throw Error(`KEY_REGISTRY entry ${t.key} must use dot-path form (branch.leaf)`);let n=t.key.slice(0,r),i=t.key.slice(r+1),s=e.get(n);s||(s={name:n,leaves:new Map},e.set(n,s)),s.leaves.set(i,t)}})();var oG=(0,oB.join)((0,oU.homedir)(),".agentbox");(0,oB.join)(oG,"config.yaml");var oW=(0,oB.join)(oG,"projects");(0,oB.join)(oW,".gc.json"),(0,oz.join)(oG,"hub","auth.db"),(0,oz.join)(oG,"hub","token");let oK="agentbox_hub_token";function oX(e,t){let r=Buffer.from(e),n=Buffer.from(t);return r.length===n.length&&(0,ro.timingSafeEqual)(r,n)}let oZ=new Set(["/api/v1/health","/api/v1/openapi.json","/api/v1/docs"]);function oY(){return o$.NextResponse.json({error:{code:"unauthorized",message:"Missing or invalid credentials. Send Authorization: Bearer <hub token>."}},{status:401})}e.s(["config",0,{matcher:["/((?!api/auth|signin|healthz|admin|rpc|events|bridge|remote|_next/static|_next/image|favicon.ico).*)"]},"proxy",0,function(e){let t,r="off"===process.env.AGENTBOX_HUB_AUTH?"off":"localhost"===("hetzner"===(t=process.env.AGENTBOX_HUB_PROFILE)||"vercel"===t?t:"localhost")?process.env.AGENTBOX_HUB_TOKEN?"token":"off":"off"!==process.env.AGENTBOX_HUB_AUTH&&("on"===process.env.AGENTBOX_HUB_AUTH||process.env.BETTER_AUTH_SECRET)?"password":"off";if("off"===r)return o$.NextResponse.next();if(e.nextUrl.pathname.startsWith("/api/v1"))return function(e,t){if(oZ.has(e.nextUrl.pathname))return o$.NextResponse.next();if("token"===t){let t,r,n=process.env.AGENTBOX_HUB_TOKEN??"";if(!n)return oY();let i=(r=(t=e.headers.get("authorization"))?/^Bearer\s+(.+)$/i.exec(t):null)?r[1].trim():null;if(i&&oX(i,n))return o$.NextResponse.next();let s=e.cookies.get(oK)?.value;return s&&oX(s,n)?o$.NextResponse.next():oY()}return oj(e)?o$.NextResponse.next():oY()}(e,r);if("token"===r){let t=process.env.AGENTBOX_HUB_TOKEN??"",r=e.nextUrl.searchParams.get("token");if(r&&t&&oX(r,t)){let r=e.nextUrl.clone();r.searchParams.delete("token");let n=o$.NextResponse.redirect(r);return n.cookies.set(oK,t,{httpOnly:!0,sameSite:"lax",secure:!1,path:"/",maxAge:2592e3}),n}let n=e.cookies.get(oK)?.value;return n&&t&&oX(n,t)?o$.NextResponse.next():new o$.NextResponse("AgentBox hub is locked. Open it with `agentbox hub`.",{status:401,headers:{"content-type":"text/plain"}})}return oj(e)?o$.NextResponse.next():o$.NextResponse.redirect(new URL("/signin?returnUrl="+e.nextUrl.pathname,e.url))}],77826);let oJ={...e.i(77826)},oQ="/proxy",o0=oJ.proxy||oJ.default;if("function"!=typeof o0)throw new class extends Error{constructor(e){super(e),this.stack=""}}(`The Proxy file "${oQ}" must export a function named \`proxy\` or a default function.`);let o1=e=>tR({...e,IncrementalCache:ra,incrementalCacheHandler:null,page:oQ,handler:async(...e)=>{try{return await o0(...e)}catch(i){let t=e[0],r=new URL(t.url),n=r.pathname+r.search;throw await c(i,{path:n,method:t.method,headers:Object.fromEntries(t.headers.entries())},{routerKind:"Pages Router",routePath:"/proxy",routeType:"proxy",revalidateReason:void 0}),i}}});async function o2(e,t){let r=await o1({request:{url:e.url,method:e.method,headers:O(e.headers),nextConfig:{basePath:"",i18n:"",trailingSlash:!1,experimental:{cacheLife:{default:{stale:300,revalidate:900,expire:0xfffffffe},seconds:{stale:30,revalidate:1,expire:60},minutes:{stale:300,revalidate:60,expire:3600},hours:{stale:300,revalidate:3600,expire:86400},days:{stale:300,revalidate:86400,expire:604800},weeks:{stale:300,revalidate:604800,expire:2592e3},max:{stale:300,revalidate:2592e3,expire:31536e3}},authInterrupts:!1,clientParamParsingOrigins:[]}},page:{name:oQ},body:"GET"!==e.method&&"HEAD"!==e.method?e.body??void 0:void 0,waitUntil:t.waitUntil,requestMeta:t.requestMeta,signal:t.signal||new AbortController().signal}});return null==t.waitUntil||t.waitUntil.call(t,r.waitUntil),r.response}e.s(["default",0,o1,"handler",0,o2],34577)}];
103
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){i(r);continue}}}function aO(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,s={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(o)):Object.assign(i,o),Object.assign(i,s),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(o.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let o=t._zod.parent;if(o&&o!==a){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}Object.assign(i,r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:ak(t,"input",e.processors),output:ak(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let ak=(e,t,r={})=>n=>{let{libraryOptions:i,target:s}=n??{},a=aE({...i??{},target:s,io:t,processors:r});return ax(e,a),aS(a,e),aO(a,e)},aT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aR=(e,t,r,n)=>{let i=e._zod.def;ax(i.innerType,t,n),t.seen.get(e).ref=i.innerType},aA=ni("ZodISODateTime",(e,t)=>{sg.init(e,t),aY.init(e,t)}),aP=ni("ZodISODate",(e,t)=>{sy.init(e,t),aY.init(e,t)}),aN=ni("ZodISOTime",(e,t)=>{sb.init(e,t),aY.init(e,t)}),aC=ni("ZodISODuration",(e,t)=>{sv.init(e,t),aY.init(e,t)}),aI=ni("ZodError",(e,t)=>{i1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>n({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)n({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)n({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)r._errors.push(t(s));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(s))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nu,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nu,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),aD=i4(aI),aL=i3(aI),aM=i5(aI),aj=i8(aI),a$=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i4(aI)(e,t,n)},az=(e,t,r)=>i4(aI)(e,t,r),aU=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i3(aI)(e,t,n)},aB=async(e,t,r)=>i3(aI)(e,t,r),aq=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i5(aI)(e,t,n)},aF=(e,t,r)=>i5(aI)(e,t,r),aH=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return i8(aI)(e,t,n)},aV=async(e,t,r)=>i8(aI)(e,t,r),aG=new WeakMap;function aW(e,t,r){let n=Object.getPrototypeOf(e),i=aG.get(n);if(i||(i=new Set,aG.set(n,i)),!i.has(t))for(let e in i.add(t),r){let t=r[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let aK=ni("ZodType",(e,t)=>(sr.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ak(e,"input"),output:ak(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let n=aE({...r,processors:t});return ax(e,n),aS(n,e),aO(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>aD(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>aM(e,t,r),e.parseAsync=async(t,r)=>aL(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>aj(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>a$(e,t,r),e.decode=(t,r)=>az(e,t,r),e.encodeAsync=async(t,r)=>aU(e,t,r),e.decodeAsync=async(t,r)=>aB(e,t,r),e.safeEncode=(t,r)=>aq(e,t,r),e.safeDecode=(t,r)=>aF(e,t,r),e.safeEncodeAsync=async(t,r)=>aH(e,t,r),e.safeDecodeAsync=async(t,r)=>aV(e,t,r),aW(e,"ZodType",{check(...e){let t=this.def;return this.clone(aw.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return nR(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new oD({type:"custom",check:"custom",fn:e,...nA(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(nB(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(nB(e)))},e(t.value,t)),(i=new iC({check:"custom",...nA(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(a_(e))},optional(){return ox(this)},exactOptional(){var e;return e=this,new oS({type:"optional",innerType:e})},nullable(){return ok(this)},nullish(){return ox(ok(this))},nonoptional(e){var t,r;return t=this,r=e,new oA({type:"nonoptional",innerType:t,...aw.normalizeParams(r)})},array(){return function(e){return new og({type:"array",element:e,...nA(void 0)})}(this)},or(e){return new ob({type:"union",options:[this,e],...aw.normalizeParams(void 0)})},and(e){var t;return t=this,new ov({type:"intersection",left:t,right:e})},transform(e){return oC(this,new ow({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new oT({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():aw.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new oR({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():aw.shallowClone(r)}})},catch(e){var t,r;return t=this,new oP({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return oC(this,e)},readonly(){var e;return e=this,new oI({type:"readonly",innerType:e})},describe(e){let t=this.clone();return au.add(t,{description:e}),t},meta(...e){if(0===e.length)return au.get(this);let t=this.clone();return au.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>au.get(e)?.description,configurable:!0}),e)),aX=ni("_ZodString",(e,t)=>{sn.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{r.type="string";let{minimum:i,maximum:s,format:a,patterns:o,contentEncoding:l}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof s&&(r.maxLength=s),a&&(r.format=aT[a]??a,""===r.format&&delete r.format,"time"===a&&delete r.format),l&&(r.contentEncoding=l),o&&o.size>0){let e=[...o];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r,0);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,aW(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new iG({check:"string_format",format:"regex",...nA(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new iX({check:"string_format",format:"includes",...nA(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new iZ({check:"string_format",format:"starts_with",...nA(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new iY({check:"string_format",format:"ends_with",...nA(t),suffix:e})}(...e))},min(...e){return this.check(ab(...e))},max(...e){return this.check(ay(...e))},length(...e){return this.check(av(...e))},nonempty(...e){return this.check(ab(1,...e))},lowercase(e){return this.check(new iW({check:"string_format",format:"lowercase",...nA(e)}))},uppercase(e){return this.check(new iK({check:"string_format",format:"uppercase",...nA(e)}))},trim(){return this.check(a_(e=>e.trim()))},normalize(...e){return this.check(function(e){return a_(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(a_(e=>e.toLowerCase()))},toUpperCase(){return this.check(a_(e=>e.toUpperCase()))},slugify(){return this.check(a_(e=>n_(e)))}})}),aZ=ni("ZodString",(e,t)=>{sn.init(e,t),aX.init(e,t),e.email=t=>e.check(new aJ({type:"string",format:"email",check:"string_format",abort:!1,...nA(t)})),e.url=t=>e.check(new a1({type:"string",format:"url",check:"string_format",abort:!1,...nA(t)})),e.jwt=t=>e.check(new oa({type:"string",format:"jwt",check:"string_format",abort:!1,...nA(t)})),e.emoji=t=>e.check(new a2({type:"string",format:"emoji",check:"string_format",abort:!1,...nA(t)})),e.guid=t=>e.check(ad(aQ,t)),e.uuid=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,...nA(t)})),e.uuidv4=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...nA(t)})),e.uuidv6=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...nA(t)})),e.uuidv7=t=>e.check(new a0({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...nA(t)})),e.nanoid=t=>e.check(new a4({type:"string",format:"nanoid",check:"string_format",abort:!1,...nA(t)})),e.guid=t=>e.check(ad(aQ,t)),e.cuid=t=>e.check(new a9({type:"string",format:"cuid",check:"string_format",abort:!1,...nA(t)})),e.cuid2=t=>e.check(new a3({type:"string",format:"cuid2",check:"string_format",abort:!1,...nA(t)})),e.ulid=t=>e.check(new a6({type:"string",format:"ulid",check:"string_format",abort:!1,...nA(t)})),e.base64=t=>e.check(new on({type:"string",format:"base64",check:"string_format",abort:!1,...nA(t)})),e.base64url=t=>e.check(new oi({type:"string",format:"base64url",check:"string_format",abort:!1,...nA(t)})),e.xid=t=>e.check(new a5({type:"string",format:"xid",check:"string_format",abort:!1,...nA(t)})),e.ksuid=t=>e.check(new a7({type:"string",format:"ksuid",check:"string_format",abort:!1,...nA(t)})),e.ipv4=t=>e.check(new a8({type:"string",format:"ipv4",check:"string_format",abort:!1,...nA(t)})),e.ipv6=t=>e.check(new oe({type:"string",format:"ipv6",check:"string_format",abort:!1,...nA(t)})),e.cidrv4=t=>e.check(new ot({type:"string",format:"cidrv4",check:"string_format",abort:!1,...nA(t)})),e.cidrv6=t=>e.check(new or({type:"string",format:"cidrv6",check:"string_format",abort:!1,...nA(t)})),e.e164=t=>e.check(new os({type:"string",format:"e164",check:"string_format",abort:!1,...nA(t)})),e.datetime=t=>e.check(new aA({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...nA(t)})),e.date=t=>e.check(new aP({type:"string",format:"date",check:"string_format",...nA(t)})),e.time=t=>e.check(new aN({type:"string",format:"time",check:"string_format",precision:null,...nA(t)})),e.duration=t=>e.check(new aC({type:"string",format:"duration",check:"string_format",...nA(t)}))}),aY=ni("ZodStringFormat",(e,t)=>{si.init(e,t),aX.init(e,t)}),aJ=ni("ZodEmail",(e,t)=>{so.init(e,t),aY.init(e,t)}),aQ=ni("ZodGUID",(e,t)=>{ss.init(e,t),aY.init(e,t)}),a0=ni("ZodUUID",(e,t)=>{sa.init(e,t),aY.init(e,t)}),a1=ni("ZodURL",(e,t)=>{sl.init(e,t),aY.init(e,t)}),a2=ni("ZodEmoji",(e,t)=>{sc.init(e,t),aY.init(e,t)}),a4=ni("ZodNanoID",(e,t)=>{su.init(e,t),aY.init(e,t)}),a9=ni("ZodCUID",(e,t)=>{sd.init(e,t),aY.init(e,t)}),a3=ni("ZodCUID2",(e,t)=>{sh.init(e,t),aY.init(e,t)}),a6=ni("ZodULID",(e,t)=>{sf.init(e,t),aY.init(e,t)}),a5=ni("ZodXID",(e,t)=>{sp.init(e,t),aY.init(e,t)}),a7=ni("ZodKSUID",(e,t)=>{sm.init(e,t),aY.init(e,t)}),a8=ni("ZodIPv4",(e,t)=>{s_.init(e,t),aY.init(e,t)}),oe=ni("ZodIPv6",(e,t)=>{sw.init(e,t),aY.init(e,t)}),ot=ni("ZodCIDRv4",(e,t)=>{sE.init(e,t),aY.init(e,t)}),or=ni("ZodCIDRv6",(e,t)=>{sx.init(e,t),aY.init(e,t)}),on=ni("ZodBase64",(e,t)=>{sO.init(e,t),aY.init(e,t)}),oi=ni("ZodBase64URL",(e,t)=>{sk.init(e,t),aY.init(e,t)}),os=ni("ZodE164",(e,t)=>{sT.init(e,t),aY.init(e,t)}),oa=ni("ZodJWT",(e,t)=>{sR.init(e,t),aY.init(e,t)}),oo=ni("ZodNumber",(e,t)=>{sA.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:s,format:a,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:c}=e._zod.bag;"string"==typeof a&&a.includes("int")?r.type="integer":r.type="number";let u="number"==typeof c&&c>=(i??-1/0),d="number"==typeof l&&l<=(s??1/0),h="draft-04"===t.target||"openapi-3.0"===t.target;u?h?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof i&&(r.minimum=i),d?h?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:"number"==typeof s&&(r.maximum=s),"number"==typeof o&&(r.multipleOf=o)})(e,t,r,0),aW(e,"ZodNumber",{gt(e,t){return this.check(ap(e,t))},gte(e,t){return this.check(am(e,t))},min(e,t){return this.check(am(e,t))},lt(e,t){return this.check(ah(e,t))},lte(e,t){return this.check(af(e,t))},max(e,t){return this.check(af(e,t))},int(e){return this.check(oc(e))},safe(e){return this.check(oc(e))},positive(e){return this.check(ap(0,e))},nonnegative(e){return this.check(am(0,e))},negative(e){return this.check(ah(0,e))},nonpositive(e){return this.check(af(0,e))},multipleOf(e,t){return this.check(ag(e,t))},step(e,t){return this.check(ag(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null}),ol=ni("ZodNumberFormat",(e,t)=>{sP.init(e,t),oo.init(e,t)});function oc(e){return new ol({type:"number",check:"number_format",abort:!1,format:"safeint",...nA(e)})}let ou=ni("ZodBoolean",(e,t)=>{sN.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}}),od=ni("ZodBigInt",(e,t)=>{sC.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,r)=>e.check(am(t,r)),e.min=(t,r)=>e.check(am(t,r)),e.gt=(t,r)=>e.check(ap(t,r)),e.gte=(t,r)=>e.check(am(t,r)),e.min=(t,r)=>e.check(am(t,r)),e.lt=(t,r)=>e.check(ah(t,r)),e.lte=(t,r)=>e.check(af(t,r)),e.max=(t,r)=>e.check(af(t,r)),e.positive=t=>e.check(ap(BigInt(0),t)),e.negative=t=>e.check(ah(BigInt(0),t)),e.nonpositive=t=>e.check(af(BigInt(0),t)),e.nonnegative=t=>e.check(am(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(ag(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),oh=ni("ZodUnknown",(e,t)=>{sI.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function of(){return new oh({type:"unknown"})}let op=ni("ZodNever",(e,t)=>{sD.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),om=ni("ZodDate",(e,t)=>{sL.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,r)=>e.check(am(t,r)),e.max=(t,r)=>e.check(af(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),og=ni("ZodArray",(e,t)=>{sj.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=ax(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,aW(e,"ZodArray",{min(e,t){return this.check(ab(e,t))},nonempty(e){return this.check(ab(1,e))},max(e,t){return this.check(ay(e,t))},length(e,t){return this.check(av(e,t))},unwrap(){return this.element}})}),oy=ni("ZodObject",(e,t)=>{sq.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object",r.properties={};let s=i.shape;for(let e in s)r.properties[e]=ax(s[e],t,{...n,path:[...n.path,"properties",e]});let a=new Set([...new Set(Object.keys(s))].filter(e=>{let r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));a.size>0&&(r.required=Array.from(a)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=ax(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),aw.defineLazy(e,"shape",()=>t.shape),aW(e,"ZodObject",{keyof(){var e;return new o_({type:"enum",entries:Array.isArray(e=Object.keys(this._zod.def.shape))?Object.fromEntries(e.map(e=>[e,e])):e,...aw.normalizeParams(void 0)})},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:of()})},loose(){return this.clone({...this._zod.def,catchall:of()})},strict(){return this.clone({...this._zod.def,catchall:new op({type:"never",...nA(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return aw.extend(this,e)},safeExtend(e){return aw.safeExtend(this,e)},merge(e){return aw.merge(this,e)},pick(e){return aw.pick(this,e)},omit(e){return aw.omit(this,e)},partial(...e){return aw.partial(oE,this,e[0])},required(...e){return aw.required(oA,this,e[0])}})}),ob=ni("ZodUnion",(e,t)=>{sH.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,s,a,o;let l,c,u;return i=e,s=t,a=r,o=n,c=!1===(l=i._zod.def).inclusive,u=l.options.map((e,t)=>ax(e,s,{...o,path:[...o.path,c?"oneOf":"anyOf",t]})),void(c?a.oneOf=u:a.anyOf=u)},e.options=t.options}),ov=ni("ZodIntersection",(e,t)=>{sG.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a,o;return s=ax((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=ax(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...o(a)?a.allOf:[a]])}}),o_=ni("ZodEnum",(e,t)=>{s0.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;(i=nc(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new o_({...t,checks:[],...aw.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new o_({...t,checks:[],...aw.normalizeParams(n),entries:i})}}),ow=ni("ZodTransform",(e,t)=>{s1.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new na(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(aw.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(aw.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}}),oE=ni("ZodOptional",(e,t)=>{s4.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>aR(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new oE({type:"optional",innerType:e})}let oS=ni("ZodExactOptional",(e,t)=>{s9.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>aR(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),oO=ni("ZodNullable",(e,t)=>{s3.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=ax((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function ok(e){return new oO({type:"nullable",innerType:e})}let oT=ni("ZodDefault",(e,t)=>{s6.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),oR=ni("ZodPrefault",(e,t)=>{s7.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),oA=ni("ZodNonOptional",(e,t)=>{s8.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),oP=ni("ZodCatch",(e,t)=>{at.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,s=e._zod.def;ax(s.innerType,t,n),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),oN=ni("ZodPipe",(e,t)=>{ar.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,s,a;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(ax(a="input"===t.io?s?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function oC(e,t){return new oN({type:"pipe",in:e,out:t})}let oI=ni("ZodReadonly",(e,t)=>{aa.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;ax((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),oD=ni("ZodCustom",(e,t)=>{al.init(e,t),aK.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});e.s(["bigint",0,function(e){return new od({type:"bigint",coerce:!0,...nA(e)})},"boolean",0,function(e){return new ou({type:"boolean",coerce:!0,...nA(e)})},"date",0,function(e){return new om({type:"date",coerce:!0,...nA(e)})},"number",0,function(e){return new oo({type:"number",coerce:!0,checks:[],...nA(e)})},"string",0,function(e){return new aZ({type:"string",coerce:!0,...nA(e)})}],52982);var oL=e.i(52982),oL=oL;let oM=e=>(t,r,n)=>{let i=function(e,t){let r={};for(let[n,i]of rM(t.headers?.get("cookie")||""))n.startsWith(e)&&(r[n]=i);return r}(t,n),s=n.context.logger,a=()=>{let e=function(e,t){let r={};for(let n in e)r[n]={name:n,value:"",attributes:{...t,maxAge:0}};return r}(i,r);for(let e in i)delete i[e];return e};return{chunk(n,o){let l=a();for(let a of function(e,t,r,n){let i=4050-r5(`${t.name}.99`,"",{...t.attributes}).length,s=i>0?Math.ceil(t.value.length/i):1/0;if(s<=1)return r[t.name]=t.value,[t];if(s>100)return n.warn(`${e} cookie is too large to store even after chunking, so the cache was skipped. Reduce the cached data or use a database session.`),[];let a=[];for(let e=0;e<s;e++){let n=`${t.name}.${e}`,s=e*i,o=t.value.substring(s,s+i);a.push({...t,name:n,value:o}),r[n]=o}return n.debug(`CHUNKING_${e.toUpperCase()}_COOKIE`,{message:`${e} cookie exceeds the 4050 byte limit and was split into ${s} chunks.`,valueSize:t.value.length,chunkCount:s,chunkSizes:a.map(e=>e.value.length)}),a}(e,{name:t,value:n,attributes:{...r,...o}},i,s))l[a.name]=a;return Object.values(l)},clean:()=>Object.values(a()),setCookies(e){for(let t of e)n.setCookie(t.name,t.value,t.attributes)}}};oM("Session"),oM("Account"),ox(new oy({type:"object",shape:{disableCookieCache:oL.boolean().meta({description:"Disable cookie cache and fetch session from database"}).optional(),disableRefresh:oL.boolean().meta({description:"Disable session refresh. Useful for checking session status, without updating the session"}).optional()}??{},...aw.normalizeParams(void 0)})),new TextEncoder().encode;let oj=(e,t)=>{let r=(e instanceof Headers||!("headers"in e)?e:e.headers).get("cookie");if(!r)return null;let{cookieName:n="session_token",cookiePrefix:i="better-auth"}=t||{},s=rM(r),a=e=>s.get(`__Secure-${e}`)??s.get(e),o=a(`${i}.${n}`)||a(`${i}-${n}`);return o||null};var o$=e.i(90133),oz=e.i(50227);e.i(73539),e.i(54799),e.i(24868);var oU=e.i(46786),oB=e.i(14747),oq=[{name:"docker",kind:"local",label:"Docker (local)",loginHint:"builds a ~1GB local image; no login needed",rebuildMinutes:"1",blurb:"local Docker containers",sizeDesc:"Per-provider override of `box.size` for docker. Reserved — docker sizing is controlled via `box.memory` / `box.cpus` / `box.disk`.",imageDesc:"Per-provider override of `box.image` for docker (local docker image ref, e.g. `agentbox/box:dev`). Wins over the generic when set."},{name:"daytona",kind:"cloud",label:"Daytona (cloud sandbox)",loginHint:"approve a browser sign-in link",rebuildMinutes:"7",blurb:"Daytona Cloud sandboxes",sizeDesc:"Per-provider override of `box.size` for daytona. `cpu-memory-disk` GB spec (e.g. `4-8-20`). Only honored on the image/Dockerfile create path; on the snapshot path the size is fixed at bake time (Daytona rejects custom resources on snapshot-resume).",imageDesc:"Per-provider override of `box.image` for daytona (named snapshot, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider daytona`."},{name:"hetzner",kind:"cloud",label:"Hetzner (cloud VPS)",loginHint:"paste an API token from the Hetzner Console",rebuildMinutes:"7-10",blurb:"Hetzner Cloud VPSes",sizeDesc:"Per-provider override of `box.size` for hetzner. Server type string (e.g. `cx23`, `cx33`, `cx43`).",imageDesc:"Per-provider override of `box.image` for hetzner (image description, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider hetzner`."},{name:"vercel",kind:"cloud",label:"Vercel (cloud microVM)",loginHint:"installs the Vercel sandbox CLI, then a browser sign-in",rebuildMinutes:"5-10",blurb:"Vercel Sandboxes",sizeDesc:"Per-provider override of `box.size` for vercel. vCPU count — one of `1`, `2`, `4`, `8` (Vercel couples RAM at 2048 MB/vCPU). Default 2.",imageDesc:"Per-provider override of `box.image` for vercel (snapshot id, e.g. `snap_…`). Written by `agentbox prepare --provider vercel`."},{name:"e2b",kind:"cloud",label:"E2B (cloud microVM)",loginHint:"paste an API key from the E2B dashboard",rebuildMinutes:"2",blurb:"E2B microVMs",sizeDesc:"Per-provider override of `box.size` for e2b. `cpu-memory` GB spec (e.g. `4-8`). Template-level: baked by `agentbox prepare --provider e2b --size <spec>`; E2B rejects per-create resources.",imageDesc:"Per-provider override of `box.image` for e2b (template id or `name:tag`, e.g. `agentbox-base:latest`). Written by `agentbox prepare --provider e2b`."},{name:"digitalocean",kind:"cloud",label:"DigitalOcean (cloud VPS)",loginHint:"paste a Personal Access Token from the DigitalOcean Console",rebuildMinutes:"7-10",blurb:"DigitalOcean Droplets",sizeDesc:"Per-provider override of `box.size` for digitalocean. Droplet size slug (e.g. `s-2vcpu-4gb`, `s-4vcpu-8gb`).",imageDesc:"Per-provider override of `box.image` for digitalocean (numeric snapshot id). Written by `agentbox prepare --provider digitalocean`."}],oF=oq.map(e=>e.name);function oH(e,t){return`box.${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}oq.filter(e=>"cloud"===e.kind).map(e=>e.name);var oV=[{key:"box.provider",type:"enum",enumValues:oF,description:`Sandbox backend new boxes are created on: ${(ei=oq.map(e=>e.blurb)).length<=1?ei.join(""):`${ei.slice(0,-1).join(", ")}, or ${ei[ei.length-1]}`}.`},{key:"box.hostSnapshot",type:"bool",description:"Use a frozen APFS clone of the host workspace as the overlay lower (default: prompt). Was box.snapshot."},{key:"box.defaultCheckpoint",type:"string",description:"Checkpoint ref new boxes in this project start from when --snapshot is not given (set via `agentbox checkpoint set-default`). Used as fallback when no per-provider override is set."},...oq.map(e=>({key:oH("defaultCheckpoint",e.name),type:"string",description:`Per-provider override of \`box.defaultCheckpoint\` for ${e.name}. Wins over the global when set; set via \`agentbox checkpoint set-default --provider ${e.name}\`.`,advanced:!0})),{key:"box.size",type:"string",description:"Default VM size for cloud providers. Provider-interpreted: hetzner = server type (e.g. `cx33`); daytona = `cpu-memory-disk` GB (e.g. `4-8-20`); vercel = vCPU count (1, 2, 4, 8); e2b = `cpu-memory` GB (e.g. `4-8`). Used as fallback when no per-provider override is set. Docker ignores it."},...oq.map(e=>({key:oH("size",e.name),type:"string",description:e.sizeDesc,advanced:!0})),{key:"checkpoint.maxLayers",type:"int",description:"Max stacked checkpoint layers before a new checkpoint is materialized merged (flattened) instead of layered.",advanced:!0},{key:"box.withPlaywright",type:"bool",description:"Install @playwright/cli@latest in the box at create time."},{key:"box.claudeInstall",type:"enum",enumValues:["native","npm"],description:"How `agentbox prepare` installs Claude Code into the base image/snapshot: `native` (Anthropic's installer, the default) or `npm` (@anthropic-ai/claude-code). A fallback for cloud egress IPs the native installer's CDN 403s. Bake-time only — change it, then re-run `agentbox prepare --provider <name>`."},{key:"box.withEnv",type:"bool",description:"Copy host env/config files (.env*, secrets.toml, agentbox.yaml, ...) into /workspace at box create time (gitignore-bypassing)."},{key:"box.resyncOnStart",type:"bool",description:"Merge the host's current branch into the box and overlay the host's uncommitted/untracked changes when starting an agent session (keeps the box's version on conflict and warns the agent)."},{key:"box.vnc",type:"bool",description:"Run the per-box Xvnc + noVNC stack."},{key:"box.autoApproveHostActions",type:"bool",description:"Auto-approve host-action confirmations (git push, cp host<->box, gh PR writes, checkpoint) for this box without an interactive prompt. Off by default; intended for unattended orchestration of trusted boxes. Each auto-approval is recorded as a relay event (visible in `agentbox agent` / the dashboard)."},{key:"box.autoApproveSafeHostActions",type:"bool",description:"Auto-approve the SAFE subset of host actions without a prompt: opening a PR, PR/review comments, re-running CI, pushing to the box's scratch or host-sanctioned branch, checkpoints, integration writes, and file copy/download that stays inside the box project folder (non-secret). Uncontained or secret file transfers, non-sanctioned-branch pushes, and PR merge/checkout still prompt. On by default; set false to prompt for every host action (the pre-relax behavior). Superseded by box.autoApproveHostActions, which approves everything. Each auto-approval is recorded as a relay event."},{key:"box.isolateClaudeConfig",type:"bool",description:"Use a per-box ~/.claude volume instead of the shared one."},{key:"box.isolateCodexConfig",type:"bool",description:"Use a per-box ~/.codex volume instead of the shared one."},{key:"box.isolateOpencodeConfig",type:"bool",description:"Use a per-box OpenCode config/data volume instead of the shared one."},{key:"box.image",type:"string",description:"Generic box image ref (fallback). Used as fallback when no per-provider override is set; the default `agentbox/box:dev` is treated as a sentinel by cloud backends (boot from their prepared base snapshot instead).",advanced:!0},...oq.map(e=>({key:oH("image",e.name),type:"string",description:e.imageDesc,advanced:!0})),{key:"box.imageRegistry",type:"string",description:"Registry repo to pull the prebuilt docker base image from before building locally. Empty = always build. Docker only (advanced).",advanced:!0},{key:"box.dockerCacheShared",type:"bool",description:"Share the in-box docker image cache across boxes via the 'agentbox-docker-cache' volume (preserved on destroy/prune; only one box can run at a time when set)."},{key:"box.memory",type:"int",description:"Hard memory ceiling in MiB for new boxes (0 = unlimited). Use --memory on create/claude for byte/k/m/g strings."},{key:"box.cpus",type:"int",description:"CPU count cap for new boxes (0 = unlimited). Whole cores via config; use --cpus for fractional (e.g. 1.5)."},{key:"box.pidsLimit",type:"int",description:"Max process count (PIDs cgroup) for new boxes (0 = unlimited)."},{key:"box.disk",type:"string",description:"Best-effort writable-layer size for new boxes, e.g. '10G'. No-op on overlay2 / the macOS engines.",advanced:!0},{key:"box.bundleDepth",type:"int",description:"Cap git bundle history shipped to cloud sandboxes (daytona, hetzner). 0 = full history. Unset = adaptive default (last 200 commits; re-bundle at 100 if the bundle exceeds 20 MB). Ignored for docker (which bind-mounts .git/)."},{key:"box.hetznerLocation",type:"string",description:"Hetzner datacenter location new --provider hetzner boxes are created in (e.g. `nbg1`, `fsn1`, `hel1`, `ash`). Default `nbg1`. Overridable per-create with `--location`. Hetzner-only; ignored by other providers."},{key:"box.digitaloceanRegion",type:"string",description:"DigitalOcean region new --provider digitalocean boxes are created in (e.g. `nyc3`, `nyc1`, `sfo3`, `ams3`, `fra1`). Default `nyc3`. Overridable per-create with `--location`. DigitalOcean-only; ignored by other providers."},{key:"box.digitaloceanProject",type:"string",description:"DigitalOcean Project new --provider digitalocean boxes are placed in — a name or the project's UUID. Unset (the default) leaves boxes in the account's default project. Set it per repo via `agentbox.yaml`, or globally at `agentbox digitalocean login`. DigitalOcean-only; ignored by other providers."},{key:"box.vercelTimeoutMs",type:"int",description:"Max session length (ms) for new --provider vercel boxes before the VM auto-snapshots; persistent mode auto-resumes on the next call. Default 2700000 (45 min, the Hobby ceiling). Vercel-only."},{key:"box.e2bTimeoutMs",type:"int",description:"Session timeout (ms) a new --provider e2b box is created with, before E2B auto-pauses it on inactivity. The host keepalive loop pushes this forward while the agent is working. Default 2700000 (45 min); the Hobby tier caps total session at ~1 h regardless. E2B-only."},{key:"box.cpMaxBytes",type:"int",description:"Max bytes a single host→box copy may transfer after excludes, shared by `agentbox cp` (blocked with a size breakdown unless --yes) and each `carry:` entry (rejected at resolve time). Default 104857600 (100 MiB).",advanced:!0},{key:"box.credentialSync",type:"bool",description:"Automatically sync refreshed agent credentials (claude/codex/opencode) from boxes to the host backup and out to all other running boxes. Claude OAuth refresh rotates the refresh token, so without this every other copy 401s after any box refreshes. Default true; --no-credential-sync at create disables the in-box watcher for that box."},{key:"box.inbound",type:"string",description:"Inbound-access policy for VPS boxes (hetzner, digitalocean per-box firewall). `locked` (default) = SSH reachable only from your host's egress IP; `open` = SSH reachable from anywhere (0.0.0.0/0, key-only — to drive a box from a phone with the laptop off); a CIDR list (e.g. `203.0.113.5/32`) = host egress plus those. Override per box with `--inbound` or after create with `agentbox inbound <box>`. Ignored by non-VPS providers."},{key:"box.vercelNetworkPolicy",type:"string",description:"Egress lock for new --provider vercel boxes: 'allow-all' (default, unset), 'deny-all', or a comma-separated domain allowlist (e.g. 'github.com,*.npmjs.org') that denies everything else. Vercel-only; ignored by other providers."},{key:"claude.sessionName",type:"string",description:"tmux session name for `agentbox claude`."},{key:"claude.dangerouslySkipPermissions",type:"bool",description:"Launch claude in new boxes with --dangerously-skip-permissions (auto-accept tool use). Safe because boxes are isolated; on by default. Override per-box with --no-dangerously-skip-permissions."},{key:"codex.sessionName",type:"string",description:"tmux session name for `agentbox codex`."},{key:"codex.dangerouslySkipPermissions",type:"bool",description:"Launch codex in new boxes with --dangerously-bypass-approvals-and-sandbox (never prompt for approval). Safe because boxes are isolated; on by default. Override per-box with --no-dangerously-skip-permissions."},{key:"opencode.sessionName",type:"string",description:"tmux session name for `agentbox opencode`."},{key:"attach.openIn",type:"enum",enumValues:["split","window","tab","same"],description:"Where `agentbox claude|codex|opencode` opens the attached session when run from tmux, cmux, Herdr, or iTerm2: `split` (tmux split-window / cmux new-split / Herdr pane.split / iTerm2 vertical split, default — same workspace), `window` (tmux new-window / cmux new-workspace / Herdr workspace.create / new iTerm2 window), `tab` (tmux new-window / cmux new-surface / Herdr tab.create in the current workspace / new iTerm2 tab), or `same` (attach inline in the current terminal). Outside tmux/cmux/Herdr/iTerm2 every value behaves like `same`."},{key:"attach.cmuxStatus",type:"bool",description:"When attached inside cmux, reflect the box agent's live activity on its cmux workspace (colour + description: blue=working, amber=needs input, idle clears; restored on detach) and, when the agent needs input, flag the box's own tab via a cmux notification (tab badge + reorder + desktop notification) so it stands out among sibling tabs. cmux only; no-op in other terminals."},{key:"attach.herdrStatus",type:"bool",description:"When attached inside Herdr, report the box agent's live activity to its Herdr pane (pane.report_agent: working / blocked / idle) so it looks like a normal agent pane and Herdr handles needs-input natively, and fire a Herdr notification for AgentBox's own host-relay approval prompts (git push / PR / checkpoint …) which Herdr can't otherwise see. Herdr only; no-op in other terminals."},{key:"code.ide",type:"enum",enumValues:["vscode","cursor","auto"],description:'Which IDE `agentbox code` launches; "auto" prefers code, falls back to cursor.'},{key:"code.wait",type:"bool",description:"Block on agentbox-ctl wait-ready before opening the IDE."},{key:"code.timeoutMs",type:"int",description:"wait-ready timeout in milliseconds."},{key:"code.autoTerminals",type:"bool",description:"Generate /workspace/.vscode/tasks.json so the IDE auto-opens log panels."},{key:"shell.user",type:"string",description:"Default in-container user for `agentbox shell`."},{key:"shell.login",type:"bool",description:"Pass `-l` to bash so the login profile loads."},{key:"shell.tmux",type:"bool",description:"Run `agentbox shell` inside a detachable tmux session (Ctrl+a d to detach)."},{key:"ssh.autoConfig",type:"bool",description:"Automatically write a `~/.agentbox/ssh/config` entry (Include'd from `~/.ssh/config`) for SSH-capable cloud boxes on create and start/resume, so `ssh <box>` just works. On by default; set false if you manage `~/.ssh/config` yourself. Explicit `agentbox shell --ssh-config`/`code`/`open` still write on demand regardless."},{key:"engine.kind",type:"enum",enumValues:["orbstack","docker-desktop","other","auto"],description:"Override the docker-engine auto-detection (used for OrbStack-only optimisations)."},{key:"browser.default",type:"enum",enumValues:["agent-browser","playwright","both"],description:'Default browser stack inside the box. "playwright" or "both" implies box.withPlaywright.'},{key:"relay.port",type:"int",description:"Host relay TCP port (advanced).",advanced:!0},{key:"relay.controlPlaneUrl",type:"string",description:"Public HTTPS URL of a deployed control plane (hosted Next.js + Postgres app). When set, new cloud boxes point at it for git-token leasing, permission state, and the box registry/events, and push to GitHub directly with a leased token so they keep working with the laptop off. Set via `agentbox control-plane set-url`."},{key:"git.pushMode",type:"enum",enumValues:["auto","relay","lease","direct"],description:"How a box's `git push` reaches GitHub: `relay` (the host relay pushes with your host credentials — they never enter the box), `lease` (the relay/plane leases a short-lived GitHub-App token and the box pushes directly, so it works with the laptop off), `direct` (the box holds a COPY of your git credentials and pushes/pulls/signs entirely on its own — needs no host or hub, but the credentials live inside the box and its snapshots; set via `--with-credentials`, which copies them in behind a confirmation), or `auto` (default — lease when `relay.controlPlaneUrl` is set for the box, else relay). Only affects cloud boxes; docker boxes always use `relay`. Forcing `relay` needs a reachable host relay for the box; forcing `lease` needs a reachable relay/plane with a GitHub App; `direct` needs credentials to have been copied into the box at create time."},{key:"vnc.containerPort",type:"int",description:"Container-side noVNC port (advanced).",advanced:!0},{key:"portless.enabled",type:"bool",description:"Map each box web app to a https://<box-name>.localhost URL via the Portless proxy (Docker Desktop only; OrbStack already has .orb.local). Default: prompt."},{key:"portless.stateDir",type:"string",description:"Host Portless state directory to share into boxes (advanced; default: Portless’s own location).",advanced:!0},{key:"autopause.enabled",type:"bool",description:"Let the host relay periodically pause idle boxes when more than autopause.maxRunningBoxes are running."},{key:"autopause.maxRunningBoxes",type:"int",description:"Target maximum number of simultaneously-running boxes before idle ones get auto-paused."},{key:"autopause.idleMinutes",type:"int",description:"Minutes a box must be continuously idle (claude state) before it is eligible for auto-pause."},{key:"queue.enabled",type:"bool",description:"Run `agentbox claude|codex|opencode -i <prompt>` jobs through the host-wide background queue (FIFO, capped by queue.maxConcurrent)."},{key:"queue.maxConcurrent",type:"int",description:"Max number of simultaneously-running boxes (across providers) before background `-i` jobs queue up instead of starting immediately. Per-invocation override: `--max-running <n>`."},{key:"queue.maxWorking",type:"int",description:"Max agents actively working/thinking (quota-consuming) at once before background `-i` jobs queue. 0 = disabled (use the queue.maxConcurrent running-box gate). Counts all boxes, foreground + queued. Per-invocation override: `--max-working <n>`."},{key:"queue.idleGraceSeconds",type:"int",description:"Seconds an agent must stay non-working before it frees its working slot (debounce against brief idle flaps between turns). Only used when queue.maxWorking > 0."},{key:"queue.openIn",type:"enum",enumValues:["none","split","window","tab"],description:"When a background `-i` job finishes creating its box, where the host relay opens an attached terminal onto it: `none` (default — open nothing, just queue), `split`, `window`, or `tab`. Honored only when the submitting shell runs inside tmux, cmux, Herdr, or iTerm2 (the targeting is captured at submit time). Under cmux, `split` splits the pane you submitted from (falling back to the parent workspace, then a new workspace), `tab` adds a tab in the parent workspace, and `window` opens a separate workspace; under Herdr, `split` splits the pane you submitted from, `tab` adds a tab in the parent workspace, and `window` opens a separate workspace; iTerm2 opens relative to the frontmost window. Unlike `attach.openIn` there is no `same` mode — the box is created asynchronously, so it is always a fresh terminal."},{key:"cloud.useCurrentBranch",type:"bool",description:"On cloud providers (daytona/hetzner), start new boxes on the host's current branch instead of forking a new agentbox/<box-name> branch. Overridden by an explicit --use-branch / --from-branch."},{key:"maintenance.pruneProjectConfigs",type:"bool",description:"Periodically delete ~/.agentbox/projects/<hash>/ dirs whose source workspace folder no longer exists."},{key:"maintenance.pruneProjectConfigsEvery",type:"int",description:"Run the orphan project-config sweep every N successful `agentbox create`."},{key:"update.check",type:"bool",description:'Daily background check for a newer published agentbox (npm registry) and menu-bar app (release sha sidecar), plus the "newer version available" nudge. At most one network probe per 24h; false disables both.'},{key:"integrations.notion.enabled",type:"bool",description:'Enable the in-box Notion integration shim (`ntn`/`notion` commands routed via the host relay). When false (default), the relay refuses dispatch with a clear "disabled" error and no host process is touched.'},{key:"integrations.linear.enabled",type:"bool",description:'Enable the in-box Linear integration shim (`linear` commands routed via the host relay; backed by `@schpet/linear-cli`). When false (default), the relay refuses dispatch with a clear "disabled" error and no host process is touched.'}];oV.map(e=>[e.key,e]),(()=>{let e=new Map;for(let t of oV){let r=t.key.indexOf(".");if(r<0)throw Error(`KEY_REGISTRY entry ${t.key} must use dot-path form (branch.leaf)`);let n=t.key.slice(0,r),i=t.key.slice(r+1),s=e.get(n);s||(s={name:n,leaves:new Map},e.set(n,s)),s.leaves.set(i,t)}})();var oG=(0,oB.join)((0,oU.homedir)(),".agentbox");(0,oB.join)(oG,"config.yaml");var oW=(0,oB.join)(oG,"projects");(0,oB.join)(oW,".gc.json"),(0,oz.join)(oG,"hub","auth.db"),(0,oz.join)(oG,"hub","token");let oK="agentbox_hub_token";function oX(e,t){let r=Buffer.from(e),n=Buffer.from(t);return r.length===n.length&&(0,ro.timingSafeEqual)(r,n)}let oZ=new Set(["/api/v1/health","/api/v1/openapi.json","/api/v1/docs"]);function oY(){return o$.NextResponse.json({error:{code:"unauthorized",message:"Missing or invalid credentials. Send Authorization: Bearer <hub token>."}},{status:401})}e.s(["config",0,{matcher:["/((?!api/auth|signin|healthz|admin|rpc|events|bridge|remote|_next/static|_next/image|favicon.ico).*)"]},"proxy",0,function(e){let t,r="off"===process.env.AGENTBOX_HUB_AUTH?"off":"localhost"===("hetzner"===(t=process.env.AGENTBOX_HUB_PROFILE)||"vercel"===t?t:"localhost")?process.env.AGENTBOX_HUB_TOKEN?"token":"off":"off"!==process.env.AGENTBOX_HUB_AUTH&&("on"===process.env.AGENTBOX_HUB_AUTH||process.env.BETTER_AUTH_SECRET)?"password":"off";if("off"===r)return o$.NextResponse.next();if(e.nextUrl.pathname.startsWith("/api/v1"))return function(e,t){if(oZ.has(e.nextUrl.pathname))return o$.NextResponse.next();if("token"===t){let t,r,n=process.env.AGENTBOX_HUB_TOKEN??"";if(!n)return oY();let i=(r=(t=e.headers.get("authorization"))?/^Bearer\s+(.+)$/i.exec(t):null)?r[1].trim():null;if(i&&oX(i,n))return o$.NextResponse.next();let s=e.cookies.get(oK)?.value;return s&&oX(s,n)?o$.NextResponse.next():oY()}return oj(e)?o$.NextResponse.next():oY()}(e,r);if("token"===r){let t=process.env.AGENTBOX_HUB_TOKEN??"",r=e.nextUrl.searchParams.get("token");if(r&&t&&oX(r,t)){let r=e.nextUrl.clone();r.searchParams.delete("token");let n=o$.NextResponse.redirect(r);return n.cookies.set(oK,t,{httpOnly:!0,sameSite:"lax",secure:!1,path:"/",maxAge:2592e3}),n}let n=e.cookies.get(oK)?.value;return n&&t&&oX(n,t)?o$.NextResponse.next():new o$.NextResponse("AgentBox hub is locked. Open it with `agentbox hub`.",{status:401,headers:{"content-type":"text/plain"}})}return oj(e)?o$.NextResponse.next():o$.NextResponse.redirect(new URL("/signin?returnUrl="+e.nextUrl.pathname,e.url))}],77826);let oJ={...e.i(77826)},oQ="/proxy",o0=oJ.proxy||oJ.default;if("function"!=typeof o0)throw new class extends Error{constructor(e){super(e),this.stack=""}}(`The Proxy file "${oQ}" must export a function named \`proxy\` or a default function.`);let o1=e=>tR({...e,IncrementalCache:ra,incrementalCacheHandler:null,page:oQ,handler:async(...e)=>{try{return await o0(...e)}catch(i){let t=e[0],r=new URL(t.url),n=r.pathname+r.search;throw await c(i,{path:n,method:t.method,headers:Object.fromEntries(t.headers.entries())},{routerKind:"Pages Router",routePath:"/proxy",routeType:"proxy",revalidateReason:void 0}),i}}});async function o2(e,t){let r=await o1({request:{url:e.url,method:e.method,headers:O(e.headers),nextConfig:{basePath:"",i18n:"",trailingSlash:!1,experimental:{cacheLife:{default:{stale:300,revalidate:900,expire:0xfffffffe},seconds:{stale:30,revalidate:1,expire:60},minutes:{stale:300,revalidate:60,expire:3600},hours:{stale:300,revalidate:3600,expire:86400},days:{stale:300,revalidate:86400,expire:604800},weeks:{stale:300,revalidate:604800,expire:2592e3},max:{stale:300,revalidate:2592e3,expire:31536e3}},authInterrupts:!1,clientParamParsingOrigins:[]}},page:{name:oQ},body:"GET"!==e.method&&"HEAD"!==e.method?e.body??void 0:void 0,waitUntil:t.waitUntil,requestMeta:t.requestMeta,signal:t.signal||new AbortController().signal}});return null==t.waitUntil||t.waitUntil.call(t,r.waitUntil),r.response}e.s(["default",0,o1,"handler",0,o2],34577)}];
104
104
 
105
105
  //# sourceMappingURL=%5Broot-of-the-server%5D__0d1lmiq._.js.map