@decocms/mesh 2.72.1 → 2.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/client/assets/{AlertCircle-BOIQEKjW.js → AlertCircle-C_hR5usO.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-BRclUYsx.js → ArrowUp-DnJUZ1OS.js} +1 -1
  3. package/dist/client/assets/{Calendar-DydX5uRn.js → Calendar-Dnf0_EY9.js} +1 -1
  4. package/dist/client/assets/{Check-Bkb61eVw.js → Check-Sa4xK5Hg.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-ZkjIkaWv.js → CheckCircle-DRhauZbp.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-BusS8ANA.js → CheckDone01-I6GfoGdi.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DqJTvBdv.js → ChevronDown-DmXLJeAy.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BBcOJkyP.js → ChevronRight-By4KEpZh.js} +1 -1
  9. package/dist/client/assets/{Code01-DEMYMNLO.js → Code01-h_k8K-1e.js} +1 -1
  10. package/dist/client/assets/{Copy01-BvgMlJ5t.js → Copy01-jvqvZrKj.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-C3Pu-YCA.js → DotsHorizontal-CQJNqVgu.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DMOP2SMU.js → DotsVertical-gLXmVMYI.js} +1 -1
  13. package/dist/client/assets/{Download01-VwSgop8U.js → Download01-BKmVPJWY.js} +1 -1
  14. package/dist/client/assets/{Edit01-ByF-cYbh.js → Edit01-BT8zEtQL.js} +1 -1
  15. package/dist/client/assets/{File02-D6OcKUS4.js → File02-BNE7fmK0.js} +1 -1
  16. package/dist/client/assets/{File06-CkTcogsG.js → File06-WU23pV9H.js} +1 -1
  17. package/dist/client/assets/{FilterLines-BL17m8OO.js → FilterLines-DJEB3mgx.js} +1 -1
  18. package/dist/client/assets/{Globe02-CwdZK2H5.js → Globe02-Dp5eUbS2.js} +1 -1
  19. package/dist/client/assets/{Grid01-zbmmdox0.js → Grid01-CSAsqBFD.js} +1 -1
  20. package/dist/client/assets/{Home02-DPzckV1r.js → Home02-BUr926Eo.js} +1 -1
  21. package/dist/client/assets/{Image01-BuXlAy8i.js → Image01-BnbXZOf7.js} +1 -1
  22. package/dist/client/assets/{Inbox01-Czow08Bp.js → Inbox01-XFeiQPbg.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-C8GtqndP.js → InfoCircle-5xWfOa8P.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-DJasjN8P.js → LinkExternal01-BJLPX8tt.js} +1 -1
  25. package/dist/client/assets/{List-BvAv-Mbv.js → List-kXpaJIIp.js} +1 -1
  26. package/dist/client/assets/{Loading01-DOPFYU4m.js → Loading01-D8zw0cyg.js} +1 -1
  27. package/dist/client/assets/{Lock01-BALKEl0l.js → Lock01-DCDiY4HG.js} +1 -1
  28. package/dist/client/assets/{Pin01-Dk_x7uai.js → Pin01-DWsvacVo.js} +1 -1
  29. package/dist/client/assets/{Play-CjfPPVn_.js → Play-Yhg_pcqU.js} +1 -1
  30. package/dist/client/assets/{Plus-WaQ7hmj5.js → Plus-BBD2SckJ.js} +1 -1
  31. package/dist/client/assets/{SearchMd-Ds-ERWzq.js → SearchMd-CGuwiAQe.js} +1 -1
  32. package/dist/client/assets/{Settings01-CMNXJNnf.js → Settings01-D7-sGWon.js} +1 -1
  33. package/dist/client/assets/{Share07-w2-wABEW.js → Share07-C8iek9k4.js} +1 -1
  34. package/dist/client/assets/{Terminal-CrrxpXUI.js → Terminal-CyioLjuI.js} +1 -1
  35. package/dist/client/assets/{Tool01-Cn8FHCpZ.js → Tool01-DF-lT9RC.js} +1 -1
  36. package/dist/client/assets/{Trash01-C-euKa34.js → Trash01-CLqhrRia.js} +1 -1
  37. package/dist/client/assets/{Upload01-Dc0hOrKX.js → Upload01-DrtXkSgF.js} +1 -1
  38. package/dist/client/assets/{Users03-zsvZ9QWQ.js → Users03-oV4Gx6fu.js} +1 -1
  39. package/dist/client/assets/{X-DUGfq2_H.js → X-CuhyLwhM.js} +1 -1
  40. package/dist/client/assets/{XClose-Cv_qbaYN.js → XClose-BFt2trBc.js} +1 -1
  41. package/dist/client/assets/{agent-connections-preview-C15fpCN8.js → agent-connections-preview-D4bn0NTx.js} +1 -1
  42. package/dist/client/assets/{agent-detail-BQXrWX9M.js → agent-detail-D8YR1Y7H.js} +1 -1
  43. package/dist/client/assets/{agents-NgYS-NWl.js → agents-BMyluA59.js} +1 -1
  44. package/dist/client/assets/{alert-dialog-B4H6MrIT.js → alert-dialog-BxcV0D_1.js} +2 -2
  45. package/dist/client/assets/{auth-catchall-GUc2KujY.js → auth-catchall-DLJkIPQ0.js} +1 -1
  46. package/dist/client/assets/{avatar-B-AS-16N.js → avatar-D3z5_V3I.js} +1 -1
  47. package/dist/client/assets/{badge-BFm6jM0d.js → badge-BklHLRcK.js} +1 -1
  48. package/dist/client/assets/{binder-C4CQlgMb.js → binder-ak1AkjZY.js} +1 -1
  49. package/dist/client/assets/{breadcrumb-Cvo4WJJ5.js → breadcrumb-B_Yxwj4p.js} +1 -1
  50. package/dist/client/assets/{button-Cl3WMTWk.js → button-CcO5M7F7.js} +1 -1
  51. package/dist/client/assets/{card-B-73zAje.js → card-BNt4WjQv.js} +1 -1
  52. package/dist/client/assets/{checkbox-kN_xGJfO.js → checkbox-CirsSPdM.js} +1 -1
  53. package/dist/client/assets/{circle-alert-BEtzK3t3.js → circle-alert-BcHtOytY.js} +1 -1
  54. package/dist/client/assets/{collection-detail-C9AV2Fn9.js → collection-detail-iX-6m_0X.js} +2 -2
  55. package/dist/client/assets/{collection-search-Aeh0FXZR.js → collection-search-Cyt8_oQV.js} +1 -1
  56. package/dist/client/assets/{collection-tab-CgMRLj1Y.js → collection-tab-Cbay3Q2-.js} +1 -1
  57. package/dist/client/assets/{collection-table-wrapper-CmBNNf0K.js → collection-table-wrapper-CFNweZN1.js} +1 -1
  58. package/dist/client/assets/{collection-tabs-2AUf3kZ2.js → collection-tabs-Dh2bhvAY.js} +1 -1
  59. package/dist/client/assets/{command-DICG2vo0.js → command-8Q_FGz0v.js} +1 -1
  60. package/dist/client/assets/{connect-DoxLTvbh.js → connect-1mhMrmD4.js} +1 -1
  61. package/dist/client/assets/{connection-card-ChzuU2dT.js → connection-card-BGd7kcn-.js} +1 -1
  62. package/dist/client/assets/connection-detail-dEdcHJ4u.js +1 -0
  63. package/dist/client/assets/connections-DmGFiu1f.js +1 -0
  64. package/dist/client/assets/{constants-1q3hobyw.js → constants-DuSOM18S.js} +1 -1
  65. package/dist/client/assets/constants-QC26G_cT.js +1 -0
  66. package/dist/client/assets/{create-organization-dialog-DWV2eGAF.js → create-organization-dialog-j_P7xuhv.js} +1 -1
  67. package/dist/client/assets/create-project-dialog-C-mSn_Ux.js +1 -0
  68. package/dist/client/assets/{dialog-BmGDp4UV.js → dialog-B_iTVR3h.js} +1 -1
  69. package/dist/client/assets/dropdown-menu-BTPpCOPE.js +1 -0
  70. package/dist/client/assets/{dynamic-plugin-layout-C_HHJRk0.js → dynamic-plugin-layout-BsqDni3U.js} +1 -1
  71. package/dist/client/assets/{empty-state-oU8PNga_.js → empty-state--JD6ZxUc.js} +1 -1
  72. package/dist/client/assets/{empty-state-DFIrBrC-.js → empty-state-Ct1fZFlf.js} +1 -1
  73. package/dist/client/assets/{env-vars-editor-Bmnp2cvo.js → env-vars-editor-B4EebJEK.js} +1 -1
  74. package/dist/client/assets/{error-boundary-D7C5xzme.js → error-boundary-DlgelpJG.js} +1 -1
  75. package/dist/client/assets/{extract-connection-data-CQQ4ZZEG.js → extract-connection-data-BM37afPK.js} +1 -1
  76. package/dist/client/assets/file-browser-DQeqPq9E.js +2 -0
  77. package/dist/client/assets/form-CSsv2IBt.js +1 -0
  78. package/dist/client/assets/grid-view-DBKftgaD.js +1 -0
  79. package/dist/client/assets/home-D16zlSya.js +1 -0
  80. package/dist/client/assets/{index-9vOB29ZB.js → index-BHu7Lc_d.js} +1 -1
  81. package/dist/client/assets/{index-BV-rIyOx.js → index-Bn2rDd42.js} +6 -6
  82. package/dist/client/assets/{index-CxyQJKsK.js → index-Bo7hWTur.js} +1 -1
  83. package/dist/client/assets/{index-5T3tdhiA.js → index-CHcJPAjT.js} +1 -1
  84. package/dist/client/assets/{index-BA6gcyzW.js → index-CZtqakWK.js} +14 -14
  85. package/dist/client/assets/{index-Dolyg0HI.js → index-DJCm-wAr.js} +1 -1
  86. package/dist/client/assets/index-DZ7G-bvr.js +1 -0
  87. package/dist/client/assets/index-a2nqbblp.js +1 -0
  88. package/dist/client/assets/{index-fCCl5Un_.js → index-fr6MaGoE.js} +1 -1
  89. package/dist/client/assets/{infiniteQueryObserver-CrYps4St.js → infiniteQueryObserver-VnhrjjoH.js} +1 -1
  90. package/dist/client/assets/{input-Dv5qvD5N.js → input-DBvMwxwE.js} +1 -1
  91. package/dist/client/assets/integration-icon-C8seGsuO.js +1 -0
  92. package/dist/client/assets/label-BjQxQJkg.js +1 -0
  93. package/dist/client/assets/layout-ZTsfxACA.js +1 -0
  94. package/dist/client/assets/{localstorage-keys-Ds2uOTRP.js → localstorage-keys-BhunmwZg.js} +1 -1
  95. package/dist/client/assets/{login-BpnfmGBt.js → login-H0BwFxqL.js} +1 -1
  96. package/dist/client/assets/{mcp-oauth-C_XpjqFg.js → mcp-oauth-ZUujauBG.js} +1 -1
  97. package/dist/client/assets/{mcp-server-card-CiGvO9aP.js → mcp-server-card-KgRAONYw.js} +1 -1
  98. package/dist/client/assets/{mcp-server-detail-SQfpDpYc.js → mcp-server-detail-Ce9SGjoZ.js} +2 -2
  99. package/dist/client/assets/members-C925BdC6.js +3 -0
  100. package/dist/client/assets/{monaco-editor-q53ZLBJ5.js → monaco-editor-D7Ghoc8y.js} +1 -1
  101. package/dist/client/assets/{monitoring-CK4xcQzM.js → monitoring-DI8QAuDx.js} +19 -19
  102. package/dist/client/assets/{oauth-callback-CeLfnx5m.js → oauth-callback-DqKFxIqr.js} +1 -1
  103. package/dist/client/assets/page-B2cjdb1f.js +1 -0
  104. package/dist/client/assets/{page-jzi-88Nr.js → page-DCfXF14g.js} +1 -1
  105. package/dist/client/assets/plugin-empty-state-BYB8Yhjv.js +1 -0
  106. package/dist/client/assets/plugin-header-CLRCQ1W3.js +1 -0
  107. package/dist/client/assets/popover-BkKSdvGf.js +1 -0
  108. package/dist/client/assets/{project-layout-CH4wXxX2.js → project-layout-DzX_Lv0I.js} +1 -1
  109. package/dist/client/assets/project-settings-lapjGGi3.js +1 -0
  110. package/dist/client/assets/projects-list-DZgOrcLS.js +1 -0
  111. package/dist/client/assets/{registry-utils-CqOx6XXE.js → registry-utils-BsLp7zXK.js} +1 -1
  112. package/dist/client/assets/{resizable-CZuYHBhW.js → resizable-CdUSPFqv.js} +1 -1
  113. package/dist/client/assets/select-J2aavKNi.js +1 -0
  114. package/dist/client/assets/{shell-layout-BxNK1bDI.js → shell-layout-DOBmQ9ah.js} +2 -2
  115. package/dist/client/assets/{spinner-BPZfVVyD.js → spinner-Bn-tqgsf.js} +1 -1
  116. package/dist/client/assets/{store-invite-ICTVmn8_.js → store-invite-C8stGp_k.js} +1 -1
  117. package/dist/client/assets/switch-CG0LWjwI.js +1 -0
  118. package/dist/client/assets/{table-BBnlXDKe.js → table-BNxQWMxG.js} +1 -1
  119. package/dist/client/assets/{tasks-CpdqRpYU.js → tasks-C_RAoHGr.js} +1 -1
  120. package/dist/client/assets/{textarea-DK_SwVx9.js → textarea-CKlKOzV4.js} +1 -1
  121. package/dist/client/assets/{tools-list-B5iaOgKy.js → tools-list-D0G5KWHg.js} +1 -1
  122. package/dist/client/assets/{typewriter-title-C_OsyMAQ.js → typewriter-title-BqfnndCW.js} +2 -2
  123. package/dist/client/assets/{use-binding-BVOuBiur.js → use-binding-Dgjl_Htk.js} +1 -1
  124. package/dist/client/assets/{use-connection-B8DnjeO8.js → use-connection-CVk8Bzpz.js} +1 -1
  125. package/dist/client/assets/{use-create-virtual-mcp-7fubOknm.js → use-create-virtual-mcp-BpXLuk-p.js} +1 -1
  126. package/dist/client/assets/{use-deco-chat-open-cMRvRYVG.js → use-deco-chat-open-CfZI9mqc.js} +5 -5
  127. package/dist/client/assets/{use-install-from-registry-ClVbT6BY.js → use-install-from-registry-5UUqPBO7.js} +1 -1
  128. package/dist/client/assets/{use-list-state-DjV5kR97.js → use-list-state-D_1V56-b.js} +1 -1
  129. package/dist/client/assets/{use-llm-H-K3anTg.js → use-llm-Ca3pgrIB.js} +1 -1
  130. package/dist/client/assets/{use-mcp-prompts-Chz_2-6S.js → use-mcp-prompts-Cn7tm6ug.js} +1 -1
  131. package/dist/client/assets/{use-mcp-tools-CXMetymP.js → use-mcp-tools-Ddi2i1Nb.js} +1 -1
  132. package/dist/client/assets/{use-mobile-B2CDnK8i.js → use-mobile-p03CcGW0.js} +1 -1
  133. package/dist/client/assets/{use-organization-settings-Bu92wRjl.js → use-organization-settings-DHZKDAPt.js} +1 -1
  134. package/dist/client/assets/{use-project-CzroiUzj.js → use-project-D-mK4K9b.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-ayu_K6US.js → use-virtual-mcp-C83o4Rih.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-DDUEUpOZ.js +1 -0
  137. package/dist/client/assets/{useMutation-BOrtlNTb.js → useMutation-CnTeRHmv.js} +1 -1
  138. package/dist/client/assets/useQuery-Ct96KcZp.js +1 -0
  139. package/dist/client/assets/utils-Ckc2UwOp.js +1 -0
  140. package/dist/client/assets/{view-mode-toggle-CHHKGadJ.js → view-mode-toggle-CJkT6m07.js} +1 -1
  141. package/dist/client/assets/{workflow-BBKpGvON.js → workflow-2rDY9uo2.js} +1 -1
  142. package/dist/client/index.html +1 -1
  143. package/dist/server/cli.js +150 -150
  144. package/dist/server/migrate.js +1 -1
  145. package/dist/server/server.js +129 -129
  146. package/package.json +1 -1
  147. package/dist/client/assets/connection-detail-CVNpoyUm.js +0 -1
  148. package/dist/client/assets/connections-BHOwcUB0.js +0 -1
  149. package/dist/client/assets/constants-DzWq-50V.js +0 -1
  150. package/dist/client/assets/create-project-dialog-49RtElmv.js +0 -1
  151. package/dist/client/assets/dropdown-menu-6IaHSzwJ.js +0 -1
  152. package/dist/client/assets/file-browser-CHtfSNHu.js +0 -2
  153. package/dist/client/assets/form-qYB4UriD.js +0 -1
  154. package/dist/client/assets/grid-view-B4Eut3Xi.js +0 -1
  155. package/dist/client/assets/home-BYm3DFU4.js +0 -1
  156. package/dist/client/assets/index-BYzsWn1B.js +0 -1
  157. package/dist/client/assets/index-Vp0uDDij.js +0 -1
  158. package/dist/client/assets/integration-icon-DKM9NBX1.js +0 -1
  159. package/dist/client/assets/layout-B7afTuaN.js +0 -1
  160. package/dist/client/assets/members-CQSBREQS.js +0 -3
  161. package/dist/client/assets/page-CrfNBuC7.js +0 -1
  162. package/dist/client/assets/plugin-empty-state-Bnssy2Oj.js +0 -1
  163. package/dist/client/assets/plugin-header-DoQQAOys.js +0 -1
  164. package/dist/client/assets/popover-DuZ2ZN5J.js +0 -1
  165. package/dist/client/assets/project-settings-CKgnjrBp.js +0 -1
  166. package/dist/client/assets/projects-list-D0sSao6e.js +0 -1
  167. package/dist/client/assets/select-ODRW9YrY.js +0 -1
  168. package/dist/client/assets/switch-B-1QAIh-.js +0 -1
  169. package/dist/client/assets/useInfiniteQuery-TqDHdib1.js +0 -1
  170. package/dist/client/assets/useQuery-DDYln2BW.js +0 -1
  171. package/dist/client/assets/utils-CfR4kXxZ.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-CHtfSNHu.js","assets/useInfiniteQuery-TqDHdib1.js","assets/infiniteQueryObserver-CrYps4St.js","assets/button-Cl3WMTWk.js","assets/utils-CfR4kXxZ.js","assets/checkbox-kN_xGJfO.js","assets/Check-Bkb61eVw.js","assets/AlertCircle-BOIQEKjW.js","assets/ChevronRight-BBcOJkyP.js","assets/Download01-VwSgop8U.js","assets/File02-D6OcKUS4.js","assets/Grid01-zbmmdox0.js","assets/Home02-DPzckV1r.js","assets/List-BvAv-Mbv.js","assets/Loading01-DOPFYU4m.js","assets/Trash01-C-euKa34.js","assets/Upload01-Dc0hOrKX.js","assets/useMutation-BOrtlNTb.js","assets/plugin-header-DoQQAOys.js","assets/ChevronDown-DqJTvBdv.js","assets/login-BpnfmGBt.js","assets/input-Dv5qvD5N.js","assets/connect-DoxLTvbh.js","assets/useQuery-DDYln2BW.js","assets/card-B-73zAje.js","assets/mcp-oauth-C_XpjqFg.js","assets/circle-alert-BEtzK3t3.js","assets/oauth-callback-CeLfnx5m.js","assets/shell-layout-BxNK1bDI.js","assets/index-BA6gcyzW.js","assets/X-DUGfq2_H.js","assets/use-deco-chat-open-cMRvRYVG.js","assets/constants-1q3hobyw.js","assets/use-virtual-mcp-ayu_K6US.js","assets/use-connection-B8DnjeO8.js","assets/use-llm-H-K3anTg.js","assets/use-binding-BVOuBiur.js","assets/binder-C4CQlgMb.js","assets/Code01-DEMYMNLO.js","assets/localstorage-keys-Ds2uOTRP.js","assets/popover-DuZ2ZN5J.js","assets/select-ODRW9YrY.js","assets/index-BYzsWn1B.js","assets/error-boundary-D7C5xzme.js","assets/File06-CkTcogsG.js","assets/Image01-BuXlAy8i.js","assets/SearchMd-Ds-ERWzq.js","assets/spinner-BPZfVVyD.js","assets/integration-icon-DKM9NBX1.js","assets/use-mcp-prompts-Chz_2-6S.js","assets/dialog-BmGDp4UV.js","assets/form-qYB4UriD.js","assets/ArrowUp-BRclUYsx.js","assets/Edit01-ByF-cYbh.js","assets/Users03-zsvZ9QWQ.js","assets/Copy01-BvgMlJ5t.js","assets/Terminal-CrrxpXUI.js","assets/monaco-editor-q53ZLBJ5.js","assets/empty-state-oU8PNga_.js","assets/generate-id-Dyweu44Y.js","assets/badge-BFm6jM0d.js","assets/use-create-virtual-mcp-7fubOknm.js","assets/index-9vOB29ZB.js","assets/typewriter-title-C_OsyMAQ.js","assets/Plus-WaQ7hmj5.js","assets/create-project-dialog-49RtElmv.js","assets/textarea-DK_SwVx9.js","assets/CheckDone01-BusS8ANA.js","assets/use-project-CzroiUzj.js","assets/use-mobile-B2CDnK8i.js","assets/avatar-B-AS-16N.js","assets/Inbox01-Czow08Bp.js","assets/XClose-Cv_qbaYN.js","assets/create-organization-dialog-DWV2eGAF.js","assets/alert-dialog-B4H6MrIT.js","assets/switch-B-1QAIh-.js","assets/use-organization-settings-Bu92wRjl.js","assets/dropdown-menu-6IaHSzwJ.js","assets/LinkExternal01-DJasjN8P.js","assets/Settings01-CMNXJNnf.js","assets/resizable-CZuYHBhW.js","assets/home-BYm3DFU4.js","assets/project-layout-CH4wXxX2.js","assets/page-CrfNBuC7.js","assets/Pin01-Dk_x7uai.js","assets/Share07-w2-wABEW.js","assets/tasks-CpdqRpYU.js","assets/breadcrumb-Cvo4WJJ5.js","assets/project-settings-CKgnjrBp.js","assets/use-install-from-registry-ClVbT6BY.js","assets/extract-connection-data-CQQ4ZZEG.js","assets/constants-DzWq-50V.js","assets/github-icon-Dp3wHhYE.js","assets/registry-utils-CqOx6XXE.js","assets/projects-list-D0sSao6e.js","assets/collection-search-Aeh0FXZR.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/members-CQSBREQS.js","assets/collection-table-wrapper-CmBNNf0K.js","assets/view-mode-toggle-CHHKGadJ.js","assets/table-BBnlXDKe.js","assets/command-DICG2vo0.js","assets/index-5T3tdhiA.js","assets/DotsHorizontal-C3Pu-YCA.js","assets/Lock01-BALKEl0l.js","assets/DotsVertical-DMOP2SMU.js","assets/connections-BHOwcUB0.js","assets/connection-card-ChzuU2dT.js","assets/CheckCircle-ZkjIkaWv.js","assets/use-list-state-DjV5kR97.js","assets/use-mcp-tools-CXMetymP.js","assets/Globe02-CwdZK2H5.js","assets/env-vars-editor-Bmnp2cvo.js","assets/connection-detail-CVNpoyUm.js","assets/index-Vp0uDDij.js","assets/index-Dolyg0HI.js","assets/index-CxyQJKsK.js","assets/collection-tabs-2AUf3kZ2.js","assets/layout-B7afTuaN.js","assets/collection-tab-CgMRLj1Y.js","assets/empty-state-DFIrBrC-.js","assets/tools-list-B5iaOgKy.js","assets/tools-list-DWnTz46N.css","assets/collection-detail-C9AV2Fn9.js","assets/Play-CjfPPVn_.js","assets/Calendar-DydX5uRn.js","assets/Tool01-Cn8FHCpZ.js","assets/monitoring-CK4xcQzM.js","assets/FilterLines-BL17m8OO.js","assets/page-jzi-88Nr.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-CiGvO9aP.js","assets/mcp-server-detail-SQfpDpYc.js","assets/InfoCircle-C8GtqndP.js","assets/agents-NgYS-NWl.js","assets/agent-connections-preview-C15fpCN8.js","assets/agent-detail-BQXrWX9M.js","assets/workflow-BBKpGvON.js","assets/dynamic-plugin-layout-C_HHJRk0.js"])))=>i.map(i=>d[i]);
2
- function LD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const jD="modulepreload",$D=function(e){return"/"+e},qR={},Jt=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");a=l(n.map(f=>{if(f=$D(f),f in qR)return;qR[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":jD,m||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),m)return new Promise((y,w)=>{g.addEventListener("load",y),g.addEventListener("error",()=>w(Error(`Unable to preload CSS for ${f}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};var Fre=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vy={exports:{}},hu={};var HR;function UD(){if(HR)return hu;HR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return hu.Fragment=t,hu.jsx=n,hu.jsxs=n,hu}var GR;function zD(){return GR||(GR=1,vy.exports=UD()),vy.exports}var x=zD(),yy={exports:{}},pu={},_y={exports:{}},by={};var ZR;function VD(){return ZR||(ZR=1,(function(e){function t(B,W){var Y=B.length;B.push(W);e:for(;0<Y;){var pe=Y-1>>>1,ae=B[pe];if(0<a(ae,W))B[pe]=W,B[Y]=ae,Y=pe;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var W=B[0],Y=B.pop();if(Y!==W){B[0]=Y;e:for(var pe=0,ae=B.length,M=ae>>>1;pe<M;){var q=2*(pe+1)-1,F=B[q],L=q+1,z=B[L];if(0>a(F,Y))L<ae&&0>a(z,F)?(B[pe]=z,B[L]=Y,pe=L):(B[pe]=F,B[q]=Y,pe=q);else if(L<ae&&0>a(z,Y))B[pe]=z,B[L]=Y,pe=L;else break e}}return W}function a(B,W){var Y=B.sortIndex-W.sortIndex;return Y!==0?Y:B.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,y=!1,w=!1,S=!1,b=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=B)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function C(B){if(S=!1,O(B),!w)if(n(d)!==null)w=!0,I||(I=!0,G());else{var W=n(f);W!==null&&le(C,W.startTime-B)}}var I=!1,N=-1,P=5,$=-1;function K(){return b?!0:!(e.unstable_now()-$<P)}function V(){if(b=!1,I){var B=e.unstable_now();$=B;var W=!0;try{e:{w=!1,S&&(S=!1,R(N),N=-1),y=!0;var Y=g;try{t:{for(O(B),p=n(d);p!==null&&!(p.expirationTime>B&&K());){var pe=p.callback;if(typeof pe=="function"){p.callback=null,g=p.priorityLevel;var ae=pe(p.expirationTime<=B);if(B=e.unstable_now(),typeof ae=="function"){p.callback=ae,O(B),W=!0;break t}p===n(d)&&r(d),O(B)}else r(d);p=n(d)}if(p!==null)W=!0;else{var M=n(f);M!==null&&le(C,M.startTime-B),W=!1}}break e}finally{p=null,g=Y,y=!1}W=void 0}}finally{W?G():I=!1}}}var G;if(typeof T=="function")G=function(){T(V)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,J=U.port2;U.port1.onmessage=V,G=function(){J.postMessage(null)}}else G=function(){E(V,0)};function le(B,W){N=E(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var Y=g;g=W;try{return B()}finally{g=Y}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(B,W){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=g;g=B;try{return W()}finally{g=Y}},e.unstable_scheduleCallback=function(B,W,Y){var pe=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?pe+Y:pe):Y=pe,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=Y+ae,B={id:m++,callback:W,priorityLevel:B,startTime:Y,expirationTime:ae,sortIndex:-1},Y>pe?(B.sortIndex=Y,t(f,B),n(d)===null&&B===n(f)&&(S?(R(N),N=-1):S=!0,le(C,Y-pe))):(B.sortIndex=ae,t(d,B),w||y||(w=!0,I||(I=!0,G()))),B},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(B){var W=g;return function(){var Y=g;g=W;try{return B.apply(this,arguments)}finally{g=Y}}}})(by)),by}var KR;function FD(){return KR||(KR=1,_y.exports=VD()),_y.exports}var wy={exports:{}},et={};var WR;function BD(){if(WR)return et;WR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,b={};function E(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||w}E.prototype.isReactComponent={},E.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=E.prototype;function T(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||w}var O=T.prototype=new R;O.constructor=T,S(O,E.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function I(){}var N={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(M,q,F){var L=F.ref;return{$$typeof:e,type:M,key:q,ref:L!==void 0?L:null,props:F}}function K(M,q){return $(M.type,q,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function G(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(F){return q[F]})}var U=/\/+/g;function J(M,q){return typeof M=="object"&&M!==null&&M.key!=null?G(""+M.key):q.toString(36)}function le(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(I,I):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,q,F,L,z){var X=typeof M;(X==="undefined"||X==="boolean")&&(M=null);var de=!1;if(M===null)de=!0;else switch(X){case"bigint":case"string":case"number":de=!0;break;case"object":switch(M.$$typeof){case e:case t:de=!0;break;case m:return de=M._init,B(de(M._payload),q,F,L,z)}}if(de)return z=z(M),de=L===""?"."+J(M,0):L,C(z)?(F="",de!=null&&(F=de.replace(U,"$&/")+"/"),B(z,q,F,"",function(Ae){return Ae})):z!=null&&(V(z)&&(z=K(z,F+(z.key==null||M&&M.key===z.key?"":(""+z.key).replace(U,"$&/")+"/")+de)),q.push(z)),1;de=0;var ve=L===""?".":L+":";if(C(M))for(var Ie=0;Ie<M.length;Ie++)L=M[Ie],X=ve+J(L,Ie),de+=B(L,q,F,X,z);else if(Ie=y(M),typeof Ie=="function")for(M=Ie.call(M),Ie=0;!(L=M.next()).done;)L=L.value,X=ve+J(L,Ie++),de+=B(L,q,F,X,z);else if(X==="object"){if(typeof M.then=="function")return B(le(M),q,F,L,z);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return de}function W(M,q,F){if(M==null)return M;var L=[],z=0;return B(M,L,"","",function(X){return q.call(F,X,z++)}),L}function Y(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(F){(M._status===0||M._status===-1)&&(M._status=1,M._result=F)},function(F){(M._status===0||M._status===-1)&&(M._status=2,M._result=F)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var pe=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ae={map:W,forEach:function(M,q,F){W(M,function(){q.apply(this,arguments)},F)},count:function(M){var q=0;return W(M,function(){q++}),q},toArray:function(M){return W(M,function(q){return q})||[]},only:function(M){if(!V(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return et.Activity=p,et.Children=ae,et.Component=E,et.Fragment=n,et.Profiler=a,et.PureComponent=T,et.StrictMode=r,et.Suspense=d,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,et.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},et.cache=function(M){return function(){return M.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(M,q,F){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var L=S({},M.props),z=M.key;if(q!=null)for(X in q.key!==void 0&&(z=""+q.key),q)!P.call(q,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&q.ref===void 0||(L[X]=q[X]);var X=arguments.length-2;if(X===1)L.children=F;else if(1<X){for(var de=Array(X),ve=0;ve<X;ve++)de[ve]=arguments[ve+2];L.children=de}return $(M.type,z,L)},et.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:i,_context:M},M},et.createElement=function(M,q,F){var L,z={},X=null;if(q!=null)for(L in q.key!==void 0&&(X=""+q.key),q)P.call(q,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(z[L]=q[L]);var de=arguments.length-2;if(de===1)z.children=F;else if(1<de){for(var ve=Array(de),Ie=0;Ie<de;Ie++)ve[Ie]=arguments[Ie+2];z.children=ve}if(M&&M.defaultProps)for(L in de=M.defaultProps,de)z[L]===void 0&&(z[L]=de[L]);return $(M,X,z)},et.createRef=function(){return{current:null}},et.forwardRef=function(M){return{$$typeof:u,render:M}},et.isValidElement=V,et.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Y}},et.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},et.startTransition=function(M){var q=N.T,F={};N.T=F;try{var L=M(),z=N.S;z!==null&&z(F,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(I,pe)}catch(X){pe(X)}finally{q!==null&&F.types!==null&&(q.types=F.types),N.T=q}},et.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},et.use=function(M){return N.H.use(M)},et.useActionState=function(M,q,F){return N.H.useActionState(M,q,F)},et.useCallback=function(M,q){return N.H.useCallback(M,q)},et.useContext=function(M){return N.H.useContext(M)},et.useDebugValue=function(){},et.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},et.useEffect=function(M,q){return N.H.useEffect(M,q)},et.useEffectEvent=function(M){return N.H.useEffectEvent(M)},et.useId=function(){return N.H.useId()},et.useImperativeHandle=function(M,q,F){return N.H.useImperativeHandle(M,q,F)},et.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},et.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},et.useMemo=function(M,q){return N.H.useMemo(M,q)},et.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},et.useReducer=function(M,q,F){return N.H.useReducer(M,q,F)},et.useRef=function(M){return N.H.useRef(M)},et.useState=function(M){return N.H.useState(M)},et.useSyncExternalStore=function(M,q,F){return N.H.useSyncExternalStore(M,q,F)},et.useTransition=function(){return N.H.useTransition()},et.version="19.2.4",et}var YR;function Zs(){return YR||(YR=1,wy.exports=BD()),wy.exports}var Sy={exports:{}},fr={};var QR;function qD(){if(QR)return fr;QR=1;var e=Zs();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:d,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(d,f,null,m)},fr.flushSync=function(d){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=m,r.d.f()}},fr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},fr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},fr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},fr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},fr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},fr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},fr.requestFormReset=function(d){r.d.r(d)},fr.unstable_batchedUpdates=function(d,f){return d(f)},fr.useFormState=function(d,f,m){return l.H.useFormState(d,f,m)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.4",fr}var XR;function VC(){if(XR)return Sy.exports;XR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sy.exports=qD(),Sy.exports}var JR;function HD(){if(JR)return pu;JR=1;var e=FD(),t=Zs(),n=VC();function r(o){var s="https://react.dev/errors/"+o;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var s=o,c=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,(s.flags&4098)!==0&&(c=s.return),o=s.return;while(o)}return s.tag===3?c:null}function l(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function u(o){if(o.tag===31){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(r(188))}function f(o){var s=o.alternate;if(!s){if(s=i(o),s===null)throw Error(r(188));return s!==o?null:o}for(var c=o,h=s;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return d(v),o;if(_===h)return d(v),s;_=_.sibling}throw Error(r(188))}if(c.return!==h.return)c=v,h=_;else{for(var k=!1,j=v.child;j;){if(j===c){k=!0,c=v,h=_;break}if(j===h){k=!0,h=v,c=_;break}j=j.sibling}if(!k){for(j=_.child;j;){if(j===c){k=!0,c=_,h=v;break}if(j===h){k=!0,h=_,c=v;break}j=j.sibling}if(!k)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:s}function m(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=m(o),s!==null)return s;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=V&&o[V]||o["@@iterator"],typeof o=="function"?o:null)}var U=Symbol.for("react.client.reference");function J(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===U?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case E:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case I:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case w:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case O:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return s=o.displayName||null,s!==null?s:J(o.type)||"Memo";case P:s=o._payload,o=o._init;try{return J(o(s))}catch{}}return null}var le=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},pe=[],ae=-1;function M(o){return{current:o}}function q(o){0>ae||(o.current=pe[ae],pe[ae]=null,ae--)}function F(o,s){ae++,pe[ae]=o.current,o.current=s}var L=M(null),z=M(null),X=M(null),de=M(null);function ve(o,s){switch(F(X,s),F(z,o),F(L,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?hR(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=hR(s),o=pR(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(L),F(L,o)}function Ie(){q(L),q(z),q(X)}function Ae(o){o.memoizedState!==null&&F(de,o);var s=L.current,c=pR(s,o.type);s!==c&&(F(z,o),F(L,c))}function H(o){z.current===o&&(q(L),q(z)),de.current===o&&(q(de),cu._currentValue=Y)}var ne,_e;function se(o){if(ne===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",_e=-1<c.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-DQeqPq9E.js","assets/useInfiniteQuery-DDUEUpOZ.js","assets/infiniteQueryObserver-VnhrjjoH.js","assets/button-CcO5M7F7.js","assets/utils-Ckc2UwOp.js","assets/checkbox-CirsSPdM.js","assets/Check-Sa4xK5Hg.js","assets/AlertCircle-C_hR5usO.js","assets/ChevronRight-By4KEpZh.js","assets/Download01-BKmVPJWY.js","assets/File02-BNE7fmK0.js","assets/Grid01-CSAsqBFD.js","assets/Home02-BUr926Eo.js","assets/List-kXpaJIIp.js","assets/Loading01-D8zw0cyg.js","assets/Trash01-CLqhrRia.js","assets/Upload01-DrtXkSgF.js","assets/useMutation-CnTeRHmv.js","assets/plugin-header-CLRCQ1W3.js","assets/ChevronDown-DmXLJeAy.js","assets/login-H0BwFxqL.js","assets/input-DBvMwxwE.js","assets/connect-1mhMrmD4.js","assets/useQuery-Ct96KcZp.js","assets/card-BNt4WjQv.js","assets/mcp-oauth-ZUujauBG.js","assets/circle-alert-BcHtOytY.js","assets/oauth-callback-DqKFxIqr.js","assets/shell-layout-DOBmQ9ah.js","assets/index-CZtqakWK.js","assets/X-CuhyLwhM.js","assets/use-deco-chat-open-CfZI9mqc.js","assets/constants-DuSOM18S.js","assets/use-virtual-mcp-C83o4Rih.js","assets/use-connection-CVk8Bzpz.js","assets/use-llm-Ca3pgrIB.js","assets/use-binding-Dgjl_Htk.js","assets/binder-ak1AkjZY.js","assets/Code01-h_k8K-1e.js","assets/localstorage-keys-BhunmwZg.js","assets/popover-BkKSdvGf.js","assets/select-J2aavKNi.js","assets/index-DZ7G-bvr.js","assets/error-boundary-DlgelpJG.js","assets/File06-WU23pV9H.js","assets/Image01-BnbXZOf7.js","assets/SearchMd-CGuwiAQe.js","assets/spinner-Bn-tqgsf.js","assets/integration-icon-C8seGsuO.js","assets/use-mcp-prompts-Cn7tm6ug.js","assets/dialog-B_iTVR3h.js","assets/form-CSsv2IBt.js","assets/label-BjQxQJkg.js","assets/ArrowUp-DnJUZ1OS.js","assets/Edit01-BT8zEtQL.js","assets/Users03-oV4Gx6fu.js","assets/Copy01-jvqvZrKj.js","assets/Terminal-CyioLjuI.js","assets/monaco-editor-D7Ghoc8y.js","assets/empty-state--JD6ZxUc.js","assets/generate-id-Dyweu44Y.js","assets/badge-BklHLRcK.js","assets/use-create-virtual-mcp-BpXLuk-p.js","assets/index-BHu7Lc_d.js","assets/typewriter-title-BqfnndCW.js","assets/Plus-BBD2SckJ.js","assets/create-project-dialog-C-mSn_Ux.js","assets/textarea-CKlKOzV4.js","assets/CheckDone01-I6GfoGdi.js","assets/use-project-D-mK4K9b.js","assets/use-mobile-p03CcGW0.js","assets/avatar-D3z5_V3I.js","assets/Inbox01-XFeiQPbg.js","assets/XClose-BFt2trBc.js","assets/create-organization-dialog-j_P7xuhv.js","assets/alert-dialog-BxcV0D_1.js","assets/switch-CG0LWjwI.js","assets/use-organization-settings-DHZKDAPt.js","assets/dropdown-menu-BTPpCOPE.js","assets/LinkExternal01-BJLPX8tt.js","assets/Settings01-D7-sGWon.js","assets/resizable-CdUSPFqv.js","assets/home-D16zlSya.js","assets/project-layout-DzX_Lv0I.js","assets/page-B2cjdb1f.js","assets/Pin01-DWsvacVo.js","assets/Share07-C8iek9k4.js","assets/tasks-C_RAoHGr.js","assets/breadcrumb-B_Yxwj4p.js","assets/project-settings-lapjGGi3.js","assets/use-install-from-registry-5UUqPBO7.js","assets/extract-connection-data-BM37afPK.js","assets/constants-QC26G_cT.js","assets/github-icon-Dp3wHhYE.js","assets/registry-utils-BsLp7zXK.js","assets/projects-list-DZgOrcLS.js","assets/collection-search-Cyt8_oQV.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/members-C925BdC6.js","assets/collection-table-wrapper-CFNweZN1.js","assets/view-mode-toggle-CJkT6m07.js","assets/table-BNxQWMxG.js","assets/command-8Q_FGz0v.js","assets/index-CHcJPAjT.js","assets/DotsHorizontal-CQJNqVgu.js","assets/Lock01-DCDiY4HG.js","assets/DotsVertical-gLXmVMYI.js","assets/connections-DmGFiu1f.js","assets/connection-card-BGd7kcn-.js","assets/CheckCircle-DRhauZbp.js","assets/use-list-state-D_1V56-b.js","assets/use-mcp-tools-Ddi2i1Nb.js","assets/Globe02-Dp5eUbS2.js","assets/env-vars-editor-B4EebJEK.js","assets/connection-detail-dEdcHJ4u.js","assets/index-a2nqbblp.js","assets/index-DJCm-wAr.js","assets/index-Bo7hWTur.js","assets/collection-tabs-Dh2bhvAY.js","assets/layout-ZTsfxACA.js","assets/collection-tab-Cbay3Q2-.js","assets/empty-state-Ct1fZFlf.js","assets/tools-list-D0G5KWHg.js","assets/tools-list-DWnTz46N.css","assets/collection-detail-iX-6m_0X.js","assets/Play-Yhg_pcqU.js","assets/Calendar-Dnf0_EY9.js","assets/Tool01-DF-lT9RC.js","assets/monitoring-DI8QAuDx.js","assets/FilterLines-DJEB3mgx.js","assets/page-DCfXF14g.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-KgRAONYw.js","assets/mcp-server-detail-Ce9SGjoZ.js","assets/InfoCircle-5xWfOa8P.js","assets/agents-BMyluA59.js","assets/agent-connections-preview-D4bn0NTx.js","assets/agent-detail-D8YR1Y7H.js","assets/workflow-2rDY9uo2.js","assets/dynamic-plugin-layout-BsqDni3U.js"])))=>i.map(i=>d[i]);
2
+ function LD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const jD="modulepreload",$D=function(e){return"/"+e},qR={},Jt=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");a=l(n.map(f=>{if(f=$D(f),f in qR)return;qR[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":jD,m||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),m)return new Promise((y,w)=>{g.addEventListener("load",y),g.addEventListener("error",()=>w(Error(`Unable to preload CSS for ${f}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};var Fre=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ga(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vy={exports:{}},hu={};var HR;function UD(){if(HR)return hu;HR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return hu.Fragment=t,hu.jsx=n,hu.jsxs=n,hu}var GR;function zD(){return GR||(GR=1,vy.exports=UD()),vy.exports}var x=zD(),yy={exports:{}},pu={},_y={exports:{}},by={};var ZR;function VD(){return ZR||(ZR=1,(function(e){function t(B,W){var Y=B.length;B.push(W);e:for(;0<Y;){var pe=Y-1>>>1,ae=B[pe];if(0<a(ae,W))B[pe]=W,B[Y]=ae,Y=pe;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var W=B[0],Y=B.pop();if(Y!==W){B[0]=Y;e:for(var pe=0,ae=B.length,M=ae>>>1;pe<M;){var q=2*(pe+1)-1,F=B[q],L=q+1,z=B[L];if(0>a(F,Y))L<ae&&0>a(z,F)?(B[pe]=z,B[L]=Y,pe=L):(B[pe]=F,B[q]=Y,pe=q);else if(L<ae&&0>a(z,Y))B[pe]=z,B[L]=Y,pe=L;else break e}}return W}function a(B,W){var Y=B.sortIndex-W.sortIndex;return Y!==0?Y:B.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,y=!1,w=!1,S=!1,b=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=B)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function C(B){if(S=!1,O(B),!w)if(n(d)!==null)w=!0,I||(I=!0,G());else{var W=n(f);W!==null&&le(C,W.startTime-B)}}var I=!1,N=-1,P=5,$=-1;function K(){return b?!0:!(e.unstable_now()-$<P)}function V(){if(b=!1,I){var B=e.unstable_now();$=B;var W=!0;try{e:{w=!1,S&&(S=!1,R(N),N=-1),y=!0;var Y=g;try{t:{for(O(B),p=n(d);p!==null&&!(p.expirationTime>B&&K());){var pe=p.callback;if(typeof pe=="function"){p.callback=null,g=p.priorityLevel;var ae=pe(p.expirationTime<=B);if(B=e.unstable_now(),typeof ae=="function"){p.callback=ae,O(B),W=!0;break t}p===n(d)&&r(d),O(B)}else r(d);p=n(d)}if(p!==null)W=!0;else{var M=n(f);M!==null&&le(C,M.startTime-B),W=!1}}break e}finally{p=null,g=Y,y=!1}W=void 0}}finally{W?G():I=!1}}}var G;if(typeof T=="function")G=function(){T(V)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,J=U.port2;U.port1.onmessage=V,G=function(){J.postMessage(null)}}else G=function(){E(V,0)};function le(B,W){N=E(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var Y=g;g=W;try{return B()}finally{g=Y}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(B,W){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=g;g=B;try{return W()}finally{g=Y}},e.unstable_scheduleCallback=function(B,W,Y){var pe=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?pe+Y:pe):Y=pe,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=Y+ae,B={id:m++,callback:W,priorityLevel:B,startTime:Y,expirationTime:ae,sortIndex:-1},Y>pe?(B.sortIndex=Y,t(f,B),n(d)===null&&B===n(f)&&(S?(R(N),N=-1):S=!0,le(C,Y-pe))):(B.sortIndex=ae,t(d,B),w||y||(w=!0,I||(I=!0,G()))),B},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(B){var W=g;return function(){var Y=g;g=W;try{return B.apply(this,arguments)}finally{g=Y}}}})(by)),by}var KR;function FD(){return KR||(KR=1,_y.exports=VD()),_y.exports}var wy={exports:{}},tt={};var WR;function BD(){if(WR)return tt;WR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,b={};function E(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||w}E.prototype.isReactComponent={},E.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=E.prototype;function T(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||w}var O=T.prototype=new R;O.constructor=T,S(O,E.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function I(){}var N={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(M,q,F){var L=F.ref;return{$$typeof:e,type:M,key:q,ref:L!==void 0?L:null,props:F}}function K(M,q){return $(M.type,q,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function G(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(F){return q[F]})}var U=/\/+/g;function J(M,q){return typeof M=="object"&&M!==null&&M.key!=null?G(""+M.key):q.toString(36)}function le(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(I,I):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,q,F,L,z){var X=typeof M;(X==="undefined"||X==="boolean")&&(M=null);var de=!1;if(M===null)de=!0;else switch(X){case"bigint":case"string":case"number":de=!0;break;case"object":switch(M.$$typeof){case e:case t:de=!0;break;case m:return de=M._init,B(de(M._payload),q,F,L,z)}}if(de)return z=z(M),de=L===""?"."+J(M,0):L,C(z)?(F="",de!=null&&(F=de.replace(U,"$&/")+"/"),B(z,q,F,"",function(Ae){return Ae})):z!=null&&(V(z)&&(z=K(z,F+(z.key==null||M&&M.key===z.key?"":(""+z.key).replace(U,"$&/")+"/")+de)),q.push(z)),1;de=0;var ve=L===""?".":L+":";if(C(M))for(var Ie=0;Ie<M.length;Ie++)L=M[Ie],X=ve+J(L,Ie),de+=B(L,q,F,X,z);else if(Ie=y(M),typeof Ie=="function")for(M=Ie.call(M),Ie=0;!(L=M.next()).done;)L=L.value,X=ve+J(L,Ie++),de+=B(L,q,F,X,z);else if(X==="object"){if(typeof M.then=="function")return B(le(M),q,F,L,z);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return de}function W(M,q,F){if(M==null)return M;var L=[],z=0;return B(M,L,"","",function(X){return q.call(F,X,z++)}),L}function Y(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(F){(M._status===0||M._status===-1)&&(M._status=1,M._result=F)},function(F){(M._status===0||M._status===-1)&&(M._status=2,M._result=F)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var pe=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ae={map:W,forEach:function(M,q,F){W(M,function(){q.apply(this,arguments)},F)},count:function(M){var q=0;return W(M,function(){q++}),q},toArray:function(M){return W(M,function(q){return q})||[]},only:function(M){if(!V(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return tt.Activity=p,tt.Children=ae,tt.Component=E,tt.Fragment=n,tt.Profiler=a,tt.PureComponent=T,tt.StrictMode=r,tt.Suspense=d,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,tt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},tt.cache=function(M){return function(){return M.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(M,q,F){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var L=S({},M.props),z=M.key;if(q!=null)for(X in q.key!==void 0&&(z=""+q.key),q)!P.call(q,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&q.ref===void 0||(L[X]=q[X]);var X=arguments.length-2;if(X===1)L.children=F;else if(1<X){for(var de=Array(X),ve=0;ve<X;ve++)de[ve]=arguments[ve+2];L.children=de}return $(M.type,z,L)},tt.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:i,_context:M},M},tt.createElement=function(M,q,F){var L,z={},X=null;if(q!=null)for(L in q.key!==void 0&&(X=""+q.key),q)P.call(q,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(z[L]=q[L]);var de=arguments.length-2;if(de===1)z.children=F;else if(1<de){for(var ve=Array(de),Ie=0;Ie<de;Ie++)ve[Ie]=arguments[Ie+2];z.children=ve}if(M&&M.defaultProps)for(L in de=M.defaultProps,de)z[L]===void 0&&(z[L]=de[L]);return $(M,X,z)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(M){return{$$typeof:u,render:M}},tt.isValidElement=V,tt.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Y}},tt.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},tt.startTransition=function(M){var q=N.T,F={};N.T=F;try{var L=M(),z=N.S;z!==null&&z(F,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(I,pe)}catch(X){pe(X)}finally{q!==null&&F.types!==null&&(q.types=F.types),N.T=q}},tt.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},tt.use=function(M){return N.H.use(M)},tt.useActionState=function(M,q,F){return N.H.useActionState(M,q,F)},tt.useCallback=function(M,q){return N.H.useCallback(M,q)},tt.useContext=function(M){return N.H.useContext(M)},tt.useDebugValue=function(){},tt.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},tt.useEffect=function(M,q){return N.H.useEffect(M,q)},tt.useEffectEvent=function(M){return N.H.useEffectEvent(M)},tt.useId=function(){return N.H.useId()},tt.useImperativeHandle=function(M,q,F){return N.H.useImperativeHandle(M,q,F)},tt.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},tt.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},tt.useMemo=function(M,q){return N.H.useMemo(M,q)},tt.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},tt.useReducer=function(M,q,F){return N.H.useReducer(M,q,F)},tt.useRef=function(M){return N.H.useRef(M)},tt.useState=function(M){return N.H.useState(M)},tt.useSyncExternalStore=function(M,q,F){return N.H.useSyncExternalStore(M,q,F)},tt.useTransition=function(){return N.H.useTransition()},tt.version="19.2.4",tt}var YR;function Zs(){return YR||(YR=1,wy.exports=BD()),wy.exports}var Sy={exports:{}},fr={};var QR;function qD(){if(QR)return fr;QR=1;var e=Zs();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:d,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(d,f,null,m)},fr.flushSync=function(d){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=m,r.d.f()}},fr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},fr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},fr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},fr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},fr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},fr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},fr.requestFormReset=function(d){r.d.r(d)},fr.unstable_batchedUpdates=function(d,f){return d(f)},fr.useFormState=function(d,f,m){return l.H.useFormState(d,f,m)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.4",fr}var XR;function VC(){if(XR)return Sy.exports;XR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sy.exports=qD(),Sy.exports}var JR;function HD(){if(JR)return pu;JR=1;var e=FD(),t=Zs(),n=VC();function r(o){var s="https://react.dev/errors/"+o;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var s=o,c=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,(s.flags&4098)!==0&&(c=s.return),o=s.return;while(o)}return s.tag===3?c:null}function l(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function u(o){if(o.tag===31){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(r(188))}function f(o){var s=o.alternate;if(!s){if(s=i(o),s===null)throw Error(r(188));return s!==o?null:o}for(var c=o,h=s;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return d(v),o;if(_===h)return d(v),s;_=_.sibling}throw Error(r(188))}if(c.return!==h.return)c=v,h=_;else{for(var k=!1,j=v.child;j;){if(j===c){k=!0,c=v,h=_;break}if(j===h){k=!0,h=v,c=_;break}j=j.sibling}if(!k){for(j=_.child;j;){if(j===c){k=!0,c=_,h=v;break}if(j===h){k=!0,h=_,c=v;break}j=j.sibling}if(!k)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:s}function m(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=m(o),s!==null)return s;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=V&&o[V]||o["@@iterator"],typeof o=="function"?o:null)}var U=Symbol.for("react.client.reference");function J(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===U?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case E:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case I:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case w:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case O:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return s=o.displayName||null,s!==null?s:J(o.type)||"Memo";case P:s=o._payload,o=o._init;try{return J(o(s))}catch{}}return null}var le=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},pe=[],ae=-1;function M(o){return{current:o}}function q(o){0>ae||(o.current=pe[ae],pe[ae]=null,ae--)}function F(o,s){ae++,pe[ae]=o.current,o.current=s}var L=M(null),z=M(null),X=M(null),de=M(null);function ve(o,s){switch(F(X,s),F(z,o),F(L,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?hR(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=hR(s),o=pR(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(L),F(L,o)}function Ie(){q(L),q(z),q(X)}function Ae(o){o.memoizedState!==null&&F(de,o);var s=L.current,c=pR(s,o.type);s!==c&&(F(z,o),F(L,c))}function H(o){z.current===o&&(q(L),q(z)),de.current===o&&(q(de),cu._currentValue=Y)}var ne,_e;function se(o){if(ne===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",_e=-1<c.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ne+o+_e}var ue=!1;function Oe(o,s){if(!o||ue)return"";ue=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ge){var me=ge}Reflect.construct(o,[],Te)}else{try{Te.call()}catch(ge){me=ge}o.call(Te.prototype)}}else{try{throw Error()}catch(ge){me=ge}(Te=o())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ge){if(ge&&me&&typeof ge.stack=="string")return[ge.stack,me.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),k=_[0],j=_[1];if(k&&j){var Q=k.split(`
5
5
  `),he=j.split(`
@@ -45,7 +45,7 @@ Error generating stack: `+h.message+`
45
45
 
46
46
  `)}y.write("payload.value = newResult;"),y.write("return payload;");const R=y.compile();return(T,O)=>R(g,T,O)};let i;const l=ed,u=!KA.jitless,f=u&&O$.value,m=t.catchall;let p;e._zod.parse=(g,y)=>{p??(p=r.value);const w=g.value;return l(w)?u&&f&&y?.async===!1&&y.jitless!==!0?(i||(i=a(t.shape)),g=i(g,y),m?dI([],w,g,y,p,e):g):n(g,y):(g.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),g)}});function Qx(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const a=e.filter(i=>!Wl(i));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(l=>Fs(l,r,Vs())))}),t)}const fI=ye("$ZodUnion",(e,t)=>{Bt.init(e,t),xt(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),xt(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),xt(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),xt(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${a.map(i=>Tb(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(a,i)=>{if(n)return r(a,i);let l=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:a.value,issues:[]},i);if(f instanceof Promise)u.push(f),l=!0;else{if(f.issues.length===0)return f;u.push(f)}}return l?Promise.all(u).then(d=>Qx(d,a,e,i)):Qx(u,a,e,i)}}),b9=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fI.init(e,t);const n=e._zod.parse;xt(e._zod,"propValues",()=>{const a={};for(const i of t.options){const l=i._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[u,d]of Object.entries(l)){a[u]||(a[u]=new Set);for(const f of d)a[u].add(f)}}return a});const r=Im(()=>{const a=t.options,i=new Map;for(const l of a){const u=l._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of u){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,l)}}return i});e._zod.parse=(a,i)=>{const l=a.value;if(!ed(l))return a.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),a;const u=r.value.get(l?.[t.discriminator]);return u?u._zod.run(a,i):t.unionFallback?n(a,i):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),a)}}),w9=ye("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value,i=t.left._zod.run({value:a,issues:[]},r),l=t.right._zod.run({value:a,issues:[]},r);return i instanceof Promise||l instanceof Promise?Promise.all([i,l]).then(([d,f])=>Xx(n,d,f)):Xx(n,i,l)}});function i_(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ic(e)&&ic(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),a={...e,...t};for(const i of r){const l=i_(e[i],t[i]);if(!l.valid)return{valid:!1,mergeErrorPath:[i,...l.mergeErrorPath]};a[i]=l.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const a=e[r],i=t[r],l=i_(a,i);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Xx(e,t,n){const r=new Map;let a;for(const u of t.issues)if(u.code==="unrecognized_keys"){a??(a=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const i=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&a&&e.issues.push({...a,keys:i}),Wl(e))return e;const l=i_(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const S9=ye("$ZodTuple",(e,t)=>{Bt.init(e,t);const n=t.items;e._zod.parse=(r,a)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const l=[],u=[...n].reverse().findIndex(m=>m._zod.optin!=="optional"),d=u===-1?0:n.length-u;if(!t.rest){const m=i.length>n.length,p=i.length<d-1;if(m||p)return r.issues.push({...m?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let f=-1;for(const m of n){if(f++,f>=i.length&&f>=d)continue;const p=m._zod.run({value:i[f],issues:[]},a);p instanceof Promise?l.push(p.then(g=>ih(g,r,f))):ih(p,r,f)}if(t.rest){const m=i.slice(n.length);for(const p of m){f++;const g=t.rest._zod.run({value:p,issues:[]},a);g instanceof Promise?l.push(g.then(y=>ih(y,r,f))):ih(g,r,f)}}return l.length?Promise.all(l).then(()=>r):r}});function ih(e,t,n){e.issues.length&&t.issues.push(...Ti(n,e.issues)),t.value[n]=e.value}const E9=ye("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;if(!ic(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;const i=[],l=t.keyType._zod.values;if(l){n.value={};const u=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const m=t.valueType._zod.run({value:a[f],issues:[]},r);m instanceof Promise?i.push(m.then(p=>{p.issues.length&&n.issues.push(...Ti(f,p.issues)),n.value[f]=p.value})):(m.issues.length&&n.issues.push(...Ti(f,m.issues)),n.value[f]=m.value)}let d;for(const f in a)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(a)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&oI.test(u)&&d.issues.length){const p=t.keyType._zod.run({value:Number(u),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?n.value[u]=a[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Fs(p,r,Vs())),input:u,path:[u],inst:e});continue}const m=t.valueType._zod.run({value:a[u],issues:[]},r);m instanceof Promise?i.push(m.then(p=>{p.issues.length&&n.issues.push(...Ti(u,p.issues)),n.value[d.value]=p.value})):(m.issues.length&&n.issues.push(...Ti(u,m.issues)),n.value[d.value]=m.value)}}return i.length?Promise.all(i).then(()=>n):n}}),R9=ye("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=WA(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(a=>C$.has(typeof a)).map(a=>typeof a=="string"?lc(a):a.toString()).join("|")})$`),e._zod.parse=(a,i)=>{const l=a.value;return r.has(l)||a.issues.push({code:"invalid_value",values:n,input:l,inst:e}),a}}),x9=ye("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?lc(r):r?lc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),T9=ye("$ZodFile",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const a=n.value;return a instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:a,inst:e}),n}}),O9=ye("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ZA(e.constructor.name);const a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(l=>(n.value=l,n));if(a instanceof Promise)throw new Jl;return n.value=a,n}});function Jx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const hI=ye("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tb(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>Jx(i,n.value)):Jx(a,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),C9=ye("$ZodExactOptional",(e,t)=>{hI.init(e,t),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),A9=ye("$ZodNullable",(e,t)=>{Bt.init(e,t),xt(e._zod,"optin",()=>t.innerType._zod.optin),xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Tb(n.source)}|null)$`):void 0}),xt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),I9=ye("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>eT(i,t)):eT(a,t)}});function eT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const N9=ye("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),k9=ye("$ZodNonOptional",(e,t)=>{Bt.init(e,t),xt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>tT(i,e)):tT(a,e)}});function tT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const M9=ye("$ZodCatch",(e,t)=>{Bt.init(e,t),xt(e._zod,"optin",()=>t.innerType._zod.optin),xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(l=>Fs(l,r,Vs()))},input:n.value}),n.issues=[]),n)):(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>Fs(i,r,Vs()))},input:n.value}),n.issues=[]),n)}}),P9=ye("$ZodPipe",(e,t)=>{Bt.init(e,t),xt(e._zod,"values",()=>t.in._zod.values),xt(e._zod,"optin",()=>t.in._zod.optin),xt(e._zod,"optout",()=>t.out._zod.optout),xt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(l=>lh(l,t.in,r)):lh(i,t.in,r)}const a=t.in._zod.run(n,r);return a instanceof Promise?a.then(i=>lh(i,t.out,r)):lh(a,t.out,r)}});function lh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const D9=ye("$ZodReadonly",(e,t)=>{Bt.init(e,t),xt(e._zod,"propValues",()=>t.innerType._zod.propValues),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"optin",()=>t.innerType?._zod?.optin),xt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(nT):nT(a)}});function nT(e){return e.value=Object.freeze(e.value),e}const L9=ye("$ZodLazy",(e,t)=>{Bt.init(e,t),xt(e._zod,"innerType",()=>t.getter()),xt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),xt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),xt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),xt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),j9=ye("$ZodCustom",(e,t)=>{ir.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(i=>rT(i,n,r,e));rT(a,n,r,e)}});function rT(e,t,n,r){if(!e){const a={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(a.params=r._zod.def.params),t.issues.push(td(a))}}var oT;class $9{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const a={...r,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function U9(){return new $9}(oT=globalThis).__zod_globalRegistry??(oT.__zod_globalRegistry=U9());const ku=globalThis.__zod_globalRegistry;function z9(e,t){return new e({type:"string",...Le(t)})}function V9(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(t)})}function aT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(t)})}function F9(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(t)})}function B9(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(t)})}function q9(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(t)})}function H9(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(t)})}function pI(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(t)})}function G9(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(t)})}function Z9(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(t)})}function K9(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(t)})}function W9(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(t)})}function Y9(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(t)})}function Q9(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(t)})}function X9(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(t)})}function J9(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(t)})}function eU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(t)})}function tU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(t)})}function nU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(t)})}function rU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(t)})}function oU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(t)})}function aU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(t)})}function sU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(t)})}function iU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(t)})}function lU(e,t){return new e({type:"string",format:"date",check:"string_format",...Le(t)})}function cU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(t)})}function uU(e,t){return new e({type:"string",format:"duration",check:"string_format",...Le(t)})}function dU(e,t){return new e({type:"number",checks:[],...Le(t)})}function fU(e,t){return new e({type:"number",coerce:!0,checks:[],...Le(t)})}function hU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Le(t)})}function pU(e,t){return new e({type:"boolean",...Le(t)})}function mU(e,t){return new e({type:"boolean",coerce:!0,...Le(t)})}function gU(e,t){return new e({type:"null",...Le(t)})}function vU(e){return new e({type:"any"})}function yU(e){return new e({type:"unknown"})}function _U(e,t){return new e({type:"never",...Le(t)})}function sT(e,t){return new sI({check:"less_than",...Le(t),value:e,inclusive:!1})}function Gy(e,t){return new sI({check:"less_than",...Le(t),value:e,inclusive:!0})}function iT(e,t){return new iI({check:"greater_than",...Le(t),value:e,inclusive:!1})}function Zy(e,t){return new iI({check:"greater_than",...Le(t),value:e,inclusive:!0})}function lT(e,t){return new E8({check:"multiple_of",...Le(t),value:e})}function bU(e,t){return new x8({check:"max_size",...Le(t),maximum:e})}function wU(e,t){return new T8({check:"min_size",...Le(t),minimum:e})}function mI(e,t){return new O8({check:"max_length",...Le(t),maximum:e})}function jp(e,t){return new C8({check:"min_length",...Le(t),minimum:e})}function gI(e,t){return new A8({check:"length_equals",...Le(t),length:e})}function SU(e,t){return new I8({check:"string_format",format:"regex",...Le(t),pattern:e})}function EU(e){return new N8({check:"string_format",format:"lowercase",...Le(e)})}function RU(e){return new k8({check:"string_format",format:"uppercase",...Le(e)})}function xU(e,t){return new M8({check:"string_format",format:"includes",...Le(t),includes:e})}function TU(e,t){return new P8({check:"string_format",format:"starts_with",...Le(t),prefix:e})}function OU(e,t){return new D8({check:"string_format",format:"ends_with",...Le(t),suffix:e})}function CU(e,t){return new L8({check:"mime_type",mime:e,...Le(t)})}function bc(e){return new j8({check:"overwrite",tx:e})}function AU(e){return bc(t=>t.normalize(e))}function IU(){return bc(e=>e.trim())}function NU(){return bc(e=>e.toLowerCase())}function kU(){return bc(e=>e.toUpperCase())}function MU(){return bc(e=>T$(e))}function PU(e,t,n){return new e({type:"array",element:t,...Le(n)})}function DU(e,t){return new e({type:"file",...Le(t)})}function LU(e,t,n){const r=Le(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function jU(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Le(n)})}function $U(e){const t=UU(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(td(r,n.value,t._zod.def));else{const a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(td(a))}},e(n.value,n)));return t}function UU(e,t){const n=new ir({check:"custom",...Le(t)});return n._zod.check=e,n}function $p(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ku,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 Xt(e,t,n={path:[],schemaPath:[]}){var r;const a=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,m);else{const g=l.schema,y=t.processors[a.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);y(e,t,g,m)}const p=e._zod.parent;p&&(l.ref||(l.ref=p),Xt(p,t,m),t.seen.get(p).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&br(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function Up(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const u=e.metadataRegistry.get(l[0])?.id;if(u){const d=r.get(u);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,l[0])}}const a=l=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(l[0])?.id,g=e.external.uri??(w=>w);if(p)return{ref:g(p)};const y=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=y,{defId:y,ref:`${g("__shared")}#/${u}/${y}`}}if(l[1]===n)return{ref:"#"};const f=`#/${u}/`,m=l[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:f+m}},i=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:d,defId:f}=a(l);u.def={...u.schema},f&&(u.defId=f);const m=u.schema;for(const p in m)delete m[p];m.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
47
47
 
48
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const u=l[1];if(t===l[0]){i(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){i(l);continue}}if(e.metadataRegistry.get(l[0])?.id){i(l);continue}if(u.cycle){i(l);continue}if(u.count>1&&e.reused==="ref"){i(l);continue}}}function zp(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,f={...d},m=u.ref;if(u.ref=null,m){r(m);const g=e.seen.get(m),y=g.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(y)):Object.assign(d,y),Object.assign(d,f),l._zod.parent===m)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(y.$ref&&g.def)for(const S in d)S==="$ref"||S==="allOf"||S in g.def&&JSON.stringify(d[S])===JSON.stringify(g.def[S])&&delete d[S]}const p=l._zod.parent;if(p&&p!==m){r(p);const g=e.seen.get(p);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const y in d)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(d[y])===JSON.stringify(g.def[y])&&delete d[y]}e.override({zodSchema:l,jsonSchema:d,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(l)}Object.assign(a,n.def??n.schema);const i=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const l=JSON.parse(JSON.stringify(a));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vp(t,"input",e.processors),output:Vp(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function br(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return br(r.element,n);if(r.type==="set")return br(r.valueType,n);if(r.type==="lazy")return br(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return br(r.innerType,n);if(r.type==="intersection")return br(r.left,n)||br(r.right,n);if(r.type==="record"||r.type==="map")return br(r.keyType,n)||br(r.valueType,n);if(r.type==="pipe")return br(r.in,n)||br(r.out,n);if(r.type==="object"){for(const a in r.shape)if(br(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(const a of r.options)if(br(a,n))return!0;return!1}if(r.type==="tuple"){for(const a of r.items)if(br(a,n))return!0;return!!(r.rest&&br(r.rest,n))}return!1}const zU=(e,t={})=>n=>{const r=$p({...n,processors:t});return Xt(e,r),Up(r,e),zp(r,e)},Vp=(e,t,n={})=>r=>{const{libraryOptions:a,target:i}=r??{},l=$p({...a??{},target:i,io:t,processors:n});return Xt(e,l),Up(l,e),zp(l,e)},VU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vI=(e,t,n,r)=>{const a=n;a.type="string";const{minimum:i,maximum:l,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof l=="number"&&(a.maxLength=l),u&&(a.format=VU[u]??u,a.format===""&&delete a.format,u==="time"&&delete a.format),f&&(a.contentEncoding=f),d&&d.size>0){const m=[...d];m.length===1?a.pattern=m[0].source:m.length>1&&(a.allOf=[...m.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},yI=(e,t,n,r)=>{const a=n,{minimum:i,maximum:l,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:m}=e._zod.bag;typeof u=="string"&&u.includes("int")?a.type="integer":a.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(a.minimum=m,a.exclusiveMinimum=!0):a.exclusiveMinimum=m),typeof i=="number"&&(a.minimum=i,typeof m=="number"&&t.target!=="draft-04"&&(m>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(a.maximum=f,a.exclusiveMaximum=!0):a.exclusiveMaximum=f),typeof l=="number"&&(a.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete a.maximum:delete a.exclusiveMaximum)),typeof d=="number"&&(a.multipleOf=d)},_I=(e,t,n,r)=>{n.type="boolean"},FU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},BU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},bI=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},qU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},HU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},wI=(e,t,n,r)=>{n.not={}},SI=(e,t,n,r)=>{},EI=(e,t,n,r)=>{},GU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},RI=(e,t,n,r)=>{const a=e._zod.def,i=WA(a.entries);i.every(l=>typeof l=="number")&&(n.type="number"),i.every(l=>typeof l=="string")&&(n.type="string"),n.enum=i},xI=(e,t,n,r)=>{const a=e._zod.def,i=[];for(const l of a.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(l))}else i.push(l);if(i.length!==0)if(i.length===1){const l=i[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else i.every(l=>typeof l=="number")&&(n.type="number"),i.every(l=>typeof l=="string")&&(n.type="string"),i.every(l=>typeof l=="boolean")&&(n.type="boolean"),i.every(l=>l===null)&&(n.type="null"),n.enum=i},ZU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},KU=(e,t,n,r)=>{const a=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=i.source},TI=(e,t,n,r)=>{const a=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:u,mime:d}=e._zod.bag;l!==void 0&&(i.minLength=l),u!==void 0&&(i.maxLength=u),d?d.length===1?(i.contentMediaType=d[0],Object.assign(a,i)):(Object.assign(a,i),a.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(a,i)},WU=(e,t,n,r)=>{n.type="boolean"},OI=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},YU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},CI=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},QU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},XU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},AI=(e,t,n,r)=>{const a=n,i=e._zod.def,{minimum:l,maximum:u}=e._zod.bag;typeof l=="number"&&(a.minItems=l),typeof u=="number"&&(a.maxItems=u),a.type="array",a.items=Xt(i.element,t,{...r,path:[...r.path,"items"]})},II=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="object",a.properties={};const l=i.shape;for(const f in l)a.properties[f]=Xt(l[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(l)),d=new Set([...u].filter(f=>{const m=i.shape[f]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));d.size>0&&(a.required=Array.from(d)),i.catchall?._zod.def.type==="never"?a.additionalProperties=!1:i.catchall?i.catchall&&(a.additionalProperties=Xt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},NI=(e,t,n,r)=>{const a=e._zod.def,i=a.inclusive===!1,l=a.options.map((u,d)=>Xt(u,t,{...r,path:[...r.path,i?"oneOf":"anyOf",d]}));i?n.oneOf=l:n.anyOf=l},kI=(e,t,n,r)=>{const a=e._zod.def,i=Xt(a.left,t,{...r,path:[...r.path,"allOf",0]}),l=Xt(a.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(i)?i.allOf:[i],...u(l)?l.allOf:[l]];n.allOf=d},MI=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((g,y)=>Xt(g,t,{...r,path:[...r.path,l,y]})),f=i.rest?Xt(i.rest,t,{...r,path:[...r.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(a.prefixItems=d,f&&(a.items=f)):t.target==="openapi-3.0"?(a.items={anyOf:d},f&&a.items.anyOf.push(f),a.minItems=d.length,f||(a.maxItems=d.length)):(a.items=d,f&&(a.additionalItems=f));const{minimum:m,maximum:p}=e._zod.bag;typeof m=="number"&&(a.minItems=m),typeof p=="number"&&(a.maxItems=p)},PI=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="object";const l=i.keyType,d=l._zod.bag?.patterns;if(i.mode==="loose"&&d&&d.size>0){const m=Xt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(const p of d)a.patternProperties[p.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(a.propertyNames=Xt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),a.additionalProperties=Xt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const m=[...f].filter(p=>typeof p=="string"||typeof p=="number");m.length>0&&(a.required=m)}},DI=(e,t,n,r)=>{const a=e._zod.def,i=Xt(a.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=a.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},LI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},jI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},$I=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},UI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType;let l;try{l=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},zI=(e,t,n,r)=>{const a=e._zod.def,i=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;Xt(i,t,r);const l=t.seen.get(e);l.ref=i},VI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,n.readOnly=!0},JU=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},Ib=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},FI=(e,t,n,r)=>{const a=e._zod.innerType;Xt(a,t,r);const i=t.seen.get(e);i.ref=a},cT={string:vI,number:yI,boolean:_I,bigint:FU,symbol:BU,null:bI,undefined:qU,void:HU,never:wI,any:SI,unknown:EI,date:GU,enum:RI,literal:xI,nan:ZU,template_literal:KU,file:TI,success:WU,custom:OI,function:YU,transform:CI,map:QU,set:XU,array:AI,object:II,union:NI,intersection:kI,tuple:MI,record:PI,nullable:DI,nonoptional:LI,default:jI,prefault:$I,catch:UI,pipe:zI,readonly:VI,promise:JU,optional:Ib,lazy:FI};function Wre(e,t){if("_idmap"in e){const r=e,a=$p({...t,processors:cT}),i={};for(const d of r._idmap.entries()){const[f,m]=d;Xt(m,a)}const l={},u={registry:r,uri:t?.uri,defs:i};a.external=u;for(const d of r._idmap.entries()){const[f,m]=d;Up(a,m),l[f]=zp(a,m)}if(Object.keys(i).length>0){const d=a.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:i}}return{schemas:l}}const n=$p({...t,processors:cT});return Xt(e,n),Up(n,e),zp(n,e)}const e7=ye("ZodISODateTime",(e,t)=>{Q8.init(e,t),hn.init(e,t)});function BI(e){return iU(e7,e)}const t7=ye("ZodISODate",(e,t)=>{X8.init(e,t),hn.init(e,t)});function n7(e){return lU(t7,e)}const r7=ye("ZodISOTime",(e,t)=>{J8.init(e,t),hn.init(e,t)});function o7(e){return cU(r7,e)}const a7=ye("ZodISODuration",(e,t)=>{e9.init(e,t),hn.init(e,t)});function s7(e){return uU(a7,e)}const i7=(e,t)=>{Cb.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>U$(e,n)},flatten:{value:n=>$$(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,s_,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,s_,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ro=ye("ZodError",i7,{Parent:Error}),l7=km(Ro),c7=Mm(Ro),u7=Pm(Ro),d7=Dm(Ro),f7=B$(Ro),h7=q$(Ro),p7=H$(Ro),m7=G$(Ro),g7=Z$(Ro),v7=K$(Ro),y7=W$(Ro),_7=Y$(Ro),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vp(e,"input"),output:Vp(e,"output")}}),e.toJSONSchema=zU(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ks(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Ws(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>l7(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>u7(e,n,r),e.parseAsync=async(n,r)=>c7(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>d7(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>f7(e,n,r),e.decode=(n,r)=>h7(e,n,r),e.encodeAsync=async(n,r)=>p7(e,n,r),e.decodeAsync=async(n,r)=>m7(e,n,r),e.safeEncode=(n,r)=>g7(e,n,r),e.safeDecode=(n,r)=>v7(e,n,r),e.safeEncodeAsync=async(n,r)=>y7(e,n,r),e.safeDecodeAsync=async(n,r)=>_7(e,n,r),e.refine=(n,r)=>e.check(cz(n,r)),e.superRefine=n=>e.check(uz(n)),e.overwrite=n=>e.check(bc(n)),e.optional=()=>vn(e),e.exactOptional=()=>Y7(e),e.nullable=()=>hT(e),e.nullish=()=>vn(hT(e)),e.nonoptional=n=>nz(e,n),e.array=()=>Ee(e),e.or=n=>Lt([e,n]),e.and=n=>yd(e,n),e.transform=n=>c_(e,QI(n)),e.default=n=>J7(e,n),e.prefault=n=>tz(e,n),e.catch=n=>oz(e,n),e.pipe=n=>c_(e,n),e.readonly=()=>iz(e),e.describe=n=>{const r=e.clone();return ku.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ku.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ku.get(e);const r=e.clone();return ku.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),qI=ye("_ZodString",(e,t)=>{Ab.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>vI(e,r,a);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(SU(...r)),e.includes=(...r)=>e.check(xU(...r)),e.startsWith=(...r)=>e.check(TU(...r)),e.endsWith=(...r)=>e.check(OU(...r)),e.min=(...r)=>e.check(jp(...r)),e.max=(...r)=>e.check(mI(...r)),e.length=(...r)=>e.check(gI(...r)),e.nonempty=(...r)=>e.check(jp(1,...r)),e.lowercase=r=>e.check(EU(r)),e.uppercase=r=>e.check(RU(r)),e.trim=()=>e.check(IU()),e.normalize=(...r)=>e.check(AU(...r)),e.toLowerCase=()=>e.check(NU()),e.toUpperCase=()=>e.check(kU()),e.slugify=()=>e.check(MU())}),jm=ye("ZodString",(e,t)=>{Ab.init(e,t),qI.init(e,t),e.email=n=>e.check(V9(b7,n)),e.url=n=>e.check(pI(HI,n)),e.jwt=n=>e.check(sU(L7,n)),e.emoji=n=>e.check(G9(S7,n)),e.guid=n=>e.check(aT(uT,n)),e.uuid=n=>e.check(F9(ch,n)),e.uuidv4=n=>e.check(B9(ch,n)),e.uuidv6=n=>e.check(q9(ch,n)),e.uuidv7=n=>e.check(H9(ch,n)),e.nanoid=n=>e.check(Z9(E7,n)),e.guid=n=>e.check(aT(uT,n)),e.cuid=n=>e.check(K9(R7,n)),e.cuid2=n=>e.check(W9(x7,n)),e.ulid=n=>e.check(Y9(T7,n)),e.base64=n=>e.check(rU(M7,n)),e.base64url=n=>e.check(oU(P7,n)),e.xid=n=>e.check(Q9(O7,n)),e.ksuid=n=>e.check(X9(C7,n)),e.ipv4=n=>e.check(J9(A7,n)),e.ipv6=n=>e.check(eU(I7,n)),e.cidrv4=n=>e.check(tU(N7,n)),e.cidrv6=n=>e.check(nU(k7,n)),e.e164=n=>e.check(aU(D7,n)),e.datetime=n=>e.check(BI(n)),e.date=n=>e.check(n7(n)),e.time=n=>e.check(o7(n)),e.duration=n=>e.check(s7(n))});function D(e){return z9(jm,e)}const hn=ye("ZodStringFormat",(e,t)=>{dn.init(e,t),qI.init(e,t)}),b7=ye("ZodEmail",(e,t)=>{F8.init(e,t),hn.init(e,t)}),uT=ye("ZodGUID",(e,t)=>{z8.init(e,t),hn.init(e,t)}),ch=ye("ZodUUID",(e,t)=>{V8.init(e,t),hn.init(e,t)}),HI=ye("ZodURL",(e,t)=>{B8.init(e,t),hn.init(e,t)});function w7(e){return pI(HI,e)}const S7=ye("ZodEmoji",(e,t)=>{q8.init(e,t),hn.init(e,t)}),E7=ye("ZodNanoID",(e,t)=>{H8.init(e,t),hn.init(e,t)}),R7=ye("ZodCUID",(e,t)=>{G8.init(e,t),hn.init(e,t)}),x7=ye("ZodCUID2",(e,t)=>{Z8.init(e,t),hn.init(e,t)}),T7=ye("ZodULID",(e,t)=>{K8.init(e,t),hn.init(e,t)}),O7=ye("ZodXID",(e,t)=>{W8.init(e,t),hn.init(e,t)}),C7=ye("ZodKSUID",(e,t)=>{Y8.init(e,t),hn.init(e,t)}),A7=ye("ZodIPv4",(e,t)=>{t9.init(e,t),hn.init(e,t)}),I7=ye("ZodIPv6",(e,t)=>{n9.init(e,t),hn.init(e,t)}),N7=ye("ZodCIDRv4",(e,t)=>{r9.init(e,t),hn.init(e,t)}),k7=ye("ZodCIDRv6",(e,t)=>{o9.init(e,t),hn.init(e,t)}),M7=ye("ZodBase64",(e,t)=>{a9.init(e,t),hn.init(e,t)}),P7=ye("ZodBase64URL",(e,t)=>{i9.init(e,t),hn.init(e,t)}),D7=ye("ZodE164",(e,t)=>{l9.init(e,t),hn.init(e,t)}),L7=ye("ZodJWT",(e,t)=>{u9.init(e,t),hn.init(e,t)}),Za=ye("ZodNumber",(e,t)=>{cI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>yI(e,r,a),e.gt=(r,a)=>e.check(iT(r,a)),e.gte=(r,a)=>e.check(Zy(r,a)),e.min=(r,a)=>e.check(Zy(r,a)),e.lt=(r,a)=>e.check(sT(r,a)),e.lte=(r,a)=>e.check(Gy(r,a)),e.max=(r,a)=>e.check(Gy(r,a)),e.int=r=>e.check(dT(r)),e.safe=r=>e.check(dT(r)),e.positive=r=>e.check(iT(0,r)),e.nonnegative=r=>e.check(Zy(0,r)),e.negative=r=>e.check(sT(0,r)),e.nonpositive=r=>e.check(Gy(0,r)),e.multipleOf=(r,a)=>e.check(lT(r,a)),e.step=(r,a)=>e.check(lT(r,a)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ze(e){return dU(Za,e)}const j7=ye("ZodNumberFormat",(e,t)=>{d9.init(e,t),Za.init(e,t)});function dT(e){return hU(j7,e)}const GI=ye("ZodBoolean",(e,t)=>{f9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>_I(e,n,r)});function nt(e){return pU(GI,e)}const $7=ye("ZodNull",(e,t)=>{h9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bI(e,n,r)});function vd(e){return gU($7,e)}const U7=ye("ZodAny",(e,t)=>{p9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>SI()});function eo(){return vU(U7)}const z7=ye("ZodUnknown",(e,t)=>{m9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>EI()});function _t(){return yU(z7)}const V7=ye("ZodNever",(e,t)=>{g9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wI(e,n,r)});function Fp(e){return _U(V7,e)}const ZI=ye("ZodArray",(e,t)=>{v9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AI(e,n,r,a),e.element=t.element,e.min=(n,r)=>e.check(jp(n,r)),e.nonempty=n=>e.check(jp(1,n)),e.max=(n,r)=>e.check(mI(n,r)),e.length=(n,r)=>e.check(gI(n,r)),e.unwrap=()=>e.element});function Ee(e,t){return PU(ZI,e,t)}const $m=ye("ZodObject",(e,t)=>{_9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>II(e,n,r,a),xt(e,"shape",()=>t.shape),e.keyof=()=>$t(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_t()}),e.loose=()=>e.clone({...e._zod.def,catchall:_t()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>M$(e,n),e.safeExtend=n=>P$(e,n),e.merge=n=>D$(e,n),e.pick=n=>N$(e,n),e.omit=n=>k$(e,n),e.partial=(...n)=>L$(XI,e,n[0]),e.required=(...n)=>j$(JI,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...Le(t)};return new $m(n)}function Yre(e,t){return new $m({type:"object",shape:e,catchall:Fp(),...Le(t)})}function ar(e,t){return new $m({type:"object",shape:e,catchall:_t(),...Le(t)})}const KI=ye("ZodUnion",(e,t)=>{fI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>NI(e,n,r,a),e.options=t.options});function Lt(e,t){return new KI({type:"union",options:e,...Le(t)})}const F7=ye("ZodDiscriminatedUnion",(e,t)=>{KI.init(e,t),b9.init(e,t)});function WI(e,t,n){return new F7({type:"union",options:t,discriminator:e,...Le(n)})}const B7=ye("ZodIntersection",(e,t)=>{w9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>kI(e,n,r,a)});function yd(e,t){return new B7({type:"intersection",left:e,right:t})}const q7=ye("ZodTuple",(e,t)=>{S9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>MI(e,n,r,a),e.rest=n=>e.clone({...e._zod.def,rest:n})});function fT(e,t,n){const r=t instanceof Bt,a=r?n:t,i=r?t:null;return new q7({type:"tuple",items:e,rest:i,...Le(a)})}const YI=ye("ZodRecord",(e,t)=>{E9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>PI(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function Et(e,t,n){return new YI({type:"record",keyType:e,valueType:t,...Le(n)})}const l_=ye("ZodEnum",(e,t)=>{R9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>RI(e,r,a),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{const i={};for(const l of r)if(n.has(l))i[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new l_({...t,checks:[],...Le(a),entries:i})},e.exclude=(r,a)=>{const i={...t.entries};for(const l of r)if(n.has(l))delete i[l];else throw new Error(`Key ${l} not found in enum`);return new l_({...t,checks:[],...Le(a),entries:i})}});function $t(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new l_({type:"enum",entries:n,...Le(t)})}const H7=ye("ZodLiteral",(e,t)=>{x9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>xI(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function je(e,t){return new H7({type:"literal",values:Array.isArray(e)?e:[e],...Le(t)})}const G7=ye("ZodFile",(e,t)=>{T9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>TI(e,n,r),e.min=(n,r)=>e.check(wU(n,r)),e.max=(n,r)=>e.check(bU(n,r)),e.mime=(n,r)=>e.check(CU(Array.isArray(n)?n:[n],r))});function Z7(e){return DU(G7,e)}const K7=ye("ZodTransform",(e,t)=>{O9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CI(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ZA(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(td(i,n.value,t));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(td(l))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(i=>(n.value=i,n)):(n.value=a,n)}});function QI(e){return new K7({type:"transform",transform:e})}const XI=ye("ZodOptional",(e,t)=>{hI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Ib(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function vn(e){return new XI({type:"optional",innerType:e})}const W7=ye("ZodExactOptional",(e,t)=>{C9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Ib(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Y7(e){return new W7({type:"optional",innerType:e})}const Q7=ye("ZodNullable",(e,t)=>{A9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>DI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new Q7({type:"nullable",innerType:e})}const X7=ye("ZodDefault",(e,t)=>{I9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>jI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function J7(e,t){return new X7({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const ez=ye("ZodPrefault",(e,t)=>{N9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>$I(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function tz(e,t){return new ez({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const JI=ye("ZodNonOptional",(e,t)=>{k9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>LI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function nz(e,t){return new JI({type:"nonoptional",innerType:e,...Le(t)})}const rz=ye("ZodCatch",(e,t)=>{M9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>UI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oz(e,t){return new rz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const az=ye("ZodPipe",(e,t)=>{P9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>zI(e,n,r,a),e.in=t.in,e.out=t.out});function c_(e,t){return new az({type:"pipe",in:e,out:t})}const sz=ye("ZodReadonly",(e,t)=>{D9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>VI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function iz(e){return new sz({type:"readonly",innerType:e})}const lz=ye("ZodLazy",(e,t)=>{L9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>FI(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function ua(e){return new lz({type:"lazy",getter:e})}const Nb=ye("ZodCustom",(e,t)=>{j9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>OI(e,n)});function eN(e,t){return LU(Nb,e??(()=>!0),t)}function cz(e,t={}){return jU(Nb,e,t)}function uz(e){return $U(e)}function Qre(e,t={}){const n=new Nb({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Le(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function kb(e,t){return c_(QI(e),t)}const dz={custom:"custom"};function tN(e){return fU(Za,e)}function pT(e){return mU(GI,e)}function Ce(...e){return E$(PA(e))}function fz(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function En({error:e,localization:t,localizeErrors:n=!0}){var r;const a="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:a;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const i=e.error.code;if(t?.[i])return t[i]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||a}function Vi(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function u_(e,t){for(const n in e)if(e[n]===t)return n}function nd(e,t){let n=D().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var hz={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},pz={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},mz={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},gz={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},vz={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},yz={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},_z={...vz,...yz},bz={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},wz={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Sz={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ez={INVALID_SESSION_TOKEN:"Invalid session token"},Rz={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},xz={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Tz={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},Oz={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Cz={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},Az={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},Iz={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Nz={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...gz,...hz,...pz,...mz,..._z,...bz,...wz,...Sz,...Ez,...Rz,...xz,...Tz,...Oz,...Cz,...Az,...Iz},kz={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},mT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},gT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function Mz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Pz=e=>{switch(e){case"success":return jz;case"info":return Uz;case"warning":return $z;case"error":return zz;default:return null}},Dz=Array(12).fill(0),Lz=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},Dz.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),jz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),$z=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Uz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fz=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let d_=1;class Bz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:d_++,l=this.toasts.find(d=>d.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...t,id:i,title:r}),{...d,...t,id:i,dismissible:u,title:r}):d):this.addToast({title:r,...a,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,l;const u=a.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(Hz(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof m=="object"&&!ee.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,m)=>u.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||d_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Dr=new Bz,qz=(e,t)=>{const n=t?.id||d_++;return Dr.addToast({title:e,...t,id:n}),n},Hz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Gz=qz,Zz=()=>Dr.toasts,Kz=()=>Dr.getActiveToasts(),vT=Object.assign(Gz,{success:Dr.success,info:Dr.info,warning:Dr.warning,error:Dr.error,custom:Dr.custom,message:Dr.message,promise:Dr.promise,dismiss:Dr.dismiss,loading:Dr.loading},{getHistory:Zz,getToasts:Kz});Mz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function uh(e){return e.label!==void 0}const Wz=3,Yz="24px",Qz="16px",yT=4e3,Xz=356,Jz=14,eV=45,tV=200;function Jo(...e){return e.filter(Boolean).join(" ")}function nV(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const rV=e=>{var t,n,r,a,i,l,u,d,f;const{invert:m,toast:p,unstyled:g,interacting:y,setHeights:w,visibleToasts:S,heights:b,index:E,toasts:R,expanded:T,removeToast:O,defaultRichColors:C,closeButton:I,style:N,cancelButtonStyle:P,actionButtonStyle:$,className:K="",descriptionClassName:V="",duration:G,position:U,gap:J,expandByDefault:le,classNames:B,icons:W,closeButtonAriaLabel:Y="Close toast"}=e,[pe,ae]=ee.useState(null),[M,q]=ee.useState(null),[F,L]=ee.useState(!1),[z,X]=ee.useState(!1),[de,ve]=ee.useState(!1),[Ie,Ae]=ee.useState(!1),[H,ne]=ee.useState(!1),[_e,se]=ee.useState(0),[ue,Oe]=ee.useState(0),Pe=ee.useRef(p.duration||G||yT),Xe=ee.useRef(null),Fe=ee.useRef(null),We=E===0,Z=E+1<=S,re=p.type,oe=p.dismissible!==!1,we=p.className||"",xe=p.descriptionClassName||"",Re=ee.useMemo(()=>b.findIndex(qe=>qe.toastId===p.id)||0,[b,p.id]),ke=ee.useMemo(()=>{var qe;return(qe=p.closeButton)!=null?qe:I},[p.closeButton,I]),Je=ee.useMemo(()=>p.duration||G||yT,[p.duration,G]),ot=ee.useRef(0),Ct=ee.useRef(0),ur=ee.useRef(0),tn=ee.useRef(null),[Rn,nn]=U.split("-"),jn=ee.useMemo(()=>b.reduce((qe,ut,Wt)=>Wt>=Re?qe:qe+ut.height,0),[b,Re]),xn=Fz(),Qa=p.invert||m,ga=re==="loading";Ct.current=ee.useMemo(()=>Re*J+jn,[Re,jn]),ee.useEffect(()=>{Pe.current=Je},[Je]),ee.useEffect(()=>{L(!0)},[]),ee.useEffect(()=>{const qe=Fe.current;if(qe){const ut=qe.getBoundingClientRect().height;return Oe(ut),w(Wt=>[{toastId:p.id,height:ut,position:p.position},...Wt]),()=>w(Wt=>Wt.filter(qt=>qt.toastId!==p.id))}},[w,p.id]),ee.useLayoutEffect(()=>{if(!F)return;const qe=Fe.current,ut=qe.style.height;qe.style.height="auto";const Wt=qe.getBoundingClientRect().height;qe.style.height=ut,Oe(Wt),w(qt=>qt.find(It=>It.toastId===p.id)?qt.map(It=>It.toastId===p.id?{...It,height:Wt}:It):[{toastId:p.id,height:Wt,position:p.position},...qt])},[F,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const Be=ee.useCallback(()=>{X(!0),se(Ct.current),w(qe=>qe.filter(ut=>ut.toastId!==p.id)),setTimeout(()=>{O(p)},tV)},[p,O,w,Ct]);ee.useEffect(()=>{if(p.promise&&re==="loading"||p.duration===1/0||p.type==="loading")return;let qe;return T||y||xn?(()=>{if(ur.current<ot.current){const qt=new Date().getTime()-ot.current;Pe.current=Pe.current-qt}ur.current=new Date().getTime()})():Pe.current!==1/0&&(ot.current=new Date().getTime(),qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Be()},Pe.current)),()=>clearTimeout(qe)},[T,y,p,re,xn,Be]),ee.useEffect(()=>{p.delete&&(Be(),p.onDismiss==null||p.onDismiss.call(p,p))},[Be,p.delete]);function bt(){var qe;if(W?.loading){var ut;return ee.createElement("div",{className:Jo(B?.loader,p==null||(ut=p.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":re==="loading"},W.loading)}return ee.createElement(Lz,{className:Jo(B?.loader,p==null||(qe=p.classNames)==null?void 0:qe.loader),visible:re==="loading"})}const Tt=p.icon||W?.[re]||Pz(re);var ct,At;return ee.createElement("li",{tabIndex:0,ref:Fe,className:Jo(K,we,B?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,B?.default,B?.[re],p==null||(n=p.classNames)==null?void 0:n[re]),"data-sonner-toast":"","data-rich-colors":(ct=p.richColors)!=null?ct:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":F,"data-promise":!!p.promise,"data-swiped":H,"data-removed":z,"data-visible":Z,"data-y-position":Rn,"data-x-position":nn,"data-index":E,"data-front":We,"data-swiping":de,"data-dismissible":oe,"data-type":re,"data-invert":Qa,"data-swipe-out":Ie,"data-swipe-direction":M,"data-expanded":!!(T||le&&F),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":R.length-E,"--offset":`${z?_e:Ct.current}px`,"--initial-height":le?"auto":`${ue}px`,...N,...p.style},onDragEnd:()=>{ve(!1),ae(null),tn.current=null},onPointerDown:qe=>{qe.button!==2&&(ga||!oe||(Xe.current=new Date,se(Ct.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(ve(!0),tn.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,ut,Wt;if(Ie||!oe)return;tn.current=null;const qt=Number(((qe=Fe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dr=Number(((ut=Fe.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((Wt=Xe.current)==null?void 0:Wt.getTime()),rn=pe==="x"?qt:dr,ao=Math.abs(rn)/It;if(Math.abs(rn)>=eV||ao>.11){se(Ct.current),p.onDismiss==null||p.onDismiss.call(p,p),q(pe==="x"?qt>0?"right":"left":dr>0?"down":"up"),Be(),Ae(!0);return}else{var Yn,xr;(Yn=Fe.current)==null||Yn.style.setProperty("--swipe-amount-x","0px"),(xr=Fe.current)==null||xr.style.setProperty("--swipe-amount-y","0px")}ne(!1),ve(!1),ae(null)},onPointerMove:qe=>{var ut,Wt,qt;if(!tn.current||!oe||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const It=qe.clientY-tn.current.y,rn=qe.clientX-tn.current.x;var ao;const Yn=(ao=e.swipeDirections)!=null?ao:nV(U);!pe&&(Math.abs(rn)>1||Math.abs(It)>1)&&ae(Math.abs(rn)>Math.abs(It)?"x":"y");let xr={x:0,y:0};const Hi=Co=>1/(1.5+Math.abs(Co)/20);if(pe==="y"){if(Yn.includes("top")||Yn.includes("bottom"))if(Yn.includes("top")&&It<0||Yn.includes("bottom")&&It>0)xr.y=It;else{const Co=It*Hi(It);xr.y=Math.abs(Co)<Math.abs(It)?Co:It}}else if(pe==="x"&&(Yn.includes("left")||Yn.includes("right")))if(Yn.includes("left")&&rn<0||Yn.includes("right")&&rn>0)xr.x=rn;else{const Co=rn*Hi(rn);xr.x=Math.abs(Co)<Math.abs(rn)?Co:rn}(Math.abs(xr.x)>0||Math.abs(xr.y)>0)&&ne(!0),(Wt=Fe.current)==null||Wt.style.setProperty("--swipe-amount-x",`${xr.x}px`),(qt=Fe.current)==null||qt.style.setProperty("--swipe-amount-y",`${xr.y}px`)}},ke&&!p.jsx&&re!=="loading"?ee.createElement("button",{"aria-label":Y,"data-disabled":ga,"data-close-button":!0,onClick:ga||!oe?()=>{}:()=>{Be(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Jo(B?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(At=W?.close)!=null?At:Vz):null,(re||p.icon||p.promise)&&p.icon!==null&&(W?.[re]!==null||p.icon)?ee.createElement("div",{"data-icon":"",className:Jo(B?.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||bt():null,p.type!=="loading"?Tt:null):null,ee.createElement("div",{"data-content":"",className:Jo(B?.content,p==null||(i=p.classNames)==null?void 0:i.content)},ee.createElement("div",{"data-title":"",className:Jo(B?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ee.createElement("div",{"data-description":"",className:Jo(V,xe,B?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ee.isValidElement(p.cancel)?p.cancel:p.cancel&&uh(p.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||P,onClick:qe=>{uh(p.cancel)&&oe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,qe),Be())},className:Jo(B?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,ee.isValidElement(p.action)?p.action:p.action&&uh(p.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:qe=>{uh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,qe),!qe.defaultPrevented&&Be())},className:Jo(B?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function _T(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function oV(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,l=i?"--mobile-offset":"--offset",u=i?Qz:Yz;function d(f){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(u)}),n}const aV=ee.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:f,offset:m,mobileOffset:p,theme:g="light",richColors:y,duration:w,style:S,visibleToasts:b=Wz,toastOptions:E,dir:R=_T(),gap:T=Jz,icons:O,containerAriaLabel:C="Notifications"}=t,[I,N]=ee.useState([]),P=ee.useMemo(()=>r?I.filter(F=>F.toasterId===r):I.filter(F=>!F.toasterId),[I,r]),$=ee.useMemo(()=>Array.from(new Set([i].concat(P.filter(F=>F.position).map(F=>F.position)))),[P,i]),[K,V]=ee.useState([]),[G,U]=ee.useState(!1),[J,le]=ee.useState(!1),[B,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=ee.useRef(null),pe=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),ae=ee.useRef(null),M=ee.useRef(!1),q=ee.useCallback(F=>{N(L=>{var z;return(z=L.find(X=>X.id===F.id))!=null&&z.delete||Dr.dismiss(F.id),L.filter(({id:X})=>X!==F.id)})},[]);return ee.useEffect(()=>Dr.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{N(L=>L.map(z=>z.id===F.id?{...z,delete:!0}:z))});return}setTimeout(()=>{yA.flushSync(()=>{N(L=>{const z=L.findIndex(X=>X.id===F.id);return z!==-1?[...L.slice(0,z),{...L[z],...F},...L.slice(z+1)]:[F,...L]})})})}),[I]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:L})=>{W(L?"dark":"light")})}catch{F.addListener(({matches:z})=>{try{W(z?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{I.length<=1&&U(!1)},[I]),ee.useEffect(()=>{const F=L=>{var z;if(l.every(ve=>L[ve]||L.code===ve)){var de;U(!0),(de=Y.current)==null||de.focus()}L.code==="Escape"&&(document.activeElement===Y.current||(z=Y.current)!=null&&z.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[l]),ee.useEffect(()=>{if(Y.current)return()=>{ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null,M.current=!1)}},[Y.current]),ee.createElement("section",{ref:n,"aria-label":`${C} ${pe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((F,L)=>{var z;const[X,de]=F.split("-");return P.length?ee.createElement("ol",{key:F,dir:R==="auto"?_T():R,tabIndex:-1,ref:Y,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":X,"data-x-position":de,style:{"--front-toast-height":`${((z=K[0])==null?void 0:z.height)||0}px`,"--width":`${Xz}px`,"--gap":`${T}px`,...S,...oV(m,p)},onBlur:ve=>{M.current&&!ve.currentTarget.contains(ve.relatedTarget)&&(M.current=!1,ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null))},onFocus:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||M.current||(M.current=!0,ae.current=ve.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{J||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||le(!0)},onPointerUp:()=>le(!1)},P.filter(ve=>!ve.position&&L===0||ve.position===F).map((ve,Ie)=>{var Ae,H;return ee.createElement(rV,{key:ve.id,icons:O,index:Ie,toast:ve,defaultRichColors:y,duration:(Ae=E?.duration)!=null?Ae:w,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:a,visibleToasts:b,closeButton:(H=E?.closeButton)!=null?H:d,interacting:J,position:F,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:q,toasts:P.filter(ne=>ne.position==ve.position),heights:K.filter(ne=>ne.position==ve.position),setHeights:V,expandByDefault:u,gap:T,expanded:G,swipeDirections:t.swipeDirections})})):null}))}),nN=A.createContext({});function rN(){return A.useContext(nN)}var Ky,bT;function sV(){if(bT)return Ky;bT=1;var e=function(){};return Ky=e,Ky}var iV=sV();const lV=Ga(iV);function cV({async:e,appendTo:t,defer:n,id:r,nonce:a,src:i}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),a&&l.setAttribute("nonce",a),l.src=i,(t==="head"?document.head:document.body).appendChild(l)}var uV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let Bu=null,rd=!1;const Bp=new Set,qp=new Set,dV=typeof window<"u",ec="___grecaptcha_cfg",oN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function fV(){if(!dV)return;function e(n){if(rd)n();else{window[ec]||(window[ec]={});const r=window[ec];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){rd=!0;for(const n of qp)n();qp.clear()}window[oN]=t}function hV({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:a=!1}){const i=a?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",u=new URLSearchParams({render:n});return t&&u.set("onload",t),e&&u.set("hl",e),`https://www.${i}/recaptcha/${l}?${u.toString()}`}function pV({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:a}){const i={id:"google-recaptcha-v3"},l=hV({language:e,onLoadCallbackName:oN,render:t,useEnterprise:r,useRecaptchaNet:a});if(Bu){if(Bu!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Bu=l,cV(Object.assign(Object.assign(Object.assign({},i),n),{src:l}))}function mV(e){if(!window[ec])return;const t=window[ec];t.clients&&delete t.clients[e]}function gV(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,a=uV(t,["onLoadCallback","onLoadCallbackName"]);if(Bp.size===0&&fV(),pV(a),Bp.add(e),n&&(rd?n():qp.add(n)),r){let i=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};rd?i():qp.add(i)}}function vV(e){var t,n,r;Bp.delete(e),Bp.size===0&&(window.grecaptcha=void 0,window[ec]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Bu}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Bu=null,rd=!1)}let wT=!1;function yV({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:a,useEnterprise:i,useRecaptchaNet:l}){var u,d,f,m,p,g,y;const w=A.useId(),[S,b]=A.useState(null),[E,R]=A.useState(null),T=A.useRef(!1);A.useEffect(()=>{function N(){var P;const $=i?(P=window.grecaptcha)===null||P===void 0?void 0:P.enterprise:window.grecaptcha;if(!$)throw new Error("reCAPTCHA not found");if(!$.ready)throw new Error("reCAPTCHA ready callback not found");$.ready(()=>{b($)})}return gV(w,{language:n,onLoadCallback:N,onLoadCallbackName:a?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:a?.appendTo,async:a?.async,defer:a?.defer,id:a?.id,nonce:a?.nonce},useEnterprise:i,useRecaptchaNet:l}),()=>{vV(w),b(null)}},[e?.element,w,n,r,a?.appendTo,a?.async,a?.defer,a?.id,a?.nonce,a?.onLoadCallbackName,i,l]),A.useEffect(()=>{var N,P,$;if(!e?.element||!S?.render)return;const K={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((N=e.parameters)===null||N===void 0?void 0:N.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},V=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!V)throw new Error("reCAPTCHA container element not found");const G=S.render(V,K);return!((P=e?.parameters)===null||P===void 0)&&P.hidden&&(wT||(lV(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),wT=!0),($=V.querySelector(".grecaptcha-badge"))===null||$===void 0||$.style.setProperty("display","none")),R(G),T.current=!0,()=>{R(null),T.current=!1,mV(G),V.innerHTML=""}},[e?.element,(u=e?.parameters)===null||u===void 0?void 0:u.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(m=e?.parameters)===null||m===void 0?void 0:m.errorCallback,(p=e?.parameters)===null||p===void 0?void 0:p.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(y=e?.parameters)===null||y===void 0?void 0:y.theme,S,r]);const O=!!e?.element,C=O?E:r,I=A.useMemo(()=>C!==null&&S?.execute?N=>{if(C===null||!S?.execute)throw new Error("reCAPTCHA has not been loaded");return O&&!T.current?(console.warn("Client ID not mounted"),null):S.execute(C,{action:N})}:void 0,[C,S,O]);return x.jsx(nN.Provider,{value:{container:e?.element,executeRecaptcha:I,reCaptchaInstance:S},children:t})}var _V=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},vo=new _V;function bV(){return()=>{}}function Ka(){return A.useSyncExternalStore(bV,()=>!0,()=>!1)}function aN(){const[e,t]=A.useState();return A.useEffect(()=>{const n=()=>{const a=document.documentElement.getAttribute("lang");t(a??void 0)};n();const r=new MutationObserver(a=>{for(const i of a)i.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Mb(){const[e,t]=A.useState("light");return A.useEffect(()=>{const n=()=>{var a;const i=document.documentElement.classList.contains("dark")||((a=document.documentElement.getAttribute("style"))==null?void 0:a.includes("color-scheme: dark"));t(i?"dark":"light")};n();const r=new MutationObserver(a=>{for(const i of a)(i.attributeName==="style"||i.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function wV({children:e}){const t=Ka(),{captcha:n}=A.useContext(ht);return n?.provider!=="google-recaptcha-v3"?e:x.jsxs(yV,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&x.jsx("style",{children:`
48
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const u=l[1];if(t===l[0]){i(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){i(l);continue}}if(e.metadataRegistry.get(l[0])?.id){i(l);continue}if(u.cycle){i(l);continue}if(u.count>1&&e.reused==="ref"){i(l);continue}}}function zp(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,f={...d},m=u.ref;if(u.ref=null,m){r(m);const g=e.seen.get(m),y=g.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(y)):Object.assign(d,y),Object.assign(d,f),l._zod.parent===m)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(y.$ref&&g.def)for(const S in d)S==="$ref"||S==="allOf"||S in g.def&&JSON.stringify(d[S])===JSON.stringify(g.def[S])&&delete d[S]}const p=l._zod.parent;if(p&&p!==m){r(p);const g=e.seen.get(p);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const y in d)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(d[y])===JSON.stringify(g.def[y])&&delete d[y]}e.override({zodSchema:l,jsonSchema:d,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(l)}Object.assign(a,n.def??n.schema);const i=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{const l=JSON.parse(JSON.stringify(a));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vp(t,"input",e.processors),output:Vp(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function br(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return br(r.element,n);if(r.type==="set")return br(r.valueType,n);if(r.type==="lazy")return br(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return br(r.innerType,n);if(r.type==="intersection")return br(r.left,n)||br(r.right,n);if(r.type==="record"||r.type==="map")return br(r.keyType,n)||br(r.valueType,n);if(r.type==="pipe")return br(r.in,n)||br(r.out,n);if(r.type==="object"){for(const a in r.shape)if(br(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(const a of r.options)if(br(a,n))return!0;return!1}if(r.type==="tuple"){for(const a of r.items)if(br(a,n))return!0;return!!(r.rest&&br(r.rest,n))}return!1}const zU=(e,t={})=>n=>{const r=$p({...n,processors:t});return Xt(e,r),Up(r,e),zp(r,e)},Vp=(e,t,n={})=>r=>{const{libraryOptions:a,target:i}=r??{},l=$p({...a??{},target:i,io:t,processors:n});return Xt(e,l),Up(l,e),zp(l,e)},VU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vI=(e,t,n,r)=>{const a=n;a.type="string";const{minimum:i,maximum:l,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof i=="number"&&(a.minLength=i),typeof l=="number"&&(a.maxLength=l),u&&(a.format=VU[u]??u,a.format===""&&delete a.format,u==="time"&&delete a.format),f&&(a.contentEncoding=f),d&&d.size>0){const m=[...d];m.length===1?a.pattern=m[0].source:m.length>1&&(a.allOf=[...m.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},yI=(e,t,n,r)=>{const a=n,{minimum:i,maximum:l,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:m}=e._zod.bag;typeof u=="string"&&u.includes("int")?a.type="integer":a.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(a.minimum=m,a.exclusiveMinimum=!0):a.exclusiveMinimum=m),typeof i=="number"&&(a.minimum=i,typeof m=="number"&&t.target!=="draft-04"&&(m>=i?delete a.minimum:delete a.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(a.maximum=f,a.exclusiveMaximum=!0):a.exclusiveMaximum=f),typeof l=="number"&&(a.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete a.maximum:delete a.exclusiveMaximum)),typeof d=="number"&&(a.multipleOf=d)},_I=(e,t,n,r)=>{n.type="boolean"},FU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},BU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},bI=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},qU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},HU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},wI=(e,t,n,r)=>{n.not={}},SI=(e,t,n,r)=>{},EI=(e,t,n,r)=>{},GU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},RI=(e,t,n,r)=>{const a=e._zod.def,i=WA(a.entries);i.every(l=>typeof l=="number")&&(n.type="number"),i.every(l=>typeof l=="string")&&(n.type="string"),n.enum=i},xI=(e,t,n,r)=>{const a=e._zod.def,i=[];for(const l of a.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(l))}else i.push(l);if(i.length!==0)if(i.length===1){const l=i[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else i.every(l=>typeof l=="number")&&(n.type="number"),i.every(l=>typeof l=="string")&&(n.type="string"),i.every(l=>typeof l=="boolean")&&(n.type="boolean"),i.every(l=>l===null)&&(n.type="null"),n.enum=i},ZU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},KU=(e,t,n,r)=>{const a=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=i.source},TI=(e,t,n,r)=>{const a=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:l,maximum:u,mime:d}=e._zod.bag;l!==void 0&&(i.minLength=l),u!==void 0&&(i.maxLength=u),d?d.length===1?(i.contentMediaType=d[0],Object.assign(a,i)):(Object.assign(a,i),a.anyOf=d.map(f=>({contentMediaType:f}))):Object.assign(a,i)},WU=(e,t,n,r)=>{n.type="boolean"},OI=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},YU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},CI=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},QU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},XU=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},AI=(e,t,n,r)=>{const a=n,i=e._zod.def,{minimum:l,maximum:u}=e._zod.bag;typeof l=="number"&&(a.minItems=l),typeof u=="number"&&(a.maxItems=u),a.type="array",a.items=Xt(i.element,t,{...r,path:[...r.path,"items"]})},II=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="object",a.properties={};const l=i.shape;for(const f in l)a.properties[f]=Xt(l[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(l)),d=new Set([...u].filter(f=>{const m=i.shape[f]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));d.size>0&&(a.required=Array.from(d)),i.catchall?._zod.def.type==="never"?a.additionalProperties=!1:i.catchall?i.catchall&&(a.additionalProperties=Xt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},NI=(e,t,n,r)=>{const a=e._zod.def,i=a.inclusive===!1,l=a.options.map((u,d)=>Xt(u,t,{...r,path:[...r.path,i?"oneOf":"anyOf",d]}));i?n.oneOf=l:n.anyOf=l},kI=(e,t,n,r)=>{const a=e._zod.def,i=Xt(a.left,t,{...r,path:[...r.path,"allOf",0]}),l=Xt(a.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(i)?i.allOf:[i],...u(l)?l.allOf:[l]];n.allOf=d},MI=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="array";const l=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((g,y)=>Xt(g,t,{...r,path:[...r.path,l,y]})),f=i.rest?Xt(i.rest,t,{...r,path:[...r.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(a.prefixItems=d,f&&(a.items=f)):t.target==="openapi-3.0"?(a.items={anyOf:d},f&&a.items.anyOf.push(f),a.minItems=d.length,f||(a.maxItems=d.length)):(a.items=d,f&&(a.additionalItems=f));const{minimum:m,maximum:p}=e._zod.bag;typeof m=="number"&&(a.minItems=m),typeof p=="number"&&(a.maxItems=p)},PI=(e,t,n,r)=>{const a=n,i=e._zod.def;a.type="object";const l=i.keyType,d=l._zod.bag?.patterns;if(i.mode==="loose"&&d&&d.size>0){const m=Xt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(const p of d)a.patternProperties[p.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(a.propertyNames=Xt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),a.additionalProperties=Xt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const m=[...f].filter(p=>typeof p=="string"||typeof p=="number");m.length>0&&(a.required=m)}},DI=(e,t,n,r)=>{const a=e._zod.def,i=Xt(a.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=a.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},LI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},jI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},$I=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},UI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType;let l;try{l=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},zI=(e,t,n,r)=>{const a=e._zod.def,i=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;Xt(i,t,r);const l=t.seen.get(e);l.ref=i},VI=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType,n.readOnly=!0},JU=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},Ib=(e,t,n,r)=>{const a=e._zod.def;Xt(a.innerType,t,r);const i=t.seen.get(e);i.ref=a.innerType},FI=(e,t,n,r)=>{const a=e._zod.innerType;Xt(a,t,r);const i=t.seen.get(e);i.ref=a},cT={string:vI,number:yI,boolean:_I,bigint:FU,symbol:BU,null:bI,undefined:qU,void:HU,never:wI,any:SI,unknown:EI,date:GU,enum:RI,literal:xI,nan:ZU,template_literal:KU,file:TI,success:WU,custom:OI,function:YU,transform:CI,map:QU,set:XU,array:AI,object:II,union:NI,intersection:kI,tuple:MI,record:PI,nullable:DI,nonoptional:LI,default:jI,prefault:$I,catch:UI,pipe:zI,readonly:VI,promise:JU,optional:Ib,lazy:FI};function Wre(e,t){if("_idmap"in e){const r=e,a=$p({...t,processors:cT}),i={};for(const d of r._idmap.entries()){const[f,m]=d;Xt(m,a)}const l={},u={registry:r,uri:t?.uri,defs:i};a.external=u;for(const d of r._idmap.entries()){const[f,m]=d;Up(a,m),l[f]=zp(a,m)}if(Object.keys(i).length>0){const d=a.target==="draft-2020-12"?"$defs":"definitions";l.__shared={[d]:i}}return{schemas:l}}const n=$p({...t,processors:cT});return Xt(e,n),Up(n,e),zp(n,e)}const e7=ye("ZodISODateTime",(e,t)=>{Q8.init(e,t),hn.init(e,t)});function BI(e){return iU(e7,e)}const t7=ye("ZodISODate",(e,t)=>{X8.init(e,t),hn.init(e,t)});function n7(e){return lU(t7,e)}const r7=ye("ZodISOTime",(e,t)=>{J8.init(e,t),hn.init(e,t)});function o7(e){return cU(r7,e)}const a7=ye("ZodISODuration",(e,t)=>{e9.init(e,t),hn.init(e,t)});function s7(e){return uU(a7,e)}const i7=(e,t)=>{Cb.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>U$(e,n)},flatten:{value:n=>$$(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,s_,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,s_,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ro=ye("ZodError",i7,{Parent:Error}),l7=km(Ro),c7=Mm(Ro),u7=Pm(Ro),d7=Dm(Ro),f7=B$(Ro),h7=q$(Ro),p7=H$(Ro),m7=G$(Ro),g7=Z$(Ro),v7=K$(Ro),y7=W$(Ro),_7=Y$(Ro),Kt=ye("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vp(e,"input"),output:Vp(e,"output")}}),e.toJSONSchema=zU(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ks(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Ws(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>l7(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>u7(e,n,r),e.parseAsync=async(n,r)=>c7(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>d7(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>f7(e,n,r),e.decode=(n,r)=>h7(e,n,r),e.encodeAsync=async(n,r)=>p7(e,n,r),e.decodeAsync=async(n,r)=>m7(e,n,r),e.safeEncode=(n,r)=>g7(e,n,r),e.safeDecode=(n,r)=>v7(e,n,r),e.safeEncodeAsync=async(n,r)=>y7(e,n,r),e.safeDecodeAsync=async(n,r)=>_7(e,n,r),e.refine=(n,r)=>e.check(cz(n,r)),e.superRefine=n=>e.check(uz(n)),e.overwrite=n=>e.check(bc(n)),e.optional=()=>vn(e),e.exactOptional=()=>Y7(e),e.nullable=()=>hT(e),e.nullish=()=>vn(hT(e)),e.nonoptional=n=>nz(e,n),e.array=()=>Ee(e),e.or=n=>Lt([e,n]),e.and=n=>yd(e,n),e.transform=n=>c_(e,QI(n)),e.default=n=>J7(e,n),e.prefault=n=>tz(e,n),e.catch=n=>oz(e,n),e.pipe=n=>c_(e,n),e.readonly=()=>iz(e),e.describe=n=>{const r=e.clone();return ku.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ku.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ku.get(e);const r=e.clone();return ku.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),qI=ye("_ZodString",(e,t)=>{Ab.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>vI(e,r,a);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(SU(...r)),e.includes=(...r)=>e.check(xU(...r)),e.startsWith=(...r)=>e.check(TU(...r)),e.endsWith=(...r)=>e.check(OU(...r)),e.min=(...r)=>e.check(jp(...r)),e.max=(...r)=>e.check(mI(...r)),e.length=(...r)=>e.check(gI(...r)),e.nonempty=(...r)=>e.check(jp(1,...r)),e.lowercase=r=>e.check(EU(r)),e.uppercase=r=>e.check(RU(r)),e.trim=()=>e.check(IU()),e.normalize=(...r)=>e.check(AU(...r)),e.toLowerCase=()=>e.check(NU()),e.toUpperCase=()=>e.check(kU()),e.slugify=()=>e.check(MU())}),jm=ye("ZodString",(e,t)=>{Ab.init(e,t),qI.init(e,t),e.email=n=>e.check(V9(b7,n)),e.url=n=>e.check(pI(HI,n)),e.jwt=n=>e.check(sU(L7,n)),e.emoji=n=>e.check(G9(S7,n)),e.guid=n=>e.check(aT(uT,n)),e.uuid=n=>e.check(F9(ch,n)),e.uuidv4=n=>e.check(B9(ch,n)),e.uuidv6=n=>e.check(q9(ch,n)),e.uuidv7=n=>e.check(H9(ch,n)),e.nanoid=n=>e.check(Z9(E7,n)),e.guid=n=>e.check(aT(uT,n)),e.cuid=n=>e.check(K9(R7,n)),e.cuid2=n=>e.check(W9(x7,n)),e.ulid=n=>e.check(Y9(T7,n)),e.base64=n=>e.check(rU(M7,n)),e.base64url=n=>e.check(oU(P7,n)),e.xid=n=>e.check(Q9(O7,n)),e.ksuid=n=>e.check(X9(C7,n)),e.ipv4=n=>e.check(J9(A7,n)),e.ipv6=n=>e.check(eU(I7,n)),e.cidrv4=n=>e.check(tU(N7,n)),e.cidrv6=n=>e.check(nU(k7,n)),e.e164=n=>e.check(aU(D7,n)),e.datetime=n=>e.check(BI(n)),e.date=n=>e.check(n7(n)),e.time=n=>e.check(o7(n)),e.duration=n=>e.check(s7(n))});function D(e){return z9(jm,e)}const hn=ye("ZodStringFormat",(e,t)=>{dn.init(e,t),qI.init(e,t)}),b7=ye("ZodEmail",(e,t)=>{F8.init(e,t),hn.init(e,t)}),uT=ye("ZodGUID",(e,t)=>{z8.init(e,t),hn.init(e,t)}),ch=ye("ZodUUID",(e,t)=>{V8.init(e,t),hn.init(e,t)}),HI=ye("ZodURL",(e,t)=>{B8.init(e,t),hn.init(e,t)});function w7(e){return pI(HI,e)}const S7=ye("ZodEmoji",(e,t)=>{q8.init(e,t),hn.init(e,t)}),E7=ye("ZodNanoID",(e,t)=>{H8.init(e,t),hn.init(e,t)}),R7=ye("ZodCUID",(e,t)=>{G8.init(e,t),hn.init(e,t)}),x7=ye("ZodCUID2",(e,t)=>{Z8.init(e,t),hn.init(e,t)}),T7=ye("ZodULID",(e,t)=>{K8.init(e,t),hn.init(e,t)}),O7=ye("ZodXID",(e,t)=>{W8.init(e,t),hn.init(e,t)}),C7=ye("ZodKSUID",(e,t)=>{Y8.init(e,t),hn.init(e,t)}),A7=ye("ZodIPv4",(e,t)=>{t9.init(e,t),hn.init(e,t)}),I7=ye("ZodIPv6",(e,t)=>{n9.init(e,t),hn.init(e,t)}),N7=ye("ZodCIDRv4",(e,t)=>{r9.init(e,t),hn.init(e,t)}),k7=ye("ZodCIDRv6",(e,t)=>{o9.init(e,t),hn.init(e,t)}),M7=ye("ZodBase64",(e,t)=>{a9.init(e,t),hn.init(e,t)}),P7=ye("ZodBase64URL",(e,t)=>{i9.init(e,t),hn.init(e,t)}),D7=ye("ZodE164",(e,t)=>{l9.init(e,t),hn.init(e,t)}),L7=ye("ZodJWT",(e,t)=>{u9.init(e,t),hn.init(e,t)}),Za=ye("ZodNumber",(e,t)=>{cI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>yI(e,r,a),e.gt=(r,a)=>e.check(iT(r,a)),e.gte=(r,a)=>e.check(Zy(r,a)),e.min=(r,a)=>e.check(Zy(r,a)),e.lt=(r,a)=>e.check(sT(r,a)),e.lte=(r,a)=>e.check(Gy(r,a)),e.max=(r,a)=>e.check(Gy(r,a)),e.int=r=>e.check(dT(r)),e.safe=r=>e.check(dT(r)),e.positive=r=>e.check(iT(0,r)),e.nonnegative=r=>e.check(Zy(0,r)),e.negative=r=>e.check(sT(0,r)),e.nonpositive=r=>e.check(Gy(0,r)),e.multipleOf=(r,a)=>e.check(lT(r,a)),e.step=(r,a)=>e.check(lT(r,a)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ze(e){return dU(Za,e)}const j7=ye("ZodNumberFormat",(e,t)=>{d9.init(e,t),Za.init(e,t)});function dT(e){return hU(j7,e)}const GI=ye("ZodBoolean",(e,t)=>{f9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>_I(e,n,r)});function et(e){return pU(GI,e)}const $7=ye("ZodNull",(e,t)=>{h9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bI(e,n,r)});function vd(e){return gU($7,e)}const U7=ye("ZodAny",(e,t)=>{p9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>SI()});function eo(){return vU(U7)}const z7=ye("ZodUnknown",(e,t)=>{m9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>EI()});function _t(){return yU(z7)}const V7=ye("ZodNever",(e,t)=>{g9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wI(e,n,r)});function Fp(e){return _U(V7,e)}const ZI=ye("ZodArray",(e,t)=>{v9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AI(e,n,r,a),e.element=t.element,e.min=(n,r)=>e.check(jp(n,r)),e.nonempty=n=>e.check(jp(1,n)),e.max=(n,r)=>e.check(mI(n,r)),e.length=(n,r)=>e.check(gI(n,r)),e.unwrap=()=>e.element});function Ee(e,t){return PU(ZI,e,t)}const $m=ye("ZodObject",(e,t)=>{_9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>II(e,n,r,a),xt(e,"shape",()=>t.shape),e.keyof=()=>$t(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_t()}),e.loose=()=>e.clone({...e._zod.def,catchall:_t()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>M$(e,n),e.safeExtend=n=>P$(e,n),e.merge=n=>D$(e,n),e.pick=n=>N$(e,n),e.omit=n=>k$(e,n),e.partial=(...n)=>L$(XI,e,n[0]),e.required=(...n)=>j$(JI,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...Le(t)};return new $m(n)}function Yre(e,t){return new $m({type:"object",shape:e,catchall:Fp(),...Le(t)})}function ar(e,t){return new $m({type:"object",shape:e,catchall:_t(),...Le(t)})}const KI=ye("ZodUnion",(e,t)=>{fI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>NI(e,n,r,a),e.options=t.options});function Lt(e,t){return new KI({type:"union",options:e,...Le(t)})}const F7=ye("ZodDiscriminatedUnion",(e,t)=>{KI.init(e,t),b9.init(e,t)});function WI(e,t,n){return new F7({type:"union",options:t,discriminator:e,...Le(n)})}const B7=ye("ZodIntersection",(e,t)=>{w9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>kI(e,n,r,a)});function yd(e,t){return new B7({type:"intersection",left:e,right:t})}const q7=ye("ZodTuple",(e,t)=>{S9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>MI(e,n,r,a),e.rest=n=>e.clone({...e._zod.def,rest:n})});function fT(e,t,n){const r=t instanceof Bt,a=r?n:t,i=r?t:null;return new q7({type:"tuple",items:e,rest:i,...Le(a)})}const YI=ye("ZodRecord",(e,t)=>{E9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>PI(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function Et(e,t,n){return new YI({type:"record",keyType:e,valueType:t,...Le(n)})}const l_=ye("ZodEnum",(e,t)=>{R9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(r,a,i)=>RI(e,r,a),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{const i={};for(const l of r)if(n.has(l))i[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new l_({...t,checks:[],...Le(a),entries:i})},e.exclude=(r,a)=>{const i={...t.entries};for(const l of r)if(n.has(l))delete i[l];else throw new Error(`Key ${l} not found in enum`);return new l_({...t,checks:[],...Le(a),entries:i})}});function $t(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new l_({type:"enum",entries:n,...Le(t)})}const H7=ye("ZodLiteral",(e,t)=>{x9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>xI(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function je(e,t){return new H7({type:"literal",values:Array.isArray(e)?e:[e],...Le(t)})}const G7=ye("ZodFile",(e,t)=>{T9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>TI(e,n,r),e.min=(n,r)=>e.check(wU(n,r)),e.max=(n,r)=>e.check(bU(n,r)),e.mime=(n,r)=>e.check(CU(Array.isArray(n)?n:[n],r))});function Z7(e){return DU(G7,e)}const K7=ye("ZodTransform",(e,t)=>{O9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CI(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ZA(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(td(i,n.value,t));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(td(l))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(i=>(n.value=i,n)):(n.value=a,n)}});function QI(e){return new K7({type:"transform",transform:e})}const XI=ye("ZodOptional",(e,t)=>{hI.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Ib(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function vn(e){return new XI({type:"optional",innerType:e})}const W7=ye("ZodExactOptional",(e,t)=>{C9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Ib(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Y7(e){return new W7({type:"optional",innerType:e})}const Q7=ye("ZodNullable",(e,t)=>{A9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>DI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function hT(e){return new Q7({type:"nullable",innerType:e})}const X7=ye("ZodDefault",(e,t)=>{I9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>jI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function J7(e,t){return new X7({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const ez=ye("ZodPrefault",(e,t)=>{N9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>$I(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function tz(e,t){return new ez({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():QA(t)}})}const JI=ye("ZodNonOptional",(e,t)=>{k9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>LI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function nz(e,t){return new JI({type:"nonoptional",innerType:e,...Le(t)})}const rz=ye("ZodCatch",(e,t)=>{M9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>UI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oz(e,t){return new rz({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const az=ye("ZodPipe",(e,t)=>{P9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>zI(e,n,r,a),e.in=t.in,e.out=t.out});function c_(e,t){return new az({type:"pipe",in:e,out:t})}const sz=ye("ZodReadonly",(e,t)=>{D9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>VI(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function iz(e){return new sz({type:"readonly",innerType:e})}const lz=ye("ZodLazy",(e,t)=>{L9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>FI(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function ua(e){return new lz({type:"lazy",getter:e})}const Nb=ye("ZodCustom",(e,t)=>{j9.init(e,t),Kt.init(e,t),e._zod.processJSONSchema=(n,r,a)=>OI(e,n)});function eN(e,t){return LU(Nb,e??(()=>!0),t)}function cz(e,t={}){return jU(Nb,e,t)}function uz(e){return $U(e)}function Qre(e,t={}){const n=new Nb({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Le(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function kb(e,t){return c_(QI(e),t)}const dz={custom:"custom"};function tN(e){return fU(Za,e)}function pT(e){return mU(GI,e)}function Ce(...e){return E$(PA(e))}function fz(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function En({error:e,localization:t,localizeErrors:n=!0}){var r;const a="Request failed";if(!n)return e?.message?e.message:(r=e?.error)!=null&&r.message?e.error.message:a;if(typeof e=="string"&&t?.[e])return t[e];if(e?.error){if(e.error.code){const i=e.error.code;if(t?.[i])return t[i]}return e.error.message||e.error.code||e.error.statusText||t?.REQUEST_FAILED}return e?.message||t?.REQUEST_FAILED||a}function Vi(e){return typeof window<"u"?new URLSearchParams(window.location.search).get(e):null}function u_(e,t){for(const n in e)if(e[n]===t)return n}function nd(e,t){let n=D().min(1,{message:t?.PASSWORD_REQUIRED});return e?.minLength&&(n=n.min(e.minLength,{message:t?.PASSWORD_TOO_SHORT})),e?.maxLength&&(n=n.max(e.maxLength,{message:t?.PASSWORD_TOO_LONG})),e?.regex&&(n=n.regex(e.regex,{message:t?.INVALID_PASSWORD})),n}var hz={FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application"},pz={FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously"},mz={INVALID_METADATA_TYPE:"metadata must be an object or undefined",REFILL_AMOUNT_AND_INTERVAL_REQUIRED:"refillAmount is required when refillInterval is provided",REFILL_INTERVAL_AND_AMOUNT_REQUIRED:"refillInterval is required when refillAmount is provided",USER_BANNED:"User is banned",UNAUTHORIZED_SESSION:"Unauthorized or invalid session",KEY_NOT_FOUND:"API Key not found",KEY_DISABLED:"API Key is disabled",KEY_EXPIRED:"API Key has expired",USAGE_EXCEEDED:"API Key has reached its usage limit",KEY_NOT_RECOVERABLE:"API Key is not recoverable",EXPIRES_IN_IS_TOO_SMALL:"The expiresIn is smaller than the predefined minimum value.",EXPIRES_IN_IS_TOO_LARGE:"The expiresIn is larger than the predefined maximum value.",INVALID_REMAINING:"The remaining count is either too large or too small.",INVALID_PREFIX_LENGTH:"The prefix length is either too large or too small.",INVALID_NAME_LENGTH:"The name length is either too large or too small.",METADATA_DISABLED:"Metadata is disabled.",RATE_LIMIT_EXCEEDED:"Rate limit exceeded.",NO_VALUES_TO_UPDATE:"No values to update.",KEY_DISABLED_EXPIRATION:"Custom key expiration values are disabled.",INVALID_API_KEY:"Invalid API key.",INVALID_USER_ID_FROM_API_KEY:"The user id from the API key is invalid.",INVALID_API_KEY_GETTER_RETURN_TYPE:"API Key getter returned an invalid key type. Expected string.",SERVER_ONLY_PROPERTY:"The property you're trying to set can only be set from the server auth instance only."},gz={USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account."},vz={VERIFICATION_FAILED:"Captcha verification failed",MISSING_RESPONSE:"Missing CAPTCHA response",UNKNOWN_ERROR:"Something went wrong"},yz={MISSING_SECRET_KEY:"Missing secret key",SERVICE_UNAVAILABLE:"CAPTCHA service unavailable"},_z={...vz,...yz},bz={OTP_EXPIRED:"otp expired",INVALID_OTP:"Invalid OTP",INVALID_EMAIL:"Invalid email",USER_NOT_FOUND:"User not found",TOO_MANY_ATTEMPTS:"Too many attempts"},wz={INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration"},Sz={PASSWORD_COMPROMISED:"The password you entered has been compromised. Please choose a different password."},Ez={INVALID_SESSION_TOKEN:"Invalid session token"},Rz={YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"you are not allowed to invite user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached"},xz={CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey"},Tz={INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified"},Oz={SUBSCRIPTION_NOT_FOUND:"Subscription not found",SUBSCRIPTION_PLAN_NOT_FOUND:"Subscription plan not found",ALREADY_SUBSCRIBED_PLAN:"You're already subscribed to this plan",UNABLE_TO_CREATE_CUSTOMER:"Unable to create customer",FAILED_TO_FETCH_PLANS:"Failed to fetch plans",EMAIL_VERIFICATION_REQUIRED:"Email verification is required before you can subscribe to a plan",SUBSCRIPTION_NOT_ACTIVE:"Subscription is not active",SUBSCRIPTION_NOT_SCHEDULED_FOR_CANCELLATION:"Subscription is not scheduled for cancellation"},Cz={TEAM_LIMIT_REACHED:"Team limit reached for this organization",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached for this team",TEAM_NOT_FOUND:"Team not found",TEAM_MEMBER_NOT_FOUND:"Team member not found",TEAM_NAME_TOO_LONG:"Team name is too long",CANNOT_REMOVE_LAST_TEAM:"Cannot remove the last team",NOT_ORGANIZATION_MEMBER:"User is not a member of the organization",ALREADY_TEAM_MEMBER:"User is already a member of this team",INSUFFICIENT_TEAM_PERMISSIONS:"Insufficient permissions to perform this action on team"},Az={OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"},Iz={INVALID_USERNAME_OR_PASSWORD:"invalid username or password",EMAIL_NOT_VERIFIED:"email not verified",UNEXPECTED_ERROR:"unexpected error",USERNAME_IS_ALREADY_TAKEN:"username is already taken. please try another.",USERNAME_TOO_SHORT:"username is too short",USERNAME_TOO_LONG:"username is too long",INVALID_USERNAME:"username is invalid"},Nz={APP:"App",ACCOUNT:"Account",ACCOUNTS:"Accounts",ACCOUNTS_DESCRIPTION:"Switch between your currently signed in accounts.",ACCOUNTS_INSTRUCTIONS:"Sign in to an additional account.",ADD_ACCOUNT:"Add Account",ADD_PASSKEY:"Add Passkey",ALREADY_HAVE_AN_ACCOUNT:"Already have an account?",AVATAR:"Avatar",AVATAR_DESCRIPTION:"Click on the avatar to upload a custom one from your files.",AVATAR_INSTRUCTIONS:"An avatar is optional but strongly recommended.",BACKUP_CODE_REQUIRED:"Backup code is required",BACKUP_CODES:"Backup Codes",BACKUP_CODES_DESCRIPTION:"Save these backup codes in a secure place. You can use them to access your account if you lose your two-factor authentication method.",BACKUP_CODE_PLACEHOLDER:"Backup Code",BACKUP_CODE:"Backup Code",CANCEL:"Cancel",CHANGE_PASSWORD:"Change Password",CHANGE_PASSWORD_DESCRIPTION:"Enter your current password and a new password.",CHANGE_PASSWORD_INSTRUCTIONS:"Please use 8 characters at minimum.",CHANGE_PASSWORD_SUCCESS:"Your password has been changed.",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Confirm Password",CONFIRM_PASSWORD_REQUIRED:"Confirm password is required",CONTINUE_WITH_AUTHENTICATOR:"Continue with Authenticator",COPIED_TO_CLIPBOARD:"Copied to clipboard",COPY_TO_CLIPBOARD:"Copy to clipboard",COPY_ALL_CODES:"Copy all codes",CONTINUE:"Continue",CURRENT_PASSWORD:"Current Password",CURRENT_PASSWORD_PLACEHOLDER:"Current Password",CURRENT_SESSION:"Current Session",UPDATE:"Update",DELETE:"Delete",DELETE_AVATAR:"Delete Avatar",DELETE_ACCOUNT:"Delete Account",DELETE_ACCOUNT_DESCRIPTION:"Permanently remove your account and all of its contents. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_INSTRUCTIONS:"Please confirm the deletion of your account. This action is not reversible, so please continue with caution.",DELETE_ACCOUNT_VERIFY:"Please check your email to verify the deletion of your account.",DELETE_ACCOUNT_SUCCESS:"Your account has been deleted.",DISABLE_TWO_FACTOR:"Disable Two-Factor",DISABLED_CREDENTIALS_DESCRIPTION:"Choose a provider to login to your account",DONT_HAVE_AN_ACCOUNT:"Don't have an account?",DONE:"Done",EMAIL:"Email",EMAIL_DESCRIPTION:"Enter the email address you want to use to log in.",EMAIL_INSTRUCTIONS:"Please enter a valid email address.",EMAIL_IS_THE_SAME:"Email is the same",EMAIL_PLACEHOLDER:"m@example.com",EMAIL_REQUIRED:"Email address is required",EMAIL_VERIFY_CHANGE:"Please check your email to verify the change.",EMAIL_VERIFICATION:"Email Verification",EMAIL_VERIFICATION_DESCRIPTION:"Please check your email for the verification code to complete your registration.",EMAIL_VERIFICATION_SUCCESS:"Email verification successful.",ENABLE_TWO_FACTOR:"Enable Two-Factor",IS_INVALID:"is invalid",IS_REQUIRED:"is required",IS_THE_SAME:"is the same",FORGOT_AUTHENTICATOR:"Forgot authenticator?",FORGOT_PASSWORD:"Forgot Password",FORGOT_PASSWORD_ACTION:"Send reset link",FORGOT_PASSWORD_DESCRIPTION:"Enter your email to reset your password",FORGOT_PASSWORD_EMAIL:"Check your email for the password reset link.",FORGOT_PASSWORD_LINK:"Forgot your password?",LINK:"Link",MAGIC_LINK:"Magic Link",MAGIC_LINK_ACTION:"Send magic link",MAGIC_LINK_DESCRIPTION:"Enter your email to receive a magic link",MAGIC_LINK_EMAIL:"Check your email for the magic link",EMAIL_OTP:"Email Code",EMAIL_OTP_SEND_ACTION:"Send code",EMAIL_OTP_VERIFY_ACTION:"Verify code",EMAIL_OTP_DESCRIPTION:"Enter your email to receive a code",EMAIL_OTP_VERIFICATION_SENT:"Please check your email for the verification code.",NAME:"Name",NAME_DESCRIPTION:"Please enter your full name, or a display name.",NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",NAME_PLACEHOLDER:"Name",NEW_PASSWORD:"New Password",NEW_PASSWORD_PLACEHOLDER:"New Password",NEW_PASSWORD_REQUIRED:"New password is required",ONE_TIME_PASSWORD:"One-Time Password",OR_CONTINUE_WITH:"Or continue with",PASSKEY:"Passkey",PASSKEYS:"Passkeys",PASSKEYS_DESCRIPTION:"Manage your passkeys for secure access.",PASSKEYS_INSTRUCTIONS:"Securely access your account without a password.",PERSONAL_ACCOUNT:"Personal Account",API_KEYS:"API Keys",API_KEYS_DESCRIPTION:"Manage your API keys for secure access.",API_KEYS_INSTRUCTIONS:"Generate API keys to access your account programmatically.",CREATE_API_KEY:"Create API Key",CREATE_API_KEY_DESCRIPTION:"Enter a unique name for your API key to differentiate it from other keys.",API_KEY_NAME_PLACEHOLDER:"New API Key",API_KEY_CREATED:"API Key Created",CREATE_API_KEY_SUCCESS:"Please copy your API key and store it in a safe place. For security reasons we cannot show it again.",NEVER_EXPIRES:"Never Expires",EXPIRES:"Expires",NO_EXPIRATION:"No Expiration",CREATE_ORGANIZATION:"Create Organization",ORGANIZATION:"Organization",ORGANIZATION_NAME:"Name",ORGANIZATION_NAME_PLACEHOLDER:"Acme Inc.",ORGANIZATION_NAME_DESCRIPTION:"This is your organization's visible name.",ORGANIZATION_NAME_INSTRUCTIONS:"Please use 32 characters at maximum.",ORGANIZATION_SLUG:"Slug URL",ORGANIZATION_SLUG_DESCRIPTION:"This is your organization's URL namespace.",ORGANIZATION_SLUG_INSTRUCTIONS:"Please use 48 characters at maximum.",ORGANIZATION_SLUG_PLACEHOLDER:"acme-inc",CREATE_ORGANIZATION_SUCCESS:"Organization created successfully",PASSWORD:"Password",PASSWORD_PLACEHOLDER:"Password",PASSWORD_REQUIRED:"Password is required",PASSWORDS_DO_NOT_MATCH:"Passwords do not match",PROVIDERS:"Providers",PROVIDERS_DESCRIPTION:"Connect your account with a third-party service.",RECOVER_ACCOUNT:"Recover Account",RECOVER_ACCOUNT_ACTION:"Recover account",RECOVER_ACCOUNT_DESCRIPTION:"Please enter a backup code to access your account",REMEMBER_ME:"Remember me",RESEND_CODE:"Resend code",RESEND_VERIFICATION_EMAIL:"Resend Verification Email",RESET_PASSWORD:"Reset Password",RESET_PASSWORD_ACTION:"Save new password",RESET_PASSWORD_DESCRIPTION:"Enter your new password below",RESET_PASSWORD_SUCCESS:"Password reset successfully",REQUEST_FAILED:"Request failed",REVOKE:"Revoke",DELETE_API_KEY:"Delete API Key",DELETE_API_KEY_CONFIRM:"Are you sure you want to delete this API key?",API_KEY:"API Key",SIGN_IN:"Sign In",SIGN_IN_ACTION:"Login",SIGN_IN_DESCRIPTION:"Enter your email below to login to your account",SIGN_IN_USERNAME_DESCRIPTION:"Enter your username or email to login to your account",SIGN_IN_WITH:"Sign in with",SIGN_OUT:"Sign Out",SIGN_UP:"Sign Up",SIGN_UP_ACTION:"Create an account",SIGN_UP_DESCRIPTION:"Enter your information to create an account",SIGN_UP_EMAIL:"Check your email for the verification link.",SESSIONS:"Sessions",SESSIONS_DESCRIPTION:"Manage your active sessions and revoke access.",SET_PASSWORD:"Set Password",SET_PASSWORD_DESCRIPTION:"Click the button below to receive an email to set up a password for your account.",SETTINGS:"Settings",SAVE:"Save",SECURITY:"Security",SWITCH_ACCOUNT:"Switch Account",TRUST_DEVICE:"Trust this device",TWO_FACTOR:"Two-Factor",TWO_FACTOR_ACTION:"Verify code",TWO_FACTOR_DESCRIPTION:"Please enter your one-time password to continue",TWO_FACTOR_CARD_DESCRIPTION:"Add an extra layer of security to your account.",TWO_FACTOR_DISABLE_INSTRUCTIONS:"Please enter your password to disable 2FA.",TWO_FACTOR_ENABLE_INSTRUCTIONS:"Please enter your password to enable 2FA.",TWO_FACTOR_ENABLED:"Two-factor authentication has been enabled",TWO_FACTOR_DISABLED:"Two-Factor Authentication has been disabled",TWO_FACTOR_PROMPT:"Two-Factor Authentication",TWO_FACTOR_TOTP_LABEL:"Scan the QR Code with your Authenticator",SEND_VERIFICATION_CODE:"Send verification code",UNLINK:"Unlink",UPDATED_SUCCESSFULLY:"updated successfully",USERNAME:"Username",USERNAME_DESCRIPTION:"Enter the username you want to use to log in.",USERNAME_INSTRUCTIONS:"Please use 32 characters at maximum.",USERNAME_PLACEHOLDER:"Username",OPTIONAL_BRACKETS:"(Optional)",SIGN_IN_USERNAME_PLACEHOLDER:"Username or email",VERIFY_YOUR_EMAIL:"Verify Your Email",VERIFY_YOUR_EMAIL_DESCRIPTION:"Please verify your email address. Check your inbox for the verification email. If you haven't received the email, click the button below to resend.",GO_BACK:"Go back",SESSION_NOT_FRESH:"Your session is not fresh. Please sign in again.",UPLOAD_AVATAR:"Upload Avatar",LOGO:"Logo",LOGO_DESCRIPTION:"Click on the logo to upload a custom one from your files.",LOGO_INSTRUCTIONS:"A logo is optional but strongly recommended.",UPLOAD:"Upload",UPLOAD_LOGO:"Upload Logo",DELETE_LOGO:"Delete Logo",PRIVACY_POLICY:"Privacy Policy",TERMS_OF_SERVICE:"Terms of Service",PROTECTED_BY_RECAPTCHA:"This site is protected by reCAPTCHA.",BY_CONTINUING_YOU_AGREE:"By continuing, you agree to the",USER:"User",ORGANIZATIONS:"Organizations",ORGANIZATIONS_DESCRIPTION:"Manage your organizations and memberships.",ORGANIZATIONS_INSTRUCTIONS:"Create an organization to collaborate with other users.",LEAVE_ORGANIZATION:"Leave Organization",LEAVE_ORGANIZATION_CONFIRM:"Are you sure you want to leave this organization?",LEAVE_ORGANIZATION_SUCCESS:"You have successfully left the organization.",MANAGE_ORGANIZATION:"Manage Organization",REMOVE_MEMBER:"Remove Member",REMOVE_MEMBER_CONFIRM:"Are you sure you want to remove this member from the organization?",REMOVE_MEMBER_SUCCESS:"Member removed successfully",INVITE_MEMBER:"Invite Member",MEMBERS:"Members",MEMBERS_DESCRIPTION:"Add or remove members and manage their roles.",MEMBERS_INSTRUCTIONS:"Invite new members to your organization.",INVITE_MEMBER_DESCRIPTION:"Send an invitation to add a new member to your organization.",ROLE:"Role",SELECT_ROLE:"Select a role",ADMIN:"Admin",MEMBER:"Member",GUEST:"Guest",OWNER:"Owner",UPDATE_ROLE_DESCRIPTION:"Update the role for this member",UPDATE_ROLE:"Update Role",MEMBER_ROLE_UPDATED:"Member role updated successfully",SEND_INVITATION:"Send Invitation",SEND_INVITATION_SUCCESS:"Invitation sent successfully",PENDING_INVITATIONS:"Pending Invitations",PENDING_INVITATIONS_DESCRIPTION:"Manage pending invitations to your organization.",PENDING_USER_INVITATIONS_DESCRIPTION:"Invitations you've received from organizations.",CANCEL_INVITATION:"Cancel Invitation",INVITATION_CANCELLED:"Invitation cancelled successfully",ACCEPT_INVITATION:"Accept Invitation",ACCEPT_INVITATION_DESCRIPTION:"You have been invited to join an organization.",INVITATION_ACCEPTED:"Invitation accepted successfully",INVITATION_REJECTED:"Invitation rejected successfully",ACCEPT:"Accept",REJECT:"Reject",INVITATION_EXPIRED:"This invitation has expired",DELETE_ORGANIZATION:"Delete Organization",DELETE_ORGANIZATION_DESCRIPTION:"Permanently remove your organization and all of its contents. This action is not reversible — please continue with caution.",DELETE_ORGANIZATION_SUCCESS:"Organization deleted successfully",DELETE_ORGANIZATION_INSTRUCTIONS:"Enter the organization slug to continue:",SLUG_REQUIRED:"Organization slug is required",SLUG_DOES_NOT_MATCH:"The slug does not match",TEAM:"Team",TEAMS:"Teams",TEAM_ACTIVE:"Active",TEAM_SET_ACTIVE:"Set Active",CREATE_TEAM:"Create Team",CREATE_TEAM_SUCCESS:"Team created successfully",UPDATE_TEAM:"Update Team",UPDATE_TEAMS:"Update Teams",SELECT_TEAMS:"Select teams",ADD:"Add",REMOVE:"Remove",UPDATE_TEAM_DESCRIPTION:"Update the name for this team",UPDATE_TEAMS_DESCRIPTION:"Add or remove teams for this member",REMOVE_TEAM_CONFIRM:"Are you sure you want to remove this team from the organization?",CREATE_TEAM_INSTRUCTIONS:"Add new team to your organization.",TEAM_NAME:"Team Name",TEAM_NAME_PLACEHOLDER:"Engineering Team",TEAM_NAME_DESCRIPTION:"This is your team's visible name.",TEAM_NAME_INSTRUCTIONS:"Please use 64 characters at maximum.",TEAMS_DESCRIPTION:"Manage your teams within your organization.",USER_TEAMS_DESCRIPTION:"You are a member of the following teams.",DELETE_TEAM:"Delete Team",DELETE_TEAM_DESCRIPTION:"Permanently remove this team and all of its contents.",DELETE_TEAM_SUCCESS:"Team deleted successfully",DELETE_TEAM_INSTRUCTIONS:"Enter the team name to continue:",TEAM_NAME_REQUIRED:"Team name is required",TEAM_NAME_DOES_NOT_MATCH:"The team name does not match",TEAM_MEMBERS:"Team Members",TEAM_MEMBERS_DESCRIPTION:"Manage your team members and their roles.",ADD_TEAM_MEMBER:"Add Team Member",REMOVE_TEAM_MEMBER:"Remove Team Member",REMOVE_TEAM_MEMBER_CONFIRM:"Are you sure you want to remove this member from the team?",REMOVE_TEAM_MEMBER_SUCCESS:"Team member removed successfully",ADD_TEAM_MEMBER_SUCCESS:"Team member added successfully",UPDATE_TEAM_SUCCESS:"Team updated successfully",MANAGE_TEAM_MEMBERS:"Manage Team Members",MANAGE_TEAM_MEMBERS_DESCRIPTION:"Search and add organization members to this team.",NO_TEAMS_FOUND:"No teams found",MEMBER_SINGULAR:"member",MEMBER_PLURAL:"members",UNKNOWN:"Unknown",...gz,...hz,...pz,...mz,..._z,...bz,...wz,...Sz,...Ez,...Rz,...xz,...Tz,...Oz,...Cz,...Az,...Iz},kz={CALLBACK:"callback",EMAIL_OTP:"email-otp",EMAIL_VERIFICATION:"email-verification",FORGOT_PASSWORD:"forgot-password",MAGIC_LINK:"magic-link",RECOVER_ACCOUNT:"recover-account",RESET_PASSWORD:"reset-password",SIGN_IN:"sign-in",SIGN_OUT:"sign-out",SIGN_UP:"sign-up",TWO_FACTOR:"two-factor",ACCEPT_INVITATION:"accept-invitation"},mT={SETTINGS:"settings",SECURITY:"security",TEAMS:"teams",API_KEYS:"api-keys",ORGANIZATIONS:"organizations"},gT={SETTINGS:"settings",MEMBERS:"members",TEAMS:"teams",API_KEYS:"api-keys"};function Mz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Pz=e=>{switch(e){case"success":return jz;case"info":return Uz;case"warning":return $z;case"error":return zz;default:return null}},Dz=Array(12).fill(0),Lz=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},Dz.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),jz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),$z=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Uz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Vz=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Fz=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let d_=1;class Bz{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,i=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:d_++,l=this.toasts.find(d=>d.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...t,id:i,title:r}),{...d,...t,id:i,dismissible:u,title:r}):d):this.addToast({title:r,...a,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,l;const u=a.then(async f=>{if(l=["resolve",f],ee.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(Hz(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!ee.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof m=="object"&&!ee.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,m)=>u.then(()=>l[0]==="reject"?m(l[1]):f(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||d_++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Dr=new Bz,qz=(e,t)=>{const n=t?.id||d_++;return Dr.addToast({title:e,...t,id:n}),n},Hz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Gz=qz,Zz=()=>Dr.toasts,Kz=()=>Dr.getActiveToasts(),vT=Object.assign(Gz,{success:Dr.success,info:Dr.info,warning:Dr.warning,error:Dr.error,custom:Dr.custom,message:Dr.message,promise:Dr.promise,dismiss:Dr.dismiss,loading:Dr.loading},{getHistory:Zz,getToasts:Kz});Mz("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function uh(e){return e.label!==void 0}const Wz=3,Yz="24px",Qz="16px",yT=4e3,Xz=356,Jz=14,eV=45,tV=200;function Jo(...e){return e.filter(Boolean).join(" ")}function nV(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const rV=e=>{var t,n,r,a,i,l,u,d,f;const{invert:m,toast:p,unstyled:g,interacting:y,setHeights:w,visibleToasts:S,heights:b,index:E,toasts:R,expanded:T,removeToast:O,defaultRichColors:C,closeButton:I,style:N,cancelButtonStyle:P,actionButtonStyle:$,className:K="",descriptionClassName:V="",duration:G,position:U,gap:J,expandByDefault:le,classNames:B,icons:W,closeButtonAriaLabel:Y="Close toast"}=e,[pe,ae]=ee.useState(null),[M,q]=ee.useState(null),[F,L]=ee.useState(!1),[z,X]=ee.useState(!1),[de,ve]=ee.useState(!1),[Ie,Ae]=ee.useState(!1),[H,ne]=ee.useState(!1),[_e,se]=ee.useState(0),[ue,Oe]=ee.useState(0),Pe=ee.useRef(p.duration||G||yT),Xe=ee.useRef(null),Fe=ee.useRef(null),We=E===0,Z=E+1<=S,re=p.type,oe=p.dismissible!==!1,we=p.className||"",xe=p.descriptionClassName||"",Re=ee.useMemo(()=>b.findIndex(qe=>qe.toastId===p.id)||0,[b,p.id]),ke=ee.useMemo(()=>{var qe;return(qe=p.closeButton)!=null?qe:I},[p.closeButton,I]),Je=ee.useMemo(()=>p.duration||G||yT,[p.duration,G]),ot=ee.useRef(0),Ct=ee.useRef(0),ur=ee.useRef(0),tn=ee.useRef(null),[Rn,nn]=U.split("-"),jn=ee.useMemo(()=>b.reduce((qe,ut,Wt)=>Wt>=Re?qe:qe+ut.height,0),[b,Re]),xn=Fz(),Qa=p.invert||m,ga=re==="loading";Ct.current=ee.useMemo(()=>Re*J+jn,[Re,jn]),ee.useEffect(()=>{Pe.current=Je},[Je]),ee.useEffect(()=>{L(!0)},[]),ee.useEffect(()=>{const qe=Fe.current;if(qe){const ut=qe.getBoundingClientRect().height;return Oe(ut),w(Wt=>[{toastId:p.id,height:ut,position:p.position},...Wt]),()=>w(Wt=>Wt.filter(qt=>qt.toastId!==p.id))}},[w,p.id]),ee.useLayoutEffect(()=>{if(!F)return;const qe=Fe.current,ut=qe.style.height;qe.style.height="auto";const Wt=qe.getBoundingClientRect().height;qe.style.height=ut,Oe(Wt),w(qt=>qt.find(It=>It.toastId===p.id)?qt.map(It=>It.toastId===p.id?{...It,height:Wt}:It):[{toastId:p.id,height:Wt,position:p.position},...qt])},[F,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const Be=ee.useCallback(()=>{X(!0),se(Ct.current),w(qe=>qe.filter(ut=>ut.toastId!==p.id)),setTimeout(()=>{O(p)},tV)},[p,O,w,Ct]);ee.useEffect(()=>{if(p.promise&&re==="loading"||p.duration===1/0||p.type==="loading")return;let qe;return T||y||xn?(()=>{if(ur.current<ot.current){const qt=new Date().getTime()-ot.current;Pe.current=Pe.current-qt}ur.current=new Date().getTime()})():Pe.current!==1/0&&(ot.current=new Date().getTime(),qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Be()},Pe.current)),()=>clearTimeout(qe)},[T,y,p,re,xn,Be]),ee.useEffect(()=>{p.delete&&(Be(),p.onDismiss==null||p.onDismiss.call(p,p))},[Be,p.delete]);function bt(){var qe;if(W?.loading){var ut;return ee.createElement("div",{className:Jo(B?.loader,p==null||(ut=p.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":re==="loading"},W.loading)}return ee.createElement(Lz,{className:Jo(B?.loader,p==null||(qe=p.classNames)==null?void 0:qe.loader),visible:re==="loading"})}const Tt=p.icon||W?.[re]||Pz(re);var ct,At;return ee.createElement("li",{tabIndex:0,ref:Fe,className:Jo(K,we,B?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,B?.default,B?.[re],p==null||(n=p.classNames)==null?void 0:n[re]),"data-sonner-toast":"","data-rich-colors":(ct=p.richColors)!=null?ct:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":F,"data-promise":!!p.promise,"data-swiped":H,"data-removed":z,"data-visible":Z,"data-y-position":Rn,"data-x-position":nn,"data-index":E,"data-front":We,"data-swiping":de,"data-dismissible":oe,"data-type":re,"data-invert":Qa,"data-swipe-out":Ie,"data-swipe-direction":M,"data-expanded":!!(T||le&&F),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":R.length-E,"--offset":`${z?_e:Ct.current}px`,"--initial-height":le?"auto":`${ue}px`,...N,...p.style},onDragEnd:()=>{ve(!1),ae(null),tn.current=null},onPointerDown:qe=>{qe.button!==2&&(ga||!oe||(Xe.current=new Date,se(Ct.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(ve(!0),tn.current={x:qe.clientX,y:qe.clientY})))},onPointerUp:()=>{var qe,ut,Wt;if(Ie||!oe)return;tn.current=null;const qt=Number(((qe=Fe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dr=Number(((ut=Fe.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((Wt=Xe.current)==null?void 0:Wt.getTime()),rn=pe==="x"?qt:dr,ao=Math.abs(rn)/It;if(Math.abs(rn)>=eV||ao>.11){se(Ct.current),p.onDismiss==null||p.onDismiss.call(p,p),q(pe==="x"?qt>0?"right":"left":dr>0?"down":"up"),Be(),Ae(!0);return}else{var Yn,xr;(Yn=Fe.current)==null||Yn.style.setProperty("--swipe-amount-x","0px"),(xr=Fe.current)==null||xr.style.setProperty("--swipe-amount-y","0px")}ne(!1),ve(!1),ae(null)},onPointerMove:qe=>{var ut,Wt,qt;if(!tn.current||!oe||((ut=window.getSelection())==null?void 0:ut.toString().length)>0)return;const It=qe.clientY-tn.current.y,rn=qe.clientX-tn.current.x;var ao;const Yn=(ao=e.swipeDirections)!=null?ao:nV(U);!pe&&(Math.abs(rn)>1||Math.abs(It)>1)&&ae(Math.abs(rn)>Math.abs(It)?"x":"y");let xr={x:0,y:0};const Hi=Co=>1/(1.5+Math.abs(Co)/20);if(pe==="y"){if(Yn.includes("top")||Yn.includes("bottom"))if(Yn.includes("top")&&It<0||Yn.includes("bottom")&&It>0)xr.y=It;else{const Co=It*Hi(It);xr.y=Math.abs(Co)<Math.abs(It)?Co:It}}else if(pe==="x"&&(Yn.includes("left")||Yn.includes("right")))if(Yn.includes("left")&&rn<0||Yn.includes("right")&&rn>0)xr.x=rn;else{const Co=rn*Hi(rn);xr.x=Math.abs(Co)<Math.abs(rn)?Co:rn}(Math.abs(xr.x)>0||Math.abs(xr.y)>0)&&ne(!0),(Wt=Fe.current)==null||Wt.style.setProperty("--swipe-amount-x",`${xr.x}px`),(qt=Fe.current)==null||qt.style.setProperty("--swipe-amount-y",`${xr.y}px`)}},ke&&!p.jsx&&re!=="loading"?ee.createElement("button",{"aria-label":Y,"data-disabled":ga,"data-close-button":!0,onClick:ga||!oe?()=>{}:()=>{Be(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Jo(B?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(At=W?.close)!=null?At:Vz):null,(re||p.icon||p.promise)&&p.icon!==null&&(W?.[re]!==null||p.icon)?ee.createElement("div",{"data-icon":"",className:Jo(B?.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||bt():null,p.type!=="loading"?Tt:null):null,ee.createElement("div",{"data-content":"",className:Jo(B?.content,p==null||(i=p.classNames)==null?void 0:i.content)},ee.createElement("div",{"data-title":"",className:Jo(B?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ee.createElement("div",{"data-description":"",className:Jo(V,xe,B?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ee.isValidElement(p.cancel)?p.cancel:p.cancel&&uh(p.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||P,onClick:qe=>{uh(p.cancel)&&oe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,qe),Be())},className:Jo(B?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,ee.isValidElement(p.action)?p.action:p.action&&uh(p.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||$,onClick:qe=>{uh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,qe),!qe.defaultPrevented&&Be())},className:Jo(B?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function _T(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function oV(e,t){const n={};return[e,t].forEach((r,a)=>{const i=a===1,l=i?"--mobile-offset":"--offset",u=i?Qz:Yz;function d(f){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(u)}),n}const aV=ee.forwardRef(function(t,n){const{id:r,invert:a,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:f,offset:m,mobileOffset:p,theme:g="light",richColors:y,duration:w,style:S,visibleToasts:b=Wz,toastOptions:E,dir:R=_T(),gap:T=Jz,icons:O,containerAriaLabel:C="Notifications"}=t,[I,N]=ee.useState([]),P=ee.useMemo(()=>r?I.filter(F=>F.toasterId===r):I.filter(F=>!F.toasterId),[I,r]),$=ee.useMemo(()=>Array.from(new Set([i].concat(P.filter(F=>F.position).map(F=>F.position)))),[P,i]),[K,V]=ee.useState([]),[G,U]=ee.useState(!1),[J,le]=ee.useState(!1),[B,W]=ee.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=ee.useRef(null),pe=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),ae=ee.useRef(null),M=ee.useRef(!1),q=ee.useCallback(F=>{N(L=>{var z;return(z=L.find(X=>X.id===F.id))!=null&&z.delete||Dr.dismiss(F.id),L.filter(({id:X})=>X!==F.id)})},[]);return ee.useEffect(()=>Dr.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{N(L=>L.map(z=>z.id===F.id?{...z,delete:!0}:z))});return}setTimeout(()=>{yA.flushSync(()=>{N(L=>{const z=L.findIndex(X=>X.id===F.id);return z!==-1?[...L.slice(0,z),{...L[z],...F},...L.slice(z+1)]:[F,...L]})})})}),[I]),ee.useEffect(()=>{if(g!=="system"){W(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:L})=>{W(L?"dark":"light")})}catch{F.addListener(({matches:z})=>{try{W(z?"dark":"light")}catch(X){console.error(X)}})}},[g]),ee.useEffect(()=>{I.length<=1&&U(!1)},[I]),ee.useEffect(()=>{const F=L=>{var z;if(l.every(ve=>L[ve]||L.code===ve)){var de;U(!0),(de=Y.current)==null||de.focus()}L.code==="Escape"&&(document.activeElement===Y.current||(z=Y.current)!=null&&z.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[l]),ee.useEffect(()=>{if(Y.current)return()=>{ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null,M.current=!1)}},[Y.current]),ee.createElement("section",{ref:n,"aria-label":`${C} ${pe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((F,L)=>{var z;const[X,de]=F.split("-");return P.length?ee.createElement("ol",{key:F,dir:R==="auto"?_T():R,tabIndex:-1,ref:Y,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":X,"data-x-position":de,style:{"--front-toast-height":`${((z=K[0])==null?void 0:z.height)||0}px`,"--width":`${Xz}px`,"--gap":`${T}px`,...S,...oV(m,p)},onBlur:ve=>{M.current&&!ve.currentTarget.contains(ve.relatedTarget)&&(M.current=!1,ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null))},onFocus:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||M.current||(M.current=!0,ae.current=ve.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{J||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||le(!0)},onPointerUp:()=>le(!1)},P.filter(ve=>!ve.position&&L===0||ve.position===F).map((ve,Ie)=>{var Ae,H;return ee.createElement(rV,{key:ve.id,icons:O,index:Ie,toast:ve,defaultRichColors:y,duration:(Ae=E?.duration)!=null?Ae:w,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:a,visibleToasts:b,closeButton:(H=E?.closeButton)!=null?H:d,interacting:J,position:F,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:q,toasts:P.filter(ne=>ne.position==ve.position),heights:K.filter(ne=>ne.position==ve.position),setHeights:V,expandByDefault:u,gap:T,expanded:G,swipeDirections:t.swipeDirections})})):null}))}),nN=A.createContext({});function rN(){return A.useContext(nN)}var Ky,bT;function sV(){if(bT)return Ky;bT=1;var e=function(){};return Ky=e,Ky}var iV=sV();const lV=Ga(iV);function cV({async:e,appendTo:t,defer:n,id:r,nonce:a,src:i}){const l=document.createElement("script");e!==void 0&&(l.async=e),n!==void 0&&(l.defer=n),r&&(l.id=r),a&&l.setAttribute("nonce",a),l.src=i,(t==="head"?document.head:document.body).appendChild(l)}var uV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};let Bu=null,rd=!1;const Bp=new Set,qp=new Set,dV=typeof window<"u",ec="___grecaptcha_cfg",oN=`onLoadCallback_${Math.random().toString(36).slice(2)}`;function fV(){if(!dV)return;function e(n){if(rd)n();else{window[ec]||(window[ec]={});const r=window[ec];r.fns||(r.fns=[]),r.fns.push(n)}}window.grecaptcha||(window.grecaptcha={}),window.grecaptcha.enterprise||(window.grecaptcha.enterprise={}),window.grecaptcha.ready=e,window.grecaptcha.enterprise.ready=e;function t(){rd=!0;for(const n of qp)n();qp.clear()}window[oN]=t}function hV({language:e,onLoadCallbackName:t,render:n,useEnterprise:r=!1,useRecaptchaNet:a=!1}){const i=a?"recaptcha.net":"google.com",l=r?"enterprise.js":"api.js",u=new URLSearchParams({render:n});return t&&u.set("onload",t),e&&u.set("hl",e),`https://www.${i}/recaptcha/${l}?${u.toString()}`}function pV({language:e,render:t,scriptProps:n,useEnterprise:r,useRecaptchaNet:a}){const i={id:"google-recaptcha-v3"},l=hV({language:e,onLoadCallbackName:oN,render:t,useEnterprise:r,useRecaptchaNet:a});if(Bu){if(Bu!==l)throw new Error("reCAPTCHA has already been loaded with different parameters. Remove the existing script and load it again.");return}Bu=l,cV(Object.assign(Object.assign(Object.assign({},i),n),{src:l}))}function mV(e){if(!window[ec])return;const t=window[ec];t.clients&&delete t.clients[e]}function gV(e,t){var{onLoadCallback:n,onLoadCallbackName:r}=t,a=uV(t,["onLoadCallback","onLoadCallbackName"]);if(Bp.size===0&&fV(),pV(a),Bp.add(e),n&&(rd?n():qp.add(n)),r){let i=function(){if(!r)return;const l=window[r];typeof l=="function"&&l()};rd?i():qp.add(i)}}function vV(e){var t,n,r;Bp.delete(e),Bp.size===0&&(window.grecaptcha=void 0,window[ec]=void 0,(t=document.querySelector(".grecaptcha-badge"))===null||t===void 0||t.remove(),(n=document.querySelector(`script[src="${Bu}"]`))===null||n===void 0||n.remove(),(r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'))===null||r===void 0||r.remove(),Bu=null,rd=!1)}let wT=!1;function yV({container:e,children:t,language:n,reCaptchaKey:r,scriptProps:a,useEnterprise:i,useRecaptchaNet:l}){var u,d,f,m,p,g,y;const w=A.useId(),[S,b]=A.useState(null),[E,R]=A.useState(null),T=A.useRef(!1);A.useEffect(()=>{function N(){var P;const $=i?(P=window.grecaptcha)===null||P===void 0?void 0:P.enterprise:window.grecaptcha;if(!$)throw new Error("reCAPTCHA not found");if(!$.ready)throw new Error("reCAPTCHA ready callback not found");$.ready(()=>{b($)})}return gV(w,{language:n,onLoadCallback:N,onLoadCallbackName:a?.onLoadCallbackName,render:e?.element?"explicit":r,scriptProps:{appendTo:a?.appendTo,async:a?.async,defer:a?.defer,id:a?.id,nonce:a?.nonce},useEnterprise:i,useRecaptchaNet:l}),()=>{vV(w),b(null)}},[e?.element,w,n,r,a?.appendTo,a?.async,a?.defer,a?.id,a?.nonce,a?.onLoadCallbackName,i,l]),A.useEffect(()=>{var N,P,$;if(!e?.element||!S?.render)return;const K={"error-callback":e.parameters.errorCallback,"expired-callback":e.parameters.expiredCallback,badge:((N=e.parameters)===null||N===void 0?void 0:N.badge)||"inline",callback:e.parameters.callback,sitekey:r,size:"invisible",tabindex:e.parameters.tabindex,theme:e.parameters.theme},V=typeof e?.element=="string"?document.getElementById(e.element):e?.element;if(!V)throw new Error("reCAPTCHA container element not found");const G=S.render(V,K);return!((P=e?.parameters)===null||P===void 0)&&P.hidden&&(wT||(lV(!1,"reCAPTCHA badge hidden. See https://cloud.google.com/recaptcha/docs/faq#id_like_to_hide_the_badge_what_is_allowed for more information."),wT=!0),($=V.querySelector(".grecaptcha-badge"))===null||$===void 0||$.style.setProperty("display","none")),R(G),T.current=!0,()=>{R(null),T.current=!1,mV(G),V.innerHTML=""}},[e?.element,(u=e?.parameters)===null||u===void 0?void 0:u.badge,(d=e?.parameters)===null||d===void 0?void 0:d.hidden,(f=e?.parameters)===null||f===void 0?void 0:f.callback,(m=e?.parameters)===null||m===void 0?void 0:m.errorCallback,(p=e?.parameters)===null||p===void 0?void 0:p.expiredCallback,(g=e?.parameters)===null||g===void 0?void 0:g.tabindex,(y=e?.parameters)===null||y===void 0?void 0:y.theme,S,r]);const O=!!e?.element,C=O?E:r,I=A.useMemo(()=>C!==null&&S?.execute?N=>{if(C===null||!S?.execute)throw new Error("reCAPTCHA has not been loaded");return O&&!T.current?(console.warn("Client ID not mounted"),null):S.execute(C,{action:N})}:void 0,[C,S,O]);return x.jsx(nN.Provider,{value:{container:e?.element,executeRecaptcha:I,reCaptchaInstance:S},children:t})}var _V=class{cache=new Map;listeners=new Map;inFlightRequests=new Map;get(e){return this.cache.get(e)}set(e,t){const n={data:t,timestamp:Date.now(),isRefetching:!1};this.cache.set(e,n),this.notify(e)}setRefetching(e,t){const n=this.cache.get(e);n&&(n.isRefetching=t,this.notify(e))}clear(e){if(e)this.cache.delete(e),this.inFlightRequests.delete(e),this.notify(e);else{this.cache.clear(),this.inFlightRequests.clear();const t=Array.from(this.listeners.keys());for(const n of t)this.notify(n)}}getInFlightRequest(e){return this.inFlightRequests.get(e)}setInFlightRequest(e,t){this.inFlightRequests.set(e,t)}removeInFlightRequest(e){this.inFlightRequests.delete(e)}subscribe(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>{const n=this.listeners.get(e);n&&(n.delete(t),n.size===0&&this.listeners.delete(e))}}notify(e){const t=this.listeners.get(e);if(t){const n=Array.from(t);for(const r of n)r()}}},vo=new _V;function bV(){return()=>{}}function Ka(){return A.useSyncExternalStore(bV,()=>!0,()=>!1)}function aN(){const[e,t]=A.useState();return A.useEffect(()=>{const n=()=>{const a=document.documentElement.getAttribute("lang");t(a??void 0)};n();const r=new MutationObserver(a=>{for(const i of a)i.attributeName==="lang"&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{lang:e}}function Mb(){const[e,t]=A.useState("light");return A.useEffect(()=>{const n=()=>{var a;const i=document.documentElement.classList.contains("dark")||((a=document.documentElement.getAttribute("style"))==null?void 0:a.includes("color-scheme: dark"));t(i?"dark":"light")};n();const r=new MutationObserver(a=>{for(const i of a)(i.attributeName==="style"||i.attributeName==="class")&&n()});return r.observe(document.documentElement,{attributes:!0}),()=>{r.disconnect()}},[]),{theme:e}}function wV({children:e}){const t=Ka(),{captcha:n}=A.useContext(ht);return n?.provider!=="google-recaptcha-v3"?e:x.jsxs(yV,{reCaptchaKey:n.siteKey,useEnterprise:n.enterprise,useRecaptchaNet:n.recaptchaNet,children:[t&&x.jsx("style",{children:`
49
49
  .grecaptcha-badge {
50
50
  visibility: hidden;
51
51
  border-radius: var(--radius) !important;
@@ -152,7 +152,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
152
152
  .dark .grecaptcha-badge {
153
153
  border-color: var(--input) !important;
154
154
  }
155
- `}),x.jsx(bW,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var PY=["/sign-up/email","/sign-in/email","/forget-password"];function Id({ref:e,localization:t,action:n}){const{captcha:r}=A.useContext(ht);if(!r||n&&!(r.endpoints||PY).includes(n))return null;const{theme:a}=Mb(),i=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",u=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return x.jsxs(x.Fragment,{children:[i&&x.jsx(MY,{ref:e}),l&&x.jsx(kY,{localization:t}),u&&x.jsx(JM,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:a,size:"flexible"}}),d&&x.jsx("div",{className:"mx-auto",children:x.jsx(KK,{ref:e,sitekey:r.siteKey,theme:a})}),f&&x.jsx("div",{className:"mx-auto",children:x.jsx(BM,{ref:e,sitekey:r.siteKey,theme:a})})]})}function R1({className:e,containerClassName:t,...n}){return x.jsx(o4,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function $l({className:e,...t}){return x.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function Gn({index:e,className:t,...n}){const r=A.useContext(r4),{char:a,hasFakeCaret:i,isActive:l}=r?.slots[e]??{};return x.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[a,i&&x.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:x.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function O0({...e}){return x.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:x.jsx(UV,{})})}function x1({otpSeparators:e=0}){return e===0?x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1}),x.jsx(Gn,{index:2}),x.jsx(Gn,{index:3}),x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]}):e===1?x.jsxs(x.Fragment,{children:[x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1}),x.jsx(Gn,{index:2})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:3}),x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]})]}):x.jsxs(x.Fragment,{children:[x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:2}),x.jsx(Gn,{index:3})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]})]})}function ZO(e){const[t,n]=A.useState();return t?x.jsx(LY,{...e,email:t}):x.jsx(DY,{...e,setEmail:n})}function DY({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:a,setEmail:i}){const l=Ka(),{captchaRef:u,getCaptchaHeaders:d}=Ad({localization:r}),{authClient:f,localization:m,toast:p,localizeErrors:g}=A.useContext(ht);r={...m,...r};const y=ce({email:D().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),w=da({resolver:fa(y),defaultValues:{email:""}});n=n||w.formState.isSubmitting,A.useEffect(()=>{a?.(w.formState.isSubmitting)},[w.formState.isSubmitting,a]);async function S({email:b}){const E={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:b,type:"sign-in",fetchOptions:E}),p({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),i(b)}catch(R){p({variant:"error",message:En({error:R,localization:r,localizeErrors:g})})}}return x.jsx(pa,{...w,children:x.jsxs("form",{onSubmit:w.handleSubmit(S),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:w.control,name:"email",render:({field:b})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...b})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:u,localization:r,action:"/email-otp/send-verification-otp"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function LY({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:a=0,redirectTo:i,setIsSubmitting:l,email:u}){const{authClient:d,localization:f,toast:m,localizeErrors:p}=A.useContext(ht);r={...f,...r};const{onSuccess:g,isPending:y}=ma({redirectTo:i}),w=ce({code:D().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),S=da({resolver:fa(w),defaultValues:{code:""}});n=n||S.formState.isSubmitting||y,A.useEffect(()=>{l?.(S.formState.isSubmitting||y)},[S.formState.isSubmitting,y,l]);async function b({code:E}){try{await d.signIn.emailOtp({email:u,otp:E,fetchOptions:{throw:!0}}),await g()}catch(R){m({variant:"error",message:En({error:R,localization:r,localizeErrors:p})}),S.reset()}}return x.jsx(pa,{...S,children:x.jsxs("form",{onSubmit:S.handleSubmit(b),className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:S.control,name:"code",render:({field:E})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL_OTP}),x.jsx(Dn,{children:x.jsx(R1,{...E,maxLength:6,onChange:R=>{E.onChange(R),R.length===6&&S.handleSubmit(b)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx("div",{className:"grid gap-4",children:x.jsxs(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&x.jsx(mr,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function jY({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:a,callbackURL:i,isSubmitting:l,redirectTo:u,setIsSubmitting:d}){const[f,m]=A.useState(!0),[p,g]=A.useState(30),{authClient:y,localization:w,toast:S,localizeErrors:b,navigate:E,basePath:R,viewPaths:T}=A.useContext(ht);t={...w,...t};const O=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:C,isPending:I}=ma({redirectTo:u}),N=ce({code:D().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),P=da({resolver:fa(N),defaultValues:{code:""}}),$=l||P.formState.isSubmitting||I;A.useEffect(()=>{d?.(P.formState.isSubmitting||I)},[P.formState.isSubmitting,I,d]),A.useEffect(()=>{if(p>0){const G=setTimeout(()=>g(p-1),1e3);return()=>clearTimeout(G)}else m(!1)},[p]);async function K({code:G}){try{const U=await y.emailOtp.verifyEmail({email:O,otp:G,fetchOptions:{throw:!0}});"token"in U&&U.token?await C():(E(`${R}/${T.SIGN_IN}${window.location.search}`),S({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(U){S({variant:"error",message:En({error:U,localization:t,localizeErrors:b})}),P.reset()}}async function V(){if(!f){m(!0),g(30);try{await y.emailOtp.sendVerificationOtp({email:O,type:"email-verification",fetchOptions:{throw:!0}}),S({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(G){S({variant:"error",message:En({error:G,localization:t,localizeErrors:b})}),m(!1),g(0)}}}return O?x.jsx(pa,{...P,children:x.jsxs("form",{onSubmit:P.handleSubmit(K),className:Ce("grid w-full gap-6",n,r?.base),children:[x.jsx(bn,{control:P.control,name:"code",render:({field:G})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:r?.label,children:t.EMAIL_OTP}),x.jsx(Dn,{children:x.jsx(R1,{...G,maxLength:6,onChange:U=>{G.onChange(U),U.length===6&&P.handleSubmit(K)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:$,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:r?.error})]})}),x.jsxs("div",{className:"grid gap-4",children:[x.jsxs(Qt,{type:"submit",disabled:$,className:Ce(r?.button,r?.primaryButton),children:[$&&x.jsx(mr,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),x.jsx(Qt,{type:"button",variant:"outline",onClick:V,disabled:f||$,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${p}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&x.jsx(Qt,{type:"button",variant:"ghost",onClick:e,disabled:$,className:"w-full",children:t.CANCEL})]})]})}):x.jsx("div",{className:Ce("grid w-full gap-6",n),children:x.jsxs("div",{className:"text-center",children:[x.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),x.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function $Y({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:a}){const i=Ka(),{captchaRef:l,getCaptchaHeaders:u,resetCaptcha:d}=Ad({localization:r}),{authClient:f,basePath:m,baseURL:p,localization:g,navigate:y,toast:w,viewPaths:S,localizeErrors:b}=A.useContext(ht);r={...g,...r};const E=ce({email:D().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),R=da({resolver:fa(E),defaultValues:{email:""}});n=n||R.formState.isSubmitting,A.useEffect(()=>{a?.(R.formState.isSubmitting)},[R.formState.isSubmitting,a]);async function T({email:O}){try{const C={throw:!0,headers:await u("/forget-password")};await f.requestPasswordReset({email:O,redirectTo:`${p}${m}/${S.RESET_PASSWORD}`,fetchOptions:C}),w({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),y(`${m}/${S.SIGN_IN}${window.location.search}`)}catch(C){w({variant:"error",message:En({error:C,localization:r,localizeErrors:b})}),d()}}return x.jsx(pa,{...R,children:x.jsxs("form",{onSubmit:R.handleSubmit(T),noValidate:i,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:R.control,name:"email",render:({field:O})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...O})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:l,localization:r,action:"/forget-password"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function KO({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,redirectTo:i,setIsSubmitting:l}){const u=Ka(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:m}=Ad({localization:a}),{authClient:p,basePath:g,baseURL:y,persistClient:w,localization:S,redirectTo:b,viewPaths:E,toast:R,localizeErrors:T}=A.useContext(ht);a={...S,...a};const O=A.useCallback(()=>i||Vi("redirectTo")||b,[i,b]),C=A.useCallback(()=>`${y}${n||(w?`${g}/${E.CALLBACK}?redirectTo=${encodeURIComponent(O())}`:O())}`,[n,w,g,E,y,O]),I=ce({email:D().email({message:`${a.EMAIL} ${a.IS_INVALID}`})}),N=da({resolver:fa(I),defaultValues:{email:""}});r=r||N.formState.isSubmitting,A.useEffect(()=>{l?.(N.formState.isSubmitting)},[N.formState.isSubmitting,l]);async function P({email:$}){try{const K={throw:!0,headers:await f("/sign-in/magic-link")};await p.signIn.magicLink({email:$,callbackURL:C(),fetchOptions:K}),R({variant:"success",message:a.MAGIC_LINK_EMAIL}),N.reset()}catch(K){R({variant:"error",message:En({error:K,localization:a,localizeErrors:T})}),m()}}return x.jsx(pa,{...N,children:x.jsxs("form",{onSubmit:N.handleSubmit(P),noValidate:u,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:N.control,name:"email",render:({field:$})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:a.EMAIL_PLACEHOLDER,disabled:r,...$})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:d,localization:a,action:"/sign-in/magic-link"}),x.jsx(Qt,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?x.jsx(mr,{className:"animate-spin"}):a.MAGIC_LINK_ACTION})]})})}function UY({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:a,setIsSubmitting:i}){const{authClient:l,localization:u,toast:d,localizeErrors:f}=A.useContext(ht);r={...u,...r};const{onSuccess:m,isPending:p}=ma({redirectTo:a}),g=ce({code:D().min(1,{message:r.BACKUP_CODE_REQUIRED})}),y=da({resolver:fa(g),defaultValues:{code:""}});n=n||y.formState.isSubmitting||p,A.useEffect(()=>{i?.(y.formState.isSubmitting||p)},[y.formState.isSubmitting,p,i]);async function w({code:S}){try{await l.twoFactor.verifyBackupCode({code:S,fetchOptions:{throw:!0}}),await m()}catch(b){d({variant:"error",message:En({error:b,localization:r,localizeErrors:f})}),y.reset()}}return x.jsx(pa,{...y,children:x.jsxs("form",{onSubmit:y.handleSubmit(w),className:Ce("grid gap-6",e,t?.base),children:[x.jsx(bn,{control:y.control,name:"code",render:({field:S})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.BACKUP_CODE}),x.jsx(Dn,{children:x.jsx(Vo,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...S})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function zY({className:e,classNames:t,localization:n,passwordValidation:r}){const a=A.useRef(!1),{authClient:i,basePath:l,credentials:u,localization:d,viewPaths:f,navigate:m,toast:p,localizeErrors:g}=A.useContext(ht),y=u?.confirmPassword,w=u?.passwordValidation;n={...d,...n},r={...w,...r};const S=ce({newPassword:nd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:y?nd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):D().optional()}).refine(T=>!y||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),b=da({resolver:fa(S),defaultValues:{newPassword:"",confirmPassword:""}}),E=b.formState.isSubmitting;A.useEffect(()=>{if(a.current)return;a.current=!0;const O=new URLSearchParams(window.location.search).get("token");(!O||O==="INVALID_TOKEN")&&(m(`${l}/${f.SIGN_IN}${window.location.search}`),p({variant:"error",message:n.INVALID_TOKEN}))},[l,m,p,f,n]);async function R({newPassword:T}){try{const C=new URLSearchParams(window.location.search).get("token");await i.resetPassword({newPassword:T,token:C,fetchOptions:{throw:!0}}),p({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),m(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(O){p({variant:"error",message:En({error:O,localization:n,localizeErrors:g})}),b.reset()}}return x.jsx(pa,{...b,children:x.jsxs("form",{onSubmit:b.handleSubmit(R),className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:b.control,name:"newPassword",render:({field:T})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:n.NEW_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:E,...T})}),x.jsx(Fn,{className:t?.error})]})}),y&&x.jsx(bn,{control:b.control,name:"confirmPassword",render:({field:T})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:n.CONFIRM_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:E,...T})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Qt,{type:"submit",disabled:E,className:Ce("w-full",t?.button,t?.primaryButton),children:E?x.jsx(mr,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function VY({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:a,setIsSubmitting:i,passwordValidation:l}){const u=Ka(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:m}=Ad({localization:r}),{authClient:p,basePath:g,credentials:y,localization:w,viewPaths:S,navigate:b,toast:E,Link:R,localizeErrors:T,emailVerification:O}=A.useContext(ht),C=y?.rememberMe,I=y?.username,N=y?.passwordValidation;r={...w,...r},l={...N,...l};const{onSuccess:P,isPending:$}=ma({redirectTo:a}),K=ce({email:I?D().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):D().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:nd(l,r),rememberMe:nt().optional()}),V=da({resolver:fa(K),defaultValues:{email:"",password:"",rememberMe:!C}});n=n||V.formState.isSubmitting||$,A.useEffect(()=>{i?.(V.formState.isSubmitting||$)},[V.formState.isSubmitting,$,i]);async function G({email:U,password:J,rememberMe:le}){var B;try{let W={};if(I&&!fz(U)){const Y={throw:!0,headers:await f("/sign-in/username")};W=await p.signIn.username({username:U,password:J,rememberMe:le,fetchOptions:Y})}else{const Y={throw:!0,headers:await f("/sign-in/email")};W=await p.signIn.email({email:U,password:J,rememberMe:le,fetchOptions:Y})}W.twoFactorRedirect?b(`${g}/${S.TWO_FACTOR}${window.location.search}`):await P()}catch(W){V.resetField("password"),m(),E({variant:"error",message:En({error:W,localization:r,localizeErrors:T})}),O?.otp&&((B=W?.error)==null?void 0:B.code)==="EMAIL_NOT_VERIFIED"&&b(`${g}/${S.EMAIL_VERIFICATION}?email=${encodeURIComponent(U)}`)}}return x.jsx(pa,{...V,children:x.jsxs("form",{onSubmit:V.handleSubmit(G),noValidate:u,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:V.control,name:"email",render:({field:U})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...U})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:V.control,name:"password",render:({field:U})=>x.jsxs(wn,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx(Sn,{className:t?.label,children:r.PASSWORD}),y?.forgotPassword&&x.jsx(R,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${S.FORGOT_PASSWORD}${u?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...U})}),x.jsx(Fn,{className:t?.error})]})}),C&&x.jsx(bn,{control:V.control,name:"rememberMe",render:({field:U})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:U.value,onCheckedChange:U.onChange,disabled:n})}),x.jsx(Sn,{children:r.REMEMBER_ME})]})}),x.jsx(Id,{ref:d,localization:r,action:"/sign-in/email"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function FY({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,redirectTo:i,setIsSubmitting:l,passwordValidation:u}){const d=Ka(),{captchaRef:f,getCaptchaHeaders:m,resetCaptcha:p}=Ad({localization:a}),{additionalFields:g,authClient:y,basePath:w,baseURL:S,credentials:b,localization:E,nameRequired:R,persistClient:T,redirectTo:O,signUp:C,viewPaths:I,navigate:N,toast:P,avatar:$,localizeErrors:K,emailVerification:V}=A.useContext(ht),G=b?.confirmPassword,U=b?.username,J=b?.usernameRequired??!0,le=b?.passwordValidation,B=C?.fields;a={...E,...a},u={...le,...u};const W=A.useRef(null),[Y,pe]=A.useState(null),[ae,M]=A.useState(!1),q=A.useCallback(()=>i||Vi("redirectTo")||O,[i,O]),F=A.useCallback(()=>`${S}${n||(T?`${w}/${I.CALLBACK}?redirectTo=${encodeURIComponent(q())}`:q())}`,[n,T,w,I,S,q]),{onSuccess:L,isPending:z}=ma({redirectTo:i}),X={email:D().email({message:`${a.EMAIL} ${a.IS_INVALID}`}),password:nd(u,a),name:B?.includes("name")&&R?D().min(1,{message:`${a.NAME} ${a.IS_REQUIRED}`}):D().optional(),image:D().optional(),username:U&&J?D().min(1,{message:`${a.USERNAME} ${a.IS_REQUIRED}`}):D().optional(),confirmPassword:G?nd(u,{PASSWORD_REQUIRED:a.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:a.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:a.PASSWORD_TOO_LONG,INVALID_PASSWORD:a.INVALID_PASSWORD}):D().optional()},de={};if(B)for(const ue of B){if(ue==="name"||ue==="image")continue;const Oe=g?.[ue];if(!Oe)continue;let Pe;Oe.type==="number"?Pe=Oe.required?kb(Xe=>Xe?Number(Xe):void 0,Ze({message:`${Oe.label} ${a.IS_INVALID}`})):tN({message:`${Oe.label} ${a.IS_INVALID}`}).optional():Oe.type==="boolean"?Pe=Oe.required?pT({message:`${Oe.label} ${a.IS_INVALID}`}).refine(Xe=>Xe===!0,{message:`${Oe.label} ${a.IS_REQUIRED}`}):pT({message:`${Oe.label} ${a.IS_INVALID}`}).optional():Pe=Oe.required?D().min(1,`${Oe.label} ${a.IS_REQUIRED}`):D().optional(),de[ue]=Pe}const ve=ce(X).extend(de).refine(ue=>G?ue.password===ue.confirmPassword:!0,{message:a.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Ie={email:"",password:"",...G&&{confirmPassword:""},...B?.includes("name")?{name:""}:{},...U?{username:""}:{},...B?.includes("image")&&$?{image:""}:{}};if(B)for(const ue of B){if(ue==="name"||ue==="image")continue;const Oe=g?.[ue];Oe&&(Ie[ue]=Oe.type==="boolean"?!1:"")}const Ae=da({resolver:fa(ve),defaultValues:Ie});r=r||Ae.formState.isSubmitting||z,A.useEffect(()=>{l?.(Ae.formState.isSubmitting||z)},[Ae.formState.isSubmitting,z,l]);const H=async ue=>{if($){M(!0);try{const Oe=await WW(ue,crypto.randomUUID(),$.size,$.extension);let Pe;$.upload?Pe=await $.upload(Oe):Pe=await QW(Oe),Pe?(pe(Pe),Ae.setValue("image",Pe)):(pe(null),Ae.setValue("image",""))}catch(Oe){console.error(Oe),P({variant:"error",message:En({error:Oe,localization:a,localizeErrors:K})})}M(!1)}},ne=()=>{pe(null),Ae.setValue("image","")},_e=()=>{var ue;return(ue=W.current)==null?void 0:ue.click()};async function se({email:ue,password:Oe,name:Pe,username:Xe,confirmPassword:Fe,image:We,...Z}){try{for(const[xe,Re]of Object.entries(Z)){const ke=g?.[xe];if(ke?.validate&&typeof Re=="string"&&!await ke.validate(Re)){Ae.setError(xe,{message:`${ke.label} ${a.IS_INVALID}`});return}}const re={throw:!0,headers:await m("/sign-up/email")},oe={};Xe!==void 0&&(!J&&(Xe===null||Xe===""||typeof Xe=="string"&&Xe.trim()==="")||(oe.username=Xe)),We!==void 0&&(oe.image=We);const we=await y.signUp.email({email:ue,password:Oe,name:Pe||"",...oe,...Z,callbackURL:F(),fetchOptions:re});"token"in we&&we.token?await L():V?.otp?N(`${w}/${I.EMAIL_VERIFICATION}?email=${encodeURIComponent(ue)}`):(N(`${w}/${I.SIGN_IN}${window.location.search}`),P({variant:"success",message:a.SIGN_UP_EMAIL}))}catch(re){P({variant:"error",message:En({error:re,localization:a,localizeErrors:K})}),Ae.resetField("password"),Ae.resetField("confirmPassword"),p()}}return x.jsx(pa,{...Ae,children:x.jsxs("form",{onSubmit:Ae.handleSubmit(se),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[B?.includes("image")&&$&&x.jsxs(x.Fragment,{children:[x.jsx("input",{ref:W,accept:"image/*",disabled:ae,hidden:!0,type:"file",onChange:ue=>{var Oe;const Pe=(Oe=ue.target.files)==null?void 0:Oe.item(0);Pe&&H(Pe),ue.target.value=""}}),x.jsx(bn,{control:Ae.control,name:"image",render:()=>x.jsxs(wn,{children:[x.jsx(Sn,{children:a.AVATAR}),x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsxs(XW,{children:[x.jsx(JW,{asChild:!0,children:x.jsx(Qt,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:x.jsx(rY,{isPending:ae,className:"size-16",user:Y?{name:Ae.watch("name"),email:Ae.watch("email"),image:Y}:null,localization:a})})}),x.jsxs(eY,{align:"start",onCloseAutoFocus:ue=>ue.preventDefault(),children:[x.jsxs(GO,{onClick:_e,disabled:ae,children:[x.jsx(DV,{}),a.UPLOAD_AVATAR]}),Y&&x.jsxs(GO,{onClick:ne,disabled:ae,variant:"destructive",children:[x.jsx(VV,{}),a.DELETE_AVATAR]})]})]}),x.jsxs(Qt,{type:"button",variant:"outline",onClick:_e,disabled:ae,children:[ae&&x.jsx(mr,{className:"animate-spin"}),a.UPLOAD]})]}),x.jsx(Fn,{})]})})]}),B?.includes("name")&&x.jsx(bn,{control:Ae.control,name:"name",render:({field:ue})=>x.jsxs(wn,{children:[x.jsxs(Sn,{className:t?.label,children:[a.NAME,!R&&x.jsx("span",{className:"ml-1 text-muted-foreground",children:a.OPTIONAL_BRACKETS})]}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"name",className:t?.input,placeholder:a.NAME_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),U&&x.jsx(bn,{control:Ae.control,name:"username",render:({field:ue})=>x.jsxs(wn,{children:[x.jsxs(Sn,{className:t?.label,children:[a.USERNAME,!J&&x.jsx("span",{className:"ml-1 text-muted-foreground",children:a.OPTIONAL_BRACKETS})]}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"username",className:t?.input,placeholder:a.USERNAME_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:Ae.control,name:"email",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"email",className:t?.input,type:"email",placeholder:a.EMAIL_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:Ae.control,name:"password",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:a.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),G&&x.jsx(bn,{control:Ae.control,name:"confirmPassword",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.CONFIRM_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:a.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),B?.filter(ue=>ue!=="name"&&ue!=="image").map(ue=>{const Oe=g?.[ue];return Oe?Oe.type==="boolean"?x.jsx(bn,{control:Ae.control,name:ue,render:({field:Pe})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:Pe.value,onCheckedChange:Pe.onChange,disabled:r})}),x.jsx(Sn,{className:t?.label,children:Oe.label}),x.jsx(Fn,{className:t?.error})]})},ue):x.jsx(bn,{control:Ae.control,name:ue,render:({field:Pe})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:Oe.label}),x.jsx(Dn,{children:Oe.type==="number"?x.jsx(Vo,{className:t?.input,type:"number",placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value}):Oe.multiline?x.jsx(aY,{className:t?.input,placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value}):x.jsx(Vo,{className:t?.input,type:"text",placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value})}),x.jsx(Fn,{className:t?.error})]})},ue):(console.error(`Additional field ${ue} not found`),null)}),x.jsx(Id,{ref:f,localization:a,action:"/sign-up/email"}),x.jsx(Qt,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?x.jsx(mr,{className:"animate-spin"}):a.SIGN_UP_ACTION})]})})}function BY({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:a=0,redirectTo:i,setIsSubmitting:l}){var u;const d=Ka(),f=d?Vi("totpURI"):null,m=A.useRef(!1),{authClient:p,basePath:g,hooks:{useSession:y},localization:w,twoFactor:S,viewPaths:b,toast:E,Link:R,localizeErrors:T}=A.useContext(ht);r={...w,...r};const{onSuccess:O,isPending:C}=ma({redirectTo:i}),{data:I}=y(),N=(u=I?.user)==null?void 0:u.twoFactorEnabled,[P,$]=A.useState(S?.length===1?S[0]:null),[K,V]=A.useState(!1),[G,U]=A.useState(0),J=ce({code:D().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:nt().optional()}),le=da({resolver:fa(J),defaultValues:{code:""}});n=n||le.formState.isSubmitting||C,A.useEffect(()=>{l?.(le.formState.isSubmitting||C)},[le.formState.isSubmitting,C,l]),A.useEffect(()=>{P==="otp"&&G<=0&&!m.current&&(m.current=!0,B())},[P]),A.useEffect(()=>{if(G<=0)return;const Y=setTimeout(()=>{U(pe=>pe-1)},1e3);return()=>clearTimeout(Y)},[G]);const B=async()=>{if(!(K||G>0)){try{V(!0),await p.twoFactor.sendOtp({fetchOptions:{throw:!0}}),U(60)}catch(Y){E({variant:"error",message:En({error:Y,localization:r,localizeErrors:T})}),Y.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}m.current=!1,V(!1)}};async function W({code:Y,trustDevice:pe}){try{await(P==="totp"?p.twoFactor.verifyTotp:p.twoFactor.verifyOtp)({code:Y,trustDevice:pe,fetchOptions:{throw:!0}}),await O(),I&&!N&&E({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(ae){E({variant:"error",message:En({error:ae,localization:r,localizeErrors:T})}),le.reset()}}return x.jsx(pa,{...le,children:x.jsxs("form",{onSubmit:le.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[S?.includes("totp")&&f&&P==="totp"&&x.jsxs("div",{className:"space-y-3",children:[x.jsx(f4,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),x.jsx(FW,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),P!==null&&x.jsxs(x.Fragment,{children:[x.jsx(bn,{control:le.control,name:"code",render:({field:Y})=>x.jsxs(wn,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx(Sn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),x.jsx(R,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${b.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),x.jsx(Dn,{children:x.jsx(R1,{...Y,maxLength:6,onChange:pe=>{Y.onChange(pe),pe.length===6&&le.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:le.control,name:"trustDevice",render:({field:Y})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:Y.value,onCheckedChange:Y.onChange,disabled:n,className:t?.checkbox})}),x.jsx(Sn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),x.jsxs("div",{className:"grid gap-4",children:[P!==null&&x.jsxs(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&x.jsx(mr,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),P==="otp"&&S?.includes("otp")&&x.jsxs(Qt,{type:"button",variant:"outline",onClick:B,disabled:G>0||K||n,className:Ce(t?.button,t?.outlineButton),children:[K?x.jsx(mr,{className:"animate-spin"}):x.jsx(ST,{className:t?.icon}),r.RESEND_CODE,G>0&&` (${G})`]}),P!=="otp"&&S?.includes("otp")&&x.jsxs(Qt,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>$("otp"),disabled:n,children:[x.jsx(ST,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),P!=="totp"&&S?.includes("totp")&&x.jsxs(Qt,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>$("totp"),disabled:n,children:[x.jsx(zV,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function b4({redirectTo:e}){const t=A.useRef(!1),{authClient:n,basePath:r,viewPaths:a}=A.useContext(ht),{onSuccess:i}=ma({redirectTo:e||`${r}/${a.SIGN_IN}`});return A.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(i))},[n,i]),x.jsx(mr,{className:"animate-spin"})}function qY({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,pathname:i,redirectTo:l,view:u,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:m,credentials:p,localization:g,magicLink:y,emailOTP:w,signUp:S,twoFactor:b,viewPaths:E,replace:R}=A.useContext(ht),T=!!S;if(a={...g,...a},A.useEffect(()=>{i&&!u_(E,i)&&(console.error(`Invalid auth view: ${i}`),R(`${m}/${E.SIGN_IN}${window.location.search}`))},[i,E,m,R]),u=u||u_(E,i)||"SIGN_IN",A.useEffect(()=>{let O=!1;u==="MAGIC_LINK"&&(!y||!p&&!w)&&(O=!0),u==="EMAIL_OTP"&&(!w||!p&&!y)&&(O=!0),u==="SIGN_UP"&&!T&&(O=!0),!p&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(u)&&(O=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(u)&&!b&&(O=!0),O&&R(`${m}/${E.SIGN_IN}${window.location.search}`)},[m,u,E,p,R,w,T,y,b]),u==="SIGN_OUT")return x.jsx(b4,{redirectTo:l});if(u==="CALLBACK")return x.jsx(_4,{redirectTo:l});if(u==="SIGN_IN")return p?x.jsx(VY,{className:e,classNames:t,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):y?x.jsx(KO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):w?x.jsx(ZO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(u==="TWO_FACTOR")return x.jsx(BY,{className:e,classNames:t,localization:a,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="RECOVER_ACCOUNT")return x.jsx(UY,{className:e,classNames:t,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="MAGIC_LINK")return x.jsx(KO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="EMAIL_OTP")return x.jsx(ZO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="EMAIL_VERIFICATION")return x.jsx(jY,{className:e,classNames:t,callbackURL:n,localization:a,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="FORGOT_PASSWORD")return x.jsx($Y,{className:e,classNames:t,localization:a,isSubmitting:r,setIsSubmitting:f});if(u==="RESET_PASSWORD")return x.jsx(zY,{className:e,classNames:t,localization:a});if(u==="SIGN_UP")return T&&x.jsx(FY,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function HY({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:a,replace:i,toast:l}=A.useContext(ht),u=A.useMemo(()=>({...r,...n}),[r,n]),{data:d}=ZW(),[f,m]=A.useState(null);return A.useEffect(()=>{const p=Vi("invitationId");if(!p){l({variant:"error",message:u.INVITATION_NOT_FOUND}),i(a);return}m(p)},[u.INVITATION_NOT_FOUND,l,i,a]),!d||!f?x.jsx(w4,{className:e,classNames:t}):x.jsx(GY,{className:e,classNames:t,localization:u,invitationId:f})}function GY({className:e,classNames:t,localization:n,invitationId:r}){var a;const{authClient:i,hooks:{useInvitation:l},localization:u,organization:d,redirectTo:f,replace:m,toast:p,localizeErrors:g}=A.useContext(ht),y=A.useMemo(()=>({...u,...n}),[u,n]),[w,S]=A.useState(!1),[b,E]=A.useState(!1),R=w||b,{data:T,isPending:O}=l({query:{id:r}}),C=A.useCallback(()=>Vi("redirectTo")||f,[f]);A.useEffect(()=>{if(!(O||!r)){if(!T){p({variant:"error",message:y.INVITATION_NOT_FOUND}),m(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(p({variant:"error",message:new Date(T.expiresAt)<new Date?y.INVITATION_EXPIRED:y.INVITATION_NOT_FOUND}),m(f))}},[T,O,r,y,p,m,f]);const I=async()=>{E(!0);try{await i.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),p({variant:"success",message:y.INVITATION_ACCEPTED||"Invitation accepted"}),m(C())}catch(V){p({variant:"error",message:En({error:V,localization:y,localizeErrors:g})}),E(!1)}},N=async()=>{S(!0);try{await i.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),p({variant:"success",message:y.INVITATION_REJECTED}),m(f)}catch(V){p({variant:"error",message:En({error:V,localization:y,localizeErrors:g})}),S(!1)}},K=((a=[...[{role:"owner",label:y.OWNER},{role:"admin",label:y.ADMIN},{role:"member",label:y.MEMBER}],...d?.customRoles||[]].find(V=>V.role===T?.role))==null?void 0:a.label)||T?.role;return T?x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsxs(b1,{className:Ce("justify-items-center text-center",t?.header),children:[x.jsx(u4,{className:Ce("text-lg md:text-xl",t?.title),children:y.ACCEPT_INVITATION}),x.jsx(d4,{className:Ce("text-xs md:text-sm",t?.description),children:y.ACCEPT_INVITATION_DESCRIPTION})]}),x.jsxs(w1,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[x.jsxs(ld,{className:Ce("flex-row items-center p-4"),children:[x.jsx(y4,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:y}),x.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:K})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[x.jsxs(Qt,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:N,disabled:R,children:[w?x.jsx(mr,{className:"animate-spin"}):x.jsx(BV,{}),y.REJECT]}),x.jsxs(Qt,{className:Ce(t?.button,t?.primaryButton),onClick:I,disabled:R,children:[b?x.jsx(mr,{className:"animate-spin"}):x.jsx(iN,{}),y.ACCEPT]})]})]})]}):x.jsx(w4,{className:e,classNames:t})}var w4=({className:e,classNames:t,localization:n})=>x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsxs(b1,{className:Ce("justify-items-center",t?.header),children:[x.jsx(Va,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),x.jsx(Va,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),x.jsxs(w1,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[x.jsxs(ld,{className:Ce("flex-row items-center p-4"),children:[x.jsx(y4,{isPending:!0,localization:n}),x.jsx(Va,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[x.jsx(Va,{className:"h-9 w-full"}),x.jsx(Va,{className:"h-9 w-full"})]})]})]});function WO({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(GW,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function ZY({classNames:e,isSubmitting:t,localization:n,view:r}){var a,i,l,u;const{viewPaths:d,navigate:f,basePath:m}=A.useContext(ht);return x.jsxs(Qt,{className:Ce("w-full",(a=e?.form)==null?void 0:a.button,(i=e?.form)==null?void 0:i.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${m}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?x.jsx(lN,{className:(l=e?.form)==null?void 0:l.icon}):x.jsx(cN,{className:(u=e?.form)==null?void 0:u.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function KY({classNames:e,isSubmitting:t,localization:n,view:r}){var a,i,l,u;const{viewPaths:d,navigate:f,basePath:m,credentials:p}=A.useContext(ht);return x.jsxs(Qt,{className:Ce("w-full",(a=e?.form)==null?void 0:a.button,(i=e?.form)==null?void 0:i.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${m}/${r==="MAGIC_LINK"||!p?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?x.jsx(lN,{className:(l=e?.form)==null?void 0:l.icon}):x.jsx(cN,{className:(u=e?.form)==null?void 0:u.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function WY({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:a,localizeErrors:i}=A.useContext(ht),l=A.useRef(!1);e=A.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:u}=ma({redirectTo:t});return A.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:u}})}catch(d){a({variant:"error",message:En({error:d,localization:e,localizeErrors:i})})}}},[n,e,i,u,a]),null}function YY({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:a}){var i,l;const{authClient:u,localization:d,toast:f,localizeErrors:m}=A.useContext(ht);n={...d,...n};const{onSuccess:p}=ma({redirectTo:r}),g=async()=>{a?.(!0);try{const y=await u.signIn.passkey({fetchOptions:{throw:!0}});y?.error?(f({variant:"error",message:En({error:y.error,localization:n,localizeErrors:m})}),a?.(!1)):p()}catch(y){f({variant:"error",message:En({error:y,localization:n,localizeErrors:m})}),a?.(!1)}};return x.jsxs(Qt,{className:Ce("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[x.jsx($V,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function YO({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,other:i,provider:l,redirectTo:u,socialLayout:d,setIsSubmitting:f}){var m,p,g,y;const{authClient:w,basePath:S,baseURL:b,persistClient:E,redirectTo:R,viewPaths:T,social:O,genericOAuth:C,toast:I,localizeErrors:N}=A.useContext(ht),P=A.useCallback(()=>u||Vi("redirectTo")||R,[u,R]),$=A.useCallback(()=>`${b}${n||(E?`${S}/${T.CALLBACK}?redirectTo=${encodeURIComponent(P())}`:P())}`,[n,E,S,T,b,P]),K=async()=>{f(!0);try{if(i){const V={providerId:l.provider,callbackURL:$(),fetchOptions:{throw:!0}};C?.signIn?(await C.signIn(V),setTimeout(()=>{f(!1)},1e4)):await w.signIn.oauth2(V)}else{const V={provider:l.provider,callbackURL:$(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(V),setTimeout(()=>{f(!1)},1e4)):await w.signIn.social(V)}}catch(V){I({variant:"error",message:En({error:V,localization:a,localizeErrors:N})}),f(!1)}};return x.jsxs(Qt,{className:Ce(d==="vertical"?"w-full":"grow",e,(m=t?.form)==null?void 0:m.button,(p=t?.form)==null?void 0:p.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:K,children:[l.icon&&x.jsx(l.icon,{className:(y=t?.form)==null?void 0:y.icon}),d==="grid"&&l.name,d==="vertical"&&`${a.SIGN_IN_WITH} ${l.name}`]})}function loe({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:a,localization:i,path:l,pathname:u,redirectTo:d,socialLayout:f="auto",view:m,otpSeparators:p=0}){var g,y,w,S,b,E;const R=Ka(),{basePath:T,credentials:O,localization:C,magicLink:I,emailOTP:N,oneTap:P,passkey:$,signUp:K,social:V,genericOAuth:G,viewPaths:U,Link:J}=A.useContext(ht);i={...C,...i};let le=f;le==="auto"&&(le=O&&V?.providers&&V.providers.length>2?"horizontal":"vertical");const B=l??u?.split("/").pop(),W=m||u_(U,B)||"SIGN_IN",[Y,pe]=A.useState(!1);if(A.useEffect(()=>{const M=()=>pe(!1);return window.addEventListener("pagehide",M),()=>{pe(!1),window.removeEventListener("pagehide",M)}},[]),W==="CALLBACK")return x.jsx(_4,{redirectTo:d});if(W==="SIGN_OUT")return x.jsx(b4,{redirectTo:d});if(W==="ACCEPT_INVITATION")return x.jsx(HY,{className:e,classNames:t});const ae=!O&&!I&&!N?i.DISABLED_CREDENTIALS_DESCRIPTION:i[`${W}_DESCRIPTION`];return x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsx(b1,{className:t?.header,children:r||x.jsxs(x.Fragment,{children:[x.jsx(u4,{className:Ce("text-lg md:text-xl",t?.title),children:i[W]}),ae&&x.jsx(d4,{className:Ce("text-xs md:text-sm",t?.description),children:ae})]})}),x.jsxs(w1,{className:Ce("grid gap-6",t?.content),children:[P&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&x.jsx(WY,{localization:i,redirectTo:d}),(O||I||N)&&x.jsxs("div",{className:"grid gap-4",children:[x.jsx(qY,{classNames:t?.form,callbackURL:n,isSubmitting:Y,localization:i,otpSeparators:p,view:W,redirectTo:d,setIsSubmitting:pe}),I&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||N&&W==="EMAIL_OTP")&&x.jsx(KY,{classNames:t,localization:i,view:W,isSubmitting:Y}),N&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&["SIGN_IN","MAGIC_LINK"].includes(W))&&x.jsx(ZY,{classNames:t,localization:i,view:W,isSubmitting:Y})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=V?.providers)==null?void 0:g.length)||((y=G?.providers)==null?void 0:y.length)||W==="SIGN_IN"&&$)&&x.jsxs(x.Fragment,{children:[(O||I||N)&&x.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[x.jsx(WO,{className:Ce("!w-auto grow",t?.separator)}),x.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:i.OR_CONTINUE_WITH}),x.jsx(WO,{className:Ce("!w-auto grow",t?.separator)})]}),x.jsxs("div",{className:"grid gap-4",children:[(((w=V?.providers)==null?void 0:w.length)||((S=G?.providers)==null?void 0:S.length))&&x.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",le==="horizontal"&&"flex-wrap",le==="vertical"&&"flex-col",le==="grid"&&"grid grid-cols-2"),children:[(b=V?.providers)==null?void 0:b.map(M=>{const q=AY.find(F=>F.provider===M);return q?x.jsx(YO,{classNames:t,callbackURL:n,isSubmitting:Y,localization:i,provider:q,redirectTo:d,setIsSubmitting:pe,socialLayout:le},M):null}),(E=G?.providers)==null?void 0:E.map(M=>x.jsx(YO,{classNames:t,callbackURL:n,isSubmitting:Y,localization:i,provider:M,redirectTo:d,setIsSubmitting:pe,socialLayout:le,other:!0},M.provider))]}),$&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&x.jsx(YY,{classNames:t,isSubmitting:Y,localization:i,redirectTo:d,setIsSubmitting:pe})]})]})]}),a&&x.jsx(HO,{className:t?.footer,children:a}),O&&K&&x.jsxs(HO,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?i.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?i.ALREADY_HAVE_AN_ACCOUNT:x.jsx(MV,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?x.jsx(J,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${U[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${R?window.location.search:""}`,children:x.jsx(Qt,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?i.SIGN_UP:i.SIGN_IN})}):x.jsx(Qt,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:i.GO_BACK})]})]})}function coe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{isPending:n}=t();return n?e:null}function uoe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{data:n}=t();return n?e:null}function doe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{data:n,isPending:r}=t();return!n&&!r?e:null}function QY(e){const t=Ui.c(8),{children:n}=e,r=vc();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={basePath:"/",pathMode:"slug"},t[0]=a):a=t[0];let i,l;t[1]!==r?(i=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=i,t[3]=l):(i=t[2],l=t[3]);let u;return t[4]!==n||t[5]!==i||t[6]!==l?(u=x.jsx(AV,{authClient:Dj,organization:a,navigate:i,replace:l,Link:XY,children:n}),t[4]=n,t[5]=i,t[6]=l,t[7]=u):u=t[7],u}function XY(e){const{href:t,className:n,children:r,...a}=e;return x.jsx(Am,{to:t,className:n,...a,children:r})}async function JY(){const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}function eQ(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([a,i])=>` ${a}: ${i};`).join(`
155
+ `}),x.jsx(bW,{ref:e,sitekey:t.siteKey,theme:n,hl:r,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:Ce(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${r}-${t.provider}`)]}):null}var PY=["/sign-up/email","/sign-in/email","/forget-password"];function Id({ref:e,localization:t,action:n}){const{captcha:r}=A.useContext(ht);if(!r||n&&!(r.endpoints||PY).includes(n))return null;const{theme:a}=Mb(),i=r.provider==="google-recaptcha-v2-checkbox"||r.provider==="google-recaptcha-v2-invisible",l=r.provider==="google-recaptcha-v3"||r.provider==="google-recaptcha-v2-invisible",u=r.provider==="cloudflare-turnstile",d=r.provider==="hcaptcha",f=r.provider==="captchafox";return x.jsxs(x.Fragment,{children:[i&&x.jsx(MY,{ref:e}),l&&x.jsx(kY,{localization:t}),u&&x.jsx(JM,{className:"mx-auto",ref:e,siteKey:r.siteKey,options:{theme:a,size:"flexible"}}),d&&x.jsx("div",{className:"mx-auto",children:x.jsx(KK,{ref:e,sitekey:r.siteKey,theme:a})}),f&&x.jsx("div",{className:"mx-auto",children:x.jsx(BM,{ref:e,sitekey:r.siteKey,theme:a})})]})}function R1({className:e,containerClassName:t,...n}){return x.jsx(o4,{"data-slot":"input-otp",containerClassName:Ce("flex items-center gap-2 has-disabled:opacity-50",t),className:Ce("disabled:cursor-not-allowed",e),...n})}function $l({className:e,...t}){return x.jsx("div",{"data-slot":"input-otp-group",className:Ce("flex items-center",e),...t})}function Gn({index:e,className:t,...n}){const r=A.useContext(r4),{char:a,hasFakeCaret:i,isActive:l}=r?.slots[e]??{};return x.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:Ce("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[a,i&&x.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:x.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function O0({...e}){return x.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:x.jsx(UV,{})})}function x1({otpSeparators:e=0}){return e===0?x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1}),x.jsx(Gn,{index:2}),x.jsx(Gn,{index:3}),x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]}):e===1?x.jsxs(x.Fragment,{children:[x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1}),x.jsx(Gn,{index:2})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:3}),x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]})]}):x.jsxs(x.Fragment,{children:[x.jsxs($l,{children:[x.jsx(Gn,{index:0}),x.jsx(Gn,{index:1})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:2}),x.jsx(Gn,{index:3})]}),x.jsx(O0,{}),x.jsxs($l,{children:[x.jsx(Gn,{index:4}),x.jsx(Gn,{index:5})]})]})}function ZO(e){const[t,n]=A.useState();return t?x.jsx(LY,{...e,email:t}):x.jsx(DY,{...e,setEmail:n})}function DY({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:a,setEmail:i}){const l=Ka(),{captchaRef:u,getCaptchaHeaders:d}=Ad({localization:r}),{authClient:f,localization:m,toast:p,localizeErrors:g}=A.useContext(ht);r={...m,...r};const y=ce({email:D().email({message:`${r.EMAIL} ${r.IS_INVALID}`})}),w=da({resolver:fa(y),defaultValues:{email:""}});n=n||w.formState.isSubmitting,A.useEffect(()=>{a?.(w.formState.isSubmitting)},[w.formState.isSubmitting,a]);async function S({email:b}){const E={throw:!0,headers:await d("/email-otp/send-verification-otp")};try{await f.emailOtp.sendVerificationOtp({email:b,type:"sign-in",fetchOptions:E}),p({variant:"success",message:r.EMAIL_OTP_VERIFICATION_SENT}),i(b)}catch(R){p({variant:"error",message:En({error:R,localization:r,localizeErrors:g})})}}return x.jsx(pa,{...w,children:x.jsxs("form",{onSubmit:w.handleSubmit(S),noValidate:l,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:w.control,name:"email",render:({field:b})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...b})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:u,localization:r,action:"/email-otp/send-verification-otp"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.EMAIL_OTP_SEND_ACTION})]})})}function LY({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:a=0,redirectTo:i,setIsSubmitting:l,email:u}){const{authClient:d,localization:f,toast:m,localizeErrors:p}=A.useContext(ht);r={...f,...r};const{onSuccess:g,isPending:y}=ma({redirectTo:i}),w=ce({code:D().min(1,{message:`${r.EMAIL_OTP} ${r.IS_REQUIRED}`}).min(6,{message:`${r.EMAIL_OTP} ${r.IS_INVALID}`})}),S=da({resolver:fa(w),defaultValues:{code:""}});n=n||S.formState.isSubmitting||y,A.useEffect(()=>{l?.(S.formState.isSubmitting||y)},[S.formState.isSubmitting,y,l]);async function b({code:E}){try{await d.signIn.emailOtp({email:u,otp:E,fetchOptions:{throw:!0}}),await g()}catch(R){m({variant:"error",message:En({error:R,localization:r,localizeErrors:p})}),S.reset()}}return x.jsx(pa,{...S,children:x.jsxs("form",{onSubmit:S.handleSubmit(b),className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:S.control,name:"code",render:({field:E})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL_OTP}),x.jsx(Dn,{children:x.jsx(R1,{...E,maxLength:6,onChange:R=>{E.onChange(R),R.length===6&&S.handleSubmit(b)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx("div",{className:"grid gap-4",children:x.jsxs(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&x.jsx(mr,{className:"animate-spin"}),r.EMAIL_OTP_VERIFY_ACTION]})})]})})}function jY({onCancel:e,localization:t,className:n,classNames:r,otpSeparators:a,callbackURL:i,isSubmitting:l,redirectTo:u,setIsSubmitting:d}){const[f,m]=A.useState(!0),[p,g]=A.useState(30),{authClient:y,localization:w,toast:S,localizeErrors:b,navigate:E,basePath:R,viewPaths:T}=A.useContext(ht);t={...w,...t};const O=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:C,isPending:I}=ma({redirectTo:u}),N=ce({code:D().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),P=da({resolver:fa(N),defaultValues:{code:""}}),$=l||P.formState.isSubmitting||I;A.useEffect(()=>{d?.(P.formState.isSubmitting||I)},[P.formState.isSubmitting,I,d]),A.useEffect(()=>{if(p>0){const G=setTimeout(()=>g(p-1),1e3);return()=>clearTimeout(G)}else m(!1)},[p]);async function K({code:G}){try{const U=await y.emailOtp.verifyEmail({email:O,otp:G,fetchOptions:{throw:!0}});"token"in U&&U.token?await C():(E(`${R}/${T.SIGN_IN}${window.location.search}`),S({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(U){S({variant:"error",message:En({error:U,localization:t,localizeErrors:b})}),P.reset()}}async function V(){if(!f){m(!0),g(30);try{await y.emailOtp.sendVerificationOtp({email:O,type:"email-verification",fetchOptions:{throw:!0}}),S({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(G){S({variant:"error",message:En({error:G,localization:t,localizeErrors:b})}),m(!1),g(0)}}}return O?x.jsx(pa,{...P,children:x.jsxs("form",{onSubmit:P.handleSubmit(K),className:Ce("grid w-full gap-6",n,r?.base),children:[x.jsx(bn,{control:P.control,name:"code",render:({field:G})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:r?.label,children:t.EMAIL_OTP}),x.jsx(Dn,{children:x.jsx(R1,{...G,maxLength:6,onChange:U=>{G.onChange(U),U.length===6&&P.handleSubmit(K)()},containerClassName:r?.otpInputContainer,className:r?.otpInput,disabled:$,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:r?.error})]})}),x.jsxs("div",{className:"grid gap-4",children:[x.jsxs(Qt,{type:"submit",disabled:$,className:Ce(r?.button,r?.primaryButton),children:[$&&x.jsx(mr,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),x.jsx(Qt,{type:"button",variant:"outline",onClick:V,disabled:f||$,className:Ce("w-full",r?.button),children:f?`${t.RESEND_VERIFICATION_EMAIL} (${p}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&x.jsx(Qt,{type:"button",variant:"ghost",onClick:e,disabled:$,className:"w-full",children:t.CANCEL})]})]})}):x.jsx("div",{className:Ce("grid w-full gap-6",n),children:x.jsxs("div",{className:"text-center",children:[x.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),x.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function $Y({className:e,classNames:t,isSubmitting:n,localization:r,setIsSubmitting:a}){const i=Ka(),{captchaRef:l,getCaptchaHeaders:u,resetCaptcha:d}=Ad({localization:r}),{authClient:f,basePath:m,baseURL:p,localization:g,navigate:y,toast:w,viewPaths:S,localizeErrors:b}=A.useContext(ht);r={...g,...r};const E=ce({email:D().email({message:`${r.EMAIL} ${r.IS_INVALID}`}).min(1,{message:`${r.EMAIL} ${r.IS_REQUIRED}`})}),R=da({resolver:fa(E),defaultValues:{email:""}});n=n||R.formState.isSubmitting,A.useEffect(()=>{a?.(R.formState.isSubmitting)},[R.formState.isSubmitting,a]);async function T({email:O}){try{const C={throw:!0,headers:await u("/forget-password")};await f.requestPasswordReset({email:O,redirectTo:`${p}${m}/${S.RESET_PASSWORD}`,fetchOptions:C}),w({variant:"success",message:r.FORGOT_PASSWORD_EMAIL}),y(`${m}/${S.SIGN_IN}${window.location.search}`)}catch(C){w({variant:"error",message:En({error:C,localization:r,localizeErrors:b})}),d()}}return x.jsx(pa,{...R,children:x.jsxs("form",{onSubmit:R.handleSubmit(T),noValidate:i,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:R.control,name:"email",render:({field:O})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:r.EMAIL_PLACEHOLDER,disabled:n,...O})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:l,localization:r,action:"/forget-password"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.FORGOT_PASSWORD_ACTION})]})})}function KO({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,redirectTo:i,setIsSubmitting:l}){const u=Ka(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:m}=Ad({localization:a}),{authClient:p,basePath:g,baseURL:y,persistClient:w,localization:S,redirectTo:b,viewPaths:E,toast:R,localizeErrors:T}=A.useContext(ht);a={...S,...a};const O=A.useCallback(()=>i||Vi("redirectTo")||b,[i,b]),C=A.useCallback(()=>`${y}${n||(w?`${g}/${E.CALLBACK}?redirectTo=${encodeURIComponent(O())}`:O())}`,[n,w,g,E,y,O]),I=ce({email:D().email({message:`${a.EMAIL} ${a.IS_INVALID}`})}),N=da({resolver:fa(I),defaultValues:{email:""}});r=r||N.formState.isSubmitting,A.useEffect(()=>{l?.(N.formState.isSubmitting)},[N.formState.isSubmitting,l]);async function P({email:$}){try{const K={throw:!0,headers:await f("/sign-in/magic-link")};await p.signIn.magicLink({email:$,callbackURL:C(),fetchOptions:K}),R({variant:"success",message:a.MAGIC_LINK_EMAIL}),N.reset()}catch(K){R({variant:"error",message:En({error:K,localization:a,localizeErrors:T})}),m()}}return x.jsx(pa,{...N,children:x.jsxs("form",{onSubmit:N.handleSubmit(P),noValidate:u,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:N.control,name:"email",render:({field:$})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{className:t?.input,type:"email",placeholder:a.EMAIL_PLACEHOLDER,disabled:r,...$})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Id,{ref:d,localization:a,action:"/sign-in/magic-link"}),x.jsx(Qt,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?x.jsx(mr,{className:"animate-spin"}):a.MAGIC_LINK_ACTION})]})})}function UY({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:a,setIsSubmitting:i}){const{authClient:l,localization:u,toast:d,localizeErrors:f}=A.useContext(ht);r={...u,...r};const{onSuccess:m,isPending:p}=ma({redirectTo:a}),g=ce({code:D().min(1,{message:r.BACKUP_CODE_REQUIRED})}),y=da({resolver:fa(g),defaultValues:{code:""}});n=n||y.formState.isSubmitting||p,A.useEffect(()=>{i?.(y.formState.isSubmitting||p)},[y.formState.isSubmitting,p,i]);async function w({code:S}){try{await l.twoFactor.verifyBackupCode({code:S,fetchOptions:{throw:!0}}),await m()}catch(b){d({variant:"error",message:En({error:b,localization:r,localizeErrors:f})}),y.reset()}}return x.jsx(pa,{...y,children:x.jsxs("form",{onSubmit:y.handleSubmit(w),className:Ce("grid gap-6",e,t?.base),children:[x.jsx(bn,{control:y.control,name:"code",render:({field:S})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:r.BACKUP_CODE}),x.jsx(Dn,{children:x.jsx(Vo,{placeholder:r.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...S})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.RECOVER_ACCOUNT_ACTION})]})})}function zY({className:e,classNames:t,localization:n,passwordValidation:r}){const a=A.useRef(!1),{authClient:i,basePath:l,credentials:u,localization:d,viewPaths:f,navigate:m,toast:p,localizeErrors:g}=A.useContext(ht),y=u?.confirmPassword,w=u?.passwordValidation;n={...d,...n},r={...w,...r};const S=ce({newPassword:nd(r,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:y?nd(r,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):D().optional()}).refine(T=>!y||T.newPassword===T.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),b=da({resolver:fa(S),defaultValues:{newPassword:"",confirmPassword:""}}),E=b.formState.isSubmitting;A.useEffect(()=>{if(a.current)return;a.current=!0;const O=new URLSearchParams(window.location.search).get("token");(!O||O==="INVALID_TOKEN")&&(m(`${l}/${f.SIGN_IN}${window.location.search}`),p({variant:"error",message:n.INVALID_TOKEN}))},[l,m,p,f,n]);async function R({newPassword:T}){try{const C=new URLSearchParams(window.location.search).get("token");await i.resetPassword({newPassword:T,token:C,fetchOptions:{throw:!0}}),p({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),m(`${l}/${f.SIGN_IN}${window.location.search}`)}catch(O){p({variant:"error",message:En({error:O,localization:n,localizeErrors:g})}),b.reset()}}return x.jsx(pa,{...b,children:x.jsxs("form",{onSubmit:b.handleSubmit(R),className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:b.control,name:"newPassword",render:({field:T})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:n.NEW_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:E,...T})}),x.jsx(Fn,{className:t?.error})]})}),y&&x.jsx(bn,{control:b.control,name:"confirmPassword",render:({field:T})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:n.CONFIRM_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:E,...T})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(Qt,{type:"submit",disabled:E,className:Ce("w-full",t?.button,t?.primaryButton),children:E?x.jsx(mr,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function VY({className:e,classNames:t,isSubmitting:n,localization:r,redirectTo:a,setIsSubmitting:i,passwordValidation:l}){const u=Ka(),{captchaRef:d,getCaptchaHeaders:f,resetCaptcha:m}=Ad({localization:r}),{authClient:p,basePath:g,credentials:y,localization:w,viewPaths:S,navigate:b,toast:E,Link:R,localizeErrors:T,emailVerification:O}=A.useContext(ht),C=y?.rememberMe,I=y?.username,N=y?.passwordValidation;r={...w,...r},l={...N,...l};const{onSuccess:P,isPending:$}=ma({redirectTo:a}),K=ce({email:I?D().min(1,{message:`${r.USERNAME} ${r.IS_REQUIRED}`}):D().email({message:`${r.EMAIL} ${r.IS_INVALID}`}),password:nd(l,r),rememberMe:et().optional()}),V=da({resolver:fa(K),defaultValues:{email:"",password:"",rememberMe:!C}});n=n||V.formState.isSubmitting||$,A.useEffect(()=>{i?.(V.formState.isSubmitting||$)},[V.formState.isSubmitting,$,i]);async function G({email:U,password:J,rememberMe:le}){var B;try{let W={};if(I&&!fz(U)){const Y={throw:!0,headers:await f("/sign-in/username")};W=await p.signIn.username({username:U,password:J,rememberMe:le,fetchOptions:Y})}else{const Y={throw:!0,headers:await f("/sign-in/email")};W=await p.signIn.email({email:U,password:J,rememberMe:le,fetchOptions:Y})}W.twoFactorRedirect?b(`${g}/${S.TWO_FACTOR}${window.location.search}`):await P()}catch(W){V.resetField("password"),m(),E({variant:"error",message:En({error:W,localization:r,localizeErrors:T})}),O?.otp&&((B=W?.error)==null?void 0:B.code)==="EMAIL_NOT_VERIFIED"&&b(`${g}/${S.EMAIL_VERIFICATION}?email=${encodeURIComponent(U)}`)}}return x.jsx(pa,{...V,children:x.jsxs("form",{onSubmit:V.handleSubmit(G),noValidate:u,className:Ce("grid w-full gap-6",e,t?.base),children:[x.jsx(bn,{control:V.control,name:"email",render:({field:U})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:I?r.USERNAME:r.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:I?"username":"email",className:t?.input,type:I?"text":"email",placeholder:I?r.SIGN_IN_USERNAME_PLACEHOLDER:r.EMAIL_PLACEHOLDER,disabled:n,...U})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:V.control,name:"password",render:({field:U})=>x.jsxs(wn,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx(Sn,{className:t?.label,children:r.PASSWORD}),y?.forgotPassword&&x.jsx(R,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${S.FORGOT_PASSWORD}${u?window.location.search:""}`,children:r.FORGOT_PASSWORD_LINK})]}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"current-password",className:t?.input,placeholder:r.PASSWORD_PLACEHOLDER,disabled:n,...U})}),x.jsx(Fn,{className:t?.error})]})}),C&&x.jsx(bn,{control:V.control,name:"rememberMe",render:({field:U})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:U.value,onCheckedChange:U.onChange,disabled:n})}),x.jsx(Sn,{children:r.REMEMBER_ME})]})}),x.jsx(Id,{ref:d,localization:r,action:"/sign-in/email"}),x.jsx(Qt,{type:"submit",disabled:n,className:Ce("w-full",t?.button,t?.primaryButton),children:n?x.jsx(mr,{className:"animate-spin"}):r.SIGN_IN_ACTION})]})})}function FY({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,redirectTo:i,setIsSubmitting:l,passwordValidation:u}){const d=Ka(),{captchaRef:f,getCaptchaHeaders:m,resetCaptcha:p}=Ad({localization:a}),{additionalFields:g,authClient:y,basePath:w,baseURL:S,credentials:b,localization:E,nameRequired:R,persistClient:T,redirectTo:O,signUp:C,viewPaths:I,navigate:N,toast:P,avatar:$,localizeErrors:K,emailVerification:V}=A.useContext(ht),G=b?.confirmPassword,U=b?.username,J=b?.usernameRequired??!0,le=b?.passwordValidation,B=C?.fields;a={...E,...a},u={...le,...u};const W=A.useRef(null),[Y,pe]=A.useState(null),[ae,M]=A.useState(!1),q=A.useCallback(()=>i||Vi("redirectTo")||O,[i,O]),F=A.useCallback(()=>`${S}${n||(T?`${w}/${I.CALLBACK}?redirectTo=${encodeURIComponent(q())}`:q())}`,[n,T,w,I,S,q]),{onSuccess:L,isPending:z}=ma({redirectTo:i}),X={email:D().email({message:`${a.EMAIL} ${a.IS_INVALID}`}),password:nd(u,a),name:B?.includes("name")&&R?D().min(1,{message:`${a.NAME} ${a.IS_REQUIRED}`}):D().optional(),image:D().optional(),username:U&&J?D().min(1,{message:`${a.USERNAME} ${a.IS_REQUIRED}`}):D().optional(),confirmPassword:G?nd(u,{PASSWORD_REQUIRED:a.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:a.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:a.PASSWORD_TOO_LONG,INVALID_PASSWORD:a.INVALID_PASSWORD}):D().optional()},de={};if(B)for(const ue of B){if(ue==="name"||ue==="image")continue;const Oe=g?.[ue];if(!Oe)continue;let Pe;Oe.type==="number"?Pe=Oe.required?kb(Xe=>Xe?Number(Xe):void 0,Ze({message:`${Oe.label} ${a.IS_INVALID}`})):tN({message:`${Oe.label} ${a.IS_INVALID}`}).optional():Oe.type==="boolean"?Pe=Oe.required?pT({message:`${Oe.label} ${a.IS_INVALID}`}).refine(Xe=>Xe===!0,{message:`${Oe.label} ${a.IS_REQUIRED}`}):pT({message:`${Oe.label} ${a.IS_INVALID}`}).optional():Pe=Oe.required?D().min(1,`${Oe.label} ${a.IS_REQUIRED}`):D().optional(),de[ue]=Pe}const ve=ce(X).extend(de).refine(ue=>G?ue.password===ue.confirmPassword:!0,{message:a.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),Ie={email:"",password:"",...G&&{confirmPassword:""},...B?.includes("name")?{name:""}:{},...U?{username:""}:{},...B?.includes("image")&&$?{image:""}:{}};if(B)for(const ue of B){if(ue==="name"||ue==="image")continue;const Oe=g?.[ue];Oe&&(Ie[ue]=Oe.type==="boolean"?!1:"")}const Ae=da({resolver:fa(ve),defaultValues:Ie});r=r||Ae.formState.isSubmitting||z,A.useEffect(()=>{l?.(Ae.formState.isSubmitting||z)},[Ae.formState.isSubmitting,z,l]);const H=async ue=>{if($){M(!0);try{const Oe=await WW(ue,crypto.randomUUID(),$.size,$.extension);let Pe;$.upload?Pe=await $.upload(Oe):Pe=await QW(Oe),Pe?(pe(Pe),Ae.setValue("image",Pe)):(pe(null),Ae.setValue("image",""))}catch(Oe){console.error(Oe),P({variant:"error",message:En({error:Oe,localization:a,localizeErrors:K})})}M(!1)}},ne=()=>{pe(null),Ae.setValue("image","")},_e=()=>{var ue;return(ue=W.current)==null?void 0:ue.click()};async function se({email:ue,password:Oe,name:Pe,username:Xe,confirmPassword:Fe,image:We,...Z}){try{for(const[xe,Re]of Object.entries(Z)){const ke=g?.[xe];if(ke?.validate&&typeof Re=="string"&&!await ke.validate(Re)){Ae.setError(xe,{message:`${ke.label} ${a.IS_INVALID}`});return}}const re={throw:!0,headers:await m("/sign-up/email")},oe={};Xe!==void 0&&(!J&&(Xe===null||Xe===""||typeof Xe=="string"&&Xe.trim()==="")||(oe.username=Xe)),We!==void 0&&(oe.image=We);const we=await y.signUp.email({email:ue,password:Oe,name:Pe||"",...oe,...Z,callbackURL:F(),fetchOptions:re});"token"in we&&we.token?await L():V?.otp?N(`${w}/${I.EMAIL_VERIFICATION}?email=${encodeURIComponent(ue)}`):(N(`${w}/${I.SIGN_IN}${window.location.search}`),P({variant:"success",message:a.SIGN_UP_EMAIL}))}catch(re){P({variant:"error",message:En({error:re,localization:a,localizeErrors:K})}),Ae.resetField("password"),Ae.resetField("confirmPassword"),p()}}return x.jsx(pa,{...Ae,children:x.jsxs("form",{onSubmit:Ae.handleSubmit(se),noValidate:d,className:Ce("grid w-full gap-6",e,t?.base),children:[B?.includes("image")&&$&&x.jsxs(x.Fragment,{children:[x.jsx("input",{ref:W,accept:"image/*",disabled:ae,hidden:!0,type:"file",onChange:ue=>{var Oe;const Pe=(Oe=ue.target.files)==null?void 0:Oe.item(0);Pe&&H(Pe),ue.target.value=""}}),x.jsx(bn,{control:Ae.control,name:"image",render:()=>x.jsxs(wn,{children:[x.jsx(Sn,{children:a.AVATAR}),x.jsxs("div",{className:"flex items-center gap-4",children:[x.jsxs(XW,{children:[x.jsx(JW,{asChild:!0,children:x.jsx(Qt,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:x.jsx(rY,{isPending:ae,className:"size-16",user:Y?{name:Ae.watch("name"),email:Ae.watch("email"),image:Y}:null,localization:a})})}),x.jsxs(eY,{align:"start",onCloseAutoFocus:ue=>ue.preventDefault(),children:[x.jsxs(GO,{onClick:_e,disabled:ae,children:[x.jsx(DV,{}),a.UPLOAD_AVATAR]}),Y&&x.jsxs(GO,{onClick:ne,disabled:ae,variant:"destructive",children:[x.jsx(VV,{}),a.DELETE_AVATAR]})]})]}),x.jsxs(Qt,{type:"button",variant:"outline",onClick:_e,disabled:ae,children:[ae&&x.jsx(mr,{className:"animate-spin"}),a.UPLOAD]})]}),x.jsx(Fn,{})]})})]}),B?.includes("name")&&x.jsx(bn,{control:Ae.control,name:"name",render:({field:ue})=>x.jsxs(wn,{children:[x.jsxs(Sn,{className:t?.label,children:[a.NAME,!R&&x.jsx("span",{className:"ml-1 text-muted-foreground",children:a.OPTIONAL_BRACKETS})]}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"name",className:t?.input,placeholder:a.NAME_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),U&&x.jsx(bn,{control:Ae.control,name:"username",render:({field:ue})=>x.jsxs(wn,{children:[x.jsxs(Sn,{className:t?.label,children:[a.USERNAME,!J&&x.jsx("span",{className:"ml-1 text-muted-foreground",children:a.OPTIONAL_BRACKETS})]}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"username",className:t?.input,placeholder:a.USERNAME_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:Ae.control,name:"email",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.EMAIL}),x.jsx(Dn,{children:x.jsx(Vo,{autoComplete:"email",className:t?.input,type:"email",placeholder:a.EMAIL_PLACEHOLDER,disabled:r,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:Ae.control,name:"password",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:a.PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),G&&x.jsx(bn,{control:Ae.control,name:"confirmPassword",render:({field:ue})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:a.CONFIRM_PASSWORD}),x.jsx(Dn,{children:x.jsx(cd,{autoComplete:"new-password",className:t?.input,placeholder:a.CONFIRM_PASSWORD_PLACEHOLDER,disabled:r,enableToggle:!0,...ue,value:ue.value})}),x.jsx(Fn,{className:t?.error})]})}),B?.filter(ue=>ue!=="name"&&ue!=="image").map(ue=>{const Oe=g?.[ue];return Oe?Oe.type==="boolean"?x.jsx(bn,{control:Ae.control,name:ue,render:({field:Pe})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:Pe.value,onCheckedChange:Pe.onChange,disabled:r})}),x.jsx(Sn,{className:t?.label,children:Oe.label}),x.jsx(Fn,{className:t?.error})]})},ue):x.jsx(bn,{control:Ae.control,name:ue,render:({field:Pe})=>x.jsxs(wn,{children:[x.jsx(Sn,{className:t?.label,children:Oe.label}),x.jsx(Dn,{children:Oe.type==="number"?x.jsx(Vo,{className:t?.input,type:"number",placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value}):Oe.multiline?x.jsx(aY,{className:t?.input,placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value}):x.jsx(Vo,{className:t?.input,type:"text",placeholder:Oe.placeholder||(typeof Oe.label=="string"?Oe.label:""),disabled:r,...Pe,value:Pe.value})}),x.jsx(Fn,{className:t?.error})]})},ue):(console.error(`Additional field ${ue} not found`),null)}),x.jsx(Id,{ref:f,localization:a,action:"/sign-up/email"}),x.jsx(Qt,{type:"submit",disabled:r,className:Ce("w-full",t?.button,t?.primaryButton),children:r?x.jsx(mr,{className:"animate-spin"}):a.SIGN_UP_ACTION})]})})}function BY({className:e,classNames:t,isSubmitting:n,localization:r,otpSeparators:a=0,redirectTo:i,setIsSubmitting:l}){var u;const d=Ka(),f=d?Vi("totpURI"):null,m=A.useRef(!1),{authClient:p,basePath:g,hooks:{useSession:y},localization:w,twoFactor:S,viewPaths:b,toast:E,Link:R,localizeErrors:T}=A.useContext(ht);r={...w,...r};const{onSuccess:O,isPending:C}=ma({redirectTo:i}),{data:I}=y(),N=(u=I?.user)==null?void 0:u.twoFactorEnabled,[P,$]=A.useState(S?.length===1?S[0]:null),[K,V]=A.useState(!1),[G,U]=A.useState(0),J=ce({code:D().min(1,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_REQUIRED}`}).min(6,{message:`${r.ONE_TIME_PASSWORD} ${r.IS_INVALID}`}),trustDevice:et().optional()}),le=da({resolver:fa(J),defaultValues:{code:""}});n=n||le.formState.isSubmitting||C,A.useEffect(()=>{l?.(le.formState.isSubmitting||C)},[le.formState.isSubmitting,C,l]),A.useEffect(()=>{P==="otp"&&G<=0&&!m.current&&(m.current=!0,B())},[P]),A.useEffect(()=>{if(G<=0)return;const Y=setTimeout(()=>{U(pe=>pe-1)},1e3);return()=>clearTimeout(Y)},[G]);const B=async()=>{if(!(K||G>0)){try{V(!0),await p.twoFactor.sendOtp({fetchOptions:{throw:!0}}),U(60)}catch(Y){E({variant:"error",message:En({error:Y,localization:r,localizeErrors:T})}),Y.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}m.current=!1,V(!1)}};async function W({code:Y,trustDevice:pe}){try{await(P==="totp"?p.twoFactor.verifyTotp:p.twoFactor.verifyOtp)({code:Y,trustDevice:pe,fetchOptions:{throw:!0}}),await O(),I&&!N&&E({variant:"success",message:r?.TWO_FACTOR_ENABLED})}catch(ae){E({variant:"error",message:En({error:ae,localization:r,localizeErrors:T})}),le.reset()}}return x.jsx(pa,{...le,children:x.jsxs("form",{onSubmit:le.handleSubmit(W),className:Ce("grid w-full gap-6",e,t?.base),children:[S?.includes("totp")&&f&&P==="totp"&&x.jsxs("div",{className:"space-y-3",children:[x.jsx(f4,{className:t?.label,children:r.TWO_FACTOR_TOTP_LABEL}),x.jsx(FW,{className:Ce("border shadow-xs",t?.qrCode),value:f})]}),P!==null&&x.jsxs(x.Fragment,{children:[x.jsx(bn,{control:le.control,name:"code",render:({field:Y})=>x.jsxs(wn,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx(Sn,{className:t?.label,children:r.ONE_TIME_PASSWORD}),x.jsx(R,{className:Ce("text-sm hover:underline",t?.forgotPasswordLink),href:`${g}/${b.RECOVER_ACCOUNT}${d?window.location.search:""}`,children:r.FORGOT_AUTHENTICATOR})]}),x.jsx(Dn,{children:x.jsx(R1,{...Y,maxLength:6,onChange:pe=>{Y.onChange(pe),pe.length===6&&le.handleSubmit(W)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:x.jsx(x1,{otpSeparators:a})})}),x.jsx(Fn,{className:t?.error})]})}),x.jsx(bn,{control:le.control,name:"trustDevice",render:({field:Y})=>x.jsxs(wn,{className:"flex",children:[x.jsx(Dn,{children:x.jsx(E1,{checked:Y.value,onCheckedChange:Y.onChange,disabled:n,className:t?.checkbox})}),x.jsx(Sn,{className:t?.label,children:r.TRUST_DEVICE})]})})]}),x.jsxs("div",{className:"grid gap-4",children:[P!==null&&x.jsxs(Qt,{type:"submit",disabled:n,className:Ce(t?.button,t?.primaryButton),children:[n&&x.jsx(mr,{className:"animate-spin"}),r.TWO_FACTOR_ACTION]}),P==="otp"&&S?.includes("otp")&&x.jsxs(Qt,{type:"button",variant:"outline",onClick:B,disabled:G>0||K||n,className:Ce(t?.button,t?.outlineButton),children:[K?x.jsx(mr,{className:"animate-spin"}):x.jsx(ST,{className:t?.icon}),r.RESEND_CODE,G>0&&` (${G})`]}),P!=="otp"&&S?.includes("otp")&&x.jsxs(Qt,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>$("otp"),disabled:n,children:[x.jsx(ST,{className:t?.icon}),r.SEND_VERIFICATION_CODE]}),P!=="totp"&&S?.includes("totp")&&x.jsxs(Qt,{type:"button",variant:"secondary",className:Ce(t?.button,t?.secondaryButton),onClick:()=>$("totp"),disabled:n,children:[x.jsx(zV,{className:t?.icon}),r.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function b4({redirectTo:e}){const t=A.useRef(!1),{authClient:n,basePath:r,viewPaths:a}=A.useContext(ht),{onSuccess:i}=ma({redirectTo:e||`${r}/${a.SIGN_IN}`});return A.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(i))},[n,i]),x.jsx(mr,{className:"animate-spin"})}function qY({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,pathname:i,redirectTo:l,view:u,otpSeparators:d=0,setIsSubmitting:f}){const{basePath:m,credentials:p,localization:g,magicLink:y,emailOTP:w,signUp:S,twoFactor:b,viewPaths:E,replace:R}=A.useContext(ht),T=!!S;if(a={...g,...a},A.useEffect(()=>{i&&!u_(E,i)&&(console.error(`Invalid auth view: ${i}`),R(`${m}/${E.SIGN_IN}${window.location.search}`))},[i,E,m,R]),u=u||u_(E,i)||"SIGN_IN",A.useEffect(()=>{let O=!1;u==="MAGIC_LINK"&&(!y||!p&&!w)&&(O=!0),u==="EMAIL_OTP"&&(!w||!p&&!y)&&(O=!0),u==="SIGN_UP"&&!T&&(O=!0),!p&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(u)&&(O=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(u)&&!b&&(O=!0),O&&R(`${m}/${E.SIGN_IN}${window.location.search}`)},[m,u,E,p,R,w,T,y,b]),u==="SIGN_OUT")return x.jsx(b4,{redirectTo:l});if(u==="CALLBACK")return x.jsx(_4,{redirectTo:l});if(u==="SIGN_IN")return p?x.jsx(VY,{className:e,classNames:t,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):y?x.jsx(KO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):w?x.jsx(ZO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f}):null;if(u==="TWO_FACTOR")return x.jsx(BY,{className:e,classNames:t,localization:a,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="RECOVER_ACCOUNT")return x.jsx(UY,{className:e,classNames:t,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="MAGIC_LINK")return x.jsx(KO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="EMAIL_OTP")return x.jsx(ZO,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="EMAIL_VERIFICATION")return x.jsx(jY,{className:e,classNames:t,callbackURL:n,localization:a,otpSeparators:d,redirectTo:l,isSubmitting:r,setIsSubmitting:f});if(u==="FORGOT_PASSWORD")return x.jsx($Y,{className:e,classNames:t,localization:a,isSubmitting:r,setIsSubmitting:f});if(u==="RESET_PASSWORD")return x.jsx(zY,{className:e,classNames:t,localization:a});if(u==="SIGN_UP")return T&&x.jsx(FY,{className:e,classNames:t,callbackURL:n,localization:a,redirectTo:l,isSubmitting:r,setIsSubmitting:f})}function HY({className:e,classNames:t,localization:n}){const{localization:r,redirectTo:a,replace:i,toast:l}=A.useContext(ht),u=A.useMemo(()=>({...r,...n}),[r,n]),{data:d}=ZW(),[f,m]=A.useState(null);return A.useEffect(()=>{const p=Vi("invitationId");if(!p){l({variant:"error",message:u.INVITATION_NOT_FOUND}),i(a);return}m(p)},[u.INVITATION_NOT_FOUND,l,i,a]),!d||!f?x.jsx(w4,{className:e,classNames:t}):x.jsx(GY,{className:e,classNames:t,localization:u,invitationId:f})}function GY({className:e,classNames:t,localization:n,invitationId:r}){var a;const{authClient:i,hooks:{useInvitation:l},localization:u,organization:d,redirectTo:f,replace:m,toast:p,localizeErrors:g}=A.useContext(ht),y=A.useMemo(()=>({...u,...n}),[u,n]),[w,S]=A.useState(!1),[b,E]=A.useState(!1),R=w||b,{data:T,isPending:O}=l({query:{id:r}}),C=A.useCallback(()=>Vi("redirectTo")||f,[f]);A.useEffect(()=>{if(!(O||!r)){if(!T){p({variant:"error",message:y.INVITATION_NOT_FOUND}),m(f);return}(T.status!=="pending"||new Date(T.expiresAt)<new Date)&&(p({variant:"error",message:new Date(T.expiresAt)<new Date?y.INVITATION_EXPIRED:y.INVITATION_NOT_FOUND}),m(f))}},[T,O,r,y,p,m,f]);const I=async()=>{E(!0);try{await i.organization.acceptInvitation({invitationId:r,fetchOptions:{throw:!0}}),p({variant:"success",message:y.INVITATION_ACCEPTED||"Invitation accepted"}),m(C())}catch(V){p({variant:"error",message:En({error:V,localization:y,localizeErrors:g})}),E(!1)}},N=async()=>{S(!0);try{await i.organization.rejectInvitation({invitationId:r,fetchOptions:{throw:!0}}),p({variant:"success",message:y.INVITATION_REJECTED}),m(f)}catch(V){p({variant:"error",message:En({error:V,localization:y,localizeErrors:g})}),S(!1)}},K=((a=[...[{role:"owner",label:y.OWNER},{role:"admin",label:y.ADMIN},{role:"member",label:y.MEMBER}],...d?.customRoles||[]].find(V=>V.role===T?.role))==null?void 0:a.label)||T?.role;return T?x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsxs(b1,{className:Ce("justify-items-center text-center",t?.header),children:[x.jsx(u4,{className:Ce("text-lg md:text-xl",t?.title),children:y.ACCEPT_INVITATION}),x.jsx(d4,{className:Ce("text-xs md:text-sm",t?.description),children:y.ACCEPT_INVITATION_DESCRIPTION})]}),x.jsxs(w1,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[x.jsxs(ld,{className:Ce("flex-row items-center p-4"),children:[x.jsx(y4,{organization:{id:T.organizationId,name:T.organizationName,slug:T.organizationSlug,logo:T.organizationLogo,createdAt:new Date},localization:y}),x.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:K})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[x.jsxs(Qt,{variant:"outline",className:Ce(t?.button,t?.outlineButton),onClick:N,disabled:R,children:[w?x.jsx(mr,{className:"animate-spin"}):x.jsx(BV,{}),y.REJECT]}),x.jsxs(Qt,{className:Ce(t?.button,t?.primaryButton),onClick:I,disabled:R,children:[b?x.jsx(mr,{className:"animate-spin"}):x.jsx(iN,{}),y.ACCEPT]})]})]})]}):x.jsx(w4,{className:e,classNames:t})}var w4=({className:e,classNames:t,localization:n})=>x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsxs(b1,{className:Ce("justify-items-center",t?.header),children:[x.jsx(Va,{className:Ce("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),x.jsx(Va,{className:Ce("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),x.jsxs(w1,{className:Ce("flex flex-col gap-6 truncate",t?.content),children:[x.jsxs(ld,{className:Ce("flex-row items-center p-4"),children:[x.jsx(y4,{isPending:!0,localization:n}),x.jsx(Va,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[x.jsx(Va,{className:"h-9 w-full"}),x.jsx(Va,{className:"h-9 w-full"})]})]})]});function WO({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(GW,{"data-slot":"separator",decorative:n,orientation:t,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function ZY({classNames:e,isSubmitting:t,localization:n,view:r}){var a,i,l,u;const{viewPaths:d,navigate:f,basePath:m}=A.useContext(ht);return x.jsxs(Qt,{className:Ce("w-full",(a=e?.form)==null?void 0:a.button,(i=e?.form)==null?void 0:i.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${m}/${r==="EMAIL_OTP"?d.SIGN_IN:d.EMAIL_OTP}${window.location.search}`),children:[r==="EMAIL_OTP"?x.jsx(lN,{className:(l=e?.form)==null?void 0:l.icon}):x.jsx(cN,{className:(u=e?.form)==null?void 0:u.icon}),n.SIGN_IN_WITH," ",r==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function KY({classNames:e,isSubmitting:t,localization:n,view:r}){var a,i,l,u;const{viewPaths:d,navigate:f,basePath:m,credentials:p}=A.useContext(ht);return x.jsxs(Qt,{className:Ce("w-full",(a=e?.form)==null?void 0:a.button,(i=e?.form)==null?void 0:i.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>f(`${m}/${r==="MAGIC_LINK"||!p?d.SIGN_IN:d.MAGIC_LINK}${window.location.search}`),children:[r==="MAGIC_LINK"?x.jsx(lN,{className:(l=e?.form)==null?void 0:l.icon}):x.jsx(cN,{className:(u=e?.form)==null?void 0:u.icon}),n.SIGN_IN_WITH," ",r==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function WY({localization:e,redirectTo:t}){const{authClient:n,localization:r,toast:a,localizeErrors:i}=A.useContext(ht),l=A.useRef(!1);e=A.useMemo(()=>({...r,...e}),[r,e]);const{onSuccess:u}=ma({redirectTo:t});return A.useEffect(()=>{if(!l.current){l.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:u}})}catch(d){a({variant:"error",message:En({error:d,localization:e,localizeErrors:i})})}}},[n,e,i,u,a]),null}function YY({classNames:e,isSubmitting:t,localization:n,redirectTo:r,setIsSubmitting:a}){var i,l;const{authClient:u,localization:d,toast:f,localizeErrors:m}=A.useContext(ht);n={...d,...n};const{onSuccess:p}=ma({redirectTo:r}),g=async()=>{a?.(!0);try{const y=await u.signIn.passkey({fetchOptions:{throw:!0}});y?.error?(f({variant:"error",message:En({error:y.error,localization:n,localizeErrors:m})}),a?.(!1)):p()}catch(y){f({variant:"error",message:En({error:y,localization:n,localizeErrors:m})}),a?.(!1)}};return x.jsxs(Qt,{className:Ce("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:g,children:[x.jsx($V,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function YO({className:e,classNames:t,callbackURL:n,isSubmitting:r,localization:a,other:i,provider:l,redirectTo:u,socialLayout:d,setIsSubmitting:f}){var m,p,g,y;const{authClient:w,basePath:S,baseURL:b,persistClient:E,redirectTo:R,viewPaths:T,social:O,genericOAuth:C,toast:I,localizeErrors:N}=A.useContext(ht),P=A.useCallback(()=>u||Vi("redirectTo")||R,[u,R]),$=A.useCallback(()=>`${b}${n||(E?`${S}/${T.CALLBACK}?redirectTo=${encodeURIComponent(P())}`:P())}`,[n,E,S,T,b,P]),K=async()=>{f(!0);try{if(i){const V={providerId:l.provider,callbackURL:$(),fetchOptions:{throw:!0}};C?.signIn?(await C.signIn(V),setTimeout(()=>{f(!1)},1e4)):await w.signIn.oauth2(V)}else{const V={provider:l.provider,callbackURL:$(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(V),setTimeout(()=>{f(!1)},1e4)):await w.signIn.social(V)}}catch(V){I({variant:"error",message:En({error:V,localization:a,localizeErrors:N})}),f(!1)}};return x.jsxs(Qt,{className:Ce(d==="vertical"?"w-full":"grow",e,(m=t?.form)==null?void 0:m.button,(p=t?.form)==null?void 0:p.outlineButton,(g=t?.form)==null?void 0:g.providerButton),disabled:r,variant:"outline",onClick:K,children:[l.icon&&x.jsx(l.icon,{className:(y=t?.form)==null?void 0:y.icon}),d==="grid"&&l.name,d==="vertical"&&`${a.SIGN_IN_WITH} ${l.name}`]})}function loe({className:e,classNames:t,callbackURL:n,cardHeader:r,cardFooter:a,localization:i,path:l,pathname:u,redirectTo:d,socialLayout:f="auto",view:m,otpSeparators:p=0}){var g,y,w,S,b,E;const R=Ka(),{basePath:T,credentials:O,localization:C,magicLink:I,emailOTP:N,oneTap:P,passkey:$,signUp:K,social:V,genericOAuth:G,viewPaths:U,Link:J}=A.useContext(ht);i={...C,...i};let le=f;le==="auto"&&(le=O&&V?.providers&&V.providers.length>2?"horizontal":"vertical");const B=l??u?.split("/").pop(),W=m||u_(U,B)||"SIGN_IN",[Y,pe]=A.useState(!1);if(A.useEffect(()=>{const M=()=>pe(!1);return window.addEventListener("pagehide",M),()=>{pe(!1),window.removeEventListener("pagehide",M)}},[]),W==="CALLBACK")return x.jsx(_4,{redirectTo:d});if(W==="SIGN_OUT")return x.jsx(b4,{redirectTo:d});if(W==="ACCEPT_INVITATION")return x.jsx(HY,{className:e,classNames:t});const ae=!O&&!I&&!N?i.DISABLED_CREDENTIALS_DESCRIPTION:i[`${W}_DESCRIPTION`];return x.jsxs(ld,{className:Ce("w-full max-w-sm",e,t?.base),children:[x.jsx(b1,{className:t?.header,children:r||x.jsxs(x.Fragment,{children:[x.jsx(u4,{className:Ce("text-lg md:text-xl",t?.title),children:i[W]}),ae&&x.jsx(d4,{className:Ce("text-xs md:text-sm",t?.description),children:ae})]})}),x.jsxs(w1,{className:Ce("grid gap-6",t?.content),children:[P&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(W)&&x.jsx(WY,{localization:i,redirectTo:d}),(O||I||N)&&x.jsxs("div",{className:"grid gap-4",children:[x.jsx(qY,{classNames:t?.form,callbackURL:n,isSubmitting:Y,localization:i,otpSeparators:p,view:W,redirectTo:d,setIsSubmitting:pe}),I&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||N&&W==="EMAIL_OTP")&&x.jsx(KY,{classNames:t,localization:i,view:W,isSubmitting:Y}),N&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(W)||I&&["SIGN_IN","MAGIC_LINK"].includes(W))&&x.jsx(ZY,{classNames:t,localization:i,view:W,isSubmitting:Y})]}),W!=="RESET_PASSWORD"&&W!=="EMAIL_VERIFICATION"&&(((g=V?.providers)==null?void 0:g.length)||((y=G?.providers)==null?void 0:y.length)||W==="SIGN_IN"&&$)&&x.jsxs(x.Fragment,{children:[(O||I||N)&&x.jsxs("div",{className:Ce("flex items-center gap-2",t?.continueWith),children:[x.jsx(WO,{className:Ce("!w-auto grow",t?.separator)}),x.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:i.OR_CONTINUE_WITH}),x.jsx(WO,{className:Ce("!w-auto grow",t?.separator)})]}),x.jsxs("div",{className:"grid gap-4",children:[(((w=V?.providers)==null?void 0:w.length)||((S=G?.providers)==null?void 0:S.length))&&x.jsxs("div",{className:Ce("flex w-full items-center justify-between gap-4",le==="horizontal"&&"flex-wrap",le==="vertical"&&"flex-col",le==="grid"&&"grid grid-cols-2"),children:[(b=V?.providers)==null?void 0:b.map(M=>{const q=AY.find(F=>F.provider===M);return q?x.jsx(YO,{classNames:t,callbackURL:n,isSubmitting:Y,localization:i,provider:q,redirectTo:d,setIsSubmitting:pe,socialLayout:le},M):null}),(E=G?.providers)==null?void 0:E.map(M=>x.jsx(YO,{classNames:t,callbackURL:n,isSubmitting:Y,localization:i,provider:M,redirectTo:d,setIsSubmitting:pe,socialLayout:le,other:!0},M.provider))]}),$&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(W)&&x.jsx(YY,{classNames:t,isSubmitting:Y,localization:i,redirectTo:d,setIsSubmitting:pe})]})]})]}),a&&x.jsx(HO,{className:t?.footer,children:a}),O&&K&&x.jsxs(HO,{className:Ce("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?i.DONT_HAVE_AN_ACCOUNT:W==="SIGN_UP"?i.ALREADY_HAVE_AN_ACCOUNT:x.jsx(MV,{className:"size-3"}),W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"||W==="SIGN_UP"?x.jsx(J,{className:Ce("text-foreground underline",t?.footerLink),href:`${T}/${U[W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${R?window.location.search:""}`,children:x.jsx(Qt,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),children:W==="SIGN_IN"||W==="MAGIC_LINK"||W==="EMAIL_OTP"?i.SIGN_UP:i.SIGN_IN})}):x.jsx(Qt,{variant:"link",size:"sm",className:Ce("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:i.GO_BACK})]})]})}function coe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{isPending:n}=t();return n?e:null}function uoe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{data:n}=t();return n?e:null}function doe({children:e}){const{hooks:{useSession:t}}=A.useContext(ht),{data:n,isPending:r}=t();return!n&&!r?e:null}function QY(e){const t=Ui.c(8),{children:n}=e,r=vc();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={basePath:"/",pathMode:"slug"},t[0]=a):a=t[0];let i,l;t[1]!==r?(i=d=>r({to:d}),l=d=>r({to:d,replace:!0}),t[1]=r,t[2]=i,t[3]=l):(i=t[2],l=t[3]);let u;return t[4]!==n||t[5]!==i||t[6]!==l?(u=x.jsx(AV,{authClient:Dj,organization:a,navigate:i,replace:l,Link:XY,children:n}),t[4]=n,t[5]=i,t[6]=l,t[7]=u):u=t[7],u}function XY(e){const{href:t,className:n,children:r,...a}=e;return x.jsx(Am,{to:t,className:n,...a,children:r})}async function JY(){const e=await fetch("/api/config");if(!e.ok)throw new Error("Failed to load public configuration");const t=await e.json();if(!t.success)throw new Error(t.error||"Failed to load public configuration");return t.config}function eQ(e){if(!e)return;const t=document.getElementById("mesh-theme-overrides");t&&t.remove();const n=[];if(e.light&&Object.keys(e.light).length>0){const r=Object.entries(e.light).map(([a,i])=>` ${a}: ${i};`).join(`
156
156
  `);n.push(`:root {
157
157
  ${r}
158
158
  }`)}if(e.dark&&Object.keys(e.dark).length>0){const r=Object.entries(e.dark).map(([a,i])=>` ${a}: ${i};`).join(`
@@ -160,7 +160,7 @@ ${r}
160
160
  ${r}
161
161
  }`)}if(n.length>0){const r=document.createElement("style");r.id="mesh-theme-overrides",r.textContent=n.join(`
162
162
 
163
- `),document.head.appendChild(r)}}function tQ(e){const t=Ui.c(6),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:JC.publicConfig(),queryFn:JY,staleTime:1/0},t[0]=r):r=t[0];const{data:a}=XC(r);let i,l;t[1]!==a.theme?(i=()=>{eQ(a.theme)},l=[a.theme],t[1]=a.theme,t[2]=i,t[3]=l):(i=t[2],l=t[3]),A.useLayoutEffect(i,l);let u;return t[4]!==n?(u=x.jsx(x.Fragment,{children:n}),t[4]=n,t[5]=u):u=t[5],u}function S4(){const e=Ui.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=x.jsx("div",{className:"flex items-center justify-center min-h-screen",children:x.jsx("div",{className:"text-gray-500",children:"Loading..."})}),e[0]=t):t=e[0],t}const nQ=new y5({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});function rQ(e){const t=Ui.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=x.jsx(aV,{}),t[0]=r):r=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=x.jsx(S4,{}),t[1]=a):a=t[1];let i;return t[2]!==n?(i=x.jsxs(b5,{client:nQ,children:[r,x.jsx(A.Suspense,{fallback:a,children:x.jsx(tQ,{children:x.jsx(P5,{children:x.jsx(QY,{children:n})})})})]}),t[2]=n,t[3]=i):i=t[3],i}var oQ=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const a=e.number||Ze();a instanceof Za&&(e.number=a.int())}}},aQ=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=je(n):typeof n=="number"?e.number=je(n):typeof n=="boolean"?e.boolean=je(n):n===null?e.null=vd():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},sQ=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?vd():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return je(e[0]);if(t==="string")return $t(e);if(t==="number"){const[n,r,...a]=e;return Lt([je(n),je(r),...a.map(i=>je(i))])}return t==="boolean"?Lt([je(!0),je(!1)]):!1}},iQ=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=Z7();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},lQ=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=D())}},cQ=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||D();r instanceof jm&&(e.string=r.refine(a=>Array.from(a).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},uQ=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||D();r instanceof jm&&(e.string=r.refine(a=>Array.from(a).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},dQ=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||D();if(r instanceof jm){const a=new RegExp(n.pattern);e.string=r.regex(a)}}}},fQ=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.min(n.minimum))}}},hQ=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.max(n.maximum))}}},pQ=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},mQ=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},gQ=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.refine(a=>{if(n.multipleOf===0)return!1;const i=a/n.multipleOf,l=Math.round(i),u=Math.min(Math.abs(a)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(i-l)<=u/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},vQ=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ee(eo()))}},yQ=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ee(eo())).min(n.minItems))}},_Q=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ee(eo())).max(n.maxItems))}},bQ=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ee(eo());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=pr(n.items);let a=Ee(r);if(e.array&&e.array instanceof ZI){const i=e.array._def;i.checks&&i.checks.forEach(l=>{if(l._zod&&l._zod.def){const u=l._zod.def;u.check==="min_length"&&u.minimum!==void 0?a=a.min(u.minimum):u.check==="max_length"&&u.maximum!==void 0&&(a=a.max(u.maximum))}})}e.array=a}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ee(eo()):e.array=Ee(eo()).max(0):(typeof n.items=="boolean"&&n.items===!0||n.prefixItems)&&(e.array=e.array||Ee(eo()))}},wQ=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(i=>pr(i));let a;r.length===0?a=fT([]):a=fT(r),n.minItems!==void 0&&n.minItems>r.length&&(a=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(a=!1),e.tuple=a,e.array=!1}},SQ=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||ce({}).passthrough())}},EQ=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=ce({}).passthrough())}},RQ=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||ce({}).passthrough();e.object=r.refine(a=>Object.keys(a).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},xQ=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||ce({}).passthrough();e.object=r.refine(a=>Object.keys(a).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function ud(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>ud(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(a=>r.includes(a)&&ud(e[a],t[a]))}return!1}function TQ(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(a=>ud(n,a))?!1:(t.push(n),!0))}}function am(e,t){return e.safeParse(t).success}var OQ=class{apply(e,t){if(!t.not)return e;const n=pr(t.not);return e.refine(r=>!am(n,r),{message:"Value must not match the 'not' schema"})}},CQ=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(TQ(),{message:"Array items must be unique"})}},AQ=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>pr(r)).reduce((r,a)=>yd(r,a),e)}},IQ=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?pr(t.anyOf[0]):Lt([pr(t.anyOf[0]),pr(t.anyOf[1]),...t.anyOf.slice(2).map(r=>pr(r))]);return yd(e,n)}},NQ=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>pr(r));return e.refine(r=>{let a=0;for(const i of n)if(i.safeParse(r).success&&(a++,a>1))return!1;return a===1},{message:"Value must match exactly one of the oneOf schemas"})}},kQ=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const a=n.prefixItems.map(i=>pr(i));return e.refine(i=>{if(!Array.isArray(i))return!0;for(let l=0;l<Math.min(i.length,a.length);l++)if(!am(a[l],i[l]))return!1;if(i.length>a.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const l=pr(n.items);for(let u=a.length;u<i.length;u++)if(!am(l,i[u]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},MQ=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof $m||e instanceof YI){const r={};if(n.properties)for(const[a,i]of Object.entries(n.properties))i!==void 0&&(r[a]=pr(i));if(n.required&&Array.isArray(n.required)){const a=new Set(n.required);for(const i of Object.keys(r))a.has(i)||(r[i]=r[i].optional())}else for(const a of Object.keys(r))r[a]=r[a].optional();return n.additionalProperties===!1?ce(r):ce(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[a,i]of Object.entries(n.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(r,a)!==void 0&&!pr(i).safeParse(r[a]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const a of n.required)if(!(Object.getOwnPropertyDescriptor(r,a)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const a=new Set(Object.keys(n.properties));for(const i in r)if(!a.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},PQ=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(a=>ud(r,a)),{message:"Value must match one of the enum values"})}},DQ=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>ud(r,n),{message:"Value must equal the const value"})}},LQ=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},jQ=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:eo().refine(a=>this.validateRequired(a,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},$Q=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const a=pr(r.contains),i=(n=r.minContains)!=null?n:1,l=r.maxContains;return e.refine(u=>{if(!Array.isArray(u))return!0;let d=0;for(const f of u)am(a,f)&&d++;return!(d<i||l!==void 0&&d>l)},{message:"Array must contain required items matching the schema"})}},UQ=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},zQ=[new aQ,new sQ,new oQ,new iQ,new lQ,new vQ,new EQ,new cQ,new uQ,new dQ,new fQ,new hQ,new pQ,new mQ,new gQ,new wQ,new yQ,new _Q,new bQ,new RQ,new xQ,new SQ],VQ=[new jQ,new PQ,new DQ,new AQ,new IQ,new NQ,new kQ,new MQ,new $Q,new OQ,new CQ,new UQ,new LQ];function pr(e){if(typeof e=="boolean")return e?eo():Fp();const t={};for(const a of zQ)a.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||D()),t.number!==!1&&n.push(t.number||Ze()),t.boolean!==!1&&n.push(t.boolean||nt()),t.null!==!1&&n.push(t.null||vd()),t.array!==!1&&n.push(t.array||Ee(eo())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const a=eN(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");n.push(a)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Fp():n.length===1?r=n[0]:Object.keys(e).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?r=Lt(n):r=eo();for(const a of VQ)r=a.apply(r,e);return r}function Qm(e){return!!e._zod}function As(e,t){return Qm(e)?eI(e,t):e.safeParse(t)}function E4(e){if(!e)return;let t;if(Qm(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function FQ(e){if(Qm(e)){const i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const r=e.value;if(r!==void 0)return r}const Xm="2025-11-25",BQ=[Xm,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Si="io.modelcontextprotocol/related-task",Jm="2.0",sr=eN(e=>e!==null&&(typeof e=="object"||typeof e=="function")),R4=Lt([D(),Ze().int()]),x4=D();ar({ttl:Lt([Ze(),vd()]).optional(),pollInterval:Ze().optional()});const qQ=ce({ttl:Ze().optional()}),HQ=ce({taskId:D()}),T1=ar({progressToken:R4.optional(),[Si]:HQ.optional()}),oo=ce({_meta:T1.optional()}),Nd=oo.extend({task:qQ.optional()}),GQ=e=>Nd.safeParse(e).success,lr=ce({method:D(),params:oo.loose().optional()}),xo=ce({_meta:T1.optional()}),To=ce({method:D(),params:xo.loose().optional()}),cr=ar({_meta:T1.optional()}),eg=Lt([D(),Ze().int()]),T4=ce({jsonrpc:je(Jm),id:eg,...lr.shape}).strict(),$_=e=>T4.safeParse(e).success,O4=ce({jsonrpc:je(Jm),...To.shape}).strict(),ZQ=e=>O4.safeParse(e).success,O1=ce({jsonrpc:je(Jm),id:eg,result:cr}).strict(),Pu=e=>O1.safeParse(e).success;var at;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(at||(at={}));const C1=ce({jsonrpc:je(Jm),id:eg.optional(),error:ce({code:Ze().int(),message:D(),data:_t().optional()})}).strict(),KQ=e=>C1.safeParse(e).success,Zu=Lt([T4,O4,O1,C1]);Lt([O1,C1]);const Yl=cr.strict(),WQ=xo.extend({requestId:eg.optional(),reason:D().optional()}),A1=To.extend({method:je("notifications/cancelled"),params:WQ}),YQ=ce({src:D(),mimeType:D().optional(),sizes:Ee(D()).optional(),theme:$t(["light","dark"]).optional()}),kd=ce({icons:Ee(YQ).optional()}),dc=ce({name:D(),title:D().optional()}),C4=dc.extend({...dc.shape,...kd.shape,version:D(),websiteUrl:D().optional(),description:D().optional()}),QQ=yd(ce({applyDefaults:nt().optional()}),Et(D(),_t())),XQ=kb(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yd(ce({form:QQ.optional(),url:sr.optional()}),Et(D(),_t()).optional())),JQ=ar({list:sr.optional(),cancel:sr.optional(),requests:ar({sampling:ar({createMessage:sr.optional()}).optional(),elicitation:ar({create:sr.optional()}).optional()}).optional()}),eX=ar({list:sr.optional(),cancel:sr.optional(),requests:ar({tools:ar({call:sr.optional()}).optional()}).optional()}),tX=ce({experimental:Et(D(),sr).optional(),sampling:ce({context:sr.optional(),tools:sr.optional()}).optional(),elicitation:XQ.optional(),roots:ce({listChanged:nt().optional()}).optional(),tasks:JQ.optional()}),nX=oo.extend({protocolVersion:D(),capabilities:tX,clientInfo:C4}),rX=lr.extend({method:je("initialize"),params:nX}),oX=ce({experimental:Et(D(),sr).optional(),logging:sr.optional(),completions:sr.optional(),prompts:ce({listChanged:nt().optional()}).optional(),resources:ce({subscribe:nt().optional(),listChanged:nt().optional()}).optional(),tools:ce({listChanged:nt().optional()}).optional(),tasks:eX.optional()}),A4=cr.extend({protocolVersion:D(),capabilities:oX,serverInfo:C4,instructions:D().optional()}),I4=To.extend({method:je("notifications/initialized"),params:xo.optional()}),aX=e=>I4.safeParse(e).success,I1=lr.extend({method:je("ping"),params:oo.optional()}),sX=ce({progress:Ze(),total:vn(Ze()),message:vn(D())}),iX=ce({...xo.shape,...sX.shape,progressToken:R4}),N1=To.extend({method:je("notifications/progress"),params:iX}),lX=oo.extend({cursor:x4.optional()}),Md=lr.extend({params:lX.optional()}),Pd=cr.extend({nextCursor:x4.optional()}),cX=$t(["working","input_required","completed","failed","cancelled"]),Dd=ce({taskId:D(),status:cX,ttl:Lt([Ze(),vd()]),createdAt:D(),lastUpdatedAt:D(),pollInterval:vn(Ze()),statusMessage:vn(D())}),dd=cr.extend({task:Dd}),uX=xo.merge(Dd),sm=To.extend({method:je("notifications/tasks/status"),params:uX}),k1=lr.extend({method:je("tasks/get"),params:oo.extend({taskId:D()})}),M1=cr.merge(Dd),P1=lr.extend({method:je("tasks/result"),params:oo.extend({taskId:D()})});cr.loose();const D1=Md.extend({method:je("tasks/list")}),L1=Pd.extend({tasks:Ee(Dd)}),j1=lr.extend({method:je("tasks/cancel"),params:oo.extend({taskId:D()})}),dX=cr.merge(Dd),N4=ce({uri:D(),mimeType:vn(D()),_meta:Et(D(),_t()).optional()}),k4=N4.extend({text:D()}),$1=D().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),M4=N4.extend({blob:$1}),Ld=$t(["user","assistant"]),Ec=ce({audience:Ee(Ld).optional(),priority:Ze().min(0).max(1).optional(),lastModified:BI({offset:!0}).optional()}),P4=ce({...dc.shape,...kd.shape,uri:D(),description:vn(D()),mimeType:vn(D()),annotations:Ec.optional(),_meta:vn(ar({}))}),fX=ce({...dc.shape,...kd.shape,uriTemplate:D(),description:vn(D()),mimeType:vn(D()),annotations:Ec.optional(),_meta:vn(ar({}))}),hX=Md.extend({method:je("resources/list")}),D4=Pd.extend({resources:Ee(P4)}),pX=Md.extend({method:je("resources/templates/list")}),L4=Pd.extend({resourceTemplates:Ee(fX)}),U1=oo.extend({uri:D()}),mX=U1,gX=lr.extend({method:je("resources/read"),params:mX}),j4=cr.extend({contents:Ee(Lt([k4,M4]))}),$4=To.extend({method:je("notifications/resources/list_changed"),params:xo.optional()}),vX=U1,yX=lr.extend({method:je("resources/subscribe"),params:vX}),_X=U1,bX=lr.extend({method:je("resources/unsubscribe"),params:_X}),wX=xo.extend({uri:D()}),SX=To.extend({method:je("notifications/resources/updated"),params:wX}),EX=ce({name:D(),description:vn(D()),required:vn(nt())}),RX=ce({...dc.shape,...kd.shape,description:vn(D()),arguments:vn(Ee(EX)),_meta:vn(ar({}))}),xX=Md.extend({method:je("prompts/list")}),U4=Pd.extend({prompts:Ee(RX)}),TX=oo.extend({name:D(),arguments:Et(D(),D()).optional()}),OX=lr.extend({method:je("prompts/get"),params:TX}),z1=ce({type:je("text"),text:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),V1=ce({type:je("image"),data:$1,mimeType:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),F1=ce({type:je("audio"),data:$1,mimeType:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),CX=ce({type:je("tool_use"),name:D(),id:D(),input:Et(D(),_t()),_meta:Et(D(),_t()).optional()}),AX=ce({type:je("resource"),resource:Lt([k4,M4]),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),IX=P4.extend({type:je("resource_link")}),B1=Lt([z1,V1,F1,IX,AX]),NX=ce({role:Ld,content:B1}),z4=cr.extend({description:D().optional(),messages:Ee(NX)}),V4=To.extend({method:je("notifications/prompts/list_changed"),params:xo.optional()}),kX=ce({title:D().optional(),readOnlyHint:nt().optional(),destructiveHint:nt().optional(),idempotentHint:nt().optional(),openWorldHint:nt().optional()}),MX=ce({taskSupport:$t(["required","optional","forbidden"]).optional()}),F4=ce({...dc.shape,...kd.shape,description:D().optional(),inputSchema:ce({type:je("object"),properties:Et(D(),sr).optional(),required:Ee(D()).optional()}).catchall(_t()),outputSchema:ce({type:je("object"),properties:Et(D(),sr).optional(),required:Ee(D()).optional()}).catchall(_t()).optional(),annotations:kX.optional(),execution:MX.optional(),_meta:Et(D(),_t()).optional()}),PX=Md.extend({method:je("tools/list")}),q1=Pd.extend({tools:Ee(F4)}),tg=cr.extend({content:Ee(B1).default([]),structuredContent:Et(D(),_t()).optional(),isError:nt().optional()});tg.or(cr.extend({toolResult:_t()}));const DX=Nd.extend({name:D(),arguments:Et(D(),_t()).optional()}),LX=lr.extend({method:je("tools/call"),params:DX}),B4=To.extend({method:je("notifications/tools/list_changed"),params:xo.optional()}),jX=ce({autoRefresh:nt().default(!0),debounceMs:Ze().int().nonnegative().default(300)}),q4=$t(["debug","info","notice","warning","error","critical","alert","emergency"]),$X=oo.extend({level:q4}),UX=lr.extend({method:je("logging/setLevel"),params:$X}),zX=xo.extend({level:q4,logger:D().optional(),data:_t()}),VX=To.extend({method:je("notifications/message"),params:zX}),FX=ce({name:D().optional()}),BX=ce({hints:Ee(FX).optional(),costPriority:Ze().min(0).max(1).optional(),speedPriority:Ze().min(0).max(1).optional(),intelligencePriority:Ze().min(0).max(1).optional()}),qX=ce({mode:$t(["auto","required","none"]).optional()}),HX=ce({type:je("tool_result"),toolUseId:D().describe("The unique identifier for the corresponding tool call."),content:Ee(B1).default([]),structuredContent:ce({}).loose().optional(),isError:nt().optional(),_meta:Et(D(),_t()).optional()}),GX=WI("type",[z1,V1,F1]),im=WI("type",[z1,V1,F1,CX,HX]),ZX=ce({role:Ld,content:Lt([im,Ee(im)]),_meta:Et(D(),_t()).optional()}),KX=Nd.extend({messages:Ee(ZX),modelPreferences:BX.optional(),systemPrompt:D().optional(),includeContext:$t(["none","thisServer","allServers"]).optional(),temperature:Ze().optional(),maxTokens:Ze().int(),stopSequences:Ee(D()).optional(),metadata:sr.optional(),tools:Ee(F4).optional(),toolChoice:qX.optional()}),H4=lr.extend({method:je("sampling/createMessage"),params:KX}),G4=cr.extend({model:D(),stopReason:vn($t(["endTurn","stopSequence","maxTokens"]).or(D())),role:Ld,content:GX}),Z4=cr.extend({model:D(),stopReason:vn($t(["endTurn","stopSequence","maxTokens","toolUse"]).or(D())),role:Ld,content:Lt([im,Ee(im)])}),WX=ce({type:je("boolean"),title:D().optional(),description:D().optional(),default:nt().optional()}),YX=ce({type:je("string"),title:D().optional(),description:D().optional(),minLength:Ze().optional(),maxLength:Ze().optional(),format:$t(["email","uri","date","date-time"]).optional(),default:D().optional()}),QX=ce({type:$t(["number","integer"]),title:D().optional(),description:D().optional(),minimum:Ze().optional(),maximum:Ze().optional(),default:Ze().optional()}),XX=ce({type:je("string"),title:D().optional(),description:D().optional(),enum:Ee(D()),default:D().optional()}),JX=ce({type:je("string"),title:D().optional(),description:D().optional(),oneOf:Ee(ce({const:D(),title:D()})),default:D().optional()}),eJ=ce({type:je("string"),title:D().optional(),description:D().optional(),enum:Ee(D()),enumNames:Ee(D()).optional(),default:D().optional()}),tJ=Lt([XX,JX]),nJ=ce({type:je("array"),title:D().optional(),description:D().optional(),minItems:Ze().optional(),maxItems:Ze().optional(),items:ce({type:je("string"),enum:Ee(D())}),default:Ee(D()).optional()}),rJ=ce({type:je("array"),title:D().optional(),description:D().optional(),minItems:Ze().optional(),maxItems:Ze().optional(),items:ce({anyOf:Ee(ce({const:D(),title:D()}))}),default:Ee(D()).optional()}),oJ=Lt([nJ,rJ]),aJ=Lt([eJ,tJ,oJ]),sJ=Lt([aJ,WX,YX,QX]),iJ=Nd.extend({mode:je("form").optional(),message:D(),requestedSchema:ce({type:je("object"),properties:Et(D(),sJ),required:Ee(D()).optional()})}),lJ=Nd.extend({mode:je("url"),message:D(),elicitationId:D(),url:D().url()}),cJ=Lt([iJ,lJ]),K4=lr.extend({method:je("elicitation/create"),params:cJ}),uJ=xo.extend({elicitationId:D()}),dJ=To.extend({method:je("notifications/elicitation/complete"),params:uJ}),W4=cr.extend({action:$t(["accept","decline","cancel"]),content:kb(e=>e===null?void 0:e,Et(D(),Lt([D(),Ze(),nt(),Ee(D())])).optional())}),fJ=ce({type:je("ref/resource"),uri:D()}),hJ=ce({type:je("ref/prompt"),name:D()}),pJ=oo.extend({ref:Lt([hJ,fJ]),argument:ce({name:D(),value:D()}),context:ce({arguments:Et(D(),D()).optional()}).optional()}),mJ=lr.extend({method:je("completion/complete"),params:pJ}),Y4=cr.extend({completion:ar({values:Ee(D()).max(100),total:vn(Ze().int()),hasMore:vn(nt())})}),gJ=ce({uri:D().startsWith("file://"),name:D().optional(),_meta:Et(D(),_t()).optional()}),vJ=lr.extend({method:je("roots/list"),params:oo.optional()}),yJ=cr.extend({roots:Ee(gJ)}),_J=To.extend({method:je("notifications/roots/list_changed"),params:xo.optional()});Lt([I1,rX,mJ,UX,OX,xX,hX,pX,gX,yX,bX,LX,PX,k1,P1,D1,j1]);Lt([A1,N1,I4,_J,sm]);Lt([Yl,G4,Z4,W4,yJ,M1,L1,dd]);Lt([I1,H4,K4,vJ,k1,P1,D1,j1]);Lt([A1,N1,VX,SX,$4,B4,V4,sm,dJ]);Lt([Yl,A4,Y4,z4,U4,D4,L4,j4,tg,q1,M1,L1,dd]);class Qe extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===at.UrlElicitationRequired&&r){const a=r;if(a.elicitations)return new bJ(a.elicitations,n)}return new Qe(t,n,r)}}class bJ extends Qe{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(at.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function yi(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function QO(e){const n=E4(e)?.method;if(!n)throw new Error("Schema is missing a method literal");const r=FQ(n);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function XO(e,t){const n=As(e,t);if(!n.success)throw n.error;return n.data}const wJ=6e4;class SJ{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(A1,n=>{this._oncancel(n)}),this.setNotificationHandler(N1,n=>{this._onprogress(n)}),this.setRequestHandler(I1,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(k1,async(n,r)=>{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Qe(at.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(P1,async(n,r)=>{const a=async()=>{const i=n.params.taskId;if(this._taskMessageQueue){let u;for(;u=await this._taskMessageQueue.dequeue(i,r.sessionId);){if(u.type==="response"||u.type==="error"){const d=u.message,f=d.id,m=this._requestResolvers.get(f);if(m)if(this._requestResolvers.delete(f),u.type==="response")m(d);else{const p=d,g=new Qe(p.error.code,p.error.message,p.error.data);m(g)}else{const p=u.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${f}`))}continue}await this._transport?.send(u.message,{relatedRequestId:r.requestId})}}const l=await this._taskStore.getTask(i,r.sessionId);if(!l)throw new Qe(at.InvalidParams,`Task not found: ${i}`);if(!yi(l.status))return await this._waitForTaskUpdate(i,r.signal),await a();if(yi(l.status)){const u=await this._taskStore.getTaskResult(i,r.sessionId);return this._clearTaskQueue(i),{...u,_meta:{...u._meta,[Si]:{taskId:i}}}}return await a()};return await a()}),this.setRequestHandler(D1,async(n,r)=>{try{const{tasks:a,nextCursor:i}=await this._taskStore.listTasks(n.params?.cursor,r.sessionId);return{tasks:a,nextCursor:i,_meta:{}}}catch(a){throw new Qe(at.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(j1,async(n,r)=>{try{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Qe(at.InvalidParams,`Task not found: ${n.params.taskId}`);if(yi(a.status))throw new Qe(at.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(n.params.taskId);const i=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!i)throw new Qe(at.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...i}}catch(a){throw a instanceof Qe?a:new Qe(at.InvalidRequest,`Failed to cancel task: ${a instanceof Error?a.message:String(a)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,r,a,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(a,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:i,onTimeout:a})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),Qe.fromError(at.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){this._transport=t;const n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=i=>{r?.(i),this._onerror(i)};const a=this._transport?.onmessage;this._transport.onmessage=(i,l)=>{a?.(i,l),Pu(i)||KQ(i)?this._onresponse(i):$_(i)?this._onrequest(i,l):ZQ(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const n=Qe.fromError(at.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of t.values())r(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,n){const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,a=this._transport,i=t.params?._meta?.[Si]?.taskId;if(r===void 0){const m={jsonrpc:"2.0",id:t.id,error:{code:at.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:m,timestamp:Date.now()},a?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):a?.send(m).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}const l=new AbortController;this._requestHandlerAbortControllers.set(t.id,l);const u=GQ(t.params)?t.params.task:void 0,d=this._taskStore?this.requestTaskStore(t,a?.sessionId):void 0,f={signal:l.signal,sessionId:a?.sessionId,_meta:t.params?._meta,sendNotification:async m=>{const p={relatedRequestId:t.id};i&&(p.relatedTask={taskId:i}),await this.notification(m,p)},sendRequest:async(m,p,g)=>{const y={...g,relatedRequestId:t.id};i&&!y.relatedTask&&(y.relatedTask={taskId:i});const w=y.relatedTask?.taskId??i;return w&&d&&await d.updateTaskStatus(w,"input_required"),await this.request(m,p,y)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:i,taskStore:d,taskRequestedTtl:u?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,f)).then(async m=>{if(l.signal.aborted)return;const p={result:m,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:p,timestamp:Date.now()},a?.sessionId):await a?.send(p)},async m=>{if(l.signal.aborted)return;const p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(m.code)?m.code:at.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},a?.sessionId):await a?.send(p)}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...r}=t.params,a=Number(n),i=this._progressHandlers.get(a);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const l=this._responseHandlers.get(a),u=this._timeoutInfo.get(a);if(u&&l&&u.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(d){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),l(d);return}i(r)}_onresponse(t){const n=Number(t.id),r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),Pu(t))r(t);else{const l=new Qe(t.error.code,t.error.message,t.error.data);r(l)}return}const a=this._responseHandlers.get(n);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let i=!1;if(Pu(t)&&t.result&&typeof t.result=="object"){const l=t.result;if(l.task&&typeof l.task=="object"){const u=l.task;typeof u.taskId=="string"&&(i=!0,this._taskProgressTokens.set(u.taskId,n))}}if(i||this._progressHandlers.delete(n),Pu(t))a(t);else{const l=Qe.fromError(t.error.code,t.error.message,t.error.data);a(l)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,r){const{task:a}=r??{};if(!a){try{yield{type:"result",result:await this.request(t,n,r)}}catch(l){yield{type:"error",error:l instanceof Qe?l:new Qe(at.InternalError,String(l))}}return}let i;try{const l=await this.request(t,dd,r);if(l.task)i=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new Qe(at.InternalError,"Task creation did not return a task");for(;;){const u=await this.getTask({taskId:i},r);if(yield{type:"taskStatus",task:u},yi(u.status)){u.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)}:u.status==="failed"?yield{type:"error",error:new Qe(at.InternalError,`Task ${i} failed`)}:u.status==="cancelled"&&(yield{type:"error",error:new Qe(at.InternalError,`Task ${i} was cancelled`)});return}if(u.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)};return}const d=u.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,d)),r?.signal?.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof Qe?l:new Qe(at.InternalError,String(l))}}}request(t,n,r){const{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l,task:u,relatedTask:d}=r??{};return new Promise((f,m)=>{const p=R=>{m(R)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),u&&this.assertTaskCapability(t.method)}catch(R){p(R);return}r?.signal?.throwIfAborted();const g=this._requestMessageId++,y={...t,jsonrpc:"2.0",id:g};r?.onprogress&&(this._progressHandlers.set(g,r.onprogress),y.params={...t.params,_meta:{...t.params?._meta||{},progressToken:g}}),u&&(y.params={...y.params,task:u}),d&&(y.params={...y.params,_meta:{...y.params?._meta||{},[Si]:d}});const w=R=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(R)}},{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l}).catch(O=>this._onerror(new Error(`Failed to send cancellation: ${O}`)));const T=R instanceof Qe?R:new Qe(at.RequestTimeout,String(R));m(T)};this._responseHandlers.set(g,R=>{if(!r?.signal?.aborted){if(R instanceof Error)return m(R);try{const T=As(n,R.result);T.success?f(T.data):m(T.error)}catch(T){m(T)}}}),r?.signal?.addEventListener("abort",()=>{w(r?.signal?.reason)});const S=r?.timeout??wJ,b=()=>w(Qe.fromError(at.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(g,S,r?.maxTotalTimeout,b,r?.resetTimeoutOnProgress??!1);const E=d?.taskId;if(E){const R=T=>{const O=this._responseHandlers.get(g);O?O(T):this._onerror(new Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,R),this._enqueueTaskMessage(E,{type:"request",message:y,timestamp:Date.now()}).catch(T=>{this._cleanupTimeout(g),m(T)})}else this._transport.send(y,{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l}).catch(R=>{this._cleanupTimeout(g),m(R)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},M1,n)}async getTaskResult(t,n,r){return this.request({method:"tasks/result",params:t},n,r)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},L1,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},dX,n)}async notification(t,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=n?.relatedTask?.taskId;if(r){const u={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Si]:n.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:u,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let u={...t,jsonrpc:"2.0"};n?.relatedTask&&(u={...u,params:{...u.params,_meta:{...u.params?._meta||{},[Si]:n.relatedTask}}}),this._transport?.send(u,n).catch(d=>this._onerror(d))});return}let l={...t,jsonrpc:"2.0"};n?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[Si]:n.relatedTask}}}),await this._transport.send(l,n)}setRequestHandler(t,n){const r=QO(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(a,i)=>{const l=XO(t,a);return Promise.resolve(n(l,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const r=QO(t);this._notificationHandlers.set(r,a=>{const i=XO(t,a);return Promise.resolve(n(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,r,a)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,n);for(const a of r)if(a.type==="request"&&$_(a.message)){const i=a.message.id,l=this._requestResolvers.get(i);l?(l(new Qe(at.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){let r=this._options?.defaultTaskPollInterval??1e3;try{const a=await this._taskStore?.getTask(t);a?.pollInterval&&(r=a.pollInterval)}catch{}return new Promise((a,i)=>{if(n.aborted){i(new Qe(at.InvalidRequest,"Request cancelled"));return}const l=setTimeout(a,r);n.addEventListener("abort",()=>{clearTimeout(l),i(new Qe(at.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async a=>{if(!t)throw new Error("No request provided");return await r.createTask(a,t.id,{method:t.method,params:t.params},n)},getTask:async a=>{const i=await r.getTask(a,n);if(!i)throw new Qe(at.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(a,i,l)=>{await r.storeTaskResult(a,i,l,n);const u=await r.getTask(a,n);if(u){const d=sm.parse({method:"notifications/tasks/status",params:u});await this.notification(d),yi(u.status)&&this._cleanupTaskProgressHandler(a)}},getTaskResult:a=>r.getTaskResult(a,n),updateTaskStatus:async(a,i,l)=>{const u=await r.getTask(a,n);if(!u)throw new Qe(at.InvalidParams,`Task "${a}" not found - it may have been cleaned up`);if(yi(u.status))throw new Qe(at.InvalidParams,`Cannot update task "${a}" from terminal status "${u.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(a,i,l,n);const d=await r.getTask(a,n);if(d){const f=sm.parse({method:"notifications/tasks/status",params:d});await this.notification(f),yi(d.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>r.listTasks(a,n)}}}function JO(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function EJ(e,t){const n={...e};for(const r in t){const a=r,i=t[a];if(i===void 0)continue;const l=n[a];JO(l)&&JO(i)?n[a]={...l,...i}:n[a]=i}return n}var Th={exports:{}},C0={},ja={},_i={},A0={},I0={},N0={},e2;function lm(){return e2||(e2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(R){if(super(),!e.IDENTIFIER.test(R))throw new Error("CodeGen: name must be a valid identifier");this.str=R}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(R){super(),this._items=typeof R=="string"?[R]:R}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const R=this._items[0];return R===""||R==='""'}get str(){var R;return(R=this._str)!==null&&R!==void 0?R:this._str=this._items.reduce((T,O)=>`${T}${O}`,"")}get names(){var R;return(R=this._names)!==null&&R!==void 0?R:this._names=this._items.reduce((T,O)=>(O instanceof n&&(T[O.str]=(T[O.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function a(E,...R){const T=[E[0]];let O=0;for(;O<R.length;)u(T,R[O]),T.push(E[++O]);return new r(T)}e._=a;const i=new r("+");function l(E,...R){const T=[y(E[0])];let O=0;for(;O<R.length;)T.push(i),u(T,R[O]),T.push(i,y(E[++O]));return d(T),new r(T)}e.str=l;function u(E,R){R instanceof r?E.push(...R._items):R instanceof n?E.push(R):E.push(p(R))}e.addCodeArg=u;function d(E){let R=1;for(;R<E.length-1;){if(E[R]===i){const T=f(E[R-1],E[R+1]);if(T!==void 0){E.splice(R-1,3,T);continue}E[R++]="+"}R++}}function f(E,R){if(R==='""')return E;if(E==='""')return R;if(typeof E=="string")return R instanceof n||E[E.length-1]!=='"'?void 0:typeof R!="string"?`${E.slice(0,-1)}${R}"`:R[0]==='"'?E.slice(0,-1)+R.slice(1):void 0;if(typeof R=="string"&&R[0]==='"'&&!(E instanceof n))return`"${E}${R.slice(1)}`}function m(E,R){return R.emptyStr()?E:E.emptyStr()?R:l`${E}${R}`}e.strConcat=m;function p(E){return typeof E=="number"||typeof E=="boolean"||E===null?E:y(Array.isArray(E)?E.join(","):E)}function g(E){return new r(y(E))}e.stringify=g;function y(E){return JSON.stringify(E).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function w(E){return typeof E=="string"&&e.IDENTIFIER.test(E)?new r(`.${E}`):a`[${E}]`}e.getProperty=w;function S(E){if(typeof E=="string"&&e.IDENTIFIER.test(E))return new r(`${E}`);throw new Error(`CodeGen: invalid export name: ${E}, use explicit $id name mapping`)}e.getEsmExportName=S;function b(E){return new r(E.toString())}e.regexpCode=b})(N0)),N0}var k0={},t2;function n2(){return t2||(t2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=lm();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:f,parent:m}={}){this._names={},this._prefixes=f,this._parent=m}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const m=this._names[f]||this._nameGroup(f);return`${f}${m.index++}`}_nameGroup(f){var m,p;if(!((p=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||p===void 0)&&p.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=a;class i extends t.Name{constructor(f,m){super(m),this.prefix=f}setValue(f,{property:m,itemIndex:p}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(m)}[${p}]`}}e.ValueScopeName=i;const l=(0,t._)`\n`;class u extends a{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new i(f,this._newName(f))}value(f,m){var p;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:y}=g,w=(p=m.key)!==null&&p!==void 0?p:m.ref;let S=this._values[y];if(S){const R=S.get(w);if(R)return R}else S=this._values[y]=new Map;S.set(w,g);const b=this._scope[y]||(this._scope[y]=[]),E=b.length;return b[E]=m.ref,g.setValue(m,{property:y,itemIndex:E}),g}getValue(f,m){const p=this._values[f];if(p)return p.get(m)}scopeRefs(f,m=this._values){return this._reduceValues(m,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${f}${p.scopePath}`})}scopeCode(f=this._values,m,p){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},m,p)}_reduceValues(f,m,p={},g){let y=t.nil;for(const w in f){const S=f[w];if(!S)continue;const b=p[w]=p[w]||new Map;S.forEach(E=>{if(b.has(E))return;b.set(E,r.Started);let R=m(E);if(R){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${T} ${E} = ${R};${this.opts._n}`}else if(R=g?.(E))y=(0,t._)`${y}${R}${this.opts._n}`;else throw new n(E);b.set(E,r.Completed)})}return y}}e.ValueScope=u})(k0)),k0}var r2;function pt(){return r2||(r2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=lm(),n=n2();var r=lm();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var a=n2();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(L,z){return this}}class l extends i{constructor(L,z,X){super(),this.varKind=L,this.name=z,this.rhs=X}render({es5:L,_n:z}){const X=L?n.varKinds.var:this.varKind,de=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${de};`+z}optimizeNames(L,z){if(L[this.name.str])return this.rhs&&(this.rhs=J(this.rhs,L,z)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(L,z,X){super(),this.lhs=L,this.rhs=z,this.sideEffects=X}render({_n:L}){return`${this.lhs} = ${this.rhs};`+L}optimizeNames(L,z){if(!(this.lhs instanceof t.Name&&!L[this.lhs.str]&&!this.sideEffects))return this.rhs=J(this.rhs,L,z),this}get names(){const L=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(L,this.rhs)}}class d extends u{constructor(L,z,X,de){super(L,X,de),this.op=z}render({_n:L}){return`${this.lhs} ${this.op}= ${this.rhs};`+L}}class f extends i{constructor(L){super(),this.label=L,this.names={}}render({_n:L}){return`${this.label}:`+L}}class m extends i{constructor(L){super(),this.label=L,this.names={}}render({_n:L}){return`break${this.label?` ${this.label}`:""};`+L}}class p extends i{constructor(L){super(),this.error=L}render({_n:L}){return`throw ${this.error};`+L}get names(){return this.error.names}}class g extends i{constructor(L){super(),this.code=L}render({_n:L}){return`${this.code};`+L}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(L,z){return this.code=J(this.code,L,z),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(L=[]){super(),this.nodes=L}render(L){return this.nodes.reduce((z,X)=>z+X.render(L),"")}optimizeNodes(){const{nodes:L}=this;let z=L.length;for(;z--;){const X=L[z].optimizeNodes();Array.isArray(X)?L.splice(z,1,...X):X?L[z]=X:L.splice(z,1)}return L.length>0?this:void 0}optimizeNames(L,z){const{nodes:X}=this;let de=X.length;for(;de--;){const ve=X[de];ve.optimizeNames(L,z)||(le(L,ve.names),X.splice(de,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((L,z)=>G(L,z.names),{})}}class w extends y{render(L){return"{"+L._n+super.render(L)+"}"+L._n}}class S extends y{}class b extends w{}b.kind="else";class E extends w{constructor(L,z){super(z),this.condition=L}render(L){let z=`if(${this.condition})`+super.render(L);return this.else&&(z+="else "+this.else.render(L)),z}optimizeNodes(){super.optimizeNodes();const L=this.condition;if(L===!0)return this.nodes;let z=this.else;if(z){const X=z.optimizeNodes();z=this.else=Array.isArray(X)?new b(X):X}if(z)return L===!1?z instanceof E?z:z.nodes:this.nodes.length?this:new E(B(L),z instanceof E?[z]:z.nodes);if(!(L===!1||!this.nodes.length))return this}optimizeNames(L,z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(L,z),!!(super.optimizeNames(L,z)||this.else))return this.condition=J(this.condition,L,z),this}get names(){const L=super.names;return U(L,this.condition),this.else&&G(L,this.else.names),L}}E.kind="if";class R extends w{}R.kind="for";class T extends R{constructor(L){super(),this.iteration=L}render(L){return`for(${this.iteration})`+super.render(L)}optimizeNames(L,z){if(super.optimizeNames(L,z))return this.iteration=J(this.iteration,L,z),this}get names(){return G(super.names,this.iteration.names)}}class O extends R{constructor(L,z,X,de){super(),this.varKind=L,this.name=z,this.from=X,this.to=de}render(L){const z=L.es5?n.varKinds.var:this.varKind,{name:X,from:de,to:ve}=this;return`for(${z} ${X}=${de}; ${X}<${ve}; ${X}++)`+super.render(L)}get names(){const L=U(super.names,this.from);return U(L,this.to)}}class C extends R{constructor(L,z,X,de){super(),this.loop=L,this.varKind=z,this.name=X,this.iterable=de}render(L){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(L)}optimizeNames(L,z){if(super.optimizeNames(L,z))return this.iterable=J(this.iterable,L,z),this}get names(){return G(super.names,this.iterable.names)}}class I extends w{constructor(L,z,X){super(),this.name=L,this.args=z,this.async=X}render(L){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(L)}}I.kind="func";class N extends y{render(L){return"return "+super.render(L)}}N.kind="return";class P extends w{render(L){let z="try"+super.render(L);return this.catch&&(z+=this.catch.render(L)),this.finally&&(z+=this.finally.render(L)),z}optimizeNodes(){var L,z;return super.optimizeNodes(),(L=this.catch)===null||L===void 0||L.optimizeNodes(),(z=this.finally)===null||z===void 0||z.optimizeNodes(),this}optimizeNames(L,z){var X,de;return super.optimizeNames(L,z),(X=this.catch)===null||X===void 0||X.optimizeNames(L,z),(de=this.finally)===null||de===void 0||de.optimizeNames(L,z),this}get names(){const L=super.names;return this.catch&&G(L,this.catch.names),this.finally&&G(L,this.finally.names),L}}class $ extends w{constructor(L){super(),this.error=L}render(L){return`catch(${this.error})`+super.render(L)}}$.kind="catch";class K extends w{render(L){return"finally"+super.render(L)}}K.kind="finally";class V{constructor(L,z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...z,_n:z.lines?`
163
+ `),document.head.appendChild(r)}}function tQ(e){const t=Ui.c(6),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:JC.publicConfig(),queryFn:JY,staleTime:1/0},t[0]=r):r=t[0];const{data:a}=XC(r);let i,l;t[1]!==a.theme?(i=()=>{eQ(a.theme)},l=[a.theme],t[1]=a.theme,t[2]=i,t[3]=l):(i=t[2],l=t[3]),A.useLayoutEffect(i,l);let u;return t[4]!==n?(u=x.jsx(x.Fragment,{children:n}),t[4]=n,t[5]=u):u=t[5],u}function S4(){const e=Ui.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=x.jsx("div",{className:"flex items-center justify-center min-h-screen",children:x.jsx("div",{className:"text-gray-500",children:"Loading..."})}),e[0]=t):t=e[0],t}const nQ=new y5({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1,gcTime:300*1e3}}});function rQ(e){const t=Ui.c(4),{children:n}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=x.jsx(aV,{}),t[0]=r):r=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=x.jsx(S4,{}),t[1]=a):a=t[1];let i;return t[2]!==n?(i=x.jsxs(b5,{client:nQ,children:[r,x.jsx(A.Suspense,{fallback:a,children:x.jsx(tQ,{children:x.jsx(P5,{children:x.jsx(QY,{children:n})})})})]}),t[2]=n,t[3]=i):i=t[3],i}var oQ=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const a=e.number||Ze();a instanceof Za&&(e.number=a.int())}}},aQ=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=je(n):typeof n=="number"?e.number=je(n):typeof n=="boolean"?e.boolean=je(n):n===null?e.null=vd():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},sQ=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?vd():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return je(e[0]);if(t==="string")return $t(e);if(t==="number"){const[n,r,...a]=e;return Lt([je(n),je(r),...a.map(i=>je(i))])}return t==="boolean"?Lt([je(!0),je(!1)]):!1}},iQ=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=Z7();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},lQ=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=D())}},cQ=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||D();r instanceof jm&&(e.string=r.refine(a=>Array.from(a).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},uQ=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||D();r instanceof jm&&(e.string=r.refine(a=>Array.from(a).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},dQ=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||D();if(r instanceof jm){const a=new RegExp(n.pattern);e.string=r.regex(a)}}}},fQ=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.min(n.minimum))}}},hQ=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.max(n.maximum))}}},pQ=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},mQ=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},gQ=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||Ze();r instanceof Za&&(e.number=r.refine(a=>{if(n.multipleOf===0)return!1;const i=a/n.multipleOf,l=Math.round(i),u=Math.min(Math.abs(a)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(i-l)<=u/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},vQ=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ee(eo()))}},yQ=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ee(eo())).min(n.minItems))}},_Q=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ee(eo())).max(n.maxItems))}},bQ=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ee(eo());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=pr(n.items);let a=Ee(r);if(e.array&&e.array instanceof ZI){const i=e.array._def;i.checks&&i.checks.forEach(l=>{if(l._zod&&l._zod.def){const u=l._zod.def;u.check==="min_length"&&u.minimum!==void 0?a=a.min(u.minimum):u.check==="max_length"&&u.maximum!==void 0&&(a=a.max(u.maximum))}})}e.array=a}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ee(eo()):e.array=Ee(eo()).max(0):(typeof n.items=="boolean"&&n.items===!0||n.prefixItems)&&(e.array=e.array||Ee(eo()))}},wQ=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(i=>pr(i));let a;r.length===0?a=fT([]):a=fT(r),n.minItems!==void 0&&n.minItems>r.length&&(a=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(a=!1),e.tuple=a,e.array=!1}},SQ=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||ce({}).passthrough())}},EQ=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=ce({}).passthrough())}},RQ=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||ce({}).passthrough();e.object=r.refine(a=>Object.keys(a).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},xQ=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||ce({}).passthrough();e.object=r.refine(a=>Object.keys(a).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function ud(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>ud(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(a=>r.includes(a)&&ud(e[a],t[a]))}return!1}function TQ(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(a=>ud(n,a))?!1:(t.push(n),!0))}}function am(e,t){return e.safeParse(t).success}var OQ=class{apply(e,t){if(!t.not)return e;const n=pr(t.not);return e.refine(r=>!am(n,r),{message:"Value must not match the 'not' schema"})}},CQ=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(TQ(),{message:"Array items must be unique"})}},AQ=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>pr(r)).reduce((r,a)=>yd(r,a),e)}},IQ=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?pr(t.anyOf[0]):Lt([pr(t.anyOf[0]),pr(t.anyOf[1]),...t.anyOf.slice(2).map(r=>pr(r))]);return yd(e,n)}},NQ=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>pr(r));return e.refine(r=>{let a=0;for(const i of n)if(i.safeParse(r).success&&(a++,a>1))return!1;return a===1},{message:"Value must match exactly one of the oneOf schemas"})}},kQ=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const a=n.prefixItems.map(i=>pr(i));return e.refine(i=>{if(!Array.isArray(i))return!0;for(let l=0;l<Math.min(i.length,a.length);l++)if(!am(a[l],i[l]))return!1;if(i.length>a.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const l=pr(n.items);for(let u=a.length;u<i.length;u++)if(!am(l,i[u]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},MQ=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof $m||e instanceof YI){const r={};if(n.properties)for(const[a,i]of Object.entries(n.properties))i!==void 0&&(r[a]=pr(i));if(n.required&&Array.isArray(n.required)){const a=new Set(n.required);for(const i of Object.keys(r))a.has(i)||(r[i]=r[i].optional())}else for(const a of Object.keys(r))r[a]=r[a].optional();return n.additionalProperties===!1?ce(r):ce(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[a,i]of Object.entries(n.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(r,a)!==void 0&&!pr(i).safeParse(r[a]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const a of n.required)if(!(Object.getOwnPropertyDescriptor(r,a)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const a=new Set(Object.keys(n.properties));for(const i in r)if(!a.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},PQ=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(a=>ud(r,a)),{message:"Value must match one of the enum values"})}},DQ=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>ud(r,n),{message:"Value must equal the const value"})}},LQ=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},jQ=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:eo().refine(a=>this.validateRequired(a,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},$Q=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const a=pr(r.contains),i=(n=r.minContains)!=null?n:1,l=r.maxContains;return e.refine(u=>{if(!Array.isArray(u))return!0;let d=0;for(const f of u)am(a,f)&&d++;return!(d<i||l!==void 0&&d>l)},{message:"Array must contain required items matching the schema"})}},UQ=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},zQ=[new aQ,new sQ,new oQ,new iQ,new lQ,new vQ,new EQ,new cQ,new uQ,new dQ,new fQ,new hQ,new pQ,new mQ,new gQ,new wQ,new yQ,new _Q,new bQ,new RQ,new xQ,new SQ],VQ=[new jQ,new PQ,new DQ,new AQ,new IQ,new NQ,new kQ,new MQ,new $Q,new OQ,new CQ,new UQ,new LQ];function pr(e){if(typeof e=="boolean")return e?eo():Fp();const t={};for(const a of zQ)a.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||D()),t.number!==!1&&n.push(t.number||Ze()),t.boolean!==!1&&n.push(t.boolean||et()),t.null!==!1&&n.push(t.null||vd()),t.array!==!1&&n.push(t.array||Ee(eo())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const a=eN(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");n.push(a)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Fp():n.length===1?r=n[0]:Object.keys(e).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?r=Lt(n):r=eo();for(const a of VQ)r=a.apply(r,e);return r}function Qm(e){return!!e._zod}function As(e,t){return Qm(e)?eI(e,t):e.safeParse(t)}function E4(e){if(!e)return;let t;if(Qm(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function FQ(e){if(Qm(e)){const i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const r=e.value;if(r!==void 0)return r}const Xm="2025-11-25",BQ=[Xm,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Si="io.modelcontextprotocol/related-task",Jm="2.0",sr=eN(e=>e!==null&&(typeof e=="object"||typeof e=="function")),R4=Lt([D(),Ze().int()]),x4=D();ar({ttl:Lt([Ze(),vd()]).optional(),pollInterval:Ze().optional()});const qQ=ce({ttl:Ze().optional()}),HQ=ce({taskId:D()}),T1=ar({progressToken:R4.optional(),[Si]:HQ.optional()}),oo=ce({_meta:T1.optional()}),Nd=oo.extend({task:qQ.optional()}),GQ=e=>Nd.safeParse(e).success,lr=ce({method:D(),params:oo.loose().optional()}),xo=ce({_meta:T1.optional()}),To=ce({method:D(),params:xo.loose().optional()}),cr=ar({_meta:T1.optional()}),eg=Lt([D(),Ze().int()]),T4=ce({jsonrpc:je(Jm),id:eg,...lr.shape}).strict(),$_=e=>T4.safeParse(e).success,O4=ce({jsonrpc:je(Jm),...To.shape}).strict(),ZQ=e=>O4.safeParse(e).success,O1=ce({jsonrpc:je(Jm),id:eg,result:cr}).strict(),Pu=e=>O1.safeParse(e).success;var at;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(at||(at={}));const C1=ce({jsonrpc:je(Jm),id:eg.optional(),error:ce({code:Ze().int(),message:D(),data:_t().optional()})}).strict(),KQ=e=>C1.safeParse(e).success,Zu=Lt([T4,O4,O1,C1]);Lt([O1,C1]);const Yl=cr.strict(),WQ=xo.extend({requestId:eg.optional(),reason:D().optional()}),A1=To.extend({method:je("notifications/cancelled"),params:WQ}),YQ=ce({src:D(),mimeType:D().optional(),sizes:Ee(D()).optional(),theme:$t(["light","dark"]).optional()}),kd=ce({icons:Ee(YQ).optional()}),dc=ce({name:D(),title:D().optional()}),C4=dc.extend({...dc.shape,...kd.shape,version:D(),websiteUrl:D().optional(),description:D().optional()}),QQ=yd(ce({applyDefaults:et().optional()}),Et(D(),_t())),XQ=kb(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yd(ce({form:QQ.optional(),url:sr.optional()}),Et(D(),_t()).optional())),JQ=ar({list:sr.optional(),cancel:sr.optional(),requests:ar({sampling:ar({createMessage:sr.optional()}).optional(),elicitation:ar({create:sr.optional()}).optional()}).optional()}),eX=ar({list:sr.optional(),cancel:sr.optional(),requests:ar({tools:ar({call:sr.optional()}).optional()}).optional()}),tX=ce({experimental:Et(D(),sr).optional(),sampling:ce({context:sr.optional(),tools:sr.optional()}).optional(),elicitation:XQ.optional(),roots:ce({listChanged:et().optional()}).optional(),tasks:JQ.optional()}),nX=oo.extend({protocolVersion:D(),capabilities:tX,clientInfo:C4}),rX=lr.extend({method:je("initialize"),params:nX}),oX=ce({experimental:Et(D(),sr).optional(),logging:sr.optional(),completions:sr.optional(),prompts:ce({listChanged:et().optional()}).optional(),resources:ce({subscribe:et().optional(),listChanged:et().optional()}).optional(),tools:ce({listChanged:et().optional()}).optional(),tasks:eX.optional()}),A4=cr.extend({protocolVersion:D(),capabilities:oX,serverInfo:C4,instructions:D().optional()}),I4=To.extend({method:je("notifications/initialized"),params:xo.optional()}),aX=e=>I4.safeParse(e).success,I1=lr.extend({method:je("ping"),params:oo.optional()}),sX=ce({progress:Ze(),total:vn(Ze()),message:vn(D())}),iX=ce({...xo.shape,...sX.shape,progressToken:R4}),N1=To.extend({method:je("notifications/progress"),params:iX}),lX=oo.extend({cursor:x4.optional()}),Md=lr.extend({params:lX.optional()}),Pd=cr.extend({nextCursor:x4.optional()}),cX=$t(["working","input_required","completed","failed","cancelled"]),Dd=ce({taskId:D(),status:cX,ttl:Lt([Ze(),vd()]),createdAt:D(),lastUpdatedAt:D(),pollInterval:vn(Ze()),statusMessage:vn(D())}),dd=cr.extend({task:Dd}),uX=xo.merge(Dd),sm=To.extend({method:je("notifications/tasks/status"),params:uX}),k1=lr.extend({method:je("tasks/get"),params:oo.extend({taskId:D()})}),M1=cr.merge(Dd),P1=lr.extend({method:je("tasks/result"),params:oo.extend({taskId:D()})});cr.loose();const D1=Md.extend({method:je("tasks/list")}),L1=Pd.extend({tasks:Ee(Dd)}),j1=lr.extend({method:je("tasks/cancel"),params:oo.extend({taskId:D()})}),dX=cr.merge(Dd),N4=ce({uri:D(),mimeType:vn(D()),_meta:Et(D(),_t()).optional()}),k4=N4.extend({text:D()}),$1=D().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),M4=N4.extend({blob:$1}),Ld=$t(["user","assistant"]),Ec=ce({audience:Ee(Ld).optional(),priority:Ze().min(0).max(1).optional(),lastModified:BI({offset:!0}).optional()}),P4=ce({...dc.shape,...kd.shape,uri:D(),description:vn(D()),mimeType:vn(D()),annotations:Ec.optional(),_meta:vn(ar({}))}),fX=ce({...dc.shape,...kd.shape,uriTemplate:D(),description:vn(D()),mimeType:vn(D()),annotations:Ec.optional(),_meta:vn(ar({}))}),hX=Md.extend({method:je("resources/list")}),D4=Pd.extend({resources:Ee(P4)}),pX=Md.extend({method:je("resources/templates/list")}),L4=Pd.extend({resourceTemplates:Ee(fX)}),U1=oo.extend({uri:D()}),mX=U1,gX=lr.extend({method:je("resources/read"),params:mX}),j4=cr.extend({contents:Ee(Lt([k4,M4]))}),$4=To.extend({method:je("notifications/resources/list_changed"),params:xo.optional()}),vX=U1,yX=lr.extend({method:je("resources/subscribe"),params:vX}),_X=U1,bX=lr.extend({method:je("resources/unsubscribe"),params:_X}),wX=xo.extend({uri:D()}),SX=To.extend({method:je("notifications/resources/updated"),params:wX}),EX=ce({name:D(),description:vn(D()),required:vn(et())}),RX=ce({...dc.shape,...kd.shape,description:vn(D()),arguments:vn(Ee(EX)),_meta:vn(ar({}))}),xX=Md.extend({method:je("prompts/list")}),U4=Pd.extend({prompts:Ee(RX)}),TX=oo.extend({name:D(),arguments:Et(D(),D()).optional()}),OX=lr.extend({method:je("prompts/get"),params:TX}),z1=ce({type:je("text"),text:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),V1=ce({type:je("image"),data:$1,mimeType:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),F1=ce({type:je("audio"),data:$1,mimeType:D(),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),CX=ce({type:je("tool_use"),name:D(),id:D(),input:Et(D(),_t()),_meta:Et(D(),_t()).optional()}),AX=ce({type:je("resource"),resource:Lt([k4,M4]),annotations:Ec.optional(),_meta:Et(D(),_t()).optional()}),IX=P4.extend({type:je("resource_link")}),B1=Lt([z1,V1,F1,IX,AX]),NX=ce({role:Ld,content:B1}),z4=cr.extend({description:D().optional(),messages:Ee(NX)}),V4=To.extend({method:je("notifications/prompts/list_changed"),params:xo.optional()}),kX=ce({title:D().optional(),readOnlyHint:et().optional(),destructiveHint:et().optional(),idempotentHint:et().optional(),openWorldHint:et().optional()}),MX=ce({taskSupport:$t(["required","optional","forbidden"]).optional()}),F4=ce({...dc.shape,...kd.shape,description:D().optional(),inputSchema:ce({type:je("object"),properties:Et(D(),sr).optional(),required:Ee(D()).optional()}).catchall(_t()),outputSchema:ce({type:je("object"),properties:Et(D(),sr).optional(),required:Ee(D()).optional()}).catchall(_t()).optional(),annotations:kX.optional(),execution:MX.optional(),_meta:Et(D(),_t()).optional()}),PX=Md.extend({method:je("tools/list")}),q1=Pd.extend({tools:Ee(F4)}),tg=cr.extend({content:Ee(B1).default([]),structuredContent:Et(D(),_t()).optional(),isError:et().optional()});tg.or(cr.extend({toolResult:_t()}));const DX=Nd.extend({name:D(),arguments:Et(D(),_t()).optional()}),LX=lr.extend({method:je("tools/call"),params:DX}),B4=To.extend({method:je("notifications/tools/list_changed"),params:xo.optional()}),jX=ce({autoRefresh:et().default(!0),debounceMs:Ze().int().nonnegative().default(300)}),q4=$t(["debug","info","notice","warning","error","critical","alert","emergency"]),$X=oo.extend({level:q4}),UX=lr.extend({method:je("logging/setLevel"),params:$X}),zX=xo.extend({level:q4,logger:D().optional(),data:_t()}),VX=To.extend({method:je("notifications/message"),params:zX}),FX=ce({name:D().optional()}),BX=ce({hints:Ee(FX).optional(),costPriority:Ze().min(0).max(1).optional(),speedPriority:Ze().min(0).max(1).optional(),intelligencePriority:Ze().min(0).max(1).optional()}),qX=ce({mode:$t(["auto","required","none"]).optional()}),HX=ce({type:je("tool_result"),toolUseId:D().describe("The unique identifier for the corresponding tool call."),content:Ee(B1).default([]),structuredContent:ce({}).loose().optional(),isError:et().optional(),_meta:Et(D(),_t()).optional()}),GX=WI("type",[z1,V1,F1]),im=WI("type",[z1,V1,F1,CX,HX]),ZX=ce({role:Ld,content:Lt([im,Ee(im)]),_meta:Et(D(),_t()).optional()}),KX=Nd.extend({messages:Ee(ZX),modelPreferences:BX.optional(),systemPrompt:D().optional(),includeContext:$t(["none","thisServer","allServers"]).optional(),temperature:Ze().optional(),maxTokens:Ze().int(),stopSequences:Ee(D()).optional(),metadata:sr.optional(),tools:Ee(F4).optional(),toolChoice:qX.optional()}),H4=lr.extend({method:je("sampling/createMessage"),params:KX}),G4=cr.extend({model:D(),stopReason:vn($t(["endTurn","stopSequence","maxTokens"]).or(D())),role:Ld,content:GX}),Z4=cr.extend({model:D(),stopReason:vn($t(["endTurn","stopSequence","maxTokens","toolUse"]).or(D())),role:Ld,content:Lt([im,Ee(im)])}),WX=ce({type:je("boolean"),title:D().optional(),description:D().optional(),default:et().optional()}),YX=ce({type:je("string"),title:D().optional(),description:D().optional(),minLength:Ze().optional(),maxLength:Ze().optional(),format:$t(["email","uri","date","date-time"]).optional(),default:D().optional()}),QX=ce({type:$t(["number","integer"]),title:D().optional(),description:D().optional(),minimum:Ze().optional(),maximum:Ze().optional(),default:Ze().optional()}),XX=ce({type:je("string"),title:D().optional(),description:D().optional(),enum:Ee(D()),default:D().optional()}),JX=ce({type:je("string"),title:D().optional(),description:D().optional(),oneOf:Ee(ce({const:D(),title:D()})),default:D().optional()}),eJ=ce({type:je("string"),title:D().optional(),description:D().optional(),enum:Ee(D()),enumNames:Ee(D()).optional(),default:D().optional()}),tJ=Lt([XX,JX]),nJ=ce({type:je("array"),title:D().optional(),description:D().optional(),minItems:Ze().optional(),maxItems:Ze().optional(),items:ce({type:je("string"),enum:Ee(D())}),default:Ee(D()).optional()}),rJ=ce({type:je("array"),title:D().optional(),description:D().optional(),minItems:Ze().optional(),maxItems:Ze().optional(),items:ce({anyOf:Ee(ce({const:D(),title:D()}))}),default:Ee(D()).optional()}),oJ=Lt([nJ,rJ]),aJ=Lt([eJ,tJ,oJ]),sJ=Lt([aJ,WX,YX,QX]),iJ=Nd.extend({mode:je("form").optional(),message:D(),requestedSchema:ce({type:je("object"),properties:Et(D(),sJ),required:Ee(D()).optional()})}),lJ=Nd.extend({mode:je("url"),message:D(),elicitationId:D(),url:D().url()}),cJ=Lt([iJ,lJ]),K4=lr.extend({method:je("elicitation/create"),params:cJ}),uJ=xo.extend({elicitationId:D()}),dJ=To.extend({method:je("notifications/elicitation/complete"),params:uJ}),W4=cr.extend({action:$t(["accept","decline","cancel"]),content:kb(e=>e===null?void 0:e,Et(D(),Lt([D(),Ze(),et(),Ee(D())])).optional())}),fJ=ce({type:je("ref/resource"),uri:D()}),hJ=ce({type:je("ref/prompt"),name:D()}),pJ=oo.extend({ref:Lt([hJ,fJ]),argument:ce({name:D(),value:D()}),context:ce({arguments:Et(D(),D()).optional()}).optional()}),mJ=lr.extend({method:je("completion/complete"),params:pJ}),Y4=cr.extend({completion:ar({values:Ee(D()).max(100),total:vn(Ze().int()),hasMore:vn(et())})}),gJ=ce({uri:D().startsWith("file://"),name:D().optional(),_meta:Et(D(),_t()).optional()}),vJ=lr.extend({method:je("roots/list"),params:oo.optional()}),yJ=cr.extend({roots:Ee(gJ)}),_J=To.extend({method:je("notifications/roots/list_changed"),params:xo.optional()});Lt([I1,rX,mJ,UX,OX,xX,hX,pX,gX,yX,bX,LX,PX,k1,P1,D1,j1]);Lt([A1,N1,I4,_J,sm]);Lt([Yl,G4,Z4,W4,yJ,M1,L1,dd]);Lt([I1,H4,K4,vJ,k1,P1,D1,j1]);Lt([A1,N1,VX,SX,$4,B4,V4,sm,dJ]);Lt([Yl,A4,Y4,z4,U4,D4,L4,j4,tg,q1,M1,L1,dd]);class Qe extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===at.UrlElicitationRequired&&r){const a=r;if(a.elicitations)return new bJ(a.elicitations,n)}return new Qe(t,n,r)}}class bJ extends Qe{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(at.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function yi(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function QO(e){const n=E4(e)?.method;if(!n)throw new Error("Schema is missing a method literal");const r=FQ(n);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function XO(e,t){const n=As(e,t);if(!n.success)throw n.error;return n.data}const wJ=6e4;class SJ{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(A1,n=>{this._oncancel(n)}),this.setNotificationHandler(N1,n=>{this._onprogress(n)}),this.setRequestHandler(I1,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(k1,async(n,r)=>{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Qe(at.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(P1,async(n,r)=>{const a=async()=>{const i=n.params.taskId;if(this._taskMessageQueue){let u;for(;u=await this._taskMessageQueue.dequeue(i,r.sessionId);){if(u.type==="response"||u.type==="error"){const d=u.message,f=d.id,m=this._requestResolvers.get(f);if(m)if(this._requestResolvers.delete(f),u.type==="response")m(d);else{const p=d,g=new Qe(p.error.code,p.error.message,p.error.data);m(g)}else{const p=u.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${f}`))}continue}await this._transport?.send(u.message,{relatedRequestId:r.requestId})}}const l=await this._taskStore.getTask(i,r.sessionId);if(!l)throw new Qe(at.InvalidParams,`Task not found: ${i}`);if(!yi(l.status))return await this._waitForTaskUpdate(i,r.signal),await a();if(yi(l.status)){const u=await this._taskStore.getTaskResult(i,r.sessionId);return this._clearTaskQueue(i),{...u,_meta:{...u._meta,[Si]:{taskId:i}}}}return await a()};return await a()}),this.setRequestHandler(D1,async(n,r)=>{try{const{tasks:a,nextCursor:i}=await this._taskStore.listTasks(n.params?.cursor,r.sessionId);return{tasks:a,nextCursor:i,_meta:{}}}catch(a){throw new Qe(at.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(j1,async(n,r)=>{try{const a=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!a)throw new Qe(at.InvalidParams,`Task not found: ${n.params.taskId}`);if(yi(a.status))throw new Qe(at.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(n.params.taskId);const i=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!i)throw new Qe(at.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...i}}catch(a){throw a instanceof Qe?a:new Qe(at.InvalidRequest,`Failed to cancel task: ${a instanceof Error?a.message:String(a)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,r,a,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(a,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:i,onTimeout:a})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),Qe.fromError(at.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){this._transport=t;const n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=i=>{r?.(i),this._onerror(i)};const a=this._transport?.onmessage;this._transport.onmessage=(i,l)=>{a?.(i,l),Pu(i)||KQ(i)?this._onresponse(i):$_(i)?this._onrequest(i,l):ZQ(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const n=Qe.fromError(at.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of t.values())r(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,n){const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,a=this._transport,i=t.params?._meta?.[Si]?.taskId;if(r===void 0){const m={jsonrpc:"2.0",id:t.id,error:{code:at.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:m,timestamp:Date.now()},a?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):a?.send(m).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}const l=new AbortController;this._requestHandlerAbortControllers.set(t.id,l);const u=GQ(t.params)?t.params.task:void 0,d=this._taskStore?this.requestTaskStore(t,a?.sessionId):void 0,f={signal:l.signal,sessionId:a?.sessionId,_meta:t.params?._meta,sendNotification:async m=>{const p={relatedRequestId:t.id};i&&(p.relatedTask={taskId:i}),await this.notification(m,p)},sendRequest:async(m,p,g)=>{const y={...g,relatedRequestId:t.id};i&&!y.relatedTask&&(y.relatedTask={taskId:i});const w=y.relatedTask?.taskId??i;return w&&d&&await d.updateTaskStatus(w,"input_required"),await this.request(m,p,y)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:i,taskStore:d,taskRequestedTtl:u?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{u&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,f)).then(async m=>{if(l.signal.aborted)return;const p={result:m,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:p,timestamp:Date.now()},a?.sessionId):await a?.send(p)},async m=>{if(l.signal.aborted)return;const p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(m.code)?m.code:at.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},a?.sessionId):await a?.send(p)}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...r}=t.params,a=Number(n),i=this._progressHandlers.get(a);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const l=this._responseHandlers.get(a),u=this._timeoutInfo.get(a);if(u&&l&&u.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(d){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),l(d);return}i(r)}_onresponse(t){const n=Number(t.id),r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),Pu(t))r(t);else{const l=new Qe(t.error.code,t.error.message,t.error.data);r(l)}return}const a=this._responseHandlers.get(n);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let i=!1;if(Pu(t)&&t.result&&typeof t.result=="object"){const l=t.result;if(l.task&&typeof l.task=="object"){const u=l.task;typeof u.taskId=="string"&&(i=!0,this._taskProgressTokens.set(u.taskId,n))}}if(i||this._progressHandlers.delete(n),Pu(t))a(t);else{const l=Qe.fromError(t.error.code,t.error.message,t.error.data);a(l)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,r){const{task:a}=r??{};if(!a){try{yield{type:"result",result:await this.request(t,n,r)}}catch(l){yield{type:"error",error:l instanceof Qe?l:new Qe(at.InternalError,String(l))}}return}let i;try{const l=await this.request(t,dd,r);if(l.task)i=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new Qe(at.InternalError,"Task creation did not return a task");for(;;){const u=await this.getTask({taskId:i},r);if(yield{type:"taskStatus",task:u},yi(u.status)){u.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)}:u.status==="failed"?yield{type:"error",error:new Qe(at.InternalError,`Task ${i} failed`)}:u.status==="cancelled"&&(yield{type:"error",error:new Qe(at.InternalError,`Task ${i} was cancelled`)});return}if(u.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},n,r)};return}const d=u.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,d)),r?.signal?.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof Qe?l:new Qe(at.InternalError,String(l))}}}request(t,n,r){const{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l,task:u,relatedTask:d}=r??{};return new Promise((f,m)=>{const p=R=>{m(R)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),u&&this.assertTaskCapability(t.method)}catch(R){p(R);return}r?.signal?.throwIfAborted();const g=this._requestMessageId++,y={...t,jsonrpc:"2.0",id:g};r?.onprogress&&(this._progressHandlers.set(g,r.onprogress),y.params={...t.params,_meta:{...t.params?._meta||{},progressToken:g}}),u&&(y.params={...y.params,task:u}),d&&(y.params={...y.params,_meta:{...y.params?._meta||{},[Si]:d}});const w=R=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(R)}},{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l}).catch(O=>this._onerror(new Error(`Failed to send cancellation: ${O}`)));const T=R instanceof Qe?R:new Qe(at.RequestTimeout,String(R));m(T)};this._responseHandlers.set(g,R=>{if(!r?.signal?.aborted){if(R instanceof Error)return m(R);try{const T=As(n,R.result);T.success?f(T.data):m(T.error)}catch(T){m(T)}}}),r?.signal?.addEventListener("abort",()=>{w(r?.signal?.reason)});const S=r?.timeout??wJ,b=()=>w(Qe.fromError(at.RequestTimeout,"Request timed out",{timeout:S}));this._setupTimeout(g,S,r?.maxTotalTimeout,b,r?.resetTimeoutOnProgress??!1);const E=d?.taskId;if(E){const R=T=>{const O=this._responseHandlers.get(g);O?O(T):this._onerror(new Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,R),this._enqueueTaskMessage(E,{type:"request",message:y,timestamp:Date.now()}).catch(T=>{this._cleanupTimeout(g),m(T)})}else this._transport.send(y,{relatedRequestId:a,resumptionToken:i,onresumptiontoken:l}).catch(R=>{this._cleanupTimeout(g),m(R)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},M1,n)}async getTaskResult(t,n,r){return this.request({method:"tasks/result",params:t},n,r)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},L1,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},dX,n)}async notification(t,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=n?.relatedTask?.taskId;if(r){const u={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Si]:n.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:u,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let u={...t,jsonrpc:"2.0"};n?.relatedTask&&(u={...u,params:{...u.params,_meta:{...u.params?._meta||{},[Si]:n.relatedTask}}}),this._transport?.send(u,n).catch(d=>this._onerror(d))});return}let l={...t,jsonrpc:"2.0"};n?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[Si]:n.relatedTask}}}),await this._transport.send(l,n)}setRequestHandler(t,n){const r=QO(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(a,i)=>{const l=XO(t,a);return Promise.resolve(n(l,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const r=QO(t);this._notificationHandlers.set(r,a=>{const i=XO(t,a);return Promise.resolve(n(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,r,a)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,n);for(const a of r)if(a.type==="request"&&$_(a.message)){const i=a.message.id,l=this._requestResolvers.get(i);l?(l(new Qe(at.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){let r=this._options?.defaultTaskPollInterval??1e3;try{const a=await this._taskStore?.getTask(t);a?.pollInterval&&(r=a.pollInterval)}catch{}return new Promise((a,i)=>{if(n.aborted){i(new Qe(at.InvalidRequest,"Request cancelled"));return}const l=setTimeout(a,r);n.addEventListener("abort",()=>{clearTimeout(l),i(new Qe(at.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async a=>{if(!t)throw new Error("No request provided");return await r.createTask(a,t.id,{method:t.method,params:t.params},n)},getTask:async a=>{const i=await r.getTask(a,n);if(!i)throw new Qe(at.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(a,i,l)=>{await r.storeTaskResult(a,i,l,n);const u=await r.getTask(a,n);if(u){const d=sm.parse({method:"notifications/tasks/status",params:u});await this.notification(d),yi(u.status)&&this._cleanupTaskProgressHandler(a)}},getTaskResult:a=>r.getTaskResult(a,n),updateTaskStatus:async(a,i,l)=>{const u=await r.getTask(a,n);if(!u)throw new Qe(at.InvalidParams,`Task "${a}" not found - it may have been cleaned up`);if(yi(u.status))throw new Qe(at.InvalidParams,`Cannot update task "${a}" from terminal status "${u.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(a,i,l,n);const d=await r.getTask(a,n);if(d){const f=sm.parse({method:"notifications/tasks/status",params:d});await this.notification(f),yi(d.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>r.listTasks(a,n)}}}function JO(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function EJ(e,t){const n={...e};for(const r in t){const a=r,i=t[a];if(i===void 0)continue;const l=n[a];JO(l)&&JO(i)?n[a]={...l,...i}:n[a]=i}return n}var Th={exports:{}},C0={},ja={},_i={},A0={},I0={},N0={},e2;function lm(){return e2||(e2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(R){if(super(),!e.IDENTIFIER.test(R))throw new Error("CodeGen: name must be a valid identifier");this.str=R}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(R){super(),this._items=typeof R=="string"?[R]:R}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const R=this._items[0];return R===""||R==='""'}get str(){var R;return(R=this._str)!==null&&R!==void 0?R:this._str=this._items.reduce((T,O)=>`${T}${O}`,"")}get names(){var R;return(R=this._names)!==null&&R!==void 0?R:this._names=this._items.reduce((T,O)=>(O instanceof n&&(T[O.str]=(T[O.str]||0)+1),T),{})}}e._Code=r,e.nil=new r("");function a(E,...R){const T=[E[0]];let O=0;for(;O<R.length;)u(T,R[O]),T.push(E[++O]);return new r(T)}e._=a;const i=new r("+");function l(E,...R){const T=[y(E[0])];let O=0;for(;O<R.length;)T.push(i),u(T,R[O]),T.push(i,y(E[++O]));return d(T),new r(T)}e.str=l;function u(E,R){R instanceof r?E.push(...R._items):R instanceof n?E.push(R):E.push(p(R))}e.addCodeArg=u;function d(E){let R=1;for(;R<E.length-1;){if(E[R]===i){const T=f(E[R-1],E[R+1]);if(T!==void 0){E.splice(R-1,3,T);continue}E[R++]="+"}R++}}function f(E,R){if(R==='""')return E;if(E==='""')return R;if(typeof E=="string")return R instanceof n||E[E.length-1]!=='"'?void 0:typeof R!="string"?`${E.slice(0,-1)}${R}"`:R[0]==='"'?E.slice(0,-1)+R.slice(1):void 0;if(typeof R=="string"&&R[0]==='"'&&!(E instanceof n))return`"${E}${R.slice(1)}`}function m(E,R){return R.emptyStr()?E:E.emptyStr()?R:l`${E}${R}`}e.strConcat=m;function p(E){return typeof E=="number"||typeof E=="boolean"||E===null?E:y(Array.isArray(E)?E.join(","):E)}function g(E){return new r(y(E))}e.stringify=g;function y(E){return JSON.stringify(E).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function w(E){return typeof E=="string"&&e.IDENTIFIER.test(E)?new r(`.${E}`):a`[${E}]`}e.getProperty=w;function S(E){if(typeof E=="string"&&e.IDENTIFIER.test(E))return new r(`${E}`);throw new Error(`CodeGen: invalid export name: ${E}, use explicit $id name mapping`)}e.getEsmExportName=S;function b(E){return new r(E.toString())}e.regexpCode=b})(N0)),N0}var k0={},t2;function n2(){return t2||(t2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=lm();class n extends Error{constructor(f){super(`CodeGen: "code" for ${f} not defined`),this.value=f.value}}var r;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:f,parent:m}={}){this._names={},this._prefixes=f,this._parent=m}toName(f){return f instanceof t.Name?f:this.name(f)}name(f){return new t.Name(this._newName(f))}_newName(f){const m=this._names[f]||this._nameGroup(f);return`${f}${m.index++}`}_nameGroup(f){var m,p;if(!((p=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||p===void 0)&&p.has(f)||this._prefixes&&!this._prefixes.has(f))throw new Error(`CodeGen: prefix "${f}" is not allowed in this scope`);return this._names[f]={prefix:f,index:0}}}e.Scope=a;class i extends t.Name{constructor(f,m){super(m),this.prefix=f}setValue(f,{property:m,itemIndex:p}){this.value=f,this.scopePath=(0,t._)`.${new t.Name(m)}[${p}]`}}e.ValueScopeName=i;const l=(0,t._)`\n`;class u extends a{constructor(f){super(f),this._values={},this._scope=f.scope,this.opts={...f,_n:f.lines?l:t.nil}}get(){return this._scope}name(f){return new i(f,this._newName(f))}value(f,m){var p;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(f),{prefix:y}=g,w=(p=m.key)!==null&&p!==void 0?p:m.ref;let S=this._values[y];if(S){const R=S.get(w);if(R)return R}else S=this._values[y]=new Map;S.set(w,g);const b=this._scope[y]||(this._scope[y]=[]),E=b.length;return b[E]=m.ref,g.setValue(m,{property:y,itemIndex:E}),g}getValue(f,m){const p=this._values[f];if(p)return p.get(m)}scopeRefs(f,m=this._values){return this._reduceValues(m,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${f}${p.scopePath}`})}scopeCode(f=this._values,m,p){return this._reduceValues(f,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},m,p)}_reduceValues(f,m,p={},g){let y=t.nil;for(const w in f){const S=f[w];if(!S)continue;const b=p[w]=p[w]||new Map;S.forEach(E=>{if(b.has(E))return;b.set(E,r.Started);let R=m(E);if(R){const T=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${T} ${E} = ${R};${this.opts._n}`}else if(R=g?.(E))y=(0,t._)`${y}${R}${this.opts._n}`;else throw new n(E);b.set(E,r.Completed)})}return y}}e.ValueScope=u})(k0)),k0}var r2;function pt(){return r2||(r2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=lm(),n=n2();var r=lm();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var a=n2();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(L,z){return this}}class l extends i{constructor(L,z,X){super(),this.varKind=L,this.name=z,this.rhs=X}render({es5:L,_n:z}){const X=L?n.varKinds.var:this.varKind,de=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${de};`+z}optimizeNames(L,z){if(L[this.name.str])return this.rhs&&(this.rhs=J(this.rhs,L,z)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(L,z,X){super(),this.lhs=L,this.rhs=z,this.sideEffects=X}render({_n:L}){return`${this.lhs} = ${this.rhs};`+L}optimizeNames(L,z){if(!(this.lhs instanceof t.Name&&!L[this.lhs.str]&&!this.sideEffects))return this.rhs=J(this.rhs,L,z),this}get names(){const L=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(L,this.rhs)}}class d extends u{constructor(L,z,X,de){super(L,X,de),this.op=z}render({_n:L}){return`${this.lhs} ${this.op}= ${this.rhs};`+L}}class f extends i{constructor(L){super(),this.label=L,this.names={}}render({_n:L}){return`${this.label}:`+L}}class m extends i{constructor(L){super(),this.label=L,this.names={}}render({_n:L}){return`break${this.label?` ${this.label}`:""};`+L}}class p extends i{constructor(L){super(),this.error=L}render({_n:L}){return`throw ${this.error};`+L}get names(){return this.error.names}}class g extends i{constructor(L){super(),this.code=L}render({_n:L}){return`${this.code};`+L}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(L,z){return this.code=J(this.code,L,z),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends i{constructor(L=[]){super(),this.nodes=L}render(L){return this.nodes.reduce((z,X)=>z+X.render(L),"")}optimizeNodes(){const{nodes:L}=this;let z=L.length;for(;z--;){const X=L[z].optimizeNodes();Array.isArray(X)?L.splice(z,1,...X):X?L[z]=X:L.splice(z,1)}return L.length>0?this:void 0}optimizeNames(L,z){const{nodes:X}=this;let de=X.length;for(;de--;){const ve=X[de];ve.optimizeNames(L,z)||(le(L,ve.names),X.splice(de,1))}return X.length>0?this:void 0}get names(){return this.nodes.reduce((L,z)=>G(L,z.names),{})}}class w extends y{render(L){return"{"+L._n+super.render(L)+"}"+L._n}}class S extends y{}class b extends w{}b.kind="else";class E extends w{constructor(L,z){super(z),this.condition=L}render(L){let z=`if(${this.condition})`+super.render(L);return this.else&&(z+="else "+this.else.render(L)),z}optimizeNodes(){super.optimizeNodes();const L=this.condition;if(L===!0)return this.nodes;let z=this.else;if(z){const X=z.optimizeNodes();z=this.else=Array.isArray(X)?new b(X):X}if(z)return L===!1?z instanceof E?z:z.nodes:this.nodes.length?this:new E(B(L),z instanceof E?[z]:z.nodes);if(!(L===!1||!this.nodes.length))return this}optimizeNames(L,z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames(L,z),!!(super.optimizeNames(L,z)||this.else))return this.condition=J(this.condition,L,z),this}get names(){const L=super.names;return U(L,this.condition),this.else&&G(L,this.else.names),L}}E.kind="if";class R extends w{}R.kind="for";class T extends R{constructor(L){super(),this.iteration=L}render(L){return`for(${this.iteration})`+super.render(L)}optimizeNames(L,z){if(super.optimizeNames(L,z))return this.iteration=J(this.iteration,L,z),this}get names(){return G(super.names,this.iteration.names)}}class O extends R{constructor(L,z,X,de){super(),this.varKind=L,this.name=z,this.from=X,this.to=de}render(L){const z=L.es5?n.varKinds.var:this.varKind,{name:X,from:de,to:ve}=this;return`for(${z} ${X}=${de}; ${X}<${ve}; ${X}++)`+super.render(L)}get names(){const L=U(super.names,this.from);return U(L,this.to)}}class C extends R{constructor(L,z,X,de){super(),this.loop=L,this.varKind=z,this.name=X,this.iterable=de}render(L){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(L)}optimizeNames(L,z){if(super.optimizeNames(L,z))return this.iterable=J(this.iterable,L,z),this}get names(){return G(super.names,this.iterable.names)}}class I extends w{constructor(L,z,X){super(),this.name=L,this.args=z,this.async=X}render(L){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(L)}}I.kind="func";class N extends y{render(L){return"return "+super.render(L)}}N.kind="return";class P extends w{render(L){let z="try"+super.render(L);return this.catch&&(z+=this.catch.render(L)),this.finally&&(z+=this.finally.render(L)),z}optimizeNodes(){var L,z;return super.optimizeNodes(),(L=this.catch)===null||L===void 0||L.optimizeNodes(),(z=this.finally)===null||z===void 0||z.optimizeNodes(),this}optimizeNames(L,z){var X,de;return super.optimizeNames(L,z),(X=this.catch)===null||X===void 0||X.optimizeNames(L,z),(de=this.finally)===null||de===void 0||de.optimizeNames(L,z),this}get names(){const L=super.names;return this.catch&&G(L,this.catch.names),this.finally&&G(L,this.finally.names),L}}class $ extends w{constructor(L){super(),this.error=L}render(L){return`catch(${this.error})`+super.render(L)}}$.kind="catch";class K extends w{render(L){return"finally"+super.render(L)}}K.kind="finally";class V{constructor(L,z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...z,_n:z.lines?`
164
164
  `:""},this._extScope=L,this._scope=new n.Scope({parent:L}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(L){return this._scope.name(L)}scopeName(L){return this._extScope.name(L)}scopeValue(L,z){const X=this._extScope.value(L,z);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue(L,z){return this._extScope.getValue(L,z)}scopeRefs(L){return this._extScope.scopeRefs(L,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(L,z,X,de){const ve=this._scope.toName(z);return X!==void 0&&de&&(this._constants[ve.str]=X),this._leafNode(new l(L,ve,X)),ve}const(L,z,X){return this._def(n.varKinds.const,L,z,X)}let(L,z,X){return this._def(n.varKinds.let,L,z,X)}var(L,z,X){return this._def(n.varKinds.var,L,z,X)}assign(L,z,X){return this._leafNode(new u(L,z,X))}add(L,z){return this._leafNode(new d(L,e.operators.ADD,z))}code(L){return typeof L=="function"?L():L!==t.nil&&this._leafNode(new g(L)),this}object(...L){const z=["{"];for(const[X,de]of L)z.length>1&&z.push(","),z.push(X),(X!==de||this.opts.es5)&&(z.push(":"),(0,t.addCodeArg)(z,de));return z.push("}"),new t._Code(z)}if(L,z,X){if(this._blockNode(new E(L)),z&&X)this.code(z).else().code(X).endIf();else if(z)this.code(z).endIf();else if(X)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(L){return this._elseNode(new E(L))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(E,b)}_for(L,z){return this._blockNode(L),z&&this.code(z).endFor(),this}for(L,z){return this._for(new T(L),z)}forRange(L,z,X,de,ve=this.opts.es5?n.varKinds.var:n.varKinds.let){const Ie=this._scope.toName(L);return this._for(new O(ve,Ie,z,X),()=>de(Ie))}forOf(L,z,X,de=n.varKinds.const){const ve=this._scope.toName(L);if(this.opts.es5){const Ie=z instanceof t.Name?z:this.var("_arr",z);return this.forRange("_i",0,(0,t._)`${Ie}.length`,Ae=>{this.var(ve,(0,t._)`${Ie}[${Ae}]`),X(ve)})}return this._for(new C("of",de,ve,z),()=>X(ve))}forIn(L,z,X,de=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(L,(0,t._)`Object.keys(${z})`,X);const ve=this._scope.toName(L);return this._for(new C("in",de,ve,z),()=>X(ve))}endFor(){return this._endBlockNode(R)}label(L){return this._leafNode(new f(L))}break(L){return this._leafNode(new m(L))}return(L){const z=new N;if(this._blockNode(z),this.code(L),z.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(L,z,X){if(!z&&!X)throw new Error('CodeGen: "try" without "catch" and "finally"');const de=new P;if(this._blockNode(de),this.code(L),z){const ve=this.name("e");this._currNode=de.catch=new $(ve),z(ve)}return X&&(this._currNode=de.finally=new K,this.code(X)),this._endBlockNode($,K)}throw(L){return this._leafNode(new p(L))}block(L,z){return this._blockStarts.push(this._nodes.length),L&&this.code(L).endBlock(z),this}endBlock(L){const z=this._blockStarts.pop();if(z===void 0)throw new Error("CodeGen: not in self-balancing block");const X=this._nodes.length-z;if(X<0||L!==void 0&&X!==L)throw new Error(`CodeGen: wrong number of nodes: ${X} vs ${L} expected`);return this._nodes.length=z,this}func(L,z=t.nil,X,de){return this._blockNode(new I(L,z,X)),de&&this.code(de).endFunc(),this}endFunc(){return this._endBlockNode(I)}optimize(L=1){for(;L-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(L){return this._currNode.nodes.push(L),this}_blockNode(L){this._currNode.nodes.push(L),this._nodes.push(L)}_endBlockNode(L,z){const X=this._currNode;if(X instanceof L||z&&X instanceof z)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${z?`${L.kind}/${z.kind}`:L.kind}"`)}_elseNode(L){const z=this._currNode;if(!(z instanceof E))throw new Error('CodeGen: "else" without "if"');return this._currNode=z.else=L,this}get _root(){return this._nodes[0]}get _currNode(){const L=this._nodes;return L[L.length-1]}set _currNode(L){const z=this._nodes;z[z.length-1]=L}}e.CodeGen=V;function G(F,L){for(const z in L)F[z]=(F[z]||0)+(L[z]||0);return F}function U(F,L){return L instanceof t._CodeOrName?G(F,L.names):F}function J(F,L,z){if(F instanceof t.Name)return X(F);if(!de(F))return F;return new t._Code(F._items.reduce((ve,Ie)=>(Ie instanceof t.Name&&(Ie=X(Ie)),Ie instanceof t._Code?ve.push(...Ie._items):ve.push(Ie),ve),[]));function X(ve){const Ie=z[ve.str];return Ie===void 0||L[ve.str]!==1?ve:(delete L[ve.str],Ie)}function de(ve){return ve instanceof t._Code&&ve._items.some(Ie=>Ie instanceof t.Name&&L[Ie.str]===1&&z[Ie.str]!==void 0)}}function le(F,L){for(const z in L)F[z]=(F[z]||0)-(L[z]||0)}function B(F){return typeof F=="boolean"||typeof F=="number"||F===null?!F:(0,t._)`!${q(F)}`}e.not=B;const W=M(e.operators.AND);function Y(...F){return F.reduce(W)}e.and=Y;const pe=M(e.operators.OR);function ae(...F){return F.reduce(pe)}e.or=ae;function M(F){return(L,z)=>L===t.nil?z:z===t.nil?L:(0,t._)`${q(L)} ${F} ${q(z)}`}function q(F){return F instanceof t.Name?F:(0,t._)`(${F})`}})(I0)),I0}var dt={},o2;function Pt(){if(o2)return dt;o2=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.checkStrictMode=dt.getErrorPath=dt.Type=dt.useFunc=dt.setEvaluated=dt.evaluatedPropsToName=dt.mergeEvaluated=dt.eachItem=dt.unescapeJsonPointer=dt.escapeJsonPointer=dt.escapeFragment=dt.unescapeFragment=dt.schemaRefOrVal=dt.schemaHasRulesButRef=dt.schemaHasRules=dt.checkUnknownRules=dt.alwaysValidSchema=dt.toHash=void 0;const e=pt(),t=lm();function n(C){const I={};for(const N of C)I[N]=!0;return I}dt.toHash=n;function r(C,I){return typeof I=="boolean"?I:Object.keys(I).length===0?!0:(a(C,I),!i(I,C.self.RULES.all))}dt.alwaysValidSchema=r;function a(C,I=C.schema){const{opts:N,self:P}=C;if(!N.strictSchema||typeof I=="boolean")return;const $=P.RULES.keywords;for(const K in I)$[K]||O(C,`unknown keyword: "${K}"`)}dt.checkUnknownRules=a;function i(C,I){if(typeof C=="boolean")return!C;for(const N in C)if(I[N])return!0;return!1}dt.schemaHasRules=i;function l(C,I){if(typeof C=="boolean")return!C;for(const N in C)if(N!=="$ref"&&I.all[N])return!0;return!1}dt.schemaHasRulesButRef=l;function u({topSchemaRef:C,schemaPath:I},N,P,$){if(!$){if(typeof N=="number"||typeof N=="boolean")return N;if(typeof N=="string")return(0,e._)`${N}`}return(0,e._)`${C}${I}${(0,e.getProperty)(P)}`}dt.schemaRefOrVal=u;function d(C){return p(decodeURIComponent(C))}dt.unescapeFragment=d;function f(C){return encodeURIComponent(m(C))}dt.escapeFragment=f;function m(C){return typeof C=="number"?`${C}`:C.replace(/~/g,"~0").replace(/\//g,"~1")}dt.escapeJsonPointer=m;function p(C){return C.replace(/~1/g,"/").replace(/~0/g,"~")}dt.unescapeJsonPointer=p;function g(C,I){if(Array.isArray(C))for(const N of C)I(N);else I(C)}dt.eachItem=g;function y({mergeNames:C,mergeToName:I,mergeValues:N,resultToName:P}){return($,K,V,G)=>{const U=V===void 0?K:V instanceof e.Name?(K instanceof e.Name?C($,K,V):I($,K,V),V):K instanceof e.Name?(I($,V,K),K):N(K,V);return G===e.Name&&!(U instanceof e.Name)?P($,U):U}}dt.mergeEvaluated={props:y({mergeNames:(C,I,N)=>C.if((0,e._)`${N} !== true && ${I} !== undefined`,()=>{C.if((0,e._)`${I} === true`,()=>C.assign(N,!0),()=>C.assign(N,(0,e._)`${N} || {}`).code((0,e._)`Object.assign(${N}, ${I})`))}),mergeToName:(C,I,N)=>C.if((0,e._)`${N} !== true`,()=>{I===!0?C.assign(N,!0):(C.assign(N,(0,e._)`${N} || {}`),S(C,N,I))}),mergeValues:(C,I)=>C===!0?!0:{...C,...I},resultToName:w}),items:y({mergeNames:(C,I,N)=>C.if((0,e._)`${N} !== true && ${I} !== undefined`,()=>C.assign(N,(0,e._)`${I} === true ? true : ${N} > ${I} ? ${N} : ${I}`)),mergeToName:(C,I,N)=>C.if((0,e._)`${N} !== true`,()=>C.assign(N,I===!0?!0:(0,e._)`${N} > ${I} ? ${N} : ${I}`)),mergeValues:(C,I)=>C===!0?!0:Math.max(C,I),resultToName:(C,I)=>C.var("items",I)})};function w(C,I){if(I===!0)return C.var("props",!0);const N=C.var("props",(0,e._)`{}`);return I!==void 0&&S(C,N,I),N}dt.evaluatedPropsToName=w;function S(C,I,N){Object.keys(N).forEach(P=>C.assign((0,e._)`${I}${(0,e.getProperty)(P)}`,!0))}dt.setEvaluated=S;const b={};function E(C,I){return C.scopeValue("func",{ref:I,code:b[I.code]||(b[I.code]=new t._Code(I.code))})}dt.useFunc=E;var R;(function(C){C[C.Num=0]="Num",C[C.Str=1]="Str"})(R||(dt.Type=R={}));function T(C,I,N){if(C instanceof e.Name){const P=I===R.Num;return N?P?(0,e._)`"[" + ${C} + "]"`:(0,e._)`"['" + ${C} + "']"`:P?(0,e._)`"/" + ${C}`:(0,e._)`"/" + ${C}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return N?(0,e.getProperty)(C).toString():"/"+m(C)}dt.getErrorPath=T;function O(C,I,N=C.opts.strictSchema){if(N){if(I=`strict mode: ${I}`,N===!0)throw new Error(I);C.self.logger.warn(I)}}return dt.checkStrictMode=O,dt}var Oh={},a2;function Qs(){if(a2)return Oh;a2=1,Object.defineProperty(Oh,"__esModule",{value:!0});const e=pt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Oh.default=t,Oh}var s2;function ng(){return s2||(s2=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=pt(),n=Pt(),r=Qs();e.keywordError={message:({keyword:b})=>(0,t.str)`must pass "${b}" keyword validation`},e.keyword$DataError={message:({keyword:b,schemaType:E})=>E?(0,t.str)`"${b}" keyword must be ${E} ($data)`:(0,t.str)`"${b}" keyword is invalid ($data)`};function a(b,E=e.keywordError,R,T){const{it:O}=b,{gen:C,compositeRule:I,allErrors:N}=O,P=p(b,E,R);T??(I||N)?d(C,P):f(O,(0,t._)`[${P}]`)}e.reportError=a;function i(b,E=e.keywordError,R){const{it:T}=b,{gen:O,compositeRule:C,allErrors:I}=T,N=p(b,E,R);d(O,N),C||I||f(T,r.default.vErrors)}e.reportExtraError=i;function l(b,E){b.assign(r.default.errors,E),b.if((0,t._)`${r.default.vErrors} !== null`,()=>b.if(E,()=>b.assign((0,t._)`${r.default.vErrors}.length`,E),()=>b.assign(r.default.vErrors,null)))}e.resetErrorsCount=l;function u({gen:b,keyword:E,schemaValue:R,data:T,errsCount:O,it:C}){if(O===void 0)throw new Error("ajv implementation error");const I=b.name("err");b.forRange("i",O,r.default.errors,N=>{b.const(I,(0,t._)`${r.default.vErrors}[${N}]`),b.if((0,t._)`${I}.instancePath === undefined`,()=>b.assign((0,t._)`${I}.instancePath`,(0,t.strConcat)(r.default.instancePath,C.errorPath))),b.assign((0,t._)`${I}.schemaPath`,(0,t.str)`${C.errSchemaPath}/${E}`),C.opts.verbose&&(b.assign((0,t._)`${I}.schema`,R),b.assign((0,t._)`${I}.data`,T))})}e.extendErrors=u;function d(b,E){const R=b.const("err",E);b.if((0,t._)`${r.default.vErrors} === null`,()=>b.assign(r.default.vErrors,(0,t._)`[${R}]`),(0,t._)`${r.default.vErrors}.push(${R})`),b.code((0,t._)`${r.default.errors}++`)}function f(b,E){const{gen:R,validateName:T,schemaEnv:O}=b;O.$async?R.throw((0,t._)`new ${b.ValidationError}(${E})`):(R.assign((0,t._)`${T}.errors`,E),R.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(b,E,R){const{createErrors:T}=b.it;return T===!1?(0,t._)`{}`:g(b,E,R)}function g(b,E,R={}){const{gen:T,it:O}=b,C=[y(O,R),w(b,R)];return S(b,E,C),T.object(...C)}function y({errorPath:b},{instancePath:E}){const R=E?(0,t.str)`${b}${(0,n.getErrorPath)(E,n.Type.Str)}`:b;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,R)]}function w({keyword:b,it:{errSchemaPath:E}},{schemaPath:R,parentSchema:T}){let O=T?E:(0,t.str)`${E}/${b}`;return R&&(O=(0,t.str)`${O}${(0,n.getErrorPath)(R,n.Type.Str)}`),[m.schemaPath,O]}function S(b,{params:E,message:R},T){const{keyword:O,data:C,schemaValue:I,it:N}=b,{opts:P,propertyName:$,topSchemaRef:K,schemaPath:V}=N;T.push([m.keyword,O],[m.params,typeof E=="function"?E(b):E||(0,t._)`{}`]),P.messages&&T.push([m.message,typeof R=="function"?R(b):R]),P.verbose&&T.push([m.schema,I],[m.parentSchema,(0,t._)`${K}${V}`],[r.default.data,C]),$&&T.push([m.propertyName,$])}})(A0)),A0}var i2;function RJ(){if(i2)return _i;i2=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.boolOrEmptySchema=_i.topBoolOrEmptySchema=void 0;const e=ng(),t=pt(),n=Qs(),r={message:"boolean schema is false"};function a(u){const{gen:d,schema:f,validateName:m}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign((0,t._)`${m}.errors`,null),d.return(!0))}_i.topBoolOrEmptySchema=a;function i(u,d){const{gen:f,schema:m}=u;m===!1?(f.var(d,!1),l(u)):f.var(d,!0)}_i.boolOrEmptySchema=i;function l(u,d){const{gen:f,data:m}=u,p={gen:f,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(p,r,void 0,d)}return _i}var nr={},bi={},l2;function Q4(){if(l2)return bi;l2=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.getRules=bi.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(a){return typeof a=="string"&&t.has(a)}bi.isJSONType=n;function r(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return bi.getRules=r,bi}var $a={},c2;function X4(){if(c2)return $a;c2=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.shouldUseRule=$a.shouldUseGroup=$a.schemaHasRulesForType=void 0;function e({schema:r,self:a},i){const l=a.RULES.types[i];return l&&l!==!0&&t(r,l)}$a.schemaHasRulesForType=e;function t(r,a){return a.rules.some(i=>n(r,i))}$a.shouldUseGroup=t;function n(r,a){var i;return r[a.keyword]!==void 0||((i=a.definition.implements)===null||i===void 0?void 0:i.some(l=>r[l]!==void 0))}return $a.shouldUseRule=n,$a}var u2;function cm(){if(u2)return nr;u2=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.reportTypeError=nr.checkDataTypes=nr.checkDataType=nr.coerceAndCheckDataType=nr.getJSONTypes=nr.getSchemaTypes=nr.DataType=void 0;const e=Q4(),t=X4(),n=ng(),r=pt(),a=Pt();var i;(function(R){R[R.Correct=0]="Correct",R[R.Wrong=1]="Wrong"})(i||(nr.DataType=i={}));function l(R){const T=u(R.type);if(T.includes("null")){if(R.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!T.length&&R.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');R.nullable===!0&&T.push("null")}return T}nr.getSchemaTypes=l;function u(R){const T=Array.isArray(R)?R:R?[R]:[];if(T.every(e.isJSONType))return T;throw new Error("type must be JSONType or JSONType[]: "+T.join(","))}nr.getJSONTypes=u;function d(R,T){const{gen:O,data:C,opts:I}=R,N=m(T,I.coerceTypes),P=T.length>0&&!(N.length===0&&T.length===1&&(0,t.schemaHasRulesForType)(R,T[0]));if(P){const $=w(T,C,I.strictNumbers,i.Wrong);O.if($,()=>{N.length?p(R,T,N):b(R)})}return P}nr.coerceAndCheckDataType=d;const f=new Set(["string","number","integer","boolean","null"]);function m(R,T){return T?R.filter(O=>f.has(O)||T==="array"&&O==="array"):[]}function p(R,T,O){const{gen:C,data:I,opts:N}=R,P=C.let("dataType",(0,r._)`typeof ${I}`),$=C.let("coerced",(0,r._)`undefined`);N.coerceTypes==="array"&&C.if((0,r._)`${P} == 'object' && Array.isArray(${I}) && ${I}.length == 1`,()=>C.assign(I,(0,r._)`${I}[0]`).assign(P,(0,r._)`typeof ${I}`).if(w(T,I,N.strictNumbers),()=>C.assign($,I))),C.if((0,r._)`${$} !== undefined`);for(const V of O)(f.has(V)||V==="array"&&N.coerceTypes==="array")&&K(V);C.else(),b(R),C.endIf(),C.if((0,r._)`${$} !== undefined`,()=>{C.assign(I,$),g(R,$)});function K(V){switch(V){case"string":C.elseIf((0,r._)`${P} == "number" || ${P} == "boolean"`).assign($,(0,r._)`"" + ${I}`).elseIf((0,r._)`${I} === null`).assign($,(0,r._)`""`);return;case"number":C.elseIf((0,r._)`${P} == "boolean" || ${I} === null
165
165
  || (${P} == "string" && ${I} && ${I} == +${I})`).assign($,(0,r._)`+${I}`);return;case"integer":C.elseIf((0,r._)`${P} === "boolean" || ${I} === null
166
166
  || (${P} === "string" && ${I} && ${I} == +${I} && !(${I} % 1))`).assign($,(0,r._)`+${I}`);return;case"boolean":C.elseIf((0,r._)`${I} === "false" || ${I} === 0 || ${I} === null`).assign($,!1).elseIf((0,r._)`${I} === "true" || ${I} === 1`).assign($,!0);return;case"null":C.elseIf((0,r._)`${I} === "" || ${I} === 0 || ${I} === false`),C.assign($,null);return;case"array":C.elseIf((0,r._)`${P} === "string" || ${P} === "number"
@@ -171,4 +171,4 @@ ${r}
171
171
  `;break;case"id":u=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?r(parseInt(b,10)):n(new gC(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:E}));break;default:n(new gC(`Unknown field "${S.length>20?`${S.slice(0,20)}…`:S}"`,{type:"unknown-field",field:S,value:b,line:E}));break}}function y(){d.length>0&&t({id:u,event:f||void 0,data:d.endsWith(`
172
172
  `)?d.slice(0,-1):d}),u=void 0,d="",f=""}function w(S={}){i&&S.consume&&p(i),l=!0,u=void 0,d="",f="",i=""}return{feed:m,reset:w}}function zee(e){const t=[];let n="",r=0;for(;r<e.length;){const a=e.indexOf("\r",r),i=e.indexOf(`
173
173
  `,r);let l=-1;if(a!==-1&&i!==-1?l=Math.min(a,i):a!==-1?a===e.length-1?l=-1:l=a:i!==-1&&(l=i),l===-1){n=e.slice(r);break}else{const u=e.slice(r,l);t.push(u),r=l+1,e[r-1]==="\r"&&e[r]===`
174
- `&&r++}}return[t,n]}class vC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(yC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(yC(this),n)}}function Vee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function U_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(U_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${U_(e.cause)}`:e.message:`${e}`}function yC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var lP=e=>{throw TypeError(e)},K1=(e,t,n)=>t.has(e)||lP("Cannot "+n),yt=(e,t,n)=>(K1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?lP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ln=(e,t,n,r)=>(K1(e,t,"write to private field"),t.set(e,n),n),za=(e,t,n)=>(K1(e,t,"access private method"),n),$r,Ri,ql,Ep,um,Ku,Ql,Wu,ks,Hl,oc,Gl,Du,Lo,z_,V_,F_,_C,B_,q_,Lu,H_,G_;class Rp extends EventTarget{constructor(t,n){var r,a;super(),zn(this,Lo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,$r),zn(this,Ri),zn(this,ql),zn(this,Ep),zn(this,um),zn(this,Ku),zn(this,Ql),zn(this,Wu,null),zn(this,ks),zn(this,Hl),zn(this,oc,null),zn(this,Gl,null),zn(this,Du,null),zn(this,V_,async i=>{var l;yt(this,Hl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){za(this,Lo,Lu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?ln(this,ql,new URL(i.url)):ln(this,ql,void 0),f!==200){za(this,Lo,Lu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){za(this,Lo,Lu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,$r)===this.CLOSED)return;ln(this,$r,this.OPEN);const p=new Event("open");if((l=yt(this,Du))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){za(this,Lo,Lu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let w=!0;do{const{done:S,value:b}=await y.read();b&&yt(this,Hl).feed(g.decode(b,{stream:!S})),S&&(w=!1,yt(this,Hl).reset(),za(this,Lo,H_).call(this))}while(w)}),zn(this,F_,i=>{ln(this,ks,void 0),!(i.name==="AbortError"||i.type==="aborted")&&za(this,Lo,H_).call(this,U_(i))}),zn(this,B_,i=>{typeof i.id=="string"&&ln(this,Wu,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,ql)?yt(this,ql).origin:yt(this,Ri).origin,lastEventId:i.id||""});yt(this,Gl)&&(!i.event||i.event==="message")&&yt(this,Gl).call(this,l),this.dispatchEvent(l)}),zn(this,q_,i=>{ln(this,Ku,i)}),zn(this,G_,()=>{ln(this,Ql,void 0),yt(this,$r)===this.CONNECTING&&za(this,Lo,z_).call(this)});try{if(t instanceof URL)ln(this,Ri,t);else if(typeof t=="string")ln(this,Ri,new URL(t,Fee()));else throw new Error("Invalid URL")}catch{throw Vee("An invalid or illegal string was specified")}ln(this,Hl,iP({onEvent:yt(this,B_),onRetry:yt(this,q_)})),ln(this,$r,this.CONNECTING),ln(this,Ku,3e3),ln(this,um,(r=n?.fetch)!=null?r:globalThis.fetch),ln(this,Ep,(a=n?.withCredentials)!=null?a:!1),za(this,Lo,z_).call(this)}get readyState(){return yt(this,$r)}get url(){return yt(this,Ri).href}get withCredentials(){return yt(this,Ep)}get onerror(){return yt(this,oc)}set onerror(t){ln(this,oc,t)}get onmessage(){return yt(this,Gl)}set onmessage(t){ln(this,Gl,t)}get onopen(){return yt(this,Du)}set onopen(t){ln(this,Du,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Ql)&&clearTimeout(yt(this,Ql)),yt(this,$r)!==this.CLOSED&&(yt(this,ks)&&yt(this,ks).abort(),ln(this,$r,this.CLOSED),ln(this,ks,void 0))}}$r=new WeakMap,Ri=new WeakMap,ql=new WeakMap,Ep=new WeakMap,um=new WeakMap,Ku=new WeakMap,Ql=new WeakMap,Wu=new WeakMap,ks=new WeakMap,Hl=new WeakMap,oc=new WeakMap,Gl=new WeakMap,Du=new WeakMap,Lo=new WeakSet,z_=function(){ln(this,$r,this.CONNECTING),ln(this,ks,new AbortController),yt(this,um)(yt(this,Ri),za(this,Lo,_C).call(this)).then(yt(this,V_)).catch(yt(this,F_))},V_=new WeakMap,F_=new WeakMap,_C=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Wu)?{"Last-Event-ID":yt(this,Wu)}:void 0},cache:"no-store",signal:(e=yt(this,ks))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},B_=new WeakMap,q_=new WeakMap,Lu=function(e,t){var n;yt(this,$r)!==this.CLOSED&&ln(this,$r,this.CLOSED);const r=new vC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r)},H_=function(e,t){var n;if(yt(this,$r)===this.CLOSED)return;ln(this,$r,this.CONNECTING);const r=new vC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r),ln(this,Ql,setTimeout(yt(this,G_),yt(this,Ku)))},G_=new WeakMap,Rp.CONNECTING=0,Rp.OPEN=1,Rp.CLOSED=2;function Fee(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function dm(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function cP(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...dm(t.headers),...dm(r.headers)}:t.headers};return e(n,a)}:e}let W1;W1=globalThis.crypto;async function Bee(e){return(await W1).getRandomValues(new Uint8Array(e))}async function qee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Bee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function Hee(e){return await qee(e)}async function Gee(e){const t=await(await W1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Zee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await Hee(e),n=await Gee(t);return{code_verifier:t,code_challenge:n}}const rr=w7().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:dz.custom,message:"URL must be parseable",fatal:!0}),R$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Kee=ar({resource:D().url(),authorization_servers:Ee(rr).optional(),jwks_uri:D().url().optional(),scopes_supported:Ee(D()).optional(),bearer_methods_supported:Ee(D()).optional(),resource_signing_alg_values_supported:Ee(D()).optional(),resource_name:D().optional(),resource_documentation:D().optional(),resource_policy_uri:D().url().optional(),resource_tos_uri:D().url().optional(),tls_client_certificate_bound_access_tokens:nt().optional(),authorization_details_types_supported:Ee(D()).optional(),dpop_signing_alg_values_supported:Ee(D()).optional(),dpop_bound_access_tokens_required:nt().optional()}),uP=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:Ee(D()).optional(),response_types_supported:Ee(D()),response_modes_supported:Ee(D()).optional(),grant_types_supported:Ee(D()).optional(),token_endpoint_auth_methods_supported:Ee(D()).optional(),token_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:Ee(D()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),introspection_endpoint:D().optional(),introspection_endpoint_auth_methods_supported:Ee(D()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),code_challenge_methods_supported:Ee(D()).optional(),client_id_metadata_document_supported:nt().optional()}),Wee=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:Ee(D()).optional(),response_types_supported:Ee(D()),response_modes_supported:Ee(D()).optional(),grant_types_supported:Ee(D()).optional(),acr_values_supported:Ee(D()).optional(),subject_types_supported:Ee(D()),id_token_signing_alg_values_supported:Ee(D()),id_token_encryption_alg_values_supported:Ee(D()).optional(),id_token_encryption_enc_values_supported:Ee(D()).optional(),userinfo_signing_alg_values_supported:Ee(D()).optional(),userinfo_encryption_alg_values_supported:Ee(D()).optional(),userinfo_encryption_enc_values_supported:Ee(D()).optional(),request_object_signing_alg_values_supported:Ee(D()).optional(),request_object_encryption_alg_values_supported:Ee(D()).optional(),request_object_encryption_enc_values_supported:Ee(D()).optional(),token_endpoint_auth_methods_supported:Ee(D()).optional(),token_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),display_values_supported:Ee(D()).optional(),claim_types_supported:Ee(D()).optional(),claims_supported:Ee(D()).optional(),service_documentation:D().optional(),claims_locales_supported:Ee(D()).optional(),ui_locales_supported:Ee(D()).optional(),claims_parameter_supported:nt().optional(),request_parameter_supported:nt().optional(),request_uri_parameter_supported:nt().optional(),require_request_uri_registration:nt().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:nt().optional()}),Yee=ce({...Wee.shape,...uP.pick({code_challenge_methods_supported:!0}).shape}),Qee=ce({access_token:D(),id_token:D().optional(),token_type:D(),expires_in:tN().optional(),scope:D().optional(),refresh_token:D().optional()}).strip(),Xee=ce({error:D(),error_description:D().optional(),error_uri:D().optional()}),bC=rr.optional().or(je("").transform(()=>{})),Jee=ce({redirect_uris:Ee(rr),token_endpoint_auth_method:D().optional(),grant_types:Ee(D()).optional(),response_types:Ee(D()).optional(),client_name:D().optional(),client_uri:rr.optional(),logo_uri:bC,scope:D().optional(),contacts:Ee(D()).optional(),tos_uri:bC,policy_uri:D().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:D().optional(),software_version:D().optional(),software_statement:D().optional()}).strip(),ete=ce({client_id:D(),client_secret:D().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),tte=Jee.merge(ete);ce({error:D(),error_description:D().optional()}).strip();ce({token:D(),token_type_hint:D().optional()}).strip();function nte(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function rte({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Wn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class Z_ extends Wn{}Z_.errorCode="invalid_request";class fm extends Wn{}fm.errorCode="invalid_client";class hm extends Wn{}hm.errorCode="invalid_grant";class pm extends Wn{}pm.errorCode="unauthorized_client";class K_ extends Wn{}K_.errorCode="unsupported_grant_type";class W_ extends Wn{}W_.errorCode="invalid_scope";class Y_ extends Wn{}Y_.errorCode="access_denied";class fc extends Wn{}fc.errorCode="server_error";class Q_ extends Wn{}Q_.errorCode="temporarily_unavailable";class X_ extends Wn{}X_.errorCode="unsupported_response_type";class J_ extends Wn{}J_.errorCode="unsupported_token_type";class eb extends Wn{}eb.errorCode="invalid_token";class tb extends Wn{}tb.errorCode="method_not_allowed";class nb extends Wn{}nb.errorCode="too_many_requests";class mm extends Wn{}mm.errorCode="invalid_client_metadata";class rb extends Wn{}rb.errorCode="insufficient_scope";class ob extends Wn{}ob.errorCode="invalid_target";const ote={[Z_.errorCode]:Z_,[fm.errorCode]:fm,[hm.errorCode]:hm,[pm.errorCode]:pm,[K_.errorCode]:K_,[W_.errorCode]:W_,[Y_.errorCode]:Y_,[fc.errorCode]:fc,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[J_.errorCode]:J_,[eb.errorCode]:eb,[tb.errorCode]:tb,[nb.errorCode]:nb,[mm.errorCode]:mm,[rb.errorCode]:rb,[ob.errorCode]:ob};class $o extends Error{constructor(t){super(t??"Unauthorized")}}function ate(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const V0="code",F0="S256";function ste(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&ate(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ite(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":lte(a,i,n);return;case"client_secret_post":cte(a,i,r);return;case"none":ute(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function lte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function cte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function ute(e,t){t.set("client_id",e)}async function dP(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=Xee.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=ote[a]||fc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new fc(a)}}async function Ci(e,t){try{return await B0(e,t)}catch(n){if(n instanceof fm||n instanceof pm)return await e.invalidateCredentials?.("all"),await B0(e,t);if(n instanceof hm)return await e.invalidateCredentials?.("tokens"),await B0(e,t);throw n}}async function B0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await hte(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await fte(t,e,l),f=await yte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const b=f?.client_id_metadata_document_supported===!0,E=e.clientMetadataUrl;if(E&&!dte(E))throw new mm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${E}`);if(b&&E)m={client_id:E},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await Ste(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const b=await wte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const b=await bte(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}catch(b){if(!(!(b instanceof Wn)||b instanceof fc))throw b}const y=e.state?await e.state():void 0,{authorizationUrl:w,codeVerifier:S}=await _te(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(S),await e.redirectToAuthorization(w),"REDIRECT"}function dte(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function fte(e,t,n){const r=nte(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!rte({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function gm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=q0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=q0(e,"scope")||void 0,u=q0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function q0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function hte(e,t,n=fetch){const r=await gte(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Kee.parse(await r.json())}async function Y1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?Y1(e,void 0,n):void 0;throw r}}function pte(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function wC(e,t,n=fetch){return await Y1(e,{"MCP-Protocol-Version":t},n)}function mte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function gte(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Xm;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=pte(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await wC(l,i,n);if(!r?.metadataUrl&&mte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await wC(d,i,n)}return u}function vte(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function yte(e,{fetchFn:t=fetch,protocolVersion:n=Xm}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=vte(e);for(const{url:i,type:l}of a){const u=await Y1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?uP.parse(await u.json()):Yee.parse(await u.json())}}}async function _te(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes(V0))throw new Error(`Incompatible auth server: does not support response type ${V0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(F0))throw new Error(`Incompatible auth server: does not support code challenge method ${F0}`)}else u=new URL("/authorize",e);const d=await Zee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",V0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",F0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function fP(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Q1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=ste(r,m);ite(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await dP(f);return Qee.parse(await f.json())}async function poe(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=fP(r,a,i);return Q1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function bte(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Q1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function wte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=fP(a,f,e.redirectUrl)}const d=await e.clientInformation();return Q1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function Ste(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await dP(i);return tte.parse(await i.json())}class Ete extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class Rte{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=dm(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new Rp(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=gm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new Ete(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=Zu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=gm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const xte="mcp";class Tte{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,xte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=Zu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class Ote extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=iP({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const Cte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Vl extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}let Ate=class{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??Cte}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=dm(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Vl(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new Ote({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:w}=await m.read();if(w)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const S=Zu.parse(JSON.parse(y.data));Pu(S)&&(d=!0,i!==void 0&&(S.id=i)),this.onmessage?.(S)}catch(S){this.onerror?.(S)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:$_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Vl(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:w}=gm(u);if(this._resourceMetadataUrl=y,this._scope=w,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:w,error:S}=gm(u);if(S==="insufficient_scope"){const b=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===b)throw new Vl(403,"Server returned 403 after trying upscoping");if(w&&(this._scope=w),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=b??void 0,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $o;return this.send(t)}}throw new Vl(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),aX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(w=>Zu.parse(w)):[Zu.parse(g)];for(const w of y)this.onmessage?.(w)}else throw await u.body?.cancel(),new Vl(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new Vl(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}};class Ite extends Ate{constructor(t,n){super(t,n)}send(t,n){const r=Nte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Nte(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class kte extends sP{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},q1,n)}}const Mte=async(e,t,n)=>{const r=Pte(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new kte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const d=new Headers(n);d.has("Authorization")||d.set("Authorization",`Bearer ${e.connection.token}`);for(const[p,g]of Object.entries(e.connection.headers??{}))d.set(p,g);const f=new URL(e.connection.url),m=f.pathname.replace(/\/+$/,"")||"/";return f.pathname=`${m}/call-tool/${encodeURIComponent(i)}`,fetch(f.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:d,signal:u})}}},Pte=(e,t,n)=>{if(e.type==="Websocket")return new Tte(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new Rte(new URL(e.url),i)}return new Ite(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},SC=e=>{try{return JSON.parse(e)}catch{return e}},dp=new Map,EC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?pr(e.inputSchema):void 0,outputSchema:e.outputSchema?pr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Dte(e){const t=n=>"connection"in e?Mte({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:w,isError:S,content:b}=await g.callTool({name:String(f),arguments:d});if(S){const R=b?.[0]?.text,T=typeof R=="string"?SC(R):null,O=T?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(T.code,T.message,T.traceId):null;throw O||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(w??b)}`)}if(w!==void 0)return w;const E=b?.[0]?.text;return typeof E=="string"?SC(E):void 0}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return dp.has(f)||dp.set(f,i()),await dp.get(f)}catch(m){console.error("Failed to list tools",m),dp.delete(f);return}}async function u(){return(await l()??[]).map(f=>EC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return EC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>Lte({connection:n}):global[t]}});function Lte(e){return Dte(e)}const jte=ce({id:D().describe("Unique identifier for the entity"),title:D().describe("Human-readable title for the entity"),description:D().nullish().describe("Description of the entity"),created_at:D().datetime(),updated_at:D().datetime(),created_by:D().optional(),updated_by:D().optional()}),$te=ce({field:Ee(D()),operator:$t(["eq","gt","gte","lt","lte","in","like","contains"]),value:_t()}),hP=ua(()=>Lt([$te,ce({operator:$t(["and","or","not"]),conditions:Ee(hP)})])),Ute=ce({field:Ee(D()),direction:$t(["asc","desc"]),nulls:$t(["first","last"]).optional()}),zte=ce({where:hP.optional().describe("Filter expression"),orderBy:Ee(Ute).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Vte(e){return ce({items:Ee(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:nt().optional().describe("Whether there are more items available")})}const Fte=ce({id:D().describe("ID of the entity to retrieve")});function Bte(e){return ce({item:e.nullable().describe("The retrieved item, or null if not found")})}function qte(e){return ce({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Hte(e){return ce({item:e.describe("The created entity with generated id")})}function Gte(e){return ce({id:D().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Zte(e){return ce({item:e.describe("The updated entity")})}const Kte=ce({id:D().describe("ID of the entity to delete")});function Wte(e){return ce({item:e.describe("The deleted entity")})}function Yte(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:zte,outputSchema:Vte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Fte,outputSchema:Bte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:qte(t),outputSchema:Hte(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:Gte(t),outputSchema:Zte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Kte,outputSchema:Wte(t),opt:!0}),i}const Qte=ce({id:D(),name:D(),description:D().optional(),inputSchema:Et(D(),_t()),outputSchema:Et(D(),_t()).optional()}),Xte=jte.extend({_meta:ce({"io.decocms":ce({id:D(),verified:nt(),scopeName:D(),appName:D(),friendlyName:D().nullable().optional(),metadata:Et(D(),_t()).nullable().optional(),publishedAt:D().datetime().optional(),updatedAt:D().datetime().optional(),tools:Ee(Qte).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:ce({$schema:D().optional(),_meta:Et(D(),_t()).optional(),name:D().describe("The server name (scope/app)"),title:D().optional().describe("User-friendly title"),description:D().optional().describe("Server description"),icons:Ee(ce({src:D(),mimeType:D().optional(),sizes:Ee(D()).optional(),theme:$t(["light","dark"]).optional()})).optional(),remotes:Ee(ce({type:$t(["http","stdio","sse"]),url:D().optional(),headers:Ee(_t()).optional()})).optional(),packages:Ee(_t()).optional(),repository:ce({url:D(),source:D().optional(),subfolder:D().optional()}).optional(),version:D().optional(),websiteUrl:D().optional()})});Yte("registry_app",Xte,{readOnly:!0});const Jte=ce({specversion:je("1.0").describe("CloudEvents specification version"),id:D().describe("Unique identifier for this event (UUID recommended)"),source:D().describe("Connection ID of the event publisher"),type:D().describe("Event type (e.g., 'order.created', 'user.signup')"),time:D().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:D().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:D().optional().default("application/json").describe("Content type of the data attribute"),dataschema:D().url().optional().describe("URI to the schema for the data attribute"),data:_t().optional().describe("Event payload (any JSON value)")});ce({events:Ee(Jte).min(1).describe("Batch of CloudEvents to process")});const ene=ce({success:nt().optional().describe("Whether this event was processed successfully"),error:D().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});ce({success:nt().optional().describe("Batch success - applies to events not in results"),error:D().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Et(D(),ene).optional().describe("Per-event results keyed by event ID")});ce({type:D().min(1).max(255).describe("Event type identifier"),subject:D().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:_t().optional().describe("Event payload"),deliverAt:D().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:D().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});ce({id:D().describe("Unique event ID"),type:D().describe("Event type"),source:D().describe("Source connection ID"),time:D().describe("Event timestamp")});ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")});ce({subscription:ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:nt().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")})});const tne=ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")}),nne=ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:nt().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")});ce({subscriptions:Ee(tne).describe("Desired subscriptions - system will create/update/delete to match")});ce({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:Ee(nne).describe("Current subscriptions after sync")});ce({subscriptionId:D().describe("Subscription ID to remove")});ce({success:nt().describe("Whether unsubscribe was successful"),subscriptionId:D().describe("Subscription ID that was removed")});ce({eventId:D().describe("Event ID to cancel")});ce({success:nt().describe("Whether cancellation was successful"),eventId:D().describe("Event ID that was cancelled")});ce({eventId:D().describe("Event ID to acknowledge")});ce({success:nt().describe("Whether ACK was successful"),eventId:D().describe("Event ID that was acknowledged")});const rne=ce({prefix:D().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:D().optional().describe("Token for pagination from previous response"),delimiter:D().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),one=ce({objects:Ee(ce({key:D().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object")})),nextContinuationToken:D().optional().describe("Token for fetching next page of results"),isTruncated:nt().describe("Whether there are more results available"),commonPrefixes:Ee(D()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),ane=ce({key:D().describe("Object key/path to get metadata for")}),sne=ce({contentType:D().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object"),metadata:Et(D(),D()).optional().describe("Custom metadata key-value pairs")}),ine=ce({key:D().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),lne=ce({url:D().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),cne=ce({key:D().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:D().optional().describe("MIME type for the object being uploaded")}),une=ce({url:D().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),dne=ce({key:D().describe("Object key/path to delete")}),fne=ce({success:nt().describe("Whether the deletion was successful"),key:D().describe("The key that was deleted")}),hne=ce({keys:Ee(D()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),pne=ce({deleted:Ee(D()).describe("Array of successfully deleted keys"),errors:Ee(ce({key:D(),message:D()})).describe("Array of errors for failed deletions")}),mne=[{name:"LIST_OBJECTS",inputSchema:rne,outputSchema:one},{name:"GET_OBJECT_METADATA",inputSchema:ane,outputSchema:sne},{name:"GET_PRESIGNED_URL",inputSchema:ine,outputSchema:lne},{name:"PUT_PRESIGNED_URL",inputSchema:cne,outputSchema:une},{name:"DELETE_OBJECT",inputSchema:dne,outputSchema:fne},{name:"DELETE_OBJECTS",inputSchema:hne,outputSchema:pne}],pP=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));pP.displayName="Folder";function RC(e,t,n,r){return e?e.startsWith("/")?`/${t}/${n}/${r}${e}`:e:`/${t}/${n}/${r}`}function gne(e){return{createRoutes:e,useParams:t=>Xl({strict:!1}),useSearch:t=>Om({strict:!1}),useNavigate:()=>{const t=vc(),{org:n,project:r,pluginId:a}=Xl({strict:!1});return i=>{const l=RC(i.to,n,r,a);return t({...i,to:l,params:{org:n,project:r,pluginId:a,...i.params}})}},useLocation:()=>pL(),Link:function(n){const{org:r,project:a,pluginId:i}=Xl({strict:!1}),l=RC(n.to,r,a,i);return x.jsx(Am,{...n,to:l,params:{org:r,project:a,pluginId:i,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}const mP=A.createContext(null);function goe(e){const t=Ui.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(mP.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function voe(e){const t=A.useContext(mP);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}var Mt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Mt||(Mt={}));var xC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xC||(xC={}));const Ve=Mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Is=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Ne=Mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ha extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof Ha))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ha.create=e=>new Ha(e);const ab=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Mt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mt.assertNever(e)}return{message:n}};let vne=ab;function yne(){return vne}const _ne=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=yne(),r=_ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ab?void 0:ab].filter(a=>!!a)});e.common.issues.push(r)}class ro{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return tt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return ro.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const tt=Object.freeze({status:"aborted"}),ju=e=>({status:"dirty",value:e}),Oo=e=>({status:"valid",value:e}),TC=e=>e.status==="aborted",OC=e=>e.status==="dirty",hc=e=>e.status==="valid",vm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class Hs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const CC=(e,t)=>{if(hc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ha(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Ot{get description(){return this._def.description}_getType(t){return Is(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ro,ctx:{common:t.parent.common,data:t.data,parsedType:Is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)},a=this._parseSync({data:t,path:r.path,parent:r});return CC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return hc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>hc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(vm(a)?a:Promise.resolve(a));return CC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new mc({schema:this,typeName:rt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return zs.create(this,this._def)}nullable(){return gc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ia.create(this)}promise(){return wm.create(this,this._def)}or(t){return _m.create([this,t],this._def)}and(t){return bm.create(this,t,this._def)}transform(t){return new mc({...mt(this._def),schema:this,typeName:rt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new lb({...mt(this._def),innerType:this,defaultValue:n,typeName:rt.ZodDefault})}brand(){return new Fne({typeName:rt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new cb({...mt(this._def),innerType:this,catchValue:n,typeName:rt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return X1.create(this,t)}readonly(){return ub.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const bne=/^c[^\s-]{8,}$/i,wne=/^[0-9a-z]+$/,Sne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ene=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rne=/^[a-z0-9_-]{21}$/i,xne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,One=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let H0;const Ane=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ine=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Nne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,kne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dne=new RegExp(`^${gP}$`);function vP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Lne(e){return new RegExp(`^${vP(e)}$`)}function jne(e){let t=`${gP}T${vP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $ne(e,t){return!!((t==="v4"||!t)&&Ane.test(e)||(t==="v6"||!t)&&Nne.test(e))}function Une(e,t){if(!xne.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function zne(e,t){return!!((t==="v4"||!t)&&Ine.test(e)||(t==="v6"||!t)&&kne.test(e))}class Ps extends Ot{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.string,received:i.parsedType}),tt}const r=new ro;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")H0||(H0=new RegExp(Cne,"u")),H0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Ene.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Rne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")bne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")wne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Sne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?jne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Dne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Lne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Tne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?$ne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Une(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?zne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Mne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Pne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ps.create=e=>new Ps({checks:[],typeName:rt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Vne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class fd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.number,received:i.parsedType}),tt}let r;const a=new ro;for(const i of this._def.checks)i.kind==="int"?Mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Vne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new fd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new fd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fd.create=e=>new fd({checks:[],typeName:rt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class hd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const a=new ro;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.bigint,received:n.parsedType}),tt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new hd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new hd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}hd.create=e=>new hd({checks:[],typeName:rt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class sb extends Ot{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.boolean,received:r.parsedType}),tt}return Oo(t.data)}}sb.create=e=>new sb({typeName:rt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class ym extends Ot{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.date,received:i.parsedType}),tt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),tt}const r=new ro;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ym({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ym.create=e=>new ym({checks:[],coerce:e?.coerce||!1,typeName:rt.ZodDate,...mt(e)});class AC extends Ot{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.symbol,received:r.parsedType}),tt}return Oo(t.data)}}AC.create=e=>new AC({typeName:rt.ZodSymbol,...mt(e)});class IC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.undefined,received:r.parsedType}),tt}return Oo(t.data)}}IC.create=e=>new IC({typeName:rt.ZodUndefined,...mt(e)});class NC extends Ot{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.null,received:r.parsedType}),tt}return Oo(t.data)}}NC.create=e=>new NC({typeName:rt.ZodNull,...mt(e)});class kC extends Ot{constructor(){super(...arguments),this._any=!0}_parse(t){return Oo(t.data)}}kC.create=e=>new kC({typeName:rt.ZodAny,...mt(e)});class MC extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Oo(t.data)}}MC.create=e=>new MC({typeName:rt.ZodUnknown,...mt(e)});class Gs extends Ot{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.never,received:n.parsedType}),tt}}Gs.create=e=>new Gs({typeName:rt.ZodNever,...mt(e)});class PC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.void,received:r.parsedType}),tt}return Oo(t.data)}}PC.create=e=>new PC({typeName:rt.ZodVoid,...mt(e)});class ia extends Ot{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ve.array)return De(n,{code:Ne.invalid_type,expected:Ve.array,received:n.parsedType}),tt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new Hs(n,l,n.path,u)))).then(l=>ro.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new Hs(n,l,n.path,u)));return ro.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ia({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new ia({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new ia({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}ia.create=(e,t)=>new ia({type:e,minLength:null,maxLength:null,exactLength:null,typeName:rt.ZodArray,...mt(t)});function Zl(e){if(e instanceof Pn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zs.create(Zl(r))}return new Pn({...e._def,shape:()=>t})}else return e instanceof ia?new ia({...e._def,type:Zl(e.element)}):e instanceof zs?zs.create(Zl(e.unwrap())):e instanceof gc?gc.create(Zl(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>Zl(t))):e}class Pn extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Mt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Ve.object,received:f.parsedType}),tt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Gs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new Hs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Gs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new Hs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>ro.mergeObjectSync(r,f)):ro.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Pn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Pn({...this._def,unknownKeys:"strip"})}passthrough(){return new Pn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:rt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Pn({...this._def,catchall:t})}pick(t){const n={};for(const r of Mt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Mt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(t){const n={};for(const r of Mt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Pn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Mt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof zs;)i=i._def.innerType;n[r]=i}return new Pn({...this._def,shape:()=>n})}keyof(){return yP(Mt.objectKeys(this.shape))}}Pn.create=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strip",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});Pn.strictCreate=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strict",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});Pn.lazycreate=(e,t)=>new Pn({shape:e,unknownKeys:"strip",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});class _m extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new Ha(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new Ha(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),tt}}get options(){return this._def.options}}_m.create=(e,t)=>new _m({options:e,typeName:rt.ZodUnion,...mt(t)});function ib(e,t){const n=Is(e),r=Is(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const a=Mt.objectKeys(t),i=Mt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=ib(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=ib(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bm extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(TC(i)||TC(l))return tt;const u=ib(i.value,l.value);return u.valid?((OC(i)||OC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bm.create=(e,t,n)=>new bm({left:e,right:t,typeName:rt.ZodIntersection,...mt(n)});class $i extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return De(r,{code:Ne.invalid_type,expected:Ve.array,received:r.parsedType}),tt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new Hs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>ro.mergeArray(n,l)):ro.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:rt.ZodTuple,rest:null,...mt(t)})};class DC extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return De(r,{code:Ne.invalid_type,expected:Ve.map,received:r.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new Hs(r,u,r.path,[f,"key"])),value:i._parse(new Hs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}DC.create=(e,t,n)=>new DC({valueType:t,keyType:e,typeName:rt.ZodMap,...mt(n)});class pd extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return De(r,{code:Ne.invalid_type,expected:Ve.set,received:r.parsedType}),tt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return tt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new Hs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new pd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new pd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}pd.create=(e,t)=>new pd({valueType:e,minSize:null,maxSize:null,typeName:rt.ZodSet,...mt(t)});class LC extends Ot{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}LC.create=(e,t)=>new LC({getter:e,typeName:rt.ZodLazy,...mt(t)});class jC extends Ot{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}jC.create=(e,t)=>new jC({value:e,typeName:rt.ZodLiteral,...mt(t)});function yP(e,t){return new pc({values:e,typeName:rt.ZodEnum,...mt(t)})}class pc extends Ot{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Mt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),tt}return Oo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return pc.create(t,{...this._def,...n})}exclude(t,n=this._def){return pc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}pc.create=yP;class $C extends Ot{_parse(t){const n=Mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const a=Mt.objectValues(n);return De(r,{expected:Mt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(Mt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Mt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),tt}return Oo(t.data)}get enum(){return this._def.values}}$C.create=(e,t)=>new $C({values:e,typeName:rt.ZodNativeEnum,...mt(t)});class wm extends Ot{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Ve.promise,received:n.parsedType}),tt;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Oo(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wm.create=(e,t)=>new wm({type:e,typeName:rt.ZodPromise,...mt(t)});class mc extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?ju(d.value):d});{if(n.value==="aborted")return tt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?tt:u.status==="dirty"||n.value==="dirty"?ju(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!hc(l))return tt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>hc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):tt);Mt.assertNever(a)}}mc.create=(e,t,n)=>new mc({schema:e,typeName:rt.ZodEffects,effect:t,...mt(n)});mc.createWithPreprocess=(e,t,n)=>new mc({schema:t,effect:{type:"preprocess",transform:e},typeName:rt.ZodEffects,...mt(n)});class zs extends Ot{_parse(t){return this._getType(t)===Ve.undefined?Oo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zs.create=(e,t)=>new zs({innerType:e,typeName:rt.ZodOptional,...mt(t)});class gc extends Ot{_parse(t){return this._getType(t)===Ve.null?Oo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:rt.ZodNullable,...mt(t)});class lb extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}lb.create=(e,t)=>new lb({innerType:e,typeName:rt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class cb extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}cb.create=(e,t)=>new cb({innerType:e,typeName:rt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class UC extends Ot{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.nan,received:r.parsedType}),tt}return{status:"valid",value:t.data}}}UC.create=e=>new UC({typeName:rt.ZodNaN,...mt(e)});class Fne extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class X1 extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),ju(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new X1({in:t,out:n,typeName:rt.ZodPipeline})}}class ub extends Ot{_parse(t){const n=this._def.innerType._parse(t),r=a=>(hc(a)&&(a.value=Object.freeze(a.value)),a);return vm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}ub.create=(e,t)=>new ub({innerType:e,typeName:rt.ZodReadonly,...mt(t)});var rt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(rt||(rt={}));const Bne=Ps.create,qne=sb.create;Gs.create;ia.create;const Hne=Pn.create;_m.create;bm.create;$i.create;const Gne=pc.create;wm.create;zs.create;gc.create;const Zne=Hne({path:Bne().optional().default(""),flat:qne().optional().default(!1),view:Gne(["table","grid"]).optional().default("grid")}),Kne=gne(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>Jt(()=>import("./file-browser-CHtfSNHu.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),validateSearch:Zne})]}),Wne=A.lazy(()=>Jt(()=>import("./plugin-header-DoQQAOys.js"),__vite__mapDeps([18,6,19]))),Yne=A.lazy(()=>Jt(()=>import("./plugin-empty-state-Bnssy2Oj.js"),[])),Qne={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:mne,renderHeader:e=>x.jsx(Wne,{...e}),renderEmptyState:()=>x.jsx(Yne,{}),setup:e=>{const{registerSidebarGroup:t,registerPluginRoutes:n}=e;t({id:"object-storage",label:"Object Storage",items:[{icon:x.jsx(pP,{size:16}),label:"File browser"}],defaultExpanded:!0});const r=Kne.createRoutes(e);n(r)}},Xne="user-sandbox",Jne="Create embeddable integration flows for platform end-users";var ere=(e,t,n,r,a,i,l,u)=>{let d=document.documentElement,f=["light","dark"];function m(y){(Array.isArray(e)?e:[e]).forEach(w=>{let S=w==="class",b=S&&i?a.map(E=>i[E]||E):a;S?(d.classList.remove(...b),d.classList.add(i&&i[y]?i[y]:y)):d.setAttribute(w,y)}),p(y)}function p(y){u&&f.includes(y)&&(d.style.colorScheme=y)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let y=localStorage.getItem(t)||n,w=l&&y==="system"?g():y;m(w)}catch{}},tre=A.createContext(void 0),nre={setTheme:e=>{},themes:[]},yoe=()=>{var e;return(e=A.useContext(tre))!=null?e:nre};A.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:f})=>{let m=JSON.stringify([n,t,i,e,u,l,r,a]).slice(1,-1);return A.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${ere.toString()})(${m})`}})});const Sm="org-admin",rre={from({org:e,project:t}){if(e?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}},isOrgAdminProject(e){return e.split("/")[1]===Sm},adminProject(e){return`${e}/${Sm}`}},_P=A.createContext(void 0),_oe=()=>{const e=A.useContext(_P);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},boe=e=>{const t=Ui.c(10),{children:n,org:r,project:a}=e;let i;t[0]!==r.slug||t[1]!==a.slug?(i=rre.from({org:r.slug,project:a.slug}),t[0]=r.slug,t[1]=a.slug,t[2]=i):i=t[2];const l=i;let u;t[3]!==l||t[4]!==r||t[5]!==a?(u={org:r,project:a,locator:l},t[3]=l,t[4]=r,t[5]=a,t[6]=u):u=t[6];const d=u;let f;return t[7]!==n||t[8]!==d?(f=x.jsx(_P.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},ore=ce({authorizationEndpoint:D().url(),tokenEndpoint:D().url(),introspectionEndpoint:D().url().optional(),clientId:D(),clientSecret:D().optional(),scopes:Ee(D()),grantType:$t(["authorization_code","client_credentials"])}),are=ce({title:D().optional(),readOnlyHint:nt().optional(),destructiveHint:nt().optional(),idempotentHint:nt().optional(),openWorldHint:nt().optional()}),sre=ce({name:D(),description:D().optional(),inputSchema:Et(D(),_t()),outputSchema:Et(D(),_t()).optional(),annotations:are.optional(),_meta:Et(D(),_t()).optional()}),ire=ce({headers:Et(D(),D()).optional()}),lre=ce({command:D().describe("Command to run (e.g., 'npx', 'node')"),args:Ee(D()).optional().describe("Command arguments"),cwd:D().optional().describe("Working directory"),envVars:Et(D(),D()).optional().describe("Environment variables (encrypted in storage)")}),bP=ce({id:D().describe("Unique identifier for the connection"),title:D().describe("Human-readable name for the connection"),created_at:D().describe("When the connection was created"),updated_at:D().describe("When the connection was last updated"),created_by:D().describe("User ID who created the connection"),updated_by:D().optional().describe("User ID who last updated the connection"),organization_id:D().describe("Organization ID this connection belongs to"),description:D().nullable().describe("Description of the connection"),icon:D().nullable().describe("Icon URL for the connection"),app_name:D().nullable().describe("Associated app name"),app_id:D().nullable().describe("Associated app ID"),connection_type:$t(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:D().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:D().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:Lt([lre,ire]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:ore.nullable().describe("OAuth configuration"),configuration_state:Et(D(),_t()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Ee(D()).nullable().optional().describe("Configuration scopes"),metadata:Et(D(),_t()).nullable().describe("Additional metadata (includes repository info)"),tools:Ee(sre).nullable().describe("Discovered tools from MCP"),bindings:Ee(D()).nullable().describe("Detected bindings"),status:$t(["active","inactive","error"]).describe("Current status")});bP.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});bP.partial();function woe(e){return e!=null&&"command"in e}function Soe(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const $u=ce({connection_id:D().describe("Connection ID"),selected_tools:Ee(D()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Ee(D()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Ee(D()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),wP=$u.extend({selected_tools:$u.shape.selected_tools.optional(),selected_resources:$u.shape.selected_resources.optional(),selected_prompts:$u.shape.selected_prompts.optional()}),Eoe=ce({id:D().describe("Unique identifier for the virtual MCP"),title:D().describe("Human-readable name for the virtual MCP"),description:D().nullable().describe("Description of the virtual MCP"),icon:D().nullable().describe("Icon URL for the virtual MCP"),created_at:D().describe("When the virtual MCP was created"),updated_at:D().describe("When the virtual MCP was last updated"),created_by:D().describe("User ID who created the virtual MCP"),updated_by:D().optional().describe("User ID who last updated the virtual MCP"),organization_id:D().describe("Organization ID this virtual MCP belongs to"),status:$t(["active","inactive"]).describe("Current status"),metadata:ce({instructions:D().nullable().describe("MCP server instructions")}).loose().describe("Additional metadata including MCP server instructions"),connections:Ee($u).describe("Connections with their selected tools, resources, and prompts")});ce({title:D().min(1).max(255).describe("Name for the virtual MCP"),description:D().nullable().optional().describe("Optional description"),icon:D().nullable().optional().describe("Optional icon URL"),status:$t(["active","inactive"]).optional().default("active").describe("Initial status"),metadata:ce({instructions:D().nullable().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Ee(wP).describe("Connections to include/exclude (can be empty for exclusion mode)")});ce({title:D().min(1).max(255).optional().describe("New name"),description:D().nullable().optional().describe("New description (null to clear)"),icon:D().nullable().optional().describe("New icon URL (null to clear)"),status:$t(["active","inactive"]).optional().describe("New status"),metadata:ce({instructions:D().nullable().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Ee(wP).optional().describe("New connections (replaces existing)")});var zC;(function(e){e.Completable="McpCompletable"})(zC||(zC={}));const cre=[],ure={id:Xne,description:Jne,binding:cre},dre=[Qne,ure],qi=tL({component:()=>x.jsx(rQ,{children:x.jsx(A.Suspense,{fallback:x.jsx(S4,{}),children:x.jsx(wA,{})})})}),fre=en({getParentRoute:()=>qi,path:"/login",component:un(()=>Jt(()=>import("./login-BpnfmGBt.js"),__vite__mapDeps([20,17,3,4,21]))),validateSearch:ua(()=>ce({next:D().optional(),client_id:D().optional(),redirect_uri:D().optional(),response_type:D().optional(),state:D().optional(),scope:D().optional(),code_challenge:D().optional(),code_challenge_method:D().optional()}))}),hre=en({getParentRoute:()=>qi,path:"/auth/$pathname",component:un(()=>Jt(()=>import("./auth-catchall-GUc2KujY.js"),[]))}),pre=en({getParentRoute:()=>qi,path:"/connect/$sessionId",component:un(()=>Jt(()=>import("./connect-DoxLTvbh.js"),__vite__mapDeps([22,23,17,3,4,24,25,26])))}),mre=en({getParentRoute:()=>qi,path:"/store/$appName",component:un(()=>Jt(()=>import("./store-invite-ICTVmn8_.js"),[])),validateSearch:ua(()=>ce({serverName:D().optional()}))}),gre=en({getParentRoute:()=>qi,path:"/oauth/callback",component:un(()=>Jt(()=>import("./oauth-callback-CeLfnx5m.js"),__vite__mapDeps([27,14,25])))}),sg=en({getParentRoute:()=>qi,id:"shell",component:un(()=>Jt(()=>import("./shell-layout-BxNK1bDI.js"),__vite__mapDeps([28,29,4,30,31,32,33,34,17,35,36,37,23,38,2,39,3,21,40,41,42,6,19,43,44,11,45,46,47,48,49,50,51,7,52,53,54,8,55,56,57,58,59,15,60,61,62,63,64,65,66,67,12,68,69,70,71,72,73,74,75,76,77,78,79,80])))}),vre=en({getParentRoute:()=>sg,path:"/",component:un(()=>Jt(()=>import("./home-BYm3DFU4.js"),__vite__mapDeps([81,24,4,70,7,6,64,46,72,3,21,73,74,51,47,17])))}),yre=en({getParentRoute:()=>sg,path:"/$org",beforeLoad:({params:e})=>{throw bb({to:"/$org/$project",params:{org:e.org,project:Sm}})}}),Rr=en({getParentRoute:()=>sg,path:"/$org/$project",component:un(()=>Jt(()=>import("./project-layout-CH4wXxX2.js"),__vite__mapDeps([82,68,23,32,3,4])))}),_re=en({getParentRoute:()=>Rr,path:"/",component:un(()=>Jt(()=>import("./page-CrfNBuC7.js"),__vite__mapDeps([83,29,4,30,31,32,33,34,17,35,36,37,23,38,2,39,3,21,40,41,42,6,19,43,44,11,45,46,47,48,49,50,51,7,52,53,54,8,55,56,57,58,59,15,60,61,63,62,84,64,85])))}),bre=en({getParentRoute:()=>Rr,path:"/tasks",component:un(()=>Jt(()=>import("./tasks-CpdqRpYU.js"),__vite__mapDeps([86,58,4,62,87,8,67])))}),wre=en({getParentRoute:()=>Rr,path:"/settings",component:un(()=>Jt(()=>import("./project-settings-CKgnjrBp.js"),__vite__mapDeps([88,62,4,87,8,17,32,3,21,66,51,23,75,34,36,37,89,90,91,92,93,59,14,64,41,42,6,19,16,30,74])))}),Ya=({params:e})=>{if(e.project!==Sm)throw bb({to:"/$org/$project",params:{org:e.org,project:e.project}})},Sre=en({getParentRoute:()=>Rr,path:"/projects",beforeLoad:Ya,component:un(()=>Jt(()=>import("./projects-list-D0sSao6e.js"),__vite__mapDeps([94,68,23,32,62,4,95,14,46,21,70,96,97,58,65,17,50,30,3,51,66,6,87,8])))}),Ere=en({getParentRoute:()=>Rr,path:"/members",beforeLoad:Ya,component:un(()=>Jt(()=>import("./members-CQSBREQS.js"),__vite__mapDeps([98,99,3,4,77,8,52,6,11,13,48,42,100,101,95,14,46,21,62,87,5,34,17,32,102,103,23,35,36,37,70,60,74,50,30,104,105,64,15,75,58,43,51,41,19,66,24,106,72,40])))}),Rre=en({getParentRoute:()=>Rr,path:"/mcps",beforeLoad:Ya,component:un(()=>Jt(()=>import("./connections-BHOwcUB0.js"),__vite__mapDeps([107,59,99,3,4,77,8,52,6,11,13,48,42,100,101,95,14,46,21,108,24,60,7,109,58,43,62,110,70,23,32,69,36,37,93,74,87,50,30,51,41,19,66,34,17,111,106,112,56,15,113,64,97]))),validateSearch:ua(()=>ce({action:$t(["create"]).optional()}))}),xre=en({getParentRoute:()=>Rr,path:"/mcps/$connectionId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./connection-detail-CVNpoyUm.js"),__vite__mapDeps([114,58,4,43,3,113,21,64,15,115,48,42,84,76,17,32,14,36,37,116,25,111,23,44,103,34,91,93,90,92,59,89,41,6,19,117,26,29,30,31,33,35,38,2,39,40,11,45,46,47,49,50,51,7,52,53,54,8,55,56,57,60,61,87,118,119,62,120,99,77,13,100,101,95,24,106,110,70,69,121,71,74,109,112,72,96,97,122,123]))),validateSearch:ua(()=>ce({tab:D().optional()}))}),Tre=en({getParentRoute:()=>Rr,path:"/mcps/$connectionId/$collectionName/$itemId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./collection-detail-C9AV2Fn9.js"),__vite__mapDeps([124,58,4,43,3,34,17,32,115,48,42,84,76,14,51,21,66,119,62,41,6,19,7,57,47,38,2,55,125,72,87,8,116,25,111,23,44,103,36,37,91,93,90,92,59,89,64,117,26,29,30,31,33,35,39,40,11,45,46,49,50,52,53,54,56,15,60,61,121,80,100,126,104,127,77]))),validateSearch:ua(()=>ce({replayId:D().optional()}))}),Ore=en({getParentRoute:()=>Rr,path:"/monitoring",beforeLoad:Ya,component:un(()=>Jt(()=>import("./monitoring-CK4xcQzM.js"),__vite__mapDeps([128,95,14,46,21,4,62,87,8,58,43,3,48,42,60,19,40,6,55,9,129,103,125,57,47,101,117,102,38,2,34,17,32,33,11,64,15,5,41,126,66,118,111,23,54]))),validateSearch:ua(()=>ce({tab:$t(["logs","analytics"]).default("logs"),from:D().default("now-24h"),to:D().default("now"),connectionId:Ee(D()).optional().default([]),virtualMcpId:Ee(D()).optional().default([]),tool:D().default(""),status:$t(["all","success","errors"]).default("all"),search:D().default(""),page:Ze().optional(),streaming:nt().default(!0),propertyFilters:D().default("")}))}),SP=en({getParentRoute:()=>Rr,path:"/store",beforeLoad:Ya,component:un(()=>Jt(()=>import("./page-jzi-88Nr.js"),__vite__mapDeps([130,62,4,87,8,129,71,14,46,1,2,93,32,34,17,131,95,21,132,48,42,3,112,105,64,56,24,92,40,6,19,72,41,58,36,37,39,23])))}),Cre=en({getParentRoute:()=>SP,path:"/$appName",component:un(()=>Jt(()=>import("./mcp-server-detail-SQfpDpYc.js"),__vite__mapDeps([133,7,14,62,4,48,42,3,109,19,64,77,8,78,58,122,23,44,92,99,52,6,11,13,100,101,95,46,21,24,119,123,118,60,112,132,105,56,87,36,37,34,17,32,111,39,90,91,93,59,131,134]))),validateSearch:ua(()=>ce({registryId:D().optional(),serverName:D().optional(),itemId:D().optional()}))}),Are=en({getParentRoute:()=>Rr,path:"/agents",beforeLoad:Ya,component:un(()=>Jt(()=>import("./agents-NgYS-NWl.js"),__vite__mapDeps([135,99,3,4,77,8,52,6,11,13,48,42,100,101,95,14,46,21,62,87,108,24,58,43,110,70,23,32,69,61,33,34,17,74,106,15,54,136,97]))),validateSearch:ua(()=>ce({action:$t(["create"]).optional()}))}),Ire=en({getParentRoute:()=>Rr,path:"/agents/$agentId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./agent-detail-BQXrWX9M.js"),__vite__mapDeps([137,31,32,33,34,17,35,36,37,23,38,2,39,3,4,21,40,41,42,6,19,43,44,11,45,46,58,48,115,84,76,14,60,75,66,8,10,125,64,85,127,87,119,62,95,5,50,30,111,49,131,55,134,136]))),validateSearch:ua(()=>ce({tab:D().optional()}))}),Nre=en({getParentRoute:()=>Rr,path:"/workflows",component:un(()=>Jt(()=>import("./workflow-BBKpGvON.js"),__vite__mapDeps([138,32,120,59,99,3,4,77,8,52,6,11,13,48,42,100,101,95,14,46,21,24,55,106,53,110,70,23,69,15,121,71,58,91,74,34,17,64,119,62,87,36,37])))}),EP=en({getParentRoute:()=>Rr,path:"/$pluginId",component:un(()=>Jt(()=>import("./dynamic-plugin-layout-C_HHJRk0.js"),__vite__mapDeps([139,14,37,23,34,17,32,79,3,4,62])))}),kre=[],Mre=[],RP=[];dre.forEach(e=>{if(!e.setup)return;const t={parentRoute:EP,routing:{createRoute:en,lazyRouteComponent:un},registerRootSidebarItem:n=>kre.push({pluginId:e.id,...n}),registerSidebarGroup:n=>Mre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{RP.push(...n)}};e.setup(t)});const Pre=EP.addChildren(RP),Dre=SP.addChildren([Cre]),Lre=[_re,bre,wre,Sre,Ere,Rre,xre,Tre,Ore,Dre,Are,Ire,Nre,Pre],jre=Rr.addChildren(Lre),$re=sg.addChildren([vre,yre,jre]),Ure=qi.addChildren([$re,fre,hre,gre,pre,mre]),zre=uL({routeTree:Ure}),Vre=document.getElementById("root");ZD.createRoot(Vre).render(x.jsx(A.StrictMode,{children:x.jsx(hL,{router:zre})}));export{pP as $,loe as A,noe as B,bP as C,toe as D,EN as E,Wre as F,jte as G,HG as H,GG as I,ZG as J,JC as K,rre as L,KG as M,Kre as N,Sm as O,boe as P,WG as Q,ZB as R,S4 as S,XB as T,ooe as U,Eoe as V,aoe as W,soe as X,roe as Y,Cm as Z,pn as _,Xl as a,nk as a$,k5 as a0,RM as a1,TM as a2,d5 as a3,dx as a4,Hre as a5,qre as a6,E$ as a7,PA as a8,hte as a9,od as aA,AN as aB,Hb as aC,qb as aD,bH as aE,wH as aF,eoe as aG,Jre as aH,Xre as aI,lZ as aJ,cZ as aK,iZ as aL,goe as aM,Am as aN,dre as aO,md as aP,Z0 as aQ,Yu as aR,m5 as aS,or as aT,Lr as aU,o5 as aV,gr as aW,db as aX,Od as aY,bd as aZ,ht as a_,yte as aa,poe as ab,Ci as ac,Gre as ad,Ee as ae,$t as af,XG as ag,YV as ah,KV as ai,WV as aj,pN as ak,Bn as al,wd as am,lt as an,RZ as ao,mk as ap,Fi as aq,C5 as ar,Tk as as,$s as at,_H as au,Wa as av,Gb as aw,vk as ax,$N as ay,Zb as az,coe as b,Zs as b$,Bo as b0,tk as b1,qo as b2,Ate as b3,sP as b4,Ga as b5,kH as b6,MH as b7,Ck as b8,Yte as b9,WI as bA,Yre as bB,Mre as bC,uY as bD,GW as bE,ioe as bF,Zre as bG,BV as bH,VV as bI,jV as bJ,Ur as bK,BC as bL,w5 as bM,R5 as bN,A5 as bO,x5 as bP,T5 as bQ,N5 as bR,fx as bS,I5 as bT,O5 as bU,jJ as bV,oP as bW,pt as bX,Aee as bY,Fre as bZ,gA as b_,Et as ba,eo as bb,BI as bc,ar as bd,Ze as be,Lt as bf,nt as bg,je as bh,_t as bi,ua as bj,vd as bk,pr as bl,voe as bm,Kne as bn,Jt as bo,kre as bp,yoe as bq,aV as br,Bre as bs,Er as bt,GV as bu,ee as bv,Ote as bw,d7 as bx,Qre as by,eN as bz,Ui as c,Fa as c0,tZ as c1,yA as c2,oO as c3,nH as c4,Ho as c5,ad as c6,t1 as c7,cc as c8,qs as c9,ca,Go as cb,ak as cc,oH as cd,iH as ce,aH as cf,Gq as cg,hoe as ch,uoe as d,doe as e,Om as f,Dj as g,fa as h,woe as i,x as j,da as k,wA as l,vc as m,yF as n,ce as o,Soe as p,XC as q,A as r,D as s,vT as t,_oe as u,_5 as v,QB as w,WB as x,YB as y,KB as z};
174
+ `&&r++}}return[t,n]}class vC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(yC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(yC(this),n)}}function Vee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function U_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(U_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${U_(e.cause)}`:e.message:`${e}`}function yC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var lP=e=>{throw TypeError(e)},K1=(e,t,n)=>t.has(e)||lP("Cannot "+n),yt=(e,t,n)=>(K1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?lP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ln=(e,t,n,r)=>(K1(e,t,"write to private field"),t.set(e,n),n),za=(e,t,n)=>(K1(e,t,"access private method"),n),$r,Ri,ql,Ep,um,Ku,Ql,Wu,ks,Hl,oc,Gl,Du,Lo,z_,V_,F_,_C,B_,q_,Lu,H_,G_;class Rp extends EventTarget{constructor(t,n){var r,a;super(),zn(this,Lo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,$r),zn(this,Ri),zn(this,ql),zn(this,Ep),zn(this,um),zn(this,Ku),zn(this,Ql),zn(this,Wu,null),zn(this,ks),zn(this,Hl),zn(this,oc,null),zn(this,Gl,null),zn(this,Du,null),zn(this,V_,async i=>{var l;yt(this,Hl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){za(this,Lo,Lu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?ln(this,ql,new URL(i.url)):ln(this,ql,void 0),f!==200){za(this,Lo,Lu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){za(this,Lo,Lu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,$r)===this.CLOSED)return;ln(this,$r,this.OPEN);const p=new Event("open");if((l=yt(this,Du))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){za(this,Lo,Lu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let w=!0;do{const{done:S,value:b}=await y.read();b&&yt(this,Hl).feed(g.decode(b,{stream:!S})),S&&(w=!1,yt(this,Hl).reset(),za(this,Lo,H_).call(this))}while(w)}),zn(this,F_,i=>{ln(this,ks,void 0),!(i.name==="AbortError"||i.type==="aborted")&&za(this,Lo,H_).call(this,U_(i))}),zn(this,B_,i=>{typeof i.id=="string"&&ln(this,Wu,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,ql)?yt(this,ql).origin:yt(this,Ri).origin,lastEventId:i.id||""});yt(this,Gl)&&(!i.event||i.event==="message")&&yt(this,Gl).call(this,l),this.dispatchEvent(l)}),zn(this,q_,i=>{ln(this,Ku,i)}),zn(this,G_,()=>{ln(this,Ql,void 0),yt(this,$r)===this.CONNECTING&&za(this,Lo,z_).call(this)});try{if(t instanceof URL)ln(this,Ri,t);else if(typeof t=="string")ln(this,Ri,new URL(t,Fee()));else throw new Error("Invalid URL")}catch{throw Vee("An invalid or illegal string was specified")}ln(this,Hl,iP({onEvent:yt(this,B_),onRetry:yt(this,q_)})),ln(this,$r,this.CONNECTING),ln(this,Ku,3e3),ln(this,um,(r=n?.fetch)!=null?r:globalThis.fetch),ln(this,Ep,(a=n?.withCredentials)!=null?a:!1),za(this,Lo,z_).call(this)}get readyState(){return yt(this,$r)}get url(){return yt(this,Ri).href}get withCredentials(){return yt(this,Ep)}get onerror(){return yt(this,oc)}set onerror(t){ln(this,oc,t)}get onmessage(){return yt(this,Gl)}set onmessage(t){ln(this,Gl,t)}get onopen(){return yt(this,Du)}set onopen(t){ln(this,Du,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Ql)&&clearTimeout(yt(this,Ql)),yt(this,$r)!==this.CLOSED&&(yt(this,ks)&&yt(this,ks).abort(),ln(this,$r,this.CLOSED),ln(this,ks,void 0))}}$r=new WeakMap,Ri=new WeakMap,ql=new WeakMap,Ep=new WeakMap,um=new WeakMap,Ku=new WeakMap,Ql=new WeakMap,Wu=new WeakMap,ks=new WeakMap,Hl=new WeakMap,oc=new WeakMap,Gl=new WeakMap,Du=new WeakMap,Lo=new WeakSet,z_=function(){ln(this,$r,this.CONNECTING),ln(this,ks,new AbortController),yt(this,um)(yt(this,Ri),za(this,Lo,_C).call(this)).then(yt(this,V_)).catch(yt(this,F_))},V_=new WeakMap,F_=new WeakMap,_C=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Wu)?{"Last-Event-ID":yt(this,Wu)}:void 0},cache:"no-store",signal:(e=yt(this,ks))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},B_=new WeakMap,q_=new WeakMap,Lu=function(e,t){var n;yt(this,$r)!==this.CLOSED&&ln(this,$r,this.CLOSED);const r=new vC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r)},H_=function(e,t){var n;if(yt(this,$r)===this.CLOSED)return;ln(this,$r,this.CONNECTING);const r=new vC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r),ln(this,Ql,setTimeout(yt(this,G_),yt(this,Ku)))},G_=new WeakMap,Rp.CONNECTING=0,Rp.OPEN=1,Rp.CLOSED=2;function Fee(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function dm(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function cP(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...dm(t.headers),...dm(r.headers)}:t.headers};return e(n,a)}:e}let W1;W1=globalThis.crypto;async function Bee(e){return(await W1).getRandomValues(new Uint8Array(e))}async function qee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Bee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function Hee(e){return await qee(e)}async function Gee(e){const t=await(await W1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Zee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await Hee(e),n=await Gee(t);return{code_verifier:t,code_challenge:n}}const rr=w7().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:dz.custom,message:"URL must be parseable",fatal:!0}),R$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Kee=ar({resource:D().url(),authorization_servers:Ee(rr).optional(),jwks_uri:D().url().optional(),scopes_supported:Ee(D()).optional(),bearer_methods_supported:Ee(D()).optional(),resource_signing_alg_values_supported:Ee(D()).optional(),resource_name:D().optional(),resource_documentation:D().optional(),resource_policy_uri:D().url().optional(),resource_tos_uri:D().url().optional(),tls_client_certificate_bound_access_tokens:et().optional(),authorization_details_types_supported:Ee(D()).optional(),dpop_signing_alg_values_supported:Ee(D()).optional(),dpop_bound_access_tokens_required:et().optional()}),uP=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:Ee(D()).optional(),response_types_supported:Ee(D()),response_modes_supported:Ee(D()).optional(),grant_types_supported:Ee(D()).optional(),token_endpoint_auth_methods_supported:Ee(D()).optional(),token_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:Ee(D()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),introspection_endpoint:D().optional(),introspection_endpoint_auth_methods_supported:Ee(D()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),code_challenge_methods_supported:Ee(D()).optional(),client_id_metadata_document_supported:et().optional()}),Wee=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:Ee(D()).optional(),response_types_supported:Ee(D()),response_modes_supported:Ee(D()).optional(),grant_types_supported:Ee(D()).optional(),acr_values_supported:Ee(D()).optional(),subject_types_supported:Ee(D()),id_token_signing_alg_values_supported:Ee(D()),id_token_encryption_alg_values_supported:Ee(D()).optional(),id_token_encryption_enc_values_supported:Ee(D()).optional(),userinfo_signing_alg_values_supported:Ee(D()).optional(),userinfo_encryption_alg_values_supported:Ee(D()).optional(),userinfo_encryption_enc_values_supported:Ee(D()).optional(),request_object_signing_alg_values_supported:Ee(D()).optional(),request_object_encryption_alg_values_supported:Ee(D()).optional(),request_object_encryption_enc_values_supported:Ee(D()).optional(),token_endpoint_auth_methods_supported:Ee(D()).optional(),token_endpoint_auth_signing_alg_values_supported:Ee(D()).optional(),display_values_supported:Ee(D()).optional(),claim_types_supported:Ee(D()).optional(),claims_supported:Ee(D()).optional(),service_documentation:D().optional(),claims_locales_supported:Ee(D()).optional(),ui_locales_supported:Ee(D()).optional(),claims_parameter_supported:et().optional(),request_parameter_supported:et().optional(),request_uri_parameter_supported:et().optional(),require_request_uri_registration:et().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:et().optional()}),Yee=ce({...Wee.shape,...uP.pick({code_challenge_methods_supported:!0}).shape}),Qee=ce({access_token:D(),id_token:D().optional(),token_type:D(),expires_in:tN().optional(),scope:D().optional(),refresh_token:D().optional()}).strip(),Xee=ce({error:D(),error_description:D().optional(),error_uri:D().optional()}),bC=rr.optional().or(je("").transform(()=>{})),Jee=ce({redirect_uris:Ee(rr),token_endpoint_auth_method:D().optional(),grant_types:Ee(D()).optional(),response_types:Ee(D()).optional(),client_name:D().optional(),client_uri:rr.optional(),logo_uri:bC,scope:D().optional(),contacts:Ee(D()).optional(),tos_uri:bC,policy_uri:D().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:D().optional(),software_version:D().optional(),software_statement:D().optional()}).strip(),ete=ce({client_id:D(),client_secret:D().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),tte=Jee.merge(ete);ce({error:D(),error_description:D().optional()}).strip();ce({token:D(),token_type_hint:D().optional()}).strip();function nte(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function rte({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Wn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class Z_ extends Wn{}Z_.errorCode="invalid_request";class fm extends Wn{}fm.errorCode="invalid_client";class hm extends Wn{}hm.errorCode="invalid_grant";class pm extends Wn{}pm.errorCode="unauthorized_client";class K_ extends Wn{}K_.errorCode="unsupported_grant_type";class W_ extends Wn{}W_.errorCode="invalid_scope";class Y_ extends Wn{}Y_.errorCode="access_denied";class fc extends Wn{}fc.errorCode="server_error";class Q_ extends Wn{}Q_.errorCode="temporarily_unavailable";class X_ extends Wn{}X_.errorCode="unsupported_response_type";class J_ extends Wn{}J_.errorCode="unsupported_token_type";class eb extends Wn{}eb.errorCode="invalid_token";class tb extends Wn{}tb.errorCode="method_not_allowed";class nb extends Wn{}nb.errorCode="too_many_requests";class mm extends Wn{}mm.errorCode="invalid_client_metadata";class rb extends Wn{}rb.errorCode="insufficient_scope";class ob extends Wn{}ob.errorCode="invalid_target";const ote={[Z_.errorCode]:Z_,[fm.errorCode]:fm,[hm.errorCode]:hm,[pm.errorCode]:pm,[K_.errorCode]:K_,[W_.errorCode]:W_,[Y_.errorCode]:Y_,[fc.errorCode]:fc,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[J_.errorCode]:J_,[eb.errorCode]:eb,[tb.errorCode]:tb,[nb.errorCode]:nb,[mm.errorCode]:mm,[rb.errorCode]:rb,[ob.errorCode]:ob};class $o extends Error{constructor(t){super(t??"Unauthorized")}}function ate(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const V0="code",F0="S256";function ste(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&ate(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ite(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":lte(a,i,n);return;case"client_secret_post":cte(a,i,r);return;case"none":ute(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function lte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function cte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function ute(e,t){t.set("client_id",e)}async function dP(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=Xee.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=ote[a]||fc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new fc(a)}}async function Ci(e,t){try{return await B0(e,t)}catch(n){if(n instanceof fm||n instanceof pm)return await e.invalidateCredentials?.("all"),await B0(e,t);if(n instanceof hm)return await e.invalidateCredentials?.("tokens"),await B0(e,t);throw n}}async function B0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await hte(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await fte(t,e,l),f=await yte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const b=f?.client_id_metadata_document_supported===!0,E=e.clientMetadataUrl;if(E&&!dte(E))throw new mm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${E}`);if(b&&E)m={client_id:E},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await Ste(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const b=await wte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const b=await bte(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}catch(b){if(!(!(b instanceof Wn)||b instanceof fc))throw b}const y=e.state?await e.state():void 0,{authorizationUrl:w,codeVerifier:S}=await _te(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(S),await e.redirectToAuthorization(w),"REDIRECT"}function dte(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function fte(e,t,n){const r=nte(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!rte({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function gm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=q0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=q0(e,"scope")||void 0,u=q0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function q0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function hte(e,t,n=fetch){const r=await gte(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Kee.parse(await r.json())}async function Y1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?Y1(e,void 0,n):void 0;throw r}}function pte(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function wC(e,t,n=fetch){return await Y1(e,{"MCP-Protocol-Version":t},n)}function mte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function gte(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Xm;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=pte(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await wC(l,i,n);if(!r?.metadataUrl&&mte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await wC(d,i,n)}return u}function vte(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function yte(e,{fetchFn:t=fetch,protocolVersion:n=Xm}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=vte(e);for(const{url:i,type:l}of a){const u=await Y1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?uP.parse(await u.json()):Yee.parse(await u.json())}}}async function _te(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes(V0))throw new Error(`Incompatible auth server: does not support response type ${V0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(F0))throw new Error(`Incompatible auth server: does not support code challenge method ${F0}`)}else u=new URL("/authorize",e);const d=await Zee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",V0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",F0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function fP(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Q1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=ste(r,m);ite(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await dP(f);return Qee.parse(await f.json())}async function poe(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=fP(r,a,i);return Q1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function bte(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Q1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function wte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=fP(a,f,e.redirectUrl)}const d=await e.clientInformation();return Q1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function Ste(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await dP(i);return tte.parse(await i.json())}class Ete extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class Rte{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=dm(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new Rp(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=gm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new Ete(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=Zu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=gm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const xte="mcp";class Tte{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,xte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=Zu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class Ote extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=iP({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const Cte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Vl extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}let Ate=class{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??Cte}async _authThenStart(){if(!this._authProvider)throw new $o("No auth provider");let t;try{t=await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new $o;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=dm(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Vl(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new Ote({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:w}=await m.read();if(w)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const S=Zu.parse(JSON.parse(y.data));Pu(S)&&(d=!0,i!==void 0&&(S.id=i)),this.onmessage?.(S)}catch(S){this.onerror?.(S)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new $o("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:$_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Vl(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:w}=gm(u);if(this._resourceMetadataUrl=y,this._scope=w,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new $o;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:w,error:S}=gm(u);if(S==="insufficient_scope"){const b=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===b)throw new Vl(403,"Server returned 403 after trying upscoping");if(w&&(this._scope=w),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=b??void 0,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new $o;return this.send(t)}}throw new Vl(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),aX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(w=>Zu.parse(w)):[Zu.parse(g)];for(const w of y)this.onmessage?.(w)}else throw await u.body?.cancel(),new Vl(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new Vl(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}};class Ite extends Ate{constructor(t,n){super(t,n)}send(t,n){const r=Nte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Nte(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class kte extends sP{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},q1,n)}}const Mte=async(e,t,n)=>{const r=Pte(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new kte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const d=new Headers(n);d.has("Authorization")||d.set("Authorization",`Bearer ${e.connection.token}`);for(const[p,g]of Object.entries(e.connection.headers??{}))d.set(p,g);const f=new URL(e.connection.url),m=f.pathname.replace(/\/+$/,"")||"/";return f.pathname=`${m}/call-tool/${encodeURIComponent(i)}`,fetch(f.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:d,signal:u})}}},Pte=(e,t,n)=>{if(e.type==="Websocket")return new Tte(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new Rte(new URL(e.url),i)}return new Ite(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},SC=e=>{try{return JSON.parse(e)}catch{return e}},dp=new Map,EC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?pr(e.inputSchema):void 0,outputSchema:e.outputSchema?pr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Dte(e){const t=n=>"connection"in e?Mte({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:w,isError:S,content:b}=await g.callTool({name:String(f),arguments:d});if(S){const R=b?.[0]?.text,T=typeof R=="string"?SC(R):null,O=T?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(T.code,T.message,T.traceId):null;throw O||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(w??b)}`)}if(w!==void 0)return w;const E=b?.[0]?.text;return typeof E=="string"?SC(E):void 0}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return dp.has(f)||dp.set(f,i()),await dp.get(f)}catch(m){console.error("Failed to list tools",m),dp.delete(f);return}}async function u(){return(await l()??[]).map(f=>EC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return EC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>Lte({connection:n}):global[t]}});function Lte(e){return Dte(e)}const jte=ce({id:D().describe("Unique identifier for the entity"),title:D().describe("Human-readable title for the entity"),description:D().nullish().describe("Description of the entity"),created_at:D().datetime(),updated_at:D().datetime(),created_by:D().optional(),updated_by:D().optional()}),$te=ce({field:Ee(D()),operator:$t(["eq","gt","gte","lt","lte","in","like","contains"]),value:_t()}),hP=ua(()=>Lt([$te,ce({operator:$t(["and","or","not"]),conditions:Ee(hP)})])),Ute=ce({field:Ee(D()),direction:$t(["asc","desc"]),nulls:$t(["first","last"]).optional()}),zte=ce({where:hP.optional().describe("Filter expression"),orderBy:Ee(Ute).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Vte(e){return ce({items:Ee(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:et().optional().describe("Whether there are more items available")})}const Fte=ce({id:D().describe("ID of the entity to retrieve")});function Bte(e){return ce({item:e.nullable().describe("The retrieved item, or null if not found")})}function qte(e){return ce({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Hte(e){return ce({item:e.describe("The created entity with generated id")})}function Gte(e){return ce({id:D().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Zte(e){return ce({item:e.describe("The updated entity")})}const Kte=ce({id:D().describe("ID of the entity to delete")});function Wte(e){return ce({item:e.describe("The deleted entity")})}function Yte(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:zte,outputSchema:Vte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Fte,outputSchema:Bte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:qte(t),outputSchema:Hte(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:Gte(t),outputSchema:Zte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Kte,outputSchema:Wte(t),opt:!0}),i}const Qte=ce({id:D(),name:D(),description:D().optional(),inputSchema:Et(D(),_t()),outputSchema:Et(D(),_t()).optional()}),Xte=jte.extend({_meta:ce({"io.decocms":ce({id:D(),verified:et(),scopeName:D(),appName:D(),friendlyName:D().nullable().optional(),metadata:Et(D(),_t()).nullable().optional(),publishedAt:D().datetime().optional(),updatedAt:D().datetime().optional(),tools:Ee(Qte).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:ce({$schema:D().optional(),_meta:Et(D(),_t()).optional(),name:D().describe("The server name (scope/app)"),title:D().optional().describe("User-friendly title"),description:D().optional().describe("Server description"),icons:Ee(ce({src:D(),mimeType:D().optional(),sizes:Ee(D()).optional(),theme:$t(["light","dark"]).optional()})).optional(),remotes:Ee(ce({type:$t(["http","stdio","sse"]),url:D().optional(),headers:Ee(_t()).optional()})).optional(),packages:Ee(_t()).optional(),repository:ce({url:D(),source:D().optional(),subfolder:D().optional()}).optional(),version:D().optional(),websiteUrl:D().optional()})});Yte("registry_app",Xte,{readOnly:!0});const Jte=ce({specversion:je("1.0").describe("CloudEvents specification version"),id:D().describe("Unique identifier for this event (UUID recommended)"),source:D().describe("Connection ID of the event publisher"),type:D().describe("Event type (e.g., 'order.created', 'user.signup')"),time:D().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:D().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:D().optional().default("application/json").describe("Content type of the data attribute"),dataschema:D().url().optional().describe("URI to the schema for the data attribute"),data:_t().optional().describe("Event payload (any JSON value)")});ce({events:Ee(Jte).min(1).describe("Batch of CloudEvents to process")});const ene=ce({success:et().optional().describe("Whether this event was processed successfully"),error:D().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});ce({success:et().optional().describe("Batch success - applies to events not in results"),error:D().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:Et(D(),ene).optional().describe("Per-event results keyed by event ID")});ce({type:D().min(1).max(255).describe("Event type identifier"),subject:D().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:_t().optional().describe("Event payload"),deliverAt:D().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:D().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});ce({id:D().describe("Unique event ID"),type:D().describe("Event type"),source:D().describe("Source connection ID"),time:D().describe("Event timestamp")});ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")});ce({subscription:ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:et().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")})});const tne=ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")}),nne=ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:et().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")});ce({subscriptions:Ee(tne).describe("Desired subscriptions - system will create/update/delete to match")});ce({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:Ee(nne).describe("Current subscriptions after sync")});ce({subscriptionId:D().describe("Subscription ID to remove")});ce({success:et().describe("Whether unsubscribe was successful"),subscriptionId:D().describe("Subscription ID that was removed")});ce({eventId:D().describe("Event ID to cancel")});ce({success:et().describe("Whether cancellation was successful"),eventId:D().describe("Event ID that was cancelled")});ce({eventId:D().describe("Event ID to acknowledge")});ce({success:et().describe("Whether ACK was successful"),eventId:D().describe("Event ID that was acknowledged")});const rne=ce({prefix:D().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:D().optional().describe("Token for pagination from previous response"),delimiter:D().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),one=ce({objects:Ee(ce({key:D().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object")})),nextContinuationToken:D().optional().describe("Token for fetching next page of results"),isTruncated:et().describe("Whether there are more results available"),commonPrefixes:Ee(D()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),ane=ce({key:D().describe("Object key/path to get metadata for")}),sne=ce({contentType:D().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object"),metadata:Et(D(),D()).optional().describe("Custom metadata key-value pairs")}),ine=ce({key:D().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),lne=ce({url:D().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),cne=ce({key:D().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:D().optional().describe("MIME type for the object being uploaded")}),une=ce({url:D().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),dne=ce({key:D().describe("Object key/path to delete")}),fne=ce({success:et().describe("Whether the deletion was successful"),key:D().describe("The key that was deleted")}),hne=ce({keys:Ee(D()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),pne=ce({deleted:Ee(D()).describe("Array of successfully deleted keys"),errors:Ee(ce({key:D(),message:D()})).describe("Array of errors for failed deletions")}),mne=[{name:"LIST_OBJECTS",inputSchema:rne,outputSchema:one},{name:"GET_OBJECT_METADATA",inputSchema:ane,outputSchema:sne},{name:"GET_PRESIGNED_URL",inputSchema:ine,outputSchema:lne},{name:"PUT_PRESIGNED_URL",inputSchema:cne,outputSchema:une},{name:"DELETE_OBJECT",inputSchema:dne,outputSchema:fne},{name:"DELETE_OBJECTS",inputSchema:hne,outputSchema:pne}],pP=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));pP.displayName="Folder";function RC(e,t,n,r){return e?e.startsWith("/")?`/${t}/${n}/${r}${e}`:e:`/${t}/${n}/${r}`}function gne(e){return{createRoutes:e,useParams:t=>Xl({strict:!1}),useSearch:t=>Om({strict:!1}),useNavigate:()=>{const t=vc(),{org:n,project:r,pluginId:a}=Xl({strict:!1});return i=>{const l=RC(i.to,n,r,a);return t({...i,to:l,params:{org:n,project:r,pluginId:a,...i.params}})}},useLocation:()=>pL(),Link:function(n){const{org:r,project:a,pluginId:i}=Xl({strict:!1}),l=RC(n.to,r,a,i);return x.jsx(Am,{...n,to:l,params:{org:r,project:a,pluginId:i,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}const mP=A.createContext(null);function goe(e){const t=Ui.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(mP.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function voe(e){const t=A.useContext(mP);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}var Mt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Mt||(Mt={}));var xC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xC||(xC={}));const Ve=Mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Is=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Ne=Mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ha extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof Ha))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ha.create=e=>new Ha(e);const ab=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Mt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mt.assertNever(e)}return{message:n}};let vne=ab;function yne(){return vne}const _ne=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=yne(),r=_ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ab?void 0:ab].filter(a=>!!a)});e.common.issues.push(r)}class ro{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return nt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return ro.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return nt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const nt=Object.freeze({status:"aborted"}),ju=e=>({status:"dirty",value:e}),Oo=e=>({status:"valid",value:e}),TC=e=>e.status==="aborted",OC=e=>e.status==="dirty",hc=e=>e.status==="valid",vm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class Hs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const CC=(e,t)=>{if(hc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ha(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Ot{get description(){return this._def.description}_getType(t){return Is(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ro,ctx:{common:t.parent.common,data:t.data,parsedType:Is(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)},a=this._parseSync({data:t,path:r.path,parent:r});return CC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return hc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>hc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Is(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(vm(a)?a:Promise.resolve(a));return CC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new mc({schema:this,typeName:rt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return zs.create(this,this._def)}nullable(){return gc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ia.create(this)}promise(){return wm.create(this,this._def)}or(t){return _m.create([this,t],this._def)}and(t){return bm.create(this,t,this._def)}transform(t){return new mc({...mt(this._def),schema:this,typeName:rt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new lb({...mt(this._def),innerType:this,defaultValue:n,typeName:rt.ZodDefault})}brand(){return new Fne({typeName:rt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new cb({...mt(this._def),innerType:this,catchValue:n,typeName:rt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return X1.create(this,t)}readonly(){return ub.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const bne=/^c[^\s-]{8,}$/i,wne=/^[0-9a-z]+$/,Sne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ene=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rne=/^[a-z0-9_-]{21}$/i,xne=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tne=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,One=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let H0;const Ane=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ine=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Nne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,kne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dne=new RegExp(`^${gP}$`);function vP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Lne(e){return new RegExp(`^${vP(e)}$`)}function jne(e){let t=`${gP}T${vP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $ne(e,t){return!!((t==="v4"||!t)&&Ane.test(e)||(t==="v6"||!t)&&Nne.test(e))}function Une(e,t){if(!xne.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function zne(e,t){return!!((t==="v4"||!t)&&Ine.test(e)||(t==="v6"||!t)&&kne.test(e))}class Ps extends Ot{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.string,received:i.parsedType}),nt}const r=new ro;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")H0||(H0=new RegExp(Cne,"u")),H0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Ene.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Rne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")bne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")wne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Sne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?jne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Dne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Lne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Tne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?$ne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Une(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?zne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Mne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Pne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ps({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ps({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ps.create=e=>new Ps({checks:[],typeName:rt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Vne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class fd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.number,received:i.parsedType}),nt}let r;const a=new ro;for(const i of this._def.checks)i.kind==="int"?Mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Vne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new fd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new fd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fd.create=e=>new fd({checks:[],typeName:rt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class hd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const a=new ro;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.bigint,received:n.parsedType}),nt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new hd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new hd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}hd.create=e=>new hd({checks:[],typeName:rt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class sb extends Ot{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.boolean,received:r.parsedType}),nt}return Oo(t.data)}}sb.create=e=>new sb({typeName:rt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class ym extends Ot{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.date,received:i.parsedType}),nt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),nt}const r=new ro;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ym({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ym.create=e=>new ym({checks:[],coerce:e?.coerce||!1,typeName:rt.ZodDate,...mt(e)});class AC extends Ot{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.symbol,received:r.parsedType}),nt}return Oo(t.data)}}AC.create=e=>new AC({typeName:rt.ZodSymbol,...mt(e)});class IC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.undefined,received:r.parsedType}),nt}return Oo(t.data)}}IC.create=e=>new IC({typeName:rt.ZodUndefined,...mt(e)});class NC extends Ot{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.null,received:r.parsedType}),nt}return Oo(t.data)}}NC.create=e=>new NC({typeName:rt.ZodNull,...mt(e)});class kC extends Ot{constructor(){super(...arguments),this._any=!0}_parse(t){return Oo(t.data)}}kC.create=e=>new kC({typeName:rt.ZodAny,...mt(e)});class MC extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Oo(t.data)}}MC.create=e=>new MC({typeName:rt.ZodUnknown,...mt(e)});class Gs extends Ot{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.never,received:n.parsedType}),nt}}Gs.create=e=>new Gs({typeName:rt.ZodNever,...mt(e)});class PC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.void,received:r.parsedType}),nt}return Oo(t.data)}}PC.create=e=>new PC({typeName:rt.ZodVoid,...mt(e)});class ia extends Ot{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ve.array)return De(n,{code:Ne.invalid_type,expected:Ve.array,received:n.parsedType}),nt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new Hs(n,l,n.path,u)))).then(l=>ro.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new Hs(n,l,n.path,u)));return ro.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ia({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new ia({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new ia({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}ia.create=(e,t)=>new ia({type:e,minLength:null,maxLength:null,exactLength:null,typeName:rt.ZodArray,...mt(t)});function Zl(e){if(e instanceof Pn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zs.create(Zl(r))}return new Pn({...e._def,shape:()=>t})}else return e instanceof ia?new ia({...e._def,type:Zl(e.element)}):e instanceof zs?zs.create(Zl(e.unwrap())):e instanceof gc?gc.create(Zl(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>Zl(t))):e}class Pn extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Mt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Ve.object,received:f.parsedType}),nt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Gs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new Hs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Gs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new Hs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>ro.mergeObjectSync(r,f)):ro.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Pn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Pn({...this._def,unknownKeys:"strip"})}passthrough(){return new Pn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:rt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Pn({...this._def,catchall:t})}pick(t){const n={};for(const r of Mt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Mt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(t){const n={};for(const r of Mt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Pn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Mt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof zs;)i=i._def.innerType;n[r]=i}return new Pn({...this._def,shape:()=>n})}keyof(){return yP(Mt.objectKeys(this.shape))}}Pn.create=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strip",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});Pn.strictCreate=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strict",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});Pn.lazycreate=(e,t)=>new Pn({shape:e,unknownKeys:"strip",catchall:Gs.create(),typeName:rt.ZodObject,...mt(t)});class _m extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new Ha(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),nt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new Ha(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),nt}}get options(){return this._def.options}}_m.create=(e,t)=>new _m({options:e,typeName:rt.ZodUnion,...mt(t)});function ib(e,t){const n=Is(e),r=Is(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const a=Mt.objectKeys(t),i=Mt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=ib(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=ib(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bm extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(TC(i)||TC(l))return nt;const u=ib(i.value,l.value);return u.valid?((OC(i)||OC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),nt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bm.create=(e,t,n)=>new bm({left:e,right:t,typeName:rt.ZodIntersection,...mt(n)});class $i extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return De(r,{code:Ne.invalid_type,expected:Ve.array,received:r.parsedType}),nt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new Hs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>ro.mergeArray(n,l)):ro.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:rt.ZodTuple,rest:null,...mt(t)})};class DC extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return De(r,{code:Ne.invalid_type,expected:Ve.map,received:r.parsedType}),nt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new Hs(r,u,r.path,[f,"key"])),value:i._parse(new Hs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return nt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}DC.create=(e,t,n)=>new DC({valueType:t,keyType:e,typeName:rt.ZodMap,...mt(n)});class pd extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return De(r,{code:Ne.invalid_type,expected:Ve.set,received:r.parsedType}),nt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return nt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new Hs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new pd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new pd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}pd.create=(e,t)=>new pd({valueType:e,minSize:null,maxSize:null,typeName:rt.ZodSet,...mt(t)});class LC extends Ot{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}LC.create=(e,t)=>new LC({getter:e,typeName:rt.ZodLazy,...mt(t)});class jC extends Ot{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:t.data}}get value(){return this._def.value}}jC.create=(e,t)=>new jC({value:e,typeName:rt.ZodLiteral,...mt(t)});function yP(e,t){return new pc({values:e,typeName:rt.ZodEnum,...mt(t)})}class pc extends Ot{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Mt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),nt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),nt}return Oo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return pc.create(t,{...this._def,...n})}exclude(t,n=this._def){return pc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}pc.create=yP;class $C extends Ot{_parse(t){const n=Mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const a=Mt.objectValues(n);return De(r,{expected:Mt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),nt}if(this._cache||(this._cache=new Set(Mt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Mt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),nt}return Oo(t.data)}get enum(){return this._def.values}}$C.create=(e,t)=>new $C({values:e,typeName:rt.ZodNativeEnum,...mt(t)});class wm extends Ot{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Ve.promise,received:n.parsedType}),nt;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Oo(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wm.create=(e,t)=>new wm({type:e,typeName:rt.ZodPromise,...mt(t)});class mc extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return nt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?nt:d.status==="dirty"||n.value==="dirty"?ju(d.value):d});{if(n.value==="aborted")return nt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?nt:u.status==="dirty"||n.value==="dirty"?ju(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?nt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?nt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!hc(l))return nt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>hc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):nt);Mt.assertNever(a)}}mc.create=(e,t,n)=>new mc({schema:e,typeName:rt.ZodEffects,effect:t,...mt(n)});mc.createWithPreprocess=(e,t,n)=>new mc({schema:t,effect:{type:"preprocess",transform:e},typeName:rt.ZodEffects,...mt(n)});class zs extends Ot{_parse(t){return this._getType(t)===Ve.undefined?Oo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zs.create=(e,t)=>new zs({innerType:e,typeName:rt.ZodOptional,...mt(t)});class gc extends Ot{_parse(t){return this._getType(t)===Ve.null?Oo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:rt.ZodNullable,...mt(t)});class lb extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}lb.create=(e,t)=>new lb({innerType:e,typeName:rt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class cb extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}cb.create=(e,t)=>new cb({innerType:e,typeName:rt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class UC extends Ot{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.nan,received:r.parsedType}),nt}return{status:"valid",value:t.data}}}UC.create=e=>new UC({typeName:rt.ZodNaN,...mt(e)});class Fne extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class X1 extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?nt:i.status==="dirty"?(n.dirty(),ju(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?nt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new X1({in:t,out:n,typeName:rt.ZodPipeline})}}class ub extends Ot{_parse(t){const n=this._def.innerType._parse(t),r=a=>(hc(a)&&(a.value=Object.freeze(a.value)),a);return vm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}ub.create=(e,t)=>new ub({innerType:e,typeName:rt.ZodReadonly,...mt(t)});var rt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(rt||(rt={}));const Bne=Ps.create,qne=sb.create;Gs.create;ia.create;const Hne=Pn.create;_m.create;bm.create;$i.create;const Gne=pc.create;wm.create;zs.create;gc.create;const Zne=Hne({path:Bne().optional().default(""),flat:qne().optional().default(!1),view:Gne(["table","grid"]).optional().default("grid")}),Kne=gne(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>Jt(()=>import("./file-browser-DQeqPq9E.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),validateSearch:Zne})]}),Wne=A.lazy(()=>Jt(()=>import("./plugin-header-CLRCQ1W3.js"),__vite__mapDeps([18,6,19]))),Yne=A.lazy(()=>Jt(()=>import("./plugin-empty-state-BYB8Yhjv.js"),[])),Qne={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:mne,renderHeader:e=>x.jsx(Wne,{...e}),renderEmptyState:()=>x.jsx(Yne,{}),setup:e=>{const{registerSidebarGroup:t,registerPluginRoutes:n}=e;t({id:"object-storage",label:"Object Storage",items:[{icon:x.jsx(pP,{size:16}),label:"File browser"}],defaultExpanded:!0});const r=Kne.createRoutes(e);n(r)}},Xne="user-sandbox",Jne="Create embeddable integration flows for platform end-users";var ere=(e,t,n,r,a,i,l,u)=>{let d=document.documentElement,f=["light","dark"];function m(y){(Array.isArray(e)?e:[e]).forEach(w=>{let S=w==="class",b=S&&i?a.map(E=>i[E]||E):a;S?(d.classList.remove(...b),d.classList.add(i&&i[y]?i[y]:y)):d.setAttribute(w,y)}),p(y)}function p(y){u&&f.includes(y)&&(d.style.colorScheme=y)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let y=localStorage.getItem(t)||n,w=l&&y==="system"?g():y;m(w)}catch{}},tre=A.createContext(void 0),nre={setTheme:e=>{},themes:[]},yoe=()=>{var e;return(e=A.useContext(tre))!=null?e:nre};A.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:f})=>{let m=JSON.stringify([n,t,i,e,u,l,r,a]).slice(1,-1);return A.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${ere.toString()})(${m})`}})});const Sm="org-admin",rre={from({org:e,project:t}){if(e?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}},isOrgAdminProject(e){return e.split("/")[1]===Sm},adminProject(e){return`${e}/${Sm}`}},_P=A.createContext(void 0),_oe=()=>{const e=A.useContext(_P);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},boe=e=>{const t=Ui.c(10),{children:n,org:r,project:a}=e;let i;t[0]!==r.slug||t[1]!==a.slug?(i=rre.from({org:r.slug,project:a.slug}),t[0]=r.slug,t[1]=a.slug,t[2]=i):i=t[2];const l=i;let u;t[3]!==l||t[4]!==r||t[5]!==a?(u={org:r,project:a,locator:l},t[3]=l,t[4]=r,t[5]=a,t[6]=u):u=t[6];const d=u;let f;return t[7]!==n||t[8]!==d?(f=x.jsx(_P.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},ore=ce({authorizationEndpoint:D().url(),tokenEndpoint:D().url(),introspectionEndpoint:D().url().optional(),clientId:D(),clientSecret:D().optional(),scopes:Ee(D()),grantType:$t(["authorization_code","client_credentials"])}),are=ce({title:D().optional(),readOnlyHint:et().optional(),destructiveHint:et().optional(),idempotentHint:et().optional(),openWorldHint:et().optional()}),sre=ce({name:D(),description:D().optional(),inputSchema:Et(D(),_t()),outputSchema:Et(D(),_t()).optional(),annotations:are.optional(),_meta:Et(D(),_t()).optional()}),ire=ce({headers:Et(D(),D()).optional()}),lre=ce({command:D().describe("Command to run (e.g., 'npx', 'node')"),args:Ee(D()).optional().describe("Command arguments"),cwd:D().optional().describe("Working directory"),envVars:Et(D(),D()).optional().describe("Environment variables (encrypted in storage)")}),bP=ce({id:D().describe("Unique identifier for the connection"),title:D().describe("Human-readable name for the connection"),created_at:D().describe("When the connection was created"),updated_at:D().describe("When the connection was last updated"),created_by:D().describe("User ID who created the connection"),updated_by:D().optional().describe("User ID who last updated the connection"),organization_id:D().describe("Organization ID this connection belongs to"),description:D().nullable().describe("Description of the connection"),icon:D().nullable().describe("Icon URL for the connection"),app_name:D().nullable().describe("Associated app name"),app_id:D().nullable().describe("Associated app ID"),connection_type:$t(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:D().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:D().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:Lt([lre,ire]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:ore.nullable().describe("OAuth configuration"),configuration_state:Et(D(),_t()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:Ee(D()).nullable().optional().describe("Configuration scopes"),metadata:Et(D(),_t()).nullable().describe("Additional metadata (includes repository info)"),tools:Ee(sre).nullable().describe("Discovered tools from MCP"),bindings:Ee(D()).nullable().describe("Detected bindings"),status:$t(["active","inactive","error"]).describe("Current status")});bP.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});bP.partial();function woe(e){return e!=null&&"command"in e}function Soe(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const $u=ce({connection_id:D().describe("Connection ID"),selected_tools:Ee(D()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:Ee(D()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:Ee(D()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),wP=$u.extend({selected_tools:$u.shape.selected_tools.optional(),selected_resources:$u.shape.selected_resources.optional(),selected_prompts:$u.shape.selected_prompts.optional()}),Eoe=ce({id:D().describe("Unique identifier for the virtual MCP"),title:D().describe("Human-readable name for the virtual MCP"),description:D().nullable().describe("Description of the virtual MCP"),icon:D().nullable().describe("Icon URL for the virtual MCP"),created_at:D().describe("When the virtual MCP was created"),updated_at:D().describe("When the virtual MCP was last updated"),created_by:D().describe("User ID who created the virtual MCP"),updated_by:D().optional().describe("User ID who last updated the virtual MCP"),organization_id:D().describe("Organization ID this virtual MCP belongs to"),status:$t(["active","inactive"]).describe("Current status"),metadata:ce({instructions:D().nullable().describe("MCP server instructions")}).loose().describe("Additional metadata including MCP server instructions"),connections:Ee($u).describe("Connections with their selected tools, resources, and prompts")});ce({title:D().min(1).max(255).describe("Name for the virtual MCP"),description:D().nullable().optional().describe("Optional description"),icon:D().nullable().optional().describe("Optional icon URL"),status:$t(["active","inactive"]).optional().default("active").describe("Initial status"),metadata:ce({instructions:D().nullable().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Ee(wP).describe("Connections to include/exclude (can be empty for exclusion mode)")});ce({title:D().min(1).max(255).optional().describe("New name"),description:D().nullable().optional().describe("New description (null to clear)"),icon:D().nullable().optional().describe("New icon URL (null to clear)"),status:$t(["active","inactive"]).optional().describe("New status"),metadata:ce({instructions:D().nullable().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:Ee(wP).optional().describe("New connections (replaces existing)")});var zC;(function(e){e.Completable="McpCompletable"})(zC||(zC={}));const cre=[],ure={id:Xne,description:Jne,binding:cre},dre=[Qne,ure],qi=tL({component:()=>x.jsx(rQ,{children:x.jsx(A.Suspense,{fallback:x.jsx(S4,{}),children:x.jsx(wA,{})})})}),fre=en({getParentRoute:()=>qi,path:"/login",component:un(()=>Jt(()=>import("./login-H0BwFxqL.js"),__vite__mapDeps([20,17,3,4,21]))),validateSearch:ua(()=>ce({next:D().optional(),client_id:D().optional(),redirect_uri:D().optional(),response_type:D().optional(),state:D().optional(),scope:D().optional(),code_challenge:D().optional(),code_challenge_method:D().optional()}))}),hre=en({getParentRoute:()=>qi,path:"/auth/$pathname",component:un(()=>Jt(()=>import("./auth-catchall-DLJkIPQ0.js"),[]))}),pre=en({getParentRoute:()=>qi,path:"/connect/$sessionId",component:un(()=>Jt(()=>import("./connect-1mhMrmD4.js"),__vite__mapDeps([22,23,17,3,4,24,25,26])))}),mre=en({getParentRoute:()=>qi,path:"/store/$appName",component:un(()=>Jt(()=>import("./store-invite-C8stGp_k.js"),[])),validateSearch:ua(()=>ce({serverName:D().optional()}))}),gre=en({getParentRoute:()=>qi,path:"/oauth/callback",component:un(()=>Jt(()=>import("./oauth-callback-DqKFxIqr.js"),__vite__mapDeps([27,14,25])))}),sg=en({getParentRoute:()=>qi,id:"shell",component:un(()=>Jt(()=>import("./shell-layout-DOBmQ9ah.js"),__vite__mapDeps([28,29,4,30,31,32,33,34,17,35,36,37,23,38,2,39,3,21,40,41,42,6,19,43,44,11,45,46,47,48,49,50,51,52,7,53,54,55,8,56,57,58,59,60,15,61,62,63,64,65,66,67,68,12,69,70,71,72,73,74,75,76,77,78,79,80,81])))}),vre=en({getParentRoute:()=>sg,path:"/",component:un(()=>Jt(()=>import("./home-D16zlSya.js"),__vite__mapDeps([82,24,4,71,7,6,65,46,73,3,21,74,75,51,52,47,17])))}),yre=en({getParentRoute:()=>sg,path:"/$org",beforeLoad:({params:e})=>{throw bb({to:"/$org/$project",params:{org:e.org,project:Sm}})}}),Rr=en({getParentRoute:()=>sg,path:"/$org/$project",component:un(()=>Jt(()=>import("./project-layout-DzX_Lv0I.js"),__vite__mapDeps([83,69,23,32,3,4])))}),_re=en({getParentRoute:()=>Rr,path:"/",component:un(()=>Jt(()=>import("./page-B2cjdb1f.js"),__vite__mapDeps([84,29,4,30,31,32,33,34,17,35,36,37,23,38,2,39,3,21,40,41,42,6,19,43,44,11,45,46,47,48,49,50,51,52,7,53,54,55,8,56,57,58,59,60,15,61,62,64,63,85,65,86])))}),bre=en({getParentRoute:()=>Rr,path:"/tasks",component:un(()=>Jt(()=>import("./tasks-C_RAoHGr.js"),__vite__mapDeps([87,59,4,63,88,8,68])))}),wre=en({getParentRoute:()=>Rr,path:"/settings",component:un(()=>Jt(()=>import("./project-settings-lapjGGi3.js"),__vite__mapDeps([89,63,4,88,8,17,32,3,21,67,51,52,23,76,34,36,37,90,91,92,93,94,60,14,65,41,42,6,19,16,30,75])))}),Ya=({params:e})=>{if(e.project!==Sm)throw bb({to:"/$org/$project",params:{org:e.org,project:e.project}})},Sre=en({getParentRoute:()=>Rr,path:"/projects",beforeLoad:Ya,component:un(()=>Jt(()=>import("./projects-list-DZgOrcLS.js"),__vite__mapDeps([95,69,23,32,63,4,96,14,46,21,71,97,98,59,66,17,50,30,3,51,52,67,6,88,8])))}),Ere=en({getParentRoute:()=>Rr,path:"/members",beforeLoad:Ya,component:un(()=>Jt(()=>import("./members-C925BdC6.js"),__vite__mapDeps([99,100,3,4,78,8,53,6,11,13,48,42,101,102,96,14,46,21,63,88,5,34,17,32,103,104,23,35,36,37,71,61,75,50,30,105,106,65,15,76,59,43,51,52,41,19,67,24,107,73,40])))}),Rre=en({getParentRoute:()=>Rr,path:"/mcps",beforeLoad:Ya,component:un(()=>Jt(()=>import("./connections-DmGFiu1f.js"),__vite__mapDeps([108,60,100,3,4,78,8,53,6,11,13,48,42,101,102,96,14,46,21,109,24,61,7,110,59,43,63,111,71,23,32,70,36,37,94,75,88,50,30,51,52,41,19,67,34,17,112,107,113,57,15,114,65,98]))),validateSearch:ua(()=>ce({action:$t(["create"]).optional()}))}),xre=en({getParentRoute:()=>Rr,path:"/mcps/$connectionId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./connection-detail-dEdcHJ4u.js"),__vite__mapDeps([115,59,4,43,3,114,21,65,15,116,48,42,85,77,17,32,14,36,37,117,25,112,23,44,104,34,92,94,91,93,60,90,41,6,19,118,26,29,30,31,33,35,38,2,39,40,11,45,46,47,49,50,51,52,7,53,54,55,8,56,57,58,61,62,88,119,120,63,121,100,78,13,101,102,96,24,107,111,71,70,122,72,75,110,113,73,97,98,123,124]))),validateSearch:ua(()=>ce({tab:D().optional()}))}),Tre=en({getParentRoute:()=>Rr,path:"/mcps/$connectionId/$collectionName/$itemId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./collection-detail-iX-6m_0X.js"),__vite__mapDeps([125,59,4,43,3,34,17,32,116,48,42,85,77,14,51,52,21,67,120,63,41,6,19,7,58,47,38,2,56,126,73,88,8,117,25,112,23,44,104,36,37,92,94,91,93,60,90,65,118,26,29,30,31,33,35,39,40,11,45,46,49,50,53,54,55,57,15,61,62,122,81,101,127,105,128,78]))),validateSearch:ua(()=>ce({replayId:D().optional()}))}),Ore=en({getParentRoute:()=>Rr,path:"/monitoring",beforeLoad:Ya,component:un(()=>Jt(()=>import("./monitoring-DI8QAuDx.js"),__vite__mapDeps([129,96,14,46,21,4,63,88,8,59,43,3,48,42,61,19,40,6,56,9,130,104,126,58,47,102,118,103,38,2,34,17,32,33,11,65,15,5,41,127,67,119,76,52,112,23,55]))),validateSearch:ua(()=>ce({tab:$t(["logs","analytics"]).default("logs"),from:D().default("now-24h"),to:D().default("now"),connectionId:Ee(D()).optional().default([]),virtualMcpId:Ee(D()).optional().default([]),tool:D().default(""),status:$t(["all","success","errors"]).default("all"),search:D().default(""),page:Ze().optional(),streaming:et().default(!0),propertyFilters:D().default(""),hideSystem:et().default(!1)}))}),SP=en({getParentRoute:()=>Rr,path:"/store",beforeLoad:Ya,component:un(()=>Jt(()=>import("./page-DCfXF14g.js"),__vite__mapDeps([131,63,4,88,8,130,72,14,46,1,2,94,32,34,17,132,96,21,133,48,42,3,113,106,65,57,24,93,40,6,19,73,41,59,36,37,39,23])))}),Cre=en({getParentRoute:()=>SP,path:"/$appName",component:un(()=>Jt(()=>import("./mcp-server-detail-Ce9SGjoZ.js"),__vite__mapDeps([134,7,14,63,4,48,42,3,110,19,65,78,8,79,59,123,23,44,93,100,53,6,11,13,101,102,96,46,21,24,120,124,119,61,113,133,106,57,88,36,37,34,17,32,112,39,91,92,94,60,132,135]))),validateSearch:ua(()=>ce({registryId:D().optional(),serverName:D().optional(),itemId:D().optional()}))}),Are=en({getParentRoute:()=>Rr,path:"/agents",beforeLoad:Ya,component:un(()=>Jt(()=>import("./agents-BMyluA59.js"),__vite__mapDeps([136,100,3,4,78,8,53,6,11,13,48,42,101,102,96,14,46,21,63,88,109,24,59,43,111,71,23,32,70,62,33,34,17,75,107,15,55,137,98]))),validateSearch:ua(()=>ce({action:$t(["create"]).optional()}))}),Ire=en({getParentRoute:()=>Rr,path:"/agents/$agentId",beforeLoad:Ya,component:un(()=>Jt(()=>import("./agent-detail-D8YR1Y7H.js"),__vite__mapDeps([138,31,32,33,34,17,35,36,37,23,38,2,39,3,4,21,40,41,42,6,19,43,44,11,45,46,59,48,116,85,77,14,61,76,67,8,10,126,65,86,128,88,120,63,96,5,50,30,112,49,132,56,135,137]))),validateSearch:ua(()=>ce({tab:D().optional()}))}),Nre=en({getParentRoute:()=>Rr,path:"/workflows",component:un(()=>Jt(()=>import("./workflow-2rDY9uo2.js"),__vite__mapDeps([139,32,121,60,100,3,4,78,8,53,6,11,13,48,42,101,102,96,14,46,21,24,56,107,54,111,71,23,70,15,122,72,59,92,75,34,17,65,120,63,88,36,37])))}),EP=en({getParentRoute:()=>Rr,path:"/$pluginId",component:un(()=>Jt(()=>import("./dynamic-plugin-layout-BsqDni3U.js"),__vite__mapDeps([140,14,37,23,34,17,32,80,3,4,63])))}),kre=[],Mre=[],RP=[];dre.forEach(e=>{if(!e.setup)return;const t={parentRoute:EP,routing:{createRoute:en,lazyRouteComponent:un},registerRootSidebarItem:n=>kre.push({pluginId:e.id,...n}),registerSidebarGroup:n=>Mre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{RP.push(...n)}};e.setup(t)});const Pre=EP.addChildren(RP),Dre=SP.addChildren([Cre]),Lre=[_re,bre,wre,Sre,Ere,Rre,xre,Tre,Ore,Dre,Are,Ire,Nre,Pre],jre=Rr.addChildren(Lre),$re=sg.addChildren([vre,yre,jre]),Ure=qi.addChildren([$re,fre,hre,gre,pre,mre]),zre=uL({routeTree:Ure}),Vre=document.getElementById("root");ZD.createRoot(Vre).render(x.jsx(A.StrictMode,{children:x.jsx(hL,{router:zre})}));export{aoe as $,loe as A,ZB as B,bP as C,QB as D,toe as E,YV as F,WB as G,YB as H,KB as I,noe as J,JC as K,rre as L,Wre as M,Kre as N,Sm as O,boe as P,jte as Q,XG as R,S4 as S,XB as T,HG as U,Eoe as V,GG as W,ZG as X,KG as Y,WG as Z,ooe as _,Xl as a,nk as a$,soe as a0,roe as a1,Cm as a2,pn as a3,pP as a4,k5 as a5,RM as a6,TM as a7,d5 as a8,dx as a9,od as aA,AN as aB,Hb as aC,qb as aD,bH as aE,wH as aF,eoe as aG,Jre as aH,Xre as aI,lZ as aJ,cZ as aK,iZ as aL,goe as aM,Am as aN,dre as aO,md as aP,Z0 as aQ,Yu as aR,m5 as aS,or as aT,Lr as aU,o5 as aV,gr as aW,db as aX,Od as aY,bd as aZ,ht as a_,Hre as aa,qre as ab,E$ as ac,PA as ad,hte as ae,yte as af,poe as ag,Ci as ah,Gre as ai,Ee as aj,$t as ak,Bn as al,wd as am,lt as an,RZ as ao,mk as ap,Fi as aq,C5 as ar,Tk as as,$s as at,_H as au,Wa as av,Gb as aw,vk as ax,$N as ay,Zb as az,coe as b,Zs as b$,Bo as b0,tk as b1,qo as b2,Ate as b3,sP as b4,Ga as b5,kH as b6,MH as b7,Ck as b8,Yte as b9,WI as bA,Yre as bB,Mre as bC,uY as bD,GW as bE,ioe as bF,Zre as bG,BV as bH,VV as bI,jV as bJ,Ur as bK,BC as bL,w5 as bM,R5 as bN,A5 as bO,x5 as bP,T5 as bQ,N5 as bR,fx as bS,I5 as bT,O5 as bU,jJ as bV,oP as bW,pt as bX,Aee as bY,Fre as bZ,gA as b_,Et as ba,eo as bb,BI as bc,ar as bd,Ze as be,Lt as bf,et as bg,je as bh,_t as bi,ua as bj,vd as bk,pr as bl,voe as bm,Kne as bn,Jt as bo,kre as bp,yoe as bq,aV as br,Bre as bs,Er as bt,GV as bu,ee as bv,Ote as bw,d7 as bx,Qre as by,eN as bz,Ui as c,Fa as c0,tZ as c1,yA as c2,oO as c3,nH as c4,Ho as c5,ad as c6,t1 as c7,cc as c8,qs as c9,ca,Go as cb,ak as cc,oH as cd,iH as ce,aH as cf,Gq as cg,hoe as ch,uoe as d,doe as e,Om as f,Dj as g,fa as h,woe as i,x as j,da as k,wA as l,vc as m,KV as n,ce as o,Soe as p,EN as q,A as r,D as s,vT as t,_oe as u,WV as v,pN as w,yF as x,XC as y,_5 as z};