agentworkshop 0.7.27 → 0.7.34

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 (1033) hide show
  1. package/.AgentWorkShop/prompts/aml-mission-default.md +20 -0
  2. package/.AgentWorkShop/prompts/aml-playbook.md +49 -0
  3. package/.AgentWorkShop/prompts/host-tools.json +314 -0
  4. package/.output/.AgentWorkShop/prompts/aml-mission-default.md +20 -0
  5. package/.output/.AgentWorkShop/prompts/aml-playbook.md +49 -0
  6. package/.output/.AgentWorkShop/prompts/host-tools.json +314 -0
  7. package/.output/.AgentWorkShop/schema.json +120 -0
  8. package/.output/nitro.json +1 -1
  9. package/.output/public/_nuxt/{BTLEvDxM.js → 4bHdIqEg.js} +8 -8
  10. package/.output/public/_nuxt/B9nXmjSB.js +19 -0
  11. package/.output/public/_nuxt/BASN8nZ0.js +1 -0
  12. package/.output/public/_nuxt/{DNQF_TXX.js → BBBtwOpo.js} +1 -1
  13. package/.output/public/_nuxt/{DoAlYsiF.js → BBwMH_hG.js} +1 -1
  14. package/.output/public/_nuxt/BWSE6hR6.js +1 -0
  15. package/.output/public/_nuxt/BZv4RFYN.js +1 -0
  16. package/.output/public/_nuxt/{BgCrZKv_2.js → Bc0AmjfT.js} +1 -1
  17. package/.output/public/_nuxt/BcmbLh2z2.js +1 -0
  18. package/.output/public/_nuxt/BgTB6h_q.js +2 -0
  19. package/.output/public/_nuxt/BkLJA9J5.js +1 -0
  20. package/.output/public/_nuxt/{XY2z78rj.js → BuCHayqN.js} +1 -1
  21. package/.output/public/_nuxt/{0jKrzLuM.js → BuvcLKh1.js} +1 -1
  22. package/.output/public/_nuxt/C-mDhyEd.js +1 -0
  23. package/.output/public/_nuxt/{DosOJEmZ2.js → C77oC8yC2.js} +1 -1
  24. package/.output/public/_nuxt/CQvmN-Mi.js +1 -0
  25. package/.output/public/_nuxt/CUDrOuW7.js +1 -0
  26. package/.output/public/_nuxt/{DjU9Dx5Y.js → CZcC-gpk.js} +1 -1
  27. package/.output/public/_nuxt/{Cz9gD2Yo.js → CbzsPO5H.js} +1 -1
  28. package/.output/public/_nuxt/CdSOrh2c.js +1 -0
  29. package/.output/public/_nuxt/Cgx818r-.js +1 -0
  30. package/.output/public/_nuxt/Cjm7VogC.js +1 -0
  31. package/.output/public/_nuxt/Cm5mDxzH.js +1 -0
  32. package/.output/public/_nuxt/Cp6z0RN7.js +1 -0
  33. package/.output/public/_nuxt/Ct-WOVr4.js +1 -0
  34. package/.output/public/_nuxt/CwqIxJGj.js +2 -0
  35. package/.output/public/_nuxt/{BGhOrgle.js → D0fhp-Ga.js} +2 -2
  36. package/.output/public/_nuxt/DIaTPH1M.js +1 -0
  37. package/.output/public/_nuxt/DLljr7g0.js +1 -0
  38. package/.output/public/_nuxt/DTYBfjRY.js +1 -0
  39. package/.output/public/_nuxt/DYKVPzN-.js +1 -0
  40. package/.output/public/_nuxt/DZzGarBE2.js +13 -0
  41. package/.output/public/_nuxt/DaMCzQhv.js +1 -0
  42. package/.output/public/_nuxt/DoMxCWN52.js +4 -0
  43. package/.output/public/_nuxt/{CucID8qg2.js → DoTdlVVe2.js} +1 -1
  44. package/.output/public/_nuxt/DsVcWfyR.js +1 -0
  45. package/.output/public/_nuxt/{BCJFMBQ6.js → DzuC31-i.js} +2 -2
  46. package/.output/public/_nuxt/FQri3dV3.js +1 -0
  47. package/.output/public/_nuxt/Lp7Ll94I.js +1 -0
  48. package/.output/public/_nuxt/PluginSlot.DmjNbrcX.css +1 -0
  49. package/.output/public/_nuxt/_id_.hRYo-EAB.css +1 -0
  50. package/.output/public/_nuxt/_wsId_.gXMEOYgX.css +1 -0
  51. package/.output/public/_nuxt/agents.BV70ioCv.css +1 -0
  52. package/.output/public/_nuxt/aml.WU_bh87J.css +1 -0
  53. package/.output/public/_nuxt/builds/latest.json +1 -1
  54. package/.output/public/_nuxt/builds/meta/adc365b6-f636-4a2b-9527-79819c1e874b.json +1 -0
  55. package/.output/public/_nuxt/daq.Bb6l44-O.css +1 -0
  56. package/.output/public/_nuxt/default.jNT73_hq.css +1 -0
  57. package/.output/public/_nuxt/ekuGmQ7R.js +1 -0
  58. package/.output/public/_nuxt/entry.jFrFAWuA.css +1 -0
  59. package/.output/public/_nuxt/pMoIO6rr.js +14 -0
  60. package/.output/public/_nuxt/pages.Cc8GX9T1.css +1 -0
  61. package/.output/public/_nuxt/plugins.wIPyfPn-.css +1 -0
  62. package/.output/public/_nuxt/settings.BCm4NZIc.css +1 -0
  63. package/.output/public/_nuxt/teams.BC75EGnR.css +1 -0
  64. package/.output/server/chunks/_/binding-authz.mjs +23 -0
  65. package/.output/server/chunks/_/binding-authz.mjs.map +1 -0
  66. package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
  67. package/.output/server/chunks/_/host-bindings.mjs +1 -1
  68. package/.output/server/chunks/_/nitro.mjs +15929 -9198
  69. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  70. package/.output/server/chunks/_/scene-layout.repo.mjs +3 -3
  71. package/.output/server/chunks/_/scene-layout.repo.mjs.map +1 -1
  72. package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs +207 -0
  73. package/.output/server/chunks/build/Checkbox-eax2M3o-.mjs.map +1 -0
  74. package/.output/server/chunks/build/{OmpTerminalPanel-Cw_Vw9oO.mjs → OmpTerminalPanel-Cu_s4i0A.mjs} +2 -2
  75. package/.output/server/chunks/build/{OmpTerminalPanel-Cw_Vw9oO.mjs.map → OmpTerminalPanel-Cu_s4i0A.mjs.map} +1 -1
  76. package/.output/server/chunks/build/{alert-qJnjyRcP.mjs → PluginSlot-CcR4Ys3T.mjs} +140 -4
  77. package/.output/server/chunks/build/PluginSlot-CcR4Ys3T.mjs.map +1 -0
  78. package/.output/server/chunks/build/{TownView-ftIylqiD.mjs → TownView-BdHnAilw.mjs} +5 -5
  79. package/.output/server/chunks/build/{TownView-ftIylqiD.mjs.map → TownView-BdHnAilw.mjs.map} +1 -1
  80. package/.output/server/chunks/build/{_id_-CahfkmEt.mjs → _id_-Cb845FHR.mjs} +7 -5
  81. package/.output/server/chunks/build/_id_-Cb845FHR.mjs.map +1 -0
  82. package/.output/server/chunks/build/{_id_-3Axz2-gV.mjs → _id_-fadFPl2i.mjs} +50 -35
  83. package/.output/server/chunks/build/_id_-fadFPl2i.mjs.map +1 -0
  84. package/.output/server/chunks/build/{_wsId_-BymlQhzS.mjs → _wsId_-CTZswnm5.mjs} +181 -22
  85. package/.output/server/chunks/build/{_wsId_-BymlQhzS.mjs.map → _wsId_-CTZswnm5.mjs.map} +1 -1
  86. package/.output/server/chunks/build/{agents-DuMiSWKp.mjs → agents-Bvin73QY.mjs} +82 -32
  87. package/.output/server/chunks/build/agents-Bvin73QY.mjs.map +1 -0
  88. package/.output/server/chunks/build/aml-uBNIppIf.mjs +508 -0
  89. package/.output/server/chunks/build/aml-uBNIppIf.mjs.map +1 -0
  90. package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs +81 -0
  91. package/.output/server/chunks/build/apiClient-BwnfOQU8.mjs.map +1 -0
  92. package/.output/server/chunks/build/{channel-templates-BStqJ-of.mjs → channel-templates-BTq8570n.mjs} +6 -5
  93. package/.output/server/chunks/build/channel-templates-BTq8570n.mjs.map +1 -0
  94. package/.output/server/chunks/build/{checkbox-C1gABOca.mjs → checkbox-8fB-wI-T.mjs} +2 -2
  95. package/.output/server/chunks/build/{checkbox-C1gABOca.mjs.map → checkbox-8fB-wI-T.mjs.map} +1 -1
  96. package/.output/server/chunks/build/{daq-ChYCABz1.mjs → daq-BvihjQyW.mjs} +111 -109
  97. package/.output/server/chunks/build/daq-BvihjQyW.mjs.map +1 -0
  98. package/.output/server/chunks/build/{dcw-CcQNGggh.mjs → dcw-Ks2vJ4PF.mjs} +5 -3
  99. package/.output/server/chunks/build/dcw-Ks2vJ4PF.mjs.map +1 -0
  100. package/.output/server/chunks/build/{default-95-zOTPt.mjs → default-GgHt4O2R.mjs} +164 -101
  101. package/.output/server/chunks/build/{default-95-zOTPt.mjs.map → default-GgHt4O2R.mjs.map} +1 -1
  102. package/.output/server/chunks/build/{input-number-Bd55elNN.mjs → input-number-DzpyYB99.mjs} +2 -2
  103. package/.output/server/chunks/build/{input-number-Bd55elNN.mjs.map → input-number-DzpyYB99.mjs.map} +1 -1
  104. package/.output/server/chunks/build/{logs-D-2UyGtE.mjs → logs-CYBhkQwh.mjs} +5 -3
  105. package/.output/server/chunks/build/logs-CYBhkQwh.mjs.map +1 -0
  106. package/.output/server/chunks/build/{monitor-mfG5jBtz.mjs → monitor-CyfDt4nR.mjs} +7 -6
  107. package/.output/server/chunks/build/{monitor-mfG5jBtz.mjs.map → monitor-CyfDt4nR.mjs.map} +1 -1
  108. package/.output/server/chunks/build/{pages-Dfosfchr.mjs → pages-C-6BRtv8.mjs} +57 -47
  109. package/.output/server/chunks/build/pages-C-6BRtv8.mjs.map +1 -0
  110. package/.output/server/chunks/build/{permissions-B-hhZuzm.mjs → permissions-B52oOmaO.mjs} +6 -5
  111. package/.output/server/chunks/build/permissions-B52oOmaO.mjs.map +1 -0
  112. package/.output/server/chunks/build/{plugins-DZR0T4Mh.mjs → plugins-dZRegC7m.mjs} +22 -18
  113. package/.output/server/chunks/build/plugins-dZRegC7m.mjs.map +1 -0
  114. package/.output/server/chunks/build/{segmented-LPPREMtZ.mjs → segmented-3TrWo0lS.mjs} +3 -3
  115. package/.output/server/chunks/build/{segmented-LPPREMtZ.mjs.map → segmented-3TrWo0lS.mjs.map} +1 -1
  116. package/.output/server/chunks/build/{settings-BajN9TQW.mjs → settings-CgDLkP3s.mjs} +437 -62
  117. package/.output/server/chunks/build/settings-CgDLkP3s.mjs.map +1 -0
  118. package/.output/server/chunks/build/{table-Bf1r2JjE.mjs → table-BjSWwmic.mjs} +4 -4
  119. package/.output/server/chunks/build/{table-Bf1r2JjE.mjs.map → table-BjSWwmic.mjs.map} +1 -1
  120. package/.output/server/chunks/build/{tag-NO9jEqKy.mjs → tag-DNE9vXc0.mjs} +3 -131
  121. package/.output/server/chunks/build/tag-DNE9vXc0.mjs.map +1 -0
  122. package/.output/server/chunks/build/{teams-t2SkRlJP.mjs → teams-2kz3CusY.mjs} +31 -30
  123. package/.output/server/chunks/build/teams-2kz3CusY.mjs.map +1 -0
  124. package/.output/server/chunks/build/{tokens-DiCojbN8.mjs → tokens-BbWLqtVz.mjs} +6 -5
  125. package/.output/server/chunks/build/tokens-BbWLqtVz.mjs.map +1 -0
  126. package/.output/server/chunks/build/town-BUqRobze.mjs +1 -0
  127. package/.output/server/chunks/build/town-BUqRobze.mjs.map +1 -1
  128. package/.output/server/chunks/build/{town-C7QM8DYK.mjs → town-DJ-V5G9U.mjs} +7 -5
  129. package/.output/server/chunks/build/town-DJ-V5G9U.mjs.map +1 -0
  130. package/.output/server/chunks/build/{useDaqStream-BeA2X8KR.mjs → useDaqStream-CIBaiGAl.mjs} +4 -3
  131. package/.output/server/chunks/build/useDaqStream-CIBaiGAl.mjs.map +1 -0
  132. package/.output/server/chunks/build/{useDcwStream-BJW_MitY.mjs → useDcwStream-CBbiYnWe.mjs} +4 -80
  133. package/.output/server/chunks/build/useDcwStream-CBbiYnWe.mjs.map +1 -0
  134. package/.output/server/chunks/build/{useDeviceTwins-Dwz_EY_i.mjs → useDeviceTwins-Yko6nNPF.mjs} +2 -2
  135. package/.output/server/chunks/build/{useDeviceTwins-Dwz_EY_i.mjs.map → useDeviceTwins-Yko6nNPF.mjs.map} +1 -1
  136. package/.output/server/chunks/build/{useOpsLog-Dm8QEb1I.mjs → useOpsLog-CO_VWh7t.mjs} +2 -2
  137. package/.output/server/chunks/build/{useOpsLog-Dm8QEb1I.mjs.map → useOpsLog-CO_VWh7t.mjs.map} +1 -1
  138. package/.output/server/chunks/build/{useWorkshopApi-B-L3MmIX.mjs → useWorkshopApi-NyjL0L3j.mjs} +4 -2
  139. package/.output/server/chunks/build/{useWorkshopApi-B-L3MmIX.mjs.map → useWorkshopApi-NyjL0L3j.mjs.map} +1 -1
  140. package/.output/server/chunks/build/{users-B9SAdEtH.mjs → users-4nzxTjFT.mjs} +6 -5
  141. package/.output/server/chunks/build/users-4nzxTjFT.mjs.map +1 -0
  142. package/.output/server/chunks/build/workshop-81xhz368.mjs +1 -0
  143. package/.output/server/chunks/build/workshop-81xhz368.mjs.map +1 -1
  144. package/.output/server/chunks/routes/api/health.get.mjs +1 -0
  145. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  146. package/.output/server/chunks/routes/api/index.get.mjs +1 -1
  147. package/.output/server/chunks/routes/api/index.post.mjs +1 -1
  148. package/.output/server/chunks/routes/api/metrics.mjs +1 -0
  149. package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
  150. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -0
  151. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
  152. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -0
  153. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs.map +1 -1
  154. package/.output/server/chunks/routes/api/plugins/i18n.get.mjs +26 -0
  155. package/.output/server/chunks/routes/api/plugins/i18n.get.mjs.map +1 -0
  156. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +2 -1
  157. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
  158. package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs +32 -0
  159. package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs.map +1 -0
  160. package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs +36 -0
  161. package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs.map +1 -0
  162. package/.output/server/chunks/routes/api/system/config.get.mjs +1 -0
  163. package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
  164. package/.output/server/chunks/routes/api/system/index.get.mjs +7 -2
  165. package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
  166. package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -1
  167. package/.output/server/chunks/routes/api/system/index.patch.mjs.map +1 -1
  168. package/.output/server/chunks/routes/api/system/index.post.mjs +36 -0
  169. package/.output/server/chunks/routes/api/system/index.post.mjs.map +1 -0
  170. package/.output/server/chunks/routes/api/system/index2.get.mjs +28 -0
  171. package/.output/server/chunks/routes/api/system/index2.get.mjs.map +1 -0
  172. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +2 -1
  173. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs.map +1 -1
  174. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +2 -1
  175. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs.map +1 -1
  176. package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -0
  177. package/.output/server/chunks/routes/api/system/monitor.get.mjs.map +1 -1
  178. package/.output/server/chunks/routes/api/system/settings/events.get.mjs +8 -5
  179. package/.output/server/chunks/routes/api/system/settings/events.get.mjs.map +1 -1
  180. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +2 -1
  181. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs.map +1 -1
  182. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +2 -1
  183. package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
  184. package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -1
  185. package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
  186. package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
  187. package/.output/server/chunks/routes/api/users/index.get.mjs +2 -1
  188. package/.output/server/chunks/routes/api/users/index.get.mjs.map +1 -1
  189. package/.output/server/chunks/routes/api/users/index.post.mjs +1 -1
  190. package/.output/server/chunks/routes/api/users/login.post.mjs +1 -1
  191. package/.output/server/chunks/routes/api/users/logout.post.mjs +2 -1
  192. package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
  193. package/.output/server/chunks/routes/api/users/me.get.mjs +2 -1
  194. package/.output/server/chunks/routes/api/users/me.get.mjs.map +1 -1
  195. package/.output/server/chunks/routes/api/users/register.post.mjs +1 -1
  196. package/.output/server/chunks/routes/api/users/setup-status.get.mjs +2 -1
  197. package/.output/server/chunks/routes/api/users/setup-status.get.mjs.map +1 -1
  198. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +2 -1
  199. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs.map +1 -1
  200. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +2 -1
  201. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs.map +1 -1
  202. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
  203. package/.output/server/chunks/routes/api/workshop/_...path_.mjs +2 -1
  204. package/.output/server/chunks/routes/api/workshop/_...path_.mjs.map +1 -1
  205. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +2 -1
  206. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
  207. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -1
  208. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -1
  209. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +2 -1
  210. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs.map +1 -1
  211. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +5 -2
  212. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs.map +1 -1
  213. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +9 -3
  214. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs.map +1 -1
  215. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +2 -1
  216. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs.map +1 -1
  217. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +2 -1
  218. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
  219. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +23 -3
  220. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs.map +1 -1
  221. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +21 -3
  222. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
  223. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +2 -1
  224. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -1
  225. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +2 -1
  226. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
  227. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +2 -1
  228. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
  229. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
  230. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -1
  231. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +75 -0
  232. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs.map +1 -0
  233. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +35 -0
  234. package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs.map +1 -0
  235. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +35 -0
  236. package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs.map +1 -0
  237. package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +46 -0
  238. package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs.map +1 -0
  239. package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs +47 -0
  240. package/.output/server/chunks/routes/api/workshop/aml/index2.get.mjs.map +1 -0
  241. package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +48 -0
  242. package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs.map +1 -0
  243. package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +41 -0
  244. package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs.map +1 -0
  245. package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +62 -0
  246. package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs.map +1 -0
  247. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +35 -0
  248. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs.map +1 -0
  249. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +36 -0
  250. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs.map +1 -0
  251. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +34 -0
  252. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs.map +1 -0
  253. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +38 -0
  254. package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs.map +1 -0
  255. package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +37 -0
  256. package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs.map +1 -0
  257. package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +42 -0
  258. package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs.map +1 -0
  259. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +2 -1
  260. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs.map +1 -1
  261. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +2 -1
  262. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs.map +1 -1
  263. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +2 -1
  264. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs.map +1 -1
  265. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +2 -1
  266. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs.map +1 -1
  267. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -1
  268. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs.map +1 -1
  269. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -0
  270. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs.map +1 -1
  271. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -1
  272. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs.map +1 -1
  273. package/.output/server/chunks/routes/api/workshop/audit.get.mjs +2 -1
  274. package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
  275. package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -1
  276. package/.output/server/chunks/routes/api/workshop/caller.mjs.map +1 -1
  277. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
  278. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +2 -1
  279. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs.map +1 -1
  280. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +2 -1
  281. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
  282. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
  283. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +1 -1
  284. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -1
  285. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs.map +1 -1
  286. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +2 -1
  287. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs.map +1 -1
  288. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
  289. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +2 -1
  290. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs.map +1 -1
  291. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
  292. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +2 -1
  293. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs.map +1 -1
  294. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +2 -1
  295. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs.map +1 -1
  296. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +2 -1
  297. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs.map +1 -1
  298. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +2 -1
  299. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs.map +1 -1
  300. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +2 -1
  301. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs.map +1 -1
  302. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +2 -1
  303. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
  304. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -1
  305. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +2 -1
  306. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
  307. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +1 -1
  308. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +2 -1
  309. package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs.map +1 -1
  310. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +2 -1
  311. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
  312. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
  313. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
  314. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
  315. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +2 -1
  316. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
  317. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
  318. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +1 -0
  319. package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs.map +1 -1
  320. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +2 -1
  321. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs.map +1 -1
  322. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +2 -1
  323. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs.map +1 -1
  324. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -1
  325. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs.map +1 -1
  326. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -0
  327. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs.map +1 -1
  328. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -1
  329. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
  330. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -1
  331. package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -0
  332. package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
  333. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +4 -4
  334. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -1
  335. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
  336. package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +2 -1
  337. package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs.map +1 -1
  338. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -1
  339. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -1
  340. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -1
  341. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -1
  342. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -1
  343. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
  344. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -1
  345. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs.map +1 -1
  346. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +3 -1
  347. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs.map +1 -1
  348. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -1
  349. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
  350. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -1
  351. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs.map +1 -1
  352. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -1
  353. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
  354. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -1
  355. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs.map +1 -1
  356. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -1
  357. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs.map +1 -1
  358. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -1
  359. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
  360. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -1
  361. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs.map +1 -1
  362. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -1
  363. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs.map +1 -1
  364. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -1
  365. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs.map +1 -1
  366. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -1
  367. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
  368. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -1
  369. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
  370. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +2 -1
  371. package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs.map +1 -1
  372. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -1
  373. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
  374. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -1
  375. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs.map +1 -1
  376. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -1
  377. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs.map +1 -1
  378. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -1
  379. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs.map +1 -1
  380. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -1
  381. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs.map +1 -1
  382. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +7 -2
  383. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
  384. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -1
  385. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs.map +1 -1
  386. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -1
  387. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
  388. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -1
  389. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs.map +1 -1
  390. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -1
  391. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
  392. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -1
  393. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs.map +1 -1
  394. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -1
  395. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
  396. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -1
  397. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs.map +1 -1
  398. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -1
  399. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
  400. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -1
  401. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs.map +1 -1
  402. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -1
  403. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
  404. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -1
  405. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs.map +1 -1
  406. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -1
  407. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
  408. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -1
  409. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs.map +1 -1
  410. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -1
  411. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs.map +1 -1
  412. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -1
  413. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs.map +1 -1
  414. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -1
  415. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs.map +1 -1
  416. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -1
  417. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs.map +1 -1
  418. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -1
  419. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs.map +1 -1
  420. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -1
  421. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
  422. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -1
  423. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
  424. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -1
  425. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs.map +1 -1
  426. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -1
  427. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs.map +1 -1
  428. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -1
  429. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs.map +1 -1
  430. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -1
  431. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs.map +1 -1
  432. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +2 -1
  433. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs.map +1 -1
  434. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -1
  435. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs.map +1 -1
  436. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs +2 -1
  437. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/versions.get.mjs.map +1 -1
  438. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -1
  439. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
  440. package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +2 -1
  441. package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs.map +1 -1
  442. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -1
  443. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
  444. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -1
  445. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs.map +1 -1
  446. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -1
  447. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs.map +1 -1
  448. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -1
  449. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs.map +1 -1
  450. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -1
  451. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs.map +1 -1
  452. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -1
  453. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
  454. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +2 -1
  455. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
  456. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +2 -1
  457. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs.map +1 -1
  458. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -1
  459. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs.map +1 -1
  460. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -1
  461. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs.map +1 -1
  462. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +2 -1
  463. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs.map +1 -1
  464. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +32 -1
  465. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -1
  466. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +2 -1
  467. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -1
  468. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +2 -1
  469. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs.map +1 -1
  470. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +3 -2
  471. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
  472. package/.output/server/chunks/routes/api/workshop/index.get.mjs +1 -0
  473. package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
  474. package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
  475. package/.output/server/chunks/routes/api/workshop/index.put.mjs +2 -1
  476. package/.output/server/chunks/routes/api/workshop/index.put.mjs.map +1 -1
  477. package/.output/server/chunks/routes/api/workshop/index10.get.mjs +12 -6
  478. package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
  479. package/.output/server/chunks/routes/api/workshop/index11.get.mjs +4 -2
  480. package/.output/server/chunks/routes/api/workshop/index11.get.mjs.map +1 -1
  481. package/.output/server/chunks/routes/api/workshop/index12.get.mjs +28 -0
  482. package/.output/server/chunks/routes/api/workshop/index12.get.mjs.map +1 -0
  483. package/.output/server/chunks/routes/api/workshop/index2.get.mjs +17 -11
  484. package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
  485. package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
  486. package/.output/server/chunks/routes/api/workshop/index3.get.mjs +11 -4
  487. package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
  488. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -1
  489. package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
  490. package/.output/server/chunks/routes/api/workshop/index4.get.mjs +5 -27
  491. package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
  492. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -1
  493. package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
  494. package/.output/server/chunks/routes/api/workshop/index5.get.mjs +24 -18
  495. package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
  496. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -1
  497. package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
  498. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +23 -5
  499. package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
  500. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -1
  501. package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
  502. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +4 -17
  503. package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
  504. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +8 -3
  505. package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
  506. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +20 -21
  507. package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
  508. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
  509. package/.output/server/chunks/routes/api/workshop/index9.get.mjs +24 -11
  510. package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
  511. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -0
  512. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs.map +1 -1
  513. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -0
  514. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs.map +1 -1
  515. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +2 -1
  516. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs.map +1 -1
  517. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -1
  518. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs.map +1 -1
  519. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -1
  520. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs.map +1 -1
  521. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +2 -1
  522. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs.map +1 -1
  523. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -0
  524. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs.map +1 -1
  525. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -1
  526. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs.map +1 -1
  527. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -1
  528. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs.map +1 -1
  529. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -0
  530. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs.map +1 -1
  531. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -1
  532. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -1
  533. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +2 -1
  534. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
  535. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
  536. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +2 -1
  537. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
  538. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +2 -1
  539. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
  540. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -0
  541. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs.map +1 -1
  542. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -1
  543. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +2 -1
  544. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
  545. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -1
  546. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +44 -0
  547. package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs.map +1 -0
  548. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +47 -0
  549. package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs.map +1 -0
  550. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +2 -1
  551. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs.map +1 -1
  552. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +2 -1
  553. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs.map +1 -1
  554. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +2 -1
  555. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
  556. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
  557. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +2 -0
  558. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs.map +1 -1
  559. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +1 -1
  560. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -2
  561. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -0
  562. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs.map +1 -1
  563. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -0
  564. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs.map +1 -1
  565. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -0
  566. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs.map +1 -1
  567. package/.output/server/chunks/routes/renderer.mjs +2 -2
  568. package/.output/server/chunks/virtual/entry.mjs +601 -36
  569. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  570. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  571. package/.output/server/index.mjs +1 -0
  572. package/.output/server/node_modules/@anthropic-ai/claude-agent-sdk/package.json +84 -0
  573. package/.output/server/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +225 -0
  574. package/.output/server/package.json +2 -1
  575. package/README-zh.md +507 -478
  576. package/README.md +517 -486
  577. package/app/app.vue +17 -2
  578. package/app/assets/css/main.css +421 -30
  579. package/app/components/AppHeader.vue +17 -0
  580. package/app/components/AppSidebar.vue +162 -63
  581. package/app/components/AwChart.vue +57 -54
  582. package/app/components/workshop/ChannelSessionList.vue +802 -703
  583. package/app/components/workshop/DaqNodeRow.vue +156 -0
  584. package/app/components/workshop/PluginSlot.vue +120 -0
  585. package/app/composables/workshop/useAmlStream.ts +136 -0
  586. package/app/composables/workshop/useDaqStream.ts +8 -1
  587. package/app/composables/workshop/usePluginPanels.ts +72 -0
  588. package/app/composables/workshop/useWorkshopApi.ts +7 -0
  589. package/app/pages/aml/index.vue +1949 -0
  590. package/app/pages/daq/[id].vue +60 -2
  591. package/app/pages/daq/index.vue +7 -148
  592. package/app/pages/index.vue +235 -213
  593. package/app/pages/plugins/index.vue +280 -274
  594. package/app/pages/settings.vue +555 -78
  595. package/app/pages/workshop/agents.vue +23 -1
  596. package/app/pages/workshop/teams.vue +2 -2
  597. package/app/plugins/aw-plugins.client.ts +95 -6
  598. package/app/plugins/runtime-config.client.ts +4 -14
  599. package/app/plugins/theme.client.ts +13 -3
  600. package/app/stores/app.ts +9 -2
  601. package/app/stores/runtime-config.ts +113 -7
  602. package/cli/aw.mjs +16 -3
  603. package/cli/commands/build.mjs +8 -8
  604. package/cli/commands/dev.mjs +5 -13
  605. package/cli/commands/init.mjs +1 -1
  606. package/cli/commands/start.mjs +10 -17
  607. package/cli/core/args.mjs +85 -4
  608. package/cli/core/child-lifecycle.mjs +136 -0
  609. package/config.yml +24 -0
  610. package/docs/plugins.md +128 -220
  611. package/docs/sdk.md +1 -1
  612. package/i18n/dicts/_en.json +43 -2
  613. package/i18n/dicts/aml.json +163 -0
  614. package/i18n/dicts/channelSessionList.json +4 -1
  615. package/i18n/dicts/daqDetail.json +1 -0
  616. package/i18n/dicts/settings.json +33 -1
  617. package/i18n/dicts/teams.json +9 -1
  618. package/i18n/locales/en.ts +364 -132
  619. package/i18n/locales/zh-CN.ts +433 -201
  620. package/nuxt.config.ts +18 -3
  621. package/package.json +153 -149
  622. package/scripts/_audit/.tmp/audit-data/dcws.json +28 -0
  623. package/scripts/_audit/.tmp/dcw-writes.json +15650 -0
  624. package/scripts/_audit/.tmp/dcws.json +9033 -0
  625. package/scripts/_audit/.tmp/pollution-backup/dcw-rollback.polluted.json +470006 -0
  626. package/scripts/_audit/.tmp/pollution-backup/dcws.polluted.json +9085 -0
  627. package/scripts/_audit/.tmp/probe-cwd.txt +1 -0
  628. package/scripts/_audit/audit-harness-adapters.md +664 -0
  629. package/scripts/_audit/awhome/commands/README.md +3 -0
  630. package/scripts/_audit/awhome/commands/hello.mjs +12 -0
  631. package/scripts/_audit/dcw-controller-e2e.ts +99 -0
  632. package/scripts/_audit/dcw-flush-cost.ts +43 -0
  633. package/scripts/_audit/dcw-rollback-ledger.ts +153 -0
  634. package/scripts/_audit/dcw-unrecorded-write.ts +171 -0
  635. package/scripts/_audit/dcw-write-mutex.ts +157 -0
  636. package/scripts/_audit/diag-cwd.ts +20 -0
  637. package/scripts/_audit/diag-cwd2.ts +19 -0
  638. package/scripts/_audit/exp-cost-scaling.mjs +54 -0
  639. package/scripts/_audit/exp-envelope-and-png.mjs +77 -0
  640. package/scripts/_audit/exp-png-decode.mjs +67 -0
  641. package/scripts/_audit/exp-retention-plan.mjs +61 -0
  642. package/scripts/_audit/exp-retention-rescan.mjs +42 -0
  643. package/scripts/_audit/exp-sweep-fairness.mjs +48 -0
  644. package/scripts/_audit/hello.mjs +12 -0
  645. package/scripts/_audit/http-api-authz-audit.md +657 -0
  646. package/scripts/_audit/ndjson-partial-line-repro.mjs +77 -0
  647. package/scripts/_audit/opencode-await-ternary-repro.mjs +20 -0
  648. package/scripts/_audit/part-frag.txt +84 -0
  649. package/scripts/_audit/part-head.txt +45 -0
  650. package/scripts/_audit/probe-binding.mjs +103 -0
  651. package/scripts/_audit/probe-child.mjs +17 -0
  652. package/scripts/_audit/probe-envelope.mjs +49 -0
  653. package/scripts/_audit/probe-packlist.mjs +67 -0
  654. package/scripts/_audit/probe-routes.mjs +47 -0
  655. package/scripts/_audit/probe-routes2.mjs +38 -0
  656. package/scripts/_audit/probe.ts +9 -0
  657. package/scripts/_audit/probe2.ts +6 -0
  658. package/scripts/_audit/probe3.ts +3 -0
  659. package/scripts/_audit/probe4.ts +3 -0
  660. package/scripts/_audit/proj/.AgentWorkShop/commands/echoargs.mjs +13 -0
  661. package/scripts/_audit/proj/config.yml +1 -0
  662. package/scripts/_audit/run.mjs +30 -0
  663. package/scripts/_audit/runtime-audit.md +716 -0
  664. package/scripts/_audit/ts-resolve-hook.mjs +41 -0
  665. package/scripts/_audit/tsconfig.probe.json +24 -0
  666. package/scripts/_audit/typecheck-out.txt +466 -0
  667. package/scripts/_audit/verify-data-integrity.mjs +112 -0
  668. package/scripts/_dbg-agents-dropdown-shot.py +33 -0
  669. package/scripts/_dbg-anim-verify.mjs +1 -1
  670. package/scripts/_dbg-audit-all-pages.mjs +1 -1
  671. package/scripts/_dbg-availability-probe.ts +11 -0
  672. package/scripts/_dbg-bind-bidi-e2e.mjs +1 -1
  673. package/scripts/_dbg-cf-line-shot.mjs +18 -0
  674. package/scripts/_dbg-channel-plugin-ui.mjs +94 -0
  675. package/scripts/_dbg-configroot-audit.mjs +84 -0
  676. package/scripts/_dbg-crash-recovery.mjs +1 -1
  677. package/scripts/_dbg-crush-probe.sh +21 -0
  678. package/scripts/_dbg-crush-spawn-probe.ts +22 -0
  679. package/scripts/_dbg-daq-acc-probe.mjs +1 -1
  680. package/scripts/_dbg-daq-attrib.mjs +1 -1
  681. package/scripts/_dbg-daq-debug.mjs +1 -1
  682. package/scripts/_dbg-daq-diag.mjs +1 -1
  683. package/scripts/_dbg-daq-e2e.mjs +1 -1
  684. package/scripts/_dbg-daq-filter-e2e.mjs +1 -1
  685. package/scripts/_dbg-daq-filter-e2e2.mjs +1 -1
  686. package/scripts/_dbg-daq-final-regression.mjs +1 -1
  687. package/scripts/_dbg-daq-frame-alarm.mjs +1 -1
  688. package/scripts/_dbg-daq-frame-ui.mjs +1 -1
  689. package/scripts/_dbg-daq-frame-ws.mjs +1 -1
  690. package/scripts/_dbg-daq-frames-e2e.mjs +1 -1
  691. package/scripts/_dbg-daq-full-check.mjs +1 -1
  692. package/scripts/_dbg-daq-intervals-func.mjs +94 -0
  693. package/scripts/_dbg-daq-pages-shot.mjs +1 -1
  694. package/scripts/_dbg-daq-perf.mjs +1 -1
  695. package/scripts/_dbg-daq-probe.mjs +1 -1
  696. package/scripts/_dbg-daq-recipe-e2e.mjs +1 -1
  697. package/scripts/_dbg-daq-rows-probe.mjs +1 -1
  698. package/scripts/_dbg-daq-rowstate-e2e.mjs +1 -1
  699. package/scripts/_dbg-daq-rowstate-shot.mjs +1 -1
  700. package/scripts/_dbg-daq-rowstate-shot2.mjs +1 -1
  701. package/scripts/_dbg-daq-rowstyle-verify.mjs +112 -0
  702. package/scripts/_dbg-dash-console-check.mjs +1 -1
  703. package/scripts/_dbg-dash-deep-probe.mjs +1 -1
  704. package/scripts/_dbg-dash-hitpoint.mjs +1 -1
  705. package/scripts/_dbg-dcw-read-rest.mjs +1 -1
  706. package/scripts/_dbg-dcw-read-ui.mjs +1 -1
  707. package/scripts/_dbg-dcw-shot2.mjs +1 -1
  708. package/scripts/_dbg-diag-mock-loop.mjs +89 -0
  709. package/scripts/_dbg-diag-watch.mjs +95 -0
  710. package/scripts/_dbg-error-probe.mjs +2 -2
  711. package/scripts/_dbg-filter-light-verify.mjs +1 -1
  712. package/scripts/_dbg-final-acceptance-2.mjs +1 -1
  713. package/scripts/_dbg-final-acceptance.mjs +1 -1
  714. package/scripts/_dbg-final-full-e2e.mjs +1 -1
  715. package/scripts/_dbg-final-shots.mjs +32 -0
  716. package/scripts/_dbg-final-t6-hitl.mjs +1 -1
  717. package/scripts/_dbg-fix-unused-imports.py +41 -0
  718. package/scripts/_dbg-fresh-scene-e2e.mjs +1 -1
  719. package/scripts/_dbg-goose-probe.mjs +33 -0
  720. package/scripts/_dbg-goose-probe.sh +10 -0
  721. package/scripts/_dbg-groups-ui-verify.mjs +122 -0
  722. package/scripts/_dbg-harness-cancel-repro.mjs +81 -0
  723. package/scripts/_dbg-harness-ui-shot.py +109 -0
  724. package/scripts/_dbg-hidden-check.mjs +1 -1
  725. package/scripts/_dbg-home-repro.mjs +1 -1
  726. package/scripts/_dbg-home-stack.mjs +1 -1
  727. package/scripts/_dbg-hydration-detail.mjs +1 -1
  728. package/scripts/_dbg-infra-lifecycle.mjs +1 -1
  729. package/scripts/_dbg-line-live-e2e.mjs +1 -1
  730. package/scripts/_dbg-line-repo-test.ts +10 -0
  731. package/scripts/_dbg-login-debug.py +23 -0
  732. package/scripts/_dbg-modbus-latency.mjs +22 -0
  733. package/scripts/_dbg-mqtt-chain-e2e.mjs +1 -1
  734. package/scripts/_dbg-oneshot-impl-probe.ts +67 -0
  735. package/scripts/_dbg-opslog-agent-e2e.mjs +5 -2
  736. package/scripts/_dbg-opt-team-e2e.mjs +1 -1
  737. package/scripts/_dbg-panesplitter-fix-check.mjs +1 -1
  738. package/scripts/_dbg-phase-e3-monitor.mjs +1 -1
  739. package/scripts/_dbg-pi-spawn-probe.ts +33 -0
  740. package/scripts/_dbg-plc-e2e.mjs +1 -1
  741. package/scripts/_dbg-plugin-config-ui.mjs +111 -0
  742. package/scripts/_dbg-plugin-panels-ui.mjs +54 -0
  743. package/scripts/_dbg-plugin-sink-rest.mjs +1 -1
  744. package/scripts/_dbg-plugin-sink-ui.mjs +1 -1
  745. package/scripts/_dbg-plugin-ui-wizard.mjs +1 -1
  746. package/scripts/_dbg-plugin-verify-e2e.mjs +1 -1
  747. package/scripts/_dbg-pop-clamp-verify.mjs +1 -1
  748. package/scripts/_dbg-preview-console.mjs +1 -1
  749. package/scripts/_dbg-preview-minrepro.mjs +1 -1
  750. package/scripts/_dbg-preview-pixels.mjs +1 -1
  751. package/scripts/_dbg-quality-pages-e2e.mjs +1 -1
  752. package/scripts/_dbg-qwen-acp-probe.mjs +30 -0
  753. package/scripts/_dbg-qwen-capture.mjs +21 -0
  754. package/scripts/_dbg-rail-tree-e2e.mjs +1 -1
  755. package/scripts/_dbg-real-driver-e2e.mjs +1 -1
  756. package/scripts/_dbg-real-scenario-timeline.log +55 -123
  757. package/scripts/_dbg-redesign-shots.mjs +1 -1
  758. package/scripts/_dbg-release-smoke.mjs +1 -1
  759. package/scripts/_dbg-resolve-probe.ts +6 -0
  760. package/scripts/_dbg-restart-persist.mjs +1 -1
  761. package/scripts/_dbg-sc001-dispatch.mjs +1 -1
  762. package/scripts/_dbg-scenario-final-shot.mjs +1 -1
  763. package/scripts/_dbg-scenario-phase-e2.mjs +1 -1
  764. package/scripts/_dbg-scenario-phase-e3.mjs +1 -1
  765. package/scripts/_dbg-scenario-phase1.mjs +1 -1
  766. package/scripts/_dbg-scenario-phase2.mjs +1 -1
  767. package/scripts/_dbg-scenario-phase3-monitor.mjs +1 -1
  768. package/scripts/_dbg-scenario-phase3.mjs +1 -1
  769. package/scripts/_dbg-settings-draft-probe.mjs +39 -0
  770. package/scripts/_dbg-settings-probe.mjs +33 -0
  771. package/scripts/_dbg-task-cancel-probe.mjs +66 -0
  772. package/scripts/_dbg-town-alarm-e2e.mjs +1 -1
  773. package/scripts/_dbg-town-daq-shot.mjs +1 -1
  774. package/scripts/_dbg-town-full-e2e.mjs +1 -1
  775. package/scripts/_dbg-town-gate.mjs +1 -1
  776. package/scripts/_dbg-town-ins-probe.mjs +1 -1
  777. package/scripts/_dbg-town-perf.mjs +1 -1
  778. package/scripts/_dbg-town-realtime.mjs +1 -1
  779. package/scripts/_dbg-town-shot.py +25 -0
  780. package/scripts/_dbg-town-shot3.mjs +1 -1
  781. package/scripts/_dbg-town-smoke.mjs +54 -0
  782. package/scripts/_dbg-town-truth.mjs +1 -1
  783. package/scripts/_dbg-town-truth2.mjs +1 -1
  784. package/scripts/_dbg-trend-expand-test.mjs +1 -1
  785. package/scripts/_dbg-twindaq-focus.mjs +1 -1
  786. package/scripts/_dbg-ui-polish-shot.mjs +1 -1
  787. package/scripts/_dbg-ui-polish-verify1.mjs +1 -1
  788. package/scripts/_dbg-ui-polish-verify2.mjs +1 -1
  789. package/scripts/_dbg-ui-polish-verify3.mjs +1 -1
  790. package/scripts/_dbg-ui-polish-verify4.mjs +1 -1
  791. package/scripts/_dbg-unify-shot.mjs +1 -1
  792. package/scripts/_dbg-uplink-probe.mjs +1 -1
  793. package/scripts/_dbg-wizard-preview-shot.mjs +1 -1
  794. package/scripts/_dbg-wizard-ui-e2e.mjs +1 -1
  795. package/scripts/_dbg-ws-probe.mjs +1 -1
  796. package/scripts/_dbg-wsdot-sanity.mjs +1 -1
  797. package/scripts/_node-state-probe.mjs +1 -1
  798. package/scripts/_tmp-args-probe.mjs +20 -0
  799. package/scripts/_tmp-cyc-entry.mjs +8 -0
  800. package/scripts/_tmp-cyc-main.mjs +5 -0
  801. package/scripts/_tmp-cyc-mod.mjs +2 -0
  802. package/scripts/_tmp-cycle-a.mjs +6 -0
  803. package/scripts/_tmp-cycle-b.mjs +2 -0
  804. package/scripts/_tmp-cycle-probe.mjs +4 -0
  805. package/scripts/_tmp-entry-variant.mjs +2 -0
  806. package/scripts/_tmp-help-probe.mjs +19 -0
  807. package/scripts/_tmp-help-probe2.mjs +2 -0
  808. package/scripts/_tmp-trace-preload.mjs +1 -0
  809. package/scripts/aml-agent-bridge.ts +230 -0
  810. package/scripts/aml-industrial-loop.ts +232 -0
  811. package/scripts/aml-ui-smoke.mjs +67 -0
  812. package/scripts/aw-start-smoke.mjs +194 -0
  813. package/scripts/design-verify-templates.mjs +1 -1
  814. package/scripts/device-line-restore.mjs +1 -1
  815. package/scripts/e2e-aml.ts +259 -0
  816. package/scripts/e2e-config-groups.mjs +238 -0
  817. package/scripts/e2e-full-closedloop.mjs +911 -0
  818. package/scripts/e2e-full-scenario.ts +321 -0
  819. package/scripts/e2e-harness-consistency.ts +204 -0
  820. package/scripts/e2e-multi-harness.ts +233 -76
  821. package/scripts/e2e-plc-plugin-closedloop.mjs +518 -0
  822. package/scripts/e2e-real-scenario.mjs +466 -452
  823. package/scripts/e2e-template-isolation.mjs +2 -2
  824. package/scripts/experiment-castfilm-closedloop.mjs +423 -0
  825. package/scripts/experiment-castfilm-finish.mjs +194 -0
  826. package/scripts/experiment-castfilm-ui-shot.mjs +52 -0
  827. package/scripts/experiment-castfilm-viz.mjs +172 -0
  828. package/scripts/production-closed-loop-e2e.mjs +78 -29
  829. package/scripts/test-aml-integration.ts +159 -0
  830. package/scripts/test-aml-job.ts +174 -0
  831. package/scripts/test-aml-unit.ts +184 -0
  832. package/scripts/test-cli-exit.mjs +235 -0
  833. package/scripts/test-daq-frame-race.mjs +310 -0
  834. package/scripts/test-data-root.mjs +208 -0
  835. package/scripts/test-log-flooding.mjs +160 -0
  836. package/scripts/test-lru.mjs +78 -0
  837. package/scripts/test-memory-month-query.mjs +62 -0
  838. package/scripts/test-plugin-hardening.mjs +45 -0
  839. package/scripts/test-rollback-index.mjs +79 -0
  840. package/scripts/test-sdk-surface.mjs +155 -0
  841. package/scripts/three-system-e2e.mjs +662 -448
  842. package/scripts/town-scene-clear.mjs +1 -1
  843. package/sdk/client.d.mts +110 -0
  844. package/sdk/client.mjs +144 -124
  845. package/sdk/context.mjs +161 -1
  846. package/sdk/index.d.mts +37 -5
  847. package/sdk/index.mjs +44 -41
  848. package/sdk/lifecycle.mjs +4 -1
  849. package/server/api/plugins/i18n.get.ts +12 -0
  850. package/server/api/system/config-groups/[id].delete.ts +21 -0
  851. package/server/api/system/config-groups/[id].patch.ts +26 -0
  852. package/server/api/system/config-groups/index.get.ts +21 -0
  853. package/server/api/system/config-groups/index.post.ts +33 -0
  854. package/server/api/system/settings/events.get.ts +8 -4
  855. package/server/api/workshop/agent-tools/bindings/[id].delete.ts +6 -1
  856. package/server/api/workshop/agent-tools/bindings/[id].patch.ts +12 -3
  857. package/server/api/workshop/agent-tools/bindings/index.get.ts +29 -2
  858. package/server/api/workshop/agent-tools/invoke.post.ts +30 -5
  859. package/server/api/workshop/aml/datasets/[id]/preview.get.ts +68 -0
  860. package/server/api/workshop/aml/datasets/[id].get.ts +24 -0
  861. package/server/api/workshop/aml/datasets/index.get.ts +20 -0
  862. package/server/api/workshop/aml/datasets/index.post.ts +27 -0
  863. package/server/api/workshop/aml/experiments/index.get.ts +35 -0
  864. package/server/api/workshop/aml/index.get.ts +24 -0
  865. package/server/api/workshop/aml/jobs/[id]/cancel.post.ts +21 -0
  866. package/server/api/workshop/aml/jobs/[id]/logs.get.ts +23 -0
  867. package/server/api/workshop/aml/jobs/[id]/retry.post.ts +20 -0
  868. package/server/api/workshop/aml/jobs/[id].get.ts +23 -0
  869. package/server/api/workshop/aml/jobs/index.get.ts +26 -0
  870. package/server/api/workshop/aml/jobs/index.post.ts +44 -0
  871. package/server/api/workshop/aml/models/[id]/predict.post.ts +24 -0
  872. package/server/api/workshop/aml/models/[id]/promote.post.ts +30 -0
  873. package/server/api/workshop/aml/models/index.get.ts +48 -0
  874. package/server/api/workshop/daq/[id].delete.ts +6 -0
  875. package/server/api/workshop/dcw/[id].patch.ts +14 -2
  876. package/server/api/workshop/hitl/respond.post.ts +3 -1
  877. package/server/api/workshop/teams/[id]/plugins/index.get.ts +36 -0
  878. package/server/api/workshop/teams/[id]/plugins/index.put.ts +42 -0
  879. package/server/api/workshop/teams/index.post.ts +13 -0
  880. package/server/api/workshop/users/me.get.ts +5 -0
  881. package/server/api/workshop/ws.ts +14 -2
  882. package/server/data/daqs.json +1648 -123
  883. package/server/data/dcw-lines.json +301 -0
  884. package/server/data/dcw-products.json +140 -0
  885. package/server/data/dcw-recipes.json +890 -0
  886. package/server/data/dcw-rollback.json +11591 -5740
  887. package/server/data/dcw-runs.json +3745 -3559
  888. package/server/data/dcw-templates.json +120 -0
  889. package/server/data/dcw-writes.json +1800 -0
  890. package/server/data/dcws.json +1576 -287
  891. package/server/data/line-runs.json +137 -27
  892. package/server/harness/pi-aw-tools.mjs +51 -0
  893. package/server/plugins/dev-stability-guard.ts +63 -63
  894. package/server/plugins/system-config.ts +10 -11
  895. package/server/plugins/workshop.ts +10 -0
  896. package/server/plugins-builtin/diag-bridge/client.mjs +84 -0
  897. package/server/plugins-builtin/diag-bridge/i18n.json +72 -0
  898. package/server/plugins-builtin/diag-bridge/index.mjs +127 -22
  899. package/server/plugins-builtin/rag-bridge/client.mjs +108 -0
  900. package/server/plugins-builtin/rag-bridge/i18n.json +60 -0
  901. package/server/plugins-builtin/rag-bridge/index.mjs +67 -20
  902. package/server/services/system-config.ts +610 -396
  903. package/server/services/workshop/agents/adapters/line-spawn.ts +15 -6
  904. package/server/services/workshop/agents/adapters/one-shot-cli-agent.ts +530 -0
  905. package/server/services/workshop/agents/base-agent.ts +219 -0
  906. package/server/services/workshop/agents/binding-authz.ts +57 -0
  907. package/server/services/workshop/agents/claude-agent.ts +546 -30
  908. package/server/services/workshop/agents/codex-agent.ts +40 -116
  909. package/server/services/workshop/agents/copilot-agent.ts +136 -0
  910. package/server/services/workshop/agents/crush-agent.ts +107 -0
  911. package/server/services/workshop/agents/cursor-agent.ts +102 -0
  912. package/server/services/workshop/agents/dsh-agent.ts +578 -670
  913. package/server/services/workshop/agents/gemini-agent.ts +121 -0
  914. package/server/services/workshop/agents/goose-agent.ts +98 -0
  915. package/server/services/workshop/agents/harness-models.ts +305 -270
  916. package/server/services/workshop/agents/hermes-agent.ts +528 -0
  917. package/server/services/workshop/agents/host-tool-bridge.ts +53 -2
  918. package/server/services/workshop/agents/industrial-tools.ts +659 -7
  919. package/server/services/workshop/agents/omp-agent.ts +74 -59
  920. package/server/services/workshop/agents/opencode-agent.ts +936 -987
  921. package/server/services/workshop/agents/pi-agent.ts +108 -0
  922. package/server/services/workshop/agents/qwen-agent.ts +540 -0
  923. package/server/services/workshop/agents/registry.ts +117 -5
  924. package/server/services/workshop/agents/tool-approvals.ts +3 -3
  925. package/server/services/workshop/aml/aml.repo.ts +368 -0
  926. package/server/services/workshop/aml/clean.ts +120 -0
  927. package/server/services/workshop/aml/dataset-builder.ts +491 -0
  928. package/server/services/workshop/aml/gates.ts +121 -0
  929. package/server/services/workshop/aml/job-orchestrator.ts +650 -0
  930. package/server/services/workshop/aml/model-registry.ts +169 -0
  931. package/server/services/workshop/aml/predictor.ts +262 -0
  932. package/server/services/workshop/aml/python/aml_eval.py +171 -0
  933. package/server/services/workshop/aml/python/amlkit.py +120 -0
  934. package/server/services/workshop/aml/python/requirements.txt +7 -0
  935. package/server/services/workshop/aml/python/train-example.py +92 -0
  936. package/server/services/workshop/aml/python-runtime.ts +217 -0
  937. package/server/services/workshop/aml/retention.ts +98 -0
  938. package/server/services/workshop/aml/runtime.ts +45 -0
  939. package/server/services/workshop/aml/spec.ts +63 -0
  940. package/server/services/workshop/aml/stats.ts +140 -0
  941. package/server/services/workshop/daq/bus/mqtt.adapter.ts +8 -1
  942. package/server/services/workshop/daq/daq-controller.ts +147 -19
  943. package/server/services/workshop/daq/daq-node.repo.ts +13 -11
  944. package/server/services/workshop/daq/daq-runtime.ts +11 -0
  945. package/server/services/workshop/daq/drivers.ts +89 -8
  946. package/server/services/workshop/db/aml-team-seeds.ts +118 -0
  947. package/server/services/workshop/db/channel-plugins.repo.ts +27 -1
  948. package/server/services/workshop/db/database.ts +89 -1
  949. package/server/services/workshop/db/memory.repo.ts +31 -0
  950. package/server/services/workshop/db/user.repo.ts +9 -0
  951. package/server/services/workshop/dcw/dcw-controller.ts +33 -7
  952. package/server/services/workshop/dcw/dcw-line.repo.ts +5 -3
  953. package/server/services/workshop/dcw/dcw-node.repo.ts +4 -4
  954. package/server/services/workshop/dcw/dcw-product.repo.ts +8 -8
  955. package/server/services/workshop/dcw/dcw-recipe.repo.ts +6 -7
  956. package/server/services/workshop/dcw/dcw-runtime.ts +16 -2
  957. package/server/services/workshop/dcw/dcw-templates.ts +4 -4
  958. package/server/services/workshop/dcw/line-run.ts +5 -5
  959. package/server/services/workshop/dcw/recipe-rollback-manager.ts +3 -1
  960. package/server/services/workshop/dcw/recipe-rollback.repo.ts +155 -52
  961. package/server/services/workshop/logger.ts +145 -3
  962. package/server/services/workshop/plugins/host.mjs +854 -566
  963. package/server/services/workshop/prompts/loader.ts +32 -6
  964. package/server/services/workshop/runtime/agent-runtime.ts +32 -3
  965. package/server/services/workshop/runtime/manager.ts +53 -13
  966. package/server/services/workshop/runtime/scheduler-loop.ts +18 -1
  967. package/server/services/workshop/scene/scene-layout.repo.ts +5 -5
  968. package/server/services/workshop/settings.ts +64 -0
  969. package/shared/config/engine.mjs +5 -0
  970. package/shared/config/groups.mjs +220 -0
  971. package/shared/config/home.mjs +11 -2
  972. package/shared/config/schema.json +31 -6
  973. package/shared/daq-protocol.ts +6 -0
  974. package/shared/lru.mjs +94 -0
  975. package/shared/workshop-protocol.ts +2 -2
  976. package/.output/public/_nuxt/2jaJHWIJ.js +0 -1
  977. package/.output/public/_nuxt/B8kt898d.js +0 -1
  978. package/.output/public/_nuxt/BFGpEo8S.js +0 -1
  979. package/.output/public/_nuxt/BG4zduPf.js +0 -14
  980. package/.output/public/_nuxt/BHcpzI2n.js +0 -19
  981. package/.output/public/_nuxt/BWyR3awA.js +0 -1
  982. package/.output/public/_nuxt/Bc89zKq2.js +0 -1
  983. package/.output/public/_nuxt/BetmGSO4.js +0 -1
  984. package/.output/public/_nuxt/BowTbasd.js +0 -1
  985. package/.output/public/_nuxt/BvtknqSC2.js +0 -1
  986. package/.output/public/_nuxt/BytVi9VX2.js +0 -4
  987. package/.output/public/_nuxt/CJviSvm-.js +0 -1
  988. package/.output/public/_nuxt/CTfqWGdy.js +0 -1
  989. package/.output/public/_nuxt/Cb3SnTM8.js +0 -1
  990. package/.output/public/_nuxt/Chc5pfAA.js +0 -1
  991. package/.output/public/_nuxt/CobSUzQv.js +0 -2
  992. package/.output/public/_nuxt/D95h62Jn.js +0 -1
  993. package/.output/public/_nuxt/DGAOugLt.js +0 -1
  994. package/.output/public/_nuxt/DHbTyoAV.js +0 -1
  995. package/.output/public/_nuxt/DfLUN8kY.js +0 -1
  996. package/.output/public/_nuxt/DnziMlcX.js +0 -1
  997. package/.output/public/_nuxt/DvgKXPgu2.js +0 -13
  998. package/.output/public/_nuxt/Q_SJDSgx.js +0 -1
  999. package/.output/public/_nuxt/_id_.DdbYeLqn.css +0 -1
  1000. package/.output/public/_nuxt/_wsId_.BqWBlY7X.css +0 -1
  1001. package/.output/public/_nuxt/agents.CB9Ck7VQ.css +0 -1
  1002. package/.output/public/_nuxt/bFnZa2yd.js +0 -1
  1003. package/.output/public/_nuxt/builds/meta/f7a8e33d-5422-45ac-895d-27168f97e3ad.json +0 -1
  1004. package/.output/public/_nuxt/daq.DGV9QS8d.css +0 -1
  1005. package/.output/public/_nuxt/default.BbgdTDCk.css +0 -1
  1006. package/.output/public/_nuxt/entry.BN02X8iR.css +0 -1
  1007. package/.output/public/_nuxt/pages.CG8UJ2TK.css +0 -1
  1008. package/.output/public/_nuxt/plugins.DpCuwaJt.css +0 -1
  1009. package/.output/public/_nuxt/rkVgzg62.js +0 -1
  1010. package/.output/public/_nuxt/settings.W6qrYAui.css +0 -1
  1011. package/.output/public/_nuxt/teams.BBXVkyKq.css +0 -1
  1012. package/.output/server/chunks/build/_id_-3Axz2-gV.mjs.map +0 -1
  1013. package/.output/server/chunks/build/_id_-CahfkmEt.mjs.map +0 -1
  1014. package/.output/server/chunks/build/agents-DuMiSWKp.mjs.map +0 -1
  1015. package/.output/server/chunks/build/alert-qJnjyRcP.mjs.map +0 -1
  1016. package/.output/server/chunks/build/channel-templates-BStqJ-of.mjs.map +0 -1
  1017. package/.output/server/chunks/build/daq-ChYCABz1.mjs.map +0 -1
  1018. package/.output/server/chunks/build/dcw-CcQNGggh.mjs.map +0 -1
  1019. package/.output/server/chunks/build/logs-D-2UyGtE.mjs.map +0 -1
  1020. package/.output/server/chunks/build/pages-Dfosfchr.mjs.map +0 -1
  1021. package/.output/server/chunks/build/permissions-B-hhZuzm.mjs.map +0 -1
  1022. package/.output/server/chunks/build/plugins-DZR0T4Mh.mjs.map +0 -1
  1023. package/.output/server/chunks/build/responsiveObserve-CS0UB6wQ.mjs +0 -78
  1024. package/.output/server/chunks/build/responsiveObserve-CS0UB6wQ.mjs.map +0 -1
  1025. package/.output/server/chunks/build/settings-BajN9TQW.mjs.map +0 -1
  1026. package/.output/server/chunks/build/tag-NO9jEqKy.mjs.map +0 -1
  1027. package/.output/server/chunks/build/teams-t2SkRlJP.mjs.map +0 -1
  1028. package/.output/server/chunks/build/tokens-DiCojbN8.mjs.map +0 -1
  1029. package/.output/server/chunks/build/town-C7QM8DYK.mjs.map +0 -1
  1030. package/.output/server/chunks/build/useDaqStream-BeA2X8KR.mjs.map +0 -1
  1031. package/.output/server/chunks/build/useDcwStream-BJW_MitY.mjs.map +0 -1
  1032. package/.output/server/chunks/build/users-B9SAdEtH.mjs.map +0 -1
  1033. /package/.output/public/_nuxt/{ORt9oDIy.js → ORt9oDIy2.js} +0 -0
@@ -0,0 +1,225 @@
1
+ #!/usr/bin/env node
2
+ // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
3
+
4
+ // Version: 0.3.266
5
+
6
+ // Want to see the unminified source? We're hiring!
7
+ // https://job-boards.greenhouse.io/anthropic/jobs/4816199008
8
+
9
+ // symbol-dispose-prelude: bun build --banner for every SDK bundle; the build
10
+ // scripts grep for this line's tag. Runs before any module body. bun lowers
11
+ // `using` to a helper that keys disposal on the registry symbol when the
12
+ // well-known one is missing, while disposable objects key on the well-known
13
+ // global directly; on engines without a native `Symbol.dispose` (Safari/iOS,
14
+ // Firefox ESR, `node:vm` contexts on Node <=22 such as Jest's `node`
15
+ // environment and vitest's vm pools, and Node before 18.18 / 20.4) the two
16
+ // disagree and every lowered `using` throws. Registering both symbols first
17
+ // makes the keys agree; a no-op where they are native, and a locked-down
18
+ // `Symbol` (SES lockdown) keeps today's behaviour instead of failing to load.
19
+ if (typeof Symbol.dispose !== 'symbol') {
20
+ try {
21
+ Symbol.dispose = Symbol.for('Symbol.dispose')
22
+ } catch {}
23
+ }
24
+ if (typeof Symbol.asyncDispose !== 'symbol') {
25
+ try {
26
+ Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')
27
+ } catch {}
28
+ }
29
+ import{createRequire as bre}from"node:module";var dre=Object.create;var{getPrototypeOf:pre,defineProperty:ex,getOwnPropertyNames:fre}=Object;var mre=Object.prototype.hasOwnProperty;function hre(e){return this[e]}var gre,_re,qn=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var o=t?gre??=new WeakMap:_re??=new WeakMap,s=o.get(e);if(s)return s}n=e!=null?dre(pre(e)):{};let i=t||!e||!e.__esModule?ex(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of fre(e))if(!mre.call(i,a))ex(i,a,{get:hre.bind(e,a),enumerable:!0})}if(r)o.set(e,i);return i};var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var yre=(e)=>e;function Sre(e,t){this[e]=yre.bind(null,t)}var Zn=(e,t)=>{for(var n in t)ex(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Sre.bind(t,n)})};var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var ve=bre(import.meta.url),Ere=Symbol.dispose||Symbol.for("Symbol.dispose"),xre=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),zt=(e,t,n)=>{if(t!=null){if(typeof t!=="object"&&typeof t!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var r;if(n)r=t[xre];if(r===void 0)r=t[Ere];if(typeof r!=="function")throw TypeError("Object not disposable");e.push([n,r,t])}else if(n)e.push([n]);return t},jt=(e,t,n)=>{var r=typeof SuppressedError==="function"?SuppressedError:function(i,a,c,l){return l=Error(c),l.name="SuppressedError",l.error=i,l.suppressed=a,l},o=(i)=>t=n?new r(i,t,"An error was suppressed during disposal"):(n=!0,i),s=(i)=>{while(i=e.pop())try{var a=i[1]&&i[1].call(i[2]);if(i[0])return Promise.resolve(a).then(s,(c)=>(o(c),s()))}catch(c){o(c)}if(n)throw t};return s()};var _N,ix;var ax=O(()=>{_N=globalThis.process?.getBuiltinModule?.("async_hooks"),ix=_N?(e)=>_N.AsyncResource.bind(e):(e)=>e});function Oe(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function ea(e){if(e===void 0)return!1;if(typeof e==="boolean")return!e;let t=String(e).toLowerCase().trim();return["0","false","no","off"].includes(t)}function Ct(){let e=new Set;return{subscribe(t){let n=ix(t);return e.add(n),()=>{e.delete(n)}},emit(...t){let n;for(let r of e)try{r(...t)}catch(o){(n??=[]).push(o)}if(n)throw n.length===1?n[0]:AggregateError(n,"Signal listener(s) threw")},clear(){e.clear()}}}var yN=O(()=>{ax()});var SN=()=>{};var jc=O(()=>{ax();yN();SN()});function M(e,t,n,r,o){if(r==="m")throw TypeError("Private method is not writable");if(r==="a"&&!o)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function E(e,t,n,r){if(n==="a"&&!r)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}var Jn=()=>{};var nl=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return nl=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(r)=>(+r^n()&15>>+r/4).toString(16))};function Nr(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var oa=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};var H,Nt,mn,hs,Od,vg,Pd,Id,Dd,Ld,Nd,Md,Ud,Fd;var wt=O(()=>{H=class H extends Error{};Nt=class Nt extends H{constructor(e,t,n,r,o){super(`${Nt.makeMessage(e,t,n)}`);this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t,this.type=o??null}static makeMessage(e,t,n){let r=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;if(e&&r)return`${e} ${r}`;if(e)return`${e} status code (no body)`;if(r)return r;return"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new hs({message:n,cause:oa(t)});let o=t,s=o?.error?.type;if(e===400)return new Pd(e,o,n,r,s);if(e===401)return new Id(e,o,n,r,s);if(e===403)return new Dd(e,o,n,r,s);if(e===404)return new Ld(e,o,n,r,s);if(e===409)return new Nd(e,o,n,r,s);if(e===422)return new Md(e,o,n,r,s);if(e===429)return new Ud(e,o,n,r,s);if(e>=500)return new Fd(e,o,n,r,s);return new Nt(e,o,n,r,s)}};mn=class mn extends Nt{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};hs=class hs extends Nt{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}};Od=class Od extends hs{constructor({message:e}={}){super({message:e??"Request timed out."})}};vg=class vg extends H{constructor(e,{cause:t}={}){super(e??"Retryable error.");if(t!==void 0)this.cause=t}};Pd=class Pd extends Nt{};Id=class Id extends Nt{};Dd=class Dd extends Nt{};Ld=class Ld extends Nt{};Nd=class Nd extends Nt{};Md=class Md extends Nt{};Ud=class Ud extends Nt{};Fd=class Fd extends Nt{}});function $d(e){if(typeof e!=="object")return{};return e??{}}function Pv(e){if(!e)return!0;for(let t in e)return!1;return!0}function iU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ble,sU=(e)=>ble.test(e),Cn=(e)=>(Cn=Array.isArray,Cn(e)),Ov,aU=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new H(`${e} must be an integer`);if(t<0)throw new H(`${e} must be a positive integer`);return t},zd=(e)=>{try{return JSON.parse(e)}catch(t){return}};var ro=O(()=>{wt();ble=/^[a-z][a-z0-9+.-]*:/i,Ov=Cn});var oo=(e,t)=>new Promise((n)=>{if(t?.aborted)return n();let r=()=>{clearTimeout(o),n()},o=setTimeout(()=>{t?.removeEventListener("abort",r),n()},e);t?.addEventListener("abort",r,{once:!0})});var Mr="0.112.1";function Ele(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function vle(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let r=n.exec(navigator.userAgent);if(r){let o=r[1]||0,s=r[2]||0,i=r[3]||0;return{browser:t,version:`${o}.${s}.${i}`}}}return null}var dU=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",xle=()=>{let e=Ele();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mr,"X-Stainless-OS":lU(Deno.build.os),"X-Stainless-Arch":cU(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mr,"X-Stainless-OS":lU(globalThis.process.platform??"unknown"),"X-Stainless-Arch":cU(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=vle();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Mr,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},cU=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},lU=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},uU,jd=()=>uU??(uU=xle());var wg=()=>{};function pU(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Iv(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Ag(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Iv({start(){},async pull(n){let{done:r,value:o}=await t.next();if(r)n.close();else n.enqueue(o)},async cancel(){await t.return?.()}})}function Hd(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();if(n?.done)t.releaseLock();return n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function fU(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var mU=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});var Dv="RFC3986",Lv=(e)=>String(e),Nv,hU="RFC1738";var Mv=O(()=>{Nv={RFC1738:(e)=>String(e).replace(/%20/g,"+"),RFC3986:Lv}});function _U(e){if(!e||typeof e!=="object")return!1;return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Fv(e,t){if(Cn(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var Tg=(e,t)=>(Tg=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),Tg(e,t)),Bo,Uv=1024,gU=(e,t,n,r,o)=>{if(e.length===0)return e;let s=e;if(typeof e==="symbol")s=Symbol.prototype.toString.call(e);else if(typeof e!=="string")s=String(e);if(n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let i="";for(let a=0;a<s.length;a+=Uv){let c=s.length>=Uv?s.slice(a,a+Uv):s,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===hU&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Bo[d];continue}if(d<2048){l[l.length]=Bo[192|d>>6]+Bo[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Bo[224|d>>12]+Bo[128|d>>6&63]+Bo[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Bo[240|d>>18]+Bo[128|d>>12&63]+Bo[128|d>>6&63]+Bo[128|d&63]}i+=l.join("")}return i};var yU=O(()=>{Mv();ro();Bo=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})()});function Tle(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"}function xU(e,t,n,r,o,s,i,a,c,l,u,d,f,m,h,_,y,b){let v=e,S=b,x=0,w=!1;while((S=S.get($v))!==void 0&&!w){let q=S.get(e);if(x+=1,typeof q<"u")if(q===x)throw RangeError("Cyclic object value");else w=!0;if(typeof S.get($v)>"u")x=0}if(typeof l==="function")v=l(t,v);else if(v instanceof Date)v=f?.(v);else if(n==="comma"&&Cn(v))v=Fv(v,function(q){if(q instanceof Date)return f?.(q);return q});if(v===null){if(s)return c&&!_?c(t,Yt.encoder,y,"key",m):t;v=""}if(Tle(v)||_U(v)){if(c){let q=_?t:c(t,Yt.encoder,y,"key",m);return[h?.(q)+"="+h?.(c(v,Yt.encoder,y,"value",m))]}return[h?.(t)+"="+h?.(String(v))]}let D=[];if(typeof v>"u")return D;let P;if(n==="comma"&&Cn(v)){if(_&&c)v=Fv(v,c);P=[{value:v.length>0?v.join(",")||null:void 0}]}else if(Cn(l))P=l;else{let q=Object.keys(v);P=u?q.sort(u):q}let F=a?String(t).replace(/\./g,"%2E"):String(t),z=r&&Cn(v)&&v.length===1?F+"[]":F;if(o&&Cn(v)&&v.length===0)return z+"[]";for(let q=0;q<P.length;++q){let ee=P[q],te=typeof ee==="object"&&typeof ee.value<"u"?ee.value:v[ee];if(i&&te===null)continue;let xe=d&&a?ee.replace(/\./g,"%2E"):ee,Q=Cn(v)?typeof n==="function"?n(z,xe):z:z+(d?"."+xe:"["+xe+"]");b.set(e,x);let ut=new WeakMap;ut.set($v,b),EU(D,xU(te,Q,n,r,o,s,i,a,n==="comma"&&_&&Cn(v)?null:c,l,u,d,f,m,h,_,y,ut))}return D}function Cle(e=Yt){if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!=="function")throw TypeError("Encoder has to be a function.");let t=e.charset||Yt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=Dv;if(typeof e.format<"u"){if(!Tg(Nv,e.format))throw TypeError("Unknown format option provided.");n=e.format}let r=Nv[n],o=Yt.filter;if(typeof e.filter==="function"||Cn(e.filter))o=e.filter;let s;if(e.arrayFormat&&e.arrayFormat in bU)s=e.arrayFormat;else if("indices"in e)s=e.indices?"indices":"repeat";else s=Yt.arrayFormat;if("commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let i=typeof e.allowDots>"u"?!!e.encodeDotInKeys===!0?!0:Yt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Yt.addQueryPrefix,allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays==="boolean"?!!e.allowEmptyArrays:Yt.allowEmptyArrays,arrayFormat:s,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Yt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Yt.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Yt.encode,encodeDotInKeys:typeof e.encodeDotInKeys==="boolean"?e.encodeDotInKeys:Yt.encodeDotInKeys,encoder:typeof e.encoder==="function"?e.encoder:Yt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Yt.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Yt.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Yt.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Yt.strictNullHandling}}function vU(e,t={}){let n=e,r=Cle(t),o,s;if(typeof r.filter==="function")s=r.filter,n=s("",n);else if(Cn(r.filter))s=r.filter,o=s;let i=[];if(typeof n!=="object"||n===null)return"";let a=bU[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;if(!o)o=Object.keys(n);if(r.sort)o.sort(r.sort);let l=new WeakMap;for(let f=0;f<o.length;++f){let m=o[f];if(r.skipNulls&&n[m]===null)continue;EU(i,xU(n[m],m,a,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=i.join(r.delimiter),d=r.addQueryPrefix===!0?"?":"";if(r.charsetSentinel)if(r.charset==="iso-8859-1")d+="utf8=%26%2310003%3B&";else d+="utf8=%E2%9C%93&";return u.length>0?d+u:""}var bU,EU=function(e,t){Array.prototype.push.apply(e,Cn(t)?t:[t])},SU,Yt,$v;var wU=O(()=>{yU();Mv();ro();bU={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},Yt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:gU,encodeValuesOnly:!1,format:Dv,formatter:Lv,indices:!1,serializeDate(e){return(SU??(SU=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};$v={}});function AU(e){return vU(e,{arrayFormat:"brackets"})}var zv=O(()=>{wU()});function kg(e){if(!e)return;let t;try{t=new URL(e)}catch(r){throw new st(`Invalid token endpoint base URL "${e}": ${r}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1"))return;throw new st(`Refusing to send credential over non-https token endpoint "${e}"`)}async function Rg(e,t){let n=await Ole(e),r;try{r=JSON.parse(n)}catch{throw new st(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Xn(n),t)}if(!r.access_token)throw new st(`Token endpoint response missing access_token: ${JSON.stringify(Xn(r))}`,e.status,Xn(r),t);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new st(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,e.status,Xn(r),t);return r}function Xn(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=jv)return e;return e.slice(0,jv)+`... <${e.length-jv} more chars>`}return JSON.stringify(Xn(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(Rle.has(n))t[n]=r;return t}return null}async function Og(e,t=(n)=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let n=await import("node:fs"),r=e,o;try{r=await n.promises.realpath(e),o=await n.promises.stat(r)}catch{return}let s=o.mode&511;if(s&18)throw new st(`Credentials file at ${r} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(s&36)throw new st(`Credentials file at ${r} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);if(typeof process.getuid==="function"&&o.uid!==process.getuid())t(`credentials file at ${r} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Pg(e,t){let n=await import("node:fs"),o=(await import("node:path")).dirname(e);await n.promises.mkdir(o,{recursive:!0,mode:448});let s=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let i=await n.promises.open(s,"w",384);try{await i.writeFile(JSON.stringify(t,null,2)),await i.sync()}finally{await i.close()}await n.promises.rename(s,e)}catch(i){throw await n.promises.unlink(s).catch(()=>{}),i}try{let i=await n.promises.open(o,"r");try{await i.sync()}finally{await i.close()}}catch{}}async function Ole(e){if(!e.body)return"";let t=e.body.getReader(),n=[],r=0;for(;;){let{done:s,value:i}=await t.read();if(s)break;if(r+i.length>TU){let a=TU-r;if(a>0)n.push(i.subarray(0,a));await t.cancel();break}n.push(i),r+=i.length}let o;if(n.length===1)o=n[0];else{o=new Uint8Array(n.reduce((i,a)=>i+a.length,0));let s=0;for(let i of n)o.set(i,s),s+=i.length}return new TextDecoder("utf-8").decode(o)}var CU="urn:ietf:params:oauth:grant-type:jwt-bearer",kU="refresh_token",Cg="/v1/oauth/token",sa="oauth-2025-04-20",RU="oidc-federation-2026-04-01",OU=120,rl=30,PU=5,TU=1048576,jv=2000,Rle,st;var ol=O(()=>{wt();Rle=new Set(["error","error_description","error_uri"]);st=class st extends H{constructor(e,t=null,n=null,r=null){super(e);this.statusCode=t,this.body=n,this.requestId=r}}});function so(){return Math.floor(Date.now()/1000)}class Hv{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let n=t.expiresAt-so();if(n>OU)return t.token;if(n>rl)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(so()-this.lastAdvisoryError<PU)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=so(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var IU=O(()=>{ol()});var Le=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function NU(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function sl(e){let t;return(DU??(t=new globalThis.TextEncoder,DU=t.encode.bind(t)))(e)}function Bv(e){let t;return(LU??(t=new globalThis.TextDecoder,LU=t.decode.bind(t)))(e)}var DU,LU;var MU=O(()=>{wt()});function Bd(){}function Ig(e,t,n){if(!t||Dg[e]>Dg[n])return Bd;else return t[e].bind(t)}function Gv(e,t){let n=UU.get(e);if(n&&n[0]===t)return n[1];let r={error:Ig("error",e,t),warn:Ig("warn",e,t),info:Ig("info",e,t),debug:Ig("debug",e,t)};return UU.set(e,[t,r]),r}function Be(e){let t=e.logger,n=e.logLevel??"off";if(!t)return Ple;return Gv(t,n)}function $U(){let e=Le("ANTHROPIC_LOG");if(!Kv||e!==FU)FU=e,Kv=Gv(console,Lg(e,"process.env['ANTHROPIC_LOG']",Gv(console,Kd))??Kd);return Kv}var Kd="warn",Dg,Lg=(e,t,n)=>{if(!e)return;if(iU(Dg,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Dg))}`);return},Ple,UU,FU,Kv,Ko=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var Go=O(()=>{ro();Dg={off:0,error:200,warn:300,info:400,debug:500};Ple={error:Bd,warn:Bd,info:Bd,debug:Bd},UU=new WeakMap});var Wv=O(()=>{ro();MU();Go();zv()});function zU(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!Ile.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Ng="1.0",Ile,jU=async(e)=>{var t,n;let r=await Vv();if(r===null)return null;let o=e??await BU();if(o===null)return null;zU(o);let s=await import("node:fs"),a=(await import("node:path")).join(r,"configs",`${o}.json`),c;try{c=await s.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=Le("ANTHROPIC_ORGANIZATION_ID"),f=Le("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Le("ANTHROPIC_FEDERATION_RULE_ID");if(m&&d)return{fromFile:!1,config:{organization_id:d,workspace_id:Le("ANTHROPIC_WORKSPACE_ID"),base_url:Le("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Le("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:Le("ANTHROPIC_SCOPE")}}};return null}let l;try{l=JSON.parse(c)}catch(d){throw Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=Le("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=Le("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=Le("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=Le("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=Le("ANTHROPIC_IDENTITY_TOKEN_FILE");if(d)l.authentication.identity_token={source:"file",path:d}}if(!l.authentication.federation_rule_id)l.authentication.federation_rule_id=Le("ANTHROPIC_FEDERATION_RULE_ID")??"";(n=l.authentication).service_account_id??(n.service_account_id=Le("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},HU=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await Vv();if(!n)return null;let r=t??await BU();if(!r)return null;return zU(r),(await import("node:path")).join(n,"credentials",`${r}.json`)},Vv=async()=>{if(!Dle())return null;let e=await import("node:path"),t=Le("ANTHROPIC_CONFIG_DIR");if(t)return t;if(jd()["X-Stainless-OS"]==="Windows"){let s=Le("APPDATA");if(s)return e.join(s,"Anthropic");let i=Le("USERPROFILE");if(i)return e.join(i,"AppData","Roaming","Anthropic");return null}let r=Le("XDG_CONFIG_HOME");if(r)return e.join(r,"anthropic");let o=Le("HOME");if(o)return e.join(o,".config","anthropic");return null},Dle=()=>{let e=jd()["X-Stainless-Runtime"];return e==="node"||e==="deno"},BU=async()=>{let e=await Vv();if(!e)return null;let t=Le("ANTHROPIC_PROFILE");if(t)return t;let n=await import("node:fs"),o=(await import("node:path")).join(e,"active_config");try{return(await n.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw Error(`failed to read ${o}: ${s}`);return"default"}};var qv=O(()=>{wg();Wv();Ile=/^[A-Za-z0-9_.-]+$/});function Zv(e){if(!e)throw new H("Identity token file path is empty");return async()=>{let t=await import("node:fs"),n;try{n=await t.promises.readFile(e,"utf-8")}catch(o){throw new H(`Failed to read identity token file at ${e}: ${o}`)}let r=n.trim();if(!r)throw new H(`Identity token file at ${e} is empty`);return r}}function KU(e){if(!e)throw new H("Identity token value is empty");return()=>e}var GU=O(()=>{wt()});function WU(e){return async()=>{kg(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new st(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:CU,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)n.service_account_id=e.serviceAccountId;if(e.workspaceId)n.workspace_id=e.workspaceId;let r=`${e.baseURL}${Cg}`,o;try{o=await e.fetch(r,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${sa},${RU}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mr} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new st(`Failed to reach token endpoint ${r}: ${c}`)}let s=o.headers.get("Request-Id");if(!o.ok){let c=await o.text().catch(()=>""),l=Xn(c),u="";if(o.status===401)u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new st(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${l}${u}`,o.status,l,s)}let i=await Rg(o,s),a=Number(i.expires_in);if(!Number.isFinite(a))throw new st(`Token endpoint response missing required fields: ${JSON.stringify(Xn(i))}`,o.status,Xn(i),s);return{token:i.access_token,expiresAt:so()+a}}}var VU=O(()=>{ol()});function qU(e){return async(t)=>{let n=await import("node:fs");await Og(e.credentialsPath,e.onSafetyWarning);let r;try{r=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(y){throw new st(`Credentials file not found at ${e.credentialsPath}: ${y}`)}let o;try{o=JSON.parse(r)}catch(y){throw new st(`Credentials file at ${e.credentialsPath} is not valid JSON: ${y}`)}let s=o.access_token;if(!s)throw new st(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let i=o.expires_at;if(!t?.forceRefresh&&(i==null||so()<i-rl))return{token:s,expiresAt:i??null};let a=o.refresh_token;if(!e.clientId||!a)throw new st(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${a?"set":"empty"})`);kg(e.baseURL);let c={grant_type:kU,refresh_token:a,client_id:e.clientId},l=`${e.baseURL}${Cg}`,u;try{u=await e.fetch(l,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":sa,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Mr} userOAuthProvider`},body:JSON.stringify(c)})}catch(y){throw new st(`User OAuth refresh failed to reach token endpoint: ${y}`)}let d=u.headers.get("Request-Id");if(!u.ok){let y=await u.text().catch(()=>"");throw new st(`User OAuth refresh failed (HTTP ${u.status}): ${Xn(y)}`,u.status,Xn(y),d)}let f=await Rg(u,d),m=Number(f.expires_in);if(!Number.isFinite(m))throw new st(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Xn(f))}`,u.status,Xn(f),d);let h=so()+m,_=f.refresh_token||a;return await Pg(e.credentialsPath,{...o,version:Ng,type:"oauth_token",access_token:f.access_token,expires_at:h,refresh_token:_}),{token:f.access_token,expiresAt:h}}}var ZU=O(()=>{qv();ol()});function Yv(e,t){let n=e.authentication.credentials_path??null,r=(e.base_url||t.baseURL).replace(/\/+$/,""),o=Lle(e,n,r,t),s={};if(e.workspace_id&&e.authentication.type==="user_oauth")s["anthropic-workspace-id"]=e.workspace_id;return{provider:o,extraHeaders:s,baseURL:e.base_url||void 0}}async function YU(e,t){let n=await jU(t);if(!n)return null;let{config:r,fromFile:o}=n,s=r.authentication.credentials_path||!o?r:{...r,authentication:{...r.authentication,credentials_path:await HU(r,t)??void 0}};return Yv(s,e)}function Lle(e,t,n,r){switch(e.authentication.type){case"oidc_federation":{let o=e.authentication,s=Nle(o);if(!s)throw new st("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new st("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new st("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let i=WU({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:e.organization_id,serviceAccountId:o.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});if(t)return Mle(i,t,r.onCacheWriteError,r.onSafetyWarning);return i}case"user_oauth":{if(!t)throw new st("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return qU({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let o=e.authentication.type;throw new st(`authentication.type "${o}" is not a known authentication type`)}}}function Nle(e){if(e.identity_token){let r=e.identity_token.source;if(r!=="file")throw new st(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new st('identity_token.source "file" requires a non-empty path');return Zv(e.identity_token.path)}let t=Le("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return Zv(t);let n=Le("ANTHROPIC_IDENTITY_TOKEN");if(n)return KU(n);return null}function Mle(e,t,n,r){return async(o)=>{let s=await import("node:fs");await Og(t,r);let i;try{let c=await s.promises.readFile(t,"utf-8");i=JSON.parse(c);let l=i?.access_token;if(l&&!o?.forceRefresh){let u=i?.expires_at;if(u==null||so()<u-rl)return{token:l,expiresAt:u??null}}}catch(c){if(c?.code!=="ENOENT"&&!(c instanceof SyntaxError))n?.(c)}let a=await e(o);try{await Pg(t,{...i??{},version:Ng,type:"oauth_token",access_token:a.token,expires_at:a.expiresAt})}catch(c){n?.(c)}return a}}var JU=O(()=>{qv();ol();GU();VU();ZU()});class ti{constructor(){Sr.set(this,void 0),br.set(this,void 0),M(this,Sr,new Uint8Array,"f"),M(this,br,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?sl(e):e;M(this,Sr,NU([E(this,Sr,"f"),t]),"f");let n=[],r;while((r=Ule(E(this,Sr,"f"),E(this,br,"f")))!=null){if(r.carriage&&E(this,br,"f")==null){M(this,br,r.index,"f");continue}if(E(this,br,"f")!=null&&(r.index!==E(this,br,"f")+1||r.carriage)){n.push(Bv(E(this,Sr,"f").subarray(0,E(this,br,"f")-1))),M(this,Sr,E(this,Sr,"f").subarray(E(this,br,"f")),"f"),M(this,br,null,"f");continue}let o=E(this,br,"f")!==null?r.preceding-1:r.preceding,s=Bv(E(this,Sr,"f").subarray(0,o));n.push(s),M(this,Sr,E(this,Sr,"f").subarray(r.index),"f"),M(this,br,null,"f")}return n}flush(){if(!E(this,Sr,"f").length)return[];return this.decode(`
30
+ `)}}function Ule(e,t){for(let o=t??0;o<e.length;o++){if(e[o]===10)return{preceding:o,index:o+1,carriage:!1};if(e[o]===13)return{preceding:o,index:o+1,carriage:!0}}return null}function XU(e){for(let r=0;r<e.length-1;r++){if(e[r]===10&&e[r+1]===10)return r+2;if(e[r]===13&&e[r+1]===13)return r+2;if(e[r]===13&&e[r+1]===10&&r+3<e.length&&e[r+2]===13&&e[r+3]===10)return r+4}return-1}var Sr,br;var Jv=O(()=>{Jn();Sr=new WeakMap,br=new WeakMap;ti.NEWLINE_CHARS=new Set([`
31
+ `,"\r"]);ti.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*QU(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new H("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new H("Attempted to iterate over a response with no body")}let n=new eF,r=new ti,o=Hd(e.body);for await(let s of Fle(o))for(let i of r.decode(s)){let a=n.decode(i);if(a)yield a}for(let s of r.flush()){let i=n.decode(s);if(i)yield i}}async function*Fle(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==="string"?sl(n):n,o=new Uint8Array(t.length+r.length);o.set(t),o.set(r,t.length),t=o;let s;while((s=XU(t))!==-1)yield t.slice(0,s),t=t.slice(s)}if(t.length>0)yield t}class eF{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r"))e=e.substring(0,e.length-1);if(!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
32
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=$le(e,":");if(r.startsWith(" "))r=r.substring(1);if(t==="event")this.event=r;else if(t==="data")this.data.push(r);return null}}function $le(e,t){let n=e.indexOf(t);if(n!==-1)return[e.substring(0,n),t,e.substring(n+t.length)];return[e,"",""]}var Gd,kn;var Wd=O(()=>{Jn();wt();Jv();ro();Go();wt();kn=class kn{constructor(e,t,n){this.iterator=e,Gd.set(this,void 0),this.controller=t,M(this,Gd,n,"f")}static rawEvents(e,t=new AbortController){return QU(e,t)}static fromSSEResponse(e,t,n){let r=!1,o=n?Be(n):console;async function*s(){if(r)throw new H("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let a of QU(e,t)){if(a.event==="completion")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="message_start"||a.event==="message_delta"||a.event==="message_stop"||a.event==="content_block_start"||a.event==="content_block_delta"||a.event==="content_block_stop"||a.event==="message"||a.event==="user.message"||a.event==="user.interrupt"||a.event==="user.tool_confirmation"||a.event==="user.custom_tool_result"||a.event==="user.tool_result"||a.event==="agent.message"||a.event==="agent.thinking"||a.event==="agent.tool_use"||a.event==="agent.tool_result"||a.event==="agent.mcp_tool_use"||a.event==="agent.mcp_tool_result"||a.event==="agent.custom_tool_use"||a.event==="agent.thread_context_compacted"||a.event==="session.status_running"||a.event==="session.status_idle"||a.event==="session.status_rescheduled"||a.event==="session.status_terminated"||a.event==="session.error"||a.event==="session.deleted"||a.event==="session.updated"||a.event==="span.model_request_start"||a.event==="span.model_request_end"||a.event==="span.outcome_evaluation_start"||a.event==="span.outcome_evaluation_ongoing"||a.event==="span.outcome_evaluation_end"||a.event==="user.define_outcome"||a.event==="agent.thread_message_received"||a.event==="agent.thread_message_sent"||a.event==="agent.session_thread_message_received"||a.event==="agent.session_thread_message_sent"||a.event==="session.thread_created"||a.event==="session.thread_status_created"||a.event==="session.thread_status_running"||a.event==="session.thread_status_idle"||a.event==="session.thread_status_rescheduled"||a.event==="session.thread_status_terminated"||a.event==="event_start"||a.event==="event_delta"||a.event==="system.message")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="ping")continue;if(a.event==="error"){let c=zd(a.data)??a.data,l=c?.error?.type;throw new Nt(void 0,c,void 0,e.headers,l)}}i=!0}catch(a){if(Nr(a))return;throw a}finally{if(!i)t.abort()}}return new kn(s,t,n)}static fromReadableStream(e,t,n){let r=!1;async function*o(){let i=new ti,a=Hd(e);for await(let c of a)for(let l of i.decode(c))yield l;for(let c of i.flush())yield c}async function*s(){if(r)throw new H("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let a of o()){if(i)continue;if(a)yield JSON.parse(a)}i=!0}catch(a){if(Nr(a))return;throw a}finally{if(!i)t.abort()}}return new kn(s,t,n)}[(Gd=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=(o)=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),t.push(s)}return o.shift()}});return[new kn(()=>r(e),this.controller,E(this,Gd,"f")),new kn(()=>r(t),this.controller,E(this,Gd,"f"))]}toReadableStream(){let e=this,t;return Iv({async start(){t=e[Symbol.asyncIterator]()},async pull(n){try{let{value:r,done:o}=await t.next();if(o)return n.close();let s=sl(JSON.stringify(r)+`
33
+ `);n.enqueue(s)}catch(r){n.error(r)}},async cancel(){await t.return?.()}})}}});async function Mg(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:s}=t,i=await(async()=>{if(t.options.stream)return Be(e).debug("response",n.status,n.url,n.headers,n.body),kn.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let f=await n.json();return Vd(f,n)}return await n.text()})();return Be(e).debug(`[${r}] response parsed`,Ko({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-s})),i}function Vd(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e;return Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var Ug=O(()=>{Wd();Go()});function Xv(e){return typeof e==="object"&&e!==null&&nF.has(e)}function rF(e){let t=new Set;while(typeof e==="object"&&e!==null&&!t.has(e)){if(t.add(e),Xv(e)||Nr(e)||e instanceof hs||e instanceof vg)return!0;e=e.cause}return!1}function Qv(e,t,n,r){return async(o,s={})=>{if(t.length===0)return e.call(void 0,o,s);let i=s.headers instanceof Headers?s.headers:new Headers(s.headers),a=await jle(e,t,n,r)({...s,headers:i,url:typeof o==="string"?o:o instanceof URL?o.href:o.url});if(a.bodyUsed||a.body?.locked)throw new H("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function zle(e,t){let n=new WeakMap;return{options:e,logger:t?Be(t):$U(),parse(r){if(e?.stream&&r.ok)return tF(r,e);let o=n.get(r);if(!o)o=tF(r,e),n.set(r,o);return o}}}async function tF(e,t){if(e.bodyUsed||e.body?.locked)throw new H("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return kn.fromSSEResponse(e.clone(),new AbortController);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){if(e.headers.get("content-length")==="0")return;return Vd(await e.clone().json(),e)}return await e.clone().text()}function jle(e,t,n,r){let o=async({url:i,...a})=>{try{return await e.call(void 0,i,a)}catch(c){let l=oa(c);throw nF.add(l),l}},s=zle(n,r);for(let i=t.length-1;i>=0;i--){let a=t[i],c=o;o=async(l)=>a(l,c,s)}return o}var nF;var oF=O(()=>{Ug();Go();wt();Wd();nF=new WeakSet});var qd,ia;var Fg=O(()=>{Jn();Ug();ia=class ia extends Promise{constructor(e,t,n=Mg){super((r)=>{r(null)});this.responsePromise=t,this.parseResponse=n,qd.set(this,void 0),M(this,qd,e,"f")}_thenUnwrap(e){return new ia(E(this,qd,"f"),this.responsePromise,async(t,n)=>Vd(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then((e)=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((e)=>this.parseResponse(E(this,qd,"f"),e));return this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};qd=new WeakMap});var $g,zg,jg,io,Ce,ew;var Qe=O(()=>{Jn();wt();Ug();Fg();ro();zg=class zg{constructor(e,t,n,r){$g.set(this,void 0),M(this,$g,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new H("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await E(this,$g,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;yield e;while(e.hasNextPage())e=await e.getNextPage(),yield e}async*[($g=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}};jg=class jg extends ia{constructor(e,t,n){super(e,t,async(r,o)=>new n(r,o.response,await Mg(r,o),o.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}};io=class io extends zg{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let t=this.first_id;if(!t)return null;return{...this.options,query:{...$d(this.options.query),before_id:t}}}let e=this.last_id;if(!e)return null;return{...this.options,query:{...$d(this.options.query),after_id:e}}}};Ce=class Ce extends zg{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;if(!e)return null;return{...this.options,query:{...$d(this.options.query),page:e}}}};ew=class ew extends zg{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.next_page=n.next_page||null,this.prev_page=n.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;if(!e)return null;return{...this.options,query:{...$d(this.options.query),page:e}}}}});function aa(e,t,n){return nw(),new File(e,t??"unknown_file",n)}function Zd(e,t){let n=typeof e==="object"&&e!==null&&(("name"in e)&&e.name&&String(e.name)||("url"in e)&&e.url&&String(e.url)||("filename"in e)&&e.filename&&String(e.filename)||("path"in e)&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function Ble(e){let t=typeof e==="function"?e:e.fetch,n=sF.get(t);if(n)return n;let r=(async()=>{try{let o="Response"in t?t.Response:(await t("data:,")).constructor,s=new FormData;if(s.toString()===await new o(s).text())return!1;return!0}catch{return!0}})();return sF.set(t,r),r}var nw=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node==="string"&&parseInt(e.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},rw=(e)=>e!=null&&typeof e==="object"&&typeof e[Symbol.asyncIterator]==="function",il=async(e,t,n=!0)=>({...e,body:await Kle(e.body,t,n)}),sF,Kle=async(e,t,n=!0)=>{if(!await Ble(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([o,s])=>tw(r,o,s,n))),r},Gle=(e)=>e instanceof Blob&&("name"in e),tw=async(e,t,n,r)=>{if(n===void 0)return;if(n==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n==="string"||typeof n==="number"||typeof n==="boolean")e.append(t,String(n));else if(n instanceof Response){let o={},s=n.headers.get("Content-Type");if(s)o={type:s};e.append(t,aa([await n.blob()],Zd(n,r),o))}else if(rw(n))e.append(t,aa([await new Response(Ag(n)).blob()],Zd(n,r)));else if(Gle(n))e.append(t,aa([n],Zd(n,r),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map((o)=>tw(e,t+"[]",o,r)));else if(typeof n==="object")await Promise.all(Object.entries(n).map(([o,s])=>tw(e,`${t}[${o}]`,s,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)};var al=O(()=>{sF=new WeakMap});async function Hg(e,t,n){if(nw(),e=await e,t||(t=Zd(e,!0)),Wle(e)){if(e instanceof File&&t==null&&n==null)return e;return aa([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n})}if(Vle(e)){let o=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),aa(await ow(o),t,n)}let r=await ow(e);if(!n?.type){let o=r.find((s)=>typeof s==="object"&&("type"in s)&&s.type);if(typeof o==="string")n={...n,type:o}}return aa(r,t,n)}async function ow(e){let t=[];if(typeof e==="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(iF(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(rw(e))for await(let n of e)t.push(...await ow(n));else{let n=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${qle(e)}`)}return t}function qle(e){if(typeof e!=="object"||e===null)return"";return`; props: [${Object.getOwnPropertyNames(e).map((n)=>`"${n}"`).join(", ")}]`}var iF=(e)=>e!=null&&typeof e==="object"&&typeof e.size==="number"&&typeof e.type==="string"&&typeof e.text==="function"&&typeof e.slice==="function"&&typeof e.arrayBuffer==="function",Wle=(e)=>e!=null&&typeof e==="object"&&typeof e.name==="string"&&typeof e.lastModified==="number"&&iF(e),Vle=(e)=>e!=null&&typeof e==="object"&&typeof e.url==="string"&&typeof e.blob==="function";var aF=O(()=>{al();al()});var sw=O(()=>{aF()});var cF=()=>{};class se{constructor(e){this._client=e}}function*Yle(e){if(!e)return;if(lF in e){let{values:r,nulls:o}=e;yield*r.entries();for(let s of o)yield[s,null];return}let t=!1,n;if(e instanceof Headers)n=e.entries();else if(Ov(e))n=e;else t=!0,n=Object.entries(e??{});for(let r of n){let o=r[0];if(typeof o!=="string")throw TypeError("expected header name to be a string");let s=Ov(r[1])?r[1]:[r[1]],i=!1;for(let a of s){if(a===void 0)continue;if(t&&!i)i=!0,yield[o,Bg];yield[o,a]}}}var lF,Bg,Jle,uF=(e,t)=>{let n=e?e.split(",").map((r)=>r.trim()).filter(Boolean):[];for(let r of t.split(",").map((o)=>o.trim()))if(r&&!n.includes(r))n.push(r);return n.join(", ")},k=(e)=>{let t=new Headers,n=new Set;for(let r of e){let o=new Set;for(let[s,i]of Yle(r)){let a=s.toLowerCase();if(Jle.has(a)){if(i===Bg)continue;if(i===null)t.delete(s),n.add(a);else t.set(s,uF(t.get(s),i)),n.delete(a);continue}if(i===Bg||!o.has(a)){if(t.delete(s),o.add(a),i===Bg)continue}if(i===null)t.delete(s),n.add(a);else t.append(s,i),n.delete(a)}}return{[lF]:!0,values:t,nulls:n}};var Ne=O(()=>{ro();lF=Symbol.for("brand.privateNullableHeaders");Bg=Symbol("clear"),Jle=new Set(["x-stainless-helper"])});function pF(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var dF,Xle=(e=pF)=>function(n,...r){if(n.length===1)return n[0];let o=!1,s=[],i=n.reduce((u,d,f)=>{if(/[?#]/.test(d))o=!0;let m=r[f],h=(o?encodeURIComponent:e)(""+m);if(f!==r.length&&(m==null||typeof m==="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??dF)??dF)?.toString))h=m+"",s.push({start:u.length+d.length,length:h.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`});return u+d+(f===r.length?"":h)},""),a=i.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;while((l=c.exec(a))!==null)s.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(s.sort((u,d)=>u.start-d.start),s.length>0){let u=0,d=s.reduce((f,m)=>{let h=" ".repeat(m.start-u),_="^".repeat(m.length);return u=m.start+m.length,f+h+_},"");throw new H(`Path parameters result in path with invalid segments:
34
+ ${s.map((f)=>f.error).join(`
35
+ `)}
36
+ ${i}
37
+ ${d}`)}return i},U;var lt=O(()=>{wt();dF=Object.freeze(Object.create(null)),U=Xle(pF)});var Yd;var iw=O(()=>{Qe();Ne();lt();Yd=class Yd extends se{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/deployment_runs/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}}});var Jd;var aw=O(()=>{Qe();Ne();lt();Jd=class Jd extends se{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/deployments?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/deployments/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/deployments/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/deployments?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/deployments/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}pause(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/deployments/${e}/pause?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}run(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/deployments/${e}/run?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}unpause(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/deployments/${e}/unpause?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Xd;var cw=O(()=>{Qe();Ne();lt();Xd=class Xd extends se{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/dreams?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"dreaming-2026-04-21"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/dreams/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/dreams?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"dreaming-2026-04-21"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/dreams/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/dreams/${e}/cancel?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}}});function tp(e){return{["x-stainless-helper"]:e}}function Kg(e){return typeof e==="object"&&e!==null&&Qd in e}function lw(e,t){let n=new Set;if(e){for(let r of e)if(Kg(r))n.add(r[Qd])}if(t)for(let r of t){if(Kg(r))n.add(r[Qd]);let o=r.content;if(Array.isArray(o)){for(let s of o)if(Kg(s))n.add(s[Qd])}}return Array.from(n)}function Wg(e,t){let n=lw(e,t);if(n.length===0)return{};return{["x-stainless-helper"]:n.join(", ")}}function fF(e){if(Kg(e))return{["x-stainless-helper"]:e[Qd]};return{}}var ep="x-stainless-helper",Gg="x-stainless-helper-method",Qd;var Wo=O(()=>{Qd=Symbol("anthropic.sdk.stainlessHelper")});var np;var uw=O(()=>{Qe();Ne();Wo();al();lt();np=class np extends se{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files?beta=true",io,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/files/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/files/${e}/content?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/files/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files?beta=true",il({body:r,...t,headers:k([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},fF(r.file),t?.headers])},this._client))}}});var rp;var dw=O(()=>{Qe();Ne();lt();rp=class rp extends se{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/models/${e}?beta=true`,{...n,headers:k([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",io,{query:r,...t,headers:k([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}});var op;var pw=O(()=>{Qe();Ne();lt();op=class op extends se{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/user_profiles?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/user_profiles/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}createEnrollmentURL(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var _F=C(function(hF){Object.defineProperty(hF,"__esModule",{value:!0});hF.timingSafeEqual=void 0;function mF(e,t=""){if(!e)throw Error(t)}function sue(e,t){if(e.byteLength!==t.byteLength)return!1;if(!(e instanceof DataView))e=new DataView(ArrayBuffer.isView(e)?e.buffer:e);if(!(t instanceof DataView))t=new DataView(ArrayBuffer.isView(t)?t.buffer:t);mF(e instanceof DataView),mF(t instanceof DataView);let n=e.byteLength,r=0,o=-1;while(++o<n)r|=e.getUint8(o)^t.getUint8(o);return r===0}hF.timingSafeEqual=sue});var bF=C(function(Er){var iue=Er&&Er.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)if(o.hasOwnProperty(s))r[s]=o[s]},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Er,"__esModule",{value:!0});var Vt=256,fw=function(){function e(t){if(t===void 0)t="=";this._paddingCharacter=t}return e.prototype.encodedLength=function(t){if(!this._paddingCharacter)return(t*8+5)/6|0;return(t+2)/3*4|0},e.prototype.encode=function(t){var n="",r=0;for(;r<t.length-2;r+=3){var o=t[r]<<16|t[r+1]<<8|t[r+2];n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),n+=this._encodeByte(o>>>6&63),n+=this._encodeByte(o>>>0&63)}var s=t.length-r;if(s>0){var o=t[r]<<16|(s===2?t[r+1]<<8:0);if(n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),s===2)n+=this._encodeByte(o>>>6&63);else n+=this._paddingCharacter||"";n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){if(!this._paddingCharacter)return(t*6+7)/8|0;return t/4*3|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);var n=this._getPaddingLength(t),r=t.length-n,o=new Uint8Array(this.maxDecodedLength(r)),s=0,i=0,a=0,c=0,l=0,u=0,d=0;for(;i<r-4;i+=4)c=this._decodeChar(t.charCodeAt(i+0)),l=this._decodeChar(t.charCodeAt(i+1)),u=this._decodeChar(t.charCodeAt(i+2)),d=this._decodeChar(t.charCodeAt(i+3)),o[s++]=c<<2|l>>>4,o[s++]=l<<4|u>>>2,o[s++]=u<<6|d,a|=c&Vt,a|=l&Vt,a|=u&Vt,a|=d&Vt;if(i<r-1)c=this._decodeChar(t.charCodeAt(i)),l=this._decodeChar(t.charCodeAt(i+1)),o[s++]=c<<2|l>>>4,a|=c&Vt,a|=l&Vt;if(i<r-2)u=this._decodeChar(t.charCodeAt(i+2)),o[s++]=l<<4|u>>>2,a|=u&Vt;if(i<r-3)d=this._decodeChar(t.charCodeAt(i+3)),o[s++]=u<<6|d,a|=d&Vt;if(a!==0)throw Error("Base64Coder: incorrect characters for decoding");return o},e.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=Vt;return n+=(42-t&t-44)>>>8&-Vt+t-43+62,n+=(46-t&t-48)>>>8&-Vt+t-47+63,n+=(47-t&t-58)>>>8&-Vt+t-48+52,n+=(64-t&t-91)>>>8&-Vt+t-65+0,n+=(96-t&t-123)>>>8&-Vt+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0;r--){if(t[r]!==this._paddingCharacter)break;n++}if(t.length<4||n>2)throw Error("Base64Coder: incorrect padding")}return n},e}();Er.Coder=fw;var sp=new fw;function aue(e){return sp.encode(e)}Er.encode=aue;function cue(e){return sp.decode(e)}Er.decode=cue;var yF=function(e){iue(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=Vt;return r+=(44-n&n-46)>>>8&-Vt+n-45+62,r+=(94-n&n-96)>>>8&-Vt+n-95+63,r+=(47-n&n-58)>>>8&-Vt+n-48+52,r+=(64-n&n-91)>>>8&-Vt+n-65+0,r+=(96-n&n-123)>>>8&-Vt+n-97+26,r},t}(fw);Er.URLSafeCoder=yF;var SF=new yF;function lue(e){return SF.encode(e)}Er.encodeURLSafe=lue;function uue(e){return SF.decode(e)}Er.decodeURLSafe=uue;Er.encodedLength=function(e){return sp.encodedLength(e)};Er.maxDecodedLength=function(e){return sp.maxDecodedLength(e)};Er.decodedLength=function(e){return sp.decodedLength(e)}});var xF=C(function(EF,Vg){(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];if(typeof Vg==="object"&&typeof Vg.exports==="object")Vg.exports=r;else if(typeof define==="function"&&define.amd)define(function(){return r});else e.sha256=r})(EF,function(e){e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(d,f,m,h,_){var y,b,v,S,x,w,D,P,F,z,q,ee,te;while(_>=64){y=f[0],b=f[1],v=f[2],S=f[3],x=f[4],w=f[5],D=f[6],P=f[7];for(z=0;z<16;z++)q=h+z*4,d[z]=(m[q]&255)<<24|(m[q+1]&255)<<16|(m[q+2]&255)<<8|m[q+3]&255;for(z=16;z<64;z++)F=d[z-2],ee=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10,F=d[z-15],te=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3,d[z]=(ee+d[z-7]|0)+(te+d[z-16]|0);for(z=0;z<64;z++)ee=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&w^~x&D)|0)+(P+(t[z]+d[z]|0)|0)|0,te=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&b^y&v^b&v)|0,P=D,D=w,w=x,x=S+ee|0,S=v,v=b,b=y,y=ee+te|0;f[0]+=y,f[1]+=b,f[2]+=v,f[3]+=S,f[4]+=x,f[5]+=w,f[6]+=D,f[7]+=P,h+=64,_-=64}return h}var r=function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var f=0;f<this.buffer.length;f++)this.buffer[f]=0;for(var f=0;f<this.temp.length;f++)this.temp[f]=0;this.reset()},d.prototype.update=function(f,m){if(m===void 0)m=f.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=m,this.bufferLength>0){while(this.bufferLength<64&&m>0)this.buffer[this.bufferLength++]=f[h++],m--;if(this.bufferLength===64)n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(m>=64)h=n(this.temp,this.state,f,h,m),m%=64;while(m>0)this.buffer[this.bufferLength++]=f[h++],m--;return this},d.prototype.finish=function(f){if(!this.finished){var m=this.bytesHashed,h=this.bufferLength,_=m/536870912|0,y=m<<3,b=m%64<56?64:128;this.buffer[h]=128;for(var v=h+1;v<b-8;v++)this.buffer[v]=0;this.buffer[b-8]=_>>>24&255,this.buffer[b-7]=_>>>16&255,this.buffer[b-6]=_>>>8&255,this.buffer[b-5]=_>>>0&255,this.buffer[b-4]=y>>>24&255,this.buffer[b-3]=y>>>16&255,this.buffer[b-2]=y>>>8&255,this.buffer[b-1]=y>>>0&255,n(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var v=0;v<8;v++)f[v*4+0]=this.state[v]>>>24&255,f[v*4+1]=this.state[v]>>>16&255,f[v*4+2]=this.state[v]>>>8&255,f[v*4+3]=this.state[v]>>>0&255;return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d.prototype._saveState=function(f){for(var m=0;m<this.state.length;m++)f[m]=this.state[m]},d.prototype._restoreState=function(f,m){for(var h=0;h<this.state.length;h++)this.state[h]=f[h];this.bytesHashed=m,this.finished=!1,this.bufferLength=0},d}();e.Hash=r;var o=function(){function d(f){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var m=new Uint8Array(this.blockSize);if(f.length>this.blockSize)new r().update(f).finish(m).clean();else for(var h=0;h<f.length;h++)m[h]=f[h];for(var h=0;h<m.length;h++)m[h]^=54;this.inner.update(m);for(var h=0;h<m.length;h++)m[h]^=106;this.outer.update(m),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<m.length;h++)m[h]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var f=0;f<this.istate.length;f++)this.ostate[f]=this.istate[f]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(f){return this.inner.update(f),this},d.prototype.finish=function(f){if(this.outer.finished)this.outer.finish(f);else this.inner.finish(f),this.outer.update(f,this.digestLength).finish(f);return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d}();e.HMAC=o;function s(d){var f=new r().update(d),m=f.digest();return f.clean(),m}e.hash=s,e.default=s;function i(d,f){var m=new o(d).update(f),h=m.digest();return m.clean(),h}e.hmac=i;function a(d,f,m,h){var _=h[0];if(_===0)throw Error("hkdf: cannot expand more");if(f.reset(),_>1)f.update(d);if(m)f.update(m);f.update(h),f.finish(d),h[0]++}var c=new Uint8Array(e.digestLength);function l(d,f,m,h){if(f===void 0)f=c;if(h===void 0)h=32;var _=new Uint8Array([1]),y=i(f,d),b=new o(y),v=new Uint8Array(b.digestLength),S=v.length,x=new Uint8Array(h);for(var w=0;w<h;w++){if(S===v.length)a(v,b,m,_),S=0;x[w]=v[S++]}return b.clean(),v.fill(0),_.fill(0),x}e.hkdf=l;function u(d,f,m,h){var _=new o(d),y=_.digestLength,b=new Uint8Array(4),v=new Uint8Array(y),S=new Uint8Array(y),x=new Uint8Array(h);for(var w=0;w*y<h;w++){var D=w+1;b[0]=D>>>24&255,b[1]=D>>>16&255,b[2]=D>>>8&255,b[3]=D>>>0&255,_.reset(),_.update(f),_.update(b),_.finish(S);for(var P=0;P<y;P++)v[P]=S[P];for(var P=2;P<=m;P++){_.reset(),_.update(S).finish(S);for(var F=0;F<y;F++)v[F]^=S[F]}for(var P=0;P<y&&w*y+P<h;P++)x[w*y+P]=v[P]}for(var w=0;w<y;w++)v[w]=S[w]=0;for(var w=0;w<4;w++)b[w]=0;return _.clean(),x}e.pbkdf2=u})});var CF=C(function(AF){Object.defineProperty(AF,"__esModule",{value:!0});AF.Webhook=AF.WebhookVerificationError=void 0;var due=_F(),vF=bF(),pue=xF(),wF=300;class mw extends Error{constructor(e){super(e);Object.setPrototypeOf(this,mw.prototype),this.name="ExtendableError",this.stack=Error(e).stack}}class ni extends mw{constructor(e){super(e);Object.setPrototypeOf(this,ni.prototype),this.name="WebhookVerificationError"}}AF.WebhookVerificationError=ni;class ip{constructor(e,t){if(!e)throw Error("Secret can't be empty.");if((t===null||t===void 0?void 0:t.format)==="raw")if(e instanceof Uint8Array)this.key=e;else this.key=Uint8Array.from(e,(n)=>n.charCodeAt(0));else{if(typeof e!=="string")throw Error("Expected secret to be of type string");if(e.startsWith(ip.prefix))e=e.substring(ip.prefix.length);this.key=vF.decode(e)}}verify(e,t){let n={};for(let d of Object.keys(t))n[d.toLowerCase()]=t[d];let r=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!r||!s)throw new ni("Missing required headers");let i=this.verifyTimestamp(s),c=this.sign(r,i,e).split(",")[1],l=o.split(" "),u=new globalThis.TextEncoder;for(let d of l){let[f,m]=d.split(",");if(f!=="v1")continue;if((0,due.timingSafeEqual)(u.encode(m),u.encode(c)))return JSON.parse(e.toString())}throw new ni("No matching signature found")}sign(e,t,n){if(typeof n==="string");else if(n.constructor.name==="Buffer")n=n.toString();else throw Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(t.getTime()/1000),s=r.encode(`${e}.${o}.${n}`);return`v1,${vF.encode(pue.hmac(this.key,s))}`}verifyTimestamp(e){let t=Math.floor(Date.now()/1000),n=parseInt(e,10);if(isNaN(n))throw new ni("Invalid Signature Headers");if(t-n>wF)throw new ni("Message timestamp too old");if(n>t+wF)throw new ni("Message timestamp too new");return new Date(n*1000)}}AF.Webhook=ip;ip.prefix="whsec_"});var kF,ap;var hw=O(()=>{kF=qn(CF(),1);ap=class ap extends se{unwrap(e,{headers:t,key:n}){if(t!==void 0){let r=n===void 0?this._client.webhookKey:n;if(r===null)throw Error("Webhook key must not be null in order to unwrap");new kF.Webhook(r).verify(e,t)}return JSON.parse(e)}}});var cp;var gw=O(()=>{Qe();Ne();lt();cp=class cp extends se{list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/agents/${e}/versions?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var cl;var _w=O(()=>{gw();gw();Qe();Ne();lt();cl=class cl extends se{constructor(){super(...arguments);this.versions=new cp(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/agents?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r,...o}=t??{};return this._client.get(U`/v1/agents/${e}?beta=true`,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/agents/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/agents/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};cl.Versions=cp});function ca(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}function ri(e,t){return e instanceof Nt&&e.status===t}function RF(e){return e instanceof Nt&&typeof e.status==="number"&&e.status>=400&&e.status<500}function oi(e){return RF(e)&&!ri(e,408)&&!ri(e,409)&&!ri(e,429)}function OF(e,t,n){return Math.min(t*2**e,n)}function yw(e,t){return e+Math.random()*(t-e)}function PF(e){return e*(1-Math.random()*0.25)}var lp=O(()=>{wt()});function qg(e,{authToken:t,helper:n}){if(!t)throw new H(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let r=e,o=r._options.defaultHeaders,s=r._authState?.extraHeaders,i=s?Object.fromEntries(Object.entries(s).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=k([i,o,{[ep]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var Sw=O(()=>{wt();Ne();Wo()});function bue(e){return OF(e,yue,Sue)}function Eue(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${nl()}`:nl()}var ll,Zg,Ur,Yg,Jg,Xg,up,dp,ul,_ue=999,yue=1000,Sue=60000,la;var Qg=O(()=>{Jn();wt();Go();Ne();lp();Sw();lp();la=class la{constructor(e){ll.set(this,void 0),Zg.set(this,!1),Ur.set(this,void 0),Yg.set(this,void 0),Jg.set(this,void 0),Xg.set(this,void 0),up.set(this,void 0),dp.set(this,void 0),ul.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??Eue(),M(this,ll,qg(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),M(this,Jg,e.autoStop??!0,"f"),M(this,Xg,e.drain??!1,"f"),M(this,up,e.blockMs===void 0?_ue:e.blockMs,"f"),M(this,dp,e.reclaimOlderThanMs??null,"f"),M(this,ul,e.requestOptions,"f"),M(this,Ur,new AbortController,"f"),M(this,Yg,ca(e.signal,E(this,Ur,"f")),"f")}get signal(){return E(this,Ur,"f").signal}abort(){E(this,Ur,"f").abort()}async*[(ll=new WeakMap,Zg=new WeakMap,Ur=new WeakMap,Yg=new WeakMap,Jg=new WeakMap,Xg=new WeakMap,up=new WeakMap,dp=new WeakMap,ul=new WeakMap,Symbol.asyncIterator)](){if(E(this,Zg,"f"))throw new H("Cannot iterate over a consumed WorkPoller");M(this,Zg,!0,"f");let e=Be(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let t=0;while(!E(this,Ur,"f").signal.aborted){let n;try{n=await E(this,ll,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...E(this,up,"f")!==null?{block_ms:E(this,up,"f")}:{},...E(this,dp,"f")!==null?{reclaim_older_than_ms:E(this,dp,"f")}:{}},{headers:k([E(this,ul,"f")?.headers]),signal:E(this,Ur,"f").signal})}catch(r){if(E(this,Ur,"f").signal.aborted)return;if(oi(r))throw e.error("poll failed permanently, stopping poller",{error:String(r)}),r;let o=PF(bue(t));e.warn("poll failed, backing off",{error:String(r),backoff_ms:o}),t++,await oo(o,E(this,Ur,"f").signal);continue}if(t=0,n==null){if(E(this,Xg,"f"))return;await oo(yw(1000,3000),E(this,Ur,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await E(this,ll,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:k([E(this,ul,"f")?.headers]),signal:E(this,Ur,"f").signal})}catch(r){e.error("ack failed",{work_id:n.id,error:String(r)});continue}try{yield n}finally{if(E(this,Jg,"f"))try{await E(this,ll,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:k([E(this,ul,"f")?.headers])})}catch(r){if(!ri(r,409))e.warn("stop failed",{work_id:n.id,error:String(r)})}}}}finally{E(this,Yg,"f").call(this)}}}});class bw{constructor(){dl.set(this,[]),si.set(this,[]),pl.set(this,!1)}push(e){if(E(this,pl,"f"))return!1;let t=E(this,si,"f").shift();if(t)t({done:!1,value:e});else E(this,dl,"f").push(e);return!0}close(){if(E(this,pl,"f"))return;M(this,pl,!0,"f");while(E(this,si,"f").length>0)E(this,si,"f").shift()({done:!0,value:void 0})}next(e){if(E(this,dl,"f").length>0)return Promise.resolve({done:!1,value:E(this,dl,"f").shift()});if(E(this,pl,"f")||e?.aborted)return Promise.resolve({done:!0,value:void 0});return new Promise((t)=>{let n=(o)=>{e?.removeEventListener("abort",r),t(o)},r=()=>{let o=E(this,si,"f").indexOf(n);if(o>=0)E(this,si,"f").splice(o,1);t({done:!0,value:void 0})};E(this,si,"f").push(n),e?.addEventListener("abort",r,{once:!0})})}tryShift(){return E(this,dl,"f").shift()}}var dl,si,pl;var IF=O(()=>{Jn();dl=new WeakMap,si=new WeakMap,pl=new WeakMap});var we;var ua=O(()=>{we=class we extends Error{constructor(e){let t=typeof e==="string"?e:e.map((n)=>{if(n.type==="text")return n.text;return`[${n.type}]`}).join(" ");super(t);this.name="ToolError",this.content=e}}});function Ew(e){return"name"in e?e.name:e.mcp_server_name}function xue(e){return e instanceof we?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function DF(e,t,n){try{let r=e.parse?e.parse(t):t;return{content:await e.run(r,n),isError:!1}}catch(r){return{content:xue(r),isError:!0}}}var LF=O(()=>{ua()});function KF(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}class GF{constructor(e,t){pp.set(this,void 0),s_.set(this,void 0),fl.set(this,new Set),da.set(this,!1),ao.set(this,void 0),M(this,pp,e,"f"),M(this,s_,t,"f")}noteEvent(e){if(e.type==="user.tool_confirmation")return;if(KF(e))this.arm();else this.disarm()}block(e){if(E(this,fl,"f").add(e),E(this,ao,"f")!==void 0)M(this,da,!0,"f"),clearTimeout(E(this,ao,"f")),M(this,ao,void 0,"f")}unblock(e){if(E(this,fl,"f").delete(e),E(this,fl,"f").size===0&&E(this,da,"f"))this.arm()}arm(){if(E(this,pp,"f")<=0)return;if(E(this,fl,"f").size>0){M(this,da,!0,"f");return}if(M(this,da,!1,"f"),E(this,ao,"f")!==void 0)clearTimeout(E(this,ao,"f"));M(this,ao,setTimeout(E(this,s_,"f"),E(this,pp,"f")),"f")}disarm(){if(M(this,da,!1,"f"),E(this,ao,"f")!==void 0)clearTimeout(E(this,ao,"f")),M(this,ao,void 0,"f")}}function Cue(e,t,n){if(e.type==="agent.custom_tool_use")return{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n};return{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function kue(e){if(typeof e==="string")return[{type:"text",text:e||"(no output)"}];let t=e.map((n)=>{if(n.type==="text")return{type:"text",text:n.text||"(no output)"};if(n.type==="image"||n.type==="document")return n;if(n.type==="search_result")return{type:"search_result",source:n.source,title:n.title,content:n.content.map((r)=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}};return{type:"text",text:JSON.stringify(n)}});return t.length>0?t:[{type:"text",text:"(no output)"}]}var pp,s_,fl,da,ao,Mt,e_,hn,t_,fp,i_,Jt,hl,xr,gl,ii,ml,gs,mp,Fr,n_,HF,NF,MF,UF,xw,FF,r_,o_,vw,$F,BF,zF=500,vue=1e4,wue=120000,Aue=30000,jF=3,Tue=60000,pa;var a_=O(()=>{Jn();wt();Go();lp();IF();Ne();Wo();LF();pp=new WeakMap,s_=new WeakMap,fl=new WeakMap,da=new WeakMap,ao=new WeakMap;pa=class pa{constructor(e,t){Mt.add(this),e_.set(this,!1),hn.set(this,void 0),t_.set(this,void 0),fp.set(this,void 0),i_.set(this,void 0),Jt.set(this,void 0),hl.set(this,new Set),xr.set(this,new Set),gl.set(this,new Map),ii.set(this,new Map),ml.set(this,new bw),gs.set(this,0),mp.set(this,null),Fr.set(this,void 0),this.client=t.client,this.sessionId=e,this.tools=t.tools,this.maxIdleMs=t.maxIdleMs??Tue,M(this,Jt,Be(t.client),"f"),M(this,i_,new Map(t.tools.map((n)=>[Ew(n),n])),"f"),M(this,hn,new AbortController,"f"),M(this,t_,ca(t.signal,E(this,hn,"f")),"f"),M(this,fp,t.requestOptions,"f"),M(this,Fr,new GF(this.maxIdleMs,()=>{E(this,Jt,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),E(this,hn,"f").abort()}),"f")}get signal(){return E(this,hn,"f").signal}abort(){E(this,hn,"f").abort()}async*[(e_=new WeakMap,hn=new WeakMap,t_=new WeakMap,fp=new WeakMap,i_=new WeakMap,Jt=new WeakMap,hl=new WeakMap,xr=new WeakMap,gl=new WeakMap,ii=new WeakMap,ml=new WeakMap,gs=new WeakMap,mp=new WeakMap,Fr=new WeakMap,Mt=new WeakSet,Symbol.asyncIterator)](){if(E(this,e_,"f"))throw new H("Cannot iterate over a consumed SessionToolRunner");M(this,e_,!0,"f"),E(this,Jt,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=E(this,Mt,"m",HF).call(this).catch((t)=>{if(!E(this,hn,"f").signal.aborted)E(this,Jt,"f").error("stream loop failed",{error:String(t)});E(this,hn,"f").abort()});try{while(!0){let n=await E(this,ml,"f").next(E(this,hn,"f").signal);if(n.done)break;yield n.value}await e;let t;while((t=E(this,ml,"f").tryShift())!==void 0)yield t}finally{E(this,hn,"f").abort(),E(this,Fr,"f").disarm(),await e;try{await E(this,Mt,"m",BF).call(this)}catch(t){E(this,Jt,"f").warn("drain failed",{error:String(t)})}E(this,ml,"f").close();for(let t of this.tools)try{await t.close?.()}catch(n){E(this,Jt,"f").warn("tool.close failed",{tool:Ew(t),error:String(n)})}E(this,t_,"f").call(this)}}};n_=function(){return{...E(this,fp,"f"),headers:k([tp("session-tool-runner"),E(this,fp,"f")?.headers]),signal:E(this,hn,"f").signal}},HF=async function(){let t=E(this,hn,"f"),n=zF;while(!t.signal.aborted){try{let r=await this.client.beta.sessions.events.stream(this.sessionId,{},E(this,Mt,"m",n_).call(this));await E(this,Mt,"m",NF).call(this);for await(let o of r)if(n=zF,await E(this,Mt,"m",UF).call(this,o))return}catch(r){if(t.signal.throwIfAborted(),oi(r))throw E(this,Jt,"f").error("permanent stream failure, shutting down",{error:String(r)}),t.abort(),r;E(this,Jt,"f").warn("stream disconnected, reconnecting",{error:String(r),backoff_ms:n})}t.signal.throwIfAborted(),await oo(n,t.signal),n=Math.min(n*2,vue)}},NF=async function(){let t=E(this,hn,"f"),n=[],r=!1;try{for await(let i of this.client.beta.sessions.events.list(this.sessionId,{limit:1000},E(this,Mt,"m",n_).call(this)))E(this,Mt,"m",MF).call(this,i,n),r=KF(i)}catch(i){t.signal.throwIfAborted(),E(this,Jt,"f").warn("reconcile list failed",{error:String(i)});for(let a of n)E(this,hl,"f").delete(a.id);return}let o=n.filter((i)=>!E(this,xr,"f").has(i.id));E(this,Fr,"f").disarm();for(let i of o)await E(this,Mt,"m",xw).call(this,i);for(let i of[...E(this,ii,"f").values()]){let a=E(this,gl,"f").get(i.id);if(a!==void 0)await E(this,Mt,"m",r_).call(this,i,a)}let s=o.filter((i)=>!E(this,xr,"f").has(i.id)&&!E(this,ii,"f").has(i.id));if(r&&s.length===0)E(this,Fr,"f").arm();else E(this,Fr,"f").disarm()},MF=function(t,n){if(t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"){if(E(this,hl,"f").add(t.id),!E(this,xr,"f").has(t.id))n.push(t)}else if(t.type==="user.tool_result")E(this,xr,"f").add(t.tool_use_id);else if(t.type==="user.custom_tool_result")E(this,xr,"f").add(t.custom_tool_use_id);else if(t.type==="user.tool_confirmation"){if(!E(this,xr,"f").has(t.tool_use_id))E(this,gl,"f").set(t.tool_use_id,t.result)}},UF=async function(t){switch(E(this,Fr,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":if(!E(this,hl,"f").has(t.id))E(this,hl,"f").add(t.id),await E(this,Mt,"m",xw).call(this,t);return!1;case"user.tool_confirmation":return await E(this,Mt,"m",FF).call(this,t),!1;case"user.tool_result":return E(this,xr,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return E(this,xr,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return E(this,Jt,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),E(this,hn,"f").abort(),!0;default:return!1}},xw=async function(t){let n=t.evaluated_permission,r=n==="deny"?"deny":E(this,gl,"f").get(t.id);if(r===void 0){if(n===void 0||n==="allow")await E(this,Mt,"m",vw).call(this,t,void 0);else if(!E(this,ii,"f").has(t.id))E(this,Jt,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,ii,"f").set(t.id,t),E(this,Fr,"f").block(t.id);return}await E(this,Mt,"m",r_).call(this,t,r)},FF=async function(t){E(this,gl,"f").set(t.tool_use_id,t.result);let n=E(this,ii,"f").get(t.tool_use_id);if(n===void 0)return;await E(this,Mt,"m",r_).call(this,n,t.result)},r_=async function(t,n){let r=E(this,ii,"f").delete(t.id);if(n==="allow"){if(E(this,Jt,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),!r)E(this,Fr,"f").block(t.id);try{await E(this,Mt,"m",vw).call(this,t,"allow")}finally{E(this,Fr,"f").unblock(t.id)}return}if(r)E(this,Fr,"f").unblock(t.id);E(this,xr,"f").add(t.id),E(this,Jt,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,Mt,"m",o_).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},o_=function(t){E(this,ml,"f").push(t)},vw=async function(t,n){var r,o;if(E(this,xr,"f").has(t.id))return;E(this,Jt,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),M(this,gs,(r=E(this,gs,"f"),r++,r),"f");try{let s=E(this,i_,"f").get(t.name);if(!s){E(this,Jt,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,Mt,"m",o_).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let i,a,c=new AbortController,l=ca(E(this,hn,"f").signal,c),u=setTimeout(()=>c.abort(),wue);try{let m=await DF(s,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});i=m.content,a=m.isError}finally{clearTimeout(u),l()}let d=Cue(t,a,kue(i)),f=await E(this,Mt,"m",$F).call(this,d,t.id);E(this,Mt,"m",o_).call(this,{event:t,result:d,toolUseId:t.id,name:t.name,isError:a,posted:f,confirmation:n})}finally{if(M(this,gs,(o=E(this,gs,"f"),o--,o),"f"),E(this,gs,"f")===0)E(this,mp,"f")?.call(this)}},$F=async function(t,n){let r=E(this,hn,"f"),o;for(let s=0;s<jF;s++){r.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},E(this,Mt,"m",n_).call(this)),E(this,xr,"f").add(n),!0}catch(i){if(o=i,oi(i))break;if(s<jF-1)await oo((s+1)*1000,r.signal)}}return E(this,Jt,"f").error("failed to send tool result",{tool_use_id:n,error:String(o)}),!1},BF=async function(){if(E(this,gs,"f")===0)return;if(await Promise.race([new Promise((t)=>M(this,mp,t,"f")),oo(Aue)]),M(this,mp,null,"f"),E(this,gs,"f")>0)E(this,Jt,"f").warn("drain timeout exceeded")}});var WF=O(()=>{Wv()});function fa(e){if(e.inputSchema.type!=="object")throw Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:(t)=>t,...e.close?{close:e.close}:{}}}var VF=O(()=>{ww();WF()});function _l(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}import*as vr from"node:fs/promises";import*as Mn from"node:path";import{randomUUID as Rue}from"node:crypto";async function Pue(e){try{return await vr.realpath(e)}catch{return e}}async function Iue(e){let t=[],n=e,r=0;for(;;){let o;try{o=await vr.realpath(n)}catch{let s=!1;try{s=(await vr.lstat(n)).isSymbolicLink()}catch{}if(s){if(++r>40)throw new we(`path ${JSON.stringify(e)} has too many levels of symbolic links`);n=Mn.resolve(Mn.dirname(n),await vr.readlink(n));continue}let i=Mn.dirname(n);if(i===n)return e;t.push(Mn.basename(n)),n=i;continue}return t.length?Mn.join(o,...t.reverse()):o}}async function qF(e,t,n){let r=n?.allowOutside??!1,o=await Pue(Mn.resolve(e)),s=Mn.resolve(o,t);if(r)return s;let i=await Iue(s);if(i!==o&&!i.startsWith(o+Mn.sep))throw new we(`path ${JSON.stringify(t)} escapes workdir`);return i}async function Aw(e,t){let n=Mn.dirname(e),r=Mn.join(n,`.tmp-${process.pid}-${Rue()}`),o;try{o=await vr.open(r,"wx",Oue),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await vr.rename(r,e)}catch(s){if(o)await o.close().catch(()=>{});throw await vr.unlink(r).catch(()=>{}),s}}function gp(e,t){switch(e?.code){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${e instanceof Error?e.message:String(e)}`}}var hp=493,Oue=420;var Tw=O(()=>{ua()});import*as Qn from"node:fs/promises";import*as ZF from"node:fs";import*as gn from"node:path";import{execFile as Due}from"node:child_process";import{promisify as Lue}from"node:util";import{Readable as Nue}from"node:stream";import{pipeline as Mue}from"node:stream/promises";async function YF(e){let{client:t,sessionId:n}=e;if(!t||!n)return async()=>{};let r=Be(t),o=await t.beta.sessions.retrieve(n),s=gn.resolve(e.workdir,"skills"),i=[];for(let a of o.agent.skills)try{let c=await JF(t,a.skill_id,a.version),l=await t.beta.skills.versions.retrieve(c,{skill_id:a.skill_id}),u=gn.basename(l.name.trim());if(u===""||u==="."||u==="..")u=a.skill_id;let d=gn.resolve(s,u);if(d!==s&&!d.startsWith(s+gn.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:l.name});continue}let f=await t.beta.skills.versions.download(c,{skill_id:a.skill_id});await Qn.rm(d,{recursive:!0,force:!0}),await Qn.mkdir(d,{recursive:!0,mode:hp}),i.push(d),await XF(f,d),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c,dest:d})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of i)await Qn.rm(a,{recursive:!0,force:!0}).catch((c)=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}async function JF(e,t,n){if(/^\d+$/.test(n))return n;let r;for await(let o of e.beta.skills.versions.list(t))if(/^\d+$/.test(o.version)&&(r===void 0||BigInt(o.version)>BigInt(r)))r=o.version;if(r===void 0)throw new H(`skill ${JSON.stringify(t)} has no concrete version to resolve ${JSON.stringify(n)} against`);return r}function Fue(e){for(let t of e.split(`
38
+ `)){let n=t.trim();if(!n)continue;if(gn.isAbsolute(n)||n.split(/[\\/]/).includes(".."))throw new H(`refusing to extract unsafe archive member: ${n}`)}}function $ue(e){for(let t of e.split(`
39
+ `)){let n=t.trimStart()[0];if(n==="l"||n==="h"||n==="b"||n==="c"||n==="p"||n==="s")throw new H("refusing to extract archive with symlink/hardlink/device member")}}async function Cw(e,t){try{let{stdout:n}=await Uue(e,t);return n}catch(n){if(n!=null&&typeof n==="object"&&n.code==="ENOENT")throw new H(`skill extraction requires the \`${e}\` command, but it was not found on PATH`);throw n}}function zue(e){let t,n=!1;for(let r of e.split(`
40
+ `)){let o=r.trim().split("/").filter((i)=>i!==""&&i!==".");if(o.length===0)continue;let s=o[0];if(t===void 0)t=s;else if(s!==t)return"";if(o.length>1)n=!0}return t!==void 0&&n?t:""}async function XF(e,t){let n=gn.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new H("skill download response had no body");await Mue(Nue.fromWeb(e.body),ZF.createWriteStream(n));let r=gn.join(gn.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await jue(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,i=s?"unzip":"tar",a=await Cw(i,s?["-Z1",n]:["-tf",n]);Fue(a),$ue(await Cw(i,s?["-Z",n]:["-tvf",n]));let c=zue(a);await Qn.mkdir(r,{recursive:!0,mode:hp}),await Cw(i,s?["-oq",n,"-d",r]:["-xf",n,"-C",r]);let l=c?gn.join(r,c):r;for(let u of await Qn.readdir(l))await Qn.rename(gn.join(l,u),gn.join(t,u))}finally{await Qn.rm(n,{force:!0}),await Qn.rm(r,{recursive:!0,force:!0})}}async function jue(e,t){let n=await Qn.open(e,"r");try{let r=Buffer.alloc(t),{bytesRead:o}=await n.read(r,0,t,0);return r.subarray(0,o)}finally{await n.close()}}var Uue;var QF=O(()=>{wt();Go();Tw();Uue=Lue(Due)});var a$={};Zn(a$,{betaAgentToolset20260401:()=>Vue,setupSkills:()=>YF});import*as Xt from"node:fs/promises";import*as l_ from"node:fs";import*as It from"node:path";import*as Rw from"node:child_process";import*as n$ from"node:crypto";import*as r$ from"node:readline";function s$(e){return e===void 0?Hue:e}function Vue(e){return[Zue(e),Yue(e),Jue(e),Xue(e),Que(e),ede(e)]}function Sp(e,t){return qF(e.workdir,t,{allowOutside:e.unrestrictedPaths??!1})}function que(){let e={};for(let[t,n]of Object.entries(process.env)){if(t.startsWith("ANTHROPIC_"))continue;e[t]=n}return e}class i${constructor(e,t=que()){c_.add(this),Un.set(this,void 0),er.set(this,""),_p.set(this,!1),ma.set(this,!1),$r.set(this,null),M(this,Un,Rw.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...t,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),E(this,Un,"f").stdout.setEncoding("utf8"),E(this,Un,"f").stderr.setEncoding("utf8"),E(this,Un,"f").stdout.on("data",(n)=>E(this,c_,"m",kw).call(this,n)),E(this,Un,"f").stderr.on("data",(n)=>E(this,c_,"m",kw).call(this,n)),E(this,Un,"f").once("close",()=>{M(this,ma,!0,"f");let n=E(this,$r,"f");M(this,$r,null,"f"),n?.resolve()})}get closed(){return E(this,ma,"f")}async exec(e,t={}){if(E(this,ma,"f"))throw new H("bash session terminated");let n=t.timeoutMs??o$,r=t.signal;if(r?.aborted)throw new H("bash command aborted");M(this,er,"","f"),M(this,_p,!1,"f");let o=`__ANT_CMD_${n$.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,i=`{ ${e}
41
+ } </dev/null 2>&1; printf '\\n${s}%d\\n' $?
42
+ `;if(E(this,Un,"f").stdin.write(i),E(this,er,"f").indexOf(o)<0){let{promise:f,resolve:m}=_l();M(this,$r,{sentinel:o,resolve:m},"f");let h,_;try{await Promise.race([f,new Promise((y,b)=>{h=setTimeout(()=>b(new H(`bash command timed out after ${n}ms`)),n)}),new Promise((y,b)=>{if(!r)return;_=()=>b(new H("bash command aborted")),r.addEventListener("abort",_,{once:!0})})])}finally{if(h)clearTimeout(h);if(_&&r)r.removeEventListener("abort",_);M(this,$r,null,"f")}}let a=E(this,er,"f").indexOf(o);if(a<0)throw new H("bash session terminated");let l=E(this,er,"f").slice(a+o.length).match(/^(-?\d+)/),u=l?parseInt(l[1],10):-1,d=E(this,er,"f").slice(0,a).replace(Gue,"").replace(/\n+$/,"");if(E(this,_p,"f"))d=`[output truncated]
43
+ ${d}`;return{output:d,exitCode:u}}close(){if(E(this,ma,"f"))return;M(this,ma,!0,"f");let e=E(this,$r,"f");M(this,$r,null,"f"),e?.resolve(),E(this,Un,"f").stdout.destroy(),E(this,Un,"f").stderr.destroy(),E(this,Un,"f").stdin.destroy();try{process.kill(-E(this,Un,"f").pid,"SIGKILL")}catch{E(this,Un,"f").kill("SIGKILL")}E(this,Un,"f").unref()}}function Zue(e){let t,n=Promise.resolve();return fa({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:o,timeout_ms:s},i)=>{let a=n,c=_l();n=c.promise;try{await a}catch{}try{if(o)t?.close(),t=void 0;if(!r){if(o)return"bash session restarted";throw new we("bash: command is required")}t??(t=new i$(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(r,{timeoutMs:s??o$,signal:i?.signal});if(u!==0)throw new we(l||`exit ${u}`);return l}catch(l){if(l instanceof we)throw l;throw t.close(),t=void 0,new we(`bash: ${l instanceof Error?l.message:String(l)}`)}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function Yue(e){return fa({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new we("read: file_path is required");let r=await Sp(e,t),o;try{let u=await Xt.stat(r);if(!u.isFile())throw new we(`read: ${t} is not a regular file`);let d=s$(e.maxFileBytes);if(d!==null&&u.size>d)throw new we(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await Xt.readFile(r,"utf8")}catch(u){if(u instanceof we)throw u;throw new we(`read: ${gp(u,t)}`)}if(!n)return o;if(n.length!==2)throw new we("read: view_range must be [start_line, end_line]");let[s,i]=n,a=o.split(`
44
+ `),c=Math.max(0,s-1),l=i>0?i:a.length;return a.slice(c,l).join(`
45
+ `)}})}function Jue(e){return fa({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new we("write: file_path is required");let r=await Sp(e,t);try{await Xt.mkdir(It.dirname(r),{recursive:!0,mode:hp}),await Aw(r,n??"")}catch(o){throw new we(`write: ${gp(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function Xue(e){return fa({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:r,replace_all:o})=>{if(!t)throw new we("edit: file_path is required");if(!n)throw new we("edit: old_string is required");let s=await Sp(e,t),i;try{let l=await Xt.stat(s);if(!l.isFile())throw new we(`edit: ${t} is not a regular file`);let u=s$(e.maxFileBytes);if(u!==null&&l.size>u)throw new we(`edit: ${t} is ${l.size} bytes, exceeds ${u}-byte limit. Use bash (sed/awk) to edit a large file.`);i=await Xt.readFile(s,"utf8")}catch(l){if(l instanceof we)throw l;throw new we(`edit: ${gp(l,t)}`)}let a=i.split(n).length-1;if(a===0)throw new we(`edit: old_string not found in ${t}`);let c;if(o)c=i.split(n).join(r);else{if(a>1)throw new we(`edit: old_string appears ${a} times in ${t} (must be unique)`);c=i.replace(n,()=>r)}try{await Aw(s,c)}catch(l){throw new we(`edit: write: ${gp(l,t)}`)}return`edited ${t} (${o?a:1} replacement(s))`}})}function Que(e){return fa({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new we("glob: pattern is required");let r=It.resolve(e.workdir),o=t;if(It.isAbsolute(t)){if(!e.unrestrictedPaths)throw new we("glob: absolute pattern not permitted");r=It.parse(t).root,o=It.relative(r,t)}else if(n)r=await Sp(e,n);if(!e.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new we('glob: ".." is not permitted in the pattern');let s=e.unrestrictedPaths?r:await Xt.realpath(r).catch(()=>r),i=[];try{for await(let a of Wue(o,{cwd:r,withFileTypes:!0,exclude:(c)=>c.name===".git"||c.name==="node_modules"})){if(!a.isFile())continue;let c=It.join(a.parentPath,a.name);if(!e.unrestrictedPaths){let u;try{u=await Xt.realpath(c)}catch{continue}if(!rde(s,u))continue}let l=0;try{l=(await Xt.stat(c)).mtimeMs}catch{}i.push({path:c,mtime:l})}}catch(a){throw new we(`glob: ${a instanceof Error?a.message:String(a)}`)}if(i.length===0)return"no matches";return i.sort((a,c)=>c.mtime-a.mtime),i.slice(0,Kue).map((a)=>a.path).join(`
46
+ `)}})}function ede(e){return fa({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},r)=>{if(!t)throw new we("grep: pattern is required");let o=It.resolve(e.workdir);if(n)o=await Sp(e,n);let s=await ade();return s?tde(s,t,o,r?.signal):nde(t,o,r?.signal)}})}function tde(e,t,n,r){return new Promise((o,s)=>{let i=Rw.spawn(e,["-n","--no-heading","-e",t,"--",n],{...r?{signal:r}:{}}),a="",c="",l=!1;i.stdout.on("data",(u)=>{if(l)return;if(a+=u,a.length>yp)l=!0,a=a.slice(0,yp),i.kill("SIGKILL")}),i.stderr.on("data",(u)=>c+=u),i.on("close",(u)=>{if(r?.aborted)return s(new we("grep: aborted"));if(l)return o(a+`
47
+ [output truncated at ${yp} bytes]`);if(u===0)return o(a);if(u===1)return o("no matches");s(new we(`grep: rg failed: ${c||`exit ${u}`}`))}),i.on("error",(u)=>{if(r?.aborted)return s(new we("grep: aborted"));s(new we(`grep: rg failed: ${u.message}`))})})}async function nde(e,t,n){let r;try{r=new RegExp(e)}catch(c){throw new we(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let o=[],s=yp,i=(c)=>{if(s-=c.length+1,s<0)return o.push(`[output truncated at ${yp} bytes]`),!1;return o.push(c),!0};if((await Xt.stat(t).catch(()=>null))?.isFile())await t$(t,r,i);else await ide(t,"",(c)=>t$(It.join(t,c),r,i),n);if(n?.aborted)throw new we("grep: aborted");if(o.length===0)return"no matches";return o.join(`
48
+ `)}async function t$(e,t,n){let r=l_.createReadStream(e,{encoding:"utf8"}),o=r$.createInterface({input:r,crlfDelay:1/0}),s=0;try{for await(let i of o){if(s++,i.length>Bue)continue;if(t.test(i)&&!n(`${e}:${s}:${i}`))return!1}}catch{}finally{r.destroy()}return!0}function rde(e,t){let n=It.relative(e,t);return n===""||!n.startsWith(".."+It.sep)&&n!==".."&&!It.isAbsolute(n)}async function ide(e,t,n,r){let o=sde;async function s(i,a){if(a>ode)return!0;if(r?.aborted)return!1;let c;try{c=await Xt.readdir(It.join(e,i),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(o--<=0)return!1;if(r?.aborted)return!1;let u=i?It.join(i,l.name):l.name;if(l.isDirectory()){if(!await s(u,a+1))return!1}else if(l.isFile()){if(await n(u)===!1)return!1}}return!0}await s(t,0)}async function ade(){let e=(process.env.PATH??"").split(It.delimiter);for(let t of e){let n=It.join(t,"rg");try{return await Xt.access(n,l_.constants.X_OK),n}catch{}}return null}var c_,Un,er,_p,ma,$r,kw,e$=102400,o$=120000,Hue=262144,yp=102400,Bue=2000,Kue=200,Gue,Wue,ode=40,sde=50000;var c$=O(()=>{Jn();wt();ua();VF();Tw();QF();Gue=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,Wue=Xt.glob;Un=new WeakMap,er=new WeakMap,_p=new WeakMap,ma=new WeakMap,$r=new WeakMap,c_=new WeakSet,kw=function(t){if(M(this,er,E(this,er,"f")+t,"f"),E(this,er,"f").length>e$)M(this,er,E(this,er,"f").slice(E(this,er,"f").length-e$),"f"),M(this,_p,!0,"f");if(E(this,$r,"f")&&E(this,er,"f").indexOf(E(this,$r,"f").sentinel)>=0){let n=E(this,$r,"f");M(this,$r,null,"f"),n.resolve()}}});class Ep{constructor(e){u_.add(this),bp.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxFileBytes=e.maxFileBytes,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,M(this,bp,e.signal,"f")}async run(e){let{environmentId:t,environmentKey:n}=this;if(t===void 0||n===void 0)throw new H("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=e??E(this,bp,"f"),o=new la({client:this.client,environmentId:t,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)await E(this,u_,"m",Ow).call(this,s,n,o.signal)}async handleItem(e){let t=e?.workId??Le("ANTHROPIC_WORK_ID"),n=e?.environmentId??Le("ANTHROPIC_ENVIRONMENT_ID"),r=e?.sessionId??Le("ANTHROPIC_SESSION_ID"),o=e?.environmentKey??this.environmentKey??Le("ANTHROPIC_ENVIRONMENT_KEY");if(!t)throw new H("handleItem: workId is required — pass it or set ANTHROPIC_WORK_ID");if(!n)throw new H("handleItem: environmentId is required — pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new H("handleItem: sessionId is required — pass it or set ANTHROPIC_SESSION_ID");if(!o)throw new H("handleItem: environmentKey is required — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let s={id:t,environment_id:n,data:{type:"session",id:r}};await E(this,u_,"m",Ow).call(this,s,o,e?.signal??E(this,bp,"f"))}}async function lde(e,t,n,r){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...r,headers:k([r?.headers])})}catch(o){if(!ri(o,409))n.error("force-stop on exit failed",{work_id:t.id,error:String(o)})}}async function ude(e,t,n,r,o){let s=l$,i=cde,a=async()=>{try{let c=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:i},{...o,headers:k([o?.headers]),signal:n.signal});if(i=c.last_heartbeat,c.ttl_seconds>0)s=Math.max(1000,Math.min(c.ttl_seconds*1000/2,l$));if(c.state==="stopping"||c.state==="stopped")r.info("heartbeat signals shutdown",{work_id:t.id,state:c.state}),n.abort();if(!c.lease_extended)r.warn("lease not extended, shutting down",{work_id:t.id}),n.abort()}catch(c){if(n.signal.throwIfAborted(),oi(c))throw r.error("permanent heartbeat failure",{work_id:t.id,error:String(c)}),n.abort(),c;r.warn("transient heartbeat failure",{work_id:t.id,error:String(c)})}};await a();while(!n.signal.aborted)await oo(s,n.signal),n.signal.throwIfAborted(),await a()}var u_,bp,Ow,l$=30000,cde="NO_HEARTBEAT";var Pw=O(()=>{Jn();wt();Go();lp();Ne();a_();Qg();Sw();bp=new WeakMap,u_=new WeakSet,Ow=async function(t,n,r){let o=Be(this.client),s=qg(this.client,{authToken:n,helper:"environments-worker"}),i=t.data.id,a={workdir:this.workdir,client:this.client,sessionId:i,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{},...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}},c=await Promise.resolve().then(() => (c$(),a$)),l=async()=>{};try{l=await c.setupSkills(a)}catch(h){o.warn("skill setup failed",{session_id:i,work_id:t.id,error:String(h)})}let u=typeof this.tools==="function"?this.tools(a):this.tools??c.betaAgentToolset20260401(a),d=new AbortController,f=ca(r,d),m=ude(s,t,d,o,this.requestOptions).catch((h)=>{if(!d.signal.aborted)o.error("heartbeat loop failed",{work_id:t.id,error:String(h)});d.abort()});try{let h=new pa(i,{client:s,tools:u,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:d.signal});for await(let _ of h);}finally{d.abort(),f(),await m,await l().catch((h)=>{o.warn("skill cleanup failed",{session_id:i,work_id:t.id,error:String(h)})}),await lde(s,t,o,this.requestOptions)}}});var ha;var Iw=O(()=>{Qe();Ne();lt();Qg();Pw();Qg();Pw();ha=class ha extends se{retrieve(e,t,n){let{environment_id:r,betas:o}=t;return this._client.get(U`/v1/environments/${r}/work/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{environment_id:r,betas:o,...s}=t;return this._client.post(U`/v1/environments/${r}/work/${e}?beta=true`,{body:s,...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/environments/${e}/work?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,t,n){let{environment_id:r,betas:o}=t;return this._client.post(U`/v1/environments/${r}/work/${e}/ack?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,t,n){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:i}=t;return this._client.post(U`/v1/environments/${r}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...n,headers:k([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,t={},n){let{betas:r,"Anthropic-Worker-ID":o,...s}=t??{};return this._client.get(U`/v1/environments/${e}/work/poll?beta=true`,{query:s,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},n?.headers])})}stats(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,t,n){let{environment_id:r,betas:o,...s}=t;return this._client.post(U`/v1/environments/${r}/work/${e}/stop?beta=true`,{body:s,...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new la({...e,client:this._client})}worker(e){return new Ep({...e,client:this._client})}};ha.WorkPoller=la;ha.EnvironmentWorker=Ep});var yl;var Dw=O(()=>{Iw();Iw();Qe();Ne();lt();yl=class yl extends se{constructor(){super(...arguments);this.work=new ha(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/environments?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/environments/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/environments/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/environments/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/environments/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yl.Work=ha});var xp;var Lw=O(()=>{Qe();Ne();lt();xp=class xp extends se{create(e,t,n){let{view:r,betas:o,...s}=t;return this._client.post(U`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:r},body:s,...n,headers:k([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}retrieve(e,t,n){let{memory_store_id:r,betas:o,...s}=t;return this._client.get(U`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:s,...n,headers:k([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}update(e,t,n){let{memory_store_id:r,view:o,betas:s,...i}=t;return this._client.post(U`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:{view:o},body:i,...n,headers:k([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/memory_stores/${e}/memories?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}delete(e,t,n){let{memory_store_id:r,expected_content_sha256:o,betas:s}=t;return this._client.delete(U`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:k([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}}});var vp;var Nw=O(()=>{Qe();Ne();lt();vp=class vp extends se{retrieve(e,t,n){let{memory_store_id:r,betas:o,...s}=t;return this._client.get(U`/v1/memory_stores/${r}/memory_versions/${e}?beta=true`,{query:s,...n,headers:k([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/memory_stores/${e}/memory_versions?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}redact(e,t,n){let{memory_store_id:r,betas:o}=t;return this._client.post(U`/v1/memory_stores/${r}/memory_versions/${e}/redact?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}}});var ga;var Mw=O(()=>{Lw();Lw();Nw();Nw();Qe();Ne();lt();ga=class ga extends se{constructor(){super(...arguments);this.memories=new xp(this._client),this.memoryVersions=new vp(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/memory_stores?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/memory_stores/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/memory_stores/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}};ga.Memories=xp;ga.MemoryVersions=vp});var Sl=O(()=>{wt()});var bl;var Uw=O(()=>{wt();Jv();bl=class bl{constructor(e,t){this.iterator=e,this.controller=t}async*decoder(){let e=new ti;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new H("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new H("Attempted to iterate over a response with no body")}return new bl(Hd(e.body),t)}}});var wp;var Fw=O(()=>{Qe();Ne();Uw();Sl();lt();wp=class wp extends se{create(e,t){let{betas:n,user_profile_id:r,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...t,headers:k([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/messages/batches/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",io,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/messages/batches/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new H(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o}=t??{};return this._client.get(r.results_url,{...n,headers:k([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,i)=>bl.fromResponse(i.response,i.controller))}}});var d_;var $w=O(()=>{d_={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function u$(e){return e?.output_format??e?.output_config?.format}function zw(e,t,n){let r=u$(t);if(!t||!("parse"in(r??{})))return{...e,content:e.content.map((o)=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null};return jw(e,t,n)}function jw(e,t,n){let r=null,o=e.content.map((s)=>{if(s.type==="text"){let i=_de(t,s.text);if(r===null)r=i;let a=Object.defineProperty({...s},"parsed_output",{value:i,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),i},enumerable:!1})}return s});return{...e,content:o,parsed_output:r}}function _de(e,t){let n=u$(e);if(n?.type!=="json_schema")return null;try{if("parse"in n)return n.parse(t);return JSON.parse(t)}catch(r){throw new H(`Failed to parse structured output: ${r}`)}}var Hw=O(()=>{wt()});var Bw=O(()=>{Wd()});var yde=(e)=>{let t=0,n=[];while(t<e.length){let r=e[t];if(r==="\\"){t++;continue}if(r==="{"){n.push({type:"brace",value:"{"}),t++;continue}if(r==="}"){n.push({type:"brace",value:"}"}),t++;continue}if(r==="["){n.push({type:"paren",value:"["}),t++;continue}if(r==="]"){n.push({type:"paren",value:"]"}),t++;continue}if(r===":"){n.push({type:"separator",value:":"}),t++;continue}if(r===","){n.push({type:"delimiter",value:","}),t++;continue}if(r==='"'){let a="",c=!1;r=e[++t];while(r!=='"'){if(t===e.length){c=!0;break}if(r==="\\"){if(t++,t===e.length){c=!0;break}a+=r+e[t],r=e[++t]}else a+=r,r=e[++t]}if(r=e[++t],!c)n.push({type:"string",value:a});continue}if(r&&/\s/.test(r)){t++;continue}let s=/[0-9]/;if(r&&s.test(r)||r==="-"||r==="."){let a="";if(r==="-")a+=r,r=e[++t];while(r&&(s.test(r)||r==="."||r==="e"||r==="E"||(r==="-"||r==="+")&&(a[a.length-1]==="e"||a[a.length-1]==="E")))a+=r,r=e[++t];n.push({type:"number",value:a});continue}let i=/[a-z]/i;if(r&&i.test(r)){let a="";while(r&&i.test(r)){if(t===e.length)break;a+=r,r=e[++t]}if(a=="true"||a=="false"||a==="null")n.push({type:"name",value:a});else{t++;continue}continue}t++}return n},El=(e)=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),El(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),El(e);case"string":let r=e[e.length-2];if(r?.type==="delimiter")return e=e.slice(0,e.length-1),El(e);else if(r?.type==="brace"&&r.value==="{")return e=e.slice(0,e.length-1),El(e);break;case"delimiter":return e=e.slice(0,e.length-1),El(e);break}return e},Sde=(e)=>{let t=[];if(e.map((n)=>{if(n.type==="brace")if(n.value==="{")t.push("}");else t.splice(t.lastIndexOf("}"),1);if(n.type==="paren")if(n.value==="[")t.push("]");else t.splice(t.lastIndexOf("]"),1)}),t.length>0)t.reverse().map((n)=>{if(n==="}")e.push({type:"brace",value:"}"});else if(n==="]")e.push({type:"paren",value:"]"})});return e},bde=(e)=>{let t="";return e.map((n)=>{switch(n.type){case"string":t+='"'+n.value+'"';break;default:t+=n.value;break}}),t},d$=(e)=>JSON.parse(bde(Sde(El(yde(e)))));var p$=()=>{};function p_(e,t){let n={};for(let s of Object.keys(e))if(s!=="input")n[s]=e[s];Object.defineProperty(n,ai,{value:t,enumerable:!1,writable:!0});let r,o=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){if(!o)r=t?d$(t):{},o=!0;return r}}),n}var ai="__json_buf";var Kw=O(()=>{p$()});function Yw(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}function h$(e){}var tr,ci,xl,Ap,f_,Tp,Cp,m_,kp,Vo,Rp,h_,g_,_a,__,y_,Op,Gw,f$,Pp,Ww,Vw,qw,m$,Zw,Ip;var g$=O(()=>{Jn();Wo();Sl();Bw();Hw();Kw();Ip=class Ip{constructor(e,t){tr.add(this),this.messages=[],this.receivedMessages=[],ci.set(this,void 0),xl.set(this,null),this.controller=new AbortController,Ap.set(this,void 0),f_.set(this,()=>{}),Tp.set(this,()=>{}),Cp.set(this,void 0),m_.set(this,()=>{}),kp.set(this,()=>{}),Vo.set(this,{}),Rp.set(this,!1),h_.set(this,!1),g_.set(this,!1),_a.set(this,!1),__.set(this,void 0),y_.set(this,void 0),Op.set(this,void 0),Pp.set(this,(n)=>{if(M(this,h_,!0,"f"),Nr(n))n=new mn;if(n instanceof mn)return M(this,g_,!0,"f"),this._emit("abort",n);if(n instanceof H)return this._emit("error",n);if(n instanceof Error){let r=new H(n.message);return r.cause=n,this._emit("error",r)}return this._emit("error",new H(String(n)))}),M(this,Ap,new Promise((n,r)=>{M(this,f_,n,"f"),M(this,Tp,r,"f")}),"f"),M(this,Cp,new Promise((n,r)=>{M(this,m_,n,"f"),M(this,kp,r,"f")}),"f"),E(this,Ap,"f").catch(()=>{}),E(this,Cp,"f").catch(()=>{}),M(this,xl,e,"f"),M(this,Op,t?.logger??console,"f")}get response(){return E(this,__,"f")}get request_id(){return E(this,y_,"f")}async withResponse(){M(this,_a,!0,"f");let e=await E(this,Ap,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new Ip(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n,{logger:r}={}){let o=new Ip(t,{logger:r});for(let s of t.messages)o._addMessageParam(s);return M(o,xl,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,[Gg]:"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},E(this,Pp,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal,o;if(r){if(r.aborted)this.controller.abort();o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o)}try{E(this,tr,"m",Ww).call(this);let{response:s,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let a of i)E(this,tr,"m",Vw).call(this,a);if(i.controller.signal?.aborted)throw new mn;E(this,tr,"m",qw).call(this)}finally{if(r&&o)r.removeEventListener("abort",o)}}_connected(e){if(this.ended)return;M(this,__,e,"f"),M(this,y_,e?.headers.get("request-id"),"f"),E(this,f_,"f").call(this,e),this._emit("connect")}get ended(){return E(this,Rp,"f")}get errored(){return E(this,h_,"f")}get aborted(){return E(this,g_,"f")}abort(){this.controller.abort()}on(e,t){return(E(this,Vo,"f")[e]||(E(this,Vo,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=E(this,Vo,"f")[e];if(!n)return this;let r=n.findIndex((o)=>o.listener===t);if(r>=0)n.splice(r,1);return this}once(e,t){return(E(this,Vo,"f")[e]||(E(this,Vo,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{if(M(this,_a,!0,"f"),e!=="error")this.once("error",n);this.once(e,t)})}async done(){M(this,_a,!0,"f"),await E(this,Cp,"f")}get currentMessage(){return E(this,ci,"f")}async finalMessage(){return await this.done(),E(this,tr,"m",Gw).call(this)}async finalText(){return await this.done(),E(this,tr,"m",f$).call(this)}_emit(e,...t){if(E(this,Rp,"f"))return;if(e==="end")M(this,Rp,!0,"f"),E(this,m_,"f").call(this);let n=E(this,Vo,"f")[e];if(n)E(this,Vo,"f")[e]=n.filter((r)=>!r.once),n.forEach(({listener:r})=>r(...t));if(e==="abort"){let r=t[0];if(!E(this,_a,"f")&&!n?.length)Promise.reject(r);E(this,Tp,"f").call(this,r),E(this,kp,"f").call(this,r),this._emit("end");return}if(e==="error"){let r=t[0];if(!E(this,_a,"f")&&!n?.length)Promise.reject(r);E(this,Tp,"f").call(this,r),E(this,kp,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",E(this,tr,"m",Gw).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;if(n){if(n.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),n.addEventListener("abort",r)}try{E(this,tr,"m",Ww).call(this),this._connected(null);let o=kn.fromReadableStream(e,this.controller);for await(let s of o)E(this,tr,"m",Vw).call(this,s);if(o.controller.signal?.aborted)throw new mn;E(this,tr,"m",qw).call(this)}finally{if(n&&r)n.removeEventListener("abort",r)}}[(ci=new WeakMap,xl=new WeakMap,Ap=new WeakMap,f_=new WeakMap,Tp=new WeakMap,Cp=new WeakMap,m_=new WeakMap,kp=new WeakMap,Vo=new WeakMap,Rp=new WeakMap,h_=new WeakMap,g_=new WeakMap,_a=new WeakMap,__=new WeakMap,y_=new WeakMap,Op=new WeakMap,Pp=new WeakMap,tr=new WeakSet,Gw=function(){if(this.receivedMessages.length===0)throw new H("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},f$=function(){if(this.receivedMessages.length===0)throw new H("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((n)=>n.type==="text").map((n)=>n.text);if(t.length===0)throw new H("stream ended without producing a content block with type=text");return t.join(" ")},Ww=function(){if(this.ended)return;M(this,ci,void 0,"f")},Vw=function(t){if(this.ended)return;let n=E(this,tr,"m",m$).call(this,t);switch(this._emit("streamEvent",t,n),t.type){case"content_block_delta":{let r=n.content.at(-1);switch(t.delta.type){case"text_delta":{if(r.type==="text")this._emit("text",t.delta.text,r.text||"");break}case"citations_delta":{if(r.type==="text")this._emit("citation",t.delta.citation,r.citations??[]);break}case"input_json_delta":{if(Yw(r)&&E(this,Vo,"f").inputJson?.length){let o;try{o=r.input}catch(s){E(this,Pp,"f").call(this,E(this,tr,"m",Zw).call(this,r,s));break}this._emit("inputJson",t.delta.partial_json,o)}break}case"thinking_delta":{if(r.type==="thinking")this._emit("thinking",t.delta.thinking,r.thinking);break}case"signature_delta":{if(r.type==="thinking")this._emit("signature",r.signature);break}case"compaction_delta":{if(r.type==="compaction"&&r.content)this._emit("compaction",r.content);break}default:h$(t.delta)}break}case"message_stop":{this._addMessageParam(n),this._addMessage(zw(n,E(this,xl,"f"),{logger:E(this,Op,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{M(this,ci,n,"f");break}case"content_block_start":case"message_delta":break}},qw=function(){if(this.ended)throw new H("stream has ended, this shouldn't happen");let t=E(this,ci,"f");if(!t)throw new H("request ended without sending any chunks");return M(this,ci,void 0,"f"),zw(t,E(this,xl,"f"),{logger:E(this,Op,"f")})},m$=function(t){let n=E(this,ci,"f");if(t.type==="message_start"){if(n)throw new H(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!n)throw new H(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return n;case"message_delta":if(n.container=t.delta.container,n.stop_reason=t.delta.stop_reason,n.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null)n.stop_details=t.delta.stop_details;if(n.usage.output_tokens=t.usage.output_tokens,n.context_management=t.context_management,t.usage.input_tokens!=null)n.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)n.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)n.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)n.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.iterations!=null)n.usage.iterations=t.usage.iterations;return n;case"content_block_start":if(n.content.push(t.content_block),t.content_block.type==="fallback")n.model=t.content_block.to.model;return n;case"content_block_delta":{let r=n.content.at(t.index);switch(t.delta.type){case"text_delta":{if(r?.type==="text")n.content[t.index]={...r,text:(r.text||"")+t.delta.text};break}case"citations_delta":{if(r?.type==="text")n.content[t.index]={...r,citations:[...r.citations??[],t.delta.citation]};break}case"input_json_delta":{if(r&&Yw(r)){let o=(r[ai]||"")+t.delta.partial_json;n.content[t.index]=p_(r,o)}break}case"thinking_delta":{if(r?.type==="thinking")n.content[t.index]={...r,thinking:r.thinking+t.delta.thinking};break}case"signature_delta":{if(r?.type==="thinking")n.content[t.index]={...r,signature:t.delta.signature};break}case"compaction_delta":{if(r?.type==="compaction")n.content[t.index]={...r,content:(r.content||"")+t.delta.content,encrypted_content:t.delta.encrypted_content};break}default:h$(t.delta)}return n}case"content_block_stop":{let r=n.content.at(t.index);if(r&&Yw(r)&&ai in r){let o;try{o=r.input}catch(s){o={},E(this,Pp,"f").call(this,E(this,tr,"m",Zw).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return n}}},Zw=function(t,n){let r=t[ai];return new H(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${r}`)},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",(r)=>{let o=t.shift();if(o)o.resolve(r);else e.push(r)}),this.on("end",()=>{n=!0;for(let r of t)r.resolve(void 0);t.length=0}),this.on("abort",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),this.on("error",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),{next:async()=>{if(!e.length){if(n)return{value:void 0,done:!0};return new Promise((o,s)=>t.push({resolve:o,reject:s})).then((o)=>o?{value:o,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new kn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var _$=1e5,y$=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
49
+ 1. Task Overview
50
+ The user's core request and success criteria
51
+ Any clarifications or constraints they specified
52
+ 2. Current State
53
+ What has been completed so far
54
+ Files created, modified, or analyzed (with paths if relevant)
55
+ Key outputs or artifacts produced
56
+ 3. Important Discoveries
57
+ Technical constraints or requirements uncovered
58
+ Decisions made and their rationale
59
+ Errors encountered and how they were resolved
60
+ What approaches were tried that didn't work (and why)
61
+ 4. Next Steps
62
+ Specific actions needed to complete the task
63
+ Any blockers or open questions to resolve
64
+ Priority order if multiple steps remain
65
+ 5. Context to Preserve
66
+ User preferences or style requirements
67
+ Domain-specific details that aren't obvious
68
+ Any promises made to the user
69
+ Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
70
+ Wrap your summary in <summary></summary> tags.`;async function Ede(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content==="string")return null;let r=t.content.filter((s)=>s.type==="tool_use");if(r.length===0)return null;return{role:"user",content:await Promise.all(r.map(async(s)=>{let i=e.tools.find((a)=>("name"in a?a.name:a.mcp_server_name)===s.name);if(!i||!("run"in i))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let a=s.input;if("parse"in i&&i.parse)a=i.parse(a);let c=await i.run(a,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:c}}catch(a){return{type:"tool_result",tool_use_id:s.id,content:a instanceof we?a.content:`Error: ${a instanceof Error?a.message:String(a)}`,is_error:!0}}}))}}var Dp,vl,ya,Qt,nr,wr,_s,li,Lp,S$,Jw,Np;var Xw=O(()=>{Jn();ua();wt();Ne();Wo();Np=class Np{constructor(e,t,n){Dp.add(this),this.client=e,vl.set(this,!1),ya.set(this,!1),Qt.set(this,void 0),nr.set(this,void 0),wr.set(this,void 0),_s.set(this,void 0),li.set(this,void 0),Lp.set(this,0),M(this,Qt,{params:{...t,messages:structuredClone(t.messages)}},"f");let r=lw(t.tools,t.messages);if(M(this,nr,{...n,headers:k([tp("BetaToolRunner"),r.length?{[ep]:r.join(", ")}:void 0,n?.headers])},"f"),M(this,li,_l(),"f"),t.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(vl=new WeakMap,ya=new WeakMap,Qt=new WeakMap,nr=new WeakMap,wr=new WeakMap,_s=new WeakMap,li=new WeakMap,Lp=new WeakMap,Dp=new WeakSet,S$=async function(){let t=E(this,Qt,"f").params.compactionControl;if(!t||!t.enabled)return!1;let n=0;if(E(this,wr,"f")!==void 0)try{let c=await E(this,wr,"f");n=c.usage.input_tokens+(c.usage.cache_creation_input_tokens??0)+(c.usage.cache_read_input_tokens??0)+c.usage.output_tokens}catch{return!1}let r=t.contextTokenThreshold??_$;if(n<r)return!1;let o=t.model??E(this,Qt,"f").params.model,s=t.summaryPrompt??y$,i=E(this,Qt,"f").params.messages;if(i[i.length-1].role==="assistant"){let c=i[i.length-1];if(Array.isArray(c.content)){let l=c.content.filter((u)=>u.type!=="tool_use");if(l.length===0)i.pop();else c.content=l}}let a=await this.client.beta.messages.create({model:o,messages:[...i,{role:"user",content:[{type:"text",text:s}]}],max_tokens:E(this,Qt,"f").params.max_tokens},{signal:E(this,nr,"f").signal,headers:k([E(this,nr,"f").headers,tp("compaction")])});if(a.content[0]?.type!=="text")throw new H("Expected text response for compaction");return E(this,Qt,"f").params.messages=[{role:"user",content:a.content}],!0},Symbol.asyncIterator)](){var e;if(E(this,vl,"f"))throw new H("Cannot iterate over a consumed stream");M(this,vl,!0,"f"),M(this,ya,!0,"f"),M(this,_s,void 0,"f");try{while(!0){let t;try{if(E(this,Qt,"f").params.max_iterations&&E(this,Lp,"f")>=E(this,Qt,"f").params.max_iterations)break;M(this,ya,!1,"f"),M(this,_s,void 0,"f"),M(this,Lp,(e=E(this,Lp,"f"),e++,e),"f"),M(this,wr,void 0,"f");let{max_iterations:n,compactionControl:r,...o}=E(this,Qt,"f").params;if(o.stream)t=this.client.beta.messages.stream({...o},E(this,nr,"f")),M(this,wr,t.finalMessage(),"f"),E(this,wr,"f").catch(()=>{}),yield t;else M(this,wr,this.client.beta.messages.create({...o,stream:!1},E(this,nr,"f")),"f"),yield E(this,wr,"f");if(!await E(this,Dp,"m",S$).call(this)){if(!E(this,ya,"f")){let a=await E(this,wr,"f");if(E(this,Qt,"f").params.messages.push({role:a.role,content:a.content}),a.stop_reason==="refusal")break}let i=await E(this,Dp,"m",Jw).call(this,E(this,Qt,"f").params.messages.at(-1));if(i)E(this,Qt,"f").params.messages.push(i);else if(!E(this,ya,"f"))break}}finally{if(t)t.abort()}}if(!E(this,wr,"f"))throw new H("ToolRunner concluded without a message from the server");E(this,li,"f").resolve(await E(this,wr,"f"))}catch(t){throw M(this,vl,!1,"f"),E(this,li,"f").promise.catch(()=>{}),E(this,li,"f").reject(t),M(this,li,_l(),"f"),t}}setMessagesParams(e){if(typeof e==="function")E(this,Qt,"f").params=e(E(this,Qt,"f").params);else E(this,Qt,"f").params=e;M(this,ya,!0,"f"),M(this,_s,void 0,"f")}setRequestOptions(e){if(typeof e==="function")M(this,nr,e(E(this,nr,"f")),"f");else M(this,nr,{...E(this,nr,"f"),...e},"f")}async generateToolResponse(e=E(this,nr,"f").signal){let t=await E(this,wr,"f")??this.params.messages.at(-1);if(!t)return null;return E(this,Dp,"m",Jw).call(this,t,e)}done(){return E(this,li,"f").promise}async runUntilDone(){if(!E(this,vl,"f"))for await(let e of this);return this.done()}get params(){return E(this,Qt,"f").params}pushMessages(...e){this.setMessagesParams((t)=>({...t,messages:[...t.messages,...e]}))}then(e,t){return this.runUntilDone().then(e,t)}};Jw=async function(t,n=E(this,nr,"f").signal){if(E(this,_s,"f")!==void 0)return E(this,_s,"f");return M(this,_s,Ede(E(this,Qt,"f").params,t,{...E(this,nr,"f"),signal:n}),"f"),E(this,_s,"f")}});function E$(e){if(!e.output_format)return e;if(e.output_config?.format)throw new H("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var b$,xde,ui;var Qw=O(()=>{Sl();Fw();$w();Ne();Wo();Hw();g$();Xw();ua();Fw();Xw();ua();b$={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},xde=["claude-mythos-preview","claude-opus-4-6"];ui=class ui extends se{constructor(){super(...arguments);this.batches=new wp(this._client)}create(e,t){let n=E$(e),{betas:r,user_profile_id:o,...s}=n;if(s.model in b$)console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${b$[s.model]}
71
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(xde.includes(s.model)&&s.thinking&&s.thinking.type==="enabled")console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let i=this._client._options.timeout;if(!s.stream&&i==null){let c=d_[s.model]??void 0;i=this._client.calculateNonstreamingTimeout(s.max_tokens,c)}let a=Wg(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:i??600000,...t,headers:k([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0},a,t?.headers]),stream:n.stream??!1})}parse(e,t){return t={...t,headers:k([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(e,t).then((n)=>jw(n,e,{logger:this._client.logger??console}))}stream(e,t){return Ip.createMessage(this,e,t)}countTokens(e,t){let n=E$(e),{betas:r,user_profile_id:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...t,headers:k([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0},t?.headers])})}toolRunner(e,t){return new Np(this._client,e,t)}};ui.Batches=wp;ui.BetaToolRunner=Np;ui.ToolError=we});var wl;var eA=O(()=>{Qe();Ne();lt();a_();a_();wl=class wl extends se{list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/sessions/${e}/events?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/sessions/${e}/events?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,t={},n){let{betas:r,...o}=t??{};return this._client.get(U`/v1/sessions/${e}/events/stream?beta=true`,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,t){return new pa(e,{...t,client:this._client})}};wl.SessionToolRunner=pa});var Mp;var tA=O(()=>{Qe();Ne();lt();Mp=class Mp extends se{retrieve(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(U`/v1/sessions/${r}/resources/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{session_id:r,betas:o,...s}=t;return this._client.post(U`/v1/sessions/${r}/resources/${e}?beta=true`,{body:s,...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/sessions/${e}/resources?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,t,n){let{session_id:r,betas:o}=t;return this._client.delete(U`/v1/sessions/${r}/resources/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/sessions/${e}/resources?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Up;var nA=O(()=>{Qe();Ne();lt();Up=class Up extends se{list(e,t,n){let{session_id:r,betas:o,...s}=t;return this._client.getAPIList(U`/v1/sessions/${r}/threads/${e}/events?beta=true`,Ce,{query:s,...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(U`/v1/sessions/${r}/threads/${e}/stream?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Al;var rA=O(()=>{nA();nA();Qe();Ne();lt();Al=class Al extends se{constructor(){super(...arguments);this.events=new Up(this._client)}retrieve(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(U`/v1/sessions/${r}/threads/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/sessions/${e}/threads?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t,n){let{session_id:r,betas:o}=t;return this._client.post(U`/v1/sessions/${r}/threads/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Al.Events=Up});var di;var oA=O(()=>{eA();eA();tA();tA();rA();rA();Qe();Ne();lt();di=class di extends se{constructor(){super(...arguments);this.events=new wl(this._client),this.resources=new Mp(this._client),this.threads=new Al(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/sessions?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/sessions/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/sessions/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",ew,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/sessions/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/sessions/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};di.Events=wl;di.Resources=Mp;di.Threads=Al});var Fp;var sA=O(()=>{Qe();Ne();al();lt();Fp=class Fp extends se{create(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/skills/${e}/versions?beta=true`,il({body:o,...n,headers:k([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])},this._client,!1))}retrieve(e,t,n){let{skill_id:r,betas:o}=t;return this._client.get(U`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/skills/${e}/versions?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,t,n){let{skill_id:r,betas:o}=t;return this._client.delete(U`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,t,n){let{skill_id:r,betas:o}=t;return this._client.get(U`/v1/skills/${r}/versions/${e}/content?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var Tl;var iA=O(()=>{sA();sA();Qe();Ne();al();lt();Tl=class Tl extends se{constructor(){super(...arguments);this.versions=new Fp(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/skills?beta=true",il({body:r,...t,headers:k([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},t?.headers])},this._client,!1))}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/skills/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/skills/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}};Tl.Versions=Fp});var $p;var aA=O(()=>{Qe();Ne();lt();$p=class $p extends se{create(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/tunnels/${e}/certificates?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}retrieve(e,t,n){let{tunnel_id:r,betas:o}=t;return this._client.get(U`/v1/tunnels/${r}/certificates/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/tunnels/${e}/certificates?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}archive(e,t,n){let{tunnel_id:r,betas:o}=t;return this._client.post(U`/v1/tunnels/${r}/certificates/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}}});var Cl;var cA=O(()=>{aA();aA();Qe();Ne();lt();Cl=class Cl extends se{constructor(){super(...arguments);this.certificates=new $p(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/tunnels?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/tunnels/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/tunnels?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/tunnels/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}revealToken(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/tunnels/${e}/reveal_token?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}rotateToken(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/tunnels/${e}/rotate_token?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}};Cl.Certificates=$p});var zp;var lA=O(()=>{Qe();Ne();lt();zp=class zp extends se{create(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/vaults/${e}/credentials?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,t,n){let{vault_id:r,betas:o}=t;return this._client.get(U`/v1/vaults/${r}/credentials/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{vault_id:r,betas:o,...s}=t;return this._client.post(U`/v1/vaults/${r}/credentials/${e}?beta=true`,{body:s,...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(U`/v1/vaults/${e}/credentials?beta=true`,Ce,{query:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,t,n){let{vault_id:r,betas:o}=t;return this._client.delete(U`/v1/vaults/${r}/credentials/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t,n){let{vault_id:r,betas:o}=t;return this._client.post(U`/v1/vaults/${r}/credentials/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,t,n){let{vault_id:r,betas:o}=t;return this._client.post(U`/v1/vaults/${r}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:k([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var kl;var uA=O(()=>{lA();lA();Qe();Ne();lt();kl=class kl extends se{constructor(){super(...arguments);this.credentials=new zp(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/vaults?beta=true",{body:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/vaults/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(U`/v1/vaults/${e}?beta=true`,{body:o,...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Ce,{query:r,...t,headers:k([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(U`/v1/vaults/${e}?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(U`/v1/vaults/${e}/archive?beta=true`,{...n,headers:k([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};kl.Credentials=zp});var Bt;var dA=O(()=>{iw();iw();aw();aw();cw();cw();uw();uw();dw();dw();pw();pw();hw();hw();_w();_w();Dw();Dw();Mw();Mw();Qw();Qw();oA();oA();iA();iA();cA();cA();uA();uA();Bt=class Bt extends se{constructor(){super(...arguments);this.models=new rp(this._client),this.messages=new ui(this._client),this.agents=new cl(this._client),this.environments=new yl(this._client),this.sessions=new di(this._client),this.deployments=new Jd(this._client),this.deploymentRuns=new Yd(this._client),this.vaults=new kl(this._client),this.memoryStores=new ga(this._client),this.files=new np(this._client),this.skills=new Tl(this._client),this.webhooks=new ap(this._client),this.userProfiles=new op(this._client),this.dreams=new Xd(this._client),this.tunnels=new Cl(this._client)}};Bt.Models=rp;Bt.Messages=ui;Bt.Agents=cl;Bt.Environments=yl;Bt.Sessions=di;Bt.Deployments=Jd;Bt.DeploymentRuns=Yd;Bt.Vaults=kl;Bt.MemoryStores=ga;Bt.Files=np;Bt.Skills=Tl;Bt.Webhooks=ap;Bt.UserProfiles=op;Bt.Dreams=Xd;Bt.Tunnels=Cl});var Rl;var pA=O(()=>{Ne();Rl=class Rl extends se{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??600000,...t,headers:k([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}});function x$(e){return e?.output_config?.format}function fA(e,t,n){let r=x$(t);if(!t||!("parse"in(r??{})))return{...e,content:e.content.map((o)=>{if(o.type==="text")return Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return o}),parsed_output:null};return mA(e,t,n)}function mA(e,t,n){let r=null,o=e.content.map((s)=>{if(s.type==="text"){let i=Nde(t,s.text);if(r===null)r=i;return Object.defineProperty({...s},"parsed_output",{value:i,enumerable:!1})}return s});return{...e,content:o,parsed_output:r}}function Nde(e,t){let n=x$(e);if(n?.type!=="json_schema")return null;try{if("parse"in n)return n.parse(t);return JSON.parse(t)}catch(r){throw new H(`Failed to parse structured output: ${r}`)}}var hA=O(()=>{wt()});function EA(e){return e.type==="tool_use"||e.type==="server_tool_use"}function A$(e){}var zr,pi,Ol,jp,S_,Hp,Bp,b_,Kp,qo,Gp,E_,x_,Sa,v_,w_,Wp,gA,v$,_A,yA,SA,bA,w$,Vp;var T$=O(()=>{Jn();Wo();Sl();Bw();hA();Kw();Vp=class Vp{constructor(e,t){zr.add(this),this.messages=[],this.receivedMessages=[],pi.set(this,void 0),Ol.set(this,null),this.controller=new AbortController,jp.set(this,void 0),S_.set(this,()=>{}),Hp.set(this,()=>{}),Bp.set(this,void 0),b_.set(this,()=>{}),Kp.set(this,()=>{}),qo.set(this,{}),Gp.set(this,!1),E_.set(this,!1),x_.set(this,!1),Sa.set(this,!1),v_.set(this,void 0),w_.set(this,void 0),Wp.set(this,void 0),_A.set(this,(n)=>{if(M(this,E_,!0,"f"),Nr(n))n=new mn;if(n instanceof mn)return M(this,x_,!0,"f"),this._emit("abort",n);if(n instanceof H)return this._emit("error",n);if(n instanceof Error){let r=new H(n.message);return r.cause=n,this._emit("error",r)}return this._emit("error",new H(String(n)))}),M(this,jp,new Promise((n,r)=>{M(this,S_,n,"f"),M(this,Hp,r,"f")}),"f"),M(this,Bp,new Promise((n,r)=>{M(this,b_,n,"f"),M(this,Kp,r,"f")}),"f"),E(this,jp,"f").catch(()=>{}),E(this,Bp,"f").catch(()=>{}),M(this,Ol,e,"f"),M(this,Wp,t?.logger??console,"f")}get response(){return E(this,v_,"f")}get request_id(){return E(this,w_,"f")}async withResponse(){M(this,Sa,!0,"f");let e=await E(this,jp,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new Vp(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n,{logger:r}={}){let o=new Vp(t,{logger:r});for(let s of t.messages)o._addMessageParam(s);return M(o,Ol,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,[Gg]:"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},E(this,_A,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal,o;if(r){if(r.aborted)this.controller.abort();o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o)}try{E(this,zr,"m",yA).call(this);let{response:s,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let a of i)E(this,zr,"m",SA).call(this,a);if(i.controller.signal?.aborted)throw new mn;E(this,zr,"m",bA).call(this)}finally{if(r&&o)r.removeEventListener("abort",o)}}_connected(e){if(this.ended)return;M(this,v_,e,"f"),M(this,w_,e?.headers.get("request-id"),"f"),E(this,S_,"f").call(this,e),this._emit("connect")}get ended(){return E(this,Gp,"f")}get errored(){return E(this,E_,"f")}get aborted(){return E(this,x_,"f")}abort(){this.controller.abort()}on(e,t){return(E(this,qo,"f")[e]||(E(this,qo,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=E(this,qo,"f")[e];if(!n)return this;let r=n.findIndex((o)=>o.listener===t);if(r>=0)n.splice(r,1);return this}once(e,t){return(E(this,qo,"f")[e]||(E(this,qo,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{if(M(this,Sa,!0,"f"),e!=="error")this.once("error",n);this.once(e,t)})}async done(){M(this,Sa,!0,"f"),await E(this,Bp,"f")}get currentMessage(){return E(this,pi,"f")}async finalMessage(){return await this.done(),E(this,zr,"m",gA).call(this)}async finalText(){return await this.done(),E(this,zr,"m",v$).call(this)}_emit(e,...t){if(E(this,Gp,"f"))return;if(e==="end")M(this,Gp,!0,"f"),E(this,b_,"f").call(this);let n=E(this,qo,"f")[e];if(n)E(this,qo,"f")[e]=n.filter((r)=>!r.once),n.forEach(({listener:r})=>r(...t));if(e==="abort"){let r=t[0];if(!E(this,Sa,"f")&&!n?.length)Promise.reject(r);E(this,Hp,"f").call(this,r),E(this,Kp,"f").call(this,r),this._emit("end");return}if(e==="error"){let r=t[0];if(!E(this,Sa,"f")&&!n?.length)Promise.reject(r);E(this,Hp,"f").call(this,r),E(this,Kp,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",E(this,zr,"m",gA).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;if(n){if(n.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),n.addEventListener("abort",r)}try{E(this,zr,"m",yA).call(this),this._connected(null);let o=kn.fromReadableStream(e,this.controller);for await(let s of o)E(this,zr,"m",SA).call(this,s);if(o.controller.signal?.aborted)throw new mn;E(this,zr,"m",bA).call(this)}finally{if(n&&r)n.removeEventListener("abort",r)}}[(pi=new WeakMap,Ol=new WeakMap,jp=new WeakMap,S_=new WeakMap,Hp=new WeakMap,Bp=new WeakMap,b_=new WeakMap,Kp=new WeakMap,qo=new WeakMap,Gp=new WeakMap,E_=new WeakMap,x_=new WeakMap,Sa=new WeakMap,v_=new WeakMap,w_=new WeakMap,Wp=new WeakMap,_A=new WeakMap,zr=new WeakSet,gA=function(){if(this.receivedMessages.length===0)throw new H("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},v$=function(){if(this.receivedMessages.length===0)throw new H("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((n)=>n.type==="text").map((n)=>n.text);if(t.length===0)throw new H("stream ended without producing a content block with type=text");return t.join(" ")},yA=function(){if(this.ended)return;M(this,pi,void 0,"f")},SA=function(t){if(this.ended)return;let n=E(this,zr,"m",w$).call(this,t);switch(this._emit("streamEvent",t,n),t.type){case"content_block_delta":{let r=n.content.at(-1);switch(t.delta.type){case"text_delta":{if(r.type==="text")this._emit("text",t.delta.text,r.text||"");break}case"citations_delta":{if(r.type==="text")this._emit("citation",t.delta.citation,r.citations??[]);break}case"input_json_delta":{if(EA(r)&&E(this,qo,"f").inputJson?.length)this._emit("inputJson",t.delta.partial_json,r.input);break}case"thinking_delta":{if(r.type==="thinking")this._emit("thinking",t.delta.thinking,r.thinking);break}case"signature_delta":{if(r.type==="thinking")this._emit("signature",r.signature);break}default:A$(t.delta)}break}case"message_stop":{this._addMessageParam(n),this._addMessage(fA(n,E(this,Ol,"f"),{logger:E(this,Wp,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{M(this,pi,n,"f");break}case"content_block_start":case"message_delta":break}},bA=function(){if(this.ended)throw new H("stream has ended, this shouldn't happen");let t=E(this,pi,"f");if(!t)throw new H("request ended without sending any chunks");return M(this,pi,void 0,"f"),fA(t,E(this,Ol,"f"),{logger:E(this,Wp,"f")})},w$=function(t){let n=E(this,pi,"f");if(t.type==="message_start"){if(n)throw new H(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!n)throw new H(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return n;case"message_delta":if(n.stop_reason=t.delta.stop_reason,n.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null)n.stop_details=t.delta.stop_details;if(n.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null)n.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)n.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)n.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)n.usage.server_tool_use=t.usage.server_tool_use;return n;case"content_block_start":return n.content.push({...t.content_block}),n;case"content_block_delta":{let r=n.content.at(t.index);switch(t.delta.type){case"text_delta":{if(r?.type==="text")n.content[t.index]={...r,text:(r.text||"")+t.delta.text};break}case"citations_delta":{if(r?.type==="text")n.content[t.index]={...r,citations:[...r.citations??[],t.delta.citation]};break}case"input_json_delta":{if(r&&EA(r)){let o=(r[ai]||"")+t.delta.partial_json;n.content[t.index]=p_(r,o)}break}case"thinking_delta":{if(r?.type==="thinking")n.content[t.index]={...r,thinking:r.thinking+t.delta.thinking};break}case"signature_delta":{if(r?.type==="thinking")n.content[t.index]={...r,signature:t.delta.signature};break}default:A$(t.delta)}return n}case"content_block_stop":{let r=n.content.at(t.index);if(r&&EA(r)&&ai in r)Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0});return n}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",(r)=>{let o=t.shift();if(o)o.resolve(r);else e.push(r)}),this.on("end",()=>{n=!0;for(let r of t)r.resolve(void 0);t.length=0}),this.on("abort",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),this.on("error",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),{next:async()=>{if(!e.length){if(n)return{value:void 0,done:!0};return new Promise((o,s)=>t.push({resolve:o,reject:s})).then((o)=>o?{value:o,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new kn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var qp;var xA=O(()=>{Qe();Ne();Uw();Sl();lt();qp=class qp extends se{create(e,t){let{user_profile_id:n,...r}=e;return this._client.post("/v1/messages/batches",{body:r,...t,headers:k([{...n!=null?{"anthropic-user-profile-id":n}:void 0},t?.headers])})}retrieve(e,t){return this._client.get(U`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",io,{query:e,...t})}delete(e,t){return this._client.delete(U`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(U`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new H(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:k([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,o)=>bl.fromResponse(o.response,o.controller))}}});var ba,C$,Ude;var vA=O(()=>{Ne();Wo();T$();hA();xA();xA();$w();ba=class ba extends se{constructor(){super(...arguments);this.batches=new qp(this._client)}create(e,t){let{user_profile_id:n,...r}=e;if(r.model in C$)console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${C$[r.model]}
72
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Ude.includes(r.model)&&r.thinking&&r.thinking.type==="enabled")console.warn(`Using Claude with ${r.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let o=this._client._options.timeout;if(!r.stream&&o==null){let i=d_[r.model]??void 0;o=this._client.calculateNonstreamingTimeout(r.max_tokens,i)}let s=Wg(r.tools,r.messages);return this._client.post("/v1/messages",{body:r,timeout:o??600000,...t,headers:k([{...n!=null?{"anthropic-user-profile-id":n}:void 0},s,t?.headers]),stream:e.stream??!1})}parse(e,t){return this.create(e,t).then((n)=>mA(n,e,{logger:this._client.logger??console}))}stream(e,t){return Vp.createMessage(this,e,t,{logger:this._client.logger??console})}countTokens(e,t){let{user_profile_id:n,...r}=e;return this._client.post("/v1/messages/count_tokens",{body:r,...t,headers:k([{...n!=null?{"anthropic-user-profile-id":n}:void 0},t?.headers])})}};C$={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},Ude=["claude-mythos-preview","claude-opus-4-6"];ba.Batches=qp});var Pl;var wA=O(()=>{Qe();Ne();lt();Pl=class Pl extends se{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(U`/v1/models/${e}`,{...n,headers:k([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",io,{query:r,...t,headers:k([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}});var k$=O(()=>{dA();pA();vA();wA();cF()});class Ut{get credentials(){return this._authState.provider}constructor({baseURL:e=Le("ANTHROPIC_BASE_URL"),apiKey:t,authToken:n,webhookKey:r=Le("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if(AA.add(this),this._requestAuthFlags=new WeakMap,A_.set(this,void 0),t===void 0)t=o.profile!=null?null:Le("ANTHROPIC_API_KEY")??null;if(n===void 0)n=o.profile!=null?null:Le("ANTHROPIC_AUTH_TOKEN")??null;if(o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:t,authToken:n,webhookKey:r,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&dU())throw new H(`It looks like you're running in a browser-like environment.
73
+
74
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
75
+ If you understand the risks and have appropriate mitigations in place,
76
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
77
+
78
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
79
+ `);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??TA.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=Kd,this.logLevel=Lg(s.logLevel,"ClientOptions.logLevel",Be(this))??Lg(Le("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",Be(this))??Kd,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??pU(),M(this,A_,mU,"f"),this.middleware=[...s.middleware??[]];let i=Le("ANTHROPIC_CUSTOM_HEADERS");if(i){let c={};for(let l of i.split(`
80
+ `)){let u=l.indexOf(":");if(u>=0)c[l.substring(0,u).trim()]=l.substring(u+1).trim()}s.defaultHeaders={...c,...s.defaultHeaders}}let a=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof t==="string"?t:null,this.authToken=n,this.webhookKey=r,a){if(this._authState=a,!this._baseURLIsExplicit&&a.baseURL)this.baseURL=a.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let c=s.credentials??null;if(c)this._authState.provider=c,this._authState.tokenCache=this._makeTokenCache(c);else if(s.config!=null){let l=Yv(s.config,this._credentialResolverOptions());this._authState.provider=l.provider,this._authState.tokenCache=this._makeTokenCache(l.provider),this._authState.extraHeaders=l.extraHeaders,this._applyCredentialBaseURL(l.baseURL)}else if(s.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(s.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let t=e.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:(e)=>{Be(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:(e)=>{Be(this).warn(e)}}}_credentialsFetch(){return Qv(this.fetch,this.middleware,void 0,this)}_makeTokenCache(e){return new Hv(e,(t)=>{Be(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(e){let t="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||t,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(e){try{let t=await YU(this._credentialResolverOptions(),e);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(e!=null)throw new H(`Profile "${e}" could not be resolved (no <config_dir>/configs/${e}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(e.get("x-api-key")||e.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&e.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&e.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(e){let t=this._requestAuthFlags.get(e);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,t);return t}async authHeaders(e){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,k([{Authorization:`Bearer ${t}`}])}return k([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey==null)return;return k([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken==null)return;return k([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return AU(e)}getUserAgent(){return`${this.constructor.name}/JS ${Mr}`}defaultIdempotencyKey(){return`stainless-node-retry-${nl()}`}makeStatusError(e,t,n,r){return Nt.generate(e,t,n,r)}buildURL(e,t,n){let r=!E(this,AA,"m",R$).call(this)&&n||this.baseURL,o=sU(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),s=this.defaultQuery(),i=Object.fromEntries(o.searchParams);if(!Pv(s)||!Pv(i))t={...i,...s,...t};if(typeof t==="object"&&t&&!Array.isArray(t))o.search=this.stringifyQuery(t);return o.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128000>600)throw new H("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let r=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,i]of Object.entries(this._authState.extraHeaders))if(!r.has(s))r.set(s,i);if(!r.get("anthropic-beta")?.split(",").map((s)=>s.trim())?.includes(sa))r.append("anthropic-beta",sa);e.headers=r}}backendMiddleware(){return[]}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then((r)=>({method:e,path:t,...r})))}request(e,t=null){return new ia(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,o=r.maxRetries??this.maxRetries;if(t==null)t=o,this._requestAuthFlags.delete(r);await this.prepareOptions(r);let{req:s,url:i,timeout:a}=await this.buildRequest(r,{retryCount:o-t}),c="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),l=n===void 0?"":`, retryOf: ${n}`,u=Date.now();if(r.signal?.aborted)throw new mn;let d=new AbortController,f=await this.fetchWithTimeout(i,s,a,d,r,{requestLogID:c,retryOfRequestLogID:n}).catch(oa),m=Date.now();if(f instanceof globalThis.Error){let y=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new mn;let b=Nr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),v=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(v&&!b&&!rF(f))throw Be(this).info(`[${c}] middleware error (not retryable)`),Be(this).debug(`[${c}] middleware error (not retryable)`,Ko({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),f;if(t)return Be(this).info(`[${c}] connection ${b?"timed out":"failed"} - ${y}`),Be(this).debug(`[${c}] connection ${b?"timed out":"failed"} (${y})`,Ko({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),this.retryRequest(r,t,n??c);if(Be(this).info(`[${c}] connection ${b?"timed out":"failed"} - error; no more retries left`),Be(this).debug(`[${c}] connection ${b?"timed out":"failed"} (error; no more retries left)`,Ko({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),b)throw new Od;if(v&&!Xv(f))throw f;throw new hs({cause:f})}let h=[...f.headers.entries()].filter(([y])=>y==="request-id").map(([y,b])=>", "+y+": "+JSON.stringify(b)).join(""),_=`[${c}${l}${h}] ${s.method} ${i} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-u}ms`;if(!f.ok){let y=await this.shouldRetry(f,r);if(t&&y){let D=`retrying, ${t} attempts remaining`;return await fU(f.body),Be(this).info(`${_} - ${D}`),Be(this).debug(`[${c}] response error (${D})`,Ko({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:m-u})),this.retryRequest(r,t,n??c,f.headers)}let b=y?"error; no more retries left":"error; not retryable";Be(this).info(`${_} - ${b}`);let v=await f.text().catch((D)=>oa(D).message),S=zd(v),x=S?void 0:v;throw Be(this).debug(`[${c}] response error (${b})`,Ko({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:x,durationMs:Date.now()-u})),this.makeStatusError(f.status,S,x,f.headers)}return Be(this).info(_),Be(this).debug(`[${c}] response start`,Ko({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:m-u})),{response:f,options:r,controller:d,requestLogID:c,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,n&&"then"in n?n.then((r)=>({method:"get",path:e,...r})):{method:"get",path:e,...n})}requestAPIList(e,t){let n=this.makeRequest(t,null,void 0);return new jg(this,n,e)}async fetchWithTimeout(e,t,n,r,o,s){let{signal:i,method:a,...c}=t||{},l=this._makeAbort(r);if(i)i.addEventListener("abort",l,{once:!0});let u=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body==="object"&&c.body!==null&&Symbol.asyncIterator in c.body,d={signal:r.signal,...u?{duplex:"half"}:{},method:"GET",...c};if(a)d.method=a.toUpperCase();let f=this.fetch,m=async(v,S)=>{let x=setTimeout(l,n);try{return await f.call(void 0,v,S)}finally{clearTimeout(x)}},h=o===void 0?m:async(v,S={})=>{let x=typeof v==="string"?v:v instanceof URL?v.href:v.url;if(S.headers=S.headers instanceof Headers?S.headers:new Headers(S.headers),await this.prepareRequest(S,{url:x,options:o}),s)Be(this).debug(`[${s.requestLogID}] sending request`,Ko({retryOfRequestLogID:s.retryOfRequestLogID,method:S.method,url:x,options:o,headers:S.headers}));return m(v,S)},_=o?.middleware,y=this.backendMiddleware(),b=_?.length||y.length?[...this.middleware,..._??[],...y]:this.middleware;return await Qv(h,b,o,this)(e,d)}async shouldRetry(e,t){let n=this._authFlags(t);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=e.headers.get("x-should-retry");if(r==="true")return!0;if(r==="false")return!1;if(e.status===408)return!0;if(e.status===409)return!0;if(e.status===429)return!0;if(e.status>=500)return!0;return!1}async retryRequest(e,t,n,r){let o,s=r?.get("retry-after-ms");if(s){let a=parseFloat(s);if(!Number.isNaN(a))o=a}let i=r?.get("retry-after");if(i&&!o){let a=parseFloat(i);if(!Number.isNaN(a))o=a*1000;else o=Date.parse(i)-Date.now()}if(o===void 0){let a=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,a)}return await oo(o),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let o=t-e,s=Math.min(0.5*Math.pow(2,o),8),i=1-Math.random()*0.25;return s*i*1000}calculateNonstreamingTimeout(e,t){if(3600000*e/128000>600000||t!=null&&e>t)throw new H("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:o,query:s,defaultBaseURL:i}=n;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let a=this.buildURL(o,s,i);if("timeout"in n)aU("timeout",n.timeout);n.timeout=n.timeout??this.timeout;let{bodyHeaders:c,body:l}=this.buildBody({options:n}),u=await this.buildHeaders({options:e,method:r,bodyHeaders:c,retryCount:t});return{req:{method:r,headers:u,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:a,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let o={};if(this.idempotencyHeader&&t!=="get"){if(!e.idempotencyKey)e.idempotencyKey=this.defaultIdempotencyKey();o[this.idempotencyHeader]=e.idempotencyKey}let s=k([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1000))}:{},...jd(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=k([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};else if(typeof e==="object"&&((Symbol.asyncIterator in e)||(Symbol.iterator in e)&&("next"in e)&&typeof e.next==="function"))return{bodyHeaders:void 0,body:Ag(e)};else if(typeof e==="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)};else return E(this,A_,"f").call(this,{body:e,headers:n})}}var AA,TA,A_,R$,O$="\\n\\nHuman:",P$="\\n\\nAssistant:",Ea;var CA=O(()=>{Jn();ro();wg();zv();wt();ol();IU();JU();oF();Qe();sw();k$();Fg();pA();wA();dA();vA();wg();Ne();Go();ro();TA=Ut,A_=new WeakMap,AA=new WeakSet,R$=function(){return this.baseURL!=="https://api.anthropic.com"};Ut.Anthropic=TA;Ut.HUMAN_PROMPT=O$;Ut.AI_PROMPT=P$;Ut.DEFAULT_TIMEOUT=600000;Ut.AnthropicError=H;Ut.APIError=Nt;Ut.APIConnectionError=hs;Ut.APIConnectionTimeoutError=Od;Ut.APIUserAbortError=mn;Ut.NotFoundError=Ld;Ut.ConflictError=Nd;Ut.RateLimitError=Ud;Ut.BadRequestError=Pd;Ut.AuthenticationError=Id;Ut.InternalServerError=Fd;Ut.PermissionDeniedError=Dd;Ut.UnprocessableEntityError=Md;Ut.toFile=Hg;Ea=class Ea extends Ut{constructor(){super(...arguments);this.completions=new Rl(this),this.messages=new ba(this),this.models=new Pl(this),this.beta=new Bt(this)}};Ea.Completions=Rl;Ea.Messages=ba;Ea.Models=Pl;Ea.Beta=Bt});var I$=O(()=>{wt();Wd();Ne();Wo();ro()});var ww=O(()=>{CA();sw();Fg();I$();CA();Qe();wt()});function ff(e,t){return function(){return e.apply(t,arguments)}}function mf(e){return e!==null&&!Gl(e)&&e.constructor!==null&&!Gl(e.constructor)&&or(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}function qge(e){let t;if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)t=ArrayBuffer.isView(e);else t=e&&e.buffer&&cj(e.buffer);return t}function s_e(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;return{}}function gf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!=="object")e=[e];if(Wl(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(mf(e))return;let s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length,a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function uj(e,t){if(mf(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,o;while(r-- >0)if(o=n[r],t===o.toLowerCase())return o;return null}function pT(){let{caseless:e,skipUndefined:t}=dj(this)&&this||{},n={},r=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;let i=e&&uj(n,s)||s;if(K_(n[i])&&K_(o))n[i]=pT(n[i],o);else if(K_(o))n[i]=pT({},o);else if(Wl(o))n[i]=o.slice();else if(!t||!Gl(o))n[i]=o};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&gf(arguments[o],r);return n}function R_e(e){return!!(e&&or(e.append)&&e[aj]==="FormData"&&e[W_])}var Vge,G_,W_,aj,V_,po=(e)=>(e=e.toLowerCase(),(t)=>V_(t)===e),q_=(e)=>(t)=>typeof t===e,Wl,Gl,cj,Zge,or,lj,hf=(e)=>e!==null&&typeof e==="object",Yge=(e)=>e===!0||e===!1,K_=(e)=>{if(V_(e)!=="object")return!1;let t=G_(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(aj in e)&&!(W_ in e)},Jge=(e)=>{if(!hf(e)||mf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},Xge,Qge,e_e=(e)=>!!(e&&typeof e.uri<"u"),t_e=(e)=>e&&typeof e.getParts<"u",n_e,r_e,o_e=(e)=>hf(e)&&or(e.pipe),oj,sj,i_e=(e)=>{if(!e)return!1;if(sj&&e instanceof sj)return!0;let t=G_(e);if(!t||t===Object.prototype)return!1;if(!or(e.append))return!1;let n=V_(e);return n==="formdata"||n==="object"&&or(e.toString)&&e.toString()==="[object FormData]"},a_e,c_e,l_e,u_e,d_e,p_e=(e)=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),Aa,dj=(e)=>!Gl(e)&&e!==Aa,f_e=(e,t,n,{allOwnKeys:r}={})=>(gf(t,(o,s)=>{if(n&&or(o))Object.defineProperty(e,s,{value:ff(o,n),writable:!0,enumerable:!0,configurable:!0});else Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),m_e=(e)=>{if(e.charCodeAt(0)===65279)e=e.slice(1);return e},h_e=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},g_e=(e,t,n,r)=>{let o,s,i,a={};if(t=t||{},e==null)return t;do{o=Object.getOwnPropertyNames(e),s=o.length;while(s-- >0)if(i=o[s],(!r||r(i,e,t))&&!a[i])t[i]=e[i],a[i]=!0;e=n!==!1&&G_(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},__e=(e,t,n)=>{if(e=String(e),n===void 0||n>e.length)n=e.length;n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},y_e=(e)=>{if(!e)return null;if(Wl(e))return e;let t=e.length;if(!lj(t))return null;let n=Array(t);while(t-- >0)n[t]=e[t];return n},S_e,b_e=(e,t)=>{let r=(e&&e[W_]).call(e),o;while((o=r.next())&&!o.done){let s=o.value;t.call(e,s[0],s[1])}},E_e=(e,t)=>{let n,r=[];while((n=e.exec(t))!==null)r.push(n);return r},x_e,v_e=(e)=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),ij,w_e,pj=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};gf(n,(o,s)=>{let i;if((i=t(o,s,e))!==!1)r[s]=i||o}),Object.defineProperties(e,r)},A_e=(e)=>{pj(e,(t,n)=>{if(or(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let r=e[n];if(!or(r))return;if(t.enumerable=!1,"writable"in t){t.writable=!1;return}if(!t.set)t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}})},T_e=(e,t)=>{let n={},r=(o)=>{o.forEach((s)=>{n[s]=!0})};return Wl(e)?r(e):r(String(e).split(t)),n},C_e=()=>{},k_e=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,O_e=(e)=>{let t=[,,,,,,,,,,],n=(r,o)=>{if(hf(r)){if(t.indexOf(r)>=0)return;if(mf(r))return r;if(!("toJSON"in r)){t[o]=r;let s=Wl(r)?[]:{};return gf(r,(i,a)=>{let c=n(i,o+1);!Gl(c)&&(s[a]=c)}),t[o]=void 0,s}}return r};return n(e,0)},P_e,I_e=(e)=>e&&(hf(e)||or(e))&&or(e.then)&&or(e.catch),fj,D_e,L_e=(e)=>e!=null&&or(e[W_]),A;var yt=O(()=>{({toString:Vge}=Object.prototype),{getPrototypeOf:G_}=Object,{iterator:W_,toStringTag:aj}=Symbol,V_=((e)=>(t)=>{let n=Vge.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),{isArray:Wl}=Array,Gl=q_("undefined");cj=po("ArrayBuffer");Zge=q_("string"),or=q_("function"),lj=q_("number"),Xge=po("Date"),Qge=po("File"),n_e=po("Blob"),r_e=po("FileList");oj=s_e(),sj=typeof oj.FormData<"u"?oj.FormData:void 0,a_e=po("URLSearchParams"),[c_e,l_e,u_e,d_e]=["ReadableStream","Request","Response","Headers"].map(po);Aa=(()=>{if(typeof globalThis<"u")return globalThis;return typeof self<"u"?self:typeof window<"u"?window:global})();S_e=((e)=>(t)=>e&&t instanceof e)(typeof Uint8Array<"u"&&G_(Uint8Array)),x_e=po("HTMLFormElement"),ij=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),w_e=po("RegExp");P_e=po("AsyncFunction"),fj=((e,t)=>{if(e)return setImmediate;return t?((n,r)=>(Aa.addEventListener("message",({source:o,data:s})=>{if(o===Aa&&s===n)r.length&&r.shift()()},!1),(o)=>{r.push(o),Aa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):(n)=>setTimeout(n)})(typeof setImmediate==="function",or(Aa.postMessage)),D_e=typeof queueMicrotask<"u"?queueMicrotask.bind(Aa):typeof process<"u"&&process.nextTick||fj,A={isArray:Wl,isArrayBuffer:cj,isBuffer:mf,isFormData:i_e,isArrayBufferView:qge,isString:Zge,isNumber:lj,isBoolean:Yge,isObject:hf,isPlainObject:K_,isEmptyObject:Jge,isReadableStream:c_e,isRequest:l_e,isResponse:u_e,isHeaders:d_e,isUndefined:Gl,isDate:Xge,isFile:Qge,isReactNativeBlob:e_e,isReactNative:t_e,isBlob:n_e,isRegExp:w_e,isFunction:or,isStream:o_e,isURLSearchParams:a_e,isTypedArray:S_e,isFileList:r_e,forEach:gf,merge:pT,extend:f_e,trim:p_e,stripBOM:m_e,inherits:h_e,toFlatObject:g_e,kindOf:V_,kindOfTest:po,endsWith:__e,toArray:y_e,forEachEntry:b_e,matchAll:E_e,isHTMLForm:x_e,hasOwnProperty:ij,hasOwnProp:ij,reduceDescriptors:pj,freezeMethods:A_e,toObjectSet:T_e,toCamelCase:v_e,noop:C_e,toFiniteNumber:k_e,findKey:uj,global:Aa,isContextDefined:dj,isSpecCompliantForm:R_e,toJSONObject:O_e,isAsyncFn:P_e,isThenable:I_e,setImmediate:fj,asap:D_e,isIterable:L_e}});var Ln,G;var Cr=O(()=>{yt();Ln=class Ln extends Error{static from(e,t,n,r,o,s){let i=new Ln(e.message,t||e.code,n,r,o);if(i.cause=e,i.name=e.name,e.status!=null&&i.status==null)i.status=e.status;return s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e);if(Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o)this.response=o,this.status=o.status}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}};Ln.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ln.ERR_BAD_OPTION="ERR_BAD_OPTION";Ln.ECONNABORTED="ECONNABORTED";Ln.ETIMEDOUT="ETIMEDOUT";Ln.ERR_NETWORK="ERR_NETWORK";Ln.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ln.ERR_DEPRECATED="ERR_DEPRECATED";Ln.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ln.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ln.ERR_CANCELED="ERR_CANCELED";Ln.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ln.ERR_INVALID_URL="ERR_INVALID_URL";Ln.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";G=Ln});var gj=C(function(uAt,hj){var mj=ve("stream").Stream,N_e=ve("util");hj.exports=fo;function fo(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}N_e.inherits(fo,mj);fo.create=function(e,t){var n=new this;t=t||{};for(var r in t)n[r]=t[r];n.source=e;var o=e.emit;if(e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),n.pauseStream)e.pause();return n};Object.defineProperty(fo.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});fo.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fo.prototype.resume=function(){if(!this._released)this.release();this.source.resume()};fo.prototype.pause=function(){this.source.pause()};fo.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};fo.prototype.pipe=function(){var e=mj.prototype.pipe.apply(this,arguments);return this.resume(),e};fo.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data")this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded();this._bufferedEvents.push(e)};fo.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded)return;if(this.dataSize<=this.maxDataSize)return;this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(e))}});var bj=C(function(dAt,Sj){var M_e=ve("util"),yj=ve("stream").Stream,_j=gj();Sj.exports=$t;function $t(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}M_e.inherits($t,yj);$t.create=function(e){var t=new this;e=e||{};for(var n in e)t[n]=e[n];return t};$t.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};$t.prototype.append=function(e){var t=$t.isStreamLike(e);if(t){if(!(e instanceof _j)){var n=_j.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}if(this._handleErrors(e),this.pauseStreams)e.pause()}return this._streams.push(e),this};$t.prototype.pipe=function(e,t){return yj.prototype.pipe.call(this,e,t),this.resume(),e};$t.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};$t.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(n){var r=$t.isStreamLike(n);if(r)n.on("data",this._checkDataSize.bind(this)),this._handleErrors(n);this._pipeNext(n)}.bind(this))};$t.prototype._pipeNext=function(e){this._currentStream=e;var t=$t.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var n=e;this.write(n),this._getNext()};$t.prototype._handleErrors=function(e){var t=this;e.on("error",function(n){t._emitError(n)})};$t.prototype.write=function(e){this.emit("data",e)};$t.prototype.pause=function(){if(!this.pauseStreams)return;if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};$t.prototype.resume=function(){if(!this._released)this._released=!0,this.writable=!0,this._getNext();if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};$t.prototype.end=function(){this._reset(),this.emit("end")};$t.prototype.destroy=function(){this._reset(),this.emit("close")};$t.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};$t.prototype._checkDataSize=function(){if(this._updateDataSize(),this.dataSize<=this.maxDataSize)return;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(e))};$t.prototype._updateDataSize=function(){this.dataSize=0;var e=this;if(this._streams.forEach(function(t){if(!t.dataSize)return;e.dataSize+=t.dataSize}),this._currentStream&&this._currentStream.dataSize)this.dataSize+=this._currentStream.dataSize};$t.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ej=C(function(pAt,U_e){U_e.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Tj=C(function(K_e){/*!
81
+ * mime-types
82
+ * Copyright(c) 2014 Jonathan Ong
83
+ * Copyright(c) 2015 Douglas Christopher Wilson
84
+ * MIT Licensed
85
+ */var Z_=Ej(),F_e=ve("path").extname,xj=/^\s*([^;\s]*)(?:;|\s|$)/,$_e=/^text\//i;K_e.charset=vj;K_e.charsets={lookup:vj};K_e.contentType=z_e;K_e.extension=j_e;K_e.extensions=Object.create(null);K_e.lookup=H_e;K_e.types=Object.create(null);B_e(K_e.extensions,K_e.types);function vj(e){if(!e||typeof e!=="string")return!1;var t=xj.exec(e),n=t&&Z_[t[1].toLowerCase()];if(n&&n.charset)return n.charset;if(t&&$_e.test(t[1]))return"UTF-8";return!1}function z_e(e){if(!e||typeof e!=="string")return!1;var t=e.indexOf("/")===-1?K_e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var n=K_e.charset(t);if(n)t+="; charset="+n.toLowerCase()}return t}function j_e(e){if(!e||typeof e!=="string")return!1;var t=xj.exec(e),n=t&&K_e.extensions[t[1].toLowerCase()];if(!n||!n.length)return!1;return n[0]}function H_e(e){if(!e||typeof e!=="string")return!1;var t=F_e("x."+e).toLowerCase().substr(1);if(!t)return!1;return K_e.types[t]||!1}function B_e(e,t){var n=["nginx","apache",void 0,"iana"];Object.keys(Z_).forEach(function(o){var s=Z_[o],i=s.extensions;if(!i||!i.length)return;e[o]=i;for(var a=0;a<i.length;a++){var c=i[a];if(t[c]){var l=n.indexOf(Z_[t[c]].source),u=n.indexOf(s.source);if(t[c]!=="application/octet-stream"&&(l>u||l===u&&t[c].substr(0,12)==="application/"))continue}t[c]=o}})}});var kj=C(function(mAt,Cj){Cj.exports=q_e;function q_e(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t)t(e);else setTimeout(e,0)}});var hT=C(function(hAt,Oj){var Rj=kj();Oj.exports=Z_e;function Z_e(e){var t=!1;return Rj(function(){t=!0}),function(r,o){if(t)e(r,o);else Rj(function(){e(r,o)})}}});var gT=C(function(gAt,Pj){Pj.exports=Y_e;function Y_e(e){Object.keys(e.jobs).forEach(J_e.bind(e)),e.jobs={}}function J_e(e){if(typeof this.jobs[e]=="function")this.jobs[e]()}});var _T=C(function(_At,Dj){var Ij=hT(),X_e=gT();Dj.exports=Q_e;function Q_e(e,t,n,r){var o=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[o]=eye(t,o,e[o],function(s,i){if(!(o in n.jobs))return;if(delete n.jobs[o],s)X_e(n);else n.results[o]=i;r(s,n.results)})}function eye(e,t,n,r){var o;if(e.length==2)o=e(n,Ij(r));else o=e(n,t,Ij(r));return o}});var yT=C(function(yAt,Lj){Lj.exports=tye;function tye(e,t){var n=!Array.isArray(e),r={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};if(t)r.keyedList.sort(n?t:function(o,s){return t(e[o],e[s])});return r}});var ST=C(function(SAt,Nj){var nye=gT(),rye=hT();Nj.exports=oye;function oye(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,nye(this),rye(e)(null,this.results)}});var Uj=C(function(bAt,Mj){var sye=_T(),iye=yT(),aye=ST();Mj.exports=cye;function cye(e,t,n){var r=iye(e);while(r.index<(r.keyedList||e).length)sye(e,t,r,function(o,s){if(o){n(o,s);return}if(Object.keys(r.jobs).length===0){n(null,r.results);return}}),r.index++;return aye.bind(r,n)}});var bT=C(function(EAt,Y_){var Fj=_T(),lye=yT(),uye=ST();Y_.exports=dye;Y_.exports.ascending=$j;Y_.exports.descending=pye;function dye(e,t,n,r){var o=lye(e,n);return Fj(e,t,o,function s(i,a){if(i){r(i,a);return}if(o.index++,o.index<(o.keyedList||e).length){Fj(e,t,o,s);return}r(null,o.results)}),uye.bind(o,r)}function $j(e,t){return e<t?-1:e>t?1:0}function pye(e,t){return-1*$j(e,t)}});var jj=C(function(xAt,zj){var fye=bT();zj.exports=mye;function mye(e,t,n){return fye(e,t,null,n)}});var Bj=C(function(vAt,Hj){Hj.exports={parallel:Uj(),serial:jj(),serialOrdered:bT()}});var ET=C(function(wAt,Kj){Kj.exports=Object});var Wj=C(function(AAt,Gj){Gj.exports=Error});var qj=C(function(TAt,Vj){Vj.exports=EvalError});var Yj=C(function(CAt,Zj){Zj.exports=RangeError});var Xj=C(function(kAt,Jj){Jj.exports=ReferenceError});var e1=C(function(RAt,Qj){Qj.exports=SyntaxError});var J_=C(function(OAt,t1){t1.exports=TypeError});var r1=C(function(PAt,n1){n1.exports=URIError});var s1=C(function(IAt,o1){o1.exports=Math.abs});var a1=C(function(DAt,i1){i1.exports=Math.floor});var l1=C(function(LAt,c1){c1.exports=Math.max});var d1=C(function(NAt,u1){u1.exports=Math.min});var f1=C(function(MAt,p1){p1.exports=Math.pow});var h1=C(function(UAt,m1){m1.exports=Math.round});var _1=C(function(FAt,g1){g1.exports=Number.isNaN||function(t){return t!==t}});var S1=C(function($At,y1){var hye=_1();y1.exports=function(t){if(hye(t)||t===0)return t;return t<0?-1:1}});var E1=C(function(zAt,b1){b1.exports=Object.getOwnPropertyDescriptor});var xT=C(function(jAt,x1){var X_=E1();if(X_)try{X_([],"length")}catch(e){X_=null}x1.exports=X_});var w1=C(function(HAt,v1){var Q_=Object.defineProperty||!1;if(Q_)try{Q_({},"a",{value:1})}catch(e){Q_=!1}v1.exports=Q_});var vT=C(function(BAt,A1){A1.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n==="string")return!1;if(Object.prototype.toString.call(n)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;t[n]=o;for(var s in t)return!1;if(typeof Object.keys==="function"&&Object.keys(t).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==o||a.enumerable!==!0)return!1}return!0}});var k1=C(function(KAt,C1){var T1=typeof Symbol<"u"&&Symbol,gye=vT();C1.exports=function(){if(typeof T1!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof T1("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return gye()}});var wT=C(function(GAt,R1){R1.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var AT=C(function(WAt,O1){var _ye=ET();O1.exports=_ye.getPrototypeOf||null});var D1=C(function(VAt,I1){var yye="Function.prototype.bind called on incompatible ",Sye=Object.prototype.toString,bye=Math.max,Eye="[object Function]",P1=function(t,n){var r=[];for(var o=0;o<t.length;o+=1)r[o]=t[o];for(var s=0;s<n.length;s+=1)r[s+t.length]=n[s];return r},xye=function(t,n){var r=[];for(var o=n||0,s=0;o<t.length;o+=1,s+=1)r[s]=t[o];return r},vye=function(e,t){var n="";for(var r=0;r<e.length;r+=1)if(n+=e[r],r+1<e.length)n+=t;return n};I1.exports=function(t){var n=this;if(typeof n!=="function"||Sye.apply(n)!==Eye)throw TypeError(yye+n);var r=xye(arguments,1),o,s=function(){if(this instanceof o){var u=n.apply(this,P1(r,arguments));if(Object(u)===u)return u;return this}return n.apply(t,P1(r,arguments))},i=bye(0,n.length-r.length),a=[];for(var c=0;c<i;c++)a[c]="$"+c;if(o=Function("binder","return function ("+vye(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var l=function(){};l.prototype=n.prototype,o.prototype=new l,l.prototype=null}return o}});var Ta=C(function(qAt,L1){var wye=D1();L1.exports=Function.prototype.bind||wye});var ey=C(function(ZAt,N1){N1.exports=Function.prototype.call});var TT=C(function(YAt,M1){M1.exports=Function.prototype.apply});var F1=C(function(JAt,U1){U1.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var z1=C(function(XAt,$1){var Aye=Ta(),Tye=TT(),Cye=ey(),kye=F1();$1.exports=kye||Aye.call(Cye,Tye)});var H1=C(function(QAt,j1){var Rye=Ta(),Oye=J_(),Pye=ey(),Iye=z1();j1.exports=function(t){if(t.length<1||typeof t[0]!=="function")throw new Oye("a function is required");return Iye(Rye,Pye,t)}});var q1=C(function(eTt,V1){var Dye=H1(),B1=xT(),G1;try{G1=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var CT=!!G1&&B1&&B1(Object.prototype,"__proto__"),W1=Object,K1=W1.getPrototypeOf;V1.exports=CT&&typeof CT.get==="function"?Dye([CT.get]):typeof K1==="function"?function(t){return K1(t==null?t:W1(t))}:!1});var Q1=C(function(tTt,X1){var Z1=wT(),Y1=AT(),J1=q1();X1.exports=Z1?function(t){return Z1(t)}:Y1?function(t){if(!t||typeof t!=="object"&&typeof t!=="function")throw TypeError("getProto: not an object");return Y1(t)}:J1?function(t){return J1(t)}:null});var tH=C(function(nTt,eH){var Lye=Function.prototype.call,Nye=Object.prototype.hasOwnProperty,Mye=Ta();eH.exports=Mye.call(Lye,Nye)});var aH=C(function(rTt,iH){var Ue,Uye=ET(),Fye=Wj(),$ye=qj(),zye=Yj(),jye=Xj(),Yl=e1(),Zl=J_(),Hye=r1(),Bye=s1(),Kye=a1(),Gye=l1(),Wye=d1(),Vye=f1(),qye=h1(),Zye=S1(),oH=Function,kT=function(e){try{return oH('"use strict"; return ('+e+").constructor;")()}catch(t){}},_f=xT(),Yye=w1(),RT=function(){throw new Zl},Jye=_f?function(){try{return arguments.callee,RT}catch(e){try{return _f(arguments,"callee").get}catch(t){return RT}}}():RT,Vl=k1()(),cn=Q1(),Xye=AT(),Qye=wT(),sH=TT(),yf=ey(),ql={},eSe=typeof Uint8Array>"u"||!cn?Ue:cn(Uint8Array),Ca={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ue:ArrayBuffer,"%ArrayIteratorPrototype%":Vl&&cn?cn([][Symbol.iterator]()):Ue,"%AsyncFromSyncIteratorPrototype%":Ue,"%AsyncFunction%":ql,"%AsyncGenerator%":ql,"%AsyncGeneratorFunction%":ql,"%AsyncIteratorPrototype%":ql,"%Atomics%":typeof Atomics>"u"?Ue:Atomics,"%BigInt%":typeof BigInt>"u"?Ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Fye,"%eval%":eval,"%EvalError%":$ye,"%Float16Array%":typeof Float16Array>"u"?Ue:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ue:FinalizationRegistry,"%Function%":oH,"%GeneratorFunction%":ql,"%Int8Array%":typeof Int8Array>"u"?Ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ue:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vl&&cn?cn(cn([][Symbol.iterator]())):Ue,"%JSON%":typeof JSON==="object"?JSON:Ue,"%Map%":typeof Map>"u"?Ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vl||!cn?Ue:cn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Uye,"%Object.getOwnPropertyDescriptor%":_f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ue:Promise,"%Proxy%":typeof Proxy>"u"?Ue:Proxy,"%RangeError%":zye,"%ReferenceError%":jye,"%Reflect%":typeof Reflect>"u"?Ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vl||!cn?Ue:cn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vl&&cn?cn(""[Symbol.iterator]()):Ue,"%Symbol%":Vl?Symbol:Ue,"%SyntaxError%":Yl,"%ThrowTypeError%":Jye,"%TypedArray%":eSe,"%TypeError%":Zl,"%Uint8Array%":typeof Uint8Array>"u"?Ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ue:Uint32Array,"%URIError%":Hye,"%WeakMap%":typeof WeakMap>"u"?Ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ue:WeakSet,"%Function.prototype.call%":yf,"%Function.prototype.apply%":sH,"%Object.defineProperty%":Yye,"%Object.getPrototypeOf%":Xye,"%Math.abs%":Bye,"%Math.floor%":Kye,"%Math.max%":Gye,"%Math.min%":Wye,"%Math.pow%":Vye,"%Math.round%":qye,"%Math.sign%":Zye,"%Reflect.getPrototypeOf%":Qye};if(cn)try{null.error}catch(e){OT=cn(cn(e)),Ca["%Error.prototype%"]=OT}var OT,tSe=function e(t){var n;if(t==="%AsyncFunction%")n=kT("async function () {}");else if(t==="%GeneratorFunction%")n=kT("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=kT("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");if(r)n=r.prototype}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");if(o&&cn)n=cn(o.prototype)}return Ca[t]=n,n},nH={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Sf=Ta(),ty=tH(),nSe=Sf.call(yf,Array.prototype.concat),rSe=Sf.call(sH,Array.prototype.splice),rH=Sf.call(yf,String.prototype.replace),ny=Sf.call(yf,String.prototype.slice),oSe=Sf.call(yf,RegExp.prototype.exec),sSe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iSe=/\\(\\)?/g,aSe=function(t){var n=ny(t,0,1),r=ny(t,-1);if(n==="%"&&r!=="%")throw new Yl("invalid intrinsic syntax, expected closing `%`");else if(r==="%"&&n!=="%")throw new Yl("invalid intrinsic syntax, expected opening `%`");var o=[];return rH(t,sSe,function(s,i,a,c){o[o.length]=a?rH(c,iSe,"$1"):i||s}),o},cSe=function(t,n){var r=t,o;if(ty(nH,r))o=nH[r],r="%"+o[0]+"%";if(ty(Ca,r)){var s=Ca[r];if(s===ql)s=tSe(r);if(typeof s>"u"&&!n)throw new Zl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:s}}throw new Yl("intrinsic "+t+" does not exist!")};iH.exports=function(t,n){if(typeof t!=="string"||t.length===0)throw new Zl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!=="boolean")throw new Zl('"allowMissing" argument must be a boolean');if(oSe(/^%?[^%]*%?$/,t)===null)throw new Yl("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=aSe(t),o=r.length>0?r[0]:"",s=cSe("%"+o+"%",n),{name:i,value:a}=s,c=!1,l=s.alias;if(l)o=l[0],rSe(r,nSe([0,1],l));for(var u=1,d=!0;u<r.length;u+=1){var f=r[u],m=ny(f,0,1),h=ny(f,-1);if((m==='"'||m==="'"||m==="`"||(h==='"'||h==="'"||h==="`"))&&m!==h)throw new Yl("property names with quotes must have matching quotes");if(f==="constructor"||!d)c=!0;if(o+="."+f,i="%"+o+"%",ty(Ca,i))a=Ca[i];else if(a!=null){if(!(f in a)){if(!n)throw new Zl("base intrinsic for "+t+" exists, but the property is not available.");return}if(_f&&u+1>=r.length){var _=_f(a,f);if(d=!!_,d&&"get"in _&&!("originalValue"in _.get))a=_.get;else a=a[f]}else d=ty(a,f),a=a[f];if(d&&!c)Ca[i]=a}}return a}});var lH=C(function(oTt,cH){var lSe=vT();cH.exports=function(){return lSe()&&!!Symbol.toStringTag}});var dH=C(function(sTt,uH){var uSe=Function.prototype.call,dSe=Object.prototype.hasOwnProperty,pSe=Ta();uH.exports=pSe.call(uSe,dSe)});var mH=C(function(iTt,fH){var fSe=aH(),pH=fSe("%Object.defineProperty%",!0),mSe=lH()(),hSe=dH(),gSe=J_(),ry=mSe?Symbol.toStringTag:null;fH.exports=function(t,n){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!=="boolean"||typeof o<"u"&&typeof o!=="boolean")throw new gSe("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");if(ry&&(r||!hSe(t,ry)))if(pH)pH(t,ry,{configurable:!o,enumerable:!1,value:n,writable:!1});else t[ry]=n}});var gH=C(function(aTt,hH){var _Se=Function.prototype.call,ySe=Object.prototype.hasOwnProperty,SSe=Ta();hH.exports=SSe.call(_Se,ySe)});var yH=C(function(cTt,_H){_H.exports=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e}});var EH=C(function(lTt,bH){var LT=bj(),bSe=ve("util"),PT=ve("path"),ESe=ve("http"),xSe=ve("https"),vSe=ve("url").parse,wSe=ve("fs"),ASe=ve("stream").Stream,TSe=ve("crypto"),IT=Tj(),CSe=Bj(),kSe=mH(),yi=gH(),DT=yH();function SH(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Ke(e){if(!(this instanceof Ke))return new Ke(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],LT.call(this),e=e||{};for(var t in e)this[t]=e[t]}bSe.inherits(Ke,LT);Ke.LINE_BREAK=`\r
86
+ `;Ke.DEFAULT_CONTENT_TYPE="application/octet-stream";Ke.prototype.append=function(e,t,n){if(n=n||{},typeof n==="string")n={filename:n};var r=LT.prototype.append.bind(this);if(typeof t==="number"||t==null)t=String(t);if(Array.isArray(t)){this._error(Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,n),s=this._multiPartFooter();r(o),r(t),r(s),this._trackLength(o,t,n)};Ke.prototype._trackLength=function(e,t,n){var r=0;if(n.knownLength!=null)r+=Number(n.knownLength);else if(Buffer.isBuffer(t))r=t.length;else if(typeof t==="string")r=Buffer.byteLength(t);if(this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+Ke.LINE_BREAK.length,!t||!t.path&&!(t.readable&&yi(t,"httpVersion"))&&!(t instanceof ASe))return;if(!n.knownLength)this._valuesToMeasure.push(t)};Ke.prototype._lengthRetriever=function(e,t){if(yi(e,"fd"))if(e.end!=null&&e.end!=1/0&&e.start!=null)t(null,e.end+1-(e.start?e.start:0));else wSe.stat(e.path,function(n,r){if(n){t(n);return}var o=r.size-(e.start?e.start:0);t(null,o)});else if(yi(e,"httpVersion"))t(null,Number(e.headers["content-length"]));else if(yi(e,"httpModule"))e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume();else t("Unknown stream")};Ke.prototype._multiPartHeader=function(e,t,n){if(typeof n.header==="string")return n.header;var r=this._getContentDisposition(t,n),o=this._getContentType(t,n),s="",i={"Content-Disposition":["form-data",'name="'+SH(e)+'"'].concat(r||[]),"Content-Type":[].concat(o||[])};if(typeof n.header==="object")DT(i,n.header);var a;for(var c in i)if(yi(i,c)){if(a=i[c],a==null)continue;if(!Array.isArray(a))a=[a];if(a.length)s+=c+": "+a.join("; ")+Ke.LINE_BREAK}return"--"+this.getBoundary()+Ke.LINE_BREAK+s+Ke.LINE_BREAK};Ke.prototype._getContentDisposition=function(e,t){var n;if(typeof t.filepath==="string")n=PT.normalize(t.filepath).replace(/\\/g,"/");else if(t.filename||e&&(e.name||e.path))n=PT.basename(t.filename||e&&(e.name||e.path));else if(e&&e.readable&&yi(e,"httpVersion"))n=PT.basename(e.client._httpMessage.path||"");if(n)return'filename="'+SH(n)+'"'};Ke.prototype._getContentType=function(e,t){var n=t.contentType;if(!n&&e&&e.name)n=IT.lookup(e.name);if(!n&&e&&e.path)n=IT.lookup(e.path);if(!n&&e&&e.readable&&yi(e,"httpVersion"))n=e.headers["content-type"];if(!n&&(t.filepath||t.filename))n=IT.lookup(t.filepath||t.filename);if(!n&&e&&typeof e==="object")n=Ke.DEFAULT_CONTENT_TYPE;return n};Ke.prototype._multiPartFooter=function(){return function(e){var t=Ke.LINE_BREAK,n=this._streams.length===0;if(n)t+=this._lastBoundary();e(t)}.bind(this)};Ke.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ke.LINE_BREAK};Ke.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)if(yi(e,t))n[t.toLowerCase()]=e[t];return n};Ke.prototype.setBoundary=function(e){if(typeof e!=="string")throw TypeError("FormData boundary must be a string");this._boundary=e};Ke.prototype.getBoundary=function(){if(!this._boundary)this._generateBoundary();return this._boundary};Ke.prototype.getBuffer=function(){var e=new Buffer.alloc(0),t=this.getBoundary();for(var n=0,r=this._streams.length;n<r;n++)if(typeof this._streams[n]!=="function"){if(Buffer.isBuffer(this._streams[n]))e=Buffer.concat([e,this._streams[n]]);else e=Buffer.concat([e,Buffer.from(this._streams[n])]);if(typeof this._streams[n]!=="string"||this._streams[n].substring(2,t.length+2)!==t)e=Buffer.concat([e,Buffer.from(Ke.LINE_BREAK)])}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Ke.prototype._generateBoundary=function(){this._boundary="--------------------------"+TSe.randomBytes(12).toString("hex")};Ke.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length)e+=this._lastBoundary().length;if(!this.hasKnownLength())this._error(Error("Cannot calculate proper length in synchronous way."));return e};Ke.prototype.hasKnownLength=function(){var e=!0;if(this._valuesToMeasure.length)e=!1;return e};Ke.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length)t+=this._lastBoundary().length;if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}CSe.parallel(this._valuesToMeasure,this._lengthRetriever,function(n,r){if(n){e(n);return}r.forEach(function(o){t+=o}),e(null,t)})};Ke.prototype.submit=function(e,t){var n,r,o={method:"post"};if(typeof e==="string")e=vSe(e),r=DT({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o);else if(r=DT(e,o),!r.port)r.port=r.protocol==="https:"?443:80;if(r.headers=this.getHeaders(e.headers),r.protocol==="https:")n=xSe.request(r);else n=ESe.request(r);return this.getLength(function(s,i){if(s&&s!=="Unknown stream"){this._error(s);return}if(i)n.setHeader("Content-Length",i);if(this.pipe(n),t){var a,c=function(l,u){return n.removeListener("error",c),n.removeListener("response",a),t.call(this,l,u)};a=c.bind(this,null),n.on("error",c),n.on("response",a)}}.bind(this)),n};Ke.prototype._error=function(e){if(!this.error)this.error=e,this.pause(),this.emit("error",e)};Ke.prototype.toString=function(){return"[object FormData]"};kSe(Ke.prototype,"FormData");bH.exports=Ke});var xH,oy;var NT=O(()=>{xH=qn(EH(),1),oy=xH.default});function UT(e){return A.isPlainObject(e)||A.isArray(e)}function vH(e){return A.endsWith(e,"[]")?e.slice(0,-2):e}function MT(e,t,n){if(!e)return t;return e.concat(t).map(function(o,s){return o=vH(o),!n&&s?"["+o+"]":o}).join(n?".":"")}function RSe(e){return A.isArray(e)&&!e.some(UT)}function PSe(e,t,n){if(!A.isObject(e))throw TypeError("target must be an object");t=t||new(oy||FormData),n=A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!A.isUndefined(b[y])});let r=n.metaTokens,o=n.visitor||d,s=n.dots,i=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=a&&A.isSpecCompliantForm(t);if(!A.isFunction(o))throw TypeError("visitor must be a function");function u(_){if(_===null)return"";if(A.isDate(_))return _.toISOString();if(A.isBoolean(_))return _.toString();if(!l&&A.isBlob(_))throw new G("Blob is not supported. Use a Buffer instead.");if(A.isArrayBuffer(_)||A.isTypedArray(_))return l&&typeof Blob==="function"?new Blob([_]):Buffer.from(_);return _}function d(_,y,b){let v=_;if(A.isReactNative(t)&&A.isReactNativeBlob(_))return t.append(MT(b,y,s),u(_)),!1;if(_&&!b&&typeof _==="object"){if(A.endsWith(y,"{}"))y=r?y:y.slice(0,-2),_=JSON.stringify(_);else if(A.isArray(_)&&RSe(_)||(A.isFileList(_)||A.endsWith(y,"[]"))&&(v=A.toArray(_)))return y=vH(y),v.forEach(function(x,w){!(A.isUndefined(x)||x===null)&&t.append(i===!0?MT([y],w,s):i===null?y:y+"[]",u(x))}),!1}if(UT(_))return!0;return t.append(MT(b,y,s),u(_)),!1}let f=[],m=Object.assign(OSe,{defaultVisitor:d,convertValue:u,isVisitable:UT});function h(_,y,b=0){if(A.isUndefined(_))return;if(b>c)throw new G("Object is too deeply nested ("+b+" levels). Max depth: "+c,G.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(_)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(_),A.forEach(_,function(S,x){if((!(A.isUndefined(S)||S===null)&&o.call(t,S,A.isString(x)?x.trim():x,y,m))===!0)h(S,y?y.concat(x):[x],b+1)}),f.pop()}if(!A.isObject(e))throw TypeError("data must be an object");return h(e),t}var OSe,Si;var bf=O(()=>{yt();Cr();NT();OSe=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});Si=PSe});function wH(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function AH(e,t){this._pairs=[],e&&Si(e,this,t)}var TH,CH;var kH=O(()=>{bf();TH=AH.prototype;TH.append=function(t,n){this._pairs.push([t,n])};TH.toString=function(t){let n=t?function(r){return t.call(this,r,wH)}:wH;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};CH=AH});function ISe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ka(e,t,n){if(!t)return e;let r=n&&n.encode||ISe,o=A.isFunction(n)?{serialize:n}:n,s=o&&o.serialize,i;if(s)i=s(t,o);else i=A.isURLSearchParams(t)?t.toString():new CH(t,o).toString(r);if(i){let a=e.indexOf("#");if(a!==-1)e=e.slice(0,a);e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var sy=O(()=>{yt();kH()});class RH{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){if(this.handlers[e])this.handlers[e]=null}clear(){if(this.handlers)this.handlers=[]}forEach(e){A.forEach(this.handlers,function(n){if(n!==null)e(n)})}}var FT;var OH=O(()=>{yt();FT=RH});var bi;var Ef=O(()=>{bi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}});import DSe from"url";var PH;var IH=O(()=>{PH=DSe.URLSearchParams});import LSe from"crypto";var $T="abcdefghijklmnopqrstuvwxyz",DH="0123456789",LH,NSe=(e=16,t=LH.ALPHA_DIGIT)=>{let n="",{length:r}=t,o=new Uint32Array(e);LSe.randomFillSync(o);for(let s=0;s<e;s++)n+=t[o[s]%r];return n},NH;var MH=O(()=>{IH();NT();LH={DIGIT:DH,ALPHA:$T,ALPHA_DIGIT:$T+$T.toUpperCase()+DH},NH={isNode:!0,classes:{URLSearchParams:PH,FormData:oy,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:LH,generateString:NSe,protocols:["http","https","file","data"]}});var HT={};Zn(HT,{hasBrowserEnv:()=>jT,hasStandardBrowserEnv:()=>MSe,hasStandardBrowserWebWorkerEnv:()=>USe,navigator:()=>zT,origin:()=>FSe});var jT,zT,MSe,USe,FSe;var UH=O(()=>{jT=typeof window<"u"&&typeof document<"u",zT=typeof navigator==="object"&&navigator||void 0,MSe=jT&&(!zT||["ReactNative","NativeScript","NS"].indexOf(zT.product)<0),USe=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")(),FSe=jT&&window.location.href||"http://localhost"});var Ye;var mo=O(()=>{MH();UH();Ye={...HT,...NH}});function BT(e,t){return Si(e,new Ye.classes.URLSearchParams,{visitor:function(n,r,o,s){if(Ye.isNode&&A.isBuffer(n))return this.append(r,n.toString("base64")),!1;return s.defaultVisitor.apply(this,arguments)},...t})}var FH=O(()=>{yt();bf();mo()});function $Se(e){return A.matchAll(/\w+|\[(\w*)]/g,e).map((t)=>t[0]==="[]"?"":t[1]||t[0])}function zSe(e){let t={},n=Object.keys(e),r,o=n.length,s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function jSe(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;let a=Number.isFinite(+i),c=s>=n.length;if(i=!i&&A.isArray(o)?o.length:i,c){if(A.hasOwnProp(o,i))o[i]=A.isArray(o[i])?o[i].concat(r):[o[i],r];else o[i]=r;return!a}if(!o[i]||!A.isObject(o[i]))o[i]=[];if(t(n,r,o[i],s)&&A.isArray(o[i]))o[i]=zSe(o[i]);return!a}if(A.isFormData(e)&&A.isFunction(e.entries)){let n={};return A.forEachEntry(e,(r,o)=>{t($Se(r),o,n,0)}),n}return null}var iy;var KT=O(()=>{yt();iy=jSe});function HSe(e,t,n){if(A.isString(e))try{return(t||JSON.parse)(e),A.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}var Jl=(e,t)=>e!=null&&A.hasOwnProp(e,t)?e[t]:void 0,GT,Xl;var ay=O(()=>{yt();Cr();Ef();bf();FH();mo();KT();GT={transitional:bi,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=A.isObject(t);if(s&&A.isHTMLForm(t))t=new FormData(t);if(A.isFormData(t))return o?JSON.stringify(iy(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){let c=Jl(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return BT(t,c).toString();if((a=A.isFileList(t))||r.indexOf("multipart/form-data")>-1){let l=Jl(this,"env"),u=l&&l.FormData;return Si(a?{"files[]":t}:t,u&&new u,c)}}if(s||o)return n.setContentType("application/json",!1),HSe(t);return t}],transformResponse:[function(t){let n=Jl(this,"transitional")||GT.transitional,r=n&&n.forcedJSONParsing,o=Jl(this,"responseType"),s=o==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(r&&!o||s)){let a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,Jl(this,"parseReviver"))}catch(c){if(a){if(c.name==="SyntaxError")throw G.from(c,G.ERR_BAD_RESPONSE,this,null,Jl(this,"response"));throw c}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ye.classes.FormData,Blob:Ye.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],(e)=>{GT.headers[e]={}});Xl=GT});var BSe,$H=(e)=>{let t={},n,r,o;return e&&e.split(`
87
+ `).forEach(function(i){if(o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!n||t[n]&&BSe[n])return;if(n==="set-cookie")if(t[n])t[n].push(r);else t[n]=[r];else t[n]=t[n]?t[n]+", "+r:r}),t};var zH=O(()=>{yt();BSe=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"])});function GSe(e){let t=0,n=e.length;while(t<n){let r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}while(n>t){let r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function xf(e){return e&&String(e).trim().toLowerCase()}function WSe(e){return GSe(e.replace(KSe,""))}function cy(e){if(e===!1||e==null)return e;return A.isArray(e)?e.map(cy):WSe(String(e))}function VSe(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;while(r=n.exec(e))t[r[1]]=r[2];return t}function WT(e,t,n,r,o){if(A.isFunction(r))return r.call(this,t,n);if(o)t=n;if(!A.isString(t))return;if(A.isString(r))return t.indexOf(r)!==-1;if(A.isRegExp(r))return r.test(t)}function ZSe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function YSe(e,t){let n=A.toCamelCase(" "+t);["get","set","has"].forEach((r)=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}var jH,KSe,qSe=(e)=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),vf,Lt;var Xo=O(()=>{yt();zH();jH=Symbol("internals"),KSe=/[^\x09\x20-\x7E\x80-\xFF]/g;vf=class vf{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function o(i,a,c){let l=xf(a);if(!l)throw Error("header name must be a non-empty string");let u=A.findKey(r,l);if(!u||r[u]===void 0||c===!0||c===void 0&&r[u]!==!1)r[u||a]=cy(i)}let s=(i,a)=>A.forEach(i,(c,l)=>o(c,l,a));if(A.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(A.isString(e)&&(e=e.trim())&&!qSe(e))s($H(e),t);else if(A.isObject(e)&&A.isIterable(e)){let i={},a,c;for(let l of e){if(!A.isArray(l))throw TypeError("Object iterator must return a key-value pair");i[c=l[0]]=(a=i[c])?A.isArray(a)?[...a,l[1]]:[a,l[1]]:l[1]}s(i,t)}else e!=null&&o(t,e,n);return this}get(e,t){if(e=xf(e),e){let n=A.findKey(this,e);if(n){let r=this[n];if(!t)return r;if(t===!0)return VSe(r);if(A.isFunction(t))return t.call(this,r,n);if(A.isRegExp(t))return t.exec(r);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=xf(e),e){let n=A.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||WT(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function o(s){if(s=xf(s),s){let i=A.findKey(n,s);if(i&&(!t||WT(n,n[i],i,t)))delete n[i],r=!0}}if(A.isArray(e))e.forEach(o);else o(e);return r}clear(e){let t=Object.keys(this),n=t.length,r=!1;while(n--){let o=t[n];if(!e||WT(this,this[o],o,e,!0))delete this[o],r=!0}return r}normalize(e){let t=this,n={};return A.forEach(this,(r,o)=>{let s=A.findKey(n,o);if(s){t[s]=cy(r),delete t[o];return}let i=e?ZSe(o):String(o).trim();if(i!==o)delete t[o];t[i]=cy(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return A.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&A.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
88
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach((r)=>n.set(r)),n}static accessor(e){let n=(this[jH]=this[jH]={accessors:{}}).accessors,r=this.prototype;function o(s){let i=xf(s);if(!n[i])YSe(r,s),n[i]=!0}return A.isArray(e)?e.forEach(o):o(e),this}};vf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);A.reduceDescriptors(vf.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});A.freezeMethods(vf);Lt=vf});function wf(e,t){let n=this||Xl,r=t||n,o=Lt.from(r.headers),s=r.data;return A.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}var HH=O(()=>{yt();ay();Xo()});function Af(e){return!!(e&&e.__CANCEL__)}var BH,kr;var Ra=O(()=>{Cr();BH=class BH extends G{constructor(e,t,n){super(e==null?"canceled":e,G.ERR_CANCELED,t,n);this.name="CanceledError",this.__CANCEL__=!0}};kr=BH});function Qo(e,t,n){let r=n.config.validateStatus;if(!n.status||!r||r(n.status))e(n);else t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}var ly=O(()=>{Cr()});function VT(e){if(typeof e!=="string")return!1;return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qT(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Oa(e,t,n){let r=!VT(t);if(e&&(r||n===!1))return qT(e,t);return t}var uy=()=>{};function XSe(e){try{return new URL(e)}catch{return null}}function KH(e){var t=(typeof e==="string"?XSe(e):e)||{},{protocol:n,host:r,port:o}=t;if(typeof r!=="string"||!r||typeof n!=="string")return"";if(n=n.split(":",1)[0],r=r.replace(/:\d*$/,""),o=parseInt(o)||JSe[n]||0,!QSe(r,o))return"";var s=ZT(n+"_proxy")||ZT("all_proxy");if(s&&s.indexOf("://")===-1)s=n+"://"+s;return s}function QSe(e,t){var n=ZT("no_proxy").toLowerCase();if(!n)return!0;if(n==="*")return!1;return n.split(/[,\s]/).every(function(r){if(!r)return!0;var o=r.match(/^(.+):(\d+)$/),s=o?o[1]:r,i=o?parseInt(o[2]):0;if(i&&i!==t)return!0;if(!/^[.*]/.test(s))return e!==s;if(s.charAt(0)==="*")s=s.slice(1);return!e.endsWith(s)})}function ZT(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var JSe;var GH=O(()=>{JSe={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443}});var VH=C(function(dCt,WH){var Ql=1000,eu=Ql*60,tu=eu*60,Pa=tu*24,ebe=Pa*7,tbe=Pa*365.25;WH.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return nbe(e);else if(n==="number"&&isFinite(e))return t.long?obe(e):rbe(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function nbe(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*tbe;case"weeks":case"week":case"w":return n*ebe;case"days":case"day":case"d":return n*Pa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*tu;case"minutes":case"minute":case"mins":case"min":case"m":return n*eu;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ql;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}function rbe(e){var t=Math.abs(e);if(t>=Pa)return Math.round(e/Pa)+"d";if(t>=tu)return Math.round(e/tu)+"h";if(t>=eu)return Math.round(e/eu)+"m";if(t>=Ql)return Math.round(e/Ql)+"s";return e+"ms"}function obe(e){var t=Math.abs(e);if(t>=Pa)return dy(e,t,Pa,"day");if(t>=tu)return dy(e,t,tu,"hour");if(t>=eu)return dy(e,t,eu,"minute");if(t>=Ql)return dy(e,t,Ql,"second");return e+" ms"}function dy(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var YT=C(function(pCt,qH){function sbe(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=VH(),n.destroy=l,Object.keys(e).forEach((u)=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,m,h;function _(...y){if(!_.enabled)return;let b=_,v=Number(new Date),S=v-(d||v);if(b.diff=S,b.prev=d,b.curr=v,d=v,y[0]=n.coerce(y[0]),typeof y[0]!=="string")y.unshift("%O");let x=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(D,P)=>{if(D==="%%")return"%";x++;let F=n.formatters[P];if(typeof F==="function"){let z=y[x];D=F.call(b,z),y.splice(x,1),x--}return D}),n.formatArgs.call(b,y),(b.log||n.log).apply(b,y)}if(_.namespace=u,_.useColors=n.useColors(),_.color=n.selectColor(u),_.extend=r,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(m!==n.namespaces)m=n.namespaces,h=n.enabled(u);return h},set:(y)=>{f=y}}),typeof n.init==="function")n.init(_);return _}function r(u,d){let f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d=(typeof u==="string"?u:"").trim().replace(" ",",").split(",").filter(Boolean);for(let f of d)if(f[0]==="-")n.skips.push(f.slice(1));else n.names.push(f)}function s(u,d){let f=0,m=0,h=-1,_=0;while(f<u.length)if(m<d.length&&(d[m]===u[f]||d[m]==="*"))if(d[m]==="*")h=m,_=f,m++;else f++,m++;else if(h!==-1)m=h+1,_++,f=_;else return!1;while(m<d.length&&d[m]==="*")m++;return m===d.length}function i(){let u=[...n.names,...n.skips.map((d)=>"-"+d)].join(",");return n.enable(""),u}function a(u){for(let d of n.skips)if(s(u,d))return!1;for(let d of n.names)if(s(u,d))return!0;return!1}function c(u){if(u instanceof Error)return u.stack||u.message;return u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}qH.exports=sbe});var YH=C(function(ZH,fy){ZH.formatArgs=abe;ZH.save=cbe;ZH.load=lbe;ZH.useColors=ibe;ZH.storage=ube();ZH.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();ZH.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ibe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function abe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+fy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(o)=>{if(o==="%%")return;if(n++,o==="%c")r=n}),e.splice(r,0,t)}ZH.log=console.debug||console.log||(()=>{});function cbe(e){try{if(e)ZH.storage.setItem("debug",e);else ZH.storage.removeItem("debug")}catch(t){}}function lbe(){let e;try{e=ZH.storage.getItem("debug")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function ube(){try{return localStorage}catch(e){}}fy.exports=YT()(ZH);var{formatters:dbe}=fy.exports;dbe.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var XH=C(function(mCt,JH){JH.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var tB=C(function(hCt,eB){var Sbe=ve("os"),QH=ve("tty"),Br=XH(),{env:ln}=process,my;if(Br("no-color")||Br("no-colors")||Br("color=false")||Br("color=never"))my=0;else if(Br("color")||Br("colors")||Br("color=true")||Br("color=always"))my=1;function bbe(){if("FORCE_COLOR"in ln){if(ln.FORCE_COLOR==="true")return 1;if(ln.FORCE_COLOR==="false")return 0;return ln.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ln.FORCE_COLOR,10),3)}}function Ebe(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function xbe(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=bbe();if(r!==void 0)my=r;let o=n?my:r;if(o===0)return 0;if(n){if(Br("color=16m")||Br("color=full")||Br("color=truecolor"))return 3;if(Br("color=256"))return 2}if(e&&!t&&o===void 0)return 0;let s=o||0;if(ln.TERM==="dumb")return s;if(process.platform==="win32"){let i=Sbe.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in ln){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((i)=>(i in ln))||ln.CI_NAME==="codeship")return 1;return s}if("TEAMCITY_VERSION"in ln)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ln.TEAMCITY_VERSION)?1:0;if(ln.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in ln){let i=Number.parseInt((ln.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ln.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(ln.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ln.TERM))return 1;if("COLORTERM"in ln)return 1;return s}function JT(e,t={}){let n=xbe(e,{streamIsTTY:e&&e.isTTY,...t});return Ebe(n)}eB.exports={supportsColor:JT,stdout:JT({isTTY:QH.isatty(1)}),stderr:JT({isTTY:QH.isatty(2)})}});var sB=C(function(rB,gy){var vbe=ve("tty"),hy=ve("util");rB.init=Obe;rB.log=Cbe;rB.formatArgs=Abe;rB.save=kbe;rB.load=Rbe;rB.useColors=wbe;rB.destroy=hy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");rB.colors=[6,2,3,4,5,1];try{let e=tB();if(e&&(e.stderr||e).level>=2)rB.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}rB.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[t];if(/^(yes|on|true|enabled)$/i.test(r))r=!0;else if(/^(no|off|false|disabled)$/i.test(r))r=!1;else if(r==="null")r=null;else r=Number(r);return e[n]=r,e},{});function wbe(){return"colors"in rB.inspectOpts?Boolean(rB.inspectOpts.colors):vbe.isatty(process.stderr.fd)}function Abe(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
89
+ `).join(`
90
+ `+s),e.push(o+"m+"+gy.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Tbe()+t+" "+e[0]}function Tbe(){if(rB.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Cbe(...e){return process.stderr.write(hy.formatWithOptions(rB.inspectOpts,...e)+`
91
+ `)}function kbe(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function Rbe(){return process.env.DEBUG}function Obe(e){e.inspectOpts={};let t=Object.keys(rB.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=rB.inspectOpts[t[n]]}gy.exports=YT()(rB);var{formatters:nB}=gy.exports;nB.o=function(e){return this.inspectOpts.colors=this.useColors,hy.inspect(e,this.inspectOpts).split(`
92
+ `).map((t)=>t.trim()).join(" ")};nB.O=function(e){return this.inspectOpts.colors=this.useColors,hy.inspect(e,this.inspectOpts)}});var iB=C(function(_Ct,XT){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)XT.exports=YH();else XT.exports=sB()});var cB=C(function(yCt,aB){var Tf;aB.exports=function(){if(!Tf){try{Tf=iB()("follow-redirects")}catch(e){}if(typeof Tf!=="function")Tf=function(){}}Tf.apply(null,arguments)}});var fB=C(function(SCt,uC){var kf=ve("url"),Cf=kf.URL,Fbe=ve("http"),$be=ve("https"),rC=ve("stream").Writable,oC=ve("assert"),lB=cB();(function(){var t=typeof process<"u",n=typeof window<"u"&&typeof document<"u",r=La(Error.captureStackTrace);if(!t&&(n||!r))console.warn("The follow-redirects package should be excluded from browser builds.")})();var sC=!1;try{oC(new Cf(""))}catch(e){sC=e.code==="ERR_INVALID_URL"}var zbe=["Authorization","Proxy-Authorization","Cookie"],jbe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],iC=["abort","aborted","connect","error","socket","timeout"],aC=Object.create(null);iC.forEach(function(e){aC[e]=function(t,n,r){this._redirectable.emit(e,t,n,r)}});var eC=Rf("ERR_INVALID_URL","Invalid URL",TypeError),tC=Rf("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Hbe=Rf("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",tC),Bbe=Rf("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Kbe=Rf("ERR_STREAM_WRITE_AFTER_END","write after end"),Gbe=rC.prototype.destroy||dB;function sr(e,t){if(rC.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t)this.on("response",t);var n=this;this._onNativeResponse=function(r){try{n._processResponse(r)}catch(o){n.emit("error",o instanceof tC?o:new tC({cause:o}))}},this._headerFilter=new RegExp("^(?:"+zbe.concat(e.sensitiveHeaders).map(Jbe).join("|")+")$","i"),this._performRequest()}sr.prototype=Object.create(rC.prototype);sr.prototype.abort=function(){lC(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};sr.prototype.destroy=function(e){return lC(this._currentRequest,e),Gbe.call(this,e),this};sr.prototype.write=function(e,t,n){if(this._ending)throw new Kbe;if(!Da(e)&&!Zbe(e))throw TypeError("data should be a string, Buffer or Uint8Array");if(La(t))n=t,t=null;if(e.length===0){if(n)n();return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength)this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n);else this.emit("error",new Bbe),this.abort()};sr.prototype.end=function(e,t,n){if(La(e))n=e,e=t=null;else if(La(t))n=t,t=null;if(!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else{var r=this,o=this._currentRequest;this.write(e,t,function(){r._ended=!0,o.end(null,null,n)}),this._ending=!0}};sr.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};sr.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};sr.prototype.setTimeout=function(e,t){var n=this;function r(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){if(n._timeout)clearTimeout(n._timeout);n._timeout=setTimeout(function(){n.emit("timeout"),s()},e),r(i)}function s(){if(n._timeout)clearTimeout(n._timeout),n._timeout=null;if(n.removeListener("abort",s),n.removeListener("error",s),n.removeListener("response",s),n.removeListener("close",s),t)n.removeListener("timeout",t);if(!n.socket)n._currentRequest.removeListener("socket",o)}if(t)this.on("timeout",t);if(this.socket)o(this.socket);else this._currentRequest.once("socket",o);return this.on("socket",r),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){sr.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(sr.prototype,e,{get:function(){return this._currentRequest[e]}})});sr.prototype._sanitizeOptions=function(e){if(!e.headers)e.headers={};if(!qbe(e.sensitiveHeaders))e.sensitiveHeaders=[];if(e.host){if(!e.hostname)e.hostname=e.host;delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0)e.pathname=e.path;else e.pathname=e.path.substring(0,t),e.search=e.path.substring(t)}};sr.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=t.request(this._options,this._onNativeResponse);r._redirectable=this;for(var o of iC)r.on(o,aC[o]);if(this._currentUrl=/^\//.test(this._options.path)?kf.format(this._options):this._options.path,this._isRedirect){var s=0,i=this,a=this._requestBodyBuffers;(function c(l){if(r===i._currentRequest){if(l)i.emit("error",l);else if(s<a.length){var u=a[s++];if(!r.finished)r.write(u.data,u.encoding,c)}else if(i._ended)r.end()}})()}};sr.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects)this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(lC(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Hbe;var r,o=this._options.beforeRedirect;if(o)r=Object.assign({Host:e.req.getHeader("host")},this._options.headers);var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))this._options.method="GET",this._requestBodyBuffers=[],QT(/^content-/i,this._options.headers);var i=QT(/^host$/i,this._options.headers),a=cC(this._currentUrl),c=i||a.host,l=/^\w+:/.test(n)?this._currentUrl:kf.format(Object.assign(a,{host:c})),u=Wbe(n,l);if(lB("redirecting to",u.href),this._isRedirect=!0,nC(u,this._options),u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!Vbe(u.host,c))QT(this._headerFilter,this._options.headers);if(La(o)){var d={headers:e.headers,statusCode:t},f={url:l,method:s,headers:r};o(this._options,d,f),this._sanitizeOptions(this._options)}this._performRequest()};function uB(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(r){var o=r+":",s=n[o]=e[r],i=t[r]=Object.create(s);function a(l,u,d){if(Ybe(l))l=nC(l);else if(Da(l))l=nC(cC(l));else d=u,u=pB(l),l={protocol:o};if(La(u))d=u,u=null;if(u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,u),u.nativeProtocols=n,!Da(u.host)&&!Da(u.hostname))u.hostname="::1";return oC.equal(u.protocol,o,"protocol mismatch"),lB("options",u),new sr(u,d)}function c(l,u,d){var f=i.request(l,u,d);return f.end(),f}Object.defineProperties(i,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function dB(){}function cC(e){var t;if(sC)t=new Cf(e);else if(t=pB(kf.parse(e)),!Da(t.protocol))throw new eC({input:e});return t}function Wbe(e,t){return sC?new Cf(e,t):cC(kf.resolve(t,e))}function pB(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new eC({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new eC({input:e.href||e});return e}function nC(e,t){var n=t||{};for(var r of jbe)n[r]=e[r];if(n.hostname.startsWith("["))n.hostname=n.hostname.slice(1,-1);if(n.port!=="")n.port=Number(n.port);return n.path=n.search?n.pathname+n.search:n.pathname,n}function QT(e,t){var n;for(var r in t)if(e.test(r))n=t[r],delete t[r];return n===null||typeof n>"u"?void 0:String(n).trim()}function Rf(e,t,n){function r(o){if(La(Error.captureStackTrace))Error.captureStackTrace(this,this.constructor);Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return r.prototype=Object.create((n||Error).prototype),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),r}function lC(e,t){for(var n of iC)e.removeListener(n,aC[n]);e.on("error",dB),e.destroy(t)}function Vbe(e,t){oC(Da(e)&&Da(t));var n=e.length-t.length-1;return n>0&&e[n]==="."&&e.endsWith(t)}function qbe(e){return e instanceof Array}function Da(e){return typeof e==="string"||e instanceof String}function La(e){return typeof e==="function"}function Zbe(e){return typeof e==="object"&&"length"in e}function Ybe(e){return Cf&&e instanceof Cf}function Jbe(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}uC.exports=uB({http:Fbe,https:$be});uC.exports.wrap=uB});var Na="1.15.2";function Of(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dC(e,t,n){let r=n&&n.Blob||Ye.classes.Blob,o=Of(e);if(t===void 0&&r)t=!0;if(o==="data"){e=o.length?e.slice(o.length+1):e;let s=Xbe.exec(e);if(!s)throw new G("Invalid URL",G.ERR_INVALID_URL);let i=s[1],a=s[2],c=s[3],l=Buffer.from(decodeURIComponent(c),a?"base64":"utf8");if(t){if(!r)throw new G("Blob is not supported",G.ERR_NOT_SUPPORT);return new r([l],{type:i})}return l}throw new G("Unsupported protocol "+o,G.ERR_NOT_SUPPORT)}var Xbe;var mB=O(()=>{Cr();mo();Xbe=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/});import Qbe from"stream";var pC,hB,fC;var gB=O(()=>{yt();pC=Symbol("internals");hB=class hB extends Qbe.Transform{constructor(e){e=A.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,r)=>!A.isUndefined(r[n]));super({readableHighWaterMark:e.chunkSize});let t=this[pC]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",(n)=>{if(n==="progress"){if(!t.isCaptured)t.isCaptured=!0}})}_read(e){let t=this[pC];if(t.onReadCallback)t.onReadCallback();return super._read(e)}_transform(e,t,n){let r=this[pC],o=r.maxRate,s=this.readableHighWaterMark,i=r.timeWindow,a=1000/i,c=o/a,l=r.minChunkSize!==!1?Math.max(r.minChunkSize,c*0.01):0,u=(f,m)=>{let h=Buffer.byteLength(f);if(r.bytesSeen+=h,r.bytes+=h,r.isCaptured&&this.emit("progress",r.bytesSeen),this.push(f))process.nextTick(m);else r.onReadCallback=()=>{r.onReadCallback=null,process.nextTick(m)}},d=(f,m)=>{let h=Buffer.byteLength(f),_=null,y=s,b,v=0;if(o){let S=Date.now();if(!r.ts||(v=S-r.ts)>=i)r.ts=S,b=c-r.bytes,r.bytes=b<0?-b:0,v=0;b=c-r.bytes}if(o){if(b<=0)return setTimeout(()=>{m(null,f)},i-v);if(b<y)y=b}if(y&&h>y&&h-y>l)_=f.subarray(y),f=f.subarray(0,y);u(f,_?()=>{process.nextTick(m,null,_)}:m)};d(e,function f(m,h){if(m)return n(m);if(h)d(h,f);else n(null)})}};fC=hB});var _B,eEe=async function*(e){if(e.stream)yield*e.stream();else if(e.arrayBuffer)yield await e.arrayBuffer();else if(e[_B])yield*e[_B]();else yield e},_y;var mC=O(()=>{({asyncIterator:_B}=Symbol),_y=eEe});import tEe from"util";import{Readable as nEe}from"stream";class yB{constructor(e,t){let{escapeName:n}=this.constructor,r=A.isString(t),o=`Content-Disposition: form-data; name="${n(e)}"${!r&&t.name?`; filename="${n(t.name)}"`:""}${Ma}`;if(r)t=Pf.encode(String(t).replace(/\r?\n|\r\n?/g,Ma));else{let s=String(t.type||"application/octet-stream").replace(/[\r\n]/g,"");o+=`Content-Type: ${s}${Ma}`}this.headers=Pf.encode(o+Ma),this.contentLength=r?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+sEe,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;if(A.isTypedArray(e))yield e;else yield*_y(e);yield oEe}static escapeName(e){return String(e).replace(/[\r\n"]/g,(t)=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}}var rEe,Pf,Ma=`\r
93
+ `,oEe,sEe=2,iEe=(e,t,n)=>{let{tag:r="form-data-boundary",size:o=25,boundary:s=r+"-"+Ye.generateString(o,rEe)}=n||{};if(!A.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let i=Pf.encode("--"+s+Ma),a=Pf.encode("--"+s+"--"+Ma),c=a.byteLength,l=Array.from(e.entries()).map(([d,f])=>{let m=new yB(d,f);return c+=m.size,m});c+=i.byteLength*l.length,c=A.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(c))u["Content-Length"]=c;return t&&t(u),nEe.from(async function*(){for(let d of l)yield i,yield*d.encode();yield a}())},SB;var bB=O(()=>{yt();mC();mo();rEe=Ye.ALPHABET.ALPHA_DIGIT+"-_",Pf=typeof TextEncoder==="function"?new TextEncoder:new tEe.TextEncoder,oEe=Pf.encode(Ma);SB=iEe});import aEe from"stream";var EB,xB;var vB=O(()=>{EB=class EB extends aEe.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0){if(this._transform=this.__transform,e[0]!==120){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,t)}}this.__transform(e,t,n)}};xB=EB});var cEe=(e,t)=>A.isAsyncFn(e)?function(...n){let r=n.pop();e.apply(this,n).then((o)=>{try{t?r(null,...t(o)):r(null,o)}catch(s){r(s)}},r)}:e,wB;var AB=O(()=>{yt();wB=cEe});function hC(e){let t;try{t=new URL(e)}catch(s){return!1}let n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if(n==="*")return!0;let r=Number.parseInt(t.port,10)||dEe[t.protocol.split(":",1)[0]]||0,o=CB(t.hostname.toLowerCase());return n.split(/[\s,]+/).some((s)=>{if(!s)return!1;let[i,a]=pEe(s);if(i=CB(i),!i)return!1;if(a&&a!==r)return!1;if(i.charAt(0)==="*")i=i.slice(1);if(i.charAt(0)===".")return o.endsWith(i);return o===i||TB(o)&&TB(i)})}var lEe,kB=(e)=>{let t=e.split(".");if(t.length!==4)return!1;if(t[0]!=="127")return!1;return t.every((n)=>/^\d+$/.test(n)&&Number(n)>=0&&Number(n)<=255)},uEe=(e)=>{if(e==="::1")return!0;let t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return kB(t[1]);let n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){let o=parseInt(n[1],16);return o>=32512&&o<=32767}let r=e.split(":");if(r.length===8){for(let o=0;o<7;o++)if(!/^0+$/.test(r[o]))return!1;return/^0*1$/.test(r[7])}return!1},TB=(e)=>{if(!e)return!1;if(lEe.has(e))return!0;if(kB(e))return!0;return uEe(e)},dEe,pEe=(e)=>{let t=e,n=0;if(t.charAt(0)==="["){let s=t.indexOf("]");if(s!==-1){let i=t.slice(1,s),a=t.slice(s+1);if(a.charAt(0)===":"&&/^\d+$/.test(a.slice(1)))n=Number.parseInt(a.slice(1),10);return[i,n]}}let r=t.indexOf(":"),o=t.lastIndexOf(":");if(r!==-1&&r===o&&/^\d+$/.test(t.slice(o+1)))n=Number.parseInt(t.slice(o+1),10),t=t.slice(0,o);return[t,n]},CB=(e)=>{if(!e)return e;if(e.charAt(0)==="["&&e.charAt(e.length-1)==="]")e=e.slice(1,-1);return e.replace(/\.+$/,"")};var RB=O(()=>{lEe=new Set(["localhost"]),dEe={http:80,https:443,ws:80,wss:443,ftp:21}});function fEe(e,t){e=e||10;let n=Array(e),r=Array(e),o=0,s=0,i;return t=t!==void 0?t:1000,function(c){let l=Date.now(),u=r[s];if(!i)i=l;n[o]=c,r[o]=l;let d=s,f=0;while(d!==o)f+=n[d++],d=d%e;if(o=(o+1)%e,o===s)s=(s+1)%e;if(l-i<t)return;let m=u&&l-u;return m?Math.round(f*1000/m):void 0}}var OB;var PB=O(()=>{OB=fEe});function mEe(e,t){let n=0,r=1000/t,o,s,i=(l,u=Date.now())=>{if(n=u,o=null,s)clearTimeout(s),s=null;e(...l)};return[(...l)=>{let u=Date.now(),d=u-n;if(d>=r)i(l,u);else if(o=l,!s)s=setTimeout(()=>{s=null,i(o)},r-d)},()=>o&&i(o)]}var IB;var DB=O(()=>{IB=mEe});var vs=(e,t,n=3)=>{let r=0,o=OB(50,250);return IB((s)=>{let i=s.loaded,a=s.lengthComputable?s.total:void 0,c=a!=null?Math.min(i,a):i,l=Math.max(0,c-r),u=o(l);r=Math.max(r,c);let d={loaded:c,total:a,progress:a?c/a:void 0,bytes:l,rate:u?u:void 0,estimated:u&&a?(a-c)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},nu=(e,t)=>{let n=e!=null;return[(r)=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ru=(e)=>(...t)=>A.asap(()=>e(...t));var yy=O(()=>{PB();DB();yt()});function gC(e){if(!e||typeof e!=="string")return 0;if(!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let{length:s,length:i}=r;for(let f=0;f<i;f++)if(r.charCodeAt(f)===37&&f+2<i){let m=r.charCodeAt(f+1),h=r.charCodeAt(f+2);if((m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))s-=2,f+=2}let a=0,c=i-1,l=(f)=>f>=2&&r.charCodeAt(f-2)===37&&r.charCodeAt(f-1)===51&&(r.charCodeAt(f)===68||r.charCodeAt(f)===100);if(c>=0){if(r.charCodeAt(c)===61)a++,c--;else if(l(c))a++,c-=3}if(a===1&&c>=0){if(r.charCodeAt(c)===61)a++;else if(l(c))a++}let d=Math.floor(s/4)*3-(a||0);return d>0?d:0}return Buffer.byteLength(r,"utf8")}import hEe from"http";import gEe from"https";import jB from"http2";import HB from"util";import{resolve as LB}from"path";import Ei from"zlib";import ho from"stream";import{EventEmitter as _Ee}from"events";class KB{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1000},t);let n=this.sessions[e];if(n){let l=n.length;for(let u=0;u<l;u++){let[d,f]=n[u];if(!d.destroyed&&!d.closed&&HB.isDeepStrictEqual(f,t))return d}}let r=jB.connect(e,t),o,s=()=>{if(o)return;o=!0;let l=n,u=l.length,d=u;while(d--)if(l[d][0]===r){if(u===1)delete this.sessions[e];else l.splice(d,1);if(!r.closed)r.close();return}},i=r.request,{sessionTimeout:a}=t;if(a!=null){let l,u=0;r.request=function(){let d=i.apply(this,arguments);if(u++,l)clearTimeout(l),l=null;return d.once("close",()=>{if(!--u)l=setTimeout(()=>{l=null,s()},a)}),d}}r.once("close",s);let c=[r,t];return n?n.push(c):n=this.sessions[e]=[c],r}}function vEe(e,t){if(e.beforeRedirects.proxy)e.beforeRedirects.proxy(e);if(e.beforeRedirects.config)e.beforeRedirects.config(e,t)}function GB(e,t,n){let r=t;if(!r&&r!==!1){let o=KH(n);if(o){if(!hC(n))r=new URL(o)}}if(r){if(r.username)r.auth=(r.username||"")+":"+(r.password||"");if(r.auth){if(Boolean(r.auth.username||r.auth.password))r.auth=(r.auth.username||"")+":"+(r.auth.password||"");else if(typeof r.auth==="object")throw new G("Invalid proxy authorization",G.ERR_BAD_OPTION,{proxy:r});let i=Buffer.from(r.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+i}e.headers.host=e.hostname+(e.port?":"+e.port:"");let o=r.hostname||r.host;if(e.hostname=o,e.host=o,e.port=r.port,e.path=n,r.protocol)e.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`}e.beforeRedirects.proxy=function(s){GB(s,t,s.href)}}var BB,NB,yEe,MB,SEe,bEe,EEe,UB,Sy,FB,$B=(e,[t,n])=>(e.on("end",n).on("error",n),t),xEe,wEe,AEe=(e)=>new Promise((t,n)=>{let r,o,s=(c,l)=>{if(o)return;o=!0,r&&r(c,l)},i=(c)=>{s(c),t(c)},a=(c)=>{s(c,!0),n(c)};e(i,a,(c)=>r=c).catch(a)}),TEe=({address:e,family:t})=>{if(!A.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},zB=(e,t)=>TEe(A.isObject(e)?e:{address:e,family:t}),CEe,WB;var VB=O(()=>{yt();ly();uy();sy();GH();Ef();Cr();Ra();mo();mB();Xo();gB();bB();mC();vB();AB();RB();yy();BB=qn(fB(),1),NB={flush:Ei.constants.Z_SYNC_FLUSH,finishFlush:Ei.constants.Z_SYNC_FLUSH},yEe={flush:Ei.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ei.constants.BROTLI_OPERATION_FLUSH},MB=A.isFunction(Ei.createBrotliDecompress),{http:SEe,https:bEe}=BB.default,EEe=/https:?/,UB=Symbol("axios.http.socketListener"),Sy=Symbol("axios.http.currentReq"),FB=Ye.protocols.map((e)=>e+":");xEe=new KB;wEe=typeof process<"u"&&A.kindOf(process)==="process",CEe={request(e,t){let n=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:r,headers:o}=e,s=xEe.getSession(n,r),{HTTP2_HEADER_SCHEME:i,HTTP2_HEADER_METHOD:a,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=jB.constants,u={[i]:e.protocol.replace(":",""),[a]:e.method,[c]:e.path};A.forEach(o,(f,m)=>{m.charAt(0)!==":"&&(u[m]=f)});let d=s.request(u);return d.once("response",(f)=>{let m=d;f=Object.assign({},f);let h=f[l];delete f[l],m.headers=f,m.statusCode=+h,t(m)}),d}},WB=wEe&&function(t){return AEe(async function(r,o,s){let i=(ae)=>A.hasOwnProp(t,ae)?t[ae]:void 0,a=i("data"),c=i("lookup"),l=i("family"),u=i("httpVersion");if(u===void 0)u=1;let d=i("http2Options"),f=i("responseType"),m=i("responseEncoding"),h=t.method.toUpperCase(),_,y=!1,b;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);let v=u===2;if(c){let ae=wB(c,(re)=>A.isArray(re)?re:[re]);c=(re,$e,nt)=>{ae(re,$e,(ie,_t,rt)=>{if(ie)return nt(ie);let ct=A.isArray(_t)?_t.map((on)=>zB(on)):[zB(_t,rt)];$e.all?nt(ie,ct):nt(ie,ct[0].address,ct[0].family)})}}let S=new _Ee;function x(ae){try{S.emit("abort",!ae||ae.type?new kr(null,t,b):ae)}catch(re){console.warn("emit error",re)}}S.once("abort",o);let w=()=>{if(t.cancelToken)t.cancelToken.unsubscribe(x);if(t.signal)t.signal.removeEventListener("abort",x);S.removeAllListeners()};if(t.cancelToken||t.signal){if(t.cancelToken&&t.cancelToken.subscribe(x),t.signal)t.signal.aborted?x():t.signal.addEventListener("abort",x)}s((ae,re)=>{if(_=!0,re){y=!0,w();return}let{data:$e}=ae;if($e instanceof ho.Readable||$e instanceof ho.Duplex){let nt=ho.finished($e,()=>{nt(),w()})}else w()});let D=Oa(t.baseURL,t.url,t.allowAbsoluteUrls),P=new URL(D,Ye.hasBrowserEnv?Ye.origin:void 0),F=P.protocol||FB[0];if(F==="data:"){if(t.maxContentLength>-1){let re=String(t.url||D||"");if(gC(re)>t.maxContentLength)return o(new G("maxContentLength size of "+t.maxContentLength+" exceeded",G.ERR_BAD_RESPONSE,t))}let ae;if(h!=="GET")return Qo(r,o,{status:405,statusText:"method not allowed",headers:{},config:t});try{ae=dC(t.url,f==="blob",{Blob:t.env&&t.env.Blob})}catch(re){throw G.from(re,G.ERR_BAD_REQUEST,t)}if(f==="text"){if(ae=ae.toString(m),!m||m==="utf8")ae=A.stripBOM(ae)}else if(f==="stream")ae=ho.Readable.from(ae);return Qo(r,o,{data:ae,status:200,statusText:"OK",headers:new Lt,config:t})}if(FB.indexOf(F)===-1)return o(new G("Unsupported protocol "+F,G.ERR_BAD_REQUEST,t));let z=Lt.from(t.headers).normalize();z.set("User-Agent","axios/"+Na,!1);let{onUploadProgress:q,onDownloadProgress:ee}=t,te=t.maxRate,xe=void 0,Q=void 0;if(A.isSpecCompliantForm(a)){let ae=z.getContentType(/boundary=([-_\w\d]{10,70})/i);a=SB(a,(re)=>{z.set(re)},{tag:`axios-${Na}-boundary`,boundary:ae&&ae[1]||void 0})}else if(A.isFormData(a)&&A.isFunction(a.getHeaders)&&a.getHeaders!==Object.prototype.getHeaders){if(z.set(a.getHeaders()),!z.hasContentLength())try{let ae=await HB.promisify(a.getLength).call(a);Number.isFinite(ae)&&ae>=0&&z.setContentLength(ae)}catch(ae){}}else if(A.isBlob(a)||A.isFile(a))a.size&&z.setContentType(a.type||"application/octet-stream"),z.setContentLength(a.size||0),a=ho.Readable.from(_y(a));else if(a&&!A.isStream(a)){if(Buffer.isBuffer(a));else if(A.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(A.isString(a))a=Buffer.from(a,"utf-8");else return o(new G("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",G.ERR_BAD_REQUEST,t));if(z.setContentLength(a.length,!1),t.maxBodyLength>-1&&a.length>t.maxBodyLength)return o(new G("Request body larger than maxBodyLength limit",G.ERR_BAD_REQUEST,t))}let ut=A.toFiniteNumber(z.getContentLength());if(A.isArray(te))xe=te[0],Q=te[1];else xe=Q=te;if(a&&(q||xe)){if(!A.isStream(a))a=ho.Readable.from(a,{objectMode:!1});a=ho.pipeline([a,new fC({maxRate:A.toFiniteNumber(xe)})],A.noop),q&&a.on("progress",$B(a,nu(ut,vs(ru(q),!1,3))))}let De=void 0,dt=i("auth");if(dt){let ae=dt.username||"",re=dt.password||"";De=ae+":"+re}if(!De&&P.username){let{username:ae,password:re}=P;De=ae+":"+re}De&&z.delete("authorization");let W;try{W=ka(P.pathname+P.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(ae){let re=Error(ae.message);return re.config=t,re.url=t.url,re.exists=!0,o(re)}z.set("Accept-Encoding","gzip, compress, deflate"+(MB?", br":""),!1);let qe=Object.assign(Object.create(null),{path:W,method:h,headers:z.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:De,protocol:F,family:l,beforeRedirect:vEe,beforeRedirects:Object.create(null),http2Options:d});if(!A.isUndefined(c)&&(qe.lookup=c),t.socketPath){if(typeof t.socketPath!=="string")return o(new G("socketPath must be a string",G.ERR_BAD_OPTION_VALUE,t));if(t.allowedSocketPaths!=null){let ae=Array.isArray(t.allowedSocketPaths)?t.allowedSocketPaths:[t.allowedSocketPaths],re=LB(t.socketPath);if(!ae.some((nt)=>typeof nt==="string"&&LB(nt)===re))return o(new G(`socketPath "${t.socketPath}" is not permitted by allowedSocketPaths`,G.ERR_BAD_OPTION_VALUE,t))}qe.socketPath=t.socketPath}else qe.hostname=P.hostname.startsWith("[")?P.hostname.slice(1,-1):P.hostname,qe.port=P.port,GB(qe,t.proxy,F+"//"+P.hostname+(P.port?":"+P.port:"")+qe.path);let wn,xt=EEe.test(qe.protocol);if(qe.agent=xt?t.httpsAgent:t.httpAgent,v)wn=CEe;else{let ae=i("transport");if(ae)wn=ae;else if(t.maxRedirects===0)wn=xt?gEe:hEe;else{if(t.maxRedirects)qe.maxRedirects=t.maxRedirects;let re=i("beforeRedirect");if(re)qe.beforeRedirects.config=re;wn=xt?bEe:SEe}}if(t.maxBodyLength>-1)qe.maxBodyLength=t.maxBodyLength;else qe.maxBodyLength=1/0;if(qe.insecureHTTPParser=Boolean(i("insecureHTTPParser")),b=wn.request(qe,function(re){if(b.destroyed)return;let $e=[re],nt=A.toFiniteNumber(re.headers["content-length"]);if(ee||Q){let ct=new fC({maxRate:A.toFiniteNumber(Q)});ee&&ct.on("progress",$B(ct,nu(nt,vs(ru(ee),!0,3)))),$e.push(ct)}let ie=re,_t=re.req||b;if(t.decompress!==!1&&re.headers["content-encoding"]){if(h==="HEAD"||re.statusCode===204)delete re.headers["content-encoding"];switch((re.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":$e.push(Ei.createUnzip(NB)),delete re.headers["content-encoding"];break;case"deflate":$e.push(new xB),$e.push(Ei.createUnzip(NB)),delete re.headers["content-encoding"];break;case"br":if(MB)$e.push(Ei.createBrotliDecompress(yEe)),delete re.headers["content-encoding"]}}ie=$e.length>1?ho.pipeline($e,A.noop):$e[0];let rt={status:re.statusCode,statusText:re.statusMessage,headers:new Lt(re.headers),config:t,request:_t};if(f==="stream"){if(t.maxContentLength>-1){let ct=t.maxContentLength,on=ie;async function*is(){let pt=0;for await(let Nh of on){if(pt+=Nh.length,pt>ct)throw new G("maxContentLength size of "+ct+" exceeded",G.ERR_BAD_RESPONSE,t,_t);yield Nh}}ie=ho.Readable.from(is(),{objectMode:!1})}rt.data=ie,Qo(r,o,rt)}else{let ct=[],on=0;ie.on("data",function(pt){if(ct.push(pt),on+=pt.length,t.maxContentLength>-1&&on>t.maxContentLength)y=!0,ie.destroy(),x(new G("maxContentLength size of "+t.maxContentLength+" exceeded",G.ERR_BAD_RESPONSE,t,_t))}),ie.on("aborted",function(){if(y)return;let pt=new G("stream has been aborted",G.ERR_BAD_RESPONSE,t,_t);ie.destroy(pt),o(pt)}),ie.on("error",function(pt){if(b.destroyed)return;o(G.from(pt,null,t,_t))}),ie.on("end",function(){try{let pt=ct.length===1?ct[0]:Buffer.concat(ct);if(f!=="arraybuffer"){if(pt=pt.toString(m),!m||m==="utf8")pt=A.stripBOM(pt)}rt.data=pt}catch(pt){return o(G.from(pt,null,t,rt.request,rt))}Qo(r,o,rt)})}S.once("abort",(ct)=>{if(!ie.destroyed)ie.emit("error",ct),ie.destroy()})}),S.once("abort",(ae)=>{if(b.close)b.close();else b.destroy(ae)}),b.on("error",function(re){o(G.from(re,null,t,b))}),b.on("socket",function(re){if(re.setKeepAlive(!0,60000),!re[UB])re.on("error",function(nt){let ie=re[Sy];if(ie&&!ie.destroyed)ie.destroy(nt)}),re[UB]=!0;re[Sy]=b,b.once("close",function(){if(re[Sy]===b)re[Sy]=null})}),t.timeout){let ae=parseInt(t.timeout,10);if(Number.isNaN(ae)){x(new G("error trying to parse `config.timeout` to int",G.ERR_BAD_OPTION_VALUE,t,b));return}b.setTimeout(ae,function(){if(_)return;let $e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",nt=t.transitional||bi;if(t.timeoutErrorMessage)$e=t.timeoutErrorMessage;x(new G($e,nt.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,b))})}else b.setTimeout(0);if(A.isStream(a)){let ae=!1,re=!1;a.on("end",()=>{ae=!0}),a.once("error",(nt)=>{re=!0,b.destroy(nt)}),a.on("close",()=>{if(!ae&&!re)x(new kr("Request stream has been aborted",t,b))});let $e=a;if(t.maxBodyLength>-1&&t.maxRedirects===0){let nt=t.maxBodyLength,ie=0;$e=ho.pipeline([a,new ho.Transform({transform(_t,rt,ct){if(ie+=_t.length,ie>nt)return ct(new G("Request body larger than maxBodyLength limit",G.ERR_BAD_REQUEST,t,b));ct(null,_t)}})],A.noop),$e.on("error",(_t)=>{if(!b.destroyed)b.destroy(_t)})}$e.pipe(b)}else a&&b.write(a),b.end()})}});var qB;var ZB=O(()=>{mo();qB=Ye.hasStandardBrowserEnv?((e,t)=>(n)=>(n=new URL(n,Ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ye.origin),Ye.navigator&&/(msie|trident)/i.test(Ye.navigator.userAgent)):()=>!0});var YB;var JB=O(()=>{yt();mo();YB=Ye.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;let a=[`${e}=${encodeURIComponent(t)}`];if(A.isNumber(n))a.push(`expires=${new Date(n).toUTCString()}`);if(A.isString(r))a.push(`path=${r}`);if(A.isString(o))a.push(`domain=${o}`);if(s===!0)a.push("secure");if(A.isString(i))a.push(`SameSite=${i}`);document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-86400000,"/")}}:{write(){},read(){return null},remove(){}}});function go(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(l,u,d,f){if(A.isPlainObject(l)&&A.isPlainObject(u))return A.merge.call({caseless:f},l,u);else if(A.isPlainObject(u))return A.merge({},u);else if(A.isArray(u))return u.slice();return u}function o(l,u,d,f){if(!A.isUndefined(u))return r(l,u,d,f);else if(!A.isUndefined(l))return r(void 0,l,d,f)}function s(l,u){if(!A.isUndefined(u))return r(void 0,u)}function i(l,u){if(!A.isUndefined(u))return r(void 0,u);else if(!A.isUndefined(l))return r(void 0,l)}function a(l,u,d){if(A.hasOwnProp(t,d))return r(l,u);else if(A.hasOwnProp(e,d))return r(void 0,l)}let c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(l,u,d)=>o(XB(l),XB(u),d,!0)};return A.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;let d=A.hasOwnProp(c,u)?c[u]:o,f=A.hasOwnProp(e,u)?e[u]:void 0,m=A.hasOwnProp(t,u)?t[u]:void 0,h=d(f,m,u);A.isUndefined(h)&&d!==a||(n[u]=h)}),n}var XB=(e)=>e instanceof Lt?{...e}:e;var by=O(()=>{yt();Xo()});var Ey=(e)=>{let t=go({},e),n=(f)=>A.hasOwnProp(t,f)?t[f]:void 0,r=n("data"),o=n("withXSRFToken"),s=n("xsrfHeaderName"),i=n("xsrfCookieName"),a=n("headers"),c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=a=Lt.from(a),t.url=ka(Oa(l,d,u),e.params,e.paramsSerializer),c)a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));if(A.isFormData(r)){if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(A.isFunction(r.getHeaders)){let f=r.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([h,_])=>{if(m.includes(h.toLowerCase()))a.set(h,_)})}}if(Ye.hasStandardBrowserEnv){if(A.isFunction(o))o=o(t);if(o===!0||o==null&&qB(t.url)){let m=s&&i&&YB.read(i);if(m)a.set(s,m)}}return t};var _C=O(()=>{mo();yt();ZB();JB();uy();by();Xo();sy()});var kEe,QB;var e2=O(()=>{yt();ly();Ef();Cr();Ra();mo();Xo();yy();_C();kEe=typeof XMLHttpRequest<"u",QB=kEe&&function(e){return new Promise(function(n,r){let o=Ey(e),s=o.data,i=Lt.from(o.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:l}=o,u,d,f,m,h;function _(){m&&m(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function b(){if(!y)return;let S=Lt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),w={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};Qo(function(P){n(P),_()},function(P){r(P),_()},w),y=null}if("onloadend"in y)y.onloadend=b;else y.onreadystatechange=function(){if(!y||y.readyState!==4)return;if(y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0))return;setTimeout(b)};if(y.onabort=function(){if(!y)return;r(new G("Request aborted",G.ECONNABORTED,e,y)),y=null},y.onerror=function(x){let w=x&&x.message?x.message:"Network Error",D=new G(w,G.ERR_NETWORK,e,y);D.event=x||null,r(D),y=null},y.ontimeout=function(){let x=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",w=o.transitional||bi;if(o.timeoutErrorMessage)x=o.timeoutErrorMessage;r(new G(x,w.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y)A.forEach(i.toJSON(),function(x,w){y.setRequestHeader(w,x)});if(!A.isUndefined(o.withCredentials))y.withCredentials=!!o.withCredentials;if(a&&a!=="json")y.responseType=o.responseType;if(l)[f,h]=vs(l,!0),y.addEventListener("progress",f);if(c&&y.upload)[d,m]=vs(c),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",m);if(o.cancelToken||o.signal){if(u=(S)=>{if(!y)return;r(!S||S.type?new kr(null,e,y):S),y.abort(),y=null},o.cancelToken&&o.cancelToken.subscribe(u),o.signal)o.signal.aborted?u():o.signal.addEventListener("abort",u)}let v=Of(o.url);if(v&&Ye.protocols.indexOf(v)===-1){r(new G("Unsupported protocol "+v+":",G.ERR_BAD_REQUEST,e));return}y.send(s||null)})}});var REe=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o,s=function(l){if(!o){o=!0,a();let u=l instanceof Error?l:this.reason;r.abort(u instanceof G?u:new kr(u instanceof Error?u.message:u))}},i=t&&setTimeout(()=>{i=null,s(new G(`timeout of ${t}ms exceeded`,G.ETIMEDOUT))},t),a=()=>{if(e)i&&clearTimeout(i),i=null,e.forEach((l)=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null};e.forEach((l)=>l.addEventListener("abort",s));let{signal:c}=r;return c.unsubscribe=()=>A.asap(a),c}},t2;var n2=O(()=>{Ra();Cr();yt();t2=REe});var OEe=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,o;while(r<n)o=r+t,yield e.slice(r,o),r=o},PEe=async function*(e,t){for await(let n of IEe(e))yield*OEe(n,t)},IEe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},yC=(e,t,n,r)=>{let o=PEe(e,t),s=0,i,a=(c)=>{if(!i)i=!0,r&&r(c)};return new ReadableStream({async pull(c){try{let{done:l,value:u}=await o.next();if(l){a(),c.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),o.return()}},{highWaterMark:2})};var r2=65536,xy,DEe,o2,s2,i2=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},LEe=(e)=>{e=A.merge.call({skipUndefined:!0},DEe,e);let{fetch:t,Request:n,Response:r}=e,o=t?xy(t):typeof fetch==="function",s=xy(n),i=xy(r);if(!o)return!1;let a=o&&xy(o2),c=o&&(typeof s2==="function"?((h)=>(_)=>h.encode(_))(new s2):async(h)=>new Uint8Array(await new n(h).arrayBuffer())),l=s&&a&&i2(()=>{let h=!1,_=new n(Ye.origin,{body:new o2,method:"POST",get duplex(){return h=!0,"half"}}),y=_.headers.has("Content-Type");if(_.body!=null)_.body.cancel();return h&&!y}),u=i&&a&&i2(()=>A.isReadableStream(new r("").body)),d={stream:u&&((h)=>h.body)};o&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach((h)=>{!d[h]&&(d[h]=(_,y)=>{let b=_&&_[h];if(b)return b.call(_);throw new G(`Response type '${h}' is not supported`,G.ERR_NOT_SUPPORT,y)})})})();let f=async(h)=>{if(h==null)return 0;if(A.isBlob(h))return h.size;if(A.isSpecCompliantForm(h))return(await new n(Ye.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(A.isArrayBufferView(h)||A.isArrayBuffer(h))return h.byteLength;if(A.isURLSearchParams(h))h=h+"";if(A.isString(h))return(await c(h)).byteLength},m=async(h,_)=>{let y=A.toFiniteNumber(h.getContentLength());return y==null?f(_):y};return async(h)=>{let{url:_,method:y,data:b,signal:v,cancelToken:S,timeout:x,onDownloadProgress:w,onUploadProgress:D,responseType:P,headers:F,withCredentials:z="same-origin",fetchOptions:q}=Ey(h),ee=t||fetch;P=P?(P+"").toLowerCase():"text";let te=t2([v,S&&S.toAbortSignal()],x),xe=null,Q=te&&te.unsubscribe&&(()=>{te.unsubscribe()}),ut;try{if(D&&l&&y!=="get"&&y!=="head"&&(ut=await m(F,b))!==0){let xt=new n(_,{method:"POST",body:b,duplex:"half"}),ae;if(A.isFormData(b)&&(ae=xt.headers.get("content-type")))F.setContentType(ae);if(xt.body){let[re,$e]=nu(ut,vs(ru(D)));b=yC(xt.body,r2,re,$e)}}if(!A.isString(z))z=z?"include":"omit";let De=s&&"credentials"in n.prototype;if(A.isFormData(b)){let xt=F.getContentType();if(xt&&/^multipart\/form-data/i.test(xt)&&!/boundary=/i.test(xt))F.delete("content-type")}let dt={...q,signal:te,method:y.toUpperCase(),headers:F.normalize().toJSON(),body:b,duplex:"half",credentials:De?z:void 0};xe=s&&new n(_,dt);let W=await(s?ee(xe,q):ee(_,dt)),qe=u&&(P==="stream"||P==="response");if(u&&(w||qe&&Q)){let xt={};["status","statusText","headers"].forEach((nt)=>{xt[nt]=W[nt]});let ae=A.toFiniteNumber(W.headers.get("content-length")),[re,$e]=w&&nu(ae,vs(ru(w),!0))||[];W=new r(yC(W.body,r2,re,()=>{$e&&$e(),Q&&Q()}),xt)}P=P||"text";let wn=await d[A.findKey(d,P)||"text"](W,h);return!qe&&Q&&Q(),await new Promise((xt,ae)=>{Qo(xt,ae,{data:wn,headers:Lt.from(W.headers),status:W.status,statusText:W.statusText,config:h,request:xe})})}catch(De){if(Q&&Q(),De&&De.name==="TypeError"&&/Load failed|fetch/i.test(De.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,h,xe,De&&De.response),{cause:De.cause||De});throw G.from(De,De&&De.code,h,xe,De&&De.response)}}},NEe,SC=(e)=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:o}=t,s=[r,o,n],i=s.length,a=i,c,l,u=NEe;while(a--)c=s[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:LEe(t)),u=l;return l},dRt;var a2=O(()=>{mo();yt();Cr();n2();Xo();yy();_C();ly();({isFunction:xy}=A),DEe=(({Request:e,Response:t})=>({Request:e,Response:t}))(A.global),{ReadableStream:o2,TextEncoder:s2}=A.global,NEe=new Map,dRt=SC()});function FEe(e,t){e=A.isArray(e)?e:[e];let{length:n}=e,r,o,s={};for(let i=0;i<n;i++){r=e[i];let a;if(o=r,!UEe(r)){if(o=bC[(a=String(r)).toLowerCase()],o===void 0)throw new G(`Unknown adapter '${a}'`)}if(o&&(A.isFunction(o)||(o=o.get(t))))break;s[a||"#"+i]=o}if(!o){let i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build")),a=n?i.length>1?`since :
94
+ `+i.map(c2).join(`
95
+ `):" "+c2(i[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}var bC,c2=(e)=>`- ${e}`,UEe=(e)=>A.isFunction(e)||e===null||e===!1,vy;var EC=O(()=>{yt();VB();e2();a2();Cr();bC={http:WB,xhr:QB,fetch:{get:SC}};A.forEach(bC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});vy={getAdapter:FEe,adapters:bC}});function xC(e){if(e.cancelToken)e.cancelToken.throwIfRequested();if(e.signal&&e.signal.aborted)throw new kr(null,e)}function wy(e){if(xC(e),e.headers=Lt.from(e.headers),e.data=wf.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1)e.headers.setContentType("application/x-www-form-urlencoded",!1);return vy.getAdapter(e.adapter||Xl.adapter,e)(e).then(function(r){return xC(e),r.data=wf.call(e,e.transformResponse,r),r.headers=Lt.from(r.headers),r},function(r){if(!Af(r)){if(xC(e),r&&r.response)r.response.data=wf.call(e,e.transformResponse,r.response),r.response.headers=Lt.from(r.response.headers)}return Promise.reject(r)})}var l2=O(()=>{HH();ay();Ra();Xo();EC()});function $Ee(e,t,n){if(typeof e!=="object")throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;while(o-- >0){let s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){let a=e[s],c=a===void 0||i(a,s,e);if(c!==!0)throw new G("option "+s+" must be "+c,G.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new G("Unknown option "+s,G.ERR_BAD_OPTION)}}var Ay,u2,If;var d2=O(()=>{Cr();Ay={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ay[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});u2={};Ay.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Na+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new G(o(i," has been removed"+(n?" in "+n:"")),G.ERR_DEPRECATED);if(n&&!u2[i])u2[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"));return t?t(s,i,a):!0}};Ay.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};If={assertOptions:$Ee,validators:Ay}});class Df{constructor(e){this.defaults=e||{},this.interceptors={request:new FT,response:new FT}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=Error();let o=(()=>{if(!r.stack)return"";let s=r.stack.indexOf(`
96
+ `);return s===-1?"":r.stack.slice(s+1)})();try{if(!n.stack)n.stack=o;else if(o){let s=o.indexOf(`
97
+ `),i=s===-1?-1:o.indexOf(`
98
+ `,s+1),a=i===-1?"":o.slice(i+1);if(!String(n.stack).endsWith(a))n.stack+=`
99
+ `+o}}catch(s){}}throw n}}_request(e,t){if(typeof e==="string")t=t||{},t.url=e;else t=e||{};t=go(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:o}=t;if(n!==void 0)If.assertOptions(n,{silentJSONParsing:Kr.transitional(Kr.boolean),forcedJSONParsing:Kr.transitional(Kr.boolean),clarifyTimeoutError:Kr.transitional(Kr.boolean),legacyInterceptorReqResOrdering:Kr.transitional(Kr.boolean)},!1);if(r!=null)if(A.isFunction(r))t.paramsSerializer={serialize:r};else If.assertOptions(r,{encode:Kr.function,serialize:Kr.function},!0);if(t.allowAbsoluteUrls!==void 0);else if(this.defaults.allowAbsoluteUrls!==void 0)t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls;else t.allowAbsoluteUrls=!0;If.assertOptions(t,{baseUrl:Kr.spelling("baseURL"),withXsrfToken:Kr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&A.merge(o.common,o[t.method]);o&&A.forEach(["delete","get","head","post","put","patch","common"],(m)=>{delete o[m]}),t.headers=Lt.concat(s,o);let i=[],a=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen==="function"&&h.runWhen(t)===!1)return;a=a&&h.synchronous;let _=t.transitional||bi;if(_&&_.legacyInterceptorReqResOrdering)i.unshift(h.fulfilled,h.rejected);else i.push(h.fulfilled,h.rejected)});let c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,u=0,d;if(!a){let m=[wy.bind(this),void 0];m.unshift(...i),m.push(...c),d=m.length,l=Promise.resolve(t);while(u<d)l=l.then(m[u++],m[u++]);return l}d=i.length;let f=t;while(u<d){let m=i[u++],h=i[u++];try{f=m(f)}catch(_){h.call(this,_);break}}try{l=wy.call(this,f)}catch(m){return Promise.reject(m)}u=0,d=c.length;while(u<d)l=l.then(c[u++],c[u++]);return l}getUri(e){e=go(this.defaults,e);let t=Oa(e.baseURL,e.url,e.allowAbsoluteUrls);return ka(t,e.params,e.paramsSerializer)}}var Kr,Lf;var p2=O(()=>{yt();sy();OH();l2();by();uy();d2();Xo();Ef();Kr=If.validators;A.forEach(["delete","get","head","options"],function(t){Df.prototype[t]=function(n,r){return this.request(go(r||{},{method:t,url:n,data:(r||{}).data}))}});A.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(go(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Df.prototype[t]=n(),Df.prototype[t+"Form"]=n(!0)});Lf=Df});class vC{constructor(e){if(typeof e!=="function")throw TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});let n=this;this.promise.then((r)=>{if(!n._listeners)return;let o=n._listeners.length;while(o-- >0)n._listeners[o](r);n._listeners=null}),this.promise.then=(r)=>{let o,s=new Promise((i)=>{n.subscribe(i),o=i}).then(r);return s.cancel=function(){n.unsubscribe(o)},s},e(function(o,s,i){if(n.reason)return;n.reason=new kr(o,s,i),t(n.reason)})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners)this._listeners.push(e);else this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);if(t!==-1)this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=(n)=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new vC(function(r){e=r}),cancel:e}}}var f2;var m2=O(()=>{Ra();f2=vC});function wC(e){return function(n){return e.apply(null,n)}}function AC(e){return A.isObject(e)&&e.isAxiosError===!0}var h2=O(()=>{yt()});var TC,g2;var _2=O(()=>{TC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(TC).forEach(([e,t])=>{TC[t]=e});g2=TC});function y2(e){let t=new Lf(e),n=ff(Lf.prototype.request,t);return A.extend(n,Lf.prototype,t,{allOwnKeys:!0}),A.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return y2(go(e,o))},n}var qt,Gr;var S2=O(()=>{yt();p2();by();ay();KT();Ra();m2();bf();Cr();h2();Xo();EC();_2();qt=y2(Xl);qt.Axios=Lf;qt.CanceledError=kr;qt.CancelToken=f2;qt.isCancel=Af;qt.VERSION=Na;qt.toFormData=Si;qt.AxiosError=G;qt.Cancel=qt.CanceledError;qt.all=function(t){return Promise.all(t)};qt.spread=wC;qt.isAxiosError=AC;qt.mergeConfig=go;qt.AxiosHeaders=Lt;qt.formToJSON=(e)=>iy(A.isHTMLForm(e)?new FormData(e):e);qt.getAdapter=vy.getAdapter;qt.HttpStatusCode=g2;qt.default=qt;Gr=qt});var CC=O(()=>{S2()});function jEe(e){let t,n=e.startsWith("//")?`https:${e}`:e;try{t=new URL(n).hostname}catch{t=e.match(/^[^/:]+/)?.[0]??e}return t.endsWith(".")?t.slice(0,-1):t}function b2(e){return zEe.test(jEe(e))}var zEe;var E2=O(()=>{zEe=/(^|\.)(anthropic\.com|claude\.ai|claude\.com)$/i});var ws=C(function(uOt,w2){var x2=["nodebuffer","arraybuffer","fragments"],v2=typeof Blob<"u";if(v2)x2.push("blob");w2.exports={BINARY_TYPES:x2,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:v2,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Nf=C(function(dOt,Ty){var{EMPTY_BUFFER:HEe}=ws(),kC=Buffer[Symbol.species];function BEe(e,t){if(e.length===0)return HEe;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),r=0;for(let o=0;o<e.length;o++){let s=e[o];n.set(s,r),r+=s.length}if(r<t)return new kC(n.buffer,n.byteOffset,r);return n}function A2(e,t,n,r,o){for(let s=0;s<o;s++)n[r+s]=e[s]^t[s&3]}function T2(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}function KEe(e){if(e.length===e.buffer.byteLength)return e.buffer;return e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function RC(e){if(RC.readOnly=!0,Buffer.isBuffer(e))return e;let t;if(e instanceof ArrayBuffer)t=new kC(e);else if(ArrayBuffer.isView(e))t=new kC(e.buffer,e.byteOffset,e.byteLength);else t=Buffer.from(e),RC.readOnly=!1;return t}Ty.exports={concat:BEe,mask:A2,toArrayBuffer:KEe,toBuffer:RC,unmask:T2};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=(()=>{throw new Error("Cannot require module "+"bufferutil");})();Ty.exports.mask=function(t,n,r,o,s){if(s<48)A2(t,n,r,o,s);else e.mask(t,n,r,o,s)},Ty.exports.unmask=function(t,n){if(t.length<32)T2(t,n);else e.unmask(t,n)}}catch(e){}});var O2=C(function(pOt,R2){var C2=Symbol("kDone"),OC=Symbol("kRun");class k2{constructor(e){this[C2]=()=>{this.pending--,this[OC]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[OC]()}[OC](){if(this.pending===this.concurrency)return;if(this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[C2])}}}R2.exports=k2});var iu=C(function(fOt,N2){var Mf=ve("zlib"),P2=Nf(),GEe=O2(),{kStatusCode:I2}=ws(),WEe=Buffer[Symbol.species],VEe=Buffer.from([0,0,255,255]),ky=Symbol("permessage-deflate"),As=Symbol("total-length"),ou=Symbol("callback"),xi=Symbol("buffers"),su=Symbol("error"),Cy;class D2{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Cy){let t=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Cy=new GEe(t)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};if(this._options.serverNoContextTakeover)e.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)e.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)e.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)e.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)e.client_max_window_bits=!0;return e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let e=this._deflate[ou];if(this._deflate.close(),this._deflate=null,e)e(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find((r)=>{if(t.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==="number"&&t.serverMaxWindowBits>r.server_max_window_bits)||typeof t.clientMaxWindowBits==="number"&&!r.client_max_window_bits)return!1;return!0});if(!n)throw Error("None of the extension offers can be accepted");if(t.serverNoContextTakeover)n.server_no_context_takeover=!0;if(t.clientNoContextTakeover)n.client_no_context_takeover=!0;if(typeof t.serverMaxWindowBits==="number")n.server_max_window_bits=t.serverMaxWindowBits;if(typeof t.clientMaxWindowBits==="number")n.client_max_window_bits=t.clientMaxWindowBits;else if(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)delete n.client_max_window_bits;return n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")t.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach((t)=>{Object.keys(t).forEach((n)=>{let r=t[n];if(r.length>1)throw Error(`Parameter "${n}" must have only a single value`);if(r=r[0],n==="client_max_window_bits"){if(r!==!0){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw TypeError(`Invalid value for parameter "${n}": ${r}`);r=o}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${n}": ${r}`)}else if(n==="server_max_window_bits"){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw TypeError(`Invalid value for parameter "${n}": ${r}`);r=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(r!==!0)throw TypeError(`Invalid value for parameter "${n}": ${r}`)}else throw Error(`Unknown parameter "${n}"`);t[n]=r})}),e}decompress(e,t,n){Cy.add((r)=>{this._decompress(e,t,(o,s)=>{r(),n(o,s)})})}compress(e,t,n){Cy.add((r)=>{this._compress(e,t,(o,s)=>{r(),n(o,s)})})}_decompress(e,t,n){let r=this._isServer?"client":"server";if(!this._inflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!=="number"?Mf.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Mf.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[ky]=this,this._inflate[As]=0,this._inflate[xi]=[],this._inflate.on("error",ZEe),this._inflate.on("data",L2)}if(this._inflate[ou]=n,this._inflate.write(e),t)this._inflate.write(VEe);this._inflate.flush(()=>{let o=this._inflate[su];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=P2.concat(this._inflate[xi],this._inflate[As]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[As]=0,this._inflate[xi]=[],t&&this.params[`${r}_no_context_takeover`])this._inflate.reset();n(null,s)})}_compress(e,t,n){let r=this._isServer?"server":"client";if(!this._deflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!=="number"?Mf.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Mf.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[As]=0,this._deflate[xi]=[],this._deflate.on("data",qEe)}this._deflate[ou]=n,this._deflate.write(e),this._deflate.flush(Mf.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=P2.concat(this._deflate[xi],this._deflate[As]);if(t)o=new WEe(o.buffer,o.byteOffset,o.length-4);if(this._deflate[ou]=null,this._deflate[As]=0,this._deflate[xi]=[],t&&this.params[`${r}_no_context_takeover`])this._deflate.reset();n(null,o)})}}N2.exports=D2;function qEe(e){this[xi].push(e),this[As]+=e.length}function L2(e){if(this[As]+=e.length,this[ky]._maxPayload<1||this[As]<=this[ky]._maxPayload){this[xi].push(e);return}this[su]=RangeError("Max payload size exceeded"),this[su].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[su][I2]=1009,this.removeListener("data",L2),this.reset()}function ZEe(e){if(this[ky]._inflate=null,this[su]){this[ou](this[su]);return}e[I2]=1007,this[ou](e)}});var au=C(function(mOt,Ry){var{isUtf8:M2}=ve("buffer"),{hasBlob:YEe}=ws(),JEe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function XEe(e){return e>=1000&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3000&&e<=4999}function PC(e){let t=e.length,n=0;while(n<t)if((e[n]&128)===0)n++;else if((e[n]&224)===192){if(n+1===t||(e[n+1]&192)!==128||(e[n]&254)===192)return!1;n+=2}else if((e[n]&240)===224){if(n+2>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||e[n]===224&&(e[n+1]&224)===128||e[n]===237&&(e[n+1]&224)===160)return!1;n+=3}else if((e[n]&248)===240){if(n+3>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||(e[n+3]&192)!==128||e[n]===240&&(e[n+1]&240)===128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}function QEe(e){return YEe&&typeof e==="object"&&typeof e.arrayBuffer==="function"&&typeof e.type==="string"&&typeof e.stream==="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Ry.exports={isBlob:QEe,isValidStatusCode:XEe,isValidUTF8:PC,tokenChars:JEe};if(M2)Ry.exports.isValidUTF8=function(e){return e.length<24?PC(e):M2(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();Ry.exports.isValidUTF8=function(t){return t.length<32?PC(t):e(t)}}catch(e){}});var DC=C(function(hOt,j2){var{Writable:exe}=ve("stream"),U2=iu(),{BINARY_TYPES:txe,EMPTY_BUFFER:F2,kStatusCode:nxe,kWebSocket:rxe}=ws(),{concat:IC,toArrayBuffer:oxe,unmask:sxe}=Nf(),{isValidStatusCode:ixe,isValidUTF8:$2}=au(),Oy=Buffer[Symbol.species];class z2 extends exe{constructor(e={}){super();this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||txe[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[rxe]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(this._opcode===8&&this._state==0)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Oy(n.buffer,n.byteOffset+e,n.length-e),new Oy(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;if(e>=n.length)t.set(this._buffers.shift(),r);else t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new Oy(n.buffer,n.byteOffset+e,n.length-e);e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(r);return}let n=(t[0]&64)===64;if(n&&!this._extensions[U2.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(r);return}if(n){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(r);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(r);return}this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(e){let t=F2;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)sxe(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(n);return}if(this._compressed){this._state=5,this.decompress(t,e);return}if(t.length)this._messageLength=this._totalPayloadLength,this._fragments.push(t);this.dataMessage(e)}decompress(e,t){this._extensions[U2.extensionName].decompress(e,this._fin,(r,o)=>{if(r)return t(r);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(s);return}this._fragments.push(o)}if(this.dataMessage(t),this._state===0)this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=0;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let r;if(this._binaryType==="nodebuffer")r=IC(n,t);else if(this._binaryType==="arraybuffer")r=oxe(IC(n,t));else if(this._binaryType==="blob")r=new Blob(n);else r=n;if(this._allowSynchronousEvents)this.emit("message",r,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",r,!0),this._state=0,this.startLoop(e)})}else{let r=IC(n,t);if(!this._skipUTF8Validation&&!$2(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",r,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",r,!1),this._state=0,this.startLoop(e)})}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,F2),this.end();else{let n=e.readUInt16BE(0);if(!ixe(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(o);return}let r=new Oy(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!$2(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._loop=!1,this.emit("conclude",n,r),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",e),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=0,this.startLoop(t)})}createError(e,t,n,r,o){this._loop=!1,this._errored=!0;let s=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,this.createError),s.code=o,s[nxe]=r,s}}j2.exports=z2});var NC=C(function(_Ot,K2){var{Duplex:gOt}=ve("stream"),{randomFillSync:axe}=ve("crypto"),{types:{isUint8Array:cxe}}=ve("util"),H2=iu(),{EMPTY_BUFFER:lxe,kWebSocket:uxe,NOOP:dxe}=ws(),{isBlob:cu,isValidStatusCode:pxe}=au(),{mask:B2,toBuffer:Ua}=Nf(),Wr=Symbol("kByteLength"),fxe=Buffer.alloc(4),Fa,lu=8192,_o=0,mxe=1,hxe=2;class vi{constructor(e,t,n){if(this._extensions=t||{},n)this._generateMask=n,this._maskBuffer=Buffer.alloc(4);this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=_o,this.onerror=dxe,this[uxe]=void 0}static frame(e,t){let n,r=!1,o=2,s=!1;if(t.mask){if(n=t.maskBuffer||fxe,t.generateMask)t.generateMask(n);else{if(lu===8192){if(Fa===void 0)Fa=Buffer.alloc(8192);axe(Fa,0,8192),lu=0}n[0]=Fa[lu++],n[1]=Fa[lu++],n[2]=Fa[lu++],n[3]=Fa[lu++]}s=(n[0]|n[1]|n[2]|n[3])===0,o=6}let i;if(typeof e==="string")if((!t.mask||s)&&t[Wr]!==void 0)i=t[Wr];else e=Buffer.from(e),i=e.length;else i=e.length,r=t.mask&&t.readOnly&&!s;let a=i;if(i>=65536)o+=8,a=127;else if(i>125)o+=2,a=126;let c=Buffer.allocUnsafe(r?i+o:o);if(c[0]=t.fin?t.opcode|128:t.opcode,t.rsv1)c[0]|=64;if(c[1]=a,a===126)c.writeUInt16BE(i,2);else if(a===127)c[2]=c[3]=0,c.writeUIntBE(i,4,6);if(!t.mask)return[c,e];if(c[1]|=128,c[o-4]=n[0],c[o-3]=n[1],c[o-2]=n[2],c[o-1]=n[3],s)return[c,e];if(r)return B2(e,n,c,o,i),[c];return B2(e,n,e,0,i),[c,e]}close(e,t,n,r){let o;if(e===void 0)o=lxe;else if(typeof e!=="number"||!pxe(e))throw TypeError("First argument must be a valid error code number");else if(t===void 0||!t.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let i=Buffer.byteLength(t);if(i>123)throw RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+i),o.writeUInt16BE(e,0),typeof t==="string")o.write(t,2);else if(cxe(t))o.set(t,2);else throw TypeError("Second argument must be a string or a Uint8Array")}let s={[Wr]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==_o)this.enqueue([this.dispatch,o,!1,s,r]);else this.sendFrame(vi.frame(o,s),r)}ping(e,t,n){let r,o;if(typeof e==="string")r=Buffer.byteLength(e),o=!1;else if(cu(e))r=e.size,o=!1;else e=Ua(e),r=e.length,o=Ua.readOnly;if(r>125)throw RangeError("The data size must not be greater than 125 bytes");let s={[Wr]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};if(cu(e))if(this._state!==_o)this.enqueue([this.getBlobData,e,!1,s,n]);else this.getBlobData(e,!1,s,n);else if(this._state!==_o)this.enqueue([this.dispatch,e,!1,s,n]);else this.sendFrame(vi.frame(e,s),n)}pong(e,t,n){let r,o;if(typeof e==="string")r=Buffer.byteLength(e),o=!1;else if(cu(e))r=e.size,o=!1;else e=Ua(e),r=e.length,o=Ua.readOnly;if(r>125)throw RangeError("The data size must not be greater than 125 bytes");let s={[Wr]:r,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};if(cu(e))if(this._state!==_o)this.enqueue([this.getBlobData,e,!1,s,n]);else this.getBlobData(e,!1,s,n);else if(this._state!==_o)this.enqueue([this.dispatch,e,!1,s,n]);else this.sendFrame(vi.frame(e,s),n)}send(e,t,n){let r=this._extensions[H2.extensionName],o=t.binary?2:1,s=t.compress,i,a;if(typeof e==="string")i=Buffer.byteLength(e),a=!1;else if(cu(e))i=e.size,a=!1;else e=Ua(e),i=e.length,a=Ua.readOnly;if(this._firstFragment){if(this._firstFragment=!1,s&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"])s=i>=r._threshold;this._compress=s}else s=!1,o=0;if(t.fin)this._firstFragment=!0;let c={[Wr]:i,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:a,rsv1:s};if(cu(e))if(this._state!==_o)this.enqueue([this.getBlobData,e,this._compress,c,n]);else this.getBlobData(e,this._compress,c,n);else if(this._state!==_o)this.enqueue([this.dispatch,e,this._compress,c,n]);else this.dispatch(e,this._compress,c,n)}getBlobData(e,t,n,r){this._bufferedBytes+=n[Wr],this._state=hxe,e.arrayBuffer().then((o)=>{if(this._socket.destroyed){let i=Error("The socket was closed while the blob was being read");process.nextTick(LC,this,i,r);return}this._bufferedBytes-=n[Wr];let s=Ua(o);if(!t)this._state=_o,this.sendFrame(vi.frame(s,n),r),this.dequeue();else this.dispatch(s,t,n,r)}).catch((o)=>{process.nextTick(gxe,this,o,r)})}dispatch(e,t,n,r){if(!t){this.sendFrame(vi.frame(e,n),r);return}let o=this._extensions[H2.extensionName];this._bufferedBytes+=n[Wr],this._state=mxe,o.compress(e,n.fin,(s,i)=>{if(this._socket.destroyed){let a=Error("The socket was closed while data was being compressed");LC(this,a,r);return}this._bufferedBytes-=n[Wr],this._state=_o,n.readOnly=!1,this.sendFrame(vi.frame(i,n),r),this.dequeue()})}dequeue(){while(this._state===_o&&this._queue.length){let e=this._queue.shift();this._bufferedBytes-=e[3][Wr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Wr],this._queue.push(e)}sendFrame(e,t){if(e.length===2)this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork();else this._socket.write(e[0],t)}}K2.exports=vi;function LC(e,t,n){if(typeof n==="function")n(t);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];if(typeof s==="function")s(t)}}function gxe(e,t,n){LC(e,t,n),e.onerror(t)}});var Q2=C(function(yOt,X2){var{kForOnEventAttribute:Uf,kListener:MC}=ws(),G2=Symbol("kCode"),W2=Symbol("kData"),V2=Symbol("kError"),q2=Symbol("kMessage"),Z2=Symbol("kReason"),uu=Symbol("kTarget"),Y2=Symbol("kType"),J2=Symbol("kWasClean");class wi{constructor(e){this[uu]=null,this[Y2]=e}get target(){return this[uu]}get type(){return this[Y2]}}Object.defineProperty(wi.prototype,"target",{enumerable:!0});Object.defineProperty(wi.prototype,"type",{enumerable:!0});class du extends wi{constructor(e,t={}){super(e);this[G2]=t.code===void 0?0:t.code,this[Z2]=t.reason===void 0?"":t.reason,this[J2]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[G2]}get reason(){return this[Z2]}get wasClean(){return this[J2]}}Object.defineProperty(du.prototype,"code",{enumerable:!0});Object.defineProperty(du.prototype,"reason",{enumerable:!0});Object.defineProperty(du.prototype,"wasClean",{enumerable:!0});class Ff extends wi{constructor(e,t={}){super(e);this[V2]=t.error===void 0?null:t.error,this[q2]=t.message===void 0?"":t.message}get error(){return this[V2]}get message(){return this[q2]}}Object.defineProperty(Ff.prototype,"error",{enumerable:!0});Object.defineProperty(Ff.prototype,"message",{enumerable:!0});class Iy extends wi{constructor(e,t={}){super(e);this[W2]=t.data===void 0?null:t.data}get data(){return this[W2]}}Object.defineProperty(Iy.prototype,"data",{enumerable:!0});var _xe={addEventListener(e,t,n={}){for(let o of this.listeners(e))if(!n[Uf]&&o[MC]===t&&!o[Uf])return;let r;if(e==="message")r=function(s,i){let a=new Iy("message",{data:i?s:s.toString()});a[uu]=this,Py(t,this,a)};else if(e==="close")r=function(s,i){let a=new du("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[uu]=this,Py(t,this,a)};else if(e==="error")r=function(s){let i=new Ff("error",{error:s,message:s.message});i[uu]=this,Py(t,this,i)};else if(e==="open")r=function(){let s=new wi("open");s[uu]=this,Py(t,this,s)};else return;if(r[Uf]=!!n[Uf],r[MC]=t,n.once)this.once(e,r);else this.on(e,r)},removeEventListener(e,t){for(let n of this.listeners(e))if(n[MC]===t&&!n[Uf]){this.removeListener(e,n);break}}};X2.exports={CloseEvent:du,ErrorEvent:Ff,Event:wi,EventTarget:_xe,MessageEvent:Iy};function Py(e,t,n){if(typeof e==="object"&&e.handleEvent)e.handleEvent.call(e,n);else e.call(t,n)}});var Dy=C(function(SOt,eK){var{tokenChars:$f}=au();function es(e,t,n){if(e[t]===void 0)e[t]=[n];else e[t].push(n)}function yxe(e){let t=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,a,c=-1,l=-1,u=-1,d=0;for(;d<e.length;d++)if(l=e.charCodeAt(d),i===void 0)if(u===-1&&$f[l]===1){if(c===-1)c=d}else if(d!==0&&(l===32||l===9)){if(u===-1&&c!==-1)u=d}else if(l===59||l===44){if(c===-1)throw SyntaxError(`Unexpected character at index ${d}`);if(u===-1)u=d;let m=e.slice(c,u);if(l===44)es(t,m,n),n=Object.create(null);else i=m;c=u=-1}else throw SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(u===-1&&$f[l]===1){if(c===-1)c=d}else if(l===32||l===9){if(u===-1&&c!==-1)u=d}else if(l===59||l===44){if(c===-1)throw SyntaxError(`Unexpected character at index ${d}`);if(u===-1)u=d;if(es(n,e.slice(c,u),!0),l===44)es(t,i,n),n=Object.create(null),i=void 0;c=u=-1}else if(l===61&&c!==-1&&u===-1)a=e.slice(c,d),c=u=-1;else throw SyntaxError(`Unexpected character at index ${d}`);else if(o){if($f[l]!==1)throw SyntaxError(`Unexpected character at index ${d}`);if(c===-1)c=d;else if(!r)r=!0;o=!1}else if(s)if($f[l]===1){if(c===-1)c=d}else if(l===34&&c!==-1)s=!1,u=d;else if(l===92)o=!0;else throw SyntaxError(`Unexpected character at index ${d}`);else if(l===34&&e.charCodeAt(d-1)===61)s=!0;else if(u===-1&&$f[l]===1){if(c===-1)c=d}else if(c!==-1&&(l===32||l===9)){if(u===-1)u=d}else if(l===59||l===44){if(c===-1)throw SyntaxError(`Unexpected character at index ${d}`);if(u===-1)u=d;let m=e.slice(c,u);if(r)m=m.replace(/\\/g,""),r=!1;if(es(n,a,m),l===44)es(t,i,n),n=Object.create(null),i=void 0;a=void 0,c=u=-1}else throw SyntaxError(`Unexpected character at index ${d}`);if(c===-1||s||l===32||l===9)throw SyntaxError("Unexpected end of input");if(u===-1)u=d;let f=e.slice(c,u);if(i===void 0)es(t,f,n);else{if(a===void 0)es(n,f,!0);else if(r)es(n,a,f.replace(/\\/g,""));else es(n,a,f);es(t,i,n)}return t}function Sxe(e){return Object.keys(e).map((t)=>{let n=e[t];if(!Array.isArray(n))n=[n];return n.map((r)=>[t].concat(Object.keys(r).map((o)=>{let s=r[o];if(!Array.isArray(s))s=[s];return s.map((i)=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}eK.exports={format:Sxe,parse:yxe}});var Uy=C(function(xOt,pK){var bxe=ve("events"),Exe=ve("https"),xxe=ve("http"),rK=ve("net"),vxe=ve("tls"),{randomBytes:wxe,createHash:Axe}=ve("crypto"),{Duplex:bOt,Readable:EOt}=ve("stream"),{URL:UC}=ve("url"),Ai=iu(),Txe=DC(),Cxe=NC(),{isBlob:kxe}=au(),{BINARY_TYPES:tK,CLOSE_TIMEOUT:Rxe,EMPTY_BUFFER:Ly,GUID:Oxe,kForOnEventAttribute:FC,kListener:Pxe,kStatusCode:Ixe,kWebSocket:un,NOOP:oK}=ws(),{EventTarget:{addEventListener:Dxe,removeEventListener:Lxe}}=Q2(),{format:Nxe,parse:Mxe}=Dy(),{toBuffer:Uxe}=Nf(),sK=Symbol("kAborted"),$C=[8,13],Ts=["CONNECTING","OPEN","CLOSING","CLOSED"],Fxe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class Ae extends bxe{constructor(e,t,n){super();if(this._binaryType=tK[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ly,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=Ae.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0)t=[];else if(!Array.isArray(t))if(typeof t==="object"&&t!==null)n=t,t=[];else t=[t];iK(this,e,t,n)}else this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){if(!tK.includes(e))return;if(this._binaryType=e,this._receiver)this._receiver._binaryType=e}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,n){let r=new Txe({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new Cxe(e,this._extensions,n.generateMask);if(this._receiver=r,this._sender=o,this._socket=e,r[un]=this,o[un]=this,e[un]=this,r.on("conclude",jxe),r.on("drain",Hxe),r.on("error",Bxe),r.on("message",Kxe),r.on("ping",Gxe),r.on("pong",Wxe),o.onerror=Vxe,e.setTimeout)e.setTimeout(0);if(e.setNoDelay)e.setNoDelay();if(t.length>0)e.unshift(t);e.on("close",lK),e.on("data",My),e.on("end",uK),e.on("error",dK),this._readyState=Ae.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=Ae.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[Ai.extensionName])this._extensions[Ai.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=Ae.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState===Ae.CLOSED)return;if(this.readyState===Ae.CONNECTING){Rr(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===Ae.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=Ae.CLOSING,this._sender.close(e,t,!this._isServer,(n)=>{if(n)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),cK(this)}pause(){if(this.readyState===Ae.CONNECTING||this.readyState===Ae.CLOSED)return;this._paused=!0,this._socket.pause()}ping(e,t,n){if(this.readyState===Ae.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e==="function")n=e,e=t=void 0;else if(typeof t==="function")n=t,t=void 0;if(typeof e==="number")e=e.toString();if(this.readyState!==Ae.OPEN){zC(this,e,n);return}if(t===void 0)t=!this._isServer;this._sender.ping(e||Ly,t,n)}pong(e,t,n){if(this.readyState===Ae.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e==="function")n=e,e=t=void 0;else if(typeof t==="function")n=t,t=void 0;if(typeof e==="number")e=e.toString();if(this.readyState!==Ae.OPEN){zC(this,e,n);return}if(t===void 0)t=!this._isServer;this._sender.pong(e||Ly,t,n)}resume(){if(this.readyState===Ae.CONNECTING||this.readyState===Ae.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(e,t,n){if(this.readyState===Ae.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t==="function")n=t,t={};if(typeof e==="number")e=e.toString();if(this.readyState!==Ae.OPEN){zC(this,e,n);return}let r={binary:typeof e!=="string",mask:!this._isServer,compress:!0,fin:!0,...t};if(!this._extensions[Ai.extensionName])r.compress=!1;this._sender.send(e||Ly,r,n)}terminate(){if(this.readyState===Ae.CLOSED)return;if(this.readyState===Ae.CONNECTING){Rr(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=Ae.CLOSING,this._socket.destroy()}}Object.defineProperty(Ae,"CONNECTING",{enumerable:!0,value:Ts.indexOf("CONNECTING")});Object.defineProperty(Ae.prototype,"CONNECTING",{enumerable:!0,value:Ts.indexOf("CONNECTING")});Object.defineProperty(Ae,"OPEN",{enumerable:!0,value:Ts.indexOf("OPEN")});Object.defineProperty(Ae.prototype,"OPEN",{enumerable:!0,value:Ts.indexOf("OPEN")});Object.defineProperty(Ae,"CLOSING",{enumerable:!0,value:Ts.indexOf("CLOSING")});Object.defineProperty(Ae.prototype,"CLOSING",{enumerable:!0,value:Ts.indexOf("CLOSING")});Object.defineProperty(Ae,"CLOSED",{enumerable:!0,value:Ts.indexOf("CLOSED")});Object.defineProperty(Ae.prototype,"CLOSED",{enumerable:!0,value:Ts.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e)=>{Object.defineProperty(Ae.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach((e)=>{Object.defineProperty(Ae.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[FC])return t[Pxe];return null},set(t){for(let n of this.listeners(e))if(n[FC]){this.removeListener(e,n);break}if(typeof t!=="function")return;this.addEventListener(e,t,{[FC]:!0})}})});Ae.prototype.addEventListener=Dxe;Ae.prototype.removeEventListener=Lxe;pK.exports=Ae;function iK(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Rxe,protocolVersion:$C[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!$C.includes(o.protocolVersion))throw RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${$C.join(", ")})`);let s;if(t instanceof UC)s=t;else try{s=new UC(t)}catch{throw SyntaxError(`Invalid URL: ${t}`)}if(s.protocol==="http:")s.protocol="ws:";else if(s.protocol==="https:")s.protocol="wss:";e._url=s.href;let i=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!i&&!a)c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(a&&!s.pathname)c="The URL's pathname is empty";else if(s.hash)c="The URL contains a fragment identifier";if(c){let _=SyntaxError(c);if(e._redirects===0)throw _;else{Ny(e,_);return}}let l=i?443:80,u=wxe(16).toString("base64"),d=i?Exe.request:xxe.request,f=new Set,m;if(o.createConnection=o.createConnection||(i?zxe:$xe),o.defaultPort=o.defaultPort||l,o.port=s.port||l,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate)m=new Ai({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=Nxe({[Ai.extensionName]:m.offer()});if(n.length){for(let _ of n){if(typeof _!=="string"||!Fxe.test(_)||f.has(_))throw SyntaxError("An invalid or duplicated subprotocol was specified");f.add(_)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin)if(o.protocolVersion<13)o.headers["Sec-WebSocket-Origin"]=o.origin;else o.headers.Origin=o.origin;if(s.username||s.password)o.auth=`${s.username}:${s.password}`;if(a){let _=o.path.split(":");o.socketPath=_[0],o.path=_[1]}let h;if(o.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=i,e._originalHostOrSocketPath=a?o.socketPath:s.host;let _=r&&r.headers;if(r={...r,headers:{}},_)for(let[y,b]of Object.entries(_))r.headers[y.toLowerCase()]=b}else if(e.listenerCount("redirect")===0){let _=a?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;if(!_||e._originalSecure&&!i){if(delete o.headers.authorization,delete o.headers.cookie,!_)delete o.headers.host;o.auth=void 0}}if(o.auth&&!r.headers.authorization)r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64");if(h=e._req=d(o),e._redirects)e.emit("redirect",e.url,h)}else h=e._req=d(o);if(o.timeout)h.on("timeout",()=>{Rr(e,h,"Opening handshake has timed out")});if(h.on("error",(_)=>{if(h===null||h[sK])return;h=e._req=null,Ny(e,_)}),h.on("response",(_)=>{let y=_.headers.location,b=_.statusCode;if(y&&o.followRedirects&&b>=300&&b<400){if(++e._redirects>o.maxRedirects){Rr(e,h,"Maximum redirects exceeded");return}h.abort();let v;try{v=new UC(y,t)}catch(S){let x=SyntaxError(`Invalid URL: ${y}`);Ny(e,x);return}iK(e,v,n,r)}else if(!e.emit("unexpected-response",h,_))Rr(e,h,`Unexpected server response: ${_.statusCode}`)}),h.on("upgrade",(_,y,b)=>{if(e.emit("upgrade",_),e.readyState!==Ae.CONNECTING)return;h=e._req=null;let v=_.headers.upgrade;if(v===void 0||v.toLowerCase()!=="websocket"){Rr(e,y,"Invalid Upgrade header");return}let S=Axe("sha1").update(u+Oxe).digest("base64");if(_.headers["sec-websocket-accept"]!==S){Rr(e,y,"Invalid Sec-WebSocket-Accept header");return}let x=_.headers["sec-websocket-protocol"],w;if(x!==void 0){if(!f.size)w="Server sent a subprotocol but none was requested";else if(!f.has(x))w="Server sent an invalid subprotocol"}else if(f.size)w="Server sent no subprotocol";if(w){Rr(e,y,w);return}if(x)e._protocol=x;let D=_.headers["sec-websocket-extensions"];if(D!==void 0){if(!m){Rr(e,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let P;try{P=Mxe(D)}catch(z){Rr(e,y,"Invalid Sec-WebSocket-Extensions header");return}let F=Object.keys(P);if(F.length!==1||F[0]!==Ai.extensionName){Rr(e,y,"Server indicated an extension that was not requested");return}try{m.accept(P[Ai.extensionName])}catch(z){Rr(e,y,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ai.extensionName]=m}e.setSocket(y,b,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest)o.finishRequest(h,e);else h.end()}function Ny(e,t){e._readyState=Ae.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function $xe(e){return e.path=e.socketPath,rK.connect(e)}function zxe(e){if(e.path=void 0,!e.servername&&e.servername!=="")e.servername=rK.isIP(e.host)?"":e.host;return vxe.connect(e)}function Rr(e,t,n){e._readyState=Ae.CLOSING;let r=Error(n);if(Error.captureStackTrace(r,Rr),t.setHeader){if(t[sK]=!0,t.abort(),t.socket&&!t.socket.destroyed)t.socket.destroy();process.nextTick(Ny,e,r)}else t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e))}function zC(e,t,n){if(t){let r=kxe(t)?t.size:Uxe(t).length;if(e._socket)e._sender._bufferedBytes+=r;else e._bufferedAmount+=r}if(n){let r=Error(`WebSocket is not open: readyState ${e.readyState} (${Ts[e.readyState]})`);process.nextTick(n,r)}}function jxe(e,t){let n=this[un];if(n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[un]===void 0)return;if(n._socket.removeListener("data",My),process.nextTick(aK,n._socket),e===1005)n.close();else n.close(e,t)}function Hxe(){let e=this[un];if(!e.isPaused)e._socket.resume()}function Bxe(e){let t=this[un];if(t._socket[un]!==void 0)t._socket.removeListener("data",My),process.nextTick(aK,t._socket),t.close(e[Ixe]);if(!t._errorEmitted)t._errorEmitted=!0,t.emit("error",e)}function nK(){this[un].emitClose()}function Kxe(e,t){this[un].emit("message",e,t)}function Gxe(e){let t=this[un];if(t._autoPong)t.pong(e,!this._isServer,oK);t.emit("ping",e)}function Wxe(e){this[un].emit("pong",e)}function aK(e){e.resume()}function Vxe(e){let t=this[un];if(t.readyState===Ae.CLOSED)return;if(t.readyState===Ae.OPEN)t._readyState=Ae.CLOSING,cK(t);if(this._socket.end(),!t._errorEmitted)t._errorEmitted=!0,t.emit("error",e)}function cK(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function lK(){let e=this[un];if(this.removeListener("close",lK),this.removeListener("data",My),this.removeListener("end",uK),e._readyState=Ae.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}if(e._receiver.end(),this[un]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted)e.emitClose();else e._receiver.on("error",nK),e._receiver.on("finish",nK)}function My(e){if(!this[un]._receiver.write(e))this.pause()}function uK(){let e=this[un];e._readyState=Ae.CLOSING,e._receiver.end(),this.end()}function dK(){let e=this[un];if(this.removeListener("error",dK),this.on("error",oK),e)e._readyState=Ae.CLOSING,this.destroy()}});var gK=C(function(wOt,hK){var vOt=Uy(),{Duplex:qxe}=ve("stream");function fK(e){e.emit("close")}function Zxe(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function mK(e){if(this.removeListener("error",mK),this.destroy(),this.listenerCount("error")===0)this.emit("error",e)}function Yxe(e,t){let n=!0,r=new qxe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(s,i){let a=!i&&r._readableState.objectMode?s.toString():s;if(!r.push(a))e.pause()}),e.once("error",function(s){if(r.destroyed)return;n=!1,r.destroy(s)}),e.once("close",function(){if(r.destroyed)return;r.push(null)}),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(fK,r);return}let i=!1;if(e.once("error",function(c){i=!0,s(c)}),e.once("close",function(){if(!i)s(o);process.nextTick(fK,r)}),n)e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",function(){r._final(o)});return}if(e._socket===null)return;if(e._socket._writableState.finished){if(o(),r._readableState.endEmitted)r.destroy()}else e._socket.once("finish",function(){o()}),e.close()},r._read=function(){if(e.isPaused)e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",function(){r._write(o,s,i)});return}e.send(o,i)},r.on("end",Zxe),r.on("error",mK),r}hK.exports=Yxe});var jC=C(function(AOt,_K){var{tokenChars:Jxe}=au();function Xxe(e){let t=new Set,n=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&Jxe[i]===1){if(n===-1)n=o}else if(o!==0&&(i===32||i===9)){if(r===-1&&n!==-1)r=o}else if(i===44){if(n===-1)throw SyntaxError(`Unexpected character at index ${o}`);if(r===-1)r=o;let a=e.slice(n,r);if(t.has(a))throw SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),n=r=-1}else throw SyntaxError(`Unexpected character at index ${o}`)}if(n===-1||r!==-1)throw SyntaxError("Unexpected end of input");let s=e.slice(n,o);if(t.has(s))throw SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}_K.exports={parse:Xxe}});var xK=C(function(COt,EK){var Qxe=ve("events"),Fy=ve("http"),{Duplex:TOt}=ve("stream"),{createHash:eve}=ve("crypto"),yK=Dy(),$a=iu(),tve=jC(),nve=Uy(),{CLOSE_TIMEOUT:rve,GUID:ove,kWebSocket:sve}=ws(),ive=/^[+/0-9A-Za-z]{22}==$/;class bK extends Qxe{constructor(e,t){super();if(e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:rve,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:nve,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null)this._server=Fy.createServer((n,r)=>{let o=Fy.STATUS_CODES[426];r.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),r.end(o)}),this._server.listen(e.port,e.host,e.backlog,t);else if(e.server)this._server=e.server;if(this._server){let n=this.emit.bind(this,"connection");this._removeListeners=ave(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,o,s)=>{this.handleUpgrade(r,o,s,n)}})}if(e.perMessageDeflate===!0)e.perMessageDeflate={};if(e.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=e,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(e){if(this._state===2){if(e)this.once("close",()=>{e(Error("The server is not running"))});process.nextTick(zf,this);return}if(e)this.once("close",e);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(zf,this);else this._shouldEmitClose=!0;else process.nextTick(zf,this)}else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{zf(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",SK);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,i=+e.headers["sec-websocket-version"];if(e.method!=="GET"){za(this,e,t,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){za(this,e,t,400,"Invalid Upgrade header");return}if(o===void 0||!ive.test(o)){za(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(i!==13&&i!==8){za(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){jf(t,400);return}let a=e.headers["sec-websocket-protocol"],c=new Set;if(a!==void 0)try{c=tve.parse(a)}catch(d){za(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&l!==void 0){let d=new $a({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=yK.parse(l);if(f[$a.extensionName])d.accept(f[$a.extensionName]),u[$a.extensionName]=d}catch(f){za(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${i===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(f,m,h,_)=>{if(!f)return jf(t,m||401,h,_);this.completeUpgrade(u,o,c,e,t,n,r)});return}if(!this.options.verifyClient(d))return jf(t,401)}this.completeUpgrade(u,o,c,e,t,n,r)}completeUpgrade(e,t,n,r,o,s,i){if(!o.readable||!o.writable)return o.destroy();if(o[sve])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return jf(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${eve("sha1").update(t+ove).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let u=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;if(u)c.push(`Sec-WebSocket-Protocol: ${u}`),l._protocol=u}if(e[$a.extensionName]){let u=e[$a.extensionName].params,d=yK.format({[$a.extensionName]:[u]});c.push(`Sec-WebSocket-Extensions: ${d}`),l._extensions=e}if(this.emit("headers",c,r),o.write(c.concat(`\r
100
+ `).join(`\r
101
+ `)),o.removeListener("error",SK),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(l),l.on("close",()=>{if(this.clients.delete(l),this._shouldEmitClose&&!this.clients.size)process.nextTick(zf,this)});i(l,r)}}EK.exports=bK;function ave(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return function(){for(let r of Object.keys(t))e.removeListener(r,t[r])}}function zf(e){e._state=2,e.emit("close")}function SK(){this.destroy()}function jf(e,t,n,r){n=n||Fy.STATUS_CODES[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Fy.STATUS_CODES[t]}\r
102
+ `+Object.keys(r).map((o)=>`${o}: ${r[o]}`).join(`\r
103
+ `)+`\r
104
+ \r
105
+ `+n)}function za(e,t,n,r,o,s){if(e.listenerCount("wsClientError")){let i=Error(o);Error.captureStackTrace(i,za),e.emit("wsClientError",i,n,t)}else jf(n,r,o,s)}});var cve,lve,uve,dve,pve,fve,mve,hve;var vK=O(()=>{cve=qn(gK(),1),lve=qn(Dy(),1),uve=qn(iu(),1),dve=qn(DC(),1),pve=qn(NC(),1),fve=qn(jC(),1),mve=qn(Uy(),1),hve=qn(xK(),1)});function wK(e){return gve.has(e)||_ve.test(e)}var gve,_ve;var AK=O(()=>{gve=new Set(["localhost","::1","[::1]"]),_ve=/^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/});function yve(){return Oe(process.env.CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK)}function TK(e,t){return`[CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK] live request from a test runtime: ${e} ${t}
106
+ `}function CK(e){let t;try{t=wK(new URL(e).hostname)}catch{t=!1}if(t)return"loopback";return yve()?"opted-in":"refused"}function HC(e,t){return`Blocked under test: ${e} ${t} — test runtimes must not reach the network. `+"Run the file via `bun run test:file -- <path>` with this request mocked, or set CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK=1 for an intentional live probe."}function kK(e){let t=Gr.getUri(e),n=(e.method??"get").toUpperCase();switch(CK(t)){case"loopback":return Sve(e,n);case"opted-in":return process.stderr.write(TK(n,t)),e;case"refused":throw new BC(HC(n,t))}}function Sve(e,t){let n=e.beforeRedirect;return e.beforeRedirect=(r,o)=>{let s=typeof r.href==="string"?r.href:"";switch(CK(s)){case"loopback":break;case"opted-in":process.stderr.write(TK(t,s));break;case"refused":throw process.stderr.write(`${HC(t,s)}
107
+ `),new BC(HC(t,s))}n?.(r,o)},e}function bve(){if(!Eve())Gr.interceptors.request.use(kK)}function Eve(){return Gr.interceptors.request.handlers?.some((e)=>e?.fulfilled===kK)??!1}function ja(){return}var BC,NOt;var RK=O(()=>{jc();CC();vK();AK();BC=class BC extends Error{name="TestEgressBlockedError";code="TestEgressBlocked"};NOt=globalThis.fetch});var OK={};Zn(OK,{externalHttp:()=>xve});function pu(e,t){for(let n of[e,t?.baseURL])if(n&&b2(n))throw Error(`externalHttp: ${n} is Anthropic-operated. Use firstPartyApi from `+"src/services/http/firstParty — it enforces the 3P data-residency gate.")}var xve;var PK=O(()=>{CC();E2();RK();xve={get(e,t){return pu(e,t),ja(),Gr.get(e,t)},head(e,t){return pu(e,t),ja(),Gr.head(e,t)},post(e,t,n){return pu(e,n),ja(),Gr.post(e,t,n)},put(e,t,n){return pu(e,n),ja(),Gr.put(e,t,n)},patch(e,t,n){return pu(e,n),ja(),Gr.patch(e,t,n)},delete(e,t){return pu(e,t),ja(),Gr.delete(e,t)}}});var rG=C(function(tG){Object.defineProperty(tG,"__esModule",{value:!0});tG._globalThis=void 0;tG._globalThis=typeof globalThis==="object"?globalThis:global});var oG=C(function(Ha){var g$e=Ha&&Ha.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]}),_$e=Ha&&Ha.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))g$e(t,e,n)};Object.defineProperty(Ha,"__esModule",{value:!0});_$e(rG(),Ha)});var sG=C(function(Ba){var y$e=Ba&&Ba.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]}),S$e=Ba&&Ba.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))y$e(t,e,n)};Object.defineProperty(Ba,"__esModule",{value:!0});S$e(oG(),Ba)});var ak=C(function(iG){Object.defineProperty(iG,"__esModule",{value:!0});iG.VERSION=void 0;iG.VERSION="1.9.0"});var pG=C(function(uG){Object.defineProperty(uG,"__esModule",{value:!0});uG.isCompatible=uG._makeCompatibilityCheck=void 0;var b$e=ak(),cG=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function lG(e){let t=new Set([e]),n=new Set,r=e.match(cG);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===e};function s(a){return n.add(a),!1}function i(a){return t.add(a),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;let l=c.match(cG);if(!l)return s(c);let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return s(c);if(o.major!==u.major)return s(c);if(o.major===0){if(o.minor===u.minor&&o.patch<=u.patch)return i(c);return s(c)}if(o.minor<=u.minor)return i(c);return s(c)}}uG._makeCompatibilityCheck=lG;uG.isCompatible=lG(b$e.VERSION)});var Ka=C(function(fG){Object.defineProperty(fG,"__esModule",{value:!0});fG.unregisterGlobal=fG.getGlobal=fG.registerGlobal=void 0;var x$e=sG(),yu=ak(),v$e=pG(),w$e=yu.VERSION.split(".")[0],Vf=Symbol.for(`opentelemetry.js.api.${w$e}`),qf=x$e._globalThis;function A$e(e,t,n,r=!1){var o;let s=qf[Vf]=(o=qf[Vf])!==null&&o!==void 0?o:{version:yu.VERSION};if(!r&&s[e]){let i=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(i.stack||i.message),!1}if(s.version!==yu.VERSION){let i=Error(`@opentelemetry/api: Registration of version v${s.version} for ${e} does not match previously registered API v${yu.VERSION}`);return n.error(i.stack||i.message),!1}return s[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${yu.VERSION}.`),!0}fG.registerGlobal=A$e;function T$e(e){var t,n;let r=(t=qf[Vf])===null||t===void 0?void 0:t.version;if(!r||!(0,v$e.isCompatible)(r))return;return(n=qf[Vf])===null||n===void 0?void 0:n[e]}fG.getGlobal=T$e;function C$e(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${yu.VERSION}.`);let n=qf[Vf];if(n)delete n[e]}fG.unregisterGlobal=C$e});var yG=C(function(gG){Object.defineProperty(gG,"__esModule",{value:!0});gG.DiagComponentLogger=void 0;var O$e=Ka();class hG{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return Zf("debug",this._namespace,e)}error(...e){return Zf("error",this._namespace,e)}info(...e){return Zf("info",this._namespace,e)}warn(...e){return Zf("warn",this._namespace,e)}verbose(...e){return Zf("verbose",this._namespace,e)}}gG.DiagComponentLogger=hG;function Zf(e,t,n){let r=(0,O$e.getGlobal)("diag");if(!r)return;return n.unshift(t),r[e](...n)}});var By=C(function(SG){Object.defineProperty(SG,"__esModule",{value:!0});SG.DiagLogLevel=void 0;var P$e;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(P$e=SG.DiagLogLevel||(SG.DiagLogLevel={}))});var xG=C(function(bG){Object.defineProperty(bG,"__esModule",{value:!0});bG.createLogLevelDiagLogger=void 0;var Cs=By();function I$e(e,t){if(e<Cs.DiagLogLevel.NONE)e=Cs.DiagLogLevel.NONE;else if(e>Cs.DiagLogLevel.ALL)e=Cs.DiagLogLevel.ALL;t=t||{};function n(r,o){let s=t[r];if(typeof s==="function"&&e>=o)return s.bind(t);return function(){}}return{error:n("error",Cs.DiagLogLevel.ERROR),warn:n("warn",Cs.DiagLogLevel.WARN),info:n("info",Cs.DiagLogLevel.INFO),debug:n("debug",Cs.DiagLogLevel.DEBUG),verbose:n("verbose",Cs.DiagLogLevel.VERBOSE)}}bG.createLogLevelDiagLogger=I$e});var Ga=C(function(wG){Object.defineProperty(wG,"__esModule",{value:!0});wG.DiagAPI=void 0;var D$e=yG(),L$e=xG(),vG=By(),Ky=Ka(),N$e="diag";class lk{constructor(){function e(r){return function(...o){let s=(0,Ky.getGlobal)("diag");if(!s)return;return s[r](...o)}}let t=this,n=(r,o={logLevel:vG.DiagLogLevel.INFO})=>{var s,i,a;if(r===t){let u=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((s=u.stack)!==null&&s!==void 0?s:u.message),!1}if(typeof o==="number")o={logLevel:o};let c=(0,Ky.getGlobal)("diag"),l=(0,L$e.createLogLevelDiagLogger)((i=o.logLevel)!==null&&i!==void 0?i:vG.DiagLogLevel.INFO,r);if(c&&!o.suppressOverrideMessage){let u=(a=Error().stack)!==null&&a!==void 0?a:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${u}`),l.warn(`Current logger will overwrite one already registered from ${u}`)}return(0,Ky.registerGlobal)("diag",l,t,!0)};t.setLogger=n,t.disable=()=>{(0,Ky.unregisterGlobal)(N$e,t)},t.createComponentLogger=(r)=>new D$e.DiagComponentLogger(r),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){if(!this._instance)this._instance=new lk;return this._instance}}wG.DiagAPI=lk});var kG=C(function(TG){Object.defineProperty(TG,"__esModule",{value:!0});TG.BaggageImpl=void 0;class Su{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(!t)return;return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new Su(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new Su(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new Su(this._entries);for(let n of e)t._entries.delete(n);return t}clear(){return new Su}}TG.BaggageImpl=Su});var PG=C(function(RG){Object.defineProperty(RG,"__esModule",{value:!0});RG.baggageEntryMetadataSymbol=void 0;RG.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var uk=C(function(IG){Object.defineProperty(IG,"__esModule",{value:!0});IG.baggageEntryMetadataFromString=IG.createBaggage=void 0;var M$e=Ga(),U$e=kG(),F$e=PG(),$$e=M$e.DiagAPI.instance();function z$e(e={}){return new U$e.BaggageImpl(new Map(Object.entries(e)))}IG.createBaggage=z$e;function j$e(e){if(typeof e!=="string")$$e.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e="";return{__TYPE__:F$e.baggageEntryMetadataSymbol,toString(){return e}}}IG.baggageEntryMetadataFromString=j$e});var Yf=C(function(LG){Object.defineProperty(LG,"__esModule",{value:!0});LG.ROOT_CONTEXT=LG.createContextKey=void 0;function B$e(e){return Symbol.for(e)}LG.createContextKey=B$e;class Gy{constructor(e){let t=this;t._currentContext=e?new Map(e):new Map,t.getValue=(n)=>t._currentContext.get(n),t.setValue=(n,r)=>{let o=new Gy(t._currentContext);return o._currentContext.set(n,r),o},t.deleteValue=(n)=>{let r=new Gy(t._currentContext);return r._currentContext.delete(n),r}}}LG.ROOT_CONTEXT=new Gy});var $G=C(function(UG){Object.defineProperty(UG,"__esModule",{value:!0});UG.DiagConsoleLogger=void 0;var dk=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class MG{constructor(){function e(t){return function(...n){if(console){let r=console[t];if(typeof r!=="function")r=console.log;if(typeof r==="function")return r.apply(console,n)}}}for(let t=0;t<dk.length;t++)this[dk[t].n]=e(dk[t].c)}}UG.DiagConsoleLogger=MG});var bk=C(function(zG){Object.defineProperty(zG,"__esModule",{value:!0});zG.createNoopMeter=zG.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=zG.NOOP_OBSERVABLE_GAUGE_METRIC=zG.NOOP_OBSERVABLE_COUNTER_METRIC=zG.NOOP_UP_DOWN_COUNTER_METRIC=zG.NOOP_HISTOGRAM_METRIC=zG.NOOP_GAUGE_METRIC=zG.NOOP_COUNTER_METRIC=zG.NOOP_METER=zG.NoopObservableUpDownCounterMetric=zG.NoopObservableGaugeMetric=zG.NoopObservableCounterMetric=zG.NoopObservableMetric=zG.NoopHistogramMetric=zG.NoopGaugeMetric=zG.NoopUpDownCounterMetric=zG.NoopCounterMetric=zG.NoopMetric=zG.NoopMeter=void 0;class pk{constructor(){}createGauge(e,t){return zG.NOOP_GAUGE_METRIC}createHistogram(e,t){return zG.NOOP_HISTOGRAM_METRIC}createCounter(e,t){return zG.NOOP_COUNTER_METRIC}createUpDownCounter(e,t){return zG.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,t){return zG.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,t){return zG.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,t){return zG.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}zG.NoopMeter=pk;class bu{}zG.NoopMetric=bu;class fk extends bu{add(e,t){}}zG.NoopCounterMetric=fk;class mk extends bu{add(e,t){}}zG.NoopUpDownCounterMetric=mk;class hk extends bu{record(e,t){}}zG.NoopGaugeMetric=hk;class gk extends bu{record(e,t){}}zG.NoopHistogramMetric=gk;class Jf{addCallback(e){}removeCallback(e){}}zG.NoopObservableMetric=Jf;class _k extends Jf{}zG.NoopObservableCounterMetric=_k;class yk extends Jf{}zG.NoopObservableGaugeMetric=yk;class Sk extends Jf{}zG.NoopObservableUpDownCounterMetric=Sk;zG.NOOP_METER=new pk;zG.NOOP_COUNTER_METRIC=new fk;zG.NOOP_GAUGE_METRIC=new hk;zG.NOOP_HISTOGRAM_METRIC=new gk;zG.NOOP_UP_DOWN_COUNTER_METRIC=new mk;zG.NOOP_OBSERVABLE_COUNTER_METRIC=new _k;zG.NOOP_OBSERVABLE_GAUGE_METRIC=new yk;zG.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new Sk;function G$e(){return zG.NOOP_METER}zG.createNoopMeter=G$e});var JG=C(function(YG){Object.defineProperty(YG,"__esModule",{value:!0});YG.ValueType=void 0;var nze;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(nze=YG.ValueType||(YG.ValueType={}))});var xk=C(function(XG){Object.defineProperty(XG,"__esModule",{value:!0});XG.defaultTextMapSetter=XG.defaultTextMapGetter=void 0;XG.defaultTextMapGetter={get(e,t){if(e==null)return;return e[t]},keys(e){if(e==null)return[];return Object.keys(e)}};XG.defaultTextMapSetter={set(e,t,n){if(e==null)return;e[t]=n}}});var rW=C(function(tW){Object.defineProperty(tW,"__esModule",{value:!0});tW.NoopContextManager=void 0;var oze=Yf();class eW{active(){return oze.ROOT_CONTEXT}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}tW.NoopContextManager=eW});var Xf=C(function(sW){Object.defineProperty(sW,"__esModule",{value:!0});sW.ContextAPI=void 0;var sze=rW(),vk=Ka(),oW=Ga(),wk="context",ize=new sze.NoopContextManager;class Ak{constructor(){}static getInstance(){if(!this._instance)this._instance=new Ak;return this._instance}setGlobalContextManager(e){return(0,vk.registerGlobal)(wk,e,oW.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,vk.getGlobal)(wk)||ize}disable(){this._getContextManager().disable(),(0,vk.unregisterGlobal)(wk,oW.DiagAPI.instance())}}sW.ContextAPI=Ak});var Ck=C(function(aW){Object.defineProperty(aW,"__esModule",{value:!0});aW.TraceFlags=void 0;var aze;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(aze=aW.TraceFlags||(aW.TraceFlags={}))});var Wy=C(function(cW){Object.defineProperty(cW,"__esModule",{value:!0});cW.INVALID_SPAN_CONTEXT=cW.INVALID_TRACEID=cW.INVALID_SPANID=void 0;var cze=Ck();cW.INVALID_SPANID="0000000000000000";cW.INVALID_TRACEID="00000000000000000000000000000000";cW.INVALID_SPAN_CONTEXT={traceId:cW.INVALID_TRACEID,spanId:cW.INVALID_SPANID,traceFlags:cze.TraceFlags.NONE}});var Vy=C(function(fW){Object.defineProperty(fW,"__esModule",{value:!0});fW.NonRecordingSpan=void 0;var lze=Wy();class pW{constructor(e=lze.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}fW.NonRecordingSpan=pW});var Ok=C(function(gW){Object.defineProperty(gW,"__esModule",{value:!0});gW.getSpanContext=gW.setSpanContext=gW.deleteSpan=gW.setSpan=gW.getActiveSpan=gW.getSpan=void 0;var uze=Yf(),dze=Vy(),pze=Xf(),kk=(0,uze.createContextKey)("OpenTelemetry Context Key SPAN");function Rk(e){return e.getValue(kk)||void 0}gW.getSpan=Rk;function fze(){return Rk(pze.ContextAPI.getInstance().active())}gW.getActiveSpan=fze;function hW(e,t){return e.setValue(kk,t)}gW.setSpan=hW;function mze(e){return e.deleteValue(kk)}gW.deleteSpan=mze;function hze(e,t){return hW(e,new dze.NonRecordingSpan(t))}gW.setSpanContext=hze;function gze(e){var t;return(t=Rk(e))===null||t===void 0?void 0:t.spanContext()}gW.getSpanContext=gze});var qy=C(function(EW){Object.defineProperty(EW,"__esModule",{value:!0});EW.wrapSpanContext=EW.isSpanContextValid=EW.isValidSpanId=EW.isValidTraceId=void 0;var yW=Wy(),xze=Vy(),vze=/^([0-9a-f]{32})$/i,wze=/^[0-9a-f]{16}$/i;function SW(e){return vze.test(e)&&e!==yW.INVALID_TRACEID}EW.isValidTraceId=SW;function bW(e){return wze.test(e)&&e!==yW.INVALID_SPANID}EW.isValidSpanId=bW;function Aze(e){return SW(e.traceId)&&bW(e.spanId)}EW.isSpanContextValid=Aze;function Tze(e){return new xze.NonRecordingSpan(e)}EW.wrapSpanContext=Tze});var Dk=C(function(AW){Object.defineProperty(AW,"__esModule",{value:!0});AW.NoopTracer=void 0;var Oze=Xf(),vW=Ok(),Pk=Vy(),Pze=qy(),Ik=Oze.ContextAPI.getInstance();class wW{startSpan(e,t,n=Ik.active()){if(Boolean(t===null||t===void 0?void 0:t.root))return new Pk.NonRecordingSpan;let o=n&&(0,vW.getSpanContext)(n);if(Ize(o)&&(0,Pze.isSpanContextValid)(o))return new Pk.NonRecordingSpan(o);else return new Pk.NonRecordingSpan}startActiveSpan(e,t,n,r){let o,s,i;if(arguments.length<2)return;else if(arguments.length===2)i=t;else if(arguments.length===3)o=t,i=n;else o=t,s=n,i=r;let a=s!==null&&s!==void 0?s:Ik.active(),c=this.startSpan(e,o,a),l=(0,vW.setSpan)(a,c);return Ik.with(l,i,void 0,c)}}AW.NoopTracer=wW;function Ize(e){return typeof e==="object"&&typeof e.spanId==="string"&&typeof e.traceId==="string"&&typeof e.traceFlags==="number"}});var Lk=C(function(kW){Object.defineProperty(kW,"__esModule",{value:!0});kW.ProxyTracer=void 0;var Dze=Dk(),Lze=new Dze.NoopTracer;class CW{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!e)return Lze;return this._delegate=e,this._delegate}}kW.ProxyTracer=CW});var DW=C(function(PW){Object.defineProperty(PW,"__esModule",{value:!0});PW.NoopTracerProvider=void 0;var Nze=Dk();class OW{getTracer(e,t,n){return new Nze.NoopTracer}}PW.NoopTracerProvider=OW});var Nk=C(function(NW){Object.defineProperty(NW,"__esModule",{value:!0});NW.ProxyTracerProvider=void 0;var Mze=Lk(),Uze=DW(),Fze=new Uze.NoopTracerProvider;class LW{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))!==null&&r!==void 0?r:new Mze.ProxyTracer(this,e,t,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Fze}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,t,n)}}NW.ProxyTracerProvider=LW});var FW=C(function(UW){Object.defineProperty(UW,"__esModule",{value:!0});UW.SamplingDecision=void 0;var $ze;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})($ze=UW.SamplingDecision||(UW.SamplingDecision={}))});var zW=C(function($W){Object.defineProperty($W,"__esModule",{value:!0});$W.SpanKind=void 0;var zze;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(zze=$W.SpanKind||($W.SpanKind={}))});var HW=C(function(jW){Object.defineProperty(jW,"__esModule",{value:!0});jW.SpanStatusCode=void 0;var jze;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(jze=jW.SpanStatusCode||(jW.SpanStatusCode={}))});var GW=C(function(BW){Object.defineProperty(BW,"__esModule",{value:!0});BW.validateValue=BW.validateKey=void 0;var $k="[_0-9a-z-*/]",Hze=`[a-z]${$k}{0,255}`,Bze=`[a-z0-9]${$k}{0,240}@[a-z]${$k}{0,13}`,Kze=new RegExp(`^(?:${Hze}|${Bze})$`),Gze=/^[ -~]{0,255}[!-~]$/,Wze=/,|=/;function Vze(e){return Kze.test(e)}BW.validateKey=Vze;function qze(e){return Gze.test(e)&&!Wze.test(e)}BW.validateValue=qze});var XW=C(function(YW){Object.defineProperty(YW,"__esModule",{value:!0});YW.TraceStateImpl=void 0;var WW=GW(),VW=32,Yze=512,qW=",",ZW="=";class zk{constructor(e){if(this._internalState=new Map,e)this._parse(e)}set(e,t){let n=this._clone();if(n._internalState.has(e))n._internalState.delete(e);return n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+ZW+this.get(t)),e),[]).join(qW)}_parse(e){if(e.length>Yze)return;if(this._internalState=e.split(qW).reverse().reduce((t,n)=>{let r=n.trim(),o=r.indexOf(ZW);if(o!==-1){let s=r.slice(0,o),i=r.slice(o+1,n.length);if((0,WW.validateKey)(s)&&(0,WW.validateValue)(i))t.set(s,i)}return t},new Map),this._internalState.size>VW)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,VW))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new zk;return e._internalState=new Map(this._internalState),e}}YW.TraceStateImpl=zk});var tV=C(function(QW){Object.defineProperty(QW,"__esModule",{value:!0});QW.createTraceState=void 0;var Jze=XW();function Xze(e){return new Jze.TraceStateImpl(e)}QW.createTraceState=Xze});var oV=C(function(nV){Object.defineProperty(nV,"__esModule",{value:!0});nV.context=void 0;var Qze=Xf();nV.context=Qze.ContextAPI.getInstance()});var aV=C(function(sV){Object.defineProperty(sV,"__esModule",{value:!0});sV.diag=void 0;var eje=Ga();sV.diag=eje.DiagAPI.instance()});var uV=C(function(cV){Object.defineProperty(cV,"__esModule",{value:!0});cV.NOOP_METER_PROVIDER=cV.NoopMeterProvider=void 0;var tje=bk();class jk{getMeter(e,t,n){return tje.NOOP_METER}}cV.NoopMeterProvider=jk;cV.NOOP_METER_PROVIDER=new jk});var mV=C(function(pV){Object.defineProperty(pV,"__esModule",{value:!0});pV.MetricsAPI=void 0;var rje=uV(),Hk=Ka(),dV=Ga(),Bk="metrics";class Kk{constructor(){}static getInstance(){if(!this._instance)this._instance=new Kk;return this._instance}setGlobalMeterProvider(e){return(0,Hk.registerGlobal)(Bk,e,dV.DiagAPI.instance())}getMeterProvider(){return(0,Hk.getGlobal)(Bk)||rje.NOOP_METER_PROVIDER}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){(0,Hk.unregisterGlobal)(Bk,dV.DiagAPI.instance())}}pV.MetricsAPI=Kk});var _V=C(function(hV){Object.defineProperty(hV,"__esModule",{value:!0});hV.metrics=void 0;var oje=mV();hV.metrics=oje.MetricsAPI.getInstance()});var EV=C(function(SV){Object.defineProperty(SV,"__esModule",{value:!0});SV.NoopTextMapPropagator=void 0;class yV{inject(e,t){}extract(e,t){return e}fields(){return[]}}SV.NoopTextMapPropagator=yV});var AV=C(function(vV){Object.defineProperty(vV,"__esModule",{value:!0});vV.deleteBaggage=vV.setBaggage=vV.getActiveBaggage=vV.getBaggage=void 0;var sje=Xf(),ije=Yf(),Gk=(0,ije.createContextKey)("OpenTelemetry Baggage Key");function xV(e){return e.getValue(Gk)||void 0}vV.getBaggage=xV;function aje(){return xV(sje.ContextAPI.getInstance().active())}vV.getActiveBaggage=aje;function cje(e,t){return e.setValue(Gk,t)}vV.setBaggage=cje;function lje(e){return e.deleteValue(Gk)}vV.deleteBaggage=lje});var OV=C(function(kV){Object.defineProperty(kV,"__esModule",{value:!0});kV.PropagationAPI=void 0;var Wk=Ka(),fje=EV(),TV=xk(),Zy=AV(),mje=uk(),CV=Ga(),Vk="propagation",hje=new fje.NoopTextMapPropagator;class qk{constructor(){this.createBaggage=mje.createBaggage,this.getBaggage=Zy.getBaggage,this.getActiveBaggage=Zy.getActiveBaggage,this.setBaggage=Zy.setBaggage,this.deleteBaggage=Zy.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new qk;return this._instance}setGlobalPropagator(e){return(0,Wk.registerGlobal)(Vk,e,CV.DiagAPI.instance())}inject(e,t,n=TV.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=TV.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,Wk.unregisterGlobal)(Vk,CV.DiagAPI.instance())}_getGlobalPropagator(){return(0,Wk.getGlobal)(Vk)||hje}}kV.PropagationAPI=qk});var DV=C(function(PV){Object.defineProperty(PV,"__esModule",{value:!0});PV.propagation=void 0;var gje=OV();PV.propagation=gje.PropagationAPI.getInstance()});var $V=C(function(UV){Object.defineProperty(UV,"__esModule",{value:!0});UV.TraceAPI=void 0;var Zk=Ka(),LV=Nk(),NV=qy(),Eu=Ok(),MV=Ga(),Yk="trace";class Jk{constructor(){this._proxyTracerProvider=new LV.ProxyTracerProvider,this.wrapSpanContext=NV.wrapSpanContext,this.isSpanContextValid=NV.isSpanContextValid,this.deleteSpan=Eu.deleteSpan,this.getSpan=Eu.getSpan,this.getActiveSpan=Eu.getActiveSpan,this.getSpanContext=Eu.getSpanContext,this.setSpan=Eu.setSpan,this.setSpanContext=Eu.setSpanContext}static getInstance(){if(!this._instance)this._instance=new Jk;return this._instance}setGlobalTracerProvider(e){let t=(0,Zk.registerGlobal)(Yk,this._proxyTracerProvider,MV.DiagAPI.instance());if(t)this._proxyTracerProvider.setDelegate(e);return t}getTracerProvider(){return(0,Zk.getGlobal)(Yk)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,Zk.unregisterGlobal)(Yk,MV.DiagAPI.instance()),this._proxyTracerProvider=new LV.ProxyTracerProvider}}UV.TraceAPI=Jk});var HV=C(function(zV){Object.defineProperty(zV,"__esModule",{value:!0});zV.trace=void 0;var _je=$V();zV.trace=_je.TraceAPI.getInstance()});var YV=C(function(it){Object.defineProperty(it,"__esModule",{value:!0});it.trace=it.propagation=it.metrics=it.diag=it.context=it.INVALID_SPAN_CONTEXT=it.INVALID_TRACEID=it.INVALID_SPANID=it.isValidSpanId=it.isValidTraceId=it.isSpanContextValid=it.createTraceState=it.TraceFlags=it.SpanStatusCode=it.SpanKind=it.SamplingDecision=it.ProxyTracerProvider=it.ProxyTracer=it.defaultTextMapSetter=it.defaultTextMapGetter=it.ValueType=it.createNoopMeter=it.DiagLogLevel=it.DiagConsoleLogger=it.ROOT_CONTEXT=it.createContextKey=it.baggageEntryMetadataFromString=void 0;var yje=uk();Object.defineProperty(it,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return yje.baggageEntryMetadataFromString}});var BV=Yf();Object.defineProperty(it,"createContextKey",{enumerable:!0,get:function(){return BV.createContextKey}});Object.defineProperty(it,"ROOT_CONTEXT",{enumerable:!0,get:function(){return BV.ROOT_CONTEXT}});var Sje=$G();Object.defineProperty(it,"DiagConsoleLogger",{enumerable:!0,get:function(){return Sje.DiagConsoleLogger}});var bje=By();Object.defineProperty(it,"DiagLogLevel",{enumerable:!0,get:function(){return bje.DiagLogLevel}});var Eje=bk();Object.defineProperty(it,"createNoopMeter",{enumerable:!0,get:function(){return Eje.createNoopMeter}});var xje=JG();Object.defineProperty(it,"ValueType",{enumerable:!0,get:function(){return xje.ValueType}});var KV=xk();Object.defineProperty(it,"defaultTextMapGetter",{enumerable:!0,get:function(){return KV.defaultTextMapGetter}});Object.defineProperty(it,"defaultTextMapSetter",{enumerable:!0,get:function(){return KV.defaultTextMapSetter}});var vje=Lk();Object.defineProperty(it,"ProxyTracer",{enumerable:!0,get:function(){return vje.ProxyTracer}});var wje=Nk();Object.defineProperty(it,"ProxyTracerProvider",{enumerable:!0,get:function(){return wje.ProxyTracerProvider}});var Aje=FW();Object.defineProperty(it,"SamplingDecision",{enumerable:!0,get:function(){return Aje.SamplingDecision}});var Tje=zW();Object.defineProperty(it,"SpanKind",{enumerable:!0,get:function(){return Tje.SpanKind}});var Cje=HW();Object.defineProperty(it,"SpanStatusCode",{enumerable:!0,get:function(){return Cje.SpanStatusCode}});var kje=Ck();Object.defineProperty(it,"TraceFlags",{enumerable:!0,get:function(){return kje.TraceFlags}});var Rje=tV();Object.defineProperty(it,"createTraceState",{enumerable:!0,get:function(){return Rje.createTraceState}});var Xk=qy();Object.defineProperty(it,"isSpanContextValid",{enumerable:!0,get:function(){return Xk.isSpanContextValid}});Object.defineProperty(it,"isValidTraceId",{enumerable:!0,get:function(){return Xk.isValidTraceId}});Object.defineProperty(it,"isValidSpanId",{enumerable:!0,get:function(){return Xk.isValidSpanId}});var Qk=Wy();Object.defineProperty(it,"INVALID_SPANID",{enumerable:!0,get:function(){return Qk.INVALID_SPANID}});Object.defineProperty(it,"INVALID_TRACEID",{enumerable:!0,get:function(){return Qk.INVALID_TRACEID}});Object.defineProperty(it,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return Qk.INVALID_SPAN_CONTEXT}});var GV=oV();Object.defineProperty(it,"context",{enumerable:!0,get:function(){return GV.context}});var WV=aV();Object.defineProperty(it,"diag",{enumerable:!0,get:function(){return WV.diag}});var VV=_V();Object.defineProperty(it,"metrics",{enumerable:!0,get:function(){return VV.metrics}});var qV=DV();Object.defineProperty(it,"propagation",{enumerable:!0,get:function(){return qV.propagation}});var ZV=HV();Object.defineProperty(it,"trace",{enumerable:!0,get:function(){return ZV.trace}});it.default={context:GV.context,diag:WV.diag,metrics:VV.metrics,propagation:qV.propagation,trace:ZV.trace}});var zm=C(function(j9){Object.defineProperty(j9,"__esModule",{value:!0});j9.regexpCode=j9.getEsmExportName=j9.getProperty=j9.safeStringify=j9.stringify=j9.strConcat=j9.addCodeArg=j9.str=j9._=j9.nil=j9._Code=j9.Name=j9.IDENTIFIER=j9._CodeOrName=void 0;class _b{}j9._CodeOrName=_b;j9.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class ju extends _b{constructor(e){super();if(!j9.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}j9.Name=ju;class Co extends _b{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof ju)t[n.str]=(t[n.str]||0)+1;return t},{})}}j9._Code=Co;j9.nil=new Co("");function $9(e,...t){let n=[e[0]],r=0;while(r<t.length)yI(n,t[r]),n.push(e[++r]);return new Co(n)}j9._=$9;var _I=new Co("+");function z9(e,...t){let n=[$m(e[0])],r=0;while(r<t.length)n.push(_I),yI(n,t[r]),n.push(_I,$m(e[++r]));return yWe(n),new Co(n)}j9.str=z9;function yI(e,t){if(t instanceof Co)e.push(...t._items);else if(t instanceof ju)e.push(t);else e.push(EWe(t))}j9.addCodeArg=yI;function yWe(e){let t=1;while(t<e.length-1){if(e[t]===_I){let n=SWe(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function SWe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof ju||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ju))return`"${e}${t.slice(1)}`;return}function bWe(e,t){return t.emptyStr()?e:e.emptyStr()?t:z9`${e}${t}`}j9.strConcat=bWe;function EWe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:$m(Array.isArray(e)?e.join(","):e)}function xWe(e){return new Co($m(e))}j9.stringify=xWe;function $m(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}j9.safeStringify=$m;function vWe(e){return typeof e=="string"&&j9.IDENTIFIER.test(e)?new Co(`.${e}`):$9`[${e}]`}j9.getProperty=vWe;function wWe(e){if(typeof e=="string"&&j9.IDENTIFIER.test(e))return new Co(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}j9.getEsmExportName=wWe;function AWe(e){return new Co(e.toString())}j9.regexpCode=AWe});var xI=C(function(G9){Object.defineProperty(G9,"__esModule",{value:!0});G9.ValueScope=G9.ValueScopeName=G9.Scope=G9.varKinds=G9.UsedValueState=void 0;var dr=zm();class B9 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Sb;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Sb||(G9.UsedValueState=Sb={}));G9.varKinds={const:new dr.Name("const"),let:new dr.Name("let"),var:new dr.Name("var")};class bI{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof dr.Name?e:this.name(e)}name(e){return new dr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}G9.Scope=bI;class EI extends dr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=dr._`.${new dr.Name(t)}[${n}]`}}G9.ValueScopeName=EI;var FWe=dr._`\n`;class K9 extends bI{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?FWe:dr.nil}}get(){return this._scope}name(e){return new EI(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return dr._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=dr.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Sb.Started);let l=t(c);if(l){let u=this.opts.es5?G9.varKinds.var:G9.varKinds.const;o=dr._`${o}${u} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=dr._`${o}${l}${this.opts._n}`;else throw new B9(c);a.set(c,Sb.Completed)})}return o}}G9.ValueScope=K9});var Ie=C(function(pr){Object.defineProperty(pr,"__esModule",{value:!0});pr.or=pr.and=pr.not=pr.CodeGen=pr.operators=pr.varKinds=pr.ValueScopeName=pr.ValueScope=pr.Scope=pr.Name=pr.regexpCode=pr.stringify=pr.getProperty=pr.nil=pr.strConcat=pr.str=pr._=void 0;var He=zm(),ko=xI(),Ui=zm();Object.defineProperty(pr,"_",{enumerable:!0,get:function(){return Ui._}});Object.defineProperty(pr,"str",{enumerable:!0,get:function(){return Ui.str}});Object.defineProperty(pr,"strConcat",{enumerable:!0,get:function(){return Ui.strConcat}});Object.defineProperty(pr,"nil",{enumerable:!0,get:function(){return Ui.nil}});Object.defineProperty(pr,"getProperty",{enumerable:!0,get:function(){return Ui.getProperty}});Object.defineProperty(pr,"stringify",{enumerable:!0,get:function(){return Ui.stringify}});Object.defineProperty(pr,"regexpCode",{enumerable:!0,get:function(){return Ui.regexpCode}});Object.defineProperty(pr,"Name",{enumerable:!0,get:function(){return Ui.Name}});var Ab=xI();Object.defineProperty(pr,"Scope",{enumerable:!0,get:function(){return Ab.Scope}});Object.defineProperty(pr,"ValueScope",{enumerable:!0,get:function(){return Ab.ValueScope}});Object.defineProperty(pr,"ValueScopeName",{enumerable:!0,get:function(){return Ab.ValueScopeName}});Object.defineProperty(pr,"varKinds",{enumerable:!0,get:function(){return Ab.varKinds}});pr.operators={GT:new He._Code(">"),GTE:new He._Code(">="),LT:new He._Code("<"),LTE:new He._Code("<="),EQ:new He._Code("==="),NEQ:new He._Code("!=="),NOT:new He._Code("!"),OR:new He._Code("||"),AND:new He._Code("&&"),ADD:new He._Code("+")};class Fi{optimizeNodes(){return this}optimizeNames(e,t){return this}}class V9 extends Fi{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?ko.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Bu(this.rhs,e,t);return this}get names(){return this.rhs instanceof He._CodeOrName?this.rhs.names:{}}}class AI extends Fi{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof He.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Bu(this.rhs,e,t),this}get names(){let e=this.lhs instanceof He.Name?{}:{...this.lhs.names};return wb(e,this.rhs)}}class q9 extends AI{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Z9 extends Fi{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Y9 extends Fi{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class J9 extends Fi{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class X9 extends Fi{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Bu(this.code,e,t),this}get names(){return this.code instanceof He._CodeOrName?this.code.names:{}}}class Tb extends Fi{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;HWe(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>sc(e,t.names),{})}}class $i extends Tb{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Q9 extends Tb{}class jm extends $i{}jm.kind="else";class Ms extends $i{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new jm(n):n}if(t){if(e===!1)return t instanceof Ms?t:t.nodes;if(this.nodes.length)return this;return new Ms(oY(e),t instanceof Ms?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Bu(this.condition,e,t),this}get names(){let e=super.names;if(wb(e,this.condition),this.else)sc(e,this.else.names);return e}}Ms.kind="if";class Hu extends $i{}Hu.kind="for";class eY extends Hu{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=Bu(this.iteration,e,t),this}get names(){return sc(super.names,this.iteration.names)}}class tY extends Hu{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?ko.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=wb(super.names,this.from);return wb(e,this.to)}}class vI extends Hu{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Bu(this.iterable,e,t),this}get names(){return sc(super.names,this.iterable.names)}}class bb extends $i{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}bb.kind="func";class Eb extends Tb{render(e){return"return "+super.render(e)}}Eb.kind="return";class nY extends $i{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)sc(e,this.catch.names);if(this.finally)sc(e,this.finally.names);return e}}class xb extends $i{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}xb.kind="catch";class vb extends $i{render(e){return"finally"+super.render(e)}}vb.kind="finally";class rY{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
108
+ `:""},this._extScope=e,this._scope=new ko.Scope({parent:e}),this._nodes=[new Q9]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let o=this._scope.toName(t);if(n!==void 0&&r)this._constants[o.str]=n;return this._leafNode(new V9(e,o,n)),o}const(e,t,n){return this._def(ko.varKinds.const,e,t,n)}let(e,t,n){return this._def(ko.varKinds.let,e,t,n)}var(e,t,n){return this._def(ko.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new AI(e,t,n))}add(e,t){return this._leafNode(new q9(e,pr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==He.nil)this._leafNode(new X9(e));return this}object(...e){let t=["{"];for(let[n,r]of e){if(t.length>1)t.push(",");if(t.push(n),n!==r||this.opts.es5)t.push(":"),(0,He.addCodeArg)(t,r)}return t.push("}"),new He._Code(t)}if(e,t,n){if(this._blockNode(new Ms(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ms(e))}else(){return this._elseNode(new jm)}endIf(){return this._endBlockNode(Ms,jm)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new eY(e),t)}forRange(e,t,n,r,o=this.opts.es5?ko.varKinds.var:ko.varKinds.let){let s=this._scope.toName(e);return this._for(new tY(o,s,t,n),()=>r(s))}forOf(e,t,n,r=ko.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof He.Name?t:this.var("_arr",t);return this.forRange("_i",0,He._`${s}.length`,(i)=>{this.var(o,He._`${s}[${i}]`),n(o)})}return this._for(new vI("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?ko.varKinds.var:ko.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,He._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new vI("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Hu)}label(e){return this._leafNode(new Z9(e))}break(e){return this._leafNode(new Y9(e))}return(e){let t=new Eb;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Eb)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new nY;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new xb(o),t(o)}if(n)this._currNode=r.finally=new vb,this.code(n);return this._endBlockNode(xb,vb)}throw(e){return this._leafNode(new J9(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=He.nil,n,r){if(this._blockNode(new bb(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(bb)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Ms))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}pr.CodeGen=rY;function sc(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function wb(e,t){return t instanceof He._CodeOrName?sc(e,t.names):e}function Bu(e,t,n){if(e instanceof He.Name)return r(e);if(!o(e))return e;return new He._Code(e._items.reduce((s,i)=>{if(i instanceof He.Name)i=r(i);if(i instanceof He._Code)s.push(...i._items);else s.push(i);return s},[]));function r(s){let i=n[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function o(s){return s instanceof He._Code&&s._items.some((i)=>i instanceof He.Name&&t[i.str]===1&&n[i.str]!==void 0)}}function HWe(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function oY(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:He._`!${wI(e)}`}pr.not=oY;var BWe=sY(pr.operators.AND);function KWe(...e){return e.reduce(BWe)}pr.and=KWe;var GWe=sY(pr.operators.OR);function WWe(...e){return e.reduce(GWe)}pr.or=WWe;function sY(e){return(t,n)=>t===He.nil?n:n===He.nil?t:He._`${wI(t)} ${e} ${wI(n)}`}function wI(e){return e instanceof He.Name?e:He._`(${e})`}});var We=C(function(mY){Object.defineProperty(mY,"__esModule",{value:!0});mY.checkStrictMode=mY.getErrorPath=mY.Type=mY.useFunc=mY.setEvaluated=mY.evaluatedPropsToName=mY.mergeEvaluated=mY.eachItem=mY.unescapeJsonPointer=mY.escapeJsonPointer=mY.escapeFragment=mY.unescapeFragment=mY.schemaRefOrVal=mY.schemaHasRulesButRef=mY.schemaHasRules=mY.checkUnknownRules=mY.alwaysValidSchema=mY.toHash=void 0;var gt=Ie(),YWe=zm();function JWe(e){let t={};for(let n of e)t[n]=!0;return t}mY.toHash=JWe;function XWe(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return lY(e,t),!uY(t,e.self.RULES.all)}mY.alwaysValidSchema=XWe;function lY(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema)return;if(typeof t==="boolean")return;let o=r.RULES.keywords;for(let s in t)if(!o[s])fY(e,`unknown keyword: "${s}"`)}mY.checkUnknownRules=lY;function uY(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}mY.schemaHasRules=uY;function QWe(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}mY.schemaHasRulesButRef=QWe;function eVe({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return gt._`${n}`}return gt._`${e}${t}${(0,gt.getProperty)(r)}`}mY.schemaRefOrVal=eVe;function tVe(e){return dY(decodeURIComponent(e))}mY.unescapeFragment=tVe;function nVe(e){return encodeURIComponent(CI(e))}mY.escapeFragment=nVe;function CI(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}mY.escapeJsonPointer=CI;function dY(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}mY.unescapeJsonPointer=dY;function rVe(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}mY.eachItem=rVe;function aY({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof gt.Name?(s instanceof gt.Name?e(o,s,i):t(o,s,i),i):s instanceof gt.Name?(t(o,i,s),s):n(s,i);return a===gt.Name&&!(c instanceof gt.Name)?r(o,c):c}}mY.mergeEvaluated={props:aY({mergeNames:(e,t,n)=>e.if(gt._`${n} !== true && ${t} !== undefined`,()=>{e.if(gt._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,gt._`${n} || {}`).code(gt._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(gt._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,gt._`${n} || {}`),kI(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:pY}),items:aY({mergeNames:(e,t,n)=>e.if(gt._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,gt._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(gt._`${n} !== true`,()=>e.assign(n,t===!0?!0:gt._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function pY(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",gt._`{}`);if(t!==void 0)kI(e,n,t);return n}mY.evaluatedPropsToName=pY;function kI(e,t,n){Object.keys(n).forEach((r)=>e.assign(gt._`${t}${(0,gt.getProperty)(r)}`,!0))}mY.setEvaluated=kI;var cY={};function oVe(e,t){return e.scopeValue("func",{ref:t,code:cY[t.code]||(cY[t.code]=new YWe._Code(t.code))})}mY.useFunc=oVe;var TI;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(TI||(mY.Type=TI={}));function sVe(e,t,n){if(e instanceof gt.Name){let r=t===TI.Num;return n?r?gt._`"[" + ${e} + "]"`:gt._`"['" + ${e} + "']"`:r?gt._`"/" + ${e}`:gt._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,gt.getProperty)(e).toString():"/"+CI(e)}mY.getErrorPath=sVe;function fY(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}mY.checkStrictMode=fY});var Us=C(function(gY){Object.defineProperty(gY,"__esModule",{value:!0});var Nn=Ie(),vVe={data:new Nn.Name("data"),valCxt:new Nn.Name("valCxt"),instancePath:new Nn.Name("instancePath"),parentData:new Nn.Name("parentData"),parentDataProperty:new Nn.Name("parentDataProperty"),rootData:new Nn.Name("rootData"),dynamicAnchors:new Nn.Name("dynamicAnchors"),vErrors:new Nn.Name("vErrors"),errors:new Nn.Name("errors"),this:new Nn.Name("this"),self:new Nn.Name("self"),scope:new Nn.Name("scope"),json:new Nn.Name("json"),jsonPos:new Nn.Name("jsonPos"),jsonLen:new Nn.Name("jsonLen"),jsonPart:new Nn.Name("jsonPart")};gY.default=vVe});var Hm=C(function(bY){Object.defineProperty(bY,"__esModule",{value:!0});bY.extendErrors=bY.resetErrorsCount=bY.reportExtraError=bY.reportError=bY.keyword$DataError=bY.keywordError=void 0;var Ve=Ie(),kb=We(),Bn=Us();bY.keywordError={message:({keyword:e})=>Ve.str`must pass "${e}" keyword validation`};bY.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Ve.str`"${e}" keyword must be ${t} ($data)`:Ve.str`"${e}" keyword is invalid ($data)`};function AVe(e,t=bY.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=SY(e,t,n);if(r!==null&&r!==void 0?r:i||a)_Y(s,c);else yY(o,Ve._`[${c}]`)}bY.reportError=AVe;function TVe(e,t=bY.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=SY(e,t,n);if(_Y(o,a),!(s||i))yY(r,Bn.default.vErrors)}bY.reportExtraError=TVe;function CVe(e,t){e.assign(Bn.default.errors,t),e.if(Ve._`${Bn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Ve._`${Bn.default.vErrors}.length`,t),()=>e.assign(Bn.default.vErrors,null)))}bY.resetErrorsCount=CVe;function kVe({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:s}){if(o===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Bn.default.errors,(a)=>{if(e.const(i,Ve._`${Bn.default.vErrors}[${a}]`),e.if(Ve._`${i}.instancePath === undefined`,()=>e.assign(Ve._`${i}.instancePath`,(0,Ve.strConcat)(Bn.default.instancePath,s.errorPath))),e.assign(Ve._`${i}.schemaPath`,Ve.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(Ve._`${i}.schema`,n),e.assign(Ve._`${i}.data`,r)})}bY.extendErrors=kVe;function _Y(e,t){let n=e.const("err",t);e.if(Ve._`${Bn.default.vErrors} === null`,()=>e.assign(Bn.default.vErrors,Ve._`[${n}]`),Ve._`${Bn.default.vErrors}.push(${n})`),e.code(Ve._`${Bn.default.errors}++`)}function yY(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(Ve._`new ${e.ValidationError}(${t})`);else n.assign(Ve._`${r}.errors`,t),n.return(!1)}var ic={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function SY(e,t,n){let{createErrors:r}=e.it;if(r===!1)return Ve._`{}`;return RVe(e,t,n)}function RVe(e,t,n={}){let{gen:r,it:o}=e,s=[OVe(o,n),PVe(e,n)];return IVe(e,t,s),r.object(...s)}function OVe({errorPath:e},{instancePath:t}){let n=t?Ve.str`${e}${(0,kb.getErrorPath)(t,kb.Type.Str)}`:e;return[Bn.default.instancePath,(0,Ve.strConcat)(Bn.default.instancePath,n)]}function PVe({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:Ve.str`${t}/${e}`;if(n)o=Ve.str`${o}${(0,kb.getErrorPath)(n,kb.Type.Str)}`;return[ic.schemaPath,o]}function IVe(e,{params:t,message:n},r){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;if(r.push([ic.keyword,o],[ic.params,typeof t=="function"?t(e):t||Ve._`{}`]),c.messages)r.push([ic.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([ic.schema,i],[ic.parentSchema,Ve._`${u}${d}`],[Bn.default.data,s]);if(l)r.push([ic.propertyName,l])}});var AY=C(function(vY){Object.defineProperty(vY,"__esModule",{value:!0});vY.boolOrEmptySchema=vY.topBoolOrEmptySchema=void 0;var UVe=Hm(),FVe=Ie(),$Ve=Us(),zVe={message:"boolean schema is false"};function jVe(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)xY(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return($Ve.default.data);else t.assign(FVe._`${r}.errors`,null),t.return(!0)}vY.topBoolOrEmptySchema=jVe;function HVe(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),xY(e);else n.var(t,!0)}vY.boolOrEmptySchema=HVe;function xY(e,t){let{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,UVe.reportError)(o,zVe,void 0,t)}});var OI=C(function(TY){Object.defineProperty(TY,"__esModule",{value:!0});TY.getRules=TY.isJSONType=void 0;var KVe=["string","number","integer","boolean","null","object","array"],GVe=new Set(KVe);function WVe(e){return typeof e=="string"&&GVe.has(e)}TY.isJSONType=WVe;function VVe(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}TY.getRules=VVe});var PI=C(function(OY){Object.defineProperty(OY,"__esModule",{value:!0});OY.shouldUseRule=OY.shouldUseGroup=OY.schemaHasRulesForType=void 0;function ZVe({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&kY(e,r)}OY.schemaHasRulesForType=ZVe;function kY(e,t){return t.rules.some((n)=>RY(e,n))}OY.shouldUseGroup=kY;function RY(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some((r)=>e[r]!==void 0))}OY.shouldUseRule=RY});var Bm=C(function(NY){Object.defineProperty(NY,"__esModule",{value:!0});NY.reportTypeError=NY.checkDataTypes=NY.checkDataType=NY.coerceAndCheckDataType=NY.getJSONTypes=NY.getSchemaTypes=NY.DataType=void 0;var XVe=OI(),QVe=PI(),eqe=Hm(),Pe=Ie(),IY=We(),Ku;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ku||(NY.DataType=Ku={}));function tqe(e){let t=DY(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}NY.getSchemaTypes=tqe;function DY(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(XVe.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}NY.getJSONTypes=DY;function nqe(e,t){let{gen:n,data:r,opts:o}=e,s=rqe(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,QVe.schemaHasRulesForType)(e,t[0]));if(i){let a=DI(t,r,o.strictNumbers,Ku.Wrong);n.if(a,()=>{if(s.length)oqe(e,t,s);else LI(e)})}return i}NY.coerceAndCheckDataType=nqe;var LY=new Set(["string","number","integer","boolean","null"]);function rqe(e,t){return t?e.filter((n)=>LY.has(n)||t==="array"&&n==="array"):[]}function oqe(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",Pe._`typeof ${o}`),a=r.let("coerced",Pe._`undefined`);if(s.coerceTypes==="array")r.if(Pe._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,Pe._`${o}[0]`).assign(i,Pe._`typeof ${o}`).if(DI(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(Pe._`${a} !== undefined`);for(let l of n)if(LY.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),LI(e),r.endIf(),r.if(Pe._`${a} !== undefined`,()=>{r.assign(o,a),sqe(e,a)});function c(l){switch(l){case"string":r.elseIf(Pe._`${i} == "number" || ${i} == "boolean"`).assign(a,Pe._`"" + ${o}`).elseIf(Pe._`${o} === null`).assign(a,Pe._`""`);return;case"number":r.elseIf(Pe._`${i} == "boolean" || ${o} === null
109
+ || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,Pe._`+${o}`);return;case"integer":r.elseIf(Pe._`${i} === "boolean" || ${o} === null
110
+ || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,Pe._`+${o}`);return;case"boolean":r.elseIf(Pe._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(Pe._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(Pe._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(Pe._`${i} === "string" || ${i} === "number"
111
+ || ${i} === "boolean" || ${o} === null`).assign(a,Pe._`[${o}]`)}}}function sqe({gen:e,parentData:t,parentDataProperty:n},r){e.if(Pe._`${t} !== undefined`,()=>e.assign(Pe._`${t}[${n}]`,r))}function II(e,t,n,r=Ku.Correct){let o=r===Ku.Correct?Pe.operators.EQ:Pe.operators.NEQ,s;switch(e){case"null":return Pe._`${t} ${o} null`;case"array":s=Pe._`Array.isArray(${t})`;break;case"object":s=Pe._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i(Pe._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return Pe._`typeof ${t} ${o} ${e}`}return r===Ku.Correct?s:(0,Pe.not)(s);function i(a=Pe.nil){return(0,Pe.and)(Pe._`typeof ${t} == "number"`,a,n?Pe._`isFinite(${t})`:Pe.nil)}}NY.checkDataType=II;function DI(e,t,n,r){if(e.length===1)return II(e[0],t,n,r);let o,s=(0,IY.toHash)(e);if(s.array&&s.object){let i=Pe._`typeof ${t} != "object"`;o=s.null?i:Pe._`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else o=Pe.nil;if(s.number)delete s.integer;for(let i in s)o=(0,Pe.and)(o,II(i,t,n,r));return o}NY.checkDataTypes=DI;var iqe={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?Pe._`{type: ${e}}`:Pe._`{type: ${t}}`};function LI(e){let t=aqe(e);(0,eqe.reportError)(t,iqe)}NY.reportTypeError=LI;function aqe(e){let{gen:t,data:n,schema:r}=e,o=(0,IY.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}});var zY=C(function(FY){Object.defineProperty(FY,"__esModule",{value:!0});FY.assignDefaults=void 0;var Gu=Ie(),mqe=We();function hqe(e,t){let{properties:n,items:r}=e.schema;if(t==="object"&&n)for(let o in n)UY(e,o,n[o].default);else if(t==="array"&&Array.isArray(r))r.forEach((o,s)=>UY(e,s,o.default))}FY.assignDefaults=hqe;function UY(e,t,n){let{gen:r,compositeRule:o,data:s,opts:i}=e;if(n===void 0)return;let a=Gu._`${s}${(0,Gu.getProperty)(t)}`;if(o){(0,mqe.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=Gu._`${a} === undefined`;if(i.useDefaults==="empty")c=Gu._`${c} || ${a} === null || ${a} === ""`;r.if(c,Gu._`${a} = ${(0,Gu.stringify)(n)}`)}});var Jr=C(function(BY){Object.defineProperty(BY,"__esModule",{value:!0});BY.validateUnion=BY.validateArray=BY.usePattern=BY.callValidateCode=BY.schemaProperties=BY.allSchemaProperties=BY.noPropertyInData=BY.propertyInData=BY.isOwnProperty=BY.hasPropFunc=BY.reportMissingProp=BY.checkMissingProp=BY.checkReportMissingProp=void 0;var At=Ie(),NI=We(),zi=Us(),gqe=We();function _qe(e,t){let{gen:n,data:r,it:o}=e;n.if(UI(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:At._`${t}`},!0),e.error()})}BY.checkReportMissingProp=_qe;function yqe({gen:e,data:t,it:{opts:n}},r,o){return(0,At.or)(...r.map((s)=>(0,At.and)(UI(e,t,s,n.ownProperties),At._`${o} = ${s}`)))}BY.checkMissingProp=yqe;function Sqe(e,t){e.setParams({missingProperty:t},!0),e.error()}BY.reportMissingProp=Sqe;function jY(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:At._`Object.prototype.hasOwnProperty`})}BY.hasPropFunc=jY;function MI(e,t,n){return At._`${jY(e)}.call(${t}, ${n})`}BY.isOwnProperty=MI;function bqe(e,t,n,r){let o=At._`${t}${(0,At.getProperty)(n)} !== undefined`;return r?At._`${o} && ${MI(e,t,n)}`:o}BY.propertyInData=bqe;function UI(e,t,n,r){let o=At._`${t}${(0,At.getProperty)(n)} === undefined`;return r?(0,At.or)(o,(0,At.not)(MI(e,t,n))):o}BY.noPropertyInData=UI;function HY(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}BY.allSchemaProperties=HY;function Eqe(e,t){return HY(t).filter((n)=>!(0,NI.alwaysValidSchema)(e,t[n]))}BY.schemaProperties=Eqe;function xqe({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:s},it:i},a,c,l){let u=l?At._`${e}, ${t}, ${r}${o}`:t,d=[[zi.default.instancePath,(0,At.strConcat)(zi.default.instancePath,s)],[zi.default.parentData,i.parentData],[zi.default.parentDataProperty,i.parentDataProperty],[zi.default.rootData,zi.default.rootData]];if(i.opts.dynamicRef)d.push([zi.default.dynamicAnchors,zi.default.dynamicAnchors]);let f=At._`${u}, ${n.object(...d)}`;return c!==At.nil?At._`${a}.call(${c}, ${f})`:At._`${a}(${f})`}BY.callValidateCode=xqe;var vqe=At._`new RegExp`;function wqe({gen:e,it:{opts:t}},n){let r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,s=o(n,r);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:At._`${o.code==="new RegExp"?vqe:(0,gqe.useFunc)(e,o)}(${n}, ${r})`})}BY.usePattern=wqe;function Aqe(e){let{gen:t,data:n,keyword:r,it:o}=e,s=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){let c=t.const("len",At._`${n}.length`);t.forRange("i",0,c,(l)=>{e.subschema({keyword:r,dataProp:l,dataPropType:NI.Type.Num},s),t.if((0,At.not)(s),a)})}}BY.validateArray=Aqe;function Tqe(e){let{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(n.some((c)=>(0,NI.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((c,l)=>{let u=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);if(t.assign(i,At._`${i} || ${a}`),!e.mergeValidEvaluated(u,a))t.if((0,At.not)(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}BY.validateUnion=Tqe});var ZY=C(function(VY){Object.defineProperty(VY,"__esModule",{value:!0});VY.validateKeywordUsage=VY.validSchemaType=VY.funcKeywordCode=VY.macroKeywordCode=void 0;var Kn=Ie(),ac=Us(),$qe=Jr(),zqe=Hm();function jqe(e,t){let{gen:n,keyword:r,schema:o,parentSchema:s,it:i}=e,a=t.macro.call(i.self,o,s,i),c=WY(n,r,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let l=n.name("valid");e.subschema({schema:a,schemaPath:Kn.nil,errSchemaPath:`${i.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}VY.macroKeywordCode=jqe;function Hqe(e,t){var n;let{gen:r,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=e;Kqe(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,i,c):t.validate,u=WY(r,o,l),d=r.let("valid");e.block$data(d,f),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function f(){if(t.errors===!1){if(_(),t.modifying)GY(e);y(()=>e.error())}else{let b=t.async?m():h();if(t.modifying)GY(e);y(()=>Bqe(e,b))}}function m(){let b=r.let("ruleErrs",null);return r.try(()=>_(Kn._`await `),(v)=>r.assign(d,!1).if(Kn._`${v} instanceof ${c.ValidationError}`,()=>r.assign(b,Kn._`${v}.errors`),()=>r.throw(v))),b}function h(){let b=Kn._`${u}.errors`;return r.assign(b,null),_(Kn.nil),b}function _(b=t.async?Kn._`await `:Kn.nil){let v=c.opts.passContext?ac.default.this:ac.default.self,S=!(("compile"in t)&&!a||t.schema===!1);r.assign(d,Kn._`${b}${(0,$qe.callValidateCode)(e,u,v,S)}`,t.modifying)}function y(b){var v;r.if((0,Kn.not)((v=t.valid)!==null&&v!==void 0?v:d),b)}}VY.funcKeywordCode=Hqe;function GY(e){let{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,Kn._`${r.parentData}[${r.parentDataProperty}]`))}function Bqe(e,t){let{gen:n}=e;n.if(Kn._`Array.isArray(${t})`,()=>{n.assign(ac.default.vErrors,Kn._`${ac.default.vErrors} === null ? ${t} : ${ac.default.vErrors}.concat(${t})`).assign(ac.default.errors,Kn._`${ac.default.vErrors}.length`),(0,zqe.extendErrors)(e)},()=>e.error())}function Kqe({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function WY(e,t,n){if(n===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Kn.stringify)(n)})}function Gqe(e,t,n=!1){return!t.length||t.some((r)=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}VY.validSchemaType=Gqe;function Wqe({schema:e,opts:t,self:n,errSchemaPath:r},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw Error("ajv implementation error");let i=o.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(c);else throw Error(c)}}}VY.validateKeywordUsage=Wqe});var QY=C(function(JY){Object.defineProperty(JY,"__esModule",{value:!0});JY.extendSubschemaMode=JY.extendSubschemaData=JY.getSubschema=void 0;var ts=Ie(),YY=We();function Yqe(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(t!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return n===void 0?{schema:a,schemaPath:ts._`${e.schemaPath}${(0,ts.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:ts._`${e.schemaPath}${(0,ts.getProperty)(t)}${(0,ts.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,YY.escapeFragment)(n)}`}}if(r!==void 0){if(o===void 0||s===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}JY.getSubschema=Yqe;function Jqe(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&n!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,f=a.let("data",ts._`${t.data}${(0,ts.getProperty)(n)}`,!0);c(f),e.errorPath=ts.str`${l}${(0,YY.getErrorPath)(n,r,d.jsPropertySyntax)}`,e.parentDataProperty=ts._`${n}`,e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let l=o instanceof ts.Name?o:a.let("data",o,!0);if(c(l),i!==void 0)e.propertyName=i}if(s)e.dataTypes=s;function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}JY.extendSubschemaData=Jqe;function Xqe(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:s}){if(r!==void 0)e.compositeRule=r;if(o!==void 0)e.createErrors=o;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=n}JY.extendSubschemaMode=Xqe});var FI=C(function(O1t,eJ){eJ.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}});var nJ=C(function(P1t,tJ){var ji=tJ.exports=function(e,t,n){if(typeof t=="function")n=t,t={};n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};Rb(t,r,o,e,"",e)};ji.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ji.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ji.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ji.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Rb(e,t,n,r,o,s,i,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,s,i,a,c,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in ji.arrayKeywords)for(var f=0;f<d.length;f++)Rb(e,t,n,d[f],o+"/"+u+"/"+f,s,o,u,r,f)}else if(u in ji.propsKeywords){if(d&&typeof d=="object")for(var m in d)Rb(e,t,n,d[m],o+"/"+u+"/"+t4e(m),s,o,u,r,m)}else if(u in ji.keywords||e.allKeys&&!(u in ji.skipKeywords))Rb(e,t,n,d,o+"/"+u,s,o,u,r)}n(r,o,s,i,a,c,l)}}function t4e(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Km=C(function(iJ){Object.defineProperty(iJ,"__esModule",{value:!0});iJ.getSchemaRefs=iJ.resolveUrl=iJ.normalizeId=iJ._getFullPath=iJ.getFullPath=iJ.inlineRef=void 0;var n4e=We(),r4e=FI(),o4e=nJ(),s4e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i4e(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!$I(e);if(!t)return!1;return rJ(e)<=t}iJ.inlineRef=i4e;var a4e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $I(e){for(let t in e){if(a4e.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some($I))return!0;if(typeof n=="object"&&$I(n))return!0}return!1}function rJ(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,s4e.has(n))continue;if(typeof e[n]=="object")(0,n4e.eachItem)(e[n],(r)=>t+=rJ(r));if(t===1/0)return 1/0}return t}function oJ(e,t="",n){if(n!==!1)t=Wu(t);let r=e.parse(t);return sJ(e,r)}iJ.getFullPath=oJ;function sJ(e,t){return e.serialize(t).split("#")[0]+"#"}iJ._getFullPath=sJ;var c4e=/#\/?$/;function Wu(e){return e?e.replace(c4e,""):""}iJ.normalizeId=Wu;function l4e(e,t,n){return n=Wu(n),e.resolve(t,n)}iJ.resolveUrl=l4e;var u4e=/^[a-z_][-a-z0-9._]*$/i;function d4e(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,o=Wu(e[n]||t),s={"":o},i=oJ(r,o,!1),a={},c=new Set;return o4e(e,{allKeys:!0},(d,f,m,h)=>{if(h===void 0)return;let _=i+f,y=s[h];if(typeof d[n]=="string")y=b.call(this,d[n]);v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),s[f]=y;function b(S){let x=this.opts.uriResolver.resolve;if(S=Wu(y?x(y,S):S),c.has(S))throw u(S);c.add(S);let w=this.refs[S];if(typeof w=="string")w=this.refs[w];if(typeof w=="object")l(d,w.schema,S);else if(S!==Wu(_))if(S[0]==="#")l(d,a[S],S),a[S]=d;else this.refs[S]=_;return S}function v(S){if(typeof S=="string"){if(!u4e.test(S))throw Error(`invalid anchor "${S}"`);b.call(this,`#${S}`)}}}),a;function l(d,f,m){if(f!==void 0&&!r4e(d,f))throw u(m)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}iJ.getSchemaRefs=d4e});var Vm=C(function(xJ){Object.defineProperty(xJ,"__esModule",{value:!0});xJ.getData=xJ.KeywordCxt=xJ.validateFunctionCode=void 0;var pJ=AY(),cJ=Bm(),jI=PI(),Ob=Bm(),_4e=zY(),Wm=ZY(),zI=QY(),pe=Ie(),be=Us(),y4e=Km(),Fs=We(),Gm=Hm();function S4e(e){if(hJ(e)){if(gJ(e),mJ(e)){x4e(e);return}}fJ(e,()=>(0,pJ.topBoolOrEmptySchema)(e))}xJ.validateFunctionCode=S4e;function fJ({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},s){if(o.code.es5)e.func(t,pe._`${be.default.data}, ${be.default.valCxt}`,r.$async,()=>{e.code(pe._`"use strict"; ${lJ(n,o)}`),E4e(e,o),e.code(s)});else e.func(t,pe._`${be.default.data}, ${b4e(o)}`,r.$async,()=>e.code(lJ(n,o)).code(s))}function b4e(e){return pe._`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${e.dynamicRef?pe._`, ${be.default.dynamicAnchors}={}`:pe.nil}}={}`}function E4e(e,t){e.if(be.default.valCxt,()=>{if(e.var(be.default.instancePath,pe._`${be.default.valCxt}.${be.default.instancePath}`),e.var(be.default.parentData,pe._`${be.default.valCxt}.${be.default.parentData}`),e.var(be.default.parentDataProperty,pe._`${be.default.valCxt}.${be.default.parentDataProperty}`),e.var(be.default.rootData,pe._`${be.default.valCxt}.${be.default.rootData}`),t.dynamicRef)e.var(be.default.dynamicAnchors,pe._`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{if(e.var(be.default.instancePath,pe._`""`),e.var(be.default.parentData,pe._`undefined`),e.var(be.default.parentDataProperty,pe._`undefined`),e.var(be.default.rootData,be.default.data),t.dynamicRef)e.var(be.default.dynamicAnchors,pe._`{}`)})}function x4e(e){let{schema:t,opts:n,gen:r}=e;fJ(e,()=>{if(n.$comment&&t.$comment)yJ(e);if(C4e(e),r.let(be.default.vErrors,null),r.let(be.default.errors,0),n.unevaluated)v4e(e);_J(e),O4e(e)});return}function v4e(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",pe._`${n}.evaluated`),t.if(pe._`${e.evaluated}.dynamicProps`,()=>t.assign(pe._`${e.evaluated}.props`,pe._`undefined`)),t.if(pe._`${e.evaluated}.dynamicItems`,()=>t.assign(pe._`${e.evaluated}.items`,pe._`undefined`))}function lJ(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?pe._`/*# sourceURL=${n} */`:pe.nil}function w4e(e,t){if(hJ(e)){if(gJ(e),mJ(e)){A4e(e,t);return}}(0,pJ.boolOrEmptySchema)(e,t)}function mJ({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function hJ(e){return typeof e.schema!="boolean"}function A4e(e,t){let{schema:n,gen:r,opts:o}=e;if(o.$comment&&n.$comment)yJ(e);k4e(e),R4e(e);let s=r.const("_errs",be.default.errors);_J(e,s),r.var(t,pe._`${s} === ${be.default.errors}`)}function gJ(e){(0,Fs.checkUnknownRules)(e),T4e(e)}function _J(e,t){if(e.opts.jtd)return uJ(e,[],!1,t);let n=(0,cJ.getSchemaTypes)(e.schema),r=(0,cJ.coerceAndCheckDataType)(e,n);uJ(e,n,!r,t)}function T4e(e){let{schema:t,errSchemaPath:n,opts:r,self:o}=e;if(t.$ref&&r.ignoreKeywordsWithRef&&(0,Fs.schemaHasRulesButRef)(t,o.RULES))o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function C4e(e){let{schema:t,opts:n}=e;if(t.default!==void 0&&n.useDefaults&&n.strictSchema)(0,Fs.checkStrictMode)(e,"default is ignored in the schema root")}function k4e(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,y4e.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function R4e(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function yJ({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){let s=n.$comment;if(o.$comment===!0)e.code(pe._`${be.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=pe.str`${r}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(pe._`${be.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function O4e(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:s}=e;if(n.$async)t.if(pe._`${be.default.errors} === 0`,()=>t.return(be.default.data),()=>t.throw(pe._`new ${o}(${be.default.vErrors})`));else{if(t.assign(pe._`${r}.errors`,be.default.vErrors),s.unevaluated)P4e(e);t.return(pe._`${be.default.errors} === 0`)}}function P4e({gen:e,evaluated:t,props:n,items:r}){if(n instanceof pe.Name)e.assign(pe._`${t}.props`,n);if(r instanceof pe.Name)e.assign(pe._`${t}.items`,r)}function uJ(e,t,n,r){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Fs.schemaHasRulesButRef)(s,u))){o.block(()=>bJ(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)I4e(e,t);o.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){if(!(0,jI.shouldUseGroup)(s,f))return;if(f.type){if(o.if((0,Ob.checkDataType)(f.type,i,c.strictNumbers)),dJ(e,f),t.length===1&&t[0]===f.type&&n)o.else(),(0,Ob.reportTypeError)(e);o.endIf()}else dJ(e,f);if(!a)o.if(pe._`${be.default.errors} === ${r||0}`)}}function dJ(e,t){let{gen:n,schema:r,opts:{useDefaults:o}}=e;if(o)(0,_4e.assignDefaults)(e,t.type);n.block(()=>{for(let s of t.rules)if((0,jI.shouldUseRule)(r,s))bJ(e,s.keyword,s.definition,t.type)})}function I4e(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(D4e(e,t),!e.opts.allowUnionTypes)L4e(e,t);N4e(e,e.dataTypes)}function D4e(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((n)=>{if(!SJ(e.dataTypes,n))HI(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),U4e(e,t)}function L4e(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))HI(e,"use allowUnionTypes to allow union type keyword")}function N4e(e,t){let n=e.self.RULES.all;for(let r in n){let o=n[r];if(typeof o=="object"&&(0,jI.shouldUseRule)(e.schema,o)){let{type:s}=o.definition;if(s.length&&!s.some((i)=>M4e(t,i)))HI(e,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function M4e(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function SJ(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function U4e(e,t){let n=[];for(let r of e.dataTypes)if(SJ(t,r))n.push(r);else if(t.includes("integer")&&r==="number")n.push("integer");e.dataTypes=n}function HI(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Fs.checkStrictMode)(e,t,e.opts.strictTypes)}class BI{constructor(e,t,n){if((0,Wm.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Fs.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",EJ(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Wm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",be.default.errors)}result(e,t,n){this.failResult((0,pe.not)(e),t,n)}failResult(e,t,n){if(this.gen.if(e),n)n();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,pe.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(pe._`${t} !== undefined && (${(0,pe.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?Gm.reportExtraError:Gm.reportError)(this,this.def.error,t)}$dataError(){(0,Gm.reportError)(this,this.def.$dataError||Gm.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Gm.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,n=pe.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=pe.nil,t=pe.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:o,def:s}=this;if(n.if((0,pe.or)(pe._`${r} === undefined`,t)),e!==pe.nil)n.assign(e,!0);if(o.length||s.validateSchema){if(n.elseIf(this.invalid$data()),this.$dataError(),e!==pe.nil)n.assign(e,!1)}n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,pe.or)(s(),i());function s(){if(n.length){if(!(t instanceof pe.Name))throw Error("ajv implementation error");let a=Array.isArray(n)?n:[n];return pe._`${(0,Ob.checkDataTypes)(a,t,o.opts.strictNumbers,Ob.DataType.Wrong)}`}return pe.nil}function i(){if(r.validateSchema){let a=e.scopeValue("validate$data",{ref:r.validateSchema});return pe._`!${a}(${t})`}return pe.nil}}subschema(e,t){let n=(0,zI.getSubschema)(this.it,e);(0,zI.extendSubschemaData)(n,this.it,e),(0,zI.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return w4e(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;if(!n.opts.unevaluated)return;if(n.props!==!0&&e.props!==void 0)n.props=Fs.mergeEvaluated.props(r,e.props,n.props,t);if(n.items!==!0&&e.items!==void 0)n.items=Fs.mergeEvaluated.items(r,e.items,n.items,t)}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,pe.Name)),!0}}xJ.KeywordCxt=BI;function bJ(e,t,n,r){let o=new BI(e,n,t);if("code"in n)n.code(o,r);else if(o.$data&&n.validate)(0,Wm.funcKeywordCode)(o,n);else if("macro"in n)(0,Wm.macroKeywordCode)(o,n);else if(n.compile||n.validate)(0,Wm.funcKeywordCode)(o,n)}var F4e=/^\/(?:[^~]|~0|~1)*$/,$4e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function EJ(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,s;if(e==="")return be.default.rootData;if(e[0]==="/"){if(!F4e.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,s=be.default.rootData}else{let l=$4e.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(o=l[2],o==="#"){if(u>=t)throw Error(c("property/index",u));return r[t-u]}if(u>t)throw Error(c("data",u));if(s=n[t-u],!o)return s}let i=s,a=o.split("/");for(let l of a)if(l)s=pe._`${s}${(0,pe.getProperty)((0,Fs.unescapeJsonPointer)(l))}`,i=pe._`${i} && ${s}`;return i;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}xJ.getData=EJ});var Pb=C(function(AJ){Object.defineProperty(AJ,"__esModule",{value:!0});class wJ extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}AJ.default=wJ});var qm=C(function(CJ){Object.defineProperty(CJ,"__esModule",{value:!0});var KI=Km();class TJ extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`);this.missingRef=(0,KI.resolveUrl)(e,t,n),this.missingSchema=(0,KI.normalizeId)((0,KI.getFullPath)(e,this.missingRef))}}CJ.default=TJ});var Db=C(function(OJ){Object.defineProperty(OJ,"__esModule",{value:!0});OJ.resolveSchema=OJ.getCompilingSchema=OJ.resolveRef=OJ.compileSchema=OJ.SchemaEnv=void 0;var Ro=Ie(),K4e=Pb(),cc=Us(),Oo=Km(),kJ=We(),G4e=Vm();class Zm{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;if(typeof e.schema=="object")n=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Oo.normalizeId)(n===null||n===void 0?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n===null||n===void 0?void 0:n.$async,this.refs={}}}OJ.SchemaEnv=Zm;function WI(e){let t=RJ.call(this,e);if(t)return t;let n=(0,Oo.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new Ro.CodeGen(this.scope,{es5:r,lines:o,ownProperties:s}),a;if(e.$async)a=i.scopeValue("Error",{ref:K4e.default,code:Ro._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let l={gen:i,allErrors:this.opts.allErrors,data:cc.default.data,parentData:cc.default.parentData,parentDataProperty:cc.default.parentDataProperty,dataNames:[cc.default.data],dataPathArr:[Ro.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ro.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:Ro.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Ro._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,G4e.validateFunctionCode)(l),i.optimize(this.opts.code.optimize);let d=i.toString();if(u=`${i.scopeRefs(cc.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let m=Function(`${cc.default.self}`,`${cc.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async)m.$async=!0;if(this.opts.code.source===!0)m.source={validateName:c,validateCode:d,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:_}=l;if(m.evaluated={props:h instanceof Ro.Name?void 0:h,items:_ instanceof Ro.Name?void 0:_,dynamicProps:h instanceof Ro.Name,dynamicItems:_ instanceof Ro.Name},m.source)m.source.evaluated=(0,Ro.stringify)(m.evaluated)}return e.validate=m,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}OJ.compileSchema=WI;function W4e(e,t,n){var r;n=(0,Oo.resolveUrl)(this.opts.uriResolver,t,n);let o=e.refs[n];if(o)return o;let s=Z4e.call(this,e,n);if(s===void 0){let i=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;if(i)s=new Zm({schema:i,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[n]=V4e.call(this,s)}OJ.resolveRef=W4e;function V4e(e){if((0,Oo.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:WI.call(this,e)}function RJ(e){for(let t of this._compilations)if(q4e(t,e))return t}OJ.getCompilingSchema=RJ;function q4e(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Z4e(e,t){let n;while(typeof(n=this.refs[t])=="string")t=n;return n||this.schemas[t]||Ib.call(this,e,t)}function Ib(e,t){let n=this.opts.uriResolver.parse(t),r=(0,Oo._getFullPath)(this.opts.uriResolver,n),o=(0,Oo.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return GI.call(this,n,e);let s=(0,Oo.normalizeId)(r),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=Ib.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return GI.call(this,n,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)WI.call(this,i);if(s===(0,Oo.normalizeId)(t)){let{schema:a}=i,{schemaId:c}=this.opts,l=a[c];if(l)o=(0,Oo.resolveUrl)(this.opts.uriResolver,o,l);return new Zm({schema:a,schemaId:c,root:e,baseId:o})}return GI.call(this,n,i)}OJ.resolveSchema=Ib;var Y4e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function GI(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof n==="boolean")return;let c=n[(0,kJ.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n==="object"&&n[this.opts.schemaId];if(!Y4e.has(a)&&l)t=(0,Oo.resolveUrl)(this.opts.uriResolver,t,l)}let s;if(typeof n!="boolean"&&n.$ref&&!(0,kJ.schemaHasRulesButRef)(n,this.RULES)){let a=(0,Oo.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=Ib.call(this,r,a)}let{schemaId:i}=this.opts;if(s=s||new Zm({schema:n,schemaId:i,root:r,baseId:t}),s.schema!==s.root.schema)return s;return}});var IJ=C(function(U1t,t6e){t6e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ZI=C(function(F1t,FJ){var n6e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),LJ=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),VI=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),NJ=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),r6e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function qI(e){let t="",n=0,r=0;for(r=0;r<e.length;r++){if(n=e[r].charCodeAt(0),n===48)continue;if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}var o6e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function DJ(e){return e.length=0,!0}function s6e(e,t,n){if(e.length){let r=qI(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function i6e(e){let t=0,n={error:!1,address:"",zone:""},r=[],o=[],s=!1,i=!1,a=s6e;for(let c=0;c<e.length;c++){let l=e[c];if(l==="["||l==="]")continue;if(l===":"){if(s===!0)i=!0;if(!a(o,r,n))break;if(++t>7){n.error=!0;break}if(c>0&&e[c-1]===":")s=!0;r.push(":");continue}else if(l==="%"){if(!a(o,r,n))break;a=DJ}else{o.push(l);continue}}if(o.length)if(a===DJ)n.zone=o.join("");else if(i)r.push(o.join(""));else r.push(qI(o));return n.address=r.join(""),n}function MJ(e){if(a6e(e,":")<2)return{host:e,isIPV6:!1};let t=i6e(e);if(!t.error){let{address:n,address:r}=t;if(t.zone)n+="%"+t.zone,r+="%25"+t.zone;return{host:n,isIPV6:!0,escapedHost:r}}else return{host:e,isIPV6:!1}}function a6e(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t)n++;return n}function c6e(e){let t=e,n=[],r=-1,o=0;while(o=t.length){if(o===1)if(t===".")break;else if(t==="/"){n.push("/");break}else{n.push(t);break}else if(o===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){n.push("/");break}}}else if(o===3){if(t==="/.."){if(n.length!==0)n.pop();n.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),n.length!==0)n.pop();continue}}}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}var l6e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},u6e=/[@/?#:]/g,d6e=/[@/?#]/g;function UJ(e,t){let n=t?d6e:u6e;return n.lastIndex=0,e.replace(n,(r)=>l6e[r])}function p6e(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(VI(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));if(t&&NJ(i))n+=i;else n+="%"+s;r+=2;continue}}n+=e[r]}return n}function f6e(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(VI(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));if(s!=="."&&NJ(s))t+=s;else t+="%"+o;n+=2;continue}}if(r6e(e[n]))t+=e[n];else t+=escape(e[n])}return t}function m6e(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(VI(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function h6e(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let n=unescape(e.host);if(!LJ(n)){let r=MJ(n);if(r.isIPV6===!0)n=`[${r.escapedHost}]`;else n=UJ(n,!1)}t.push(n)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}FJ.exports={nonSimpleDomain:o6e,recomposeAuthority:h6e,reescapeHostDelimiters:UJ,normalizePercentEncoding:p6e,normalizePathEncoding:f6e,escapePreservingEscapes:m6e,removeDotSegments:c6e,isIPv4:LJ,isUUID:n6e,normalizeIPv6:MJ,stringArrayToHexStripped:qI}});var BJ=C(function($1t,HJ){var{isUUID:g6e}=ZI(),_6e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,y6e=["http","https","ws","wss","urn","urn:uuid"];function S6e(e){return y6e.indexOf(e)!==-1}function YI(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function $J(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function zJ(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function b6e(e){return e.secure=YI(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function E6e(e){if(e.port===(YI(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function x6e(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(_6e);if(n){let r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let o=`${r}:${t.nid||e.nid}`,s=JI(o);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function v6e(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,s=JI(o);if(s)e=s.serialize(e,t);let i=e,a=e.nss;return i.path=`${r||t.nid}:${a}`,t.skipEscape=!0,i}function w6e(e,t){let n=e;if(n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!g6e(n.uuid)))n.error=n.error||"UUID is not valid.";return n}function A6e(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var jJ={scheme:"http",domainHost:!0,parse:$J,serialize:zJ},T6e={scheme:"https",domainHost:jJ.domainHost,parse:$J,serialize:zJ},Lb={scheme:"ws",domainHost:!0,parse:b6e,serialize:E6e},C6e={scheme:"wss",domainHost:Lb.domainHost,parse:Lb.parse,serialize:Lb.serialize},k6e={scheme:"urn",parse:x6e,serialize:v6e,skipNormalize:!0},R6e={scheme:"urn:uuid",parse:w6e,serialize:A6e,skipNormalize:!0},Nb={http:jJ,https:T6e,ws:Lb,wss:C6e,urn:k6e,"urn:uuid":R6e};Object.setPrototypeOf(Nb,null);function JI(e){return e&&(Nb[e]||Nb[e.toLowerCase()])||void 0}HJ.exports={wsIsSecure:YI,SCHEMES:Nb,isValidSchemeName:S6e,getSchemeHandler:JI}});var ZJ=C(function(z1t,Mb){var{normalizeIPv6:O6e,removeDotSegments:Ym,recomposeAuthority:P6e,normalizePercentEncoding:I6e,normalizePathEncoding:D6e,escapePreservingEscapes:L6e,reescapeHostDelimiters:N6e,isIPv4:M6e,nonSimpleDomain:U6e}=ZI(),{SCHEMES:F6e,getSchemeHandler:GJ}=BJ();function $6e(e,t){if(typeof e==="string")e=K6e(e,t);else if(typeof e==="object")e=Vu(lc(e,t),t);return e}function z6e(e,t,n){let r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=WJ(Vu(e,r),Vu(t,r),r,!0);return r.skipEscape=!0,lc(o,r)}function WJ(e,t,n,r){let o={};if(!r)e=Vu(lc(e,n),n),t=Vu(lc(t,n),n);if(n=n||{},!n.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Ym(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Ym(t.path||""),o.query=t.query;else{if(!t.path)if(o.path=e.path,t.query!==void 0)o.query=t.query;else o.query=e.query;else{if(t.path[0]==="/")o.path=Ym(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)o.path="/"+t.path;else if(!e.path)o.path=t.path;else o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;o.path=Ym(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function j6e(e,t,n){let r=KJ(e,n),o=KJ(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function lc(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],s=GJ(r.scheme||n.scheme);if(s&&s.serialize)s.serialize(n,r);if(n.path!==void 0)if(!r.skipEscape){if(n.path=L6e(n.path),n.scheme!==void 0)n.path=n.path.split("%3A").join(":")}else n.path=I6e(n.path);if(r.reference!=="suffix"&&n.scheme)o.push(n.scheme,":");let i=P6e(n);if(i!==void 0){if(r.reference!=="suffix")o.push("//");if(o.push(i),n.path&&n.path[0]!=="/")o.push("/")}if(n.path!==void 0){let a=n.path;if(!r.absolutePath&&(!s||!s.absolutePath))a=Ym(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);o.push(a)}if(n.query!==void 0)o.push("?",n.query);if(n.fragment!==void 0)o.push("#",n.fragment);return o.join("")}var H6e=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function B6e(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function VJ(e,t){let n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;if(n.reference==="suffix")if(n.scheme)e=n.scheme+":"+e;else e="//"+e;let i=e.match(H6e);if(i){if(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port))r.port=i[5];let a=B6e(r,i);if(a!==void 0)r.error=r.error||a,o=!0;if(r.host)if(M6e(r.host)===!1){let u=O6e(r.host);r.host=u.host.toLowerCase(),s=u.isIPV6}else s=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(n.reference&&n.reference!=="suffix"&&n.reference!==r.reference)r.error=r.error||"URI is not a "+n.reference+" reference.";let c=GJ(n.scheme||r.scheme);if(!n.unicodeSupport&&(!c||!c.unicodeSupport)){if(r.host&&(n.domainHost||c&&c.domainHost)&&s===!1&&U6e(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(l){r.error=r.error||"Host's domain name can not be converted to ASCII: "+l}}if(!c||c&&!c.skipNormalize){if(e.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=N6e(unescape(r.host),s)}if(r.path)r.path=D6e(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(c&&c.parse)c.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function Vu(e,t){return VJ(e,t).parsed}function K6e(e,t){return qJ(e,t).normalized}function qJ(e,t){let{parsed:n,malformedAuthorityOrPort:r}=VJ(e,t);return{normalized:r?e:lc(n,t),malformedAuthorityOrPort:r}}function KJ(e,t){if(typeof e==="string"){let{normalized:n,malformedAuthorityOrPort:r}=qJ(e,t);return r?void 0:n}if(typeof e==="object")return lc(e,t)}var XI={SCHEMES:F6e,normalize:$6e,resolve:z6e,resolveComponent:WJ,equal:j6e,serialize:lc,parse:Vu};Mb.exports=XI;Mb.exports.default=XI;Mb.exports.fastUri=XI});var XJ=C(function(JJ){Object.defineProperty(JJ,"__esModule",{value:!0});var YJ=ZJ();YJ.code='require("ajv/dist/runtime/uri").default';JJ.default=YJ});var i5=C(function($s){Object.defineProperty($s,"__esModule",{value:!0});$s.CodeGen=$s.Name=$s.nil=$s.stringify=$s.str=$s._=$s.KeywordCxt=void 0;var W6e=Vm();Object.defineProperty($s,"KeywordCxt",{enumerable:!0,get:function(){return W6e.KeywordCxt}});var qu=Ie();Object.defineProperty($s,"_",{enumerable:!0,get:function(){return qu._}});Object.defineProperty($s,"str",{enumerable:!0,get:function(){return qu.str}});Object.defineProperty($s,"stringify",{enumerable:!0,get:function(){return qu.stringify}});Object.defineProperty($s,"nil",{enumerable:!0,get:function(){return qu.nil}});Object.defineProperty($s,"Name",{enumerable:!0,get:function(){return qu.Name}});Object.defineProperty($s,"CodeGen",{enumerable:!0,get:function(){return qu.CodeGen}});var V6e=Pb(),r5=qm(),q6e=OI(),Jm=Db(),Z6e=Ie(),Xm=Km(),Ub=Bm(),eD=We(),QJ=IJ(),Y6e=XJ(),o5=(e,t)=>new RegExp(e,t);o5.code="new RegExp";var J6e=["removeAdditional","useDefaults","coerceTypes"],X6e=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Q6e={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},e3e={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},e5=200;function t3e(e){var t,n,r,o,s,i,a,c,l,u,d,f,m,h,_,y,b,v,S,x,w,D,P,F,z;let q=e.strict,ee=(t=e.code)===null||t===void 0?void 0:t.optimize,te=ee===!0||ee===void 0?1:ee||0,xe=(r=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:o5,Q=(o=e.uriResolver)!==null&&o!==void 0?o:Y6e.default;return{strictSchema:(i=(s=e.strictSchema)!==null&&s!==void 0?s:q)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:q)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:q)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:q)!==null&&f!==void 0?f:"log",strictRequired:(h=(m=e.strictRequired)!==null&&m!==void 0?m:q)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:te,regExp:xe}:{optimize:te,regExp:xe},loopRequired:(_=e.loopRequired)!==null&&_!==void 0?_:e5,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:e5,meta:(b=e.meta)!==null&&b!==void 0?b:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(x=e.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(D=e.validateSchema)!==null&&D!==void 0?D:!0,validateFormats:(P=e.validateFormats)!==null&&P!==void 0?P:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(z=e.int32range)!==null&&z!==void 0?z:!0,uriResolver:Q}}class Fb{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...t3e(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new Z6e.ValueScope({scope:{},prefixes:X6e,es5:t,lines:n}),this.logger=a3e(e.logger);let r=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,q6e.getRules)(),t5.call(this,Q6e,e,"NOT SUPPORTED"),t5.call(this,e3e,e,"DEPRECATED","warn"),this._metaOpts=s3e.call(this),e.formats)r3e.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)o3e.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);n3e.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=QJ;if(n==="id")r={...QJ},r.id=r.$id,delete r.$id;if(t&&e)this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);if(!("$async"in n))this.errors=n.errors;return r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(l,u){await o.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||s.call(this,d)}async function o(l){if(l&&!this.getSchema(l))await r.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof r5.default))throw u;return i.call(this,u),await a.call(this,u.missingSchema),s.call(this,l)}}function i({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function a(l){let u=await c.call(this,l);if(!this.refs[l])await o.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function c(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,r);return this}let o;if(typeof e==="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw Error(`schema ${s} must be string`)}return t=(0,Xm.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return r}getSchema(e){let t;while(typeof(t=n5.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new Jm.SchemaEnv({schema:{},schemaId:n});if(t=Jm.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=n5.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];if(n)n=(0,Xm.normalizeId)(n),delete this.schemas[n],delete this.refs[n];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string"){if(n=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n}else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(l3e.call(this,n,t),!t)return(0,eD.eachItem)(n,(o)=>QI.call(this,o)),this;d3e.call(this,t);let r={...t,type:(0,Ub.getJSONTypes)(t.type),schemaType:(0,Ub.getJSONTypes)(t.schemaType)};return(0,eD.eachItem)(n,r.type.length===0?(o)=>QI.call(this,o,r):(o)=>r.type.forEach((s)=>QI.call(this,o,r,s))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let r=n.rules.findIndex((o)=>o.keyword===e);if(r>=0)n.rules.splice(r,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){if(!e||e.length===0)return"No errors";return e.map((r)=>`${n}${r.instancePath} ${r.message}`).reduce((r,o)=>r+t+o)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let o=r.split("/").slice(1),s=e;for(let i of o)s=s[i];for(let i in n){let a=n[i];if(typeof a!="object")continue;let{$data:c}=a.definition,l=s[i];if(c&&l)s[i]=s5(l)}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];if(!t||t.test(n)){if(typeof r=="string")delete e[n];else if(r&&!r.meta)this._cache.delete(r.schema),delete e[n]}}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:i}=this.opts;if(typeof e=="object")s=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;n=(0,Xm.normalizeId)(s||n);let c=Xm.getSchemaRefs.call(this,e,n);if(a=new Jm.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),o&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=a}if(r)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Jm.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Jm.compileSchema.call(this,e)}finally{this.opts=t}}}Fb.ValidationError=V6e.default;Fb.MissingRefError=r5.default;$s.default=Fb;function t5(e,t,n,r="error"){for(let o in e){let s=o;if(s in t)this.logger[r](`${n}: option ${o}. ${e[s]}`)}}function n5(e){return e=(0,Xm.normalizeId)(e),this.schemas[e]||this.refs[e]}function n3e(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function r3e(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function o3e(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let n=e[t];if(!n.keyword)n.keyword=t;this.addKeyword(n)}}function s3e(){let e={...this.opts};for(let t of J6e)delete e[t];return e}var i3e={log(){},warn(){},error(){}};function a3e(e){if(e===!1)return i3e;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var c3e=/^[a-z_$][a-z0-9_$:-]*$/i;function l3e(e,t){let{RULES:n}=this;if((0,eD.eachItem)(e,(r)=>{if(n.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!c3e.test(r))throw Error(`Keyword ${r} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function QI(e,t,n){var r;let o=t===null||t===void 0?void 0:t.post;if(n&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===n);if(!i)i={type:n,rules:[]},s.rules.push(i);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,Ub.getJSONTypes)(t.type),schemaType:(0,Ub.getJSONTypes)(t.schemaType)}};if(t.before)u3e.call(this,i,a,t.before);else i.rules.push(a);s.all[e]=a,(r=t.implements)===null||r===void 0||r.forEach((c)=>this.addKeyword(c))}function u3e(e,t,n){let r=e.rules.findIndex((o)=>o.keyword===n);if(r>=0)e.rules.splice(r,0,t);else e.rules.push(t),this.logger.warn(`rule ${n} is not defined`)}function d3e(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=s5(t);e.validateSchema=this.compile(t,!0)}var p3e={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function s5(e){return{anyOf:[e,p3e]}}});var c5=C(function(a5){Object.defineProperty(a5,"__esModule",{value:!0});var h3e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};a5.default=h3e});var m5=C(function(p5){Object.defineProperty(p5,"__esModule",{value:!0});p5.callRef=p5.getValidate=void 0;var _3e=qm(),l5=Jr(),fr=Ie(),Zu=Us(),u5=Db(),$b=We(),y3e={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=r,{root:l}=s;if((n==="#"||n==="#/")&&o===l.baseId)return d();let u=u5.resolveRef.call(c,l,o,n);if(u===void 0)throw new _3e.default(r.opts.uriResolver,o,n);if(u instanceof u5.SchemaEnv)return f(u);return m(u);function d(){if(s===l)return zb(e,i,s,s.$async);let h=t.scopeValue("root",{ref:l});return zb(e,fr._`${h}.validate`,l,l.$async)}function f(h){let _=d5(e,h);zb(e,_,h,h.$async)}function m(h){let _=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,fr.stringify)(h)}:{ref:h}),y=t.name("valid"),b=e.subschema({schema:h,dataTypes:[],schemaPath:fr.nil,topSchemaRef:_,errSchemaPath:n},y);e.mergeEvaluated(b),e.ok(y)}}};function d5(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):fr._`${n.scopeValue("wrapper",{ref:t})}.validate`}p5.getValidate=d5;function zb(e,t,n,r){let{gen:o,it:s}=e,{allErrors:i,schemaEnv:a,opts:c}=s,l=c.passContext?Zu.default.this:fr.nil;if(r)u();else d();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{if(o.code(fr._`await ${(0,l5.callValidateCode)(e,t,l)}`),m(t),!i)o.assign(h,!0)},(_)=>{if(o.if(fr._`!(${_} instanceof ${s.ValidationError})`,()=>o.throw(_)),f(_),!i)o.assign(h,!1)}),e.ok(h)}function d(){e.result((0,l5.callValidateCode)(e,t,l),()=>m(t),()=>f(t))}function f(h){let _=fr._`${h}.errors`;o.assign(Zu.default.vErrors,fr._`${Zu.default.vErrors} === null ? ${_} : ${Zu.default.vErrors}.concat(${_})`),o.assign(Zu.default.errors,fr._`${Zu.default.vErrors}.length`)}function m(h){var _;if(!s.opts.unevaluated)return;let y=(_=n===null||n===void 0?void 0:n.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)s.props=$b.mergeEvaluated.props(o,y.props,s.props)}else{let b=o.var("props",fr._`${h}.evaluated.props`);s.props=$b.mergeEvaluated.props(o,b,s.props,fr.Name)}if(s.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)s.items=$b.mergeEvaluated.items(o,y.items,s.items)}else{let b=o.var("items",fr._`${h}.evaluated.items`);s.items=$b.mergeEvaluated.items(o,b,s.items,fr.Name)}}}p5.callRef=zb;p5.default=y3e});var g5=C(function(h5){Object.defineProperty(h5,"__esModule",{value:!0});var E3e=c5(),x3e=m5(),v3e=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",E3e.default,x3e.default];h5.default=v3e});var y5=C(function(_5){Object.defineProperty(_5,"__esModule",{value:!0});var jb=Ie(),Hi=jb.operators,Hb={maximum:{okStr:"<=",ok:Hi.LTE,fail:Hi.GT},minimum:{okStr:">=",ok:Hi.GTE,fail:Hi.LT},exclusiveMaximum:{okStr:"<",ok:Hi.LT,fail:Hi.GTE},exclusiveMinimum:{okStr:">",ok:Hi.GT,fail:Hi.LTE}},A3e={message:({keyword:e,schemaCode:t})=>jb.str`must be ${Hb[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>jb._`{comparison: ${Hb[e].okStr}, limit: ${t}}`},T3e={keyword:Object.keys(Hb),type:"number",schemaType:"number",$data:!0,error:A3e,code(e){let{keyword:t,data:n,schemaCode:r}=e;e.fail$data(jb._`${n} ${Hb[t].fail} ${r} || isNaN(${n})`)}};_5.default=T3e});var b5=C(function(S5){Object.defineProperty(S5,"__esModule",{value:!0});var Qm=Ie(),k3e={message:({schemaCode:e})=>Qm.str`must be multiple of ${e}`,params:({schemaCode:e})=>Qm._`{multipleOf: ${e}}`},R3e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:k3e,code(e){let{gen:t,data:n,schemaCode:r,it:o}=e,s=o.opts.multipleOfPrecision,i=t.let("res"),a=s?Qm._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:Qm._`${i} !== parseInt(${i})`;e.fail$data(Qm._`(${r} === 0 || (${i} = ${n}/${r}, ${a}))`)}};S5.default=R3e});var v5=C(function(x5){Object.defineProperty(x5,"__esModule",{value:!0});function E5(e){let t=e.length,n=0,r=0,o;while(r<t)if(n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t){if(o=e.charCodeAt(r),(o&64512)===56320)r++}return n}x5.default=E5;E5.code='require("ajv/dist/runtime/ucs2length").default'});var A5=C(function(w5){Object.defineProperty(w5,"__esModule",{value:!0});var uc=Ie(),I3e=We(),D3e=v5(),L3e={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return uc.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>uc._`{limit: ${e}}`},N3e={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:L3e,code(e){let{keyword:t,data:n,schemaCode:r,it:o}=e,s=t==="maxLength"?uc.operators.GT:uc.operators.LT,i=o.opts.unicode===!1?uc._`${n}.length`:uc._`${(0,I3e.useFunc)(e.gen,D3e.default)}(${n})`;e.fail$data(uc._`${i} ${s} ${r}`)}};w5.default=N3e});var C5=C(function(T5){Object.defineProperty(T5,"__esModule",{value:!0});var U3e=Jr(),F3e=We(),Yu=Ie(),$3e={message:({schemaCode:e})=>Yu.str`must match pattern "${e}"`,params:({schemaCode:e})=>Yu._`{pattern: ${e}}`},z3e={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:$3e,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:s,it:i}=e,a=i.opts.unicodeRegExp?"u":"";if(r){let{regExp:c}=i.opts.code,l=c.code==="new RegExp"?Yu._`new RegExp`:(0,F3e.useFunc)(t,c),u=t.let("valid");t.try(()=>t.assign(u,Yu._`${l}(${s}, ${a}).test(${n})`),()=>t.assign(u,!1)),e.fail$data(Yu._`!${u}`)}else{let c=(0,U3e.usePattern)(e,o);e.fail$data(Yu._`!${c}.test(${n})`)}}};T5.default=z3e});var R5=C(function(k5){Object.defineProperty(k5,"__esModule",{value:!0});var eh=Ie(),H3e={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return eh.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>eh._`{limit: ${e}}`},B3e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:H3e,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?eh.operators.GT:eh.operators.LT;e.fail$data(eh._`Object.keys(${n}).length ${o} ${r}`)}};k5.default=B3e});var P5=C(function(O5){Object.defineProperty(O5,"__esModule",{value:!0});var th=Jr(),nh=Ie(),G3e=We(),W3e={message:({params:{missingProperty:e}})=>nh.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>nh._`{missingProperty: ${e}}`},V3e={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W3e,code(e){let{gen:t,schema:n,schemaCode:r,data:o,$data:s,it:i}=e,{opts:a}=i;if(!s&&n.length===0)return;let c=n.length>=a.loopRequired;if(i.allErrors)l();else u();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:h}=e.it;for(let _ of n)if((m===null||m===void 0?void 0:m[_])===void 0&&!h.has(_)){let y=i.schemaEnv.baseId+i.errSchemaPath,b=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,G3e.checkStrictMode)(i,b,i.opts.strictRequired)}}function l(){if(c||s)e.block$data(nh.nil,d);else for(let m of n)(0,th.checkReportMissingProp)(e,m)}function u(){let m=t.let("missing");if(c||s){let h=t.let("valid",!0);e.block$data(h,()=>f(m,h)),e.ok(h)}else t.if((0,th.checkMissingProp)(e,n,m)),(0,th.reportMissingProp)(e,m),t.else()}function d(){t.forOf("prop",r,(m)=>{e.setParams({missingProperty:m}),t.if((0,th.noPropertyInData)(t,o,m,a.ownProperties),()=>e.error())})}function f(m,h){e.setParams({missingProperty:m}),t.forOf(m,r,()=>{t.assign(h,(0,th.propertyInData)(t,o,m,a.ownProperties)),t.if((0,nh.not)(h),()=>{e.error(),t.break()})},nh.nil)}}};O5.default=V3e});var D5=C(function(I5){Object.defineProperty(I5,"__esModule",{value:!0});var rh=Ie(),Z3e={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return rh.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>rh._`{limit: ${e}}`},Y3e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Z3e,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?rh.operators.GT:rh.operators.LT;e.fail$data(rh._`${n}.length ${o} ${r}`)}};I5.default=Y3e});var Bb=C(function(N5){Object.defineProperty(N5,"__esModule",{value:!0});var L5=FI();L5.code='require("ajv/dist/runtime/equal").default';N5.default=L5});var U5=C(function(M5){Object.defineProperty(M5,"__esModule",{value:!0});var tD=Bm(),xn=Ie(),Q3e=We(),eZe=Bb(),tZe={message:({params:{i:e,j:t}})=>xn.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>xn._`{i: ${e}, j: ${t}}`},nZe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:tZe,code(e){let{gen:t,data:n,$data:r,schema:o,parentSchema:s,schemaCode:i,it:a}=e;if(!r&&!o)return;let c=t.let("valid"),l=s.items?(0,tD.getSchemaTypes)(s.items):[];e.block$data(c,u,xn._`${i} === false`),e.ok(c);function u(){let h=t.let("i",xn._`${n}.length`),_=t.let("j");e.setParams({i:h,j:_}),t.assign(c,!0),t.if(xn._`${h} > 1`,()=>(d()?f:m)(h,_))}function d(){return l.length>0&&!l.some((h)=>h==="object"||h==="array")}function f(h,_){let y=t.name("item"),b=(0,tD.checkDataTypes)(l,y,a.opts.strictNumbers,tD.DataType.Wrong),v=t.const("indices",xn._`{}`);t.for(xn._`;${h}--;`,()=>{if(t.let(y,xn._`${n}[${h}]`),t.if(b,xn._`continue`),l.length>1)t.if(xn._`typeof ${y} == "string"`,xn._`${y} += "_"`);t.if(xn._`typeof ${v}[${y}] == "number"`,()=>{t.assign(_,xn._`${v}[${y}]`),e.error(),t.assign(c,!1).break()}).code(xn._`${v}[${y}] = ${h}`)})}function m(h,_){let y=(0,Q3e.useFunc)(t,eZe.default),b=t.name("outer");t.label(b).for(xn._`;${h}--;`,()=>t.for(xn._`${_} = ${h}; ${_}--;`,()=>t.if(xn._`${y}(${n}[${h}], ${n}[${_}])`,()=>{e.error(),t.assign(c,!1).break(b)})))}}};M5.default=nZe});var $5=C(function(F5){Object.defineProperty(F5,"__esModule",{value:!0});var nD=Ie(),oZe=We(),sZe=Bb(),iZe={message:"must be equal to constant",params:({schemaCode:e})=>nD._`{allowedValue: ${e}}`},aZe={keyword:"const",$data:!0,error:iZe,code(e){let{gen:t,data:n,$data:r,schemaCode:o,schema:s}=e;if(r||s&&typeof s=="object")e.fail$data(nD._`!${(0,oZe.useFunc)(t,sZe.default)}(${n}, ${o})`);else e.fail(nD._`${s} !== ${n}`)}};F5.default=aZe});var j5=C(function(z5){Object.defineProperty(z5,"__esModule",{value:!0});var oh=Ie(),lZe=We(),uZe=Bb(),dZe={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>oh._`{allowedValues: ${e}}`},pZe={keyword:"enum",schemaType:"array",$data:!0,error:dZe,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:s,it:i}=e;if(!r&&o.length===0)throw Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,l=()=>c!==null&&c!==void 0?c:c=(0,lZe.useFunc)(t,uZe.default),u;if(a||r)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(o))throw Error("ajv implementation error");let m=t.const("vSchema",s);u=(0,oh.or)(...o.map((h,_)=>f(m,_)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",s,(m)=>t.if(oh._`${l()}(${n}, ${m})`,()=>t.assign(u,!0).break()))}function f(m,h){let _=o[h];return typeof _==="object"&&_!==null?oh._`${l()}(${n}, ${m}[${h}])`:oh._`${n} === ${_}`}}};z5.default=pZe});var B5=C(function(H5){Object.defineProperty(H5,"__esModule",{value:!0});var mZe=y5(),hZe=b5(),gZe=A5(),_Ze=C5(),yZe=R5(),SZe=P5(),bZe=D5(),EZe=U5(),xZe=$5(),vZe=j5(),wZe=[mZe.default,hZe.default,gZe.default,_Ze.default,yZe.default,SZe.default,bZe.default,EZe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xZe.default,vZe.default];H5.default=wZe});var oD=C(function(G5){Object.defineProperty(G5,"__esModule",{value:!0});G5.validateAdditionalItems=void 0;var dc=Ie(),rD=We(),TZe={message:({params:{len:e}})=>dc.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>dc._`{limit: ${e}}`},CZe={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:TZe,code(e){let{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,rD.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}K5(e,r)}};function K5(e,t){let{gen:n,schema:r,data:o,keyword:s,it:i}=e;i.items=!0;let a=n.const("len",dc._`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass(dc._`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,rD.alwaysValidSchema)(i,r)){let l=n.var("valid",dc._`${a} <= ${t.length}`);n.if((0,dc.not)(l),()=>c(l)),e.ok(l)}function c(l){n.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:s,dataProp:u,dataPropType:rD.Type.Num},l),!i.allErrors)n.if((0,dc.not)(l),()=>n.break())})}}G5.validateAdditionalItems=K5;G5.default=CZe});var sD=C(function(Z5){Object.defineProperty(Z5,"__esModule",{value:!0});Z5.validateTuple=void 0;var V5=Ie(),Kb=We(),RZe=Jr(),OZe={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return q5(e,"additionalItems",t);if(n.items=!0,(0,Kb.alwaysValidSchema)(n,t))return;e.ok((0,RZe.validateArray)(e))}};function q5(e,t,n=e.schema){let{gen:r,parentSchema:o,data:s,keyword:i,it:a}=e;if(u(o),a.opts.unevaluated&&n.length&&a.items!==!0)a.items=Kb.mergeEvaluated.items(r,n.length,a.items);let c=r.name("valid"),l=r.const("len",V5._`${s}.length`);n.forEach((d,f)=>{if((0,Kb.alwaysValidSchema)(a,d))return;r.if(V5._`${l} > ${f}`,()=>e.subschema({keyword:i,schemaProp:f,dataProp:f},c)),e.ok(c)});function u(d){let{opts:f,errSchemaPath:m}=a,h=n.length,_=h===d.minItems&&(h===d.maxItems||d[t]===!1);if(f.strictTuples&&!_){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,Kb.checkStrictMode)(a,y,f.strictTuples)}}}Z5.validateTuple=q5;Z5.default=OZe});var X5=C(function(J5){Object.defineProperty(J5,"__esModule",{value:!0});var IZe=sD(),DZe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,IZe.validateTuple)(e,"items")};J5.default=DZe});var t8=C(function(e8){Object.defineProperty(e8,"__esModule",{value:!0});var Q5=Ie(),NZe=We(),MZe=Jr(),UZe=oD(),FZe={message:({params:{len:e}})=>Q5.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Q5._`{limit: ${e}}`},$Ze={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:FZe,code(e){let{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;if(r.items=!0,(0,NZe.alwaysValidSchema)(r,t))return;if(o)(0,UZe.validateAdditionalItems)(e,o);else e.ok((0,MZe.validateArray)(e))}};e8.default=$Ze});var r8=C(function(n8){Object.defineProperty(n8,"__esModule",{value:!0});var Xr=Ie(),Gb=We(),jZe={message:({params:{min:e,max:t}})=>t===void 0?Xr.str`must contain at least ${e} valid item(s)`:Xr.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Xr._`{minContains: ${e}}`:Xr._`{minContains: ${e}, maxContains: ${t}}`},HZe={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jZe,code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:s}=e,i,a,{minContains:c,maxContains:l}=r;if(s.opts.next)i=c===void 0?1:c,a=l;else i=1;let u=t.const("len",Xr._`${o}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){(0,Gb.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,Gb.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Gb.alwaysValidSchema)(s,n)){let _=Xr._`${u} >= ${i}`;if(a!==void 0)_=Xr._`${_} && ${u} <= ${a}`;e.pass(_);return}s.items=!0;let d=t.name("valid");if(a===void 0&&i===1)m(d,()=>t.if(d,()=>t.break()));else if(i===0){if(t.let(d,!0),a!==void 0)t.if(Xr._`${o}.length > 0`,f)}else t.let(d,!1),f();e.result(d,()=>e.reset());function f(){let _=t.name("_valid"),y=t.let("count",0);m(_,()=>t.if(_,()=>h(y)))}function m(_,y){t.forRange("i",0,u,(b)=>{e.subschema({keyword:"contains",dataProp:b,dataPropType:Gb.Type.Num,compositeRule:!0},_),y()})}function h(_){if(t.code(Xr._`${_}++`),a===void 0)t.if(Xr._`${_} >= ${i}`,()=>t.assign(d,!0).break());else if(t.if(Xr._`${_} > ${a}`,()=>t.assign(d,!1).break()),i===1)t.assign(d,!0);else t.if(Xr._`${_} >= ${i}`,()=>t.assign(d,!0))}}};n8.default=HZe});var l8=C(function(i8){Object.defineProperty(i8,"__esModule",{value:!0});i8.validateSchemaDeps=i8.validatePropertyDeps=i8.error=void 0;var iD=Ie(),KZe=We(),sh=Jr();i8.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let r=t===1?"property":"properties";return iD.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>iD._`{property: ${e},
112
+ missingProperty: ${r},
113
+ depsCount: ${t},
114
+ deps: ${n}}`};var GZe={keyword:"dependencies",type:"object",schemaType:"object",error:i8.error,code(e){let[t,n]=WZe(e);o8(e,t),s8(e,n)}};function WZe({schema:e}){let t={},n={};for(let r in e){if(r==="__proto__")continue;let o=Array.isArray(e[r])?t:n;o[r]=e[r]}return[t,n]}function o8(e,t=e.schema){let{gen:n,data:r,it:o}=e;if(Object.keys(t).length===0)return;let s=n.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=(0,sh.propertyInData)(n,r,i,o.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors)n.if(c,()=>{for(let l of a)(0,sh.checkReportMissingProp)(e,l)});else n.if(iD._`${c} && (${(0,sh.checkMissingProp)(e,a,s)})`),(0,sh.reportMissingProp)(e,s),n.else()}}i8.validatePropertyDeps=o8;function s8(e,t=e.schema){let{gen:n,data:r,keyword:o,it:s}=e,i=n.name("valid");for(let a in t){if((0,KZe.alwaysValidSchema)(s,t[a]))continue;n.if((0,sh.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>n.var(i,!0)),e.ok(i)}}i8.validateSchemaDeps=s8;i8.default=GZe});var p8=C(function(d8){Object.defineProperty(d8,"__esModule",{value:!0});var u8=Ie(),ZZe=We(),YZe={message:"property name must be valid",params:({params:e})=>u8._`{propertyName: ${e.propertyName}}`},JZe={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:YZe,code(e){let{gen:t,schema:n,data:r,it:o}=e;if((0,ZZe.alwaysValidSchema)(o,n))return;let s=t.name("valid");t.forIn("key",r,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if((0,u8.not)(s),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(s)}};d8.default=JZe});var aD=C(function(f8){Object.defineProperty(f8,"__esModule",{value:!0});var Wb=Jr(),Po=Ie(),QZe=Us(),Vb=We(),e9e={message:"must NOT have additional properties",params:({params:e})=>Po._`{additionalProperty: ${e.additionalProperty}}`},t9e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:e9e,code(e){let{gen:t,schema:n,parentSchema:r,data:o,errsCount:s,it:i}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,Vb.alwaysValidSchema)(i,n))return;let l=(0,Wb.allSchemaProperties)(r.properties),u=(0,Wb.allSchemaProperties)(r.patternProperties);d(),e.ok(Po._`${s} === ${QZe.default.errors}`);function d(){t.forIn("key",o,(y)=>{if(!l.length&&!u.length)h(y);else t.if(f(y),()=>h(y))})}function f(y){let b;if(l.length>8){let v=(0,Vb.schemaRefOrVal)(i,r.properties,"properties");b=(0,Wb.isOwnProperty)(t,v,y)}else if(l.length)b=(0,Po.or)(...l.map((v)=>Po._`${y} === ${v}`));else b=Po.nil;if(u.length)b=(0,Po.or)(b,...u.map((v)=>Po._`${(0,Wb.usePattern)(e,v)}.test(${y})`));return(0,Po.not)(b)}function m(y){t.code(Po._`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){m(y);return}if(n===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof n=="object"&&!(0,Vb.alwaysValidSchema)(i,n)){let b=t.name("valid");if(c.removeAdditional==="failing")_(y,b,!1),t.if((0,Po.not)(b),()=>{e.reset(),m(y)});else if(_(y,b),!a)t.if((0,Po.not)(b),()=>t.break())}}function _(y,b,v){let S={keyword:"additionalProperties",dataProp:y,dataPropType:Vb.Type.Str};if(v===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(S,b)}}};f8.default=t9e});var _8=C(function(g8){Object.defineProperty(g8,"__esModule",{value:!0});var r9e=Vm(),m8=Jr(),cD=We(),h8=aD(),o9e={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:s}=e;if(s.opts.removeAdditional==="all"&&r.additionalProperties===void 0)h8.default.code(new r9e.KeywordCxt(s,h8.default,"additionalProperties"));let i=(0,m8.allSchemaProperties)(n);for(let d of i)s.definedProperties.add(d);if(s.opts.unevaluated&&i.length&&s.props!==!0)s.props=cD.mergeEvaluated.props(t,(0,cD.toHash)(i),s.props);let a=i.filter((d)=>!(0,cD.alwaysValidSchema)(s,n[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a){if(l(d))u(d);else{if(t.if((0,m8.propertyInData)(t,o,d,s.opts.ownProperties)),u(d),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function l(d){return s.opts.useDefaults&&!s.compositeRule&&n[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};g8.default=o9e});var x8=C(function(E8){Object.defineProperty(E8,"__esModule",{value:!0});var y8=Jr(),qb=Ie(),S8=We(),b8=We(),i9e={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:r,parentSchema:o,it:s}=e,{opts:i}=s,a=(0,y8.allSchemaProperties)(n),c=a.filter((_)=>(0,S8.alwaysValidSchema)(s,n[_]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=i.strictSchema&&!i.allowMatchingProperties&&o.properties,u=t.name("valid");if(s.props!==!0&&!(s.props instanceof qb.Name))s.props=(0,b8.evaluatedPropsToName)(t,s.props);let{props:d}=s;f();function f(){for(let _ of a){if(l)m(_);if(s.allErrors)h(_);else t.var(u,!0),h(_),t.if(u)}}function m(_){for(let y in l)if(new RegExp(_).test(y))(0,S8.checkStrictMode)(s,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function h(_){t.forIn("key",r,(y)=>{t.if(qb._`${(0,y8.usePattern)(e,_)}.test(${y})`,()=>{let b=c.includes(_);if(!b)e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:b8.Type.Str},u);if(s.opts.unevaluated&&d!==!0)t.assign(qb._`${d}[${y}]`,!0);else if(!b&&!s.allErrors)t.if((0,qb.not)(u),()=>t.break())})})}}};E8.default=i9e});var w8=C(function(v8){Object.defineProperty(v8,"__esModule",{value:!0});var c9e=We(),l9e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:r}=e;if((0,c9e.alwaysValidSchema)(r,n)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};v8.default=l9e});var T8=C(function(A8){Object.defineProperty(A8,"__esModule",{value:!0});var d9e=Jr(),p9e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:d9e.validateUnion,error:{message:"must match a schema in anyOf"}};A8.default=p9e});var k8=C(function(C8){Object.defineProperty(C8,"__esModule",{value:!0});var Zb=Ie(),m9e=We(),h9e={message:"must match exactly one schema in oneOf",params:({params:e})=>Zb._`{passingSchemas: ${e.passing}}`},g9e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:h9e,code(e){let{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;let s=n,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(i,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,d)=>{let f;if((0,m9e.alwaysValidSchema)(o,u))t.var(c,!0);else f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(Zb._`${c} && ${i}`).assign(i,!1).assign(a,Zb._`[${a}, ${d}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,d),f)e.mergeEvaluated(f,Zb.Name)})})}}};C8.default=g9e});var O8=C(function(R8){Object.defineProperty(R8,"__esModule",{value:!0});var y9e=We(),S9e={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw Error("ajv implementation error");let o=t.name("valid");n.forEach((s,i)=>{if((0,y9e.alwaysValidSchema)(r,s))return;let a=e.subschema({keyword:"allOf",schemaProp:i},o);e.ok(o),e.mergeEvaluated(a)})}};R8.default=S9e});var L8=C(function(D8){Object.defineProperty(D8,"__esModule",{value:!0});var Yb=Ie(),I8=We(),E9e={message:({params:e})=>Yb.str`must match "${e.ifClause}" schema`,params:({params:e})=>Yb._`{failingKeyword: ${e.ifClause}}`},x9e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:E9e,code(e){let{gen:t,parentSchema:n,it:r}=e;if(n.then===void 0&&n.else===void 0)(0,I8.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let o=P8(r,"then"),s=P8(r,"else");if(!o&&!s)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else if(o)t.if(a,l("then"));else t.if((0,Yb.not)(a),l("else"));e.pass(i,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,d){return()=>{let f=e.subschema({keyword:u},a);if(t.assign(i,a),e.mergeValidEvaluated(f,i),d)t.assign(d,Yb._`${u}`);else e.setParams({ifClause:u})}}}};function P8(e,t){let n=e.schema[t];return n!==void 0&&!(0,I8.alwaysValidSchema)(e,n)}D8.default=x9e});var M8=C(function(N8){Object.defineProperty(N8,"__esModule",{value:!0});var w9e=We(),A9e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){if(t.if===void 0)(0,w9e.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};N8.default=A9e});var F8=C(function(U8){Object.defineProperty(U8,"__esModule",{value:!0});var C9e=oD(),k9e=X5(),R9e=sD(),O9e=t8(),P9e=r8(),I9e=l8(),D9e=p8(),L9e=aD(),N9e=_8(),M9e=x8(),U9e=w8(),F9e=T8(),$9e=k8(),z9e=O8(),j9e=L8(),H9e=M8();function B9e(e=!1){let t=[U9e.default,F9e.default,$9e.default,z9e.default,j9e.default,H9e.default,D9e.default,L9e.default,I9e.default,N9e.default,M9e.default];if(e)t.push(k9e.default,O9e.default);else t.push(C9e.default,R9e.default);return t.push(P9e.default),t}U8.default=B9e});var z8=C(function($8){Object.defineProperty($8,"__esModule",{value:!0});var Kt=Ie(),G9e={message:({schemaCode:e})=>Kt.str`must match format "${e}"`,params:({schemaCode:e})=>Kt._`{format: ${e}}`},W9e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:G9e,code(e,t){let{gen:n,data:r,$data:o,schema:s,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;if(o)f();else m();function f(){let h=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),_=n.const("fDef",Kt._`${h}[${i}]`),y=n.let("fType"),b=n.let("format");n.if(Kt._`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>n.assign(y,Kt._`${_}.type || "string"`).assign(b,Kt._`${_}.validate`),()=>n.assign(y,Kt._`"string"`).assign(b,_)),e.fail$data((0,Kt.or)(v(),S()));function v(){if(c.strictSchema===!1)return Kt.nil;return Kt._`${i} && !${b}`}function S(){let x=u.$async?Kt._`(${_}.async ? await ${b}(${r}) : ${b}(${r}))`:Kt._`${b}(${r})`,w=Kt._`(typeof ${b} == "function" ? ${x} : ${b}.test(${r}))`;return Kt._`${b} && ${b} !== true && ${y} === ${t} && !${w}`}}function m(){let h=d.formats[s];if(!h){v();return}if(h===!0)return;let[_,y,b]=S(h);if(_===t)e.pass(x());function v(){if(c.strictSchema===!1){d.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function S(w){let D=w instanceof RegExp?(0,Kt.regexpCode)(w):c.code.formats?Kt._`${c.code.formats}${(0,Kt.getProperty)(s)}`:void 0,P=n.scopeValue("formats",{key:s,ref:w,code:D});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,Kt._`${P}.validate`];return["string",w,P]}function x(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw Error("async format in sync schema");return Kt._`await ${b}(${r})`}return typeof y=="function"?Kt._`${b}(${r})`:Kt._`${b}.test(${r})`}}}};$8.default=W9e});var H8=C(function(j8){Object.defineProperty(j8,"__esModule",{value:!0});var q9e=z8(),Z9e=[q9e.default];j8.default=Z9e});var G8=C(function(B8){Object.defineProperty(B8,"__esModule",{value:!0});B8.contentVocabulary=B8.metadataVocabulary=void 0;B8.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];B8.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var q8=C(function(V8){Object.defineProperty(V8,"__esModule",{value:!0});var X9e=g5(),Q9e=B5(),eYe=F8(),tYe=H8(),W8=G8(),nYe=[X9e.default,Q9e.default,(0,eYe.default)(),tYe.default,W8.metadataVocabulary,W8.contentVocabulary];V8.default=nYe});var X8=C(function(Y8){Object.defineProperty(Y8,"__esModule",{value:!0});Y8.DiscrError=void 0;var Z8;(function(e){e.Tag="tag",e.Mapping="mapping"})(Z8||(Y8.DiscrError=Z8={}))});var tX=C(function(eX){Object.defineProperty(eX,"__esModule",{value:!0});var Ju=Ie(),lD=X8(),Q8=Db(),oYe=qm(),sYe=We(),iYe={message:({params:{discrError:e,tagName:t}})=>e===lD.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>Ju._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},aYe={keyword:"discriminator",type:"object",schemaType:"object",error:iYe,code(e){let{gen:t,data:n,schema:r,parentSchema:o,it:s}=e,{oneOf:i}=o;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",Ju._`${n}${(0,Ju.getProperty)(a)}`);t.if(Ju._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:lD.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=f();t.if(!1);for(let h in m)t.elseIf(Ju._`${l} === ${h}`),t.assign(c,d(m[h]));t.else(),e.error(!1,{discrError:lD.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function d(m){let h=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:m},h);return e.mergeEvaluated(_,Ju.Name),h}function f(){var m;let h={},_=b(o),y=!0;for(let x=0;x<i.length;x++){let w=i[x];if((w===null||w===void 0?void 0:w.$ref)&&!(0,sYe.schemaHasRulesButRef)(w,s.self.RULES)){let P=w.$ref;if(w=Q8.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,P),w instanceof Q8.SchemaEnv)w=w.schema;if(w===void 0)throw new oYe.default(s.opts.uriResolver,s.baseId,P)}let D=(m=w===null||w===void 0?void 0:w.properties)===null||m===void 0?void 0:m[a];if(typeof D!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||b(w)),v(D,x)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function b({required:x}){return Array.isArray(x)&&x.includes(a)}function v(x,w){if(x.const)S(x.const,w);else if(x.enum)for(let D of x.enum)S(D,w);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(x,w){if(typeof x!="string"||x in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[x]=w}}}};eX.default=aYe});var nX=C(function(LHt,lYe){lYe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var dD=C(function(mr,uD){Object.defineProperty(mr,"__esModule",{value:!0});mr.MissingRefError=mr.ValidationError=mr.CodeGen=mr.Name=mr.nil=mr.stringify=mr.str=mr._=mr.KeywordCxt=mr.Ajv=void 0;var uYe=i5(),dYe=q8(),pYe=tX(),rX=nX(),fYe=["/properties"],Jb="http://json-schema.org/draft-07/schema";class ih extends uYe.default{_addVocabularies(){if(super._addVocabularies(),dYe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(pYe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(rX,fYe):rX;this.addMetaSchema(e,Jb,!1),this.refs["http://json-schema.org/schema"]=Jb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Jb)?Jb:void 0)}}mr.Ajv=ih;uD.exports=mr=ih;uD.exports.Ajv=ih;Object.defineProperty(mr,"__esModule",{value:!0});mr.default=ih;var mYe=Vm();Object.defineProperty(mr,"KeywordCxt",{enumerable:!0,get:function(){return mYe.KeywordCxt}});var Xu=Ie();Object.defineProperty(mr,"_",{enumerable:!0,get:function(){return Xu._}});Object.defineProperty(mr,"str",{enumerable:!0,get:function(){return Xu.str}});Object.defineProperty(mr,"stringify",{enumerable:!0,get:function(){return Xu.stringify}});Object.defineProperty(mr,"nil",{enumerable:!0,get:function(){return Xu.nil}});Object.defineProperty(mr,"Name",{enumerable:!0,get:function(){return Xu.Name}});Object.defineProperty(mr,"CodeGen",{enumerable:!0,get:function(){return Xu.CodeGen}});var hYe=Pb();Object.defineProperty(mr,"ValidationError",{enumerable:!0,get:function(){return hYe.default}});var gYe=qm();Object.defineProperty(mr,"MissingRefError",{enumerable:!0,get:function(){return gYe.default}})});var fX=C(function(dX){Object.defineProperty(dX,"__esModule",{value:!0});dX.formatNames=dX.fastFormats=dX.fullFormats=void 0;function ns(e,t){return{validate:e,compare:t}}dX.fullFormats={date:ns(aX,hD),time:ns(fD(!0),gD),"date-time":ns(oX(!0),lX),"iso-time":ns(fD(),cX),"iso-date-time":ns(oX(),uX),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:wYe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:PYe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:AYe,int32:{type:"number",validate:kYe},int64:{type:"number",validate:RYe},float:{type:"number",validate:iX},double:{type:"number",validate:iX},password:!0,binary:!0};dX.fastFormats={...dX.fullFormats,date:ns(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hD),time:ns(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,gD),"date-time":ns(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lX),"iso-time":ns(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,cX),"iso-date-time":ns(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,uX),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};dX.formatNames=Object.keys(dX.fullFormats);function SYe(e){return e%4===0&&(e%100!==0||e%400===0)}var bYe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,EYe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function aX(e){let t=bYe.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(r===2&&SYe(n)?29:EYe[r])}function hD(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var pD=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function fD(e){return function(n){let r=pD.exec(n);if(!r)return!1;let o=+r[1],s=+r[2],i=+r[3],a=r[4],c=r[5]==="-"?-1:1,l=+(r[6]||0),u=+(r[7]||0);if(l>23||u>59||e&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-u*c,f=o-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&i<61}}function gD(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),r=new Date("2020-01-01T"+t).valueOf();if(!(n&&r))return;return n-r}function cX(e,t){if(!(e&&t))return;let n=pD.exec(e),r=pD.exec(t);if(!(n&&r))return;if(e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t)return 1;if(e<t)return-1;return 0}var mD=/t|\s/i;function oX(e){let t=fD(e);return function(r){let o=r.split(mD);return o.length===2&&aX(o[0])&&t(o[1])}}function lX(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(!(n&&r))return;return n-r}function uX(e,t){if(!(e&&t))return;let[n,r]=e.split(mD),[o,s]=t.split(mD),i=hD(n,o);if(i===void 0)return;return i||gD(r,s)}var xYe=/\/|:/,vYe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function wYe(e){return xYe.test(e)&&vYe.test(e)}var sX=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function AYe(e){return sX.lastIndex=0,sX.test(e)}var TYe=-2147483648,CYe=2147483647;function kYe(e){return Number.isInteger(e)&&e<=CYe&&e>=TYe}function RYe(e){return Number.isInteger(e)}function iX(){return!0}var OYe=/[^\\]\\Z/;function PYe(e){if(OYe.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var hX=C(function(mX){Object.defineProperty(mX,"__esModule",{value:!0});mX.formatLimitDefinition=void 0;var DYe=dD(),Io=Ie(),Bi=Io.operators,Xb={formatMaximum:{okStr:"<=",ok:Bi.LTE,fail:Bi.GT},formatMinimum:{okStr:">=",ok:Bi.GTE,fail:Bi.LT},formatExclusiveMaximum:{okStr:"<",ok:Bi.LT,fail:Bi.GTE},formatExclusiveMinimum:{okStr:">",ok:Bi.GT,fail:Bi.LTE}},LYe={message:({keyword:e,schemaCode:t})=>Io.str`should be ${Xb[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Io._`{comparison: ${Xb[e].okStr}, limit: ${t}}`};mX.formatLimitDefinition={keyword:Object.keys(Xb),type:"string",schemaType:"string",$data:!0,error:LYe,code(e){let{gen:t,data:n,schemaCode:r,keyword:o,it:s}=e,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new DYe.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else u();function l(){let f=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),m=t.const("fmt",Io._`${f}[${c.schemaCode}]`);e.fail$data((0,Io.or)(Io._`typeof ${m} != "object"`,Io._`${m} instanceof RegExp`,Io._`typeof ${m}.compare != "function"`,d(m)))}function u(){let f=c.schema,m=a.formats[f];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${o}": format "${f}" does not define "compare" function`);let h=t.scopeValue("formats",{key:f,ref:m,code:i.code.formats?Io._`${i.code.formats}${(0,Io.getProperty)(f)}`:void 0});e.fail$data(d(h))}function d(f){return Io._`${f}.compare(${n}, ${r}) ${Xb[o].fail} 0`}},dependencies:["format"]};var NYe=(e)=>(e.addKeyword(mX.formatLimitDefinition),e);mX.default=NYe});var SX=C(function(ah,yX){Object.defineProperty(ah,"__esModule",{value:!0});var Qu=fX(),UYe=hX(),SD=Ie(),gX=new SD.Name("fullFormats"),FYe=new SD.Name("fastFormats"),bD=(e,t={keywords:!0})=>{if(Array.isArray(t))return _X(e,t,Qu.fullFormats,gX),e;let[n,r]=t.mode==="fast"?[Qu.fastFormats,FYe]:[Qu.fullFormats,gX],o=t.formats||Qu.formatNames;if(_X(e,o,n,r),t.keywords)(0,UYe.default)(e);return e};bD.get=(e,t="full")=>{let r=(t==="fast"?Qu.fastFormats:Qu.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function _X(e,t,n,r){var o,s;(o=(s=e.opts.code).formats)!==null&&o!==void 0||(s.formats=SD._`require("ajv-formats/dist/formats").${r}`);for(let i of t)e.addFormat(i,n[i])}yX.exports=ah=bD;Object.defineProperty(ah,"__esModule",{value:!0});ah.default=bD});import{randomUUID as _d}from"crypto";import{createHash as wre,randomBytes as qnt}from"crypto";function tx(e){return e}var i0="[\\w-]{1,63}",vre=new RegExp(`^${i0}$`);var Gnt=new RegExp(`^a(?:${i0}-)?[0-9a-f]{16}$`);function a0(e,t){let n=Buffer.from(t.replace(/-/g,""),"hex"),r=wre("sha1").update(n).update(Buffer.from(e,"utf8")).digest();r[6]=r[6]&15|80,r[8]=r[8]&63|128;let o=r.subarray(0,16).toString("hex");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20,32)}`}var Are="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function c0(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?a0(e,Are):null}function Tre(){this.__data__=[],this.size=0}var l0=Tre;function Cre(e,t){return e===t||e!==e&&t!==t}var Mo=Cre;function kre(e,t){var n=e.length;while(n--)if(Mo(e[n][0],t))return n;return-1}var Hs=kre;var Rre=Array.prototype,Ore=Rre.splice;function Pre(e){var t=this.__data__,n=Hs(t,e);if(n<0)return!1;var r=t.length-1;if(n==r)t.pop();else Ore.call(t,n,1);return--this.size,!0}var u0=Pre;function Ire(e){var t=this.__data__,n=Hs(t,e);return n<0?void 0:t[n][1]}var d0=Ire;function Dre(e){return Hs(this.__data__,e)>-1}var p0=Dre;function Lre(e,t){var n=this.__data__,r=Hs(n,e);if(r<0)++this.size,n.push([e,t]);else n[r][1]=t;return this}var f0=Lre;function Cc(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Cc.prototype.clear=l0;Cc.prototype.delete=u0;Cc.prototype.get=d0;Cc.prototype.has=p0;Cc.prototype.set=f0;var Bs=Cc;function Nre(){this.__data__=new Bs,this.size=0}var m0=Nre;function Mre(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var h0=Mre;function Ure(e){return this.__data__.get(e)}var g0=Ure;function Fre(e){return this.__data__.has(e)}var _0=Fre;var $re=typeof global=="object"&&global&&global.Object===Object&&global,Uh=$re;var zre=typeof self=="object"&&self&&self.Object===Object&&self,jre=Uh||zre||Function("return this")(),Gt=jre;var Hre=Gt.Symbol,an=Hre;var y0=Object.prototype,{hasOwnProperty:Bre,toString:Kre}=y0,yd=an?an.toStringTag:void 0;function Gre(e){var t=Bre.call(e,yd),n=e[yd];try{e[yd]=void 0;var r=!0}catch(s){}var o=Kre.call(e);if(r)if(t)e[yd]=n;else delete e[yd];return o}var S0=Gre;var Wre=Object.prototype,Vre=Wre.toString;function qre(e){return Vre.call(e)}var b0=qre;var Zre="[object Null]",Yre="[object Undefined]",E0=an?an.toStringTag:void 0;function Jre(e){if(e==null)return e===void 0?Yre:Zre;return E0&&E0 in Object(e)?S0(e):b0(e)}var hr=Jre;function Xre(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ht=Xre;var Qre="[object AsyncFunction]",eoe="[object Function]",toe="[object GeneratorFunction]",noe="[object Proxy]";function roe(e){if(!Ht(e))return!1;var t=hr(e);return t==eoe||t==toe||t==Qre||t==noe}var kc=roe;var ooe=Gt["__core-js_shared__"],Fh=ooe;var x0=function(){var e=/[^.]+$/.exec(Fh&&Fh.keys&&Fh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function soe(e){return!!x0&&x0 in e}var v0=soe;var ioe=Function.prototype,aoe=ioe.toString;function coe(e){if(e!=null){try{return aoe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var as=coe;var loe=/[\\^$.*+?()[\]{}|]/g,uoe=/^\[object .+?Constructor\]$/,doe=Function.prototype,poe=Object.prototype,foe=doe.toString,moe=poe.hasOwnProperty,hoe=RegExp("^"+foe.call(moe).replace(loe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function goe(e){if(!Ht(e)||v0(e))return!1;var t=kc(e)?hoe:uoe;return t.test(as(e))}var w0=goe;function _oe(e,t){return e==null?void 0:e[t]}var A0=_oe;function yoe(e,t){var n=A0(e,t);return w0(n)?n:void 0}var Yn=yoe;var Soe=Yn(Gt,"Map"),Ks=Soe;var boe=Yn(Object,"create"),cs=boe;function Eoe(){this.__data__=cs?cs(null):{},this.size=0}var T0=Eoe;function xoe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var C0=xoe;var voe="__lodash_hash_undefined__",woe=Object.prototype,Aoe=woe.hasOwnProperty;function Toe(e){var t=this.__data__;if(cs){var n=t[e];return n===voe?void 0:n}return Aoe.call(t,e)?t[e]:void 0}var k0=Toe;var Coe=Object.prototype,koe=Coe.hasOwnProperty;function Roe(e){var t=this.__data__;return cs?t[e]!==void 0:koe.call(t,e)}var R0=Roe;var Ooe="__lodash_hash_undefined__";function Poe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=cs&&t===void 0?Ooe:t,this}var O0=Poe;function Rc(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Rc.prototype.clear=T0;Rc.prototype.delete=C0;Rc.prototype.get=k0;Rc.prototype.has=R0;Rc.prototype.set=O0;var nx=Rc;function Ioe(){this.size=0,this.__data__={hash:new nx,map:new(Ks||Bs),string:new nx}}var P0=Ioe;function Doe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var I0=Doe;function Loe(e,t){var n=e.__data__;return I0(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Gs=Loe;function Noe(e){var t=Gs(this,e).delete(e);return this.size-=t?1:0,t}var D0=Noe;function Moe(e){return Gs(this,e).get(e)}var L0=Moe;function Uoe(e){return Gs(this,e).has(e)}var N0=Uoe;function Foe(e,t){var n=Gs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var M0=Foe;function Oc(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Oc.prototype.clear=P0;Oc.prototype.delete=D0;Oc.prototype.get=L0;Oc.prototype.has=N0;Oc.prototype.set=M0;var Xi=Oc;var $oe=200;function zoe(e,t){var n=this.__data__;if(n instanceof Bs){var r=n.__data__;if(!Ks||r.length<$oe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xi(r)}return n.set(e,t),this.size=n.size,this}var U0=zoe;function Pc(e){var t=this.__data__=new Bs(e);this.size=t.size}Pc.prototype.clear=m0;Pc.prototype.delete=h0;Pc.prototype.get=g0;Pc.prototype.has=_0;Pc.prototype.set=U0;var Uo=Pc;var joe="__lodash_hash_undefined__";function Hoe(e){return this.__data__.set(e,joe),this}var F0=Hoe;function Boe(e){return this.__data__.has(e)}var $0=Boe;function $h(e){var t=-1,n=e==null?0:e.length;this.__data__=new Xi;while(++t<n)this.add(e[t])}$h.prototype.add=$h.prototype.push=F0;$h.prototype.has=$0;var z0=$h;function Koe(e,t){var n=-1,r=e==null?0:e.length;while(++n<r)if(t(e[n],n,e))return!0;return!1}var j0=Koe;function Goe(e,t){return e.has(t)}var H0=Goe;var Woe=1,Voe=2;function qoe(e,t,n,r,o,s){var i=n&Woe,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,m=n&Voe?new z0:void 0;s.set(e,t),s.set(t,e);while(++d<a){var h=e[d],_=t[d];if(r)var y=i?r(_,h,d,t,e,s):r(h,_,d,e,t,s);if(y!==void 0){if(y)continue;f=!1;break}if(m){if(!j0(t,function(b,v){if(!H0(m,v)&&(h===b||o(h,b,n,r,s)))return m.push(v)})){f=!1;break}}else if(!(h===_||o(h,_,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var zh=qoe;var Zoe=Gt.Uint8Array,Ic=Zoe;function Yoe(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var B0=Yoe;function Joe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var K0=Joe;var Xoe=1,Qoe=2,ese="[object Boolean]",tse="[object Date]",nse="[object Error]",rse="[object Map]",ose="[object Number]",sse="[object RegExp]",ise="[object Set]",ase="[object String]",cse="[object Symbol]",lse="[object ArrayBuffer]",use="[object DataView]",G0=an?an.prototype:void 0,rx=G0?G0.valueOf:void 0;function dse(e,t,n,r,o,s,i){switch(n){case use:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case lse:if(e.byteLength!=t.byteLength||!s(new Ic(e),new Ic(t)))return!1;return!0;case ese:case tse:case ose:return Mo(+e,+t);case nse:return e.name==t.name&&e.message==t.message;case sse:case ase:return e==t+"";case rse:var a=B0;case ise:var c=r&Xoe;if(a||(a=K0),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;r|=Qoe,i.set(e,t);var u=zh(a(e),a(t),r,o,s,i);return i.delete(e),u;case cse:if(rx)return rx.call(e)==rx.call(t)}return!1}var W0=dse;function pse(e,t){var n=-1,r=t.length,o=e.length;while(++n<r)e[o+n]=t[n];return e}var Dc=pse;var fse=Array.isArray,Tt=fse;function mse(e,t,n){var r=t(e);return Tt(e)?r:Dc(r,n(e))}var jh=mse;function hse(e,t){var n=-1,r=e==null?0:e.length,o=0,s=[];while(++n<r){var i=e[n];if(t(i,n,e))s[o++]=i}return s}var V0=hse;function gse(){return[]}var Hh=gse;var _se=Object.prototype,yse=_se.propertyIsEnumerable,q0=Object.getOwnPropertySymbols,Sse=!q0?Hh:function(e){if(e==null)return[];return e=Object(e),V0(q0(e),function(t){return yse.call(e,t)})},Lc=Sse;function bse(e,t){var n=-1,r=Array(e);while(++n<e)r[n]=t(n);return r}var Z0=bse;function Ese(e){return e!=null&&typeof e=="object"}var Zt=Ese;var xse="[object Arguments]";function vse(e){return Zt(e)&&hr(e)==xse}var ox=vse;var Y0=Object.prototype,{hasOwnProperty:wse,propertyIsEnumerable:Ase}=Y0,Tse=ox(function(){return arguments}())?ox:function(e){return Zt(e)&&wse.call(e,"callee")&&!Ase.call(e,"callee")},ls=Tse;var Kh={};Zn(Kh,{default:()=>Fo});function Cse(){return!1}var J0=Cse;var eN=typeof Kh=="object"&&Kh&&!Kh.nodeType&&Kh,X0=eN&&typeof Bh=="object"&&Bh&&!Bh.nodeType&&Bh,kse=X0&&X0.exports===eN,Q0=kse?Gt.Buffer:void 0,Rse=Q0?Q0.isBuffer:void 0,Ose=Rse||J0,Fo=Ose;var Pse=9007199254740991,Ise=/^(?:0|[1-9]\d*)$/;function Dse(e,t){var n=typeof e;return t=t==null?Pse:t,!!t&&(n=="number"||n!="symbol"&&Ise.test(e))&&(e>-1&&e%1==0&&e<t)}var Ws=Dse;var Lse=9007199254740991;function Nse(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Lse}var Nc=Nse;var Mse="[object Arguments]",Use="[object Array]",Fse="[object Boolean]",$se="[object Date]",zse="[object Error]",jse="[object Function]",Hse="[object Map]",Bse="[object Number]",Kse="[object Object]",Gse="[object RegExp]",Wse="[object Set]",Vse="[object String]",qse="[object WeakMap]",Zse="[object ArrayBuffer]",Yse="[object DataView]",Jse="[object Float32Array]",Xse="[object Float64Array]",Qse="[object Int8Array]",eie="[object Int16Array]",tie="[object Int32Array]",nie="[object Uint8Array]",rie="[object Uint8ClampedArray]",oie="[object Uint16Array]",sie="[object Uint32Array]",vt={};vt[Jse]=vt[Xse]=vt[Qse]=vt[eie]=vt[tie]=vt[nie]=vt[rie]=vt[oie]=vt[sie]=!0;vt[Mse]=vt[Use]=vt[Zse]=vt[Fse]=vt[Yse]=vt[$se]=vt[zse]=vt[jse]=vt[Hse]=vt[Bse]=vt[Kse]=vt[Gse]=vt[Wse]=vt[Vse]=vt[qse]=!1;function iie(e){return Zt(e)&&Nc(e.length)&&!!vt[hr(e)]}var tN=iie;function aie(e){return function(t){return e(t)}}var Mc=aie;var Wh={};Zn(Wh,{default:()=>$o});var nN=typeof Wh=="object"&&Wh&&!Wh.nodeType&&Wh,Sd=nN&&typeof Gh=="object"&&Gh&&!Gh.nodeType&&Gh,cie=Sd&&Sd.exports===nN,sx=cie&&Uh.process,lie=function(){try{var e=Sd&&Sd.require&&Sd.require("util").types;if(e)return e;return sx&&sx.binding&&sx.binding("util")}catch(t){}}(),$o=lie;var rN=$o&&$o.isTypedArray,uie=rN?Mc(rN):tN,Uc=uie;var die=Object.prototype,pie=die.hasOwnProperty;function fie(e,t){var n=Tt(e),r=!n&&ls(e),o=!n&&!r&&Fo(e),s=!n&&!r&&!o&&Uc(e),i=n||r||o||s,a=i?Z0(e.length,String):[],c=a.length;for(var l in e)if((t||pie.call(e,l))&&!(i&&(l=="length"||o&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ws(l,c))))a.push(l);return a}var Vh=fie;var mie=Object.prototype;function hie(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||mie;return e===n}var Fc=hie;function gie(e,t){return function(n){return e(t(n))}}var qh=gie;var _ie=qh(Object.keys,Object),oN=_ie;var yie=Object.prototype,Sie=yie.hasOwnProperty;function bie(e){if(!Fc(e))return oN(e);var t=[];for(var n in Object(e))if(Sie.call(e,n)&&n!="constructor")t.push(n);return t}var sN=bie;function Eie(e){return e!=null&&Nc(e.length)&&!kc(e)}var Vs=Eie;function xie(e){return Vs(e)?Vh(e):sN(e)}var zo=xie;function vie(e){return jh(e,zo,Lc)}var bd=vie;var wie=1,Aie=Object.prototype,Tie=Aie.hasOwnProperty;function Cie(e,t,n,r,o,s){var i=n&wie,a=bd(e),c=a.length,l=bd(t),u=l.length;if(c!=u&&!i)return!1;var d=c;while(d--){var f=a[d];if(!(i?f in t:Tie.call(t,f)))return!1}var m=s.get(e),h=s.get(t);if(m&&h)return m==t&&h==e;var _=!0;s.set(e,t),s.set(t,e);var y=i;while(++d<c){f=a[d];var b=e[f],v=t[f];if(r)var S=i?r(v,b,f,t,e,s):r(b,v,f,e,t,s);if(!(S===void 0?b===v||o(b,v,n,r,s):S)){_=!1;break}y||(y=f=="constructor")}if(_&&!y){var x=e.constructor,w=t.constructor;if(x!=w&&(("constructor"in e)&&("constructor"in t))&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w))_=!1}return s.delete(e),s.delete(t),_}var iN=Cie;var kie=Yn(Gt,"DataView"),Zh=kie;var Rie=Yn(Gt,"Promise"),Yh=Rie;var Oie=Yn(Gt,"Set"),Jh=Oie;var Pie=Yn(Gt,"WeakMap"),Xh=Pie;var aN="[object Map]",Iie="[object Object]",cN="[object Promise]",lN="[object Set]",uN="[object WeakMap]",dN="[object DataView]",Die=as(Zh),Lie=as(Ks),Nie=as(Yh),Mie=as(Jh),Uie=as(Xh),Qi=hr;if(Zh&&Qi(new Zh(new ArrayBuffer(1)))!=dN||Ks&&Qi(new Ks)!=aN||Yh&&Qi(Yh.resolve())!=cN||Jh&&Qi(new Jh)!=lN||Xh&&Qi(new Xh)!=uN)Qi=function(e){var t=hr(e),n=t==Iie?e.constructor:void 0,r=n?as(n):"";if(r)switch(r){case Die:return dN;case Lie:return aN;case Nie:return cN;case Mie:return lN;case Uie:return uN}return t};var us=Qi;var Fie=1,pN="[object Arguments]",fN="[object Array]",Qh="[object Object]",$ie=Object.prototype,mN=$ie.hasOwnProperty;function zie(e,t,n,r,o,s){var i=Tt(e),a=Tt(t),c=i?fN:us(e),l=a?fN:us(t);c=c==pN?Qh:c,l=l==pN?Qh:l;var u=c==Qh,d=l==Qh,f=c==l;if(f&&Fo(e)){if(!Fo(t))return!1;i=!0,u=!1}if(f&&!u)return s||(s=new Uo),i||Uc(e)?zh(e,t,n,r,o,s):W0(e,t,c,n,r,o,s);if(!(n&Fie)){var m=u&&mN.call(e,"__wrapped__"),h=d&&mN.call(t,"__wrapped__");if(m||h){var _=m?e.value():e,y=h?t.value():t;return s||(s=new Uo),o(_,y,n,r,s)}}if(!f)return!1;return s||(s=new Uo),iN(e,t,n,r,o,s)}var hN=zie;function gN(e,t,n,r,o){if(e===t)return!0;if(e==null||t==null||!Zt(e)&&!Zt(t))return e!==e&&t!==t;return hN(e,t,n,r,gN,o)}var $c=gN;function jie(e,t){return $c(e,t)}var zc=jie;import{basename as Bie,dirname as bN}from"path";var Hie;function ye(){return Hie===!0}class Je{#e;#t=new WeakMap;constructor(e){this.#e=e}of(e){let t=this.#t.get(e);if(t!==void 0)return t;let n=this.#e();return this.#t.set(e,n),n}}jc();class eg{mergedSettings=null;perSource=new Map;parsedFiles=new Map;folderListings=new Map;managedFileReads=new Map;primedFiles=new Set;policyWalks=0;walkedFolders=new Map;policy={};lastPolicyEnvComposition=null;isLoadingFromDisk=!1;autoModeUntrustedSourceWarned=!1;changed=Ct();internalWrites=new Map;enabledSources;pluginBase;epoch=0;systemSpaceServingLogged=!1;systemAttestationContradicted=!1;backendReadResetTail=Promise.resolve();invalidated=Ct();pluginBaseLoaded=!1;primer;localStoreProbes=new EN;retained=new Map;retainedListings=new Map;setPluginBase(e){this.pluginBase=e,this.pluginBaseLoaded=!0}clearPluginBase(){this.pluginBase=void 0}invalidateAll(e){if(this.epoch++,this.mergedSettings=null,this.perSource.clear(),this.parsedFiles.clear(),this.primedFiles.clear(),this.policyWalks=0,this.walkedFolders.clear(),this.folderListings.clear(),this.policy={},e?.userLayer==="retain"&&ye()&&this.primer!==void 0){for(let[t,n]of this.retained)this.parsedFiles.set(t,n.parsed),this.primedFiles.add(t);for(let[t,n]of this.retainedListings)this.folderListings.set(t,n.names)}else this.retained.clear(),this.retainedListings.clear();this.invalidated.emit()}invalidatePolicyLayer(){this.mergedSettings=null,this.perSource.delete("policySettings"),this.policy={}}onInvalidate(e){return this.invalidated.subscribe(e)}seedParsedFile(e,t,n,r){if(r!==this.epoch)return!1;let o=this.parsedFiles.get(e),s=o===void 0||!zc(o,n);if(this.parsedFiles.set(e,n),s||this.primedFiles.has(e))this.primedFiles.add(e);let i=this.retained.get(e);if(i!==void 0)i.parsed=n;if(s)this.dropDerivedCaches(t);return!0}walkReadDiffers(e,t){let n=this.parsedFiles.get(e);return n!==void 0&&!this.primedFiles.has(e)&&!zc(n,t)}unseedParsedFile(e,t,n){if(n!==this.epoch)return;if(this.retained.delete(e),!this.primedFiles.has(e)||t==="policySettings"&&this.policyWalks>0)return;this.primedFiles.delete(e),this.parsedFiles.delete(e),this.dropDerivedCaches(t)}dropDerivedCaches(e){if(this.perSource.delete(e),this.mergedSettings=null,e==="policySettings")this.policy={}}primedFolderListing(e){return ye()?this.folderListings.get(e):void 0}folderListingForPolicyWalk(e){if(!ye())return;this.policyWalks++;let t=this.folderListings.get(e);if(!this.walkedFolders.has(e)||t!==void 0)this.walkedFolders.set(e,t??null);return t}noteWalkListing(e,t){if(!ye())return;this.walkedFolders.set(e,t)}get policyWalkCount(){return this.policyWalks}policyInstallVerdict(e,t,n){let r=this.parsedFiles.get(e);if(r===void 0||zc(r,t))return"install";if(!this.primedFiles.has(e))return"raced";if(this.policyWalks===0)return"install";return this.policyWalks>n?"raced":"deferred"}folderInstallVerdict(e,t,n){if(!this.walkedFolders.has(e))return this.hasParsedDropInOutside(e,t)?"raced":"install";let r=this.walkedFolders.get(e);if(r!==null&&r!==void 0&&zc(r,t))return"install";return this.policyWalks>n?"raced":"deferred"}seedFolderListing(e,t,n){if(n!==this.epoch)return!1;let r=this.folderListings.get(e);this.folderListings.set(e,t);let o=this.retainedListings.get(e);if(o!==void 0)o.names=t;if(r!==void 0&&!zc(r,t))this.dropDerivedCaches("policySettings");return!0}walkReadManagedFileIn(e,t){for(let[n,r]of this.parsedFiles)if(!n.includes("\x00")&&!this.primedFiles.has(n)&&(r.settings!==null||r.errors.length>0)&&(n===e||bN(n)===t))return!0;return!1}walkRead(e){return this.parsedFiles.has(e)&&!this.primedFiles.has(e)}hasParsedDropInOutside(e,t){for(let n of this.parsedFiles.keys())if(!n.includes("\x00")&&!this.primedFiles.has(n)&&bN(n)===e&&!t.includes(Bie(n)))return!0;return!1}clearFolderListing(e,t){if(t!==this.epoch)return;if(this.retainedListings.delete(e),!this.folderListings.has(e)||this.walkedFolders.has(e))return;this.folderListings.delete(e),this.dropDerivedCaches("policySettings")}retainLayer(e,t){let n={parsed:t};return this.retained.set(e,n),()=>{if(this.retained.get(e)===n)this.retained.delete(e)}}dropRetainedLayer(e){this.retained.delete(e)}retainFolderListing(e,t){let n={names:t};return this.retainedListings.set(e,n),()=>{if(this.retainedListings.get(e)===n)this.retainedListings.delete(e)}}}class EN{ownerUidsByRoot=new Map;realHomeDir=void 0;canonicalRootOwnerUids(e,t){let n=this.ownerUidsByRoot.get(e);if(n!==void 0)return n;let r=t(e);return this.ownerUidsByRoot.set(e,r),r}hasCanonicalRootOwnerUids(e){return this.ownerUidsByRoot.has(e)}primeCanonicalRootOwnerUids(e,t){if(this.ownerUidsByRoot.has(e))return!1;return this.ownerUidsByRoot.set(e,t),!0}clearCanonicalRootOwnerUids(){this.ownerUidsByRoot.clear()}normalizedRealHomeDir(e){return this.realHomeDir??=e(),this.realHomeDir}clearNormalizedRealHomeDir(){this.realHomeDir=void 0}}var cx=new Je(()=>new eg);function tg(){return{sent:new Set,rejected:new Set,declaredTools:void 0,declaredToolsDecided:!1,readsTranscriptRecord:!0,nameOnlyAnnouncements:new Set,surfacedOnWire:new Set}}function lx(e){let t=tg();return t.declaredTools=e.declaredTools,t.declaredToolsDecided=e.declaredToolsDecided,t.readsTranscriptRecord=e.readsTranscriptRecord,t}import{realpathSync as xN}from"node:fs";import{cwd as Kie}from"node:process";function vN(e){return process.platform==="darwin"?e.normalize("NFC"):e}function ux(){let e="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof xN==="function")try{let t=Kie();try{e=vN(xN(t))}catch{e=vN(t)}}catch{}return e}var AN=ux(),wN=(()=>{if(typeof process>"u"||typeof process.cwd!=="function")return null;try{return process.cwd()}catch{return null}})();function dx(){if(wN===null)return null;let e=process.env.CLAUDE_CODE_SESSION_KIND;return e!==void 0&&String(e).trim()==="bg"?null:wN}class px{spawner=void 0;pairings=new Map;mainEnsureInFlight=!1;mainSlotBlocked=!1}class fx{#e=tg();#t=new Map;#n=void 0;stickyBetas(){return this.#e}unlatchStickyBetas(){this.#e=lx(this.#e)}perTurnEffortPins(){return this.#t}atisLatch(){return this.#n}replaceAtisLatch(e){this.#n=e}reset(){this.#e=tg(),this.#t=new Map,this.#n=void 0}}var Gie=function(){try{var e=Yn(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Hc=Gie;function Wie(e,t,n){if(t=="__proto__"&&Hc)Hc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0});else e[t]=n}var qs=Wie;function Vie(e){return function(t,n,r){var o=-1,s=Object(t),i=r(t),a=i.length;while(a--){var c=i[e?a:++o];if(n(s[c],c,s)===!1)break}return t}}var TN=Vie;var qie=TN(),ng=qie;function Zie(e,t){return e&&ng(e,t,zo)}var CN=Zie;var Yie=1,Jie=2;function Xie(e,t,n,r){var o=n.length,s=o,i=!r;if(e==null)return!s;e=Object(e);while(o--){var a=n[o];if(i&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}while(++o<s){a=n[o];var c=a[0],l=e[c],u=a[1];if(i&&a[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Uo;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?$c(u,l,Yie|Jie,r,d):f))return!1}}return!0}var kN=Xie;function Qie(e){return e===e&&!Ht(e)}var rg=Qie;function eae(e){var t=zo(e),n=t.length;while(n--){var r=t[n],o=e[r];t[n]=[r,o,rg(o)]}return t}var RN=eae;function tae(e,t){return function(n){if(n==null)return!1;return n[e]===t&&(t!==void 0||(e in Object(n)))}}var og=tae;function nae(e){var t=RN(e);if(t.length==1&&t[0][2])return og(t[0][0],t[0][1]);return function(n){return n===e||kN(n,e,t)}}var ON=nae;var rae="[object Symbol]";function oae(e){return typeof e=="symbol"||Zt(e)&&hr(e)==rae}var Bc=oae;var sae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,iae=/^\w*$/;function aae(e,t){if(Tt(e))return!1;var n=typeof e;if(n=="number"||n=="symbol"||n=="boolean"||e==null||Bc(e))return!0;return iae.test(e)||!sae.test(e)||t!=null&&e in Object(t)}var Kc=aae;var cae="Expected a function";function mx(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(cae);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=e.apply(this,r);return n.cache=s.set(o,i)||s,i};return n.cache=new(mx.Cache||Xi),n}mx.Cache=Xi;var Ed=mx;var lae=500;function uae(e){var t=Ed(e,function(r){if(n.size===lae)n.clear();return r}),n=t.cache;return t}var PN=uae;var dae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pae=/\\(\\)?/g,fae=PN(function(e){var t=[];if(e.charCodeAt(0)===46)t.push("");return e.replace(dae,function(n,r,o,s){t.push(o?s.replace(pae,"$1"):r||n)}),t}),IN=fae;function mae(e,t){var n=-1,r=e==null?0:e.length,o=Array(r);while(++n<r)o[n]=t(e[n],n,e);return o}var Gc=mae;var hae=1/0,DN=an?an.prototype:void 0,LN=DN?DN.toString:void 0;function NN(e){if(typeof e=="string")return e;if(Tt(e))return Gc(e,NN)+"";if(Bc(e))return LN?LN.call(e):"";var t=e+"";return t=="0"&&1/e==-hae?"-0":t}var MN=NN;function gae(e){return e==null?"":MN(e)}var UN=gae;function _ae(e,t){if(Tt(e))return e;return Kc(e,t)?[e]:IN(UN(e))}var Ir=_ae;var yae=1/0;function Sae(e){if(typeof e=="string"||Bc(e))return e;var t=e+"";return t=="0"&&1/e==-yae?"-0":t}var gr=Sae;function bae(e,t){t=Ir(t,e);var n=0,r=t.length;while(e!=null&&n<r)e=e[gr(t[n++])];return n&&n==r?e:void 0}var Zs=bae;function Eae(e,t,n){var r=e==null?void 0:Zs(e,t);return r===void 0?n:r}var FN=Eae;function xae(e,t){return e!=null&&t in Object(e)}var $N=xae;function vae(e,t,n){t=Ir(t,e);var r=-1,o=t.length,s=!1;while(++r<o){var i=gr(t[r]);if(!(s=e!=null&&n(e,i)))break;e=e[i]}if(s||++r!=o)return s;return o=e==null?0:e.length,!!o&&Nc(o)&&Ws(i,o)&&(Tt(e)||ls(e))}var zN=vae;function wae(e,t){return e!=null&&zN(e,t,$N)}var sg=wae;var Aae=1,Tae=2;function Cae(e,t){if(Kc(e)&&rg(t))return og(gr(e),t);return function(n){var r=FN(n,e);return r===void 0&&r===t?sg(n,e):$c(t,r,Aae|Tae)}}var jN=Cae;function kae(e){return e}var Wc=kae;function Rae(e){return function(t){return t==null?void 0:t[e]}}var HN=Rae;function Oae(e){return function(t){return Zs(t,e)}}var BN=Oae;function Pae(e){return Kc(e)?HN(gr(e)):BN(e)}var KN=Pae;function Iae(e){if(typeof e=="function")return e;if(e==null)return Wc;if(typeof e=="object")return Tt(e)?jN(e[0],e[1]):ON(e);return KN(e)}var Ys=Iae;function Dae(e,t){var n={};return t=Ys(t,3),CN(e,function(r,o,s){qs(n,o,t(r,o,s))}),n}var xd=Dae;function Lae(e,t){var n,r=-1,o=e.length;while(++r<o){var s=t(e[r]);if(s!==void 0)n=n===void 0?s:n+s}return n}var GN=Lae;function Nae(e,t){return e&&e.length?GN(e,Ys(t,2)):0}var Vc=Nae;function ig(e){let t=Object.create(null);return Object.assign(t,e)}class hx{#e=0;#t=0;#n=0;#r=0;#s=Date.now();#u=void 0;#c=0;#l=0;#a=!1;#o=ig();#i=null;#f=null;#p=null;totalCostUSD(){return this.#e}totalAPIDuration(){return this.#t}totalAPIDurationWithoutRetries(){return this.#n}totalToolDuration(){return this.#r}totalDuration(){return Math.max(0,Date.now()-this.#s)}sessionStartTime(){return this.#u??this.#s}totalLinesAdded(){return this.#c}totalLinesRemoved(){return this.#l}hasUnknownModelCost(){return this.#a}modelUsage(){return this.#o}usageForModel(e){return this.#o[e]}totalInputTokens(){return Vc(Object.values(this.#o),"inputTokens")}totalOutputTokens(){return Vc(Object.values(this.#o),"outputTokens")}totalCacheReadInputTokens(){return Vc(Object.values(this.#o),"cacheReadInputTokens")}totalCacheCreationInputTokens(){return Vc(Object.values(this.#o),"cacheCreationInputTokens")}totalWebSearchRequests(){return Vc(Object.values(this.#o),"webSearchRequests")}recordApiDuration(e,t){this.#t+=e,this.#n+=t}recordCost(e,t,n){this.#o[n]=t,this.#e+=e}recordToolDuration(e){this.#r+=e}recordLinesChanged(e,t){this.#c+=e,this.#l+=t}markUnknownModelCost(){this.#a=!0}zeroDurationsAndCostForTests(){this.#t=0,this.#n=0,this.#e=0}restartClock(){this.#s=Date.now(),this.anchorLogicalStart(void 0)}anchorLogicalStart(e){this.#u=e===void 0?void 0:Math.min(e,this.#s)}restore({totalCostUSD:e,totalAPIDuration:t,totalAPIDurationWithoutRetries:n,totalToolDuration:r,totalLinesAdded:o,totalLinesRemoved:s,lastDuration:i,startTime:a,modelUsage:c,hasUnknownModelCost:l},u){if(this.#p=u,this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#c=o,this.#l=s,this.#a=l??!1,c)this.#o=ig(c);if(i!==void 0)this.#s=Date.now()-i;this.anchorLogicalStart(a)}registerSaver(e){this.#i=e}runSaver(e,t){(this.#i??(t?t.#i:null))?.(e)}registerTranscriptRecorder(e){this.#f=e}runTranscriptRecorder(e,t,n){(this.#f??(n?n.#f:null))?.(e,t)}snapshot(){return{ownerSessionId:this.#p,totalCostUSD:this.#e,totalAPIDuration:this.#t,totalAPIDurationWithoutRetries:this.#n,totalToolDuration:this.#r,startTime:this.#s,sessionLogicalStartTime:this.#u,totalLinesAdded:this.#c,totalLinesRemoved:this.#l,hasUnknownModelCost:this.#a,modelUsage:xd(this.#o,(e)=>({...e}))}}restoreSnapshot(e){this.#p=e.ownerSessionId,this.#e=e.totalCostUSD,this.#t=e.totalAPIDuration,this.#n=e.totalAPIDurationWithoutRetries,this.#r=e.totalToolDuration,this.#s=e.startTime,this.#u=e.sessionLogicalStartTime,this.#c=e.totalLinesAdded,this.#l=e.totalLinesRemoved,this.#a=e.hasUnknownModelCost,this.#o=ig(xd(e.modelUsage,(t)=>({...t})))}claim(e){this.#p??=e}scopeTo(e){this.#p=e}ownerSessionId(){return this.#p}belongsTo(e){return this.#p===e}reset(e){this.#p=e,this.#e=0,this.#t=0,this.#n=0,this.#r=0,this.#s=Date.now(),this.anchorLogicalStart(void 0),this.#c=0,this.#l=0,this.#a=!1,this.#o=ig()}}class gx{#e=!1;fableConsentSessionFallback(){return this.#e}replaceFableConsentSessionFallback(e){this.#e=e}reset(){this.#e=!1}}class _x{#e={registeredHooks:null};#t=void 0;#n=void 0;holder(){return this.#e}mainThreadAgentType(){return this.#t}replaceMainThreadAgentType(e){this.#t=e}mainThreadAgentHooks(){return this.#n}replaceMainThreadAgentHooks(e){this.#n=e}reset(){this.#e={registeredHooks:null},this.#t=void 0,this.#n=void 0}}class yx{#e=new Map;skills(){return this.#e}lookup(e){return this.#e.get(e)}record(e,t){this.#e.set(e,t)}forget(e){this.#e.delete(e)}forgetAll(){this.#e.clear()}reset(){this.#e=new Map}}class Sx{#e=[];#t;#n;#r;#s;approvedServers(){return this.#e}approveServers(e,t){for(let n of t)if(!this.#e.some((r)=>r.name===n&&r.workspaceKey===e))this.#e.push({name:n,workspaceKey:e})}registerClientsAccessor(e){this.#t=e}acquireClientsAccessor(e){if(this.#t)return()=>{};return this.#t=e,()=>{if(this.#t===e)this.#t=void 0}}clientsFromAccessor(){return this.#t?.()}registerConnectedClientWiring(e){this.#n=e}connectedClientWiring(){return this.#n}registerToolsSwapper(e){this.#r=e}acquireToolsSwapper(e){if(this.#r)return()=>{};return this.#r=e,()=>{if(this.#r===e)this.#r=void 0}}swapServerTools(e,t){if(!this.#r)return!1;return this.#r(e,t)}registerConnections(e){this.#s=e}acquireConnections(e){if(this.#s)return()=>{};return this.#s=e,()=>{if(this.#s===e)this.#s=void 0}}connections(){return this.#s}reset(){this.#e=[],this.#t=void 0}}class bx{#e=void 0;#t=void 0;#n=void 0;#r=void 0;#s=void 0;#u=void 0;#c=!1;#l=!1;#a=void 0;#o=void 0;mainLoopModelOverride(){return this.#e}overrideMainLoopModel(e){this.#e=e}mainLoopEffortState(){return this.#t}replaceMainLoopEffortState(e){this.#t=e}initialMainLoopModel(){return this.#n}replaceInitialMainLoopModel(e){this.#n=e}initialModelSettingLayer(){return this.#r}replaceInitialModelSettingLayer(e){this.#r=e}resolvedOrgDefault(){return this.#s}replaceResolvedOrgDefault(e){this.#s=e}initialEnvDefaultModel(){return this.#u}replaceInitialEnvDefaultModel(e){this.#u=e}refusalFallbackOccurred(){return this.#c}markRefusalFallbackOccurred(e){this.#c=!0,this.#a??=e}refusalFallbackHeaderArmed(){return this.#l}armRefusalFallbackHeader(e){this.#l=!0,this.#a??=e}refusalFallbackLatchOriginRequestId(){return this.#a}forgetRefusalFallbackOccurred(){this.#c=!1,this.#l=!1,this.#a=void 0}refusalFallbackModelLatch(){return this.#o}replaceRefusalFallbackModelLatch(e){this.#o=e}unlatchRefusalFallbackModel(){this.#o=void 0}reset(){this.#e=void 0,this.#t=void 0,this.#n=void 0,this.#r=void 0,this.#s=void 0,this.#u=void 0,this.#c=!1,this.#l=!1,this.#a=void 0,this.#o=void 0}}class Ex{#e=new Map;#t=null;#n=0;#r=void 0;#s=null;sections(){return this.#e}recordSection(e,t){this.#e.set(e,t)}forgetAllSections(){this.#e.clear()}noteInvalidation(e="other"){this.#n+=1,this.#r=e}epoch(){return this.#n}lastInvalidationReason(){return this.#r}registerWordingLatchClear(e){this.#s=e}clearWordingLatch(e){(this.#s??(e?e.#s:null))?.()}lastEmittedDate(){return this.#t}replaceLastEmittedDate(e){this.#t=e}reset(){this.#e=new Map,this.#t=null}}class xx{#e=null;#t=null;#n=null;#r=null;#s=null;#u=0;#c=void 0;#l=null;#a=null;#o=!1;#i=null;#f=null;#p=!1;lastAPIRequest(){return this.#e}replaceLastAPIRequest(e){this.#e=e}lastCancelledAPIMessageId(){return this.#t}replaceLastCancelledAPIMessageId(e){this.#t=e}lastAPIRequestMessages(){return this.#n}replaceLastAPIRequestMessages(e){this.#n=e}lastClassifierRequests(){return this.#r}replaceLastClassifierRequests(e){this.#r=e}promptId(){return this.#s}replacePromptId(e){this.#s=e}promptIndex(){return this.#u}replacePromptIndex(e){this.#u=e}incrementPromptIndex(){return this.#u++,this.#u}lastMainRequestId(){return this.#c}replaceLastMainRequestId(e){this.#c=e}lastMainThreadCacheTtlMs(){return this.#l}replaceLastMainThreadCacheTtlMs(e){this.#l=e,this.#a=Date.now(),this.#o=!0}lastMainThreadRequestAt(){return this.#a}mainThreadRequestedInProcess(){return this.#o}recordMainThreadTurnStart(){this.#o=!0}replaceLastMainThreadRequest(e,t){this.#a=e,this.#l=t}lastMainThreadContextTokens(){return this.#i}replaceLastMainThreadContextTokens(e){this.#i=e}stageResumeSeed(e){this.#d=e}applyResumeSeed(e){this.#d=null,this.#l=e.ttlMs,this.#a=e.requestAt,this.#i=e.contextTokens}#d=null;clearLastMainThreadRequest(e){let t=e!==void 0&&this.#d?.sessionId===e?this.#d:null;this.#d=null,this.#l=t?.ttlMs??null,this.#a=t?.requestAt??null,this.#i=t?.contextTokens??null,this.#o=!1}lastApiCompletionTimestamp(){return this.#f}replaceLastApiCompletionTimestamp(e){this.#f=e}pendingPostCompaction(){return this.#p}replacePendingPostCompaction(e){this.#p=e}reset(){this.#e=null,this.#t=null,this.#n=null,this.#r=null,this.#s=null,this.#u=0,this.#c=void 0,this.#l=null,this.#a=null,this.#o=!1,this.#i=null,this.#d=null,this.#f=null,this.#p=!1}}class vx{#e=[];#t=Object.create(null);#n=null;#r=0;#s=!1;#u=0;tasks(){return this.#e}schedule(e){this.#e.push(e)}replaceTasks(e){this.#e=e}chainStartedAt(e){return this.#t[e]}recordChainStart(e,t){this.#t[e]=t}forgetChainStart(e){delete this.#t[e]}tickInFlightPrompt(){return this.#n}replaceTickInFlightPrompt(e){this.#n=e}consecutiveKeepalives(){return this.#r}replaceConsecutiveKeepalives(e){this.#r=e}ended(){return this.#s}replaceEnded(e){this.#s=e}wakeFires(){return this.#u}recordWakeFire(){this.#u++}resetWakeFires(){this.#u=0}reset(){this.#e=[],this.#t=Object.create(null),this.#n=null,this.#r=0,this.#s=!1,this.#u=0}}class wx{#e=!1;#t=!1;#n=!1;#r=!1;#s=!1;#u=!1;#c=!1;#l=!1;#a=!1;#o=!1;#i=null;#f=null;#p=null;#d=!1;#m=null;#g=!1;#h=!1;#_=!1;#E=!1;#S=!1;#b=void 0;#v=void 0;#x=void 0;#A=null;#T=null;onboardingShownThisSession(){return this.#e}replaceOnboardingShownThisSession(e){this.#e=e}lspRecommendationShownThisSession(){return this.#t}replaceLspRecommendationShownThisSession(e){this.#t=e}sessionTrustAccepted(){return this.#n}replaceSessionTrustAccepted(e){this.#n=e}homeTrustDialogAccepted(){return this.#r}replaceHomeTrustDialogAccepted(e){this.#r=e}hasExitedPlanMode(){return this.#s}replaceHasExitedPlanMode(e){this.#s=e}needsPlanModeExitAttachment(){return this.#u}replaceNeedsPlanModeExitAttachment(e){this.#u=e}needsAutoModeExitAttachment(){return this.#c}replaceNeedsAutoModeExitAttachment(e){this.#c=e}memoryToggledOff(){return this.#l}replaceMemoryToggledOff(e){this.#l=e}teardownUnwindRequested(){return this.#d}replaceTeardownUnwindRequested(e){this.#d=e}backgroundAutoModeSetupInFlight(){return this.#a}replaceBackgroundAutoModeSetupInFlight(e){this.#a=e}launchEffortPinsReleasedForSession(){return this.#o}markLaunchEffortPinsReleasedForSession(){this.#o=!0}restoreLaunchEffortPinsReleasedForSession(e){this.#o=e}deferredToolStubGateLatch(){return this.#i}replaceDeferredToolStubGateLatch(e){this.#i=e}verifySkillRolloutGateLatch(){return this.#f}replaceVerifySkillRolloutGateLatch(e){this.#f=e}commitSkillRolloutGateLatch(){return this.#p}replaceCommitSkillRolloutGateLatch(e){this.#p=e}memoryToolsShapeLatch(){return this.#m}replaceMemoryToolsShapeLatch(e){this.#m=e}proposeGoalAvailabilityLogged(){return this.#g}markProposeGoalAvailabilityLogged(){this.#g=!0}activeRoutine(){return this.#v}replaceActiveRoutine(e){this.#v=e}inheritedTeamName(){return this.#x}replaceInheritedTeamName(e){this.#x=e}teleportedSessionInfo(){return this.#A}replaceTeleportedSessionInfo(e){this.#A=e}markFirstTeleportMessageLogged(){if(this.#A)this.#A.hasLoggedFirstMessage=!0}cachedClaudeMdContent(){return this.#T}replaceCachedClaudeMdContent(e){this.#T=e}accountSkillsSyncEnabled(){return this.#h}replaceAccountSkillsSyncEnabled(e){this.#h=e}skillsSyncVetoed(){return this.#_}replaceSkillsSyncVetoed(e){this.#_=e}accountPluginsSyncEnabled(){return this.#E}replaceAccountPluginsSyncEnabled(e){this.#E=e}pluginsSyncVetoed(){return this.#S}replacePluginsSyncVetoed(e){this.#S=e}armPendingContextCompacted(e){this.#b=e}consumePendingContextCompacted(){let e=this.#b;return this.#b=void 0,e}forgetPendingContextCompacted(){this.#b=void 0}reset(){this.#h=!1,this.#_=!1,this.#E=!1,this.#S=!1,this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#s=!1,this.#u=!1,this.#c=!1,this.#l=!1,this.#d=!1,this.#a=!1,this.#o=!1,this.#i=null,this.#f=null,this.#p=null,this.#m=null,this.#g=!1,this.#v=void 0,this.#x=void 0,this.#A=null,this.#T=null,this.#b=void 0}}class Ax{#e=new Map;#t=new Map;#n=null;#r=new Map;#s=new Set;#u=new Set;#c=new Set;#l=new Set;#a=new Set;#o=new Set;#i=new Set;#f=new Set;#p=new Set;#d=new Map;#m=new Set;#g=void 0;#h=void 0;#_=void 0;planSlugCache(){return this.#e}forgetPlanSlug(e){this.#e.delete(e)}pendingBranchLinks(){return this.#t}replacePendingBranchLinks(){this.#t=new Map}vimSharedState(){return this.#n}replaceVimSharedState(e){this.#n=e}agentColorMap(){return this.#r}sessionCreatedTeams(){return this.#s}surfacedHookSpawnFailures(){return this.#u}bareMcpServerMatchersWarned(){return this.#c}pendingConversationEditKinds(){return this.#l}clientTruncatedAssistantIds(){return this.#a}heldStatelessReplyIds(){return this.#o}unsupportedThreadKeys(){return this.#i}pendingPrLinks(){return this.#f}policyPredicateTelemetryEmitted(){return this.#p}humanAttachmentDigests(){return this.#d}chromeAvailabilityStagesLogged(){return this.#m}replaceChromeAvailabilityStagesLogged(e){if(this.#m=new Set,e)this.#g=Date.now()}chromeAvailabilityAnchorMs(){return this.#g}pendingGoalIdleCheckin(){return this.#h}replacePendingGoalIdleCheckin(e){this.#h=e}workerCheckin(){return this.#_}replaceWorkerCheckin(e){this.#_=e}reset(){this.#e=new Map,this.#t=new Map,this.#n=null,this.#r=new Map,this.#s=new Set,this.#u=new Set,this.#c=new Set,this.#l=new Set,this.#a=new Set,this.#o=new Set,this.#i=new Set,this.#f=new Set,this.#p=new Set,this.#d=new Map,this.#m=new Set,this.#g=void 0,clearTimeout(this.#h),this.#h=void 0,clearInterval(this.#_?.timer),this.#_=void 0}}var WN={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};class Tx{#e=!1;#t=void 0;#n=void 0;#r=void 0;#s=null;#u=!1;#c=void 0;#l=WN;#a=!1;#o="idle";attacherCapsChanged=Ct();rvSupervisorLinkChanged=Ct();sdkDialogHostActive(){return this.#e}markSdkDialogHostActive(e){this.#e=e}sdkSupportedDialogKinds(){return this.#t}sdkSupportedDialogKindsSource(){return this.#n}declareDialogKinds(e,t){this.#t=e,this.#n=e===void 0?void 0:t}sdkPerTaskStopAffordance(){return this.#r}declarePerTaskStopAffordance(e){this.#r=e}attacherCaps(){return this.#s}replaceAttacherCaps(e){this.#s=e,this.attacherCapsChanged.emit()}rvSupervisorLinkLive(){return this.#u}replaceRvSupervisorLinkLive(e){if(this.#u===e)return;this.#u=e,this.rvSupervisorLinkChanged.emit()}sdkBetas(){return this.#c}replaceSdkBetas(e){this.#c=e}caps(){return this.#l}replaceCaps(e){this.#l=e}markRemote(e){this.#l={...this.#l,workspace:e?"remote":"local"}}replBridgeActive(){return this.#a}replaceReplBridgeActive(e){if(this.#a===e)return;this.#a=e}mainLoopBusy(){return this.#o!=="idle"}mainQueryRunning(){return this.#o==="running"}replaceMainLoopStatus(e){this.#o=e}reset(){this.#e=!1,this.#t=void 0,this.#n=void 0,this.#r=void 0,this.#s=null,this.#c=void 0,this.#l=WN,this.#a=!1,this.#o="idle",this.#u=!1,this.attacherCapsChanged.clear(),this.rvSupervisorLinkChanged.clear()}}class Cx{#e=0;#t=null;#n=0;outputTokensAtTurnStart(){return this.#e}budget(){return this.#t}continuationCount(){return this.#n}snapshotForTurn(e,t){this.#e=e,this.#t=t,this.#n=0}incrementContinuation(){this.#n++}reset(){this.#e=0,this.#t=null,this.#n=0}}var VN=150;class kx{#e=Date.now();#t=!1;interactionFired=Ct();#n=void 0;terminalFocusFired=Ct();#r=!1;#s;lastInteractionTime(){return this.#e}recordInteraction(e){if(e)this.#u();else this.#t=!0}flushIfDirty(){if(this.#t)this.#u()}#u(){this.#e=Date.now(),this.#t=!1,this.interactionFired.emit()}resetBaseline(){this.#e=Date.now(),this.#t=!1}terminalFocus(){return this.#n}updateTerminalFocus(e){this.#n=e,this.terminalFocusFired.emit()}scrollDraining(){return this.#r}markScrollActivity(){if(this.#r=!0,this.#s)clearTimeout(this.#s);this.#s=setTimeout(()=>{this.#r=!1,this.#s=void 0},VN),this.#s.unref?.()}async waitForScrollIdle(){while(this.#r)await new Promise((e)=>setTimeout(e,VN))}reset(){this.#e=Date.now(),this.#n=void 0,this.interactionFired.clear(),this.terminalFocusFired.clear()}}var Mae=["sdk_single_prompt_gate","subagent_estimate","subagent_final_turn"];class Rx{byAgent=new Map;attemptsByAgent=new Map;cappedFailuresByAgent=new Map;armGateEventEmitted=new Set;sidecarIo=Promise.resolve();rehydrateAttemptedSessions=new Set;sidecarReadsAhead=new Map;get(e){return this.byAgent.get(e)}has(e){return this.byAgent.has(e)}put(e,t){this.byAgent.set(e,t)}remove(e){this.byAgent.delete(e)}nextAttemptNumber(e){let t=(this.attemptsByAgent.get(e)??0)+1;return this.attemptsByAgent.set(e,t),t}consecutiveCountedFailures(e){return this.cappedFailuresByAgent.get(e)??0}recordCountedFailure(e){let t=(this.cappedFailuresByAgent.get(e)??0)+1;return this.cappedFailuresByAgent.set(e,t),t}clearCountedFailures(e){this.cappedFailuresByAgent.delete(e)}latchArmGateEvent(e){if(this.armGateEventEmitted.has(e))return!1;return this.armGateEventEmitted.add(e),!0}enqueueSidecarIo(e,t){return this.sidecarIo=this.sidecarIo.then(e,e).catch(t),this.sidecarIo}sidecarIoSettled(){return this.sidecarIo}hasAttemptedRehydrate(e){return this.rehydrateAttemptedSessions.has(e)}markRehydrateAttempted(e){this.rehydrateAttemptedSessions.add(e)}keepSidecarReadAhead(e,t){this.sidecarReadsAhead.delete(e);while(this.sidecarReadsAhead.size>=8){let n=this.sidecarReadsAhead.keys().next().value;if(n===void 0)break;this.sidecarReadsAhead.delete(n)}this.sidecarReadsAhead.set(e,t)}takeSidecarReadAhead(e){let t=this.sidecarReadsAhead.get(e);return this.sidecarReadsAhead.delete(e),t}dropSidecarReadAhead(e){this.sidecarReadsAhead.delete(e)}forgetSubagentTelemetry(e){this.attemptsByAgent.delete(e),this.cappedFailuresByAgent.delete(e);for(let t of Mae)this.armGateEventEmitted.delete(`${e}:${t}`)}}class Ox{#e=null;#t=null;mainAgentId(e){return this.#e??=tx(e),this.#e}projectDir(){return this.#t}replaceProjectDir(e){this.#t=e}}class Px{openToolUseId;answeredThisSession=!1;get answered(){return this.answeredThisSession}markAnswered(){this.answeredThisSession=!0}isOpenElsewhere(e){return this.openToolUseId!==void 0&&this.openToolUseId!==e}open(e){this.openToolUseId=e}closeFor(e){if(e!==void 0&&this.openToolUseId===e)this.openToolUseId=void 0}}class Ix{granted=!1;isGranted(){return this.granted}grant(){this.granted=!0}}class Dx{inFlight=null;startedForTurnEnd=!1;reset(){this.inFlight?.abort(),this.inFlight=null,this.startedForTurnEnd=!1}}class Lx{firstSyncPromise=null;syncErrors=[];syncedLaneOpened=!1;removalsDeferredHere=new Set;pendingTrashRemovals=[];ensureBucketRoot=null}class Nx{abortController=null;reset(){this.abortController?.abort(),this.abortController=null}}class Mx{#e=void 0;#t=void 0;ccrSessionID(){return this.#e}latchCcrSessionID(e){this.#e=e}syncEnabled(){return this.#t}latchSyncEnabled(e){return this.#t=e,e}}class Ux{autonomousPreambleDelivered=!1;lastLoopFileDelivered=null;reset(){this.autonomousPreambleDelivered=!1,this.lastLoopFileDelivered=null}}class Fx{exchanges=[];replace(e){this.exchanges=e}append(e,t,n){this.exchanges=[...this.exchanges,{question:e,response:t,...n&&{fallbackNotice:n}}].slice(-20)}pendingReopen=null;reopenAway=!1;get reopenPending(){return this.pendingReopen!==null}armReopen(e,t){if(this.pendingReopen){this.pendingReopen.owners.add(e);return}this.pendingReopen={owners:new Set([e]),cancel:t()}}clearPendingReopen(e){let t=this.pendingReopen;if(!t){this.reopenAway=!1;return}if(e!==void 0){if(t.owners.delete(e),t.owners.size>0)return}t.cancel(),this.pendingReopen=null,this.reopenAway=!1}reopener=null;setReopener(e){this.reopener=e}get hasReopener(){return this.reopener!==null}reopenNow(){return this.reopener?.()??!1}inFlightQuestions=[];get inFlight(){return this.inFlightQuestions.at(-1)??null}pendingBesidesTop(){return this.inFlightQuestions.slice(0,-1)}setInFlight(e){if(!this.inFlightQuestions.includes(e))this.inFlightQuestions=[...this.inFlightQuestions,e]}clearInFlight(e){if(this.inFlightQuestions.includes(e))this.inFlightQuestions=this.inFlightQuestions.filter((t)=>t!==e)}}import{lstatSync as aut,readlinkSync as cut,realpathSync as nM}from"fs";function Dr(e,t,n){return new Promise((r,o)=>{if(t?.aborted){if(n?.throwOnAbort||n?.abortError)o(n.abortError?.()??Error("aborted"));else r();return}let s=setTimeout((a,c,l)=>{a?.removeEventListener("abort",c),l()},e,t,i,r);function i(){if(clearTimeout(s),n?.throwOnAbort||n?.abortError)o(n.abortError?.()??Error("aborted"));else r()}if(t?.addEventListener("abort",i,{once:!0}),n?.unref)s.unref()})}function Uae(e,t){e(Error(t))}function Lr(e,t,n){let r,o=new Promise((s,i)=>{r=setTimeout(Uae,t,i,n)});return Promise.race([e,o]).finally(()=>{if(r!==void 0)clearTimeout(r)})}import{homedir as Fae}from"os";import{basename as fut,dirname as qN,isAbsolute as mut,join as hut,parse as gut,relative as _ut,resolve as qc,sep as ds}from"path";import*as Hx from"path";function ot(e){return process.platform==="darwin"?e.normalize("NFC"):e}function jo(e){return/^[\\/]{2}/.test(e)||pg(e)}function vd(e){return/(^|[\\/])\.\.([\\/]|$)/.test(e)}function ZN(e){if(/^[\\/]{2}[?.][\\/](?!unc[\\/])/i.test(e))return null;return e.match(/^[\\/]{2}(?:[?.][\\/]unc[\\/])?([^\\/]+)/i)?.[1]?.replace(/[A-Z]/g,(t)=>t.toLowerCase())??null}function Zc(e){return/(^|[\\/])\.{1,2}[. ]*([\\/]|$)/.test(e)}function Yc(e){return/^[\\/]{2}[?.][\\/]/.test(e)}function $ae(e){return/^[\\/](GLOBAL\?\?|GLOBALROOT|DosDevices|Device)[\\/]/i.test(e)}function rM(e,t){if(!jo(e))return!1;if(Yc(e)||pg(e))return!0;if(Zc(e))return!0;let n=ZN(e);return n===null||n!==ZN(t)}function oM(e){return e.length===2&&$x(e[0])==="net"||e.length===3&&$x(e[0])==="network"&&$x(e[1])==="servers"}function Bx(e){if(process.platform==="win32"||!e.startsWith("/"))return null;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}if(t.push(n),oM(t))return zae(n)}return null}function zae(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function $x(e){return e.replace(/[\u200c-\u200f\u202a-\u202e\u206a-\u206f\ufeff]/g,"").toUpperCase().toLowerCase()}function sM(e,t){if(!Jc(e))return!1;let n=Bx(e);return n===null||n!==Bx(t)}function Jc(e){if(process.platform==="win32")return!1;return Js(e)}function Js(e){return lg(e)!==null}function lg(e){if(!e.startsWith("/"))return null;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}if(t.push(n),oM(t))return"/"+t.join("/")}return null}function Xc(e){if(!e.startsWith("/"))return!1;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}t.push(n)}return t.length===1&&t[0].toLowerCase()==="net"}function wd(e){if(!e.startsWith("/"))return!1;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}if(t.push(n),t.length===1&&t[0].toLowerCase()==="network")return!0}return!1}function iM(e){if(process.platform!=="darwin")return!1;return wd(e)}function Ad(e){return ug(e)||Js(e)||wd(e)||Xc(e)||Yc(e)||pg(e)||$ae(e)}function ta(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function ug(e){return jo(e)&&!ta(e)}function Kx(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function aM(e){if(/^\\\\\?\\volume\{/i.test(e))return YN(e);if(pg(e))return!0;let t=Kx(e);if(t!==e&&YN(t))return!0;return jo(t)&&!ta(t)}function YN(e){return Zc(e)||e.includes("/")}function Gx(e){try{return Kx(nM.native(e))}catch{return null}}var jae=new Set(["EPERM","EBUSY","EACCES"]),Hae=4,Bae=50,JN;function ag(e){return Wae(e).real??null}function dg(e,t){let n=qc(t).toLowerCase(),r=qN(qc(e)).toLowerCase();if(r===n||XN(r,n)||QN(r,n,"lexical"))return!0;let o=ag(t)?.toLowerCase();if(o==null)return!1;let s=ag(qN(qc(e)))?.toLowerCase();if(s==null)return!0;return s===o||XN(s,o)||QN(s,o,"canonical")}var Kae=new Set(["node_modules",".venv","venv","env",".env","virtualenv",".tox",".nox",".direnv","__pypackages__"]);function XN(e,t){if(!e.startsWith(cg(t)+ds))return!1;return e.split(ds).some((n)=>Kae.has(n))}function cg(e){return e.endsWith(ds)?e.slice(0,-1):e}var zx;function QN(e,t,n){let r=Fae(),o=(process.env.LOCALAPPDATA??"").trim();if(n==="lexical")return jx(eM(r,o,(c)=>qc(c).toLowerCase()),e,t);let s=r+"\x00"+o;if(zx?.key===s)return jx(zx.aliasDirs,e,t);let i=!0,a=eM(r,o,(c)=>{if(!Gae(c))return qc(c).toLowerCase();let l=ag(c)?.toLowerCase();if(l==null)return i=!1,qc(c).toLowerCase();return l});if(i)zx={key:s,aliasDirs:a};return jx(a,e,t)}function eM(e,t,n){let r=[];if(e)r.push(cg(n(e))+ds+["appdata","local","microsoft","windowsapps"].join(ds));if(t){let o=cg(n(t))+ds+["microsoft","windowsapps"].join(ds);if(!r.includes(o))r.push(o)}return r}function Gae(e){return process.platform==="win32"?/^[A-Za-z]:[\\/](?![\\/])/.test(e):e.startsWith("/")&&!jo(e)}function jx(e,t,n){let r=cg(n);for(let o of e){if(!(o===r||o.startsWith(r+ds)))continue;if(t===o||t.startsWith(o+ds))return!0}return!1}function Wae(e){let t=qae(()=>Kx(nM.native(e)));return{real:t.value,code:t.code}}function Vae(e){return e!=null&&typeof e==="object"&&"code"in e&&typeof e.code==="string"?e.code:void 0}function qae(e){for(let t=0;;t++)try{return{value:e()}}catch(n){let r=Vae(n);if(r===void 0||process.platform!=="win32"||!jae.has(r)||t>=Hae-1)return{code:r};JN??=new Int32Array(new SharedArrayBuffer(4)),Atomics.wait(JN,0,0,Bae)}}function pg(e){return tM.test(e)||e.includes("??")&&tM.test(Zae(e))}var tM=/^[\\/]\?\?[\\/]/;function Zae(e){return Hx.win32?Hx.win32.normalize(e):e}var Yae=16;class Wx{pending=null;shownThisSession=!1;changed=Ct();submitted=[];submittedChanged=Ct();subscribe=this.changed.subscribe;getSnapshot=()=>this.pending;subscribeSubmitted=this.submittedChanged.subscribe;submit(e){if(this.shownThisSession)return;if(this.submitted.length>=Yae)this.submitted.shift();this.submitted.push(e),this.submittedChanged.emit()}takeSubmitted(){let e=this.submitted;return this.submitted=[],e}offer(e){if(this.shownThisSession)return;this.pending=e,this.changed.emit()}dismiss(){if(this.pending!==null)this.pending=null,this.changed.emit()}markShown(){this.shownThisSession=!0}}class Vx{lastEmittedAt=new Map;shouldEmit(e,t,n){let r=this.lastEmittedAt.get(e)||0;if(t-r<n)return!1;if(this.lastEmittedAt.size>=100){let o=this.lastEmittedAt.keys().next().value;if(o!==void 0)this.lastEmittedAt.delete(o)}return this.lastEmittedAt.set(e,t),!0}}var Jae=Symbol("permission-stash-evicted");class Zx{entriesCap;evictedKeysCap;lanes={write:new Map,read:new Map};evicted={write:new Set,read:new Set};poisoned={write:!1,read:!1};constructor(e=256,t=1048576){this.entriesCap=e;this.evictedKeysCap=t}stash(e,t,n,r="write"){if(e===void 0)return;let o=this.lanes[r],s=this.evicted[r],i=qx(e,t);if(s.has(i))return;let a=o.get(i);if(a!==void 0){let c=new Set(n);o.set(i,a.filter((l)=>c.has(l)));return}if(o.size>=this.entriesCap){let c=o.keys().next().value;if(c!==void 0){if(o.delete(c),s.add(c),s.size>this.evictedKeysCap){this.poisoned[r]=!0;let l=s.values().next().value;if(l!==void 0)s.delete(l)}}}o.set(i,n)}holds(e,t,n="write"){return e!==void 0&&this.lanes[n].has(qx(e,t))}consume(e,t,n="write"){if(e===void 0)return;let r=this.lanes[n],o=qx(e,t),s=r.get(o),i=s===void 0&&(this.evicted[n].delete(o)||this.poisoned[n]),a=`${e}\x00`;for(let c of r.keys())if(c.startsWith(a))r.delete(c);if(i)return Jae;return s}}function qx(e,t){return`${e}\x00${t}`}function cM(e){return lM({kind:"root",host:e.host,id:e.id,parentId:e.parentId},e.project)}function lM(e,t){let n=ot(t.originalCwd),r=ot(t.projectRoot),o=ot(t.cwd),s=Ct(),i=e.kind==="fork"?e.root.observers:new px,a=e.kind==="fork"?e.root.autonomousLoopPreamble:new Ux,c=e.kind==="fork"?e.root.precompute:new Rx,l={get originalCwd(){return n},get projectRoot(){return r},get cwd(){return o}},u={host:e.kind==="fork"?e.root.host:e.host,get id(){return e.kind==="fork"?e.root.id:e.id},get parentId(){return e.kind==="fork"?e.root.parentId:e.parentId},get root(){return e.kind==="fork"?e.root:u},project:l,observers:i,autonomousLoopPreamble:a,btwHistory:e.kind==="fork"?e.root.btwHistory:new Fx,ccrRecap:e.kind==="fork"?e.root.ccrRecap:new Dx,conversationLatches:e.kind==="fork"?e.root.conversationLatches:new fx,costLedger:e.kind==="fork"?e.root.costLedger:new hx,fableConsentSlots:e.kind==="fork"?e.root.fableConsentSlots:new gx,hookRegistry:e.kind==="fork"?e.root.hookRegistry:new _x,identity:e.kind==="fork"?e.root.identity:new Ox,invokedSkills:e.kind==="fork"?e.root.invokedSkills:new yx,mcpSessionWiring:e.kind==="fork"?e.root.mcpSessionWiring:new Sx,modelSelection:e.kind==="fork"?e.root.modelSelection:new bx,promptAssembly:e.kind==="fork"?e.root.promptAssembly:new Ex,promptSuggestion:e.kind==="fork"?e.root.promptSuggestion:new Nx,pendingHint:e.kind==="fork"?e.root.pendingHint:new Wx,pluginsSync:e.kind==="fork"?e.root.pluginsSync:new Lx,precompute:c,requestJournal:e.kind==="fork"?e.root.requestJournal:new xx,sessionCron:e.kind==="fork"?e.root.sessionCron:new vx,sessionFlags:e.kind==="fork"?e.root.sessionFlags:new wx,sessionRefsGate:e.kind==="fork"?e.root.sessionRefsGate:new Mx,sessionScratch:e.kind==="fork"?e.root.sessionScratch:new Ax,surfaceCapabilities:e.kind==="fork"?e.root.surfaceCapabilities:new Tx,toolProgressThrottle:e.kind==="fork"?e.root.toolProgressThrottle:new Vx,turnBudget:e.kind==="fork"?e.root.turnBudget:new Cx,userPresence:e.kind==="fork"?e.root.userPresence:new kx,workflowUsageConsent:e.kind==="fork"?e.root.workflowUsageConsent:new Ix,outsideReadPrompt:e.kind==="fork"?e.root.outsideReadPrompt:new Px,writePermissionStash:e.kind==="fork"?e.root.writePermissionStash:new Zx,subscribe(d){let f=s.subscribe(d);if(e.kind!=="fork")return f;let m=e.root,{id:h,parentId:_}=m,y=m.subscribe(()=>{if(m.id===h&&m.parentId===_)return;h=m.id,_=m.parentId,d()});return()=>{f(),y()}},setCwd(d){u.update({project:{cwd:d}})},withProject(d){return lM({kind:"fork",root:u.root},{originalCwd:d.originalCwd??n,projectRoot:d.projectRoot??r,cwd:d.cwd??o})},update(d){let f=!1;if(d.id!==void 0||"parentId"in d){if(e.kind==="fork")throw Error("A withProject fork cannot re-identify the session — update the root session instead");if(d.id!==void 0&&d.id!==e.id)e.id=d.id,f=!0;if("parentId"in d&&d.parentId!==e.parentId)e.parentId=d.parentId,f=!0}let m=d.project;if(m){if(m.originalCwd!==void 0){let h=ot(m.originalCwd);if(h!==n)n=h,f=!0}if(m.projectRoot!==void 0){let h=ot(m.projectRoot);if(h!==r)r=h,f=!0}if(m.cwd!==void 0){let h=ot(m.cwd);if(h!==o)o=h,f=!0}}if(f)s.emit()}};return u}class fg{#e;#t=new WeakMap;constructor(e){this.#e=e}peek(e){return this.#t.get(e.root)}of(e){let t=e.root,n=this.#t.get(t);if(n!==void 0)return n;let r=this.#e();return this.#t.set(t,r),r}drop(e){this.#t.delete(e.root)}}class Yx{#e=!1;#t=null;#n=!1;#r=void 0;#s=!1;#u=!1;#c=!1;#l=!1;#a=void 0;#o=!1;#i=!1;#f=null;#p=null;#d=new Map;#m="cli";#g="fresh";#h=void 0;#_=!1;#E=[];#S=!1;#b=!1;#v=!1;#x=!1;#A="none";#T=!1;#R=!1;#L=!1;#w=!1;#U=!1;#O=!0;#P=null;#N=!1;#C=null;#k=!1;#M=!1;#I={};isInteractive(){return this.#e}replaceIsInteractive(e){this.#e=e}printOutputFormat(){return this.#t}replacePrintOutputFormat(e){this.#t=e}thinkingDisplayExplicit(){return this.#n}replaceThinkingDisplayExplicit(e){this.#n=e}permissionPromptToolName(){return this.#r}replacePermissionPromptToolName(e){this.#r=e}hasStreamingInput(){return this.#s}replaceHasStreamingInput(e){this.#s=e}singleShotPrintSession(){return this.#u}replaceSingleShotPrintSession(e){this.#u=e}printInputClosed(){return this.#c}markPrintInputClosed(){this.#c=!0}modelOverrideOptOutForSession(){return this.#l}replaceModelOverrideOptOutForSession(e){this.#l=e}rendererMode(){return this.#a}replaceRendererMode(e){this.#a=e}strictToolResultPairing(){return this.#o}replaceStrictToolResultPairing(e){this.#o=e}restrictedSession(){return this.#i}replaceRestrictedSession(e){this.#i=e}workspaceRestrictionState(){return this.#f}replaceWorkspaceRestrictionState(e){this.#f=e}replaceWorkspaceRestrictionUnsubscribe(e){this.#p?.(),this.#p=e}restrictedWorkspaceRoots(){return this.#d}addRestrictedWorkspaceRoot(e,t){this.#d.set(e,t)}clearRestrictedWorkspaceRoots(){this.#d=new Map}clientType(){return this.#m}replaceClientType(e){this.#m=e}sessionStartType(){return this.#g}replaceSessionStartType(e){this.#g=e}questionPreviewFormat(){return this.#h}replaceQuestionPreviewFormat(e){this.#h=e}extendedQuestionsEnabled(){return this.#_}replaceExtendedQuestionsEnabled(e){this.#_=e}replConfigArgv(){return this.#E}replaceReplConfigArgv(e){this.#E=e}userMsgOptIn(){return this.#S}replaceUserMsgOptIn(e){this.#S=e}searchToolsOptIn(){return this.#b}replaceSearchToolsOptIn(e){this.#b=e}todoToolsOptIn(){return this.#v}replaceTodoToolsOptIn(e){this.#v=e}wizardOperatorToolsEnabled(){return this.#x}replaceWizardOperatorToolsEnabled(e){this.#x=e}pollEventIngress(){return this.#A}markPollEventIngress(e){this.#A=e}sdkAgentProgressSummariesEnabled(){return this.#T}replaceSdkAgentProgressSummariesEnabled(e){this.#T=e}sessionPersistenceDisabled(){return this.#R}replaceSessionPersistenceDisabled(e){this.#R=e}diskless(){return this.#L}replaceDiskless(e){this.#L=e}sessionBypassPermissionsMode(){return this.#w}replaceSessionBypassPermissionsMode(e){this.#w=e}disableSlashCommands(){return this.#U}replaceDisableSlashCommands(e){this.#U=e}mayForwardHomeSettings(){return this.#O}replaceMayForwardHomeSettings(e){this.#O=e}homeSettingsHostConsent(){return this.#P}replaceHomeSettingsHostConsent(e){this.#P=e}scheduledTasksEnabled(){return this.#N}replaceScheduledTasksEnabled(e){this.#N=e}initJsonSchema(){return this.#C}replaceInitJsonSchema(e){this.#C=e}cliSessionConfigCarried(){return this.#k}replaceCliSessionConfigCarried(e){this.#k=e}forkRestrictedLaunchConfig(){return this.#M}replaceForkRestrictedLaunchConfig(e){this.#M=e}forkReplayLaunchConfig(){return this.#I}replaceForkReplayLaunchConfig(e){this.#I=e}reset(){this.#e=!1,this.#t=null,this.#n=!1,this.#r=void 0,this.#s=!1,this.#u=!1,this.#c=!1,this.#l=!1,this.#a=void 0,this.#o=!1,this.#i=!1,this.#f=null,this.replaceWorkspaceRestrictionUnsubscribe(null),this.#d=new Map,this.#m="cli",this.#g="fresh",this.#h=void 0,this.#_=!1,this.#E=[],this.#S=!1,this.#b=!1,this.#v=!1,this.#x=!1,this.#A="none",this.#T=!1,this.#R=!1,this.#L=!1,this.#w=!1,this.#U=!1,this.#O=!0,this.#P=null,this.#N=!1,this.#C=null,this.#k=!1,this.#M=!1,this.#I={}}}class Jx{#e=void 0;#t=void 0;#n=void 0;#r=null;#s=null;#u=!1;#c=uM();#l=null;#a=!1;flagSettingsPath(){return this.#e}replaceFlagSettingsPath(e){this.#e=e}flagSettingsExpectedContent(){return this.#t}replaceFlagSettingsExpectedContent(e){this.#t=e}flagSettingsFilePinnedContent(){return this.#n}replaceFlagSettingsFilePinnedContent(e){this.#n=e}flagSettingsInline(){return this.#r}replaceFlagSettingsInline(e){this.#r=e}parentManagedSettings(){return this.#s}replaceParentManagedSettings(e){this.#s=e}parentManagedSettingsInvalid(){return this.#u}replaceParentManagedSettingsInvalid(e){this.#u=e}allowedSettingSources(){return this.#c}replaceAllowedSettingSources(e){this.#c=e}allowedSettingSourcesWithoutRepoDirSources(){let e=this.#c;if(this.#l?.of!==e)this.#l={of:e,result:e.filter((t)=>t!=="projectSettings"&&t!=="localSettings")};return this.#l.result}useCoworkPlugins(){return this.#a}replaceUseCoworkPlugins(e){this.#a=e}reset(){this.#e=void 0,this.#t=void 0,this.#n=void 0,this.#r=null,this.#s=null,this.#u=!1,this.#c=uM(),this.#l=null,this.#a=!1}}function uM(){return["userSettings","projectSettings","localSettings","flagSettings","policySettings"]}class Xx{#e=[];#t=[];#n=[];#r=void 0;#s=new Map;#u=new Map;#c=[];#l=[];#a=!1;#o=void 0;#i=void 0;#f=void 0;inlinePlugins(){return this.#e}replaceInlinePlugins(e){this.#e=e}inlinePluginsNoMcp(){return this.#t}replaceInlinePluginsNoMcp(e){this.#t=e}inlinePluginUrls(){return this.#n}replaceInlinePluginUrls(e){this.#n=e}syncedPluginDirs(){return this.#r??[]}syncedPluginDirsRegistered(){return this.#r!==void 0}syncedPluginAttestation(e){return this.#s.get(e)}replaceSyncedPluginDirs(e,t=new Map){this.#r=e,this.#s=t,this.#u=this.#p(this.#u)}clearSyncedPluginDirs(){this.#r=void 0,this.#s=new Map,this.#u=new Map}attestedOfficialPluginMarketplace(e){return this.#u.get(e)}replaceAttestedOfficialPluginIds(e){this.#u=this.#p(e)}#p(e){let t=new Set([...this.#s.values()].map((n)=>`${n.pluginName}@${n.marketplace}`));return new Map([...e].filter(([n,r])=>t.has(`${n.slice(0,n.lastIndexOf("@"))}@${r}`)))}additionalDirectoriesForClaudeMd(){return this.#c}replaceAdditionalDirectoriesForClaudeMd(e){this.#c=e}allowedChannels(){return this.#l}replaceAllowedChannels(e){this.#l=e}hasDevChannels(){return this.#a}replaceHasDevChannels(e){this.#a=e}sessionSkillAllowlist(){return this.#o}replaceSessionSkillAllowlist(e){this.#o=e}chromeFlagOverride(){return this.#i}replaceChromeFlagOverride(e){this.#i=e}teammateAgentId(){return this.#f}replaceTeammateAgentId(e){this.#f=e}reset(){this.#e=[],this.#t=[],this.#n=[],this.clearSyncedPluginDirs(),this.#c=[],this.#l=[],this.#a=!1,this.#o=void 0,this.#i=void 0,this.#f=void 0}}class Qx{#e=null;#t=null;modelStrings(){return this.#e}replaceModelStrings(e){this.#e=e}invalidate(){this.#e=null}admin3PSteeringSnapshot(){return this.#t}recordAdmin3PSteeringSnapshot(e){this.#t=e}reset(){this.#e=null,this.#t=null}}var dM=[];class ev{#e=[];#t=[];#n=void 0;errorLog(){return this.#e}recordError(e){if(this.#e.length>=100)this.#e.shift();this.#e.push(e)}recordSlowOperation(e,t){return}slowOperations(){if(this.#t.length===0)return dM;let e=Date.now();if(this.#t.some((t)=>e-t.timestamp>=1e4)){if(this.#t=this.#t.filter((t)=>e-t.timestamp<1e4),this.#t.length===0)return dM}return this.#t}recordDevBarAlert(e){return}devBarAlert(){let e=this.#n;if(e&&Date.now()-e.timestamp>=60000){this.#n=void 0;return}return e}reset(){this.#e=[],this.#t=[],this.#n=void 0}}function pM(){return{rateTokens:null,rateLastRefillMs:null,featureOkLogged:!1,reportedDropReasons:new Set}}class tv{#e=null;#t=null;#n=null;#r=null;#s=null;#u=null;#c=null;#l=null;#a=null;#o=null;#i=null;#f=null;#p=null;#d=[];#m=null;#g=pM();#h=null;#_=null;#E=null;#S={direct:null,proxied:null};#b=null;#v=null;installMeter(e,t,{omitUnits:n=!1}={}){this.#e=e;let r=(o)=>n?void 0:o;this.#t=t("claude_code.session.count",{description:"Count of CLI sessions started"}),this.#n=t("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed and the 'model' attribute indicating which model made the change"}),this.#r=t("claude_code.pull_request.count",{description:"Number of pull requests created"}),this.#s=t("claude_code.commit.count",{description:"Number of git commits created"}),this.#u=t("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:r("USD")}),this.#c=t("claude_code.token.usage",{description:"Number of tokens used",unit:r("tokens")}),this.#l=t("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),this.#a=t("claude_code.active_time.total",{description:"Total active time in seconds",unit:r("s")})}meter(){return this.#e}sessionCounter(){return this.#t}locCounter(){return this.#n}prCounter(){return this.#r}commitCounter(){return this.#s}costCounter(){return this.#u}tokenCounter(){return this.#c}codeEditToolDecisionCounter(){return this.#l}activeTimeCounter(){return this.#a}statsStore(){return this.#o}replaceStatsStore(e){this.#o=e}loggerProvider(){return this.#i}replaceLoggerProvider(e){this.#i=e}eventLogger(){return this.#f}eventLoggerOwner(){return this.#p}attachEventLogger(e,t){if(this.#f=e,this.#p=e?t:null,!e)return;let n=this.#d;if(this.#d=null,n)for(let r of n)e.emit(r)}bufferPendingEvent(e){if(this.#d===null||this.#d.length>=100)return!1;return this.#d.push(e),!0}closeWindow(e){this.#d=null,this.#m=e}windowCloseCause(){return this.#m}isWindowOpen(){return this.#d!==null}hostOtel(){return this.#g}meterProvider(){return this.#h}replaceMeterProvider(e){this.#h=e}tracerProvider(){return this.#_}replaceTracerProvider(e){this.#_=e}cachedTelemetryResource(){return this.#E}replaceCachedTelemetryResource(e){this.#E=e}cachedOtlpHttpAgentFactory(e){return this.#S[e?"proxied":"direct"]}replaceCachedOtlpHttpAgentFactory(e,t){this.#S[e?"proxied":"direct"]=t}inClusterOtlpTrustRoots(){return this.#b}replaceInClusterOtlpTrustRoots(e){this.#b=e}inClusterOtlpAgentFactory(){return this.#v}replaceInClusterOtlpAgentFactory(e){this.#v=e}reset(){this.#e=null,this.#t=null,this.#n=null,this.#r=null,this.#s=null,this.#u=null,this.#c=null,this.#l=null,this.#a=null,this.#o=null,this.#i=null,this.#f=null,this.#p=null,this.#d=[],this.#m=null,this.#g=pM(),this.#h=null,this.#_=null,this.#E=null,this.#S={direct:null,proxied:null},this.#b=null,this.#v=null}}class nv{#e=void 0;#t=void 0;#n=!1;#r=void 0;#s=void 0;#u=new Set;#c=void 0;#l=null;#a=null;#o=0;#i=!1;#f=()=>!1;#p=null;#d=void 0;#m=null;#g=null;sessionIngressToken(){return this.#e}replaceSessionIngressToken(e){this.#e=e}oauthTokenFromFd(){return this.#t}replaceOauthTokenFromFd(e){this.#t=e}oauthTokenFromBgSnapshot(){return this.#n}replaceOauthTokenFromBgSnapshot(e){this.#n=e}oauthScopesFromFd(){return this.#r}replaceOauthScopesFromFd(e){this.#r=e}apiKeyFromFd(){return this.#s}replaceApiKeyFromFd(e){this.#s=e}descriptorAnnouncementConsumed(e){return this.#u.has(e)}markDescriptorAnnouncementConsumed(e){this.#u.add(e)}gatewayTokenFromDescriptor(){return this.#c}replaceGatewayTokenFromDescriptor(e){this.#c=e}resetFdCredentialState(){this.#e=void 0,this.#t=void 0,this.#n=!1,this.#r=void 0,this.#s=void 0}gatewayAuth(){return this.#l}replaceGatewayAuth(e){this.#l=e}gatewayServerProcess(){return this.#i}replaceGatewayServerProcess(e){this.#i=e}gatewayRequiredByHostPolicy(){return this.#f()}replaceGatewayRequiredByHostPolicyReader(e){this.#f=e}authenticatedAccount(){return this.#a}authenticatedAccountEpoch(){return this.#o}stampAuthenticatedAccount(e){let t=this.#a;if(e!==null&&t!==null&&e.accountUuid===t.accountUuid&&e.emailAddress===t.emailAddress&&e.organizationUuid===t.organizationUuid)return;this.#o+=1,this.#a=e}startupPolicySnapshot(){return this.#d}replaceStartupPolicySnapshot(e){this.#d=e}gatewayRefreshInFlight(){return this.#p}replaceGatewayRefreshInFlight(e){this.#p=e}sdkOAuthTokenRefreshCallback(){return this.#m}replaceSdkOAuthTokenRefreshCallback(e){this.#m=e}hostAuthTokenRefreshCallback(){return this.#g}replaceHostAuthTokenRefreshCallback(e){this.#g=e}resetForTests(){this.#e=null,this.#t=null,this.#n=!1,this.#r=void 0,this.#s=null,this.#u.clear(),this.#c=void 0,this.#l=null,this.#a=null,this.#o=0,this.#i=!1,this.#f=()=>!1,this.#p=null,this.#d=void 0,this.#m=null,this.#g=null}}class rv{#e=void 0;#t=!1;#n=!1;#r;directConnectServerUrl(){return this.#e}replaceDirectConnectServerUrl(e){this.#e=e}connectNonBlocking(){return this.#t}replaceConnectNonBlocking(e){this.#t=e}strictConfig(){return this.#n}replaceStrictConfig(e){this.#n=e}registerEnsureConnectedClient(e){this.#r=e}ensureConnectedClient(){return this.#r}reset(){this.#e=void 0,this.#t=!1,this.#n=!1}}class ov{#e=null;#t=new Map;#n=new Map;#r=new Set;#s=!1;#u=!1;#c=!1;#l=!1;#a=new Set;#o=new Map;#i=new Map;promptCache1hAllowlist(){return this.#e}replacePromptCache1hAllowlist(e){this.#e=e}thinkingTypeOverrides(){return this.#t}recordThinkingTypeOverride(e,t){this.#t.set(e,t)}servedModelsByRequestedModel(){return this.#n}recordServedModels(e,t){this.#n.set(e,t)}effortUnsupportedModels(){return this.#r}markEffortUnsupported(e){this.#r.add(e)}midConvCachePromotionRejected(){return this.#s}markMidConvCachePromotionRejected(){this.#s=!0}perTurnEffortOkEmitted(){return this.#u}markPerTurnEffortOkEmitted(){this.#u=!0}lateToolAdditionsOkEmitted(){return this.#c}markLateToolAdditionsOkEmitted(){this.#c=!0}toolChangeHeaderRefused(){return this.#l}markToolChangeHeaderRefused(){this.#l=!0}toolChangeUnsupportedModels(){return this.#a}markToolChangeUnsupportedModel(e){this.#a.add(e)}inferenceProfileBackingModels(){return this.#o}recordInferenceProfileBackingModel(e,t){this.#o.set(e,t)}foundryDeploymentCapabilities(){return this.#i}reset(){this.#e=null,this.#t=new Map,this.#n=new Map,this.#r=new Set,this.#s=!1,this.#u=!1,this.#c=!1,this.#l=!1,this.#a=new Set,this.#o=new Map,this.#i=new Map}}class sv{#e=!1;#t=!1;longContext1mCreditsBlocked(){return this.#e}replaceLongContext1mCreditsBlocked(e){this.#e=e}fableCreditsRequired(){return this.#t}replaceFableCreditsRequired(e){this.#t=e}reset(){this.#e=!1,this.#t=!1}}class iv{#e=!1;#t=!1;#n=fM;#r=Ct();selectorGate(){return this.#e}selectorGateEverOn(){return this.#t}replaceSelectorGate(e){this.#e=e,this.#t||=e}inheritSelectorGateEverOn(){this.#t=!0}resampleSelectorGate(e){let t=this.#e;if(this.#e=e,this.#t||=e,t!==e)this.#r.emit(e)}subscribeSelectorGateChanged(e){return this.#r.subscribe(e)}replaceHostGateSubscription(e){let t=this.#n;this.#n=e,t()}dropHostGateSubscription(){this.replaceHostGateSubscription(fM)}}function fM(){}class av{started=!1;stagingReaped=!1;claim(){if(this.started)return!1;return this.started=!0,!0}claimStagingReap(){if(this.stagingReaped)return!1;return this.stagingReaped=!0,!0}}class cv{backgroundHousekeeping;launchOptions;settingsSource;extensionsConfig;modelStringsCache;diagnostics;telemetryHandles;credentialSlots;mcpProcessWiring;requestLatches;accountCreditLatches;proactivity;constructor(e){this.backgroundHousekeeping=e.backgroundHousekeeping,this.launchOptions=e.launchOptions,this.settingsSource=e.settingsSource,this.extensionsConfig=e.extensionsConfig,this.modelStringsCache=e.modelStringsCache,this.diagnostics=e.diagnostics,this.telemetryHandles=e.telemetryHandles,this.credentialSlots=e.credentialSlots,this.mcpProcessWiring=e.mcpProcessWiring,this.requestLatches=e.requestLatches,this.accountCreditLatches=e.accountCreditLatches,this.proactivity=e.proactivity}}function mM(){return new cv({backgroundHousekeeping:new av,launchOptions:new Yx,settingsSource:new Jx,extensionsConfig:new Xx,modelStringsCache:new Qx,diagnostics:new ev,telemetryHandles:new tv,credentialSlots:new nv,mcpProcessWiring:new rv,requestLatches:new ov,accountCreditLatches:new sv,proactivity:new iv})}function Xae(e=ux()){return cM({host:mM(),id:c0()??_d(),project:{originalCwd:e,projectRoot:e,cwd:e}})}var hM=Xae(AN);function Tn(){return gM()}function gM(){return _M()?.session??hM}function Xs(e){return e.of(hM.host)}function Qae(){let e=_M();return e?.session?void 0:e}var _M=()=>{return};function lv(){return Qae()?.sessionId??gM().id}var jdt=new fg(()=>Ct());var Hdt=new fg(()=>Ct());var Bdt=new Je(()=>Ct());import{execFile as pnt}from"child_process";import{randomUUID as HL}from"crypto";import{createReadStream as fnt,realpathSync as mnt}from"fs";import{mkdir as FL,readdir as hnt,readFile as zne,rm as gnt,writeFile as jne}from"fs/promises";import{createRequire as _nt}from"module";import{homedir as $L,tmpdir as ynt}from"os";import{dirname as zL,isAbsolute as Hne,join as vn,posix as Snt,relative as Bne,resolve as Lh,sep as BL,win32 as bnt}from"path";import{createInterface as Ent}from"readline";import{fileURLToPath as xnt}from"url";import{setMaxListeners as ece}from"events";var tce=50;function Td(e=tce){let t=new AbortController;return ece(e,t.signal),t}var Wdt=new FinalizationRegistry(({parentSignalRef:e,handler:t})=>{e.deref()?.removeEventListener("abort",t)});var Vdt={"user-cancel":new DOMException("user-cancel","AbortError"),"remote-cancel":new DOMException("remote-cancel","AbortError"),shutdown:new DOMException("shutdown","AbortError"),interrupt:new DOMException("interrupt","AbortError"),"turn-abort":new DOMException("turn-abort","AbortError"),background:new DOMException("background","AbortError"),"refusal-fallback-edit":new DOMException("refusal-fallback-edit","AbortError"),"recovery-timeout":new DOMException("recovery-timeout","AbortError")};var nce="server-fallback-tombstone";var qdt=new DOMException(nce,"AbortError");var rce="subagent-park",Zdt=new DOMException(rce,"AbortError");import{spawn as qFe}from"child_process";import{existsSync as ZFe}from"fs";import{createInterface as YFe}from"readline";import{StringDecoder as JFe}from"string_decoder";var ps=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PreModelSwitch","PostModelSwitch","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","DirectoryAdded","MessageDisplay"],oce=["clear","resume","logout","prompt_input_exit","other"],sce="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uv(e,t,n=t+"s"){return e===1?t:n}function Qc(e,t){if(t<=0)return"";if(e.length<=t)return e;let n=e.slice(0,t),r=n.charCodeAt(t-1);return yM(r>=55296&&r<=56319?n.slice(0,-1):n)}function dv(e,t){if(t<=0)return"";if(e.length<=t)return e;let n=e.slice(-t),r=n.charCodeAt(0);return yM(r>=56320&&r<=57343?n.slice(1):n)}function yM(e){if(typeof Buffer<"u")return Buffer.from(e,"utf16le").toString("utf16le");return ice(e)}function ice(e){let n=[];for(let r=0;r<e.length;r+=8192){let o=Math.min(r+8192,e.length),s=new Uint16Array(o-r);for(let i=r;i<o;i++)s[i-r]=e.charCodeAt(i);n.push(String.fromCharCode(...s))}return n.join("")}var ace=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/,cce=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,mg=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,Qdt=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;function hg(e){if(mg)return mg(e);return!ace.test(e)}function gg(e){if(mg&&mg(e))return e;return e.replace(cce,"")}function pv(e,t){let n=e.indexOf(t);return n===-1?e:e.slice(0,n)}function SM(e,t,n=0){let r=0,o=e.indexOf(t,n);while(o!==-1)r++,o=e.indexOf(t,o+1);return r}function lce(e){let t=/[\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}\u2028\u2029]/gu;if(!t.test(e))return e;let n="";for(let{segment:r}of new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e)){let o=/\p{Extended_Pictographic}|\p{Regional_Indicator}|^[#*0-9]\uFE0F?\u20E3$/u.test(r),s=/^\u{1F3F4}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,6}\u{E007F}$/u.test(r);t.lastIndex=0,n+=r.replace(t,(i,a)=>{if(i===`
115
+ `||i==="\t")return i;let c=i.codePointAt(0)??0;if(o&&(i==="️"||i==="︎"||i==="⃣"||i==="‍"&&a+i.length<r.length||s&&c>=917536&&c<=917631))return i;if(c===27)return"␛";if(c<32)return String.fromCodePoint(9216+c);if(c===127)return"␡";return`\\u{${c.toString(16).toUpperCase()}}`})}return n}function _g(e){return lce(e).replace(/\n/g,"␤").replace(/\t/g,"␉")}var uce=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,dce=/<command-name>(.*?)<\/command-name>/;function na(e,t){if(e.type!=="user")return;if(e.isMeta===!0||e.isCompactSummary===!0)return;let n=e.message;if(!n)return;let r=n.content,o=[];if(typeof r==="string")o.push(r);else if(Array.isArray(r))for(let s of r){if(!s||typeof s!=="object")continue;if(s.type==="tool_result")return;if(s.type==="text"&&typeof s.text==="string")o.push(s.text)}for(let s of o){let i=s.replaceAll(`
116
+ `," ").trim();if(!i)continue;let a=dce.exec(i);if(a){if(!t.commandFallback)t.commandFallback=a[1];continue}let c=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(i);if(c)return`! ${c[1].trim()}`;if(uce.test(i))continue;if(i.length>200)i=Qc(i,200).trim()+"…";return i}return}var pce={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};function yg(e,t,n,r){let o=r?.mtime??e?.mtime??0,s=e!==void 0?{sessionId:e.sessionId,mtime:o,data:{...e.data}}:{sessionId:t.sessionId,mtime:o,data:{}},i=s.data;for(let a of n){let c=mce(a.timestamp);if(i.isSidechain===void 0)i.isSidechain=a.isSidechain===!0;if(i.createdAt===void 0&&c!==void 0)i.createdAt=c;if(i.cwd===void 0){let l=a.cwd;if(typeof l==="string"&&l)i.cwd=l}hce(i,a);for(let[l,u]of Object.entries(pce)){let d=a[l];if(typeof d==="string")i[u]=d}if(a.type==="tag"){let l=a.tag;if(typeof l==="string"&&l)i.tag=l;else delete i.tag}if(a.type==="relocated"){let l=a.relocatedCwd;if(typeof l==="string"&&l)i.cwd=l}}return s}function bM(e,t){let n=e.data;if(n.isSidechain===!0)return null;let r=Qs(n.firstPromptLocked===!0?n.firstPrompt:n.commandFallback)||void 0,o=Qs(n.customTitle)||Qs(n.aiTitle)||void 0,s=o||Qs(n.lastPrompt)||Qs(n.summaryHint)||r;if(!s)return null;return{sessionId:e.sessionId,summary:s,lastModified:e.mtime,fileSize:void 0,customTitle:o,firstPrompt:r,gitBranch:Qs(n.gitBranch)||void 0,cwd:Qs(n.cwd)||t||void 0,tag:Qs(n.tag)||void 0,createdAt:fce(n.createdAt)}}function Qs(e){return typeof e==="string"?e:void 0}function fce(e){return typeof e==="number"?e:void 0}function mce(e){if(typeof e!=="string")return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t}function hce(e,t){if(e.firstPromptLocked)return;let n={commandFallback:e.commandFallback??""},r=na(t,n);if(n.commandFallback&&!e.commandFallback)e.commandFallback=n.commandFallback;if(r!==void 0)e.firstPrompt=r,e.firstPromptLocked=!0}class fv{store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let t=[e.projectKey,e.sessionId];if(e.subpath)t.push(e.subpath);return t.join("/")}async append(e,t){let n=this.keyToString(e),r=this.store.get(n)??[];r.push(...t),this.store.set(n,r);let o=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=o,this.mtimes.set(n,o),e.subpath===void 0){let s=`${e.projectKey}/${e.sessionId}`,i=yg(this.summaries.get(s),e,t,{mtime:o});this.summaries.set(s,i)}}async load(e){let t=this.keyToString(e);return this.store.get(t)??null}async listSessions(e){let t=[],n=e+"/";for(let[r]of this.store)if(r.startsWith(n)){let o=r.slice(n.length);if(!o.includes("/"))t.push({sessionId:o,mtime:this.mtimes.get(r)??0})}return t}async listSessionSummaries(e){let t=[],n=e+"/";for(let[r,o]of this.summaries)if(r.startsWith(n))t.push(o);return t}async delete(e){let t=this.keyToString(e);if(this.store.delete(t),this.mtimes.delete(t),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let r of this.store.keys())if(r.startsWith(n))this.store.delete(r),this.mtimes.delete(r)}}async listSubkeys(e){let t=`${e.projectKey}/${e.sessionId}/`,n=[];for(let r of this.store.keys())if(r.startsWith(t))n.push(r.slice(t.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let t of this.store.keys()){let n=t.indexOf("/");if(n!==-1&&!t.slice(n+1).includes("/"))e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}}function fs(e){return!Array.isArray?kM(e)==="[object Array]":Array.isArray(e)}var gce=1/0;function _ce(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-gce?"-0":t}function yce(e){return e==null?"":_ce(e)}function Ho(e){return typeof e==="string"}function TM(e){return typeof e==="number"}function Sce(e){return e===!0||e===!1||bce(e)&&kM(e)=="[object Boolean]"}function CM(e){return typeof e==="object"}function bce(e){return CM(e)&&e!==null}function _r(e){return e!==void 0&&e!==null}function mv(e){return!e.trim().length}function kM(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var Ece="Incorrect 'index' type",xce=(e)=>`Invalid value for key ${e}`,vce=(e)=>`Pattern length exceeds max of ${e}.`,wce=(e)=>`Missing ${e} property in key`,Ace=(e)=>`Property 'weight' in key '${e}' must be a positive integer`,EM=Object.prototype.hasOwnProperty;class RM{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((n)=>{let r=OM(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach((n)=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function OM(e){let t=null,n=null,r=null,o=1,s=null;if(Ho(e)||fs(e))r=e,t=xM(e),n=hv(e);else{if(!EM.call(e,"name"))throw Error(wce("name"));let i=e.name;if(r=i,EM.call(e,"weight")){if(o=e.weight,o<=0)throw Error(Ace(i))}t=xM(i),n=hv(i),s=e.getFn}return{path:t,id:n,weight:o,src:r,getFn:s}}function xM(e){return fs(e)?e:e.split(".")}function hv(e){return fs(e)?e.join("."):e}function Tce(e,t){let n=[],r=!1,o=(s,i,a)=>{if(!_r(s))return;if(!i[a])n.push(s);else{let c=i[a],l=s[c];if(!_r(l))return;if(a===i.length-1&&(Ho(l)||TM(l)||Sce(l)))n.push(yce(l));else if(fs(l)){r=!0;for(let u=0,d=l.length;u<d;u+=1)o(l[u],i,a+1)}else if(i.length)o(l,i,a+1)}};return o(e,Ho(t)?t.split("."):t,0),r?n:n[0]}var Cce={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},kce={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Rce={location:0,threshold:0.6,distance:100},Oce={useExtendedSearch:!1,getFn:Tce,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Ee={...kce,...Cce,...Rce,...Oce},Pce=/[^ ]+/g;function Ice(e=1,t=3){let n=new Map,r=Math.pow(10,t);return{get(o){let s=o.match(Pce).length;if(n.has(s))return n.get(s);let i=1/Math.pow(s,0.5*e),a=parseFloat(Math.round(i*r)/r);return n.set(s,a),a},clear(){n.clear()}}}class Eg{constructor({getFn:e=Ee.getFn,fieldNormWeight:t=Ee.fieldNormWeight}={}){this.norm=Ice(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;if(this.isCreated=!0,Ho(this.docs[0]))this.docs.forEach((e,t)=>{this._addString(e,t)});else this.docs.forEach((e,t)=>{this._addObject(e,t)});this.norm.clear()}add(e){let t=this.size();if(Ho(e))this._addString(e,t);else this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!_r(e)||mv(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach((r,o)=>{let s=r.getFn?r.getFn(e):this.getFn(e,r.path);if(!_r(s))return;if(fs(s)){let i=[],a=[{nestedArrIndex:-1,value:s}];while(a.length){let{nestedArrIndex:c,value:l}=a.pop();if(!_r(l))continue;if(Ho(l)&&!mv(l)){let u={v:l,i:c,n:this.norm.get(l)};i.push(u)}else if(fs(l))l.forEach((u,d)=>{a.push({nestedArrIndex:d,value:u})})}n.$[o]=i}else if(Ho(s)&&!mv(s)){let i={v:s,n:this.norm.get(s)};n.$[o]=i}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function PM(e,t,{getFn:n=Ee.getFn,fieldNormWeight:r=Ee.fieldNormWeight}={}){let o=new Eg({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(OM)),o.setSources(t),o.create(),o}function Dce(e,{getFn:t=Ee.getFn,fieldNormWeight:n=Ee.fieldNormWeight}={}){let{keys:r,records:o}=e,s=new Eg({getFn:t,fieldNormWeight:n});return s.setKeys(r),s.setIndexRecords(o),s}function Sg(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=Ee.distance,ignoreLocation:s=Ee.ignoreLocation}={}){let i=t/e.length;if(s)return i;let a=Math.abs(r-n);if(!o)return a?1:i;return i+a/o}function Lce(e=[],t=Ee.minMatchCharLength){let n=[],r=-1,o=-1,s=0;for(let i=e.length;s<i;s+=1){let a=e[s];if(a&&r===-1)r=s;else if(!a&&r!==-1){if(o=s-1,o-r+1>=t)n.push([r,o]);r=-1}}if(e[s-1]&&s-r>=t)n.push([r,s-1]);return n}var ra=32;function Nce(e,t,n,{location:r=Ee.location,distance:o=Ee.distance,threshold:s=Ee.threshold,findAllMatches:i=Ee.findAllMatches,minMatchCharLength:a=Ee.minMatchCharLength,includeMatches:c=Ee.includeMatches,ignoreLocation:l=Ee.ignoreLocation}={}){if(t.length>ra)throw Error(vce(ra));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),m=s,h=f,_=a>1||c,y=_?Array(d):[],b;while((b=e.indexOf(t,h))>-1){let P=Sg(t,{currentLocation:b,expectedLocation:f,distance:o,ignoreLocation:l});if(m=Math.min(P,m),h=b+u,_){let F=0;while(F<u)y[b+F]=1,F+=1}}h=-1;let v=[],S=1,x=u+d,w=1<<u-1;for(let P=0;P<u;P+=1){let F=0,z=x;while(F<z){if(Sg(t,{errors:P,currentLocation:f+z,expectedLocation:f,distance:o,ignoreLocation:l})<=m)F=z;else x=z;z=Math.floor((x-F)/2+F)}x=z;let q=Math.max(1,f-z+1),ee=i?d:Math.min(f+z,d)+u,te=Array(ee+2);te[ee+1]=(1<<P)-1;for(let Q=ee;Q>=q;Q-=1){let ut=Q-1,De=n[e.charAt(ut)];if(_)y[ut]=+!!De;if(te[Q]=(te[Q+1]<<1|1)&De,P)te[Q]|=(v[Q+1]|v[Q])<<1|1|v[Q+1];if(te[Q]&w){if(S=Sg(t,{errors:P,currentLocation:ut,expectedLocation:f,distance:o,ignoreLocation:l}),S<=m){if(m=S,h=ut,h<=f)break;q=Math.max(1,2*f-h)}}}if(Sg(t,{errors:P+1,currentLocation:f,expectedLocation:f,distance:o,ignoreLocation:l})>m)break;v=te}let D={isMatch:h>=0,score:Math.max(0.001,S)};if(_){let P=Lce(y,a);if(!P.length)D.isMatch=!1;else if(c)D.indices=P}return D}function Mce(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let o=e.charAt(n);t[o]=(t[o]||0)|1<<r-n-1}return t}class Ev{constructor(e,{location:t=Ee.location,threshold:n=Ee.threshold,distance:r=Ee.distance,includeMatches:o=Ee.includeMatches,findAllMatches:s=Ee.findAllMatches,minMatchCharLength:i=Ee.minMatchCharLength,isCaseSensitive:a=Ee.isCaseSensitive,ignoreLocation:c=Ee.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:a,ignoreLocation:c},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let l=(d,f)=>{this.chunks.push({pattern:d,alphabet:Mce(d),startIndex:f})},u=this.pattern.length;if(u>ra){let d=0,f=u%ra,m=u-f;while(d<m)l(this.pattern.substr(d,ra),d),d+=ra;if(f){let h=u-ra;l(this.pattern.substr(h),h)}}else l(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:n}=this.options;if(!t)e=e.toLowerCase();if(this.pattern===e){let m={isMatch:!0,score:0};if(n)m.indices=[[0,e.length-1]];return m}let{location:r,distance:o,threshold:s,findAllMatches:i,minMatchCharLength:a,ignoreLocation:c}=this.options,l=[],u=0,d=!1;this.chunks.forEach(({pattern:m,alphabet:h,startIndex:_})=>{let{isMatch:y,score:b,indices:v}=Nce(e,m,h,{location:r+_,distance:o,threshold:s,findAllMatches:i,minMatchCharLength:a,includeMatches:n,ignoreLocation:c});if(y)d=!0;if(u+=b,y&&v)l=[...l,...v]});let f={isMatch:d,score:d?u/this.chunks.length:1};if(d&&n)f.indices=l;return f}}class ms{constructor(e){this.pattern=e}static isMultiMatch(e){return vM(e,this.multiRegex)}static isSingleMatch(e){return vM(e,this.singleRegex)}search(){}}function vM(e,t){let n=e.match(t);return n?n[1]:null}class IM extends ms{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class DM extends ms{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class LM extends ms{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class NM extends ms{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class MM extends ms{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class UM extends ms{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class xv extends ms{constructor(e,{location:t=Ee.location,threshold:n=Ee.threshold,distance:r=Ee.distance,includeMatches:o=Ee.includeMatches,findAllMatches:s=Ee.findAllMatches,minMatchCharLength:i=Ee.minMatchCharLength,isCaseSensitive:a=Ee.isCaseSensitive,ignoreLocation:c=Ee.ignoreLocation}={}){super(e);this._bitapSearch=new Ev(e,{location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class vv extends ms{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n,r=[],o=this.pattern.length;while((n=e.indexOf(this.pattern,t))>-1)t=n+o,r.push([n,t-1]);let s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}var gv=[IM,vv,LM,NM,UM,MM,DM,xv],wM=gv.length,Uce=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Fce="|";function $ce(e,t={}){return e.split(Fce).map((n)=>{let r=n.trim().split(Uce).filter((s)=>s&&!!s.trim()),o=[];for(let s=0,i=r.length;s<i;s+=1){let a=r[s],c=!1,l=-1;while(!c&&++l<wM){let u=gv[l],d=u.isMultiMatch(a);if(d)o.push(new u(d,t)),c=!0}if(c)continue;l=-1;while(++l<wM){let u=gv[l],d=u.isSingleMatch(a);if(d){o.push(new u(d,t));break}}}return o})}var zce=new Set([xv.type,vv.type]);class FM{constructor(e,{isCaseSensitive:t=Ee.isCaseSensitive,includeMatches:n=Ee.includeMatches,minMatchCharLength:r=Ee.minMatchCharLength,ignoreLocation:o=Ee.ignoreLocation,findAllMatches:s=Ee.findAllMatches,location:i=Ee.location,threshold:a=Ee.threshold,distance:c=Ee.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:s,ignoreLocation:o,location:i,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=$ce(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r}=this.options;e=r?e:e.toLowerCase();let o=0,s=[],i=0;for(let a=0,c=t.length;a<c;a+=1){let l=t[a];s.length=0,o=0;for(let u=0,d=l.length;u<d;u+=1){let f=l[u],{isMatch:m,indices:h,score:_}=f.search(e);if(m){if(o+=1,i+=_,n){let y=f.constructor.type;if(zce.has(y))s=[...s,...h];else s.push(h)}}else{i=0,o=0,s.length=0;break}}if(o){let u={isMatch:!0,score:i/o};if(n)u.indices=s;return u}}return{isMatch:!1,score:1}}}var _v=[];function jce(...e){_v.push(...e)}function yv(e,t){for(let n=0,r=_v.length;n<r;n+=1){let o=_v[n];if(o.condition(e,t))return new o(e,t)}return new Ev(e,t)}var bg={AND:"$and",OR:"$or"},Sv={PATH:"$path",PATTERN:"$val"},bv=(e)=>!!(e[bg.AND]||e[bg.OR]),Hce=(e)=>!!e[Sv.PATH],Bce=(e)=>!fs(e)&&CM(e)&&!bv(e),AM=(e)=>({[bg.AND]:Object.keys(e).map((t)=>({[t]:e[t]}))});function $M(e,t,{auto:n=!0}={}){let r=(o)=>{let s=Object.keys(o),i=Hce(o);if(!i&&s.length>1&&!bv(o))return r(AM(o));if(Bce(o)){let c=i?o[Sv.PATH]:s[0],l=i?o[Sv.PATTERN]:o[c];if(!Ho(l))throw Error(xce(c));let u={keyId:hv(c),pattern:l};if(n)u.searcher=yv(l,t);return u}let a={children:[],operator:s[0]};return s.forEach((c)=>{let l=o[c];if(fs(l))l.forEach((u)=>{a.children.push(r(u))})}),a};if(!bv(e))e=AM(e);return r(e)}function Kce(e,{ignoreFieldNorm:t=Ee.ignoreFieldNorm}){e.forEach((n)=>{let r=1;n.matches.forEach(({key:o,norm:s,score:i})=>{let a=o?o.weight:null;r*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n.score=r})}function Gce(e,t){let n=e.matches;if(t.matches=[],!_r(n))return;n.forEach((r)=>{if(!_r(r.indices)||!r.indices.length)return;let{indices:o,value:s}=r,i={indices:o,value:s};if(r.key)i.key=r.key.src;if(r.idx>-1)i.refIndex=r.idx;t.matches.push(i)})}function Wce(e,t){t.score=e.score}function Vce(e,t,{includeMatches:n=Ee.includeMatches,includeScore:r=Ee.includeScore}={}){let o=[];if(n)o.push(Gce);if(r)o.push(Wce);return e.map((s)=>{let{idx:i}=s,a={item:t[i],refIndex:i};if(o.length)o.forEach((c)=>{c(s,a)});return a})}class ei{constructor(e,t={},n){this.options={...Ee,...t},this.options.useExtendedSearch,this._keyStore=new RM(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Eg))throw Error(Ece);this._myIndex=t||PM(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){if(!_r(e))return;this._docs.push(e),this._myIndex.add(e)}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n<r;n+=1){let o=this._docs[n];if(e(o,n))this.removeAt(n),n-=1,r-=1,t.push(o)}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:n,includeScore:r,shouldSort:o,sortFn:s,ignoreFieldNorm:i}=this.options,a=Ho(e)?Ho(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);if(Kce(a,{ignoreFieldNorm:i}),o)a.sort(s);if(TM(t)&&t>-1)a=a.slice(0,t);return Vce(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=yv(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:o,i:s,n:i})=>{if(!_r(o))return;let{isMatch:a,score:c,indices:l}=t.searchIn(o);if(a)r.push({item:o,idx:s,matches:[{score:c,value:o,norm:i,indices:l}]})}),r}_searchLogical(e){let t=$M(e,this.options),n=(i,a,c)=>{if(!i.children){let{keyId:u,searcher:d}=i,f=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(a,u),searcher:d});if(f&&f.length)return[{idx:c,item:a,matches:f}];return[]}let l=[];for(let u=0,d=i.children.length;u<d;u+=1){let f=i.children[u],m=n(f,a,c);if(m.length)l.push(...m);else if(i.operator===bg.AND)return[]}return l},r=this._myIndex.records,o={},s=[];return r.forEach(({$:i,i:a})=>{if(_r(i)){let c=n(t,i,a);if(c.length){if(!o[a])o[a]={idx:a,item:i,matches:[]},s.push(o[a]);c.forEach(({matches:l})=>{o[a].matches.push(...l)})}}}),s}_searchObjectList(e){let t=yv(e,this.options),{keys:n,records:r}=this._myIndex,o=[];return r.forEach(({$:s,i})=>{if(!_r(s))return;let a=[];if(n.forEach((c,l)=>{a.push(...this._findMatches({key:c,value:s[l],searcher:t}))}),a.length)o.push({idx:i,item:s,matches:a})}),o}_findMatches({key:e,value:t,searcher:n}){if(!_r(t))return[];let r=[];if(fs(t))t.forEach(({v:o,i:s,n:i})=>{if(!_r(o))return;let{isMatch:a,score:c,indices:l}=n.searchIn(o);if(a)r.push({score:c,key:e,value:o,idx:s,norm:i,indices:l})});else{let{v:o,n:s}=t,{isMatch:i,score:a,indices:c}=n.searchIn(o);if(i)r.push({score:a,key:e,value:o,norm:s,indices:c})}return r}}ei.version="7.0.0";ei.createIndex=PM;ei.parseIndex=Dce;ei.config=Ee;ei.parseQuery=$M;jce(FM);var zM=/[:_-]/g;class wv{fuse;constructor(e){let t=e.map((n)=>{let{name:r,displayName:o}=n,s=r.split(zM).filter(Boolean),i=o!==r?o.split(zM).filter(Boolean):[];return{descriptionKey:(n.description??"").split(" ").map((a)=>a.toLowerCase().replace(/[^a-z0-9]/g,"")).filter(Boolean),partKey:s.length>1?s:void 0,displayPartKey:i.length>1?i:void 0,commandName:r,displayName:o,candidate:n,aliasKey:n.aliases}});this.fuse=new ei(t,{includeScore:!0,threshold:0.3,location:0,distance:100,keys:[{name:"commandName",weight:3},{name:"displayName",weight:2},{name:"partKey",weight:2},{name:"aliasKey",weight:2},{name:"displayPartKey",weight:1},{name:"descriptionKey",weight:0.5}]})}search(e,t){let{getScoreBoost:n,filter:r}=t??{},o=e.trim().toLowerCase(),s=this.fuse.search(o);if(r)s=s.filter((c)=>r(c.item.candidate));return s.map((c)=>{let l=c.item.commandName.toLowerCase(),u=c.item.displayName.toLowerCase(),d=c.item.aliasKey?.map((m)=>m.toLowerCase())??[],f=n?n(c.item.candidate):0;return{r:c,name:l,display:u,aliases:d,boost:f}}).sort((c,l)=>{let u=c.name,d=l.name,f=c.aliases,m=l.aliases,h=u===o||c.display===o,_=d===o||l.display===o;if(h&&!_)return-1;if(_&&!h)return 1;let y=f.some((ee)=>ee===o),b=m.some((ee)=>ee===o);if(y&&!b)return-1;if(b&&!y)return 1;let v=(ee,te)=>Math.min(ee.startsWith(o)?ee.length:1/0,te.startsWith(o)?te.length:1/0),S=v(u,c.display),x=v(d,l.display),w=S<1/0,D=x<1/0;if(w&&!D)return-1;if(D&&!w)return 1;if(w&&D&&S!==x)return S-x;let P=f.find((ee)=>ee.startsWith(o)),F=m.find((ee)=>ee.startsWith(o));if(P&&!F)return-1;if(F&&!P)return 1;if(P&&F&&P.length!==F.length)return P.length-F.length;let z=Math.floor((c.r.score??0)*10),q=Math.floor((l.r.score??0)*10);if(z!==q)return z-q;return l.boost-c.boost}).map((c)=>c.r.item.candidate)}}function Av(){if(typeof setImmediate==="function")return new Promise((e)=>setImmediate(e));if(typeof MessageChannel==="function")return new Promise((e)=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e()},t.port2.postMessage(null)});return Dr(0)}var jM=16,GM=8,qce=6,Zce=4,WM=8,Yce=3,Jce=1,Xce=100,HM=64,BM=4;class Tv{paths=[];lowerPaths=[];charBits=new Int32Array(0);pathLens=new Uint16Array(0);topLevelCache=null;matchPositions=new Int32Array(HM);readyCount=0;buildGen=0;loadFromFileList(e){let t=new Set,n=[];for(let r of e)if(r.length>0&&!t.has(r))t.add(r),n.push(r);this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{},n=new Promise((o)=>{t=o}),r=this.buildAsync(e,t);return{queryable:n,done:r}}async buildAsync(e,t){let n=++this.buildGen,r=new Set,o=[],s=performance.now();for(let a=0;a<e.length;a++){let c=e[a];if(c.length>0&&!r.has(c))r.add(c),o.push(c);if((a&255)===255&&performance.now()-s>BM){if(await Av(),this.buildGen!==n)return t(),!1;s=performance.now()}}this.resetArrays(o),s=performance.now();let i=!0;for(let a=0;a<o.length;a++)if(this.indexPath(a),(a&255)===255&&performance.now()-s>BM){if(this.readyCount=a+1,i)t(),i=!1;if(await Av(),this.buildGen!==n)return!1;s=performance.now()}return this.readyCount=o.length,t(),!0}buildIndex(e){this.buildGen++,this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=rle(e,Xce)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let o=0;o<n;o++){let s=t.charCodeAt(o);if(s>=97&&s<=122)r|=1<<s-97}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0){if(this.topLevelCache)return this.topLevelCache.slice(0,t).map(({path:S,score:x})=>({path:S,score:x,positions:[]}));return[]}let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),o=Math.min(r.length,HM),s=Array(o),i=0;for(let S=0;S<o;S++){let x=r.charAt(S);s[S]=x;let w=x.charCodeAt(0);if(w>=97&&w<=122)i|=1<<w-97}let a=o*(jM+GM)+WM+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:m,readyCount:h}=this,_=this.matchPositions;e:for(let S=0;S<h;S++){if((f[S]&i)!==i)continue;let x=n?u[S]:d[S],w=x.indexOf(s[0]);if(w===-1)continue;_[0]=w;let D=0,P=0,F=w;for(let te=1;te<o;te++){if(w=x.indexOf(s[te],F+1),w===-1)continue e;_[te]=w;let xe=w-F-1;if(xe===0)P+=Zce;else D+=Yce+xe*Jce;F=w}if(c.length===t&&a+P-D<=l)continue;let z=u[S],q=m[S],ee=o*jM+P-D;ee+=KM(z,_[0],!0);for(let te=1;te<o;te++)ee+=KM(z,_[te],!1);if(ee+=Math.max(0,32-(q>>2)),c.length<t){if(c.push({pathIndex:S,fuzzScore:ee}),c.length===t)c.sort((te,xe)=>te.fuzzScore-xe.fuzzScore),l=c[0].fuzzScore}else if(ee>l){let te=0,xe=c.length;while(te<xe){let Q=te+xe>>1;if(c[Q].fuzzScore<ee)te=Q+1;else xe=Q}c.splice(te,0,{pathIndex:S,fuzzScore:ee}),c.shift(),l=c[0].fuzzScore}}c.sort((S,x)=>x.fuzzScore-S.fuzzScore);let y=c.length,b=Math.max(y,1),v=Array(y);for(let S=0;S<y;S++){let x=c[S].pathIndex,w=u[x],D=d[x],P=n?w:D,F=Array(o),z=0;for(let te=0;te<o;te++){let xe=P.indexOf(s[te],z);F[te]=xe,z=xe+1}if(!n&&D.length!==w.length)nle(w,F);let q=S/b,ee=w.includes("test")?Math.min(q*1.05,1):q;v[S]={path:w,score:ee,positions:F}}return v}}function KM(e,t,n){if(t===0)return n?WM:0;let r=e.charCodeAt(t-1);if(Qce(r))return GM;if(ele(r)&&tle(e.charCodeAt(t)))return qce;return 0}function Qce(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ele(e){return e>=97&&e<=122}function tle(e){return e>=65&&e<=90}function nle(e,t){let n=0,r=0,o=0;while(o<t.length&&n<e.length){let s=e.codePointAt(n),i=s>65535?2:1,a=String.fromCodePoint(s).toLowerCase().length;while(o<t.length&&t[o]<r+a)t[o]=n,o++;n+=i,r+=a}}function rle(e,t){let n=new Set;for(let o of e){let s=o.length;for(let a=0;a<o.length;a++){let c=o.charCodeAt(a);if(c===47||c===92){s=a;break}}let i=o.slice(0,s);if(i.length>0){if(n.add(i),n.size>=t)break}}let r=Array.from(n);return r.sort((o,s)=>{let i=o.length-s.length;if(i!==0)return i;return o<s?-1:o>s?1:0}),r.slice(0,t).map((o)=>({path:o,score:0,positions:[]}))}var VM=["You've hit your","You've reached your","You're out of usage credits","Your org is out of usage · add funds to continue","Your org is out of usage · contact your admin","Your seat type doesn't include usage credits","Your seat type doesn't include usage","Your usage allocation has been disabled by your admin","Your group's usage limit is set to $0","Fable 5 requires usage credits","You're out of extra usage","Your seat type doesn't include extra usage"];var qM=["This service is disabled for your org"],ZM=["You've used","You're close to"],YM=["You're now using usage credits","You're now using your usage allocation","Now using your usage allocation","Now using usage credits","You're now using extra usage","Now using extra usage"];class yr extends Error{}function el(){return process.versions.bun!==void 0}jc();import{homedir as cle}from"os";import{basename as Mpt,dirname as Upt,join as lle,resolve as JM}from"path";var ole=/^[+-]?(\d+(\.\d*)?|\.\d+)[eE][+-]?\d+$/,sle=/^[+-]?\d{1,3}([_,\u00A0\u202F ])\d{3}(?:\1\d{3})*$/,ile=/[_,\u00A0\u202F ]/g;function ale(e){if(e.length<=32){if(ole.test(e)){let t=Number(e);return Number.isInteger(t)?t:NaN}if(sle.test(e))return parseInt(e.replace(ile,""),10)}return}function Cv(e){let t=String(e).trim();return ale(t)??parseInt(t,10)}jc();function xg(){return process.env.CLAUDE_CONFIG_DIR}var Wt=Ed(()=>(xg()??lle(cle(),".claude")).normalize("NFC"),xg);function XM(e){return JM(Wt())===JM(e)}function QM(){return process.env.CLAUDE_CODE_PROJECT_DIR_NAME}var ule=/^[A-Za-z0-9_-]{1,64}$/,dle=/^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;function kv(e){if(!e||!ule.test(e)||dle.test(e))return;return e}function ple(){return`${xg()??""}\x00${QM()??""}`}var eU=Ed(()=>xg()?kv(QM()):void 0,ple);var fle=/hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9/_-]+/gi;var Rv={bearer:[/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi,"Bearer <token>"],basic:[/(:\s*)Basic\s+[A-Za-z0-9+/=]{8,}/gi,"$1Basic <token>"],sk:[/\bsk-[A-Za-z0-9_-]{20,}/g,"<token>"]},mle=[/\bBearer\s{1,512}(?=[A-Za-z0-9._~+/=-]{16})(?:eyJ|(?=[A-Za-z0-9._~+/=-]{0,64}[0-9=]))/i,/:\s{0,512}Basic\s{1,512}(?=[A-Za-z0-9+/=]{16})(?=[A-Za-z0-9+/=]{0,64}[0-9=])/i,/\bsk-(?=[A-Za-z0-9_-]{20})(?=[A-Za-z0-9_-]{0,64}[0-9])/];var Kpt=new RegExp(`(?:\\b(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-${tl("[A-Za-z0-9+/=%_-]")}|\\bxox[cd]-|(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-(?=[0-9])|xox[cd]-${tl("[A-Za-z0-9+/=%_-]")}(?=[A-Za-z0-9+/=%_-]{16}))`,"i"),nU=[[kd("sk-ant-","[A-Za-z0-9_-]",8,tU(8)),"<token>"],[kd("sk-(?:proj|svcacct|admin)-","[A-Za-z0-9_-]",20,tU(20)),"<token>"]],rU=[[/(^|[^A-Za-z0-9+])AKIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"],[/(^|[^A-Za-z0-9+])ASIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"]],oU=[[kd("gh[opusr]_","[A-Za-z0-9]",20,tl("[A-Za-z0-9]")),"<token>"],[/github_pat_[A-Za-z0-9_]{82,}/g,"<token>"],[/sq0(?:atp|csp)-[A-Za-z0-9_-]{22,}/g,"<token>"],[/(^|[^A-Za-z0-9+/])EAAA[A-Za-z0-9+/=%_-]{56,}/g,"$1<token>"],[kd("gl(?:pat|dt|rt|ft|soat|oas|agent|ptt|cbt|imt|ffct)-","[A-Za-z0-9_=-]",20,tl("[A-Za-z0-9_=-]"),"(?:\\.[0-9a-z]{9})?"),"<token>"],[kd("(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-","[A-Za-z0-9+/=%_-]",10,"(?=[0-9])","",tl("[A-Za-z0-9+/=%_-]"),"gi"),"<token>"],[new RegExp(`(?:\\bxox[cd]-[A-Za-z0-9+/=%_-]{10,}|xox[cd]-${tl("[A-Za-z0-9+/=%_-]")}[A-Za-z0-9+/=%_-]{16,})`,"gi"),"<token>"],[fle,"hooks.slack.com/<redacted>"]],hle=[/\bey[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,"<jwt>"],gle=/\beyJ(?:[A-Za-z0-9_-]{256}|[A-Za-z0-9_-]{8,2048}\.[A-Za-z0-9_-]{10})/,_le=[Rv.bearer,Rv.basic,...nU,Rv.sk,...rU],yle=[...oU,hle];function Rd(e){return[..._le,...yle].reduce((t,[n,r])=>t.replace(n,r),String(e))}var Gpt=[...mle,...[...nU,...rU,...oU].map(([e])=>new RegExp(e.source,e.flags.replaceAll("g",""))),gle];function kd(e,t,n,r,o="",s="",i="g"){let a=`${t}{${n},}${o}`;return new RegExp(`(?:\\b${e}${s}${a}|${e}${r}${a})`,i)}function tl(e){return`(?=${e}{0,64}[0-9])`}function tU(e){return`(?=[A-Za-z0-9_-]{0,64}?(?=[A-Za-z0-9]{${e}})(?=[A-Za-z0-9]{0,64}[0-9])(?=[A-Za-z0-9]{0,64}[A-Za-z]))`}ww();function kA(e){return e}function Rn(e){return kA(e)}function fi(e){return kA(e)}function RA(e){return kA(e)}class Ze extends Error{telemetryMessage;errorClass;constructor(e,t,n){super(e);this.name="TelemetrySafeError",this.telemetryMessage=t??e,this.errorClass=n}}var D$=(e,t)=>{try{if(e!==null&&typeof e==="object"&&!("telemetryMessage"in e)&&Object.isExtensible(e))Object.assign(e,{telemetryMessage:t})}catch{}return e},On=(e,t)=>{try{if(e!==null&&typeof e==="object"&&Object.isExtensible(e)){let n=e,r=Object.entries(t).filter(([o,s])=>s!==void 0&&!(o in n));Object.assign(n,Object.fromEntries(r))}}catch{}return e};function L$(e){try{if(e!==null&&typeof e==="object"&&"telemetryMessage"in e&&typeof e.telemetryMessage==="string")return e.telemetryMessage}catch{}return}function N$(e,t){return e instanceof Error&&e.message===t}function jr(e){return e instanceof Error?e:Error(String(e))}function Hr(e){return e instanceof Error?e.message:String(e)}function ke(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}function Zp(e){return zde(ke(e))}function zde(e){return e&&/^[A-Z][A-Z0-9_]{0,63}$/.test(e)?RA(e):void 0}function rr(e){return ke(e)==="ENOENT"}function OA(e){return ke(e)==="EISDIR"}var jde=new Set(["ENOENT","EACCES","EPERM","ENOTDIR","ELOOP","ENAMETOOLONG","EROFS"]);function PA(e){return Hde(ke(e))}function Hde(e){return e!==void 0&&jde.has(e)}import{randomUUID as KFe}from"crypto";import{join as $K}from"path";import{AsyncLocalStorage as ppe}from"async_hooks";import{constants as fpe}from"fs";import{appendFile as mpe,copyFile as hpe,lstat as gpe,mkdir as _pe,open as j$,readdir as H$,readFile as B$,stat as ype,unlink as Spe,writeFile as MA}from"fs/promises";import{randomBytes as Bde}from"crypto";import{closeSync as cEt,constants as Pn,fchmodSync as lEt,fstatSync as uEt,ftruncateSync as dEt,lstatSync as pEt,openSync as fEt,readFileSync as mEt,renameSync as hEt,unlinkSync as gEt,writeFileSync as _Et}from"fs";import{lstat as DA,open as k_,rename as Kde,stat as Gde,unlink as C_,writeFile as Wde}from"fs/promises";var Vde=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),qde=new Set(["EPERM","EBUSY","EACCES"]);function Zde(e){return`${e}.tmp.${Bde(4).toString("hex")}`}var Yde=4,Jde=50,EEt=new Int32Array(new SharedArrayBuffer(4));function Xde(e,t){if(process.platform!=="win32")return!1;let n=ke(e);return n!==void 0&&qde.has(n)&&t<Yde-1}var Qde=128;async function epe(e){try{return((await DA(e)).mode&Qde)===0}catch{return!1}}async function tpe(e,t){let n=!1;for(let r=0;;r++)try{return await e(),n}catch(o){if(Xde(o,r)){if(r===0&&t!==void 0&&await epe(t))throw o;n=!0,await Dr(Jde);continue}throw o}}function npe(e,t,n=Kde){return tpe(()=>n(e,t),t)}var rpe=67108864,LA=process.platform==="win32"?0:Pn.O_NONBLOCK;async function U$(e,t,n=process.platform){if(n!=="win32")return!0;try{return(await DA(e)).isFile()}catch(r){return t&&ke(r)==="ENOENT"}}async function ope(e,t=!1){if(!t&&!await U$(e,!0))return{kind:"unavailable"};let n;try{n=await k_(e,process.platform==="win32"?Pn.O_RDONLY:Pn.O_RDONLY|(t?0:Pn.O_NOFOLLOW)|LA)}catch(r){return ke(r)==="ENOENT"?{kind:"absent"}:{kind:"unavailable"}}try{let r=await n.stat();if(!r.isFile()||r.size>rpe)return{kind:"unavailable"};return{kind:"snapshot",bytes:new Uint8Array(await n.readFile()),mode:r.mode&4095}}catch{return{kind:"unavailable"}}finally{await n.close().catch(()=>{})}}async function spe(e,t,n=!1){if(!n&&!await U$(e,!0))return!1;let r;try{r=await k_(e,process.platform==="win32"?"w":Pn.O_WRONLY|Pn.O_CREAT|Pn.O_TRUNC|(n?0:Pn.O_NOFOLLOW)|LA,t.mode)}catch{return!1}try{if(!(await r.stat()).isFile())return await r.close().catch(()=>{}),!1;return await r.writeFile(t.bytes),await r.chmod(t.mode).catch(()=>{}),await r.close(),!0}catch{return await r.close().catch(()=>{}),!1}}function T_(e,t,n){try{if(e instanceof Error)e.message=`${e.message}; ${t!==void 0?`new contents preserved at ${t}; `:""}${n==="restored"?"original target restored":n==="removed"?"partial target removed":n==="untouched"?"target untouched":"target left partial — treat contents as torn"}`,Object.assign(e,{...t!==void 0&&{preservedTmp:t},targetOutcome:n})}catch{}return e}function IA(e){let t=ke(e);return t==="EINVAL"||t==="ENOTSUP"||t==="EPERM"||t==="ENOSYS"}var M$=3;async function ipe(e,t){if(t!=="win32")return!1;try{return await DA(e),!0}catch(n){return ke(n)==="ENOENT"?!1:{cause:n}}}function ape(e,t){return Object.assign(Error("EEXIST: name already taken (exclusive create)",typeof t==="object"?{cause:t.cause}:void 0),{code:"EEXIST",syscall:"lstat",path:e})}async function F$(e,t,n){for(let r=1;;r++){let o=Zde(e),s=await ipe(o,t);if(s!==!1){if(r<M$)continue;throw ape(o,s)}try{return await n(o)}catch(i){if(ke(i)==="EEXIST"&&r<M$)continue;throw i}}}async function cpe(e,t,n,r=process.platform){return F$(e,r,async(o)=>{try{return await Wde(o,t,{encoding:"utf8",mode:n,flag:"wx"}),o}catch(s){if(ke(s)!=="EEXIST")await C_(o).catch(()=>{});throw s}})}async function lpe(e,t,n=process.platform){return F$(e,n,async(r)=>({fh:await k_(r,n==="win32"?"wx":Pn.O_WRONLY|Pn.O_CREAT|Pn.O_EXCL,t),tmp:r}))}async function $$(e,t,n,r){return upe(e,t,{mode:n,renameFn:r})}async function upe(e,t,n){let{mode:r,createMode:o,exactMode:s,flush:i,followSymlinks:a,inPlaceOnTempCreateRefused:c,renameFn:l}=n,u=r??o,d=a===!0||process.platform==="win32"?0:Pn.O_NOFOLLOW,f,m=!1,h=!1,_=async(y)=>{let b=await ope(e,a===!0),v=b.kind==="snapshot"?b:void 0,S=await k_(e,process.platform==="win32"?Pn.O_WRONLY|Pn.O_CREAT:Pn.O_WRONLY|Pn.O_CREAT|d|LA,s??u),x;try{x=await S.stat()}catch(F){throw await S.close().catch(()=>{}),m=y!==void 0,T_(F,y,"untouched")}let w=x.isCharacterDevice();if(!x.isFile()&&!w)throw await S.close().catch(()=>{}),Object.assign(Error("refusing the in-place arm on a non-regular target"),{code:"ENXIO",path:e});let D=!1;try{if(!w)await S.truncate(0),D=!0;await S.writeFile(t,{encoding:"utf8"});let F=w?void 0:s??(b.kind!=="absent"?r:void 0);if(F!==void 0)await S.chmod(F).catch(()=>{});if(i===!0)try{await S.sync()}catch(z){if(!IA(z))throw z}await S.close()}catch(F){if(await S.close().catch(()=>{}),!D)throw m=y!==void 0,T_(F,y,"untouched");m=y!==void 0;let q=v!==void 0&&await spe(e,v,a===!0)?"restored":await C_(e).then(()=>!0,(ee)=>ke(ee)==="ENOENT")?"removed":"partial";throw T_(F,y,q)}let P=y??f;if(P!==void 0)await C_(P).catch(()=>{})};try{try{if(s!==void 0||i===!0){let b=await lpe(e,s??u),v=b.fh;f=b.tmp;let S=!1,x;try{if(await v.writeFile(t,{encoding:"utf8"}),s!==void 0)try{await v.chmod(s)}catch(w){if(!IA(w))throw w}if(i===!0)try{await v.sync()}catch(w){if(!IA(w))throw w}}catch(w){S=!0,x=w}if(!S)h=!0;try{await v.close()}catch(w){if(!S)throw m=!0,T_(w,f,"untouched")}if(S)throw x}else f=await cpe(e,t,u),h=!0}catch(b){if(c!==!0)throw b;if(h)throw b;if(ke(b)!=="EACCES")throw b;if(!await Gde(e).then(()=>!0,()=>!1))throw b;await _(void 0);return}if(f===void 0)throw Error("staging block exited without a staging file");let y=f;try{await npe(y,e,l)}catch(b){let v=ke(b);if(v===void 0||!Vde.has(v))throw b;await _(y)}}catch(y){if(f!==void 0&&!m)await C_(f).catch(()=>{});throw y}}import{constants as z$}from"fs";var dpe=process.platform==="win32"?0:z$.O_NONBLOCK,NA=process.platform==="win32"?0:z$.O_NOFOLLOW|dpe;class G${read(e){return B$(e,"utf8")}readBytes(e){return B$(e)}write(e,t,n){return MA(e,t,{encoding:"utf8",mode:n})}async mkdir(e,t){try{await _pe(e,{recursive:!0,mode:t})}catch(n){if(ke(n)!=="EEXIST")throw n}}atomicWrite(e,t,n){return $$(e,t,n)}delete(e){return Spe(e)}list(e){return H$(e)}append(e,t,n){return mpe(e,t,{encoding:"utf8",mode:n})}writeExclusive(e,t,n){return MA(e,t,{encoding:"utf8",flag:"wx",mode:n})}writeBytesExclusive(e,t,n){return MA(e,t,{flag:"wx",mode:n})}copy(e,t){return hpe(e,t)}async stat(e){return{mtimeMs:(await ype(e)).mtimeMs}}async lstat(e){try{let t=await gpe(e);return{isSymbolicLink:t.isSymbolicLink(),isFile:t.isFile(),isDirectory:t.isDirectory(),mtimeMs:t.mtimeMs,nlink:t.nlink}}catch(t){if(ke(t)==="ENOENT")return;throw t}}async listEntries(e){return(await H$(e,{withFileTypes:!0})).map((n)=>({name:n.name,isDirectory:n.isDirectory(),isFile:n.isFile()}))}async readRange(e,t,n){UA("readRange","offset",t),UA("readRange","length",n);let r=await j$(e,"r");try{return await K$(r,t,n)}finally{await r.close()}}async readTail(e,t,n){UA("readTail","maxBytes",t);let r=n?.noFollow?fpe.O_RDONLY|NA:"r",o=await j$(e,r);try{let s=await o.stat();if(n?.noFollow&&!s.isFile())throw Object.assign(Error("ENXIO: not a regular file"),{code:"ENXIO",path:e});let{size:i}=s,a=Math.min(t,i);return await K$(o,i-a,a)}finally{await o.close()}}}function UA(e,t,n){if(!Number.isInteger(n)||n<0)throw RangeError(`${e}: ${t} must be a non-negative integer, got ${n}`)}async function K$(e,t,n){if(n===0)return Buffer.alloc(0);let r=Buffer.alloc(n),o=0;while(o<n){let{bytesRead:s}=await e.read(r,o,n-o,t+o);if(s===0)break;o+=s}return o===n?r:Buffer.from(r.subarray(0,o))}var bpe=new ppe;function Il(){return bpe.getStore()??new G$}var KA={};Zn(KA,{AGENT_PROXY_AUTH_TOKEN:()=>ffe,ANTHROPIC_API_KEY:()=>efe,ANTHROPIC_AUTH_TOKEN:()=>tfe,ANTHROPIC_AWS_API_KEY:()=>ofe,ANTHROPIC_FEDERATION_RULE_ID:()=>Xfe,ANTHROPIC_FOUNDRY_API_KEY:()=>sfe,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>ife,ANTHROPIC_ORGANIZATION_ID:()=>eme,ANTHROPIC_PROFILE:()=>nme,ANTHROPIC_WORKSPACE_ID:()=>tme,AWS_BEARER_TOKEN_BEDROCK:()=>rfe,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>ufe,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>lfe,AWS_ROLE_ARN:()=>cfe,AWS_WEB_IDENTITY_TOKEN_FILE:()=>afe,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>ome,CLAUDE_CODE_ACCOUNT_UUID:()=>rme,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>_fe,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>jfe,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>zfe,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>Jfe,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>Tfe,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>wfe,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>Hfe,CLAUDE_CODE_FEDERATION_CACHE_DIR:()=>Qfe,CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR:()=>Sfe,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>pfe,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>Ofe,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>Rfe,CLAUDE_CODE_HOST_CREDS_FILE:()=>Pfe,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>$fe,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>vfe,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>xfe,CLAUDE_CODE_OAUTH_SCOPES:()=>Afe,CLAUDE_CODE_OAUTH_TOKEN:()=>nfe,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>yfe,CLAUDE_CODE_ORGANIZATION_UUID:()=>sme,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>Bfe,CLAUDE_CODE_RATE_LIMIT_TIER:()=>cme,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>kfe,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>Cfe,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>Ife,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>Vfe,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>qfe,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>Yfe,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>Kfe,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>Wfe,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>Zfe,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>Gfe,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>ame,CLAUDE_CODE_USER_EMAIL:()=>ime,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>bfe,CLAUDE_LOCAL_OAUTH_API_BASE:()=>Mfe,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>Ufe,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>Ffe,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>Efe,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>Dfe,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>dfe,ENVIRONMENT_SERVICE_KEY:()=>mfe,MCP_CLIENT_SECRET:()=>hfe,MCP_XAA_IDP_CLIENT_SECRET:()=>gfe,USE_LOCAL_OAUTH:()=>Lfe,USE_STAGING_OAUTH:()=>Nfe});var ze;(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(ze||(ze={}));var W$;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(W$||(W$={}));var ne=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ys=(e)=>{switch(typeof e){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return Number.isNaN(e)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":if(Array.isArray(e))return ne.array;if(e===null)return ne.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return ne.promise;if(typeof Map<"u"&&e instanceof Map)return ne.map;if(typeof Set<"u"&&e instanceof Set)return ne.set;if(typeof Date<"u"&&e instanceof Date)return ne.date;return ne.object;default:return ne.unknown}};var B=ze.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 Ar extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Ar))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Ar.create=(e)=>new Ar(e);var Epe=(e,t)=>{let n;switch(e.code){case B.invalid_type:if(e.received===ne.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ze.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:n=`Unrecognized key(s) in object: ${ze.joinValues(e.keys,", ")}`;break;case B.invalid_union:n="Invalid input";break;case B.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ze.joinValues(e.options)}`;break;case B.invalid_enum_value:n=`Invalid enum value. Expected ${ze.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:n="Invalid function arguments";break;case B.invalid_return_type:n="Invalid function return type";break;case B.invalid_date:n="Invalid date";break;case B.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(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}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else ze.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case B.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(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))}`;else n="Invalid input";break;case B.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case B.custom:n="Invalid input";break;case B.invalid_intersection_types:n="Intersection results could not be merged";break;case B.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:n="Number must be finite";break;default:n=t.defaultError,ze.assertNever(e)}return{message:n}},mi=Epe;var xpe=mi;function Yp(){return xpe}var R_=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function J(e,t){let n=Yp(),r=R_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===mi?void 0:mi].filter((o)=>!!o)});e.common.issues.push(r)}class In{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return he;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return In.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return he;if(s.status==="aborted")return he;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var he=Object.freeze({status:"aborted"}),Dl=(e)=>({status:"dirty",value:e}),Fn=(e)=>({status:"valid",value:e}),FA=(e)=>e.status==="aborted",$A=(e)=>e.status==="dirty",xa=(e)=>e.status==="valid",Jp=(e)=>typeof Promise<"u"&&e instanceof Promise;var le;(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(le||(le={}));class co{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var V$=(e,t)=>{if(xa(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Ar(e.common.issues);return this._error=n,this._error}}}};function Re(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class Me{get description(){return this._def.description}_getType(e){return ys(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ys(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new In,ctx:{common:e.parent.common,data:e.data,parsedType:ys(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Jp(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ys(e)},r=this._parseSync({data:e,path:n.path,parent:n});return V$(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ys(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return xa(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>xa(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ys(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Jp(r)?r:Promise.resolve(r));return V$(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:B.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new Jo({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:(t)=>this["~validate"](t)}}optional(){return Yo.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zo.create(this)}promise(){return Fl.create(this,this._def)}or(e){return nf.create([this,e],this._def)}and(e){return rf.create(this,e,this._def)}transform(e){return new Jo({...Re(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new cf({...Re(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new BA({typeName:K.ZodBranded,type:this,...Re(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new lf({...Re(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return U_.create(this,e)}readonly(){return uf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var vpe=/^c[^\s-]{8,}$/i,wpe=/^[0-9a-z]+$/,Ape=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tpe=/^[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,Cpe=/^[a-z0-9_-]{21}$/i,kpe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rpe=/^[-+]?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)?)??$/,Ope=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ppe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zA,Ipe=/^(?:(?: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])$/,Dpe=/^(?:(?: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])$/,Lpe=/^(([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]))$/,Npe=/^(([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])$/,Mpe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Upe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q$="((\\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])))",Fpe=new RegExp(`^${q$}$`);function Z$(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function $pe(e){return new RegExp(`^${Z$(e)}$`)}function zpe(e){let t=`${q$}T${Z$(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jpe(e,t){if((t==="v4"||!t)&&Ipe.test(e))return!0;if((t==="v6"||!t)&&Lpe.test(e))return!0;return!1}function Hpe(e,t){if(!kpe.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function Bpe(e,t){if((t==="v4"||!t)&&Dpe.test(e))return!0;if((t==="v6"||!t)&&Npe.test(e))return!0;return!1}class bs extends Me{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==ne.string){let o=this._getOrReturnCtx(e);return J(o,{code:B.invalid_type,expected:ne.string,received:o.parsedType}),he}let n=new In,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),J(r,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),J(r,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)J(r,{code:B.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)J(r,{code:B.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!Ope.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"email",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!zA)zA=new RegExp(Ppe,"u");if(!zA.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"emoji",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!Tpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"uuid",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!Cpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"nanoid",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!vpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"cuid",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!wpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"cuid2",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!Ape.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"ulid",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),J(r,{validation:"url",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"regex",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!zpe(o).test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!Fpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!$pe(o).test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:B.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!Rpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"duration",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!jpe(e.data,o.version))r=this._getOrReturnCtx(e,r),J(r,{validation:"ip",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!Hpe(e.data,o.alg))r=this._getOrReturnCtx(e,r),J(r,{validation:"jwt",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!Bpe(e.data,o.version))r=this._getOrReturnCtx(e,r),J(r,{validation:"cidr",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!Mpe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"base64",code:B.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!Upe.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"base64url",code:B.invalid_string,message:o.message}),n.dirty()}else ze.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:B.invalid_string,...le.errToObj(n)})}_addCheck(e){return new bs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...le.errToObj(e)})}url(e){return this._addCheck({kind:"url",...le.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...le.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...le.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...le.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...le.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...le.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...le.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...le.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...le.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...le.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...le.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...le.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...le.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...le.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...le.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...le.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...le.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...le.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...le.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...le.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...le.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...le.errToObj(t)})}nonempty(e){return this.min(1,le.errToObj(e))}trim(){return new bs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}bs.create=(e)=>new bs({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Re(e)});function Kpe(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}class Nl extends Me{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==ne.number){let o=this._getOrReturnCtx(e);return J(o,{code:B.invalid_type,expected:ne.number,received:o.parsedType}),he}let n=void 0,r=new In;for(let o of this._def.checks)if(o.kind==="int"){if(!ze.isInteger(e.data))n=this._getOrReturnCtx(e,n),J(n,{code:B.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:B.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:B.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(Kpe(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),J(n,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),J(n,{code:B.not_finite,message:o.message}),r.dirty()}else ze.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,le.toString(t))}gt(e,t){return this.setLimit("min",e,!1,le.toString(t))}lte(e,t){return this.setLimit("max",e,!0,le.toString(t))}lt(e,t){return this.setLimit("max",e,!1,le.toString(t))}setLimit(e,t,n,r){return new Nl({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:le.toString(r)}]})}_addCheck(e){return new Nl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:le.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:le.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:le.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:le.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&ze.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}}Nl.create=(e)=>new Nl({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Re(e)});class Ml extends Me{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==ne.bigint)return this._getInvalidInput(e);let n=void 0,r=new In;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:B.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:B.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),J(n,{code:B.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else ze.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return J(t,{code:B.invalid_type,expected:ne.bigint,received:t.parsedType}),he}gte(e,t){return this.setLimit("min",e,!0,le.toString(t))}gt(e,t){return this.setLimit("min",e,!1,le.toString(t))}lte(e,t){return this.setLimit("max",e,!0,le.toString(t))}lt(e,t){return this.setLimit("max",e,!1,le.toString(t))}setLimit(e,t,n,r){return new Ml({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:le.toString(r)}]})}_addCheck(e){return new Ml({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:le.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:le.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}Ml.create=(e)=>new Ml({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Re(e)});class O_ extends Me{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==ne.boolean){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.boolean,received:n.parsedType}),he}return Fn(e.data)}}O_.create=(e)=>new O_({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Re(e)});class Qp extends Me{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==ne.date){let o=this._getOrReturnCtx(e);return J(o,{code:B.invalid_type,expected:ne.date,received:o.parsedType}),he}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return J(o,{code:B.invalid_date}),he}let n=new In,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),J(r,{code:B.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),J(r,{code:B.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else ze.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qp({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:le.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:le.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}}Qp.create=(e)=>new Qp({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Re(e)});class P_ extends Me{_parse(e){if(this._getType(e)!==ne.symbol){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.symbol,received:n.parsedType}),he}return Fn(e.data)}}P_.create=(e)=>new P_({typeName:K.ZodSymbol,...Re(e)});class ef extends Me{_parse(e){if(this._getType(e)!==ne.undefined){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.undefined,received:n.parsedType}),he}return Fn(e.data)}}ef.create=(e)=>new ef({typeName:K.ZodUndefined,...Re(e)});class tf extends Me{_parse(e){if(this._getType(e)!==ne.null){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.null,received:n.parsedType}),he}return Fn(e.data)}}tf.create=(e)=>new tf({typeName:K.ZodNull,...Re(e)});class I_ extends Me{constructor(){super(...arguments);this._any=!0}_parse(e){return Fn(e.data)}}I_.create=(e)=>new I_({typeName:K.ZodAny,...Re(e)});class va extends Me{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Fn(e.data)}}va.create=(e)=>new va({typeName:K.ZodUnknown,...Re(e)});class Es extends Me{_parse(e){let t=this._getOrReturnCtx(e);return J(t,{code:B.invalid_type,expected:ne.never,received:t.parsedType}),he}}Es.create=(e)=>new Es({typeName:K.ZodNever,...Re(e)});class D_ extends Me{_parse(e){if(this._getType(e)!==ne.undefined){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.void,received:n.parsedType}),he}return Fn(e.data)}}D_.create=(e)=>new D_({typeName:K.ZodVoid,...Re(e)});class Zo extends Me{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==ne.array)return J(t,{code:B.invalid_type,expected:ne.array,received:t.parsedType}),he;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)J(t,{code:s?B.too_big:B.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)J(t,{code:B.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)J(t,{code:B.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new co(t,s,t.path,i)))).then((s)=>In.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new co(t,s,t.path,i)));return In.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Zo({...this._def,minLength:{value:e,message:le.toString(t)}})}max(e,t){return new Zo({...this._def,maxLength:{value:e,message:le.toString(t)}})}length(e,t){return new Zo({...this._def,exactLength:{value:e,message:le.toString(t)}})}nonempty(e){return this.min(1,e)}}Zo.create=(e,t)=>new Zo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Re(t)});function Ll(e){if(e instanceof Ft){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Yo.create(Ll(r))}return new Ft({...e._def,shape:()=>t})}else if(e instanceof Zo)return new Zo({...e._def,type:Ll(e.element)});else if(e instanceof Yo)return Yo.create(Ll(e.unwrap()));else if(e instanceof hi)return hi.create(Ll(e.unwrap()));else if(e instanceof xs)return xs.create(e.items.map((t)=>Ll(t)));else return e}class Ft extends Me{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=ze.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==ne.object){let c=this._getOrReturnCtx(e);return J(c,{code:B.invalid_type,expected:ne.object,received:c.parsedType}),he}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Es&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],u=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new co(r,u,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Es){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)J(r,{code:B.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let u=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new co(r,u,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let u=await l.key,d=await l.value;c.push({key:u,value:d,alwaysSet:l.alwaysSet})}return c}).then((c)=>In.mergeObjectSync(n,c));else return In.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return le.errToObj,new Ft({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:le.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Ft({...this._def,unknownKeys:"strip"})}passthrough(){return new Ft({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ft({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ft({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ft({...this._def,catchall:e})}pick(e){let t={};for(let n of ze.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Ft({...this._def,shape:()=>t})}omit(e){let t={};for(let n of ze.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Ft({...this._def,shape:()=>t})}deepPartial(){return Ll(this)}partial(e){let t={};for(let n of ze.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Ft({...this._def,shape:()=>t})}required(e){let t={};for(let n of ze.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Yo)o=o._def.innerType;t[n]=o}return new Ft({...this._def,shape:()=>t})}keyof(){return Y$(ze.objectKeys(this.shape))}}Ft.create=(e,t)=>new Ft({shape:()=>e,unknownKeys:"strip",catchall:Es.create(),typeName:K.ZodObject,...Re(t)});Ft.strictCreate=(e,t)=>new Ft({shape:()=>e,unknownKeys:"strict",catchall:Es.create(),typeName:K.ZodObject,...Re(t)});Ft.lazycreate=(e,t)=>new Ft({shape:e,unknownKeys:"strip",catchall:Es.create(),typeName:K.ZodObject,...Re(t)});class nf extends Me{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Ar(i.ctx.common.issues));return J(t,{code:B.invalid_union,unionErrors:s}),he}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Ar(a));return J(t,{code:B.invalid_union,unionErrors:i}),he}}get options(){return this._def.options}}nf.create=(e,t)=>new nf({options:e,typeName:K.ZodUnion,...Re(t)});var Ss=(e)=>{if(e instanceof of)return Ss(e.schema);else if(e instanceof Jo)return Ss(e.innerType());else if(e instanceof sf)return[e.value];else if(e instanceof wa)return e.options;else if(e instanceof af)return ze.objectValues(e.enum);else if(e instanceof cf)return Ss(e._def.innerType);else if(e instanceof ef)return[void 0];else if(e instanceof tf)return[null];else if(e instanceof Yo)return[void 0,...Ss(e.unwrap())];else if(e instanceof hi)return[null,...Ss(e.unwrap())];else if(e instanceof BA)return Ss(e.unwrap());else if(e instanceof uf)return Ss(e.unwrap());else if(e instanceof lf)return Ss(e._def.innerType);else return[]};class HA extends Me{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.object)return J(t,{code:B.invalid_type,expected:ne.object,received:t.parsedType}),he;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return J(t,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),he;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let o of t){let s=Ss(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new HA({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Re(n)})}}function jA(e,t){let n=ys(e),r=ys(t);if(e===t)return{valid:!0,data:e};else if(n===ne.object&&r===ne.object){let o=ze.objectKeys(t),s=ze.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=jA(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===ne.array&&r===ne.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=jA(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===ne.date&&r===ne.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}class rf extends Me{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(FA(o)||FA(s))return he;let i=jA(o.value,s.value);if(!i.valid)return J(n,{code:B.invalid_intersection_types}),he;if($A(o)||$A(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}rf.create=(e,t,n)=>new rf({left:e,right:t,typeName:K.ZodIntersection,...Re(n)});class xs extends Me{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.array)return J(n,{code:B.invalid_type,expected:ne.array,received:n.parsedType}),he;if(n.data.length<this._def.items.length)return J(n,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),he;if(!this._def.rest&&n.data.length>this._def.items.length)J(n,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new co(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>In.mergeArray(t,s));else return In.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new xs({...this._def,rest:e})}}xs.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xs({items:e,typeName:K.ZodTuple,rest:null,...Re(t)})};class L_ extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.object)return J(n,{code:B.invalid_type,expected:ne.object,received:n.parsedType}),he;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new co(n,i,n.path,i)),value:s._parse(new co(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return In.mergeObjectAsync(t,r);else return In.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Me)return new L_({keyType:e,valueType:t,typeName:K.ZodRecord,...Re(n)});return new L_({keyType:bs.create(),valueType:e,typeName:K.ZodRecord,...Re(t)})}}class N_ extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.map)return J(n,{code:B.invalid_type,expected:ne.map,received:n.parsedType}),he;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new co(n,i,n.path,[c,"key"])),value:o._parse(new co(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return he;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return he;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}}N_.create=(e,t,n)=>new N_({valueType:t,keyType:e,typeName:K.ZodMap,...Re(n)});class Ul extends Me{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.set)return J(n,{code:B.invalid_type,expected:ne.set,received:n.parsedType}),he;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)J(n,{code:B.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)J(n,{code:B.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return he;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new co(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new Ul({...this._def,minSize:{value:e,message:le.toString(t)}})}max(e,t){return new Ul({...this._def,maxSize:{value:e,message:le.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ul.create=(e,t)=>new Ul({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Re(t)});class Xp extends Me{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.function)return J(t,{code:B.invalid_type,expected:ne.function,received:t.parsedType}),he;function n(i,a){return R_({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Yp(),mi].filter((c)=>!!c),issueData:{code:B.invalid_arguments,argumentsError:a}})}function r(i,a){return R_({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Yp(),mi].filter((c)=>!!c),issueData:{code:B.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Fl){let i=this;return Fn(async function(...a){let c=new Ar([]),l=await i._def.args.parseAsync(a,o).catch((f)=>{throw c.addIssue(n(a,f)),c}),u=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(u,o).catch((f)=>{throw c.addIssue(r(u,f)),c})})}else{let i=this;return Fn(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Ar([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),u=i._def.returns.safeParse(l,o);if(!u.success)throw new Ar([r(l,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xp({...this._def,args:xs.create(e).rest(va.create())})}returns(e){return new Xp({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Xp({args:e?e:xs.create([]).rest(va.create()),returns:t||va.create(),typeName:K.ZodFunction,...Re(n)})}}class of extends Me{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}of.create=(e,t)=>new of({getter:e,typeName:K.ZodLazy,...Re(t)});class sf extends Me{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return J(t,{received:t.data,code:B.invalid_literal,expected:this._def.value}),he}return{status:"valid",value:e.data}}get value(){return this._def.value}}sf.create=(e,t)=>new sf({value:e,typeName:K.ZodLiteral,...Re(t)});function Y$(e,t){return new wa({values:e,typeName:K.ZodEnum,...Re(t)})}class wa extends Me{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{expected:ze.joinValues(n),received:t.parsedType,code:B.invalid_type}),he}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{received:t.data,code:B.invalid_enum_value,options:n}),he}return Fn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return wa.create(e,{...this._def,...t})}exclude(e,t=this._def){return wa.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}}wa.create=Y$;class af extends Me{_parse(e){let t=ze.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ne.string&&n.parsedType!==ne.number){let r=ze.objectValues(t);return J(n,{expected:ze.joinValues(r),received:n.parsedType,code:B.invalid_type}),he}if(!this._cache)this._cache=new Set(ze.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=ze.objectValues(t);return J(n,{received:n.data,code:B.invalid_enum_value,options:r}),he}return Fn(e.data)}get enum(){return this._def.values}}af.create=(e,t)=>new af({values:e,typeName:K.ZodNativeEnum,...Re(t)});class Fl extends Me{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==ne.promise&&t.common.async===!1)return J(t,{code:B.invalid_type,expected:ne.promise,received:t.parsedType}),he;let n=t.parsedType===ne.promise?t.data:Promise.resolve(t.data);return Fn(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Fl.create=(e,t)=>new Fl({type:e,typeName:K.ZodPromise,...Re(t)});class Jo extends Me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(J(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return he;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return he;if(a.status==="dirty")return Dl(a.value);if(t.value==="dirty")return Dl(a.value);return a});else{if(t.value==="aborted")return he;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return he;if(i.status==="dirty")return Dl(i.value);if(t.value==="dirty")return Dl(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return he;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return he;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xa(s))return he;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!xa(s))return he;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});ze.assertNever(r)}}Jo.create=(e,t,n)=>new Jo({schema:e,typeName:K.ZodEffects,effect:t,...Re(n)});Jo.createWithPreprocess=(e,t,n)=>new Jo({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Re(n)});class Yo extends Me{_parse(e){if(this._getType(e)===ne.undefined)return Fn(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yo.create=(e,t)=>new Yo({innerType:e,typeName:K.ZodOptional,...Re(t)});class hi extends Me{_parse(e){if(this._getType(e)===ne.null)return Fn(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:K.ZodNullable,...Re(t)});class cf extends Me{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===ne.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}cf.create=(e,t)=>new cf({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Re(t)});class lf extends Me{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(Jp(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ar(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ar(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}lf.create=(e,t)=>new lf({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Re(t)});class M_ extends Me{_parse(e){if(this._getType(e)!==ne.nan){let n=this._getOrReturnCtx(e);return J(n,{code:B.invalid_type,expected:ne.nan,received:n.parsedType}),he}return{status:"valid",value:e.data}}}M_.create=(e)=>new M_({typeName:K.ZodNaN,...Re(e)});var ZEt=Symbol("zod_brand");class BA extends Me{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class U_ extends Me{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return he;if(o.status==="dirty")return t.dirty(),Dl(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return he;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new U_({in:e,out:t,typeName:K.ZodPipeline})}}class uf extends Me{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(xa(r))r.value=Object.freeze(r.value);return r};return Jp(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}}uf.create=(e,t)=>new uf({innerType:e,typeName:K.ZodReadonly,...Re(t)});var YEt={object:Ft.lazycreate},K;(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"})(K||(K={}));var $l=bs.create,JEt=Nl.create,XEt=M_.create,QEt=Ml.create,ext=O_.create,txt=Qp.create,nxt=P_.create,rxt=ef.create,oxt=tf.create,sxt=I_.create,ixt=va.create,axt=Es.create,cxt=D_.create,lxt=Zo.create,{create:J$,strictCreate:uxt}=Ft,dxt=nf.create,pxt=HA.create,fxt=rf.create,mxt=xs.create,hxt=L_.create,gxt=N_.create,_xt=Ul.create,yxt=Xp.create,Sxt=of.create,bxt=sf.create,Ext=wa.create,xxt=af.create,vxt=Fl.create,wxt=Jo.create,Axt=Yo.create,Txt=hi.create,zl=Jo.createWithPreprocess,Cxt=U_.create;class X${resetters=[];lazy(e){let t;return this.resetters.push(()=>{t=void 0}),()=>t??=e()}reset(){for(let e of this.resetters)e()}}var Vpe=new X$;function L(e){return Vpe.lazy(e)}function qpe(e){let t=e?.trim();return t?t:void 0}function jl(e){return e===void 0?void 0:String(e)}var Zpe=L(()=>zl(jl,$l().optional().transform(qpe))),Ype=L(()=>zl(jl,$l().optional())),Jpe=L(()=>zl(jl,$l().optional().transform((e)=>Oe(e)))),Xpe=L(()=>zl(jl,$l().optional().transform((e)=>{if(Oe(e))return!0;if(ea(e))return!1;return}))),Qpe=L(()=>ez());function Q$(e){if(typeof e==="boolean")return e?"1":"0";return String(e)}var p={str:()=>Zpe(),rawStr:()=>Ype(),bool:()=>Jpe(),triBool:()=>Xpe(),int:(e)=>e?ez(e):Qpe(),enum:(e)=>zl(jl,$l().optional().transform((t)=>t!==void 0&&e.includes(t.trim())?t.trim():void 0))};function ez(e){return zl(jl,$l().optional().transform((t)=>{if(t===void 0)return;if(e?.digitsOnly&&!/^[+-]?\d+$/.test(t.trim()))return;let n=Cv(t);if(!Number.isFinite(n))return;if(e?.min!==void 0&&n<e.min)return;if(e?.max!==void 0&&n>e.max)return;return n}))}var efe=p.str(),tfe=p.str(),nfe=p.str(),rfe=p.str(),ofe=p.str(),sfe=p.str(),ife=p.str(),afe=p.str(),cfe=p.str(),lfe=p.str(),ufe=p.str(),dfe=p.str(),pfe=p.str(),ffe=p.str(),mfe=p.str(),hfe=p.str(),gfe=p.str(),_fe=p.str(),yfe=p.str(),Sfe=p.str(),bfe=p.str(),Efe=p.str(),xfe=p.str(),vfe=p.str(),wfe=p.str(),Afe=p.str(),Tfe=p.str(),Cfe=p.bool(),kfe=p.bool(),Rfe=p.int({min:1}),Ofe=p.str(),Pfe=p.str(),Ife=p.str(),Dfe=p.str(),Lfe=p.bool(),Nfe=p.bool(),Mfe=p.str(),Ufe=p.str(),Ffe=p.str(),$fe=p.int({min:0}),zfe=p.int({min:0}),jfe=p.int(),Hfe=p.bool(),Bfe=p.int(),Kfe=p.bool(),Gfe=p.bool(),Wfe=p.bool(),Vfe=p.bool(),qfe=p.bool(),Zfe=p.bool(),Yfe=p.bool(),Jfe=p.int({min:1,max:2147483647}),Xfe=p.str(),Qfe=p.str(),eme=p.str(),tme=p.str(),nme=p.str(),rme=p.str(),ome=p.str(),sme=p.str(),ime=p.str(),ame=p.str(),cme=p.str();var GA={};Zn(GA,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>_he,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>uhe,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>dhe,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>phe,ANT_OTEL_LOGS_EXPORTER:()=>fhe,ANT_OTEL_METRICS_EXPORTER:()=>mhe,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>ghe,ANT_OTEL_TRACES_EXPORTER:()=>hhe,BETA_TRACING_ENDPOINT:()=>yhe,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>Tme,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>Dme,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>Pme,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>Ime,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>pme,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>dme,CLAUDE_CODE_DEBUG_REPAINTS:()=>fme,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>mme,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>Cme,CLAUDE_CODE_FRAME_TIMING_LOG:()=>bme,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>Eme,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>ohe,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>Lme,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>kme,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>Ome,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>Rme,CLAUDE_CODE_PERFETTO_TRACE:()=>yme,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>Sme,CLAUDE_CODE_PROFILE_STARTUP:()=>_me,CLAUDE_CODE_SESSION_LOG:()=>xme,CLAUDE_CODE_TEE_SDK_STDOUT:()=>Ame,CLAUDE_CODE_TERMINAL_RECORDING:()=>wme,CLAUDE_DEBUG:()=>lme,CLAUDE_PTY_RECORD:()=>vme,DEBUG:()=>ume,DEBUG_CLAUDE_AGENT_SDK:()=>hme,DEBUG_SDK:()=>gme,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>the,OTEL_EXPORTER_OTLP_ENDPOINT:()=>Fme,OTEL_EXPORTER_OTLP_HEADERS:()=>$me,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>jme,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>Hme,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>Bme,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>Kme,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>Gme,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>Wme,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>Vme,OTEL_EXPORTER_OTLP_PROTOCOL:()=>zme,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>qme,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>Zme,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>Yme,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>nhe,OTEL_LOGS_EXPORTER:()=>Mme,OTEL_LOGS_EXPORT_INTERVAL:()=>Xme,OTEL_LOG_ASSISTANT_RESPONSES:()=>ihe,OTEL_LOG_RAW_API_BODIES:()=>lhe,OTEL_LOG_TOOL_CONTENT:()=>ahe,OTEL_LOG_TOOL_DETAILS:()=>che,OTEL_LOG_USER_PROMPTS:()=>she,OTEL_METRICS_EXPORTER:()=>Nme,OTEL_METRIC_EXPORT_INTERVAL:()=>Jme,OTEL_RESOURCE_ATTRIBUTES:()=>ehe,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>rhe,OTEL_TRACES_EXPORTER:()=>Ume,OTEL_TRACES_EXPORT_INTERVAL:()=>Qme});var lme=p.bool(),ume=p.str(),dme=p.str(),pme=p.str(),fme=p.bool(),mme=p.str(),hme=p.bool(),gme=p.bool(),_me=p.bool(),yme=p.str(),Sme=p.int(),bme=p.str(),Eme=p.int(),xme=p.str(),vme=p.str(),wme=p.str(),Ame=p.bool(),Tme=p.bool(),Cme=p.bool(),kme=p.int(),Rme=p.int(),Ome=p.int(),Pme=p.int({min:1}),Ime=p.int({min:1}),Dme=p.bool(),Lme=p.bool(),Nme=p.str(),Mme=p.str(),Ume=p.str(),Fme=p.str(),$me=p.str(),zme=p.str(),jme=p.str(),Hme=p.str(),Bme=p.str(),Kme=p.str(),Gme=p.str(),Wme=p.str(),Vme=p.str(),qme=p.str(),Zme=p.str(),Yme=p.str(),Jme=p.int(),Xme=p.int(),Qme=p.int(),ehe=p.str(),the=p.int({min:0}),nhe=p.int({min:0}),rhe=p.int({min:0}),ohe=p.int({min:1,digitsOnly:!0}),she=p.bool(),ihe=p.triBool(),ahe=p.bool(),che=p.bool(),lhe=p.bool(),uhe=p.str(),dhe=p.str(),phe=p.str(),fhe=p.str(),mhe=p.str(),hhe=p.str(),ghe=p.str(),_he=p.str(),yhe=p.str();import{constants as vve}from"fs";import{access as KC,readdir as wve,readFile as Ave,readlink as Tve}from"fs/promises";import{homedir as Cve}from"os";import{delimiter as kve,join as Bf,resolve as DK}from"path";function df(e,t){let n=0;for(let r of e)n+=+!!t(r);return n}function Tr(e){return[...new Set(e)]}function nz(){return"prod"}function rz(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return"-custom-oauth";switch(nz()){case"local":return"-local-oauth";case"staging":return"-staging-oauth";case"prod":return""}}var She=31536000;var Hxt=Math.round(She/86400),bhe="user:inference",oz="user:profile",Ehe="org:create_api_key";var xhe=[Ehe,oz],vhe=[oz,bhe,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],Bxt=Tr([...xhe,...vhe]);var tz={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",DESIGN_CLIENT_ID:"59637612-477b-4836-a601-b0589eda7704",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"};var whe=void 0;function Ahe(){let e=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",t=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",n=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:e,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${t}/oauth/authorize`,CLAUDE_AI_ORIGIN:t,TOKEN_URL:`${e}/v1/oauth/token`,API_KEY_URL:`${e}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${e}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",DESIGN_CLIENT_ID:"00000000-0000-4000-8000-000000000000",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}var The=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];function sz(){let e=(()=>{switch(nz()){case"local":return Ahe();case"staging":return whe??tz;case"prod":return tz}})(),t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let r=t.replace(/\/$/,"");if(!The.includes(r))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");e={...e,BASE_API_URL:r,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_ORIGIN:r,TOKEN_URL:`${r}/v1/oauth/token`,API_KEY_URL:`${r}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${r}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let n=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;if(n)e={...e,CLIENT_ID:n};return e}import*as _e from"fs";import{appendFile as uge,chmod as dge,copyFile as pge,link as fge,lstat as tT,mkdir as mge,open as z_,readdir as hge,readFile as Nz,readlink as gge,realpath as _ge,rename as yge,rmdir as Sge,rm as bge,stat as Mz,symlink as Ege,unlink as xge}from"fs/promises";import*as mt from"path";import{appendFile as JA,mkdir as Az,rename as Tz,stat as Yhe,symlink as Jhe,unlink as XA}from"fs/promises";import{dirname as Hl,isAbsolute as Xhe,join as gi,resolve as Pz}from"path";function Y(e,t){return{code:"InvalidArgument",argument:e,...t!==void 0&&{reason:t}}}var Che="ByteViewUnsupported";function iz(e){return e.code==="Failed"&&"telemetryCode"in e&&e.telemetryCode===Che}var F_={home:(e)=>({space:"home",path:e}),workspace:(e)=>({space:"workspace",path:e}),system:(e)=>({space:"system",path:e}),userNamed:(e)=>({space:"userNamed",path:e})};var WA=globalThis.process?.getBuiltinModule?.("async_hooks"),cz=WA!==void 0,VA=WA?new WA.AsyncLocalStorage:{run:(e,t)=>t(),getStore:()=>{return}};function lz({writeBatch:e,sizeOf:t,flushIntervalMs:n=1000,maxBufferSize:r=100,maxBufferBytes:o=1/0,immediateMode:s=!1}){let i=[],a=0,c=null,l=null;function u(){if(c)clearTimeout(c),c=null}function d(_){try{e(_)}catch{}}function f(){if(l)d(l),l=null;if(i.length===0)return;d(i),i=[],a=0,u()}function m(){if(!c)c=setTimeout(f,n)}function h(){if(l){l.push(...i),i=[],a=0,u();return}let _=i;i=[],a=0,u(),l=_,setImmediate(()=>{let y=l;if(l=null,y)d(y)})}return{write(_){if(s){d([_]);return}if(i.push(_),a+=t(_),m(),i.length>=r||a>=o)h()},flush:f,dispose(){f()}}}function Rhe(e){if(typeof e==="function")return e;if(Symbol.asyncDispose in e)return()=>e[Symbol.asyncDispose]();return()=>e[Symbol.dispose]()}class qA{#e=new Set;#t=!1;get drainStarted(){return this.#t}register(e){let t=Rhe(e);this.#e.add(t);let n=()=>{this.#e.delete(t)};return Object.assign(n,{[Symbol.dispose]:n})}async drain(){this.#t=!0;let e=Array.from(this.#e);this.#e.clear();let n=(await Promise.allSettled(e.map(async(r)=>r()))).find((r)=>r.status==="rejected");if(n!==void 0)throw n.reason}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}}class uz{cleanup=new qA;preExitFlush=new qA}var Ohe=new Je(()=>new uz);function Phe(){return Xs(Ohe)}function $_(e){return Phe().cleanup.register(e)}class pz{parsed=new Map;lookup(e){return this.parsed.get(e)}remember(e,t){this.parsed.set(e,t)}reset(){this.parsed.clear()}}var dz=new pz;function fz(e){let t=dz.lookup(e);if(t!==void 0)return t;let n=Ihe(e);return dz.remember(e,n),n}function Ihe(e){if(!e||e.trim()==="")return null;let t=e.split(",").map((s)=>s.trim()).filter(Boolean);if(t.length===0)return null;let n=t.some((s)=>s.startsWith("!")),r=t.some((s)=>!s.startsWith("!"));if(n&&r)return null;let o=t.map((s)=>s.replace(/^!/,"").toLowerCase());return{include:n?[]:o,exclude:n?o:[],isExclusive:n}}function Dhe(e){let t=[],n=e.match(/^MCP server ["']([^"']+)["']/);if(n&&n[1])t.push("mcp"),t.push(n[1].toLowerCase());else{let s=e.match(/^([^:[]+):/);if(s&&s[1])t.push(s[1].trim().toLowerCase())}let r=e.match(/^\[([^\]]+)]/);if(r&&r[1])t.push(r[1].trim().toLowerCase());if(e.toLowerCase().includes("1p event:"))t.push("1p");let o=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();if(s.length<30&&!s.includes(" "))t.push(s)}return Array.from(new Set(t))}function Lhe(e,t){if(!t)return!0;if(e.length===0)return!1;if(t.isExclusive)return!e.some((n)=>t.exclude.includes(n));else return e.some((n)=>t.include.includes(n))}function mz(e,t){if(!t)return!0;let n=Dhe(e);return Lhe(n,t)}function Nhe(e,t,n){if(e.destroyed||e.writableEnded)return!1;return e.write(t,n),!0}class ZA{everWritten=!1;drainPromise=void 0;bytesQueued=0;bytesFlushed=0;notifyFlushProgress=void 0;notifyExternallyClocked=void 0;externallyClockedPromise=void 0;externallyClocked=!1;errored=!1;flushConfirmedPromise=void 0;flushCloseListener=void 0;markEverWritten(){this.everWritten=!0}recordQueued(e){this.bytesQueued+=e}recordFlushed(e){this.bytesFlushed+=e,this.notifyFlushProgress?.()}markErrored(){this.errored=!0,this.notifyFlushProgress?.()}outstandingBytes(){return process.stdout.destroyed||this.errored?0:this.bytesQueued-this.bytesFlushed}endStdoutOnce(){if(this.drainPromise===void 0){let e=process.stdout;if(e.isTTY||e.destroyed||e.writableEnded||!this.everWritten)return;this.drainPromise=new Promise((t)=>e.end(t))}return this.drainPromise}fullyFlushed(){if(this.flushConfirmedPromise===void 0)this.flushConfirmedPromise=new Promise((e)=>{let t=()=>{if(this.outstandingBytes()<=0)this.notifyFlushProgress=void 0,e()};this.notifyFlushProgress=t,this.flushCloseListener=t,process.stdout.once("close",t),t()});return this.flushConfirmedPromise}isExternallyClocked(){return this.externallyClocked}ensureExternallyClockedPromise(){return this.externallyClockedPromise??=new Promise((e)=>{this.notifyExternallyClocked=e})}markExternallyClocked(){this.externallyClocked=!0,this.ensureExternallyClockedPromise(),this.notifyExternallyClocked?.(),this.notifyExternallyClocked=void 0}reset(){if(this.flushCloseListener!==void 0)process.stdout.removeListener("close",this.flushCloseListener);Object.assign(this,new ZA)}}var cvt=new ZA;function hz(e){Nhe(process.stderr,e)}var Mhe=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,gz="[^\\s,;&}\\])]+",_z=`"[^"]*"|'[^']*'|[^\\s-]{0,4}\\[REDACTED\\]['"\`]?|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${gz})|${gz}`,Uhe=["sk","ant","api"].join("-"),lo="[\\w=-]{20,}(?:\\.[0-9a-z]{9})?",Ez=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${Mhe.source})[\\w.-]*["']?\\s*[=:]\\s*(${_z})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${_z})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:"\\b(AIza[\\w-]{35})(?![\\w-])",confidence:"high"},{id:"google-oauth-client-secret",source:"\\bGOCSPX-[\\w-]{28}(?![\\w-])",confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${Uhe}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-oauth-token",source:`\\b(sk-ant-(?:oat|ort)\\d{2}-[\\w-]{20,})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:"sk-[A-Za-z0-9_-]{8,200}T3BlbkFJ[A-Za-z0-9_-]{8,200}",confidence:"high"},{id:"openai-legacy-api-key",source:"\\bsk-[a-zA-Z0-9]{48}(?![a-zA-Z0-9])",confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"supabase-secret-key",source:"\\bsb_secret_[A-Za-z0-9_-]{20,}",confidence:"high"},{id:"supabase-access-token",source:"\\bsbp_[a-z0-9]{40,}",confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:`glpat-${lo}`,confidence:"high"},{id:"gitlab-deploy-token",source:`gldt-${lo}`,confidence:"high"},{id:"gitlab-runner-authentication-token",source:`glrt-${lo}`,confidence:"high"},{id:"gitlab-oauth-app-secret",source:`gloas-${lo}`,confidence:"high"},{id:"gitlab-pipeline-trigger-token",source:`glptt-${lo}`,confidence:"high"},{id:"gitlab-kubernetes-agent-token",source:`glagent-${lo}`,confidence:"high"},{id:"gitlab-incoming-mail-token",source:`glimt-${lo}`,confidence:"high"},{id:"gitlab-scim-oauth-token",source:`glsoat-${lo}`,confidence:"high"},{id:"gitlab-ci-build-token",source:`glcbt-${lo}`,confidence:"high"},{id:"gitlab-feed-token",source:`glft-${lo}`,confidence:"high"},{id:"gitlab-feature-flag-client-token",source:`glffct-${lo}`,confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[a-z](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-rotation-token",source:"xoxe(?:\\.xox[a-z])?-[0-9]-[A-Za-z0-9-]{28,}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"slack-workflow-token",source:"\\bxwfp-[a-zA-Z0-9-]{20,}",confidence:"high"},{id:"slack-webhook-url",source:"(?:https?://)?hooks\\.slack\\.com/(?:services|workflows|triggers)/[A-Za-z0-9+/_-]{40,}",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"}],Fhe=64;function YA(e,t){let n=/-----BEGIN[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi,r=/-----END[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi;n.lastIndex=t;let o=n.exec(e);if(!o)return null;r.lastIndex=o.index+o[0].length+Fhe;let s=r.exec(e);if(!s)return null;return{start:o.index,end:s.index+s[0].length}}function $he(e){return YA(e,0)!==null}function zhe(e){let t=YA(e,0);if(!t)return e;let n="",r=0;while(t)n+=e.slice(r,t.start)+"[REDACTED]",r=t.end,t=YA(e,r);return n+e.slice(r)}var yz=`(?:[\\x60'"\\s;]|\\\\[nr]|$)`,Sz="(?=[^a-zA-Z0-9_\\-+=]|$)",jhe="(?<![a-zA-Z0-9_\\-])";function Hhe(){return Ez.map((e)=>({id:e.id,confidence:e.confidence,re:new RegExp(e.confidence!=="high"?e.source:jhe+(e.source.endsWith(yz)?e.source.slice(0,-yz.length)+Sz:e.source+Sz),(e.flags??"").replace("g","")+"g")}))}function bz(e){return Ez.map((t)=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function xz(e,t){if(typeof t!=="string")return"[REDACTED]";let n=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t.at(-1)===t[0]?t[0]:"",r=e.lastIndexOf(t);return`${e.slice(0,r)}${n}[REDACTED]${n}${e.slice(r+t.length)}`}var Bhe=512,Khe=512;class vz{testRules=null;redactRules=null;displayRules=null;resultCache=new Map;scan(e){this.testRules??=bz(!1);let t=[];for(let n of this.testRules)if(n.confidence==="high"&&n.re.test(e))t.push({ruleId:n.id,label:n.id.split("-").map((r)=>Zhe[r]??Cd(r)).join(" ")});if($he(e))t.push({ruleId:"private-key",label:"Private Key"});return t}redact(e){let t=e.length<=Bhe;if(t){let r=this.resultCache.get(e);if(r!==void 0)return r}this.redactRules??=bz(!0);let n=zhe(e);for(let r of this.redactRules)n=n.replace(r.re,xz);if(t){if(this.resultCache.size>=Khe)this.resultCache.delete(this.resultCache.keys().next().value);this.resultCache.set(e,n)}return n}redactForDisplay(e){this.displayRules??=Hhe();let t=e;for(let n of this.displayRules){if(n.confidence!=="high")continue;t=t.replace(n.re,qhe)}return t}}var Ghe=new vz;function wz(e){return Ghe.redact(e)}var Whe=/[$\x60|;&<>()\s]/,Vhe=/[/.@:~*?\\]/;function qhe(e,t){let n=typeof t==="string"?t:e;if(Whe.test(n)||Vhe.test(n))return e;return xz(e,t)}var Zhe={aws:"AWS",gcp:"GCP",api:"API",pat:"PAT",ad:"AD",tf:"TF",oauth:"OAuth",npm:"NPM",pypi:"PyPI",jwt:"JWT",ci:"CI",scim:"SCIM",github:"GitHub",gitlab:"GitLab",openai:"OpenAI",digitalocean:"DigitalOcean",huggingface:"HuggingFace",hashicorp:"HashiCorp",sendgrid:"SendGrid"};var eT={verbose:0,debug:1,info:2,warn:3,error:4},Qhe=10485760;function ege(e){return Object.hasOwn(eT,e)}function Cz(e){return aM(e)?null:Pz(e)}function kz(){}var tge={sessionId:"",fromBackend:!1};function Rz(e,t,n,r){let o=gi(t,"debug"),s=gi(o,`${e.sessionId}.txt`),i;if(n===null)i=s;else if(r!==null&&n===r)i=gi(r,`${e.sessionId}.txt`);else i=n;let a=!e.fromBackend&&i===s?"v5":"raw";return{target:i,arm:a,configHome:t,rotate:a==="raw"&&!(Hl(i)===o&&i.endsWith(".txt")),pointLatest:a==="raw"&&i!==s}}function QA(e){return F_.userNamed(Xhe(e)?e:Pz(e))}function nge(e){return e.code==="Failed"&&e.telemetryCode==="ENOENT"}function rge(e,t=cz){return t?e:void 0}async function Oz(e,t,n,r){let o={namespace:"log",sessionId:t,channel:"debug"},s=await VA.run(!0,()=>e.append(o,[{data:n}],r?{markLatest:!0}:void 0));if(s.ok)return"landed";return r&&s.error.code==="InvalidArgument"&&s.error.argument==="opts.markLatest"?"refused":"dropped"}class Iz{deps;minLevel;filter;toStderr;filePath;runtimeDebugEnabled=!1;hasFormattedOutput=!1;debugFromLaunch;storageV5;writer=null;redirect=null;pendingWrite=Promise.resolve();unflushedChunks=[];backendLinesLogged=0;exiting=!1;exitHandlerRegistered=!1;successor=null;writtenBytes=-1;rotating=!1;resolvedLogPath=null;overrideDirectory=null;rotationTarget=null;latestMarked=!1;latestRefused=!1;constructor(e){this.deps=e;if(this.storageV5=rge(e.storageV5),e.launchIdentity!==void 0){this.minLevel=e.launchIdentity.minLevel,this.filter=e.launchIdentity.filter,this.toStderr=e.launchIdentity.toStderr,this.filePath=e.launchIdentity.filePath,this.debugFromLaunch=e.launchIdentity.debugFromLaunch;return}let t=Array.isArray(e.argv)?e.argv:[],n=t.indexOf("--"),r=n===-1?t:t.slice(0,n),o=e.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();this.minLevel=o&&ege(o)?o:"debug";let s=r.find((a)=>a.startsWith("--debug="));this.filter=s?fz(s.substring(8)):null,this.toStderr=r.includes("--debug-to-stderr")||r.includes("-d2e");let i=null;for(let a=0;a<r.length;a++){let c=r[a];if(c.startsWith("--debug-file=")){i=Cz(c.substring(13));break}if(c==="--debug-file"&&a+1<r.length){i=Cz(r[a+1]);break}}this.filePath=i,this.debugFromLaunch=Oe(e.env.DEBUG)||Oe(e.env.DEBUG_SDK)||r.includes("--debug")||r.includes("-d")||this.toStderr||s!==void 0||this.filePath!==null}isDebugMode(){return this.runtimeDebugEnabled||this.debugFromLaunch}drainsSyncAtExit(){return!(ye()&&this.storageV5!==void 0&&this.deps.syncExitDrain===!1)}launchIdentity(){return{minLevel:this.minLevel,filter:this.filter,toStderr:this.toStderr,filePath:this.filePath,debugFromLaunch:this.debugFromLaunch,isAnt:this.deps.isAnt,isTestEnvironment:this.deps.isTestEnvironment}}enableDebugLogging(){let e=this.isDebugMode()||this.deps.isAnt;return this.runtimeDebugEnabled=!0,e}logPath(){return this.filePath??(this.overrideDirectory!==null&&this.overrideDirectory===this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR?gi(this.overrideDirectory,`${this.deps.sessionId()}.txt`):null)??this.resolvedLogPath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??this.defaultLogPath()}defaultLogPath(e=this.deps.sessionId()){return gi(this.deps.configHomeDir(),"debug",`${e}.txt`)}learnedOverrideDirectory(){return this.overrideDirectory}isArmed(){return this.storageV5!==void 0}log(e,{level:t}={level:"debug"}){if(eT[t]<eT[this.minLevel])return;if(!this.shouldLog(e))return;let n=wz(e.trim());if(n.includes(`
117
+ `))n=me(n);let o=`${new Date().toISOString()} [${t.toUpperCase()}] ${n}
118
+ `;if(this.toStderr){this.deps.writeToStderr(o);return}this.write(o)}write(e){let t=this.getWriter(),n=tge;if(this.storageV5!==void 0){if(n={sessionId:this.deps.sessionId(),fromBackend:VA.getStore()===!0},n.fromBackend)this.backendLinesLogged++}if(t.write({origin:n,content:e}),this.exiting)t.flush()}async flush(){let e=this.backendLinesLogged;if(this.writer?.flush(),await this.pendingWrite,this.storageV5!==void 0&&this.successor)return this.successor.flush();for(let t=0;this.backendLinesLogged!==e&&t<3;t++)e=this.backendLinesLogged,this.writer?.flush(),await this.pendingWrite}dispose(e){this.redirect=e;try{this.writer?.dispose()}finally{this.redirect=null,this.writer=null}}succeed(e){this.runtimeDebugEnabled=e.runtimeDebugEnabled,this.hasFormattedOutput=e.hasFormattedOutput,this.pendingWrite=e.pendingWrite,this.unflushedChunks=e.unflushedChunks,this.exitHandlerRegistered=e.exitHandlerRegistered,e.successor=this,e.dispose((t)=>{this.write(t)})}handleExit(){if(this.successor){this.successor.handleExit();return}this.exiting=!0,this.writer?.flush(),this.drainSync()}async maybeRotate(e,t,n=Qhe){let r=ye()&&this.storageV5!==void 0?this.storageV5.hostFiles:void 0;if(this.writtenBytes<0)if(r){let o=await r.stat(QA(e));this.writtenBytes=o.ok&&o.value.kind!=="absent"?o.value.size:0}else this.writtenBytes=await Yhe(e).then((o)=>o.size).catch(()=>0);else this.writtenBytes+=t;if(this.writtenBytes<=n||this.rotating)return;this.rotating=!0;try{let o=e.endsWith(".txt")?`${e.slice(0,-4)}.1.txt`:`${e}.1`;if(r){let s=QA(e),i=QA(o),a=await r.rename(s,i);if(!a.ok&&!nge(a.error)){if(await r.delete(i,{missingOk:!0}),!(await r.rename(s,i)).ok)await r.delete(s,{missingOk:!0})}}else try{await Tz(e,o)}catch(s){if(!rr(s))await XA(o).catch(()=>{}),await Tz(e,o).catch(()=>XA(e).catch(()=>{}))}this.writtenBytes=0}finally{this.rotating=!1}}shouldLog(e){if(this.deps.isTestEnvironment&&!this.toStderr&&this.filePath===null)return!1;if(!this.deps.isAnt&&!this.isDebugMode())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;return mz(e,this.filter)}resolveDirToFile(e){return this.resolvedLogPath=gi(e,`${this.deps.sessionId()}.txt`),this.resolvedLogPath}async appendGroup(e,t,n,r){if(this.storageV5!==void 0&&e.arm==="v5"){await this.appendV5AndMark(this.storageV5,t,n);return}if(r)await Az(Hl(e.target),{recursive:!0}).catch(()=>{});let o=e;try{await JA(e.target,n)}catch(s){if(!OA(s))throw s;if(this.storageV5===void 0)o={...e,target:this.resolveDirToFile(e.target)},await JA(o.target,n);else{if(this.overrideDirectory=e.target,o=Rz(t,e.configHome,e.target,e.target),o.arm==="v5"){await this.appendV5AndMark(this.storageV5,t,n);return}await Az(Hl(o.target),{recursive:!0}).catch(()=>{});try{await JA(o.target,n)}catch{return}}}if(o.rotate){if(this.storageV5!==void 0&&o.target!==this.rotationTarget)this.rotationTarget=o.target,this.writtenBytes=-1;await this.maybeRotate(o.target,Buffer.byteLength(n)).catch(kz)}if(o.pointLatest)this.markLatestSymlink()}async appendV5AndMark(e,t,n){let r=ye(),o=r&&!this.latestMarked&&!this.latestRefused,s=await Oz(e,t.sessionId,n,o);if(s==="refused")this.latestRefused=!0,s=await Oz(e,t.sessionId,n,!1),this.log("debug log: the storage backend refused markLatest; <debug folder>/latest is not pointed in this process",{level:"warn"});if(s!=="landed")return;if(o&&!this.latestRefused)this.latestMarked=!0;else if(!r)this.markLatestSymlink()}markLatestSymlink(){if(!this.latestMarked)this.latestMarked=!0,this.updateLatestSymlink()}shiftUnflushedChunk(){this.unflushedChunks.shift()}drainSync(){if(this.unflushedChunks.length===0)return;if(!this.drainsSyncAtExit()){this.unflushedChunks.length=0;return}let e=[];for(let t of this.unflushedChunks.splice(0)){let n=e.at(-1);if(n!==void 0&&n.armed===t.armed&&(!t.armed||n.target===t.target))n.parts.push(t);else e.push({target:t.target,armed:t.armed,parts:[t]})}for(let{target:t,armed:n,parts:r}of e){let o=n?t:this.logPath(),s=r.map((i)=>i.content).join("");try{et().mkdirSync(Hl(o))}catch{}try{et().appendFileSync(o,s)}catch(i){if(OA(i))try{if(!n)et().appendFileSync(this.resolveDirToFile(o),s);else{let a=(u,d)=>{try{et().appendFileSync(gi(o,`${u}.txt`),d)}catch{}},c=r[0]?.sessionId,l="";for(let u of r){if(u.sessionId!==c)a(c,l),c=u.sessionId,l="";l+=u.content}a(c,l)}}catch{}}}}groupLines(e){let t=e[0];if(t===void 0)return[];if(this.storageV5===void 0)return[{decision:{target:this.logPath(),arm:"raw",configHome:"",rotate:!0,pointLatest:!0},origin:t.origin,lines:e}];let n=[];for(let r of e){let o=n.at(-1);if(o!==void 0&&o.origin.sessionId===r.origin.sessionId&&o.origin.fromBackend===r.origin.fromBackend)o.lines.push(r);else n.push({decision:Rz(r.origin,this.deps.configHomeDir(),this.filePath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??null,this.overrideDirectory),origin:r.origin,lines:[r]})}return n}getWriter(){if(this.writer)return this.writer;let e=null,t=this.storageV5!==void 0;if(this.writer=lz({writeBatch:(n)=>{if(this.redirect){this.redirect(n.map((r)=>r.content).join(""));return}if(this.exiting){for(let r of this.groupLines(n))this.unflushedChunks.push({target:r.decision.target,sessionId:r.origin.sessionId,armed:t,content:r.lines.map((o)=>o.content).join("")});this.drainSync();return}for(let r of this.groupLines(n)){let o=r.lines.map((a)=>a.content).join(""),s=Hl(r.decision.target),i=r.decision.arm==="raw"&&(r.origin.fromBackend||e!==s);if(r.decision.arm==="raw")e=s;this.unflushedChunks.push({target:r.decision.target,sessionId:r.origin.sessionId,armed:t,content:o}),this.pendingWrite=this.pendingWrite.then(this.appendGroup.bind(this,r.decision,r.origin,o,i)).catch(kz).then(this.shiftUnflushedChunk.bind(this))}},sizeOf:(n)=>n.content.length,flushIntervalMs:1000,maxBufferSize:100,immediateMode:this.isDebugMode()}),this.deps.registerCleanup(async()=>{this.writer?.dispose(),await this.pendingWrite}),!this.exitHandlerRegistered)this.exitHandlerRegistered=!0,this.deps.onExit(this.handleExit.bind(this));return this.writer}async updateLatestSymlink(){try{let e=this.logPath(),t=gi(Hl(e),"latest");await XA(t).catch(()=>{}),await Jhe(e,t)}catch{}}}class Dz{instance=void 0;init={};setInstance(e){this.instance=e}setInit(e){this.init=e}}var oge=new Je(()=>new Dz);function sge(){return Xs(oge)}function ige(e,t){return new Iz({argv:process.argv,env:process.env,sessionId:()=>lv(),configHomeDir:()=>Wt(),onExit:(n)=>{process.on("exit",n)},registerCleanup:(n)=>{$_(n)},writeToStderr:(n)=>{hz(n)},isAnt:t?.isAnt??!1,isTestEnvironment:t?.isTestEnvironment??!1,launchIdentity:t,storageV5:e.init.storageV5!==void 0&&e.init.configHome===Wt()?e.init.storageV5:void 0,syncExitDrain:e.init.syncExitDrain})}function age(){let e=sge(),t=e.instance;if(t)return t;let n=ige(e);return e.setInstance(n),n}function ce(e,t={level:"debug"}){age().log(e,t)}var Lvt=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})();var cge={[Symbol.dispose](){}};function lge(){return cge}var en=lge;function me(e,t,n){let o=[];try{const r=zt(o,en`JSON.stringify(${e})`,0);return JSON.stringify(e,t,n)}catch(s){var i=s,a=1}finally{jt(o,i,a)}}var ft=(e,t)=>{let r=[];try{const n=zt(r,en`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(o){var s=o,i=1}finally{jt(r,s,i)}};function Lz(e){return JSON.parse(e)}function uo(e,t){let r=[];try{const n=zt(r,en`structuredClone(${e})`,0);return structuredClone(e,t)}catch(o){var s=o,i=1}finally{jt(r,s,i)}}var vge="→";function wge(){return process.platform==="win32"?0:_e.constants.O_NOFOLLOW|_e.constants.O_NONBLOCK}var Bl=process.platform==="win32"?/[\\/]+/:/\/+/;function Age(e,t){let n=(a)=>a.split(Bl).filter(Boolean),r=mt.resolve(e),o=mt.resolve(t),s=n(r),i=n(o);return mt.parse(r).root===mt.parse(o).root&&s.length<i.length&&s.every((a,c)=>a===i[c])}function oT(e){let t="";for(let r of e.split(/([\\/]+)/)){if(r==="."||r==="..")break;t+=r}let n=t.replace(/(?<=[^\\/])[\\/]+$/,"");return n===""?e:n}function Tge(e){let t=mt.join(e).replace(/(?<=[^\\/])[\\/]+$/,"");if(jo(t)&&!ta(t))return t;return oT(e)}function Cge(e){if(e.startsWith("\\\\"))return oT(e);let t=e.replace(/^\/+/,"/"),n=lg(t);if(n!==null)return n;return oT(e)}var kge=process.platform==="win32"?Tge:Cge;function Uz(e,t,n){let r=Zc(e);if(t.length===0||r||t.some((o)=>o==="."||o==="..")){if(n!==void 0&&(t.length>0||r))n(mt.join(e,...t));return r?kge(e):e}return mt.join(e,...t)}var sT="\x00unverified-ancestry";function Fz(e,t,n=!1){if(t?.unreadableAncestry!=="unverified")return;let r=e!==void 0&&typeof e==="object"&&"errno"in e?e.errno:void 0;if(r==="ENOENT"||r==="ENOTDIR")return;if(r==="ENAMETOOLONG"&&!n)return;return sT}function nT(e){return wd(e)}function rT(e,t){return t===void 0||t.every((n)=>sM(e,n))}function $z(e,t){return t===void 0||t.every((n)=>rM(e,n))}function Rge(e){if(e?.anchors!==void 0&&e.anchors.length>0)return e.anchors;return e?.anchor!==void 0?[e.anchor]:void 0}async function zz(e){return vd(e)||ug(e)||Js(e)||Xc(e)||await Hz(aT,e)!==void 0}async function iT(e,t=aT){return vd(e)||ug(e)||Js(e)||Xc(e)||await Hz(t,e,{surfaceNetworkRaw:!0,unreadableAncestry:"unverified"})!==void 0}function jz(e,t,n){return Oge(Bz(t,n),(r)=>{if(r.kind==="lstat")return e.lstatSync(r.path);if(r.kind==="opendirNofollow")return e.openDirNoFollowSync(r.path),"ok";return e.readlinkSync(r.path)})}function Hz(e,t,n){return Pge(Bz(t,n),async(r)=>{if(r.kind==="lstat")return e.lstat(r.path);if(r.kind==="opendirNofollow")return await e.openDirNoFollow(r.path),"ok";return e.readlink(r.path)})}function Oge(e,t){let n;for(;;){let r=e.next(n);if(r.done)return r.value;try{n=t(r.value)}catch(o){n={errno:ke(o)}}}}async function Pge(e,t){let n;for(;;){let r=e.next(n);if(r.done)return r.value;try{n=await t(r.value)}catch(o){n={errno:ke(o)}}}}function*Bz(e,t){let n=Rge(t);if(jo(e)&&!ta(e)&&$z(e,n)||Jc(e)&&rT(e,n))return;if(nT(e))return e;let r=mt.resolve(e),o=mt.parse(r).root,s=o,i=r.slice(o.length).split(Bl).filter(Boolean),a=0,c=!1,l=!1,u,d=64;while(i.length>0&&a<d){if(c&&Zc(i[0]))return sT;let f=mt.join(s,i[0]);if(Jc(f)&&rT(f,n)||nT(f))return Uz(f,i.slice(1),t?.onCollapsedLanding);let m=yield{kind:"lstat",path:f};if(m===void 0||typeof m==="string"||"errno"in m){if(process.platform!=="win32"&&typeof m==="object"&&"errno"in m&&m.errno!==void 0&&m.errno!=="ENOENT"&&m.errno!=="ENOTDIR"&&m.errno!=="ENAMETOOLONG"){if(typeof(yield{kind:"opendirNofollow",path:f})==="string"){l=!0,i.shift(),s=f;continue}}if(t?.launchAncestry&&!l&&typeof m==="object"&&"errno"in m&&(m.errno==="EPERM"||m.errno==="EACCES")&&Age(f,t.launchAncestry)){c=!0,i.shift(),s=f;continue}if(typeof m==="object"&&"errno"in m&&(m.errno==="ENOENT"||m.errno==="ENOTDIR"))t?.onOutcome?.({kind:"absent"});return Fz(m,t,a>0)}let h=m;if(l=!0,!h.isSymbolicLink()){i.shift(),s=f;continue}a++;let _=f+"\x00"+i.join("\x00");if((u??=new Set).has(_))return;u.add(_);let y=yield{kind:"readlink",path:f};if(typeof y!=="string")return Fz(y,t,a>0);let b=y;if(!mt.isAbsolute(b)){i.shift(),i=[...b.split(Bl).filter(Boolean),...i];continue}let v=b;if(jo(v)&&!ta(v)&&$z(v,n)||Jc(v)&&rT(v,n)||nT(v))return i.shift(),Uz(v,i,t?.onCollapsedLanding);if(t?.surfaceNetworkRaw===!0&&Zc(v)&&(jo(v)||Js(v)||wd(v)||Xc(v)))return i.shift(),i.length===0?v:v+mt.sep+i.join(mt.sep);i.shift();let x=mt.parse(v).root||mt.sep;s=x,l=!1,i=[...v.slice(x.length).split(Bl).filter(Boolean),...i]}if(i.length>0&&t?.surfaceNetworkRaw)return sT;if(a>0&&Xc(s))return s;if(i.length===0)t?.onOutcome?.({kind:"resolved",path:s});return}function pf(e,t){if(jo(t)&&!ta(t)||Jc(t)||iM(t))return{resolvedPath:t,isSymlink:!1,isCanonical:!1};let n=jz(e,t);if(n!==void 0)return{resolvedPath:n,isSymlink:!0,isCanonical:!1};try{let r=Ige(e,t);return{resolvedPath:r,isSymlink:r!==t,isCanonical:!0}}catch(r){return{resolvedPath:t,isSymlink:!1,isCanonical:!1}}}function Ige(e,t){try{return e.realpathSync(t)}catch(n){let r=ke(n);if(r!=="EPERM"&&r!=="EACCES")throw n;let o,s=dx(),i=null;if(s!==null)try{let c=mt.resolve(s),l=mt.resolve(e.cwd()),u=mt.parse(c).root;if(u===mt.parse(l).root){let d=c.slice(u.length).split(Bl).filter(Boolean),f=l.slice(u.length).split(Bl).filter(Boolean),m=0;while(m<d.length&&m<f.length&&d[m]===f[m])m++;if(m>0)i=mt.join(u,...d.slice(0,m))}}catch{}if(jz(e,t,{unreadableAncestry:"unverified",surfaceNetworkRaw:!0,launchAncestry:i,onOutcome:(c)=>{o=c}})!==void 0||o===void 0)throw n;if(o.kind==="absent")throw Object.assign(Error("ENOENT: no such file or directory"),{code:"ENOENT",syscall:"realpath",path:t});return ot(o.path)}}var aT={cwd(){return process.cwd()},existsSync(e){let n=[];try{const t=zt(n,en`fs.existsSync(${e})`,0);return _e.existsSync(e)}catch(r){var o=r,s=1}finally{jt(n,o,s)}},async stat(e){return Mz(e)},async lstat(e){return tT(e)},async openDirNoFollow(e){if(process.platform==="win32")throw Error("openDirNoFollow is a POSIX-only examination probe");await(await z_(e,_e.constants.O_DIRECTORY|_e.constants.O_NOFOLLOW)).close()},openDirNoFollowSync(e){if(process.platform==="win32")throw Error("openDirNoFollowSync is a POSIX-only examination probe");let t=_e.openSync(e,_e.constants.O_DIRECTORY|_e.constants.O_NOFOLLOW);_e.closeSync(t)},async lstatBigint(e){return tT(e,{bigint:!0})},async statBigint(e){return Mz(e,{bigint:!0})},async readdir(e){return hge(e,{withFileTypes:!0})},async unlink(e){return xge(e)},async rmdir(e){return Sge(e)},async rm(e,t){return bge(e,t)},async mkdir(e,t){try{await mge(e,{recursive:!0,...t})}catch(n){if(ke(n)!=="EEXIST")throw n}},async readFile(e,t){return Nz(e,{encoding:t.encoding})},async rename(e,t){return yge(e,t)},async realpath(e){return ot(await _ge(e))},async readlink(e){return gge(e)},async copyFile(e,t){return pge(e,t)},async appendFile(e,t,n){if(n?.mode!==void 0)try{let r=await z_(e,"ax",n.mode);try{await r.appendFile(t)}finally{await r.close()}return}catch(r){if(ke(r)!=="EEXIST")throw r}return uge(e,t)},async symlink(e,t,n){return Ege(e,t,n)},async link(e,t){return fge(e,t)},async chmod(e,t){return dge(e,t)},statSync(e){let n=[];try{const t=zt(n,en`fs.statSync(${e})`,0);return _e.statSync(e)}catch(r){var o=r,s=1}finally{jt(n,o,s)}},lstatSync(e){let n=[];try{const t=zt(n,en`fs.lstatSync(${e})`,0);return _e.lstatSync(e)}catch(r){var o=r,s=1}finally{jt(n,o,s)}},readFileSync(e,t){let r=[];try{const n=zt(r,en`fs.readFileSync(${e})`,0);return _e.readFileSync(e,{encoding:t.encoding})}catch(o){var s=o,i=1}finally{jt(r,s,i)}},readSync(e,t){let o=[];try{const n=zt(o,en`fs.readSync(${e}, ${t.length} bytes)`,0);let r=void 0;try{r=_e.openSync(e,"r");let c=[],l=0;while(l<t.length){let d=Buffer.allocUnsafe(Math.min(65536,t.length-l)),f=_e.readSync(r,d,0,d.length,l);if(f===0)break;c.push(d.subarray(0,f)),l+=f}return{buffer:Buffer.concat(c,l),bytesRead:l}}finally{if(r!==void 0)_e.closeSync(r)}}catch(s){var i=s,a=1}finally{jt(o,i,a)}},appendFileSync(e,t,n){let o=[];try{const r=zt(o,en`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(n?.mode!==void 0)try{let c=_e.openSync(e,"ax",n.mode);try{_e.appendFileSync(c,t)}finally{_e.closeSync(c)}return}catch(c){if(ke(c)!=="EEXIST")throw c}_e.appendFileSync(e,t)}catch(s){var i=s,a=1}finally{jt(o,i,a)}},unlinkSync(e){let n=[];try{const t=zt(n,en`fs.unlinkSync(${e})`,0);_e.unlinkSync(e)}catch(r){var o=r,s=1}finally{jt(n,o,s)}},renameSync(e,t){let r=[];try{const n=zt(r,en`fs.renameSync(${e} ${vge} ${t})`,0);_e.renameSync(e,t)}catch(o){var s=o,i=1}finally{jt(r,s,i)}},readlinkSync(e){let n=[];try{const t=zt(n,en`fs.readlinkSync(${e})`,0);return _e.readlinkSync(e)}catch(r){var o=r,s=1}finally{jt(n,o,s)}},realpathSync(e){let n=[];try{const t=zt(n,en`fs.realpathSync(${e})`,0);return ot(_e.realpathSync(e))}catch(r){var o=r,s=1}finally{jt(n,o,s)}},mkdirSync(e,t){let o=[];try{const n=zt(o,en`fs.mkdirSync(${e})`,0);let r={recursive:!0};if(t?.mode!==void 0)r.mode=t.mode;try{_e.mkdirSync(e,r)}catch(c){if(ke(c)!=="EEXIST")throw c}}catch(s){var i=s,a=1}finally{jt(o,i,a)}},readdirSync(e){let n=[];try{const t=zt(n,en`fs.readdirSync(${e})`,0);return _e.readdirSync(e,{withFileTypes:!0})}catch(r){var o=r,s=1}finally{jt(n,o,s)}},rmSync(e,t){let r=[];try{const n=zt(r,en`fs.rmSync(${e})`,0);_e.rmSync(e,t)}catch(o){var s=o,i=1}finally{jt(r,s,i)}},createWriteStream(e){return _e.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return Nz(e);let n=await z_(e,process.platform==="win32"?"r":_e.constants.O_RDONLY|(_e.constants.O_NONBLOCK??0)|(_e.constants.O_NOCTTY??0));try{if(!(await n.stat()).isFile())return Buffer.alloc(0);return await Kz(n,t,"file")}finally{await n.close()}},async readFileFdGated(e,t){try{let n=wge();if(n===0){if(!(await tT(e)).isFile())return null}let r=await z_(e,_e.constants.O_RDONLY|n);try{let o=await r.stat();if(!o.isFile()||o.size>t)return null;let s=Number(o.size),i=Buffer.allocUnsafe(s),a=0;while(a<s){let{bytesRead:c}=await r.read(i,a,s-a,a);if(c===0)break;a+=c}return{content:(a<s?i.subarray(0,a):i).toString("utf8"),stats:o}}finally{await r.close()}}catch{return null}}};function et(){return aT}async function Kz(e,t,n){let r=n!==void 0?n==="file":(await e.stat()).isFile(),o=[],s=0;while(s<t){let i=Buffer.allocUnsafe(Math.min(65536,t-s)),{bytesRead:a}=await e.read(i,0,i.length,r?s:null);if(a===0)break;o.push(i.subarray(0,a)),s+=a}return Buffer.concat(o,s)}import{readdir as Uwt,readFile as Zz}from"fs/promises";import{release as jge}from"os";var Dge="finished",Yvt=`" ${Dge}`;var Lge="channel",Jvt=`<${Lge} source="`;import Dt from"node:path";import Gz from"node:os";import cT from"node:process";var _i=Gz.homedir(),lT=Gz.tmpdir(),{env:Kl}=cT,Nge=(e)=>{let t=Dt.join(_i,"Library");return{data:Dt.join(t,"Application Support",e),config:Dt.join(t,"Preferences",e),cache:Dt.join(t,"Caches",e),log:Dt.join(t,"Logs",e),temp:Dt.join(lT,e)}},Mge=(e)=>{let t=Kl.APPDATA||Dt.join(_i,"AppData","Roaming"),n=Kl.LOCALAPPDATA||Dt.join(_i,"AppData","Local");return{data:Dt.join(n,e,"Data"),config:Dt.join(t,e,"Config"),cache:Dt.join(n,e,"Cache"),log:Dt.join(n,e,"Log"),temp:Dt.join(lT,e)}},Uge=(e)=>{let t=Dt.basename(_i);return{data:Dt.join(Kl.XDG_DATA_HOME||Dt.join(_i,".local","share"),e),config:Dt.join(Kl.XDG_CONFIG_HOME||Dt.join(_i,".config"),e),cache:Dt.join(Kl.XDG_CACHE_HOME||Dt.join(_i,".cache"),e),log:Dt.join(Kl.XDG_STATE_HOME||Dt.join(_i,".local","state"),e),temp:Dt.join(lT,t,e)}};function uT(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(cT.platform==="darwin")return Nge(e);if(cT.platform==="win32")return Mge(e);return Uge(e)}function dT(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}var lwt=uT("claude-cli");function $ge(){if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return"essential-traffic";if(process.env.DISABLE_TELEMETRY)return"no-telemetry";if(Oe(process.env.DO_NOT_TRACK))return"no-telemetry";return"default"}function Wz(){return $ge()==="essential-traffic"}var zge=100;class qz{recentErrors=[];queue=[];sink=null;hardFailMode=void 0;remember(e){if(this.recentErrors.length>=zge)this.recentErrors.shift();this.recentErrors.push(e)}dispatch(e){if(this.sink===null){this.queue.push(e);return}switch(e.type){case"error":this.sink.logError(e.error);break;case"mcpError":this.sink.logMCPError(e.serverName,e.error);break;case"mcpDebug":this.sink.logMCPDebug(e.serverName,e.message);break}}attachSink(e){if(this.sink!==null)return;this.sink=e;let t=this.queue;this.queue=[];for(let n of t)this.dispatch(n)}isHardFailMode(){return this.hardFailMode??=process.argv.includes("--hard-fail"),this.hardFailMode}reset(){this.recentErrors=[],this.queue=[],this.sink=null,this.hardFailMode=void 0}}var Vz=new qz;function j_(e){let t=jr(e);try{if(Oe(process.env.CLAUDE_CODE_USE_BEDROCK)||Oe(process.env.CLAUDE_CODE_USE_VERTEX)||Oe(process.env.CLAUDE_CODE_USE_FOUNDRY)||Oe(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||Oe(process.env.CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD)||Oe(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||Wz())return;let r={error:t.stack||t.message,timestamp:new Date().toISOString()};Vz.remember(r),Vz.dispatch({type:"error",error:t})}catch{}}function H_(){try{return et().readFileSync("/proc/version",{encoding:"utf8"}).toLowerCase()}catch{return}}function B_(e){return e.includes("microsoft")||e.includes("wsl")}class Yz{sources;primedProcVersion;fallbackProcVersion;fallbackProcVersionRead=!1;platform;wslVersion=null;macOSMajorVersion=null;linuxDistroInfo;constructor(e){this.sources=e}kernelString(){if(this.primedProcVersion!==void 0)return this.primedProcVersion;if(!this.fallbackProcVersionRead)this.fallbackProcVersion=this.sources.readProcVersionSync(),this.fallbackProcVersionRead=!0;return this.fallbackProcVersion}getPlatform(){if(this.platform!==void 0)return this.platform;try{if(this.sources.platform==="darwin")this.platform="macos";else if(this.sources.platform==="win32")this.platform="windows";else if(this.sources.platform==="linux")if(this.sources.env.WSL_DISTRO_NAME||this.sources.env.WSL_INTEROP)this.platform="wsl";else{let e=this.kernelString();this.platform=e!==void 0&&B_(e)?"wsl":"linux"}else this.platform="unknown"}catch(e){j_(e),this.platform="unknown"}return this.platform}getWslVersion(){if(this.wslVersion!==null)return this.wslVersion;if(this.sources.platform!=="linux"){this.wslVersion=void 0;return}let e=this.kernelString();if(e===void 0){this.wslVersion=void 0;return}let t=e.match(/wsl(\d+)/);if(t&&t[1])this.wslVersion=t[1];else if(e.includes("microsoft"))this.wslVersion="1";else this.wslVersion=void 0;return this.wslVersion}getMacOSMajorVersion(){if(this.macOSMajorVersion!==null)return this.macOSMajorVersion;if(this.sources.platform!=="darwin"){this.macOSMajorVersion=void 0;return}let e=this.sources.osRelease().match(/^(\d+)\./);return this.macOSMajorVersion=e&&e[1]?parseInt(e[1],10)-9:void 0,this.macOSMajorVersion}getLinuxDistroInfo(){return this.linuxDistroInfo??=this.readLinuxDistroInfo()}async readLinuxDistroInfo(){if(this.sources.platform!=="linux")return;let e={linuxKernel:this.sources.osRelease()};try{let t=await this.sources.readOsRelease();for(let n of t.split(`
119
+ `)){let r=n.match(/^(ID|VERSION_ID)=(.*)$/);if(r&&r[1]&&r[2]){let o=r[2].replace(/^"|"$/g,"");if(r[1]==="ID")e.linuxDistroId=o;else e.linuxDistroVersion=o}}}catch{}return e}async prime(){if(this.primedProcVersion!==void 0||this.sources.platform!=="linux")return;try{let e=await this.sources.readProcVersion();this.primedProcVersion=e.toLowerCase()}catch(e){ce(`Failed to read /proc/version for WSL detection: ${e}`,{level:"error"});return}this.platform=void 0,this.wslVersion=null}}var Hge;function Bge(){return Hge??=new Yz({platform:process.platform,env:process.env,readProcVersionSync:H_,readProcVersion:()=>Zz("/proc/version",{encoding:"utf8"}),osRelease:jge,readOsRelease:()=>Zz("/etc/os-release","utf8")})}function Dn(){return Bge().getPlatform()}function Jz(e){return!e.isDirectory()&&!e.isFile()&&!e.isSymbolicLink()&&!e.isFIFO()&&!e.isSocket()&&!e.isBlockDevice()&&!e.isCharacterDevice()}import{delimiter as eAt,isAbsolute as Kge}from"path";function Gge(e){let t=process.cwd();return e.filter((n)=>!dg(n,t))}function Xz(e){return Wge(e,Bun.which(e))}function Wge(e,t){if(!t||process.platform!=="win32"||Kge(e))return t;return Gge([t])[0]??null}var Qz=async(e)=>Xz(e),ej=Xz;function tj(){if(process.platform!=="linux")return!1;return et().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function nj(){if(process.platform!=="linux")return;try{return et().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function rj(){if(process.platform!=="linux")return!1;return et().existsSync("/.dockerenv")}function Rve(){if(et().existsSync(Bf(Wt(),".config.json")))return Bf(Wt(),".config.json");return Ove()}function Ove(){let e=`.claude${rz()}.json`;return Bf(process.env.CLAUDE_CONFIG_DIR||Cve(),e)}async function Pve(){try{let{externalHttp:e}=await Promise.resolve().then(() => (PK(),OK));return await e.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}}async function Ive(){return null}async function mu(e){try{return!!await Qz(e)}catch{return!1}}async function Dve(){let e=[];if(await mu("npm"))e.push("npm");if(await mu("yarn"))e.push("yarn");if(await mu("pnpm"))e.push("pnpm");return e}async function Lve(){let e=[];if(await mu("bun"))e.push("bun");if(await mu("deno"))e.push("deno");if(await mu("node"))e.push("node");return e}var IK=["git","node","npm","npx","yarn","pnpm","bun","deno","tsc","python","python3","py","pip","uv","poetry","ruby","gem","bundle","rake","dotnet","msbuild","nuget","cl","nmake","cmake","ninja","make","gcc","g++","clang","cargo","rustc","go","java","javac","mvn","gradle","docker"],Nve=1000;async function Mve(e){try{return/appinstaller/i.test(await Tve(e))}catch{return!1}}async function Uve(e){if(e===""||Ad(e)||vd(e))return!1;return!await iT(DK(e))}async function Fve(e,t){let n=Dn()==="windows",r=new Set(e),o=n?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],s=Tr((process.env.PATH??"").split(kve).map((i)=>i.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(s.map(async(i)=>{if(!await Uve(i))return;let a;try{a=await wve(i,{withFileTypes:!0})}catch{return}let c=n&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(i);for(let l of a){if(l.isDirectory())continue;let u=l.name;if(n){let d=u.toLowerCase(),f=d.lastIndexOf(".");if(f<=0||!o.includes(d.slice(f)))continue;u=d.slice(0,f)}if(!r.has(u)||t.has(u))continue;if(n){if(c&&await Mve(Bf(i,l.name)))continue}else{let d=Bf(i,l.name);if((l.isSymbolicLink()||Jz(l))&&await iT(DK(d)))continue;try{await KC(d,vve.X_OK)}catch{continue}}t.add(u)}}))}async function $ve(){let e=new Set;try{await Lr(Fve(IK,e),Nve,"build tool PATH scan timed out")}catch{}return IK.filter((t)=>e.has(t))}function zve(e){try{if(!e.isWslEnvironment())return!1;let t=ej("npm");if(t===null)return!1;return t.startsWith("/mnt/c/")}catch(t){return!1}}function jve(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var LK=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function Hve(e){let t=e.toLowerCase();return t.includes("windsurf")||t.includes("devin.app")||t.includes("devin desktop")||t.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(t)}function Bve(){if(process.env.CURSOR_TRACE_ID)return"cursor";let e=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(e.includes("cursor"))return"cursor";if(Hve(e))return"windsurf";if(e.includes("antigravity"))return"antigravity";let t=process.env.__CFBundleIdentifier?.toLowerCase();if(t?.includes("vscodium"))return"codium";if(t?.includes("windsurf")||t?.includes("devin"))return"windsurf";if(t?.includes("com.google.android.studio"))return"androidstudio";if(t){for(let n of LK)if(t.includes(n))return n}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM){if(/^devin([ -]desktop)?$/i.test(process.env.TERM_PROGRAM))return"windsurf";return process.env.TERM_PROGRAM}if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(UK())return"ssh-session";if(process.env.TERM){let n=process.env.TERM;if(n.includes("alacritty"))return"alacritty";if(n.includes("rxvt"))return"rxvt";if(n.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class NK{sources;globalClaudeFile;internetAccess;internetProbeOutcome;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(e){this.sources=e}getGlobalClaudeFile(){return this.globalClaudeFile??=Rve()}seedGlobalClaudeFile(e){if(this.globalClaudeFile===void 0)return this.globalClaudeFile=e,"seeded";return this.globalClaudeFile===e?"unchanged":"conflict"}hasInternetAccess(){return this.internetAccess??=Pve().then((e)=>(this.internetProbeOutcome=e,e))}getInternetProbeOutcome(){return this.internetProbeOutcome}getPackageManagers(){return this.packageManagers??=Dve()}getRuntimes(){return this.runtimes??=Lve()}getDetectedBuildTools(){return this.detectedBuildTools??=$ve()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=zve(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=Gve(this)}async prime(){if(this.primedWslInteropExists!==void 0||process.platform!=="linux")return;let[e,t,n]=await Promise.all([KC("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),Ave("/sys/hypervisor/uuid",{encoding:"utf8"}).then((r)=>r.trim().toLowerCase(),()=>{return}),KC("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=e,this.primedHypervisorUuid=t??"",this.primedDockerenvExists=n,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var Kve=new Je(()=>new NK({wslInteropExistsSync:tj,readHypervisorUuidSync:nj,dockerenvExistsSync:rj}));function fu(){return Kve.of(Tn().host)}function MK(){return fu().detectDeploymentEnvironment()}function Gve(e){if(Oe(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(Oe(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(Oe(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(Oe(process.env.GOOGLE_CLOUD_WORKSTATIONS))return"gcp-cloud-workstations";if(process.env.C9_PID||process.env.C9_USER)return"aws-cloud9";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(Oe(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(Oe(process.env.RENDER))return"render";if(Oe(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(Oe(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";if(e.hypervisorUuid().startsWith("ec2"))return"aws-ec2";if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(Oe(process.env.GITHUB_ACTIONS))return"github-actions";if(Oe(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(Oe(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(e.isDockerenvPresent())return"docker";if(Hf.platform==="darwin")return"unknown-darwin";if(Hf.platform==="linux")return"unknown-linux";if(Hf.platform==="win32")return"unknown-win32";return"unknown"}function UK(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var Hf={hasInternetAccess(){return fu().hasInternetAccess()},probeInternalNetworkAccess:Ive,isCI:Oe(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:Bve(),isSSH:UK,getPackageManagers(){return fu().getPackageManagers()},getRuntimes(){return fu().getRuntimes()},isRunningWithBun:el,isWslEnvironment(){return fu().isWslEnvironment()},isNpmFromWindowsPath(){return fu().isNpmFromWindowsPath()},isConductor:jve,detectDeploymentEnvironment:MK};var GC={};Zn(GC,{CLAUDE_AX_PREPARK_MS:()=>qve,CLAUDE_AX_SCREEN_READER:()=>Wve,CLAUDE_AX_STARTUP_QUIET_MS:()=>Vve,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>Zve,CLAUDE_CODE_ACCESSIBILITY:()=>tTe,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>nTe,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>Jve,CLAUDE_CODE_AMBER_ASTROLABE:()=>RAe,CLAUDE_CODE_ARTIFACT_ASSETS:()=>wTe,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>dTe,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>pTe,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>mTe,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>hTe,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>fTe,CLAUDE_CODE_ARTIFACT_DB:()=>gTe,CLAUDE_CODE_ARTIFACT_DB_STR_REPLACE:()=>_Te,CLAUDE_CODE_ARTIFACT_DELETE:()=>yTe,CLAUDE_CODE_ARTIFACT_MULTI_FILE:()=>ATe,CLAUDE_CODE_ARTIFACT_OPEN_ACTION:()=>bTe,CLAUDE_CODE_ARTIFACT_PIN:()=>ETe,CLAUDE_CODE_ARTIFACT_PRESENCE:()=>vTe,CLAUDE_CODE_ARTIFACT_PREVIEW:()=>STe,CLAUDE_CODE_ARTIFACT_ROOM:()=>xTe,CLAUDE_CODE_ARTIFACT_TOOLSET:()=>TTe,CLAUDE_CODE_ARTIFACT_TYPES:()=>CTe,CLAUDE_CODE_ARTIFACT_TYPE_CATALOG:()=>kTe,CLAUDE_CODE_ARTIFACT_TYPE_CLOUD_CREATE:()=>RTe,CLAUDE_CODE_ARTIFACT_VERIFY:()=>OTe,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>PTe,CLAUDE_CODE_BASALT_COVE:()=>rwe,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>lTe,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>ITe,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>dwe,CLAUDE_CODE_BISON_CAIRN:()=>OAe,CLAUDE_CODE_BREEZY_HORIZON:()=>owe,CLAUDE_CODE_BUBBLEWRAP:()=>DTe,CLAUDE_CODE_CARVED_SLATE:()=>rTe,CLAUDE_CODE_CCR_EARLY_HYDRATE_PREFETCH:()=>NTe,CLAUDE_CODE_CCR_LAZY_SUBAGENT_HYDRATE:()=>LTe,CLAUDE_CODE_CHILD_SESSION:()=>MTe,CLAUDE_CODE_CHROME_MCP_ORG_DENIED:()=>UTe,CLAUDE_CODE_COLD_COMPACT:()=>FTe,CLAUDE_CODE_COORDINATOR_FORCE_WORKER_INHERIT_MODEL:()=>pwe,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>hwe,CLAUDE_CODE_COZY_TEAPOT:()=>nwe,CLAUDE_CODE_DAPPER_LAGOON:()=>swe,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>ywe,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>gwe,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>Swe,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>bwe,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>Ewe,CLAUDE_CODE_DISABLE_ARTIFACT:()=>xwe,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>vwe,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>wwe,CLAUDE_CODE_DISABLE_AWAITING_USER_IDLE:()=>Awe,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>Twe,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>kwe,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>Rwe,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>Owe,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>Pwe,CLAUDE_CODE_DISABLE_CFC_PROMPT:()=>Iwe,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>Dwe,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>Lwe,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>Nwe,CLAUDE_CODE_DISABLE_CRON:()=>Mwe,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>Uwe,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>Fwe,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>$we,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>zwe,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>jwe,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>Hwe,CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND:()=>Cwe,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>Bwe,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>Kwe,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>Gwe,CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE:()=>Wwe,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>Vwe,CLAUDE_CODE_DISABLE_MOUSE:()=>Ywe,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>Jwe,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>Xwe,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>Qwe,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>eAe,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>tAe,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>nAe,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>rAe,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>oAe,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>qwe,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>sAe,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>iAe,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>aAe,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>uAe,CLAUDE_CODE_DISABLE_THINKING:()=>pAe,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>fAe,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>mAe,CLAUDE_CODE_EDITOR_CODELIVERY:()=>fwe,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>gAe,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>_Ae,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>yAe,CLAUDE_CODE_ENABLE_CFC:()=>SAe,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>bAe,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>EAe,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>xAe,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>vAe,CLAUDE_CODE_ENABLE_FUNCTION_HOOKS:()=>Nke,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>wAe,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>AAe,CLAUDE_CODE_ENABLE_NARRATION:()=>$Ae,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>UAe,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>FAe,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>zAe,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>jAe,CLAUDE_CODE_ENABLE_TASKS:()=>HAe,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>BAe,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>KAe,CLAUDE_CODE_ENABLE_XAA:()=>GAe,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>ACe,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>$Te,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>zTe,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>TAe,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>VTe,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>GTe,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>WTe,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>qTe,CLAUDE_CODE_FORK_SUBAGENT:()=>jTe,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>ZTe,CLAUDE_CODE_FORWARD_USER_INTENT:()=>mwe,CLAUDE_CODE_GAULT_KESTREL:()=>IAe,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>CAe,CLAUDE_CODE_GENTLE_PARASOL:()=>ewe,CLAUDE_CODE_GLOB_HIDDEN:()=>HTe,CLAUDE_CODE_GLOB_NO_IGNORE:()=>BTe,CLAUDE_CODE_GORSE_PLOVER:()=>DAe,CLAUDE_CODE_HARBOR_KITE:()=>WAe,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>qAe,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>VAe,CLAUDE_CODE_HIDE_CWD:()=>KTe,CLAUDE_CODE_HOOKS_SAME_THREAD:()=>Lke,CLAUDE_CODE_HOVER_REST:()=>kAe,CLAUDE_CODE_HUMBLE_HAMMOCK:()=>cwe,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>YTe,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>JTe,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>XTe,CLAUDE_CODE_INTRO_FRAME:()=>oTe,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>MAe,CLAUDE_CODE_KB_COHESION_FIXES:()=>eTe,CLAUDE_CODE_LANTERN_PRISM:()=>ZAe,CLAUDE_CODE_LARCH_CISTERN:()=>PAe,CLAUDE_CODE_LUMINOUS_WHISTLE:()=>awe,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>Zwe,CLAUDE_CODE_NANKEEN_KESTREL:()=>_we,CLAUDE_CODE_NATIVE_CURSOR:()=>QTe,CLAUDE_CODE_NEW_INIT:()=>eCe,CLAUDE_CODE_NONBLOCKING_STDOUT:()=>nCe,CLAUDE_CODE_NO_FLICKER:()=>tCe,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>rCe,CLAUDE_CODE_PARCHMENT_FERN:()=>LAe,CLAUDE_CODE_PEWTER_OWL:()=>MCe,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>UCe,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>oCe,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>PCe,CLAUDE_CODE_PLUGIN_DIR_WATCH:()=>Mke,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>OCe,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>DCe,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>ICe,CLAUDE_CODE_POLISHED_DEWDROP:()=>iwe,CLAUDE_CODE_POLL_EVENTS:()=>sCe,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>LCe,CLAUDE_CODE_PROACTIVE:()=>iCe,CLAUDE_CODE_PROMPT_CACHE_TTL:()=>vke,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>NCe,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>cAe,CLAUDE_CODE_REPORT_FINDINGS:()=>lAe,CLAUDE_CODE_SEND_FEEDBACK:()=>dAe,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>iTe,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>cTe,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>aTe,CLAUDE_CODE_SKILL_PROPOSALS:()=>aCe,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>cCe,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>lCe,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>uCe,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>dCe,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>pCe,CLAUDE_CODE_STELLAR_DRIFT:()=>lwe,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>fCe,CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL:()=>wke,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>mCe,CLAUDE_CODE_SYNC_PLUGINS:()=>gCe,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>hCe,CLAUDE_CODE_SYNC_SKILLS:()=>_Ce,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>yCe,CLAUDE_CODE_THINKING_DISPLAY_UPDATES:()=>uTe,CLAUDE_CODE_THISTLE_GREBE:()=>Xve,CLAUDE_CODE_THRIFTY_SONIC:()=>twe,CLAUDE_CODE_TOASTY_THIMBLE:()=>Qve,CLAUDE_CODE_TODO_REMINDER_MODE:()=>YAe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>JAe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>QAe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>XAe,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>SCe,CLAUDE_CODE_TURN_UPDATES:()=>sTe,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>bCe,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>ECe,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>xCe,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>vCe,CLAUDE_CODE_WALNUT_SPIRE:()=>wCe,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>CCe,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>kCe,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>RCe,CLAUDE_CODE_WEB_FETCH_AGENT:()=>TCe,CLAUDE_CODE_WILLOW_TERN:()=>NAe,CLAUDE_CODE_WISE_COMET:()=>uwe,CLAUDE_CODE_WORKFLOWS:()=>hAe,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>KCe,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>HCe,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>BCe,CLAUDE_DISABLE_ADOPT:()=>FCe,CLAUDE_IMPORT_CONVERSATIONS:()=>$Ce,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>zCe,CLAUDE_WORKFLOW_NAME_ONLY:()=>jCe,DISABLE_AUTOUPDATER:()=>WCe,DISABLE_AUTO_COMPACT:()=>GCe,DISABLE_BRIEF_MODE_STOP_HOOK:()=>VCe,DISABLE_BUG_COMMAND:()=>qCe,DISABLE_COST_WARNINGS:()=>ZCe,DISABLE_DOCTOR_COMMAND:()=>YCe,DISABLE_ERROR_REPORTING:()=>JCe,DISABLE_EXTRA_USAGE_COMMAND:()=>XCe,DISABLE_FEEDBACK_COMMAND:()=>QCe,DISABLE_GROWTHBOOK:()=>eke,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>tke,DISABLE_INTERLEAVED_THINKING:()=>nke,DISABLE_LOGIN_COMMAND:()=>rke,DISABLE_LOGOUT_COMMAND:()=>oke,DISABLE_PROMPT_CACHING:()=>ske,DISABLE_PROMPT_CACHING_FABLE:()=>lke,DISABLE_PROMPT_CACHING_HAIKU:()=>ike,DISABLE_PROMPT_CACHING_MYTHOS:()=>uke,DISABLE_PROMPT_CACHING_OPUS:()=>ake,DISABLE_PROMPT_CACHING_SONNET:()=>cke,DISABLE_TELEMETRY:()=>dke,DISABLE_UPDATES:()=>pke,DISABLE_UPGRADE_COMMAND:()=>fke,EMBEDDED_SEARCH_TOOLS:()=>Ike,ENABLE_BETA_TRACING_DETAILED:()=>mke,ENABLE_CLAUDEAI_MCP_SERVERS:()=>hke,ENABLE_ENHANCED_TELEMETRY_BETA:()=>gke,ENABLE_LOCKLESS_UPDATES:()=>_ke,ENABLE_LSP_TOOL:()=>yke,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>Ske,ENABLE_PID_BASED_VERSION_LOCKING:()=>bke,ENABLE_PROMPT_CACHING_1H:()=>Eke,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>xke,ENABLE_SESSION_BACKGROUNDING:()=>Ake,ENABLE_SESSION_PERSISTENCE:()=>Tke,ENABLE_TOOL_SEARCH:()=>Cke,FORCE_AUTOUPDATE_PLUGINS:()=>kke,FORCE_CODE_TERMINAL:()=>Rke,FORCE_PROMPT_CACHING_5M:()=>Oke,FORCE_VCR:()=>Pke,INK_SCREEN_READER:()=>Yve,USE_API_CONTEXT_MANAGEMENT:()=>Dke});var hu=["5m","1h"];var Wve=p.triBool(),Vve=p.int({min:0}),qve=p.int({min:0}),Zve=p.triBool(),Yve=p.bool(),Jve=p.bool(),Xve=p.str(),Qve=p.str(),ewe=p.str(),twe=p.triBool(),nwe=p.enum(["strict","relaxed"]),rwe=p.bool(),owe=p.str(),swe=p.triBool(),iwe=p.enum(["drop","block","off"]),awe=p.triBool(),cwe=p.triBool(),lwe=p.triBool(),uwe=p.triBool(),dwe=p.bool(),pwe=p.bool(),fwe=p.bool(),mwe=p.bool(),hwe=p.bool(),gwe=p.bool(),_we=p.bool(),ywe=p.bool(),Swe=p.bool(),bwe=p.bool(),Ewe=p.bool(),xwe=p.bool(),vwe=p.bool(),wwe=p.bool(),Awe=p.bool(),Twe=p.bool(),Cwe=p.bool(),kwe=p.bool(),Rwe=p.bool(),Owe=p.bool(),Pwe=p.bool(),Iwe=p.bool(),Dwe=p.bool(),Lwe=p.bool(),Nwe=p.bool(),Mwe=p.bool(),Uwe=p.bool(),Fwe=p.bool(),$we=p.bool(),zwe=p.bool(),jwe=p.triBool(),Hwe=p.bool(),Bwe=p.bool(),Kwe=p.bool(),Gwe=p.bool(),Wwe=p.bool(),Vwe=p.bool(),qwe=p.bool(),Zwe=p.enum(["corroborate","immediate","never"]),Ywe=p.triBool(),Jwe=p.triBool(),Xwe=p.bool(),Qwe=p.bool(),eAe=p.bool(),tAe=p.bool(),nAe=p.bool(),rAe=p.bool(),oAe=p.bool(),sAe=p.bool(),iAe=p.bool(),aAe=p.bool(),cAe=p.triBool(),lAe=p.bool(),uAe=p.bool(),dAe=p.triBool(),pAe=p.bool(),fAe=p.bool(),mAe=p.bool(),hAe=p.triBool(),gAe=p.bool(),_Ae=p.bool(),yAe=p.bool(),SAe=p.triBool(),bAe=p.bool(),EAe=p.bool(),xAe=p.bool(),vAe=p.triBool(),wAe=p.bool(),AAe=p.bool(),TAe=p.bool(),CAe=p.bool(),kAe=p.triBool(),RAe=p.bool(),OAe=p.triBool(),PAe=p.bool(),IAe=p.bool(),DAe=p.bool(),LAe=p.bool(),NAe=p.bool(),MAe=p.int({min:1,digitsOnly:!0}),UAe=p.triBool(),FAe=p.bool(),$Ae=p.triBool(),zAe=p.triBool(),jAe=p.bool(),HAe=p.triBool(),BAe=p.bool(),KAe=p.bool(),GAe=p.bool(),WAe=p.str(),VAe=p.bool(),qAe=p.bool(),ZAe=p.bool(),YAe=p.enum(["baseline","off"]),JAe=p.str(),XAe=p.int(),QAe=p.triBool(),eTe=p.bool(),tTe=p.bool(),nTe=p.triBool(),rTe=p.triBool(),oTe=p.triBool(),sTe=p.triBool(),iTe=p.triBool(),aTe=p.int({min:1}),cTe=p.str(),lTe=p.triBool(),uTe=p.triBool(),dTe=p.triBool(),pTe=p.triBool(),fTe=p.triBool(),mTe=p.triBool(),hTe=p.triBool(),gTe=p.triBool(),_Te=p.triBool(),yTe=p.triBool(),STe=p.triBool(),bTe=p.triBool(),ETe=p.triBool(),xTe=p.triBool(),vTe=p.triBool(),wTe=p.triBool(),ATe=p.triBool(),TTe=p.triBool(),CTe=p.triBool(),kTe=p.triBool(),RTe=p.triBool(),OTe=p.triBool(),PTe=p.triBool(),ITe=p.bool(),DTe=p.bool(),LTe=p.triBool(),NTe=p.bool(),MTe=p.bool(),UTe=p.bool(),FTe=p.bool(),$Te=p.bool(),zTe=p.bool(),jTe=p.triBool(),HTe=p.bool(),BTe=p.bool(),KTe=p.bool(),GTe=p.bool(),WTe=p.bool(),VTe=p.bool(),qTe=p.str(),ZTe=p.bool(),YTe=p.bool(),JTe=p.bool(),XTe=p.bool(),QTe=p.bool(),eCe=p.bool(),tCe=p.triBool(),nCe=p.triBool(),rCe=p.bool(),oCe=p.bool(),sCe=p.bool(),iCe=p.bool(),aCe=p.bool(),cCe=p.bool(),lCe=p.str(),uCe=p.bool(),dCe=p.bool(),pCe=p.bool(),fCe=p.bool(),mCe=p.bool(),hCe=p.bool(),gCe=p.bool(),_Ce=p.bool(),yCe=p.bool(),SCe=p.triBool(),bCe=p.bool(),ECe=p.bool(),xCe=p.bool(),vCe=p.triBool(),wCe=p.bool(),ACe=p.bool(),TCe=p.triBool(),CCe=p.int({min:1,digitsOnly:!0}),kCe=p.bool(),RCe=p.bool(),OCe=p.bool(),PCe=p.bool(),ICe=p.bool(),DCe=p.bool(),LCe=p.bool(),NCe=p.bool(),MCe=p.triBool(),UCe=p.triBool(),FCe=p.bool(),$Ce=p.bool(),zCe=p.bool(),jCe=p.bool(),HCe=p.int({min:1}),BCe=p.int({min:1}),KCe=p.int({min:0}),GCe=p.bool(),WCe=p.bool(),VCe=p.bool(),qCe=p.bool(),ZCe=p.bool(),YCe=p.bool(),JCe=p.bool(),XCe=p.bool(),QCe=p.bool(),eke=p.bool(),tke=p.bool(),nke=p.bool(),rke=p.bool(),oke=p.bool(),ske=p.bool(),ike=p.bool(),ake=p.bool(),cke=p.bool(),lke=p.bool(),uke=p.bool(),dke=p.bool(),pke=p.bool(),fke=p.bool(),mke=p.bool(),hke=p.triBool(),gke=p.bool(),_ke=p.bool(),yke=p.bool(),Ske=p.triBool(),bke=p.triBool(),Eke=p.bool(),xke=p.bool(),vke=p.enum(hu),wke=p.enum(hu),Ake=p.bool(),Tke=p.bool(),Cke=p.str(),kke=p.bool(),Rke=p.bool(),Oke=p.bool(),Pke=p.bool(),Ike=p.bool(),Dke=p.bool(),Lke=p.bool(),Nke=p.triBool(),Mke=p.triBool();var WC={};Zn(WC,{ALACRITTY_LOG:()=>dOe,ANDROID_HOME:()=>BRe,ANDROID_SDK_ROOT:()=>KRe,APPDATA:()=>fRe,APP_URL:()=>$Pe,AWS_CA_BUNDLE:()=>ORe,AWS_EXECUTION_ENV:()=>CPe,AWS_LAMBDA_FUNCTION_NAME:()=>TPe,AZURE_FUNCTIONS_ENVIRONMENT:()=>FPe,BAT_THEME:()=>KPe,BROWSER:()=>eRe,BUILDKITE:()=>aPe,BUN_CHROME_PATH:()=>BPe,BUN_INSTALL:()=>HPe,CARGO_HTTP_CAINFO:()=>IRe,CF_PAGES:()=>wPe,CIRCLECI:()=>iPe,CLOUDSDK_CONFIG:()=>NPe,CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE:()=>kRe,CODER:()=>pPe,CODER_WORKSPACE_NAME:()=>fPe,CODESPACES:()=>dPe,COLORFGBG:()=>qRe,COLORTERM:()=>VRe,COMSPEC:()=>Gke,CONTAINER_SANDBOX_MOUNT_POINT:()=>dRe,CURL_CA_BUNDLE:()=>CRe,CURSOR_TRACE_ID:()=>ROe,ComSpec:()=>Vke,ConEmuANSI:()=>xOe,ConEmuPID:()=>vOe,ConEmuTask:()=>wOe,DAYTONA_WS_ID:()=>gPe,DEMO_VERSION:()=>YPe,DENO_CERT:()=>PRe,DENO_DEPLOYMENT_ID:()=>APe,DISPLAY:()=>tRe,DO_NOT_TRACK:()=>ZRe,DYNO:()=>vPe,EDITOR:()=>Xke,FORCE_COLOR:()=>WRe,GCLOUD_PROJECT:()=>OPe,GCM_INTERACTIVE:()=>UOe,GH_CONFIG_DIR:()=>zOe,GH_ENTERPRISE_TOKEN:()=>KOe,GH_HOST:()=>BOe,GH_TOKEN:()=>HOe,GITHUB_ACTIONS:()=>ZOe,GITHUB_ACTION_INPUTS:()=>YOe,GITHUB_ACTION_PATH:()=>JOe,GITHUB_ACTOR:()=>XOe,GITHUB_ACTOR_ID:()=>QOe,GITHUB_ENTERPRISE_TOKEN:()=>WOe,GITHUB_ENV:()=>VOe,GITHUB_EVENT_NAME:()=>ePe,GITHUB_EVENT_PATH:()=>tPe,GITHUB_REPOSITORY:()=>nPe,GITHUB_REPOSITORY_ID:()=>rPe,GITHUB_REPOSITORY_OWNER:()=>oPe,GITHUB_REPOSITORY_OWNER_ID:()=>sPe,GITHUB_TOKEN:()=>GOe,GITHUB_WORKSPACE:()=>qOe,GITLAB_CI:()=>cPe,GITPOD_WORKSPACE_ID:()=>mPe,GIT_ASKPASS:()=>MOe,GIT_CONFIG_COUNT:()=>FOe,GIT_CONFIG_GLOBAL:()=>$Oe,GIT_CONFIG_NOSYSTEM:()=>FRe,GIT_SSH_COMMAND:()=>LOe,GIT_SSL_CAINFO:()=>URe,GIT_SSL_CAPATH:()=>$Re,GIT_TERMINAL_PROMPT:()=>NOe,GNOME_TERMINAL_SERVICE:()=>lOe,GOOGLE_APPLICATION_CREDENTIALS:()=>PPe,GOOGLE_CLOUD_PROJECT:()=>RPe,GOOGLE_CLOUD_WORKSTATIONS:()=>hPe,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH:()=>LRe,HEX_CACERTS_PATH:()=>MRe,HISTFILE:()=>ERe,HOME:()=>Uke,HTTPLIB2_CA_CERTS:()=>RRe,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>AOe,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>TOe,IS_DEMO:()=>ZPe,IS_SANDBOX:()=>qPe,ITERM_SESSION_ID:()=>sOe,JAVA_HOME:()=>jRe,JAVA_TOOL_OPTIONS:()=>HRe,KITTY_WINDOW_ID:()=>iOe,KONSOLE_VERSION:()=>aOe,KUBERNETES_SERVICE_HOST:()=>jPe,K_SERVICE:()=>kPe,LANG:()=>rRe,LC_ALL:()=>oRe,LC_TERMINAL:()=>QRe,LC_TIME:()=>sRe,LOCALAPPDATA:()=>mRe,MSYSTEM:()=>EOe,NETLIFY:()=>xPe,NIX_SSL_CERT_FILE:()=>NRe,NODE_EXTRA_CA_CERTS:()=>vRe,NODE_OPTIONS:()=>xRe,NO_COLOR:()=>GRe,NoDefaultCurrentDirectoryInExePath:()=>Jke,P4PORT:()=>GPe,PATH:()=>Fke,PATHEXT:()=>Yke,PIP_CERT:()=>DRe,PLAYWRIGHT_BROWSERS_PATH:()=>WPe,PREFIX:()=>zke,PROJECT_DOMAIN:()=>SPe,PWD:()=>$ke,ProgramFiles:()=>Zke,RENDER:()=>EPe,REPL_ID:()=>_Pe,REPL_SLUG:()=>yPe,REQUESTS_CA_BUNDLE:()=>TRe,RUNNER_ENVIRONMENT:()=>uPe,RUNNER_OS:()=>lPe,SAFEUSER:()=>hRe,SESSIONNAME:()=>fOe,SHELL:()=>Kke,SPACE_CREATOR_USER_ID:()=>zPe,SSH_AUTH_SOCK:()=>DOe,SSH_CLIENT:()=>OOe,SSH_CONNECTION:()=>POe,SSH_TTY:()=>IOe,SSL_CERT_DIR:()=>ARe,SSL_CERT_FILE:()=>wRe,STY:()=>mOe,SUDO_GID:()=>cRe,SUDO_UID:()=>aRe,SUDO_USER:()=>lRe,SYSTEMROOT:()=>Wke,SystemRoot:()=>qke,TEMP:()=>Bke,TERM:()=>YRe,TERMINAL:()=>eOe,TERMINAL_EMULATOR:()=>tOe,TERMINATOR_UUID:()=>nOe,TERMUX_VERSION:()=>rOe,TERM_PROGRAM:()=>JRe,TERM_PROGRAM_VERSION:()=>XRe,TILIX_ID:()=>oOe,TMP:()=>Hke,TMPDIR:()=>jke,TMUX:()=>hOe,TMUX_PANE:()=>gOe,TRACEPARENT:()=>JPe,TRACESTATE:()=>XPe,USER:()=>iRe,USERNAME:()=>uRe,USERPROFILE:()=>pRe,USE_BUILTIN_RIPGREP:()=>VPe,UV_THREADPOOL_SIZE:()=>zRe,VERCEL:()=>bPe,VISUAL:()=>Qke,VSCODE_GIT_ASKPASS_MAIN:()=>kOe,VTE_VERSION:()=>uOe,WAYLAND_DISPLAY:()=>nRe,WEBSITE_SITE_NAME:()=>MPe,WEBSITE_SKU:()=>UPe,WSL_DISTRO_NAME:()=>SOe,WSL_INTEROP:()=>bOe,WT_SESSION:()=>pOe,XDG_CACHE_HOME:()=>SRe,XDG_CONFIG_HOME:()=>_Re,XDG_DATA_HOME:()=>yRe,XDG_RUNTIME_DIR:()=>gRe,XDG_STATE_HOME:()=>bRe,XTERM_VERSION:()=>cOe,ZDOTDIR:()=>jOe,ZED_TERM:()=>yOe,ZELLIJ:()=>_Oe,__CFBundleIdentifier:()=>COe,gcloud_project:()=>IPe,google_application_credentials:()=>LPe,google_cloud_project:()=>DPe});var Uke=p.str(),Fke=p.str(),$ke=p.str(),zke=p.str(),jke=p.str(),Hke=p.str(),Bke=p.str(),Kke=p.str(),Gke=p.str(),Wke=p.str(),Vke=p.str(),qke=p.str(),Zke=p.str(),Yke=p.str(),Jke=p.str(),Xke=p.str(),Qke=p.str(),eRe=p.str(),tRe=p.str(),nRe=p.str(),rRe=p.str(),oRe=p.str(),sRe=p.str(),iRe=p.str(),aRe=p.int({min:0,digitsOnly:!0}),cRe=p.int({min:0,digitsOnly:!0}),lRe=p.str(),uRe=p.str(),dRe=p.str(),pRe=p.str(),fRe=p.str(),mRe=p.str(),hRe=p.str(),gRe=p.str(),_Re=p.str(),yRe=p.str(),SRe=p.str(),bRe=p.str(),ERe=p.str(),xRe=p.str(),vRe=p.str(),wRe=p.str(),ARe=p.str(),TRe=p.str(),CRe=p.str(),kRe=p.str(),RRe=p.str(),ORe=p.str(),PRe=p.str(),IRe=p.str(),DRe=p.str(),LRe=p.str(),NRe=p.str(),MRe=p.str(),URe=p.str(),FRe=p.str(),$Re=p.str(),zRe=p.str(),jRe=p.str(),HRe=p.str(),BRe=p.str(),KRe=p.str(),GRe=p.rawStr(),WRe=p.rawStr(),VRe=p.str(),qRe=p.str(),ZRe=p.str(),YRe=p.str(),JRe=p.str(),XRe=p.str(),QRe=p.str(),eOe=p.str(),tOe=p.str(),nOe=p.str(),rOe=p.str(),oOe=p.str(),sOe=p.str(),iOe=p.str(),aOe=p.str(),cOe=p.str(),lOe=p.str(),uOe=p.str(),dOe=p.str(),pOe=p.str(),fOe=p.str(),mOe=p.str(),hOe=p.str(),gOe=p.str(),_Oe=p.str(),yOe=p.str(),SOe=p.str(),bOe=p.str(),EOe=p.str(),xOe=p.str(),vOe=p.str(),wOe=p.str(),AOe=p.str(),TOe=p.str(),COe=p.str(),kOe=p.str(),ROe=p.rawStr(),OOe=p.str(),POe=p.str(),IOe=p.str(),DOe=p.str(),LOe=p.str(),NOe=p.str(),MOe=p.str(),UOe=p.str(),FOe=p.str(),$Oe=p.str(),zOe=p.str(),jOe=p.str(),HOe=p.str(),BOe=p.str(),KOe=p.str(),GOe=p.str(),WOe=p.str(),VOe=p.str(),qOe=p.str(),ZOe=p.str(),YOe=p.rawStr(),JOe=p.str(),XOe=p.str(),QOe=p.str(),ePe=p.str(),tPe=p.str(),nPe=p.str(),rPe=p.str(),oPe=p.str(),sPe=p.str(),iPe=p.str(),aPe=p.str(),cPe=p.str(),lPe=p.str(),uPe=p.str(),dPe=p.str(),pPe=p.str(),fPe=p.str(),mPe=p.str(),hPe=p.str(),gPe=p.str(),_Pe=p.str(),yPe=p.str(),SPe=p.str(),bPe=p.str(),EPe=p.str(),xPe=p.str(),vPe=p.str(),wPe=p.str(),APe=p.str(),TPe=p.str(),CPe=p.str(),kPe=p.str(),RPe=p.str(),OPe=p.str(),PPe=p.str(),IPe=p.str(),DPe=p.str(),LPe=p.str(),NPe=p.str(),MPe=p.str(),UPe=p.str(),FPe=p.str(),$Pe=p.str(),zPe=p.str(),jPe=p.str(),HPe=p.str(),BPe=p.str(),KPe=p.str(),GPe=p.str(),WPe=p.str(),VPe=p.str(),qPe=p.str(),ZPe=p.str(),YPe=p.str(),JPe=p.str(),XPe=p.str();var VC={};Zn(VC,{AI_AGENT:()=>zLe,ALLOW_ANT_COMPUTER_USE_MCP:()=>jLe,ANTHROPIC_CONFIG_DIR:()=>QPe,BASH_MAX_OUTPUT_LENGTH:()=>sNe,CCR_SESSION_PROFILE:()=>HLe,CLAUBBIT:()=>BLe,CLAUDECODE:()=>KLe,CLAUDE_AFK_COUNTDOWN_MS:()=>iNe,CLAUDE_AFK_TIMEOUT_MS:()=>aNe,CLAUDE_AFTER_LAST_COMPACT:()=>eIe,CLAUDE_AGENTS_SELECT:()=>tIe,CLAUDE_AGENT_SDK_CLIENT_APP:()=>nIe,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>GLe,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>WLe,CLAUDE_AGENT_SDK_VERSION:()=>rIe,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>cNe,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>oIe,CLAUDE_AUTO_BACKGROUND_TASKS:()=>VLe,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>qLe,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>sIe,CLAUDE_BG_BACKEND:()=>iIe,CLAUDE_BG_CLAIM_AUTH:()=>aIe,CLAUDE_BG_DISPATCHER_RATE_LIMIT_TIER:()=>cIe,CLAUDE_BG_DISPATCHER_SUBSCRIPTION_TYPE:()=>lIe,CLAUDE_BG_ISOLATION:()=>uIe,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>dIe,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>pIe,CLAUDE_BG_PTY_AUTH:()=>fIe,CLAUDE_BG_RENDEZVOUS_SOCK:()=>mIe,CLAUDE_BG_RV_AUTH:()=>hIe,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>gIe,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>_Ie,CLAUDE_BG_SOURCE:()=>yIe,CLAUDE_BG_STARTUP_WEDGE_MS:()=>lNe,CLAUDE_BG_TCC_DISCLAIMED:()=>SIe,CLAUDE_BRIDGE_BASE_URL:()=>bIe,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>EIe,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>xIe,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>ZLe,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>YLe,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>vIe,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>wIe,CLAUDE_BRIDGE_REATTACH_SEQ:()=>uNe,CLAUDE_BRIDGE_REATTACH_SESSION:()=>AIe,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>TIe,CLAUDE_CHROME_PERMISSION_MODE:()=>CIe,CLAUDE_CLIENT_PRESENCE_FILE:()=>kIe,CLAUDE_CODE_ACTION:()=>RIe,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>OIe,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>JLe,CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSION:()=>M0e,CLAUDE_CODE_AGENT:()=>PIe,CLAUDE_CODE_ARTIFACT:()=>IIe,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>LIe,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>NIe,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>MIe,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>DIe,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>UIe,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>FIe,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>$Ie,CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS:()=>dNe,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>zIe,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>XLe,CLAUDE_CODE_BASE_REF:()=>jIe,CLAUDE_CODE_BASE_REFS:()=>HIe,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>BIe,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>KIe,CLAUDE_CODE_BRIDGE_OWNER_ACCOUNT_UUID:()=>GIe,CLAUDE_CODE_BRIDGE_OWNER_ORG_UUID:()=>WIe,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>VIe,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>qIe,CLAUDE_CODE_BRIEF:()=>QLe,CLAUDE_CODE_BRIEF_UPLOAD:()=>e0e,CLAUDE_CODE_CCR_SURFACE:()=>O0e,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>ZIe,CLAUDE_CODE_CONTAINER_ID:()=>YIe,CLAUDE_CODE_COORDINATOR_WORKER_CHECKIN_SECONDS:()=>pNe,CLAUDE_CODE_DAEMON_COLD_START:()=>t0e,CLAUDE_CODE_DECSTBM:()=>JIe,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>XIe,CLAUDE_CODE_DIR_SYNC_DISABLE_ANCHORING:()=>QIe,CLAUDE_CODE_DIR_SYNC_ENGINE:()=>rDe,CLAUDE_CODE_DIR_SYNC_FFWD:()=>oDe,CLAUDE_CODE_DIR_SYNC_GIT:()=>nDe,CLAUDE_CODE_DIR_SYNC_STREAM:()=>sDe,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>n0e,CLAUDE_CODE_DISABLE_DIR_SYNC:()=>tDe,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>iDe,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>aDe,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>cDe,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>lDe,CLAUDE_CODE_DONT_INHERIT_ENV:()=>r0e,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>uDe,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>o0e,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>s0e,CLAUDE_CODE_ENTRYPOINT:()=>dDe,CLAUDE_CODE_ENVIRONMENT_KIND:()=>pDe,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>fDe,CLAUDE_CODE_EVAL_CONFINED:()=>A0e,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>i0e,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>fNe,CLAUDE_CODE_FORCE_BRIDGE:()=>a0e,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>c0e,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>l0e,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>u0e,CLAUDE_CODE_FORCE_TIP_ID:()=>mDe,CLAUDE_CODE_GIT_BASH_PATH:()=>hDe,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>mNe,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>hNe,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>gDe,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>$0e,CLAUDE_CODE_HOLD_UNANSWERED_PARKED_PERMISSION:()=>N0e,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>_De,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>yDe,CLAUDE_CODE_HOST_PLATFORM:()=>SDe,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>bDe,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>gNe,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>_Ne,CLAUDE_CODE_IS_COWORK:()=>d0e,CLAUDE_CODE_LEGACY_BUNDLE:()=>eDe,CLAUDE_CODE_LOOP_KEEPALIVE:()=>p0e,CLAUDE_CODE_LOOP_PERSISTENT:()=>f0e,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>EDe,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>yNe,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>SNe,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>bNe,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>xDe,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>oMe,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>Y0e,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>rMe,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>m0e,CLAUDE_CODE_MOCK_TRIAL:()=>h0e,CLAUDE_CODE_OVERRIDE_DATE:()=>vDe,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>D0e,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>F0e,CLAUDE_CODE_PERFORCE_MODE:()=>wDe,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>ENe,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>xNe,CLAUDE_CODE_PLUGIN_ATTRIBUTION:()=>ADe,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>TDe,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>vNe,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>CDe,CLAUDE_CODE_POWERUP_ONBOARDING:()=>kDe,CLAUDE_CODE_PROJECT_DIR_NAME:()=>RDe,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>wNe,CLAUDE_CODE_QUESTION_EXTENDED:()=>PDe,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>ODe,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>IDe,CLAUDE_CODE_REMOTE:()=>g0e,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>DDe,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>_0e,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>LDe,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>NDe,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>y0e,CLAUDE_CODE_REMOTE_SESSION_ID:()=>MDe,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>UDe,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>FDe,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>ANe,CLAUDE_CODE_REPL:()=>S0e,CLAUDE_CODE_REPO_CHECKOUTS:()=>$De,CLAUDE_CODE_RESTRICTED:()=>b0e,CLAUDE_CODE_RESUME_FROM_SESSION:()=>zDe,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>E0e,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>v0e,CLAUDE_CODE_RESUME_PROMPT:()=>jDe,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>x0e,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>TNe,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>CNe,CLAUDE_CODE_RESUME_TOLERATES_CONTEXT_APPENDS:()=>U0e,CLAUDE_CODE_RETIRE_UNANSWERED_PARKED_PERMISSION:()=>L0e,CLAUDE_CODE_SAFE_MODE:()=>w0e,CLAUDE_CODE_SANDBOXED:()=>T0e,CLAUDE_CODE_SCRIPT_CAPS:()=>kNe,CLAUDE_CODE_SCROLL_SPEED:()=>HDe,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>RNe,CLAUDE_CODE_SESSION_ID:()=>BDe,CLAUDE_CODE_SESSION_KIND:()=>KDe,CLAUDE_CODE_SESSION_NAME:()=>GDe,CLAUDE_CODE_SESSION_ORIGIN:()=>WDe,CLAUDE_CODE_SHELL:()=>VDe,CLAUDE_CODE_SHELL_PREFIX:()=>qDe,CLAUDE_CODE_SIMPLE:()=>C0e,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>ZDe,CLAUDE_CODE_SKILL_ATTRIBUTION:()=>YDe,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>ONe,CLAUDE_CODE_SSE_PORT:()=>PNe,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>JDe,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>INe,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>k0e,CLAUDE_CODE_SUPERVISED:()=>R0e,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>P0e,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>I0e,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>LNe,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>NNe,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>DNe,CLAUDE_CODE_SYNC_SESSION_REFS:()=>z0e,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>MNe,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>UNe,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>j0e,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>XDe,CLAUDE_CODE_TAGS:()=>QDe,CLAUDE_CODE_TASK_LIST_ID:()=>tLe,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>FNe,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>eLe,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>H0e,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>nLe,CLAUDE_CODE_TEST_FORCE_DENY:()=>B0e,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>K0e,CLAUDE_CODE_TEST_NO_PWSH:()=>G0e,CLAUDE_CODE_TMPDIR:()=>rLe,CLAUDE_CODE_TMUX_PREFIX:()=>oLe,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>W0e,CLAUDE_CODE_TMUX_SESSION:()=>sLe,CLAUDE_CODE_TMUX_TRUECOLOR:()=>V0e,CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE:()=>q0e,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>Z0e,CLAUDE_CODE_TRIGGER_ID:()=>iLe,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>J0e,CLAUDE_CODE_TUI_TRIAL:()=>X0e,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>aLe,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>cLe,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>$Ne,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>Q0e,CLAUDE_CODE_WORKER_EPOCH:()=>zNe,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>lLe,CLAUDE_CONFIG_DIR:()=>uLe,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>dLe,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>pLe,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>fLe,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>mLe,CLAUDE_ENV_FILE:()=>hLe,CLAUDE_FORCE_DISPLAY_SURVEY:()=>eNe,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>gLe,CLAUDE_INTERNAL_FC_OVERRIDES:()=>_Le,CLAUDE_JOB_DIR:()=>yLe,CLAUDE_MEMORY_STORES:()=>SLe,CLAUDE_PROJECT_UUID:()=>bLe,CLAUDE_PTY_HEARTBEAT_MS:()=>jNe,CLAUDE_PTY_HOST_EXEC:()=>ELe,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>HNe,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>xLe,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>vLe,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>wLe,CLAUDE_REPL_VARIANT:()=>ALe,CLAUDE_RUNNER_ACTIVITY_FD:()=>BNe,CLAUDE_RUNNER_FETCH_DEPTH:()=>TLe,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>CLe,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>KNe,CLAUDE_SNIP:()=>kLe,CLAUDE_SSH_LOCAL_BINARY:()=>RLe,CLAUDE_SSH_VERSION:()=>OLe,CLAUDE_STAGE_FILE_ROOT:()=>PLe,CLAUDE_TMPDIR:()=>ILe,LOCAL_BRIDGE:()=>tNe,MCP_CONNECTION_NONBLOCKING:()=>nNe,MCP_CONNECT_TIMEOUT_MS:()=>GNe,MCP_DISCOVERY_CACHE:()=>WNe,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>VNe,MCP_DISCOVERY_CACHE_STRIKES:()=>qNe,MCP_DISCOVERY_CACHE_TTL_S:()=>ZNe,MCP_OAUTH_CALLBACK_PORT:()=>YNe,MCP_OAUTH_CLIENT_METADATA_URL:()=>DLe,MCP_PROTOCOL_NEGOTIATION:()=>JNe,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>XNe,MCP_SDK_GENERATION:()=>eMe,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>QNe,MCP_TIMEOUT:()=>tMe,MCP_TOOL_TIMEOUT:()=>nMe,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>LLe,SDK_NATIVE_BIN:()=>NLe,SESSION_INGRESS_URL:()=>MLe,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>sMe,TASK_MAX_OUTPUT_LENGTH:()=>iMe,TEST_ENABLE_SESSION_PERSISTENCE:()=>rNe,ULTRAPLAN_PROMPT_FILE:()=>ULe,VCR_RECORD:()=>oNe,VITALS_EMITTER_BIN:()=>FLe,VOICE_STREAM_BASE_URL:()=>$Le});var QPe=p.str(),eIe=p.str(),tIe=p.str(),nIe=p.str(),rIe=p.str(),oIe=p.str(),sIe=p.str(),iIe=p.str(),aIe=p.str(),cIe=p.str(),lIe=p.str(),uIe=p.str(),dIe=p.str(),pIe=p.bool(),fIe=p.str(),mIe=p.str(),hIe=p.str(),gIe=p.str(),_Ie=p.str(),yIe=p.str(),SIe=p.str(),bIe=p.str(),EIe=p.str(),xIe=p.str(),vIe=p.str(),wIe=p.str(),AIe=p.str(),TIe=p.str(),CIe=p.str(),kIe=p.str(),RIe=p.str(),OIe=p.str(),PIe=p.str(),IIe=p.str(),DIe=p.str(),LIe=p.str(),NIe=p.str(),MIe=p.str(),UIe=p.str(),FIe=p.str(),$Ie=p.str(),zIe=p.str(),jIe=p.str(),HIe=p.str(),BIe=p.str(),KIe=p.enum(["1","spent"]),GIe=p.str(),WIe=p.str(),VIe=p.str(),qIe=p.str(),ZIe=p.str(),YIe=p.str(),JIe=p.str(),XIe=p.str(),QIe=p.bool(),eDe=p.bool(),tDe=p.bool(),nDe=p.bool(),rDe=p.str(),oDe=p.str(),sDe=p.str(),iDe=p.bool(),aDe=p.bool(),cDe=p.bool(),lDe=p.bool(),uDe=p.str(),dDe=p.str(),pDe=p.str(),fDe=p.str(),mDe=p.str(),hDe=p.str(),gDe=p.str(),_De=p.int({min:0}),yDe=p.int({min:0}),SDe=p.str(),bDe=p.str(),EDe=p.str(),xDe=p.str(),vDe=p.str(),wDe=p.str(),ADe=p.str(),TDe=p.str(),CDe=p.str(),kDe=p.str(),RDe=p.str(),ODe=p.str(),PDe=p.bool(),IDe=p.str(),DDe=p.str(),LDe=p.str(),NDe=p.str(),MDe=p.str(),UDe=p.str(),FDe=p.str(),$De=p.str(),zDe=p.str(),jDe=p.str(),HDe=p.str(),BDe=p.str(),KDe=p.str(),GDe=p.str(),WDe=p.enum(["claude_ai_chat"]),VDe=p.str(),qDe=p.str(),ZDe=p.str(),YDe=p.str(),JDe=p.str(),XDe=p.str(),QDe=p.str(),eLe=p.str(),tLe=p.str(),nLe=p.str(),rLe=p.str(),oLe=p.str(),sLe=p.str(),iLe=p.str(),aLe=p.str(),cLe=p.str(),lLe=p.str(),uLe=p.str(),dLe=p.str(),pLe=p.str(),fLe=p.str(),mLe=p.str(),hLe=p.str(),gLe=p.str(),_Le=p.str(),yLe=p.str(),SLe=p.str(),bLe=p.str(),ELe=p.str(),xLe=p.str(),vLe=p.str(),wLe=p.str(),ALe=p.str(),TLe=p.str(),CLe=p.str(),kLe=p.str(),RLe=p.str(),OLe=p.str(),PLe=p.str(),ILe=p.str(),DLe=p.str(),LLe=p.str(),NLe=p.str(),MLe=p.str(),ULe=p.str(),FLe=p.str(),$Le=p.str(),zLe=p.bool(),jLe=p.bool(),HLe=p.bool(),BLe=p.bool(),KLe=p.bool(),GLe=p.bool(),WLe=p.bool(),VLe=p.bool(),qLe=p.bool(),ZLe=p.bool(),YLe=p.bool(),JLe=p.bool(),XLe=p.bool(),QLe=p.bool(),e0e=p.bool(),t0e=p.bool(),n0e=p.bool(),r0e=p.bool(),o0e=p.bool(),s0e=p.bool(),i0e=p.bool(),a0e=p.bool(),c0e=p.bool(),l0e=p.bool(),u0e=p.bool(),d0e=p.bool(),p0e=p.triBool(),f0e=p.bool(),m0e=p.str(),h0e=p.bool(),g0e=p.bool(),_0e=p.bool(),y0e=p.bool(),S0e=p.triBool(),b0e=p.bool(),E0e=p.bool(),x0e=p.str(),v0e=p.str(),w0e=p.bool(),A0e=p.bool(),T0e=p.bool(),C0e=p.bool(),k0e=p.triBool(),R0e=p.bool(),O0e=p.str(),P0e=p.bool(),I0e=p.int({min:1}),D0e=p.int({min:0}),L0e=p.bool(),N0e=p.bool(),M0e=p.bool(),U0e=p.bool(),F0e=p.bool(),$0e=p.bool(),z0e=p.bool(),j0e=p.str(),H0e=p.bool(),B0e=p.rawStr(),K0e=p.str(),G0e=p.str(),W0e=p.bool(),V0e=p.rawStr(),q0e=p.str(),Z0e=p.str(),Y0e=p.str(),J0e=p.str(),X0e=p.str(),Q0e=p.bool(),eNe=p.bool(),tNe=p.bool(),nNe=p.triBool(),rNe=p.bool(),oNe=p.bool(),sNe=p.int(),iNe=p.int(),aNe=p.int(),cNe=p.int({min:1,max:2147483647,digitsOnly:!0}),lNe=p.int(),uNe=p.int(),dNe=p.int({min:1,max:86400,digitsOnly:!0}),pNe=p.int({min:1,max:86400,digitsOnly:!0}),fNe=p.int(),mNe=p.int({min:1}),hNe=p.int({min:0,max:10080,digitsOnly:!0}),gNe=p.int(),_Ne=p.int(),yNe=p.int({min:1,digitsOnly:!0}),SNe=p.int({min:1,digitsOnly:!0}),bNe=p.int({min:1,digitsOnly:!0}),ENe=p.int(),xNe=p.int(),vNe=p.int(),wNe=p.int(),ANe=p.int(),TNe=p.int(),CNe=p.int(),kNe=p.int(),RNe=p.int(),ONe=p.int(),PNe=p.int(),INe=p.int(),DNe=p.int({min:1}),LNe=p.int({min:1}),NNe=p.int({min:0}),MNe=p.int(),UNe=p.int(),FNe=p.int({min:1000,max:60000}),$Ne=p.int(),zNe=p.int(),jNe=p.int({min:1}),HNe=p.int({min:1}),BNe=p.int({min:3}),KNe=p.int({min:1}),GNe=p.int(),WNe=p.triBool(),VNe=p.int({min:1}),qNe=p.int({min:1}),ZNe=p.int({min:1}),YNe=p.int({min:1}),JNe=p.str(),XNe=p.int({min:1}),QNe=p.int({min:1}),eMe=p.str(),tMe=p.int(),nMe=p.int({min:1}),rMe=p.int(),oMe=p.int(),sMe=p.int({min:1}),iMe=p.int();var qC={};Zn(qC,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>wMe,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>TMe,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>AMe,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>uMe,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>pMe,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>dMe,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>SMe,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>EMe,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>bMe,ANTHROPIC_DEFAULT_MODEL:()=>cMe,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>fMe,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>hMe,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>mMe,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>gMe,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>yMe,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>_Me,ANTHROPIC_MODEL:()=>aMe,ANTHROPIC_SMALL_FAST_MODEL:()=>lMe,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>vMe,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>xMe,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>FMe,CLAUDE_CODE_AUTO_MODE_MODEL:()=>RMe,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>OMe,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>HMe,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>NMe,CLAUDE_CODE_DISABLE_FAST_MODE:()=>$Me,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>MMe,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>BMe,CLAUDE_CODE_EFFORT_LEVEL:()=>UMe,CLAUDE_CODE_MODEL_CATALOG:()=>KMe,CLAUDE_CODE_MODEL_CATALOG_URL:()=>GMe,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>LMe,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>zMe,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>jMe,CLAUDE_CODE_SUBAGENT_MODEL:()=>CMe,CLAUDE_CODE_SUBAGENT_MODEL_FORCE:()=>kMe,CLAUDE_CONTEXT_COLLAPSE:()=>IMe,CLAUDE_CONTEXT_COLLAPSE_MODEL:()=>PMe,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>DMe});var aMe=p.str(),cMe=p.str(),lMe=p.str(),uMe=p.str(),dMe=p.str(),pMe=p.str(),fMe=p.str(),mMe=p.str(),hMe=p.str(),gMe=p.str(),_Me=p.str(),yMe=p.str(),SMe=p.str(),bMe=p.str(),EMe=p.str(),xMe=p.str(),vMe=p.str(),wMe=p.str(),AMe=p.str(),TMe=p.str(),CMe=p.str(),kMe=p.bool(),RMe=p.str(),OMe=p.str(),PMe=p.str(),IMe=p.bool(),DMe=p.str(),LMe=p.bool(),NMe=p.bool(),MMe=p.bool(),UMe=p.str(),FMe=p.bool(),$Me=p.bool(),zMe=p.bool(),jMe=p.bool(),HMe=p.bool(),BMe=p.bool(),KMe=p.str(),GMe=p.str();var ZC={};Zn(ZC,{ALL_PROXY:()=>XMe,ANTHROPIC_BETAS:()=>sUe,ANTHROPIC_CUSTOM_HEADERS:()=>iUe,API_FORCE_IDLE_TIMEOUT:()=>bUe,API_TIMEOUT_MS:()=>SUe,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>CUe,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>lUe,CLAUDE_CODE_CERT_STORE:()=>oUe,CLAUDE_CODE_CLIENT_CERT:()=>eUe,CLAUDE_CODE_CLIENT_KEY:()=>tUe,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>nUe,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>rUe,CLAUDE_CODE_EAGER_FLUSH:()=>PUe,CLAUDE_CODE_EXTRA_BODY:()=>aUe,CLAUDE_CODE_EXTRA_METADATA:()=>cUe,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>fUe,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>IUe,CLAUDE_CODE_GZIP_CCR_REQUEST_BODIES:()=>AUe,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>wUe,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>pUe,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>dUe,CLAUDE_CODE_MAX_RETRIES:()=>uUe,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>mUe,CLAUDE_CODE_MAX_TURNS:()=>hUe,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>NUe,CLAUDE_CODE_RETRY_WATCHDOG:()=>OUe,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>LUe,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>EUe,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>xUe,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>vUe,CLAUDE_MOCK_HEADERLESS_429:()=>DUe,CLAUDE_SLOW_FIRST_BYTE_MS:()=>RUe,CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS:()=>kUe,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>TUe,HTTPS_PROXY:()=>VMe,HTTP_PROXY:()=>WMe,MAX_MCP_OUTPUT_TOKENS:()=>yUe,MAX_STRUCTURED_OUTPUT_RETRIES:()=>_Ue,MAX_THINKING_TOKENS:()=>gUe,NO_PROXY:()=>qMe,all_proxy:()=>QMe,http_proxy:()=>ZMe,https_proxy:()=>YMe,no_proxy:()=>JMe});var WMe=p.str(),VMe=p.str(),qMe=p.str(),ZMe=p.str(),YMe=p.str(),JMe=p.str(),XMe=p.str(),QMe=p.str(),eUe=p.str(),tUe=p.str(),nUe=p.str(),rUe=p.bool(),oUe=p.str(),sUe=p.str(),iUe=p.str(),aUe=p.str(),cUe=p.str(),lUe=p.str(),uUe=p.int(),dUe=p.int(),pUe=p.int(),fUe=p.int(),mUe=p.int({min:1}),hUe=p.str(),gUe=p.int(),_Ue=p.int(),yUe=p.int(),SUe=p.int(),bUe=p.int(),EUe=p.triBool(),xUe=p.bool(),vUe=p.triBool(),wUe=p.triBool(),AUe=p.triBool(),TUe=p.int({min:1}),CUe=p.int({min:1}),kUe=p.int({min:1}),RUe=p.int({min:1}),OUe=p.bool(),PUe=p.bool(),IUe=p.bool(),DUe=p.bool(),LUe=p.int(),NUe=p.int({min:0});var YC={};Zn(YC,{AGENT_PROXY_URL:()=>FFe,ANTHROPIC_AWS_BASE_URL:()=>ZUe,ANTHROPIC_AWS_WORKSPACE_ID:()=>YUe,ANTHROPIC_BASE_URL:()=>HUe,ANTHROPIC_BEDROCK_BASE_URL:()=>GUe,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>qUe,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>WUe,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>VUe,ANTHROPIC_FOUNDRY_BASE_URL:()=>oFe,ANTHROPIC_FOUNDRY_RESOURCE:()=>sFe,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>eFe,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>XUe,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>JUe,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>QUe,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>gFe,ANTHROPIC_UNIX_SOCKET:()=>_Fe,ANTHROPIC_VERTEX_BASE_URL:()=>tFe,ANTHROPIC_VERTEX_PROJECT_ID:()=>nFe,AWS_ACCESS_KEY_ID:()=>dFe,AWS_CONFIG_FILE:()=>lFe,AWS_DEFAULT_REGION:()=>aFe,AWS_ENDPOINT_URL:()=>mFe,AWS_ENDPOINT_URL_STS:()=>hFe,AWS_PROFILE:()=>cFe,AWS_REGION:()=>iFe,AWS_SECRET_ACCESS_KEY:()=>pFe,AWS_SESSION_TOKEN:()=>fFe,AWS_SHARED_CREDENTIALS_FILE:()=>uFe,CCR_AGENT_PROXY_ENABLED:()=>CFe,CCR_AGENT_PROXY_FRAME_HOSTS:()=>LFe,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>PFe,CCR_AGENT_PROXY_RECEIVE_GATE_DISABLED:()=>IFe,CCR_AGENT_PROXY_RELAY_MODE:()=>OFe,CCR_AGENT_PROXY_UPLOAD_GATE_DISABLED:()=>DFe,CCR_ENABLE_BUNDLE:()=>NFe,CCR_FORCE_BUNDLE:()=>MFe,CCR_ON_BRANCH_DEFAULT_GUARD:()=>UFe,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>RFe,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>kFe,CLAUDE_CODE_API_BASE_URL:()=>KUe,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>wFe,CLAUDE_CODE_GB_BASE_URL:()=>AFe,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>TFe,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>yFe,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>bFe,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>SFe,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>$Fe,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>$Ue,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>zUe,CLAUDE_CODE_USE_BEDROCK:()=>MUe,CLAUDE_CODE_USE_FOUNDRY:()=>FUe,CLAUDE_CODE_USE_GATEWAY:()=>EFe,CLAUDE_CODE_USE_MANTLE:()=>jUe,CLAUDE_CODE_USE_VERTEX:()=>UUe,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>xFe,CLAUDE_GATEWAY_LOG_LEVEL:()=>vFe,CLOUD_ML_REGION:()=>rFe,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>BUe});var FK=["us","eu","apac","jp","au","global"];var MUe=p.bool(),UUe=p.bool(),FUe=p.bool(),$Ue=p.bool(),zUe=p.bool(),jUe=p.bool(),HUe=p.str(),BUe=p.bool(),KUe=p.str(),GUe=p.str(),WUe=p.enum(FK),VUe=p.str(),qUe=p.str(),ZUe=p.str(),YUe=p.str(),JUe=p.str(),XUe=p.str(),QUe=p.str(),eFe=p.str(),tFe=p.str(),nFe=p.str(),rFe=p.str(),oFe=p.str(),sFe=p.str(),iFe=p.str(),aFe=p.str(),cFe=p.str(),lFe=p.str(),uFe=p.str(),dFe=p.str(),pFe=p.str(),fFe=p.str(),mFe=p.str(),hFe=p.str(),gFe=p.str(),_Fe=p.str(),yFe=p.bool(),SFe=p.bool(),bFe=p.bool(),EFe=p.bool(),xFe=p.bool(),vFe=p.str(),wFe=p.bool(),AFe=p.str(),TFe=p.int(),CFe=p.bool(),kFe=p.bool(),RFe=p.bool(),OFe=p.str(),PFe=p.str(),IFe=p.bool(),DFe=p.bool(),LFe=p.str(),NFe=p.bool(),MFe=p.bool(),UFe=p.enum(["enforce","observe","off"]),FFe=p.str(),$Fe=p.bool();var jFe={...KA,...YC,...qC,...GC,...ZC,...WC,...GA,...VC};function JC(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e)){let s=n,i;Object.defineProperty(n,r,{get:()=>{let a=process.env[r];if(a!==s)i=o.parse(a),s=a;return i},enumerable:!0,configurable:!0})}return Object.defineProperties(n,{set:{value:(r,o)=>{process.env[r]=Q$(o)}},unset:{value:(r)=>{delete process.env[r]}}}),n}var _n=JC(jFe,Hf),HFe={},xPt=JC(HFe,null),BFe={},vPt=JC(BFe,null);class zK{debugFilePath=void 0;initPromise=null;logStem=null}var GFe=new Je(()=>new zK);function jK(){return GFe.of(Tn().host)}function HK(e){if(e.initPromise)return e.initPromise;if(!_n.DEBUG_CLAUDE_AGENT_SDK)return e.debugFilePath=null,e.initPromise=Promise.resolve(),e.initPromise;let t=$K(Wt(),"debug");return e.logStem=`sdk-${KFe()}`,e.debugFilePath=$K(t,`${e.logStem}.txt`),process.stderr.write(`SDK debug logs: ${e.debugFilePath}
120
+ `),e.initPromise=Il().mkdir(t).catch(()=>{}),e.initPromise}function WFe(e){return e.logStem===null?null:{namespace:"log",sessionId:e.logStem,channel:"debug"}}function BK(){let e=jK();return HK(e),e.debugFilePath??null}function yn(e,t){let n=jK();if(n.debugFilePath===null)return;let o=`${new Date().toISOString()} ${e}
121
+ `;HK(n).then(()=>{if(t!==void 0){let s=WFe(n);if(s!==null)t.append(s,[{data:o}]).catch(()=>{});return}if(n.debugFilePath)Il().append(n.debugFilePath,o).catch(()=>{})})}function VFe(e){let t=e.trim();return t.startsWith("{")&&t.endsWith("}")}function KK(e,t){let n={...e};if(!t)return n;let r=t.enabled===!0&&t.failIfUnavailable===void 0?{...t,failIfUnavailable:!0}:t,o=n.settings;if(o&&!VFe(o))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let s={sandbox:r};if(o)try{s={...ft(o),sandbox:r}}catch{}return n.settings=me(s),n}function XC(e,t,n){let r=String(n);if(r.length>1&&r.startsWith("-"))e.push(`--${t}=${r}`);else e.push(`--${t}`,r)}var XFe=2000,QC=2048,VK="sdk-exit-after-stderr-drained",QFe=200;function ek(e){return e==="exit"?VK:e}class qK{#e=new Set;#t=!1;#n=()=>this.killAll();track(e){if(this.#e.add(e),!this.#t)this.#t=!0,process.on("exit",this.#n)}untrack(e){this.#e.delete(e)}isTracking(e){return this.#e.has(e)}get size(){return this.#e.size}killAll(){for(let e of this.#e)if(!e.killed)if(process.platform==="win32")try{e.stdin.end()}catch{}else e.kill("SIGTERM")}reset(){process.off("exit",this.#n),this.#t=!1,this.#e.clear()}}var $y=new qK,e$e=/[(),\u0000-\u001f\u007f-\u009f]/;function t$e(e){if(typeof e!=="string"||e.trim()==="")throw Error("Skill names must be non-empty strings.");if(!hg(e))throw new Ze(`Invalid skill name ${me(e)}: the name contains an unpaired surrogate, which cannot survive the UTF-8 encoding of the CLI invocation; no skill discovered from the filesystem can have such a name.`,"skill name with unpaired surrogate rejected");if(e!==e.trim())throw new Ze(`Invalid skill name ${me(e)}: leading or trailing whitespace is not allowed — the Skill tool trims the invoked name, so a padded rule can never match. Remove the padding.`,"skill name with surrounding whitespace rejected");if(e$e.test(e))throw new Ze(`Invalid skill name ${me(e)}: parentheses, commas, and control characters are not allowed in skill names. Skill names match the skill's directory name (or 'plugin:skill' for plugin-qualified skills); rename the skill if its directory name contains these characters.`,"invalid skill name rejected");if(e==="*")throw Error("Invalid skill name '*': use skills: 'all' to enable every skill.");if(e.endsWith(":*")||e.endsWith(" *"))throw new Ze(`Invalid skill name ${me(e)}: wildcard-suffix names are not allowed; list each skill by its exact name.`,"wildcard-suffix skill name rejected");if(e.startsWith("/"))throw new Ze(`Invalid skill name ${me(e)}: skill names may not start with '/'. Skills are invoked as slash commands, but the skills option takes the skill's canonical name — the directory name, or 'plugin:skill'.`,"skill name with leading slash rejected");if(e.includes("\\\\"))throw new Ze(`Invalid skill name ${me(e)}: consecutive backslashes are not allowed — the permission-rule parser collapses escaped backslashes, so the rule would name a different skill. Rename the skill.`,"skill name with consecutive backslashes rejected");if(e.endsWith("\\"))throw new Ze(`Invalid skill name ${me(e)}: names may not end with an unpaired backslash.`,"skill name with unpaired trailing backslash rejected");return e}class nk{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitEventDelivered=!1;stderrTail="";exitListeners=[];abortHandler;forwardedAbort=Td();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e;if(this.abortController=e.abortController||Td(),e.deferSpawn)this.spawnPromise=new Promise((t,n)=>{this.spawnResolve=t,this.spawnReject=n}),this.spawnPromise.catch(()=>{});else this.initialize()}spawn(){try{this.initialize()}catch(t){throw this.spawnAbort(jr(t)),t}let e=this.pendingWrites;if(this.pendingWrites=[],this.spawnResolve)this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0;for(let t of e)this.write(t);if(this.pendingEndInput)this.pendingEndInput=!1,this.processStdin?.end()}spawnAbort(e){if(this.spawnReject)this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[]}updateEnv(e){if(this.options.env)Object.assign(this.options.env,e);else this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return el()?"bun":"node"}spawnLocalProcess(e){let{command:t,args:n,cwd:r,env:o,signal:s}=e,i=qFe(t,n,{cwd:r,stdio:["pipe","pipe","pipe"],signal:s,env:o,windowsHide:!0}),a=new JFe("utf8"),c=!1,l=!1,u=!1,d,f=Oe(o.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr!==void 0;i.stderr.on("data",(_)=>{if(u)return;let y=a.write(_);if(this.stderrTail+=y,this.stderrTail.length>2*QC)this.stderrTail=dv(Rd(this.stderrTail),QC);if(f)yn(y),this.options.stderr?.(y)}),i.stderr.on("error",(_)=>{yn(`[ProcessTransport] stderr read failed: ${_.code??_.message}`)});let m=()=>{if(u)return;if(u=!0,d)clearTimeout(d);i.emit(VK,i.exitCode,i.signalCode);let _=i.stderr;if(s$e(_))_.unref();else _.destroy()};return i.stderr.once("close",()=>{if(this.stderrTail+=a.end(),c=!0,l)m()}),i.once("exit",()=>{if(l=!0,this.ready=!1,c)m();else d=setTimeout(m,QFe)}),{stdin:i.stdin,stdout:i.stdout,get killed(){return i.killed},get exitCode(){return i.exitCode},get signalCode(){return i.signalCode},kill:i.kill.bind(i),on:(_,y)=>i.on(ek(_),y),once:(_,y)=>i.once(ek(_),y),off:(_,y)=>i.off(ek(_),y)}}initialize(){try{let{additionalDirectories:e=[],agent:t,betas:n,cwd:r,executable:o=this.getDefaultExecutable(),executableArgs:s=[],extraArgs:i={},pathToClaudeCodeExecutable:a,env:c={...process.env},thinkingConfig:l,maxTurns:u,maxBudgetUsd:d,taskBudget:f,model:m,fallbackModel:h,jsonSchema:_,permissionMode:y,allowDangerouslySkipPermissions:b,permissionPromptToolName:v,permissionPrompts:S,continueConversation:x,resume:w,settingSources:D,skills:P,disallowedTools:F=[],tools:z,mcpServers:q,strictMcpConfig:ee,canUseTool:te,includePartialMessages:xe,plugins:Q,pluginsViaInitialize:ut,sandbox:De}=this.options,{allowedTools:dt=[]}=this.options;if(P!==void 0){let ie=P==="all"?["Skill"]:P.map((rt)=>`Skill(${t$e(rt)})`),_t=new Set(dt);dt=[...dt,...ie.filter((rt)=>!_t.has(rt))]}let W=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(l){switch(l.type){case"enabled":if(l.budgetTokens===void 0)W.push("--thinking","adaptive");else W.push("--max-thinking-tokens",l.budgetTokens.toString());break;case"disabled":W.push("--thinking","disabled");break;case"adaptive":W.push("--thinking","adaptive");break}if(l.type!=="disabled"&&l.display)W.push("--thinking-display",l.display)}if(this.options.effort)W.push("--effort",this.options.effort);if(u)W.push("--max-turns",u.toString());if(d!==void 0)W.push("--max-budget-usd",d.toString());if(f)W.push("--task-budget",f.total.toString());if(m)W.push("--model",m);if(t)W.push("--agent",t);if(n&&n.length>0)W.push("--betas",n.join(","));if(_)W.push("--json-schema",me(_));if(this.options.debugFile)W.push("--debug-file",this.options.debugFile);else if(this.options.debug)W.push("--debug");if(!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let ie=BK();if(ie)W.push("--debug-file",ie)}if(te){if(v)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");W.push("--permission-prompt-tool","stdio")}else if(v)W.push("--permission-prompt-tool",v);if(S)W.push("--permission-prompts",S);if(x)W.push("--continue");if(w)W.push(`--resume=${w}`);if(this.options.channels&&this.options.channels.length>0)for(let ie of this.options.channels)XC(W,"channels",ie);if(dt.length>0)W.push("--allowedTools",dt.join(","));if(F.length>0)W.push("--disallowedTools",F.join(","));if(z!==void 0)if(Array.isArray(z))if(z.length===0)W.push("--tools","");else W.push("--tools",z.join(","));else W.push("--tools","default");if(q&&Object.keys(q).length>0)W.push("--mcp-config",me({mcpServers:q}));if(D!==void 0)W.push(`--setting-sources=${D.join(",")}`);if(ee)W.push("--strict-mcp-config");if(y)W.push("--permission-mode",y);if(b)W.push("--allow-dangerously-skip-permissions");if(h){if(m&&h===m)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");W.push("--fallback-model",h)}if(this.options.includeHookEvents)W.push("--include-hook-events");if(xe)W.push("--include-partial-messages");if(this.options.sessionMirror)W.push("--session-mirror");for(let ie of e)W.push("--add-dir",ie);if(ut)W.push("--await-initialize");else if(Q&&Q.length>0)for(let ie of Q)if(ie.type==="local")W.push(ie.skipMcpDiscovery?"--plugin-dir-no-mcp":"--plugin-dir",ie.path);else throw Error(`Unsupported plugin type: ${ie.type}`);if(this.options.forkSession)W.push("--fork-session");if(this.options.resumeSessionAt)W.push(`--resume-session-at=${this.options.resumeSessionAt}`);if(this.options.resumeDropsTurn!==void 0)W.push(`--resume-drops-turn=${this.options.resumeDropsTurn}`);if(this.options.sessionId)W.push(`--session-id=${this.options.sessionId}`);if(this.options.persistSession===!1)W.push("--no-session-persistence");if(this.options.managedSettings)W.push("--managed-settings",this.options.managedSettings);let qe={...i??{}};if(this.options.settings)qe.settings=this.options.settings;let wn=KK(qe,De);for(let[ie,_t]of Object.entries(wn))if(_t===null)W.push(`--${ie}`);else XC(W,ie,_t);if(!c.CLAUDE_CODE_ENTRYPOINT)c.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete c.NODE_OPTIONS,Oe(c.DEBUG_CLAUDE_AGENT_SDK))c.DEBUG="1";else delete c.DEBUG;let xt=n$e(a),ae=xt?a:o,re=xt?[...s,...W]:[...s,a,...W],$e={command:ae,args:re,cwd:r,env:c,signal:this.forwardedAbort.signal};if(this.options.spawnClaudeCodeProcess)yn(`Spawning Claude Code (custom): ${ae} ${re.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess($e);else yn(`Spawning Claude Code: ${ae} ${re.join(" ")}`),this.process=this.spawnLocalProcess($e);if(this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,this.processStdin.on("error",(ie)=>{yn(`[ProcessTransport] stdin write failed (child likely exited): ${ie.code??ie.message}`),this.ready=!1}),$y.track(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted)this.close();let nt=this.process;nt.on("error",(ie)=>{this.ready=!1;let _t=ie,rt=_t.syscall!==void 0?_t.syscall.startsWith("spawn"):PA(ie);if(rt&&!nt.killed)$y.untrack(nt);if(this.abortController.signal.aborted)this.exitError=zy(),On(ie,{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"});else if(rt&&PA(ie)){let{message:ct,telemetryMessage:on,errorClass:is}=r$e(a,xt),pt={telemetryMessage:`${on}${tk(ie)}`,errorClass:is,code:Zp(ie)};this.exitError=On(ReferenceError(ct),pt),On(ie,pt),yn(this.exitError.message)}else{let ct={telemetryMessage:rt?`Failed to spawn Claude Code process${tk(ie)}`:`Claude Code process error${tk(ie)}`,errorClass:rt?"spawn_failed":"process_error",code:Zp(ie)};this.exitError=On(Error(`Failed to spawn Claude Code process: ${Rd(ie.message)}`),ct),On(ie,ct),yn(this.exitError.message)}}),nt.on("exit",(ie,_t)=>{if(this.exitEventDelivered=!0,this.ready=!1,this.abortController.signal.aborted)this.exitError=zy();else{let rt=this.getProcessExitError(ie,_t);if(rt)this.exitError=rt,yn(rt.message)}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,t){if(e!==0&&e!==null){let n=Number.isInteger(e)?e:void 0;return On(Error(`Claude Code process exited with code ${e}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process exited with code ${n??"unknown"}`,errorClass:"process_exited_nonzero",exitCode:n})}else if(t){let n=/^SIG[A-Z0-9]{1,8}$/.test(t)?t:"unknown";return On(Error(`Claude Code process terminated by signal ${t}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process terminated by signal ${n}`,errorClass:"process_killed_by_signal",signal:n})}return}formatStderrTail(){let e=dv(Rd(this.stderrTail),QC).trim();return e?`. stderr: ${e}`:""}write(e){if(this.abortController.signal.aborted)throw GK();if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){yn("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw On(Error(`Cannot write to process that exited with error: ${this.exitError.message}`),{telemetryMessage:`Cannot write to process that exited with error: ${L$(this.exitError)??"untagged exit error"}`,errorClass:WK(this.exitError,"errorClass"),code:Zp(this.exitError),exitCode:o$e(this.exitError),signal:WK(this.exitError,"signal")});yn(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{if(!this.processStdin.write(e))yn("[ProcessTransport] Write buffer full, data queued")}catch(t){throw this.ready=!1,Error(`Failed to write to process stdin: ${Hr(t)}`)}}[Symbol.dispose](){this.close()}close(){if(this.spawnAbort(this.abortController.signal.aborted?zy():Error("Query closed before spawn")),this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;let e=this.process?.exitCode??null,t=this.process?.signalCode??null,n=!this.exitEventDelivered&&(e!==null&&e>=0||t!==null),r;if(n){if(this.exitEventDelivered=!0,r=this.abortController.signal.aborted?zy():this.getProcessExitError(e,t),r&&!this.exitError)this.exitError=r}let o=this.exitListeners;this.exitListeners=[];for(let{callback:a,handler:c}of o)if(this.process?.off("exit",c),n)try{a(r)}catch(l){yn(`[ProcessTransport] onExit callback threw during close(): ${Hr(l)}`)}let s=()=>{if(this.abortController.signal.aborted)this.forwardedAbort.abort(this.abortController.signal.reason)},i=this.process;if(i&&!i.killed&&i.exitCode===null&&i.signalCode==null)setTimeout((a,c)=>{if(a.exitCode!==null||a.signalCode!=null){c();return}if(process.platform==="win32"){setTimeout((l,u)=>{if(l.exitCode===null)l.kill("SIGKILL");u()},5000,a,c).unref();return}a.kill("SIGTERM"),setTimeout((l)=>{if(l.exitCode===null)l.kill("SIGKILL")},5000,a).unref(),c()},XFe,i,s).unref(),i.once("exit",()=>$y.untrack(i));else if(i)$y.untrack(i),s();this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise)await this.spawnPromise,this.spawnPromise=void 0;if(!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=YFe({input:this.processStdout}),t=this.process?(()=>{let n=this.process,r=()=>e.close();return n.on("error",r),()=>n.off("error",r)})():void 0;if(this.exitError)e.close();try{for await(let n of e)if(n.trim()){let r;try{r=ft(n)}catch(o){yn(`Non-JSON stdout: ${n}`);continue}yield r}if(this.exitError)throw this.exitError;await this.waitForExit()}finally{t?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}if(this.processStdin)this.processStdin.end()}onExit(e){if(!this.process)return()=>{};let t=(n,r)=>{let o=this.getProcessExitError(n,r);e(o)};return this.process.on("exit",t),this.exitListeners.push({callback:e,handler:t}),()=>{if(this.process)this.process.off("exit",t);let n=this.exitListeners.findIndex((r)=>r.handler===t);if(n!==-1)this.exitListeners.splice(n,1)}}async waitForExit(){if(this.exitError)throw this.exitError;if(!this.process||this.process.exitCode===0||this.process.killed&&this.exitEventDelivered)return;return new Promise((e,t)=>{let n=(o,s)=>{if(this.abortController.signal.aborted){t(GK());return}let i=this.getProcessExitError(o,s);if(i)t(i);else e()};this.process.once("exit",n);let r=(o)=>{this.process.off("exit",n),t(o)};this.process.once("error",r),this.process.once("exit",()=>{this.process.off("error",r)})})}}function n$e(e){return![".js",".mjs",".tsx",".ts",".jsx"].some((n)=>e.endsWith(n))}function r$e(e,t){let n=t?"native binary":"executable",r=Rd(e);if(ZFe(e))return{message:t?`Claude Code native binary at ${r} exists but failed to launch. This usually means the binary does not match this system's libc — e.g. spawning a musl-linked binary on a glibc Linux host fails because the musl dynamic loader (/lib/ld-musl-*) is missing. Specify a matching binary with options.pathToClaudeCodeExecutable.`:`Claude Code executable at ${r} exists but failed to launch.`,telemetryMessage:`Claude Code ${n} exists at the configured path but failed to launch`,errorClass:"executable_launch_failed"};return{message:t?`Claude Code native binary not found at ${r}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${r}. Is options.pathToClaudeCodeExecutable set?`,telemetryMessage:`Claude Code ${n} not found at the configured path`,errorClass:"executable_not_found"}}function tk(e){let t=Zp(e);return t===void 0?"":` (${t})`}function zy(){return On(new yr("Claude Code process aborted by user"),{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"})}function GK(){return On(new yr("Operation aborted"),{telemetryMessage:"Operation aborted",errorClass:"aborted"})}function WK(e,t){let n=Object.hasOwn(e,t)?Reflect.get(e,t):void 0;return typeof n==="string"?n:void 0}function o$e(e){let t=Object.hasOwn(e,"exitCode")?Reflect.get(e,"exitCode"):void 0;return typeof t==="number"?t:void 0}function s$e(e){return typeof Reflect.get(e,"unref")==="function"}import{existsSync as i$e}from"fs";var gu="@anthropic-ai/claude-agent-sdk";function a$e(){if(process.platform!=="linux")return!1;let e=typeof process.report?.getReport==="function"?process.report.getReport():null;return e!=null&&e.header?.glibcVersionRuntime===void 0}function ZK(e,t={}){let n=t.platform??process.platform,r=t.arch??process.arch,o=t.exists??i$e,s=t.preferMusl??a$e(),i="claude",a=n==="win32"?".exe":"",l=(n==="android"?[`${gu}-linux-${r}-android`]:n==="linux"?s?[`${gu}-linux-${r}-musl`,`${gu}-linux-${r}`]:[`${gu}-linux-${r}`,`${gu}-linux-${r}-musl`]:[`${gu}-${n}-${r}`]).map((u)=>`${u}/claude${a}`);for(let u of l)try{let d=e(u);if(o(d))return d}catch{}return null}var c$e=["signed_out","identity_changed","transient","refresh_failed"];function YK(e){return c$e.some((t)=>t===e)}class Kf{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((e,t)=>{this.readResolve=e,this.readReject=t})}enqueue(e){if(this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let t=this.readReject;this.readResolve=void 0,this.readReject=void 0,t(e)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}var l$e=1000;function u$e(){return{eventQueue:[],sink:null,droppedEventCount:0}}function d$e(e,t){if(e.eventQueue.length>=l$e)e.eventQueue.shift(),e.droppedEventCount++;e.eventQueue.push(t)}class JK{state=u$e()}var p$e=new Je(()=>new JK);function f$e(){return Xs(p$e)}function Ti(e,t){let n=f$e().state;if(n.sink===null){d$e(n,{eventName:e,metadata:t,async:!1});return}n.sink.logEvent(e,t)}function rk(e,t){Ti("tengu_feature_ok",{feature_name:fi(e),...t})}function ok(e,t,n){Ti("tengu_feature_bad",{...n,feature_name:fi(e),error_code:t})}function XK(e,t,n){Ti("tengu_feature_sad",{...n,feature_name:fi(e),error_code:t})}async function $n(e,t,n){try{let r=await t();return rk(e),r}catch(r){throw ok(e,n?.(r)??"error"),r}}function Ge(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function QK(e){return"method"in e&&"id"in e&&e.id!==null}var hIt=Object.freeze({}),gIt=Object.freeze({name:"claude-code",title:"Claude Code",description:"Anthropic's agentic coding tool",websiteUrl:"https://claude.com/claude-code"}),_It=Symbol("swallow");class sk{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function Gf(e){return typeof e==="number"&&Number.isInteger(e)&&e>0?e:void 0}var Wf=Symbol("suppressControlResponse");class jy{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;onUserDialog;pendingControlResponses=new Map;unmatchedControlResponses=new Map;static UNMATCHED_CONTROL_RESPONSES_MAX=1024;cleanupPerformed=!1;sdkMessages;inputStream=new Kf;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;initHooksPayload;sdkMcpServers=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;latestCommands;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,t){let n={type:"system",subtype:"mirror_error",error:t,key:e,uuid:_d(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){if(this.cleanupPerformed)e();else this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpServers.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.onUserDialog!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0||this.workSecretAnswerer!==void 0}remoteControlCallGeneration=0;workSecretAnswerer;constructor(e,t,n,r,o,s=new Map,i,a,c,l,u,d){this.transport=e;this.isSingleUserTurn=t;this.canUseTool=n;this.hooks=r;this.abortController=o;this.jsonSchema=i;this.initConfig=a;this.onElicitation=c;this.getOAuthToken=l;this.getHostAuthToken=u;this.onUserDialog=d;for(let[f,m]of s)this.connectSdkMcpServer(f,m);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){if(this.cleanupPromise)return this.cleanupPromise;return this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise}async performCleanup(e){for(let t of this.cleanupCallbacks)try{t()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let t=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(t);this.pendingControlResponses.clear(),this.unmatchedControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(t);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let{transport:n}of this.sdkMcpServers.values())n.close().catch(()=>{});if(this.sdkMcpServers.clear(),e)this.inputStream.error(e);else this.inputStream.done()}catch(t){}if(this.transport.waitForExit){let t=new AbortController;try{await Promise.race([this.transport.waitForExit(),Dr(2000,t.signal)])}catch{}finally{t.abort()}}}next(...[e]){return this.sdkMessages.next(...[e])}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let t=this.pendingControlResponses.get(e.response.request_id);if(t)t.handler(e.response);else{if(this.unmatchedControlResponses.size>=jy.UNMATCHED_CONTROL_RESPONSES_MAX){let n=this.unmatchedControlResponses.keys().next().value;if(n!==void 0)this.unmatchedControlResponses.delete(n)}this.unmatchedControlResponses.set(e.response.request_id,e.response)}continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else if(e.type==="keep_alive")continue;else if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}if(e.type==="system"&&e.subtype==="commands_changed"&&Array.isArray(e.commands))this.latestCommands=e.commands;if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}if(e.type==="active_goal"){this.inputStream.enqueue(e);continue}if(e.type==="autocompact_state"){this.inputStream.enqueue(e);continue}if(e.type==="result"){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();let t=e.is_error?e.subtype==="success"?e.result:e.errors.map((n)=>n.trim()).filter(Boolean).join("; "):void 0;if(this.lastErrorResultText=t||void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)ce("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(e.type==="system"&&e.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(e)}if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(e instanceof yr)&&e?.name!=="SSEHttpError"){let t=On(Error(`Claude Code returned an error result: ${this.lastErrorResultText}`),{telemetryMessage:"Claude Code returned an error result",errorClass:"error_result"});ce(`[Query.readMessages] Replacing exit error with result text. Original: ${Hr(e)}`),this.inputStream.error(t),this.cleanup(t);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){if(this.cancelControllers.has(e.request_id)){ce(`[Query.handleControlRequest] Duplicate delivery of in-flight request ${e.request_id} (${e.request.subtype}) — skipping`);return}let t=new AbortController;this.cancelControllers.set(e.request_id,t);try{let n=await this.processControlRequest(e,t.signal);if(this.cleanupPerformed)return;if(n===Wf)return;let r={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(me(r)+`
122
+ `))}catch(n){if(this.cleanupPerformed)return;let r={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:Hr(n)}};try{await Promise.resolve(this.transport.write(me(r)+`
123
+ `))}catch(o){ce(`[Query.handleControlRequest] Error-response write failed: ${Hr(o)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let t=this.cancelControllers.get(e.request_id);if(t)t.abort(),this.cancelControllers.delete(e.request_id)}async processControlRequest(e,t){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");let n=await this.canUseTool(e.request.tool_name,e.request.input,{signal:t,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id,requestId:e.request_id,...e.request.matched_ask_rule&&{matchedAskRule:{source:e.request.matched_ask_rule.source,toolName:e.request.matched_ask_rule.tool_name,...e.request.matched_ask_rule.rule_content!==void 0&&{ruleContent:e.request.matched_ask_rule.rule_content}}}});if(n===null)return Wf;return{...n,toolUseID:e.request.tool_use_id}}else if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,t);else if(e.request.subtype==="mcp_message"){let n=e.request,r=this.sdkMcpServers.get(n.server_name)?.transport;if(!r)throw Error(`SDK MCP server not found: ${n.server_name}`);if(QK(n.message))return{mcp_response:await this.handleMcpControlRequest(n.server_name,n,r)};else{if(r.onmessage)r.onmessage(n.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(e.request.subtype==="elicitation"){let n=e.request;if(this.onElicitation){let r=await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:t,requestId:e.request_id});if(r===null)return Wf;return r}return{action:"decline"}}else if(e.request.subtype==="request_user_dialog"){if(this.onUserDialog){let n=await this.onUserDialog({dialogKind:e.request.dialog_kind,payload:e.request.payload,toolUseID:e.request.tool_use_id},{signal:t,requestId:e.request_id});if(n===null)return Wf;return n}return ce(`[Query] No onUserDialog handler for request_user_dialog (kind=${e.request.dialog_kind}) — staying silent so a capable client (or the worker's park deadline) settles it`),Ti("tengu_request_user_dialog_response_ignored",{shape:fi("auto_cancel")}),Wf}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");let n,r=await this.getOAuthToken({signal:t,onDecline:(o)=>{if(YK(o))n=o}})??null;return r===null&&n!==void 0?{accessToken:r,reason:n}:{accessToken:r}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");let n=await this.getHostAuthToken({signal:t})??null;return typeof n==="string"||n===null?{authToken:n}:n}else if(e.request.subtype==="remote_control_work_secret"){let n=this.workSecretAnswerer;if(!n)throw Error("refreshWorkSecret callback is not provided.");if(!eG(n.sessionId,e.request.session_id))throw Error("remote_control_work_secret names a session this host did not attach.");return{work_secret:await n.refresh(n.sessionId,{signal:t})||null}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){if(this.hooks&&!this.initHooksPayload){this.initHooksPayload={};for(let[i,a]of Object.entries(this.hooks))if(a.length>0)this.initHooksPayload[i]=a.map((c)=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}})}let e=this.sdkMcpServers.size>0?Array.from(this.sdkMcpServers.keys()):void 0,t=Array.from(this.sdkMcpServers).flatMap(([i,{timeout:a}])=>a!==void 0?[[i,{timeout:a}]]:[]),n=t.length>0?Object.fromEntries(t):void 0,r={subtype:"initialize",hooks:this.initHooksPayload,sdkMcpServers:e,sdkMcpServerConfigs:n,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt==="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,systemPromptSnapshot:this.initConfig?.systemPromptSnapshot,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText,supportedDialogKinds:this.initConfig?.supportedDialogKinds,perTaskStopAffordance:this.initConfig?.perTaskStopAffordance,workspaceTrust:this.initConfig?.workspaceTrust,plugins:this.initConfig?.plugins},s=(await this.request(r)).response;if(this.initConfig?.plugins!==void 0&&this.initConfig.plugins.length>0&&s.plugins_applied!==!0)ce(`[Query.initialize] Claude Code reported plugins_applied=${String(s.plugins_applied)} for ${this.initConfig.plugins.length} plugins sent with pluginDelivery 'initialize'; the process is running with the plugins it was launched with.`,{level:"warn"});return s}async interrupt(e){return $n("sdk_interrupt",async()=>{let t=await this.request({subtype:"interrupt",...e?.cancelQueued===!0&&{cancel_queued:!0}}),n=t.response?.still_queued;if(!Array.isArray(n))return;let r=t.response?.cancelled;return{still_queued:n.filter((o)=>typeof o==="string"),...Array.isArray(r)&&{cancelled:r.filter((o)=>typeof o==="string")}}})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setMcpPermissionModeOverride(e,t){return(await this.request({subtype:"set_mcp_permission_mode_override",serverName:e,mode:t})).response??{}}awaitControlResponse(e){return this.transport.expectControlResponse?.(e),new Promise((t,n)=>{let r=(s)=>{if(s.subtype==="success"){let{pending_permission_requests:i,pending_user_dialog_requests:a,...c}=s;t(c)}else n(new Ze(s.error,"awaitControlResponse: CLI error verdict"));if(s.pending_permission_requests||s.pending_user_dialog_requests)ce("[Query] Ignoring prompt-redelivery fields on awaitControlResponse response")};if(this.cleanupPerformed){n(Error("Query closed before response received"));return}let o=this.unmatchedControlResponses.get(e);if(o){this.unmatchedControlResponses.delete(e),r(o);return}this.pendingControlResponses.set(e,{handler:(s)=>{this.pendingControlResponses.delete(e),r(s)},reject:n})})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e,t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e,thinking_display:t})}async applyFlagSettings(e){return $n("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async updateSettings(e,t){return $n("sdk_update_settings",async()=>{await this.request({subtype:"update_settings",source:e,settings:t})})}async rewindFiles(e,t){return $n("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:t?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,t){await this.request({subtype:"seed_read_state",path:e,mtime:t})}async setCwd(e,t){return $n("sdk_set_cwd",async()=>(await this.request({subtype:"set_cwd",path:e,...t?.trustAccepted!==void 0&&{trust_accepted:t.trustAccepted},...t?.trustedDirectory!==void 0&&{trusted_directory:t.trustedDirectory}})).response)}async enableRemoteControl(e,t,n){let r=++this.remoteControlCallGeneration,o=this.workSecretAnswerer,s=n?.reattachSessionId||(n?.workSecret===void 0?void 0:m$e(n.workSecret)),i=e&&n?.workSecret!==void 0&&n.refreshWorkSecret&&s!==void 0?{sessionId:s,refresh:n.refreshWorkSecret}:void 0;this.workSecretAnswerer=i;let a;try{a=(await this.request({subtype:"remote_control",enabled:e,...t!==void 0&&{name:t},reattach_session_id:n?.reattachSessionId,keep_session_on_exit:n?.keepSessionOnExit,work_secret:n?.workSecret})).response}catch(c){if(r===this.remoteControlCallGeneration)this.workSecretAnswerer=void 0;throw c}if(e&&r===this.remoteControlCallGeneration){let c=a.bridge_session_id,l=[i,o];this.workSecretAnswerer=typeof c==="string"?l.find((u)=>u!==void 0&&eG(u.sessionId,c)):void 0}return a}async submitFeedback(e,t){return(await this.request({subtype:"submit_feedback",description:e,surface:t?.surface,draft_id:t?.draft_id,type:t?.type,title:t?.title,area:t?.area,attach_transcript:t?.attach_transcript})).response}async generateSessionTitle(e,t){return $n("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:t?.persist})).response.title)}async askSideQuestion(e,t){return $n("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e,...t?.history?.length&&{history:[...t.history]}},t)).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1,...r.refusal_fallback&&{refusalFallback:{originalModel:r.refusal_fallback.original_model,fallbackModel:r.refusal_fallback.fallback_model,content:r.refusal_fallback.content}}}},()=>t?.signal?.aborted?"cancelled":"error")}async launchUltrareview(e,t){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:t?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let t of e)if(t.request.subtype==="can_use_tool")this.handleControlRequest(t).catch(()=>{})}processPendingUserDialogRequests(e){for(let t of e)if(t.request.subtype==="request_user_dialog")this.handleControlRequest(t).catch(()=>{})}request(e,t){let n=Math.random().toString(36).substring(2,15);this.transport.expectControlResponse?.(n);let r={request_id:n,type:"control_request",request:e},o=e.subtype==="initialize";return new Promise((s,i)=>{let a=t?.signal,c,l=(d)=>{c?.(),s(d)},u=(d)=>{c?.(),i(d)};if(a){let d=()=>{this.pendingControlResponses.delete(n),u(jr(a.reason??"Control request aborted"));try{Promise.resolve(this.transport.write(me({type:"control_cancel_request",request_id:n})+`
124
+ `)).catch(()=>{})}catch{}};if(a.aborted){d();return}a.addEventListener("abort",d,{once:!0}),c=()=>{a.removeEventListener("abort",d)}}this.pendingControlResponses.set(n,{handler:(d)=>{if(this.pendingControlResponses.delete(n),d.subtype==="success")l(d);else u(On(Error(d.error),{telemetryMessage:`Claude Code control request failed (${e.subtype})`,errorClass:"control_request_failed"}));if(!o&&(d.pending_permission_requests||d.pending_user_dialog_requests))ce(`[Query] Ignoring prompt-redelivery fields on non-initialize response (subtype=${e.subtype})`);else{if(d.pending_permission_requests)this.processPendingPermissionRequests(d.pending_permission_requests);if(d.pending_user_dialog_requests)this.processPendingUserDialogRequests(d.pending_user_dialog_requests)}},reject:u}),Promise.resolve(this.transport.write(me(r)+`
125
+ `)).catch((d)=>{this.pendingControlResponses.delete(n),u(d)})})}initializationResult(){return this.initialization}reinitialize(){return $n("sdk_reinitialize",()=>this.initialize())}async supportedCommands(){let{commands:e}=await this.initialization;return this.latestCommands??e}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,t){return $n("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:t})})}async enableChannel(e){return $n("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,t){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:t})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,t){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:t})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,t){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:t})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(e){return(await this.request({subtype:"get_context_usage",...e})).response}async usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(e){return(await this.request({subtype:"get_usage",...e?.skipBehaviors&&{skip_behaviors:!0}})).response}async readFile(e,t){try{return(await this.request({subtype:"read_file",path:e,max_bytes:t?.maxBytes,encoding:t?.encoding})).response}catch{return null}}async reloadPlugins(){return $n("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async reloadSkills(){return $n("sdk_reload_skills",async()=>(await this.request({subtype:"reload_skills"})).response)}async reloadOutputStyles(){return $n("sdk_reload_output_styles",async()=>(await this.request({subtype:"reload_output_styles"})).response)}async setMcpServers(e){return $n("sdk_mcp_set_servers",async()=>{let t={},n={};for(let[a,c]of Object.entries(e))if(c.type==="sdk"&&"instance"in c)t[a]=c;else n[a]=c;let r=new Set(this.sdkMcpServers.keys()),o=new Set(Object.keys(t));for(let a of r)if(!o.has(a))await this.disconnectSdkMcpServer(a);for(let[a,c]of Object.entries(t)){let l=this.sdkMcpServers.get(a);if(!l)this.connectSdkMcpServer(a,c);else if(Gf(c.timeout)!==l.timeout)ce(`[Query.setMcpServers] MCP server '${a}' is already registered; its timeout change is ignored until the server is removed and re-added`)}let s={};for(let a of Object.keys(t)){let c=this.sdkMcpServers.get(a)?.timeout;s[a]={type:"sdk",name:a,...c!==void 0&&{timeout:c}}}return(await this.request({subtype:"mcp_set_servers",servers:{...n,...s}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){ce("[Query.streamInput] Starting to process input stream");try{let t=0;for await(let n of e){if(t++,ce(`[Query.streamInput] Processing message ${t}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(me(n)+`
126
+ `))}if(ce(`[Query.streamInput] Finished processing ${t} messages from input stream`),t>0&&this.hasBidirectionalNeeds())ce("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();ce("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(t){if(!(t instanceof yr))throw t}}waitForFirstResult(){if(this.firstResultReceived)return ce("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((e)=>{let t=this.abortController?.signal;if(this.cleanupPerformed||t?.aborted){e();return}let n=()=>e();t?.addEventListener("abort",n,{once:!0}),this.addCleanupCallback(()=>{t?.removeEventListener("abort",n),e()}),this.firstResultReceivedResolve=()=>{t?.removeEventListener("abort",n),e()}})}handleHookCallbacks(e,t,n,r){let o=this.hookCallbacks.get(e);if(!o)throw Error(`No hook callback found for ID: ${e}`);return o(t,n,{signal:r})}connectSdkMcpServer(e,t){let n=new sk((r)=>this.sendMcpServerMessageToCli(e,r));this.sdkMcpServers.set(e,{transport:n,timeout:Gf(t.timeout)}),t.instance.connect(n).catch((r)=>{if(this.sdkMcpServers.get(e)?.transport===n)this.sdkMcpServers.delete(e);ce(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${r}`,{level:"error"})})}async disconnectSdkMcpServer(e){let t=this.sdkMcpServers.get(e);if(t){if(await t.transport.close(),this.sdkMcpServers.get(e)===t)this.sdkMcpServers.delete(e)}}sendMcpServerMessageToCli(e,t){if("id"in t&&t.id!==null&&t.id!==void 0){let r=`${e}:${t.id}`,o=this.pendingMcpResponses.get(r);if(o){o.resolve(t),this.pendingMcpResponses.delete(r);return}}let n={type:"control_request",request_id:_d(),request:{subtype:"mcp_message",server_name:e,message:t}};Promise.resolve(this.transport.write(me(n)+`
127
+ `)).catch((r)=>{ce(`[Query.sendMcpServerMessageToCli] Transport write failed: ${r}`,{level:"error"})})}handleMcpControlRequest(e,t,n){let r="id"in t.message?t.message.id:null,o=`${e}:${r}`;return new Promise((s,i)=>{let a=()=>{this.pendingMcpResponses.delete(o)},c=(u)=>{a(),s(u)},l=(u)=>{a(),i(u)};if(this.pendingMcpResponses.set(o,{resolve:c,reject:l}),n.onmessage)n.onmessage(t.message);else{a(),i(Error("No message handler registered"));return}})}}function eG(e,t){if(e===t)return!0;let n=e.slice(e.lastIndexOf("_")+1),r=t.slice(t.lastIndexOf("_")+1);return n.length>=4&&n===r}function m$e(e){try{let t=ft(Buffer.from(e,"base64url").toString("utf8"));if(typeof t!=="object"||t===null||!("session_ingress_token"in t)||typeof t.session_ingress_token!=="string")return;let n=t.session_ingress_token,o=(n.startsWith("sk-ant-si-")?n.slice(10):n).split(".");if(o.length!==3||!o[1])return;let s=ft(Buffer.from(o[1],"base64url").toString("utf8"));return typeof s==="object"&&s!==null&&"session_id"in s&&typeof s.session_id==="string"&&s.session_id?s.session_id:void 0}catch{return}}var Hy=500,_u=1048576;var h$e=[200,800];class ik{send;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;constructor(e,t){this.send=e;let{sendTimeoutMs:n=60000,onError:r,maxPendingEntries:o=Hy,maxPendingBytes:s=_u,backoffMs:i=h$e}=t??{};this.sendTimeoutMs=n,this.onError=r,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=i}enqueue(e,t){let n=me(t).length;if(this.pending.push({filePath:e,entries:t,bytes:n}),this.pendingEntries+=t.length,this.pendingBytes+=n,this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)this.flushPromise=this.drain(),this.flushPromise.catch(()=>{})}async flush(){let e=this.drain();if(this.flushPromise=e,await e,this.flushPromise===e)this.flushPromise=null}async drain(){let e=this.flushPromise,t=this.pending.splice(0);if(this.pendingEntries=0,this.pendingBytes=0,e)await e;if(t.length===0)return;await this.doFlush(t)}async doFlush(e){let t=new Map;for(let n of e){let r=t.get(n.filePath);if(r)r.push(...n.entries);else t.set(n.filePath,n.entries.slice())}for(let[n,r]of t)await this.sendWithRetry(n,r)}async sendWithRetry(e,t){let n=this.backoffMs.length+1,r=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${e}`,o,s=1;for(;s<=n;s++)try{await Lr(this.send(e,t),this.sendTimeoutMs,r),o=void 0;break}catch(i){if(o=jr(i),o.message===r)break;let a=this.backoffMs[s-1];if(a===void 0)break;await Dr(a)}if(o){ce(`[TranscriptMirrorBatcher] flush failed for ${e} after ${s} attempt(s): ${o}`,{level:"error"});try{this.onError?.(e,o)}catch(i){ce(`[TranscriptMirrorBatcher] onError callback threw: ${i}`,{level:"error"})}}}}var VE=qn(YV(),1);var JV="\\p{Default_Ignorable_Code_Point}\\u2800",xu=`\\p{Cc}\\p{Cf}\\p{Cs}\\p{Co}\\p{Cn}\\u2028\\u2029${JV}`,lLt=new RegExp(`[${xu}]+`,"gu"),eR="\\u200D\\uFE0E\\uFE0F",uLt=new RegExp(`(?:(?![${eR}])[${xu}])+`,"gu"),dLt=new RegExp(`(?:(?![${eR}\\n])[${xu}])+`,"gu"),pLt=new RegExp(`(?<!\\S)[${eR}]+`,"gu");var fLt=new RegExp(`[\\p{Cf}\\p{Co}\\p{Cn}\\u2028\\u2029\\u007F-\\u009F${JV}]`,"gu");function Ije(e){let t=e.replace(/[\p{Cf}\p{Co}\p{Cn}]/gu,"");return t=t.replace(/[\u200B-\u200F]/g,"").replace(/[\u202A-\u202E]/g,"").replace(/[\u2066-\u2069]/g,"").replace(/[\uFEFF]/g,"").replace(/[\uE000-\uF8FF]/g,""),t}function Dje(e){let t=gg(e);for(let n=0;n<10;n++){let r=Ije(t);if(r===t)return t;t=r}return t}function Lje(e){let t=e,n="",r=0,o=10;while(t!==n&&r<o)n=t,t=t.normalize("NFKC"),t=Dje(t),r++;if(r>=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${e.slice(0,100)}`);return t}function Wa(e){if(typeof e==="string")return Lje(e);if(Array.isArray(e))return e.map(Wa);if(e!==null&&typeof e==="object"){let t={};for(let[n,r]of Object.entries(e))t[Wa(n)]=Wa(r);return t}return e}function Yy(e){return e.replace(/[\p{Cc}\p{Cf}\u2028\u2029]+/gu," ")}function vu(e){return e.startsWith("\uFEFF")?e.slice(1):e}import{readFile as SHe}from"fs/promises";import{once as nq}from"events";import{constants as Qf,createWriteStream as qje}from"fs";import{lstat as Zje,open as dq,lstat as DLt,readdir as em,realpath as pq,rename as LLt,stat as Yje}from"fs/promises";import{basename as Jje,dirname as Xje,isAbsolute as MLt,join as So}from"path";var XV=1e4;async function yo(e,t,n){let r=Math.max(1,Math.floor(n?.maxPages??1e4)),o;for(let s=0;s<r;s++){if(n?.budget!==void 0){if(n.budget.pagesLeft<1)return{status:"capped"};n.budget.pagesLeft--}let i=await e(o);if(!i.ok)return{status:"error",error:i.error};if(await t(i.value.items),n?.until?.())return{status:"done"};if(o=i.value.cursor,!o)return{status:"done"}}return{status:"capped"}}import{execFile as Gje}from"child_process";import{promisify as Wje}from"util";import{execFileSync as Nje}from"child_process";import{lstatSync as Mje}from"fs";import{join as Uje}from"path";function Fje(){return process.platform==="win32"}class eq{resolved=new Map;lookup(e){return this.resolved.get(e)}remember(e,t){this.resolved.set(e,t)}forget(e){this.resolved.delete(e)}}var $je=new Je(()=>new eq),zje=5000;function QV(e){try{return Mje(e,{throwIfNoEntry:!1})===void 0}catch{return!1}}var jje=new Set([".com",".exe",".bat",".cmd"]);function Hje(e){let t=e.toLowerCase().replace(/.*[\\/]/,"").replace(/[. ]+$/,""),n=t.lastIndexOf(".");return n>0&&jje.has(t.slice(n))}function Bje(e,t=!1){let n=$je.of(Tn().host),r=n.lookup(e);if(r!==void 0)if(r!==null){if(!QV(r))return r;n.forget(e)}else{if(!t)return r;n.forget(e)}let o=_n.SYSTEMROOT||"C:\\Windows",s=Uje(o,"System32","where.exe");try{let a=Nje(s,[e],{stdio:"pipe",encoding:"utf8",timeout:zje,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),c=process.cwd(),l=!1;for(let u of a){if(QV(u))continue;if(dg(u,c)){l=!0;continue}if(!Hje(u))continue;return n.remember(e,u),u}if(a.length>0&&!l)n.remember(e,null);return null}catch(i){if(Kje(i))n.remember(e,null);return null}}function Kje(e){if(e===null||typeof e!=="object")return!1;let t="status"in e?e.status:void 0,n="signal"in e?e.signal:void 0,r="code"in e?e.code:void 0;return t===1&&!n&&!r}function tq(e,t=!1){if(!Fje())return e;if(e.includes("/")||e.includes("\\"))return e;return Bje(e,t)}var Vje=Wje(Gje);async function ks(e){let t=tq("git");if(t===null)return[];try{let{stdout:n}=await Vje(t,["-c","core.hooksPath=/dev/null","-c","core.fsmonitor=","worktree","list","--porcelain"],{cwd:e,timeout:5000,windowsHide:!0});if(!n)return[];return n.split(`
128
+ `).filter((r)=>r.startsWith("worktree ")).map((r)=>ot(r.slice(9)))}catch{return[]}}var zn=65536,Qje=new Set(["sdk-cli","sdk-ts","sdk-py"]);function fq(e,t){let n=wu(e,"entrypoint")??dn(t,"entrypoint");if(n&&Qje.has(n))return!0;let r=e.split(`
129
+ `).find((s)=>s.includes('"parentUuid":'))??e,o=wu(r,"sessionKind");return o==="daemon"||o==="daemon-worker"}var e1e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xe(e){if(typeof e!=="string")return null;return e1e.test(e)?e:null}function mq(e){if(!e.includes("\\"))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function wu(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let r of n){let o=e.indexOf(r);if(o<0)continue;let s=o+r.length,i=s;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==='"')return mq(e.slice(s,i));i++}}return}function dn(e,t){let n=[`"${t}":"`,`"${t}": "`],r,o=-1;for(let s of n){let i=0;while(!0){let a=e.indexOf(s,i);if(a<0)break;let c=a+s.length,l=c;while(l<e.length){if(e[l]==="\\"){l+=2;continue}if(e[l]==='"'){if(a>o)r=mq(e.slice(c,l)),o=a;break}l++}i=l+1}}return r}function eS(e,t,n){return t1e(e,n,t)}function t1e(e,t,n){let r=n===void 0?void 0:`"type":"${n}"`,o=`"${t}":`,s=e.length;while(s>0){let i=e.lastIndexOf(`
130
+ `,s-1),a=e.slice(i+1,s);if(s=i,a.includes(o)&&(r===void 0||a.includes(r)))try{let c=JSON.parse(a);if(typeof c==="object"&&c!==null&&(n===void 0||c.type===n)){let l=c[t];if(typeof l==="string")return l}}catch{}if(i<0)break}return}function tR(e,t){let n=`"${t}":`,r=0;while(r<e.length){let o=e.indexOf(`
131
+ `,r),s=o<0?e.slice(r):e.slice(r,o);if(r=o<0?e.length:o+1,s.includes(n))try{let i=JSON.parse(s);if(typeof i==="object"&&i!==null){let a=i[t];if(typeof a==="string")return a}}catch{}}return}function tS(e,t){return e?.realWorkspacePath===void 0?void 0:{hoverRestOn:t,realPath:e.realWorkspacePath}}async function nm(e,t,n){return n1e(e,t,"w",n)}async function n1e(e,t,n,r){if(r!==void 0&&r.hoverRestOn&&(n==="w"||t.length>0))return r1e(r.source,t,n);let o=qje(e,{mode:384,flags:n});try{for(let s of t)if(!o.write(JSON.stringify(s)+`
132
+ `))await nq(o,"drain");o.end(),await nq(o,"finish")}catch(s){throw o.destroy(),s}}async function r1e(e,t,n){let{backend:r,key:o}=e,s=t.map((a)=>({data:JSON.stringify(a)+`
133
+ `}));if(n==="w"){let a=await r.replaceRecords(o,s,{publishDiscipline:"inPlace",mode:384});if(!a.ok)throw Error("transcript stream replace failed",{cause:a.error});return}let i=await r.append(o,s);if(!i.ok)throw Error("transcript stream append failed",{cause:i.error})}function nS(e){let t=0,n={commandFallback:""};while(t<e.length){let r=e.indexOf(`
134
+ `,t),o=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!o.includes('"type":"user"')&&!o.includes('"type": "user"'))continue;if(o.includes('"tool_result"'))continue;if(o.includes('"isMeta":true')||o.includes('"isMeta": true'))continue;if(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true'))continue;try{let s=JSON.parse(o),i=na(s,n);if(i!==void 0)return i}catch{continue}}return n.commandFallback}function hq(e){let t={commandFallback:""};for(let n of e){if(typeof n!=="object"||n===null)continue;let r=na(n,t);if(r!==void 0)return r}return t.commandFallback}var rq=process.platform==="win32"?Qf.O_RDONLY:Qf.O_RDONLY|Qf.O_NOFOLLOW|Qf.O_NONBLOCK;async function o1e(e){let{backend:t,key:n}=e;try{let r=await t.read([{key:n,offset:0,length:zn},{key:n,tail:zn}]);if(!r.ok)return null;let[o,s]=r.value.items;if(!o.found||o.value.length===0)return null;let i=oq(o.value),a=s.found&&s.value.length>0?oq(s.value):i;return{head:i,tail:a,mtimeMs:o.mtimeMs,totalBytes:o.totalBytes}}catch{return null}}function oq(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}var KLt=Buffer.from('"type":"user"'),GLt=Buffer.from('"type":"assistant"');function rS(e,t){if(e.kind!=="scope"||e.scope.namespace!=="transcript"||e.scope.projectKey===void 0||e.scope.sessionId!==void 0||!t(e.scope.projectKey))return;return e.scope.projectKey}function gq(e){return{skipScopeStats:!0,skipKeyStats:!0,...e!==void 0&&{cursor:e}}}function s1e(e){let t=new Map,n=new Proxy(e.backend,{get(r,o,s){let i=Reflect.get(r,o,s);if(o!=="listEntries")return typeof i==="function"?i.bind(r):i;return(c,l)=>{if(!(c.namespace==="transcript"&&!("projectKey"in c)&&Object.keys(l??{}).every((m)=>m==="cursor"||m==="skipScopeStats"||m==="skipKeyStats")))return r.listEntries(c,l);let d=[l?.cursor??"",l?.skipScopeStats,l?.skipKeyStats].map(String).join("\x00"),f=t.get(d);if(f===void 0){f=r.listEntries(c,l),t.set(d,f);let m=()=>{t.delete(d)};f.then((h)=>{if(!h.ok)m()},m)}return f}}});return{...e,backend:n}}async function qa(e,t){if(t!==void 0&&t.hoverRestOn)return _q(t.source);try{if(rq===Qf.O_RDONLY){if(!(await Zje(e)).isFile())return null}let n=await dq(e,rq);try{let r=await n.stat();if(!r.isFile())return null;let o=Buffer.allocUnsafe(zn),s=await n.read(o,0,zn,0);if(s.bytesRead===0)return null;let i=o.toString("utf8",0,s.bytesRead),a=Math.max(0,r.size-zn),c=i;if(a>0){let l=await n.read(o,0,zn,a);c=o.toString("utf8",0,l.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:i,tail:c}}finally{await n.close()}}catch{return null}}async function _q(e){let t=await o1e(e);if(t===null)return null;return{mtime:Math.trunc(t.mtimeMs),size:t.totalBytes,head:t.head,tail:t.tail}}var Rs=200;function i1e(e){return Math.abs(dT(e)).toString(36)}function Au(e){return e.replace(/[^a-zA-Z0-9]/g,"-")}function rm(e){let t=Au(e);if(t.length<=Rs)return t;return`${t.slice(0,Rs)}-${i1e(e)}`}function Jy(e,t){let n=e.replaceAll("\\","/");return t?n.toLowerCase():n}function sq(e,t,n){let r=ot(e),o=ot(t),s=(i)=>n?i.toLowerCase():i;if(s(Au(r))!==s(Au(o)))return!1;return Jy(r,n)!==Jy(o,n)}async function yq(e,t,n,r,o){if(!sq(e,t,n))return!1;if(Ad(e)||Ad(t))return!1;if(await r(e)||await r(t))return!1;let s;try{if(o!==void 0&&o.hoverRestOn){let a=await o.realPath(e);if(!a.ok||!a.value.found)return!1;s=ot(a.value.path)}else s=ot(await pq(e))}catch{return!1}let i=await Ps(t,o);return sq(s,i,n)}function Sq(e,t,n){if(t===void 0)return!1;let r=Jy(ot(e),n);return t.some((o)=>{let s=Jy(ot(o),n);return r===s||r.startsWith(s.endsWith("/")?s:s+"/")})}function nR(){return process.platform==="win32"||process.platform==="darwin"}function kt(){return So(Wt(),"projects")}function Os(e){return eU()??rm(e)}function rR(e){let t=rm(e);return t===Os(e)?void 0:t}function Tu(e){return So(kt(),Os(e))}function Za(e,t){let n=Jje(e);return Xje(e)===kt()&&t(n)?n:void 0}async function Ps(e,t){try{if(t!==void 0&&t.hoverRestOn){let n=await t.realPath(e);return ot(n.ok&&n.value.found?n.value.path:e)}return ot(await pq(e))}catch{return ot(e)}}async function Cu(e,t,n,r){let o=r!==void 0&&r.hoverRestOn?r.source:void 0,s=o===void 0?void 0:Za(e,o.isKeySegment);if(o!==void 0&&s!==void 0){let c=await a1e(s,t,n,o);if(c!==void 0)return c}let i=Au(t),a;try{a=await em(e,{withFileTypes:!0})}catch{return!1}for(let c of a){if(!c.isFile()||!c.name.endsWith(".jsonl"))continue;let l=await qa(So(e,c.name));if(l===null)continue;if(bq(l,i,n))return!0}return!1}function bq(e,t,n){let r=eS(e.tail,"relocated","relocatedCwd")??tR(e.head,"cwd");if(r===void 0)return!1;let o=Au(ot(r));return n?o.toLowerCase()===t.toLowerCase():o===t}async function a1e(e,t,n,r){let{backend:o,transcriptKey:s,isKeySegment:i}=r,a=Au(t),c=!1,l=new Set;try{let u=await yo((d)=>o.listEntries({namespace:"transcript",projectKey:e},gq(d)),async(d)=>{for(let f of d){if(f.kind!=="key"||f.key.namespace!=="transcript"||f.key.projectKey!==e||f.key.agentId!==void 0||!i(f.key.sessionId)||l.has(f.key.sessionId))continue;let m=f.key.sessionId,h=await _q({backend:o,key:s(e,m)});if(h===null)continue;if(l.add(m),bq(h,a,n)){c=!0;return}}},{until:()=>c});if(c)return!0;if(u.status!=="done")return}catch{return}return!1}async function ir(e,t){if(t!==void 0&&t.hoverRestOn)return c1e(e,t);let n=Tu(e),r=[];try{await em(n),r.push(n)}catch{}let o=rR(e);if(o!==void 0){let d=So(kt(),o);try{await em(d),r.push(d)}catch{}return r}let s=rm(e);if(s.length<=Rs)return r;let i=kt(),a=process.platform==="win32",c=(d)=>a?d.toLowerCase():d,l=c(s.slice(0,Rs)+"-"),u=c(n);try{for(let d of await em(i,{withFileTypes:!0})){if(!d.isDirectory()||!c(d.name).startsWith(l))continue;let f=So(i,d.name);if(c(f)!==u&&await Cu(f,e,a))r.push(f)}}catch{}return r}async function c1e(e,t){let n=await ku(t.source);if(n===null){let r=rR(e);return[Tu(e),...r!==void 0?[So(kt(),r)]:[]]}return oR(e,n,process.platform==="win32",t)}async function ku(e){let{backend:t,isKeySegment:n}=e,r=[],o=new Set,s=0;try{if((await yo((a)=>t.listEntries({namespace:"transcript"},gq(a)),(a)=>{for(let c of a){let l=rS(c,n);if(l!==void 0&&!o.has(l))o.add(l),r.push(l)}s++})).status==="error")return s===0?null:r}catch{return s===0?null:r}return r}async function oR(e,t,n,r){let o=Os(e),s=Tu(e),i=rR(e),a=i===void 0&&o.length>Rs?o.slice(0,Rs)+"-":void 0,c=kt(),l=(b)=>n?b.toLowerCase():b,u=a!==void 0?l(a):void 0,d=l(o),f=!1,m,h=[],_=new Set;for(let b of t)if(b===o)f=!0;else if(i!==void 0){if(m===void 0&&l(b)===l(i))m=So(c,b)}else if(u!==void 0&&l(b).startsWith(u)&&l(b)!==d&&!_.has(l(b)))_.add(l(b)),h.push(b);let y=[];for(let b of h){let v=So(c,b);if(await Cu(v,e,n,r))y.push(v)}return[...f?[s]:[],...m!==void 0?[m]:[],...y]}async function l1e(e,t){let n=[];for(let r of await ks(e)){if(r===e)continue;let o=await ir(r,t);if(t!==void 0&&t.hoverRestOn){let s=Tu(r);if(!o.includes(s))o.push(s)}for(let s of o)n.push({worktreePath:r,projectDir:s})}return n}async function Ci(e,t,n,r){let o=`${e}.jsonl`,s=r&&n!==void 0&&n.isKeySegment(e)?s1e(n):void 0,i=s===void 0?void 0:{source:s,hoverRestOn:r};async function a(u,d){let f=So(u,o);if(s){let m=Za(u,s.isKeySegment);if(m!==void 0){try{let h=await s.backend.stat(s.transcriptKey(m,e));if(h.ok){let _=h.value.storedBytes??h.value.size;if(_>0)return{filePath:f,projectPath:d,fileSize:_}}}catch{}return}}try{let m=await Yje(f);if(m.size>0)return{filePath:f,projectPath:d,fileSize:m.size}}catch{}return}if(t){let u=await Ps(t,tS(n,r));for(let d of await ir(u,i)){let f=await a(d,u);if(f)return f}for(let{worktreePath:d,projectDir:f}of await l1e(u,i)){let m=await a(f,d);if(m)return m}return}let c=kt();if(s){let u=new Map;try{if((await yo((m)=>s.backend.listEntries({namespace:"transcript"},m!==void 0?{cursor:m}:void 0),(m)=>{for(let h of m){let _=rS(h,s.isKeySegment);if(_===void 0)continue;let y=h.kind==="scope"&&h.mtimeMs!==void 0?h.mtimeMs:Number.NEGATIVE_INFINITY,b=u.get(_);if(b===void 0)u.set(_,{projectKey:_,mtimeMs:y});else if(y>b.mtimeMs)b.mtimeMs=y}})).status==="error")return}catch{return}let d=[...u.values()];d.sort((f,m)=>f.mtimeMs!==m.mtimeMs?m.mtimeMs-f.mtimeMs:f.projectKey<m.projectKey?-1:f.projectKey>m.projectKey?1:0);for(let{projectKey:f}of d){let m=await a(So(c,f),void 0);if(m)return m}return}let l;try{l=await em(c)}catch{return}for(let u of l){let d=await a(So(c,u),void 0);if(d)return d}return}var Eq=1048576,xq=5242880,u1e=Buffer.from('"compact_boundary"');function vq(e){try{let t=JSON.parse(e);if(t.type!=="system"||t.subtype!=="compact_boundary")return null;return{hasPreservedSegment:Boolean(t.compactMetadata?.preservedSegment||t.compactMetadata?.preservedMessages)}}catch{return null}}function Va(e,t,n,r){let o=r-n;if(o<=0)return;if(e.len+o>e.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+o),e.cap));e.buf.copy(s,0,0,e.len),e.buf=s}t.copy(e.buf,e.len,n,r),e.len+=o}function Xy(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}var Qy=Buffer.from('{"type":"attribution-snapshot"'),d1e=Buffer.from('{"type":"system"'),tm=10,p1e=Buffer.from([tm]),f1e=256;function iq(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,o=t.indexOf(tm);if(o===-1||o>=n)return 0;let s=o+1;if(Xy(r,Qy,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=s,e.lastSnapSrc=null;else if(e.carryLen<Qy.length)return 0;else{if(Xy(r,d1e,0,e.carryLen)){let i=vq(r.toString("utf-8",0,e.carryLen)+t.toString("utf-8",0,o));if(i?.hasPreservedSegment)e.hasPreservedSegment=!0;else if(i)e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null}Va(e.out,r,0,e.carryLen),Va(e.out,t,0,s)}return e.bufFileOff+=e.carryLen+s,e.carryLen=0,s}function aq(e,t,n){let r=t.indexOf(n),o=0,s=0,i=-1,a=-1,c=t.indexOf(tm);while(c!==-1){let l=c+1;if(r!==-1&&r<s)r=t.indexOf(n,s);if(Xy(t,Qy,s,l))Va(e.out,t,o,s),i=s,a=l,o=l;else if(r>=s&&r<Math.min(s+f1e,l)){let u=vq(t.toString("utf-8",s,c));if(u?.hasPreservedSegment)e.hasPreservedSegment=!0;else if(u)e.out.len=0,e.boundaryStartOffset=e.bufFileOff+s,e.hasPreservedSegment=!1,e.lastSnapSrc=null,i=-1,e.straddleSnapCarryLen=0,o=s;r=t.indexOf(n,r+n.length)}s=l,c=t.indexOf(tm,s)}return Va(e.out,t,o,s),{lastSnapStart:i,lastSnapEnd:a,trailStart:s}}function cq(e,t,n,r,o){if(r!==-1){if(e.lastSnapLen=o-r,e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen);t.copy(e.lastSnapBuf,0,r,o),e.lastSnapSrc=e.lastSnapBuf}else if(e.straddleSnapCarryLen>0){if(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen);e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf}}function lq(e,t,n){if(e.carryLen=t.length-n,e.carryLen>0){if(e.carryBuf===void 0||e.carryLen>e.carryBuf.length)e.carryBuf=Buffer.allocUnsafe(e.carryLen);t.copy(e.carryBuf,0,n,t.length)}}function uq(e){if(e.carryLen>0){let t=e.carryBuf;if(Xy(t,Qy,0,e.carryLen))e.lastSnapSrc=t,e.lastSnapLen=e.carryLen;else Va(e.out,t,0,e.carryLen)}if(e.lastSnapSrc){if(e.out.len>0&&e.out.buf[e.out.len-1]!==tm)Va(e.out,p1e,0,1);Va(e.out,e.lastSnapSrc,0,e.lastSnapLen)}}async function m1e(e,t,n,r){let o=0,s;while(o<n){let i=await e.readRecords(t,{order:"forward",maxBytes:Eq,...s!==void 0&&{fromSeq:s}});if(!i.ok)throw Error("transcript record page failed during load",{cause:i.error});let a=[],c=0;for(let u of i.value.items){if(o+c+u.data.byteLength>n)break;a.push(u.data),c+=u.data.byteLength}if(c>0)r(Buffer.concat(a,c)),o+=c;let l=i.value.nextSeq;if(l===void 0||a.length<i.value.items.length)return;if(s!==void 0&&l<=s)throw Error("transcript record cursor did not advance during load");s=l}}async function wq(e,t,n){let r=u1e,o=Eq,s={out:{buf:Buffer.allocUnsafe(Math.min(t,8388608)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0};if(n!==void 0&&n.hoverRestOn){let{backend:c,key:l}=n.source,u=0,d=(f)=>{let m=f.length;u+=m;let h=iq(s,f,m),_;if(s.carryLen>0){let b=s.carryLen+(m-h);_=Buffer.allocUnsafe(b),s.carryBuf.copy(_,0,0,s.carryLen),f.copy(_,s.carryLen,h,m)}else _=f.subarray(h,m);let y=aq(s,_,r);cq(s,_,f,y.lastSnapStart,y.lastSnapEnd),lq(s,_,y.trailStart),s.bufFileOff+=y.trailStart};while(u<t){let f=await c.read([{key:l,offset:u,length:Math.min(o,t-u)}]);if(!f.ok){if(u===0&&iz(f.error)){await m1e(c,l,t,d);break}throw Error("transcript ranged read failed",{cause:f.error})}let[m]=f.value.items;if(!m.found)throw Error("transcript stream absent during load");if(m.value.length===0)break;d(Buffer.from(m.value.buffer,m.value.byteOffset,m.value.length))}return uq(s),{boundaryStartOffset:s.boundaryStartOffset,postBoundaryBuf:s.out.buf.subarray(0,s.out.len),hasPreservedSegment:s.hasPreservedSegment}}let i=Buffer.allocUnsafe(o),a=await dq(e,"r");try{let c=0;while(c<t){let{bytesRead:l}=await a.read(i,0,Math.min(o,t-c),c);if(l===0)break;c+=l;let u=iq(s,i,l),d;if(s.carryLen>0){let m=s.carryLen+(l-u);d=Buffer.allocUnsafe(m),s.carryBuf.copy(d,0,0,s.carryLen),i.copy(d,s.carryLen,u,l)}else d=i.subarray(u,l);let f=aq(s,d,r);cq(s,d,i,f.lastSnapStart,f.lastSnapEnd),lq(s,d,f.trailStart),s.bufFileOff+=f.trailStart}uq(s)}finally{await a.close()}return{boundaryStartOffset:s.boundaryStartOffset,postBoundaryBuf:s.out.buf.subarray(0,s.out.len),hasPreservedSegment:s.hasPreservedSegment}}var Aq=/^[0-9a-f]{16}(?:[0-9a-f]{48})?@v\d+$/;function Tq(e,t,n){return{type:"history-suppression",sessionId:e,cause:t,...n&&{vetoedAgainstAccountUuid:n},ts:new Date().toISOString()}}import{basename as e4,dirname as t4,isAbsolute as H0t,join as yHe,relative as B0t,sep as K0t}from"path";var h1e=String.fromCharCode(0),g1e=/^\.[0-9a-f]{16}\.aside$/;function _1e(e){if(e.charCodeAt(0)!==46)return!1;return Is(e).some((t)=>g1e.test(t))}function Cq(e){return typeof e==="string"&&/^[. ]+$/.test(e)}function pn(e){return!(typeof e!=="string"||e.length===0||Cq(e)||e.includes("/")||e.includes("\\")||e.includes(h1e)||_1e(e))}function ar(e){return e.length>0&&e.every(pn)}function om(e){return Is(e).some((t)=>t.endsWith(".jsonl"))}function Is(e){let t=oS.get(e);if(t!==void 0)return t;let n=Object.freeze(y1e(e));if(oS.size>=S1e)oS.clear();return oS.set(e,n),n}function y1e(e){let t=e.toLowerCase(),n=t.indexOf(":");return n===-1?[sR(t)]:[sR(t),sR(t.slice(0,n))]}var oS=new Map,S1e=32768;function sR(e){let t=e.length;while(t>0){let n=e.charCodeAt(t-1);if(n!==46&&n!==32)break;t-=1}return t===e.length?e:e.slice(0,t)}function sS(e,t,n){return n===void 0?e:{...e,[t]:n}}function b1e(e,t,n,r){let s=sS({namespace:"transcript",projectKey:e,sessionId:t},"agentId",n);return sS(s,"agentRelPath",r)}function E1e(e,t,n){let o=sS({namespace:"log",sessionId:e,channel:t},"agentId",n?.agentId);return sS(o,"runId",n?.runId)}var tn={transcript:b1e,journal:(e,t,n)=>({namespace:"transcript",projectKey:e,sessionId:t,agentRelPath:n,journal:!0}),sessionJournal:(e,t,n)=>({namespace:"transcript",projectKey:e,sessionId:t,sessionJournal:n}),history:()=>({namespace:"history"}),log:E1e,globalConfig:()=>({namespace:"globalConfig"}),globalConfigCopy:(e,t)=>({namespace:"globalConfig",kind:e,stamp:t}),userSettings:()=>({namespace:"settings",layer:"user"}),projectSettings:(e)=>({namespace:"settings",layer:"project",projectKey:e}),localSettings:(e)=>({namespace:"settings",layer:"local",consentRootKey:e}),task:(e,t)=>({namespace:"task",listId:e,taskId:t}),taskListMeta:(e)=>({namespace:"task",listId:e,meta:!0}),taskListHighWaterMark:(e)=>({namespace:"task",listId:e,highWaterMark:!0}),memory:(e,t)=>({namespace:"memory",projectKey:e,relPath:t}),pluginRegistry:(e)=>({namespace:"pluginRegistry",file:e}),marketplaceCache:(e,t)=>({namespace:"marketplaceCache",marketplace:e,form:t}),marketplaceTree:(e,t)=>({namespace:"marketplaceCache",marketplace:e,relPath:t}),pluginCache:(e,t,n,r)=>({namespace:"pluginCache",marketplace:e,plugin:t,version:n,relPath:r}),cache:(e,t)=>({namespace:"cache",store:e,id:t}),paste:(e)=>({namespace:"paste",id:e}),state:(e)=>({namespace:"state",id:e}),pluginAssetCache:(e)=>({namespace:"pluginAssetCache",digest:e}),plan:(e)=>({namespace:"plan",name:e}),daemon:(e)=>({namespace:"daemon",relPath:e}),feedbackDraft:(e)=>({namespace:"feedbackDraft",draftId:e}),agentMemory:(e,t)=>({namespace:"agentMemory",layer:"user",agentType:e,relPath:t}),identity:()=>({namespace:"identity"}),team:(e)=>({namespace:"team",team:e}),sidecar:(e,t,n)=>({namespace:"sidecar",projectKey:e,sessionId:t,relPath:n}),mailbox:(e,t)=>({namespace:"mailbox",team:e,teammate:t}),scratch:(e,t)=>({namespace:"scratch",sessionId:e,relPath:t}),userConfigDir:(e,t)=>({namespace:"userConfigDir",dir:e,relPath:t}),fileHistory:(e,t)=>({namespace:"fileHistory",sessionId:e,backupFileName:t}),job:(e,t)=>({namespace:"job",jobId:e,relPath:t}),jobTimeline:(e)=>({namespace:"jobTimeline",jobId:e}),recording:(e,t,n)=>({namespace:"recording",projectKey:e,sessionId:t,stamp:n}),sessionLog:(e,t,n)=>({namespace:"sessionLog",projectKey:e,year:t.year,month:t.month,day:t.day,logName:n}),jobPins:()=>({namespace:"jobsRoot",file:"pins"}),jobDraft:(e)=>({namespace:"jobsRoot",draftKey:e}),session:(e)=>({namespace:"session",file:e}),bridgePointer:(e)=>({namespace:"bridgePointer",projectKey:e}),sessionAliases:(e)=>({namespace:"sessionAliases",projectKey:e}),dirSyncRecord:(e,t)=>({namespace:"dirSyncRecord",projectKey:e,sessionId:t})};import{createHash as x1e}from"crypto";function sm(e){return x1e("sha256").update(e).digest("hex")}class kq{available=void 0;probing=void 0;procUnreadableLogged=!1}var x0t=new Je(()=>new kq);function T1e(e){return Y(e,"expected a segment that is not empty or made only of dots and spaces, with no path separator, NUL or set-aside shape")}function Ds(e){if(typeof e!=="object"||e===null)return Y("key","expected a key object");let t=M1e(e);if(t!==void 0)return t;let n=dHe(e);if(n===void 0)return Y("key",`${e.namespace} is not a storage namespace`);return Oq("key",n)}function Oq(e,t){for(let[n,r,o]of t){let s=`${e}.${n}`;if(r===void 0){if(o!=="optional")return Y(s,"required")}else if(C1e(n)){if(!(e==="scope"&&n==="agentRelPath"&&Array.isArray(r)&&r.length===0)&&(!Array.isArray(r)||!ar(r)))return Y(s,"expected a non-empty array of segments, none empty or made only of dots and spaces, with no path separator, NUL or set-aside shape")}else if(typeof r!=="string"||!pn(r))return T1e(s)}return}function C1e(e){return e==="relPath"||e==="agentRelPath"}var Pq=["commands","agents","output-styles","skills","workflows","routines","themes","rules","session-env","uploads","mcp-skill-archives","usage-data","mcp-discovery-cache"];var Iq=new Set(Pq),Dq=`must be one of the userConfigDir directory names (${Pq.join(", ")})`,Lq=["installed","marketplaces","flagged","catalog","inUseSweep"];var k1e=new Set(Lq),R1e=`must be one of the pluginRegistry files (${Lq.join(", ")})`,Nq=["manifest","catalog"];var O1e=new Set(Nq),P1e=`must be one of the marketplaceCache forms (${Nq.join(", ")})`;var Mq=["world"];var I1e=new Set(Mq),D1e=`must be one of the session journal names (${Mq.join(", ")})`;function L1e(e){return I1e.has(e)}function N1e(e){return typeof e==="string"&&/^[0-9a-f]{64}$/.test(e)}function M1e(e){if(e.namespace==="transcript")return $1e(e);if(e.namespace==="pluginAssetCache"&&!N1e(e.digest))return Y("key.digest","must be a SHA-256 digest: 64 lowercase hexadecimal characters");if(e.namespace==="globalConfig"&&"kind"in e){if(!zq(e.kind))return Y("key.kind",$q);if(typeof e.stamp!=="string")return Y("key.stamp","a recovery copy key carries its stamp")}if(e.namespace==="task")return nHe(e);if(e.namespace==="sidecar"){let t=aS("key.sessionId",e.sessionId);if(t!==void 0)return t;if(cS(e.relPath))return Y("key.relPath",im);return Kq(e.relPath)?Y("key.relPath",Hq):void 0}if(e.namespace==="recording")return aS("key.sessionId",e.sessionId)??(Bq(e.stamp)?void 0:Y("key.stamp",H1e));if(e.namespace==="jobsRoot")return rHe(e);if(e.namespace==="userConfigDir"&&!Iq.has(e.dir))return Y("key.dir",Dq);if(e.namespace==="fileHistory")return U1e(e);if(e.namespace==="settings"&&!eHe(e.layer))return Y("key.layer","must be user, project or local");if(e.namespace==="log")return tHe(e);if(e.namespace==="job"&&Jq(e.relPath))return Y("key.relPath",Yq);if(e.namespace==="sessionLog")return Xq("key",e)??(cHe(e.logName)?void 0:Y("key.logName","must be the session-log stem <sessionId8>[-<title-slug>]: up to eight word characters, then lower-case a-z / 0-9 runs joined by single hyphens; not a bare device name"));if(e.namespace==="pluginRegistry"&&!k1e.has(e.file))return Y("key.file",R1e);if(e.namespace==="marketplaceCache"){if(!("relPath"in e))return O1e.has(e.form)?void 0:Y("key.form",P1e);return e.form===void 0?void 0:Y("key.form","a tree file key carries relPath, not form")}if(e.namespace!=="agentMemory")return;if(!Uq(e.layer))return Y("key.layer","must be user, project or local");if(e.layer==="user"&&"projectKey"in e)return Y("key.projectKey","the user layer is not keyed by project");if(e.layer!=="user"&&typeof e.projectKey!=="string")return Y("key.projectKey","required for the project and local layers");return typeof e.agentType==="string"?void 0:Y("key.agentType","an agent memory key names its agent")}function U1e(e){return typeof e.backupFileName!=="string"||!Aq.test(e.backupFileName)?Y("key.backupFileName","must be a backup file name the engine has ever written (hex hash @v version)"):void 0}function Uq(e){return e==="user"||e==="project"||e==="local"}var Fq=["backup","corrupted"];var F1e=new Set(Fq),$q=`must be one of the global-config copy kinds (${Fq.join(", ")})`;function zq(e){return F1e.has(e)}function $1e(e){let t=aS("key.sessionId",e.sessionId);if(t!==void 0)return t;if(cS(e.agentRelPath))return Y("key.agentRelPath",im);if("sessionJournal"in e){if(typeof e.sessionJournal!=="string"||!L1e(e.sessionJournal))return Y("key.sessionJournal",D1e);return e.agentId===void 0&&e.agentRelPath===void 0&&!("journal"in e)?void 0:Y("key.sessionJournal","a session journal key names the session's own journal: no agentId, agentRelPath or run journal")}if("journal"in e){if(e.journal!==!0)return Y("key.journal","must be true");if(!Array.isArray(e.agentRelPath))return Y("key.agentRelPath","a run journal key carries its run directory");return e.agentId===void 0?void 0:Y("key.agentId","a transcript key names an agent transcript or the run journal, never both")}return e.agentRelPath!==void 0&&e.agentId===void 0?Y("key.agentRelPath","requires agentId or journal"):void 0}var z1e="cloud-snapshots";var jq=new Set(["memory","tiny_memory","bagel",z1e,"bridge-pointer.json",".session-aliases"]),j1e=/^[0-9]{1,16}$/,H1e="must be the recording stamp: 1 to 16 decimal digits (epoch milliseconds)",iS=".cast",Hq=`<stamp>${iS} inside a session's folder is that session's terminal recording stream: address it as keys.recording(projectKey, sessionId, stamp)`;function Bq(e){return typeof e==="string"&&j1e.test(e)}function Kq(e){return Array.isArray(e)&&typeof e[0]==="string"&&Is(e[0]).some((t)=>B1e(t)!==void 0)}function B1e(e){if(!e.endsWith(iS))return;let t=e.slice(0,-iS.length);return Bq(t)?t:void 0}var Gq=[".ccr-tip.json",".precompact.json",iS],K1e=`must not end with ${Gq.join(", ")}: those name a session's project-level sibling files`;function G1e(e){return Is(e).some((t)=>Gq.some((n)=>t.endsWith(n)))}var Wq=".dir-sync.json",W1e=`must not end with ${Wq}: that names a cloud session's directory-sync record at the project level`;function V1e(e){return Is(e).some((t)=>t.endsWith(Wq))}var q1e=`${[...jq].join(", ")} are reserved: they name project-level entries, not sessions`;function Z1e(e){return Is(e).some((t)=>jq.has(t))}function aS(e,t){if(typeof t!=="string")return;if(Z1e(t))return Y(e,q1e);if(G1e(t))return Y(e,K1e);if(V1e(t))return Y(e,W1e);return om(t)?Y(e,im):void 0}var Y1e=".meta.json",J1e=".meta is reserved for the list metadata key, under every spelling that opens its file";function X1e(e){return Q1e(`${e}.json`)}function Q1e(e){return Is(e).includes(Y1e)}var im="names a .jsonl stream, which only a transcript key addresses";function cS(e){return Array.isArray(e)&&e.some((t)=>typeof t==="string"&&om(t))}function eHe(e){return e==="user"||e==="project"||e==="local"}var Vq="must be debug, telemetry or apiDump";function qq(e){return e==="debug"||e==="telemetry"||e==="apiDump"}function tHe(e){if(!qq(e.channel))return Y("key.channel",Vq);if(e.channel!=="apiDump")return;for(let t of["agentId","runId"])if(t in e&&e[t]!==void 0)return Y(`key.${t}`,"an apiDump key names its dump by one id — the agent's for a subagent's requests, else the session's (today's dump-prompts/<id>.jsonl); agentId and runId nest nothing on this channel");return}function nHe(e){if("taskId"in e&&(("meta"in e)||("highWaterMark"in e)))return Y("key.taskId","a task key names an item, the list metadata or the list high-water mark, never more than one");if("meta"in e&&"highWaterMark"in e)return Y("key.highWaterMark","a task key names an item, the list metadata or the list high-water mark, never more than one");if("meta"in e&&e.meta!==!0)return Y("key.meta","must be true");if("highWaterMark"in e&&e.highWaterMark!==!0)return Y("key.highWaterMark","must be true");if(typeof e.listId!=="string")return Y("key.listId","a task key carries its listId");if("meta"in e||"highWaterMark"in e)return;if(typeof e.taskId!=="string")return Y("key.taskId","a task item key carries its taskId");if(X1e(e.taskId))return Y("key.taskId",J1e);return}function rHe(e){if("file"in e&&"draftKey"in e)return Y("key.draftKey","a jobs-root key names the pins file or one draft, never both");if("file"in e)return e.file==="pins"?void 0:Y("key.file","must be pins");if(typeof e.draftKey!=="string")return Y("key.draftKey","a jobs-root draft key carries its draftKey");return uHe.test(e.draftKey)?void 0:Y("key.draftKey","must be 8 lowercase hex characters")}var Zq="timeline.jsonl",Yq=`${Zq} is the job's timeline stream: address it as keys.jobTimeline(jobId)`;function Jq(e){return Array.isArray(e)&&typeof e[0]==="string"&&Is(e[0]).includes(Zq)}var oHe=/^\d{4}$/,Rq=/^\d{2}$/,sHe=/^[A-Za-z0-9_-]{1,8}(?:-[a-z0-9]+)*$/,iHe=128,aHe=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i;function cHe(e){return typeof e==="string"&&e.length<=iHe&&sHe.test(e)&&!aHe.test(e)}function Xq(e,t){if(t.year!==void 0&&!iR(oHe,t.year))return Y(`${e}.year`,"must be four digits (YYYY)");if(t.month!==void 0&&!iR(Rq,t.month))return Y(`${e}.month`,"must be two digits (MM)");if(t.day!==void 0&&!iR(Rq,t.day))return Y(`${e}.day`,"must be two digits (DD)");return}function iR(e,t){return typeof t==="string"&&e.test(t)}function lHe(e){if(e.year!==void 0&&e.projectKey===void 0)return Y("scope.projectKey","required when year is given");if(e.month!==void 0&&e.year===void 0)return Y("scope.year","required when month is given");if(e.day!==void 0&&e.month===void 0)return Y("scope.month","required when day is given");return Xq("scope",e)}var uHe=/^[0-9a-f]{8}$/;function dHe(e){switch(e.namespace){case"transcript":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["agentId",e.agentId,"optional"],["agentRelPath",e.agentRelPath,"optional"]];case"history":case"identity":return[];case"globalConfig":return"kind"in e?[["stamp",e.stamp]]:[];case"settings":return e.layer==="user"?[]:e.layer==="project"?[["projectKey",e.projectKey]]:[["consentRootKey",e.consentRootKey]];case"task":return"taskId"in e?[["listId",e.listId],["taskId",e.taskId]]:[["listId",e.listId]];case"memory":return[["projectKey",e.projectKey],["relPath",e.relPath]];case"pluginRegistry":return[];case"marketplaceCache":return"relPath"in e?[["marketplace",e.marketplace],["relPath",e.relPath]]:[["marketplace",e.marketplace]];case"pluginCache":return[["marketplace",e.marketplace],["plugin",e.plugin],["version",e.version],["relPath",e.relPath]];case"cache":return[["store",e.store],["id",e.id]];case"paste":return[["id",e.id]];case"pluginAssetCache":return[["digest",e.digest]];case"state":return[["id",e.id]];case"plan":return[["name",e.name]];case"feedbackDraft":return[["draftId",e.draftId]];case"agentMemory":return[...e.layer==="user"?[]:[["projectKey",e.projectKey]],["agentType",e.agentType],["relPath",e.relPath]];case"team":return[["team",e.team]];case"sidecar":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["relPath",e.relPath]];case"scratch":return[["sessionId",e.sessionId],["relPath",e.relPath]];case"userConfigDir":return[["relPath",e.relPath]];case"fileHistory":return[["sessionId",e.sessionId],["backupFileName",e.backupFileName]];case"job":return[["jobId",e.jobId],["relPath",e.relPath]];case"daemon":return[["relPath",e.relPath]];case"jobsRoot":return"file"in e?[]:[["draftKey",e.draftKey]];case"session":return[["file",e.file]];case"bridgePointer":case"sessionAliases":return[["projectKey",e.projectKey]];case"dirSyncRecord":return[["projectKey",e.projectKey],["sessionId",e.sessionId]];case"mailbox":return[["team",e.team],["teammate",e.teammate]];case"log":return[["sessionId",e.sessionId],["agentId",e.agentId,"optional"],["runId",e.runId,"optional"]];case"jobTimeline":return[["jobId",e.jobId]];case"recording":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["stamp",e.stamp]];case"sessionLog":return[["projectKey",e.projectKey],["year",e.year],["month",e.month],["day",e.day],["logName",e.logName]]}return}function aR(e){if(typeof e!=="object"||e===null)return Y("scope","expected a scope object");let t=hHe(e);if(t===void 0)return Y("scope",`${String(e.namespace)} is not a listable namespace`);return fHe(e)??Oq("scope",t)}var pHe={transcript:[["agentId","names one agent transcript, a stream key, not a scope: narrow a scope with agentRelPath"],["journal","names a run journal, a stream key, not a scope: narrow a scope with agentRelPath"],["sessionJournal","names a session's own journal, a stream key, not a scope: the session scope lists it"]],log:[["agentId","names one log stream, a stream key, not a scope"],["runId","names one log stream, a stream key, not a scope"]],sessionLog:[["logName","names one session's log, a stream key, not a scope: a day scope lists its logs"]],task:[["taskId","names one task value, a key, not a scope: a list scope narrows with listId only"],["meta","names one task value, a key, not a scope: a list scope narrows with listId only"],["highWaterMark","names one task value, a key, not a scope: a list scope narrows with listId only"]],mailbox:[["teammate","names one inbox, a key, not a scope"]],cache:[["id","names one cached value, a key, not a scope: a cache scope narrows with store only"]],pluginAssetCache:[["digest","names one cached asset, a key, not a scope"]],fileHistory:[["backupFileName","names one backup, a key, not a scope: a file-history scope narrows with sessionId only"]],state:[["id","names one value, a key, not a scope"]],feedbackDraft:[["draftId","names one draft, a key, not a scope"]],jobsRoot:[["file","names one value, a key, not a scope"],["draftKey","names one value, a key, not a scope"]],plan:[["name","names one plan, a key, not a scope"]],paste:[["id","names one paste, a key, not a scope"]],session:[["file","names one value, a key, not a scope"]],globalConfig:[["stamp","names one recovery copy, a key, not a scope: the scope narrows with kind only"]],marketplaceCache:[["form","names one of the marketplace's two engine-written files, a key, not a scope: the tree narrows with relPath only"]],memory:[],pluginCache:[],daemon:[],sidecar:[],agentMemory:[],scratch:[],userConfigDir:[],job:[],bridgeSpawn:[]};function fHe(e){let t=e.namespace==="agentMemory"?mHe(e):void 0;if(t!==void 0)return t;if(e.namespace==="transcript"||e.namespace==="sidecar"){let r=aS("scope.sessionId",e.sessionId);if(r!==void 0)return r}for(let[r,o]of pHe[e.namespace])if(r in e&&e[r]!==void 0)return Y(`scope.${r}`,o);if(e.namespace==="sidecar"&&cS(e.relPath))return Y("scope.relPath",im);if(e.namespace==="sidecar"&&Kq(e.relPath))return Y("scope.relPath",Hq);if(e.namespace==="log"&&e.channel!==void 0&&!qq(e.channel))return Y("scope.channel",Vq);if(e.namespace==="job"&&Jq(e.relPath))return Y("scope.relPath",Yq);let n=e.namespace==="sessionLog"?lHe(e):void 0;if(n!==void 0)return n;if(e.namespace==="scratch"&&e.sessionId===void 0&&e.relPath!==void 0)return Y("scope.relPath","requires scope.sessionId: a scratch relPath narrows one session directory, and no cross-session prefix filter exists");if(e.namespace==="userConfigDir"&&!Iq.has(e.dir))return Y("scope.dir",Dq);if(e.namespace==="transcript"&&e.agentRelPath!==void 0&&(e.projectKey===void 0||e.sessionId===void 0))return Y("scope.agentRelPath","requires scope.projectKey and scope.sessionId: an agentRelPath narrows the subagents/ tree of one session directory");if(e.namespace==="transcript"&&cS(e.agentRelPath))return Y("scope.agentRelPath",im);if(e.namespace==="pluginCache"){if(e.marketplace===void 0&&e.plugin!==void 0)return Y("scope.plugin","requires scope.marketplace: a plugin narrows one marketplace folder");if(e.plugin===void 0&&e.version!==void 0)return Y("scope.version","requires scope.plugin: a version narrows one plugin folder");if(e.version===void 0&&e.relPath!==void 0)return Y("scope.relPath","requires scope.version: a relPath narrows one version folder")}if(e.namespace==="job"&&e.jobId===void 0&&e.relPath!==void 0)return Y("scope.relPath","requires scope.jobId: a job relPath narrows one job directory, and no cross-job prefix filter exists");if(e.namespace==="transcript"&&e.projectKey===void 0&&e.sessionId!==void 0)return Y("scope.sessionId","requires scope.projectKey: a session narrows one project folder, and no cross-project session filter exists");if(e.namespace==="globalConfig"&&e.kind!==void 0&&!zq(e.kind))return Y("scope.kind",$q);return}function mHe(e){if(!Uq(e.layer))return Y("scope.layer","must be user, project or local");if(e.layer==="user"&&"projectKey"in e)return Y("scope.projectKey","the user layer is not keyed by project");if(e.layer!=="user"&&typeof e.projectKey!=="string")return Y("scope.projectKey","required for the project and local layers");return e.agentType===void 0&&e.relPath!==void 0?Y("scope.relPath","requires scope.agentType: an agent-memory relPath narrows one agent directory"):void 0}function hHe(e){switch(e.namespace){case"transcript":return[["projectKey",e.projectKey,"optional"],["sessionId",e.sessionId,"optional"],["agentRelPath",e.agentRelPath,"optional"]];case"task":return[["listId",e.listId,"optional"]];case"mailbox":return[["team",e.team,"optional"]];case"memory":return[["projectKey",e.projectKey],["relPath",e.relPath,"optional"]];case"pluginCache":return[["marketplace",e.marketplace,"optional"],["plugin",e.plugin,"optional"],["version",e.version,"optional"],["relPath",e.relPath,"optional"]];case"marketplaceCache":return[["marketplace",e.marketplace],["relPath",e.relPath,"optional"]];case"cache":return[["store",e.store]];case"state":case"plan":case"paste":case"pluginAssetCache":case"feedbackDraft":return[];case"sidecar":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["relPath",e.relPath,"optional"]];case"agentMemory":return[["projectKey",e.layer==="user"?void 0:e.projectKey,"optional"],["agentType",e.agentType,"optional"],["relPath",e.relPath,"optional"]];case"scratch":return[["sessionId",e.sessionId,"optional"],["relPath",e.relPath,"optional"]];case"userConfigDir":return[["relPath",e.relPath,"optional"]];case"fileHistory":return[["sessionId",e.sessionId,"optional"]];case"job":return[["jobId",e.jobId,"optional"],["relPath",e.relPath,"optional"]];case"daemon":return[["relPath",e.relPath,"optional"]];case"jobsRoot":case"session":return[];case"bridgeSpawn":return[["dir",e.dir,"optional"]];case"globalConfig":return[["kind",e.kind,"optional"]];case"log":return[["sessionId",e.sessionId,"optional"]];case"sessionLog":return[["projectKey",e.projectKey,"optional"],["year",e.year,"optional"],["month",e.month,"optional"],["day",e.day,"optional"]]}return}import{isAbsolute as gHe,sep as Qq}from"path";function _He(e){let t=process.cwd();return t.endsWith(Qq)?t+e:t+Qq+e}function cR(e){return(t)=>e.hostFiles.realPath(F_.workspace(t===""||gHe(t)?t:_He(t)),{native:!0})}function am(e){return e===void 0?void 0:{hoverRestOn:ye(),realPath:cR(e)}}function bo(e,t){if(!ye()||t===void 0)return;if(!e.endsWith(".jsonl"))return;let n=t4(e);if(t4(n)!==kt())return;let r=e4(n),o=e4(e,".jsonl");if(e!==yHe(kt(),r,`${o}.jsonl`))return;let s=tn.transcript(r,o);return Ds(s)===void 0?{backend:t,key:s}:void 0}function cr(e){if(!ye()||e===void 0)return;return{backend:e,transcriptKey:tn.transcript,isKeySegment:pn,realWorkspacePath:cR(e)}}function Sn(e){return e===void 0?void 0:{source:e,hoverRestOn:ye()}}async function bHe(e,t,n){try{let r=Sn(bo(e,n));if(t>xq&&!_n.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)return(await wq(e,t,r)).postBoundaryBuf;if(r!==void 0&&r.hoverRestOn){let o=await r.source.backend.read([r.source.key]);if(!o.ok)return null;let s=o.value.items[0];if(!s.found)return null;return Buffer.from(s.value.buffer,s.value.byteOffset,s.value.byteLength)}return await SHe(e)}catch{return null}}var n4=524288,r4=8192;async function EHe(e){let a=[];try{const t=zt(a,en`parseTranscriptEntries(${e.length} bytes)`,0);let n=[];let r=10;let o=e.length;let s=0;let i=n4;while(s<o){if(s>=i)await new Promise((h)=>setImmediate(h)),i=s+n4;let d=e.indexOf(r,s);if(d===-1)d=o;let f=s;while(f<d&&e[f]<=32)f++;if(s=d+1,f>=d)continue;let m=e.toString("utf-8",f,d);try{let h=Lz(m),_=h.type;if((_==="user"||_==="assistant"||_==="progress"||_==="system"||_==="attachment")&&typeof h.uuid==="string")n.push(h)}catch{}}return n}catch(c){var l=c,u=1}finally{jt(a,l,u)}}async function xHe(e){let t=new Map;for(let m of e)t.set(m.uuid,m);let n=0;for(let m of t.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let h=m.compactMetadata?.preservedMessages,_=m.compactMetadata?.preservedSegment;if(h){if(h.uuids.length===0||h.uuids.some((S)=>!t.has(S)))continue;let y=h.anchorUuid;for(let S of h.uuids){let x=t.get(S);t.set(S,{...x,parentUuid:y}),y=S}let b=h.uuids[0],v=h.uuids.at(-1);for(let[S,x]of t){if(++n%r4===0)await new Promise((w)=>setImmediate(w));if(x.parentUuid===h.anchorUuid&&S!==b)t.set(S,{...x,parentUuid:v})}}else if(_){let y=t.get(_.headUuid);if(y)t.set(_.headUuid,{...y,parentUuid:_.anchorUuid});for(let[b,v]of t){if(++n%r4===0)await new Promise((S)=>setImmediate(S));if(v.parentUuid===_.anchorUuid&&b!==_.headUuid)t.set(b,{...v,parentUuid:_.tailUuid})}}}let r=new Map;for(let m=0;m<e.length;m++)r.set(e[m].uuid,m);let o=new Set;for(let m of t.values())if(m.parentUuid)o.add(m.parentUuid);let s=[...t.values()].filter((m)=>!o.has(m.uuid)),i=[];for(let m of s){let h=m,_=new Set;while(h){if(_.has(h.uuid))break;if(_.add(h.uuid),h.type==="user"||h.type==="assistant"){i.push(h);break}h=h.parentUuid?t.get(h.parentUuid):void 0}}if(i.length===0)return[];let a=i.filter((m)=>!m.isSidechain&&!m.teamName&&!m.isMeta),c=(m)=>m.reduce((h,_)=>(r.get(_.uuid)??-1)>(r.get(h.uuid)??-1)?_:h),l=a.length>0?c(a):c(i),u=[],d=new Set,f=t.get(l.uuid);while(f){if(d.has(f.uuid))break;d.add(f.uuid),u.push(f),f=f.parentUuid?t.get(f.parentUuid):void 0}return u.reverse(),await new Promise((m)=>setImmediate(m)),wHe(t,u,d)}function lR(e){if(e.type!=="assistant")return;let t=e.message;if(typeof t!=="object"||t===null)return;let n=t.id;return typeof n==="string"?n:void 0}function vHe(e){if(e.type!=="user"||!e.parentUuid)return!1;let t=e.message;if(typeof t!=="object"||t===null)return!1;let n=t.content;if(!Array.isArray(n))return!1;return n.some((r)=>typeof r==="object"&&r!==null&&r.type==="tool_result")}function wHe(e,t,n){let r=t.filter((d)=>d.type==="assistant");if(r.length===0)return t;let o=new Map;for(let d of r){let f=lR(d);if(f)o.set(f,d)}let s=new Map,i=new Map;for(let d of e.values()){let f=lR(d);if(f){let m=s.get(f);if(m)m.push(d);else s.set(f,[d])}else if(vHe(d)){let m=d.parentUuid,h=i.get(m);if(h)h.push(d);else i.set(m,[d])}}let a=new Set,c=new Map,l=0;for(let d of r){let f=lR(d);if(!f||a.has(f))continue;a.add(f);let m=s.get(f)??[d],h=m.filter((S)=>!n.has(S.uuid)),_=[];for(let S of m){let x=i.get(S.uuid);if(!x)continue;for(let w of x)if(!n.has(w.uuid))_.push(w)}if(h.length===0&&_.length===0)continue;let y=(S,x)=>(S.timestamp??"").localeCompare(x.timestamp??"");h.sort(y),_.sort(y);let b=o.get(f),v=[...h,..._];for(let S of v)n.add(S.uuid);l+=v.length,c.set(b.uuid,v)}if(l===0)return t;let u=[];for(let d of t){u.push(d);let f=c.get(d.uuid);if(f)u.push(...f)}return u}function AHe(e,t){if(e.type==="user"||e.type==="assistant");else if(e.type==="system"&&t);else return!1;if(e.isMeta)return!1;if(e.isSidechain)return!1;if(e.teamName)return!1;return!0}function uR(e,t,n){return{type:e.type,uuid:e.uuid,session_id:e.sessionId,message:e.message,parent_tool_use_id:t??null,parent_agent_id:n??null,...e.interruptedByShutdown===!0&&{interruptedByShutdown:!0},timestamp:e.timestamp}}function dR(e,t){let n=t?.offset??0;if(t?.limit!==void 0&&t.limit>0)return e.slice(n,n+t.limit);if(n>0)return e.slice(n);return e}async function o4(e,t){let n=[];for(let r of e){if(typeof r!=="object"||r===null)continue;let o=r,s=o.type;if((s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid==="string")n.push(o)}return s4(n,t)}async function s4(e,t){let n=await xHe(e),r=t?.includeSystemMessages??!1,s=n.filter((i)=>AHe(i,r)).map((i)=>uR(i));return dR(s,t)}async function i4(e,t,n){if(!Xe(e))return[];let r=ye(),o=r?n:void 0,s=await Ci(e,t?.dir,cr(o),r);if(!s)return[];let i=await bHe(s.filePath,s.fileSize,o);if(!i)return[];return s4(await EHe(i),t)}import{readdir as FP,stat as B2e}from"fs/promises";import{basename as THe,dirname as CHe,join as kHe}from"path";function RHe(){return kHe(Wt(),"projects")}function a4(e){return CHe(e)===RHe()?THe(e):void 0}class c4{projectDirCache=new Map;agentTranscriptSubdirs=new Map;cacheProjectDir(e,t){this.projectDirCache.set(e,t)}clearProjectDirCache(){this.projectDirCache.clear()}setAgentTranscriptSubdir(e,t){this.agentTranscriptSubdirs.set(e,t)}clearAgentTranscriptSubdir(e){this.agentTranscriptSubdirs.delete(e)}}var mNt=new Je(()=>new c4);import{basename as K2e,join as Cm}from"path";import{readFile as k2e}from"fs/promises";import{dirname as R2e,join as O2e}from"path";var l4;function I(e,t,n){function r(a,c){if(!a._zod)Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let f=u[d];if(!(f in a))a[f]=l[f].bind(a)}}let o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let l=n?.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:(a)=>{if(n?.Parent&&a instanceof n.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}var OHe=Symbol("zod_brand");class Ls extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class cm extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(l4=globalThis).__zod_globalConfig??(l4.__zod_globalConfig={});var Ru=globalThis.__zod_globalConfig;function lr(e){if(e)Object.assign(Ru,e);return Ru}function uS(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function fR(e,t="|"){return e.map((n)=>gR(n)).join(t)}function lm(e,t){if(typeof t==="bigint")return t.toString();return t}function um(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function dS(e){return e===null||e===void 0}function pS(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function d4(e,t){let n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-r)<o)return 0;return n-r}var u4=Symbol("evaluating");function Fe(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===u4)return;if(r===void 0)r=u4,r=n();return r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ya(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ki(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mR(e){return JSON.stringify(e)}function p4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var hR="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ou(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var f4=um(()=>{if(Ru.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ja(e){if(Ou(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(Ou(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function fS(e){if(Ja(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var m4=new Set(["string","number","symbol"]);function Ri(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ur(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function oe(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function gR(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function h4(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var g4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _4(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=ki(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in n.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;i[a]=n.shape[a]}return Ya(this,"shape",i),i},checks:[]});return ur(e,s)}function y4(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=ki(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in n.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;delete i[a]}return Ya(this,"shape",i),i},checks:[]});return ur(e,s)}function S4(e,t){if(!Ja(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ki(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ya(this,"shape",s),s}});return ur(e,o)}function b4(e,t){if(!Ja(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=ki(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return Ya(this,"shape",r),r}});return ur(e,n)}function PHe(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ki(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Ya(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ur(e,n)}function E4(e,t,n){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=ki(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(n)for(let l in n){if(!(l in a))throw Error(`Unrecognized key: "${l}"`);if(!n[l])continue;c[l]=e?new e({type:"optional",innerType:a[l]}):a[l]}else for(let l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Ya(this,"shape",c),c},checks:[]});return ur(t,i)}function x4(e,t,n){let r=ki(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(n)for(let i in n){if(!(i in s))throw Error(`Unrecognized key: "${i}"`);if(!n[i])continue;s[i]=new e({type:"nonoptional",innerType:o[i]})}else for(let i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Ya(this,"shape",s),s}});return ur(t,r)}function Xa(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function v4(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Oi(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function lS(e){return typeof e==="string"?e:e?.message}function Eo(e,t,n){let r=e.message?e.message:lS(e.inst?._zod.def?.error?.(e))??lS(t?.error?.(e))??lS(n.customError?.(e))??lS(n.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;if(a.path??(a.path=[]),a.message=r,t?.reportInput)a.input=i;return a}function mS(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function w4(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Qa(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}var A4=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hS=I("$ZodError",A4),dm=I("$ZodError",A4,{Parent:Error});function _R(e,t=(n)=>n.message){let n={},r=[];for(let o of e.issues)if(o.path.length>0)n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o));else r.push(t(o));return{formErrors:r,fieldErrors:n}}function yR(e,t=(n)=>n.message){let n={_errors:[]},r=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,l=0;while(l<a.length){let u=a[l];if(l!==a.length-1)c[u]=c[u]||{_errors:[]};else c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(i));c=c[u],l++}}}};return r(e),n}var pm=(e)=>(t,n,r,o)=>{let s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ls;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map((c)=>Eo(c,s,lr())));throw hR(a,o?.callee),a}return i.value},gS=pm(dm),fm=(e)=>async(t,n,r,o)=>{let s=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)i=await i;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map((c)=>Eo(c,s,lr())));throw hR(a,o?.callee),a}return i.value},_S=fm(dm),mm=(e)=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Ls;return s.issues.length?{success:!1,error:new(e??hS)(s.issues.map((i)=>Eo(i,o,lr())))}:{success:!0,data:s.value}},ec=mm(dm),hm=(e)=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>Eo(i,o,lr())))}:{success:!0,data:s.value}},tc=hm(dm),T4=(e)=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return pm(e)(t,n,o)};var C4=(e)=>(t,n,r)=>pm(e)(t,n,r);var k4=(e)=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return fm(e)(t,n,o)};var R4=(e)=>async(t,n,r)=>fm(e)(t,n,r);var O4=(e)=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return mm(e)(t,n,o)};var P4=(e)=>(t,n,r)=>mm(e)(t,n,r);var I4=(e)=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return hm(e)(t,n,o)};var D4=(e)=>async(t,n,r)=>hm(e)(t,n,r);var L4=/^[cC][0-9a-z]{6,}$/,N4=/^[0-9a-z]+$/,M4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,U4=/^[0-9a-vA-V]{20}$/,F4=/^[A-Za-z0-9]{27}$/,$4=/^[a-zA-Z0-9_-]{21}$/,z4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var j4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,SR=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var H4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var DHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function B4(){return new RegExp(DHe,"u")}var K4=/^(?:(?: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])$/,G4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var W4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,V4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,q4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bR=/^[A-Za-z0-9_-]*$/;var Z4=/^https?$/,Y4=/^\+[1-9]\d{6,14}$/,J4="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",X4=new RegExp(`^${J4}$`);function Q4(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function e6(e){return new RegExp(`^${Q4(e)}$`)}function t6(e){let t=Q4({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${J4}T(?:${r})$`)}var n6=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var r6=/^-?\d+$/,ER=/^-?\d+(?:\.\d+)?$/,o6=/^(?:true|false)$/i,s6=/^null$/i;var i6=/^undefined$/i;var a6=/^[^A-Z]*$/,c6=/^[^a-z]*$/;var fn=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),l6={number:"number",bigint:"bigint",object:"date"},xR=I("$ZodCheckLessThan",(e,t)=>{fn.init(e,t);let n=l6[typeof t.value];e._zod.onattach.push((r)=>{let o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value<=t.value:r.value<t.value)return;r.issues.push({origin:n,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vR=I("$ZodCheckGreaterThan",(e,t)=>{fn.init(e,t);let n=l6[typeof t.value];e._zod.onattach.push((r)=>{let o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value>=t.value:r.value>t.value)return;r.issues.push({origin:n,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),u6=I("$ZodCheckMultipleOf",(e,t)=>{fn.init(e,t),e._zod.onattach.push((n)=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):d4(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),d6=I("$ZodCheckNumberFormat",(e,t)=>{fn.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,s]=g4[t.format];e._zod.onattach.push((i)=>{let a=i._zod.bag;if(a.format=t.format,a.minimum=o,a.maximum=s,n)a.pattern=r6}),e._zod.check=(i)=>{let a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}if(a<o)i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var p6=I("$ZodCheckMaxLength",(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!dS(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let o=r.value;if(o.length<=t.maximum)return;let i=mS(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),f6=I("$ZodCheckMinLength",(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!dS(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let o=r.value;if(o.length>=t.minimum)return;let i=mS(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),m6=I("$ZodCheckLengthEquals",(e,t)=>{var n;fn.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!dS(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(r)=>{let o=r.value,s=o.length;if(s===t.length)return;let i=mS(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),gm=I("$ZodCheckStringFormat",(e,t)=>{var n,r;if(fn.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),h6=I("$ZodCheckRegex",(e,t)=>{gm.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),g6=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=a6),gm.init(e,t)}),_6=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=c6),gm.init(e,t)}),y6=I("$ZodCheckIncludes",(e,t)=>{fn.init(e,t);let n=Ri(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),S6=I("$ZodCheckStartsWith",(e,t)=>{fn.init(e,t);let n=new RegExp(`^${Ri(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),b6=I("$ZodCheckEndsWith",(e,t)=>{fn.init(e,t);let n=new RegExp(`.*${Ri(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var E6=I("$ZodCheckOverwrite",(e,t)=>{fn.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class wR{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
135
+ `).filter((s)=>s),r=Math.min(...n.map((s)=>s.length-s.trimStart().length)),o=n.map((s)=>s.slice(r)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((o)=>` ${o}`)];return new e(...t,r.join(`
136
+ `))}}var v6={major:4,minor:4,patch:3};var at=I("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=v6;let r=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))r.unshift(e);for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(i,a,c)=>{let l=Xa(i),u;for(let d of a){if(d._zod.def.when){if(v4(i))continue;if(!d._zod.def.when(i))continue}else if(l)continue;let f=i.issues.length,m=d._zod.check(i);if(m instanceof Promise&&c?.async===!1)throw new Ls;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{if(await m,i.issues.length===f)return;if(!l)l=Xa(i,f)});else{if(i.issues.length===f)continue;if(!l)l=Xa(i,f)}}if(u)return u.then(()=>i);return i},s=(i,a,c)=>{if(Xa(i))return i.aborted=!0,i;let l=o(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Ls;return l.then((u)=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});if(l instanceof Promise)return l.then((u)=>s(u,i,a));return s(l,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Ls;return c.then((l)=>o(l,r,a))}return o(c,r,a)}}Fe(e,"~standard",()=>({validate:(o)=>{try{let s=ec(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return tc(e,o).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),_m=I("$ZodString",(e,t)=>{at.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??n6(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),St=I("$ZodStringFormat",(e,t)=>{gm.init(e,t),_m.init(e,t)}),TR=I("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=j4),St.init(e,t)}),CR=I("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=SR(r))}else t.pattern??(t.pattern=SR());St.init(e,t)}),kR=I("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=H4),St.init(e,t)}),RR=I("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=(n)=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Z4.source){if(!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}}let o=new URL(r);if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(o.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(t.normalize)n.value=o.href;else n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),OR=I("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=B4()),St.init(e,t)}),PR=I("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$4),St.init(e,t)}),IR=I("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=L4),St.init(e,t)}),DR=I("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=N4),St.init(e,t)}),LR=I("$ZodULID",(e,t)=>{t.pattern??(t.pattern=M4),St.init(e,t)}),NR=I("$ZodXID",(e,t)=>{t.pattern??(t.pattern=U4),St.init(e,t)}),MR=I("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=F4),St.init(e,t)}),I6=I("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=t6(t)),St.init(e,t)}),D6=I("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=X4),St.init(e,t)}),L6=I("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=e6(t)),St.init(e,t)}),N6=I("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=z4),St.init(e,t)}),UR=I("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=K4),St.init(e,t),e._zod.bag.format="ipv4"}),FR=I("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=G4),St.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}});var $R=I("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=W4),St.init(e,t)}),zR=I("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=V4),St.init(e,t),e._zod.check=(n)=>{let r=n.value.split("/");try{if(r.length!==2)throw Error();let[o,s]=r;if(!s)throw Error();let i=Number(s);if(`${i}`!==s)throw Error();if(i<0||i>128)throw Error();new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function M6(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var jR=I("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=q4),St.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(n)=>{if(M6(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function LHe(e){if(!bR.test(e))return!1;let t=e.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return M6(n)}var HR=I("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=bR),St.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(n)=>{if(LHe(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),BR=I("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Y4),St.init(e,t)});function NHe(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var KR=I("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=(n)=>{if(NHe(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});var bS=I("$ZodNumber",(e,t)=>{at.init(e,t),e._zod.pattern=e._zod.bag.pattern??ER,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(i){}let o=n.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),GR=I("$ZodNumberFormat",(e,t)=>{d6.init(e,t),bS.init(e,t)}),WR=I("$ZodBoolean",(e,t)=>{at.init(e,t),e._zod.pattern=o6,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(s){}let o=n.value;if(typeof o==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}});var VR=I("$ZodUndefined",(e,t)=>{at.init(e,t),e._zod.pattern=i6,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{let o=n.value;if(typeof o>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),n}}),qR=I("$ZodNull",(e,t)=>{at.init(e,t),e._zod.pattern=s6,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let o=n.value;if(o===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}});var ZR=I("$ZodUnknown",(e,t)=>{at.init(e,t),e._zod.parse=(n)=>n}),YR=I("$ZodNever",(e,t)=>{at.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function w6(e,t,n){if(e.issues.length)t.issues.push(...Oi(n,e.issues));t.value[n]=e.value}var JR=I("$ZodArray",(e,t)=>{at.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=t.element._zod.run({value:a,issues:[]},r);if(c instanceof Promise)s.push(c.then((l)=>w6(l,n,i)));else w6(c,n,i)}if(s.length)return Promise.all(s).then(()=>n);return n}});function SS(e,t,n,r,o,s){let i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...Oi(n,e.issues))}if(!i&&!o){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(i)t.value[n]=void 0}else t.value[n]=e.value}function U6(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let n=h4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function F6(e,t,n,r,o,s){let i=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(let f in t){if(f==="__proto__")continue;if(a.has(f))continue;if(l==="never"){i.push(f);continue}let m=c.run({value:t[f],issues:[]},r);if(m instanceof Promise)e.push(m.then((h)=>SS(h,n,f,t,u,d)));else SS(m,n,f,t,u,d)}if(i.length)n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s});if(!e.length)return n;return Promise.all(e).then(()=>n)}var XR=I("$ZodObject",(e,t)=>{if(at.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let r=um(()=>U6(t));Fe(e._zod,"propValues",()=>{let a=t.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d)}}return c});let o=Ou,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=r.value);let l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};let u=[],d=i.shape;for(let f of i.keys){let m=d[f],h=m._zod.optin==="optional",_=m._zod.optout==="optional",y=m._zod.run({value:l[f],issues:[]},c);if(y instanceof Promise)u.push(y.then((b)=>SS(b,a,f,l,h,_)));else SS(y,a,f,l,h,_)}if(!s)return u.length?Promise.all(u).then(()=>a):a;return F6(u,l,a,c,r.value,e)}}),$6=I("$ZodObjectJIT",(e,t)=>{XR.init(e,t);let n=e._zod.parse,r=um(()=>U6(t)),o=(f)=>{let m=new wR(["shape","payload","ctx"]),h=r.value,_=(S)=>{let x=mR(S);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");let y=Object.create(null),b=0;for(let S of h.keys)y[S]=`key_${b++}`;m.write("const newResult = {};");for(let S of h.keys){let x=y[S],w=mR(S),D=f[S],P=D?._zod?.optin==="optional",F=D?._zod?.optout==="optional";if(m.write(`const ${x} = ${_(S)};`),P&&F)m.write(`
137
+ if (${x}.issues.length) {
138
+ if (${w} in input) {
139
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
140
+ ...iss,
141
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
142
+ })));
143
+ }
144
+ }
145
+
146
+ if (${x}.value === undefined) {
147
+ if (${w} in input) {
148
+ newResult[${w}] = undefined;
149
+ }
150
+ } else {
151
+ newResult[${w}] = ${x}.value;
152
+ }
153
+
154
+ `);else if(!P)m.write(`
155
+ const ${x}_present = ${w} in input;
156
+ if (${x}.issues.length) {
157
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
158
+ ...iss,
159
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
160
+ })));
161
+ }
162
+ if (!${x}_present && !${x}.issues.length) {
163
+ payload.issues.push({
164
+ code: "invalid_type",
165
+ expected: "nonoptional",
166
+ input: undefined,
167
+ path: [${w}]
168
+ });
169
+ }
170
+
171
+ if (${x}_present) {
172
+ if (${x}.value === undefined) {
173
+ newResult[${w}] = undefined;
174
+ } else {
175
+ newResult[${w}] = ${x}.value;
176
+ }
177
+ }
178
+
179
+ `);else m.write(`
180
+ if (${x}.issues.length) {
181
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
182
+ ...iss,
183
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
184
+ })));
185
+ }
186
+
187
+ if (${x}.value === undefined) {
188
+ if (${w} in input) {
189
+ newResult[${w}] = undefined;
190
+ }
191
+ } else {
192
+ newResult[${w}] = ${x}.value;
193
+ }
194
+
195
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let v=m.compile();return(S,x)=>v(f,S,x)},s,i=Ou,a=!Ru.jitless,l=a&&f4.value,u=t.catchall,d;e._zod.parse=(f,m)=>{d??(d=r.value);let h=f.value;if(!i(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;if(a&&l&&m?.async===!1&&m.jitless!==!0){if(!s)s=o(t.shape);if(f=s(f,m),!u)return f;return F6([],h,f,m,d,e)}return n(f,m)}});function A6(e,t,n,r){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter((s)=>!Xa(s));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((s)=>s.issues.map((i)=>Eo(i,r,lr())))}),t}var ES=I("$ZodUnion",(e,t)=>{at.init(e,t),Fe(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),Fe(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),Fe(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),Fe(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((o)=>o._zod.pattern);return new RegExp(`^(${r.map((o)=>pS(o.source)).join("|")})$`)}return});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return A6(i,r,e,o);return Promise.all(i).then((a)=>A6(a,r,e,o))}});var QR=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ES.init(e,t);let n=e._zod.parse;Fe(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){if(!o[a])o[a]=new Set;for(let l of c)o[a].add(l)}}return o});let r=um(()=>{let o=t.options,s=new Map;for(let i of o){let a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!Ou(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let a=r.value.get(i?.[t.discriminator]);if(a)return a._zod.run(o,s);if(t.unionFallback||s.direction==="backward")return n(o,s);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),o}}),eO=I("$ZodIntersection",(e,t)=>{at.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,l])=>T6(n,c,l));return T6(n,s,i)}});function AR(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(Ja(e)&&Ja(t)){let n=Object.keys(t),r=Object.keys(e).filter((s)=>n.indexOf(s)!==-1),o={...e,...t};for(let s of r){let i=AR(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t[r],i=AR(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function T6(e,t,n){let r=new Map,o;for(let a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(let c of a.keys){if(!r.has(c))r.set(c,{});r.get(c).l=!0}}else e.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let c of a.keys){if(!r.has(c))r.set(c,{});r.get(c).r=!0}else e.issues.push(a);let s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o)e.issues.push({...o,keys:s});if(Xa(e))return e;let i=AR(t.value,n.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var tO=I("$ZodRecord",(e,t)=>{at.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Ja(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let s=[],i=t.keyType._zod.values;if(i){n.value={};let a=new Set;for(let l of i)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){a.add(typeof l==="number"?l.toString():l);let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map((m)=>Eo(m,r,lr())),input:l,path:[l],inst:e});continue}let d=u.value,f=t.valueType._zod.run({value:o[l],issues:[]},r);if(f instanceof Promise)s.push(f.then((m)=>{if(m.issues.length)n.issues.push(...Oi(l,m.issues));n.value[d]=m.value}));else{if(f.issues.length)n.issues.push(...Oi(l,f.issues));n.value[d]=f.value}}let c;for(let l in o)if(!a.has(l))c=c??[],c.push(l);if(c&&c.length>0)n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(o,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a==="string"&&ER.test(a)&&c.issues.length){let d=t.keyType._zod.run({value:Number(a),issues:[]},r);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length===0)c=d}if(c.issues.length){if(t.mode==="loose")n.value[a]=o[a];else n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((d)=>Eo(d,r,lr())),input:a,path:[a],inst:e});continue}let u=t.valueType._zod.run({value:o[a],issues:[]},r);if(u instanceof Promise)s.push(u.then((d)=>{if(d.issues.length)n.issues.push(...Oi(a,d.issues));n.value[c.value]=d.value}));else{if(u.issues.length)n.issues.push(...Oi(a,u.issues));n.value[c.value]=u.value}}}if(s.length)return Promise.all(s).then(()=>n);return n}});var nO=I("$ZodEnum",(e,t)=>{at.init(e,t);let n=uS(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter((o)=>m4.has(typeof o)).map((o)=>typeof o==="string"?Ri(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let i=o.value;if(r.has(i))return o;return o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),rO=I("$ZodLiteral",(e,t)=>{if(at.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?Ri(r):r?Ri(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{let s=r.value;if(n.has(s))return r;return r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}});var oO=I("$ZodTransform",(e,t)=>{at.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cm(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new Ls;return n.value=o,n.fallback=!0,n}});function C6(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}var xS=I("$ZodOptional",(e,t)=>{at.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Fe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${pS(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){let o=n.value,s=t.innerType._zod.run(n,r);if(s instanceof Promise)return s.then((i)=>C6(i,o));return C6(s,o)}if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}}),sO=I("$ZodExactOptional",(e,t)=>{xS.init(e,t),Fe(e._zod,"values",()=>t.innerType._zod.values),Fe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),iO=I("$ZodNullable",(e,t)=>{at.init(e,t),Fe(e._zod,"optin",()=>t.innerType._zod.optin),Fe(e._zod,"optout",()=>t.innerType._zod.optout),Fe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${pS(n.source)}|null)$`):void 0}),Fe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>{if(n.value===null)return n;return t.innerType._zod.run(n,r)}}),aO=I("$ZodDefault",(e,t)=>{at.init(e,t),e._zod.optin="optional",Fe(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;let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>k6(s,t));return k6(o,t)}});function k6(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var cO=I("$ZodPrefault",(e,t)=>{at.init(e,t),e._zod.optin="optional",Fe(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)n.value=t.defaultValue;return t.innerType._zod.run(n,r)}}),lO=I("$ZodNonOptional",(e,t)=>{at.init(e,t),Fe(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((r)=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>R6(s,e));return R6(o,e)}});function R6(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var uO=I("$ZodCatch",(e,t)=>{at.init(e,t),e._zod.optin="optional",Fe(e._zod,"optout",()=>t.innerType._zod.optout),Fe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>{if(n.value=s.value,n.issues=s.issues,s.issues.length)n.value=t.catchValue({...n,error:{issues:s.issues.map((i)=>Eo(i,r,lr()))},input:n.value}),n.issues=[],n.fallback=!0;return n});if(n.value=o.value,n.issues=o.issues,o.issues.length)n.value=t.catchValue({...n,error:{issues:o.issues.map((s)=>Eo(s,r,lr()))},input:n.value}),n.issues=[],n.fallback=!0;return n}});var vS=I("$ZodPipe",(e,t)=>{at.init(e,t),Fe(e._zod,"values",()=>t.in._zod.values),Fe(e._zod,"optin",()=>t.in._zod.optin),Fe(e._zod,"optout",()=>t.out._zod.optout),Fe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let s=t.out._zod.run(n,r);if(s instanceof Promise)return s.then((i)=>yS(i,t.in,r));return yS(s,t.in,r)}let o=t.in._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>yS(s,t.out,r));return yS(o,t.out,r)}});function yS(e,t,n){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var z6=I("$ZodPreprocess",(e,t)=>{vS.init(e,t)}),dO=I("$ZodReadonly",(e,t)=>{at.init(e,t),Fe(e._zod,"propValues",()=>t.innerType._zod.propValues),Fe(e._zod,"values",()=>t.innerType._zod.values),Fe(e._zod,"optin",()=>t.innerType?._zod?.optin),Fe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then(O6);return O6(o)}});function O6(e){return e.value=Object.freeze(e.value),e}var pO=I("$ZodLazy",(e,t)=>{at.init(e,t),Fe(e._zod,"innerType",()=>{let n=t;if(!n._cachedInner)n._cachedInner=t.getter();return n._cachedInner}),Fe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Fe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Fe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Fe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),fO=I("$ZodCustom",(e,t)=>{fn.init(e,t),at.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=(n)=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then((s)=>P6(s,n,r,e));P6(o,n,r,e);return}});function P6(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)o.params=r._zod.def.params;t.issues.push(Qa(o))}}var MHe=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let s=r[o.expected]??o.expected,i=w4(o.input),a=r[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${gR(o.values[0])}`;return`Invalid option: expected one of ${fR(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=t(o.origin);if(i)return`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=t(o.origin);if(i)return`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`;return`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${fR(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":if(o.options&&Array.isArray(o.options)&&o.options.length>0)return`Invalid discriminator value. Expected ${o.options.map((i)=>`'${i}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function mO(){return{localeError:MHe()}}var j6,UHe=Symbol("ZodOutput"),FHe=Symbol("ZodInput");class H6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function B6(){return new H6}(j6=globalThis).__zod_globalRegistry??(j6.__zod_globalRegistry=B6());var vo=globalThis.__zod_globalRegistry;function hO(e,t){return new e({type:"string",...oe(t)})}function K6(e,t){return new e({type:"string",coerce:!0,...oe(t)})}function gO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function wS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function _O(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function yO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function SO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function bO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function EO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function xO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function vO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function wO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function AO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function TO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function CO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function kO(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function RO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function OO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function PO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function IO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function DO(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function LO(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function NO(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function MO(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function G6(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function W6(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function V6(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function q6(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function UO(e,t){return new e({type:"number",checks:[],...oe(t)})}function FO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function $O(e,t){return new e({type:"boolean",...oe(t)})}function zO(e,t){return new e({type:"undefined",...oe(t)})}function jO(e,t){return new e({type:"null",...oe(t)})}function HO(e){return new e({type:"unknown"})}function BO(e,t){return new e({type:"never",...oe(t)})}function AS(e,t){return new xR({check:"less_than",...oe(t),value:e,inclusive:!1})}function ym(e,t){return new xR({check:"less_than",...oe(t),value:e,inclusive:!0})}function TS(e,t){return new vR({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Sm(e,t){return new vR({check:"greater_than",...oe(t),value:e,inclusive:!0})}function CS(e,t){return new u6({check:"multiple_of",...oe(t),value:e})}function kS(e,t){return new p6({check:"max_length",...oe(t),maximum:e})}function Iu(e,t){return new f6({check:"min_length",...oe(t),minimum:e})}function RS(e,t){return new m6({check:"length_equals",...oe(t),length:e})}function KO(e,t){return new h6({check:"string_format",format:"regex",...oe(t),pattern:e})}function GO(e){return new g6({check:"string_format",format:"lowercase",...oe(e)})}function WO(e){return new _6({check:"string_format",format:"uppercase",...oe(e)})}function VO(e,t){return new y6({check:"string_format",format:"includes",...oe(t),includes:e})}function qO(e,t){return new S6({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function ZO(e,t){return new b6({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function Pi(e){return new E6({check:"overwrite",tx:e})}function YO(e){return Pi((t)=>t.normalize(e))}function JO(){return Pi((e)=>e.trim())}function XO(){return Pi((e)=>e.toLowerCase())}function QO(){return Pi((e)=>e.toUpperCase())}function eP(){return Pi((e)=>p4(e))}function Z6(e,t,n){return new e({type:"array",element:t,...oe(n)})}function tP(e,t,n){let r=oe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function nP(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function rP(e,t){let n=$He((r)=>(r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(Qa(o,r.value,n._zod.def));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Qa(s))}},e(r.value,r)),t);return n}function $He(e,t){let n=new fn({check:"custom",...oe(t)});return n._zod.check=e,n}function Em(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??vo,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 ht(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,n.schemaPath.includes(e))s.cycle=n.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{let f=i.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,f,u)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;ht(d,t,u),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(i.schema,c);if(t.io==="input"&&jn(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(r=i.schema).default??(r.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function xm(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=r.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}let o=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,f=e.external.uri??((h)=>h);if(d)return{ref:f(d)};let m=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=m,{defId:m,ref:`${f("__shared")}#/${a}/${m}`}}if(i[1]===n)return{ref:"#"};let l=`${"#"}/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:l}=o(i);if(a.def={...a.schema},l)a.defId=l;let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
196
+
197
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref"){s(i);continue}}}}function vm(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);let m=e.seen.get(d),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(h);else Object.assign(l,h);if(Object.assign(l,u),a._zod.parent===d)for(let y in l){if(y==="$ref"||y==="allOf")continue;if(!(y in u))delete l[y]}if(h.$ref&&m.def)for(let y in l){if(y==="$ref"||y==="allOf")continue;if(y in m.def&&JSON.stringify(l[y])===JSON.stringify(m.def[y]))delete l[y]}}let f=a._zod.parent;if(f&&f!==d){r(f);let m=e.seen.get(f);if(m?.schema.$ref){if(l.$ref=m.schema.$ref,m.def)for(let h in l){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(l[h])===JSON.stringify(m.def[h]))delete l[h]}}}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())r(a[0]);let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&o.id===s)delete o.id;let i=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;i[c.defId]=c.def}}if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:bm(t,"input",e.processors),output:bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function jn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return jn(r.element,n);if(r.type==="set")return jn(r.valueType,n);if(r.type==="lazy")return jn(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 jn(r.innerType,n);if(r.type==="intersection")return jn(r.left,n)||jn(r.right,n);if(r.type==="record"||r.type==="map")return jn(r.keyType,n)||jn(r.valueType,n);if(r.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return jn(r.in,n)||jn(r.out,n)}if(r.type==="object"){for(let o in r.shape)if(jn(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(jn(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(jn(o,n))return!0;if(r.rest&&jn(r.rest,n))return!0;return!1}return!1}var Y6=(e,t={})=>(n)=>{let r=Em({...n,processors:t});return ht(e,r),xm(r,e),vm(r,e)},bm=(e,t,n={})=>(r)=>{let{libraryOptions:o,target:s}=r??{},i=Em({...o??{},target:s,io:t,processors:n});return ht(e,i),xm(i,e),vm(i,e)};var zHe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oP=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof i==="number")o.maxLength=i;if(a){if(o.format=zHe[a]??a,o.format==="")delete o.format;if(a==="time")delete o.format}if(l)o.contentEncoding=l;if(c&&c.size>0){let u=[...c];if(u.length===1)o.pattern=u[0].source;else if(u.length>1)o.allOf=[...u.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},sP=(e,t,n,r)=>{let o=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;if(typeof a==="string"&&a.includes("int"))o.type="integer";else o.type="number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l==="number"&&l<=(i??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(m)o.minimum=u,o.exclusiveMinimum=!0;else o.exclusiveMinimum=u;else if(typeof s==="number")o.minimum=s;if(f)if(m)o.maximum=l,o.exclusiveMaximum=!0;else o.exclusiveMaximum=l;else if(typeof i==="number")o.maximum=i;if(typeof c==="number")o.multipleOf=c},iP=(e,t,n,r)=>{n.type="boolean"},X6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Q6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},aP=(e,t,n,r)=>{if(t.target==="openapi-3.0")n.type="string",n.nullable=!0,n.enum=[null];else n.type="null"},cP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},e3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},lP=(e,t,n,r)=>{n.not={}},t3=(e,t,n,r)=>{},uP=(e,t,n,r)=>{},n3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},dP=(e,t,n,r)=>{let o=e._zod.def,s=uS(o.entries);if(s.every((i)=>typeof i==="number"))n.type="number";if(s.every((i)=>typeof i==="string"))n.type="string";n.enum=s},pP=(e,t,n,r)=>{let o=e._zod.def,s=[];for(let i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else s.push(Number(i));else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[i];else n.const=i}else{if(s.every((i)=>typeof i==="number"))n.type="number";if(s.every((i)=>typeof i==="string"))n.type="string";if(s.every((i)=>typeof i==="boolean"))n.type="boolean";if(s.every((i)=>i===null))n.type="null";n.enum=s}},r3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},o3=(e,t,n,r)=>{let o=n,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},s3=(e,t,n,r)=>{let o=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:a,mime:c}=e._zod.bag;if(i!==void 0)s.minLength=i;if(a!==void 0)s.maxLength=a;if(c)if(c.length===1)s.contentMediaType=c[0],Object.assign(o,s);else Object.assign(o,s),o.anyOf=c.map((l)=>({contentMediaType:l}));else Object.assign(o,s)},i3=(e,t,n,r)=>{n.type="boolean"},fP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},a3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},mP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},c3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},l3=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},hP=(e,t,n,r)=>{let o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;if(typeof i==="number")o.minItems=i;if(typeof a==="number")o.maxItems=a;o.type="array",o.items=ht(s.element,t,{...r,path:[...r.path,"items"]})},gP=(e,t,n,r)=>{let o=n,s=e._zod.def;o.type="object",o.properties={};let i=s.shape;for(let l in i)o.properties[l]=ht(i[l],t,{...r,path:[...r.path,"properties",l]});let a=new Set(Object.keys(i)),c=new Set([...a].filter((l)=>{let u=s.shape[l]._zod;if(t.io==="input")return u.optin===void 0;else return u.optout===void 0}));if(c.size>0)o.required=Array.from(c);if(s.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")o.additionalProperties=!1}else if(s.catchall)o.additionalProperties=ht(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})},_P=(e,t,n,r)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ht(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));if(s)n.oneOf=i;else n.anyOf=i},yP=(e,t,n,r)=>{let o=e._zod.def,s=ht(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ht(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=(l)=>("allOf"in l)&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},u3=(e,t,n,r)=>{let o=n,s=e._zod.def;o.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,m)=>ht(f,t,{...r,path:[...r.path,i,m]})),l=s.rest?ht(s.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(o.prefixItems=c,l)o.items=l}else if(t.target==="openapi-3.0"){if(o.items={anyOf:c},l)o.items.anyOf.push(l);if(o.minItems=c.length,!l)o.maxItems=c.length}else if(o.items=c,l)o.additionalItems=l;let{minimum:u,maximum:d}=e._zod.bag;if(typeof u==="number")o.minItems=u;if(typeof d==="number")o.maxItems=d},SP=(e,t,n,r)=>{let o=n,s=e._zod.def;o.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let u=ht(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)o.patternProperties[d.source]=u}else{if(t.target==="draft-07"||t.target==="draft-2020-12")o.propertyNames=ht(s.keyType,t,{...r,path:[...r.path,"propertyNames"]});o.additionalProperties=ht(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let l=i._zod.values;if(l){let u=[...l].filter((d)=>typeof d==="string"||typeof d==="number");if(u.length>0)o.required=u}},bP=(e,t,n,r)=>{let o=e._zod.def,s=ht(o.innerType,t,r),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=o.innerType,n.nullable=!0;else n.anyOf=[s,{type:"null"}]},EP=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType},xP=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},vP=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);if(s.ref=o.innerType,t.io==="input")n._prefault=JSON.parse(JSON.stringify(o.defaultValue))},wP=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},AP=(e,t,n,r)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;ht(i,t,r);let a=t.seen.get(e);a.ref=i},TP=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},d3=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType},OS=(e,t,n,r)=>{let o=e._zod.def;ht(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType},CP=(e,t,n,r)=>{let o=e._zod.innerType;ht(o,t,r);let s=t.seen.get(e);s.ref=o},J6={string:oP,number:sP,boolean:iP,bigint:X6,symbol:Q6,null:aP,undefined:cP,void:e3,never:lP,any:t3,unknown:uP,date:n3,enum:dP,literal:pP,nan:r3,template_literal:o3,file:s3,success:i3,custom:fP,function:a3,transform:mP,map:c3,set:l3,array:hP,object:gP,union:_P,intersection:yP,tuple:u3,record:SP,nullable:bP,nonoptional:EP,default:xP,prefault:vP,catch:wP,pipe:AP,readonly:TP,promise:d3,optional:OS,lazy:CP};function kP(e,t){if("_idmap"in e){let r=e,o=Em({...t,processors:J6}),s={};for(let c of r._idmap.entries()){let[l,u]=c;ht(u,o)}let i={},a={registry:r,uri:t?.uri,defs:s};o.external=a;for(let c of r._idmap.entries()){let[l,u]=c;xm(o,u),i[l]=vm(o,u)}if(Object.keys(s).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let n=Em({...t,processors:J6});return ht(e,n),xm(n,e),vm(n,e)}var VHe=I("ZodISODateTime",(e,t)=>{I6.init(e,t),Rt.init(e,t)});function RP(e){return G6(VHe,e)}var qHe=I("ZodISODate",(e,t)=>{D6.init(e,t),Rt.init(e,t)});function f3(e){return W6(qHe,e)}var ZHe=I("ZodISOTime",(e,t)=>{L6.init(e,t),Rt.init(e,t)});function m3(e){return V6(ZHe,e)}var YHe=I("ZodISODuration",(e,t)=>{N6.init(e,t),Rt.init(e,t)});function h3(e){return q6(YHe,e)}var JHe=(e,t)=>{hS.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>yR(e,n)},flatten:{value:(n)=>_R(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,lm,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,lm,2)}},isEmpty:{get(){return e.issues.length===0}}})};var Or=I("ZodError",JHe,{Parent:Error});var _3=pm(Or),y3=fm(Or),S3=mm(Or),b3=hm(Or),E3=T4(Or),x3=C4(Or),v3=k4(Or),w3=R4(Or),A3=O4(Or),T3=P4(Or),C3=I4(Or),k3=D4(Or);var R3=new WeakMap;function wm(e,t,n){let r=Object.getPrototypeOf(e),o=R3.get(r);if(!o)o=new Set,R3.set(r,o);if(o.has(t))return;o.add(t);for(let s in n){let i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}var bt=I("ZodType",(e,t)=>(at.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bm(e,"input"),output:bm(e,"output")}}),e.toJSONSchema=Y6(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>_3(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>S3(e,n,r),e.parseAsync=async(n,r)=>y3(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>b3(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>E3(e,n,r),e.decode=(n,r)=>x3(e,n,r),e.encodeAsync=async(n,r)=>v3(e,n,r),e.decodeAsync=async(n,r)=>w3(e,n,r),e.safeEncode=(n,r)=>A3(e,n,r),e.safeDecode=(n,r)=>T3(e,n,r),e.safeEncodeAsync=async(n,r)=>C3(e,n,r),e.safeDecodeAsync=async(n,r)=>k3(e,n,r),wm(e,"ZodType",{check(...n){let r=this.def;return this.clone(ki(r,{checks:[...r.checks??[],...n.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return ur(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(v2e(n,r))},superRefine(n,r){return this.check(w2e(n,r))},overwrite(n){return this.check(Pi(n))},optional(){return Ot(this)},exactOptional(){return u2e(this)},nullable(){return I3(this)},nullish(){return Ot(I3(this))},nonoptional(n){return g2e(this,n)},array(){return N(this)},or(n){return ue([this,n])},and(n){return IS(this,n)},transform(n){return D3(this,z3(n))},default(n){return f2e(this,n)},prefault(n){return h2e(this,n)},catch(n){return y2e(this,n)},pipe(n){return D3(this,n)},readonly(){return E2e(this)},describe(n){let r=this.clone();return vo.add(r,{description:n}),r},meta(...n){if(n.length===0)return vo.get(this);let r=this.clone();return vo.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return vo.get(e)?.description},configurable:!0}),e)),L3=I("_ZodString",(e,t)=>{_m.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>oP(e,r,o,s);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,wm(e,"_ZodString",{regex(...r){return this.check(KO(...r))},includes(...r){return this.check(VO(...r))},startsWith(...r){return this.check(qO(...r))},endsWith(...r){return this.check(ZO(...r))},min(...r){return this.check(Iu(...r))},max(...r){return this.check(kS(...r))},length(...r){return this.check(RS(...r))},nonempty(...r){return this.check(Iu(1,...r))},lowercase(r){return this.check(GO(r))},uppercase(r){return this.check(WO(r))},trim(){return this.check(JO())},normalize(...r){return this.check(YO(...r))},toLowerCase(){return this.check(XO())},toUpperCase(){return this.check(QO())},slugify(){return this.check(eP())}})}),DP=I("ZodString",(e,t)=>{_m.init(e,t),L3.init(e,t),e.email=(n)=>e.check(gO(MBe,n)),e.url=(n)=>e.check(EO(UBe,n)),e.jwt=(n)=>e.check(MO(XBe,n)),e.emoji=(n)=>e.check(xO(FBe,n)),e.guid=(n)=>e.check(wS(O3,n)),e.uuid=(n)=>e.check(_O(PS,n)),e.uuidv4=(n)=>e.check(yO(PS,n)),e.uuidv6=(n)=>e.check(SO(PS,n)),e.uuidv7=(n)=>e.check(bO(PS,n)),e.nanoid=(n)=>e.check(vO($Be,n)),e.guid=(n)=>e.check(wS(O3,n)),e.cuid=(n)=>e.check(wO(zBe,n)),e.cuid2=(n)=>e.check(AO(jBe,n)),e.ulid=(n)=>e.check(TO(HBe,n)),e.base64=(n)=>e.check(DO(ZBe,n)),e.base64url=(n)=>e.check(LO(YBe,n)),e.xid=(n)=>e.check(CO(BBe,n)),e.ksuid=(n)=>e.check(kO(KBe,n)),e.ipv4=(n)=>e.check(RO(GBe,n)),e.ipv6=(n)=>e.check(OO(WBe,n)),e.cidrv4=(n)=>e.check(PO(VBe,n)),e.cidrv6=(n)=>e.check(IO(qBe,n)),e.e164=(n)=>e.check(NO(JBe,n)),e.datetime=(n)=>e.check(RP(n)),e.date=(n)=>e.check(f3(n)),e.time=(n)=>e.check(m3(n)),e.duration=(n)=>e.check(h3(n))});function g(e){return hO(DP,e)}var Rt=I("ZodStringFormat",(e,t)=>{St.init(e,t),L3.init(e,t)}),MBe=I("ZodEmail",(e,t)=>{kR.init(e,t),Rt.init(e,t)});var O3=I("ZodGUID",(e,t)=>{TR.init(e,t),Rt.init(e,t)});var PS=I("ZodUUID",(e,t)=>{CR.init(e,t),Rt.init(e,t)});var UBe=I("ZodURL",(e,t)=>{RR.init(e,t),Rt.init(e,t)});var FBe=I("ZodEmoji",(e,t)=>{OR.init(e,t),Rt.init(e,t)});var $Be=I("ZodNanoID",(e,t)=>{PR.init(e,t),Rt.init(e,t)});var zBe=I("ZodCUID",(e,t)=>{IR.init(e,t),Rt.init(e,t)});var jBe=I("ZodCUID2",(e,t)=>{DR.init(e,t),Rt.init(e,t)});var HBe=I("ZodULID",(e,t)=>{LR.init(e,t),Rt.init(e,t)});var BBe=I("ZodXID",(e,t)=>{NR.init(e,t),Rt.init(e,t)});var KBe=I("ZodKSUID",(e,t)=>{MR.init(e,t),Rt.init(e,t)});var GBe=I("ZodIPv4",(e,t)=>{UR.init(e,t),Rt.init(e,t)});var WBe=I("ZodIPv6",(e,t)=>{FR.init(e,t),Rt.init(e,t)});var VBe=I("ZodCIDRv4",(e,t)=>{$R.init(e,t),Rt.init(e,t)});var qBe=I("ZodCIDRv6",(e,t)=>{zR.init(e,t),Rt.init(e,t)});var ZBe=I("ZodBase64",(e,t)=>{jR.init(e,t),Rt.init(e,t)});var YBe=I("ZodBase64URL",(e,t)=>{HR.init(e,t),Rt.init(e,t)});var JBe=I("ZodE164",(e,t)=>{BR.init(e,t),Rt.init(e,t)});var XBe=I("ZodJWT",(e,t)=>{KR.init(e,t),Rt.init(e,t)});var LP=I("ZodNumber",(e,t)=>{bS.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>sP(e,r,o,s),wm(e,"ZodNumber",{gt(r,o){return this.check(TS(r,o))},gte(r,o){return this.check(Sm(r,o))},min(r,o){return this.check(Sm(r,o))},lt(r,o){return this.check(AS(r,o))},lte(r,o){return this.check(ym(r,o))},max(r,o){return this.check(ym(r,o))},int(r){return this.check(P3(r))},safe(r){return this.check(P3(r))},positive(r){return this.check(TS(0,r))},nonnegative(r){return this.check(Sm(0,r))},negative(r){return this.check(AS(0,r))},nonpositive(r){return this.check(ym(0,r))},multipleOf(r,o){return this.check(CS(r,o))},step(r,o){return this.check(CS(r,o))},finite(){return this}});let 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??0.5),e.isFinite=!0,e.format=n.format??null});function X(e){return UO(LP,e)}var QBe=I("ZodNumberFormat",(e,t)=>{GR.init(e,t),LP.init(e,t)});function P3(e){return FO(QBe,e)}var N3=I("ZodBoolean",(e,t)=>{WR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>iP(e,n,r,o)});function R(e){return $O(N3,e)}var e2e=I("ZodUndefined",(e,t)=>{VR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cP(e,n,r,o)});function NP(e){return zO(e2e,e)}var t2e=I("ZodNull",(e,t)=>{qR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aP(e,n,r,o)});function M3(e){return jO(t2e,e)}var n2e=I("ZodUnknown",(e,t)=>{ZR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uP(e,n,r,o)});function Te(){return HO(n2e)}var r2e=I("ZodNever",(e,t)=>{YR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lP(e,n,r,o)});function U3(e){return BO(r2e,e)}var o2e=I("ZodArray",(e,t)=>{JR.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hP(e,n,r,o),e.element=t.element,wm(e,"ZodArray",{min(n,r){return this.check(Iu(n,r))},nonempty(n){return this.check(Iu(1,n))},max(n,r){return this.check(kS(n,r))},length(n,r){return this.check(RS(n,r))},unwrap(){return this.element}})});function N(e,t){return Z6(o2e,e,t)}var MP=I("ZodObject",(e,t)=>{$6.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gP(e,n,r,o),Fe(e,"shape",()=>t.shape),wm(e,"ZodObject",{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Te()})},loose(){return this.clone({...this._zod.def,catchall:Te()})},strict(){return this.clone({...this._zod.def,catchall:U3()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return S4(this,n)},safeExtend(n){return b4(this,n)},merge(n){return PHe(this,n)},pick(n){return _4(this,n)},omit(n){return y4(this,n)},partial(...n){return E4(DS,this,n[0])},required(...n){return x4(j3,this,n[0])}})});function T(e,t){let n={type:"object",shape:e??{},...oe(t)};return new MP(n)}function UP(e,t){return new MP({type:"object",shape:e,catchall:U3(),...oe(t)})}function nn(e,t){return new MP({type:"object",shape:e,catchall:Te(),...oe(t)})}var F3=I("ZodUnion",(e,t)=>{ES.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_P(e,n,r,o),e.options=t.options});function ue(e,t){return new F3({type:"union",options:e,...oe(t)})}var s2e=I("ZodDiscriminatedUnion",(e,t)=>{F3.init(e,t),QR.init(e,t)});function nc(e,t,n){return new s2e({type:"union",options:t,discriminator:e,...oe(n)})}var i2e=I("ZodIntersection",(e,t)=>{eO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yP(e,n,r,o)});function IS(e,t){return new i2e({type:"intersection",left:e,right:t})}var PP=I("ZodRecord",(e,t)=>{tO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SP(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Z(e,t,n){if(!t||!t._zod)return new PP({type:"record",keyType:g(),valueType:e,...oe(t)});return new PP({type:"record",keyType:e,valueType:t,...oe(n)})}function $3(e,t,n){let r=ur(e);return r._zod.values=void 0,new PP({type:"record",keyType:r,valueType:t,...oe(n)})}var IP=I("ZodEnum",(e,t)=>{nO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>dP(e,r,o,s),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let s={};for(let i of r)if(n.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new IP({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{let s={...t.entries};for(let i of r)if(n.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new IP({...t,checks:[],...oe(o),entries:s})}});function V(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new IP({type:"enum",entries:n,...oe(t)})}var a2e=I("ZodLiteral",(e,t)=>{rO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pP(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function j(e,t){return new a2e({type:"literal",values:Array.isArray(e)?e:[e],...oe(t)})}var c2e=I("ZodTransform",(e,t)=>{oO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mP(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cm(e.constructor.name);n.addIssue=(s)=>{if(typeof s==="string")n.issues.push(Qa(s,n.value,t));else{let i=s;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Qa(i))}};let o=t.transform(n.value,n);if(o instanceof Promise)return o.then((s)=>(n.value=s,n.fallback=!0,n));return n.value=o,n.fallback=!0,n}});function z3(e){return new c2e({type:"transform",transform:e})}var DS=I("ZodOptional",(e,t)=>{xS.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OS(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ot(e){return new DS({type:"optional",innerType:e})}var l2e=I("ZodExactOptional",(e,t)=>{sO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OS(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function u2e(e){return new l2e({type:"optional",innerType:e})}var d2e=I("ZodNullable",(e,t)=>{iO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function I3(e){return new d2e({type:"nullable",innerType:e})}var p2e=I("ZodDefault",(e,t)=>{aO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function f2e(e,t){return new p2e({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():fS(t)}})}var m2e=I("ZodPrefault",(e,t)=>{cO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function h2e(e,t){return new m2e({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():fS(t)}})}var j3=I("ZodNonOptional",(e,t)=>{lO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function g2e(e,t){return new j3({type:"nonoptional",innerType:e,...oe(t)})}var _2e=I("ZodCatch",(e,t)=>{uO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function y2e(e,t){return new _2e({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var H3=I("ZodPipe",(e,t)=>{vS.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>AP(e,n,r,o),e.in=t.in,e.out=t.out});function D3(e,t){return new H3({type:"pipe",in:e,out:t})}var S2e=I("ZodPreprocess",(e,t)=>{H3.init(e,t),z6.init(e,t)}),b2e=I("ZodReadonly",(e,t)=>{dO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>TP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function E2e(e){return new b2e({type:"readonly",innerType:e})}var x2e=I("ZodLazy",(e,t)=>{pO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CP(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function LS(e){return new x2e({type:"lazy",getter:e})}var B3=I("ZodCustom",(e,t)=>{fO.init(e,t),bt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fP(e,n,r,o)});function K3(e,t){return tP(B3,e??(()=>!0),t)}function v2e(e,t={}){return nP(B3,e,t)}function w2e(e,t){return rP(e,t)}function tt(e,t){return new S2e({type:"pipe",in:z3(e),out:t})}var Vr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var G3;(function(e){})(G3||(G3={}));function A2e(e){return K6(DP,e)}lr(mO());var V3=200;function T2e(e){return[...e.replace(/[\x00-\x1f\x7f-\x9f]/g,"")].slice(0,V3).join("")}function q3(e){return T2e(Yy(e.trim())).trim()}import{basename as Z3,dirname as Y3}from"path";var C2e=6;function J3(e){let t=Z3(e);if(om(t))return;let n=kt(),r=[t],o=Y3(e);while(o!==n&&r.length<=C2e+1){let l=Y3(o);if(l===o)return;r.unshift(Z3(o)),o=l}if(o!==n||r.length<3)return;let[s,i,...a]=r;if(!pn(s)||!pn(i)||a.length===0||!a.every(pn))return;let c=tn.sidecar(s,i,a);return Ds(c)===void 0?c:void 0}var P2e=L(()=>T({customTitle:g()}));function I2e(e,t){return O2e(R2e(e),t,"custom-title.json")}async function Du(e,t,n){let r=await D2e(I2e(e,t),n);if(r===void 0)return;let o;try{o=JSON.parse(r)}catch{return}let s=P2e().safeParse(o);if(!s.success)return;return q3(s.data.customTitle)||void 0}async function D2e(e,t){if(ye()&&t!==void 0)try{let n=J3(e);if(n!==void 0){let r=await t.readText([n]);if(!r.ok)return;let o=r.value.items[0];return o.found?o.value:void 0}}catch{return}try{return await k2e(e,"utf8")}catch{return}}import{constants as NS}from"fs";import{lstat as L2e,open as N2e}from"fs/promises";import{dirname as M2e,join as U2e}from"path";var X3='"type":"continued-in"',F2e=L(()=>nn({type:j("continued-in"),continuedInSessionId:g()})),$2e=L(()=>nn({type:j("assistant"),isApiErrorMessage:R().optional(),message:nn({stop_reason:g().nullish()}).optional()}));function eZ(e){if(!e.includes(X3))return;let t=e.length;while(t>0){let n=e.lastIndexOf(`
198
+ `,t-1),r=e.slice(n+1,t);t=n;let o=r.includes(X3),s=r.includes('"type":"user"')||r.includes('"type":"assistant"');if(o||s)try{let i=JSON.parse(r);if(o){let a=F2e().safeParse(i);if(a.success)return Xe(a.data.continuedInSessionId)??void 0}if(s&&z2e(i))return}catch{}if(n<0)break}return}function z2e(e){let t=$2e().safeParse(e);if(t.success)return t.data.isApiErrorMessage!==!0&&typeof t.data.message?.stop_reason==="string";return Ge(e)&&na(e,{commandFallback:""})!==void 0}async function tZ(e,t,n){let r=U2e(M2e(e),`${t}.jsonl`),o=await qa(r,Sn(bo(r,n)));return o!==null&&await H2e(r,o.head,o.tail,o.size,n)}var Am='"parentUuid":',j2e=16777216,Q3=1048576;async function H2e(e,t,n,r,o){if(t.includes(Am)||n.includes(Am))return!0;if(r<=zn)return!1;if(bo(e,o)!==void 0)return!0;try{let s=process.platform!=="win32";if(!s&&!(await L2e(e)).isFile())return!1;let i=await N2e(e,s?NS.O_RDONLY|NS.O_NOFOLLOW|NS.O_NONBLOCK:NS.O_RDONLY);try{if(!(await i.stat()).isFile())return!1;let a=Buffer.allocUnsafe(Q3+Am.length),c=0,l=0;while(l<j2e){let{bytesRead:u}=await i.read(a,c,Q3,l);if(u===0)return!1;let d=c+u;if(a.subarray(0,d).includes(Am))return!0;c=Math.min(Am.length,d),a.copyWithin(0,d-c,d),l+=u}return!0}finally{await i.close()}}catch{return!1}}function Lu(e,t,n,r){let{head:o,tail:s,mtime:i,size:a}=t,c=o.indexOf(`
199
+ `),l=c>=0?o.slice(0,c):o;if(l.includes('"isSidechain":true')||l.includes('"isSidechain": true'))return null;let u=dn(s,"customTitle")||r||dn(o,"customTitle")||dn(s,"aiTitle")||dn(o,"aiTitle")||void 0,d=nS(o)||void 0,f=wu(o,"timestamp"),m;if(f){let S=Date.parse(f);if(!Number.isNaN(S))m=S}let h=u||dn(s,"lastPrompt")||dn(s,"summary")||d;if(!h)return null;let _=dn(s,"gitBranch")||wu(o,"gitBranch")||void 0,y=eS(s,"relocated","relocatedCwd")||wu(o,"cwd")||n||void 0,b=s.split(`
200
+ `).findLast((S)=>S.includes('"type":"tag"')&&S.includes('"tag":"')),v=b?dn(b,"tag")||void 0:void 0;return{sessionId:e,summary:h,lastModified:i,fileSize:a,customTitle:u,firstPrompt:d,gitBranch:_,cwd:y,tag:v,createdAt:m}}function G2e(e){let t=a4(e);return t!==void 0&&pn(t)?t:void 0}function MS(e){return{pagesLeft:XV+e}}async function Tm(e,t,n,r,o,s){let i=ye()&&r!==void 0?G2e(e):void 0;if(r!==void 0&&i!==void 0){let l=new Map;try{await yo((u)=>r.listEntries({namespace:"transcript",projectKey:i},{skipScopeStats:!0,...t?{}:{skipKeyStats:!0},...u!==void 0&&{cursor:u}}),(u)=>{for(let d of u){if(d.kind!=="key"||d.key.namespace!=="transcript")continue;let f=Xe(d.key.sessionId);if(!f)continue;if(t&&d.mtimeMs===void 0)continue;let m=t?Math.trunc(d.mtimeMs??0):0,h=l.get(f);if(h!==void 0){if(m>h.mtime)h.mtime=m;continue}l.set(f,{sessionId:f,filePath:Cm(e,`${d.key.sessionId}.jsonl`),mtime:m,projectPath:n,ownWorktrees:s})}},o!==void 0?{budget:o}:void 0)}catch{}return[...l.values()]}let a;try{a=await FP(e)}catch{return[]}return(await Promise.all(a.map(async(l)=>{if(!l.endsWith(".jsonl"))return null;let u=Xe(l.slice(0,-6));if(!u)return null;let d=Cm(e,l);if(!t)return{sessionId:u,filePath:d,mtime:0,projectPath:n,ownWorktrees:s};try{let f=await B2e(d);return{sessionId:u,filePath:d,mtime:f.mtime.getTime(),projectPath:n,ownWorktrees:s}}catch{return null}}))).filter((l)=>l!==null)}async function nZ(e,t,n){let r=await qa(e.filePath,Sn(bo(e.filePath,n)));if(!r)return null;if(!t&&fq(r.head,r.tail))return null;let o=eZ(r.tail);if(o!==void 0&&await tZ(e.filePath,o,n))return null;let s=dn(r.tail,"customTitle")===void 0?await Du(e.filePath,e.sessionId,n):void 0,i=Lu(e.sessionId,r,e.projectPath,s);if(!i)return null;let a=eS(r.tail,"relocated","relocatedCwd")??tR(r.head,"cwd");if(a!==void 0&&e.projectPath!==void 0&&!Sq(a,e.ownWorktrees,nR())&&await yq(a,e.projectPath,nR(),zz,am(n)))return null;if(e.mtime)i.lastModified=e.mtime;return i}var W2e=32;function V2e(e,t){if(t.mtime!==e.mtime)return t.mtime-e.mtime;return t.sessionId<e.sessionId?-1:t.sessionId>e.sessionId?1:0}async function q2e(e,t,n,r,o){e.sort(V2e);let s=[],i=t&&t>0?t:1/0,a=0,c=new Set;for(let l=0;l<e.length&&s.length<i;){let u=Math.min(l+W2e,e.length),d=e.slice(l,u),f=await Promise.all(d.map((m)=>nZ(m,r,o)));for(let m=0;m<f.length&&s.length<i;m++){l++;let h=f[m];if(!h)continue;if(c.has(h.sessionId))continue;if(c.add(h.sessionId),a<n){a++;continue}s.push(h)}}return s}async function Z2e(e,t,n){let r=await Promise.all(e.map((i)=>nZ(i,t,n))),o=new Map;for(let i of r){if(!i)continue;let a=o.get(i.sessionId);if(!a||i.lastModified>a.lastModified)o.set(i.sessionId,i)}let s=[...o.values()];return s.sort((i,a)=>a.lastModified!==i.lastModified?a.lastModified-i.lastModified:a.sessionId<i.sessionId?-1:a.sessionId>i.sessionId?1:0),s}async function Y2e(e,t,n,r){let o=await Ps(e,am(r)),s=Sn(cr(r)),i;if(t)try{i=await ks(o)}catch{i=[]}else i=[];if(i.length<=1){let b=[],v=await ir(o,s),S=MS(v.length);for(let x of v)b.push(...await Tm(x,n,o,r,S));return b}let a=kt(),c=process.platform==="win32",l=i.map((b)=>{let v=Os(b),S=c?v.toLowerCase():v;return{path:b,exactName:S,truncatedPrefix:v.length>Rs?S.slice(0,Rs):void 0}});l.sort((b,v)=>v.exactName.length-b.exactName.length);let u=s!==void 0&&s.hoverRestOn?await ku(s.source):null,d=u;if(d===null){let b;try{b=await FP(a,{withFileTypes:!0})}catch{let v=[],S=await ir(o),x=MS(S.length);for(let w of S)v.push(...await Tm(w,n,o,r,x));return v}d=b.filter((v)=>v.isDirectory()).map((v)=>v.name)}let f=[],m=new Set,h=MS(d.length+1),_=s!==void 0&&s.hoverRestOn&&u!==null?await oR(o,u,c,s):await ir(o),y=[o,...i];for(let b of _){let v=K2e(b),S=c?v.toLowerCase():v;m.add(S),f.push(...await Tm(b,n,o,r,h,y))}for(let b of d){let v=c?b.toLowerCase():b;if(m.has(v))continue;for(let{path:S,exactName:x,truncatedPrefix:w}of l)if(v===x||w!==void 0&&v.startsWith(w+"-")&&await Cu(Cm(a,b),S,c,s)){m.add(v),f.push(...await Tm(Cm(a,b),n,S,r,h,y));break}}return f}async function J2e(e,t){let n=kt(),r=cr(t),o=r!==void 0?await ku(r):null;if(o===null){let a;try{a=await FP(n,{withFileTypes:!0})}catch{return[]}o=a.filter((c)=>c.isDirectory()).map((c)=>c.name)}let s=MS(o.length);return(await Promise.all(o.map((a)=>Tm(Cm(n,a),e,void 0,t,s)))).flat()}async function rZ(e,t){let n=ye()?t:void 0,{dir:r,limit:o,offset:s,includeWorktrees:i,includeProgrammatic:a}=e??{},c=s??0,l=a??!0,u=o!==void 0&&o>0||c>0,d=r?await Y2e(r,i??!0,u,n):await J2e(u,n);if(!u)return Z2e(d,l,n);return q2e(d,o,c,l,n)}async function oZ(e,t={},n){let r=Xe(e);if(!r)return;let o=ye(),s=o?n:void 0,i=await Ci(r,t.dir,cr(s),o);if(!i)return;let a=await qa(i.filePath,Sn(bo(i.filePath,s)));if(!a)return;let c=dn(a.tail,"customTitle")===void 0?await Du(i.filePath,r,s):void 0;return Lu(r,a,i.projectPath,c)??void 0}import{constants as sZ}from"fs";import{open as X2e,readdir as cZ,rm as iZ,stat as Q2e}from"fs/promises";import{join as Ns}from"path";var eKe=64;function zP(e){return ye()?e:void 0}async function lZ(e,t,n={},r){if(!Xe(e))throw Error(`Invalid sessionId: ${e}`);if(!t.trim())throw Error("title must be non-empty");let o=me({type:"custom-title",customTitle:t.trim(),sessionId:e})+`
201
+ `;await fZ(e,o,n,zP(r))}async function uZ(e,t,n={},r){if(!Xe(e))throw Error(`Invalid sessionId: ${e}`);if(t!==null){let s=Wa(t).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");t=s}let o=me({type:"tag",tag:t??"",sessionId:e})+`
202
+ `;await fZ(e,o,n,zP(r))}async function dZ(e,t={},n){if(!Xe(e))throw Error(`Invalid sessionId: ${e}`);let r=zP(n);for(let o of await nKe(t,r)){if(ye()&&r!==void 0){let a=Za(o,r.isKeySegment);if(a!==void 0){if(await tKe(a,e,r))return;continue}}let s=Ns(o,`${e}.jsonl`),i;try{({size:i}=await Q2e(s))}catch(a){let c=ke(a);if(c==="ENOENT"||c==="ENOTDIR")continue;throw a}if(i===0)continue;await iZ(s,{force:!0}),await iZ(Ns(o,e),{recursive:!0,force:!0});return}throw Error(t.dir?`Session ${e} not found in project directory for ${t.dir}`:`Session ${e} not found in any project directory`)}async function tKe(e,t,n){let{backend:r,transcriptKey:o}=n,s=o(e,t),i=await r.statMeta(s);if(!i.ok){if(i.error.code==="NotFound")return!1;throw Error("Session delete: transcript unreadable via storage",{cause:i.error})}if((i.value.storedBytes??i.value.size)===0)return!1;for(let c of["transcript","sidecar"]){let l=await r.deleteScope({namespace:c,projectKey:e,sessionId:t});if(!l.ok)throw Error("Session delete: session directory not deletable via storage",{cause:l.error})}let a=await r.delete(s);if(!a.ok)throw Error("Session delete: transcript not deletable via storage",{cause:a.error});return!0}async function nKe(e,t){if(e.dir){let r=await Ps(e.dir,tS(t,ye())),o=await aZ(r,t),s;try{s=await ks(r)}catch{s=[]}for(let i of s){if(i===r)continue;o.push(...await aZ(i,t))}return o}let n=kt();if(ye()&&t!==void 0){let r=await pZ(t);if(r===void 0)return[];if(r.laterPageFailed)throw Error("Session delete: project listing incomplete via storage");return r.names.map((o)=>Ns(n,o))}try{return(await cZ(n,{withFileTypes:!0})).filter((o)=>o.isDirectory()||o.isSymbolicLink()).map((o)=>Ns(n,o.name))}catch{return[]}}async function aZ(e,t){let n=Sn(t);if(n===void 0||!n.hoverRestOn)return ir(e);let r=await ir(e,n),o=Tu(e),s=process.platform==="win32",i=[];for(let a of r)if(a===o||await Cu(a,e,s,n))i.push(a);return i}async function pZ(e){let t=[],n,r=0;try{do{let o=await e.backend.listEntries({namespace:"transcript"},{skipScopeStats:!0,...n!==void 0&&{cursor:n}});if(!o.ok)return r===0?void 0:{names:t,laterPageFailed:!0};for(let s of o.value.items){let i=rS(s,e.isKeySegment);if(i!==void 0)t.push(i)}n=o.value.cursor}while(n&&++r<eKe);return{names:t,laterPageFailed:Boolean(n)}}catch{return r===0&&t.length===0?void 0:{names:t,laterPageFailed:!0}}}async function fZ(e,t,n,r){let o=`${e}.jsonl`;if(n.dir){let a=await Ps(n.dir,tS(r,ye()));for(let l of await ir(a,Sn(r)))if(await US(Ns(l,o),t,$P(l,e,r)))return;let c;try{c=await ks(a)}catch{c=[]}for(let l of c){if(l===a)continue;for(let u of await ir(l,Sn(r)))if(await US(Ns(u,o),t,$P(u,e,r)))return}throw Error(`Session ${e} not found in project directory for ${n.dir}`)}let s=kt();if(ye()&&r!==void 0){let a=await pZ(r);if(a===void 0)throw new Ze(`Session ${e} not found (no projects directory)`,"Session not found (no projects directory)");let{names:c}=a;for(let l of c){let u=Ns(s,l);if(await US(Ns(u,o),t,$P(u,e,r)))return}throw new Ze(`Session ${e} not found in any project directory`,"Session not found in any project directory")}let i;try{i=await cZ(s)}catch{throw Error(`Session ${e} not found (no projects directory)`)}for(let a of i)if(await US(Ns(s,a,o),t))return;throw Error(`Session ${e} not found in any project directory`)}async function US(e,t,n){if(ye()&&n!==void 0)return rKe(n,t);let r;try{r=await X2e(e,sZ.O_WRONLY|sZ.O_APPEND)}catch(o){let s=ke(o);if(s==="ENOENT"||s==="ENOTDIR")return!1;throw o}try{let{size:o}=await r.stat();if(o===0)return!1;let s=process.platform==="win32"?o:void 0,i=Buffer.from(t,"utf8"),a=0;while(a<i.length){let{bytesWritten:c}=await r.write(i,a,i.length-a,s);if(c<=0)throw new Ze(`tryAppend: short write to ${e} stalled with ${i.length-a} bytes remaining`,"tryAppend: zero-progress short write");if(a+=c,s!==void 0)s+=c}return!0}finally{await r.close()}}async function rKe({backend:e,key:t},n){let r=await e.append(t,[{data:n}],{precondition:{type:"ifExists",nonEmpty:!0}});if(!r.ok){if(r.error.code==="NotFound")return!1;throw Error("Session append: transcript not writable via storage",{cause:r.error})}return!0}function $P(e,t,n){if(!ye()||n===void 0)return;let r=Za(e,n.isKeySegment);return r===void 0?void 0:{backend:n.backend,key:n.transcriptKey(r,t)}}import{randomUUID as FS}from"crypto";import{basename as oKe,join as rc}from"path";async function sKe(e,t,n){let r=`${e}.jsonl`,o=Sn(cr(n));async function s(c){let l=Sn(bo(rc(c,r),n));if(l!==void 0&&l.hoverRestOn)try{let u=await l.source.backend.read([l.source.key]);if(!u.ok)return null;let d=u.value.items[0];if(!d?.found)return null;if(d.value.byteLength===0){let f=await l.source.backend.statMeta(l.source.key);if(!f.ok||(f.value.storedBytes??f.value.size)===0)return null}return{buf:Buffer.from(d.value),projectDir:c}}catch{return null}try{let u=await Il().readBytes(rc(c,r));if(u.length===0)return null;return{buf:u,projectDir:c}}catch{return null}}if(t){let c=await Ps(t,am(n));for(let u of await ir(c,o)){let d=await s(u);if(d)return d}let l;try{l=await ks(c)}catch{l=[]}for(let u of l){if(u===c)continue;for(let d of await ir(u,o)){let f=await s(d);if(f)return f}}return null}let i=kt();if(o!==void 0&&o.hoverRestOn){let c=await ku(o.source);if(c!==null){for(let l of c){let u=await s(rc(i,l));if(u)return u}return null}}let a;try{a=await Il().list(i)}catch{return null}for(let c of a){let l=await s(rc(i,c));if(l)return l}return null}var iKe=new Set(["user","assistant","attachment","system","progress"]);function aKe(e,t){let n=[],r=[],o,s={historySuppressed:!1},i=10,a=e.length,c=0;while(c<a){let l=e.indexOf(10,c);if(l===-1)l=a;let u=c;while(u<l&&e[u]<=32)u++;if(c=l+1,u>=l)continue;let d=e.toString("utf-8",u,l);try{o=mZ(ft(d),t,n,r,s)??o}catch{}}return{transcript:n,contentReplacements:r,relocatedCwd:o,historySuppressed:s.historySuppressed,atisLatch:s.atisLatch}}function cKe(e,t){let n=[],r=[],o,s={historySuppressed:!1};for(let i of e){if(typeof i!=="object"||i===null)continue;o=mZ(i,t,n,r,s)??o}return{transcript:n,contentReplacements:r,relocatedCwd:o,historySuppressed:s.historySuppressed,atisLatch:s.atisLatch}}function mZ(e,t,n,r,o){if(iKe.has(e.type)&&typeof e.uuid==="string")n.push(e);else if(e.type==="history-suppression"){if(o)o.historySuppressed=!0}else if(e.type==="atis-latch"&&e.sessionId===t&&typeof e.atis==="string"&&/^[\x21-\x7e]*$/.test(e.atis)){if(o)o.atisLatch=e.atis}else if(e.type==="content-replacement"&&e.sessionId===t&&Array.isArray(e.replacements))r.push(...e.replacements);else if(e.type==="relocated"&&e.sessionId===t&&typeof e.relocatedCwd==="string"&&e.relocatedCwd!=="")return e.relocatedCwd;return}async function hZ(e,t={},n){let r=ye()?n:void 0;if(!Xe(e))throw new Ze(`Invalid sessionId: ${e}`,"forkSession: invalid sessionId (not a UUID)");if(t.upToMessageId&&!Xe(t.upToMessageId))throw new Ze(`Invalid upToMessageId: ${t.upToMessageId}`,"forkSession: invalid upToMessageId (not a UUID)");let o=await sKe(e,t.dir,r);if(!o)throw Error(t.dir?`Session ${e} not found in project directory for ${t.dir}`:`Session ${e} not found`);let s=await Du(rc(o.projectDir,`${e}.jsonl`),e,r),{entries:i,forkedSessionId:a}=uKe(o.buf,e,t,s);return await nm(rc(o.projectDir,`${a}.jsonl`),i,Sn(lKe(o.projectDir,a,cr(r)))),{sessionId:a}}function lKe(e,t,n){if(n===void 0)return;let r=oKe(e);if(rc(kt(),r)!==e||!n.isKeySegment(r)||!n.isKeySegment(t))return;return{backend:n.backend,key:n.transcriptKey(r,t)}}function uKe(e,t,n,r){let o=aKe(e,t);return _Z(o,t,n,()=>{let i=e.length,a=e.toString("utf-8",0,Math.min(i,zn)),c=e.toString("utf-8",Math.max(0,i-zn)),l=dn(c,"customTitle");return(l!==void 0?l:r??dn(a,"customTitle"))||dn(c,"aiTitle")||dn(a,"aiTitle")||nS(a)})}function gZ(e,t,n){let r=cKe(e,t);return _Z(r,t,n,()=>dKe(e))}function dKe(e){let t,n;for(let r of e){if(typeof r!=="object"||r===null)continue;let o=r;if(typeof o.customTitle==="string"&&o.customTitle)t=o.customTitle;if(typeof o.aiTitle==="string"&&o.aiTitle)n=o.aiTitle}return t||n||hq(e)||void 0}function _Z(e,t,n,r){let o=e.transcript.filter((f)=>!f.isSidechain);if(o.length===0)throw Error(`Session ${t} has no messages to fork`);if(n.upToMessageId){let f=o.findIndex((m)=>m.uuid===n.upToMessageId);if(f===-1)throw Error(`Message ${n.upToMessageId} not found in session ${t}`);o=o.slice(0,f+1)}let s=new Map;for(let f of o)s.set(f.uuid,FS());let i=o.filter((f)=>f.type!=="progress");if(i.length===0)throw Error(`Session ${t} has no messages to fork`);let a=new Map;for(let f of o)a.set(f.uuid,f);let c=FS(),l=new Date().toISOString(),u=[];if(e.historySuppressed)u.push(Tq(c,"fork_inherit"));for(let f=0;f<i.length;f++){let m=i[f],h=s.get(m.uuid),_=null,y=m.parentUuid;while(y){let D=a.get(y);if(!D)break;if(D.type!=="progress"){_=s.get(y)??null;break}y=D.parentUuid}let b=f===i.length-1?l:m.timestamp,v=m.logicalParentUuid==null?m.logicalParentUuid:s.get(m.logicalParentUuid)??null,S=m.type==="system"&&m.subtype==="model_refusal_fallback"?{neutralizedByFork:!0}:void 0,x=pKe(m,s),w={...m,...S,...x,uuid:h,parentUuid:_,logicalParentUuid:v,sessionId:c,timestamp:b,isSidechain:!1,teamName:void 0,agentName:void 0,sessionKind:void 0,slug:void 0,sourceToolAssistantUUID:void 0,forkedFrom:{sessionId:t,messageUuid:m.uuid}};u.push(w)}if(e.contentReplacements.length>0)u.push({type:"content-replacement",sessionId:c,replacements:e.contentReplacements,uuid:FS(),timestamp:l});if(e.atisLatch!==void 0)u.push({type:"atis-latch",sessionId:c,atis:e.atisLatch});if(e.relocatedCwd)u.push({type:"relocated",sessionId:c,relocatedCwd:e.relocatedCwd});let d=n.title?.trim();if(!d)d=`${r()||"Forked session"} (fork)`;return u.push({type:"custom-title",sessionId:c,customTitle:d,uuid:FS(),timestamp:l}),{entries:u,forkedSessionId:c}}function pKe(e,t){let n=e.attachment;if(e.type!=="attachment"||typeof n!=="object"||n===null||n.type!=="deferred_tools_record")return;let r=n.nameOnlyAnnouncements;if(!Array.isArray(r))return;return{attachment:{...n,nameOnlyAnnouncements:r.flatMap((o)=>typeof o==="string"&&t.has(o)?[t.get(o)]:[])}}}import{readdir as fKe,readFile as yZ}from"fs/promises";import{isAbsolute as SZ,join as $S,relative as bZ,sep as zS}from"path";async function EZ(e,t,n,r){let o=await Ci(e,t,cr(n),r);if(!o)return null;let s=o.filePath.replace(/\.jsonl$/,"");return $S(s,"subagents")}function xZ(e){let t=bZ(kt(),e);if(t===""||t.startsWith(`..${zS}`)||t===".."||SZ(t))return null;let n=t.split(zS);return n.length<4||n[2]!=="subagents"?null:n}function mKe(e){let t=xZ(e),n=t?.at(-1);if(!t||!n?.startsWith("agent-")||!n.endsWith(".jsonl"))return null;let r=n.slice(6,-6),o=t.slice(3,-1);if(!ar([t[0],t[1],r])||o.length>0&&!ar(o))return null;let s=tn.transcript(t[0],t[1],r,o.length>0?o:void 0);return Ds(s)===void 0?s:null}function hKe(e){let t=xZ(e);if(!t)return null;let n=t.slice(2);if(!ar([t[0],t[1]])||!ar(n))return null;let r=tn.sidecar(t[0],t[1],n);return Ds(r)===void 0?r:null}async function vZ(e,t){let n=ye()&&t!==void 0?gKe(e):null;if(t!==void 0&&n!==null)return yKe(t,n,e);let r=[];async function o(s){let i;try{i=await fKe(s,{withFileTypes:!0})}catch{return}for(let a of i)if(a.isFile()&&a.name.startsWith("agent-")&&a.name.endsWith(".jsonl")){let c=a.name.slice(6,-6);r.push({agentId:c,filePath:$S(s,a.name)})}else if(a.isDirectory())await o($S(s,a.name))}return await o(e),r}function gKe(e){let t=bZ(kt(),e);if(t===""||t.startsWith(`..${zS}`)||SZ(t))return null;let n=t.split(zS);if(n.length!==3||n[2]!=="subagents"||!ar([n[0],n[1]]))return null;let r={namespace:"transcript",projectKey:n[0],sessionId:n[1]};return aR(r)===void 0?r:null}var _Ke=1e4;async function yKe(e,t,n,r=_Ke){let o=[],s=[t],i=new Set([""]),a=0;try{while(s.length>0){if(++a>r)return[];let c=s.shift(),l=[];if((await yo((d)=>e.listEntries(c,{skipKeyStats:!0,skipScopeStats:!0,...d!==void 0&&{cursor:d}}),(d)=>{for(let f of d)if(f.kind==="key"&&f.key.namespace==="transcript"&&f.key.agentId!==void 0&&pn(f.key.agentId)&&(f.key.agentRelPath===void 0||ar(f.key.agentRelPath)))o.push({agentId:f.key.agentId,filePath:$S(n,...f.key.agentRelPath??[],`agent-${f.key.agentId}.jsonl`)});else if(f.kind==="scope"&&f.scope.namespace==="transcript"&&f.scope.agentRelPath!==void 0&&ar(f.scope.agentRelPath)&&!i.has(f.scope.agentRelPath.join("/"))){let m={...t,agentRelPath:f.scope.agentRelPath};if(aR(m)===void 0)i.add(f.scope.agentRelPath.join("/")),l.push(m)}})).status!=="done")return[];s.unshift(...l)}}catch{return[]}return o}function SKe(e){let t=[],n=10,r=e.length,o=0;while(o<r){let s=e.indexOf(10,o);if(s===-1)s=r;let i=o;while(i<s&&e[i]<=32)i++;if(o=s+1,i>=s)continue;let a=e.toString("utf-8",i,s);try{let c=ft(a),l=c.type;if((l==="user"||l==="assistant"||l==="attachment")&&typeof c.uuid==="string")t.push(c)}catch{}}return t}function bKe(e){if(e.length===0)return[];let t=new Map;for(let i of e)t.set(i.uuid,i);let n=e.findLast((i)=>i.type==="user"||i.type==="assistant");if(!n)return[];let r=[],o=new Set,s=n;while(s){if(o.has(s.uuid))break;o.add(s.uuid),r.push(s),s=s.parentUuid?t.get(s.parentUuid):void 0}return r.reverse(),r}async function wZ(e,t,n){if(!Xe(e))return[];let r=ye(),o=r?n:void 0,s=await EZ(e,t?.dir,o,r);if(!s)return[];return(await vZ(s,o)).map((a)=>a.agentId)}async function AZ(e,t,n,r){if(!Xe(e))return[];if(!t)return[];let o=ye(),s=o?r:void 0,i=await EZ(e,n?.dir,s,o);if(!i)return[];let c=(await vZ(i,s)).find((m)=>m.agentId===t);if(!c)return[];let l,u=s!==void 0?mKe(c.filePath):null;if(s!==void 0&&u!==null)try{let m=await s.read([u]),h=m.ok?m.value.items[0]:void 0;if(!h?.found)return[];l=Buffer.from(h.value)}catch{return[]}else try{l=await yZ(c.filePath)}catch{return[]}let d,f;try{let m=c.filePath.replace(/\.jsonl$/,".meta.json"),h=s!==void 0?hKe(m):null,_;if(s!==void 0&&h!==null){let b=await s.read([h]);if(!b.ok||!b.value.items[0]?.found)throw Error("sidecar absent");_=Buffer.from(b.value.items[0].value).toString("utf-8")}else _=await yZ(m,"utf-8");let y=ft(_);d=y.toolUseId,f=y.parentAgentId}catch{}return jP(l,n,d,f)}function jP(e,t,n,r){if(e.length===0)return[];let o=SKe(e),i=bKe(o).filter((a)=>a.type==="user"||a.type==="assistant").map((a)=>uR(a,n,r));return dR(i,t)}function jS(e){return["subagents",...e.agentRelPath??[],e.kind==="agent"?`agent-${e.agentId}`:"journal"].join("/")}async function HP(e,t,n,r,o,s=xKe){let i=[],a=0,c,l=!1;for(let u=0;u<s;u++){let d=await e.readRecords(t,{order:"forward",maxBytes:EKe,...c!==void 0&&{fromSeq:c}});if(!d.ok)throw new Ze(`importSessionToStore: transcript read failed (${d.error.code})`,"importSessionToStore: transcript read failed");for(let f of d.value.items){let m=Buffer.from(f.data.buffer,f.data.byteOffset,f.data.byteLength).toString("utf8").replace(/\r?\n$/,"");if(!m)continue;try{i.push(ft(m))}catch(h){ce(`importSessionToStore: skipping unparseable record ${f.seq}: ${h}`);continue}if(a+=m.length,i.length>=o||a>=_u)await r.append(n,i),i=[],a=0}if(c=d.value.nextSeq,c===void 0){l=!0;break}}if(!l)throw new Ze("importSessionToStore: transcript read did not end (page cap reached)","importSessionToStore: transcript read did not end");if(i.length>0)await r.append(n,i)}var EKe=67108864,xKe=1e5,vKe=1e4;async function kZ(e,t,n,r=vKe){let o=[],s=[{namespace:"transcript",projectKey:t,sessionId:n}],i=new Set([""]),a=new Set,c=0;while(s.length>0){if(++c>r)throw Error("importSessionToStore: subagent listing did not end (scope cap reached)");let l=s.shift(),u=[];if((await yo((f)=>e.listEntries(l,{skipKeyStats:!0,skipScopeStats:!0,...f!==void 0&&{cursor:f}}),(f)=>{for(let m of f)if(m.kind==="key"&&m.key.namespace==="transcript"){let h=m.key.agentRelPath;if(h!==void 0&&!ar(h))continue;let _=m.key.agentId!==void 0?pn(m.key.agentId)?{kind:"agent",agentId:m.key.agentId,...h&&{agentRelPath:h}}:void 0:m.key.journal===!0&&h!==void 0?{kind:"journal",agentRelPath:h}:void 0,y=_&&jS(_);if(_&&y!==void 0&&!a.has(y))a.add(y),o.push(_)}else if(m.kind==="scope"&&m.scope.namespace==="transcript"&&m.scope.agentRelPath!==void 0&&ar(m.scope.agentRelPath)&&!i.has(m.scope.agentRelPath.join("/")))i.add(m.scope.agentRelPath.join("/")),u.push({namespace:"transcript",projectKey:t,sessionId:n,agentRelPath:m.scope.agentRelPath})})).status!=="done")throw Error("importSessionToStore: subagent listing failed");s.unshift(...u)}return o}function wKe(e,t,n){return tn.sidecar(e,t,["subagents",...n.agentRelPath??[],n.kind==="agent"?`agent-${n.agentId}.meta.json`:"journal.meta.json"])}async function RZ(e,t,n,r){let o=r.map((a)=>({subpath:jS(a),key:wKe(t,n,a)})).filter(({key:a})=>Ds(a)===void 0),s=new Map;if(o.length===0)return s;let i=await e.readText(o.map(({key:a})=>a));if(i.ok)return i.value.items.forEach((a,c)=>{if(a.found)s.set(o[c].subpath,a.value)}),s;if(!TZ(i.error))throw CZ(i.error.code);for(let{subpath:a,key:c}of o){let l=await e.readText([c]);if(l.ok){if(l.value.items[0].found)s.set(a,l.value.items[0].value)}else if(!TZ(l.error))throw CZ(l.error.code)}return s}function TZ(e){return e.code==="Failed"&&(e.telemetryCode==="ELOOP"||e.telemetryCode==="ENXIO")}function CZ(e){return new Ze(`importSessionToStore: sidecar read failed (${e})`,"importSessionToStore: sidecar read failed")}import{copyFile as AKe,readFile as TKe,rm as PZ,writeFile as IZ}from"fs/promises";import{homedir as OZ}from"os";import{join as BP}from"path";function DZ(e){return{globalConfig:BP(e||OZ(),".claude.json"),userSettings:BP(e||BP(OZ(),".claude"),"settings.json")}}function KP(e,t,n,r){return e!==void 0&&t===n?{backend:e,key:r}:void 0}async function HS(e,t,n,r){if(r)return CKe(r,e,t,n);try{if(n)await IZ(t,n(await TKe(e)),{mode:384});else await AKe(e,t)}catch(o){if(ke(o)===void 0)throw o;if(!rr(o))await PZ(t,{force:!0}).catch(()=>{}),ce(`sessionStore resume: skipping ${e} (${ke(o)})`)}}async function CKe({backend:e,key:t},n,r,o){let s=await e.read([t]);if(!s.ok){if(s.error.code==="InvalidArgument")throw new Ze(`sessionStore resume: invalid v5 key for ${n}: ${s.error.argument}${s.error.reason?` (${s.error.reason})`:""}`,"sessionStore resume: invalid v5 key (InvalidArgument from backend read)");ce(`sessionStore resume: skipping ${n} (${s.error.code})`);return}let i=s.value.items[0];if(!i?.found)return;let a=Buffer.from(i.value);try{await IZ(r,o?o(a):a,{mode:384})}catch(c){if(ke(c)===void 0)throw c;if(!rr(c))await PZ(r,{force:!0}).catch(()=>{}),ce(`sessionStore resume: skipping ${n} (${ke(c)})`)}}import{createHash as kKe}from"crypto";import{homedir as SFt,userInfo as RKe}from"os";var LZ="-credentials";function NZ(e=""){let t=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,n=t!==void 0?!t:!process.env.CLAUDE_CONFIG_DIR,r=t!==void 0?t.normalize("NFC"):Wt(),o=n?"":`-${kKe("sha256").update(r).digest("hex").substring(0,8)}`;return`Claude Code${sz().OAUTH_FILE_SUFFIX}${e}${o}`}var OKe=/^[a-zA-Z0-9._-]+$/;function MZ(){if(process.platform==="win32")return"claude-code-user";let e;try{e=process.env.USER||RKe().username}catch{e="claude-code-user"}if(!OKe.test(e))return"claude-code-user";return e}class UZ{cache={data:null,cachedAt:0};generation=0;readInFlight=null;lastReadFailure=null;lastKnown=null;legacyApiKeyPrefetch=null}var wFt=new Je(()=>new UZ);function PKe(e,t){if(e==="bypassPermissions")return"canUseTool will not be invoked: permissionMode 'bypassPermissions' auto-approves every tool call (except explicit deny rules) before the callback is consulted. To gate every tool call, use a PreToolUse hook instead.";let n=t.filter((r)=>r.length>0&&!r.includes("("));if(n.length===0)return;return`canUseTool will not be invoked for: ${n.join(", ")}. Bare allowedTools entries auto-approve the whole tool before the callback is consulted. To gate every tool call, use a PreToolUse hook; or remove the bare names from allowedTools so they fall through to canUseTool. Allow rules from settings files can also shadow the callback but are not visible here.`}function FZ(e,t,n){if(!e)return;let r=PKe(t,n);if(r===void 0)return;process.emitWarning(r,{code:"CLAUDE_SDK_CAN_USE_TOOL_SHADOWED"})}var DKe=I("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");at.init(e,t),e.def=t,e.type=t.type,e.parse=(n,r)=>gS(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>ec(e,n,r),e.parseAsync=async(n,r)=>_S(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>tc(e,n,r),e.check=(...n)=>e.clone({...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)=>ur(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.apply=(n)=>n(e)});var LKe=I("ZodMiniObject",(e,t)=>{XR.init(e,t),DKe.init(e,t),Fe(e,"shape",()=>t.shape)});function GP(e,t){let n={type:"object",shape:e??{},...oe(t)};return new LKe(n)}function qr(e){return!!e._zod}function oc(e){let t=Object.values(e);if(t.length===0)return GP({});let n=t.every(qr),r=t.every((o)=>!qr(o));if(n)return GP(e);if(r)return J$(e);throw Error("Mixed Zod versions detected in object shape.")}function Di(e,t){if(qr(e))return ec(e,t);return e.safeParse(t)}async function BS(e,t){if(qr(e))return await tc(e,t);return await e.safeParseAsync(t)}function Li(e){if(!e)return;let t;if(qr(e))t=e._zod?.def?.shape;else t=e.shape;if(!t)return;if(typeof t==="function")try{return t()}catch{return}return t}function Nu(e){if(!e)return;if(typeof e==="object"){let t=e,n=e;if(!t._def&&!n._zod){let r=Object.values(e);if(r.length>0&&r.every((o)=>typeof o==="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse==="function")))return oc(e)}}if(qr(e)){let n=e._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return e}else if(e.shape!==void 0)return e;return}function KS(e){if(e&&typeof e==="object"){if("message"in e&&typeof e.message==="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t==="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function $Z(e){return e.description}function zZ(e){if(qr(e))return e._zod?.def?.type==="optional";let t=e;if(typeof e.isOptional==="function")return e.isOptional();return t._def?.typeName==="ZodOptional"}function GS(e){if(qr(e)){let s=e._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let 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]}let r=e.value;if(r!==void 0)return r;return}var WP="2025-11-25";var jZ=[WP,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ni="io.modelcontextprotocol/related-task",VS="2.0",rn=K3((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),HZ=ue([g(),X().int()]),BZ=g(),GFt=nn({ttl:X().optional(),pollInterval:X().optional()}),MKe=T({ttl:X().optional()}),UKe=T({taskId:g()}),VP=nn({progressToken:HZ.optional(),[Ni]:UKe.optional()}),Pr=T({_meta:VP.optional()}),km=Pr.extend({task:MKe.optional()}),KZ=(e)=>km.safeParse(e).success,bn=T({method:g(),params:Pr.loose().optional()}),Zr=T({_meta:VP.optional()}),Yr=T({method:g(),params:Zr.loose().optional()}),En=nn({_meta:VP.optional()}),qS=ue([g(),X().int()]),GZ=T({jsonrpc:j(VS),id:qS,...bn.shape}).strict(),qP=(e)=>GZ.safeParse(e).success,WZ=T({jsonrpc:j(VS),...Yr.shape}).strict(),VZ=(e)=>WZ.safeParse(e).success,ZP=T({jsonrpc:j(VS),id:qS,result:En}).strict(),Rm=(e)=>ZP.safeParse(e).success;var fe;(function(e){e[e.ConnectionClosed=-32000]="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"})(fe||(fe={}));var YP=T({jsonrpc:j(VS),id:qS.optional(),error:T({code:X().int(),message:g(),data:Te().optional()})}).strict();var qZ=(e)=>YP.safeParse(e).success;var WFt=ue([GZ,WZ,ZP,YP]),VFt=ue([ZP,YP]),ZS=En.strict(),FKe=Zr.extend({requestId:qS.optional(),reason:g().optional()}),YS=Yr.extend({method:j("notifications/cancelled"),params:FKe}),$Ke=T({src:g(),mimeType:g().optional(),sizes:N(g()).optional(),theme:V(["light","dark"]).optional()}),Om=T({icons:N($Ke).optional()}),Mu=T({name:g(),title:g().optional()}),ZZ=Mu.extend({...Mu.shape,...Om.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),zKe=IS(T({applyDefaults:R().optional()}),Z(g(),Te())),jKe=tt((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},IS(T({form:zKe.optional(),url:rn.optional()}),Z(g(),Te()).optional())),HKe=nn({list:rn.optional(),cancel:rn.optional(),requests:nn({sampling:nn({createMessage:rn.optional()}).optional(),elicitation:nn({create:rn.optional()}).optional()}).optional()}),BKe=nn({list:rn.optional(),cancel:rn.optional(),requests:nn({tools:nn({call:rn.optional()}).optional()}).optional()}),KKe=T({experimental:Z(g(),rn).optional(),sampling:T({context:rn.optional(),tools:rn.optional()}).optional(),elicitation:jKe.optional(),roots:T({listChanged:R().optional()}).optional(),tasks:HKe.optional(),extensions:Z(g(),rn).optional()}),GKe=Pr.extend({protocolVersion:g(),capabilities:KKe,clientInfo:ZZ}),JP=bn.extend({method:j("initialize"),params:GKe});var WKe=T({experimental:Z(g(),rn).optional(),logging:rn.optional(),completions:rn.optional(),prompts:T({listChanged:R().optional()}).optional(),resources:T({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:T({listChanged:R().optional()}).optional(),tasks:BKe.optional(),extensions:Z(g(),rn).optional()}),VKe=En.extend({protocolVersion:g(),capabilities:WKe,serverInfo:ZZ,instructions:g().optional()}),XP=Yr.extend({method:j("notifications/initialized"),params:Zr.optional()});var JS=bn.extend({method:j("ping"),params:Pr.optional()}),qKe=T({progress:X(),total:Ot(X()),message:Ot(g())}),ZKe=T({...Zr.shape,...qKe.shape,progressToken:HZ}),XS=Yr.extend({method:j("notifications/progress"),params:ZKe}),YKe=Pr.extend({cursor:BZ.optional()}),Pm=bn.extend({params:YKe.optional()}),Im=En.extend({nextCursor:BZ.optional()}),JKe=V(["working","input_required","completed","failed","cancelled"]),Dm=T({taskId:g(),status:JKe,ttl:ue([X(),M3()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:Ot(X()),statusMessage:Ot(g())}),Uu=En.extend({task:Dm}),XKe=Zr.merge(Dm),Lm=Yr.extend({method:j("notifications/tasks/status"),params:XKe}),QS=bn.extend({method:j("tasks/get"),params:Pr.extend({taskId:g()})}),eb=En.merge(Dm),tb=bn.extend({method:j("tasks/result"),params:Pr.extend({taskId:g()})}),qFt=En.loose(),nb=Pm.extend({method:j("tasks/list")}),rb=Im.extend({tasks:N(Dm)}),ob=bn.extend({method:j("tasks/cancel"),params:Pr.extend({taskId:g()})}),YZ=En.merge(Dm),JZ=T({uri:g(),mimeType:Ot(g()),_meta:Z(g(),Te()).optional()}),XZ=JZ.extend({text:g()}),QP=g().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),QZ=JZ.extend({blob:QP}),Nm=V(["user","assistant"]),Fu=T({audience:N(Nm).optional(),priority:X().min(0).max(1).optional(),lastModified:RP({offset:!0}).optional()}),e9=T({...Mu.shape,...Om.shape,uri:g(),description:Ot(g()),mimeType:Ot(g()),size:Ot(X()),annotations:Fu.optional(),_meta:Ot(nn({}))}),QKe=T({...Mu.shape,...Om.shape,uriTemplate:g(),description:Ot(g()),mimeType:Ot(g()),annotations:Fu.optional(),_meta:Ot(nn({}))}),sb=Pm.extend({method:j("resources/list")}),eGe=Im.extend({resources:N(e9)}),ib=Pm.extend({method:j("resources/templates/list")}),tGe=Im.extend({resourceTemplates:N(QKe)}),eI=Pr.extend({uri:g()}),nGe=eI,ab=bn.extend({method:j("resources/read"),params:nGe}),rGe=En.extend({contents:N(ue([XZ,QZ]))}),oGe=Yr.extend({method:j("notifications/resources/list_changed"),params:Zr.optional()}),sGe=eI,iGe=bn.extend({method:j("resources/subscribe"),params:sGe}),aGe=eI,cGe=bn.extend({method:j("resources/unsubscribe"),params:aGe}),lGe=Zr.extend({uri:g()}),uGe=Yr.extend({method:j("notifications/resources/updated"),params:lGe}),dGe=T({name:g(),description:Ot(g()),required:Ot(R())}),pGe=T({...Mu.shape,...Om.shape,description:Ot(g()),arguments:Ot(N(dGe)),_meta:Ot(nn({}))}),cb=Pm.extend({method:j("prompts/list")}),fGe=Im.extend({prompts:N(pGe)}),mGe=Pr.extend({name:g(),arguments:Z(g(),g()).optional()}),lb=bn.extend({method:j("prompts/get"),params:mGe}),tI=T({type:j("text"),text:g(),annotations:Fu.optional(),_meta:Z(g(),Te()).optional()}),nI=T({type:j("image"),data:QP,mimeType:g(),annotations:Fu.optional(),_meta:Z(g(),Te()).optional()}),rI=T({type:j("audio"),data:QP,mimeType:g(),annotations:Fu.optional(),_meta:Z(g(),Te()).optional()}),hGe=T({type:j("tool_use"),name:g(),id:g(),input:Z(g(),Te()),_meta:Z(g(),Te()).optional()}),gGe=T({type:j("resource"),resource:ue([XZ,QZ]),annotations:Fu.optional(),_meta:Z(g(),Te()).optional()}),_Ge=e9.extend({type:j("resource_link")}),oI=ue([tI,nI,rI,_Ge,gGe]),yGe=T({role:Nm,content:oI}),SGe=En.extend({description:g().optional(),messages:N(yGe)}),bGe=Yr.extend({method:j("notifications/prompts/list_changed"),params:Zr.optional()}),EGe=T({title:g().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),xGe=T({taskSupport:V(["required","optional","forbidden"]).optional()}),t9=T({...Mu.shape,...Om.shape,description:g().optional(),inputSchema:T({type:j("object"),properties:Z(g(),rn).optional(),required:N(g()).optional()}).catchall(Te()),outputSchema:T({type:j("object"),properties:Z(g(),rn).optional(),required:N(g()).optional()}).catchall(Te()).optional(),annotations:EGe.optional(),execution:xGe.optional(),_meta:Z(g(),Te()).optional()}),ub=Pm.extend({method:j("tools/list")}),vGe=Im.extend({tools:N(t9)}),db=En.extend({content:N(oI).default([]),structuredContent:Z(g(),Te()).optional(),isError:R().optional()}),ZFt=db.or(En.extend({toolResult:Te()})),wGe=km.extend({name:g(),arguments:Z(g(),Te()).optional()}),$u=bn.extend({method:j("tools/call"),params:wGe}),AGe=Yr.extend({method:j("notifications/tools/list_changed"),params:Zr.optional()}),YFt=T({autoRefresh:R().default(!0),debounceMs:X().int().nonnegative().default(300)}),Mm=V(["debug","info","notice","warning","error","critical","alert","emergency"]),TGe=Pr.extend({level:Mm}),sI=bn.extend({method:j("logging/setLevel"),params:TGe}),CGe=Zr.extend({level:Mm,logger:g().optional(),data:Te()}),kGe=Yr.extend({method:j("notifications/message"),params:CGe}),RGe=T({name:g().optional()}),OGe=T({hints:N(RGe).optional(),costPriority:X().min(0).max(1).optional(),speedPriority:X().min(0).max(1).optional(),intelligencePriority:X().min(0).max(1).optional()}),PGe=T({mode:V(["auto","required","none"]).optional()}),IGe=T({type:j("tool_result"),toolUseId:g().describe("The unique identifier for the corresponding tool call."),content:N(oI).default([]),structuredContent:T({}).loose().optional(),isError:R().optional(),_meta:Z(g(),Te()).optional()}),DGe=nc("type",[tI,nI,rI]),WS=nc("type",[tI,nI,rI,hGe,IGe]),LGe=T({role:Nm,content:ue([WS,N(WS)]),_meta:Z(g(),Te()).optional()}),NGe=km.extend({messages:N(LGe),modelPreferences:OGe.optional(),systemPrompt:g().optional(),includeContext:V(["none","thisServer","allServers"]).optional(),temperature:X().optional(),maxTokens:X().int(),stopSequences:N(g()).optional(),metadata:rn.optional(),tools:N(t9).optional(),toolChoice:PGe.optional()}),MGe=bn.extend({method:j("sampling/createMessage"),params:NGe}),Um=En.extend({model:g(),stopReason:Ot(V(["endTurn","stopSequence","maxTokens"]).or(g())),role:Nm,content:DGe}),iI=En.extend({model:g(),stopReason:Ot(V(["endTurn","stopSequence","maxTokens","toolUse"]).or(g())),role:Nm,content:ue([WS,N(WS)])}),UGe=T({type:j("boolean"),title:g().optional(),description:g().optional(),default:R().optional()}),FGe=T({type:j("string"),title:g().optional(),description:g().optional(),minLength:X().optional(),maxLength:X().optional(),format:V(["email","uri","date","date-time"]).optional(),default:g().optional()}),$Ge=T({type:V(["number","integer"]),title:g().optional(),description:g().optional(),minimum:X().optional(),maximum:X().optional(),default:X().optional()}),zGe=T({type:j("string"),title:g().optional(),description:g().optional(),enum:N(g()),default:g().optional()}),jGe=T({type:j("string"),title:g().optional(),description:g().optional(),oneOf:N(T({const:g(),title:g()})),default:g().optional()}),HGe=T({type:j("string"),title:g().optional(),description:g().optional(),enum:N(g()),enumNames:N(g()).optional(),default:g().optional()}),BGe=ue([zGe,jGe]),KGe=T({type:j("array"),title:g().optional(),description:g().optional(),minItems:X().optional(),maxItems:X().optional(),items:T({type:j("string"),enum:N(g())}),default:N(g()).optional()}),GGe=T({type:j("array"),title:g().optional(),description:g().optional(),minItems:X().optional(),maxItems:X().optional(),items:T({anyOf:N(T({const:g(),title:g()}))}),default:N(g()).optional()}),WGe=ue([KGe,GGe]),VGe=ue([HGe,BGe,WGe]),qGe=ue([VGe,UGe,FGe,$Ge]),ZGe=km.extend({mode:j("form").optional(),message:g(),requestedSchema:T({type:j("object"),properties:Z(g(),qGe),required:N(g()).optional()})}),YGe=km.extend({mode:j("url"),message:g(),elicitationId:g(),url:g().url()}),JGe=ue([ZGe,YGe]),XGe=bn.extend({method:j("elicitation/create"),params:JGe}),QGe=Zr.extend({elicitationId:g()}),eWe=Yr.extend({method:j("notifications/elicitation/complete"),params:QGe}),zu=En.extend({action:V(["accept","decline","cancel"]),content:tt((e)=>e===null?void 0:e,Z(g(),ue([g(),X(),R(),N(g())])).optional())}),tWe=T({type:j("ref/resource"),uri:g()});var nWe=T({type:j("ref/prompt"),name:g()}),rWe=Pr.extend({ref:ue([nWe,tWe]),argument:T({name:g(),value:g()}),context:T({arguments:Z(g(),g()).optional()}).optional()}),pb=bn.extend({method:j("completion/complete"),params:rWe});function n9(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function r9(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var oWe=En.extend({completion:nn({values:N(g()).max(100),total:Ot(X().int()),hasMore:Ot(R())})}),sWe=T({uri:g().startsWith("file://"),name:g().optional(),_meta:Z(g(),Te()).optional()}),iWe=bn.extend({method:j("roots/list"),params:Pr.optional()}),aI=En.extend({roots:N(sWe)}),aWe=Yr.extend({method:j("notifications/roots/list_changed"),params:Zr.optional()}),JFt=ue([JS,JP,pb,sI,lb,cb,sb,ib,ab,iGe,cGe,$u,ub,QS,tb,nb,ob]),XFt=ue([YS,XS,XP,aWe,Lm]),QFt=ue([ZS,Um,iI,zu,aI,eb,rb,Uu]),e$t=ue([JS,MGe,XGe,iWe,QS,tb,nb,ob]),t$t=ue([YS,XS,kGe,uGe,oGe,AGe,bGe,Lm,eWe]),n$t=ue([ZS,VKe,oWe,SGe,fGe,eGe,tGe,rGe,db,vGe,eb,rb,Uu]);class de extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`);this.code=e,this.data=n,this.name="McpError"}static fromError(e,t,n){if(e===fe.UrlElicitationRequired&&n){let r=n;if(r.elicitations)return new o9(r.elicitations,t)}return new de(e,t,n)}}class o9 extends de{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(fe.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function Mi(e){return e==="completed"||e==="failed"||e==="cancelled"}var i9=Symbol("Let zodToJsonSchema decide on which parser to use");var s9={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},a9=(e)=>typeof e==="string"?{...s9,name:e}:{...s9,...e};var c9=(e)=>{let t=a9(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function cI(e,t,n,r){if(!r?.errorMessages)return;if(n)e.errorMessage={...e.errorMessage,[t]:n}}function je(e,t,n,r,o){e[t]=n,cI(e,t,r,o)}var fb=(e,t)=>{let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!==t[n])break;return[(e.length-n).toString(),...t.slice(n)].join("/")};function Pt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?fb(t,e.currentPath):t.join("/")}}function l9(e,t){let n={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==K.ZodAny)n.items=ge(e.type._def,{...t,currentPath:[...t.currentPath,"items"]});if(e.minLength)je(n,"minItems",e.minLength.value,e.minLength.message,t);if(e.maxLength)je(n,"maxItems",e.maxLength.value,e.maxLength.message,t);if(e.exactLength)je(n,"minItems",e.exactLength.value,e.exactLength.message,t),je(n,"maxItems",e.exactLength.value,e.exactLength.message,t);return n}function u9(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"min":if(t.target==="jsonSchema7")if(r.inclusive)je(n,"minimum",r.value,r.message,t);else je(n,"exclusiveMinimum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMinimum=!0;je(n,"minimum",r.value,r.message,t)}break;case"max":if(t.target==="jsonSchema7")if(r.inclusive)je(n,"maximum",r.value,r.message,t);else je(n,"exclusiveMaximum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMaximum=!0;je(n,"maximum",r.value,r.message,t)}break;case"multipleOf":je(n,"multipleOf",r.value,r.message,t);break}return n}function d9(){return{type:"boolean"}}function mb(e,t){return ge(e.type._def,t)}var p9=(e,t)=>ge(e.innerType._def,t);function lI(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((o,s)=>lI(e,t,o))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return cWe(e,t)}}var cWe=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let r of e.checks)switch(r.kind){case"min":je(n,"minimum",r.value,r.message,t);break;case"max":je(n,"maximum",r.value,r.message,t);break}return n};function f9(e,t){return{...ge(e.innerType._def,t),default:e.defaultValue()}}function m9(e,t){return t.effectStrategy==="input"?ge(e.schema._def,t):Pt(t)}function h9(e){return{type:"string",enum:Array.from(e.values)}}var lWe=(e)=>{if("type"in e&&e.type==="string")return!1;return"allOf"in e};function g9(e,t){let n=[ge(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ge(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((s)=>!!s),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return n.forEach((s)=>{if(lWe(s)){if(o.push(...s.allOf),s.unevaluatedProperties===void 0)r=void 0}else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:a,...c}=s;i=c}else r=void 0;o.push(i)}}),o.length?{allOf:o,...r}:void 0}function _9(e,t){let n=typeof e.value;if(n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string")return{type:Array.isArray(e.value)?"array":"object"};if(t.target==="openApi3")return{type:n==="bigint"?"integer":n,enum:[e.value]};return{type:n==="bigint"?"integer":n,const:e.value}}var uI=void 0,Ao={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(uI===void 0)uI=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return uI},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function hb(e,t){let n={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case"min":je(n,"minLength",typeof n.minLength==="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":je(n,"maxLength",typeof n.maxLength==="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":To(n,"email",r.message,t);break;case"format:idn-email":To(n,"idn-email",r.message,t);break;case"pattern:zod":Hn(n,Ao.email,r.message,t);break}break;case"url":To(n,"uri",r.message,t);break;case"uuid":To(n,"uuid",r.message,t);break;case"regex":Hn(n,r.regex,r.message,t);break;case"cuid":Hn(n,Ao.cuid,r.message,t);break;case"cuid2":Hn(n,Ao.cuid2,r.message,t);break;case"startsWith":Hn(n,RegExp(`^${dI(r.value,t)}`),r.message,t);break;case"endsWith":Hn(n,RegExp(`${dI(r.value,t)}$`),r.message,t);break;case"datetime":To(n,"date-time",r.message,t);break;case"date":To(n,"date",r.message,t);break;case"time":To(n,"time",r.message,t);break;case"duration":To(n,"duration",r.message,t);break;case"length":je(n,"minLength",typeof n.minLength==="number"?Math.max(n.minLength,r.value):r.value,r.message,t),je(n,"maxLength",typeof n.maxLength==="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":{Hn(n,RegExp(dI(r.value,t)),r.message,t);break}case"ip":{if(r.version!=="v6")To(n,"ipv4",r.message,t);if(r.version!=="v4")To(n,"ipv6",r.message,t);break}case"base64url":Hn(n,Ao.base64url,r.message,t);break;case"jwt":Hn(n,Ao.jwt,r.message,t);break;case"cidr":{if(r.version!=="v6")Hn(n,Ao.ipv4Cidr,r.message,t);if(r.version!=="v4")Hn(n,Ao.ipv6Cidr,r.message,t);break}case"emoji":Hn(n,Ao.emoji(),r.message,t);break;case"ulid":{Hn(n,Ao.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{To(n,"binary",r.message,t);break}case"contentEncoding:base64":{je(n,"contentEncoding","base64",r.message,t);break}case"pattern:zod":{Hn(n,Ao.base64,r.message,t);break}}break}case"nanoid":Hn(n,Ao.nanoid,r.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:((o)=>{})(r)}return n}function dI(e,t){return t.patternStrategy==="escape"?dWe(e):e}var uWe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dWe(e){let t="";for(let n=0;n<e.length;n++){if(!uWe.has(e[n]))t+="\\";t+=e[n]}return t}function To(e,t,n,r){if(e.format||e.anyOf?.some((o)=>o.format)){if(!e.anyOf)e.anyOf=[];if(e.format){if(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage){if(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})}else je(e,"format",t,n,r)}function Hn(e,t,n,r){if(e.pattern||e.allOf?.some((o)=>o.pattern)){if(!e.allOf)e.allOf=[];if(e.pattern){if(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage){if(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.allOf.push({pattern:y9(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})}else je(e,"pattern",y9(t,r),n,r)}function y9(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",s=!1,i=!1,a=!1;for(let c=0;c<r.length;c++){if(s){o+=r[c],s=!1;continue}if(n.i){if(i){if(r[c].match(/[a-z]/)){if(a)o+=r[c],o+=`${r[c-2]}-${r[c]}`.toUpperCase(),a=!1;else if(r[c+1]==="-"&&r[c+2]?.match(/[a-z]/))o+=r[c],a=!0;else o+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){o+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(n.m){if(r[c]==="^"){o+=`(^|(?<=[\r
203
+ ]))`;continue}else if(r[c]==="$"){o+=`($|(?=[\r
204
+ ]))`;continue}}if(n.s&&r[c]==="."){o+=i?`${r[c]}\r
205
+ `:`[${r[c]}\r
206
+ ]`;continue}if(o+=r[c],r[c]==="\\")s=!0;else if(i&&r[c]==="]")i=!1;else if(!i&&r[c]==="[")i=!0}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function gb(e,t){if(t.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(t.target==="openApi3"&&e.keyType?._def.typeName===K.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,o)=>({...r,[o]:ge(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??Pt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let n={type:"object",additionalProperties:ge(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===K.ZodString&&e.keyType._def.checks?.length){let{type:r,...o}=hb(e.keyType._def,t);return{...n,propertyNames:o}}else if(e.keyType?._def.typeName===K.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===K.ZodBranded&&e.keyType._def.type._def.typeName===K.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...o}=mb(e.keyType._def,t);return{...n,propertyNames:o}}return n}function S9(e,t){if(t.mapStrategy==="record")return gb(e,t);let n=ge(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Pt(t),r=ge(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Pt(t);return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function b9(e){let t=e.values,r=Object.keys(e.values).filter((s)=>typeof t[t[s]]!=="number").map((s)=>t[s]),o=Array.from(new Set(r.map((s)=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:r}}function E9(e){return e.target==="openAi"?void 0:{not:Pt({...e,currentPath:[...e.currentPath,"not"]})}}function x9(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Fm={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function w9(e,t){if(t.target==="openApi3")return v9(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((r)=>(r._def.typeName in Fm)&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((o,s)=>{let i=Fm[s._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:r.length>1?r:r[0]}}else if(n.every((r)=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((o,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(r.length===n.length){let o=r.filter((s,i,a)=>a.indexOf(s)===i);return{type:o.length>1?o:o[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every((r)=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,o)=>[...r,...o._def.values.filter((s)=>!r.includes(s))],[])};return v9(e,t)}var v9=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,o)=>ge(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter((r)=>!!r&&(!t.strictUnions||typeof r==="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function A9(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(t.target==="openApi3")return{type:Fm[e.innerType._def.typeName],nullable:!0};return{type:[Fm[e.innerType._def.typeName],"null"]}}if(t.target==="openApi3"){let r=ge(e.innerType._def,{...t,currentPath:[...t.currentPath]});if(r&&"$ref"in r)return{allOf:[r],nullable:!0};return r&&{...r,nullable:!0}}let n=ge(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function T9(e,t){let n={type:"number"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"int":n.type="integer",cI(n,"type",r.message,t);break;case"min":if(t.target==="jsonSchema7")if(r.inclusive)je(n,"minimum",r.value,r.message,t);else je(n,"exclusiveMinimum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMinimum=!0;je(n,"minimum",r.value,r.message,t)}break;case"max":if(t.target==="jsonSchema7")if(r.inclusive)je(n,"maximum",r.value,r.message,t);else je(n,"exclusiveMaximum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMaximum=!0;je(n,"maximum",r.value,r.message,t)}break;case"multipleOf":je(n,"multipleOf",r.value,r.message,t);break}return n}function C9(e,t){let n=t.target==="openAi",r={type:"object",properties:{}},o=[],s=e.shape();for(let a in s){let c=s[a];if(c===void 0||c._def===void 0)continue;let l=fWe(c);if(l&&n){if(c._def.typeName==="ZodOptional")c=c._def.innerType;if(!c.isNullable())c=c.nullable();l=!1}let u=ge(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});if(u===void 0)continue;if(r.properties[a]=u,!l)o.push(a)}if(o.length)r.required=o;let i=pWe(e,t);if(i!==void 0)r.additionalProperties=i;return r}function pWe(e,t){if(e.catchall._def.typeName!=="ZodNever")return ge(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function fWe(e){try{return e.isOptional()}catch{return!0}}var k9=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return ge(e.innerType._def,t);let n=ge(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Pt(t)},n]}:Pt(t)};var R9=(e,t)=>{if(t.pipeStrategy==="input")return ge(e.in._def,t);else if(t.pipeStrategy==="output")return ge(e.out._def,t);let n=ge(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=ge(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter((o)=>o!==void 0)}};function O9(e,t){return ge(e.type._def,t)}function P9(e,t){let r={type:"array",uniqueItems:!0,items:ge(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};if(e.minSize)je(r,"minItems",e.minSize.value,e.minSize.message,t);if(e.maxSize)je(r,"maxItems",e.maxSize.value,e.maxSize.message,t);return r}function I9(e,t){if(e.rest)return{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>ge(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ge(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})};else return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>ge(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function D9(e){return{not:Pt(e)}}function L9(e){return Pt(e)}var N9=(e,t)=>ge(e.innerType._def,t);var M9=(e,t,n)=>{switch(t){case K.ZodString:return hb(e,n);case K.ZodNumber:return T9(e,n);case K.ZodObject:return C9(e,n);case K.ZodBigInt:return u9(e,n);case K.ZodBoolean:return d9();case K.ZodDate:return lI(e,n);case K.ZodUndefined:return D9(n);case K.ZodNull:return x9(n);case K.ZodArray:return l9(e,n);case K.ZodUnion:case K.ZodDiscriminatedUnion:return w9(e,n);case K.ZodIntersection:return g9(e,n);case K.ZodTuple:return I9(e,n);case K.ZodRecord:return gb(e,n);case K.ZodLiteral:return _9(e,n);case K.ZodEnum:return h9(e);case K.ZodNativeEnum:return b9(e);case K.ZodNullable:return A9(e,n);case K.ZodOptional:return k9(e,n);case K.ZodMap:return S9(e,n);case K.ZodSet:return P9(e,n);case K.ZodLazy:return()=>e.getter()._def;case K.ZodPromise:return O9(e,n);case K.ZodNaN:case K.ZodNever:return E9(n);case K.ZodEffects:return m9(e,n);case K.ZodAny:return Pt(n);case K.ZodUnknown:return L9(n);case K.ZodDefault:return f9(e,n);case K.ZodBranded:return mb(e,n);case K.ZodReadonly:return N9(e,n);case K.ZodCatch:return p9(e,n);case K.ZodPipeline:return R9(e,n);case K.ZodFunction:case K.ZodVoid:case K.ZodSymbol:return;default:return((r)=>{return})(t)}};function ge(e,t,n=!1){let r=t.seen.get(e);if(t.override){let a=t.override?.(e,t,r,n);if(a!==i9)return a}if(r&&!n){let a=mWe(r,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let s=M9(e,e.typeName,t),i=typeof s==="function"?ge(s(),t):s;if(i)hWe(e,t,i);if(t.postProcess){let a=t.postProcess(i,e,t);return o.jsonSchema=i,a}return o.jsonSchema=i,i}var mWe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:fb(t.currentPath,e.path)};case"none":case"seen":{if(e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Pt(t);return t.$refStrategy==="seen"?Pt(t):void 0}}},hWe=(e,t,n)=>{if(e.description){if(n.description=e.description,t.markdownDescription)n.markdownDescription=e.description}return n};var pI=(e,t)=>{let n=c9(t),r=typeof t==="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,u])=>({...c,[l]:ge(u._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0)??Pt(n)}),{}):void 0,o=typeof t==="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=ge(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1)??Pt(n),i=typeof t==="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;if(i!==void 0)s.title=i;if(n.flags.hasReferencedOpenAiAnyType){if(!r)r={};if(!r[n.openAiAnyTypeName])r[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}}let a=o===void 0?r?{...s,[n.definitionPath]:r}:s:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:s}};if(n.target==="jsonSchema7")a.$schema="http://json-schema.org/draft-07/schema#";else if(n.target==="jsonSchema2019-09"||n.target==="openAi")a.$schema="https://json-schema.org/draft/2019-09/schema#";if(n.target==="openAi"&&(("anyOf"in a)||("oneOf"in a)||("allOf"in a)||("type"in a)&&Array.isArray(a.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return a};function gWe(e){if(!e)return"draft-7";if(e==="jsonSchema7"||e==="draft-7")return"draft-7";if(e==="jsonSchema2019-09"||e==="draft-2020-12")return"draft-2020-12";return"draft-7"}function fI(e,t){if(qr(e))return kP(e,{target:gWe(t?.target),io:t?.pipeStrategy??"input"});return pI(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function mI(e){let n=Li(e)?.method;if(!n)throw Error("Schema is missing a method literal");let r=GS(n);if(typeof r!=="string")throw Error("Schema method literal must be a string");return r}function hI(e,t){let n=Di(e,t);if(!n.success)throw n.error;return n.data}var _We=60000;class gI{constructor(e){if(this._options=e,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(YS,(t)=>{this._oncancel(t)}),this.setNotificationHandler(XS,(t)=>{this._onprogress(t)}),this.setRequestHandler(JS,(t)=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore)this.setRequestHandler(QS,async(t,n)=>{let r=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!r)throw new de(fe.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(tb,async(t,n)=>{let r=async()=>{let o=t.params.taskId;if(this._taskMessageQueue){let i;while(i=await this._taskMessageQueue.dequeue(o,n.sessionId)){if(i.type==="response"||i.type==="error"){let a=i.message,c=a.id,l=this._requestResolvers.get(c);if(l)if(this._requestResolvers.delete(c),i.type==="response")l(a);else{let u=a,d=new de(u.error.code,u.error.message,u.error.data);l(d)}else{let u=i.type==="response"?"Response":"Error";this._onerror(Error(`${u} handler missing for request ${c}`))}continue}await this._transport?.send(i.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new de(fe.InvalidParams,`Task not found: ${o}`);if(!Mi(s.status))return await this._waitForTaskUpdate(o,n.signal),await r();if(Mi(s.status)){let i=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[Ni]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(nb,async(t,n)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,n.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new de(fe.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ob,async(t,n)=>{try{let r=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!r)throw new de(fe.InvalidParams,`Task not found: ${t.params.taskId}`);if(Mi(r.status))throw new de(fe.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(t.params.taskId);let o=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!o)throw new de(fe.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){if(r instanceof de)throw r;throw new de(fe.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}})}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),de.fromError(fe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=(o)=>{n?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{if(r?.(o,s),Rm(o)||qZ(o))this._onresponse(o);else if(qP(o))this._onrequest(o,s);else if(VZ(o))this._onnotification(o);else this._onerror(Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let t=de.fromError(fe.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;if(t===void 0)return;Promise.resolve().then(()=>t(e)).catch((n)=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[Ni]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:fe.MethodNotFound,message:"Method not found"}};if(o&&this._taskMessageQueue)this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch((u)=>this._onerror(Error(`Failed to enqueue error response: ${u}`)));else r?.send(l).catch((u)=>this._onerror(Error(`Failed to send an error response: ${u}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let i=KZ(e.params)?e.params.task:void 0,a=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async(l)=>{if(s.signal.aborted)return;let u={relatedRequestId:e.id};if(o)u.relatedTask={taskId:o};await this.notification(l,u)},sendRequest:async(l,u,d)=>{if(s.signal.aborted)throw new de(fe.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:e.id};if(o&&!f.relatedTask)f.relatedTask={taskId:o};let m=f.relatedTask?.taskId??o;if(m&&a)await a.updateTaskStatus(m,"input_required");return await this.request(l,u,f)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:a,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(i)this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async(l)=>{if(s.signal.aborted)return;let u={result:l,jsonrpc:"2.0",id:e.id};if(o&&this._taskMessageQueue)await this._enqueueTaskMessage(o,{type:"response",message:u,timestamp:Date.now()},r?.sessionId);else await r?.send(u)},async(l)=>{if(s.signal.aborted)return;let u={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:fe.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};if(o&&this._taskMessageQueue)await this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},r?.sessionId);else await r?.send(u)}).catch((l)=>this._onerror(Error(`Failed to send response: ${l}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(e.id)===s)this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(a){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(a);return}o(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){if(this._requestResolvers.delete(t),Rm(e))n(e);else{let s=new de(e.error.code,e.error.message,e.error.data);n(s)}return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(Rm(e)&&e.result&&typeof e.result==="object"){let s=e.result;if(s.task&&typeof s.task==="object"){let i=s.task;if(typeof i.taskId==="string")o=!0,this._taskProgressTokens.set(i.taskId,t)}}if(!o)this._progressHandlers.delete(t);if(Rm(e))r(e);else{let s=de.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:"result",result:await this.request(e,t,n)}}catch(s){yield{type:"error",error:s instanceof de?s:new de(fe.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Uu,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new de(fe.InternalError,"Task creation did not return a task");while(!0){let i=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:i},Mi(i.status)){if(i.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)};else if(i.status==="failed")yield{type:"error",error:new de(fe.InternalError,`Task ${o} failed`)};else if(i.status==="cancelled")yield{type:"error",error:new de(fe.InternalError,`Task ${o} was cancelled`)};return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)};return}let a=i.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((c)=>setTimeout(c,a)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof de?s:new de(fe.InternalError,String(s))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:i,relatedTask:a}=n??{};return new Promise((c,l)=>{let u=(b)=>{l(b)};if(!this._transport){u(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(e.method),i)this.assertTaskCapability(e.method)}catch(b){u(b);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:d};if(n?.onprogress)this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}};if(i)f.params={...f.params,task:i};if(a)f.params={...f.params,_meta:{...f.params?._meta||{},[Ni]:a}};let m=(b)=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(b)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch((S)=>this._onerror(Error(`Failed to send cancellation: ${S}`)));let v=b instanceof de?b:new de(fe.RequestTimeout,String(b));l(v)};this._responseHandlers.set(d,(b)=>{if(n?.signal?.aborted)return;if(b instanceof Error)return l(b);try{let v=Di(t,b.result);if(!v.success)l(v.error);else c(v.data)}catch(v){l(v)}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??_We,_=()=>m(de.fromError(fe.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(d,h,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let y=a?.taskId;if(y){let b=(v)=>{let S=this._responseHandlers.get(d);if(S)S(v);else this._onerror(Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,b),this._enqueueTaskMessage(y,{type:"request",message:f,timestamp:Date.now()}).catch((v)=>{this._cleanupTimeout(d),l(v)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch((b)=>{this._cleanupTimeout(d),l(b)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},eb,t)}async getTaskResult(e,t,n){return this.request({method:"tasks/result",params:e},t,n)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},rb,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},YZ,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Ni]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};if(t?.relatedTask)i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[Ni]:t.relatedTask}}};this._transport?.send(i,t).catch((a)=>this._onerror(a))});return}let s={...e,jsonrpc:"2.0"};if(t?.relatedTask)s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Ni]:t.relatedTask}}};await this._transport.send(s,t)}setRequestHandler(e,t){let n=mI(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(r,o)=>{let s=hI(e,r);return Promise.resolve(t(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=mI(e);this._notificationHandlers.set(n,(r)=>{let o=hI(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);if(t!==void 0)this._progressHandlers.delete(t),this._taskProgressTokens.delete(e)}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let r of n)if(r.type==="request"&&qP(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);if(s)s(new de(fe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o);else this._onerror(Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1000;try{let r=await this._taskStore?.getTask(e);if(r?.pollInterval)n=r.pollInterval}catch{}return new Promise((r,o)=>{if(t.aborted){o(new de(fe.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,n);t.addEventListener("abort",()=>{clearTimeout(s),o(new de(fe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:async(r)=>{if(!e)throw Error("No request provided");return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async(r)=>{let o=await n.getTask(r,t);if(!o)throw new de(fe.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,s)=>{await n.storeTaskResult(r,o,s,t);let i=await n.getTask(r,t);if(i){let a=Lm.parse({method:"notifications/tasks/status",params:i});if(await this.notification(a),Mi(i.status))this._cleanupTaskProgressHandler(r)}},getTaskResult:(r)=>n.getTaskResult(r,t),updateTaskStatus:async(r,o,s)=>{let i=await n.getTask(r,t);if(!i)throw new de(fe.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(Mi(i.status))throw new de(fe.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(r,o,s,t);let a=await n.getTask(r,t);if(a){let c=Lm.parse({method:"notifications/tasks/status",params:a});if(await this.notification(c),Mi(a.status))this._cleanupTaskProgressHandler(r)}},listTasks:(r)=>n.listTasks(r,t)}}}function U9(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function F9(e,t){let n={...e};for(let r in t){let o=r,s=t[o];if(s===void 0)continue;let i=n[o];if(U9(i)&&U9(s))n[o]={...i,...s};else n[o]=s}return n}var bX=qn(dD(),1),EX=qn(SX(),1);function $Ye(){let e=new bX.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return EX.default(e),e}class ED{constructor(e){this._ajv=e??$Ye()}getValidator(e){let t="$id"in e&&typeof e.$id==="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return(n)=>{if(t(n))return{valid:!0,data:n,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}class xD{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some((l)=>l.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some((l)=>l.type==="tool_use");if(s){if(o.some((l)=>l.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!c)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter((d)=>d.type==="tool_use").map((d)=>d.id)),u=new Set(o.filter((d)=>d.type==="tool_result").map((d)=>d.toolUseId));if(l.size!==u.size||![...l].every((d)=>u.has(d)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Um,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},zu,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}function xX(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function vX(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}class vD extends gI{constructor(e,t){super(t);if(this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Mm.options.map((n,r)=>[n,r])),this.isMessageIgnored=(n,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new ED,this.setRequestHandler(JP,(n)=>this._oninitialize(n)),this.setNotificationHandler(XP,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(sI,async(n,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,i=Mm.safeParse(s);if(i.success)this._loggingLevels.set(o,i.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new xD(this)};return this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=F9(this._capabilities,e)}setRequestHandler(e,t){let r=Li(e)?.method;if(!r)throw Error("Schema is missing a method literal");let o;if(qr(r)){let i=r;o=i._zod?.def?.value??i.value}else{let i=r;o=i._def?.value??i.value}if(typeof o!=="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let i=async(a,c)=>{let l=Di($u,a);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new de(fe.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:u}=l.data,d=await Promise.resolve(t(a,c));if(u.task){let m=Di(Uu,d);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new de(fe.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let f=Di(db,d);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new de(fe.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(!this._capabilities)return;switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){vX(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){if(!this._capabilities)return;xX(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:jZ.includes(t)?t:WP,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},ZS)}async createMessage(e,t){if(e.tools||e.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(e.messages.length>0){let n=e.messages[e.messages.length-1],r=Array.isArray(n.content)?n.content:[n.content],o=r.some((c)=>c.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],a=i.some((c)=>c.type==="tool_use");if(o){if(r.some((c)=>c.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!a)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(a){let c=new Set(i.filter((u)=>u.type==="tool_use").map((u)=>u.id)),l=new Set(r.filter((u)=>u.type==="tool_result").map((u)=>u.toolUseId));if(c.size!==l.size||![...c].every((u)=>l.has(u)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(e.tools)return this.request({method:"sampling/createMessage",params:e},iI,t);return this.request({method:"sampling/createMessage",params:e},Um,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},zu,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},zu,t);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!i.valid)throw new de(fe.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(s){if(s instanceof de)throw s;throw new de(fe.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},aI,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var AX=Symbol.for("mcp.completable");function wD(e){return!!e&&typeof e==="object"&&AX in e}function TX(e){return e[AX]?.complete}var wX;(function(e){e.Completable="McpCompletable"})(wX||(wX={}));var zYe=/^[A-Za-z0-9._-]{1,128}$/;function jYe(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!zYe.test(e)){let n=e.split("").filter((r)=>!/[A-Za-z0-9._-]/.test(r)).filter((r,o,s)=>s.indexOf(r)===o);return t.push(`Tool name contains invalid characters: ${n.map((r)=>`"${r}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function HYe(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)console.warn(` - ${n}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function AD(e){let t=jYe(e);return HYe(e,t.warnings),t.isValid}class TD{constructor(e){this._mcpServer=e}registerToolTask(e,t,n){let r={taskSupport:"required",...t.execution};if(r.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,r,t._meta,n)}}class kD{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new vD(e,t)}get experimental(){if(!this._experimental)this._experimental={tasks:new TD(this)};return this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(Ki(ub)),this.server.assertCanSetRequestHandler(Ki($u)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(ub,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:(()=>{let r=Nu(t.inputSchema);return r?fI(r,{strictUnions:!0,pipeStrategy:"input"}):BYe})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let r=Nu(t.outputSchema);if(r)n.outputSchema=fI(r,{strictUnions:!0,pipeStrategy:"output"})}return n})})),this.server.setRequestHandler($u,async(e,t)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new de(fe.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new de(fe.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new de(fe.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new de(fe.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(n,e,t);let i=await this.validateToolInput(n,e.params.arguments,e.params.name),a=await this.executeToolHandler(n,i,t);if(r)return a;return await this.validateToolOutput(n,a,e.params.name),a}catch(n){if(n instanceof de){if(n.code===fe.UrlElicitationRequired)throw n}return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,n){if(!e.inputSchema)return;let o=Nu(e.inputSchema)??e.inputSchema,s=await BS(o,t);if(!s.success){let i="error"in s?s.error:"Unknown error",a=KS(i);throw new de(fe.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${a}`)}return s.data}async validateToolOutput(e,t,n){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new de(fe.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let r=Nu(e.outputSchema),o=await BS(r,t.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",i=KS(s);throw new de(fe.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${i}`)}}async executeToolHandler(e,t,n){let r=e.handler;if("createTask"in r){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema)return await Promise.resolve(r.createTask(t,s));else return await Promise.resolve(r.createTask(s))}if(e.inputSchema)return await Promise.resolve(r(t,n));else return await Promise.resolve(r(n))}async handleAutomaticTaskPolling(e,t,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,t.params.arguments,t.params.name),o=e.handler,s={...n,taskStore:n.taskStore},i=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),a=i.task.taskId,c=i.task,l=c.pollInterval??5000;while(c.status!=="completed"&&c.status!=="failed"&&c.status!=="cancelled"){await new Promise((d)=>setTimeout(d,l));let u=await n.taskStore.getTask(a);if(!u)throw new de(fe.InternalError,`Task ${a} not found during polling`);c=u}return await n.taskStore.getTaskResult(a)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(Ki(pb)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(pb,async(e)=>{switch(e.params.ref.type){case"ref/prompt":return n9(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return r9(e),this.handleResourceCompletion(e,e.params.ref);default:throw new de(fe.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let n=this._registeredPrompts[t.name];if(!n)throw new de(fe.InvalidParams,`Prompt ${t.name} not found`);if(!n.enabled)throw new de(fe.InvalidParams,`Prompt ${t.name} disabled`);if(!n.argsSchema)return ch;let o=Li(n.argsSchema)?.[e.params.argument.name];if(!wD(o))return ch;let s=TX(o);if(!s)return ch;let i=await s(e.params.argument.value,e.params.context);return kX(i)}async handleResourceCompletion(e,t){let n=Object.values(this._registeredResourceTemplates).find((s)=>s.resourceTemplate.uriTemplate.toString()===t.uri);if(!n){if(this._registeredResources[t.uri])return ch;throw new de(fe.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=n.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return ch;let o=await r(e.params.argument.value,e.params.context);return kX(o)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(Ki(sb)),this.server.assertCanSetRequestHandler(Ki(ib)),this.server.assertCanSetRequestHandler(Ki(ab)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(sb,async(e,t)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(t);for(let i of s.resources)r.push({...o.metadata,...i})}return{resources:[...n,...r]}}),this.server.setRequestHandler(ib,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,n])=>({name:t,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(ab,async(e,t)=>{let n=new URL(e.params.uri),r=this._registeredResources[n.toString()];if(r){if(!r.enabled)throw new de(fe.InvalidParams,`Resource ${n} disabled`);return r.readCallback(n,t)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,t)}throw new de(fe.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(Ki(cb)),this.server.assertCanSetRequestHandler(Ki(lb)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(cb,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?KYe(t.argsSchema):void 0}))})),this.server.setRequestHandler(lb,async(e,t)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new de(fe.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new de(fe.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let r=Nu(n.argsSchema),o=await BS(r,e.params.arguments);if(!o.success){let a="error"in o?o.error:"Unknown error",c=KS(a);throw new de(fe.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${c}`)}let s=o.data,i=n.callback;return await Promise.resolve(i(s,t))}else{let r=n.callback;return await Promise.resolve(r(t))}}),this._promptHandlersInitialized=!0}resource(e,t,...n){let r;if(typeof n[0]==="object")r=n.shift();let o=n[0];if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let s=this._createRegisteredResource(e,void 0,t,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,t,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,t,n,r){if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,n.title,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,t,n,r,o){let s={name:e,title:t,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:(i)=>{if(typeof i.uri<"u"&&i.uri!==n){if(delete this._registeredResources[n],i.uri)this._registeredResources[i.uri]=s}if(typeof i.name<"u")s.name=i.name;if(typeof i.title<"u")s.title=i.title;if(typeof i.metadata<"u")s.metadata=i.metadata;if(typeof i.callback<"u")s.readCallback=i.callback;if(typeof i.enabled<"u")s.enabled=i.enabled;this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,t,n,r,o){let s={resourceTemplate:n,title:t,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(c)=>{if(typeof c.name<"u"&&c.name!==e){if(delete this._registeredResourceTemplates[e],c.name)this._registeredResourceTemplates[c.name]=s}if(typeof c.title<"u")s.title=c.title;if(typeof c.template<"u")s.resourceTemplate=c.template;if(typeof c.metadata<"u")s.metadata=c.metadata;if(typeof c.callback<"u")s.readCallback=c.callback;if(typeof c.enabled<"u")s.enabled=c.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let i=n.uriTemplate.variableNames;if(Array.isArray(i)&&i.some((c)=>!!n.completeCallback(c)))this.setCompletionRequestHandler();return s}_createRegisteredPrompt(e,t,n,r,o){let s={title:t,description:n,argsSchema:r===void 0?void 0:oc(r),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(i)=>{if(typeof i.name<"u"&&i.name!==e){if(delete this._registeredPrompts[e],i.name)this._registeredPrompts[i.name]=s}if(typeof i.title<"u")s.title=i.title;if(typeof i.description<"u")s.description=i.description;if(typeof i.argsSchema<"u")s.argsSchema=oc(i.argsSchema);if(typeof i.callback<"u")s.callback=i.callback;if(typeof i.enabled<"u")s.enabled=i.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=s,r){if(Object.values(r).some((a)=>{let c=a instanceof DS?a._def?.innerType:a;return wD(c)}))this.setCompletionRequestHandler()}return s}_createRegisteredTool(e,t,n,r,o,s,i,a,c){AD(e);let l={title:t,description:n,inputSchema:CX(r),outputSchema:CX(o),annotations:s,execution:i,_meta:a,handler:c,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:(u)=>{if(typeof u.name<"u"&&u.name!==e){if(typeof u.name==="string")AD(u.name);if(delete this._registeredTools[e],u.name)this._registeredTools[u.name]=l}if(typeof u.title<"u")l.title=u.title;if(typeof u.description<"u")l.description=u.description;if(typeof u.paramsSchema<"u")l.inputSchema=oc(u.paramsSchema);if(typeof u.outputSchema<"u")l.outputSchema=oc(u.outputSchema);if(typeof u.callback<"u")l.handler=u.callback;if(typeof u.annotations<"u")l.annotations=u.annotations;if(typeof u._meta<"u")l._meta=u._meta;if(typeof u.enabled<"u")l.enabled=u.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...t){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,r,o,s;if(typeof t[0]==="string")n=t.shift();if(t.length>1){let a=t[0];if(CD(a)){if(r=t.shift(),t.length>1&&typeof t[0]==="object"&&t[0]!==null&&!CD(t[0]))s=t.shift()}else if(typeof a==="object"&&a!==null){if(Object.values(a).some((c)=>typeof c==="object"&&c!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=t.shift()}}let i=t[0];return this._createRegisteredTool(e,void 0,n,r,o,s,{taskSupport:"forbidden"},void 0,i)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:i,annotations:a,_meta:c}=t;return this._createRegisteredTool(e,r,o,s,i,a,{taskSupport:"forbidden"},c,n)}prompt(e,...t){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;if(typeof t[0]==="string")n=t.shift();let r;if(t.length>1)r=t.shift();let o=t[0],s=this._createRegisteredPrompt(e,void 0,n,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,t,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=t,i=this._createRegisteredPrompt(e,r,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var BYe={type:"object",properties:{}};function RX(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function OX(e){return"_def"in e||"_zod"in e||RX(e)}function CD(e){if(typeof e!=="object"||e===null)return!1;if(OX(e))return!1;if(Object.keys(e).length===0)return!0;return Object.values(e).some(RX)}function CX(e){if(!e)return;if(CD(e))return oc(e);if(!OX(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}function KYe(e){let t=Li(e);if(!t)return[];return Object.entries(t).map(([n,r])=>{let o=$Z(r),s=zZ(r);return{name:n,description:o,required:!s}})}function Ki(e){let n=Li(e)?.method;if(!n)throw Error("Schema is missing a method literal");let r=GS(n);if(typeof r==="string")return r;throw Error("Schema method literal must be a string")}function kX(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var ch={completion:{values:[],hasMore:!1}};function GYe(e,t,n,r,o){let s={};if(o?.searchHint)s["anthropic/searchHint"]=o.searchHint;if(o?.alwaysLoad)s["anthropic/alwaysLoad"]=!0;return{name:e,description:t,inputSchema:n,handler:r,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function WYe(e){let t=new kD({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0},instructions:e.instructions});if(e.tools)e.tools.forEach((r)=>{for(let o of Object.values(r.inputSchema)){if(!VYe(o))continue;let s=o.description;if(s&&!vo.has(o))vo.add(o,{description:s})}t.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:e.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)});let n=Gf(e.timeout);return{type:"sdk",name:e.name,instance:t,...n!==void 0&&{timeout:n}}}function VYe(e){return typeof e==="object"&&e!==null&&"_zod"in e}var PX=15000,qYe=L(()=>T({session_id:g(),ws_url:g(),work_dir:g().optional(),session_key:g().optional()}));class Do extends Error{code;constructor(e,t){super(e);this.name="DirectConnectError",this.code=t}}class DX{options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new Kf;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e;this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((t,n)=>{this.readyResolve=t,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new yr("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new yr("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let o=await YYe(this.options);this.sessionId=o.sessionId,this.workDir=o.workDir,e=o.wsUrl}catch(o){let s=jr(o);if(!(s instanceof yr)){let i=s instanceof Do&&s.code?s.code:"session_create_failed";this.emitTelemetry("bad",i)}this.failInit(s);return}if(this.closed){if(this.options.deleteSessionOnClose&&this.sessionId)IX(this.options.serverUrl,this.sessionId,this.options.authToken);return}let t={};if(this.options.authToken)t.authorization=`Bearer ${this.options.authToken}`;let n=new WebSocket(e,{headers:t});this.ws=n;let r=setTimeout((o,s)=>{if(!o.readyState){s.close();let i=new Do(`WebSocket connection timeout after ${PX}ms`);o.exitError=i,o.readyReject?.(i),o.emitTelemetry("bad","connect_timeout")}},PX,this,n);n.addEventListener("open",()=>{clearTimeout(r),this.readyState=!0,yn(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",(o)=>{let s=typeof o.data==="string"?o.data:"";if(s.indexOf(`
207
+ `)===-1){if(s)this.partialChunks.push(s);return}let i=this.partialChunks.join("")+s;this.partialChunks.length=0;let a=i.split(`
208
+ `),c=a.pop()??"";if(c)this.partialChunks.push(c);for(let l of a){if(!l)continue;let u;try{u=ft(l)}catch(d){yn(`DirectConnect: dropped malformed JSON line (${l.length} bytes): ${d}`);continue}this.messages.enqueue(u)}}),n.addEventListener("error",()=>{clearTimeout(r);let o=new Do("WebSocket connection error");if(this.exitError=o,this.readyReject?.(o),this.messages.done(),!this.readyState)this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",(o)=>{let s=this.readyState;this.readyState=!1,this.closed=!0;let i=o.code!==1000&&o.code!==1001;if(i&&!this.exitError)this.exitError=new Do(`WebSocket closed abnormally: ${o.code} ${o.reason}`);if(this.messages.done(),s&&i&&!this.abortController.signal.aborted)this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,t){if(this.telemetryEmitted)return;if(this.telemetryEmitted=!0,e==="ok")rk("transport_direct_connect");else if(e==="bad")ok("transport_direct_connect",t??"unknown");else XK("transport_direct_connect",t??"unknown")}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new yr("Operation aborted");if(!this.readyState)await this.readyPromise;if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Do("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){if(this.closed)return;if(this.closed=!0,this.readyState=!1,this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(!this.abortController.signal.aborted)this.abortController.abort();if(this.ws&&this.ws.readyState===WebSocket.OPEN)this.ws.close(1000,"Normal closure");if(this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId)IX(this.options.serverUrl,this.sessionId,this.options.authToken)}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function ZYe(e){if(e.startsWith("cc://")){let r=e.slice(5),o=new URL(`http://${r}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(e.startsWith("cc+unix://"))throw new Do("Unix socket connect (cc+unix://) is not supported by the SDK transport");let t=/^https?:\/\//i.test(e)?e:`http://${e}`,n=new URL(t);return{serverUrl:`${n.protocol}//${n.host}`,authToken:void 0}}async function YYe(e){let t={"content-type":"application/json"};if(e.authToken)t.authorization=`Bearer ${e.authToken}`;let n={};if(e.cwd)n.cwd=e.cwd;if(e.sessionKey)n.session_key=e.sessionKey;if(e.permissionMode)n.permission_mode=e.permissionMode;let r;try{r=await fetch(`${e.serverUrl}/sessions`,{method:"POST",headers:t,body:me(n)})}catch(s){throw new Do(`Failed to connect to server at ${e.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!r.ok){let s=await r.text().catch(()=>"");throw new Do(`Failed to create session: ${r.status} ${r.statusText}${s?` — ${s}`:""}`,"session_create_failed")}let o=qYe().safeParse(await r.json());if(!o.success)throw new Do(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function IX(e,t,n){let r={};if(n)r.authorization=`Bearer ${n}`;try{await fetch(`${e}/sessions/${t}`,{method:"DELETE",headers:r})}catch{}}import{resolve as snt}from"path";function pc(){return cx.of(Tn().host)}function LX(e){pc().invalidateAll(e)}var NX=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];var JYe=["projectSettings","localSettings"],$Bt=new Set(JYe);var MX=["auto","bypassPermissions"];import{join as md}from"path";import{dirname as XYe}from"path";function FX(){}async function QYe(e,t){let n=et();try{await n.appendFile(e,t)}catch{await n.mkdir(XYe(e)).catch(FX),await n.appendFile(e,t)}}class $X{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(e,t){if(this.pendingWrite=this.pendingWrite.then(QYe.bind(null,e,t)).catch(FX),!this.cleanupRegistered)this.cleanupRegistered=!0,$_(()=>this.flush())}flush(){return this.pendingWrite}}var eJe=new Je(()=>new $X);function tJe(){return Xs(eJe)}function lh(e,t,n){let r=rJe();if(!r)return;let o;try{o=UX(e,t,nJe(n))}catch{o=UX(e,t,{diagnostics_payload_failed:!0})}tJe().append(r,o)}function nJe(e){try{return(typeof e==="function"?e():e)??{}}catch{return{diagnostics_payload_failed:!0}}}function UX(e,t,n){let r={timestamp:new Date().toISOString(),level:e,event:t,data:n};return me(r)+`
209
+ `}function rJe(){return _n.CLAUDE_CODE_DIAGNOSTICS_FILE}function zX(e,t,n){oJe(e.statSync(t),t,n)}function oJe(e,t,n){if(e.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:t});if(!e.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:t});if(n!==void 0&&e.size>n)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:t,size:e.size,maxBytes:n})}function jX(e,t,n){if(n===void 0)return;if(e>n)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:t,size:e,maxBytes:n})}function HX(e){return e!=null&&typeof e==="object"&&"code"in e&&e.code==="ERR_FILE_TOO_LARGE"}function sJe(e){if(e.byteLength===0)return"utf8";if(e.byteLength>=2){if(e[0]===255&&e[1]===254)return"utf16le"}if(e.byteLength>=3&&e[0]===239&&e[1]===187&&e[2]===191)return"utf8";return"utf8"}function BX(e){let{buffer:t,bytesRead:n}=et().readSync(e,{length:4096});return sJe(t.subarray(0,n))}function KX(e){let t=0,n=0;for(let r=0;r<e.length;r++)if(e[r]===`
210
+ `)if(r>0&&e[r-1]==="\r")t++;else n++;return t>n?"CRLF":"LF"}function iJe(e,t){let n=et(),{resolvedPath:r,isSymlink:o}=pf(n,e);if(o)ce(`Reading through symlink: ${e} -> ${r}`);zX(n,e,t);let s=BX(e),i;if(t===void 0)i=n.readFileSync(e,{encoding:s});else{let{buffer:c,bytesRead:l}=n.readSync(e,{length:t+1});jX(l,e,t),i=c.subarray(0,l).toString(s)}let a=KX(i.slice(0,4096));return{content:i.replaceAll(`\r
211
+ `,`
212
+ `),encoding:s,lineEndings:a}}function fc(e,t){return iJe(e,t).content}async function GX(e,t){let n=et(),{resolvedPath:r,isSymlink:o}=pf(n,e);if(o)ce(`Reading through symlink: ${e} -> ${r}`);zX(n,e,t);let s=BX(e),i=await n.readFileBytes(e,t===void 0?void 0:t+1);jX(i.length,e,t);let a=i.toString(s),c=KX(a.slice(0,4096));return{content:a.replaceAll(`\r
213
+ `,`
214
+ `),encoding:s,lineEndings:c}}var WX;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(WX||(WX={}));var cJe=Array(20).fill(0).map((e,t)=>" ".repeat(t));var lJe={" ":{"\n":Array(200).fill(0).map((e,t)=>`
215
+ `+" ".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
216
+ `+" ".repeat(t))},"\t":{"\n":Array(200).fill(0).map((e,t)=>`
217
+ `+"\t".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
218
+ `+"\t".repeat(t))}};var qX;(function(e){e.DEFAULT={allowTrailingComma:!1}})(qX||(qX={}));var ZX;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ZX||(ZX={}));var YX;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(YX||(YX={}));var JX;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(JX||(JX={}));var ed=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,QX=new Set,RD=typeof process==="object"&&!!process?process:{},e7=(e,t,n,r)=>{typeof RD.emitWarning==="function"?RD.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},{AbortController:Qb,AbortSignal:XX}=globalThis;if(typeof Qb>"u"){XX=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,o){this._onabort.push(o)}},Qb=class{constructor(){t()}signal=new XX;abort(r){if(this.signal.aborted)return;this.signal.reason=r,this.signal.aborted=!0;for(let o of this.signal._onabort)o(r);this.signal.onabort?.(r)}};let e=RD.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{if(!e)return;e=!1,e7("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t)}}var gJe=(e)=>!QX.has(e),g2t=Symbol("type"),Gi=(e)=>e&&e===Math.floor(e)&&e>0&&isFinite(e),t7=(e)=>!Gi(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?uh:null;class uh extends Array{constructor(e){super(e);this.fill(0)}}class td{heap;length;static#e=!1;static create(e){let t=t7(e);if(!t)return[];td.#e=!0;let n=new td(e,t);return td.#e=!1,n}constructor(e,t){if(!td.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class eE{#e;#t;#n;#r;#s;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#a;#o;#i;#f;#p;#d;#m;#g;#h;#_;#E;#S;#b;#v;#x;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#S,sizes:e.#_,keyMap:e.#a,keyList:e.#o,valList:e.#i,next:e.#f,prev:e.#p,get head(){return e.#d},get tail(){return e.#m},free:e.#g,isBackgroundFetch:(t)=>e.#y(t),backgroundFetch:(t,n,r,o)=>e.#$(t,n,r,o),moveToTail:(t)=>e.#F(t),indexes:(t)=>e.#C(t),rindexes:(t)=>e.#k(t),isStale:(t)=>e.#w(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#u}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:i,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:u,noUpdateTTL:d,maxSize:f=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:_,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:x,ignoreFetchAbort:w}=e;if(t!==0&&!Gi(t))throw TypeError("max option must be a nonnegative integer");let D=t?t7(t):Array;if(!D)throw Error("invalid max value: "+t);if(this.#e=t,this.#t=f,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#u=y,_!==void 0&&typeof _!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#s=_,this.#v=!!_,this.#a=new Map,this.#o=Array(t).fill(void 0),this.#i=Array(t).fill(void 0),this.#f=new D(t),this.#p=new D(t),this.#d=0,this.#m=0,this.#g=td.create(t),this.#c=0,this.#l=0,typeof c==="function")this.#n=c;if(typeof l==="function")this.#r=l,this.#h=[];else this.#r=void 0,this.#h=void 0;if(this.#b=!!this.#n,this.#x=!!this.#r,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(this.#t!==0){if(!Gi(this.#t))throw TypeError("maxSize must be a positive integer if specified")}if(!Gi(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!i,this.ttlResolution=Gi(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!Gi(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#A()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){if(gJe("LRU_CACHE_UNBOUNDED"))QX.add("LRU_CACHE_UNBOUNDED"),e7("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",eE)}}getRemainingTTL(e){return this.#a.has(e)?1/0:0}#A(){let e=new uh(this.#e),t=new uh(this.#e);this.#S=e,this.#E=t,this.#L=(o,s,i=ed.now())=>{if(t[o]=s!==0?i:0,e[o]=s,s!==0&&this.ttlAutopurge){let a=setTimeout(()=>{if(this.#w(o))this.#D(this.#o[o],"expire")},s+1);if(a.unref)a.unref()}},this.#T=(o)=>{t[o]=e[o]!==0?ed.now():0},this.#R=(o,s)=>{if(e[s]){let i=e[s],a=t[s];if(!i||!a)return;o.ttl=i,o.start=a,o.now=n||r();let c=o.now-a;o.remainingTTL=i-c}};let n=0,r=()=>{let o=ed.now();if(this.ttlResolution>0){n=o;let s=setTimeout(()=>n=0,this.ttlResolution);if(s.unref)s.unref()}return o};this.getRemainingTTL=(o)=>{let s=this.#a.get(o);if(s===void 0)return 0;let i=e[s],a=t[s];if(!i||!a)return 1/0;let c=(n||r())-a;return i-c},this.#w=(o)=>{let s=t[o],i=e[o];return!!i&&!!s&&(n||r())-s>i}}#T=()=>{};#R=()=>{};#L=()=>{};#w=()=>!1;#U(){let e=new uh(this.#e);this.#l=0,this.#_=e,this.#O=(t)=>{this.#l-=e[t],e[t]=0},this.#N=(t,n,r,o)=>{if(this.#y(n))return 0;if(!Gi(r))if(o){if(typeof o!=="function")throw TypeError("sizeCalculation must be a function");if(r=o(n,t),!Gi(r))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let o=this.#t-e[t];while(this.#l>o)this.#I(!0)}if(this.#l+=e[t],r)r.entrySize=n,r.totalCalculatedSize=this.#l}}#O=(e)=>{};#P=(e,t,n)=>{};#N=(e,t,n,r)=>{if(n||r)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#m;;){if(!this.#M(t))break;if(e||!this.#w(t))yield t;if(t===this.#d)break;else t=this.#p[t]}}*#k({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#d;;){if(!this.#M(t))break;if(e||!this.#w(t))yield t;if(t===this.#m)break;else t=this.#f[t]}}#M(e){return e!==void 0&&this.#a.get(this.#o[e])===e}*entries(){for(let e of this.#C())if(this.#i[e]!==void 0&&this.#o[e]!==void 0&&!this.#y(this.#i[e]))yield[this.#o[e],this.#i[e]]}*rentries(){for(let e of this.#k())if(this.#i[e]!==void 0&&this.#o[e]!==void 0&&!this.#y(this.#i[e]))yield[this.#o[e],this.#i[e]]}*keys(){for(let e of this.#C()){let t=this.#o[e];if(t!==void 0&&!this.#y(this.#i[e]))yield t}}*rkeys(){for(let e of this.#k()){let t=this.#o[e];if(t!==void 0&&!this.#y(this.#i[e]))yield t}}*values(){for(let e of this.#C())if(this.#i[e]!==void 0&&!this.#y(this.#i[e]))yield this.#i[e]}*rvalues(){for(let e of this.#k())if(this.#i[e]!==void 0&&!this.#y(this.#i[e]))yield this.#i[e]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#C()){let r=this.#i[n],o=this.#y(r)?r.__staleWhileFetching:r;if(o===void 0)continue;if(e(o,this.#o[n],this))return this.get(this.#o[n],t)}}forEach(e,t=this){for(let n of this.#C()){let r=this.#i[n],o=this.#y(r)?r.__staleWhileFetching:r;if(o===void 0)continue;e.call(t,o,this.#o[n],this)}}rforEach(e,t=this){for(let n of this.#k()){let r=this.#i[n],o=this.#y(r)?r.__staleWhileFetching:r;if(o===void 0)continue;e.call(t,o,this.#o[n],this)}}purgeStale(){let e=!1;for(let t of this.#k({allowStale:!0}))if(this.#w(t))this.#D(this.#o[t],"expire"),e=!0;return e}info(e){let t=this.#a.get(e);if(t===void 0)return;let n=this.#i[t],r=this.#y(n)?n.__staleWhileFetching:n;if(r===void 0)return;let o={value:r};if(this.#S&&this.#E){let s=this.#S[t],i=this.#E[t];if(s&&i){let a=s-(ed.now()-i);o.ttl=a,o.start=Date.now()}}if(this.#_)o.size=this.#_[t];return o}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let n=this.#o[t],r=this.#i[t],o=this.#y(r)?r.__staleWhileFetching:r;if(o===void 0||n===void 0)continue;let s={value:o};if(this.#S&&this.#E){s.ttl=this.#S[t];let i=ed.now()-this.#E[t];s.start=Math.floor(Date.now()-i)}if(this.#_)s.size=this.#_[t];e.unshift([n,s])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let r=Date.now()-n.start;n.start=ed.now()-r}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:a}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#N(e,t,n.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize){if(a)a.set="miss",a.maxEntrySizeExceeded=!0;return this.#D(e,"set"),this}let u=this.#c===0?void 0:this.#a.get(e);if(u===void 0){if(u=this.#c===0?this.#m:this.#g.length!==0?this.#g.pop():this.#c===this.#e?this.#I(!1):this.#c,this.#o[u]=e,this.#i[u]=t,this.#a.set(e,u),this.#f[this.#m]=u,this.#p[u]=this.#m,this.#m=u,this.#c++,this.#P(u,l,a),a)a.set="add";c=!1}else{this.#F(u);let d=this.#i[u];if(t!==d){if(this.#v&&this.#y(d)){d.__abortController.abort(Error("replaced"));let{__staleWhileFetching:f}=d;if(f!==void 0&&!s){if(this.#b)this.#n?.(f,e,"set");if(this.#x)this.#h?.push([f,e,"set"])}}else if(!s){if(this.#b)this.#n?.(d,e,"set");if(this.#x)this.#h?.push([d,e,"set"])}if(this.#O(u),this.#P(u,l,a),this.#i[u]=t,a){a.set="replace";let f=d&&this.#y(d)?d.__staleWhileFetching:d;if(f!==void 0)a.oldValue=f}}else if(a)a.set="update"}if(r!==0&&!this.#S)this.#A();if(this.#S){if(!c)this.#L(u,r,o);if(a)this.#R(a,u)}if(!s&&this.#x&&this.#h){let d=this.#h,f;while(f=d?.shift())this.#r?.(...f)}return this}pop(){try{while(this.#c){let e=this.#i[this.#d];if(this.#I(!0),this.#y(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#x&&this.#h){let e=this.#h,t;while(t=e?.shift())this.#r?.(...t)}}}#I(e){let t=this.#d,n=this.#o[t],r=this.#i[t];if(this.#v&&this.#y(r))r.__abortController.abort(Error("evicted"));else if(this.#b||this.#x){if(this.#b)this.#n?.(r,n,"evict");if(this.#x)this.#h?.push([r,n,"evict"])}if(this.#O(t),e)this.#o[t]=void 0,this.#i[t]=void 0,this.#g.push(t);if(this.#c===1)this.#d=this.#m=0,this.#g.length=0;else this.#d=this.#f[t];return this.#a.delete(n),this.#c--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,o=this.#a.get(e);if(o!==void 0){let s=this.#i[o];if(this.#y(s)&&s.__staleWhileFetching===void 0)return!1;if(!this.#w(o)){if(n)this.#T(o);if(r)r.has="hit",this.#R(r,o);return!0}else if(r)r.has="stale",this.#R(r,o)}else if(r)r.has="miss";return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#a.get(e);if(r===void 0||!n&&this.#w(r))return;let o=this.#i[r];return this.#y(o)?o.__staleWhileFetching:o}#$(e,t,n,r){let o=t===void 0?void 0:this.#i[t];if(this.#y(o))return o;let s=new Qb,{signal:i}=n;i?.addEventListener("abort",()=>s.abort(i.reason),{signal:s.signal});let a={signal:s.signal,options:n,context:r},c=(h,_=!1)=>{let{aborted:y}=s.signal,b=n.ignoreFetchAbort&&h!==void 0;if(n.status)if(y&&!_){if(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,b)n.status.fetchAbortIgnored=!0}else n.status.fetchResolved=!0;if(y&&!b&&!_)return u(s.signal.reason);let v=f;if(this.#i[t]===f)if(h===void 0)if(v.__staleWhileFetching)this.#i[t]=v.__staleWhileFetching;else this.#D(e,"fetch");else{if(n.status)n.status.fetchUpdated=!0;this.set(e,h,a.options)}return h},l=(h)=>{if(n.status)n.status.fetchRejected=!0,n.status.fetchError=h;return u(h)},u=(h)=>{let{aborted:_}=s.signal,y=_&&n.allowStaleOnFetchAbort,b=y||n.allowStaleOnFetchRejection,v=b||n.noDeleteOnFetchRejection,S=f;if(this.#i[t]===f){if(!v||S.__staleWhileFetching===void 0)this.#D(e,"fetch");else if(!y)this.#i[t]=S.__staleWhileFetching}if(b){if(n.status&&S.__staleWhileFetching!==void 0)n.status.returnedStale=!0;return S.__staleWhileFetching}else if(S.__returned===S)throw h},d=(h,_)=>{let y=this.#s?.(e,o,a);if(y&&y instanceof Promise)y.then((b)=>h(b===void 0?void 0:b),_);s.signal.addEventListener("abort",()=>{if(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort){if(h(void 0),n.allowStaleOnFetchAbort)h=(b)=>c(b,!0)}})};if(n.status)n.status.fetchDispatched=!0;let f=new Promise(d).then(c,l),m=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});if(t===void 0)this.set(e,m,{...a.options,status:void 0}),t=this.#a.get(e);else this.#i[t]=m;return m}#y(e){if(!this.#v)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Qb}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:h,forceRefresh:_=!1,status:y,signal:b}=t;if(!this.#v){if(y)y.fetch="get";return this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:y})}let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:i,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:y,signal:b},S=this.#a.get(e);if(S===void 0){if(y)y.fetch="miss";let x=this.#$(e,S,v,h);return x.__returned=x}else{let x=this.#i[S];if(this.#y(x)){let z=n&&x.__staleWhileFetching!==void 0;if(y){if(y.fetch="inflight",z)y.returnedStale=!0}return z?x.__staleWhileFetching:x.__returned=x}let w=this.#w(S);if(!_&&!w){if(y)y.fetch="hit";if(this.#F(S),r)this.#T(S);if(y)this.#R(y,S);return x}let D=this.#$(e,S,v,h),F=D.__staleWhileFetching!==void 0&&n;if(y){if(y.fetch=w?"stale":"refresh",F&&w)y.returnedStale=!0}return F?D.__staleWhileFetching:D.__returned=D}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#u;if(!n)throw Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...s}=t,i=this.get(e,s);if(!o&&i!==void 0)return i;let a=n(e,i,{options:s,context:r});return this.set(e,a,s),a}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,i=this.#a.get(e);if(i!==void 0){let a=this.#i[i],c=this.#y(a);if(s)this.#R(s,i);if(this.#w(i)){if(s)s.get="stale";if(!c){if(!o)this.#D(e,"expire");if(s&&n)s.returnedStale=!0;return n?a:void 0}else{if(s&&n&&a.__staleWhileFetching!==void 0)s.returnedStale=!0;return n?a.__staleWhileFetching:void 0}}else{if(s)s.get="hit";if(c)return a.__staleWhileFetching;if(this.#F(i),r)this.#T(i);return a}}else if(s)s.get="miss"}#z(e,t){this.#p[t]=e,this.#f[e]=t}#F(e){if(e!==this.#m){if(e===this.#d)this.#d=this.#f[e];else this.#z(this.#p[e],this.#f[e]);this.#z(this.#m,e),this.#m=e}}delete(e){return this.#D(e,"delete")}#D(e,t){let n=!1;if(this.#c!==0){let r=this.#a.get(e);if(r!==void 0)if(n=!0,this.#c===1)this.#j(t);else{this.#O(r);let o=this.#i[r];if(this.#y(o))o.__abortController.abort(Error("deleted"));else if(this.#b||this.#x){if(this.#b)this.#n?.(o,e,t);if(this.#x)this.#h?.push([o,e,t])}if(this.#a.delete(e),this.#o[r]=void 0,this.#i[r]=void 0,r===this.#m)this.#m=this.#p[r];else if(r===this.#d)this.#d=this.#f[r];else{let s=this.#p[r];this.#f[s]=this.#f[r];let i=this.#f[r];this.#p[i]=this.#p[r]}this.#c--,this.#g.push(r)}}if(this.#x&&this.#h?.length){let r=this.#h,o;while(o=r?.shift())this.#r?.(...o)}return n}clear(){return this.#j("delete")}#j(e){for(let t of this.#k({allowStale:!0})){let n=this.#i[t];if(this.#y(n))n.__abortController.abort(Error("deleted"));else{let r=this.#o[t];if(this.#b)this.#n?.(n,r,e);if(this.#x)this.#h?.push([n,r,e])}}if(this.#a.clear(),this.#i.fill(void 0),this.#o.fill(void 0),this.#S&&this.#E)this.#S.fill(0),this.#E.fill(0);if(this.#_)this.#_.fill(0);if(this.#d=0,this.#m=0,this.#g.length=0,this.#l=0,this.#c=0,this.#x&&this.#h){let t=this.#h,n;while(n=t?.shift())this.#r?.(...n)}}}function tE(e,t,n=100){let r=new eE({max:n}),o=(...s)=>{let i=t(...s),a=r.get(i);if(a!==void 0)return a;let c=e(...s);return r.set(i,c),c};return o.cache={clear:()=>r.clear(),size:()=>r.size,delete:(s)=>r.delete(s),get:(s)=>r.peek(s),has:(s)=>r.has(s),set:(s,i)=>void r.set(s,i)},o}var _Je=8192;function r7(e,t){try{return{ok:!0,value:JSON.parse(vu(e))}}catch(n){if(t)j_(D$(n,`safeParseJSON: invalid JSON (${n instanceof Error?n.constructor.name:typeof n}, ${e.length} bytes)`));return{ok:!1}}}class o7{cached=tE(r7,(e)=>e,50);cache=this.cached.cache;parse(e,t){return this.cached(e,t)}}var n7=new o7;var mc=Object.assign(function(t,n=!0){if(!t)return null;let r=t.length>_Je?r7(t,n):n7.parse(t,n);return r.ok?r.value:null},{cache:n7.cache});import{join as yJe}from"path";class s7{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=bJe(),this.managedFilePath}getDropInDir(){return this.dropInDir??=yJe(hc(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var SJe=new s7;function hc(){return SJe.getManagedFilePath()}function bJe(){let e=EJe();if(e!==void 0)return e;switch(Dn()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}function EJe(){return}var dh=[{path:["allowManagedPermissionRulesOnly"],restrictive:!0},{path:["allowManagedHooksOnly"],restrictive:!0},{path:["allowManagedMcpServersOnly"],restrictive:!0},{path:["enforceAvailableModels"],restrictive:!0},{path:["disableAllHooks"],restrictive:!0},{path:["disableClaudeAiConnectors"],restrictive:!0},{path:["disableCommandPluginSources"],restrictive:!0},{path:["disableSideloadFlags"],restrictive:!0},{path:["disableSkillShellExecution"],restrictive:!0},{path:["disableRemoteControl"],restrictive:!0},{path:["disableAgentView"],restrictive:!0},{path:["disableWorkflows"],restrictive:!0},{path:["disableArtifact"],restrictive:!0},{path:["disableBundledSkills"],restrictive:!0},{path:["fastModePerSessionOptIn"],restrictive:!0},{path:["isolatePeerMachines"],restrictive:!0},{path:["strictPluginOnlyCustomization"],restrictive:!0},{path:["disableAutoMode"],restrictive:"disable"},{path:["disableDeepLinkRegistration"],restrictive:"disable"},{path:["permissions","disableBypassPermissionsMode"],restrictive:"disable"},{path:["permissions","disableAutoMode"],restrictive:"disable"},{path:["permissions","blockReadsOutsideWorkingDirectories"],restrictive:!0},{path:["autoMode","classifyAllShell"],restrictive:!0},...[],{path:["worktree","bgIsolation"],restrictive:"worktree"},{path:["enableArtifact"],restrictive:!1},{path:["enableWorkflows"],restrictive:!1},{path:["syncClaudeAiSkills"],restrictive:!1},{path:["syncClaudeAiPlugins"],restrictive:!1},{path:["useAutoModeDuringPlan"],restrictive:!1},{path:["skipDangerousModePermissionPrompt"],restrictive:!1},{path:["skipAutoPermissionPrompt"],restrictive:!1},{path:["enableAllProjectMcpServers"],restrictive:!1},{path:["channelsEnabled"],restrictive:!1},{path:["skipWebFetchPreflight"],restrictive:!1},{path:["skipWorkflowUsageWarning"],restrictive:!1},{path:["autoUploadSessions"],restrictive:!1},{path:["remoteControlAtStartup"],restrictive:!1},{path:["remoteTools","allowUnattendedServing"],restrictive:!1},{path:["autoContinueAtUsageLimit"],restrictive:!1},...[],{path:["attribution","sessionUrl"],restrictive:!1},{path:["crossSessionInbound"],restrictive:["refuse","hold"]},{path:["remoteControl","shareHostProfile"],restrictive:["off","basic"]},{path:["modelProposedGoals"],restrictive:["disabled","alwaysAsk"]},{path:["feedbackDrafts"],restrictive:"off"},{path:["askUserQuestionTimeout"],restrictive:"never"},{path:["dialogExpiry"],restrictive:"never"},{path:["sandbox","enabled"],restrictive:!0},{path:["sandbox","failIfUnavailable"],restrictive:!0},{path:["sandbox","autoAllowBashIfSandboxed"],restrictive:!1},{path:["sandbox","allowUnsandboxedCommands"],restrictive:!1},{path:["sandbox","enableWeakerNestedSandbox"],restrictive:!1},{path:["sandbox","enableWeakerNetworkIsolation"],restrictive:!1},{path:["sandbox","allowAppleEvents"],restrictive:!1},{path:["sandbox","network","allowManagedDomainsOnly"],restrictive:!0},{path:["sandbox","network","strictAllowlist"],restrictive:!0},{path:["sandbox","network","allowAllUnixSockets"],restrictive:!1},{path:["sandbox","network","allowLocalBinding"],restrictive:!1},{path:["sandbox","filesystem","allowManagedReadPathsOnly"],restrictive:!0},{path:["sandbox","filesystem","disabled"],restrictive:!1},{path:["sandbox","credentials","allowPlaintextInject"],restrictive:!1},{path:["sandbox","credentials","sigv4","streaming"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","presigned"],restrictive:"deny"},{path:["sandbox","credentials","sigv4","sigv4a"],restrictive:"deny"}];function ph(e){return Array.isArray(e)?e:[e]}function zs(e,t){let n=e;for(let r of t){if(n===null||typeof n!=="object")return;n=n[r]}return n}function Wi(e,t,n){let r=[e],o=e;for(let i of t.slice(0,-1)){let a={...o[i]};o[i]=a,o=a,r.push(o)}let s=t.at(-1);if(n!==void 0){o[s]=n;return}delete o[s];for(let i=r.length-1;i>0;i--){if(Object.keys(r[i]).length>0)break;delete r[i-1][t[i-1]]}}function xJe(e,t,n){if(n!==void 0&&!Mo(e[t],n)||n===void 0&&!(t in e))qs(e,t,n)}var fh=xJe;var rE={};Zn(rE,{default:()=>mh});var l7=typeof rE=="object"&&rE&&!rE.nodeType&&rE,i7=l7&&typeof nE=="object"&&nE&&!nE.nodeType&&nE,vJe=i7&&i7.exports===l7,a7=vJe?Gt.Buffer:void 0,c7=a7?a7.allocUnsafe:void 0;function wJe(e,t){if(t)return e.slice();var n=e.length,r=c7?c7(n):new e.constructor(n);return e.copy(r),r}var mh=wJe;function AJe(e){var t=new e.constructor(e.byteLength);return new Ic(t).set(new Ic(e)),t}var nd=AJe;function TJe(e,t){var n=t?nd(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var oE=TJe;function CJe(e,t){var n=-1,r=e.length;t||(t=Array(r));while(++n<r)t[n]=e[n];return t}var sE=CJe;var u7=Object.create,kJe=function(){function e(){}return function(t){if(!Ht(t))return{};if(u7)return u7(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),d7=kJe;var RJe=qh(Object.getPrototypeOf,Object),rd=RJe;function OJe(e){return typeof e.constructor=="function"&&!Fc(e)?d7(rd(e)):{}}var iE=OJe;function PJe(e){return Zt(e)&&Vs(e)}var p7=PJe;var IJe="[object Object]",DJe=Function.prototype,LJe=Object.prototype,f7=DJe.toString,NJe=LJe.hasOwnProperty,MJe=f7.call(Object);function UJe(e){if(!Zt(e)||hr(e)!=IJe)return!1;var t=rd(e);if(t===null)return!0;var n=NJe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&f7.call(n)==MJe}var aE=UJe;function FJe(e,t){if(t==="constructor"&&typeof e[t]==="function")return;if(t=="__proto__")return;return e[t]}var hh=FJe;var $Je=Object.prototype,zJe=$Je.hasOwnProperty;function jJe(e,t,n){var r=e[t];if(!(zJe.call(e,t)&&Mo(r,n))||n===void 0&&!(t in e))qs(e,t,n)}var od=jJe;function HJe(e,t,n,r){var o=!n;n||(n={});var s=-1,i=t.length;while(++s<i){var a=t[s],c=r?r(n[a],e[a],a,n,e):void 0;if(c===void 0)c=e[a];if(o)qs(n,a,c);else od(n,a,c)}return n}var Qr=HJe;function BJe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var m7=BJe;var KJe=Object.prototype,GJe=KJe.hasOwnProperty;function WJe(e){if(!Ht(e))return m7(e);var t=Fc(e),n=[];for(var r in e)if(!(r=="constructor"&&(t||!GJe.call(e,r))))n.push(r);return n}var h7=WJe;function VJe(e){return Vs(e)?Vh(e,!0):h7(e)}var rs=VJe;function qJe(e){return Qr(e,rs(e))}var g7=qJe;function ZJe(e,t,n,r,o,s,i){var a=hh(e,n),c=hh(t,n),l=i.get(c);if(l){fh(e,n,l);return}var u=s?s(a,c,n+"",e,t,i):void 0,d=u===void 0;if(d){var f=Tt(c),m=!f&&Fo(c),h=!f&&!m&&Uc(c);if(u=c,f||m||h)if(Tt(a))u=a;else if(p7(a))u=sE(a);else if(m)d=!1,u=mh(c,!0);else if(h)d=!1,u=oE(c,!0);else u=[];else if(aE(c)||ls(c)){if(u=a,ls(a))u=g7(a);else if(!Ht(a)||kc(a))u=iE(c)}else d=!1}if(d)i.set(c,u),o(u,c,r,s,i),i.delete(c);fh(e,n,u)}var _7=ZJe;function y7(e,t,n,r,o){if(e===t)return;ng(t,function(s,i){if(o||(o=new Uo),Ht(s))_7(e,t,i,n,y7,r,o);else{var a=r?r(hh(e,i),s,i+"",e,t,o):void 0;if(a===void 0)a=s;fh(e,i,a)}},rs)}var S7=y7;function YJe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var b7=YJe;var E7=Math.max;function JJe(e,t,n){return t=E7(t===void 0?e.length-1:t,0),function(){var r=arguments,o=-1,s=E7(r.length-t,0),i=Array(s);while(++o<s)i[o]=r[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=r[o];return a[t]=n(i),b7(e,this,a)}}var cE=JJe;function XJe(e){return function(){return e}}var x7=XJe;var QJe=!Hc?Wc:function(e,t){return Hc(e,"toString",{configurable:!0,enumerable:!1,value:x7(t),writable:!0})},v7=QJe;var e5e=800,t5e=16,n5e=Date.now;function r5e(e){var t=0,n=0;return function(){var r=n5e(),o=t5e-(r-n);if(n=r,o>0){if(++t>=e5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var w7=r5e;var o5e=w7(v7),lE=o5e;function s5e(e,t){return lE(cE(e,t,Wc),e+"")}var A7=s5e;function i5e(e,t,n){if(!Ht(n))return!1;var r=typeof t;if(r=="number"?Vs(n)&&Ws(t,n.length):r=="string"&&(t in n))return Mo(n[t],e);return!1}var T7=i5e;function a5e(e){return A7(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;if(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&T7(n[0],n[1],i))s=o<3?void 0:s,o=1;t=Object(t);while(++r<o){var a=n[r];if(a)e(t,a,r,s)}return t})}var C7=a5e;var c5e=C7(function(e,t,n,r){S7(e,t,n,r)}),Gn=c5e;function l5e(e,t){var n=-1,r=e==null?0:e.length;while(++n<r)if(t(e[n],n,e)===!1)break;return e}var k7=l5e;function u5e(e,t){return e&&Qr(t,zo(t),e)}var R7=u5e;function d5e(e,t){return e&&Qr(t,rs(t),e)}var O7=d5e;function p5e(e,t){return Qr(e,Lc(e),t)}var P7=p5e;var f5e=Object.getOwnPropertySymbols,m5e=!f5e?Hh:function(e){var t=[];while(e)Dc(t,Lc(e)),e=rd(e);return t},uE=m5e;function h5e(e,t){return Qr(e,uE(e),t)}var I7=h5e;function g5e(e){return jh(e,rs,uE)}var sd=g5e;var _5e=Object.prototype,y5e=_5e.hasOwnProperty;function S5e(e){var t=e.length,n=new e.constructor(t);if(t&&typeof e[0]=="string"&&y5e.call(e,"index"))n.index=e.index,n.input=e.input;return n}var D7=S5e;function b5e(e,t){var n=t?nd(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var L7=b5e;var E5e=/\w*$/;function x5e(e){var t=new e.constructor(e.source,E5e.exec(e));return t.lastIndex=e.lastIndex,t}var N7=x5e;var M7=an?an.prototype:void 0,U7=M7?M7.valueOf:void 0;function v5e(e){return U7?Object(U7.call(e)):{}}var F7=v5e;var w5e="[object Boolean]",A5e="[object Date]",T5e="[object Map]",C5e="[object Number]",k5e="[object RegExp]",R5e="[object Set]",O5e="[object String]",P5e="[object Symbol]",I5e="[object ArrayBuffer]",D5e="[object DataView]",L5e="[object Float32Array]",N5e="[object Float64Array]",M5e="[object Int8Array]",U5e="[object Int16Array]",F5e="[object Int32Array]",$5e="[object Uint8Array]",z5e="[object Uint8ClampedArray]",j5e="[object Uint16Array]",H5e="[object Uint32Array]";function B5e(e,t,n){var r=e.constructor;switch(t){case I5e:return nd(e);case w5e:case A5e:return new r(+e);case D5e:return L7(e,n);case L5e:case N5e:case M5e:case U5e:case F5e:case $5e:case z5e:case j5e:case H5e:return oE(e,n);case T5e:return new r;case C5e:case O5e:return new r(e);case k5e:return N7(e);case R5e:return new r;case P5e:return F7(e)}}var $7=B5e;var K5e="[object Map]";function G5e(e){return Zt(e)&&us(e)==K5e}var z7=G5e;var j7=$o&&$o.isMap,W5e=j7?Mc(j7):z7,H7=W5e;var V5e="[object Set]";function q5e(e){return Zt(e)&&us(e)==V5e}var B7=q5e;var K7=$o&&$o.isSet,Z5e=K7?Mc(K7):B7,G7=Z5e;var Y5e=1,J5e=2,X5e=4,W7="[object Arguments]",Q5e="[object Array]",e8e="[object Boolean]",t8e="[object Date]",n8e="[object Error]",V7="[object Function]",r8e="[object GeneratorFunction]",o8e="[object Map]",s8e="[object Number]",q7="[object Object]",i8e="[object RegExp]",a8e="[object Set]",c8e="[object String]",l8e="[object Symbol]",u8e="[object WeakMap]",d8e="[object ArrayBuffer]",p8e="[object DataView]",f8e="[object Float32Array]",m8e="[object Float64Array]",h8e="[object Int8Array]",g8e="[object Int16Array]",_8e="[object Int32Array]",y8e="[object Uint8Array]",S8e="[object Uint8ClampedArray]",b8e="[object Uint16Array]",E8e="[object Uint32Array]",Et={};Et[W7]=Et[Q5e]=Et[d8e]=Et[p8e]=Et[e8e]=Et[t8e]=Et[f8e]=Et[m8e]=Et[h8e]=Et[g8e]=Et[_8e]=Et[o8e]=Et[s8e]=Et[q7]=Et[i8e]=Et[a8e]=Et[c8e]=Et[l8e]=Et[y8e]=Et[S8e]=Et[b8e]=Et[E8e]=!0;Et[n8e]=Et[V7]=Et[u8e]=!1;function dE(e,t,n,r,o,s){var i,a=t&Y5e,c=t&J5e,l=t&X5e;if(n)i=o?n(e,r,o,s):n(e);if(i!==void 0)return i;if(!Ht(e))return e;var u=Tt(e);if(u){if(i=D7(e),!a)return sE(e,i)}else{var d=us(e),f=d==V7||d==r8e;if(Fo(e))return mh(e,a);if(d==q7||d==W7||f&&!o){if(i=c||f?{}:iE(e),!a)return c?I7(e,O7(i,e)):P7(e,R7(i,e))}else{if(!Et[d])return o?e:{};i=$7(e,d,a)}}s||(s=new Uo);var m=s.get(e);if(m)return m;if(s.set(e,i),G7(e))e.forEach(function(y){i.add(dE(y,t,n,y,e,s))});else if(H7(e))e.forEach(function(y,b){i.set(b,dE(y,t,n,b,e,s))});var h=l?c?sd:bd:c?rs:zo,_=u?void 0:h(e);return k7(_||e,function(y,b){if(_)b=y,y=e[b];od(i,b,dE(y,t,n,b,e,s))}),i}var Z7=dE;function x8e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Y7=x8e;function v8e(e,t,n){var r=-1,o=e.length;if(t<0)t=-t>o?0:o+t;if(n=n>o?o:n,n<0)n+=o;o=t>n?0:n-t>>>0,t>>>=0;var s=Array(o);while(++r<o)s[r]=e[r+t];return s}var J7=v8e;function w8e(e,t){return t.length<2?e:Zs(e,J7(t,0,-1))}var X7=w8e;var A8e=Object.prototype,T8e=A8e.hasOwnProperty;function C8e(e,t){t=Ir(t,e);var n=-1,r=t.length;if(!r)return!0;while(++n<r){var o=gr(t[n]);if(o==="__proto__"&&!T8e.call(e,"__proto__"))return!1;if((o==="constructor"||o==="prototype")&&n<r-1)return!1}var s=X7(e,t);return s==null||delete s[gr(Y7(t))]}var Q7=C8e;function k8e(e){return aE(e)?void 0:e}var eQ=k8e;var tQ=an?an.isConcatSpreadable:void 0;function R8e(e){return Tt(e)||ls(e)||!!(tQ&&e&&e[tQ])}var nQ=R8e;function rQ(e,t,n,r,o){var s=-1,i=e.length;n||(n=nQ),o||(o=[]);while(++s<i){var a=e[s];if(t>0&&n(a))if(t>1)rQ(a,t-1,n,r,o);else Dc(o,a);else if(!r)o[o.length]=a}return o}var oQ=rQ;function O8e(e){var t=e==null?0:e.length;return t?oQ(e,1):[]}var sQ=O8e;function P8e(e){return lE(cE(e,void 0,sQ),e+"")}var pE=P8e;var I8e=1,D8e=2,L8e=4,N8e=pE(function(e,t){var n={};if(e==null)return n;var r=!1;if(t=Gc(t,function(s){return s=Ir(s,e),r||(r=s.length>1),s}),Qr(e,sd(e),n),r)n=Z7(n,I8e|D8e|L8e,eQ);var o=t.length;while(o--)Q7(n,t[o]);return n}),gh=N8e;function M8e(e,t,n,r){if(!Ht(e))return e;t=Ir(t,e);var o=-1,s=t.length,i=s-1,a=e;while(a!=null&&++o<s){var c=gr(t[o]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=i){var u=a[c];if(l=r?r(u,c,a):void 0,l===void 0)l=Ht(u)?u:Ws(t[o+1])?[]:{}}od(a,c,l),a=a[c]}return e}var iQ=M8e;function U8e(e,t,n){var r=-1,o=t.length,s={};while(++r<o){var i=t[r],a=Zs(e,i);if(n(a,i))iQ(s,Ir(i,e),a)}return s}var fE=U8e;function F8e(e,t){return fE(e,t,function(n,r){return sg(e,r)})}var aQ=F8e;var $8e=pE(function(e,t){return e==null?{}:aQ(e,t)}),_h=$8e;import{homedir as Ket}from"os";import{dirname as Get,join as No,resolve as eo}from"path";jc();var z8e="Expected a function";function j8e(e){if(typeof e!="function")throw TypeError(z8e);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var cQ=j8e;function H8e(e,t){if(e==null)return{};var n=Gc(sd(e),function(r){return[r]});return t=Ys(t),fE(e,n,function(r,o){return t(r,o[0])})}var lQ=H8e;function B8e(e,t){return lQ(e,cQ(Ys(t)))}var yh=B8e;import{join as hte}from"path";import{isAbsolute as uQ}from"path";var K8e=L(()=>T({allowedDomains:N(g()).optional(),deniedDomains:N(g()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),strictAllowlist:R().optional().describe("When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. "+"Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),allowManagedDomainsOnly:R().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:N(g()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:R().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:R().optional(),allowMachLookup:N(g().refine((e)=>!(e.endsWith("*")?e.slice(0,-1):e).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:X().optional(),socksProxyPort:X().optional(),tlsTerminate:T({caCertPath:g().min(1).optional(),caKeyPath:g().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings "+"(.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),G8e=L(()=>T({allowWrite:N(g()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:N(g()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:N(g()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:N(g()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:R().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:R().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries "+"do not pin it — env scrubbing and sentinel binds are independent of the filesystem "+"layer and survive this setting.) When unset, filesystem isolation stays on.")}).optional());function dQ(e,t,n){if(e.length===0||e.some((r)=>r.length===0))n.addIssue({code:Vr.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(t===void 0)n.addIssue({code:Vr.custom,path:["maskClaims"],message:"maskClaims requires decode — without a decode format there is no token to read claims from. Set decode, or omit maskClaims."})}function pQ(e,t){let n;try{n=new RegExp(e)}catch(o){t.addIssue({code:Vr.custom,path:["extract"],message:`extract is not a valid regular expression: ${Hr(o)}`});return}if(new RegExp(n.source+"|").exec("").length-1<1)t.addIssue({code:Vr.custom,path:["extract"],message:"extract must contain at least one capturing group — "+'group 1 is the credential value to mask (e.g. "token:\\s*(\\S+)").'})}function fQ(e){if(typeof e!=="object"||e===null)return e;let t=e;if(t.mode!=="deny")return e;let n={...t};if("extract"in n&&typeof n.extract!=="string")delete n.extract;if("onExtractNoMatch"in n&&n.onExtractNoMatch!=="warn"&&n.onExtractNoMatch!=="deny"&&n.onExtractNoMatch!=="error")delete n.onExtractNoMatch;if("decode"in n&&n.decode!=="jwt")delete n.decode;if("maskClaims"in n&&!(Array.isArray(n.maskClaims)&&n.maskClaims.every((r)=>typeof r==="string")))delete n.maskClaims;if("maskDuplicates"in n&&typeof n.maskDuplicates!=="boolean")delete n.maskDuplicates;if("injectHosts"in n&&!(Array.isArray(n.injectHosts)&&n.injectHosts.every((r)=>typeof r==="string")))delete n.injectHosts;return n}var mE=L(()=>tt(fQ,T({path:g().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:V(["deny","mask"]).describe("Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the "+"host proxy swaps sentinel→real on egress to `injectHosts`. "+"On macOS and Windows `mask` currently degrades to `deny`."),extract:g().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced "+"with sentinels — the rest of the file is preserved so a tool "+"that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),onExtractNoMatch:V(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the file — or, "+"with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to "+"mode `deny` so the file is unreadable (fail-closed) — under "+"`sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),decode:V(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),maskClaims:N(g()).optional().describe("Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),maskDuplicates:R().optional().describe("If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the "+"corresponding sentinel — for a secret repeated where the regex "+"does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),injectHosts:N(g()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{if(e.mode==="mask"&&e.path.endsWith("/"))t.addIssue({code:Vr.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'});if(e.mode==="mask"&&e.extract!==void 0)pQ(e.extract,t);if(e.mode==="mask"&&e.maskClaims!==void 0)dQ(e.maskClaims,e.decode,t)}))),id=()=>g().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"),hE=L(()=>tt(fQ,T({name:id().describe("Environment variable name."),mode:V(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the "+"host proxy swaps sentinel→real on egress to `injectHosts`."),extract:g().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are "+"replaced with sentinels — the rest of the value is preserved "+"so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`."),onExtractNoMatch:V(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting "+"cannot be honored — `deny` and `error` are rejected there; "+"only `warn` is accepted. In all other shapes the field is accepted but ignored."),decode:V(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning "+"(fail-open). Cannot be combined with `extract` — the decode "+"path never consults it. Accepted but ignored for `deny`."),maskClaims:N(g()).optional().describe("Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),injectHosts:N(g()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{if(e.mode==="mask"&&e.extract!==void 0)pQ(e.extract,t);if(e.mode==="mask"&&e.maskClaims!==void 0)dQ(e.maskClaims,e.decode,t);if(e.mode==="mask"&&e.decode!==void 0&&e.extract!==void 0)t.addIssue({code:Vr.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry — the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."});if(e.mode==="mask"&&e.decode!==void 0&&(e.onExtractNoMatch==="deny"||e.onExtractNoMatch==="error"))t.addIssue({code:Vr.custom,path:["onExtractNoMatch"],message:"onExtractNoMatch cannot be honored on an env entry with decode — the runtime takes the decode path (which is unconditionally fail-open on verify failure) and never consults extract or onExtractNoMatch. Remove onExtractNoMatch, or drop decode to use extract-based masking (whose no-match handling does honor it)."})}))),Vi=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var OD="_INVALID_PAIR_",gE="_PARENT_PAIR_SUPPRESSOR_";var _E=L(()=>T({accessKeyIdVar:id().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:id().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:id().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((e,t)=>{let n=new Map;for(let[r,o]of[["accessKeyIdVar",e.accessKeyIdVar],["secretAccessKeyVar",e.secretAccessKeyVar],["sessionTokenVar",e.sessionTokenVar]]){if(o===void 0)continue;let s=n.get(o);if(s!==void 0)t.addIssue({code:Vr.custom,path:[r],message:`${r} names the same env var ('${o}') as ${s} — each pair member must be a distinct variable.`});else n.set(o,r)}})),W8e=L(()=>{let e=V(["deny","passthrough"]);return T({streaming:e.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:e.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:e.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),V8e=L(()=>T({files:N(mE()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`."),envVars:N(hE()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:R().optional().describe("Allow sentinel→real substitution on the plain-HTTP proxy path. "+"Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored."),awsPairs:N(_E()).optional().describe("Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not "+"qualify — re-signing needs the whole real value). A pair "+"whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed)."),sigv4:W8e().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).superRefine((e,t)=>{let n=new Set;for(let[r,o]of(e?.awsPairs??[]).entries()){let s=[["accessKeyIdVar",o.accessKeyIdVar],["secretAccessKeyVar",o.secretAccessKeyVar],["sessionTokenVar",o.sessionTokenVar]],i=new Set;for(let[a,c]of s){if(c===void 0)continue;if(n.has(c))t.addIssue({code:Vr.custom,path:["awsPairs",r,a],message:`"${c}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});i.add(c)}for(let a of i)n.add(a)}}).optional()),PD=L(()=>T({enabled:R().optional(),failIfUnavailable:R().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:R().optional(),allowUnsandboxedCommands:R().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:K8e(),filesystem:G8e(),credentials:V8e(),ignoreViolations:Z(g(),N(g())).optional(),enableWeakerNestedSandbox:R().optional(),enableWeakerNetworkIsolation:R().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:R().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. "+"**Removes code-execution isolation** — sandboxed commands can launch other applications "+"unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:N(g()).optional(),ripgrep:T({command:g(),args:N(g()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),bwrapPath:tt((e)=>typeof e==="string"&&uQ(e)?e:void 0,g()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:tt((e)=>typeof e==="string"&&uQ(e)?e:void 0,g()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var mQ=new Set(["disableAllHooks"]);function hQ(e){let t={};for(let{path:u,restrictive:d}of dh){if(mQ.has(u[0]))continue;let f=zs(e,u);if((typeof f==="boolean"||typeof f==="string")&&ph(d).includes(f))Wi(t,u,f)}let n=yE(e.permissions,["deny","ask","disableBypassPermissionsMode","disableAutoMode"]);if(n)t.permissions={...t.permissions,...n};for(let u of q8e)if(e[u]!==void 0)t[u]=e[u];for(let[u,d]of Object.entries(e))if((u.startsWith("disable")&&(d===!0||d==="disable")||u.startsWith("enable")&&d===!1)&&!mQ.has(u))t[u]=d;if(e.disableAllHooks===!0)t.allowManagedHooksOnly=!0;if(Array.isArray(e.httpHookAllowedEnvVars)&&e.httpHookAllowedEnvVars.length===0)t.httpHookAllowedEnvVars=[];let r=yE(e.sandbox?.filesystem,["denyRead","denyWrite","allowManagedReadPathsOnly"]),o=yE(e.sandbox?.network,["deniedDomains","strictAllowlist","allowManagedDomainsOnly"]),s=yE(e.sandbox?.credentials,["files","envVars"])??{},i=(e.sandbox?.credentials?.awsPairs??[]).flatMap((u)=>[u.accessKeyIdVar,u.secretAccessKeyVar,u.sessionTokenVar]),a=Vi.filter((u)=>i.includes(u));if(a.length>0)s.awsPairs=a.map((u,d)=>({accessKeyIdVar:u,secretAccessKeyVar:`${gE}${d+1}_`}));let c=e.sandbox?.credentials?.sigv4;if(c){let u={};for(let[d,f]of Object.entries(c))if(f==="deny")u[d]="deny";if(Object.keys(u).length>0)s.sigv4=u}let l=Object.keys(s).length>0;if(r||o||l){let u=t.sandbox??{};t.sandbox={...u,...r&&{filesystem:{...u.filesystem,...r}},...o&&{network:{...u.network,...o}},...l&&{credentials:{...u.credentials,...s}}}}return Object.keys(t).length>0?t:null}function yE(e,t){if(!e)return;let n={};for(let r of t)if(e[r]!==void 0)n[r]=e[r];return Object.keys(n).length>0?n:void 0}var q8e=["allowedMcpServers","deniedMcpServers","allowManagedMcpServersOnly","disabledMcpjsonServers","allowManagedHooksOnly","allowedHttpHookUrls","strictKnownMarketplaces","allowedMarketplaces","blockedMarketplaces","strictPluginOnlyCustomization","availableModels","enforceAvailableModels"];function _Q(e){let t=0,n=e.length;while(t<n&&gQ(e.charCodeAt(t)))t++;while(n>t&&gQ(e.charCodeAt(n-1)))n--;let r=Z8e(e.slice(t,n));if(r!==-1)return{kind:"line_break",index:ID(e,t+r)};for(let o=t;o<n;o++){let s=e.charCodeAt(o);if(s===0)return{kind:"nul",index:ID(e,o)};if(s>255)return{kind:"non_ascii",index:ID(e,o),codePoint:Y8e(e,o)}}return null}function Z8e(e){let t=e.indexOf(`
219
+ `),n=e.indexOf("\r");if(t===-1)return n;return n===-1?t:Math.min(t,n)}function gQ(e){return e===9||e===32||e===10||e===13}function Y8e(e,t){return e.codePointAt(t)??e.charCodeAt(t)}function ID(e,t){let n=0;for(let r=0;r<t;r++){let o=e.charCodeAt(r);if(o>=55296&&o<=56319&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320)r++;n++}return n}var DD=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"],yQ=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var SQ="OTEL_EXPORTER_OTLP_",bQ=["OTEL_LOG_RAW_API_BODIES","OTEL_LOG_USER_PROMPTS","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOGS_EXPORTER","ENABLE_BETA_TRACING_DETAILED","BETA_TRACING_ENDPOINT","ANT_OTEL_LOGS_EXPORTER"],EQ=[SQ,`ANT_${SQ}`],xQ={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...yQ,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...yQ,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],gcpAuthRefresh:["CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]},J8e=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var LD=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL","CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL","CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL","CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL",...J8e],X8e=[{endpoint:"ANTHROPIC_BASE_URL",companions:["_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_BASE_URL",selection:"CLAUDE_CODE_USE_BEDROCK",companions:["CLAUDE_CODE_SKIP_BEDROCK_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_VERTEX_BASE_URL",selection:"CLAUDE_CODE_USE_VERTEX",companions:["CLAUDE_CODE_SKIP_VERTEX_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_FOUNDRY_BASE_URL",selection:"CLAUDE_CODE_USE_FOUNDRY",companions:["CLAUDE_CODE_SKIP_FOUNDRY_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_AWS_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_AWS",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_GOOGLE_CLOUD_BASE_URL",selection:"CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD",companions:["CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","ANTHROPIC_CUSTOM_HEADERS"]},{endpoint:"ANTHROPIC_BEDROCK_MANTLE_BASE_URL",selection:"CLAUDE_CODE_USE_MANTLE",companions:["CLAUDE_CODE_SKIP_MANTLE_AUTH","ANTHROPIC_CUSTOM_HEADERS"]}],cqt=Tr(X8e.flatMap((e)=>[e.endpoint,...e.companions])),ND=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],Q8e=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],MD=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"],UD=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],eXe=["CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_GATEWAY_TOKEN_FILE_DESCRIPTOR","CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR","CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR"],lqt=["CLAUDE_CODE_OAUTH_TOKEN",...eXe,"CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_SLACK_TAG_TOKEN","CLAUDE_CODE_HFI_BEARER_TOKEN","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_TRUSTED_DEVICE_TOKEN","AGENT_PROXY_AUTH_TOKEN","CLAUDE_CODE_MCP_SERVE_AUTH_TOKEN","CLAUDE_BG_AUTH_SNAPSHOT_PATH","CLAUDE_BG_SOCKET_TOKENS_PATH","CLAUDE_BG_RV_AUTH","CLAUDE_BG_PTY_AUTH","CLAUDE_BG_CLAIM_AUTH"],tXe=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],FD=[...tXe,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var $D=["AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN"],zD=["GCE_METADATA_HOST","GCE_METADATA_ROOT","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],uqt=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...DD,...LD,...ND,...Q8e,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...FD,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...zD,...$D,"AWS_REGION","AWS_DEFAULT_REGION",...MD,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE",...UD]);var vQ=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],jD=["bwrapPath","ripgrep","socatPath"],wQ=["allowAppleEvents","credentials","enableWeakerNestedSandbox","enableWeakerNetworkIsolation","filesystem.disabled","network.allowAllUnixSockets","network.allowMachLookup","network.allowUnixSockets","network.httpProxyPort","network.socksProxyPort","network.tlsTerminate"],nXe=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_FEEDBACK_COMMAND","DISABLE_GROWTHBOOK","DISABLE_INSTALLATION_CHECKS","DISABLE_UPDATES","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_CONNECT_TIMEOUT_MS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_COMPRESSION","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_COMPRESSION","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_COMPRESSION","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_COMPRESSION","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_TRACES_PROTOCOL","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_ENTRYPOINT","OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_FABLE_5_1","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","CLAUDE_CODE_PROMPT_CACHE_TTL","CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND","CLAUDE_CODE_DISABLE_MEMORY_RO_UNSAVED_NOTICE","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_FUNCTION_HOOKS","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS","CLAUDE_CODE_COORDINATOR_WORKER_CHECKIN_SECONDS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS","CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH","MCP_CONNECTION_NONBLOCKING","CLAUDE_ENABLE_BYTE_WATCHDOG","CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK","CLAUDE_ENABLE_STREAM_WATCHDOG"]),rXe=new Set(["API_FORCE_IDLE_TIMEOUT","CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]),oXe=new Set(["ENABLE_BETA_TRACING_DETAILED","OTEL_LOG_RAW_API_BODIES"]),sXe=/auth|key|token|cookie|secret|credential|session|signature|passw|jwt|assertion|cert|oidc|org|tenant|account|project|workspace|user|email|identity|principal|consumer|client|host|url|base|target|upstream|endpoint|proxy|forward|route|fallback|override|apigw|x-goog-|l5d-|bypass|guardrail|amz|x-ms-|azureml|extra-parameters|envoy|helicone|litellm|cf-aig|cf-access|beta|version/;function iXe(e){if(/\r(?!\n)/.test(e))return!0;return e.split(/\n|\r\n/).some((t)=>{let n=t.indexOf(":");if(n===-1)return!1;let r=t.slice(0,n).trim();return!aXe.test(r)||_Q(t.slice(n+1))!==null||sXe.test(r.toLowerCase())})}var aXe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function AQ(e,t){let n=e.toUpperCase();return nXe.has(n)||rXe.has(n)&&Oe(t)||oXe.has(n)&&ea(t)||n==="ANTHROPIC_CUSTOM_HEADERS"&&!iXe(t)}import{posix as Gee,win32 as Wee}from"path";var ad=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],cXe=[...ad],TQ=cXe;function Sh(e){return e==="manual"?"default":e}var fqt=`Cannot set permission mode: must be one of ${ad.join(", ")}`,mqt={dangerousRemoval:{bypassImmune:!0,classifierRouted:!0},backgroundOperator:{bypassImmune:!1,classifierRouted:!0},suspiciousWindowsPath:{bypassImmune:!1,classifierRouted:!0},isolatePeerMachines:{bypassImmune:!0,classifierRouted:!1},restrictedMode:{bypassImmune:!0,classifierRouted:!1},outsideReadsBlocked:{bypassImmune:!0,classifierRouted:!1},...{}};var CQ=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var kQ=["normal","vim"];var RQ=["auto","12-hour","24-hour","24-hour-utc"],OQ=["auto","tmux","iterm2","in-process"],lXe=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],PQ=["auto",...lXe],IQ=["auto","alwaysAsk","disabled"],DQ=1e5,LQ=1e6;var uXe=String.raw`\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-[^}]*)?\}`;function NQ(e){return new RegExp(uXe).test(e)}var bqt=L(()=>V(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Eqt=L(()=>V(["stdio","sse","sse-ide","http","ws","sdk"])),cd=L(()=>j("comms").optional().catch(void 0)),qi=L(()=>X().int().positive()),dXe=300000,MQ=L(()=>X().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function UQ({request_timeout_ms:e,...t}){return{...t,...t.timeout===void 0&&e!==void 0&&{timeout:Math.min(e,dXe)}}}var pXe=L(()=>T({type:j("stdio").optional(),command:g().min(1,"Command cannot be empty"),args:N(g()).default([]),env:Z(g(),g()).optional(),timeout:qi().optional(),alwaysLoad:R().optional(),role:cd()})),fXe=L(()=>R()),FQ=L(()=>T({clientId:g().optional(),callbackPort:X().int().positive().optional(),authServerMetadataUrl:g().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:g().min(1).optional(),xaa:fXe().optional()})),$Q=L(()=>T({name:g(),permission_policy:V(["always_allow","always_ask","always_deny"]).optional()})),zQ=L(()=>T({type:j("sse"),url:g(),headers:Z(g(),g()).optional(),headersHelper:g().optional(),oauth:FQ().optional(),timeout:qi().optional(),request_timeout_ms:MQ(),tools:N($Q()).optional(),alwaysLoad:R().optional(),discoveryCache:R().optional(),role:cd(),toolPermissions:Z(g(),GD()).optional()}).transform(UQ)),mXe=L(()=>T({type:j("sse-ide"),url:g(),ideName:g(),ideRunningInWindows:R().optional(),timeout:qi().optional(),alwaysLoad:R().optional(),role:cd()})),hXe=L(()=>T({type:j("ws-ide"),url:g(),ideName:g(),authToken:g().optional(),ideRunningInWindows:R().optional(),timeout:qi().optional(),alwaysLoad:R().optional(),role:cd()})),jQ=L(()=>T({type:V(["http","streamable-http"]).transform(()=>"http"),url:g(),headers:Z(g(),g()).optional(),headersHelper:g().optional(),oauth:FQ().optional(),timeout:qi().optional(),request_timeout_ms:MQ(),tools:N($Q()).optional(),alwaysLoad:R().optional(),discoveryCache:R().optional(),role:cd(),toolPermissions:Z(g(),GD()).optional()}).transform(UQ)),gXe=["command","args","env","headersHelper"],_Xe=new Set(["http","streamable-http","sse"]),yXe=/[\p{Cc}\p{Cf}\u2028\u2029]/u,SXe=/[\p{Cc}\p{Cf}\u2028\u2029]/gu;function HD(e){return/^[A-Za-z0-9_-]+$/.test(e)&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function bXe(e){try{let t=new URL(e);return t.protocol==="https:"&&t.hostname!==""}catch{return!1}}function HQ(e,t="",n=0){if(typeof e==="string")return[[t,e,!1]];if(n>4||e===null||typeof e!=="object")return[];return Object.entries(e).flatMap(([r,o])=>{let s=r.replace(SXe,(a)=>`\\u${a.codePointAt(0).toString(16).padStart(4,"0")}`),i=t?`${t}.${s}`:s;return[[i,r,!0],...HQ(o,i,n+1)]})}var BD=L(()=>Z(g(),Te()).check((e)=>{let t=(r,o)=>{e.issues.push({code:"custom",path:r,message:o,input:e.value})};for(let r of gXe)if(Object.hasOwn(e.value,r))t([r],`"${r}" is not allowed in managed settings: only http/sse URL servers can be delivered this way, and a managed settings document must not name a program to run`);if(!_Xe.has(e.value.type))t(["type"],'managed settings can only deliver "http" or "sse" servers');let n=e.value.url;if(typeof n==="string"&&!bXe(n))t(["url"],"managed settings servers must use a valid https:// url");for(let[r,o,s]of HQ(e.value))if(yXe.test(o))t(r.split("."),"contains control or invisible format characters (in a key or a value); a managed settings document must not be able to print escape sequences");else if(!s&&NQ(o))t(r.split("."),"${VAR} references are not expanded in managed settings; use a literal value (a managed settings document must not read the user's environment)")}).pipe(ue([jQ(),zQ()]))),KD=`"managedMcpServers" must be an object keyed by server name (the .mcp.json mcpServers shape; Claude Desktop's array form of its same-named key is not accepted here: use the server name as the key and "type" instead of "transport"). No managed MCP servers are installed from it until it is fixed.`;function SE(e,t){if(e===void 0)return;if(e===null||typeof e!=="object"||Array.isArray(e)){t("",KD);return}let n=Object.create(null);for(let[r,o]of Object.entries(e)){if(!HD(r)){t("<invalid name>","server names may only contain letters, numbers, hyphens and underscores");continue}let s=BD().safeParse(o);if(s.success){n[r]=s.data;continue}let i=s.error.issues[0];t(r,i?[i.path.join("."),i.message].filter(Boolean).join(": "):"failed validation")}return n}var EXe=L(()=>T({type:j("ws"),url:g(),headers:Z(g(),g()).optional(),headersHelper:g().optional(),timeout:qi().optional(),alwaysLoad:R().optional(),role:cd()})),xXe=L(()=>T({type:j("sdk"),name:g(),timeout:qi().optional(),alwaysLoad:R().optional()})),GD=L(()=>V(["allow","ask","blocked"])),vXe=L(()=>T({type:j("claudeai-proxy"),url:g(),id:g(),displayName:g().optional(),iconUrl:g().optional(),timeout:qi().optional(),alwaysLoad:R().optional(),toolPermissions:Z(g(),GD()).optional(),stateless:R().optional(),cachedInitResponse:Z(g(),Te()).nullish(),discoverSupport:V(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:Z(g(),Te()).nullish(),eligible:R().nullish(),ineligibleReason:g().nullish(),enterpriseManaged:R().optional()})),bE=L(()=>ue([pXe(),zQ(),mXe(),hXe(),jQ(),EXe(),xXe(),vXe()]));var xqt=L(()=>T({mcpServers:Z(g(),bE())}));var Tqt=Dn()==="macos"?"⏺":"●";var Lqt=L(()=>tt(Sh,V(TQ))),Nqt=L(()=>tt(Sh,V(ad)));import{posix as BXe,win32 as KXe}from"path";import{isIPv4 as wXe,isIPv6 as AXe}from"net";var TXe=new Set(["metadata.google.internal","metadata.goog","metadata","instance-data","instance-data.ec2.internal","ip6-localhost","ip6-loopback","localhost.localdomain","localhost4","localhost4.localdomain4","localhost6","localhost6.localdomain6"]),BQ=new Set(["100.100.100.200","168.63.129.16","192.0.0.192"]);function KQ(e,t,n,r){return e===127||e===169&&t===254||e===0}function CXe(e){let t=e.indexOf("%"),r=(t>=0?e.slice(0,t):e).toLowerCase().split("::");if(r.length>2)return;let o=r[0]?r[0].split(":"):[],s=r.length===2&&r[1]?r[1].split(":"):[],i=r.length===2?s:o,a=[],c=i.at(-1);if(c!==void 0&&c.includes(".")){let m=c.split(".").map(Number);if(m.length!==4||m.some((h)=>!Number.isInteger(h)||h<0||h>255))return;a=m,i.pop()}let l=(m)=>{let h=[];for(let _ of m){if(!/^[0-9a-f]{1,4}$/.test(_))return;let y=parseInt(_,16);h.push(y>>8,y&255)}return h},u=l(r.length===2?o:[]),d=l(i);if(u===void 0||d===void 0)return;let f=u.length+d.length+a.length;if(f>16||r.length===1&&f!==16)return;return[...u,...Array(16-f).fill(0),...d,...a]}function kXe(e){return GQ(e)&&e[4]===0&&e[5]===1}function GQ(e){return e[0]===0&&e[1]===100&&e[2]===255&&e[3]===155}function RXe(e){let t=[];if(e[0]===32&&e[1]===2)t.push(e.slice(2,6));let n=e.slice(0,10).every((a)=>a===0),r=n&&e[10]===255&&e[11]===255,o=n&&e[10]===0&&e[11]===0,s=GQ(e)&&e.slice(4,12).every((a)=>a===0),i=(e[8]===0||e[8]===2)&&e[9]===0&&e[10]===94&&e[11]===254;if(r||o||s||i)t.push(e.slice(12,16));return t}function WQ(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"");if(t.endsWith("."))t=t.slice(0,-1);if(t===""||t==="localhost"||t.endsWith(".localhost"))return!0;if(TXe.has(t))return!0;if(t.startsWith("instance-data.")&&t.endsWith(".compute.internal"))return!0;if(wXe(t)){if(BQ.has(t))return!0;let[r=0,o=0,s=0,i=0]=t.split(".").map(Number);return KQ(r,o,s,i)}if(!AXe(t))return!1;let n=CXe(t);if(n===void 0)return!0;if(kXe(n))return!0;if(n.every((r)=>r===0))return!0;if(n.slice(0,15).every((r)=>r===0)&&n[15]===1)return!0;if(t==="fd00:ec2::254")return!0;if(n[0]===254&&(n[1]??0)>=128&&(n[1]??0)<=191)return!0;return RXe(n).some((r)=>{let[o=0,s=0,i=0,a=0]=r;return KQ(o,s,i,a)||BQ.has(`${o}.${s}.${i}.${a}`)})}var VQ=["bash","powershell"];var bh=L(()=>g().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function OXe(){let e=T({type:j("command").describe("Shell command hook type"),command:g().describe("Shell command to execute"),args:N(g()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:bh(),shell:V(VQ).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:X().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution"),async:R().optional().describe("If true, hook runs in background without blocking"),asyncRewake:R().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:g().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:g().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".'),cloud:V(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'device': offer it to the cloud session and run it here even when its script sits where the cloud session can write on this machine or cannot be pinned — the author accepts that the session may have changed files this hook executes. 'skip': never offer it to cloud sessions. Omit for the default: a command hook whose script could be read and pinned and lies outside everything the cloud session can write here is offered; other command hooks are not. Applies to this entry only: the same hook written in another settings scope keeps its own setting. An unrecognised value reads as 'skip' (the file still loads; the hook stays on this machine).")}),t=T({type:j("prompt").describe("LLM prompt hook type"),prompt:g().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:bh(),timeout:X().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:g().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:R().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")}),n=T({type:j("mcp_tool").describe("MCP tool hook type"),server:g().describe("Name of an already-configured MCP server to invoke"),tool:g().describe("Name of the tool on that server to call"),input:Z(g(),Te()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:bh(),timeout:X().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")}),r=T({type:j("http").describe("HTTP hook type"),url:g().url().describe("URL to POST the hook input JSON to"),if:bh(),timeout:X().positive().optional().describe("Timeout in seconds for this specific request"),headers:Z(g(),g()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:N(g()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution"),cloud:V(["device","skip"]).optional().catch("skip").describe("@internal Where this hook may run when a cloud session is driven from this machine. 'skip': never offer it to cloud sessions; 'device' or omitted: offered (an HTTP hook has no script to pin). Applies to this entry only. An unrecognised value reads as 'skip' (the file still loads).")}),o=T({type:j("agent").describe("Agentic verifier hook type"),prompt:g().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:bh(),timeout:X().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:g().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:e,PromptHookSchema:t,HttpHookSchema:r,AgentHookSchema:o,McpToolHookSchema:n}}var EE=L(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r,McpToolHookSchema:o}=OXe();return nc("type",[...[e,t,n,r,o]])}),WD=L(()=>T({matcher:g().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:N(EE()).describe("List of hooks to execute when the matcher matches")})),yc=L(()=>$3(V(ps),N(WD())));function xE(){return new Set(EE().options.map((e)=>e.shape.type.value))}function PXe(e,t){if(!e||typeof e!=="object"||Array.isArray(e)){let o=gc(e);return{problem:`Hook entry must be an object; received ${o}`,received:o,aboutType:!1}}let n=e.type;if(typeof n!=="string"){let o=gc(n);return{problem:n===void 0?'Hook entry has no "type"':`Hook entry "type" must be a string; received ${o}`,received:o,aboutType:!0}}if(!t.has(n)){let o=_g(n);return{problem:`Unknown hook type "${o}"`,received:o,aboutType:!0}}let r=EE().safeParse(e);if(!r.success)return{problem:`Invalid ${n} hook (${qQ(r.error)})`,received:n,aboutType:!1};return}function qQ(e){return e.issues.map((t)=>t.path.length>0?`${t.path.join(".")}: ${t.message}`:t.message).join("; ")}function vE(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;if(!("matcher"in e)&&Object.keys(e).some((n)=>ps.includes(n)))return!1;let t=e.hooks;if(Array.isArray(t))return t.length>0;return!!t&&typeof t==="object"&&(("matcher"in e)||typeof t.type==="string")}function _c(e,t=3,{matchersCount:n=!0,unscannedKeys:r=IXe,inHooksList:o=!1}={}){if(JQ(e))return!0;if(n&&vE(e))return!0;if(t===0||!e||typeof e!=="object")return!1;if(Array.isArray(e))return e.some((s)=>_c(s,t-1,{matchersCount:n,unscannedKeys:r,inHooksList:o}));if(o&&typeof e.type==="string")return!1;return Object.entries(e).some(([s,i])=>!r.has(s)&&_c(i,t-1,{unscannedKeys:r,matchersCount:n&&!ps.includes(s),inHooksList:s==="hooks"&&Array.isArray(i)}))}function ZQ(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return!1;return JQ(e)||Object.entries(e).some(([n,r])=>n!=="hooks"&&!t.has(n)&&_c(r,3,{unscannedKeys:t,matchersCount:!ps.includes(n)}))}var IXe=new Set,YQ=new Set(["mcpServers","managedMcpServers","lspServers","pluginConfigs","enabledPlugins","extraKnownMarketplaces","env","skillOverrides","modelSettings"]),DXe=new Set(["metadata","mcpServers","lspServers"]),Gqt=new Set([...DXe,"experimental"]);function JQ(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;return Object.entries(e).some(([t,n])=>Eh.has(t)&&n!==null&&n!==void 0&&!(Array.isArray(n)&&n.length===0))}function VD(e){if(vE(e))return!0;if(Array.isArray(e))return e.some(VD);if(!e||typeof e!=="object")return!1;return Object.entries(e).some(([t,n])=>Eh.has(t)&&n!==null&&n!==void 0&&!(Array.isArray(n)&&n.length===0))}var Eh=new Set(["PreToolUse","PermissionRequest"]);function XQ(e,t){if(!Array.isArray(e))return{stripped:[],unloadableGuards:[]};let n=Eh.has(t),r=xE(),o=WD(),s=[],i=[];for(let a=e.length-1;a>=0;a--){let c=e[a],l=(m,h)=>{if(!n)e.splice(a,1);s.push({matcherIndex:a,hookIndex:void 0,path:`${a}`,problem:m,received:h,aboutType:!1})};if(_c(c,3,{matchersCount:!1})){(n?s:i).push({matcherIndex:a,hookIndex:void 0,path:`${a}`,problem:"holds PreToolUse/PermissionRequest hooks where a matcher was expected",received:gc(c),aboutType:!1});continue}if(!c||typeof c!=="object"||Array.isArray(c)){l(`Hook matcher must be an object; received ${gc(c)}`,gc(c));continue}let u=c.hooks;if(!Array.isArray(u)){l(`Hook matcher "hooks" must be an array of hook entries; received ${gc(u)}`,gc(u));continue}let d=[];for(let m=u.length-1;m>=0;m--){let h=PXe(u[m],r);if(h!==void 0){if(!n)u.splice(m,1);d.push({matcherIndex:a,hookIndex:m,path:`${a}.hooks.${m}`,...h})}}let f=o.safeParse(n?{...c,hooks:[]}:c);if(!f.success){l(`Invalid hook matcher (${qQ(f.error)})`,"matcher");continue}s.push(...d)}return s.reverse(),i.reverse(),n?{stripped:[],unloadableGuards:s}:{stripped:s,unloadableGuards:i}}var Sc="a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed";function gc(e){if(e===null||e===void 0)return String(e);if(Array.isArray(e))return"an array";let t=typeof e;return`${t==="object"?"an":"a"} ${t}`}var QQ="github.com",qqt=[`git@${QQ}:`,`ssh://git@${QQ}/`];var LXe=/[:/\\?#@\s]/;function NXe(e){let t=eee(e.replace(/[\t\n\r]/g,"").toLowerCase());if(t===""||LXe.test(t))return t;try{let n=new URL(`https://${t}`);if(n.username!==""||n.password!==""||n.port!==""||n.pathname!=="/"||n.search!==""||n.hash!=="")return t;return eee(n.hostname)}catch{return t}}var Zqt=tE(function(t){let n=NXe(t);while(n.startsWith("www."))n=n.slice(4);return n},(e)=>e,50);function eee(e){let t=e.length;while(t>0&&e[t-1]===".")t--;return e.slice(0,t)}function MXe(e){return Yy($Xe(gg(e))).replace(/ {2,}/g," ").trim()}var UXe=/\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/g,FXe=4;function $Xe(e){let t=e;for(let n=0;n<FXe;n++){let r=t.replace(UXe,"");if(r===t)break;t=r}return t}function qD(e,t=160){return zXe(MXe(jXe(e,t)).normalize("NFC").replace(/[`\uff40\u02cb\u1fef\u2035]/g,"'").replace(HXe,""),t)}function zXe(e,t=2000){return e.length>t?`${Qc(e,t)}…`:e}function jXe(e,t){let n=Qc(e,t*8);if(n.length===e.length)return n;let r=/\x1b(?:[\]PX^_][^\x1b\x07]*\x1b?|\[[\x30-\x3f]*[\x20-\x2f]*)$/.exec(n);if(r===null)return n;let o=e.slice(r.index);return(o[1]==="["?/^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]/.test(o):/^\x1b[\]PX^_][^\x1b\x07]*(?:\x07|\x1b\\)/.test(o))?n.slice(0,r.index):n}var HXe=/(?<![^\s\p{P}])\p{M}+/gu;var QD=500,GXe=32;function iee(){return{claudeaiPluginId:g().max(128).optional().catch(void 0),archiveSha256:yee().optional().catch(void 0)}}function aee(){return{sourceCommand:g().max(QD+20).optional().catch(void 0).describe("The `command`-source command the user accepted at explicit install/update. The once-per-session background re-resolve only runs while the marketplace entry still declares this exact command; a changed command (or an entry that became command-sourced later) is skipped with a warning until the user runs an explicit update."),sourceProducerPath:g().max(4096).refine(tee,{message:"must be an absolute path"}).optional().catch(void 0).describe("The directory a `command`-source plugin was last resolved to (what its command printed). Served in place in link mode and re-copied every session in copy mode, so the sandbox write-denies it; refreshed on every install/update, including no-op updates that resolve to a new location."),previousProducerPaths:N(Te()).transform((e)=>e.filter((t)=>typeof t==="string"&&t.length<=4096&&tee(t)).slice(-GXe)).optional().catch(void 0).describe("Producer directories this installation was resolved to before the current one (most recent last, bounded). A concurrent older session may still serve one of them, so the sandbox keeps write-denying them too.")}}function tee(e){return BXe.isAbsolute(e)||KXe.isAbsolute(e)}var cee=/[^\x20-\x7E]| {4,}/;function eL(){return g().max(QD,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((e)=>!cee.test(e),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var WXe=new Set(["claude-community","claude-plugins-community","healthcare"]),VXe=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins","claude-tag-plugins"]),lee=new Set([...VXe,...WXe]);var qXe=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,ZXe=/[^\u0020-\u007E]/;function YXe(e){if(lee.has(e.toLowerCase()))return!1;if(ZXe.test(e))return!0;return qXe.test(e)}var os=L(()=>g().startsWith("./")),bc=L(()=>os().endsWith(".json")),nee=L(()=>ue([j("."),os()])),ree=L(()=>ue([os().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),g().url().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),YD=L(()=>os().endsWith(".md")),JD=L(()=>ue([YD(),os()])),uee={inline:"--plugin-dir session plugins",builtin:"built-in plugins","skills-dir":"plugins auto-loaded from .claude/skills/",synced:"plugins synced from your claude.ai account"};function JXe(e){return Object.hasOwn(uee,e)}var dee=L(()=>g().min(1,"Marketplace must have a name").refine((e)=>!e.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((e)=>!xee.test(e),{message:"Marketplace name cannot contain control or bidirectional-formatting characters"}).refine((e)=>!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&e!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((e)=>!YXe(e),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).superRefine((e,t)=>{let n=e.toLowerCase();if(!JXe(n))return;t.addIssue({code:"custom",message:`Marketplace name "${n}" is reserved for ${uee[n]}`})})),wE=L(()=>g().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).refine((e)=>!xee.test(e),{message:"Plugin name cannot contain control or bidirectional-formatting characters"})),tL=L(()=>T({name:g().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:g().optional().describe("Contact email for support or feedback"),url:g().optional().describe("Website, GitHub profile, or organization URL")})),XXe=L(()=>T({$schema:g().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:wE().describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:g().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:g().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:g().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:tL().optional().describe("Information about the plugin creator or maintainer"),homepage:g().url().optional().describe("Plugin homepage or documentation URL"),repository:g().optional().describe("Source code repository URL"),license:g().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:N(g()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:R().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:N(q7e()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`),metadata:tt((e)=>Ge(e)?e:void 0,Z(g(),Te()).optional()).describe("Free-form metadata for the plugin author's own use (e.g. entitlement or catalog fields). Preserved on the parsed manifest but not read by Claude Code.")})),QXe=1,m4t=L(()=>T({description:g().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:LS(()=>yc()).optional().describe("The hooks provided by the plugin, in the same format as the one used for settings"),modules:N(g()).max(QXe,{message:"hooks.json `modules` names one hooks module per plugin; a second entry is refused"}).optional().describe("The hooks module: one path, relative to this hooks.json, of a module exporting register(on). What it hooks and calls is read from its source before it loads; `claude plugin validate` shows the result.")}).refine((e)=>e.hooks!==void 0||(e.modules?.length??0)>0,{message:"hooks.json must have `hooks` (the hook matchers) or `modules` (hooks modules), or both"})),e7e=L(()=>T({hooks:ue([bc().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),LS(()=>yc()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),N(ue([bc().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),LS(()=>yc()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),t7e=L(()=>T({source:JD().optional().describe("Path to command markdown file, relative to plugin root"),content:g().optional().describe("Inline markdown content for the command"),description:g().optional().describe("Command description override"),argumentHint:g().optional().describe('Hint for command arguments (e.g., "[file]")'),model:g().optional().describe("Default model for this command"),allowedTools:N(g()).optional().describe("Tools allowed when command runs")}).refine((e)=>e.source&&!e.content||!e.source&&e.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),n7e=L(()=>T({commands:ue([JD().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both."),N(JD().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),Z(g(),t7e()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),r7e=L(()=>T({agents:ue([YD().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both."),N(YD().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),o7e=L(()=>T({skills:ue([nee().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself). Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan).'),N(nee().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself).')).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),s7e=L(()=>ue([g(),N(g())])),pee=L(()=>T({outputStyles:ue([os().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both."),N(os().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),i7e=L(()=>g().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),a7e=16,c7e=L(()=>T({id:i7e(),remote:g().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:g().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),l7e=L(()=>T({syntaxHighlighting:T({hljsLanguages:N(c7e()).max(a7e)}).strict()})),fee=L(()=>T({themes:ue([os().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both."),N(os().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),u7e=L(()=>T({})),oee=L(()=>g().min(1)),d7e=L(()=>g().min(2).refine((e)=>e.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),p7e=L(()=>T({mcpServers:ue([bc().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),ree().describe("Path or URL to MCPB file containing MCP server configuration"),Z(g(),bE()).describe("MCP server configurations keyed by server name"),N(ue([bc().describe("Path to MCP servers configuration file"),ree().describe("Path or URL to MCPB file"),Z(g(),bE()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),mee=L(()=>T({type:V(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:g().describe("Human-readable label shown in the config dialog"),description:g().describe("Help text shown beneath the field in the config dialog"),required:R().optional().describe("If true, validation fails when this field is empty"),default:ue([g(),X(),R(),N(g())]).optional().describe("Default value used when the user provides nothing"),multiple:R().optional().describe("For string type: allow an array of strings"),sensitive:R().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:X().optional().describe("Minimum value (number type only)"),max:X().optional().describe("Maximum value (number type only)")}).strict()),f7e=L(()=>T({userConfig:Z(g().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),mee()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),m7e=L(()=>T({channels:N(T({server:g().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:g().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:Z(g(),mee()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),see=L(()=>UP({command:g().min(1).refine((e)=>{if(e.includes(" ")&&!e.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:N(oee()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:Z(d7e(),oee()).refine((e)=>Object.keys(e).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:V(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:Z(g(),g()).optional().describe("Environment variables to set when starting the server"),initializationOptions:Te().optional().describe("Initialization options passed to the server during initialization"),settings:Te().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:g().optional().describe("Workspace folder path to use for the server"),startupTimeout:X().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:X().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:R().optional().describe("Whether to restart the server if it crashes"),maxRestarts:X().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:R().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),h7e=L(()=>UP({name:g().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:g().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd — prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:g().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:ue([j("always"),g().startsWith("on-skill-invoke:").refine((e)=>e.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),g7e=L(()=>N(h7e()).refine((e)=>new Set(e.map((t)=>t.name)).size===e.length,{message:"Monitor names must be unique within a plugin"})),hee=L(()=>T({monitors:ue([bc().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),g7e()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),_7e=L(()=>T({lspServers:ue([bc().describe("Path to .lsp.json configuration file relative to plugin root"),Z(g(),see()).describe("LSP server configurations keyed by server name"),N(ue([bc().describe("Path to LSP configuration file"),Z(g(),see()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),gee=L(()=>g().refine((e)=>!e.includes("..")&&!e.includes("//"),"Package name cannot contain path traversal patterns").refine((e)=>{let t=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,n=/^[a-z0-9][a-z0-9-._]*$/;return t.test(e)||n.test(e)},"Invalid npm package name format")),y7e=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,S7e=/^[0-9a-f]{64}$/;var b7e=64;var E7e=L(()=>T({sha256:g().regex(S7e)}));function x7e(e){let t=Z(g(),Te()).safeParse(e);if(!t.success)return;let n=Object.create(null),r=0;for(let[o,s]of Object.entries(t.data)){if(r>=b7e)break;let i=E7e().safeParse(s);if(y7e.test(o)&&i.success)n[o]=i.data,r++}return r>0?n:void 0}var v7e=L(()=>T({binaries:Te().transform(x7e).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),w7e=L(()=>T({settings:Z(g(),Te()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),A7e=L(()=>T({experimental:tt((e)=>Ge(e)?e:void 0,T({...fee().partial().shape,...l7e().partial().shape,...hee().partial().shape,...pee().partial().shape,evals:s7e().optional().describe("Directory of eval cases for the plugin evaluation harness, relative to the plugin root (default: evals/). A list is accepted; its first entry is the case directory.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))}));var T7e=L(()=>T({...XXe().shape,...e7e().partial().shape,...n7e().partial().shape,...r7e().partial().shape,...o7e().partial().shape,...pee().partial().shape,...fee().partial().shape,...u7e().shape,...m7e().partial().shape,...p7e().partial().shape,..._7e().partial().shape,...hee().partial().shape,...w7e().partial().shape,...f7e().partial().shape,...v7e().partial().shape,...A7e().partial().shape})),_ee=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]),ld=L(()=>nc("source",[T({source:j("url"),url:g().url().describe("Direct URL to marketplace.json file"),headers:Z(g(),g()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:eL().optional().describe("Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.")}),T({source:j("github"),repo:g().describe('GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value '+"must name a single repository — a wildcard is taken literally and fails to clone."),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:g().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:N(g()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:R().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),T({source:j("git"),url:g().describe("Full git repository URL"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:g().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:N(g()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:R().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),T({source:j("npm"),package:gee().describe("NPM package containing marketplace.json")}),T({source:j("file"),path:g().describe("Local file path to marketplace.json")}),T({source:j("directory"),path:g().describe("Local directory containing .claude-plugin/marketplace.json")}),T({source:j("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),T({source:j("hostPattern"),hostPattern:g().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),T({source:j("pathPattern"),pathPattern:g().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),T({source:j("settings"),name:dee().refine((e)=>!lee.has(e.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:N(O7e()).describe("Plugin entries declared inline in settings.json"),owner:tL().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),ZD=L(()=>g().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),yee=L(()=>g().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest")),C7e="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function k7e(e){try{let t=new URL(e);return t.protocol==="https:"&&!WQ(t.hostname)}catch{return!1}}var R7e=L(()=>T({source:j("archive"),url:g().url().refine(k7e,{message:C7e}).describe("HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive "+"or nested one directory deep — a single wrapping directory is stripped."),sha256:yee().optional().describe("SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json "+"version, else the entry version, else this digest) — changing only the digest "+"while a version is declared does not trigger an update.")}).describe("Plugin distributed as a zip archive fetched over HTTPS — for hosting on any "+"static file server or artifact repository (S3, GitLab, nginx) with no git or npm on the client. Authentication: the entry's own `headers` / `headersHelper` (bound to this URL), overlaid on the enclosing url-source marketplace's headers (static or `headersHelper`-minted) when the archive shares its origin.")),See=L(()=>ue([tt((e)=>e==="."?"./":e,os()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),T({source:j("npm"),package:gee().or(g().refine((e)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(e)||!e.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:g().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:g().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),T({source:j("url"),url:g().describe("Full git repository URL (https:// or git@)"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ZD().optional().describe("Specific commit SHA to use")}),T({source:j("github"),repo:g().describe("GitHub repository in owner/repo format"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ZD().optional().describe("Specific commit SHA to use")}),T({source:j("git-subdir"),url:g().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:g().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:ZD().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),R7e(),T({source:j("command"),command:g().min(1).max(QD,{message:"command must not be longer than the install consent UI can display"}).refine((e)=>!cee.test(e),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:X().int().positive().max(600).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:V(["copy","link"]).optional().describe("copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory "+"in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay "+"valid while Claude Code runs, and a different printed path is what signals new content.")}).describe("Plugin directory produced by a locally installed tool (e.g. an IDE that renders its plugin for the currently selected SDK). Claude Code runs the command, copies the directory it prints, and re-runs it in the background at startup to pick up changes."),T({source:j("unsupported"),error:g().optional()}).describe("Placeholder for source types this Claude Code version does not recognize, or a known type whose fields failed validation (then `error` "+"holds the reason). Never authored by hand — PluginMarketplaceSchema rewrites "+"unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with an actionable message.")])),O7e=L(()=>T({name:wE().describe("Plugin name as it appears in the target repository"),source:See().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:g().optional(),version:g().optional(),strict:R().optional(),headers:Z(g(),g()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:eL().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine((e)=>typeof e.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((e)=>typeof e.source==="string"||e.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."}));var P7e=L(()=>T({cli:N(g().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:N(g().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) — exact, case-insensitive match against '+"hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path."),filesRead:N(g().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) — the plugin is relevant when a file Claude has read '+"this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive."),manifestDeps:N(T({file:g().max(256),pattern:g().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: "+"`file` matches the manifest filename (package.json, go.mod, requirements.txt, …); "+"`pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:N(g().max(256)).max(10).optional().describe('Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) — the plugin is relevant when the '+`session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),I7e=L(()=>T({topic:g().max(64).optional().describe('What the user is working with when this plugin is relevant — fills "Working with {topic}?". '+'Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:P7e().optional().describe("Matchers that determine when the plugin is relevant.")})),D7e=L(()=>T7e().partial().extend({name:wE().describe("Unique identifier matching the plugin name"),source:See().describe("Where to fetch the plugin from"),headers:Z(g(),g()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:eL().optional().describe("Command that prints a JSON object of HTTP headers for fetching this plugin's archive (e.g. a short-lived auth token); overrides this entry's `headers` and the marketplace's. Runs only when the user installs or updates this plugin, never during catalog browse. An entry that sets it must be `strict: false` with its manifest inlined here, so consent is informed from the entry alone before the command runs."),category:g().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:N(g()).optional().describe("Tags for searchability and discovery"),strict:R().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:tt((e)=>Ge(e)?e:void 0,I7e().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),L7e=L(()=>T({name:wE()}));function N7e(e){let t=D7e();return e.flatMap((n,r)=>{let o=t.safeParse(n);if(o.success){let a=o.data.source;if(typeof a==="object"&&a.source==="unsupported"&&a.error!==void 0)return[{...o.data,source:{source:"unsupported"}}];return[o.data]}let s=L7e().safeParse(n).data?.name,i=o.error.issues.map((a)=>`${a.path.join(".")}: ${a.message}`).join(", ");if(s){ce(`Stubbing unparseable marketplace plugin entry (${s}): ${i}`,{level:"warn"});let a=bee(Ge(n)?n.source:void 0)?H7e:nL(n)?void 0:U7e(o.error.issues)??AE(o.error.issues);return[{name:s,source:{source:"unsupported",...a&&{error:a}},strict:!0}]}return ce(`Dropping unparseable marketplace plugin entry (index ${r}): ${i}`,{level:"warn"}),[]})}var M7e=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function nL(e){if(!e||typeof e!=="object")return!1;let t=e.source;if(!t||typeof t!=="object")return!1;let n=t.source;return typeof n==="string"&&!M7e.has(n)}function U7e(e){let t=e.find((r)=>r.path.length===1&&r.path[0]==="source");if(!t||t.code!=="invalid_union")return;let n=t.errors.find((r)=>!r.some((o)=>o.path.length===0||o.code==="invalid_value"&&o.path[0]==="source"));if(!n||n.length===0)return;return AE(n.map((r)=>({...r,path:["source",...r.path]})))}var F7e=/^[A-Za-z0-9_$.-]{1,40}$/;function ss(e){return F7e.test(e)?e:"<key>"}var $7e=3,z7e=160;function AE(e){let t=e.slice(0,$7e).map((r)=>{let o=r.path.map(String).map((i)=>ss(i)).join("."),s=r.code==="unrecognized_keys"?`Unrecognized ${r.keys.length===1?"field":"fields"}: ${r.keys.map(ss).join(", ")}`:qD(r.message,z7e);return o?`${o}: ${s}`:s}),n=e.length-t.length;return n>0?`${t.join(", ")} (+${n} more)`:t.join(", ")}var j7e=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,H7e='Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.';function bee(e){return typeof e==="string"&&j7e.test(e)&&!e.includes("..")}function B7e(e){if(typeof e!=="string"||e===""||e.startsWith("/")||e.includes("\\")||e.includes(":"))return;let t=e.replace(/^\.\//,"").replace(/\/+$/,"");if(t===""||t===".")return".";if(t.split("/").some((n)=>n===""||n==="."||n===".."))return;return t}function K7e(e,t){if(t===void 0||!Ge(e)||!bee(e.source))return e;let n=t==="."?`./${e.source}`:`./${t}/${e.source}`;return{...e,source:n}}function G7e(e){if(!Ge(e)||!Array.isArray(e.plugins))return e;let t=Ge(e.metadata)?B7e(e.metadata.pluginRoot):void 0;if(t===void 0)return e;return{...e,plugins:e.plugins.map((n)=>K7e(n,t))}}var W7e=L(()=>T({$schema:g().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:dee(),version:g().optional().describe("Marketplace manifest version"),description:g().optional().describe("Human-readable description of this marketplace"),owner:tL().describe("Marketplace maintainer or curator information"),plugins:N(Te()).transform(N7e).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:R().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:T({pluginRoot:g().optional().describe('Base directory for bare plugin source names, relative to the marketplace root (e.g. "./plugins" resolves "source": "formatter" as ./plugins/formatter). Sources that already start with "./" are unaffected.'),version:g().optional().describe("Marketplace version"),description:g().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:N(g()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:Z(g(),g().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name → current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),h4t=L(()=>tt(G7e,W7e())),XD="[A-Za-z0-9][-A-Za-z0-9._]*",g4t=new RegExp(`^${XD}$`);var Eee=L(()=>g().regex(new RegExp(`^${XD}@${XD}$`),"Plugin ID must be in format: plugin@marketplace")),_4t=new RegExp(`[@:\\s/\\\\${xu}]`,"u"),y4t=new RegExp(`[${xu}]`,"u"),xee=/[\p{Cc}\u200E\u200F\u202A-\u202E\u2066-\u2069]/u,V7e=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,q7e=L(()=>ue([g().regex(V7e,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((e)=>e.replace(/@\^[^@]*$/,"")),T({name:g().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:g().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((e)=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),Z7e=L(()=>T({version:g().describe("Currently installed version"),installedAt:g().describe("ISO 8601 timestamp of installation"),lastUpdated:g().optional().describe("ISO 8601 timestamp of last update"),installPath:g().describe("Absolute path to the installed plugin directory"),gitCommitSha:g().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:g().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:R().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs)."),...iee(),...aee()})),S4t=L(()=>T({version:j(1).describe("Schema version 1"),plugins:Z(Eee(),Z7e()).describe("Map of plugin IDs to their installation metadata")})),Y7e=L(()=>V(["managed","user","project","local"])),J7e=L(()=>T({scope:Y7e().describe("Installation scope"),projectPath:g().optional().describe("Project path (required for project/local scopes)"),installPath:g().describe("Absolute path to the versioned plugin directory"),version:g().optional().describe("Currently installed version"),installedAt:g().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:g().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:g().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:g().optional().describe("Tag-derived semver this install resolved to"),auto:R().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...iee(),...aee()})),b4t=L(()=>T({version:j(2).describe("Schema version 2"),plugins:Z(Eee(),N(J7e())).describe("Map of plugin IDs to arrays of installation entries")})),X7e=L(()=>T({source:ld().describe("Where to fetch the marketplace from"),installLocation:g().describe("Local cache path where marketplace manifest is stored"),lastUpdated:g().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:R().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),E4t=L(()=>Z(g(),X7e()));var TE=["aspell","hunspell","ispell"];var vee=2147483647;var Q7e=["autoMode","deepLink","voice","briefView","screenReader"],rL={},CE={autoMode:{buildGate:()=>!1,shape:()=>rL,permissionsShape:()=>rL,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:V(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:R().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:V(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>rL}};function vh(){return Q7e.filter((e)=>CE[e].buildGate())}function wee(e){let t={};for(let n of e)t={...t,...CE[n].shape()};return t}function Aee(e){let t={};for(let n of e)t={...t,...CE[n].permissionsShape?.()};return t}function Tee(e){let t=[];for(let n of e)t.push(...CE[n].permissionModes?.()??[]);return t}var Cee={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",AgentOutput:"TaskOutput",BashOutput:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function oL(e){return Object.hasOwn(Cee,e)?Cee[e]:e}var kee="workspace",R4t=`mcp__${kee}__bash`,O4t=`mcp__${kee}__web_fetch`;function kE(e){return e.includes("*")}function eQe(e){return e.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function tQe(e){return nQe(e).replaceAll("\\\\","\\")}function nQe(e){return e.replaceAll("\\(","(").replaceAll("\\)",")")}function sL(e){let t=rQe(e,"("),n=oQe(e,")");if(t===-1&&n===-1)return{kind:"bare"};let r=e.substring(0,t);if(t===-1||n<=t||n!==e.length-1||/[()]/.test(r))return{kind:"malformed"};return{kind:"call",toolName:r,rawContent:e.substring(t+1,n)}}function Ree(e){let t=sL(e);if(t.kind!=="call"||!t.toolName)return{toolName:oL(e)};if(t.rawContent===""||t.rawContent==="*")return{toolName:oL(t.toolName)};let n=tQe(t.rawContent);return{toolName:oL(t.toolName),ruleContent:n}}function RE(e){if(!e.ruleContent)return e.toolName;let t=eQe(e.ruleContent);return`${e.toolName}(${t})`}function rQe(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let r=0,o=n-1;while(o>=0&&e[o]==="\\")r++,o--;if(r%2===0)return n}return-1}function oQe(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let r=0,o=n-1;while(o>=0&&e[o]==="\\")r++,o--;if(r%2===0)return n}return-1}function iL(e){let t=e.split("__"),[n,r,...o]=t;if(n!=="mcp"||!r)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:r,toolName:s}}var OE={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(e)=>{if(e.includes("*")||e.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(e)=>{if(e.includes("://")||e.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!e.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function aL(e){return OE.filePatternTools.includes(e)}function Oee(e){return OE.bashPrefixTools.includes(e)}function Pee(e){return Object.hasOwn(OE.customValidation,e)?OE.customValidation[e]:void 0}function Nee(e,t){let n=0,r=t-1;while(r>=0&&e[r]==="\\")n++,r--;return n%2!==0}function Iee(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t&&!Nee(e,r))n++;return n}var sQe=/(?:^|[^\\])\\[()]/;function iQe(e){return sQe.test(e)&&Iee(e,"(")!==Iee(e,")")}var aQe=/^(?:[|&;<>]|\d+[<>])/;function cQe(e){return aQe.test(e)}function Dee(e){for(let t=0;t<e.length;t++)if(e[t]==="*"&&!Nee(e,t))return!0;return!1}function lQe(e){if(e.endsWith(":*"))return;let t=e.trim().split(/\s+/).filter(Boolean),n=t[0];if(t.length<3||n===void 0||Dee(n))return;let r=!1;for(let o of t.slice(1)){if(cQe(o))return;if(Dee(o)){r=!0;continue}if(o.startsWith("-"))continue;return r?n:void 0}return}function Lee(e){if(!kE(e))return null;let t=iL(e);if(t&&!kE(t.serverName))return null;return{valid:!1,error:`Wildcard tool name "${e}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function cL(e,t){if(!e||e.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let n=sL(e);if(n.kind==="malformed")return{valid:!1,error:"Malformed Tool(content) rule",suggestion:'Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal'};if(n.kind==="call"&&n.rawContent===""){if(!n.toolName)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${n.toolName}" without parentheses`,examples:[`${n.toolName}`,`${n.toolName}(some-pattern)`]}}let r=Ree(e),o=iL(r.toolName);if(o){if(n.kind==="call")return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${r.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)};if(t==="allow"){let i=Lee(r.toolName);if(i)return i}return{valid:!0}}if(!r.toolName||r.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(t==="allow"){let i=Lee(r.toolName);if(i)return i}if(!r.toolName.includes("_")&&r.toolName[0]!==r.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Cd(String(r.toolName))}"`};if(n.kind==="call"&&iQe(n.rawContent)){let i=aL(r.toolName);return{valid:!1,error:'Ambiguous "\\(" or "\\)" beside an unescaped parenthesis',suggestion:i?"Write a Windows path with forward slashes, or spell a literal parenthesis as [(] or [)]":'Double a backslash that is a path separator ("\\\\("), and escape literal parentheses in pairs',examples:i?[`${r.toolName}(C:/Projects/(drafts)/**)`,`${r.toolName}(C:\\Projects\\[(]drafts)\\**)`]:[`${r.toolName}(C:\\tools\\\\(x86)\\run.exe *)`]}}let s=Pee(r.toolName);if(s&&r.ruleContent!==void 0){let i=s(r.ruleContent);if(!i.valid)return i}if(Oee(r.toolName)&&r.ruleContent!==void 0){let i=r.ruleContent;if(i.includes(":*")&&!i.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(i===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]};if(t==="allow"){let a=lQe(i);if(a!==void 0){let c=a==="git",l=c?" For git, options such as -c and --exec-path can run arbitrary commands.":"",u=c?" (for example Bash(git status *))":"";return{valid:!0,warning:`${RE(r)} has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt.${l} Replace that * with the exact value you mean, or only use * after the subcommand${u}.`}}}}if(aL(r.toolName)&&r.ruleContent!==void 0){if(r.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${r.toolName}(*.ts) - matches .ts files`,`${r.toolName}(src/**) - matches all files in src`,`${r.toolName}(**/*.test.ts) - matches test files`]}}if(r.ruleContent!==void 0){let i=r.toolName==="Write"||r.toolName==="NotebookEdit"||r.toolName==="MultiEdit"?"Edit":r.toolName==="Glob"?"Read":void 0;if(i!==void 0&&!r.ruleContent.includes(":*"))return{valid:!0,warning:`${RE(r)} is not matched by file permission checks — only ${i}(path) rules are. Use ${RE({toolName:i,ruleContent:r.ruleContent})} instead (${i} rules cover all file-${i==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var lL=L(()=>Uee()),Mee=L(()=>Uee("allow"));function Uee(e){return g().superRefine((t,n)=>{let r=cL(t,e);if(!r.valid){let o=r.error;if(r.suggestion)o+=`. ${r.suggestion}`;if(r.examples&&r.examples.length>0)o+=`. Examples: ${r.examples.join(", ")}`;n.addIssue({code:Vr.custom,message:o,params:{received:t}})}})}var wh=["accept","hold","refuse"],DE=["off","basic","full"],uQe=L(()=>Z(g(),A2e()));function Vee(e){return T({allow:N(Mee()).optional().describe("List of permission rules for allowed operations"),deny:N(lL()).optional().describe("List of permission rules for denied operations"),ask:N(lL()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:tt(Sh,V([...ad,...Tee(e)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:V(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),blockReadsOutsideWorkingDirectories:R().optional().describe('Refuse file-tool reads (Read, Grep, Glob, LSP) outside the working directories in every permission mode; true in any settings source wins. Also set when the user picks "block" on the one-time auto-mode prompt for a read outside the working directories.'),...Aee(e),additionalDirectories:N(g()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var f6t=L(()=>Vee(vh())),dQe=L(()=>ue([g(),T({}).passthrough().describe('{ id: stable id (letters, digits, ".", "_", "-"; max 64), text: the tip (max 500 characters, one line), cooldownSessions?: sessions to wait before showing it again (default 0), priority?: tie-break weight among never-shown tips (default 0) }')])),pQe=L(()=>tt((e)=>Array.isArray(e)?e.filter((t)=>typeof t==="string"||!!t&&typeof t==="object"&&!Array.isArray(t)):[],N(dQe()))),pL=L(()=>T({source:ld().describe("Where to fetch the marketplace from"),installLocation:g().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:R().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),fL=L(()=>{let e=()=>X().min(0).max(1e4);return T({input:e(),output:e(),cacheRead:e(),cacheWrite:e()})}),mL=L(()=>X().gt(0).lte(1).optional()),hL=L(()=>T({model:g().describe('Model to select, taken verbatim: an alias ("opus"), an Anthropic model ID, or a provider-format ID (Vertex, Bedrock, gateway). Same values --model accepts.'),label:g().optional().describe("Row title. Defaults to the model name."),description:g().optional().describe("Row subtitle. Defaults to a generic description."),behavesAs:g().optional().describe("For a model this version of Claude Code does not know: the ID of a model it does know "+'(e.g. "claude-opus-4-8") whose client-side handling — prompt profile, capability and effort '+"defaults — applies to it. Changes neither the row's label nor the model ID sent. Without it, "+"a model-catalog row for a model this version does not know is not offered until Claude Code is updated.")})),LE=L(()=>T({serverName:g().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:N(g()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:g().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((e)=>df([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),NE=L(()=>T({serverName:g().min(1,"Server name must be non-empty").refine((e)=>e.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((e)=>e===e.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:N(g()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:g().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((e)=>df([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),fQe=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function mQe(e){let t=e.replaceAll("/","\\");if(Yc(t))return!1;return/^\\{2}[^\\]/.test(t)}function hQe(e){return Js(e)||/^\/network\/servers(\/|$)/i.test(e)}function gQe(e){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(e)}function _Qe(e,t,n={}){if(t==="win32"){let r=e.replaceAll("/","\\");if(Yc(r))return!1;let o=mQe(r);if(n.rejectUnc&&o)return!1;if(n.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(r)&&!o&&/^(\\|[A-Za-z]:)/.test(r))return!1}if(Wee.normalize(r)!==r)return!1;let s=r.split("\\");if(s.some((a)=>a==="."||a===".."))return!1;if(s.some((a,c)=>/[. ]$/.test(a)||a.includes(":")&&!(c===0&&/^[A-Za-z]:$/.test(a))))return!1;let i=r.startsWith("\\\\")?r.slice(2):r;if(/\\{2}/.test(i))return!1;return!r.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(r)}if(n.rejectNetworkRoot&&hQe(e))return!1;if(n.rejectMagicLinkRoot&&gQe(e))return!1;if(Gee.normalize(e)!==e)return!1;if(e.split("/").some((r)=>r==="."||r===".."))return!1;if(/\/{2}/.test(e))return!1;return!e.endsWith("/")||e==="/"}var yQe=/\.(exe|ps1)$/i;function SQe(e){return/\.ps1$/i.test(e)}function bQe(e){return SQe(e)&&/[[\]`*?]/.test(e)}var EQe='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',xQe=()=>g().describe("Absolute path to the helper executable"),Zi=(e)=>tt((t)=>t===null?void 0:t,e.optional()).optional(),vQe=vee,Fee=(e)=>X().int().min(e).transform((t)=>Math.min(t,vQe)),$ee=["path","script","defaultSettings"];function qee(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;let t=e;return $ee.some((n)=>t[n]===null)&&$ee.every((n)=>t[n]===null||t[n]===void 0)}var zee=64,IE=L(()=>T({path:xQe(),timeoutMs:Zi(Fee(1000)),refreshIntervalMs:Zi(ue([j(0),Fee(60000)]))})),Zee=()=>V(["replace","merge"]).describe("How the helper's managedSettings compose with the settings of the source that delivered this entry: 'replace' (default) — the output is the policy; 'merge' — the output is deep-merged over that source's own settings the way merged managed sources compose (helper scalars win, arrays union, objects merge — except fallbackModel, forceLoginOrgUUID, sandbox.filesystem.allowRead, sandbox.credentials.awsPairs, sandbox.ripgrep and the restriction allowlists such as allowedMcpServers, availableModels and allowedHttpHookUrls, which are the helper's whole value when it emits one; tighten a permission with a deny), so a failed helper costs only the delta");function Yee(e){return e==="continue"||e==="refuse"}var wQe=()=>tt((e)=>e===void 0||Yee(e)?e:"refuse",V(["continue","refuse"]).describe(`What happens when this entry's helper fails at startup (bad path, missing file or interpreter, non-zero exit, timeout, oversize or invalid output) and no static settings payload (this entry's own, the linux entry's on WSL, or the map's "default") applies in its place: 'refuse' — Claude Code does not start, naming the failure; 'continue' — Claude Code starts without the helper's output, on the delivering source's own settings, with a /status notice. Default: 'refuse' when the entry comes from MDM or the managed settings file, 'continue' when it comes from remote managed settings. Any other value is treated as 'refuse', with a /status notice. The install and update commands start no session and are never refused over a remote entry: they report the refusal in /status. An entry whose other fields fail validation runs no helper; from MDM or the managed settings file, any value but 'continue' on it then refuses to start Claude Code until the entry is fixed, unless a static settings payload (the entry's own, kept when it validates, the linux entry's for a wsl one, or the map's "default") serves in its place. From remote, a non-interactive session runs the helper off settings verified this session without the interactive approval, so 'refuse' there too means the helper ran and failed; a launch whose remote settings could not be verified this session (offline, fetch failed) starts without the helper regardless; and a failure first reached after the session has started (settings verified or approved mid-session, which on a machine that only ever runs non-interactively is every launch) ends a session no person watches (non-interactive, a background session no client is attached to, or a teammate session) as the refused start would have, and leaves a watched interactive one (a terminal, with or without remote control, or an attached background session) running under a /status notice with its next start refused. Background refresh failures always keep the last good output whatever this says`)),AQe=5,TQe=()=>X().int().min(0).transform((e)=>Math.min(e,AQe)).describe("How many more times to run this entry's helper when a run fails to execute — it could not be launched, exited non-zero, or was stopped at timeoutMs — before that counts as a failure (a non-negative integer; default 0, a single attempt; above 5 is treated as 5). Attempts are separated by a short randomized backoff (from 250 ms, doubling per attempt, at most 4 s each) and each attempt gets the full timeoutMs, so a start that waits on the helper can wait up to (retries + 1) × timeoutMs plus the backoff. Output the helper did produce and that was refused — oversized, not a JSON object, an invalid envelope, or settings that fail validation — is not retried, and neither is an invalid path. Applies alike at startup and on each background refresh; only once the attempts are used up do the entry's failure rules (a static settings payload in its place, onFailure, the refresh notice) apply, naming the last attempt's failure"),CQe=(e)=>(e==="windows"?j("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):j("sh",{message:"interpreter must be 'sh' on macos/linux/wsl"})).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"),kQe="exactly one of path/script must be configured",RQe='"script" and "interpreter" must be configured together',OQe="script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9",PQe=(e)=>g({message:"script must be a string"}).min(1,{message:"script must not be empty"}).max(65536,{message:"script must be at most 65536 characters"}).refine((t)=>!t.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((t)=>hg(t),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((t)=>e!=="windows"||!/[\u0080-\uffff]/.test(t),{message:OQe}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var Wn=["macos","linux","windows","wsl"];function gL(e){return e==="wsl"?["wsl","linux"]:[e]}function IQe(e){return e==="windows"?"win32":"posix"}function DQe(e){return{rejectDriveRelative:e==="windows",rejectUnc:e==="windows",rejectNetworkRoot:e!=="windows",rejectMagicLinkRoot:e!=="windows",requireWin32ExecutableSuffix:e==="windows"}}function LQe(e){let t=IQe(e),n=DQe(e);return g().max(1024,{message:"path must be at most 1024 characters"}).refine((r)=>!fQe.test(r),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((r)=>(t==="win32"?Wee:Gee).isAbsolute(r),{message:"path must be absolute"}).refine((r)=>!(t==="win32"&&n.requireWin32ExecutableSuffix)||yQe.test(r),{message:"path must end in .exe or .ps1 on Windows"}).refine((r)=>t!=="win32"||!bQe(r),{message:EQe}).refine((r)=>_Qe(r,t,n),{message:t==="win32"?'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, no component ending in "." or a space, no ":" outside the drive letter, no device-namespace (\\\\?\\) prefix, no drive-relative (\\dir or C:name) or UNC (\\\\server\\share) form':'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, and not under a network automount root (/net/<host>, /Network/Servers) or a kernel magic-link root (/proc, /dev/fd)'}).describe("Absolute path to the helper executable")}var _L=[...Wn,"default"],uL=["path","script","interpreter","outputBehavior","onFailure","retries","timeoutMs","refreshIntervalMs","defaultSettings"],PE=["managedSettings","appendSystemPrompt"],Ec=L(()=>Z(g(),Te()).superRefine((e,t)=>{for(let n of["policyHelper","policyHelpers"])if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let n of uL)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${uL.join("/")}) belong on the per-OS entries (policyHelpers.${Wn.join("/")})`});for(let n of PE)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is the managedSettings SUBTREE, not the helper's stdout envelope; paste the object your helper emits UNDER "managedSettings", not the envelope around it`});for(let n of _L)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${n}" line inside the slot`})})),NQe='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function MQe(e){let{path:t,script:n,interpreter:r,defaultSettings:o}=e;if(t!==void 0&&n!==void 0)return kQe;if(n===void 0!==(r===void 0))return RQe;if(t===void 0&&n===void 0&&o===void 0)return NQe;return null}function Jee(e,t){return IE().omit({path:!0}).extend({path:Zi(LQe(e)),script:Zi(PQe(e)),interpreter:Zi(CQe(e)),outputBehavior:Zi(Zee()),onFailure:Zi(wQe()),retries:Zi(TQe()),defaultSettings:tt((n)=>n===null?void 0:n,t.optional()).optional()}).check((n)=>{if(n.issues.length>0)return;let r=MQe(n.value);if(r!==null)n.issues.push({code:"custom",message:r,input:n.value})})}var m6t=L(()=>Jee("linux",Ec()));function dL(e,t=Ec()){return e==="default"?Ec():Jee(e,t)}var UQe=L(()=>T(Object.fromEntries(_L.map((e)=>[e,tt((t)=>{if(t===null)return;if(e!=="default"&&qee(t))return;return t},dL(e).optional()).optional()])))),jee=["skills","agents","hooks","mcp"],Hee=Object.freeze({type:"invalid-entry-stripped"}),FQe=L(()=>ue([T({type:j("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:g().describe("Regex matched against turn output (tool results and assistant text)"),url:g().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:g().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),T({type:g().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()])),$Qe=()=>X().int().min(DQ).max(LQ).optional().catch(void 0);function ME(e,{strictPolicyHelperKeys:t=!1}={}){function n(o){return Z(g(),pL()).check((s)=>{for(let[i,a]of Object.entries(s.value))if(a.source.source==="settings"&&a.source.name!==i)s.issues.push({code:"custom",input:a.source.name,path:[i,"source","name"],message:`Settings-sourced marketplace name must match its ${o} key (got key "${i}" but source.name "${a.source.name}")`})})}let r=(o,s)=>t?tt((i)=>{if(i===null)return;return s?s(i):i},o):o.catch(void 0);return T({$schema:g().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:g().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:g().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:g().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:g().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:g().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:g().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:r(IE().optional(),(o)=>o&&typeof o==="object"&&!Array.isArray(o)&&o.path===null?void 0:o).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:r(UQe().optional()).describe(`@internal Per-OS variant of policyHelper, keyed by platform: macos, linux, windows, wsl, plus an optional "default" entry that is a STATIC settings payload (a JSON object of managed settings, not a helper). Each per-OS entry carries a helper — a "path", or an inline "script" + "interpreter" delivered to a fixed interpreter over stdin, either with timeoutMs/refreshIntervalMs — its own static "defaultSettings" payload, or both; an entry may be payload-only. Selection for a platform walks its chain (the platform's own entry; on wsl the linux entry next): the first helper on the chain wins over policyHelper; if no helper is configured — or the selected helper fails at startup or refresh — the first payload applies (the chain's "defaultSettings" in platform-specific-first order, then the top-level "default", applied with no process spawned; unrecognized platforms reach only "default"); with no payload either, policyHelper. Honored from admin-controlled policy sources, and from remote managed settings — a payload of plain policy as delivered, like any other remote key; a helper, or a payload carrying anything the managed-settings approval dialog lists, only once the settings are verified this session and approved there (policyHelper itself is never honored from remote).`),..._n.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:T({issuer:g().url().describe("IdP issuer URL for OIDC discovery"),clientId:g().describe("Claude Code's client_id registered at the IdP"),callbackPort:X().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:T({type:j("command"),command:g()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:R().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:T({enabled:R().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:X().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:X().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:g().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks — just a friendly heads-up."),quietHours:T({enabled:R().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:g().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:g().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:X().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),desktopSessionCleanupPeriodDays:X().int().nonnegative().optional().describe("Retention ceiling in days for session transcripts created or last written by a desktop-host surface (Claude Desktop, Cowork), which are otherwise exempt from the cleanupPeriodDays sweep. 0 (the default) means no ceiling: such transcripts are kept until deleted another way. Unlike cleanupPeriodDays, 0 is allowed because this setting never disables writes — it only bounds an exemption from deletion. The ceiling is a hard cap: it also bounds an active archive grace, so the grace window of a release marker never keeps files past the ceiling. Ignored when cleanupPeriodDays is managed by org policy. A ceiling at or below cleanupPeriodDays effectively disables the exemption: those transcripts age out on the regular cleanupPeriodDays schedule, so the effective retention is whichever of the two periods is longer."),syncClaudeAiSkills:R().optional().describe("Set to false to turn off syncing of the skills you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced skills (~/.claude/skills/synced) can no longer be run, are hidden from every session started afterwards, and are moved to ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced skills are blocked and hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced skills are available in every session, re-synced every 10 minutes, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),syncClaudeAiPlugins:R().optional().describe("Set to false to turn off syncing of the plugins you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced plugins (~/.claude/plugins/synced) are hidden from every session started afterwards and moved to ~/.claude/plugins/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced plugins are hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced plugins load in every session like plugins you installed yourself (a plugin you installed with the same name takes precedence), are re-synced at each launch, and are removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),skillListingMaxDescChars:X().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:X().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:R().optional().describe("When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:uQe().optional().describe("Environment variables to set for Claude Code sessions"),attribution:T({commit:g().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:g().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:R().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link."),...!1}).passthrough().optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:R().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),...!1,...!1,includeGitInstructions:R().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:Vee(e).optional().describe("Tool usage permissions configuration"),model:g().optional().describe("Override the default model used by Claude Code"),fallbackModel:N(g()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:N(g()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:R().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),modelOverrides:Z(g(),g()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),modelPicker:T({options:N(hL()).describe("Rows to show in the /model picker, in order."),replaceBuiltInOptions:R().optional().describe("When true, the picker shows only the Default row and these options — the built-in "+"lineup, gateway-discovered models and ANTHROPIC_CUSTOM_MODEL_OPTION are hidden. When false or unset, these options are added after the built-in lineup.")}).optional().describe("Curate the /model picker: an ordered list of models with your own labels, independent of the built-in lineup and of Claude Code releases. availableModels still applies to these rows. Honored from managed, --settings/SDK, and user settings only (not from a project checkout); the highest-precedence of those that defines modelPicker wins outright (no merging across sources). Typically set in managed settings by enterprise administrators."),modelPricing:T({multiplier:mL(),overrides:Z(g(),fL()).optional()}).optional().describe("Price usage at your organization's contracted rates instead of list price. "+"Affects every spend figure Claude Code reports — /cost, the status line, the SDK total_cost_usd, "+"--max-budget-usd, and the OpenTelemetry cost metric and events — which remain USD estimates, not an invoice "+'(the per-Mtok price labels in /model stay at list). "overrides" maps a model ID to its USD-per-million-token rates (input, output, cacheRead, '+"cacheWrite — all four required, each 0 to 10000; cacheWrite prices both 5-minute and 1-hour cache writes). "+"A matching row is charged exactly as written; fast-mode and US-data-residency surcharges are not added on top. "+'A key Claude Code itself uses for a built-in model — its ID such as "claude-sonnet-4-6", or its '+"first-party, Bedrock (any or no region prefix), Vertex or Foundry ID — covers every dated and provider form "+"of that model; any other key — a gateway model alias, or a spelling Claude Code does not itself use — "+'matches that model ID only (case-insensitive), and such an exact match wins over a built-in row. On Bedrock an application inference profile is matched by its backing model. An invalid row or multiplier is reported and skipped; the rest still apply. "multiplier" in (0, 1] scales every computed cost, overridden or not (0.85 = 85% of the price). Only honored from managed settings (server-managed, MDM / OS policy, or managed-settings.json), '+"or — when none of those sets it — when supplied by a host application that manages the model "+"provider; ignored in user, project, local and --settings sources."),...!1,enableAllProjectMcpServers:R().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:N(g()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:N(g()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:R().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. "+"Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly "+"(e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:Z(g(),V(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:R().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),managedMcpServers:Z(g().refine(HD,{error:"server names may only contain letters, numbers, hyphens and underscores, and may not be __proto__, constructor or prototype"}),BD(),{error:KD}).optional().describe(`MCP servers the organization provides to every user, keyed by server name, each with the .mcp.json entry shape; only "http" and "sse" servers are accepted (nothing that names a program to run, no \${VAR} references). Honored from managed settings only; users cannot remove them, deniedMcpServers still applies, and they need no allowedMcpServers entry. Not read in Claude Desktop's Code tab on a third-party deployment or in Cowork sessions, where Claude Desktop supplies and locks the session's MCP servers itself.`),allowedMcpServers:N(LE()).optional().describe("Enterprise allowlist of the MCP servers users may use. Governs servers users add (user, project and local config, --mcp-config, agent frontmatter, plugins, claude.ai connectors); servers the organization itself delivers (managedMcpServers, and managed-mcp.json entries that use no ${VAR} expansion) are allowed without being listed; a managed-mcp.json entry that uses ${VAR} expansion is still checked against this list. If undefined, all servers are allowed. If empty array, users can use no servers of their own. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:N(NE()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:yc().optional().describe("Custom commands to run before/after tool executions"),worktree:T({symlinkDirectories:N(g()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:N(g()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:V(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:V(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly."),location:g().optional().catch(void 0).describe("Directory under which Claude Code Desktop creates the worktrees of SSH sessions that run on this machine (an absolute path or one starting with ~/), instead of <project>/.claude/worktrees. Read by the desktop app from the SSH host user settings; a location chosen in the desktop app's SSH connection settings takes precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read it yet.")}).optional().describe("Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent isolation, plus the location Claude Code Desktop uses for SSH-session worktrees on this machine."),disableAllHooks:R().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:R().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:R().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:R().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:R().optional().describe("Deprecated: use enableArtifact: false. Still honored — true disables the Artifact tool; false is ignored."),enableArtifact:R().optional().describe("Turn the Artifact tool on or off. Off in any of managed, --settings, or user settings wins; project and local settings can only turn it off. Unset defaults to on once the feature is available."),enableWorkflows:R().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:V(["unrestricted","small","medium","large"]).optional().describe('Advisory size guideline for the dynamic workflows Claude writes: "small" aims for fewer than 5 agents, "medium" (the default) fewer than 15, "large" fewer than 50, and "unrestricted" sends no guideline. A value here — including from managed settings — takes precedence over the "Dynamic workflow size" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.'),workflowKeywordTriggerEnabled:R().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:R().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:V(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),bashOutputMaxChars:X().int().positive().optional().catch(void 0).describe("How many characters of a successful Bash or PowerShell command's output Claude receives inline (default 30000; values clamp to 4000-128000). Output past this is saved to a file and Claude receives a short preview plus the path. When set, this also replaces BASH_MAX_OUTPUT_LENGTH, which on its own only sizes the read-back window."),taskOutputMaxChars:X().int().positive().optional().catch(void 0).describe("How many characters of a background task's output the TaskOutput tool hands Claude inline (default 32000; values clamp to 4000-128000). Longer output is cut to its most recent characters with the path of the full output file, except that a shell command still running returns its first characters up to this size. When set, this also replaces TASK_MAX_OUTPUT_LENGTH, which on its own only sizes that window."),respondToBashCommands:R().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:R().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:N(g()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:N(g()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:R().optional().describe("When true (and set in managed settings), permission rules from user, project, local, and --settings files and allow rules from --allowedTools are ignored; only managed settings can add allow rules through settings. --disallowedTools and other deny and ask rules from the command line or the current session still apply."),allowManagedMcpServersOnly:R().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:R().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:tt((o)=>Array.isArray(o)?o.filter((s)=>jee.includes(s)):o,ue([R(),N(V(jee))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:T({type:j("command"),command:g(),padding:X().optional(),refreshInterval:X().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:R().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:g().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:N(FQe().catch(Hee)).transform((o)=>o.filter((s)=>s!==Hee)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:T({type:j("command"),command:g()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:Z(g(),ue([N(g()),R(),NP()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),...!1,extraKnownMarketplaces:n("extraKnownMarketplaces").optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),additionalMarketplaces:n("additionalMarketplaces").optional().describe("Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled "+"extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored "+"with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings."),strictKnownMarketplaces:N(ld()).optional().describe('Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. '+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),allowedMarketplaces:N(ld()).optional().describe("Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it "+"were spelled strictKnownMarketplaces. Do not set both in one file — if both appear, this key "+"is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions."),blockedMarketplaces:N(ld()).optional().describe('Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:R().optional().describe("Controls the `command` plugin source, whose plugin directory is produced by running a marketplace-declared command on this machine. true: command-sourced plugins are never installed, updated, or re-resolved (the command never runs). false: explicitly allowed. "+"Unset: follows allowManagedHooksOnly — an org that restricts hook execution to managed "+"settings gets command sources disabled too. Only honored from managed settings."),disableSideloadFlags:R().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:N(g()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:V(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:g().min(1).optional().catch(void 0).describe('Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: "gateway". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.'),parentSettingsBehavior:V(["first-wins","merge"]).optional().describe('Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" '+"(default): parent is dropped — admin tiers are the only policy "+`source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),managedSourcesBehavior:V(["first-wins","merge"]).optional().describe('Controls how the managed settings sources compose. "first-wins" (default): the highest-priority source present (server-managed > MDM (managed plist / HKLM) > managed-settings.json) is the managed tier alone. "merge": every present source deep-merges with fixed '+"precedence server-managed > MDM > managed-settings.json — scalars "+"take the highest source's value (a restrictive boolean or enum — "+"the allowManaged*Only locks, the disable* switches, the sandbox "+"lock family — takes the strictest value any source sets) and "+"arrays union, except fallbackModel, the restriction allowlists allowedMcpServers, availableModels, strictKnownMarketplaces and allowedChannelPlugins, and sandbox.credentials.awsPairs and sandbox.ripgrep (the highest source that sets one owns it whole), modelOverrides (the whole map of the highest source that sets it, dropped when that source sits below the one that sets availableModels), managedMcpServers (server names union; a name set by two sources takes the higher source's whole entry), and the keys taken from the highest source only: the auth pins forceLoginOrgUUID, forceLoginMethod and forceLoginGatewayUrl, the credential helpers apiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper and proxyAuthHelper, modelPicker, permissions.defaultMode, parentSettingsBehavior and the policyHelper configuration (env keeps its own per-key union). Honored only from the highest-priority source present; enable it only when every lower source is admin-controlled, since lower sources then contribute entries such as permissions.allow. HKCU and --managed-settings never take part in the merge."),forceLoginOrgUUID:ue([g(),N(g())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:R().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:g().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:g().optional().describe("Controls the output style for assistant responses"),viewMode:V(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:g().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:R().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:PD().optional(),feedbackSurveyRate:X().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:V(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:R().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:T({mode:V(["append","replace"]),verbs:N(g())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:T({excludeDefault:R().optional().catch(void 0),tips:pQe().optional(),tipsFile:g().optional().catch(void 0).describe("Absolute or ~/ local path to a JSON file holding an array of tips (same shapes as `tips`); honored from user, --settings and on-disk managed settings only. Read once per CLI process (restart to pick up edits)."),label:g().optional().catch(void 0).describe('Prefix shown before your tips in the spinner (default "Tip")')}).passthrough().optional().catch(void 0).describe("Add your organization's own tips to the spinner tip rotation. tips: strings or {id, text, cooldownSessions?, priority?} objects; tipsFile: a JSON file of the same; label: prefix shown before your tips; excludeDefault: if true, only show your tips (default: false)."),syntaxHighlightingDisabled:R().optional().describe("Whether to disable syntax highlighting in diffs"),spellcheck:T({enabled:R().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:g().optional().catch(void 0).describe(`Which spell checker to run: ${TE.map((o)=>`"${o}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:g().optional().catch(void 0).describe(`Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, ispell -d), e.g. "en_GB"; names are checker-specific (letters, digits and _ - . , only). Default: the checker's own default`),color:g().optional().catch(void 0).describe(`Color of misspelled words (they are also underlined): a terminal color name such as "red" or "magenta", "#rrggbb", "rgb(r,g,b)", "ansi256(n)" or "ansi:<name>". Default: the theme's error color`)}).passthrough().optional().catch(void 0).describe(`Underline misspelled words in the prompt input as you type, using an installed ${TE.slice(0,-1).join(", ")} or ${TE.at(-1)} (off unless "enabled" is true; does nothing if none is installed). Read from user, flag and managed settings only (the whole block from the highest-precedence of those applies); ignored in project .claude/settings.json and .claude/settings.local.json.`),terminalTitleFromRename:R().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),promptCacheTtl:V(hu).optional().catch(void 0).describe('Prompt cache TTL for the main conversation (interactive, -p and SDK turns, plus the helpers that run inline with it): "5m" or "1h". Unset = automatic: 1 hour on a Claude subscription within its usage limits, 5 minutes on an API key, Bedrock, Vertex or Foundry. 1-hour cache writes are billed at a higher rate; the cache stays warm across longer breaks. The CLAUDE_CODE_PROMPT_CACHE_TTL environment variable takes precedence.'),subagentPromptCacheTtl:V(hu).optional().catch(void 0).describe("Prompt cache TTL for everything outside the main conversation — subagents, workflows, background and helper requests: "+'"5m" or "1h". Unset = automatic (5 minutes unless ENABLE_PROMPT_CACHING_1H=1). The CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL environment variable takes precedence.'),alwaysThinkingEnabled:R().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:V(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),modelSettings:tt((o)=>typeof o==="object"&&o!==null&&!Array.isArray(o)?yh(o,(s,i)=>Object.hasOwn(Object.prototype,i)):o,Z(g(),T({effortLevel:V(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model.")}).passthrough().optional().catch(void 0))).optional().catch(void 0).describe("Per-model settings keyed by canonical model name."),ultracode:R().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:$Qe().describe("Auto-compact window size"),...!1,advisorModel:g().optional().describe("Advisor model for the server-side advisor tool."),fastMode:R().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:R().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:R().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:R().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:R().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:R().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:V(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),dialogExpiry:V(["60s","5m","10m","never"]).optional().catch(void 0).describe('Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; "never" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).'),agent:g().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),modelProposedGoals:V(IQ).optional().catch(void 0).describe("@internal Controls the ProposeGoal tool (model-proposed session goals). 'auto' (the default when absent) lets the model choose per proposal whether to ask for approval via its ask_user parameter; 'alwaysAsk' routes every model-proposed goal through the approval dialog; 'disabled' turns the tool off. A typed /goal is unaffected. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:N(g()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:Z(g(),T({mcpServers:Z(g(),Z(g(),ue([g(),X(),R(),N(g())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:Z(g(),ue([g(),X(),R(),N(g())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(NP())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:T({defaultEnvironmentId:g().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:V(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:g().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:g().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:g().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:g().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:V(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),...!1,voice:T({enabled:R().optional(),mode:V(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:R().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:R().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:N(T({marketplace:g(),plugin:g()})).optional().describe("Managed-org allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:R().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),timeFormat:ue([V(RQ),g()]).optional().describe('Clock format for times shown in the UI: "auto" (default, follows the locale), "12-hour", "24-hour", "24-hour-utc" ("18:05Z"), or a strftime pattern such as "%H:%M" (any value containing "%"; other values read as "auto"). A pattern replaces the time everywhere; message timestamps show only the pattern, so include %Y-%m-%d for the date. /config offers the presets; a pattern is set here.'),timeZone:g().optional().describe('IANA time zone for times shown in the UI, e.g. "UTC" or "Europe/Dublin". Default: the system time zone. An unknown name falls back to the system time zone.'),doneMeansMerged:R().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:V(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to padded-countdown. "+"Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:X().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:R().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to on. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:R().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:g().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:R().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:R().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:R().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:R().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:V(["disable"]).optional().describe("Disable auto mode"),remoteTools:T({allowUnattendedServing:R().optional().describe("@internal When false in managed or user settings, a cloud session in auto mode may not run commands on this computer without a person approving each one, whatever consent the computer has given; a project, local or --settings value is ignored. Default: true.")}).optional().describe("@internal How this computer serves tool calls to cloud sessions"),sshConfigs:N(T({id:g().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:g().describe("Display name for the SSH connection"),sshHost:g().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:X().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:g().optional().describe("Path to SSH identity file (private key)"),startDirectory:g().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:g().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:N(g()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:g().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:ue([V(PQ),g().startsWith("custom:").transform((o)=>o)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:V(kQ).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:V(["classic","readline"]).optional().catch(void 0).describe("Deprecated: no longer has any effect. The prompt's word-editing keys always follow Bash (readline) conventions."),vimInsertModeRemaps:Z(g(),Te()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:R().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:V(CQ).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:R().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:R().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:R().optional().describe("When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoContinueAtUsageLimit:R().optional().describe("When a claude.ai usage limit stops your session, wait for the limit to reset and continue the task automatically. When off, the limit dialog offers the wait as a choice instead."),autoScrollEnabled:R().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:R().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:R().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:R().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:R().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:R().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:R().optional().describe("Enable the todo / task tracking panel"),teammateMode:V(OQ).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:R().optional().describe("Start Remote Control bridge automatically each session"),remoteControl:T({shareHostProfile:V(DE).optional().catch(void 0).describe("@internal What a Remote Control environment reports about this machine when it registers: 'off' reports nothing, 'basic' the OS, architecture and detected developer tools, 'full' also the names of MCP servers configured on this machine (never a repository's .mcp.json). When unset, the level comes from the feature rollout, which may be any of the three. Managed, --settings and user settings choose the level (the most restrictive wins); project and local settings can only lower it, never raise it. Read when Remote Control starts; lowering it later applies from the next registration, raising it from the next start.")}).optional().describe("@internal Remote Control (`claude remote-control`) options"),isolatePeerMachines:R().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:V(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),crossSessionInbound:V(wh).optional().catch(void 0).describe("Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts."),autoUploadSessions:R().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:R().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:R().optional().describe("Allow Claude to push proactive mobile notifications"),...wee(e)}).passthrough()}var ud=L(()=>ME(vh())),Bee=Object.freeze({serverName:"invalid-entry-stripped"});function Kee(e,t,n){return N(t.catch((r)=>(n({path:`${e}[]`,message:`Invalid entry was ignored: ${r.issues[0]?.message??"failed validation"}`}),Bee))).transform((r)=>r.filter((o)=>o!==Bee)).optional()}function yL(e,t){let n=ud(),r={};for(let[S,x]of Object.entries(n.shape))r[S]=x.catch((w)=>{e({path:S,message:`${w.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});r.allowedMcpServers=Kee("allowedMcpServers",LE(),e).catch(()=>(e({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[])),r.deniedMcpServers=Kee("deniedMcpServers",NE(),e).catch(()=>{e({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return}),r.managedMcpServers=Te().transform((S)=>SE(S,(x,w)=>e({path:x?`managedMcpServers.${x}`:"managedMcpServers",message:x?`Managed MCP server was ignored: ${w}`:w,statusOnly:!0}))).optional(),r.allowManagedHooksOnly=n.shape.allowManagedHooksOnly.catch(()=>(e({path:"allowManagedHooksOnly",message:'"allowManagedHooksOnly" was present but invalid; treating it as true (only managed hooks run; command-sourced plugins disabled) until it is fixed.'}),!0)),r.syncClaudeAiSkills=n.shape.syncClaudeAiSkills.catch(()=>(e({path:"syncClaudeAiSkills",message:'"syncClaudeAiSkills" was present but invalid; treating it as false (claude.ai skills sync off) until it is fixed.'}),!1)),r.syncClaudeAiPlugins=n.shape.syncClaudeAiPlugins.catch(()=>(e({path:"syncClaudeAiPlugins",message:'"syncClaudeAiPlugins" was present but invalid; treating it as false (claude.ai plugins sync off) until it is fixed.'}),!1)),r.remoteTools=n.shape.remoteTools.catch(()=>(e({path:"remoteTools",message:'"remoteTools" was present but invalid; treating allowUnattendedServing as false (no unattended serving) until it is fixed.'}),{allowUnattendedServing:!1})),r.disableCommandPluginSources=n.shape.disableCommandPluginSources.catch(()=>(e({path:"disableCommandPluginSources",message:'"disableCommandPluginSources" was present but invalid; treating it as true (command-sourced plugins disabled) until it is fixed.'}),!0)),r.allowManagedMcpServersOnly=n.shape.allowManagedMcpServersOnly.catch(()=>(e({path:"allowManagedMcpServersOnly",message:'"allowManagedMcpServersOnly" was present but invalid; treating it as true until it is fixed.'}),!0)),r.enforceAvailableModels=n.shape.enforceAvailableModels.catch(()=>(e({path:"enforceAvailableModels",message:'"enforceAvailableModels" was present but invalid; treating it as true until it is fixed.'}),!0)),r.availableModels=N(Te()).transform((S,x)=>{let w=[];for(let D of S)if(typeof D==="string")w.push(D);else e({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(D)}); the entry was ignored.`});return w}).optional().catch(()=>(e({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[])),r.forceLoginOrgUUID=n.shape.forceLoginOrgUUID.catch(()=>(e({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]));let o=!1,s=(S,x)=>{let w=S.safeParse(x);if(w.success)return;return w.error.issues.slice(0,3).map((D)=>D.path.length?`${D.path.join(".")}: ${D.message}`:D.message).join("; ")},i;r.policyHelper=tt((S)=>{if(o=!1,i=S,S&&typeof S==="object"&&!Array.isArray(S)){let x=S;for(let w of["defaultSettings","default",...PE])if(x[w]!==void 0&&x[w]!==null)e({path:"policyHelper",message:`"${w}" on the singular policyHelper is ignored — static fallback payloads belong on the policyHelpers per-OS entries ("defaultSettings") or the map's "default" key. The intended fallback will NOT apply from here.`,statusOnly:!0});for(let w of["policyHelper","policyHelpers"])if(x[w]!==void 0&&x[w]!==null)e({path:"policyHelper",message:`"${w}" inside the singular policyHelper is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside the singular entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let w of Wn)if(x[w]!==void 0&&x[w]!==null)e({path:"policyHelper",message:`"${w}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${w}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(x.claudeMd!==void 0&&x.claudeMd!==null)e({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored — "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0});if(x.outputBehavior!==void 0&&x.outputBehavior!==null)e({path:"policyHelper",message:`"outputBehavior" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Wn.join("/")}); this helper's output REPLACES the policy tier whatever the value says.`,statusOnly:!0});if(x.onFailure!==void 0&&x.onFailure!==null)e({path:"policyHelper",message:`"onFailure" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Wn.join("/")}); a failure of this helper REFUSES to start Claude Code whatever the value says.`,statusOnly:!0});if(x.retries!==void 0&&x.retries!==null)e({path:"policyHelper",message:`"retries" on the singular policyHelper is ignored — it is only honored on the policyHelpers per-OS entries (policyHelpers.${Wn.join("/")}); this helper is run ONCE per start or refresh, never re-run, whatever the value says.`,statusOnly:!0});if(x.path===null||x.path===void 0)o=!0}return S===null?void 0:S},IE().optional()).catch((S)=>{e({path:"policyHelper",message:`${S.issues[0]?.message??s(IE(),i)??"Failed schema validation"}. This field was ignored.`,...o&&{statusOnly:!0}});return});let a=(S,x)=>{e({path:S,message:`"${S}" is not a valid static settings payload: ${x??"failed validation"}. When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})},c=[],l=(S)=>{let x=!1,w,D=dL(S,Ec().optional().catch((P)=>{x=!0,a(`policyHelpers.${S}.defaultSettings`,P.issues[0]?.message??s(Ec(),w&&typeof w==="object"&&!Array.isArray(w)?w.defaultSettings:void 0));return}));return tt((P)=>{if(x=!1,w=P,S!=="default"&&P&&typeof P==="object"&&!Array.isArray(P)){let F=P;for(let q of[...PE,"claudeMd"])if(F[q]!==void 0&&F[q]!==null)e({path:`policyHelpers.${S}`,message:`"${q}" on the policyHelpers.${S} entry is ignored — helper output cannot be pre-seeded on an entry; a static fallback payload goes under this entry's "defaultSettings" (a managed-settings object). The intended content will NOT apply from here.`,statusOnly:!0});for(let q of["policyHelper","policyHelpers"])if(F[q]!==void 0&&F[q]!==null)e({path:`policyHelpers.${S}`,message:`"${q}" on the policyHelpers.${S} entry is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside an entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let q of Wn)if(F[q]!==void 0&&F[q]!==null)e({path:`policyHelpers.${S}`,message:`"${q}" on the policyHelpers.${S} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${q} config will NOT apply from here.`,statusOnly:!0});if(F.default!==void 0&&F.default!==null)e({path:`policyHelpers.${S}`,message:`"default" on the policyHelpers.${S} entry is ignored — the per-entry static payload field is spelled "defaultSettings"; "default" is the MAP's any-platform catch-all key (a sibling of the OS entries). The intended fallback will NOT apply from here.`,statusOnly:!0});let z=F.onFailure;if(z!==void 0&&z!==null&&!Yee(z)){let q;if(typeof z==="string"){let ee=z.replace(/[^\x20-\x7e]/gu,"?");q=JSON.stringify(ee.length>zee?`${ee.slice(0,zee-1)}…`:ee)}else if(typeof z==="number"||typeof z==="boolean")q=String(z);else q=`a non-string value (${Array.isArray(z)?"array":typeof z})`;e({path:`policyHelpers.${S}.onFailure`,message:`"onFailure": ${q} on the policyHelpers.${S} entry is not a recognized value ("continue" or "refuse"); it is treated as "refuse" — a startup failure of this entry's helper with no static payload in its place will not start Claude Code.`,statusOnly:!0})}if(qee(P))return}return P===null?void 0:P},D.optional()).catch((P)=>{if(S==="default"){a("policyHelpers.default",P.issues[0]?.message??s(Ec(),w));return}if(x)return;let F=s(dL(S),w)??"failed validation",z=w,q=z&&typeof z==="object"&&!Array.isArray(z)?z:null,ee=q?.onFailure,te=ee!==void 0&&ee!==null&&ee!=="continue",xe=(Q)=>{let ut=`policyHelpers.${S}`;if(te)c.push({entryKey:S,message:Q});else e({path:ut,message:Q,statusOnly:!0})};if(q){let Q=q.defaultSettings;if(Q!==void 0&&Q!==null){let ut=Ec().safeParse(Q);if(ut.success){let De=q.outputBehavior,dt=De===void 0||De===null?null:Zee().safeParse(De);if(dt&&!dt.success){xe(`Invalid entry was ignored: ${F}. Its "defaultSettings" static payload was NOT kept: "outputBehavior" is unrecognized, so whether the payload replaces or merges over this source's settings is unknown. No policy helper runs on ${S} from this entry.`);return}return e({path:`policyHelpers.${S}`,message:`Invalid entry: its helper fields were ignored (${F}), but its "defaultSettings" static payload was kept. No policy helper runs on ${S} from this entry.`,statusOnly:!0}),{defaultSettings:ut.data,...dt&&{outputBehavior:dt.data}}}}}xe(`Invalid entry was ignored: ${F}. No policy helper runs on ${S} from this entry.`);return})};r.policyHelpers=tt((S)=>{if(c=[],S&&typeof S==="object"&&!Array.isArray(S)){let x=S;for(let w of["defaultSettings",...PE,"claudeMd"])if(x[w]!==void 0&&x[w]!==null)e({path:"policyHelpers",message:`"${w}" directly on the policyHelpers map is ignored — static fallback payloads go on a per-OS entry's "defaultSettings" or the map's "default" key (a managed-settings object), and helper-output keys come from the helper's stdout. The intended content will NOT apply from here.`,statusOnly:!0});for(let w of["policyHelper","policyHelpers"])if(x[w]!==void 0&&x[w]!==null)e({path:"policyHelpers",message:`"${w}" inside the policyHelpers map is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; the map's keys are the per-OS entries and "default". The nested config will NOT apply from here.`,statusOnly:!0});for(let w of uL.filter((D)=>D!=="defaultSettings"))if(x[w]!==void 0&&x[w]!==null){let D=w==="script"||w==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":w==="outputBehavior"||w==="onFailure"||w==="retries"?"":", or on the singular policyHelper key";e({path:"policyHelpers",message:`"${w}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${Wn.join("/")})${D}. No helper runs from this field here.`,statusOnly:!0})}}return S===null?void 0:S},T(Object.fromEntries(_L.map((S)=>[S,l(S)]))).transform((S)=>{for(let x of Object.keys(S))if(S[x]===void 0)delete S[x];for(let{entryKey:x,message:w}of c){let D=`policyHelpers.${x}`,P=gL(x).find((z)=>S[z]?.defaultSettings!==void 0&&S[z]?.defaultSettings!==null),F=P!==void 0?`${P}.defaultSettings`:S.default!==void 0?"default":null;e(F!==null?{path:D,message:`${w} Its "onFailure" requires the helper; the "policyHelpers.${F}" static payload serves in its place.`,statusOnly:!0}:{path:D,message:`${w} Its "onFailure" requires the helper, so when delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})}return c=[],S}).optional().catch((S)=>(e({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${Wn.join(", ")}) to helper entries, plus an optional "default" settings payload (${S.issues[0]?.message??"failed schema validation"}). When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0}),{})));let u=Object.freeze({mode:"deny"}),d=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),f=0,m=[],h=t===void 0?"":`${[...t].reduce((S,x)=>Math.imul(S^x.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,_=(S,x)=>{if(typeof S!=="object"||S===null)return;let w=(W)=>x.some((qe)=>qe.path?.includes(W)),D=(W)=>{let qe=S[W];if(typeof qe==="string")return qe;return w(W)?"":void 0},P=D("accessKeyIdVar"),F=D("secretAccessKeyVar"),z=D("sessionTokenVar"),q=Vi;if(![P,F,z].some((W)=>W!==void 0&&q.includes(W)))return;let ee=(W)=>W!==void 0&&id().safeParse(W).success;f+=1;let te=(W)=>`${OD}${W}_${h}${f}_`,xe=ee(P)?P:te("ACCESS_KEY_ID"),Q=ee(F)&&F!==xe?F:te("SECRET_ACCESS_KEY"),ut=z===void 0?void 0:ee(z)&&z!==xe&&z!==Q?z:te("SESSION_TOKEN"),De=(W)=>W.startsWith(OD);if(!De(xe)&&!De(Q)){let W=q.includes(Q)?Q:void 0;if(Q=te("SECRET_ACCESS_KEY"),W!==void 0){let qe=_({accessKeyIdVar:W},[]);if(qe!==void 0)m.push(qe)}}let dt=_E().safeParse({accessKeyIdVar:xe,secretAccessKeyVar:Q,...ut!==void 0&&{sessionTokenVar:ut}});return dt.success?dt.data:void 0},y=(S,x,w)=>N(x.catch((D)=>{let P=w(D.value);if(P!==void 0)return e({path:`sandbox.credentials.${S}[]`,message:`Invalid entry was degraded to mode "deny": ${D.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${S==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`}),P;return e({path:`sandbox.credentials.${S}[]`,message:`Invalid entry was ignored: ${D.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),u})).transform((D)=>D.filter((P)=>P!==u)).optional().catch((D)=>{if(typeof D.value==="object"&&D.value!==null&&!Array.isArray(D.value)){let P=x.safeParse(D.value);if(P.success)return e({path:`sandbox.credentials.${S}`,message:`"${S}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[P.data];let F=w(D.value);if(F!==void 0)return e({path:`sandbox.credentials.${S}`,message:`"${S}" must be an array; its lone entry object was invalid and was degraded to mode "deny". The credential stays blocked (not masked) until it is fixed.`}),[F]}return e({path:`sandbox.credentials.${S}`,message:`${D.issues[0]?.message??"Invalid value"}. "${S}" was ignored; these credential entries are NOT protected until it is fixed.`}),[]}),b=T({files:y("files",mE(),(S)=>{if(typeof S!=="object"||S===null||!("mode"in S)||S.mode!=="mask"&&S.mode!=="deny"||!("path"in S)||typeof S.path!=="string")return;let x=mE().safeParse({path:S.path,mode:"deny"});return x.success?x.data:void 0}),envVars:y("envVars",hE(),(S)=>{if(typeof S!=="object"||S===null||!("mode"in S)||S.mode!=="mask"&&S.mode!=="deny"||!("name"in S)||typeof S.name!=="string")return;let x=hE().safeParse({name:S.name,mode:"deny"});return x.success?x.data:void 0}),allowPlaintextInject:R().optional().catch((S)=>(e({path:"sandbox.credentials.allowPlaintextInject",message:`${S.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was degraded to an explicit false; plaintext credential injection stays disabled (lower-precedence values cannot enable it) until it is fixed.`}),!1)),awsPairs:N(_E().catch((S)=>{let x=_(S.value,S.issues);if(x!==void 0)return e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${S.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`}),x;return e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${S.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),d})).transform((S)=>{let x=S.filter((w)=>w!==d);if(m.length>0)x.push(...m),m.length=0;return x}).optional().catch((S)=>{let x=typeof S.value==="object"&&S.value!==null?_(S.value,[]):void 0,w=typeof S.value==="object"&&S.value!==null&&(("accessKeyIdVar"in S.value)||("secretAccessKeyVar"in S.value)||("sessionTokenVar"in S.value));if(x===void 0&&w)return m.length=0,e({path:"sandbox.credentials.awsPairs",message:`${S.issues[0]?.message??"Invalid value"}. "awsPairs" must be an array; its lone pair-shaped entry claimed no conventional AWS name and was ignored. SigV4 re-signing stays unconfigured until it is fixed.`}),[];let D=x!==void 0?[x]:Vi.flatMap((P)=>{let F=_({accessKeyIdVar:P},[]);return F!==void 0?[F]:[]});if(m.length>0)D.push(...m),m.length=0;return e({path:"sandbox.credentials.awsPairs",message:`${S.issues[0]?.message??"Invalid value"}. "awsPairs" was degraded to non-functional suppressor pair(s); implicit AWS auto-pairing stays suppressed but nothing re-signs until it is fixed.`}),D}),sigv4:T(Object.fromEntries(["streaming","presigned","sigv4a"].map((S)=>[S,V(["deny","passthrough"]).optional().catch((x)=>(e({path:`sandbox.credentials.sigv4.${S}`,message:`${x.issues[0]?.message??"Invalid value"}. "${S}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`}),"deny"))]))).optional().catch((S)=>(e({path:"sandbox.credentials.sigv4",message:`${S.issues[0]?.message??"Invalid value"}. "sigv4" was degraded to an all-deny block (all shapes stay denied, and lower-precedence sigv4 values cannot take effect) until it is fixed.`}),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).optional().catch((S)=>{e({path:"sandbox.credentials",message:`${S.issues[0]?.message??"Failed schema validation"}. The credentials block was degraded to a fail-closed skeleton (all-deny sigv4, implicit AWS auto-pairing suppressed, no masking) until it is fixed.`});let x=Vi.flatMap((w)=>{let D=_({accessKeyIdVar:w},[]);return D!==void 0?[D]:[]});return m.length=0,{allowPlaintextInject:!1,awsPairs:x,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}}});return r.sandbox=PD().extend({credentials:b}).optional().catch((S)=>{e({path:"sandbox",message:`${S.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});let x=S.value;if(typeof x==="object"&&x!==null&&"credentials"in x){let w=b.safeParse(x.credentials);if(w.success&&w.data!==void 0)return e({path:"sandbox.credentials",message:"The credentials block was salvaged from the invalid sandbox value and stays enforced; every other sandbox field was ignored."}),{credentials:w.data}}return}),T(r).passthrough().transform((S)=>{for(let x of Object.keys(S))if(S[x]===void 0)delete S[x];return S})}function zQe(){let e=H_();return e!==void 0&&B_(e)}function Xee(){let e=Dn(),t=e==="wsl"&&!zQe()?"linux":e;switch(t){case"unknown":return{platform:t,chain:[]};default:return{platform:t,chain:gL(t)}}}var SL=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function Qee(e,t){if(!Ge(e))return[];let n=[];for(let{alias:r,canonical:o}of SL){if(!(r in e))continue;if(o in e&&e[o]!==null)n.push({file:t,path:r,message:`"${r}" is an alias for "${o}" and this file sets both; the "${r}" value was ignored. Use only "${o}".`,severity:"warning",alias:r,canonical:o});else e[o]=e[r];delete e[r]}return n}function ete(e){if(typeof e!=="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function UE(e){if(Array.isArray(e))return e.map(UE);if(e!==null&&typeof e==="object"){let t={};for(let n of Object.keys(e).sort())t[n]=UE(e[n]);return t}return e}var HQe=["enabled","enabledPlatforms"],Th="network.allowedDomains";function nte(e){if(!e)return{shellSettings:{},envVars:{},sandboxSettings:{},hasHooks:!1,payloadSlots:{}};let t=rte(e),n=BQe(e);KQe([t,...n.map(([,i])=>i)]);let r={};for(let[i,a]of n){let c={shellSettings:a.hasHooks?{...a.shellSettings,hooks:xc(a.hooks)}:a.shellSettings,envVars:a.envVars,sandboxSettings:a.sandboxSettings};if(ite(c))r[i]=c}let{sandboxSwitches:o,...s}=t;return{...s,payloadSlots:r}}function rte(e){let t={},n;for(let l of vQ){let u=e[l];if(l==="policyHelpers"){if(u!==null&&typeof u==="object")for(let f of Wn){let m=YQe(u[f]);if(m){if(t[`policyHelpers.${f}`]=m.command,m.scriptSize)n??={},n[`policyHelpers.${f}`]=m.scriptSize}}continue}let d;if(typeof u==="string")d=u;else if(u!==null&&typeof u==="object"&&"command"in u&&typeof u.command==="string")d=u.command;if(d!==void 0&&d.length>0)t[l]=d}let r=tet(e);if(r&&typeof r==="object")for(let[l,u]of Object.entries(r)){let d=u?.source;if(!d||typeof d!=="object")continue;if(d.source==="url"&&typeof d.headersHelper==="string"&&d.headersHelper.length>0)t[`extraKnownMarketplaces[${me(l)}].source.headersHelper`]=tte(d.headersHelper,"url",d.url);if(d.source==="settings"&&Array.isArray(d.plugins)){let f=new Map;for(let m of d.plugins){let h=me(m?.name),_=f.get(h)??0;f.set(h,_+1);let y=m?.source;if(y!==null&&typeof y==="object"&&"source"in y&&y.source==="command"&&"command"in y&&typeof y.command==="string"&&y.command.length>0)t[`extraKnownMarketplaces[${me(l)}].plugins[${me(m.name)}][${_}].source.command`]=y.command;if(typeof m?.headersHelper==="string"&&m.headersHelper.length>0){let b=m.source,v=b!==null&&typeof b==="object";t[`extraKnownMarketplaces[${me(l)}].plugins[${me(m.name)}][${_}].headersHelper`]=tte(m.headersHelper,v&&"source"in b?b.source:void 0,v&&"url"in b?b.url:void 0)}}}}let o=e.sandbox,s={},i={enabled:Ah(o,"enabled"),enabledPlatforms:Ah(o,"enabledPlatforms"),[Th]:Ah(o,Th)};if(o!==null&&typeof o==="object"){let l={enabled:i.enabled,enabledPlatforms:i.enabledPlatforms};for(let u of jD){let d=QQe(o[u]);if(d)t[`sandbox.${u}`]=xc({value:d,...l})}for(let u of wQ){let d=Ah(o,u);if(GQe(u,d))s[`sandbox.${u}`]=xc({value:d,...l,...ate.has(u)&&{allowedDomains:cte(i[Th])}})}}let a={};if(e.env&&typeof e.env==="object")for(let[l,u]of Object.entries(e.env)){if(u===void 0)continue;let d=String(u);if(d.length>0&&!AQ(l,d))a[l]=d}let c=e.hooks!==void 0&&e.hooks!==null&&typeof e.hooks==="object"&&Object.keys(e.hooks).length>0;return{shellSettings:t,inlineHelperScriptSizes:n,envVars:a,sandboxSettings:s,hasHooks:c,hooks:c?e.hooks:void 0,sandboxSwitches:i}}function BQe(e){return EL(e).map(([t,n])=>[t,rte(n)])}function EL(e){let t=[];for(let n of ste){let r=`policyHelpers.${n}`,o=Ah(e,r);if(!ete(o))continue;let{policyHelper:s,policyHelpers:i,...a}=o;t.push([r,a])}return t}function ote(e){return Wn.find((t)=>e===`policyHelpers.${t}.defaultSettings`)}function KQe(e){let t=e.map((r)=>Object.keys(r.sandboxSettings).length>0||jD.some((o)=>r.shellSettings[`sandbox.${o}`]!==void 0)),n=e.map((r)=>[...ate].some((o)=>r.sandboxSettings[`sandbox.${o}`]!==void 0));e.forEach((r,o)=>{if(t.some((s,i)=>s&&i!==o))for(let s of HQe){let i=r.sandboxSwitches[s];if(i!==void 0)r.sandboxSettings[`sandbox.${s}`]=xc({value:i})}if(n.some((s,i)=>s&&i!==o)){let s=r.sandboxSwitches[Th];if(s!==void 0)r.sandboxSettings[`sandbox.${Th}`]=xc({value:cte(s)??s})}})}var ste=[...Wn.map((e)=>`${e}.defaultSettings`),"default"];function bL(e){let t=[];for(let n of ste){let r=`policyHelpers.${n}`,o=e.payloadSlots[r];if(o!==void 0&&ite(o))t.push([r,o])}return t}function ite(e){return Object.keys(e.shellSettings).length>0||Object.keys(e.envVars).length>0||Object.keys(e.sandboxSettings).length>0}var ate=new Set(["credentials","network.tlsTerminate"]);function cte(e){return Array.isArray(e)?Tr(e.filter((t)=>typeof t==="string")).sort():void 0}function Ah(e,t){let n=e;for(let r of t.split(".")){if(n===null||typeof n!=="object")return;n=n[r]}return n}function GQe(e,t){if(t===void 0||t===null||t===!1)return!1;if(Array.isArray(t)&&t.length===0)return!1;return!(e==="credentials"&&WQe(t))}function WQe(e){if(typeof e!=="object"||e===null)return!1;return Object.entries(e).every(([t,n])=>{if(n===void 0)return!0;if(t==="files"||t==="envVars")return Array.isArray(n)&&n.every((r)=>typeof r==="object"&&r!==null&&r.mode==="deny");if(t==="sigv4")return typeof n==="object"&&n!==null&&Object.values(n).every((r)=>r===void 0||r==="deny");return t==="allowPlaintextInject"&&n===!1})}function VQe(e){return Object.keys(e.shellSettings).some(qQe)}function qQe(e){return Wn.some((t)=>e===`policyHelpers.${t}`)}function lte(e){return VQe(e)||Object.keys(e.shellSettings).some((t)=>t.startsWith("extraKnownMarketplaces["))||bL(e).length>0}function ZQe(e){return e==="sh"||e==="pwsh"}function YQe(e){if(e===null||typeof e!=="object")return;let{path:t,script:n,interpreter:r,timeoutMs:o,refreshIntervalMs:s}=e,i,a;if(typeof t==="string"&&t)i=t;else if(typeof n==="string"&&n&&ZQe(r))i={interpreter:r,script:XQe(n)},a=JQe(n);else return;return{command:me([i,o??null,s??null]),scriptSize:a}}function JQe(e){return{bytes:Buffer.byteLength(e,"utf8"),lines:SM(e,`
220
+ `)+(e.endsWith(`
221
+ `)?0:1)}}function XQe(e){return sm(me(e))}function QQe(e){if(typeof e==="string")return e||void 0;if(e===null||typeof e!=="object"||!("command"in e)||typeof e.command!=="string"||!e.command)return;let t="args"in e&&Array.isArray(e.args)?e.args.map(String):[];return me([e.command,...t])}function eet(e){return xc(ute(e))}function ute(e){return{shellSettings:e.shellSettings,envVars:e.envVars,sandboxSettings:Object.keys(e.sandboxSettings).length>0?e.sandboxSettings:void 0,hooks:e.hooks,payloadSlots:bL(e).length>0?Object.fromEntries(bL(e)):void 0}}function xc(e){return me(UE(e))}function dte(e){return sm(eet(e))}function pte(e,t,n){if(dte(t)===e)return!0;return typeof n==="string"&&n.length>0&&sm(xc({...ute(t),claudeMd:n}))===e}function tte(e,t,n){return me([e,typeof t==="string"?t:null,typeof n==="string"?n:null])}function fte(e){return e.replace(/[^\x20-\x7e]/gu,"?")}function tet(e){let t=e.extraKnownMarketplaces;if(t!==void 0&&t!==null)return t;let n=e;for(let{alias:r,canonical:o}of SL){if(o!=="extraKnownMarketplaces")continue;let s=n[r];if(s!==void 0&&s!==null&&typeof s==="object")return s}return}var net="remote-settings.json";var gte="remote-settings-helper-consent";function ret(){return hte(Wt(),gte)}function oet(e){let t=nte(e);return lte(t)?t:void 0}function set(e){return yh(e,(t,n)=>n.startsWith("$")&&n!=="$schema")}class _te{sessionCache=null;eligible=void 0;eligibilityMemo=void 0;ineligibleReason=void 0;evalPolicySnapshotOnly=!1;lastLoadStatus=void 0;lastLoadStatusChanged=Ct();policySettingsNotified=!1;verifiedPayload=null;unverifiedView=null;projectedView=null;consentedPayload=null;deferredPayload=null;resetEpoch=0;backendView=void 0;replaceSessionCache(e,t){if(this.sessionCache=e,t?.verified){if(this.verifiedPayload=e,t.consentDeferred)this.deferredPayload=e}}seedFromDisk(e){this.sessionCache=e;let t=oet(e);if(t!==void 0){let n=pet();if(n===void 0||!pte(n,t,e.claudeMd))return}this.consentedPayload??=e}markConsented(e){this.consentedPayload=e}dropConsentDeferral(){this.deferredPayload=null}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(e,t){if(this.eligible=e,t.memoize)this.eligibilityMemo=e,this.ineligibleReason=e?void 0:t.ineligibleReason}resetListener=null;registerResetListener(e){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=e}reset(){this.sessionCache=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.ineligibleReason=void 0,this.evalPolicySnapshotOnly=!1,this.lastLoadStatus=void 0,this.policySettingsNotified=!1,this.verifiedPayload=null,this.unverifiedView=null,this.projectedView=null,this.consentedPayload=null,this.deferredPayload=null,this.resetEpoch++,this.emitLoadStatusChanged(void 0)}emitLoadStatusChanged(e){try{this.lastLoadStatusChanged.emit(e)}catch(t){ce(`Remote settings: load-status listener threw: ${Hr(t)}`,{level:"error"})}}}var iet=new Je(()=>new _te);function dd(){return iet.of(Tn().host)}function FE(){return}function yte(){return dd().evalPolicySnapshotOnly}function Ste(e){return e!==null&&dd().projectedView?.view===e}function aet(e){return e&&yte()?{...hQ(e),managedSourcesBehavior:"merge"}:e}function cet(){return FE()??hte(Wt(),net)}var bte=8388608;function uet(){try{let e=fet();if(e===null)return null;let t=ft(vu(e));if(!t||typeof t!=="object"||Array.isArray(t))return null;return set(t)}catch(e){if(HX(e))ce(`Remote settings: Disk cache exceeds ${bte} bytes; ignoring it as if absent`);return null}}var det=4096;function pet(){let e=xL();if(e!==void 0)return e.attestation;try{return fc(ret(),det).trim()||void 0}catch{return}}function fet(){let e=xL();if(e!==void 0)return e.content;return fc(cet(),bte)}function xL(){let e=dd().backendView;if(!ye()||e===void 0||!e.ready||e.stoodDown||FE()!==void 0)return;if(!XM(e.configHome)){e.standDown("config home changed");return}return e}var S3t=tn.state("remote-settings"),b3t=tn.state(gte);var met=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...DD,...LD,"AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL_BEDROCK_RUNTIME",...FD,...$D,...zD,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...ND,"CLAUDE_CODE_API_BASE_URL","CLAUDE_CODE_OAUTH_REFRESH_TOKEN","CLAUDE_CODE_OAUTH_SCOPES","CLAUDE_CODE_OAUTH_CLIENT_ID","CLAUDE_CODE_SESSION_ACCESS_TOKEN","CLAUDE_SESSION_INGRESS_TOKEN_FILE","CLAUDE_CODE_ENVIRONMENT_KIND","CLAUDE_CODE_REMOTE_SESSION_ID","ANTHROPIC_FEDERATION_RULE_ID","ANTHROPIC_ORGANIZATION_ID","ANTHROPIC_WORKSPACE_ID","ANTHROPIC_SERVICE_ACCOUNT_ID","ANTHROPIC_IDENTITY_TOKEN","ANTHROPIC_IDENTITY_TOKEN_FILE","ANTHROPIC_SCOPE","ANTHROPIC_PROFILE","ANTHROPIC_CONFIG_DIR","CLAUDE_CODE_FEDERATION_CACHE_DIR","HOME","XDG_CONFIG_HOME","APPDATA","USERPROFILE","ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MANAGED_SETTINGS_PATH","CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE","CLAUDE_LOCAL_OAUTH_APPS_BASE","CLAUDE_LOCAL_OAUTH_CONSOLE_BASE","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL"].map((e)=>e.toUpperCase()));function het(e){if(!e||!e.env&&!("managedMcpServers"in e))return e;let{managedMcpServers:t,...n}=e;return e.env?{...n,env:yh(e.env,(r,o)=>met.has(o.toUpperCase()))}:n}function Ete(){let e=vte();if(e===null||xte(dd(),e))return!1;if(mte(e))return!0;let t=EL(e);if(t.length===0)return!1;let{chain:n}=Xee();return t.some(([r,o])=>{let s=ote(r);return(s===void 0||n.includes(s))&&mte(o)})}function mte(e){let t=e.managedMcpServers;return Ge(t)&&Object.keys(t).length>0}function xte(e,t){return t===e.verifiedPayload||Boolean(FE())}function vte(){let e=dd();if(!FE()&&e.eligible!==!0)return null;if(e.sessionCache)return e.sessionCache;let t=xL()!==void 0,n=uet();if(n){if(e.seedFromDisk(n),t)pc().invalidatePolicyLayer();else LX();return n}return null}function wte(){let e=vte(),t=dd(),n=xte(t,e)?e:get(t,e);if(n===null||!yte())return n;if(t.projectedView?.raw!==n)t.projectedView={raw:n,view:aet(n)};return t.projectedView.view}function get(e,t){if(t===null)return null;if(e.unverifiedView?.raw!==t)e.unverifiedView={raw:t,view:het(t)};return e.unverifiedView.view}var Ate={cli:!0,mcp:!0,"sdk-cli":!0,"sdk-ts":!0,"sdk-py":!0,bench:!0,"claude-vscode":!0,"claude-code-github-action":!0,"local-agent":!0,local_agent:!0,"claude-desktop":!0,remote:!0,remote_baku:!0,remote_cowork:!0,remote_trigger:!0,remote_cowork_trigger:!0,remote_desktop:!0,remote_mobile:!0,claude_in_slack:!0,"claude-in-slack":!0,"claude-in-teams":!0,"claude-desktop-3p":!0,"claude-security":!0,"ssh-remote":!0,"claude-coworker":!0,"claude-coworker-terminal":!0};var k3t=new Set(Object.keys(Ate));var _et=new Set(["claude-desktop-3p","local-agent"]);function Tte(){let e=_n.CLAUDE_CODE_ENTRYPOINT;return e!==void 0&&_et.has(e)}class Cte{entrypoint=void 0;childSession=!1;claudecode=!1;coworkFrameArtifacts=!1;setEntrypoint(e){this.entrypoint=e}setChildSession(e){this.childSession=e}setClaudecode(e){this.claudecode=e}setCoworkFrameArtifacts(e){this.coworkFrameArtifacts=e}}var R3t=new Je(()=>new Cte);function yet(e){return e!==void 0&&(e.commit!==void 0||e.pr!==void 0)}function kte(e,t){let n=e?.commitTrailers;if(typeof n==="boolean")return n?"explicit-enabled":"disabled";if(e!==void 0&&yet(e))return e.commit===""?"disabled":"implicit-enabled";if(t!==void 0)return t?"implicit-enabled":"disabled";return}import{userInfo as bet}from"os";var Rte="com.anthropic.claudecode",$E="HKLM\\SOFTWARE\\Policies\\ClaudeCode",zE="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Ch="Settings",vL="/usr/bin/plutil",Ote=["-convert","json","-o","-","--"],Pte=["-lint","-s","--"],Ite=5000,jE=2097152,Dte="/mnt/c/Windows/System32/reg.exe",pd="/mnt/c/Program Files/ClaudeCode";function kh(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let e=ve("fs").readFileSync("/proc/version","utf8").toLowerCase();return e.includes("microsoft")||e.includes("wsl")}catch{return!1}}function Lte(){let e="";try{e=bet().username}catch{}let t=[];if(e)t.push({path:`/Library/Managed Preferences/${e}/${Rte}.plist`,label:"per-user managed preferences"});return t.push({path:`/Library/Managed Preferences/${Rte}.plist`,label:"device-level managed preferences"}),t}var Nte=512;function Mte(e){return e.map(Eet)}function Eet(e){let{file:t,severity:n,docLink:r,statusOnly:o,startupFatal:s,preserveOnWrite:i,mcpErrorMetadata:a,path:c,message:l,expected:u,suggestion:d,invalidValue:f,...m}=e,h=m;return{file:t,severity:n,docLink:r,statusOnly:o,startupFatal:s,preserveOnWrite:i,mcpErrorMetadata:a,path:Rh(c),message:Rh(l),expected:u===void 0?void 0:Rh(u),suggestion:d===void 0?void 0:Rh(d),invalidValue:typeof f==="string"?Rh(f):void 0}}function Rh(e){let t=fte(e.replace(/\s+/gu," "));return t.length>Nte?`${t.slice(0,Nte-1)}…`:t}var js="https://code.claude.com/docs/en",xet=[{matches:(e)=>e.path==="permissions.defaultMode"&&e.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${js}/iam#permission-modes`}},{matches:(e)=>e.path==="apiKeyHelper"&&e.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(e)=>e.path==="cleanupPeriodDays"&&e.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(e)=>e.path.startsWith("env.")&&e.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${js}/settings#environment-variables`}},{matches:(e)=>(e.path==="permissions.allow"||e.path==="permissions.deny")&&e.code==="invalid_type"&&e.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(e)=>e.path.startsWith("hooks.")&&e.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${js}/hooks`}},{matches:(e)=>/\.hooks\.\d+\.command$/.test(e.path)&&e.code==="invalid_type"&&e.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${js}/hooks#exec-form-and-shell-form`}},{matches:(e)=>e.path.includes("hooks")&&e.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(e)=>e.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${js}/settings`}},{matches:(e)=>e.code==="invalid_value"&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="object"&&e.received===null&&e.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(e)=>e.path==="permissions.additionalDirectories"&&e.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${js}/iam#working-directories`}}],vet={permissions:`${js}/iam#configuring-permissions`,env:`${js}/settings#environment-variables`,hooks:`${js}/hooks`};function Ute(e){let t=xet.find((r)=>r.matches(e));if(!t)return null;let n={...t.tip};if(e.code==="invalid_value"&&e.enumValues&&!n.suggestion)n.suggestion=`Valid values: ${e.enumValues.map((r)=>`"${r}"`).join(", ")}`;if(!n.docLink&&e.path)n.docLink=vet[pv(e.path,".")];return n}var uZt=L(()=>ME(vh(),{strictPolicyHelperKeys:!0}).strict());function Fte(e){return e.code==="invalid_type"}function $te(e){return e.code==="invalid_value"}function wet(e){return e.code==="unrecognized_keys"}function zte(e){return e.code==="too_small"}function Vn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function jte(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function Oh(e,t){return e.issues.map((n)=>{let r=n.path.map(String).join("."),o=n.message,s,i,a,c,l;if($te(n))i=n.values.map((d)=>String(d)),a=i.join(" | "),c=void 0,l=void 0;else if(Fte(n)){a=n.expected;let d=jte(n.message);c=d??Vn(n.input),l=d??Vn(n.input)}else if(zte(n))a=String(n.minimum);else if(n.code==="custom"&&"params"in n)c=n.params.received,l=c;let u=Ute({path:r,code:n.code,expected:a,received:c,enumValues:i,message:n.message,value:c});if($te(n))s=i?.map((d)=>`"${d}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(Fte(n)){let d=jte(n.message)??Vn(n.input);if(n.expected==="object"&&d==="null"&&r==="")o="Invalid or malformed JSON";else o=`Expected ${n.expected}, but received ${d}`}else if(wet(n)){let d=n.keys.join(", ");o=`Unrecognized ${uv(n.keys.length,"field")}: ${d}`}else if(zte(n))o=`Number must be greater than or equal to ${n.minimum}`,s=String(n.minimum);return{file:t,path:r,message:o,expected:s,invalidValue:l,suggestion:u?.suggestion,docLink:u?.docLink}})}function Aet(e,t){if(!e||typeof e!=="object")return[];let n=e;if(!n.permissions||typeof n.permissions!=="object")return[];let r=n.permissions,o=[];for(let s of["allow","deny","ask"]){let i=r[s];if(!Array.isArray(i))continue;r[s]=i.filter((a)=>{if(typeof a!=="string")return o.push({file:t,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:a}),!1;let c=cL(a,s);if(!c.valid){let l=`Invalid permission rule "${a}" was skipped: ${c.error}`;if(c.suggestion)l+=`. ${c.suggestion}`;return o.push({file:t,path:`permissions.${s}`,message:l,severity:"warning",invalidValue:a}),!1}return!0})}return o}var Tet=new Set(ps);function Cet(e,t){if(!e||typeof e!=="object")return[];return[...ZQ(e,YQ)?[{file:t,path:"hooks",message:`PreToolUse/PermissionRequest hooks are declared outside "hooks" (at the top level or under another key) — ${Sc}.`,severity:"fatal",docLink:"https://code.claude.com/docs/en/hooks"}]:[],...ket(e,t)]}function ket(e,t){if(!("hooks"in e))return[];if(e.hooks===null||typeof e.hooks!=="object"||Array.isArray(e.hooks)){let o=Vn(e.hooks);if(Array.isArray(e.hooks)&&(e.hooks.some(Ge)||VD(e.hooks)))return[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${o} — ${Sc}.`,invalidValue:o,docLink:"https://code.claude.com/docs/en/hooks"}];return delete e.hooks,[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${o}. This field was ignored.`,severity:"warning",invalidValue:o,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=e.hooks;if(vE(n))return[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received a single matcher — ${Sc}.`,docLink:"https://code.claude.com/docs/en/hooks"}];let r=[];for(let o of Object.keys(n)){let s=_g(o);if(!Tet.has(o)){if(_c(n[o],3,{matchersCount:!Array.isArray(n[o])})){r.push({file:t,path:`hooks.${s}`,message:`"${s}" is not a hook event, but it holds PreToolUse/PermissionRequest hooks — ${Sc}.`,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete n[o],r.push({file:t,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${ps.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0});continue}if(!Array.isArray(n[o])){let i=n[o],a=Vn(i);if(Eh.has(o)&&i!==null||_c(i,3,{matchersCount:!1})){r.push({file:t,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${a} — ${Sc}.`,invalidValue:a,docLink:"https://code.claude.com/docs/en/hooks"});continue}delete n[o],r.push({file:t,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${a}. This entry was ignored.`,severity:"warning",invalidValue:a,docLink:"https://code.claude.com/docs/en/hooks",...i!==null&&{preserveOnWrite:!0}})}}for(let[o,s]of Object.entries(n)){let{stripped:i,unloadableGuards:a}=XQ(s,o);for(let c of a)r.push({file:t,path:c.aboutType?`hooks.${o}.${c.path}.type`:`hooks.${o}.${c.path}`,message:`${c.problem} — ${Sc}.${c.aboutType?` Valid types: ${[...xE()].join(", ")}`:""}`,severity:"fatal",invalidValue:c.received,docLink:"https://code.claude.com/docs/en/hooks"});for(let c of i)r.push({file:t,path:c.aboutType?`hooks.${o}.${c.path}.type`:`hooks.${o}.${c.path}`,message:c.aboutType?`${c.problem}; entry ignored. Valid types: ${[...xE()].join(", ")}`:`${c.problem}; ${c.hookIndex===void 0?"matcher":"entry"} ignored.`,severity:"warning",invalidValue:c.received,docLink:"https://code.claude.com/docs/en/hooks",preserveOnWrite:!0})}if(r.length>0&&Object.keys(n).length===0)delete e.hooks;return r}var Ret=[{key:"allowedMcpServers",schema:LE},{key:"deniedMcpServers",schema:NE}];function Oet(e,t,n){if(!e||typeof e!=="object")return[];let r=e,o=[];for(let{key:s,schema:i}of Ret){if(!(s in r))continue;if(!Array.isArray(r[s])){if(n?.keepWholeFieldInvalid)continue;let l=r[s];delete r[s],o.push({file:t,path:s,message:`"${s}" must be an array; received ${Vn(l)}. This field was ignored.`,severity:"warning",invalidValue:l});continue}let a=r[s],c=[];for(let l=0;l<a.length;l++){let u=i().safeParse(a[l]);if(u.success)c.push(a[l]);else o.push({file:t,path:`${s}[${l}]`,message:`Invalid entry was ignored: ${u.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:a[l]})}if(c.length<a.length)r[s]=c}return o}function Pet(e,t){if(!Ge(e)||e.managedMcpServers===void 0)return[];let r=[],o=SE(e.managedMcpServers,(s,i)=>r.push({file:t,path:s?`managedMcpServers.${s}`:"managedMcpServers",message:s?`Managed MCP server was ignored: ${i}`:i,severity:"warning"}));if(o===void 0)delete e.managedMcpServers;else e.managedMcpServers=o;return r}function Iet(e){if(!e||typeof e!=="object")return;let t=e.source;if(!t||typeof t!=="object")return;let n=t.source;return typeof n==="string"?n:void 0}function Det(e){if(!e||typeof e!=="object")return!1;let t=e.source;if(!t||typeof t!=="object")return!1;let n=t.plugins;return Array.isArray(n)&&n.some(nL)}function Let(e,t){if(!e||typeof e!=="object")return[];let n=e,r="extraKnownMarketplaces";if(!(r in n))return[];let o=n[r];if(!o||typeof o!=="object"||Array.isArray(o)){let a=Vn(o);return delete n[r],[{file:t,path:r,message:`"${r}" must be an object mapping marketplace names to declarations; received ${a}. This field was ignored.`,severity:"warning",invalidValue:a}]}let s=o,i=[];for(let a of Object.keys(s)){let c=pL().safeParse(s[a]),l;if(!c.success){let u=Iet(s[a]);if(u!==void 0&&!_ee.has(u)||Det(s[a]))continue;l=AE(c.error.issues)}else if(c.data.source.source==="settings"&&c.data.source.name!==a)l=`key "${ss(a)}" must match the settings source name "${ss(c.data.source.name)}"`;if(l!==void 0)i.push({file:t,path:`${r}.${ss(a)}`,message:`Invalid marketplace entry was ignored: ${l}`,severity:"warning"}),delete s[a]}return i}function Net(e,t){if(!e||typeof e!=="object")return[];let n=e,r="modelPicker";if(!(r in n))return[];let o=n[r];if(!Ge(o)||!Array.isArray(o.options)){let c=Ge(o)?`options: ${Vn(o.options)}`:Vn(o);return delete n[r],[{file:t,path:r,message:`"${r}" must be an object with an "options" array of { model, label?, description?, behavesAs? } rows; received ${c}. This field was ignored.`,severity:"warning",invalidValue:c}]}let s=[];if("replaceBuiltInOptions"in o&&typeof o.replaceBuiltInOptions!=="boolean"){let c=Vn(o.replaceBuiltInOptions);delete o.replaceBuiltInOptions,s.push({file:t,path:`${r}.replaceBuiltInOptions`,message:`"replaceBuiltInOptions" must be true or false; received ${c}. This entry was ignored (the rows are added to the built-in lineup).`,severity:"warning",invalidValue:c})}let i=o.options,a=[];for(let c=0;c<i.length;c++){let l=hL().safeParse(i[c]);if(l.success){a.push(i[c]);continue}s.push({file:t,path:`${r}.options.${c}`,message:`${Uet(l.error.issues[0])}. This row was ignored; the other rows still apply.`,severity:"warning",invalidValue:Vn(i[c])})}if(a.length!==i.length)o.options=a;return s}function Met(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return[];let n=e;if(!("modelPricing"in n)||n.modelPricing===void 0)return[];let r=n.modelPricing;if(!r||typeof r!=="object"||Array.isArray(r))return delete n.modelPricing,[{file:t,path:"modelPricing",message:`"modelPricing" must be an object; received ${Vn(r)}. It was ignored.`,severity:"warning"}];let o=r,s=[];if(o.multiplier!==void 0&&!mL().safeParse(o.multiplier).success)s.push({file:t,path:"modelPricing.multiplier",message:'"multiplier" must be a number in (0, 1]. It was ignored.',severity:"warning",invalidValue:o.multiplier}),delete o.multiplier;if(o.overrides!==void 0){let i=o.overrides;if(!i||typeof i!=="object"||Array.isArray(i))s.push({file:t,path:"modelPricing.overrides",message:`"overrides" must be an object mapping model ID to rates; received ${Vn(i)}. It was ignored.`,severity:"warning"}),delete o.overrides;else{let a=i;for(let c of Object.keys(a)){let l=fL().safeParse(a[c]);if(l.success&&c!=="constructor"&&c!=="__proto__")continue;let u=l.success?void 0:l.error.issues[0];s.push({file:t,path:`modelPricing.overrides.${ss(c)}`,message:`Invalid pricing row was ignored (${u?`${u.path.join(".")||"row"}: ${u.message}`:"not a model ID"}).`,severity:"warning",invalidValue:a[c]}),delete a[c]}}}return s}function Uet(e){if(!e)return"Invalid modelPicker row";return`modelPicker row ${e.path.length>0?`"${e.path.join(".")}" `:""}${e.message}`.trim()}function Fet(e,t,n){if(!e||typeof e!=="object"||Array.isArray(e))return[];let r=e,o=r.crossSessionInbound;if(o===void 0||$et(o))return[];if(n?.policySource)r.crossSessionInbound="refuse";else delete r.crossSessionInbound;return[Het(o,t,n?.policySource===!0)]}function $et(e){return typeof e==="string"&&wh.includes(e)}var zet="crossSessionInbound";function jet(e){let t=wh.map((r)=>`"${r}"`).join(", "),n=typeof e==="string"?`"${ss(e).replace(/^<key>$/,"<value>")}"`:Vn(e);return`must be one of ${t}; received ${n}`}function Het(e,t,n=!1){let r=wh.map((s)=>`"${s}"`).join(", "),o=n?'In managed settings an unrecognized value is treated as "refuse" (the most restrictive): cross-session messages to this session are turned away until an administrator fixes it.':"This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.";return{file:t,path:zet,message:`"crossSessionInbound" ${jet(e)}. ${o}`,severity:"warning",expected:r,...n&&{statusOnly:!0}}}var Hte="remoteControl.shareHostProfile";function Bet(e,t,n){if(!Ge(e)||e.remoteControl===void 0)return[];let r=n?.policySource===!0,o=DE.map((f)=>`"${f}"`).join(", "),s=r?'In managed settings this is treated as "off" (the most restrictive): Remote Control environments report nothing about this machine until an administrator fixes it.':"While it is present, Remote Control environments report nothing about this machine.",i=(f)=>({file:t,path:Hte,message:`${f}. ${s}`,severity:"warning",expected:o,...r?{statusOnly:!0}:{preserveOnWrite:!0}}),a=(f)=>typeof f==="string"?`"${ss(f).replace(/^<key>$/,"<value>")}"`:Vn(f),c=e.remoteControl;if(!Ge(c)){if(r)e.remoteControl={shareHostProfile:"off"};else delete e.remoteControl;return[i(`"remoteControl" must be an object like { "shareHostProfile": ${o.replace(/, /g," | ")} }; received ${a(c)}`)]}let l=[],u=Object.keys(c).filter((f)=>f!=="shareHostProfile");if(u.length>0){if(r)c.shareHostProfile="off";l.push(i(`"remoteControl" has an unrecognized key ${u.map((f)=>`"${ss(f)}"`).join(", ")} (its only key is "shareHostProfile")`))}let d=c.shareHostProfile;if(d!==void 0&&!(typeof d==="string"&&DE.includes(d))){if(r)c.shareHostProfile="off";else delete c.shareHostProfile;l.push(i(`"${Hte}" must be one of ${o}; received ${a(d)}`))}return l}function vc(e,t,n){return[...Qee(e,t),...Aet(e,t),...Cet(e,t),...Let(e,t),...Net(e,t),...Met(e,t),...Fet(e,t,{policySource:n?.policySource}),...Bet(e,t,{policySource:n?.policySource}),...n?.skipMcpServerEntryFilter?[]:Oet(e,t,{keepWholeFieldInvalid:n?.mcpServerEntrySalvageOnly}),...n?.mcpServerEntrySalvageOnly?Pet(e,t):[]]}function OL(e){let t=new Set(e.allowedSources);return t.add("flagSettings"),t.add("policySettings"),NX.filter((n)=>t.has(n))}function Wet(){return No(hc(),"managed-settings.json")}function PL(e){if(Dn()==="wsl"&&e.wslInherits?.()){let t=wL(pd,e.store);if(t.settings)return t;let n=wL(hc(),e.store);return{settings:n.settings,errors:[...t.errors,...n.errors]}}return wL(hc(),e.store)}function Vet(e){return e.endsWith(".json")&&!e.startsWith(".")}function wL(e,t){let n=[],r={},o=!1,{settings:s,errors:i}=fd(No(e,"managed-settings.json"),t,void 0,!0);if(n.push(...i),s&&Object.keys(s).length>0)r=Gn(r,s,Lo),o=!0;let a=No(e,"managed-settings.d");try{let c=t.folderListingForPolicyWalk(a),l;if(c!==void 0)l=c;else l=et().readdirSync(a).filter((u)=>(u.isFile()||u.isSymbolicLink())&&Vet(u.name)).map((u)=>u.name).sort(),t.noteWalkListing(a,l);for(let u of l){let{settings:d,errors:f}=fd(No(a,u),t,void 0,!0);if(n.push(...f),d&&Object.keys(d).length>0)r=Gn(r,d,Lo),o=!0}}catch(c){let l=ke(c);if(l!=="ENOENT"&&l!=="ENOTDIR")ce(`managed-settings.d read failed: ${c}`,{level:"error"}),n.push(Ph(a,c,"directory"))}return{settings:o&&Ac(r)?r:null,errors:n}}function qet(e,t){if(rr(e))Qet(t);else ce(`settings file read failed at ${t}: ${e}`,{level:"error"})}function fd(e,t,n,r){let o=n!==void 0?`${e}\x00pinned`:e,s=t.parsedFiles.get(o);if(s)return{settings:s.settings?uo(s.settings):null,errors:s.errors};let i=Jet(e,n,r);return t.parsedFiles.set(o,i),{settings:i.settings?uo(i.settings):null,errors:i.errors}}function IL(e){if(!e.mdm)return{settings:null,errors:[]};let t=e.mdm();return{settings:Object.keys(t.settings).length>0?t.settings:null,errors:t.errors}}function BE(e,t){let n=Bte.get(e),r=n?.get(t);if(r)return{settings:r.settings&&uo(r.settings),errors:r.errors.map((s)=>({...s}))};let o=Zet(e,t);if(n)n.set(t,o);else Bte.set(e,new Map([[t,o]]));return{settings:o.settings&&uo(o.settings),errors:o.errors.map((s)=>({...s}))}}var Bte=new WeakMap;function Zet(e,t){let n=uo(e),r=vc(n,t,{skipMcpServerEntryFilter:!0,policySource:!0}),o=[],s=yL(Yte(t,o),t).safeParse(n);if(!s.success)return{settings:null,errors:[...r,...Oh(s.error,t)]};return{settings:Object.keys(s.data).length>0?s.data:null,errors:[...r,...o]}}function wc(e){return Tte()&&(e==="managedMcpServers"||e.startsWith("managedMcpServers."))}function Zte(e,t){if(!Ge(e)||!("managedMcpServers"in e))return[];return delete e.managedMcpServers,wc("managedMcpServers")?[]:[{file:t,path:"managedMcpServers",message:'"managedMcpServers" is only honored from managed settings and was ignored here.',severity:"warning"}]}function Yte(e,t){return(n)=>{if(wc(n.path))return;if(t.push({file:e,path:n.path,message:n.message,severity:"warning",...n.statusOnly&&{statusOnly:n.statusOnly},...n.startupFatal&&{startupFatal:n.startupFatal}}),n.statusOnly||n.startupFatal)ce(`${e}: ${n.path}: ${n.message}`,{level:n.startupFatal?"error":"warn"})}}function Jte(e){let t=e?.remote?e.remote():wte(),n=!e?.remote&&!wc("managedMcpServers")&&Ete()?[{file:"remote managed settings",path:"managedMcpServers",message:"The organization's MCP servers in the cached remote settings are withheld until the server confirms them this session; they connect as soon as it does.",severity:"warning",statusOnly:!0}]:[];if(!t||Object.keys(t).length===0)return{settings:null,errors:n,servedSnapshot:!1};let{settings:r,errors:o}=BE(t,"remote managed settings");return{settings:r,errors:[...n,...Mte(o)],servedSnapshot:Ste(t)}}var Kte="parent managed settings";function Yet(e){let t=e.parentManaged;if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};let n=BE(t,Kte);if(n.settings?.managedMcpServers!==void 0&&!wc("managedMcpServers"))n.errors.push({file:Kte,path:"managedMcpServers",message:`"managedMcpServers" is only honored from the organization's managed settings sources (server-managed, MDM, managed-settings.json), not from settings a host passes in, and was ignored here.`,severity:"warning",statusOnly:!0});return n}function Xte(e){let t=e.flagInline;if(!t)return{settings:null,errors:[]};let n=uo(t),r=[...Zte(n,"SDK inline settings"),...vc(n,"SDK inline settings")],o=ud().safeParse(n);if(!o.success)return{settings:null,errors:[...r,...Oh(o.error,"SDK inline settings")]};if(r.some((s)=>s.severity==="fatal"))return{settings:null,errors:r};return{settings:o.data,errors:r}}var KE=2097152;function Jet(e,t,n){try{let r;if(t!==void 0)r=t;else{let{resolvedPath:o}=pf(et(),e);r=fc(o,KE)}return Xet(r,e,n)}catch(r){return ttt(r,e)}}function Xet(e,t,n){if(e.trim()==="")return{settings:{},errors:[]};let r=uo(mc(e,!1));if(n){if(!Ge(r))return{settings:null,errors:[GE(t)]};let i=vc(r,t,{skipMcpServerEntryFilter:!0,policySource:!0}),a=[],c=yL(Yte(t,a),t).safeParse(r);if(!c.success)return{settings:null,errors:[...i,...Oh(c.error,t)]};return{settings:c.data,errors:[...i,...a]}}let o=[...Zte(r,t),...vc(r,t)],s=ud().safeParse(r);if(!s.success){let i=Oh(s.error,t);return{settings:null,errors:[...o,...i]}}if(o.some((i)=>i.severity==="fatal"))return{settings:null,errors:o};return{settings:s.data,errors:o}}function GE(e,{userWritable:t=!1}={}){return t?{file:e,path:"",message:`Managed settings document (${e}) could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`,severity:"warning",statusOnly:!0}:{file:e,path:"",message:"Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.",startupFatal:!0}}function Qet(e){ce(`Broken symlink or missing file encountered for settings.json at path: ${e}`)}function ett(){return{settings:null,errors:[]}}function ttt(e,t){if(qet(e,t),rr(e))return ett();return{settings:null,errors:[Ph(t,e)]}}function Ph(e,t,n="file"){return{file:e,path:"",message:`${n==="directory"?"Managed settings drop-in directory":"Settings file"} could not be read: ${t instanceof Error?t.message:String(t)}`,severity:"fatal"}}function Gte(e,t){switch(e){case"userSettings":return eo(Wt());case"policySettings":case"projectSettings":return eo(t.cwd);case"localSettings":return Qte(t.cwd,t.canonicalGitRoot);case"flagSettings":return t.flagPath?Get(eo(t.flagPath)):eo(t.cwd)}}function Qte(e,t){let n=ntt(e,t);if(n.decided!==void 0)return n.decided;if(!stt(n.root))return n.cwdResolved;return n.root}function ntt(e,t){let n=t?.(e);if(!n)return{decided:eo(e)};let r=eo(n),o=eo(e);if(r===o)return{decided:r};let s;try{s=itt()}catch{return{decided:o}}if(r===s)return{decided:o};return{decided:void 0,root:r,cwdResolved:o}}function rtt(e){return pc().localStoreProbes.canonicalRootOwnerUids(e,ott)}function ott(e){let t=et(),n=null;try{n=t.lstatSync(No(e,".claude")).uid}catch(r){if(!rr(r))throw r}return{rootUid:t.statSync(e).uid,gitEntryUid:t.lstatSync(No(e,".git")).uid,claudeEntryUid:n}}function stt(e){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return ce(`localSettings: not canonicalizing the consent store to ${e} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let t=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:n,gitEntryUid:r,claudeEntryUid:o}=rtt(e);if(n===t&&r===t&&(o===null||o===t))return!0;return ce(`localSettings: not canonicalizing the consent store to ${e} — it (uid ${n}), its .git entry (uid ${r}), or its .claude entry (uid ${o??"absent"}) is not owned by the current user (uid ${t}); the store stays at the session cwd (the pre-canonicalization behavior). If you own this repo, chown it (including .git and .claude) or run from a directory you own.`,{level:"warn"}),!1}catch(n){return ce(`localSettings: not canonicalizing the consent store to ${e} — its ownership could not be verified (${n instanceof Error?n.message:String(n)}); the store stays at the session cwd`,{level:"warn"}),!1}}function itt(){return pc().localStoreProbes.normalizedRealHomeDir(att)}function att(){let e=Gx(Ket());if(e===null)throw Error("home directory realpath unavailable");return ot(e)}var Wte={default:"settings.json",cowork:"cowork_settings.json"};function ctt(e){if(e.coworkPlugins||_n.CLAUDE_CODE_USE_COWORK_PLUGINS)return Wte.cowork;return Wte.default}function Ih(e,t){switch(e){case"userSettings":return No(Gte(e,t),ctt(t));case"projectSettings":case"localSettings":return No(Gte(e,t),ene(e));case"policySettings":return Wet();case"flagSettings":return t.flagPath}}function ene(e){switch(e){case"projectSettings":return No(".claude","settings.json");case"localSettings":return No(".claude","settings.local.json")}}function tne(e){if(Qte(e.cwd,e.canonicalGitRoot)===eo(e.cwd))return;return No(eo(e.cwd),ene("localSettings"))}function nne(e,t){let n=t.store.perSource.get(e);if(n!==void 0)return n;let r=Dtt(e,t);return t.store.perSource.set(e,r),r}function ltt(e,t=!1){return!e||e.parentSettingsBehavior==="merge"||t}var utt=[["permissions","defaultMode"],["modelPicker","replaceBuiltInOptions"]];function dtt(e){let t={};for(let{path:n,restrictive:r}of dh){let o=zs(e,n);if(n[0]==="sandbox"&&ph(r).includes(o))Wi(t,n,o)}return t.sandbox??{}}function ptt(e,t){let n={};if(e.allowManagedHooksOnly===!0)n.allowManagedHooksOnly=!0;if(e.disableCommandPluginSources===!0)n.disableCommandPluginSources=!0;if(e.allowManagedMcpServersOnly===!0)n.allowManagedMcpServersOnly=!0;if(e.disableClaudeAiConnectors===!0)n.disableClaudeAiConnectors=!0;if(e.syncClaudeAiSkills===!1)n.syncClaudeAiSkills=!1;if(e.syncClaudeAiPlugins===!1)n.syncClaudeAiPlugins=!1;if(e.remoteTools?.allowUnattendedServing===!1)n.remoteTools={...n.remoteTools,allowUnattendedServing:!1};if(e.allowManagedPermissionRulesOnly===!0)n.allowManagedPermissionRulesOnly=!0;if(e.disableAutoMode==="disable")n.disableAutoMode="disable";let r=e.remoteControl?.shareHostProfile;if(r==="off"||r==="basic")n.remoteControl={...n.remoteControl,shareHostProfile:r};if(kte(e.attribution,e.includeCoAuthoredBy)==="disabled")n.attribution={...n.attribution,commitTrailers:!1};if(e.attribution?.sessionUrl===!1)n.attribution={...n.attribution,sessionUrl:!1};let o=e.strictPluginOnlyCustomization;if(o===!0||Array.isArray(o)&&o.length>0)n.strictPluginOnlyCustomization=o;if(e.deniedMcpServers)n.deniedMcpServers=e.deniedMcpServers;if(t.forceLoginOrgUUID===void 0&&e.forceLoginOrgUUID)n.forceLoginOrgUUID=e.forceLoginOrgUUID;if(t.allowedMcpServers===void 0&&e.allowedMcpServers)n.allowedMcpServers=e.allowedMcpServers;if(t.availableModels===void 0&&e.availableModels)n.availableModels=e.availableModels;if(e.enforceAvailableModels===!0)n.enforceAvailableModels=!0;if(e.permissions){let s=_h(e.permissions,["deny","ask"]);if(e.permissions.disableBypassPermissionsMode==="disable")s.disableBypassPermissionsMode="disable";if(e.permissions.disableAutoMode==="disable")s.disableAutoMode="disable";if(e.permissions.blockReadsOutsideWorkingDirectories===!0)s.blockReadsOutsideWorkingDirectories=!0;if(t.allowManagedPermissionRulesOnly!==!0){let{allow:i,additionalDirectories:a}=e.permissions;if(i&&t.sandbox?.network?.allowManagedDomainsOnly!==!0)s.allow=i;if(a)s.additionalDirectories=a}if(Object.keys(s).length>0)n.permissions=s}if(e.sandbox){let{network:s,filesystem:i,credentials:a}=e.sandbox,c={},l=s?_h(s,["deniedDomains"]):{},u=i?_h(i,["denyRead","denyWrite"]):{};if(s){if(t.sandbox?.network?.allowManagedDomainsOnly!==!0&&s.allowedDomains)l.allowedDomains=s.allowedDomains}if(Object.keys(l).length>0)c.network=l;if(i){if(t.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&i.allowRead)u.allowRead=i.allowRead}if(Object.keys(u).length>0)c.filesystem=u;if(a){let d=(a.files??[]).map((h)=>h.mode==="deny"?{path:h.path,mode:"deny"}:{path:h.path,mode:"mask",injectHosts:[]}),f=(a.envVars??[]).filter((h)=>h.mode==="deny").map((h)=>({name:h.name,mode:"deny"})),m={...d.length>0&&{files:d},...f.length>0&&{envVars:f}};if(a.sigv4){let h={};for(let _ of["streaming","presigned","sigv4a"])if(a.sigv4[_]==="deny")h[_]="deny";m.sigv4=h}{let h=rne(a.awsPairs??[],[]);if(h.length>0)m.awsPairs=h}if(Object.keys(m).length>0)c.credentials=m}if(Gn(c,dtt(e)),Object.keys(c).length>0)n.sandbox=c}return n}function rne(e,t){let n=Vi,r=new Set(t.flatMap(Vte));return Tr(e.flatMap(Vte)).filter((o)=>n.includes(o)&&!r.has(o)).map((o,s)=>({accessKeyIdVar:o,secretAccessKeyVar:`${gE}${s+1}_`}))}function Vte(e){if(!Ge(e))return[];return[e.accessKeyIdVar,e.secretAccessKeyVar,e.sessionTokenVar].filter((t)=>typeof t==="string")}var ftt=new Set([...[...MD].filter((e)=>e!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...UD,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL","CLAUDE_CODE_SUBAGENT_MODEL_FORCE"]);function mtt(e,t){if(!t||!e)return null;let n={};if(e.model!==void 0)n.model=e.model;if(e.availableModels!==void 0)n.availableModels=e.availableModels;if(e.enforceAvailableModels!==void 0)n.enforceAvailableModels=e.enforceAvailableModels;if(e.fallbackModel!==void 0)n.fallbackModel=e.fallbackModel;if(e.modelPicker!==void 0)n.modelPicker=e.modelPicker;return Object.keys(n).length>0?n:null}function HE(e){if(delete e.model,delete e.fallbackModel,delete e.modelPicker,delete e.modelOverrides,e.env){let t={};for(let[n,r]of Object.entries(e.env))if(!ftt.has(n.toUpperCase()))t[n]=r;e.env=t}}function CL(){return Dn()==="macos"?"plist":"hklm"}function one(e){let t=LL(e);if(t.composes==="tier")return"helper";let n=kL(e);if(t.composes==="remoteSlot"||n.present.remote)return"remote";if(n.present.mdm)return CL();if(n.present.file)return"file";if(n.parentSlice||n.hostModelOverlay)return"parent";let r=e.hkcu?.();return r&&Object.keys(r.settings).length>0?"hkcu":null}function kL(e){let t=[],{settings:n,errors:r,servedSnapshot:o}=Jte(e);t.push(...r);let s=LL(e),i=s.composes==="remoteSlot"?s.helper:TL(n),{settings:a,errors:c}=IL(e);t.push(...c);let l=TL(a),{settings:u,errors:d}=e.file?.()??PL(e);t.push(...d);let f=TL(u),{settings:m,errors:h}=Yet(e);t.push(...h);let _=m!==null&&(l===null&&f===null||(l??f)?.parentSettingsBehavior==="merge"),y=[btt(i,o&&s.composes!=="remoteSlot",[l,f,..._?[_h(m,Stt)]:[]]),l,f].filter((Q)=>Q!==null),v=(s.composes==="remoteSlot"?s.helper:[n,a,u].find((Q)=>Q!==null&&(Q===n&&o?i!==null:Q.managedSourcesBehavior!==void 0||Ac(Q))))?.managedSourcesBehavior,S=i!==null&&o&&s.composes!=="remoteSlot",{admin:x,merged:w}=htt(y,v,S),D={remote:i!==null,mdm:l!==null,file:f!==null},P=[];if(w){let Q=D.remote?"remote":D.mdm?CL():"file",ut=[[l,CL()],[f,"file"]];for(let[De,dt]of ut){if(De===null||De===y[0]||S&&De===y[1])continue;let W=DL.filter((wn)=>Object.values(De[wn]??{}).some((xt)=>xt!==void 0&&xt!==null)),[qe]=W;if(qe===void 0)continue;P.push(dt),t.push({file:AL[dt],path:qe,message:`${W.map((wn)=>`"${wn}"`).join(" and ")} in ${AL[dt]} ignored: policy helper configuration is read from the highest managed settings source only (${AL[Q]} here), even with managedSourcesBehavior "merge". Configure the helper in that source instead.`,severity:"warning",statusOnly:!0})}}let F=(Q)=>Q!==null&&(Q===y[0]||Object.keys(gh(Q,dne())).length>0),z={remote:F(i),mdm:F(l),file:F(f)},q={allowManagedPermissionRulesOnly:y.some((Q)=>Q.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:x?.forceLoginOrgUUID,allowedMcpServers:x?.allowedMcpServers,availableModels:x?.availableModels,sandbox:{network:{allowManagedDomainsOnly:y.some((Q)=>Q.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:y.some((Q)=>Q.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},ee=m&&ltt(x,S&&!D.mdm&&!D.file)?ptt(m,q):null,te=ee&&Object.keys(ee).length>0?ee:null,xe=mtt(m,e.hostManagedProvider);return{tiers:y,admin:x,parentSlice:te,hostModelOverlay:xe,errors:t,present:D,merged:w,composed:z,snapshotFirst:S,shadowedHelperSources:P}}function htt(e,t,n){let r=e[0];if(!r)return{admin:null,merged:!1};let{managedSourcesBehavior:o,...s}=r;if(t!=="merge"||e.length<2)return{admin:o===void 0?r:s,merged:!1};let i=e.slice(1).map((c,l)=>{let u=n&&l===0?{...c}:gh(c,dne());if(!(n&&l===0)){for(let f of utt)if(zs(u,f)!==void 0)Wi(u,f,void 0)}let d=zs(u.sandbox,["enabledPlatforms"]);if(Array.isArray(d)&&d.includes(Dn()))Wi(u,["sandbox","enabledPlatforms"],void 0);else if(d!==void 0)delete u.sandbox;return u}),a={};for(let c of[...i].reverse())Gn(a,c,RL);return Gn(a,s,n?Ett:RL),xtt(a,[r,...i]),gtt(a,[r,...i],n),{admin:a,merged:!0}}var sne=["managedSourcesBehavior","wslInheritsWindowsSettings"],DL=["policyHelper","policyHelpers"],AL={remote:"server-managed settings",plist:"the managed preferences plist",hklm:"the HKLM policy key",file:"managed-settings.json"};function Ac(e){return Object.keys(e).some((t)=>!sne.includes(t))}function TL(e){return e&&Ac(e)?e:null}function gtt(e,t,n){let r=t.findIndex((s)=>s.availableModels!==void 0),o=t.findIndex((s)=>s.modelOverrides!==void 0);if(o!==-1&&(r===-1||o<=r||n&&r===0))e.modelOverrides={...t[o].modelOverrides};else delete e.modelOverrides}var ine=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins"],_tt=["awsPairs","ripgrep"];function ane(e,t,n){if(t===void 0)return e;if(Array.isArray(t))return n==="awsPairs"&&Array.isArray(e)?[...t,...rne(e,t)]:[...t];if(!Ge(t))return t;return xd(t,(r)=>Array.isArray(r)?[...r]:r)}var ytt=["allowedMcpServers","availableModels","strictKnownMarketplaces","allowedChannelPlugins","allowedMarketplaces","allowedHttpHookUrls","httpHookAllowedEnvVars"],Stt=["allowedMcpServers","availableModels"];function btt(e,t,n){if(e===null||!t)return e;let r=ytt.filter((o)=>n.some((s)=>s?.[o]!==void 0));return r.length===0?e:gh(e,r)}function RL(e,t,n){if(n!==void 0&&(ine.includes(n)||_tt.includes(n)))return ane(e,t,n);return cne(e,t,n)}function Ett(e,t,n){if(n!==void 0&&ine.includes(n))return ane(e,t,n);return cne(e,t,n)}function cne(e,t,n){if(Array.isArray(e)&&Array.isArray(t)&&n!=="fallbackModel")return Tr([...t,...e]);return Lo(e,t,n)}function xtt(e,t){let n=t[0],r=e;for(let{path:o,restrictive:s}of dh){let i=ph(s),a=Math.min(...t.map((c)=>i.indexOf(zs(c,o))).filter((c)=>c!==-1));if(Number.isFinite(a))Wi(r,o,i[a]);else if(zs(n,o)===void 0&&zs(e,o)!==void 0)Wi(r,o,void 0)}if(e.strictPluginOnlyCustomization!==!0){let o=Tr(t.flatMap((s)=>Array.isArray(s.strictPluginOnlyCustomization)?s.strictPluginOnlyCustomization:[]));if(o.length>0)e.strictPluginOnlyCustomization=o;else if(n?.strictPluginOnlyCustomization===void 0)delete e.strictPluginOnlyCustomization}}function LL(e){let t=e.helper?.()??null;if(!t)return{composes:"none"};let n=e.helperArmedFromRemote?.()===!1?"tier":"remoteSlot";if(e.helperMergesOutput?.()!==!0)return{composes:n,helper:t,mergedOver:null};if(!e.store.policy.mergedHelper){let r,o;if(n==="remoteSlot")r=Jte(e).settings,o="remote";else if(r=IL(e).settings)o=Dn()==="macos"?"plist":"hklm";else r=(e.file?.()??PL(e)).settings,o="file";e.store.policy.mergedHelper={helper:Ttt(r,t),mergedOver:Object.keys(lne(r)).length>0?o:null}}return{composes:n,...e.store.policy.mergedHelper}}function lne(e){return gh(e??{},DL)}function vtt(e,t){let n=new Map;for(let[o,s]of Object.entries(t)){let i=o.toUpperCase();if(!n.has(i))n.set(i,s)}let r={};for(let[o,s]of Object.entries(e))r[o]=n.get(o.toUpperCase())??s;return Object.assign(r,t)}var wtt=["forceLoginOrgUUID","allowedHttpHookUrls","httpHookAllowedEnvVars","allowRead"];function Att(e,t,n){let r=n!==void 0&&t!==void 0&&wtt.includes(n)?t:RL(e,t,n);return r===t&&Array.isArray(r)?[...r]:r}function Ttt(e,t){let n=lne(e),r=Gn({},n,t,Att);if(n.env&&t.env)r.env=vtt(n.env,t.env);return r}var une=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];var Ctt=[...une,"otelHeadersHelper","proxyAuthHelper","forceLoginOrgUUID","forceLoginMethod","forceLoginGatewayUrl","parentSettingsBehavior","env","modelPicker",...DL,...sne];function dne(){return Ctt}function ktt(e){return EQ.some((t)=>e.startsWith(t))||bQ.includes(e)}function Rtt(e,t,n,r=0){let o=new Map,s=new Map,i=!1;for(let[a,c]of e.entries()){let l=new Set,u=t?.[a]===!0;for(let[d,f]of Object.entries(c??{})){let m=d.toUpperCase(),h=ktt(m);if(h&&f.trim()==="")continue;if(h&&i)continue;if(h&&a>r&&t?.[a]===!0)continue;let _=o.get(m);if(_!==void 0){if(l.has(m))s.set(d,f);else if(!s.has(d))s.set(d,_);continue}if(a>r&&n?.[a]?.has(m))continue;if(s.set(d,f),l.add(m),o.set(m,f),h)u=!0}if(u)i=!0}return Object.fromEntries(s)}var Ott="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function qte(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))if(n.toUpperCase()!==Ott)t[n]=r;return t}function Ptt(e,t){let n=Object.entries(e??{}),r=t??{};return n.length===Object.keys(r).length&&n.every(([o,s])=>r[o]===s)}function Itt(e){let t=IL(e);return t.settings?t.errors:[...t.errors,...(e.file?.()??PL(e)).errors]}function pne(e){let t=LL(e),n=(e.helperWarnings?.()??[]).filter((_)=>!wc(_.path));if(t.composes==="tier"){let{helper:_}=t;e.store.lastPolicyEnvComposition=null;let y=e.hostManagedProvider?{..._}:_;if(e.hostManagedProvider)HE(y);e.store.policy.pairedModelOverrides={value:e.hostManagedProvider&&_.availableModels!==void 0?_.modelOverrides:void 0};let b=e.store.policy.helperBaseStatusNotices??=[...e.helperMergesOutput?.()===!0?Itt(e).filter((v)=>!v.statusOnly):[],...kL(e).errors.filter((v)=>v.statusOnly)];return{settings:y,errors:[...b,...n]}}let{tiers:r,admin:o,parentSlice:s,hostModelOverlay:i,errors:a,present:c,snapshotFirst:l}=kL(e);if(a.push(...n),!o&&!s){e.store.lastPolicyEnvComposition=null,e.store.policy.pairedModelOverrides={value:void 0};let _=e.hkcu?.();if(_&&Object.keys(_.settings).length>0){let y=e.hostManagedProvider?{..._.settings}:_.settings;if(e.hostManagedProvider){if(HE(y),i)Object.assign(y,i)}return{settings:y,errors:[...a,..._.errors]}}if(i)return{settings:{...i},errors:[...a,..._?.errors??[]]};return{settings:null,errors:[...a,..._?.errors??[]]}}let u=Gn({},s??{},o??{},Lo);if(r.some((_)=>_.forceRemoteSettingsRefresh===!0))u.forceRemoteSettingsRefresh=!0;let d=_n.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0,f=u.env;if(!d){let _=Rtt(r.map((y)=>y.env),r.map((y)=>(y.otelHeadersHelper??"").trim()!==""),r.map((y)=>{let b=new Set;for(let v of une){let S=y[v];if(typeof S==="string"&&S.trim()!=="")for(let x of xQ[v])b.add(x)}return b.size>0?b:void 0}),l?1:0);if(Object.keys(_).length>0)u.env=_;else delete u.env}if(u.env){let _=qte(u.env);if(_&&Object.keys(_).length>0)u.env=_;else delete u.env}if(e.hostManagedProvider){if(HE(u),i)Object.assign(u,i)}let m={env:qte(f)};if(e.hostManagedProvider)HE(m);let h=!d&&!Ptt(u.env,m.env);return e.store.lastPolicyEnvComposition={unionOptedOut:d,unionChangedEnv:h,remoteTierPresent:c.remote,mdmTierPresent:c.mdm,fileTierPresent:c.file,adminTierCount:r.length,tiersWithEnv:df(r,(_)=>Object.keys(_.env??{}).length>0)},e.store.policy.pairedModelOverrides={value:e.hostManagedProvider&&o?.availableModels!==void 0&&o.modelOverrides!==void 0&&i?.availableModels===void 0?o.modelOverrides:void 0},{settings:u,errors:a}}function Dtt(e,t,{includeLegacyLocalSettings:n=!0}={}){if(e==="policySettings")return pne(t).settings;let r=Ih(e,t),{settings:o}=r?fd(r,t.store,e==="flagSettings"?t.flagExpectedContent:void 0):{settings:null};if(e==="flagSettings"){let{settings:s}=Xte(t);if(s)return Gn(o||{},s,Lo)}if(e==="localSettings"&&n){let s=tne(t);if(s){let{settings:i}=fd(s,t.store);if(i)return t.onLegacyLocalSettingsRead?.("per_source"),Gn(i,o||{},Lo)}}return o}function Ltt(e,t){return{...e,...t}}function Lo(e,t,n){if(n==="modelPicker"&&t!==void 0)return fne(t);if(Array.isArray(e)&&Array.isArray(t)){if(n==="fallbackModel")return t;return Tr([...e,...t])}if((n==="extraKnownMarketplaces"||n==="managedMcpServers")&&Ge(e)&&Ge(t))return Ltt(e,t);return}function fne(e){if(!Ge(e))return e;let t=e.options;return{...e,...Array.isArray(t)&&{options:t.map((n)=>Ge(n)?{...n}:n)}}}function Ntt(e){if(e.store.isLoadingFromDisk)return{settings:{},errors:[]};let t=Date.now();lh("info","settings_load_started"),e.store.isLoadingFromDisk=!0;try{let n=e.store.pluginBase,r={};if(n)r=Gn(r,n,Lo);let o=[],s=new Set,i=new Set,a=(l)=>{for(let u of l){let d=`${u.file}:${u.path}:${u.message}`;if(!s.has(d))s.add(d),o.push(u)}},c=null;for(let l of OL(e)){if(l==="policySettings"){let{settings:d,errors:f}=pne(e);if(c=d,d)r=Gn(r,d,Lo);a(f);continue}if(l==="localSettings"){let d=tne(e);if(d&&!i.has(eo(d))){i.add(eo(d));let{settings:f,errors:m}=fd(d,e.store);if(a(m),f)e.onLegacyLocalSettingsRead?.("cascade"),r=Gn(r,f,Lo)}}let u=Ih(l,e);if(u){let d=eo(u),f=l==="flagSettings"&&e.flagExpectedContent!==void 0;if(!i.has(d)||f){i.add(d);let{settings:m,errors:h}=fd(u,e.store,l==="flagSettings"?e.flagExpectedContent:void 0);if(a(h),m)r=Gn(r,m,Lo)}}if(l==="flagSettings"){let{settings:d,errors:f}=Xte(e);if(a(f),d)r=Gn(r,d,Lo)}}if(c){if(c.availableModels!==void 0)r.availableModels=[...c.availableModels];if(c.enforceAvailableModels!==void 0)r.enforceAvailableModels=c.enforceAvailableModels;if(c.modelPicker!==void 0)r.modelPicker=fne(c.modelPicker)}return lh("info","settings_load_completed",{duration_ms:Date.now()-t,source_count:i.size,error_count:o.length}),{settings:r,errors:o}}finally{e.store.isLoadingFromDisk=!1}}function Mtt(e){let t=e.store.mergedSettings;if(t!==null)return t;let n=Ntt(e);return e.store.mergedSettings=n,n}function Utt(e){let{settings:t}=Mtt(e);return t||{}}function mne(e){e.store.invalidateAll();let t=[];for(let n of OL(e)){let r=nne(n,e);if(r&&Object.keys(r).length>0)t.push({source:n,settings:r})}return{effective:Utt(e),sources:t}}function hne(e,t){let n=OL(t);for(let r=n.length-1;r>=0;r--){let o=n[r];if(nne(o,t)?.[e]!==void 0)return o}return null}import{execFile as Ftt}from"child_process";import{accessSync as $tt,closeSync as ztt,constants as jtt,openSync as Htt,readSync as Btt}from"fs";class Sne{promise=null;start(){if(this.promise)return;this.promise=ML()}reset(){this.promise=null}}var Ktt=new Sne;function Gtt(e){if(!e)return{status:"ok",exitCode:0,errno:null,signal:null};let t=e,n=typeof t.signal==="string"&&t.signal?t.signal:null;if(typeof t.code==="string")return{status:"spawn_error",exitCode:null,errno:t.code,signal:null};if(t.killed===!0)return{status:"timeout",exitCode:null,errno:null,signal:n};if(n)return{status:"killed",exitCode:null,errno:null,signal:n};return{status:"exited",exitCode:typeof t.code==="number"?t.code:null,errno:null,signal:null}}function NL(e,t,n){let r=Date.now();return new Promise((o)=>{try{Ftt(e,t,{encoding:"utf-8",timeout:Ite,windowsHide:!0,...n!==void 0&&{maxBuffer:n}},(s,i)=>{o({stdout:i??"",...Gtt(s),durationMs:Date.now()-r})})}catch(s){let i=s.code;o({stdout:"",status:"spawn_error",exitCode:null,errno:typeof i==="string"?i:null,signal:null,durationMs:Date.now()-r})}})}function gne(e){return{status:e.status,exitCode:e.exitCode,errno:e.errno,signal:e.signal,durationMs:e.durationMs}}function _ne(e){return e.status==="ok"||e.status==="exited"&&e.exitCode!==null}function Wtt(e){return e.status==="spawn_error"&&e.errno==="ERR_CHILD_PROCESS_STDIO_MAXBUFFER"}function Vtt(e){let t;try{return t=Htt(e,"r"),Btt(t,Buffer.alloc(1),0,1,0),null}catch(n){return{code:n&&typeof n==="object"&&"code"in n?n.code:void 0,message:n instanceof Error?n.message:String(n)}}finally{if(t!==void 0)try{ztt(t)}catch{}}}function ML(){return(async()=>{if(process.platform==="darwin"){let e=Lte(),n=(await Promise.all(e.map(async({path:o,...s})=>{try{$tt(o,jtt.R_OK)}catch(l){let u=l&&typeof l==="object"&&"code"in l?l.code:void 0;if(u==="ENOENT"||u==="ENOTDIR")return null;return{stdout:null,unreadReason:l instanceof Error?l.message:String(l),...s}}let i=await NL(vL,[...Ote,o],jE);if(!_ne(i))return{stdout:null,unreadReason:"plutil did not finish converting it",...s};if(i.status==="ok")return{stdout:i.stdout,...s};let a=await NL(vL,[...Pte,o]);if(!_ne(a))return{stdout:null,unreadReason:"plutil did not finish checking it",...s};if(a.status==="ok")return{stdout:null,unreadReason:"it holds a value plutil cannot convert to JSON (a date or data value)",...s};let c=Vtt(o);if(c!==null){if(c.code==="ENOENT"||c.code==="ENOTDIR")return null;return{stdout:null,unreadReason:c.message,...s}}return{stdout:"",...s}}))).filter((o)=>o!==null),r=n.findIndex((o)=>o.stdout!==null);return{plistStdouts:r===-1?n:n.slice(0,r+1),hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`;return yne(t)}if(kh())return yne(Dte);return{plistStdouts:null,hklmStdout:null,hkcuStdout:null,outcomes:{hklm:null,hkcu:null}}})()}async function yne(e){let t=(o)=>NL(e,["query",o,"/v",Ch],jE),[n,r]=await Promise.all([t($E),t(zE)]);return{plistStdouts:null,hklmStdout:n.status==="ok"?n.stdout:null,...Wtt(n)&&{hklmUnreadReason:`the value exceeds ${jE/1048576} MiB`},hkcuStdout:r.status==="ok"?r.stdout:null,outcomes:{hklm:gne(n),hkcu:gne(r)}}}function bne(){return Ktt.promise}var Yi=Object.freeze({settings:{},errors:[]});class Cne{mdm=null;hkcu=null;wslInherits=!1;loadPromise=null;startLoad(e){if(this.loadPromise)return;this.loadPromise=(async()=>{let t=Date.now(),r=await(bne()??ML()),{mdm:o,hkcu:s,wslInherits:i}=await nnt(r,e);this.replace(o,s,i);let a=Date.now()-t;ce(`MDM settings load completed in ${a}ms`);try{Ti("tengu_managed_settings_os_read",tnt(r,a))}catch{}if(Object.keys(o.settings).length>0){ce(`MDM settings found: ${Object.keys(o.settings).join(", ")}`);try{lh("info","mdm_settings_loaded",{duration_ms:a,key_count:Object.keys(o.settings).length,error_count:o.errors.length})}catch{}}})()}replace(e,t,n){this.mdm=e,this.hkcu=t,this.wslInherits=n}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.loadPromise=null}}var qtt=new Je(()=>new Cne);function Dh(){return qtt.of(Tn().host)}function Ztt(e){Dh().startLoad(e)}async function kne(){let e=Dh();if(!e.loadPromise)Ztt();await e.loadPromise}function Rne(){return Dh().mdm??Yi}function One(){return Dh().hkcu??Yi}function Pne(){return Dh().wslInherits}function UL(e,t,{userWritable:n=!1}={}){let r=mc(e,!1);if(!Ge(r))return{settings:{},errors:[GE(t,{userWritable:n})]};let o=[],s=r;if(n&&"managedMcpServers"in r){if(s={...r},delete s.managedMcpServers,!wc("managedMcpServers"))o.push({file:t,path:"managedMcpServers",message:`"managedMcpServers" is only honored from administrator-controlled managed settings and was ignored in ${t}, which the user account can write.`,severity:"warning",statusOnly:!0})}let{settings:i,errors:a}=BE(s,t),c=[...o,...a];return{settings:i??{},errors:n?c.map((l)=>l.severity==="warning"&&!l.startupFatal?l:{...Ytt(l),severity:"warning",statusOnly:!0}):c}}function Ytt({startupFatal:e,...t}){return t}function Ene(e,t,n){return{file:e,path:"",message:`Managed settings document (${e}) could not be read: ${t}; none of its settings are in effect.`,severity:n?"warning":"fatal",statusOnly:!0}}function xne(e,t="Settings"){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^[ \\t]+${n}[ \\t]+REG_(?:EXPAND_)?SZ[ \\t]+([\\s\\S]*)`,"im"),o=e.match(r)?.[1]?.trimEnd();return o?o:null}var Jtt=new Map([["ENOENT",Rn("ENOENT")],["EACCES",Rn("EACCES")],["EPERM",Rn("EPERM")],["ENOEXEC",Rn("ENOEXEC")],["EAGAIN",Rn("EAGAIN")],["EMFILE",Rn("EMFILE")],["ENOMEM",Rn("ENOMEM")],["ETIMEDOUT",Rn("ETIMEDOUT")],["ERR_CHILD_PROCESS_STDIO_MAXBUFFER",Rn("ERR_CHILD_PROCESS_STDIO_MAXBUFFER")]]),Xtt=new Map([["SIGTERM",Rn("SIGTERM")],["SIGKILL",Rn("SIGKILL")],["SIGINT",Rn("SIGINT")]]);function Qtt(e){if(!e)return;return Jtt.get(e)??Rn("other")}function ent(e){if(!e)return;return Xtt.get(e)??Rn("other")}function vne(e,t){if(!t)return{};return{[`${e}_status`]:fi(t.status),[`${e}_exit_code`]:t.exitCode??void 0,[`${e}_errno`]:Qtt(t.errno),[`${e}_signal`]:ent(t.signal),[`${e}_duration_ms`]:t.durationMs}}function tnt(e,t){return{is_wsl:kh(),await_ms:t,...vne("hklm",e.outcomes.hklm),...vne("hkcu",e.outcomes.hkcu)}}async function nnt(e,t){let n=[];for(let c of e.plistStdouts??[]){let{label:l,userWritable:u}=c;if(c.stdout===null){n.push(Ene(l,c.unreadReason,u));continue}let d=UL(c.stdout,l,{userWritable:u});if(Ac(d.settings))return{mdm:{settings:d.settings,errors:[...n,...d.errors],...u&&{userWritable:u}},hkcu:Yi,wslInherits:!1};n.push(...d.errors)}let r=`Registry: ${$E}\\${Ch}`,o=null;if(e.hklmStdout!==null)o=UL(xne(e.hklmStdout)??"",r);else if(e.hklmUnreadReason!==void 0)n.push(Ene(r,e.hklmUnreadReason,!1));if(o)n.push(...o.errors);let s=kh(),i=!1;if(s){if(i=o?.settings.wslInheritsWindowsSettings===!0,!i){let c=await ont(t);if(i=c.flag,!i)n.push(...c.records)}}let a=n.length>0?{settings:{},errors:n}:Yi;if(s&&!i)return{mdm:a,hkcu:Yi,wslInherits:!1};if(o){if(Ac(o.settings))return{mdm:o,hkcu:Yi,wslInherits:i}}if(await rnt(i,t))return{mdm:a,hkcu:Yi,wslInherits:i};if(e.hkcuStdout!==null){let c=UL(xne(e.hkcuStdout)??"",`Registry: ${zE}\\${Ch}`,{userWritable:!0});if(!s||c.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:l,managedSourcesBehavior:u,...d}=c.settings;return{mdm:a,hkcu:{settings:d,errors:c.errors},wslInherits:i}}if(c.errors.length>0)return{mdm:a,hkcu:{settings:{},errors:c.errors},wslInherits:i}}return{mdm:a,hkcu:Yi,wslInherits:i}}async function Ine(e,t){if(ye()&&t!==void 0)return(await GX(e,KE)).content;return fc(e,KE)}async function Dne(e,t){if(ye()&&t!==void 0)return await et().readdir(e);return et().readdirSync(e)}async function rnt(e,t){if(e&&await Tne(pd,t))return!0;return Tne(hc(),t)}async function wne(e,t){let n=uo(mc(await Ine(e,t),!1));if(!n||typeof n!=="object")return!1;return vc(n,e,{skipMcpServerEntryFilter:!0,policySource:!0}),Ac(n)}function Ane(e){let t=ke(e);return t==="ENOENT"||t==="ENOTDIR"}async function ont(e){let t=[];async function n(s){let i;try{i=await Ine(s,e)}catch(c){if(!Ane(c))t.push(Ph(s,c));return!1}if(i.trim()==="")return!1;let a=mc(i,!1);if(!Ge(a))return t.push(GE(s)),!1;return a.wslInheritsWindowsSettings===!0}if(await n(md(pd,"managed-settings.json")))return{flag:!0,records:t};let r=md(pd,"managed-settings.d"),o;try{o=await Dne(r,e)}catch(s){if(!Ane(s))t.push(Ph(r,s,"directory"));return{flag:!1,records:t}}for(let s of o)if((s.isFile()||s.isSymbolicLink())&&s.name.endsWith(".json")&&!s.name.startsWith(".")&&await n(md(r,s.name)))return{flag:!0,records:t};return{flag:!1,records:t}}async function Tne(e,t){try{if(await wne(md(e,"managed-settings.json"),t))return!0}catch{}try{let n=md(e,"managed-settings.d"),r=await Dne(n,t);for(let o of r){if(!(o.isFile()||o.isSymbolicLink())||!o.name.endsWith(".json")||o.name.startsWith("."))continue;try{if(await wne(md(n,o.name),t))return!0}catch{}}}catch{}return!1}var int={user:"userSettings",project:"projectSettings",local:"localSettings"},Lne={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},ant=["user","project","local"],cnt=new Set(["bypassPermissions","auto","acceptEdits"]),lnt=new Set(["project"]),unt=new Set(["project","local"]);function dnt(e){let t=e.effective.permissions?.defaultMode;if(!t||!cnt.has(t))return e.effective;for(let n=e.sources.length-1;n>=0;n--){let r=e.sources[n];if(r.settings.permissions?.defaultMode!==void 0){if((MX.includes(t)?unt:lnt).has(r.source)){let{defaultMode:s,...i}=e.effective.permissions??{};return{...e.effective,permissions:i}}return e.effective}}return e.effective}async function Nne(e={}){await kne();let t={store:new eg,cwd:snt(e.cwd??et().cwd()),allowedSources:(e.settingSources??ant).map((a)=>int[a]),parentManaged:e.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Rne,hkcu:One,wslInherits:Pne,...e.serverManagedSettings!==void 0&&{remote:()=>e.serverManagedSettings}},{effective:n,sources:r}=mne(t),o=one(t)??void 0,s=r.map(({source:a,settings:c})=>({source:Lne[a],settings:c,path:a==="policySettings"?void 0:Ih(a,t),...a==="policySettings"&&{policyOrigin:o}})),i={};for(let a of Object.keys(n)){let c=hne(a,t);if(c)i[a]={source:Lne[c],path:c==="policySettings"?void 0:Ih(c,t),...c==="policySettings"&&{policyOrigin:o}}}return{effective:n,provenance:i,sources:s}}process.env.NoDefaultCurrentDirectoryInExePath="1";async function lYt(e){return Nne(e)}var vnt=["enabledPlugins","extraKnownMarketplaces","additionalMarketplaces"];function Mne(e){let t;try{t=ft(vu(e.toString("utf8")))}catch{return e}if(!Une(t))return e;let n=!1;for(let o of vnt)if(Object.hasOwn(t,o))delete t[o],n=!0;let r=t.env;if(Une(r)&&Object.hasOwn(r,"CLAUDE_CONFIG_DIR"))delete r.CLAUDE_CONFIG_DIR,n=!0;return n?me(t):e}function Une(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}async function wnt(e,t){if(!e)return;let n=e;try{let r=ft(e);if(r?.claudeAiOauth?.refreshToken)delete r.claudeAiOauth.refreshToken,n=me(r)}catch{}await jne(t,n,{mode:384})}function Ant(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=NZ(LZ);return new Promise((t)=>{pnt("security",["find-generic-password","-a",MZ(),"-w","-s",e],{encoding:"utf-8",timeout:5000,windowsHide:!0},(n,r)=>t(n?void 0:r.trim()||void 0))})}async function Kne(e,t,n,r,o=60000,s){if(!Xe(t))return;let i=to(n,r),a=await Lr(e.load({projectKey:i,sessionId:t}),o,`SessionStore.load() timed out after ${o}ms for session ${t}`);if(!a||a.length===0)return;let c=vn(ynt(),`claude-resume-${HL()}`);try{let l=vn(c,"projects",i);await FL(l,{recursive:!0,mode:448});let u=vn(l,`${t}.jsonl`);await nm(u,a);let d=r?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,f=d??vn($L(),".claude"),m;try{m=await zne(vn(f,".credentials.json"),"utf-8")}catch(b){if(!rr(b))throw b}if(!d&&!(r??process.env).ANTHROPIC_API_KEY&&!(r??process.env).CLAUDE_CODE_OAUTH_TOKEN)m=await Ant()??m;await wnt(m,vn(c,".credentials.json"));let h=DZ(_n.CLAUDE_CONFIG_DIR),_=vn(d??$L(),".claude.json");await HS(_,vn(c,".claude.json"),void 0,KP(s,_,h.globalConfig,tn.globalConfig()));let y=vn(f,"settings.json");if(await HS(y,vn(c,"settings.json"),Mne,KP(s,y,h.userSettings,tn.userSettings())),await HS(vn(f,"cowork_settings.json"),vn(c,"cowork_settings.json"),Mne),e.listSubkeys)await Tnt(e,{projectKey:i,sessionId:t},vn(l,t),o);return c}catch(l){throw await WE(c),l}}async function Tnt(e,t,n,r){let o=await Lr(e.listSubkeys({projectKey:t.projectKey,sessionId:t.sessionId}),r,`SessionStore.listSubkeys() timed out after ${r}ms for session ${t.sessionId}`);for(let s of o){let i=Lh(n,s+".jsonl");if(!s||Hne(s)||s.split(/[\\/]/).includes("..")||!i.startsWith(n+BL)){ce(`[SessionStore] skipping unsafe subpath from listSubkeys: ${s}`,{level:"warn"});continue}let a=await Lr(e.load({projectKey:t.projectKey,sessionId:t.sessionId,subpath:s}),r,`SessionStore.load() timed out after ${r}ms for session ${t.sessionId} subpath ${s}`);if(!a||a.length===0)continue;let c=[],l=[];for(let u of a)if(jL(u))c.push(u);else l.push(u);if(l.length>0)await FL(zL(i),{recursive:!0}),await nm(i,l);if(c.length>0){let u=c.at(-1),d=Lh(n,s+".meta.json");await FL(zL(d),{recursive:!0});let{type:f,...m}=u;await jne(d,me(m),{mode:384})}}}function KL(e,t){let{isSingleUserTurn:n,resumeConfigDir:r,deferSpawn:o}=t,{systemPrompt:s,settings:i,managedSettings:a,settingSources:c,sandbox:l,...u}=e??{},d,f,m,h;if(s===void 0)d="";else if(typeof s==="string")d=s;else if(Array.isArray(s))d=s;else if(s.type==="custom")d=s.prompt,h=s.snapshot;else if(s.type==="preset")f=s.append,m=s.excludeDynamicSections,h=s.snapshot;process.env.CLAUDE_AGENT_SDK_VERSION="0.3.266";let{abortController:_=Td(),additionalDirectories:y=[],agent:b,agents:v,allowedTools:S=[],betas:x,canUseTool:w,continue:D,cwd:P,debug:F,debugFile:z,disallowedTools:q=[],tools:ee,env:te,executable:xe=el()?"bun":"node",executableArgs:Q=[],extraArgs:ut={},fallbackModel:De,enableFileCheckpointing:dt,toolConfig:W,forkSession:qe,hooks:wn,includeHookEvents:xt,includePartialMessages:ae,forwardSubagentText:re,onElicitation:$e,onUserDialog:nt,supportedDialogKinds:ie,perTaskStopAffordance:_t,workspaceTrust:rt,persistSession:ct,sessionStore:on,sessionStoreFlush:is,thinking:pt,effort:Nh,maxThinkingTokens:qE,maxTurns:Jne,maxBudgetUsd:Xne,taskBudget:Qne,mcpServers:WL,model:ere,outputFormat:VL,permissionMode:tre,allowDangerouslySkipPermissions:nre=!1,permissionPromptToolName:rre,permissionPrompts:ore,plugins:Mh,pluginDelivery:ZE="argv",getOAuthToken:qL,getHostAuthToken:ZL,workload:YL,resume:JL,resumeSessionAt:sre,resumeDropsTurn:ire,sessionId:are,skills:XL,stderr:cre,strictMcpConfig:lre}=u,QL=tre??(e?.resolvePermissionModeInCli?void 0:"default");if(on&&ct===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(ie!==void 0&&ie.length>0&&!nt)throw Error("supportedDialogKinds requires an onUserDialog callback -- declaring dialog kinds without a handler would park dialogs nothing can answer. Provide onUserDialog, or omit supportedDialogKinds.");let e0=rt?.accepted===!0&&(typeof rt.directory!=="string"||!(Snt.isAbsolute(rt.directory)||bnt.isAbsolute(rt.directory)))?void 0:rt;if(rt!==void 0&&e0===void 0)ce("workspaceTrust ignored: accepted requires an absolute directory, as it exists where Claude Code runs",{level:"warn"});if(on&&D&&!JL&&!on.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(on&&dt)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");if(on&&u.spawnClaudeCodeProcess)ce("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});if(FZ(!!w,QL??"default",S),ZE!=="argv"&&ZE!=="initialize")throw Error("Invalid pluginDelivery. Expected 'argv' or 'initialize'.");let t0=ZE==="initialize"&&Mh!==void 0&&Mh.length>0,YE=u.pathToClaudeCodeExecutable;if(!YE){let An=xnt(import.meta.url),no=_nt(An),Ji=ZK((Tc)=>no.resolve(Tc));if(!Ji)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);YE=Ji}let n0=VL?.type==="json_schema"?VL.schema:void 0,sn=te?{...te}:{...process.env};if(!sn.CLAUDE_CODE_ENTRYPOINT)sn.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!sn.CLAUDE_AGENT_SDK_VERSION)sn.CLAUDE_AGENT_SDK_VERSION="0.3.266";if(dt)sn.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(qL)sn.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1";if(ZL)sn.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1";if(W?.askUserQuestion?.previewFormat)sn.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=W.askUserQuestion.previewFormat;if(W?.askUserQuestion?.extendedQuestions)sn.CLAUDE_CODE_QUESTION_EXTENDED="1";else if(!te){for(let An of Object.keys(sn))if(An.toUpperCase()==="CLAUDE_CODE_QUESTION_EXTENDED")delete sn[An]}let JE={};if(VE.propagation.inject(VE.context.active(),JE),"traceparent"in JE){for(let An of["TRACEPARENT","TRACESTATE"])if(!(An in(te??{})))delete sn[An]}for(let[An,no]of Object.entries(JE)){let Ji=An.toUpperCase();if(!(Ji in(te??{})))sn[Ji]=no}let r0={},o0=new Map;if(WL)for(let[An,no]of Object.entries(WL))if(no.type==="sdk"&&no.instance)o0.set(An,no);else r0[An]=no;let hd;if(pt)switch(pt.type){case"adaptive":hd={type:"adaptive",display:pt.display};break;case"enabled":hd={type:"enabled",budgetTokens:pt.budgetTokens,display:pt.display};break;case"disabled":hd={type:"disabled"};break}else if(qE!==void 0)hd=qE===0?{type:"disabled"}:{type:"enabled",budgetTokens:qE};if(r){if(sn.CLAUDE_CONFIG_DIR=r,process.platform==="win32")sn.CLAUDE_SECURESTORAGE_CONFIG_DIR=te?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??te?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""}let s0=new nk({abortController:_,additionalDirectories:y,agent:b,betas:x,cwd:P,debug:F,debugFile:z,executable:xe,executableArgs:Q,extraArgs:YL?{...ut,workload:YL}:ut,pathToClaudeCodeExecutable:YE,env:sn,forkSession:qe,stderr:cre,thinkingConfig:hd,effort:Nh,maxTurns:Jne,maxBudgetUsd:Xne,taskBudget:Qne,model:ere,fallbackModel:De,jsonSchema:n0,permissionMode:QL,allowDangerouslySkipPermissions:nre,permissionPromptToolName:rre,permissionPrompts:ore,continueConversation:on?void 0:D,resume:JL,resumeSessionAt:sre,resumeDropsTurn:ire,sessionId:are,settings:typeof i==="object"?me(i):i,managedSettings:a?me(a):void 0,settingSources:c,skills:XL,allowedTools:S,disallowedTools:q,tools:ee,mcpServers:r0,strictMcpConfig:lre,canUseTool:!!w,hooks:!!wn,includeHookEvents:xt,includePartialMessages:ae,persistSession:ct,sessionMirror:!!on,plugins:Mh,pluginsViaInitialize:t0,sandbox:l,spawnClaudeCodeProcess:u.spawnClaudeCodeProcess,deferSpawn:o}),ure={systemPrompt:d,appendSystemPrompt:f,planModeInstructions:u.planModeInstructions,systemPromptSnapshot:h,appendSubagentSystemPrompt:u.appendSubagentSystemPrompt,toolAliases:u.toolAliases,excludeDynamicSections:m,agents:v,title:u.title,skills:XL,webSearchIsolationExemptMcpServers:u.webSearchIsolationExemptMcpServers,promptSuggestions:u.promptSuggestions,agentProgressSummaries:u.agentProgressSummaries,forwardSubagentText:re,supportedDialogKinds:ie,perTaskStopAffordance:_t,workspaceTrust:e0,plugins:t0?Mh:void 0},XE=new jy(s0,n,w,wn,_,o0,n0,ure,$e,qL,ZL,nt);if(on){let An=()=>vn(sn.CLAUDE_CONFIG_DIR??vn($L(),".claude"),"projects"),no=is==="eager",Ji=new ik(async(Tc,QE)=>{let gd=$ne(Tc,An());if(gd)await on.append(gd,QE);else ce(`[SessionStore] dropping mirror frame: filePath ${Tc} is not under ${An()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},{onError:(Tc,QE)=>{let gd=$ne(Tc,An());if(gd)XE.reportMirrorError(gd,QE.message)},maxPendingEntries:no?0:Hy,maxPendingBytes:no?0:_u});XE.setTranscriptMirrorBatcher(Ji)}return{queryInstance:XE,transport:s0,abortController:_,processEnv:sn}}function GL(e,t,n,r){if(typeof n==="string")t.write(me({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:n}]},parent_tool_use_id:null})+`
222
+ `);else e.streamInput(n).catch((o)=>r.abort(o))}var Cnt=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);async function WE(e){for(let t=0;;t++)try{return await gnt(e,{recursive:!0,force:!0})}catch(n){if(t>=4||!Cnt.has(ke(n)??""))return;await Dr((t+1)*100)}}function knt(e,t){e.waitForExit().catch(()=>{}).finally(()=>WE(t))}function uYt({prompt:e,options:t}){if((t?.resume||t?.continue)&&t?.sessionStore)return Rnt(e,t);let{queryInstance:n,transport:r,abortController:o}=KL(t,{isSingleUserTurn:typeof e==="string"});return GL(n,r,e,o),n}function Rnt(e,t){let{queryInstance:n,transport:r,abortController:o,processEnv:s}=KL({...t},{isSingleUserTurn:typeof e==="string",deferSpawn:!0}),i=Lh(t.cwd??"."),a=t.sessionStore,c=t.loadTimeoutMs??60000,l=t.resume;return(async()=>{if(!l)l=(await Lr(a.listSessions(to(i,t.env)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((f,m)=>m.mtime-f.mtime)[0]?.sessionId;if(!l)return;return Kne(a,l,i,t.env,t.loadTimeoutMs)})().then((d)=>{if(d){r.updateResume(l);let f={CLAUDE_CONFIG_DIR:d};if(process.platform==="win32"){let m=t.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??t.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";f.CLAUDE_SECURESTORAGE_CONFIG_DIR=m,s.CLAUDE_SECURESTORAGE_CONFIG_DIR=m}r.updateEnv(f),s.CLAUDE_CONFIG_DIR=d,n.addCleanupCallback(()=>knt(r,d))}if(!n.isClosed())r.spawn()}).catch((d)=>{let f=jr(d);r.spawnAbort(f),n.setError(f)}),GL(n,r,e,o),n}async function dYt({options:e,initializeTimeoutMs:t=60000}={}){let n,r=e?.resume;if((r||e?.continue)&&e?.sessionStore){let a=Lh(e.cwd??".");if(!r){if(!e.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let c=e.loadTimeoutMs??60000;r=(await Lr(e.sessionStore.listSessions(to(a,e.env)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((u,d)=>d.mtime-u.mtime)[0]?.sessionId}if(r)n=await Kne(e.sessionStore,r,a,e.env,e.loadTimeoutMs)}let o,s,i;try{let m=function(){if(f)return;f=!0,u.close()},a=KL(n&&r&&r!==e?.resume?{...e,resume:r}:e,{isSingleUserTurn:!1,resumeConfigDir:n});o=a.queryInstance;let{transport:c,abortController:l}=a;s=c;let u=a.queryInstance;if(n){let h=n;u.addCleanupCallback(()=>{i=c.waitForExit().catch(()=>{}).then(()=>WE(h))})}let d=`Subprocess initialization did not complete within ${t}ms — check authentication and network connectivity`;await Lr(u.initializationResult(),t,d).catch((h)=>{throw N$(h,d)?On(h,{telemetryMessage:`Subprocess initialization did not complete within ${t}ms`,errorClass:"initialize_timeout"}):h});let f=!1;return{query(h){if(f)throw Error("WarmQuery.query() can only be called once");f=!0;try{GL(u,c,h,l)}catch(_){throw u.close(),_}if(typeof h==="string")u.setIsSingleUserTurn(!0);return u},close:m,async[Symbol.asyncDispose](){f=!0,u.close(),await i}}}catch(a){if(o?.close(),n&&!i){let c=s;i=(c?c.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>WE(n))}throw await i,a}}async function pYt(e,t){if(t?.sessionStore)return Lnt(t.sessionStore,e,t);return i4(e,t)}async function fYt(e){if(e?.sessionStore)return Pnt(e.sessionStore,e);return rZ(e)}async function mYt(e,t){if(t?.sessionStore)return Nnt(t.sessionStore,e,t);return oZ(e,t)}async function hYt(e,t,n){if(n?.sessionStore)return Mnt(n.sessionStore,e,t,n.dir);return lZ(e,t,n)}async function gYt(e,t,n){if(n?.sessionStore)return Unt(n.sessionStore,e,t,n.dir);return uZ(e,t,n)}async function _Yt(e,t){if(!Xe(e))throw new Ze(`Invalid sessionId: ${e}`,"deleteSession: invalid sessionId (must be a UUID)");if(t?.sessionStore){if(!t.sessionStore.delete)return;let n=to(t.dir);await t.sessionStore.delete({projectKey:n,sessionId:e});return}return dZ(e,t)}async function yYt(e,t){if(t?.sessionStore)return Fnt(t.sessionStore,e,t);return hZ(e,t)}async function SYt(e,t,n,r){if(!Xe(e))throw new Ze(`Invalid sessionId: ${e}`,"importSessionToStore: invalid sessionId (must be a UUID)");let o=ye(),s=o?r:void 0,i=await Ci(e,n?.dir,cr(s),o);if(!i)throw Error(`Session ${e} not found`);let a=to(n?.dir),c=n?.batchSize&&n.batchSize>0?n.batchSize:Hy,l=s===void 0?void 0:Za(zL(i.filePath),pn),u=s!==void 0&&l!==void 0?{backend:s,projectKey:l}:void 0;if(u!==void 0)await HP(u.backend,tn.transcript(u.projectKey,e),{projectKey:a,sessionId:e},t,c);else await Fne(i.filePath,{projectKey:a,sessionId:e},t,c);if(n?.includeSubagents===!1)return;if(u!==void 0){let m=await kZ(u.backend,u.projectKey,e),h=await RZ(u.backend,u.projectKey,e,m);for(let _ of m){let y={projectKey:a,sessionId:e,subpath:jS(_)};await HP(u.backend,_.kind==="agent"?tn.transcript(u.projectKey,e,_.agentId,_.agentRelPath):tn.journal(u.projectKey,e,_.agentRelPath),y,t,c);let b=h.get(y.subpath),v;if(b!==void 0)try{v=ft(b)}catch(S){ce(`importSessionToStore: skipping unreadable sidecar for ${y.subpath}: ${S}`)}if(v!==void 0)await t.append(y,[{type:"agent_metadata",...v}])}return}let d=i.filePath.replace(/\.jsonl$/,""),f=vn(d,"subagents");for(let m of await Ont(f)){let h=Bne(d,m).split(BL);h[h.length-1]=h.at(-1).replace(/\.jsonl$/,"");let _={projectKey:a,sessionId:e,subpath:h.join("/")};await Fne(m,_,t,c);let y=m.replace(/\.jsonl$/,".meta.json"),b;try{b=ft(await zne(y,"utf8"))}catch(v){if(!rr(v))ce(`importSessionToStore: skipping unreadable sidecar ${y}: ${v}`)}if(b!==void 0)await t.append(_,[{type:"agent_metadata",...b}])}}async function Fne(e,t,n,r){let o=Ent({input:fnt(e,{encoding:"utf8"}),crlfDelay:1/0}),s=[],i=0;for await(let a of o){if(!a)continue;try{s.push(ft(a))}catch(c){ce(`importSessionToStore: skipping unparseable line in ${e}: ${c}`);continue}if(i+=a.length,s.length>=r||i>=_u)await n.append(t,s),s=[],i=0}if(s.length>0)await n.append(t,s)}async function Ont(e){let t=[];async function n(r){let o;try{o=await hnt(r,{withFileTypes:!0})}catch{return}for(let s of o){let i=vn(r,s.name);if(s.isDirectory())await n(i);else if(s.isFile()&&s.name.endsWith(".jsonl"))t.push(i)}}return await n(e),t}async function bYt(e,t){if(t?.sessionStore)return $nt(t.sessionStore,e,t.dir);return wZ(e,t)}async function EYt(e,t,n){if(n?.sessionStore)return znt(n.sessionStore,e,t,n);return AZ(e,t,n)}function Gne(e){let t=Lh(e??"."),n;try{n=mnt(t)}catch{n=t}return ot(n)}function to(e,t){let n=Gne(e);if(t===void 0)return Os(n);return(t.CLAUDE_CONFIG_DIR?kv(t.CLAUDE_CODE_PROJECT_DIR_NAME):void 0)??rm(n)}function Wne(e){return e.map((t)=>me(t)).join(`
223
+ `)+`
224
+ `}function Vne(e,t,n){if(t!==void 0&&t>0)return e.slice(n,n+t);if(n>0)return e.slice(n);return e}function jL(e){return typeof e==="object"&&e!==null&&"type"in e&&e.type==="agent_metadata"}async function Pnt(e,t){let n=Gne(t.dir),r=Os(n),o=t.offset??0,s=t.limit;if(e.listSessionSummaries)return Int(e,r,n,t.dir,s,o);if(!e.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let a=(await e.listSessions(r)).slice().sort((l,u)=>u.mtime-l.mtime),c=Vne(a,s,o);return qne(e,c,t.dir,n)}async function Int(e,t,n,r,o,s){let i=await e.listSessionSummaries(t),a=e.listSessions?new Map((await e.listSessions(t)).map((d)=>[d.sessionId,d])):void 0,c=[];for(let d of i){let f=a?.get(d.sessionId);if(a&&!f)continue;let m=f!==void 0&&d.mtime<f.mtime;c.push({sessionId:d.sessionId,mtime:m?f.mtime:d.mtime,info:m?void 0:bM(d,n)})}if(a){let d=new Set(i.map((f)=>f.sessionId));for(let[f,m]of a)if(!d.has(f))c.push({sessionId:f,mtime:m.mtime})}else ce("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");c.sort((d,f)=>f.mtime-d.mtime);let l=Vne(c,o,s),u=l.filter((d)=>d.info===void 0);if(u.length>0){let d=await qne(e,u,r,n),f=new Map(d.map((m)=>[m.sessionId,m]));for(let m of l)if(m.info===void 0)m.info=f.get(m.sessionId)??null}return l.flatMap((d)=>d.info?[d.info]:[])}async function qne(e,t,n,r){return(await Promise.allSettled(t.map(async(s)=>{let i=await Yne(e,s.sessionId,n);if(!i)return null;let a=Lu(s.sessionId,Zne(i,s.mtime),r);return a?{...a,lastModified:s.mtime}:null}))).flatMap((s,i)=>{let a=t[i];if(s.status==="fulfilled")return s.value?[s.value]:[];return[{sessionId:a.sessionId,summary:"",lastModified:a.mtime}]})}function Zne(e,t){let n=Buffer.from(e,"utf-8"),r=n.length,o=n.subarray(0,zn).toString("utf-8"),s=r>zn?n.subarray(r-zn).toString("utf-8"):o;return{mtime:t,size:r,head:o,tail:s}}function Dnt(e){let t=e.trimEnd(),n=t.slice(t.lastIndexOf(`
225
+ `)+1);try{let r=ft(n);if(typeof r==="object"&&r!==null&&"timestamp"in r&&typeof r.timestamp==="string"){let o=Date.parse(r.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function Yne(e,t,n){let r=to(n),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)return null;return Wne(o)}async function Lnt(e,t,n){if(!Xe(t))return[];let r=to(n.dir),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)return[];return o4(o,{limit:n.limit,offset:n.offset,includeSystemMessages:n.includeSystemMessages})}async function Nnt(e,t,n){if(!Xe(t))return;let r=await Yne(e,t,n.dir);if(!r)return;let o=Zne(r,Dnt(r));return Lu(t,o)??void 0}async function Mnt(e,t,n,r){if(!Xe(t))throw new Ze(`Invalid sessionId: ${t}`,"renameSession: invalid sessionId (must be a UUID)");if(!n.trim())throw Error("title must be non-empty");let o=to(r);await e.append({projectKey:o,sessionId:t},[{type:"custom-title",customTitle:n.trim(),sessionId:t,uuid:HL(),timestamp:new Date().toISOString()}])}async function Unt(e,t,n,r){if(!Xe(t))throw new Ze(`Invalid sessionId: ${t}`,"tagSession: invalid sessionId (must be a UUID)");if(n!==null){let s=Wa(n).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");n=s}let o=to(r);await e.append({projectKey:o,sessionId:t},[{type:"tag",tag:n??"",sessionId:t,uuid:HL(),timestamp:new Date().toISOString()}])}async function Fnt(e,t,n){if(!Xe(t))throw new Ze(`Invalid sessionId: ${t}`,"forkSession: invalid sessionId (must be a UUID)");if(n.upToMessageId&&!Xe(n.upToMessageId))throw new Ze(`Invalid upToMessageId: ${n.upToMessageId}`,"forkSession: invalid upToMessageId (must be a UUID)");let r=to(n.dir),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)throw Error(`Session ${t} not found`);let{entries:s,forkedSessionId:i}=gZ(o,t,n);return await e.append({projectKey:r,sessionId:i},s),{sessionId:i}}async function $nt(e,t,n){if(!Xe(t))return[];if(!e.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let r=to(n),o=await e.listSubkeys({projectKey:r,sessionId:t}),s=new Set;for(let i of o){if(!i.startsWith("subagents/"))continue;let a=i.split("/").at(-1);if(a.startsWith("agent-"))s.add(a.slice(6))}return[...s]}async function znt(e,t,n,r){if(!Xe(t))return[];if(!n)return[];let o=to(r.dir),s=`subagents/agent-${n}`;if(e.listSubkeys){let d=await e.listSubkeys({projectKey:o,sessionId:t}),f=`agent-${n}`,m=d.find((h)=>h.startsWith("subagents/")&&h.split("/").at(-1)===f);if(!m)return[];s=m}let i=await e.load({projectKey:o,sessionId:t,subpath:s});if(!i||i.length===0)return[];let a=i.findLast(jL),c=typeof a?.toolUseId==="string"?a.toolUseId:void 0,l=typeof a?.parentAgentId==="string"?a.parentAgentId:void 0,u=i.filter((d)=>!jL(d));if(u.length===0)return[];return jP(Buffer.from(Wne(u)),{limit:r.limit,offset:r.offset},c,l)}function $ne(e,t){let n=Bne(t,e),r=n.split(BL);if(r[0]===".."||Hne(n))return null;if(r.length<2)return null;let o=r[0],s=r[1];if(r.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(r.length>=4){let i=r.slice(2),a=i.length-1;return i[a]=i.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:i.join("/")}}return null}export{yr as AbortError,wv as CommandMatcher,Do as DirectConnectError,DX as DirectConnectTransport,oce as EXIT_REASONS,Tv as FileIndex,ps as HOOK_EVENTS,fv as InMemorySessionStore,qM as ORG_POLICY_LIMIT_PREFIXES,sce as SYSTEM_PROMPT_DYNAMIC_BOUNDARY,VM as USAGE_LIMIT_ERROR_PREFIXES,YM as USAGE_TRANSITION_PREFIXES,ZM as USAGE_WARNING_PREFIXES,WYe as createSdkMcpServer,_Yt as deleteSession,dnt as filterEscalatingDefaultMode,yg as foldSessionSummary,yYt as forkSession,mYt as getSessionInfo,pYt as getSessionMessages,EYt as getSubagentMessages,SYt as importSessionToStore,fYt as listSessions,bYt as listSubagents,ZYe as parseDirectConnectUrl,uYt as query,hYt as renameSession,lYt as resolveSettings,dYt as startup,gYt as tagSession,GYe as tool};