@bryanhu/codexly 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/README.md +87 -0
  4. package/README.zh-CN.md +87 -0
  5. package/dist/chunk-3OBVX5TN.js +15 -0
  6. package/dist/chunk-42AR5IS7.js +12543 -0
  7. package/dist/chunk-K63YBMTG.js +61287 -0
  8. package/dist/chunk-K6J42667.js +43 -0
  9. package/dist/chunk-MH54VCZJ.js +5224 -0
  10. package/dist/chunk-TEPSAXZZ.js +3360 -0
  11. package/dist/cli.js +889 -0
  12. package/dist/client/index.js +1010 -0
  13. package/dist/codex-jsonl-frame-worker.js +120 -0
  14. package/dist/core/index.js +5 -0
  15. package/dist/dist-NGSIFQU5.js +252 -0
  16. package/dist/protocol/index.js +5 -0
  17. package/dist/providers/codex/index.js +7 -0
  18. package/dist/server/index.js +9 -0
  19. package/dist/sqlite-state-worker.js +661 -0
  20. package/dist/web/.vite/manifest.json +829 -0
  21. package/dist/web/.vite/manifest.json.br +0 -0
  22. package/dist/web/.vite/manifest.json.gz +0 -0
  23. package/dist/web/assets/bash-BiGZg9Om.js +1 -0
  24. package/dist/web/assets/bash-BiGZg9Om.js.br +0 -0
  25. package/dist/web/assets/bash-BiGZg9Om.js.gz +0 -0
  26. package/dist/web/assets/bundle-mjs-rHxsej31.js +1 -0
  27. package/dist/web/assets/bundle-mjs-rHxsej31.js.br +0 -0
  28. package/dist/web/assets/bundle-mjs-rHxsej31.js.gz +0 -0
  29. package/dist/web/assets/button-CG0GNEOD.js +1 -0
  30. package/dist/web/assets/button-CG0GNEOD.js.br +0 -0
  31. package/dist/web/assets/button-CG0GNEOD.js.gz +0 -0
  32. package/dist/web/assets/button-group-D2LfHIjt.js +1 -0
  33. package/dist/web/assets/button-group-D2LfHIjt.js.br +0 -0
  34. package/dist/web/assets/button-group-D2LfHIjt.js.gz +0 -0
  35. package/dist/web/assets/c-DWGmR78Y.js +1 -0
  36. package/dist/web/assets/c-DWGmR78Y.js.br +1 -0
  37. package/dist/web/assets/c-DWGmR78Y.js.gz +0 -0
  38. package/dist/web/assets/c-SSSlmE39.js +1 -0
  39. package/dist/web/assets/c-SSSlmE39.js.br +0 -0
  40. package/dist/web/assets/c-SSSlmE39.js.gz +0 -0
  41. package/dist/web/assets/checkbox-Bvl7MRXT.js +1 -0
  42. package/dist/web/assets/checkbox-Bvl7MRXT.js.br +0 -0
  43. package/dist/web/assets/checkbox-Bvl7MRXT.js.gz +0 -0
  44. package/dist/web/assets/chunk-BO2N2NFS-C72FSBge.js +131 -0
  45. package/dist/web/assets/chunk-BO2N2NFS-C72FSBge.js.br +0 -0
  46. package/dist/web/assets/chunk-BO2N2NFS-C72FSBge.js.gz +0 -0
  47. package/dist/web/assets/code-highlighter-Cm0xdvAd.js +1 -0
  48. package/dist/web/assets/code-highlighter-Cm0xdvAd.js.br +0 -0
  49. package/dist/web/assets/code-highlighter-Cm0xdvAd.js.gz +0 -0
  50. package/dist/web/assets/code-languages-CfwYbccP.js +2 -0
  51. package/dist/web/assets/code-languages-CfwYbccP.js.br +0 -0
  52. package/dist/web/assets/code-languages-CfwYbccP.js.gz +0 -0
  53. package/dist/web/assets/cpp-BcHBJY00.js +1 -0
  54. package/dist/web/assets/cpp-BcHBJY00.js.br +0 -0
  55. package/dist/web/assets/cpp-BcHBJY00.js.gz +0 -0
  56. package/dist/web/assets/cpp-CIkEvbIe.js +1 -0
  57. package/dist/web/assets/cpp-CIkEvbIe.js.br +0 -0
  58. package/dist/web/assets/cpp-CIkEvbIe.js.gz +0 -0
  59. package/dist/web/assets/csharp-oqKa8noW.js +1 -0
  60. package/dist/web/assets/csharp-oqKa8noW.js.br +0 -0
  61. package/dist/web/assets/csharp-oqKa8noW.js.gz +0 -0
  62. package/dist/web/assets/css-CdtkT07m.js +1 -0
  63. package/dist/web/assets/css-CdtkT07m.js.br +1 -0
  64. package/dist/web/assets/css-CdtkT07m.js.gz +0 -0
  65. package/dist/web/assets/css-LbU1hoFO.js +1 -0
  66. package/dist/web/assets/css-LbU1hoFO.js.br +0 -0
  67. package/dist/web/assets/css-LbU1hoFO.js.gz +0 -0
  68. package/dist/web/assets/diff-woXpYk--.js +1 -0
  69. package/dist/web/assets/diff-woXpYk--.js.br +0 -0
  70. package/dist/web/assets/diff-woXpYk--.js.gz +0 -0
  71. package/dist/web/assets/dockerfile-IyjqRm3v.js +1 -0
  72. package/dist/web/assets/dockerfile-IyjqRm3v.js.br +0 -0
  73. package/dist/web/assets/dockerfile-IyjqRm3v.js.gz +0 -0
  74. package/dist/web/assets/dotenv-_5a1GRtc.js +1 -0
  75. package/dist/web/assets/dotenv-_5a1GRtc.js.br +0 -0
  76. package/dist/web/assets/dotenv-_5a1GRtc.js.gz +0 -0
  77. package/dist/web/assets/engine-compile-DQ0HPfe0.js +152 -0
  78. package/dist/web/assets/engine-compile-DQ0HPfe0.js.br +0 -0
  79. package/dist/web/assets/engine-compile-DQ0HPfe0.js.gz +0 -0
  80. package/dist/web/assets/es2015-CIXyxC_2.js +41 -0
  81. package/dist/web/assets/es2015-CIXyxC_2.js.br +0 -0
  82. package/dist/web/assets/es2015-CIXyxC_2.js.gz +0 -0
  83. package/dist/web/assets/file-CEs2ZXvf.js +1 -0
  84. package/dist/web/assets/file-CEs2ZXvf.js.br +0 -0
  85. package/dist/web/assets/file-CEs2ZXvf.js.gz +0 -0
  86. package/dist/web/assets/file-change-D7aZLgtG.js +4 -0
  87. package/dist/web/assets/file-change-D7aZLgtG.js.br +0 -0
  88. package/dist/web/assets/file-change-D7aZLgtG.js.gz +0 -0
  89. package/dist/web/assets/file-review-dialog-CTL5FpHU.js +2 -0
  90. package/dist/web/assets/file-review-dialog-CTL5FpHU.js.br +0 -0
  91. package/dist/web/assets/file-review-dialog-CTL5FpHU.js.gz +0 -0
  92. package/dist/web/assets/file-tree-DRpR7Mu2.js +1 -0
  93. package/dist/web/assets/file-tree-DRpR7Mu2.js.br +0 -0
  94. package/dist/web/assets/file-tree-DRpR7Mu2.js.gz +0 -0
  95. package/dist/web/assets/git-commit-horizontal-CQWH7rsr.js +1 -0
  96. package/dist/web/assets/git-commit-horizontal-CQWH7rsr.js.br +0 -0
  97. package/dist/web/assets/git-commit-horizontal-CQWH7rsr.js.gz +0 -0
  98. package/dist/web/assets/git-history-panel-BsIopLeA.js +2 -0
  99. package/dist/web/assets/git-history-panel-BsIopLeA.js.br +0 -0
  100. package/dist/web/assets/git-history-panel-BsIopLeA.js.gz +0 -0
  101. package/dist/web/assets/github-dark-C-LZuMrd.js +1 -0
  102. package/dist/web/assets/github-dark-C-LZuMrd.js.br +0 -0
  103. package/dist/web/assets/github-dark-C-LZuMrd.js.gz +0 -0
  104. package/dist/web/assets/github-light-EUqPIrTm.js +1 -0
  105. package/dist/web/assets/github-light-EUqPIrTm.js.br +0 -0
  106. package/dist/web/assets/github-light-EUqPIrTm.js.gz +0 -0
  107. package/dist/web/assets/global-settings-dialog-CJA_j2dA.js +1 -0
  108. package/dist/web/assets/global-settings-dialog-CJA_j2dA.js.br +0 -0
  109. package/dist/web/assets/global-settings-dialog-CJA_j2dA.js.gz +0 -0
  110. package/dist/web/assets/go-rLFTqkRN.js +1 -0
  111. package/dist/web/assets/go-rLFTqkRN.js.br +0 -0
  112. package/dist/web/assets/go-rLFTqkRN.js.gz +0 -0
  113. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js +1 -0
  114. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.br +0 -0
  115. package/dist/web/assets/grammar-cpp-support-CV8oNpIY.js.gz +0 -0
  116. package/dist/web/assets/graphql-D5qRqMLb.js +1 -0
  117. package/dist/web/assets/graphql-D5qRqMLb.js.br +0 -0
  118. package/dist/web/assets/graphql-D5qRqMLb.js.gz +0 -0
  119. package/dist/web/assets/graphql-f69H1Mm0.js +1 -0
  120. package/dist/web/assets/graphql-f69H1Mm0.js.br +0 -0
  121. package/dist/web/assets/graphql-f69H1Mm0.js.gz +0 -0
  122. package/dist/web/assets/highlighted-body-OFNGDK62-NQRGdW--.js +1 -0
  123. package/dist/web/assets/highlighted-body-OFNGDK62-NQRGdW--.js.br +0 -0
  124. package/dist/web/assets/highlighted-body-OFNGDK62-NQRGdW--.js.gz +0 -0
  125. package/dist/web/assets/html-BcACZWSP.js +1 -0
  126. package/dist/web/assets/html-BcACZWSP.js.br +0 -0
  127. package/dist/web/assets/html-BcACZWSP.js.gz +0 -0
  128. package/dist/web/assets/html-DDNsd9lV.js +1 -0
  129. package/dist/web/assets/html-DDNsd9lV.js.br +0 -0
  130. package/dist/web/assets/html-DDNsd9lV.js.gz +0 -0
  131. package/dist/web/assets/index-B3NtDmQp.css +2 -0
  132. package/dist/web/assets/index-B3NtDmQp.css.br +0 -0
  133. package/dist/web/assets/index-B3NtDmQp.css.gz +0 -0
  134. package/dist/web/assets/index-C_O4z_mI.js +4 -0
  135. package/dist/web/assets/index-C_O4z_mI.js.br +0 -0
  136. package/dist/web/assets/index-C_O4z_mI.js.gz +0 -0
  137. package/dist/web/assets/ini-B5eOa1yu.js +1 -0
  138. package/dist/web/assets/ini-B5eOa1yu.js.br +5 -0
  139. package/dist/web/assets/ini-B5eOa1yu.js.gz +0 -0
  140. package/dist/web/assets/java-BtIQNnN0.js +1 -0
  141. package/dist/web/assets/java-BtIQNnN0.js.br +0 -0
  142. package/dist/web/assets/java-BtIQNnN0.js.gz +0 -0
  143. package/dist/web/assets/java-DxlWrXwe.js +1 -0
  144. package/dist/web/assets/java-DxlWrXwe.js.br +1 -0
  145. package/dist/web/assets/java-DxlWrXwe.js.gz +0 -0
  146. package/dist/web/assets/javascript-BzbQS41l.js +1 -0
  147. package/dist/web/assets/javascript-BzbQS41l.js.br +0 -0
  148. package/dist/web/assets/javascript-BzbQS41l.js.gz +0 -0
  149. package/dist/web/assets/javascript-Yelw-5ZN.js +1 -0
  150. package/dist/web/assets/javascript-Yelw-5ZN.js.br +0 -0
  151. package/dist/web/assets/javascript-Yelw-5ZN.js.gz +0 -0
  152. package/dist/web/assets/json-B88Oqtu5.js +1 -0
  153. package/dist/web/assets/json-B88Oqtu5.js.br +0 -0
  154. package/dist/web/assets/json-B88Oqtu5.js.gz +0 -0
  155. package/dist/web/assets/json-CaljABEy.js +1 -0
  156. package/dist/web/assets/json-CaljABEy.js.br +1 -0
  157. package/dist/web/assets/json-CaljABEy.js.gz +0 -0
  158. package/dist/web/assets/json5-BR5RXkoi.js +1 -0
  159. package/dist/web/assets/json5-BR5RXkoi.js.br +0 -0
  160. package/dist/web/assets/json5-BR5RXkoi.js.gz +0 -0
  161. package/dist/web/assets/jsonc-CYpm1nAK.js +1 -0
  162. package/dist/web/assets/jsonc-CYpm1nAK.js.br +0 -0
  163. package/dist/web/assets/jsonc-CYpm1nAK.js.gz +0 -0
  164. package/dist/web/assets/jsx-D3KKoC5L.js +1 -0
  165. package/dist/web/assets/jsx-D3KKoC5L.js.br +0 -0
  166. package/dist/web/assets/jsx-D3KKoC5L.js.gz +0 -0
  167. package/dist/web/assets/jsx-hEbJ82HF.js +1 -0
  168. package/dist/web/assets/jsx-hEbJ82HF.js.br +1 -0
  169. package/dist/web/assets/jsx-hEbJ82HF.js.gz +0 -0
  170. package/dist/web/assets/kotlin-DhhofPvG.js +1 -0
  171. package/dist/web/assets/kotlin-DhhofPvG.js.br +0 -0
  172. package/dist/web/assets/kotlin-DhhofPvG.js.gz +0 -0
  173. package/dist/web/assets/lazy-message-response-Cy_8wxLM.js +2 -0
  174. package/dist/web/assets/lazy-message-response-Cy_8wxLM.js.br +0 -0
  175. package/dist/web/assets/lazy-message-response-Cy_8wxLM.js.gz +0 -0
  176. package/dist/web/assets/lib-DrPFkMXk.js +1 -0
  177. package/dist/web/assets/lib-DrPFkMXk.js.br +0 -0
  178. package/dist/web/assets/lib-DrPFkMXk.js.gz +0 -0
  179. package/dist/web/assets/lua-BJObVtAx.js +1 -0
  180. package/dist/web/assets/lua-BJObVtAx.js.br +0 -0
  181. package/dist/web/assets/lua-BJObVtAx.js.gz +0 -0
  182. package/dist/web/assets/lua-DjuecEsk.js +1 -0
  183. package/dist/web/assets/lua-DjuecEsk.js.br +0 -0
  184. package/dist/web/assets/lua-DjuecEsk.js.gz +0 -0
  185. package/dist/web/assets/makefile-Dixweg8N.js +1 -0
  186. package/dist/web/assets/makefile-Dixweg8N.js.br +0 -0
  187. package/dist/web/assets/makefile-Dixweg8N.js.gz +0 -0
  188. package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
  189. package/dist/web/assets/markdown-BYOwaDjH.js.br +0 -0
  190. package/dist/web/assets/markdown-BYOwaDjH.js.gz +0 -0
  191. package/dist/web/assets/mdx-DQZ5AkYe.js +1 -0
  192. package/dist/web/assets/mdx-DQZ5AkYe.js.br +0 -0
  193. package/dist/web/assets/mdx-DQZ5AkYe.js.gz +0 -0
  194. package/dist/web/assets/mermaid-GHXKKRXX-D0CV54MY.js +1 -0
  195. package/dist/web/assets/mermaid-GHXKKRXX-D0CV54MY.js.br +0 -0
  196. package/dist/web/assets/mermaid-GHXKKRXX-D0CV54MY.js.gz +0 -0
  197. package/dist/web/assets/message-response-CBOOkYPm.js +7 -0
  198. package/dist/web/assets/message-response-CBOOkYPm.js.br +0 -0
  199. package/dist/web/assets/message-response-CBOOkYPm.js.gz +0 -0
  200. package/dist/web/assets/patch-diff-viewer-BHcdOhhw.js +1409 -0
  201. package/dist/web/assets/patch-diff-viewer-BHcdOhhw.js.br +0 -0
  202. package/dist/web/assets/patch-diff-viewer-BHcdOhhw.js.gz +0 -0
  203. package/dist/web/assets/perl-Br95gH8g.js +1 -0
  204. package/dist/web/assets/perl-Br95gH8g.js.br +0 -0
  205. package/dist/web/assets/perl-Br95gH8g.js.gz +0 -0
  206. package/dist/web/assets/php-CYrBA5iX.js +1 -0
  207. package/dist/web/assets/php-CYrBA5iX.js.br +0 -0
  208. package/dist/web/assets/php-CYrBA5iX.js.gz +0 -0
  209. package/dist/web/assets/prompt-input-controls-CrypM5HZ.js +1 -0
  210. package/dist/web/assets/prompt-input-controls-CrypM5HZ.js.br +0 -0
  211. package/dist/web/assets/prompt-input-controls-CrypM5HZ.js.gz +0 -0
  212. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js +1 -0
  213. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.br +0 -0
  214. package/dist/web/assets/prompt-reference-token-Cxx6C-IR.js.gz +0 -0
  215. package/dist/web/assets/provider-connection-queries-C40YvSEy.js +1 -0
  216. package/dist/web/assets/provider-connection-queries-C40YvSEy.js.br +0 -0
  217. package/dist/web/assets/provider-connection-queries-C40YvSEy.js.gz +0 -0
  218. package/dist/web/assets/python-gzcpVVnB.js +1 -0
  219. package/dist/web/assets/python-gzcpVVnB.js.br +0 -0
  220. package/dist/web/assets/python-gzcpVVnB.js.gz +0 -0
  221. package/dist/web/assets/react-runtime-CVaUQXZF.js +9 -0
  222. package/dist/web/assets/react-runtime-CVaUQXZF.js.br +0 -0
  223. package/dist/web/assets/react-runtime-CVaUQXZF.js.gz +0 -0
  224. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  225. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js.br +0 -0
  226. package/dist/web/assets/rolldown-runtime-QTnfLwEv.js.gz +0 -0
  227. package/dist/web/assets/ruby-CbXu8Ywv.js +1 -0
  228. package/dist/web/assets/ruby-CbXu8Ywv.js.br +0 -0
  229. package/dist/web/assets/ruby-CbXu8Ywv.js.gz +0 -0
  230. package/dist/web/assets/rust-Cfkwpbl8.js +1 -0
  231. package/dist/web/assets/rust-Cfkwpbl8.js.br +0 -0
  232. package/dist/web/assets/rust-Cfkwpbl8.js.gz +0 -0
  233. package/dist/web/assets/scss-DHtrkMkT.js +1 -0
  234. package/dist/web/assets/scss-DHtrkMkT.js.br +0 -0
  235. package/dist/web/assets/scss-DHtrkMkT.js.gz +0 -0
  236. package/dist/web/assets/shellscript-BiGZg9Om.js +1 -0
  237. package/dist/web/assets/shellscript-BiGZg9Om.js.br +0 -0
  238. package/dist/web/assets/shellscript-BiGZg9Om.js.gz +0 -0
  239. package/dist/web/assets/shellscript-CqHdAlCp.js +1 -0
  240. package/dist/web/assets/shellscript-CqHdAlCp.js.br +0 -0
  241. package/dist/web/assets/shellscript-CqHdAlCp.js.gz +0 -0
  242. package/dist/web/assets/shiki-bundle-DzEBOJSk.js +1 -0
  243. package/dist/web/assets/shiki-bundle-DzEBOJSk.js.br +0 -0
  244. package/dist/web/assets/shiki-bundle-DzEBOJSk.js.gz +0 -0
  245. package/dist/web/assets/sql-0Qcw9ht3.js +1 -0
  246. package/dist/web/assets/sql-0Qcw9ht3.js.br +0 -0
  247. package/dist/web/assets/sql-0Qcw9ht3.js.gz +0 -0
  248. package/dist/web/assets/sql-CP0rg-5b.js +1 -0
  249. package/dist/web/assets/sql-CP0rg-5b.js.br +0 -0
  250. package/dist/web/assets/sql-CP0rg-5b.js.gz +0 -0
  251. package/dist/web/assets/svelte-BUVJxsYv.js +1 -0
  252. package/dist/web/assets/svelte-BUVJxsYv.js.br +0 -0
  253. package/dist/web/assets/svelte-BUVJxsYv.js.gz +0 -0
  254. package/dist/web/assets/swift-DonLKvLd.js +1 -0
  255. package/dist/web/assets/swift-DonLKvLd.js.br +0 -0
  256. package/dist/web/assets/swift-DonLKvLd.js.gz +0 -0
  257. package/dist/web/assets/toml-CcmNWLt0.js +1 -0
  258. package/dist/web/assets/toml-CcmNWLt0.js.br +0 -0
  259. package/dist/web/assets/toml-CcmNWLt0.js.gz +0 -0
  260. package/dist/web/assets/tsx-5f3ulCja.js +1 -0
  261. package/dist/web/assets/tsx-5f3ulCja.js.br +0 -0
  262. package/dist/web/assets/tsx-5f3ulCja.js.gz +0 -0
  263. package/dist/web/assets/tsx-BOvsFOI6.js +1 -0
  264. package/dist/web/assets/tsx-BOvsFOI6.js.br +0 -0
  265. package/dist/web/assets/tsx-BOvsFOI6.js.gz +0 -0
  266. package/dist/web/assets/typescript-Utq2Cl8c.js +1 -0
  267. package/dist/web/assets/typescript-Utq2Cl8c.js.br +0 -0
  268. package/dist/web/assets/typescript-Utq2Cl8c.js.gz +0 -0
  269. package/dist/web/assets/typescript-j_1H8WHN.js +1 -0
  270. package/dist/web/assets/typescript-j_1H8WHN.js.br +0 -0
  271. package/dist/web/assets/typescript-j_1H8WHN.js.gz +0 -0
  272. package/dist/web/assets/vue-BpAUjojh.js +1 -0
  273. package/dist/web/assets/vue-BpAUjojh.js.br +0 -0
  274. package/dist/web/assets/vue-BpAUjojh.js.gz +0 -0
  275. package/dist/web/assets/workbench-inspector-changes-RHaBVG45.js +1 -0
  276. package/dist/web/assets/workbench-inspector-changes-RHaBVG45.js.br +0 -0
  277. package/dist/web/assets/workbench-inspector-changes-RHaBVG45.js.gz +0 -0
  278. package/dist/web/assets/workbench-shell--6Y1cx2L.js +12 -0
  279. package/dist/web/assets/workbench-shell--6Y1cx2L.js.br +0 -0
  280. package/dist/web/assets/workbench-shell--6Y1cx2L.js.gz +0 -0
  281. package/dist/web/assets/xml-CoDIzWF0.js +1 -0
  282. package/dist/web/assets/xml-CoDIzWF0.js.br +0 -0
  283. package/dist/web/assets/xml-CoDIzWF0.js.gz +0 -0
  284. package/dist/web/assets/xml-WY0zc4PG.js +1 -0
  285. package/dist/web/assets/xml-WY0zc4PG.js.br +0 -0
  286. package/dist/web/assets/xml-WY0zc4PG.js.gz +0 -0
  287. package/dist/web/assets/yaml-CxbubiML.js +1 -0
  288. package/dist/web/assets/yaml-CxbubiML.js.br +0 -0
  289. package/dist/web/assets/yaml-CxbubiML.js.gz +0 -0
  290. package/dist/web/assets/yaml-DijMHRDA.js +1 -0
  291. package/dist/web/assets/yaml-DijMHRDA.js.br +0 -0
  292. package/dist/web/assets/yaml-DijMHRDA.js.gz +0 -0
  293. package/dist/web/brand/codexly-logo.svg +34 -0
  294. package/dist/web/brand/codexly-logo.svg.br +0 -0
  295. package/dist/web/brand/codexly-logo.svg.gz +0 -0
  296. package/dist/web/brand/codexly-mark.svg +21 -0
  297. package/dist/web/brand/codexly-mark.svg.br +0 -0
  298. package/dist/web/brand/codexly-mark.svg.gz +0 -0
  299. package/dist/web/favicon.svg +20 -0
  300. package/dist/web/favicon.svg.br +0 -0
  301. package/dist/web/favicon.svg.gz +0 -0
  302. package/dist/web/index.html +25 -0
  303. package/dist/web/index.html.br +0 -0
  304. package/dist/web/index.html.gz +0 -0
  305. package/package.json +85 -0
@@ -0,0 +1,41 @@
1
+ import{n as e,r as t}from"./rolldown-runtime-QTnfLwEv.js";import{i as n,r,t as i}from"./react-runtime-CVaUQXZF.js";import{a,i as o,n as s,r as c,s as l}from"./button-CG0GNEOD.js";var u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},d=new class extends u{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},f={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},p=new class{#e=f;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function m(e){setTimeout(e,0)}var h=typeof window>`u`||`Deno`in globalThis;function g(){}function _(e,t){return typeof e==`function`?e(t):e}function v(e){return typeof e==`number`&&e>=0&&e!==1/0}function y(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){return typeof e==`function`?e(t):e}function S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function C(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!te(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function re(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ie(e)&&ie(t);if(!r&&!(ae(e)&&ae(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=re(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function T(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ae(e){if(!oe(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!oe(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function oe(e){return Object.prototype.toString.call(e)===`[object Object]`}function se(e){return new Promise(t=>{p.setTimeout(t,e)})}function ce(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:re(e,t)}function le(e){return e}function ue(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function de(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fe=Symbol();function pe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===fe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function me(e,t){return typeof e==`function`?e(...t):!!e}function he(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ge=(()=>{let e=()=>h;return{isServer(){return e()},setIsServer(t){e=t}}})();function _e(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ve=m;function ye(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ve,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var be=ye(),xe=new class extends u{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Se(e){return Math.min(1e3*2**e,3e4)}function Ce(e){return(e??`online`)!==`online`||xe.isOnline()}var we=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Te(e){let t=!1,n=0,r,i=_e(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new we(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>d.isFocused()&&(e.networkMode===`always`||xe.isOnline())&&e.canRun(),u=()=>Ce(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(ge.isServer()?0:3),o=e.retryDelay??Se,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),se(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?h():m().then(h),i)}}var Ee=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v(this.gcTime)&&(this.#e=p.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ge.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(p.clearTimeout(this.#e),this.#e=void 0)}};function De(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{he(e,()=>t.signal,()=>n=!0)},u=pe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?de:ue;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ke:Oe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Oe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Oe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ke(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ae(e,t){return t?Oe(e,t)!=null:!1}function je(e,t){return!t||!e.getPreviousPageParam?!1:ke(e,t)!=null}var Me=class extends Ee{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fe(this.options);e.data!==void 0&&(this.setState(Pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ce(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(g).catch(g):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>x(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>b(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!y(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=pe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?De(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Te({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof we&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof we){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ne(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),be.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ne(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ce(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ie=class extends u{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=_e(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Re(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ze(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ze(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof x(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!T(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Be(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||b(this.options.staleTime,this.#t)!==b(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||x(this.options.enabled,this.#t)!==x(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(g)),t}#g(){this.#b();let e=b(this.options.staleTime,this.#t);if(ge.isServer()||this.#r.isStale||!v(e))return;let t=y(this.#r.dataUpdatedAt,e)+1;this.#d=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(ge.isServer()||x(this.options.enabled,this.#t)===!1||!v(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(p.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(p.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Re(e,t),o=i&&Be(e,n,t,r);(a||o)&&(l={...l,...Ne(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ce(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ce(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ve(e,t),refetch:this.refetch,promise:this.#o,isEnabled:x(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=_e();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!T(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){be.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Le(e,t){return x(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&x(t.retryOnMount,e)===!1)}function Re(e,t){return Le(e,t)||e.state.data!==void 0&&ze(e,t,t.refetchOnMount)}function ze(e,t,n){if(x(t.enabled,e)!==!1&&b(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ve(e,t)}return!1}function Be(e,t,n,r){return(e!==t||x(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ve(e,n)}function Ve(e,t){return x(t.enabled,e)!==!1&&e.isStaleByTime(b(t.staleTime,e))}function He(e,t){return!T(e.getCurrentResult(),t)}var E=t(n(),1),D=i(),Ue=E.createContext(void 0),We=e=>{let t=E.useContext(Ue);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ge=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,D.jsx)(Ue.Provider,{value:e,children:t})),Ke=E.createContext(!1),qe=()=>E.useContext(Ke);Ke.Provider;function Je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ye=E.createContext(Je()),Xe=()=>E.useContext(Ye),Ze=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?me(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Qe=e=>{E.useEffect(()=>{e.clearReset()},[e])},$e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||me(n,[e.error,r])),et=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},tt=(e,t)=>e.isLoading&&e.isFetching&&!t,nt=(e,t)=>e?.suspense&&t.isPending,rt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function it(e,t,n){let r=qe(),i=Xe(),a=We(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,et(o),Ze(o,i,s),Qe(i);let l=!a.getQueryCache().get(o.queryHash),[u]=E.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=f?u.subscribe(be.batchCalls(e)):g;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),E.useEffect(()=>{u.setOptions(o)},[o,u]),nt(o,d))throw rt(o,u,i);if($e({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!ge.isServer()&&tt(d,r)&&(l?rt(o,u,i):s?.promise)?.catch(g).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function at(e,t){return it(e,Ie,t)}function ot(e){return e}function st(e){return e}function ct(e){return O(e)&&!lt(e)&&!yt(e)&&Symbol.asyncIterator in e}function lt(e){return Array.isArray(e)}function ut(e){return typeof e==`bigint`}function dt(e){return typeof e==`boolean`}function ft(e){return e instanceof globalThis.Date}function pt(e){return typeof e==`function`}function mt(e){return O(e)&&!lt(e)&&!yt(e)&&Symbol.iterator in e}function ht(e){return e===null}function gt(e){return typeof e==`number`}function O(e){return typeof e==`object`&&!!e}function _t(e){return e instanceof globalThis.RegExp}function k(e){return typeof e==`string`}function vt(e){return typeof e==`symbol`}function yt(e){return e instanceof globalThis.Uint8Array}function A(e){return e===void 0}function bt(e){return e.map(e=>Tt(e))}function xt(e){return new Date(e.getTime())}function St(e){return new Uint8Array(e)}function Ct(e){return new RegExp(e.source,e.flags)}function wt(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Tt(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Tt(e[n]);return t}function Tt(e){return lt(e)?bt(e):ft(e)?xt(e):yt(e)?St(e):_t(e)?Ct(e):O(e)?wt(e):e}function Et(e){return Tt(e)}function Dt(e,t){return Et(t===void 0?e:{...t,...e})}function Ot(e){return Nt(e)&&globalThis.Symbol.asyncIterator in e}function kt(e){return Nt(e)&&globalThis.Symbol.iterator in e}function At(e){return e instanceof globalThis.Promise}function jt(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function Mt(e){return e instanceof globalThis.Uint8Array}function Nt(e){return typeof e==`object`&&!!e}function Pt(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function Ft(e){return e===void 0}function It(e){return e===null}function Lt(e){return typeof e==`boolean`}function Rt(e){return typeof e==`number`}function zt(e){return globalThis.Number.isInteger(e)}function Bt(e){return typeof e==`bigint`}function Vt(e){return typeof e==`string`}function Ht(e){return typeof e==`function`}function Ut(e){return typeof e==`symbol`}var Wt;(function(e){e.InstanceMode=`default`,e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(t,n){return e.ExactOptionalPropertyTypes?n in t:t[n]!==void 0}e.IsExactOptionalProperty=t;function n(t){let n=Nt(t);return e.AllowArrayObject?n:n&&!Pt(t)}e.IsObjectLike=n;function r(e){return n(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)}e.IsRecordLike=r;function i(t){return e.AllowNaN?Rt(t):Number.isFinite(t)}e.IsNumberLike=i;function a(t){let n=Ft(t);return e.AllowNullVoid?n||t===null:n}e.IsVoidLike=a})(Wt||={});function Gt(e){return globalThis.Object.freeze(e).map(e=>Xt(e))}function Kt(e){return e}function qt(e){return e}function Jt(e){return e}function Yt(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Xt(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Xt(e[n]);return globalThis.Object.freeze(t)}function Xt(e){return lt(e)?Gt(e):ft(e)?Kt(e):yt(e)?qt(e):_t(e)?Jt(e):O(e)?Yt(e):e}function j(e,t){let n=t===void 0?e:{...t,...e};switch(Wt.InstanceMode){case`freeze`:return Xt(n);case`clone`:return Et(n);default:return n}}var Zt=class extends Error{constructor(e){super(e)}},Qt=Symbol.for(`TypeBox.Transform`),$t=Symbol.for(`TypeBox.Readonly`),en=Symbol.for(`TypeBox.Optional`),tn=Symbol.for(`TypeBox.Hint`),M=Symbol.for(`TypeBox.Kind`);function nn(e){return O(e)&&e[$t]===`Readonly`}function rn(e){return O(e)&&e[en]===`Optional`}function an(e){return N(e,`Any`)}function on(e){return N(e,`Argument`)}function sn(e){return N(e,`Array`)}function cn(e){return N(e,`AsyncIterator`)}function ln(e){return N(e,`BigInt`)}function un(e){return N(e,`Boolean`)}function dn(e){return N(e,`Computed`)}function fn(e){return N(e,`Constructor`)}function pn(e){return N(e,`Date`)}function mn(e){return N(e,`Function`)}function hn(e){return N(e,`Integer`)}function gn(e){return N(e,`Intersect`)}function _n(e){return N(e,`Iterator`)}function N(e,t){return O(e)&&M in e&&e[M]===t}function vn(e){return dt(e)||gt(e)||k(e)}function yn(e){return N(e,`Literal`)}function bn(e){return N(e,`MappedKey`)}function xn(e){return N(e,`MappedResult`)}function Sn(e){return N(e,`Never`)}function Cn(e){return N(e,`Not`)}function wn(e){return N(e,`Null`)}function Tn(e){return N(e,`Number`)}function En(e){return N(e,`Object`)}function Dn(e){return N(e,`Promise`)}function On(e){return N(e,`Record`)}function kn(e){return N(e,`Ref`)}function An(e){return N(e,`RegExp`)}function jn(e){return N(e,`String`)}function Mn(e){return N(e,`Symbol`)}function Nn(e){return N(e,`TemplateLiteral`)}function Pn(e){return N(e,`This`)}function Fn(e){return O(e)&&Qt in e}function In(e){return N(e,`Tuple`)}function Ln(e){return N(e,`Undefined`)}function P(e){return N(e,`Union`)}function Rn(e){return N(e,`Uint8Array`)}function zn(e){return N(e,`Unknown`)}function Bn(e){return N(e,`Unsafe`)}function Vn(e){return N(e,`Void`)}function Hn(e){return O(e)&&M in e&&k(e[M])}function Un(e){return an(e)||on(e)||sn(e)||un(e)||ln(e)||cn(e)||dn(e)||fn(e)||pn(e)||mn(e)||hn(e)||gn(e)||_n(e)||yn(e)||bn(e)||xn(e)||Sn(e)||Cn(e)||wn(e)||Tn(e)||En(e)||Dn(e)||On(e)||kn(e)||An(e)||jn(e)||Mn(e)||Nn(e)||Pn(e)||In(e)||Ln(e)||P(e)||Rn(e)||zn(e)||Bn(e)||Vn(e)||Hn(e)}var Wn=`Argument.Any.Array.AsyncIterator.BigInt.Boolean.Computed.Constructor.Date.Enum.Function.Integer.Intersect.Iterator.Literal.MappedKey.MappedResult.Not.Null.Number.Object.Promise.Record.Ref.RegExp.String.Symbol.TemplateLiteral.This.Tuple.Undefined.Union.Uint8Array.Unknown.Void`.split(`.`);function Gn(e){try{return new RegExp(e),!0}catch{return!1}}function Kn(e){if(!k(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function qn(e){return Yn(e)||Hr(e)}function Jn(e){return A(e)||ut(e)}function F(e){return A(e)||gt(e)}function Yn(e){return A(e)||dt(e)}function I(e){return A(e)||k(e)}function Xn(e){return A(e)||k(e)&&Kn(e)&&Gn(e)}function Zn(e){return A(e)||k(e)&&Kn(e)}function Qn(e){return A(e)||Hr(e)}function $n(e){return O(e)&&e[en]===`Optional`}function er(e){return L(e,`Any`)&&I(e.$id)}function tr(e){return L(e,`Argument`)&&gt(e.index)}function nr(e){return L(e,`Array`)&&e.type===`array`&&I(e.$id)&&Hr(e.items)&&F(e.minItems)&&F(e.maxItems)&&Yn(e.uniqueItems)&&Qn(e.contains)&&F(e.minContains)&&F(e.maxContains)}function rr(e){return L(e,`AsyncIterator`)&&e.type===`AsyncIterator`&&I(e.$id)&&Hr(e.items)}function ir(e){return L(e,`BigInt`)&&e.type===`bigint`&&I(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}function ar(e){return L(e,`Boolean`)&&e.type===`boolean`&&I(e.$id)}function or(e){return L(e,`Computed`)&&k(e.target)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))}function sr(e){return L(e,`Constructor`)&&e.type===`Constructor`&&I(e.$id)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))&&Hr(e.returns)}function cr(e){return L(e,`Date`)&&e.type===`Date`&&I(e.$id)&&F(e.exclusiveMaximumTimestamp)&&F(e.exclusiveMinimumTimestamp)&&F(e.maximumTimestamp)&&F(e.minimumTimestamp)&&F(e.multipleOfTimestamp)}function lr(e){return L(e,`Function`)&&e.type===`Function`&&I(e.$id)&&lt(e.parameters)&&e.parameters.every(e=>Hr(e))&&Hr(e.returns)}function ur(e){return L(e,`Integer`)&&e.type===`integer`&&I(e.$id)&&F(e.exclusiveMaximum)&&F(e.exclusiveMinimum)&&F(e.maximum)&&F(e.minimum)&&F(e.multipleOf)}function dr(e){return O(e)&&Object.entries(e).every(([e,t])=>Kn(e)&&Hr(t))}function fr(e){return L(e,`Intersect`)&&!(k(e.type)&&e.type!==`object`)&&lt(e.allOf)&&e.allOf.every(e=>Hr(e)&&!Nr(e))&&I(e.type)&&(Yn(e.unevaluatedProperties)||Qn(e.unevaluatedProperties))&&I(e.$id)}function pr(e){return L(e,`Iterator`)&&e.type===`Iterator`&&I(e.$id)&&Hr(e.items)}function L(e,t){return O(e)&&M in e&&e[M]===t}function mr(e){return _r(e)&&k(e.const)}function hr(e){return _r(e)&&gt(e.const)}function gr(e){return _r(e)&&dt(e.const)}function _r(e){return L(e,`Literal`)&&I(e.$id)&&vr(e.const)}function vr(e){return dt(e)||gt(e)||k(e)}function yr(e){return L(e,`MappedKey`)&&lt(e.keys)&&e.keys.every(e=>gt(e)||k(e))}function br(e){return L(e,`MappedResult`)&&dr(e.properties)}function xr(e){return L(e,`Never`)&&O(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Sr(e){return L(e,`Not`)&&Hr(e.not)}function Cr(e){return L(e,`Null`)&&e.type===`null`&&I(e.$id)}function wr(e){return L(e,`Number`)&&e.type===`number`&&I(e.$id)&&F(e.exclusiveMaximum)&&F(e.exclusiveMinimum)&&F(e.maximum)&&F(e.minimum)&&F(e.multipleOf)}function R(e){return L(e,`Object`)&&e.type===`object`&&I(e.$id)&&dr(e.properties)&&qn(e.additionalProperties)&&F(e.minProperties)&&F(e.maxProperties)}function Tr(e){return L(e,`Promise`)&&e.type===`Promise`&&I(e.$id)&&Hr(e.item)}function Er(e){return L(e,`Record`)&&e.type===`object`&&I(e.$id)&&qn(e.additionalProperties)&&O(e.patternProperties)&&(e=>{let t=Object.getOwnPropertyNames(e.patternProperties);return t.length===1&&Gn(t[0])&&O(e.patternProperties)&&Hr(e.patternProperties[t[0]])})(e)}function Dr(e){return L(e,`Ref`)&&I(e.$id)&&k(e.$ref)}function Or(e){return L(e,`RegExp`)&&I(e.$id)&&k(e.source)&&k(e.flags)&&F(e.maxLength)&&F(e.minLength)}function kr(e){return L(e,`String`)&&e.type===`string`&&I(e.$id)&&F(e.minLength)&&F(e.maxLength)&&Xn(e.pattern)&&Zn(e.format)}function Ar(e){return L(e,`Symbol`)&&e.type===`symbol`&&I(e.$id)}function jr(e){return L(e,`TemplateLiteral`)&&e.type===`string`&&k(e.pattern)&&e.pattern[0]===`^`&&e.pattern[e.pattern.length-1]===`$`}function Mr(e){return L(e,`This`)&&I(e.$id)&&k(e.$ref)}function Nr(e){return O(e)&&Qt in e}function Pr(e){return L(e,`Tuple`)&&e.type===`array`&&I(e.$id)&&gt(e.minItems)&&gt(e.maxItems)&&e.minItems===e.maxItems&&(A(e.items)&&A(e.additionalItems)&&e.minItems===0||lt(e.items)&&e.items.every(e=>Hr(e)))}function Fr(e){return L(e,`Undefined`)&&e.type===`undefined`&&I(e.$id)}function Ir(e){return L(e,`Union`)&&I(e.$id)&&O(e)&&lt(e.anyOf)&&e.anyOf.every(e=>Hr(e))}function Lr(e){return L(e,`Uint8Array`)&&e.type===`Uint8Array`&&I(e.$id)&&F(e.minByteLength)&&F(e.maxByteLength)}function Rr(e){return L(e,`Unknown`)&&I(e.$id)}function zr(e){return L(e,`Unsafe`)}function Br(e){return L(e,`Void`)&&e.type===`void`&&I(e.$id)}function Vr(e){return O(e)&&M in e&&k(e[M])&&!Wn.includes(e[M])}function Hr(e){return O(e)&&(er(e)||tr(e)||nr(e)||ar(e)||ir(e)||rr(e)||or(e)||sr(e)||cr(e)||lr(e)||ur(e)||fr(e)||pr(e)||_r(e)||yr(e)||br(e)||xr(e)||Sr(e)||Cr(e)||wr(e)||R(e)||Tr(e)||Er(e)||Dr(e)||Or(e)||kr(e)||Ar(e)||jr(e)||Mr(e)||Pr(e)||Fr(e)||Ir(e)||Lr(e)||Rr(e)||zr(e)||Br(e)||Vr(e))}var Ur=`(true|false)`,Wr=`(0|[1-9][0-9]*)`,Gr=`(.*)`,Kr=`(?!.*)`;`${Ur}`;var qr=`^${Wr}$`,Jr=`^${Gr}$`,Yr=`^${Kr}$`,Xr=new Map;function Zr(e){return Xr.has(e)}function Qr(e,t){Xr.set(e,t)}function $r(e){return Xr.get(e)}var ei=new Map;function ti(e){return ei.has(e)}function ni(e){return ei.get(e)}function ri(e,t){return e.includes(t)}function ii(e){return[...new Set(e)]}function ai(e,t){return e.filter(e=>t.includes(e))}function oi(e,t){return e.reduce((e,t)=>ai(e,t),t)}function si(e){return e.length===1?e[0]:e.length>1?oi(e.slice(1),e[0]):[]}function ci(e){let t=[];for(let n of e)t.push(...n);return t}function li(e){return j({[M]:`Any`},e)}function ui(e,t){return j({[M]:`Array`,type:`array`,items:e},t)}function di(e){return j({[M]:`Argument`,index:e})}function fi(e,t){return j({[M]:`AsyncIterator`,type:`AsyncIterator`,items:e},t)}function pi(e,t,n){return j({[M]:`Computed`,target:e,parameters:t},n)}function mi(e,t){let{[t]:n,...r}=e;return r}function hi(e,t){return t.reduce((e,t)=>mi(e,t),e)}function z(e){return j({[M]:`Never`,not:{}},e)}function gi(e){return j({[M]:`MappedResult`,properties:e})}function _i(e,t,n){return j({[M]:`Constructor`,type:`Constructor`,parameters:e,returns:t},n)}function vi(e,t,n){return j({[M]:`Function`,type:`Function`,parameters:e,returns:t},n)}function yi(e,t){return j({[M]:`Union`,anyOf:e},t)}function bi(e){return e.some(e=>rn(e))}function xi(e){return e.map(e=>rn(e)?Si(e):e)}function Si(e){return hi(e,[en])}function Ci(e,t){return bi(e)?so(yi(xi(e),t)):yi(xi(e),t)}function wi(e,t){return e.length===1?j(e[0],t):e.length===0?z(t):Ci(e,t)}function Ti(e,t){return e.length===0?z(t):e.length===1?j(e[0],t):yi(e,t)}var Ei=class extends Zt{};function Di(e){return e.replace(/\\\$/g,`$`).replace(/\\\*/g,`*`).replace(/\\\^/g,`^`).replace(/\\\|/g,`|`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)}function Oi(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function ki(e,t){return Oi(e,t,`(`)}function Ai(e,t){return Oi(e,t,`)`)}function ji(e,t){return Oi(e,t,`|`)}function Mi(e){if(!(ki(e,0)&&Ai(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(ki(e,n)&&(t+=1),Ai(e,n)&&--t,t===0&&n!==e.length-1)return!1;return!0}function Ni(e){return e.slice(1,e.length-1)}function Pi(e){let t=0;for(let n=0;n<e.length;n++)if(ki(e,n)&&(t+=1),Ai(e,n)&&--t,ji(e,n)&&t===0)return!0;return!1}function Fi(e){for(let t=0;t<e.length;t++)if(ki(e,t))return!0;return!1}function Ii(e){let[t,n]=[0,0],r=[];for(let i=0;i<e.length;i++)if(ki(e,i)&&(t+=1),Ai(e,i)&&--t,ji(e,i)&&t===0){let t=e.slice(n,i);t.length>0&&r.push(Ri(t)),n=i+1}let i=e.slice(n);return i.length>0&&r.push(Ri(i)),r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`or`,expr:r}}function Li(e){function t(e,t){if(!ki(e,t))throw new Ei(`TemplateLiteralParser: Index must point to open parens`);let n=0;for(let r=t;r<e.length;r++)if(ki(e,r)&&(n+=1),Ai(e,r)&&--n,n===0)return[t,r];throw new Ei(`TemplateLiteralParser: Unclosed group parens in expression`)}function n(e,t){for(let n=t;n<e.length;n++)if(ki(e,n))return[t,n];return[t,e.length]}let r=[];for(let i=0;i<e.length;i++)if(ki(e,i)){let[n,a]=t(e,i),o=e.slice(n,a+1);r.push(Ri(o)),i=a}else{let[t,a]=n(e,i),o=e.slice(t,a);o.length>0&&r.push(Ri(o)),i=a-1}return r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`and`,expr:r}}function Ri(e){return Mi(e)?Ri(Ni(e)):Pi(e)?Ii(e):Fi(e)?Li(e):{type:`const`,const:Di(e)}}function zi(e){return Ri(e.slice(1,e.length-1))}var Bi=class extends Zt{};function Vi(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`0`&&e.expr[1].type===`const`&&e.expr[1].const===`[1-9][0-9]*`}function Hi(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`true`&&e.expr[1].type===`const`&&e.expr[1].const===`false`}function Ui(e){return e.type===`const`&&e.const===`.*`}function Wi(e){return Vi(e)||Ui(e)?!1:Hi(e)?!0:e.type===`and`||e.type===`or`?e.expr.every(e=>Wi(e)):e.type===`const`||(()=>{throw new Bi(`Unknown expression type`)})()}function Gi(e){return Wi(zi(e.pattern))}var Ki=class extends Zt{};function*qi(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of qi(e.slice(1)))yield`${t}${n}`}function*Ji(e){return yield*qi(e.expr.map(e=>[...Zi(e)]))}function*Yi(e){for(let t of e.expr)yield*Zi(t)}function*Xi(e){return yield e.const}function*Zi(e){return e.type===`and`?yield*Ji(e):e.type===`or`?yield*Yi(e):e.type===`const`?yield*Xi(e):(()=>{throw new Ki(`Unknown expression`)})()}function Qi(e){let t=zi(e.pattern);return Wi(t)?[...Zi(t)]:[]}function B(e,t){return j({[M]:`Literal`,const:e,type:typeof e},t)}function $i(e){return j({[M]:`Boolean`,type:`boolean`},e)}function ea(e){return j({[M]:`BigInt`,type:`bigint`},e)}function ta(e){return j({[M]:`Number`,type:`number`},e)}function na(e){return j({[M]:`String`,type:`string`},e)}function*ra(e){let t=e.trim().replace(/"|'/g,``);return t===`boolean`?yield $i():t===`number`?yield ta():t===`bigint`?yield ea():t===`string`?yield na():yield(()=>{let e=t.split(`|`).map(e=>B(e.trim()));return e.length===0?z():e.length===1?e[0]:wi(e)})()}function*ia(e){if(e[1]!==`{`)return yield*[B(`$`),...aa(e.slice(1))];for(let t=2;t<e.length;t++)if(e[t]===`}`){let n=ra(e.slice(2,t)),r=aa(e.slice(t+1));return yield*[...n,...r]}yield B(e)}function*aa(e){for(let t=0;t<e.length;t++)if(e[t]===`$`)return yield*[B(e.slice(0,t)),...ia(e.slice(t))];yield B(e)}function oa(e){return[...aa(e)]}var sa=class extends Zt{};function ca(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function la(e,t){return Nn(e)?e.pattern.slice(1,e.pattern.length-1):P(e)?`(${e.anyOf.map(e=>la(e,t)).join(`|`)})`:Tn(e)||hn(e)||ln(e)?`${t}${Wr}`:jn(e)?`${t}${Gr}`:yn(e)?`${t}${ca(e.const.toString())}`:un(e)?`${t}${Ur}`:(()=>{throw new sa(`Unexpected Kind '${e[M]}'`)})()}function ua(e){return`^${e.map(e=>la(e,``)).join(``)}\$`}function da(e){return wi(Qi(e).map(e=>B(e)))}function fa(e,t){let n=k(e)?ua(oa(e)):ua(e);return j({[M]:`TemplateLiteral`,type:`string`,pattern:n},t)}function pa(e){return Qi(e).map(e=>e.toString())}function ma(e){let t=[];for(let n of e)t.push(...ga(n));return t}function ha(e){return[e.toString()]}function ga(e){return[...new Set(Nn(e)?pa(e):P(e)?ma(e.anyOf):yn(e)?ha(e.const):Tn(e)||hn(e)?[`[number]`]:[])]}function _a(e,t,n){let r={};for(let i of Object.getOwnPropertyNames(t))r[i]=ja(e,ga(t[i]),n);return r}function va(e,t,n){return _a(e,t.properties,n)}function ya(e,t,n){return gi(va(e,t,n))}function ba(e,t){return e.map(e=>Oa(e,t))}function xa(e){return e.filter(e=>!Sn(e))}function Sa(e,t){return _o(xa(ba(e,t)))}function Ca(e){return e.some(e=>Sn(e))?[]:e}function wa(e,t){return wi(Ca(ba(e,t)))}function Ta(e,t){return t in e?e[t]:t===`[number]`?wi(e):z()}function Ea(e,t){return t===`[number]`?e:z()}function Da(e,t){return t in e?e[t]:z()}function Oa(e,t){return gn(e)?Sa(e.allOf,t):P(e)?wa(e.anyOf,t):In(e)?Ta(e.items??[],t):sn(e)?Ea(e.items,t):En(e)?Da(e.properties,t):z()}function ka(e,t){return t.map(t=>Oa(e,t))}function Aa(e,t){return wi(ka(e,t))}function ja(e,t,n){if(kn(e)||kn(t)){if(!Un(e)||!Un(t))throw new Zt(`Index types using Ref parameters require both Type and Key to be of TSchema`);return pi(`Index`,[e,t])}return xn(t)?ya(e,t,n):bn(t)?Fa(e,t,n):j(Un(t)?Aa(e,ga(t)):Aa(e,t),n)}function Ma(e,t,n){return{[t]:ja(e,[t],Et(n))}}function Na(e,t,n){return t.reduce((t,r)=>({...t,...Ma(e,r,n)}),{})}function Pa(e,t,n){return Na(e,t.keys,n)}function Fa(e,t,n){return gi(Pa(e,t,n))}function Ia(e,t){return j({[M]:`Iterator`,type:`Iterator`,items:e},t)}function La(e){return globalThis.Object.keys(e).filter(t=>!rn(e[t]))}function Ra(e,t){let n=La(e);return j(n.length>0?{[M]:`Object`,type:`object`,required:n,properties:e}:{[M]:`Object`,type:`object`,properties:e},t)}var V=Ra;function za(e,t){return j({[M]:`Promise`,type:`Promise`,item:e},t)}function Ba(e){return j(hi(e,[$t]))}function Va(e){return j({...e,[$t]:`Readonly`})}function Ha(e,t){return t===!1?Ba(e):Va(e)}function Ua(e,t){let n=t??!0;return xn(e)?Ka(e,n):Ha(e,n)}function Wa(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Ua(e[r],t);return n}function Ga(e,t){return Wa(e.properties,t)}function Ka(e,t){return gi(Ga(e,t))}function qa(e,t){return j(e.length>0?{[M]:`Tuple`,type:`array`,items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[M]:`Tuple`,type:`array`,minItems:e.length,maxItems:e.length},t)}function Ja(e,t){return e in t?to(e,t[e]):gi(t)}function Ya(e){return{[e]:B(e)}}function Xa(e){let t={};for(let n of e)t[n]=B(n);return t}function Za(e,t){return ri(t,e)?Ya(e):Xa(t)}function Qa(e,t){return Ja(e,Za(e,t))}function $a(e,t){return t.map(t=>to(e,t))}function eo(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=to(e,t[r]);return n}function to(e,t){let n={...t};return rn(t)?so(to(e,hi(t,[en]))):nn(t)?Ua(to(e,hi(t,[$t]))):xn(t)?Ja(e,t.properties):bn(t)?Qa(e,t.keys):fn(t)?_i($a(e,t.parameters),to(e,t.returns),n):mn(t)?vi($a(e,t.parameters),to(e,t.returns),n):cn(t)?fi(to(e,t.items),n):_n(t)?Ia(to(e,t.items),n):gn(t)?vo($a(e,t.allOf),n):P(t)?Ti($a(e,t.anyOf),n):In(t)?qa($a(e,t.items??[]),n):En(t)?V(eo(e,t.properties),n):sn(t)?ui(to(e,t.items),n):Dn(t)?za(to(e,t.item),n):t}function no(e,t){let n={};for(let r of e)n[r]=to(r,t);return n}function ro(e,t,n){let r=Un(e)?ga(e):e;return V(no(r,t({[M]:`MappedKey`,keys:r})),n)}function io(e){return j(hi(e,[en]))}function ao(e){return j({...e,[en]:`Optional`})}function oo(e,t){return t===!1?io(e):ao(e)}function so(e,t){let n=t??!0;return xn(e)?uo(e,n):oo(e,n)}function co(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=so(e[r],t);return n}function lo(e,t){return co(e.properties,t)}function uo(e,t){return gi(lo(e,t))}function fo(e,t={}){let n=e.every(e=>En(e)),r=Un(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return j(t.unevaluatedProperties===!1||Un(t.unevaluatedProperties)||n?{...r,[M]:`Intersect`,type:`object`,allOf:e}:{...r,[M]:`Intersect`,allOf:e},t)}function po(e){return e.every(e=>rn(e))}function mo(e){return hi(e,[en])}function ho(e){return e.map(e=>rn(e)?mo(e):e)}function go(e,t){return po(e)?so(fo(ho(e),t)):fo(ho(e),t)}function _o(e,t={}){if(e.length===1)return j(e[0],t);if(e.length===0)return z(t);if(e.some(e=>Fn(e)))throw Error(`Cannot intersect transform types`);return go(e,t)}function vo(e,t){if(e.length===1)return j(e[0],t);if(e.length===0)return z(t);if(e.some(e=>Fn(e)))throw Error(`Cannot intersect transform types`);return fo(e,t)}function yo(...e){let[t,n]=typeof e[0]==`string`?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!=`string`)throw new Zt(`Ref: $ref must be a string`);return j({[M]:`Ref`,$ref:t},n)}function bo(e,t){return pi(`Awaited`,[pi(e,t)])}function xo(e){return pi(`Awaited`,[yo(e)])}function So(e){return vo(To(e))}function Co(e){return Ti(To(e))}function wo(e){return Eo(e)}function To(e){return e.map(e=>Eo(e))}function Eo(e,t){return j(dn(e)?bo(e.target,e.parameters):gn(e)?So(e.allOf):P(e)?Co(e.anyOf):Dn(e)?wo(e.item):kn(e)?xo(e.$ref):e,t)}function Do(e){let t=[];for(let n of e)t.push(Po(n));return t}function Oo(e){return ci(Do(e))}function ko(e){return si(Do(e))}function Ao(e){return e.map((e,t)=>t.toString())}function jo(e){return[`[number]`]}function Mo(e){return globalThis.Object.getOwnPropertyNames(e)}function No(e){return Fo?globalThis.Object.getOwnPropertyNames(e).map(e=>e[0]===`^`&&e[e.length-1]===`$`?e.slice(1,e.length-1):e):[]}function Po(e){return gn(e)?Oo(e.allOf):P(e)?ko(e.anyOf):In(e)?Ao(e.items??[]):sn(e)?jo(e.items):En(e)?Mo(e.properties):On(e)?No(e.patternProperties):[]}var Fo=!1;function Io(e){Fo=!0;let t=Po(e);return Fo=!1,`^(${t.map(e=>`(${e})`).join(`|`)})$`}function Lo(e,t){return pi(`KeyOf`,[pi(e,t)])}function Ro(e){return pi(`KeyOf`,[yo(e)])}function zo(e,t){return j(wi(Bo(Po(e))),t)}function Bo(e){return e.map(e=>e===`[number]`?ta():B(e))}function Vo(e,t){return dn(e)?Lo(e.target,e.parameters):kn(e)?Ro(e.$ref):xn(e)?Wo(e,t):zo(e,t)}function Ho(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Vo(e[r],Et(t));return n}function Uo(e,t){return Ho(e.properties,t)}function Wo(e,t){return gi(Uo(e,t))}function Go(e){let t=[];for(let n of e)t.push(...Po(n));return ii(t)}function Ko(e){return e.filter(e=>!Sn(e))}function qo(e,t){let n=[];for(let r of e)n.push(...ka(r,[t]));return Ko(n)}function Jo(e,t){let n={};for(let r of t)n[r]=_o(qo(e,r));return n}function Yo(e,t){return V(Jo(e,Go(e)),t)}function Xo(e){return j({[M]:`Date`,type:`Date`},e)}function Zo(e){return j({[M]:`Null`,type:`null`},e)}function Qo(e){return j({[M]:`Symbol`,type:`symbol`},e)}function $o(e){return j({[M]:`Undefined`,type:`undefined`},e)}function es(e){return j({[M]:`Uint8Array`,type:`Uint8Array`},e)}function ts(e){return j({[M]:`Unknown`},e)}function ns(e){return e.map(e=>as(e,!1))}function rs(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Ua(as(e[n],!1));return t}function is(e,t){return t===!0?e:Ua(e)}function as(e,t){return ct(e)||mt(e)?is(li(),t):lt(e)?Ua(qa(ns(e))):yt(e)?es():ft(e)?Xo():O(e)?is(V(rs(e)),t):pt(e)?is(vi([],ts()),t):A(e)?$o():ht(e)?Zo():vt(e)?Qo():ut(e)?ea():gt(e)||dt(e)||k(e)?B(e):V({})}function os(e,t){return j(as(e,!0),t)}function ss(e,t){return fn(e)?qa(e.parameters,t):z(t)}function cs(e,t){if(A(e))throw Error(`Enum undefined or empty`);let n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return Ti([...new Set(n)].map(e=>B(e)),{...t,[tn]:`Enum`})}var ls=class extends Zt{},H;(function(e){e[e.Union=0]=`Union`,e[e.True=1]=`True`,e[e.False=2]=`False`})(H||={});function us(e){return e===H.False?e:H.True}function ds(e){throw new ls(e)}function U(e){return xr(e)||fr(e)||Ir(e)||Rr(e)||er(e)}function W(e,t){return xr(t)?ks(e,t):fr(t)?Ts(e,t):Ir(t)?fc(e,t):Rr(t)?mc(e,t):er(t)?fs(e,t):ds(`StructuralRight`)}function fs(e,t){return H.True}function ps(e,t){return fr(t)?Ts(e,t):Ir(t)&&t.anyOf.some(e=>er(e)||Rr(e))?H.True:Ir(t)?H.Union:Rr(t)||er(t)?H.True:H.Union}function ms(e,t){return Rr(e)?H.False:er(e)?H.Union:xr(e)?H.True:H.False}function hs(e,t){return R(t)&&Ks(t)?H.True:U(t)?W(e,t):nr(t)?us(G(e.items,t.items)):H.False}function gs(e,t){return U(t)?W(e,t):rr(t)?us(G(e.items,t.items)):H.False}function _s(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ir(t)?H.True:H.False}function vs(e,t){return gr(e)||ar(e)?H.True:H.False}function ys(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ar(t)?H.True:H.False}function bs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):sr(t)?e.parameters.length>t.parameters.length?H.False:e.parameters.every((e,n)=>us(G(t.parameters[n],e))===H.True)?us(G(e.returns,t.returns)):H.False:H.False}function xs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):cr(t)?H.True:H.False}function Ss(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):lr(t)?e.parameters.length>t.parameters.length?H.False:e.parameters.every((e,n)=>us(G(t.parameters[n],e))===H.True)?us(G(e.returns,t.returns)):H.False:H.False}function Cs(e,t){return _r(e)&&gt(e.const)||wr(e)||ur(e)?H.True:H.False}function ws(e,t){return ur(t)||wr(t)?H.True:U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):H.False}function Ts(e,t){return t.allOf.every(t=>G(e,t)===H.True)?H.True:H.False}function Es(e,t){return e.allOf.some(e=>G(e,t)===H.True)?H.True:H.False}function Ds(e,t){return U(t)?W(e,t):pr(t)?us(G(e.items,t.items)):H.False}function Os(e,t){return _r(t)&&t.const===e.const?H.True:U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):kr(t)?rc(e,t):wr(t)?Ps(e,t):ur(t)?Cs(e,t):ar(t)?vs(e,t):H.False}function ks(e,t){return H.False}function As(e,t){return H.True}function js(e){let[t,n]=[e,0];for(;Sr(t);)t=t.not,n+=1;return n%2==0?t:ts()}function Ms(e,t){return Sr(e)?G(js(e),t):Sr(t)?G(e,js(t)):ds(`Invalid fallthrough for Not`)}function Ns(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Cr(t)?H.True:H.False}function Ps(e,t){return hr(e)||wr(e)||ur(e)?H.True:H.False}function Fs(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):ur(t)||wr(t)?H.True:H.False}function Is(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function Ls(e){return Ks(e)}function Rs(e){return Is(e,0)||Is(e,1)&&`description`in e.properties&&Ir(e.properties.description)&&e.properties.description.anyOf.length===2&&(kr(e.properties.description.anyOf[0])&&Fr(e.properties.description.anyOf[1])||kr(e.properties.description.anyOf[1])&&Fr(e.properties.description.anyOf[0]))}function zs(e){return Is(e,0)}function Bs(e){return Is(e,0)}function Vs(e){return Is(e,0)}function Hs(e){return Is(e,0)}function Us(e){return Ks(e)}function Ws(e){let t=ta();return Is(e,0)||Is(e,1)&&`length`in e.properties&&us(G(e.properties.length,t))===H.True}function Gs(e){return Is(e,0)}function Ks(e){let t=ta();return Is(e,0)||Is(e,1)&&`length`in e.properties&&us(G(e.properties.length,t))===H.True}function qs(e){let t=vi([li()],li());return Is(e,0)||Is(e,1)&&`then`in e.properties&&us(G(e.properties.then,t))===H.True}function Js(e,t){return G(e,t)===H.False||$n(e)&&!$n(t)?H.False:H.True}function Ys(e,t){return Rr(e)?H.False:er(e)?H.Union:xr(e)||mr(e)&&Ls(t)||hr(e)&&zs(t)||gr(e)&&Bs(t)||Ar(e)&&Rs(t)||ir(e)&&Vs(t)||kr(e)&&Ls(t)||Ar(e)&&Rs(t)||wr(e)&&zs(t)||ur(e)&&zs(t)||ar(e)&&Bs(t)||Lr(e)&&Us(t)||cr(e)&&Hs(t)||sr(e)&&Gs(t)||lr(e)&&Ws(t)?H.True:Er(e)&&kr(Qs(e))?t[tn]===`Record`?H.True:H.False:Er(e)&&wr(Qs(e))&&Is(t,0)?H.True:H.False}function Xs(e,t){return U(t)?W(e,t):Er(t)?ec(e,t):R(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!$n(t.properties[n]))return H.False;if($n(t.properties[n]))return H.True;if(Js(e.properties[n],t.properties[n])===H.False)return H.False}return H.True})():H.False}function Zs(e,t){return U(t)?W(e,t):R(t)&&qs(t)?H.True:Tr(t)?us(G(e.item,t.item)):H.False}function Qs(e){return qr in e.patternProperties?ta():Jr in e.patternProperties?na():ds(`Unknown record key pattern`)}function $s(e){return qr in e.patternProperties?e.patternProperties[qr]:Jr in e.patternProperties?e.patternProperties[Jr]:ds(`Unable to get record value schema`)}function ec(e,t){let[n,r]=[Qs(t),$s(t)];return mr(e)&&wr(n)&&us(G(e,r))===H.True?H.True:Lr(e)&&wr(n)||kr(e)&&wr(n)||nr(e)&&wr(n)?G(e,r):R(e)?(()=>{for(let t of Object.getOwnPropertyNames(e.properties))if(Js(r,e.properties[t])===H.False)return H.False;return H.True})():H.False}function tc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?G($s(e),$s(t)):H.False}function nc(e,t){return G(Or(e)?na():e,Or(t)?na():t)}function rc(e,t){return _r(e)&&k(e.const)||kr(e)?H.True:H.False}function ic(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):kr(t)?H.True:H.False}function ac(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Ar(t)?H.True:H.False}function oc(e,t){return jr(e)?G(da(e),t):jr(t)?G(e,da(t)):ds(`Invalid fallthrough for TemplateLiteral`)}function sc(e,t){return nr(t)&&e.items!==void 0&&e.items.every(e=>G(e,t.items)===H.True)}function cc(e,t){return xr(e)?H.True:Rr(e)?H.False:er(e)?H.Union:H.False}function lc(e,t){return U(t)?W(e,t):R(t)&&Ks(t)||nr(t)&&sc(e,t)?H.True:Pr(t)?A(e.items)&&!A(t.items)||!A(e.items)&&A(t.items)?H.False:A(e.items)&&!A(t.items)||e.items.every((e,n)=>G(e,t.items[n])===H.True)?H.True:H.False:H.False}function uc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Lr(t)?H.True:H.False}function dc(e,t){return U(t)?W(e,t):R(t)?Ys(e,t):Er(t)?ec(e,t):Br(t)?gc(e,t):Fr(t)?H.True:H.False}function fc(e,t){return t.anyOf.some(t=>G(e,t)===H.True)?H.True:H.False}function pc(e,t){return e.anyOf.every(e=>G(e,t)===H.True)?H.True:H.False}function mc(e,t){return H.True}function hc(e,t){return xr(t)?ks(e,t):fr(t)?Ts(e,t):Ir(t)?fc(e,t):er(t)?fs(e,t):kr(t)?rc(e,t):wr(t)?Ps(e,t):ur(t)?Cs(e,t):ar(t)?vs(e,t):nr(t)?ms(e,t):Pr(t)?cc(e,t):R(t)?Ys(e,t):Rr(t)?H.True:H.False}function gc(e,t){return Fr(e)||Fr(e)?H.True:H.False}function _c(e,t){return fr(t)?Ts(e,t):Ir(t)?fc(e,t):Rr(t)?mc(e,t):er(t)?fs(e,t):R(t)?Ys(e,t):Br(t)?H.True:H.False}function G(e,t){return jr(e)||jr(t)?oc(e,t):Or(e)||Or(t)?nc(e,t):Sr(e)||Sr(t)?Ms(e,t):er(e)?ps(e,t):nr(e)?hs(e,t):ir(e)?_s(e,t):ar(e)?ys(e,t):rr(e)?gs(e,t):sr(e)?bs(e,t):cr(e)?xs(e,t):lr(e)?Ss(e,t):ur(e)?ws(e,t):fr(e)?Es(e,t):pr(e)?Ds(e,t):_r(e)?Os(e,t):xr(e)?As(e,t):Cr(e)?Ns(e,t):wr(e)?Fs(e,t):R(e)?Xs(e,t):Er(e)?tc(e,t):kr(e)?ic(e,t):Ar(e)?ac(e,t):Pr(e)?lc(e,t):Tr(e)?Zs(e,t):Lr(e)?uc(e,t):Fr(e)?dc(e,t):Ir(e)?pc(e,t):Rr(e)?hc(e,t):Br(e)?_c(e,t):ds(`Unknown left type operand '${e[M]}'`)}function vc(e,t){return G(e,t)}function yc(e,t,n,r,i){let a={};for(let o of globalThis.Object.getOwnPropertyNames(e))a[o]=Cc(e[o],t,n,r,Et(i));return a}function bc(e,t,n,r,i){return yc(e.properties,t,n,r,i)}function xc(e,t,n,r,i){return gi(bc(e,t,n,r,i))}function Sc(e,t,n,r){let i=vc(e,t);return i===H.Union?Ti([n,r]):i===H.True?n:r}function Cc(e,t,n,r,i){return xn(e)?xc(e,t,n,r,i):bn(e)?j(Dc(e,t,n,r,i)):j(Sc(e,t,n,r),i)}function wc(e,t,n,r,i){return{[e]:Cc(B(e),t,n,r,Et(i))}}function Tc(e,t,n,r,i){return e.reduce((e,a)=>({...e,...wc(a,t,n,r,i)}),{})}function Ec(e,t,n,r,i){return Tc(e.keys,t,n,r,i)}function Dc(e,t,n,r,i){return gi(Ec(e,t,n,r,i))}function Oc(e){return e.allOf.every(e=>jc(e))}function kc(e){return e.anyOf.some(e=>jc(e))}function Ac(e){return!jc(e.not)}function jc(e){return e[M]===`Intersect`?Oc(e):e[M]===`Union`?kc(e):e[M]===`Not`?Ac(e):e[M]===`Undefined`}function Mc(e,t){return Pc(da(e),t)}function Nc(e,t){let n=e.filter(e=>vc(e,t)===H.False);return n.length===1?n[0]:Ti(n)}function Pc(e,t,n={}){return Nn(e)?j(Mc(e,t),n):xn(e)?j(Lc(e,t),n):j(P(e)?Nc(e.anyOf,t):vc(e,t)===H.False?e:z(),n)}function Fc(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Pc(e[r],t);return n}function Ic(e,t){return Fc(e.properties,t)}function Lc(e,t){return gi(Ic(e,t))}function Rc(e,t){return Bc(da(e),t)}function zc(e,t){let n=e.filter(e=>vc(e,t)!==H.False);return n.length===1?n[0]:Ti(n)}function Bc(e,t,n){return Nn(e)?j(Rc(e,t),n):xn(e)?j(Uc(e,t),n):j(P(e)?zc(e.anyOf,t):vc(e,t)===H.False?z():e,n)}function Vc(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Bc(e[r],t);return n}function Hc(e,t){return Vc(e.properties,t)}function Uc(e,t){return gi(Hc(e,t))}function Wc(e,t){return fn(e)?j(e.returns,t):z(t)}function Gc(e){return Ua(so(e))}function Kc(e,t,n){return j({[M]:`Record`,type:`object`,patternProperties:{[e]:t}},n)}function qc(e,t,n){let r={};for(let n of e)r[n]=t;return V(r,{...n,[tn]:`Record`})}function Jc(e,t,n){return Gi(e)?qc(ga(e),t,n):Kc(e.pattern,t,n)}function Yc(e,t,n){return qc(ga(Ti(e)),t,n)}function Xc(e,t,n){return qc([e.toString()],t,n)}function Zc(e,t,n){return Kc(e.source,t,n)}function Qc(e,t,n){return Kc(A(e.pattern)?Jr:e.pattern,t,n)}function $c(e,t,n){return Kc(Jr,t,n)}function el(e,t,n){return Kc(Yr,t,n)}function tl(e,t,n){return V({true:t,false:t},n)}function nl(e,t,n){return Kc(qr,t,n)}function rl(e,t,n){return Kc(qr,t,n)}function il(e,t,n={}){return P(e)?Yc(e.anyOf,t,n):Nn(e)?Jc(e,t,n):yn(e)?Xc(e.const,t,n):un(e)?tl(e,t,n):hn(e)?nl(e,t,n):Tn(e)?rl(e,t,n):An(e)?Zc(e,t,n):jn(e)?Qc(e,t,n):an(e)?$c(e,t,n):Sn(e)?el(e,t,n):z(n)}function al(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function ol(e){let t=al(e);return t===Jr?na():t===qr?ta():na({pattern:t})}function sl(e){return e.patternProperties[al(e)]}function cl(e,t){return t.parameters=Sl(e,t.parameters),t.returns=Cl(e,t.returns),t}function ll(e,t){return t.parameters=Sl(e,t.parameters),t.returns=Cl(e,t.returns),t}function ul(e,t){return t.allOf=Sl(e,t.allOf),t}function dl(e,t){return t.anyOf=Sl(e,t.anyOf),t}function fl(e,t){return A(t.items)||(t.items=Sl(e,t.items)),t}function pl(e,t){return t.items=Cl(e,t.items),t}function ml(e,t){return t.items=Cl(e,t.items),t}function hl(e,t){return t.items=Cl(e,t.items),t}function gl(e,t){return t.item=Cl(e,t.item),t}function _l(e,t){let n=xl(e,t.properties);return{...t,...V(n)}}function vl(e,t){let n=il(Cl(e,ol(t)),Cl(e,sl(t)));return{...t,...n}}function yl(e,t){return t.index in e?e[t.index]:ts()}function bl(e,t){let n=nn(t),r=rn(t),i=Cl(e,t);return n&&r?Gc(i):n&&!r?Ua(i):!n&&r?so(i):i}function xl(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:bl(e,t[r])}),{})}function Sl(e,t){return t.map(t=>Cl(e,t))}function Cl(e,t){return fn(t)?cl(e,t):mn(t)?ll(e,t):gn(t)?ul(e,t):P(t)?dl(e,t):In(t)?fl(e,t):sn(t)?pl(e,t):cn(t)?ml(e,t):_n(t)?hl(e,t):Dn(t)?gl(e,t):En(t)?_l(e,t):On(t)?vl(e,t):on(t)?yl(e,t):t}function wl(e,t){return Cl(t,Dt(e))}function Tl(e){return j({[M]:`Integer`,type:`integer`},e)}function El(e,t,n){return{[e]:Ll(B(e),t,Et(n))}}function Dl(e,t,n){return e.reduce((e,r)=>({...e,...El(r,t,n)}),{})}function Ol(e,t,n){return Dl(e.keys,t,n)}function kl(e,t,n){return gi(Ol(e,t,n))}function Al(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join(``)}function jl(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join(``)}function Ml(e){return e.toUpperCase()}function Nl(e){return e.toLowerCase()}function Pl(e,t,n){let r=zi(e.pattern);return Wi(r)?fa([Ti(Il([...Zi(r)].map(e=>B(e)),t))],n):{...e,pattern:Fl(e.pattern,t)}}function Fl(e,t){return typeof e==`string`?t===`Uncapitalize`?Al(e):t===`Capitalize`?jl(e):t===`Uppercase`?Ml(e):t===`Lowercase`?Nl(e):e:e.toString()}function Il(e,t){return e.map(e=>Ll(e,t))}function Ll(e,t,n={}){return bn(e)?kl(e,t,n):Nn(e)?Pl(e,t,n):P(e)?Ti(Il(e.anyOf,t),n):yn(e)?B(Fl(e.const,t),n):j(e,n)}function Rl(e,t={}){return Ll(e,`Capitalize`,t)}function zl(e,t={}){return Ll(e,`Lowercase`,t)}function Bl(e,t={}){return Ll(e,`Uncapitalize`,t)}function Vl(e,t={}){return Ll(e,`Uppercase`,t)}function Hl(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Ql(e[i],t,Et(n));return r}function Ul(e,t,n){return Hl(e.properties,t,n)}function Wl(e,t,n){return gi(Ul(e,t,n))}function Gl(e,t){return e.map(e=>Zl(e,t))}function Kl(e,t){return e.map(e=>Zl(e,t))}function ql(e,t){let{[t]:n,...r}=e;return r}function Jl(e,t){return t.reduce((e,t)=>ql(e,t),e)}function Yl(e,t,n){let r=hi(e,[Qt,`$id`,`required`,`properties`]);return V(Jl(n,t),r)}function Xl(e){return Ti(e.reduce((e,t)=>vn(t)?[...e,B(t)]:e,[]))}function Zl(e,t){return gn(e)?vo(Gl(e.allOf,t)):P(e)?Ti(Kl(e.anyOf,t)):En(e)?Yl(e,t,e.properties):V({})}function Ql(e,t,n){let r=lt(t)?Xl(t):t,i=Un(t)?ga(t):t,a=kn(e),o=kn(t);return xn(e)?Wl(e,i,n):bn(t)?nu(e,t,n):a&&o||!a&&o||a&&!o?pi(`Omit`,[e,r],n):j({...Zl(e,i),...n})}function $l(e,t,n){return{[t]:Ql(e,[t],Et(n))}}function eu(e,t,n){return t.reduce((t,r)=>({...t,...$l(e,r,n)}),{})}function tu(e,t,n){return eu(e,t.keys,n)}function nu(e,t,n){return gi(tu(e,t,n))}function ru(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=fu(e[i],t,Et(n));return r}function iu(e,t,n){return ru(e.properties,t,n)}function au(e,t,n){return gi(iu(e,t,n))}function ou(e,t){return e.map(e=>du(e,t))}function su(e,t){return e.map(e=>du(e,t))}function cu(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function lu(e,t,n){let r=hi(e,[Qt,`$id`,`required`,`properties`]);return V(cu(n,t),r)}function uu(e){return Ti(e.reduce((e,t)=>vn(t)?[...e,B(t)]:e,[]))}function du(e,t){return gn(e)?vo(ou(e.allOf,t)):P(e)?Ti(su(e.anyOf,t)):En(e)?lu(e,t,e.properties):V({})}function fu(e,t,n){let r=lt(t)?uu(t):t,i=Un(t)?ga(t):t,a=kn(e),o=kn(t);return xn(e)?au(e,i,n):bn(t)?gu(e,t,n):a&&o||!a&&o||a&&!o?pi(`Pick`,[e,r],n):j({...du(e,i),...n})}function pu(e,t,n){return{[t]:fu(e,[t],Et(n))}}function mu(e,t,n){return t.reduce((t,r)=>({...t,...pu(e,r,n)}),{})}function hu(e,t,n){return mu(e,t.keys,n)}function gu(e,t,n){return gi(hu(e,t,n))}function _u(e,t){return pi(`Partial`,[pi(e,t)])}function vu(e){return pi(`Partial`,[yo(e)])}function yu(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=so(e[n]);return t}function bu(e,t){let n=hi(e,[Qt,`$id`,`required`,`properties`]);return V(yu(t),n)}function xu(e){return e.map(e=>Su(e))}function Su(e){return dn(e)?_u(e.target,e.parameters):kn(e)?vu(e.$ref):gn(e)?vo(xu(e.allOf)):P(e)?Ti(xu(e.anyOf)):En(e)?bu(e,e.properties):ln(e)||un(e)||hn(e)||yn(e)||wn(e)||Tn(e)||jn(e)||Mn(e)||Ln(e)?e:V({})}function Cu(e,t){return xn(e)?Eu(e,t):j({...Su(e),...t})}function wu(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Cu(e[r],Et(t));return n}function Tu(e,t){return wu(e.properties,t)}function Eu(e,t){return gi(Tu(e,t))}function Du(e,t){return pi(`Required`,[pi(e,t)])}function Ou(e){return pi(`Required`,[yo(e)])}function ku(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=hi(e[n],[en]);return t}function Au(e,t){let n=hi(e,[Qt,`$id`,`required`,`properties`]);return V(ku(t),n)}function ju(e){return e.map(e=>Mu(e))}function Mu(e){return dn(e)?Du(e.target,e.parameters):kn(e)?Ou(e.$ref):gn(e)?vo(ju(e.allOf)):P(e)?Ti(ju(e.anyOf)):En(e)?Au(e,e.properties):ln(e)||un(e)||hn(e)||yn(e)||wn(e)||Tn(e)||jn(e)||Mn(e)||Ln(e)?e:V({})}function Nu(e,t){return xn(e)?Iu(e,t):j({...Mu(e),...t})}function Pu(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Nu(e[r],t);return n}function Fu(e,t){return Pu(e.properties,t)}function Iu(e,t){return gi(Fu(e,t))}function Lu(e,t){return t.map(t=>kn(t)?Ru(e,t.$ref):ad(e,t))}function Ru(e,t){return t in e?kn(e[t])?Ru(e,e[t].$ref):ad(e,e[t]):z()}function zu(e){return Eo(e[0])}function Bu(e){return ja(e[0],e[1])}function Vu(e){return Vo(e[0])}function Hu(e){return Cu(e[0])}function Uu(e){return Ql(e[0],e[1])}function Wu(e){return fu(e[0],e[1])}function Gu(e){return Nu(e[0])}function Ku(e,t,n){let r=Lu(e,n);return t===`Awaited`?zu(r):t===`Index`?Bu(r):t===`KeyOf`?Vu(r):t===`Partial`?Hu(r):t===`Omit`?Uu(r):t===`Pick`?Wu(r):t===`Required`?Gu(r):z()}function qu(e,t){return ui(ad(e,t))}function Ju(e,t){return fi(ad(e,t))}function Yu(e,t,n){return _i(id(e,t),ad(e,n))}function Xu(e,t,n){return vi(id(e,t),ad(e,n))}function Zu(e,t){return vo(id(e,t))}function Qu(e,t){return Ia(ad(e,t))}function $u(e,t){return V(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:ad(e,t[r])}),{}))}function ed(e,t){let[n,r]=[ad(e,sl(t)),al(t)],i=Dt(t);return i.patternProperties[r]=n,i}function td(e,t){return kn(t)?{...Ru(e,t.$ref),[Qt]:t[Qt]}:t}function nd(e,t){return qa(id(e,t))}function rd(e,t){return Ti(id(e,t))}function id(e,t){return t.map(t=>ad(e,t))}function ad(e,t){return rn(t)?j(ad(e,hi(t,[en])),t):nn(t)?j(ad(e,hi(t,[$t])),t):Fn(t)?j(td(e,t),t):sn(t)?j(qu(e,t.items),t):cn(t)?j(Ju(e,t.items),t):dn(t)?j(Ku(e,t.target,t.parameters)):fn(t)?j(Yu(e,t.parameters,t.returns),t):mn(t)?j(Xu(e,t.parameters,t.returns),t):gn(t)?j(Zu(e,t.allOf),t):_n(t)?j(Qu(e,t.items),t):En(t)?j($u(e,t.properties),t):On(t)?j(ed(e,t)):In(t)?j(nd(e,t.items||[]),t):P(t)?j(rd(e,t.anyOf),t):t}function od(e,t){return t in e?ad(e,e[t]):z()}function sd(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:od(e,n)}),{})}var cd=class{constructor(e){let t=sd(e),n=this.WithIdentifiers(t);this.$defs=n}Import(e,t){let n={...this.$defs,[e]:j(this.$defs[e],t)};return j({[M]:`Import`,$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}};function ld(e){return new cd(e)}function ud(e,t){return j({[M]:`Not`,not:e},t)}function dd(e,t){return mn(e)?qa(e.parameters,t):z()}var fd=0;function pd(e,t={}){A(t.$id)&&(t.$id=`T${fd++}`);let n=Dt(e({[M]:`This`,$ref:`${t.$id}`}));return n.$id=t.$id,j({[tn]:`Recursive`,...n},t)}function md(e,t){let n=k(e)?new globalThis.RegExp(e):e;return j({[M]:`RegExp`,type:`RegExp`,source:n.source,flags:n.flags},t)}function hd(e){return gn(e)?e.allOf:P(e)?e.anyOf:In(e)?e.items??[]:[]}function gd(e){return hd(e)}function _d(e,t){return mn(e)?j(e.returns,t):z(t)}var vd=class{constructor(e){this.schema=e}Decode(e){return new yd(this.schema,e)}},yd=class{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){let n={Encode:n=>t[Qt].Encode(e(n)),Decode:e=>this.decode(t[Qt].Decode(e))};return{...t,[Qt]:n}}EncodeSchema(e,t){let n={Decode:this.decode,Encode:e};return{...t,[Qt]:n}}Encode(e){return Fn(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function bd(e){return new vd(e)}function xd(e={}){return j({[M]:e[M]??`Unsafe`},e)}function Sd(e){return j({[M]:`Void`,type:`void`},e)}var K=e({Any:()=>li,Argument:()=>di,Array:()=>ui,AsyncIterator:()=>fi,Awaited:()=>Eo,BigInt:()=>ea,Boolean:()=>$i,Capitalize:()=>Rl,Composite:()=>Yo,Const:()=>os,Constructor:()=>_i,ConstructorParameters:()=>ss,Date:()=>Xo,Enum:()=>cs,Exclude:()=>Pc,Extends:()=>Cc,Extract:()=>Bc,Function:()=>vi,Index:()=>ja,InstanceType:()=>Wc,Instantiate:()=>wl,Integer:()=>Tl,Intersect:()=>vo,Iterator:()=>Ia,KeyOf:()=>Vo,Literal:()=>B,Lowercase:()=>zl,Mapped:()=>ro,Module:()=>ld,Never:()=>z,Not:()=>ud,Null:()=>Zo,Number:()=>ta,Object:()=>V,Omit:()=>Ql,Optional:()=>so,Parameters:()=>dd,Partial:()=>Cu,Pick:()=>fu,Promise:()=>za,Readonly:()=>Ua,ReadonlyOptional:()=>Gc,Record:()=>il,Recursive:()=>pd,Ref:()=>yo,RegExp:()=>md,Required:()=>Nu,Rest:()=>gd,ReturnType:()=>_d,String:()=>na,Symbol:()=>Qo,TemplateLiteral:()=>fa,Transform:()=>bd,Tuple:()=>qa,Uint8Array:()=>es,Uncapitalize:()=>Bl,Undefined:()=>$o,Union:()=>Ti,Unknown:()=>ts,Unsafe:()=>xd,Uppercase:()=>Vl,Void:()=>Sd}),Cd=K.String({pattern:`^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:(?:0|[1-9][0-9]*)|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$`}),wd=K.Union([K.Literal(`current`),K.Literal(`available`),K.Literal(`restart-required`),K.Literal(`check-failed`)]),Td=K.Object({appVersion:Cd,codexVersion:Cd,latestVersion:K.Union([Cd,K.Null()]),releaseNotes:K.Union([K.String({maxLength:32768}),K.Null()]),status:wd,updateAvailable:K.Boolean()},{additionalProperties:!1});K.Object({version:Cd},{additionalProperties:!1});var Ed=K.Object({appVersion:Cd,codexVersion:Cd,latestVersion:Cd,releaseNotes:K.Null(),status:K.Literal(`restart-required`),updateAvailable:K.Literal(!1)},{additionalProperties:!1}),Dd=K.Union([K.Literal(`local`),K.Literal(`lan`)]),Od=K.Object({authenticated:K.Boolean(),mode:Dd,version:K.Literal(1)},{additionalProperties:!1});K.Object({code:K.String({minLength:1})},{additionalProperties:!1});var kd=K.String({maxLength:32768,minLength:1,pattern:`^(?!.*[\\u0000\\r\\n])(?:/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+).*$`}),Ad=K.String({maxLength:64,minLength:1}),jd=K.Object({path:kd},{additionalProperties:!1}),Md=K.Object({id:Ad,path:kd},{additionalProperties:!1}),Nd=K.Readonly(K.Array(Md,{minItems:1,uniqueItems:!0})),Pd=K.Readonly(K.Array(jd,{minItems:1,uniqueItems:!0}));K.Object({rootPath:kd},{additionalProperties:!1}),Zr(`date-time`)||Qr(`date-time`,e=>!Number.isNaN(Date.parse(e)));var Fd=K.String({format:`date-time`}),Id=K.Union([Fd,K.Null()]),Ld=K.String({minLength:1,pattern:`^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*//)(?!.*\\\\)(?!.*\\/$).+$`}),Rd=K.String({maxLength:128,minLength:1,pattern:`^[A-Za-z0-9._:-]+$`});K.Object({query:K.String({maxLength:256}),rootPath:K.Optional(kd),sessionId:Rd},{additionalProperties:!1});var zd=K.Object({name:K.String({minLength:1}),path:Ld,rootId:Ad,rootPath:kd},{additionalProperties:!1}),Bd=K.Object({data:K.Array(zd,{maxItems:50})},{additionalProperties:!1});K.Object({rootPath:K.Optional(kd),sessionId:Rd},{additionalProperties:!1});var Vd=K.Object({},{additionalProperties:!1}),Hd=K.String({maxLength:32768,minLength:1,pattern:`^[^\\u0000\\r\\n]+$`}),Ud=K.Object({createdAt:Fd,id:K.String({minLength:1}),name:K.String({minLength:1}),roots:Nd},{additionalProperties:!1}),Wd=kd;K.Object({includeHidden:K.Optional(K.Boolean()),path:K.Optional(Wd)},{additionalProperties:!1});var Gd=K.Object({name:K.String({minLength:1}),path:Wd},{additionalProperties:!1}),Kd=K.Object({name:K.String({minLength:1}),path:Wd},{additionalProperties:!1}),qd=K.Object({entries:K.Array(Gd),parentPath:K.Union([Wd,K.Null()]),path:Wd,roots:K.Array(Kd)},{additionalProperties:!1}),Jd=K.Union([K.Literal(`file`),K.Literal(`image`)]);K.Object({includeHidden:K.Optional(K.Boolean()),kind:Jd,path:K.Optional(Wd)},{additionalProperties:!1});var Yd=K.Object({name:K.String({minLength:1}),path:Wd,type:K.Union([K.Literal(`directory`),K.Literal(`file`)])},{additionalProperties:!1}),Xd=K.Object({entries:K.Array(Yd),parentPath:K.Union([Wd,K.Null()]),path:Wd,roots:K.Array(Kd)},{additionalProperties:!1});K.Object({path:Wd},{additionalProperties:!1}),K.Object({roots:Pd},{additionalProperties:!1});var Zd=K.Object({project:Ud},{additionalProperties:!1}),Qd=K.Union([K.Literal(`visual-studio-code`),K.Literal(`system-default`),K.Literal(`zed`),K.Literal(`windsurf`),K.Literal(`finder`),K.Literal(`terminal`),K.Literal(`ghostty`),K.Literal(`xcode`),K.Literal(`android-studio`),K.Literal(`file-manager`),K.Literal(`gnome-terminal`),K.Literal(`konsole`),K.Literal(`xfce-terminal`),K.Literal(`explorer`),K.Literal(`windows-terminal`),K.Literal(`command-prompt`)]),$d=K.Union([K.Literal(`editor`),K.Literal(`file-manager`),K.Literal(`system-default`),K.Literal(`terminal`),K.Literal(`tool`)]),ef=K.Object({id:Qd,kind:$d,name:K.String({minLength:1})},{additionalProperties:!1}),tf=K.Union([K.Literal(`darwin`),K.Literal(`linux`),K.Literal(`win32`)]),nf=K.Object({apps:K.Array(ef,{uniqueItems:!0}),platform:tf},{additionalProperties:!1});K.Object({appId:Qd,path:K.Optional(Hd)},{additionalProperties:!1});var rf=K.Object({appId:Qd,path:K.Optional(Hd)},{additionalProperties:!1});K.Object({projectIds:K.Array(K.String({minLength:1}),{minItems:1,uniqueItems:!0})},{additionalProperties:!1}),K.Object({name:K.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var af=K.Object({project:Ud},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var of=K.Object({projectId:K.String({minLength:1}),status:K.Literal(`removed`)},{additionalProperties:!1}),sf=K.Object({id:K.String({minLength:1}),pinned:K.Boolean(),projectId:K.String({minLength:1}),title:K.String({minLength:1}),updatedAt:Fd},{additionalProperties:!1}),cf=K.Union([K.Literal(`pending`),K.Literal(`running`),K.Literal(`completed`),K.Literal(`failed`),K.Literal(`declined`),K.Literal(`interrupted`)]),lf=K.Object({branch:K.Optional(K.String({minLength:1})),instructions:K.Optional(K.String({minLength:1})),sha:K.Optional(K.String({minLength:1})),title:K.Optional(K.String({minLength:1})),type:K.Union([K.Literal(`uncommitted_changes`),K.Literal(`base_branch`),K.Literal(`commit`),K.Literal(`custom`)])},{additionalProperties:!1}),uf=K.Intersect([lf,K.Union([K.Object({type:K.Literal(`uncommitted_changes`)}),K.Object({branch:K.String({minLength:1}),type:K.Literal(`base_branch`)}),K.Object({sha:K.String({minLength:1}),type:K.Literal(`commit`)}),K.Object({instructions:K.String({minLength:1}),type:K.Literal(`custom`)})])]),df=50*1024*1024,ff=50*1024*1024,pf=10*1024*1024,mf=50*1024*1024,hf=Math.max(df,pf),gf=1500,_f=512*1024*1024,vf=`.png,.jpg,.jpeg,.webp,.gif`,yf=`.asm,.astro,.awk,.bash,.bat,.c,.cc,.conf,.cs,.cpp,.css,.csv,.cxx,.def,.dic,.diff,.doc,.docx,.dot,.eml,.ejs,.ex,.exs,.go,.gradle,.graphql,.groovy,.h,.hh,.htm,.html,.hbs,.hcl,.hs,.ics,.ifb,.iif,.in,.ini,.jade,.java,.jinja2,.jl,.js,.jsx,.json,.json5,.kt,.kts,.ksh,.list,.liquid,.lua,.log,.markdown,.md,.mht,.mhtml,.mime,.mjs,.nws,.ndjson,.odt,.pdf,.pl,.patch,.php,.pot,.ppa,.pps,.ppt,.pptx,.pwz,.py,.properties,.proto,.ps1,.pug,.r,.rb,.rst,.rtf,.rs,.s,.sass,.scala,.scss,.sh,.sql,.srt,.text,.tex,.tf,.tmpl,.toml,.ts,.tsx,.tsv,.txt,.vcf,.vtt,.vbs,.wiz,.xla,.xlb,.xlc,.xlm,.xls,.xlsx,.xlt,.xlw,.xml,.yaml,.yml,.zsh`.split(`,`),bf=`application/csv,application/graphql,application/javascript,application/json,application/msword,application/pdf,application/rtf,application/toml,application/typescript,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/x-httpd-php,application/x-iif,application/x-ndjson,application/x-patch,application/x-protobuf,application/x-rust,application/x-shellscript,application/x-sql,application/x-toml,application/x-typescript,application/x-yaml,application/yaml,message/rfc822,text/calendar,text/csv,text/css,text/html,text/javascript,text/jsx,text/markdown,text/plain,text/rtf,text/tsx,text/tsv,text/vtt,text/x-c,text/x-c++,text/x-csharp,text/x-diff,text/x-go,text/x-java,text/x-makefile,text/x-python,text/x-rst,text/x-rust,text/x-shellscript,text/x-sql,text/x-typescript,text/x-yaml,text/xml`.split(`,`),xf=[...yf,...bf].join(`,`);K.Union([K.Literal(`image/gif`),K.Literal(`image/jpeg`),K.Literal(`image/png`),K.Literal(`image/webp`)]);var Sf=K.String({maxLength:255,minLength:1}),Cf=K.Union([K.Literal(`file`),K.Literal(`image`),K.Literal(`text`)]),wf=K.Object({name:K.String({minLength:1})},{additionalProperties:!1});function Tf(e,t){let n=new Set(t.map(e=>e.name)),r=e,i=!1;for(;r.length>0;){let e=/^\s*\$([^\s$]+)/u.exec(r),t=e?.[1];if(e===null||t===void 0||!n.has(t))break;r=r.slice(e[0].length),i=!0}return i?r.trimStart():e}var Ef=K.Object({id:K.String({minLength:1}),kind:Cf,mediaType:Sf,name:K.String({maxLength:255,minLength:1}),size:K.Integer({maximum:_f,minimum:1})},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var Df=K.Object({attachmentId:K.String({minLength:1}),status:K.Literal(`opened`)},{additionalProperties:!1}),Of=K.Union([K.Literal(`commentary`),K.Literal(`final_answer`)]),kf=K.Object({attachments:K.Optional(K.Array(Ef,{maxItems:gf})),id:K.String({minLength:1}),phase:K.Optional(Of),role:K.Union([K.Literal(`user`),K.Literal(`assistant`)]),skills:K.Optional(K.Array(wf)),text:K.String(),type:K.Literal(`message`)},{additionalProperties:!1}),Af=K.Object({content:K.String(),id:K.String({minLength:1}),summary:K.String(),type:K.Literal(`reasoning`)},{additionalProperties:!1}),jf=K.Object({command:K.String(),cwd:K.String(),exitCode:K.Optional(K.Integer()),id:K.String({minLength:1}),output:K.Optional(K.String()),outputTruncated:K.Boolean(),status:cf,type:K.Literal(`command`)},{additionalProperties:!1}),Mf=K.Object({command:K.String({minLength:1}),cwd:K.String({minLength:1}),id:K.String({minLength:1}),itemId:K.String({minLength:1})},{additionalProperties:!1}),Nf=K.Object({data:K.Array(Mf)},{additionalProperties:!1}),Pf=K.Object({status:K.Literal(`terminated`),terminalId:K.String({minLength:1})},{additionalProperties:!1}),Ff=K.Union([K.String(),K.Null()]),If=K.Union([K.Number(),K.Null()]),Lf={description:Ff,id:K.String({minLength:1}),required:K.Boolean(),title:K.String({minLength:1})},Rf=K.Object({label:K.String({minLength:1}),value:K.String()},{additionalProperties:!1}),zf=K.Union([K.Object({...Lf,defaultValue:K.Union([K.String(),K.Null()]),format:K.Union([K.Literal(`email`),K.Literal(`uri`),K.Literal(`date`),K.Literal(`date-time`),K.Null()]),maxLength:K.Union([K.Integer({minimum:0}),K.Null()]),minLength:K.Union([K.Integer({minimum:0}),K.Null()]),type:K.Literal(`string`)},{additionalProperties:!1}),K.Object({...Lf,defaultValue:K.Union([K.String(),K.Null()]),options:K.Array(Rf,{minItems:1}),type:K.Literal(`select`)},{additionalProperties:!1}),K.Object({...Lf,defaultValue:K.Array(K.String()),maximum:K.Union([K.Integer({minimum:0}),K.Null()]),minimum:K.Union([K.Integer({minimum:0}),K.Null()]),options:K.Array(Rf,{minItems:1}),type:K.Literal(`multi_select`)},{additionalProperties:!1}),K.Object({...Lf,defaultValue:If,maximum:If,minimum:If,type:K.Union([K.Literal(`number`),K.Literal(`integer`)])},{additionalProperties:!1}),K.Object({...Lf,defaultValue:K.Union([K.Boolean(),K.Null()]),type:K.Literal(`boolean`)},{additionalProperties:!1})]),Bf=K.Record(K.String(),K.Union([K.String(),K.Number(),K.Boolean(),K.Array(K.String())])),Vf=K.Union([K.Object({action:K.Literal(`accept`),content:Bf},{additionalProperties:!1}),K.Object({action:K.Union([K.Literal(`decline`),K.Literal(`cancel`)]),content:K.Null()},{additionalProperties:!1})]),Hf=K.Union([K.Literal(`pending`),K.Literal(`resolved`),K.Literal(`expired`)]),Uf=K.Union([K.Literal(`allow`),K.Literal(`allow_for_session`),K.Literal(`deny`)]),Wf=K.Object({host:K.String({minLength:1}),protocol:K.Union([K.Literal(`http`),K.Literal(`https`),K.Literal(`socks5Tcp`),K.Literal(`socks5Udp`)])},{additionalProperties:!1}),Gf={createdAt:Fd,expiresAt:Id,itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),requestId:K.String({minLength:1}),status:Hf,taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},Kf={itemId:K.String({minLength:1}),projectId:K.String({minLength:1}),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},qf=K.Object({description:K.String(),label:K.String({minLength:1})},{additionalProperties:!1}),Jf={header:K.String({minLength:1}),id:K.String({minLength:1}),isSecret:K.Boolean(),prompt:K.String({minLength:1})},Yf=K.Union([K.Object({...Jf,isOther:K.Boolean(),options:K.Array(qf,{minItems:1}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Literal(!0),options:K.Array(qf,{maxItems:0}),type:K.Literal(`choice`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Literal(!1),options:K.Array(qf,{maxItems:2,minItems:2}),type:K.Literal(`confirmation`)},{additionalProperties:!1}),K.Object({...Jf,isOther:K.Boolean(),options:K.Array(qf,{maxItems:0}),type:K.Literal(`short_text`)},{additionalProperties:!1})]),Xf=K.Object({...Gf,availableDecisions:K.Array(Uf,{minItems:1}),grantRoot:K.Union([K.String(),K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),Zf=K.Union([K.Literal(`network`),K.Literal(`file_system`)]),Qf=K.Union([K.Literal(`read`),K.Literal(`write`),K.Literal(`deny`)]),$f=K.Union([K.Object({type:K.Literal(`path`),value:K.String({minLength:1})},{additionalProperties:!1}),K.Object({type:K.Literal(`glob`),value:K.String({minLength:1})},{additionalProperties:!1}),K.Object({kind:K.Union([K.Literal(`root`),K.Literal(`minimal`),K.Literal(`project_roots`),K.Literal(`tmpdir`),K.Literal(`slash_tmp`),K.Literal(`unknown`)]),path:K.Union([K.String({minLength:1}),K.Null()]),subpath:K.Union([K.String(),K.Null()]),type:K.Literal(`special`)},{additionalProperties:!1})]),ep=K.Object({entries:K.Array(K.Object({access:Qf,path:$f},{additionalProperties:!1})),globScanMaxDepth:K.Union([K.Integer({minimum:0}),K.Null()]),read:K.Union([K.Array(K.String({minLength:1})),K.Null()]),write:K.Union([K.Array(K.String({minLength:1})),K.Null()])},{additionalProperties:!1}),tp=K.Object({fileSystem:K.Union([ep,K.Null()]),network:K.Union([K.Object({enabled:K.Union([K.Boolean(),K.Null()])},{additionalProperties:!1}),K.Null()])},{additionalProperties:!1}),np=K.Object({...Gf,additionalPermissions:K.Optional(K.Union([tp,K.Null()])),availableDecisions:K.Array(Uf,{minItems:1}),command:K.Union([K.String(),K.Null()]),cwd:K.Union([K.String(),K.Null()]),networkAccess:K.Union([Wf,K.Null()]),reason:K.Union([K.String(),K.Null()]),type:K.Literal(`command_approval`)},{additionalProperties:!1}),rp=K.Object({...Gf,cwd:K.String({minLength:1}),environmentId:K.Union([K.String({minLength:1}),K.Null()]),permissions:tp,reason:K.Union([K.String(),K.Null()]),type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),ip=K.Object({...Gf,questions:K.Array(Yf,{minItems:1,maxItems:3}),type:K.Literal(`user_input`)},{additionalProperties:!1}),ap={...Gf,message:K.String({minLength:1}),serverName:K.String({minLength:1}),type:K.Literal(`mcp_elicitation`)},op=K.Object({...ap,fields:K.Array(zf),mode:K.Literal(`form`)},{additionalProperties:!1}),sp=K.Object({...ap,mode:K.Literal(`url`),url:K.String({minLength:1})},{additionalProperties:!1}),cp=K.Object({...ap,mode:K.Literal(`unsupported`)},{additionalProperties:!1}),lp=K.Union([op,sp,cp]),up=K.Union([np,Xf,rp,ip,lp]);function dp(e){return K.Union([K.Object({...np.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...Xf.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...rp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...ip.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...op.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...sp.properties,status:K.Literal(e)},{additionalProperties:!1}),K.Object({...cp.properties,status:K.Literal(e)},{additionalProperties:!1})])}var fp=dp(`pending`),pp=dp(`resolved`),mp=dp(`expired`),hp=K.Object({decision:Uf},{additionalProperties:!1}),gp=K.Object({answers:K.Record(K.String(),K.Array(K.String({minLength:1}),{maxItems:1,minItems:1}))},{additionalProperties:!1}),_p=K.Object({grantedPermissions:K.Array(Zf,{maxItems:2,uniqueItems:!0}),scope:K.Union([K.Literal(`turn`),K.Literal(`session`)])},{additionalProperties:!1});K.Union([K.Object({...Kf,resolution:hp,type:K.Literal(`command_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:hp,type:K.Literal(`file_change_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:_p,type:K.Literal(`permissions_approval`)},{additionalProperties:!1}),K.Object({...Kf,resolution:gp,type:K.Literal(`user_input`)},{additionalProperties:!1}),K.Object({...Kf,resolution:Vf,type:K.Literal(`mcp_elicitation`)},{additionalProperties:!1})]);var vp=K.Object({request:up},{additionalProperties:!1}),yp=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:K.String({minLength:1})},{additionalProperties:!1}),bp=K.String({maxLength:64,minLength:64,pattern:`^[a-f0-9]{64}$`}),xp=K.String({maxLength:1024,minLength:1,pattern:`\\S`}),Sp=K.String({maxLength:1024,minLength:1,pattern:`^(?!\\.{1,2}$)(?!.*[\\u0000\\r\\n])[^/\\\\]+$`}),Cp=K.Array(Ld,{maxItems:500,minItems:1,uniqueItems:!0}),wp=K.String({maxLength:1e4,minLength:1,pattern:`\\S`}),Tp=K.Object({diff:K.String(),kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Ep=K.Object({baseBranches:K.Array(K.String({minLength:1}),{uniqueItems:!0}),branch:K.Union([K.String({minLength:1}),K.Null()]),branches:K.Array(xp,{uniqueItems:!0}),repositoryMode:K.Union([K.Literal(`root`),K.Literal(`children`),K.Literal(`none`)]),snapshot:bp,staged:K.Array(Tp),unstaged:K.Array(Tp)},{additionalProperties:!1});K.Object({includeDiff:K.Optional(K.Boolean()),repository:K.Optional(Sp),rootPath:kd},{additionalProperties:!1});var Dp=K.Object({authoredAt:K.String({format:`date-time`}),authorEmail:K.String({maxLength:320,minLength:1}),authorName:K.String({maxLength:512,minLength:1,pattern:`\\S`}),sha:K.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),title:K.String({maxLength:1e4,minLength:1,pattern:`\\S`})},{additionalProperties:!1}),Op=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(Op),repository:K.Optional(Ld),rootPath:kd},{additionalProperties:!1});var kp=K.Object({branch:K.Union([xp,K.Null()]),commits:K.Array(Dp,{maxItems:20}),nextCursor:K.Union([Op,K.Null()]),repositories:K.Array(Ld,{maxItems:256,uniqueItems:!0}),repository:K.Union([Ld,K.Null()]),repositoryMode:K.Union([K.Literal(`root`),K.Literal(`children`)])},{additionalProperties:!1}),Ap=K.String({maxLength:64,minLength:40,pattern:`^[a-f0-9]+$`}),jp=K.String({maxLength:20,minLength:1,pattern:`^[0-9]+$`});K.Object({cursor:K.Optional(jp),repository:K.Optional(Ld),rootPath:kd,sha:Ap},{additionalProperties:!1});var Mp=K.Object({kind:K.Union([K.Literal(`create`),K.Literal(`update`),K.Literal(`delete`)]),path:Ld},{additionalProperties:!1}),Np=K.Object({files:K.Array(Mp,{maxItems:100}),nextCursor:K.Union([jp,K.Null()])},{additionalProperties:!1});K.Object({path:Ld,repository:K.Optional(Ld),rootPath:kd,sha:Ap},{additionalProperties:!1});var Pp=K.Object({diff:K.String({maxLength:512*1024}),truncated:K.Boolean()},{additionalProperties:!1});K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1}),K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1});var Fp=K.Object({branch:K.Union([xp,K.Null()]),current:K.Boolean(),path:Wd},{additionalProperties:!1}),Ip=K.Object({worktrees:K.Array(Fp,{maxItems:256})},{additionalProperties:!1});K.Object({branch:xp,expectedSnapshot:bp},{additionalProperties:!1}),K.Object({path:Wd},{additionalProperties:!1});var Lp=K.Object({project:Ud,worktree:Fp},{additionalProperties:!1});K.Object({expectedSnapshot:bp,paths:Cp,repository:K.Optional(Sp)},{additionalProperties:!1});var Rp=K.Object({message:wp,snapshot:bp},{additionalProperties:!1});K.Object({action:K.Union([K.Literal(`commit`),K.Literal(`commit_and_push`)]),expectedSnapshot:bp,message:wp,paths:Cp,repository:K.Optional(Sp)},{additionalProperties:!1});var zp=K.Object({branch:K.Union([K.String({minLength:1}),K.Null()]),commitSha:K.String({maxLength:64,minLength:7,pattern:`^[a-f0-9]+$`}),message:wp,pushError:K.Union([K.String({minLength:1}),K.Null()]),pushStatus:K.Union([K.Literal(`not_requested`),K.Literal(`pushed`),K.Literal(`failed`),K.Literal(`not_configured`)])},{additionalProperties:!1}),Bp=K.Object({path:Ld,type:K.Union([K.Literal(`directory`),K.Literal(`file`)])},{additionalProperties:!1});K.Object({path:K.Optional(Ld),rootPath:K.Optional(kd)},{additionalProperties:!1});var Vp=K.Object({entries:K.Array(Bp),path:K.Union([Ld,K.Null()])},{additionalProperties:!1});K.Object({cursor:K.Optional(K.Integer({minimum:0})),path:Hd,rootPath:K.Optional(kd)},{additionalProperties:!1});var Hp=K.Object({content:K.String(),nextCursor:K.Union([K.Integer({minimum:0}),K.Null()]),path:Hd},{additionalProperties:!1}),Up=K.Object({changes:K.Array(yp),id:K.String({minLength:1}),status:cf,type:K.Literal(`file_change`)},{additionalProperties:!1}),Wp=K.Object({id:K.String({minLength:1}),input:K.Optional(K.Unknown()),name:K.String({minLength:1}),output:K.Optional(K.Unknown()),progress:K.Optional(K.String({maxLength:8192})),status:cf,type:K.Literal(`tool`)},{additionalProperties:!1}),Gp=K.Object({fasterModel:K.Optional(K.String({minLength:1})),id:K.String({minLength:1}),kind:K.Literal(`safety_buffering`),model:K.String({minLength:1}),status:cf,type:K.Literal(`runtime_status`)},{additionalProperties:!1}),Kp=K.Object({fromModel:K.String({minLength:1}),id:K.String({minLength:1}),kind:K.Literal(`model_rerouted`),status:K.Literal(`completed`),toModel:K.String({minLength:1}),type:K.Literal(`runtime_status`)},{additionalProperties:!1}),qp=K.Object({detail:K.Optional(K.String({maxLength:8192})),durationMs:K.Optional(K.Integer({minimum:0})),eventName:K.String({minLength:1}),id:K.String({minLength:1}),kind:K.Literal(`hook`),status:cf,type:K.Literal(`runtime_status`)},{additionalProperties:!1}),Jp=K.Union([Gp,Kp,qp]),Yp=K.Object({id:K.String({minLength:1}),text:K.String(),type:K.Literal(`plan`)},{additionalProperties:!1}),Xp=K.Object({detail:K.Optional(K.String()),id:K.String({minLength:1}),label:K.String({minLength:1}),status:K.Optional(cf),transient:K.Optional(K.Boolean()),type:K.Literal(`activity`)},{additionalProperties:!1}),Zp=K.Union([K.Literal(`in_progress`),K.Literal(`approved`),K.Literal(`denied`),K.Literal(`timed_out`),K.Literal(`aborted`)]),Qp=K.Object({detail:K.String(),type:K.Union([K.Literal(`command`),K.Literal(`file_change`),K.Literal(`network_access`),K.Literal(`mcp_tool_call`),K.Literal(`permissions`)])},{additionalProperties:!1}),$p=K.Object({action:Qp,id:K.String({minLength:1}),rationale:K.Optional(K.String()),riskLevel:K.Optional(K.Union([K.Literal(`low`),K.Literal(`medium`),K.Literal(`high`),K.Literal(`critical`)])),status:Zp,targetItemId:K.Optional(K.String({minLength:1})),type:K.Literal(`approval_review`),userAuthorization:K.Optional(K.Union([K.Literal(`unknown`),K.Literal(`low`),K.Literal(`medium`),K.Literal(`high`)]))},{additionalProperties:!1}),em=K.Union([K.Object({type:K.Literal(`uncommitted_changes`)},{additionalProperties:!1}),K.Object({branch:K.String({minLength:1}),type:K.Literal(`base_branch`)},{additionalProperties:!1}),K.Object({sha:K.String({minLength:1}),title:K.Optional(K.String({minLength:1})),type:K.Literal(`commit`)},{additionalProperties:!1}),K.Object({instructions:K.String({minLength:1}),type:K.Literal(`custom`)},{additionalProperties:!1})]),tm=K.Object({id:K.String({minLength:1}),target:em,type:K.Literal(`review`)},{additionalProperties:!1}),nm=K.Union([kf,Af,jf,Up,Wp,Yp,Xp,$p,tm,Jp]),rm=K.Union([K.Literal(`running`),K.Literal(`completed`),K.Literal(`failed`),K.Literal(`interrupted`)]),im=K.Object({completedAt:Id,error:K.Union([K.String(),K.Null()]),id:K.String({minLength:1}),items:K.Array(nm),startedAt:Id,status:rm},{additionalProperties:!1}),am=K.Object({id:K.String({minLength:1}),kind:Cf,mediaType:Sf,name:K.String({maxLength:255,minLength:1}),size:K.Integer({maximum:hf,minimum:1})},{additionalProperties:!1}),om=K.Object({attachment:am},{additionalProperties:!1}),sm=K.Union([K.Literal(`user`),K.Literal(`repo`),K.Literal(`system`),K.Literal(`admin`)]),cm=K.Object({description:K.String(),displayName:K.String({minLength:1}),id:K.String({minLength:1}),name:K.String({minLength:1}),scope:sm},{additionalProperties:!1}),lm=K.Union([K.Literal(`starting`),K.Literal(`ready`),K.Literal(`failed`),K.Literal(`cancelled`)]),um=K.Union([K.Literal(`unknown`),K.Literal(`unsupported`),K.Literal(`notLoggedIn`),K.Literal(`bearerToken`),K.Literal(`oAuth`)]),dm=K.Literal(`reauthenticationRequired`),fm=K.Object({authStatus:K.Union([um,K.Null()]),description:K.Union([K.String(),K.Null()]),error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([dm,K.Null()]),name:K.String({minLength:1}),status:lm,title:K.Union([K.String(),K.Null()]),toolCount:K.Integer({minimum:0}),version:K.Union([K.String(),K.Null()])},{additionalProperties:!1}),pm=K.Object({data:K.Array(fm,{uniqueItems:!0})},{additionalProperties:!1}),mm=K.Object({id:K.String({minLength:1}),name:K.String({minLength:1})},{additionalProperties:!1}),hm=K.Object({id:K.String({minLength:1})},{additionalProperties:!1}),gm={attachments:K.Array(hm),skills:K.Array(mm),text:K.String({maxLength:1e5}),type:K.Literal(`prompt`)},_m=K.Union([K.Object({...gm,text:K.String({maxLength:1e5,minLength:1})},{additionalProperties:!1}),K.Object({...gm,attachments:K.Array(hm,{minItems:1})},{additionalProperties:!1}),K.Object({...gm,skills:K.Array(mm,{minItems:1})},{additionalProperties:!1})]),vm=K.Object({attachments:K.Array(Ef,{maxItems:gf}),clientUserMessageId:K.String({minLength:1}),id:K.String({minLength:1}),skills:K.Array(mm),text:K.String({maxLength:1e5})},{additionalProperties:!1}),ym=K.Object({data:K.Array(vm),nextCursor:K.Union([K.String({minLength:1}),K.Null()])},{additionalProperties:!1}),bm=`gpt-5.6-luna`,xm=K.Object({mcp_elicitations:K.Boolean(),request_permissions:K.Boolean(),rules:K.Boolean(),sandbox_approval:K.Boolean(),skill_approval:K.Boolean()},{additionalProperties:!1}),Sm=K.Object({granular:xm},{additionalProperties:!1}),Cm=K.Union([K.Literal(`on-request`),Sm,K.Literal(`never`)]),wm=K.Union([K.Literal(`untrusted`),K.Literal(`on-request`),Sm,K.Literal(`never`)]),Tm=K.Union([K.Literal(`user`),K.Literal(`auto_review`)]),Em=K.Union([K.Literal(`read-only`),K.Literal(`workspace-write`),K.Literal(`danger-full-access`)]),Dm={model:K.String({minLength:1}),reasoningEffort:K.String({minLength:1}),sandboxMode:Em},Om=K.Object({approvalPolicy:wm,approvalsReviewer:Tm,...Dm},{additionalProperties:!1}),km=K.Literal(`plan`),Am={commitMessageModel:K.String({minLength:1}),commitMessagePrompt:K.String({maxLength:4e3}),defaultOpenAppId:K.Union([K.Exclude(Qd,K.Literal(`system-default`)),K.Null()]),fastMode:K.Boolean(),followUpBehavior:K.Union([K.Literal(`queue`),K.Literal(`steer`)]),...Dm},jm=K.Object({approvalPolicy:Cm,approvalsReviewer:Tm,...Am},{additionalProperties:!1}),Mm=K.Object({settings:jm},{additionalProperties:!1}),Nm=K.Object({approvalPolicy:wm,approvalsReviewer:Tm,fastMode:K.Boolean(),...Dm},{additionalProperties:!1}),Pm=K.Object({settings:Nm},{additionalProperties:!1}),Fm=K.Object({settings:Om},{additionalProperties:!1}),Im={collaborationMode:K.Optional(km),fastMode:K.Optional(K.Literal(!0)),goalMode:K.Optional(K.Literal(!0)),...Dm},Lm=K.Object({approvalPolicy:wm,approvalsReviewer:Tm,...Im},{additionalProperties:!1}),Rm=K.Object({description:K.String(),id:K.String({minLength:1})},{additionalProperties:!1}),zm=K.Object({defaultReasoningEffort:K.String({minLength:1}),description:K.String(),displayName:K.String({minLength:1}),id:K.String({minLength:1}),isDefault:K.Boolean(),supportedReasoningEfforts:K.Array(Rm,{minItems:1})},{additionalProperties:!1}),Bm=K.Object({contextWindow:K.Union([K.Integer({minimum:1}),K.Null()]),usedTokens:K.Integer({minimum:0})},{additionalProperties:!1}),Vm=`temporary`,Hm=`/v1/temporary`,Um=K.Union([K.Literal(`pending`),K.Literal(`in_progress`),K.Literal(`completed`)]),Wm=K.Object({status:Um,text:K.String({minLength:1})},{additionalProperties:!1}),Gm=K.Object({explanation:K.Union([K.String(),K.Null()]),steps:K.Array(Wm)},{additionalProperties:!1}),Km=K.Object({contextUsage:K.Union([Bm,K.Null()]),id:K.String({minLength:1}),plan:K.Union([Gm,K.Null()]),pendingRequests:K.Array(fp),pinned:K.Boolean(),projectId:K.String({minLength:1}),settings:Om,status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)]),title:K.String({minLength:1}),turns:K.Array(im),turnsNextCursor:K.Union([K.String({minLength:1}),K.Null()]),updatedAt:Fd},{additionalProperties:!1});function qm(e){return K.Object({data:K.Array(e),nextCursor:K.Union([K.String(),K.Null()])},{additionalProperties:!1})}var Jm=qm(Ud),Ym=Jm,Xm=qm(sf),Zm=qm(zm),Qm=qm(cm),$m=K.Object({status:K.Literal(`ok`),version:K.Literal(1)},{additionalProperties:!1}),eh=K.Object({feedback:K.Object({upload:K.Boolean()},{additionalProperties:!1}),provider:K.String({minLength:1}),skills:K.Object({list:K.Boolean(),use:K.Boolean()},{additionalProperties:!1}),tasks:K.Object({fork:K.Boolean(),list:K.Boolean(),read:K.Boolean(),start:K.Boolean()},{additionalProperties:!1}),turns:K.Object({compact:K.Boolean(),interrupt:K.Boolean(),review:K.Boolean(),start:K.Boolean(),steer:K.Boolean()},{additionalProperties:!1})},{additionalProperties:!1}),th=K.Union([K.Literal(`official`),K.Literal(`custom`)]),nh=K.Union([K.Literal(`disconnected`),K.Literal(`pending`),K.Literal(`connected`),K.Literal(`failed`)]),rh=K.Union([K.Object({email:K.Union([K.String({maxLength:320}),K.Null()]),planType:K.Union([K.String({maxLength:64}),K.Null()]),type:K.Literal(`chatgpt`)},{additionalProperties:!1}),K.Object({type:K.Literal(`apiKey`)},{additionalProperties:!1})]),ih=K.Object({error:K.Union([K.String({maxLength:1e3}),K.Null()]),loginId:K.String({maxLength:256,minLength:1}),state:K.Union([K.Literal(`pending`),K.Literal(`failed`)])},{additionalProperties:!1}),ah=K.Object({account:K.Union([rh,K.Null()]),customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),mode:th,pendingLogin:K.Union([ih,K.Null()]),state:nh},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var oh=K.Object({authUrl:K.String({maxLength:8192,minLength:1}),loginId:K.String({maxLength:256,minLength:1}),status:ah},{additionalProperties:!1});K.Object({apiKey:K.Optional(K.String({maxLength:16384,minLength:1})),baseUrl:K.String({maxLength:2048,minLength:1}),models:K.Optional(K.Array(K.Object({id:K.String({maxLength:256,minLength:1,pattern:`.*\\S.*`}),name:K.String({maxLength:256,minLength:1,pattern:`.*\\S.*`})},{additionalProperties:!1}),{maxItems:1e3}))},{additionalProperties:!1});var sh=K.Object({models:Zm,status:ah},{additionalProperties:!1});K.Object({loginId:K.String({maxLength:256,minLength:1})},{additionalProperties:!1});var ch=K.Object({status:ah},{additionalProperties:!1});K.Object({customBaseUrl:K.Union([K.String({maxLength:2048,minLength:1}),K.Null()]),customModels:K.Union([Zm,K.Null()]),mode:th,updatedAt:Fd},{additionalProperties:!1});function lh(e){return e.mode===`official`&&e.state===`connected`&&e.account?.type===`chatgpt`}K.Object({},{additionalProperties:!1});var uh=K.Object({task:sf},{additionalProperties:!1});K.Object({pinned:K.Boolean()},{additionalProperties:!1});var dh=K.Object({task:sf},{additionalProperties:!1});K.Object({title:K.String({maxLength:200,minLength:1,pattern:`\\S`})},{additionalProperties:!1});var fh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var ph=K.Object({status:K.Literal(`archived`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var mh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var hh=K.Object({status:K.Literal(`deleted`),taskId:K.String({minLength:1})},{additionalProperties:!1}),gh=K.Object({status:K.Union([K.Literal(`busy`),K.Literal(`notLoaded`),K.Literal(`notSubscribed`),K.Literal(`unsubscribed`)]),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({target:uf},{additionalProperties:!1});var _h=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var vh=K.Object({status:K.Literal(`compacting`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({lastTurnId:K.Optional(K.String({minLength:1}))},{additionalProperties:!1});var yh=K.Object({task:sf},{additionalProperties:!1});K.Object({},{additionalProperties:!1});var bh=pm;K.Object({classification:K.String({maxLength:100,minLength:1}),includeLogs:K.Boolean(),reason:K.String({maxLength:4e3,minLength:1})},{additionalProperties:!1});var xh=K.Object({status:K.Literal(`sent`),taskId:K.String({minLength:1})},{additionalProperties:!1});K.Object({input:_m,options:Lm},{additionalProperties:!1});var Sh=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({input:_m,taskId:K.String({minLength:1})},{additionalProperties:!1});var Ch=K.Object({status:K.Literal(`accepted`),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},{additionalProperties:!1});K.Object({clientUserMessageId:K.String({minLength:1}),input:_m},{additionalProperties:!1});var wh=K.Object({queuedSubmission:vm},{additionalProperties:!1});K.Object({input:_m},{additionalProperties:!1});var Th=wh,Eh=K.Object({deleted:K.Boolean()},{additionalProperties:!1});K.Object({queuedSubmissionIds:K.Array(K.String({minLength:1}),{uniqueItems:!0})},{additionalProperties:!1});var Dh=K.Object({status:K.Literal(`reordered`)},{additionalProperties:!1});K.Object({queuedSubmissionId:K.Optional(K.String({minLength:1}))},{additionalProperties:!1});var Oh=K.Object({taskId:K.String({minLength:1}),turn:im},{additionalProperties:!1});K.Object({taskId:K.String({minLength:1})},{additionalProperties:!1});var kh=K.Object({status:K.Literal(`interrupting`),taskId:K.String({minLength:1}),turnId:K.String({minLength:1})},{additionalProperties:!1}),Ah=K.Union([K.Literal(`ACCESS_DENIED`),K.Literal(`IDEMPOTENCY_KEY_REQUIRED`),K.Literal(`IDEMPOTENCY_CONFLICT`),K.Literal(`IDEMPOTENCY_CAPACITY_EXCEEDED`),K.Literal(`INVALID_REQUEST`),K.Literal(`PROJECT_NOT_FOUND`),K.Literal(`TASK_NOT_FOUND`),K.Literal(`TURN_NOT_FOUND`),K.Literal(`TURN_NOT_RUNNING`),K.Literal(`ATTACHMENT_NOT_FOUND`),K.Literal(`PENDING_REQUEST_NOT_FOUND`),K.Literal(`PENDING_REQUEST_EXPIRED`),K.Literal(`PENDING_REQUEST_ALREADY_RESOLVED`),K.Literal(`PENDING_REQUEST_MISMATCH`),K.Literal(`PAIRING_FAILED`),K.Literal(`PAIRING_RATE_LIMITED`),K.Literal(`GIT_STATUS_CHANGED`),K.Literal(`GIT_REPOSITORY_UNAVAILABLE`),K.Literal(`GIT_PATH_UNAVAILABLE`),K.Literal(`GIT_COMMIT_FAILED`),K.Literal(`GIT_BRANCH_ALREADY_ACTIVE`),K.Literal(`GIT_BRANCH_ALREADY_EXISTS`),K.Literal(`GIT_BRANCH_CREATE_FAILED`),K.Literal(`GIT_BRANCH_INVALID`),K.Literal(`GIT_BRANCH_NOT_FOUND`),K.Literal(`GIT_BRANCH_SWITCH_FAILED`),K.Literal(`GIT_WORKTREE_ALREADY_ACTIVE`),K.Literal(`GIT_WORKTREE_CREATE_FAILED`),K.Literal(`GIT_WORKTREE_NOT_FOUND`),K.Literal(`GIT_MUTATION_IN_PROGRESS`),K.Literal(`GIT_REPOSITORY_READ_ONLY`),K.Literal(`COMMIT_MESSAGE_GENERATION_FAILED`),K.Literal(`UPDATE_NOT_AVAILABLE`),K.Literal(`UPDATE_CHECK_FAILED`),K.Literal(`UPDATE_INSTALL_FAILED`),K.Literal(`PROVIDER_ERROR`)]),jh=K.Object({code:Ah,message:K.String({minLength:1}),retryable:K.Boolean()},{additionalProperties:!1}),Mh=K.String({minLength:1}),Nh=K.Integer({minimum:0}),Ph=K.String({format:`date-time`}),Fh={originalByteLength:K.Integer({minimum:0}),truncated:K.Boolean()},Ih={provider:K.String({minLength:1}),sequence:Nh,sessionId:Mh,taskId:K.String({minLength:1}),timestamp:Ph,version:K.Literal(2)};function q(e){return K.Object({...Ih,...e},{additionalProperties:!1})}var Lh=q({payload:K.Object({turn:im},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.started`)}),Rh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`message.delta`)}),zh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String(),field:K.Union([K.Literal(`content`),K.Literal(`summary`)]),sectionIndex:K.Optional(K.Integer({minimum:0}))},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`reasoning.delta`)}),Bh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.delta`)}),Vh=q({itemId:K.String({minLength:1}),payload:K.Object({message:K.String({maxLength:8192})},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`tool.progress`)}),Hh=q({itemId:K.String({minLength:1}),payload:K.Object({changes:K.Array(yp,{maxItems:100}),...Fh},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`file_change.updated`)}),Uh=q({payload:K.Object({code:K.Union([K.Literal(`runtime_warning`),K.Literal(`guardian_warning`),K.Literal(`strict_review_required`),K.Literal(`model_verification`),K.Literal(`hook_status`)]),level:K.Union([K.Literal(`info`),K.Literal(`warning`)]),message:K.String({maxLength:8192,minLength:1})},{additionalProperties:!1}),type:K.Literal(`task.notice`)}),Wh=q({payload:K.Object({error:K.Union([K.String({maxLength:8192}),K.Null()]),failureReason:K.Union([dm,K.Null()]),name:K.String({minLength:1}),status:lm},{additionalProperties:!1}),type:K.Literal(`mcp_server.status_updated`)}),Gh=q({payload:K.Object({status:K.Union([K.Literal(`idle`),K.Literal(`running`),K.Literal(`failed`)])},{additionalProperties:!1}),type:K.Literal(`task.status_updated`)}),Kh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`task.metadata_changed`)}),qh=q({payload:K.Object({reason:K.Union([K.Literal(`archived`),K.Literal(`deleted`)])},{additionalProperties:!1}),type:K.Literal(`task.removed`)}),Jh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`skills.changed`)}),Yh=q({payload:K.Object({},{additionalProperties:!1}),type:K.Literal(`queue.changed`)}),Xh=q({payload:K.Object({rootPath:K.String({minLength:1})},{additionalProperties:!1}),type:K.Literal(`project.git_metadata_changed`)}),Zh=q({itemId:K.String({minLength:1}),payload:K.Object({delta:K.String()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`command.output_delta`)}),Qh=q({itemId:K.String({minLength:1}),payload:K.Object({item:nm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.completed`)}),$h=q({itemId:K.String({minLength:1}),payload:K.Object({item:nm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`item.started`)}),eg=q({payload:K.Object({turn:im},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`turn.completed`)}),tg=q({payload:K.Object({code:K.Optional(K.Union([K.Literal(`context_window_exceeded`),K.Literal(`session_budget_exceeded`),K.Literal(`usage_limit_exceeded`),K.Literal(`server_overloaded`),K.Literal(`policy_blocked`),K.Literal(`connection_failed`),K.Literal(`internal_error`),K.Literal(`unauthorized`),K.Literal(`bad_request`),K.Literal(`sandbox_error`),K.Literal(`other`)])),httpStatusCode:K.Optional(K.Integer({maximum:599,minimum:100})),message:K.String({minLength:1}),willRetry:K.Boolean()},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`provider.error`)}),ng=q({payload:K.Object({usage:Bm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`usage.updated`)}),rg=q({payload:K.Object({plan:Gm},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(`plan.updated`)});function ig(e,t){return q({itemId:K.String({minLength:1}),payload:K.Object({request:t},{additionalProperties:!1}),turnId:K.String({minLength:1}),type:K.Literal(e)})}var ag=ig(`pending_request.created`,fp),og=ig(`pending_request.resolved`,pp),sg=ig(`pending_request.expired`,mp),cg=K.Union([Lh,Rh,zh,Zh,Bh,Vh,Hh,$h,Qh,eg,ng,rg,tg,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,ag,og,sg]),lg=K.Object({events:K.Array(cg,{maxItems:64,minItems:1}),type:K.Literal(`events.batch`),version:K.Literal(3)},{additionalProperties:!1}),ug=K.Object({latestSequence:Nh,sessionId:Mh,type:K.Literal(`connection.ready`),version:K.Literal(3)},{additionalProperties:!1}),dg=K.Object({latestSequence:Nh,reason:K.Union([K.Literal(`event_retention_exceeded`),K.Literal(`session_changed`),K.Literal(`sequence_gap`)]),sessionId:Mh,type:K.Literal(`resync.required`),version:K.Literal(3)},{additionalProperties:!1}),fg=K.Union([ug,dg,lg]),pg=K.Object({sequence:Nh,sessionId:Mh},{additionalProperties:!1}),mg=K.Object({checkpoint:pg,snapshot:Km},{additionalProperties:!1}),hg=class extends Zt{constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function gg(e,t){let n=t.find(t=>t.$id===e.$ref);if(n===void 0)throw new hg(e);return vg(n,t)}function _g(e,t){return!Vt(e.$id)||t.some(t=>t.$id===e.$id)||t.push(e),t}function vg(e,t){return e[M]===`This`||e[M]===`Ref`?gg(e,t):e}var yg=class extends Zt{constructor(e){super(`Unable to hash value`),this.value=e}},bg;(function(e){e[e.Undefined=0]=`Undefined`,e[e.Null=1]=`Null`,e[e.Boolean=2]=`Boolean`,e[e.Number=3]=`Number`,e[e.String=4]=`String`,e[e.Object=5]=`Object`,e[e.Array=6]=`Array`,e[e.Date=7]=`Date`,e[e.Uint8Array=8]=`Uint8Array`,e[e.Symbol=9]=`Symbol`,e[e.BigInt=10]=`BigInt`})(bg||={});var xg=BigInt(`14695981039346656037`),[Sg,Cg]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],wg=Array.from({length:256}).map((e,t)=>BigInt(t)),Tg=new Float64Array(1),Eg=new DataView(Tg.buffer),Dg=new Uint8Array(Tg.buffer);function*Og(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function kg(e){Vg(bg.Array);for(let t of e)Bg(t)}function Ag(e){Vg(bg.Boolean),Vg(+!!e)}function jg(e){Vg(bg.BigInt),Eg.setBigInt64(0,e);for(let e of Dg)Vg(e)}function Mg(e){Vg(bg.Date),Bg(e.getTime())}function Ng(e){Vg(bg.Null)}function Pg(e){Vg(bg.Number),Eg.setFloat64(0,e);for(let e of Dg)Vg(e)}function Fg(e){Vg(bg.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Bg(t),Bg(e[t])}function Ig(e){Vg(bg.String);for(let t=0;t<e.length;t++)for(let n of Og(e.charCodeAt(t)))Vg(n)}function Lg(e){Vg(bg.Symbol),Bg(e.description)}function Rg(e){Vg(bg.Uint8Array);for(let t=0;t<e.length;t++)Vg(e[t])}function zg(e){return Vg(bg.Undefined)}function Bg(e){if(Pt(e))return kg(e);if(Lt(e))return Ag(e);if(Bt(e))return jg(e);if(jt(e))return Mg(e);if(It(e))return Ng(e);if(Rt(e))return Pg(e);if(Nt(e))return Fg(e);if(Vt(e))return Ig(e);if(Ut(e))return Lg(e);if(Mt(e))return Rg(e);if(Ft(e))return zg(e);throw new yg(e)}function Vg(e){xg^=wg[e],xg=xg*Sg%Cg}function Hg(e){return xg=BigInt(`14695981039346656037`),Bg(e),xg}var Ug=class extends Zt{constructor(e){super(`Unknown type`),this.schema=e}};function Wg(e){return e[M]===`Any`||e[M]===`Unknown`}function J(e){return e!==void 0}function Gg(e,t,n){return!0}function Kg(e,t,n){return!0}function qg(e,t,n){if(!Pt(n)||J(e.minItems)&&!(n.length>=e.minItems)||J(e.maxItems)&&!(n.length<=e.maxItems))return!1;for(let r of n)if(!Y(e.items,t,r))return!1;if(e.uniqueItems===!0&&!(function(){let e=new Set;for(let t of n){let n=Hg(t);if(e.has(n))return!1;e.add(n)}return!0})())return!1;if(!(J(e.contains)||Rt(e.minContains)||Rt(e.maxContains)))return!0;let r=J(e.contains)?e.contains:z(),i=n.reduce((e,n)=>Y(r,t,n)?e+1:e,0);return!(i===0||Rt(e.minContains)&&i<e.minContains||Rt(e.maxContains)&&i>e.maxContains)}function Jg(e,t,n){return Ot(n)}function Yg(e,t,n){return!(!Bt(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.minimum)&&!(n>=e.minimum)||J(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function Xg(e,t,n){return Lt(n)}function Zg(e,t,n){return Y(e.returns,t,n.prototype)}function Qg(e,t,n){return!(!jt(n)||J(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||J(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||J(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||J(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||J(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function $g(e,t,n){return Ht(n)}function e_(e,t,n){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Y(i,[...t,...r],n)}function t_(e,t,n){return!(!zt(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.minimum)&&!(n>=e.minimum)||J(e.multipleOf)&&n%e.multipleOf!==0)}function n_(e,t,n){let r=e.allOf.every(e=>Y(e,t,n));if(e.unevaluatedProperties===!1){let t=new RegExp(Io(e)),i=Object.getOwnPropertyNames(n).every(e=>t.test(e));return r&&i}else if(Un(e.unevaluatedProperties)){let i=new RegExp(Io(e)),a=Object.getOwnPropertyNames(n).every(r=>i.test(r)||Y(e.unevaluatedProperties,t,n[r]));return r&&a}else return r}function r_(e,t,n){return kt(n)}function i_(e,t,n){return n===e.const}function a_(e,t,n){return!1}function o_(e,t,n){return!Y(e.not,t,n)}function s_(e,t,n){return It(n)}function c_(e,t,n){return!(!Wt.IsNumberLike(n)||J(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||J(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||J(e.minimum)&&!(n>=e.minimum)||J(e.maximum)&&!(n<=e.maximum)||J(e.multipleOf)&&n%e.multipleOf!==0)}function l_(e,t,n){if(!Wt.IsObjectLike(n)||J(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||J(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let r=Object.getOwnPropertyNames(e.properties);for(let i of r){let r=e.properties[i];if(e.required&&e.required.includes(i)){if(!Y(r,t,n[i])||(jc(r)||Wg(r))&&!(i in n))return!1}else if(Wt.IsExactOptionalProperty(n,i)&&!Y(r,t,n[i]))return!1}if(e.additionalProperties===!1){let t=Object.getOwnPropertyNames(n);return e.required&&e.required.length===r.length&&t.length===r.length?!0:t.every(e=>r.includes(e))}else if(typeof e.additionalProperties==`object`)return Object.getOwnPropertyNames(n).every(i=>r.includes(i)||Y(e.additionalProperties,t,n[i]));else return!0}function u_(e,t,n){return At(n)}function d_(e,t,n){if(!Wt.IsRecordLike(n)||J(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||J(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[r,i]=Object.entries(e.patternProperties)[0],a=new RegExp(r),o=Object.entries(n).every(([e,n])=>!a.test(e)||Y(i,t,n)),s=typeof e.additionalProperties!=`object`||Object.entries(n).every(([n,r])=>a.test(n)?!0:Y(e.additionalProperties,t,r)),c=e.additionalProperties!==!1||Object.getOwnPropertyNames(n).every(e=>a.test(e));return o&&s&&c}function f_(e,t,n){return Y(vg(e,t),t,n)}function p_(e,t,n){let r=new RegExp(e.source,e.flags);return J(e.minLength)&&!(n.length>=e.minLength)||J(e.maxLength)&&!(n.length<=e.maxLength)?!1:r.test(n)}function m_(e,t,n){return!Vt(n)||J(e.minLength)&&!(n.length>=e.minLength)||J(e.maxLength)&&!(n.length<=e.maxLength)||J(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:J(e.format)?Zr(e.format)?$r(e.format)(n):!1:!0}function h_(e,t,n){return Ut(n)}function g_(e,t,n){return Vt(n)&&new RegExp(e.pattern).test(n)}function __(e,t,n){return Y(vg(e,t),t,n)}function v_(e,t,n){if(!Pt(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let r=0;r<e.items.length;r++)if(!Y(e.items[r],t,n[r]))return!1;return!0}function y_(e,t,n){return Ft(n)}function b_(e,t,n){return e.anyOf.some(e=>Y(e,t,n))}function x_(e,t,n){return!(!Mt(n)||J(e.maxByteLength)&&!(n.length<=e.maxByteLength)||J(e.minByteLength)&&!(n.length>=e.minByteLength))}function S_(e,t,n){return!0}function C_(e,t,n){return Wt.IsVoidLike(n)}function w_(e,t,n){return ti(e[M])?ni(e[M])(e,n):!1}function Y(e,t,n){let r=J(e.$id)?_g(e,t):t,i=e;switch(i[M]){case`Any`:return Gg(i,r,n);case`Argument`:return Kg(i,r,n);case`Array`:return qg(i,r,n);case`AsyncIterator`:return Jg(i,r,n);case`BigInt`:return Yg(i,r,n);case`Boolean`:return Xg(i,r,n);case`Constructor`:return Zg(i,r,n);case`Date`:return Qg(i,r,n);case`Function`:return $g(i,r,n);case`Import`:return e_(i,r,n);case`Integer`:return t_(i,r,n);case`Intersect`:return n_(i,r,n);case`Iterator`:return r_(i,r,n);case`Literal`:return i_(i,r,n);case`Never`:return a_(i,r,n);case`Not`:return o_(i,r,n);case`Null`:return s_(i,r,n);case`Number`:return c_(i,r,n);case`Object`:return l_(i,r,n);case`Promise`:return u_(i,r,n);case`Record`:return d_(i,r,n);case`Ref`:return f_(i,r,n);case`RegExp`:return p_(i,r,n);case`String`:return m_(i,r,n);case`Symbol`:return h_(i,r,n);case`TemplateLiteral`:return g_(i,r,n);case`This`:return __(i,r,n);case`Tuple`:return v_(i,r,n);case`Undefined`:return y_(i,r,n);case`Union`:return b_(i,r,n);case`Uint8Array`:return x_(i,r,n);case`Unknown`:return S_(i,r,n);case`Void`:return C_(i,r,n);default:if(!ti(i[M]))throw new Ug(i);return w_(i,r,n)}}function T_(...e){return e.length===3?Y(e[0],e[1],e[2]):Y(e[0],[],e[1])}var E_=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyEventError`}};function D_(e,t,n){let r=t===`temporary`?`${Hm}/events`:`/v1/projects/${encodeURIComponent(t)}/events`,i=e?new URL(`${e}${r}`):new URL(r,globalThis.location.href);return i.protocol=i.protocol===`https:`?`wss:`:`ws:`,i.searchParams.set(`afterSequence`,String(n)),i.toString()}function O_(e,t,n){return{latestSequence:t,reason:n,sessionId:e,type:`resync.required`,version:3}}function k_(e){let t=e.reconnectDelayMs??250,n=!0,r=!0,i=e.afterSequence,a=0,o,s,c,l=t=>{e.onConnectionState?.(t)},u=(e,t)=>{let n=s;n!==void 0&&(c?.(),c=void 0,s=void 0,n.close(e,t))},d=t=>{r=!1,e.onResyncRequired(t),u(1e3,`Snapshot resync required`),l(`closed`)},f=(t,n)=>{r=!1,e.onError?.(new E_(t,n===void 0?void 0:{cause:n})),u(1002,`Invalid Agent Event frame`),l(`closed`)},p=()=>{if(!n)return;o=void 0;let u=!1,m=e.webSocketFactory(D_(e.baseUrl,e.projectId,i));s=m;let h=()=>n&&s===m,g=t=>{if(!h())return;let n;try{n=JSON.parse(String(t.data))}catch(e){f(`Codexly event frame is not valid JSON`,e);return}if(!T_(fg,n)){f(`Codexly event frame does not match the protocol schema`);return}let r=n;if(r.type===`resync.required`){d(r);return}if(r.type===`connection.ready`){if(r.sessionId!==e.sessionId||r.latestSequence<i){d(O_(r.sessionId,r.latestSequence,`session_changed`));return}u=!0,a=0,l(`connected`);return}if(!u){f(`Codexly event arrived before connection.ready`);return}for(let t of r.events){if(t.sessionId!==e.sessionId){d(O_(t.sessionId,t.sequence,`session_changed`));return}if(!(t.sequence<=i)){if(t.sequence!==i+1){d(O_(t.sessionId,t.sequence,`sequence_gap`));return}if(i=t.sequence,e.onEvent(t),!h())return}}},_=()=>{!n||s!==m||e.onError?.(new E_(`Codexly event connection failed`))},v=()=>{if(s!==m||(c?.(),c=void 0,s=void 0,!n))return;if(!r){l(`closed`);return}l(`reconnecting`);let e=Math.min(t*2**a,5e3);a+=1,o=setTimeout(p,e)};c=()=>{m.removeEventListener(`message`,g),m.removeEventListener(`error`,_),m.removeEventListener(`close`,v)},m.addEventListener(`message`,g),m.addEventListener(`error`,_),m.addEventListener(`close`,v)};return l(`connecting`),p(),()=>{n&&(n=!1,r=!1,o!==void 0&&clearTimeout(o),u(1e3,`Subscription cancelled`),l(`closed`))}}var A_=[];for(let e=0;e<256;++e)A_.push((e+256).toString(16).slice(1));function j_(e,t=0){return(A_[e[t+0]]+A_[e[t+1]]+A_[e[t+2]]+A_[e[t+3]]+`-`+A_[e[t+4]]+A_[e[t+5]]+`-`+A_[e[t+6]]+A_[e[t+7]]+`-`+A_[e[t+8]]+A_[e[t+9]]+`-`+A_[e[t+10]]+A_[e[t+11]]+A_[e[t+12]]+A_[e[t+13]]+A_[e[t+14]]+A_[e[t+15]]).toLowerCase()}var M_=new Uint8Array(16);function N_(){return crypto.getRandomValues(M_)}function P_(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():F_(e,t,n)}function F_(e,t,n){e||={};let r=e.random??e.rng?.()??N_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return j_(r)}var I_=15e4,L_=class extends Error{status;constructor(e,t,n){super(n??`Codexly request failed with ${String(e)} ${t}`.trim()),this.name=`CodexlyHttpError`,this.status=e}},R_=class extends L_{code;retryable;constructor(e,t,n){super(e,t,n.message),this.name=`CodexlyMutationError`,this.code=n.code,this.retryable=n.retryable}},z_=class extends Error{constructor(e,t){super(e,t),this.name=`CodexlyResponseError`}};function X(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,String(r));let r=n.toString();return r?`${e}?${r}`:e}function Z(e){return e===`temporary`?Hm:`/v1/projects/${encodeURIComponent(e)}`}function Q(e,t){return`${Z(e)}/tasks/${encodeURIComponent(t)}`}function B_(e,t,n,r){return`${e.replace(/\/$/u,``)}${Q(t,n)}/attachments/${encodeURIComponent(r)}`}function V_(e,t,n,r){let i=X(`${Z(t)}/files/image`,{path:n,rootPath:r});return`${e.replace(/\/$/u,``)}${i}`}function H_(e,t,n){return`${e.replace(/\/$/u,``)}${Z(t)}/attachments/${encodeURIComponent(n)}`}var U_=class{baseUrl;fetchImplementation;requestTimeouts;webSocketFactory;unauthorizedListeners=new Set;constructor(e={}){this.baseUrl=e.baseUrl?.replace(/\/$/u,``)??``,this.fetchImplementation=e.fetch??globalThis.fetch.bind(globalThis),this.requestTimeouts={mutationMs:e.requestTimeouts?.mutationMs??6e4,queryMs:e.requestTimeouts?.queryMs??3e4,readMs:e.requestTimeouts?.readMs??15e3},this.webSocketFactory=e.webSocketFactory??(e=>new WebSocket(e))}async getHealth(e={}){return this.read(`/v1/health`,$m,e)}async getAppInfo(e={}){return this.read(`/v1/app-info`,Td,e)}async installAppUpdate(e,t={}){return this.mutation(`/v1/app-update`,{version:e},Ed,t,`POST`,I_)}async getAccessStatus(e={}){return this.read(`/v1/access`,Od,e)}async pairAccess(e){return this.request(`/v1/access/pair`,Od,{body:JSON.stringify({code:e}),headers:{"content-type":`application/json`},method:`POST`},jh,{timeoutMs:this.requestTimeouts.mutationMs})}async logoutAccess(){return this.request(`/v1/access/logout`,Od,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`},jh,{timeoutMs:this.requestTimeouts.mutationMs})}subscribeUnauthorized(e){return this.unauthorizedListeners.add(e),()=>this.unauthorizedListeners.delete(e)}async getCapabilities(e={}){return this.read(`/v1/capabilities`,eh,e)}async listModels(e={}){return this.read(`/v1/models`,Zm,e)}async getProviderConnection(e={}){return this.read(`/v1/provider-connection`,ah,e)}async startOfficialProviderLogin(e={}){return this.mutation(`/v1/provider-connection/official-login`,{},oh,e)}async cancelProviderLogin(e,t={}){return this.mutation(`/v1/provider-connection/official-login/cancel`,{loginId:e},ch,t)}async configureCustomProvider(e,t={}){return this.mutation(`/v1/provider-connection/custom`,e,sh,t,`PUT`)}async logoutProvider(e={}){return this.mutation(`/v1/provider-connection/logout`,{},ch,e)}async getGlobalSettings(e={}){return this.read(`/v1/settings`,Mm,e)}async updateGlobalSettings(e,t={}){return this.mutation(`/v1/settings`,e,Mm,t,`PUT`)}subscribeEvents(e){return k_({...e,baseUrl:this.baseUrl,webSocketFactory:this.webSocketFactory})}mutation(e,t,n,r,i=`POST`,a=this.requestTimeouts.mutationMs){return this.request(e,n,{body:JSON.stringify(t),headers:{"content-type":`application/json`,"idempotency-key":r.idempotencyKey??P_()},method:i},jh,{...r.signal===void 0?{}:{signal:r.signal},timeoutMs:a})}read(e,t,n,r){return this.request(e,t,{},r,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:n.signal===void 0?this.requestTimeouts.readMs:this.requestTimeouts.queryMs})}async request(e,t,n={},r,i={}){let a=AbortSignal.timeout(i.timeoutMs??this.requestTimeouts.readMs),o=i.signal===void 0?a:AbortSignal.any([i.signal,a]),s=await this.fetchImplementation(`${this.baseUrl}${e}`,{...n,credentials:`same-origin`,headers:{accept:`application/json`,...n.headers},signal:o});if(!s.ok){if(s.status===401)for(let e of this.unauthorizedListeners)try{e()}catch{}if(r!==void 0){let e;try{e=await s.json()}catch(e){throw new z_(`Codexly error response is not valid JSON`,{cause:e})}throw T_(r,e)?new R_(s.status,s.statusText,e):new z_(`Codexly error response does not match the protocol schema`)}try{let e=await s.json();if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&e.message.length>0)throw new L_(s.status,s.statusText,e.message)}catch(e){if(e instanceof L_)throw e}throw new L_(s.status,s.statusText)}let c;try{c=await s.json()}catch(e){throw new z_(`Codexly response is not valid JSON`,{cause:e})}if(!T_(t,c))throw new z_(`Codexly response does not match the protocol schema`);return c}},W_=class extends U_{async listSkills(e,t={}){return this.read(`${Z(e)}/skills`,Qm,t)}async listMcpServers(e,t,n={}){return this.read(`${Q(e,t)}/mcp-servers`,pm,n,jh)}async retryMcpServers(e,t,n={}){return this.mutation(`${Q(e,t)}/mcp-servers/retry`,{},bh,n)}async listProjects(e={}){return this.read(`/v1/projects`,Jm,e)}async listProjectDirectories(e,t={}){return this.read(X(`/v1/project-directories`,{path:e,includeHidden:t.includeHidden===!0?`true`:void 0}),qd,t)}async listHostFiles(e,t,n={}){return this.read(X(`/v1/host-files`,{kind:e,path:t,includeHidden:n.includeHidden===!0?`true`:void 0}),Xd,n)}async reorderProjects(e,t={}){return this.mutation(`/v1/projects/order`,{projectIds:e},Ym,t,`PUT`)}async getProjectDefaults(e,t={}){return this.read(`${Z(e)}/defaults`,Pm,t)}async updateProjectDefaults(e,t,n={}){return this.mutation(`${Z(e)}/defaults`,t,Pm,n,`PUT`)}async addProject(e,t={}){return this.mutation(`/v1/projects`,{roots:e.map(e=>({path:e}))},Zd,t)}async renameProject(e,t,n={}){return this.mutation(`${Z(e)}/rename`,{name:t},af,n)}async removeProject(e,t={}){return this.mutation(`${Z(e)}/remove`,{},of,t)}async getProjectOpenCapabilities(e,t={}){return this.read(`${Z(e)}/open-capabilities`,nf,t)}async openProject(e,t,n,r={}){return this.mutation(X(`${Z(e)}/open`,{rootPath:t}),n,rf,r)}async getProjectGitStatus(e,t,n={}){return this.read(X(`/v1/projects/${encodeURIComponent(e)}/git/status`,{includeDiff:t.includeDiff===!0?`true`:void 0,repository:t.repository,rootPath:t.rootPath}),Ep,n)}async getProjectGitHistory(e,t,n={}){return this.read(X(`${Z(e)}/git/history`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath}),kp,n)}async getProjectGitCommitFiles(e,t,n={}){return this.read(X(`${Z(e)}/git/commit-files`,{cursor:t.cursor,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Np,n)}async getProjectGitCommitFileDiff(e,t,n={}){return this.read(X(`${Z(e)}/git/commit-diff`,{path:t.path,repository:t.repository,rootPath:t.rootPath,sha:t.sha}),Pp,n)}async switchProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branch`,{rootPath:t}),n,Ep,r)}async createProjectBranch(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/branches`,{rootPath:t}),n,Ep,r)}async listProjectWorktrees(e,t,n={}){return this.read(X(`${Z(e)}/git/worktrees`,{rootPath:t}),Ip,n)}async createProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktrees`,{rootPath:t}),n,Lp,r)}async switchProjectWorktree(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/worktree`,{rootPath:t}),n,Lp,r)}async generateCommitMessage(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commit-message`,{rootPath:t}),n,Rp,r)}async commitProjectChanges(e,t,n,r={}){return this.mutation(X(`${Z(e)}/git/commits`,{rootPath:t}),n,zp,r)}async listProjectFiles(e,t,n,r={}){let i=X(`/v1/projects/${encodeURIComponent(e)}/files/tree`,{path:n??void 0,rootPath:t});return this.read(i,Vp,r)}async searchProjectFiles(e,t,n,r,i={}){let a=X(`/v1/projects/${encodeURIComponent(e)}/files/search`,{query:n,rootPath:t,sessionId:r});return this.read(a,Bd,i)}async stopProjectFileSearch(e,t,n,r={}){return this.mutation(`/v1/projects/${encodeURIComponent(e)}/files/search/stop`,{rootPath:t,sessionId:n},Vd,r)}async readProjectSourceFile(e,t,n,r,i={}){let a=X(`${Z(e)}/files/source`,{cursor:r,path:n,rootPath:t});return this.read(a,Hp,i)}},G_=class extends W_{async archiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/archive`,{},ph,n)}async unarchiveTask(e,t,n={}){return this.mutation(`${Q(e,t)}/unarchive`,{},mh,n)}async deleteTask(e,t,n={}){return this.mutation(Q(e,t),{},hh,n,`DELETE`)}},K_=class extends G_{async listQueuedSubmissions(e,t,n={},r={}){return this.read(X(`${Q(e,t)}/queue`,n),ym,r)}async addQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue`,{clientUserMessageId:r,input:n},wh,i)}async updateQueuedSubmission(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{input:r},Th,i,`PUT`)}async deleteQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/${encodeURIComponent(n)}`,{},Eh,r,`DELETE`)}async reorderQueuedSubmissions(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/reorder`,{queuedSubmissionIds:n},Dh,r,`PUT`)}async startQueuedSubmission(e,t,n,r={}){return this.mutation(`${Q(e,t)}/queue/start`,{...n===void 0?{}:{queuedSubmissionId:n}},Oh,r)}async listTasks(e,t={},n={}){let r=X(`${Z(e)}/tasks`,t);return this.read(r,Xm,n)}async readTask(e,t,n={}){let{cursor:r,...i}=n;return this.read(X(Q(e,t),{cursor:r}),mg,i)}getTaskAttachmentUrl(e,t,n){return B_(this.baseUrl,e,t,n)}async openTaskAttachment(e,t,n,r={}){return this.mutation(`${Q(e,t)}/attachments/${encodeURIComponent(n)}/open`,{},Df,r)}async listBackgroundTerminals(e,t,n={}){return this.read(`${Q(e,t)}/background-terminals`,Nf,n)}async terminateBackgroundTerminal(e,t,n,r={}){return this.mutation(`${Q(e,t)}/background-terminals/${encodeURIComponent(n)}/terminate`,{},Pf,r)}async getTaskSettings(e,t,n={}){return this.read(`${Q(e,t)}/settings`,Fm,n)}async updateTaskSettings(e,t,n,r={}){return this.mutation(`${Q(e,t)}/settings`,n,Fm,r,`PUT`)}async startTask(e,t={}){return this.mutation(`${Z(e)}/tasks`,{},uh,t)}async pinTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/pin`,{pinned:n},dh,r,`PUT`)}async renameTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/rename`,{title:n},fh,r)}async unsubscribeTask(e,t){return this.request(`${Q(e,t)}/unsubscribe`,gh,{body:`{}`,headers:{"content-type":`application/json`},method:`POST`})}async startReview(e,t,n,r={}){return this.mutation(`${Q(e,t)}/review`,n,_h,r)}async compactTask(e,t,n={}){return this.mutation(`${Q(e,t)}/compact`,{},vh,n)}async forkTask(e,t,n,r={}){return this.mutation(`${Q(e,t)}/fork`,n,yh,r)}async uploadFeedback(e,t,n,r={}){return this.mutation(`${Q(e,t)}/feedback`,n,xh,r)}async uploadAttachment(e,t,n={}){let r=new FormData;return r.set(`attachment`,t.content,t.name),this.request(`${Z(e)}/attachments/${t.kind}`,om,{body:r,headers:{"idempotency-key":n.idempotencyKey??P_()},method:`POST`},jh,{...n.signal===void 0?{}:{signal:n.signal},timeoutMs:this.requestTimeouts.mutationMs})}async importHostAttachment(e,t,n,r={}){return this.mutation(`${Z(e)}/attachments/${t}/host`,{path:n},om,r)}async startTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns`,{input:n,options:r},Sh,i)}async steerTurn(e,t,n,r,i={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/steer`,{input:r,taskId:t},Ch,i)}async interruptTurn(e,t,n,r={}){return this.mutation(`${Q(e,t)}/turns/${encodeURIComponent(n)}/interrupt`,{taskId:t},kh,r)}async resolvePendingRequest(e,t,n={}){let r={itemId:e.itemId,projectId:e.projectId,resolution:t,taskId:e.taskId,turnId:e.turnId,type:e.type};return this.mutation(`${Q(e.projectId,e.taskId)}/pending-requests/${encodeURIComponent(e.requestId)}/resolve`,r,vp,n)}},q_=class extends K_{},J_=`pinned`,Y_=`search-source`,X_=3e4;function Z_(e,t){return[`projects`,e,`tasks`,t,`queue`]}var Q_=new q_,$_=l(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ev=l(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),tv=Object.defineProperty,nv=(e,t)=>tv(e,`name`,{value:t,configurable:!0}),rv=!!(typeof window<`u`&&window.document&&window.document.createElement);function iv(e,t,{checkForDefaultPrevented:n=!0}={}){return nv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}nv(iv,`composeEventHandlers`);function av(e){if(!rv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}nv(av,`getOwnerWindow`);function ov(e){if(!rv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}nv(ov,`getOwnerDocument`);function sv(e,t=!1){let{activeElement:n}=ov(e);if(!n?.nodeName)return null;if(cv(n)&&n.contentDocument)return sv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ov(n).getElementById(e);if(t)return t}}return n}nv(sv,`getActiveElement`);function cv(e){return e.tagName===`IFRAME`}nv(cv,`isFrame`);var lv=Object.defineProperty,uv=(e,t)=>lv(e,`name`,{value:t,configurable:!0});function dv(e,t){let n=E.createContext(t);n.displayName=e+`Context`;let r=uv(e=>{let{children:t,...r}=e,i=E.useMemo(()=>r,Object.values(r));return(0,D.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=E.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return uv(i,`useContext`),[r,i]}uv(dv,`createContext`);function fv(e,t=[]){let n=[];function r(t,r){let i=E.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=uv(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=E.useMemo(()=>o,Object.values(o));return(0,D.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=E.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return uv(s,`useContext`),[o,s]}uv(r,`createContext`);let i=uv(()=>{let t=n.map(e=>E.createContext(e));return uv(function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,pv(i,...t)]}uv(fv,`createContextScope`);function pv(...e){let t=e[0];if(e.length===1)return t;let n=uv(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return uv(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}uv(pv,`composeContextScopes`);var mv=t(r(),1),hv=Object.defineProperty,gv=(e,t)=>hv(e,`name`,{value:t,configurable:!0}),_v=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=c(`Primitive.${t}`),r=E.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,D.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vv(e,t){e&&mv.flushSync(()=>e.dispatchEvent(t))}gv(vv,`dispatchDiscreteCustomEvent`);var yv=Object.defineProperty,bv=(e,t)=>yv(e,`name`,{value:t,configurable:!0});function xv(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}bv(xv,`useCallbackRef`);var Sv=Object.defineProperty,$=(e,t)=>Sv(e,`name`,{value:t,configurable:!0}),Cv=`dismissableLayer.update`,wv=`dismissableLayer.pointerDownOutside`,Tv=`dismissableLayer.focusOutside`,Ev,Dv=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ov=E.forwardRef($(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=E.useContext(Dv),[f,p]=E.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=E.useState({}),g=a(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=E.useRef(!1),ee=jv(e=>{o?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),w=Mv(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),te=f?b===_.length-1:!1,ne=xv(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return E.useEffect(()=>{if(te)return m.addEventListener(`keydown`,ne,{capture:!0}),()=>m.removeEventListener(`keydown`,ne,{capture:!0})},[m,te,ne]),E.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ev=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Nv(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ev))}},[f,m,n,d]),E.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Nv())},[f,d]),E.useEffect(()=>{let e=$(()=>h({}),`handleUpdate`);return document.addEventListener(Cv,e),()=>document.removeEventListener(Cv,e)},[]),(0,D.jsx)(_v.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:iv(e.onFocusCapture,w.onFocusCapture),onBlurCapture:iv(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:iv(e.onPointerDownCapture,ee.onPointerDownCapture)})},`DismissableLayer`));function kv(){let e=E.useContext(Dv),[t,n]=E.useState(null);return E.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}$(kv,`useDismissableLayerSurface`);var Av=$(()=>!0,`IS_TRUE`);function jv(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Av}=t,s=xv(e),c=E.useRef(!1),l=E.useRef(!1),u=E.useRef(new Map),d=E.useRef(()=>{});return E.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}$(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}$(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}$(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}$(p,`handleInteractionBubble`);let m=$(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Pv(wv,s,p,{discrete:!0})};if($(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:$(()=>c.current=!0,`onPointerDownCapture`)}}$(jv,`usePointerDownOutside`);function Mv(e,t=globalThis?.document){let n=xv(e),r=E.useRef(!1);return E.useEffect(()=>{let e=$(e=>{e.target&&!r.current&&Pv(Tv,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:$(()=>r.current=!0,`onFocusCapture`),onBlurCapture:$(()=>r.current=!1,`onBlurCapture`)}}$(Mv,`useFocusOutside`);function Nv(){let e=new CustomEvent(Cv);document.dispatchEvent(e)}$(Nv,`dispatchUpdate`);function Pv(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?vv(i,a):i.dispatchEvent(a)}$(Pv,`handleAndDispatchCustomEvent`);var Fv=globalThis?.document?E.useLayoutEffect:()=>{},Iv=Object.defineProperty,Lv=(e,t)=>Iv(e,`name`,{value:t,configurable:!0}),Rv=E.useId||(()=>void 0),zv=0;function Bv(e){let[t,n]=E.useState(Rv());return Fv(()=>{e||n(e=>e??String(zv++))},[e]),e||(t?`radix-${t}`:``)}Lv(Bv,`useId`);var Vv=[`top`,`right`,`bottom`,`left`],Hv=Math.min,Uv=Math.max,Wv=Math.round,Gv=Math.floor,Kv=e=>({x:e,y:e}),qv={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Jv(e,t,n){return Uv(e,Hv(t,n))}function Yv(e,t){return typeof e==`function`?e(t):e}function Xv(e){return e.split(`-`)[0]}function Zv(e){return e.split(`-`)[1]}function Qv(e){return e===`x`?`y`:`x`}function $v(e){return e===`y`?`height`:`width`}function ey(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ty(e){return Qv(ey(e))}function ny(e,t,n){n===void 0&&(n=!1);let r=Zv(e),i=ty(e),a=$v(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=dy(o)),[o,dy(o)]}function ry(e){let t=dy(e);return[iy(e),t,iy(t)]}function iy(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ay=[`left`,`right`],oy=[`right`,`left`],sy=[`top`,`bottom`],cy=[`bottom`,`top`];function ly(e,t,n){switch(e){case`top`:case`bottom`:return n?t?oy:ay:t?ay:oy;case`left`:case`right`:return t?sy:cy;default:return[]}}function uy(e,t,n,r){let i=Zv(e),a=ly(Xv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(iy)))),a}function dy(e){let t=Xv(e);return qv[t]+e.slice(t.length)}function fy(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function py(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:fy(e)}function my(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function hy(e,t,n){let{reference:r,floating:i}=e,a=ey(t),o=ty(t),s=$v(o),c=Xv(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Zv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function gy(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Yv(t,e),p=py(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=my(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=my(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var _y=50,vy=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:gy},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=hy(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<_y&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=hy(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},yy=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Yv(e,t)||{};if(l==null)return{};let d=py(u),f={x:n,y:r},p=ty(i),m=$v(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let ee=b/2-x/2,w=C/2-h[m]/2-1,te=Hv(d[_],w),ne=Hv(d[v],w),re=C-h[m]-ne,T=C/2-h[m]/2+ee,ie=Jv(te,T,re),ae=!c.arrow&&Zv(i)!=null&&T!==ie&&a.reference[m]/2-(T<te?te:ne)-h[m]/2<0,oe=ae?T<te?T-te:T-re:0;return{[p]:f[p]+oe,data:{[p]:ie,centerOffset:T-ie-oe,...ae&&{alignmentOffset:oe}},reset:ae}}}),by=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Yv(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Xv(r),_=ey(o),v=Xv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[dy(o)]:ry(o)),x=p!==`none`;!d&&x&&b.push(...uy(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],w=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=ny(r,a,y);ee.push(C[e[0]],C[e[1]])}if(w=[...w,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==ey(t))||w.every(e=>ey(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:w},reset:{placement:t}};let n=w.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=w.filter(e=>{if(x){let t=ey(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function xy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sy(e){return Vv.some(t=>e[t]>=0)}var Cy=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Yv(e,t);switch(i){case`referenceHidden`:{let e=xy(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Sy(e)}}}case`escaped`:{let e=xy(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Sy(e)}}}default:return{}}}}},wy=new Set([`left`,`top`]);async function Ty(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Xv(n),s=Zv(n),c=ey(n)===`y`,l=wy.has(o)?-1:1,u=a&&c?-1:1,d=Yv(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ey=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ty(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Dy=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Yv(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ey(i),p=Qv(f),m=u[p],h=u[f],g=(e,t)=>Jv(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Oy=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Yv(e,t),u={x:n,y:r},d=ey(i),f=Qv(d),p=u[f],m=u[d],h=Yv(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=wy.has(Xv(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ky=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Yv(e,t),c=await i.detectOverflow(t,s),l=Xv(n),u=Zv(n),d=ey(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Hv(p-c[m],g),y=Hv(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Uv(c.left,c.right):S=p-2*Uv(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let ee=await i.getDimensions(a.floating);return f!==ee.width||p!==ee.height?{reset:{rects:!0}}:{}}}};function Ay(){return typeof window<`u`}function jy(e){return Py(e)?(e.nodeName||``).toLowerCase():`#document`}function My(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ny(e){return((Py(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Py(e){return Ay()?e instanceof Node||e instanceof My(e).Node:!1}function Fy(e){return Ay()?e instanceof Element||e instanceof My(e).Element:!1}function Iy(e){return Ay()?e instanceof HTMLElement||e instanceof My(e).HTMLElement:!1}function Ly(e){return!Ay()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof My(e).ShadowRoot}function Ry(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Yy(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function zy(e){return/^(table|td|th)$/.test(jy(e))}function By(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Vy=/transform|translate|scale|rotate|perspective|filter/,Hy=/paint|layout|strict|content/,Uy=e=>!!e&&e!==`none`,Wy;function Gy(e){let t=Fy(e)?Yy(e):e;return Uy(t.transform)||Uy(t.translate)||Uy(t.scale)||Uy(t.rotate)||Uy(t.perspective)||!qy()&&(Uy(t.backdropFilter)||Uy(t.filter))||Vy.test(t.willChange||``)||Hy.test(t.contain||``)}function Ky(e){let t=Zy(e);for(;Iy(t)&&!Jy(t);){if(Gy(t))return t;if(By(t))return null;t=Zy(t)}return null}function qy(){return Wy??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Wy}function Jy(e){return/^(html|body|#document)$/.test(jy(e))}function Yy(e){return My(e).getComputedStyle(e)}function Xy(e){return Fy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zy(e){if(jy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ly(e)&&e.host||Ny(e);return Ly(t)?t.host:t}function Qy(e){let t=Zy(e);return Jy(t)?(e.ownerDocument||e).body:Iy(t)&&Ry(t)?t:Qy(t)}function $y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Qy(e),i=r===e.ownerDocument?.body,a=My(r);if(i){let e=eb(a);return t.concat(a,a.visualViewport||[],Ry(r)?r:[],e&&n?$y(e):[])}else return t.concat(r,$y(r,[],n))}function eb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tb(e){let t=Yy(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Iy(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Wv(n)!==a||Wv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function nb(e){return Fy(e)?e:e.contextElement}function rb(e){let t=nb(e);if(!Iy(t))return Kv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=tb(t),o=(a?Wv(n.width):n.width)/r,s=(a?Wv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ib=Kv(0);function ab(e){let t=My(e);return!qy()||!t.visualViewport?ib:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ob(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===My(e)}function sb(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=nb(e),o=Kv(1);t&&(r?Fy(r)&&(o=rb(r)):o=rb(e));let s=ob(a,n,r)?ab(a):Kv(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=My(a),t=Fy(r)?My(r):r,n=e,i=eb(n);for(;i&&t!==n;){let e=rb(i),t=i.getBoundingClientRect(),r=Yy(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=My(i),i=eb(n)}}return my({width:u,height:d,x:c,y:l})}function cb(e,t){let n=Xy(e).scrollLeft;return t?t.left+n:sb(Ny(e)).left+n}function lb(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cb(e,n),y:n.top+t.scrollTop}}function ub(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ny(r),s=t?By(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Kv(1),u=Kv(0),d=Iy(r);if((d||!a)&&((jy(r)!==`body`||Ry(o))&&(c=Xy(r)),d)){let e=sb(r);l=rb(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?lb(o,c):Kv(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function db(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function fb(e){let t=Xy(e),n=e.ownerDocument.body,r=Uv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Uv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+cb(e),o=-t.scrollTop;return Yy(n).direction===`rtl`&&(a+=Uv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var pb=25;function mb(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=My(e),a=Ny(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!qy()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(cb(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=pb&&(s-=o)}return{width:s,height:c,x:l,y:u}}function hb(e,t){let n=sb(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rb(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gb(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=mb(e,n,t);else if(t===`document`)r=fb(Ny(e));else if(Fy(t))r=hb(t,n);else{let n=ab(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return my(r)}function _b(e,t){let n=t.get(e);if(n)return n;let r=$y(e,[],!1).filter(e=>Fy(e)&&jy(e)!==`body`),i=null,a=Yy(e).position===`fixed`,o=a?Zy(e):e;for(;Fy(o)&&!Jy(o);){let e=Yy(o),t=Gy(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Zy(o)}return t.set(e,r),r}function vb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?By(t)?[]:_b(t,this._c):[].concat(n),r],o=gb(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=gb(t,a[e],i);s=Uv(n.top,s),c=Hv(n.right,c),l=Hv(n.bottom,l),u=Uv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function yb(e){let{width:t,height:n}=tb(e);return{width:t,height:n}}function bb(e,t,n){let r=Iy(t),i=Ny(t),a=n===`fixed`,o=sb(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Kv(0);if((r||!a)&&((jy(t)!==`body`||Ry(i))&&(s=Xy(t)),r)){let e=sb(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=cb(i));let l=i&&!r&&!a?lb(i,s):Kv(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function xb(e){return Yy(e).position===`static`}function Sb(e,t){if(!Iy(e)||Yy(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ny(e)===n&&(n=n.ownerDocument.body),n}function Cb(e,t){let n=My(e);if(By(e))return n;if(!Iy(e)){let t=Zy(e);for(;t&&!Jy(t);){if(Fy(t)&&!xb(t))return t;t=Zy(t)}return n}let r=Sb(e,t);for(;r&&zy(r)&&xb(r);)r=Sb(r,t);return r&&Jy(r)&&xb(r)&&!Gy(r)?n:r||Ky(e)||n}var wb=async function(e){let t=this.getOffsetParent||Cb,n=this.getDimensions,r=await n(e.floating);return{reference:bb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Tb(e){return Yy(e).direction===`rtl`}var Eb={convertOffsetParentRelativeRectToViewportRelativeRect:ub,getDocumentElement:Ny,getClippingRect:vb,getOffsetParent:Cb,getElementRects:wb,getClientRects:db,getDimensions:yb,getScale:rb,isElement:Fy,isRTL:Tb};function Db(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ob(e,t,n){let r=null,i,a=Ny(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Gv(d),h=Gv(a.clientWidth-(u+f)),g=Gv(a.clientHeight-(d+p)),_=Gv(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Uv(0,Hv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Db(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=My(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function kb(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=nb(e),u=i||a?[...l?$y(l):[],...t?$y(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ob(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?sb(e):null;c&&g();function g(){let t=sb(e);h&&!Db(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ab=Ey,jb=Dy,Mb=by,Nb=ky,Pb=Cy,Fb=yy,Ib=Oy,Lb=(e,t,n)=>{let r=new Map,i=n??{},a={...Eb,...i.platform,_c:r};return vy(e,t,{...i,platform:a})},Rb=typeof document<`u`?E.useLayoutEffect:function(){};function zb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!zb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Bb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vb(e,t){let n=Bb(e);return Math.round(t*n)/n}function Hb(e){let t=E.useRef(e);return Rb(()=>{t.current=e}),t}function Ub(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);zb(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),ee=E.useRef(u),w=c!=null,te=Hb(c),ne=Hb(i),re=Hb(l),T=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),Lb(S.current,C.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ie.current&&!zb(ee.current,t)&&(ee.current=t,mv.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);Rb(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=E.useRef(!1);Rb(()=>(ie.current=!0,()=>{ie.current=!1}),[]),Rb(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(te.current)return te.current(b,x,T);T()}},[b,x,T,te,w]);let ae=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),oe=E.useMemo(()=>({reference:b,floating:x}),[b,x]),se=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=Vb(oe.floating,u.x),r=Vb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Bb(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:T,refs:ae,elements:oe,floatingStyles:se}),[u,T,ae,oe,se])}var Wb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Fb({element:r.current,padding:i}).fn(n):r?Fb({element:r,padding:i}).fn(n):{}}}},Gb=(e,t)=>{let n=Ab(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kb=(e,t)=>{let n=jb(e);return{name:n.name,fn:n.fn,options:[e,t]}},qb=(e,t)=>({fn:Ib(e).fn,options:[e,t]}),Jb=(e,t)=>{let n=Mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yb=(e,t)=>{let n=Nb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xb=(e,t)=>{let n=Pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zb=(e,t)=>{let n=Wb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qb=Object.defineProperty,$b=(e,t)=>Qb(e,`name`,{value:t,configurable:!0});function ex(e){let[t,n]=E.useState(void 0);return Fv(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}$b(ex,`useSize`);var tx=Object.defineProperty,nx=(e,t)=>tx(e,`name`,{value:t,configurable:!0}),rx=`Popper`,[ix,ax]=fv(rx),[ox,sx]=ix(rx),cx=nx(e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(ox,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),lx=`PopperAnchor`,ux=E.forwardRef(nx(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,o=sx(lx,n),s=E.useRef(null),c=o.onAnchorChange,l=a(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=o.placementState&&_x(o.placementState),f=d?.[0],p=d?.[1];return r?null:(0,D.jsx)(_v.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),dx=`PopperContent`,[fx,px]=ix(dx),mx=E.forwardRef(nx(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=sx(dx,n),[v,y]=E.useState(null),b=a(t,y),[x,S]=E.useState(null),C=ex(x),ee=C?.width??0,w=C?.height??0,te=r+(o===`center`?``:`-`+o),ne=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},re=Array.isArray(u)?u:[u],T=re.length>0,ie={padding:ne,boundary:re.filter(hx),altBoundary:T},{refs:ae,floatingStyles:oe,placement:se,isPositioned:ce,middlewareData:le}=Ub({strategy:`fixed`,placement:te,whileElementsMounted:nx((...e)=>kb(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Gb({mainAxis:i+w,alignmentAxis:s}),l&&Kb({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?qb():void 0,...ie}),l&&Jb({...ie}),Yb({...ie,apply:nx(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Zb({element:x,padding:c}),gx({arrowWidth:ee,arrowHeight:w}),p&&Xb({strategy:`referenceHidden`,...ie,boundary:T?ie.boundary:void 0})]}),ue=_.setPlacementState;Fv(()=>(ue(se),()=>{ue(void 0)}),[se,ue]);let[de,fe]=_x(se),pe=xv(h);Fv(()=>{ce&&pe?.()},[ce,pe]);let me=le.arrow?.x,he=le.arrow?.y,ge=le.arrow?.centerOffset!==0,[_e,ve]=E.useState();return Fv(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),(0,D.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...oe,transform:ce?oe.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:_e,"--radix-popper-transform-origin":[le.transformOrigin?.x,le.transformOrigin?.y].join(` `),...le.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(fx,{scope:n,placedSide:de,placedAlign:fe,onArrowChange:S,arrowX:me,arrowY:he,shouldHideArrow:ge,children:(0,D.jsx)(_v.div,{"data-side":de,"data-align":fe,...g,ref:b,style:{...g.style,animation:ce?g.style?.animation:`none`}})})})},`PopperContent`));function hx(e){return e!==null}nx(hx,`isNotNull`);var gx=nx(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_x(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function _x(e){let[t,n=`center`]=e.split(`-`);return[t,n]}nx(_x,`getSideAndAlignFromPlacement`);var vx=cx,yx=ux,bx=mx,xx=Object.defineProperty,Sx=E.forwardRef(((e,t)=>xx(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=E.useState(!1);Fv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?mv.createPortal((0,D.jsx)(_v.div,{...r,ref:t}),o):null},`Portal`)),Cx=Object.defineProperty,wx=(e,t)=>Cx(e,`name`,{value:t,configurable:!0});function Tx(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}wx(Tx,`useStateMachine`);var Ex=wx(e=>{let{present:t,children:n}=e,r=Dx(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=kx(r.ref,jx(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null},`Presence`);function Dx(e){let[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef(`none`),o=E.useRef(void 0),[s,c]=Tx(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return E.useEffect(()=>{s===`mounted`?(a.current=o.current??Ax(r.current),o.current=void 0):a.current=`none`},[s]),Fv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Ax(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Fv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=wx(a=>{let o=Ax(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=wx(e=>{e.target===t&&(a.current=Ax(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:E.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Ax(t)}else r.current=null;n(e)},[])}}wx(Dx,`usePresence`);function Ox(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}wx(Ox,`setRef`);function kx(...e){let t=E.useRef(e);return t.current=e,E.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ox(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ox(n[e],null)}}},[])}wx(kx,`useStableComposedRefs`);function Ax(e){return e?.animationName||`none`}wx(Ax,`getAnimationName`);function jx(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}wx(jx,`getElementRef`);var Mx=Object.defineProperty,Nx=(e,t)=>Mx(e,`name`,{value:t,configurable:!0}),Px=E.useEffectEvent,Fx=E.useInsertionEffect;function Ix(e){if(typeof Px==`function`)return Px(e);let t=E.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Fx==`function`?Fx(()=>{t.current=e}):Fv(()=>{t.current=e}),E.useMemo(()=>((...e)=>t.current?.(...e)),[])}Nx(Ix,`useEffectEvent`);var Lx=Object.defineProperty,Rx=(e,t)=>Lx(e,`name`,{value:t,configurable:!0}),zx=E.useInsertionEffect||Fv;function Bx({prop:e,defaultProp:t,onChange:n=Rx(()=>{},`onChange`),caller:r}){let[i,a,o]=Vx({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,E.useCallback(t=>{if(s){let n=Hx(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Rx(Bx,`useControllableState`);function Vx({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return zx(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Rx(Vx,`useUncontrolledState`);function Hx(e){return typeof e==`function`}Rx(Hx,`isFunction`);var Ux=Symbol(`RADIX:SYNC_STATE`);function Wx(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ix(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=E.useReducer((t,n)=>{if(n.type===Ux)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=E.useRef(p);E.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=E.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return E.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ux,state:i})},[i,d.state,c]),[h,f]}Rx(Wx,`useControllableStateReducer`);var Gx=Object.defineProperty,Kx=(e,t)=>Gx(e,`name`,{value:t,configurable:!0}),qx=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Jx=E.forwardRef(Kx(function(e,t){return(0,D.jsx)(_v.span,{...e,ref:t,style:{...qx,...e.style}})},`VisuallyHidden`)),Yx=Object.defineProperty,Xx=(e,t)=>Yx(e,`name`,{value:t,configurable:!0}),[Zx,Qx]=fv(`Tooltip`,[ax]),$x=ax(),eS=`TooltipProvider`,tS=700,nS=`tooltip.open`,[rS,iS]=Zx(eS),aS=Xx(e=>{let{__scopeTooltip:t,delayDuration:n=tS,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=E.useRef(!0),s=E.useRef(!1),c=E.useRef(0);return E.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,D.jsx)(rS,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:E.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:E.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),oS=`Tooltip`,[sS,cS]=Zx(oS),lS=Xx(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=iS(oS,e.__scopeTooltip),l=$x(t),[u,d]=E.useState(null),[f,p]=E.useState(void 0),m=Bv(),h=E.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=E.useRef(!1),[y,b]=Bx({prop:r,defaultProp:i??!1,onChange:Xx(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(nS))):c.onClose(),a?.(e)},`onChange`),caller:oS}),x=E.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=E.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),ee=E.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);E.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let w=f??m;return(0,D.jsx)(vx,{...l,children:(0,D.jsx)(sS,{scope:t,contentId:w,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{c.isOpenDelayedRef.current?ee():S()},[c.isOpenDelayedRef,ee,S]),onTriggerLeave:E.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),uS=`TooltipTrigger`,dS=E.forwardRef(Xx(function(e,t){let{__scopeTooltip:n,...r}=e,i=cS(uS,n),o=iS(uS,n),s=$x(n),c=a(t,E.useRef(null),i.onTriggerChange),l=E.useRef(!1),u=E.useRef(!1),d=E.useCallback(()=>l.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,D.jsx)(yx,{asChild:!0,...s,children:(0,D.jsx)(_v.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:iv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:iv(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:iv(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:iv(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:iv(e.onBlur,i.onClose),onClick:iv(e.onClick,i.onClose)})})},`TooltipTrigger`)),fS=`TooltipPortal`,[pS,mS]=Zx(fS,{forceMount:void 0}),hS=Xx(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=cS(fS,t);return(0,D.jsx)(pS,{scope:t,forceMount:n,children:(0,D.jsx)(Ex,{present:n||a.open,children:(0,D.jsx)(Sx,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),gS=`TooltipContent`,_S=E.forwardRef(Xx(function(e,t){let n=mS(gS,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=cS(gS,e.__scopeTooltip);return(0,D.jsx)(Ex,{present:r||o.open,children:o.disableHoverableContent?(0,D.jsx)(bS,{side:i,...a,ref:t}):(0,D.jsx)(vS,{side:i,...a,ref:t})})},`TooltipContent`)),vS=E.forwardRef(Xx(function(e,t){let n=cS(gS,e.__scopeTooltip),r=iS(gS,e.__scopeTooltip),i=E.useRef(null),o=a(t,i),[s,c]=E.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=E.useCallback(()=>{c(null),f(!1)},[f]),m=E.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=SS(r,xS(r,n.getBoundingClientRect())),a=CS(t.getBoundingClientRect()),o=TS([...i,...a]);c(o),f(!0)},[f]);return E.useEffect(()=>()=>p(),[p]),E.useEffect(()=>{if(l&&d){let e=Xx(e=>m(e,d),`handleTriggerLeave`),t=Xx(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),E.useEffect(()=>{if(s){let e=Xx(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!wS(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,D.jsx)(bS,{...e,ref:o})},`TooltipContentHoverable`)),yS=o(`TooltipContent`),bS=E.forwardRef(Xx(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=cS(gS,n),u=$x(n),{onClose:d}=l;E.useEffect(()=>(document.addEventListener(nS,d),()=>document.removeEventListener(nS,d)),[d]),E.useEffect(()=>{if(l.trigger){let e=Xx(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Fv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,D.jsx)(Ov,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,D.jsxs)(bx,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,D.jsx)(yS,{children:r}),i?(0,D.jsx)(Jx,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function xS(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Xx(xS,`getExitSideFromRect`);function SS(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Xx(SS,`getPaddedExitPoints`);function CS(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Xx(CS,`getPointsFromRect`);function wS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Xx(wS,`isPointInPolygon`);function TS(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ES(t)}Xx(TS,`getHull`);function ES(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Xx(ES,`getHullPresorted`);var DS=aS,OS=lS,kS=dS,AS=hS,jS=_S;function MS({delayDuration:e=350,disableHoverableContent:t=!0,skipDelayDuration:n=150,...r}){return(0,D.jsx)(DS,{"data-slot":`tooltip-provider`,delayDuration:e,disableHoverableContent:t,skipDelayDuration:n,...r})}function NS(e){return(0,D.jsx)(OS,{"data-slot":`tooltip`,...e})}function PS(e){return(0,D.jsx)(kS,{"data-slot":`tooltip-trigger`,...e})}function FS({children:e,className:t,collisionPadding:n=8,sideOffset:r=8,...i}){return(0,D.jsx)(AS,{children:(0,D.jsx)(jS,{className:s(`pointer-events-none z-50 w-fit max-w-[min(20rem,calc(100vw-1rem))] whitespace-normal rounded-control bg-foreground px-2 py-1 text-meta text-raised shadow-floating`,t),collisionPadding:n,"data-slot":`tooltip-content`,sideOffset:r,...i,children:e})})}var IS=Object.defineProperty,LS=(e,t)=>IS(e,`name`,{value:t,configurable:!0}),RS=`focusScope.autoFocusOnMount`,zS=`focusScope.autoFocusOnUnmount`,BS={bubbles:!1,cancelable:!0},VS=E.forwardRef(LS(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[c,l]=E.useState(null),u=xv(i),d=xv(o),f=E.useRef(null),p=a(t,l),m=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:JS(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||JS(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&JS(c)};LS(e,`handleFocusIn`),LS(t,`handleFocusOut`),LS(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),E.useEffect(()=>{if(c){YS.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(RS,BS);c.addEventListener(RS,u),c.dispatchEvent(t),t.defaultPrevented||(HS(QS(WS(c)),{select:!0}),document.activeElement===e&&JS(c))}return()=>{c.removeEventListener(RS,u),setTimeout(()=>{let t=new CustomEvent(zS,BS);c.addEventListener(zS,d),c.dispatchEvent(t),t.defaultPrevented||JS(e??document.body,{select:!0}),c.removeEventListener(zS,d),YS.remove(m)},0)}}},[c,u,d,m]);let h=E.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=US(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&JS(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&JS(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,D.jsx)(_v.div,{tabIndex:-1,...s,ref:p,onKeyDown:h})},`FocusScope`));function HS(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(JS(r,{select:t}),document.activeElement!==n)return}LS(HS,`focusFirst`);function US(e){let t=WS(e);return[GS(t,e),GS(t.reverse(),e)]}LS(US,`getTabbableEdges`);function WS(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:LS(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}LS(WS,`getTabbableCandidates`);function GS(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):KS(r,{upTo:t})))return r}LS(GS,`findVisible`);function KS(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}LS(KS,`isHidden`);function qS(e){return e instanceof HTMLInputElement&&`select`in e}LS(qS,`isSelectableInput`);function JS(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qS(e)&&t&&e.select()}}LS(JS,`focus`);var YS=XS();function XS(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ZS(e,t),e.unshift(t)},remove(t){e=ZS(e,t),e[0]?.resume()}}}LS(XS,`createFocusScopesStack`);function ZS(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}LS(ZS,`arrayRemove`);function QS(e){return e.filter(e=>e.tagName!==`A`)}LS(QS,`removeLinks`);var $S=Object.defineProperty,eC=(e,t)=>$S(e,`name`,{value:t,configurable:!0}),tC=0,nC=null;function rC(e){return iC(),e.children}eC(rC,`FocusGuards`);function iC(){E.useEffect(()=>{nC||={start:aC(),end:aC()};let{start:e,end:t}=nC;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),tC++,()=>{tC===1&&(nC?.start.remove(),nC?.end.remove(),nC=null),tC=Math.max(0,tC-1)}},[])}eC(iC,`useFocusGuards`);function aC(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}eC(aC,`createFocusGuard`);var oC=function(){return oC=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oC.apply(this,arguments)};function sC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cC(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var lC=`right-scroll-bar-position`,uC=`width-before-scroll-bar`,dC=`with-scroll-bars-hidden`,fC=`--removed-body-scroll-bar-size`;function pC(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function mC(e,t){var n=(0,E.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hC=typeof window<`u`?E.useLayoutEffect:E.useEffect,gC=new WeakMap;function _C(e,t){var n=mC(t||null,function(t){return e.forEach(function(e){return pC(e,t)})});return hC(function(){var t=gC.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||pC(e,null)}),i.forEach(function(e){r.has(e)||pC(e,a)})}gC.set(n,e)},[e]),n}function vC(e){return e}function yC(e,t){t===void 0&&(t=vC);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function bC(e){e===void 0&&(e={});var t=yC(null);return t.options=oC({async:!0,ssr:!1},e),t}var xC=function(e){var t=e.sideCar,n=sC(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return E.createElement(r,oC({},n))};xC.isSideCarExport=!0;function SC(e,t){return e.useMedium(t),xC}var CC=bC(),wC=function(){},TC=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:wC,onWheelCapture:wC,onTouchMoveCapture:wC}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=sC(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=_C([n,t]),C=oC(oC({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:CC,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?E.cloneElement(E.Children.only(s),oC(oC({},C),{ref:S})):E.createElement(v,oC({},C,{className:c,ref:S}),s))});TC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},TC.classNames={fullWidth:uC,zeroRight:lC};var EC,DC=function(){if(EC)return EC;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function OC(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=DC();return t&&e.setAttribute(`nonce`,t),e}function kC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AC(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=OC())&&(kC(t,n),AC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MC=function(){var e=jC();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},NC=function(){var e=MC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},PC={left:0,top:0,right:0,gap:0},FC=function(e){return parseInt(e||``,10)||0},IC=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[FC(n),FC(r),FC(i)]},LC=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return PC;var t=IC(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},RC=NC(),zC=`data-scroll-locked`,BC=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${dC} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${zC}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${lC} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${uC} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${lC} .${lC} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${uC} .${uC} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${zC}] {
36
+ ${fC}: ${s}px;
37
+ }
38
+ `},VC=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},HC=function(){E.useEffect(function(){return document.body.setAttribute(zC,(VC()+1).toString()),function(){var e=VC()-1;e<=0?document.body.removeAttribute(zC):document.body.setAttribute(zC,e.toString())}},[])},UC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;HC();var a=E.useMemo(function(){return LC(i)},[i]);return E.createElement(RC,{styles:BC(a,!t,i,n?``:`!important`)})},WC=!1;if(typeof window<`u`)try{var GC=Object.defineProperty({},"passive",{get:function(){return WC=!0,!0}});window.addEventListener(`test`,GC,GC),window.removeEventListener(`test`,GC,GC)}catch{WC=!1}var KC=WC?{passive:!1}:!1,qC=function(e){return e.tagName===`TEXTAREA`},JC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!qC(e)&&n[t]===`visible`)},YC=function(e){return JC(e,`overflowY`)},XC=function(e){return JC(e,`overflowX`)},ZC=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ew(e,r)){var i=tw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},QC=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},$C=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ew=function(e,t){return e===`v`?YC(t):XC(t)},tw=function(e,t){return e===`v`?QC(t):$C(t)},nw=function(e,t){return e===`h`&&t===`rtl`?-1:1},rw=function(e,t,n,r,i){var a=nw(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=tw(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ew(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},iw=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aw=function(e){return[e.deltaX,e.deltaY]},ow=function(e){return e&&`current`in e?e.current:e},sw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cw=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},lw=0,uw=[];function dw(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(lw++)[0],a=E.useState(NC)[0],o=E.useRef(e);E.useEffect(function(){o.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=cC([e.lockRef.current],(e.shards||[]).map(ow),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=iw(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ZC(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ZC(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return rw(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!uw.length||uw[uw.length-1]!==a)){var r=`deltaY`in n?aw(n):iw(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&sw(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ow).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=E.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:fw(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=E.useCallback(function(e){n.current=iw(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,aw(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,iw(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return uw.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,KC),document.addEventListener(`touchmove`,c,KC),document.addEventListener(`touchstart`,u,KC),function(){uw=uw.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,KC),document.removeEventListener(`touchmove`,c,KC),document.removeEventListener(`touchstart`,u,KC)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:cw(i)}):null,p?E.createElement(UC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pw=SC(CC,dw),mw=E.forwardRef(function(e,t){return E.createElement(TC,oC({},e,{ref:t,sideCar:pw}))});mw.classNames=TC.classNames;var hw=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},gw=new WeakMap,_w=new WeakMap,vw={},yw=0,bw=function(e){return e&&(e.host||bw(e.parentNode))},xw=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bw(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Sw=function(e,t,n,r){var i=xw(t,Array.isArray(e)?e:[e]);vw[n]||(vw[n]=new WeakMap);var a=vw[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(gw.get(e)||0)+1,l=(a.get(e)||0)+1;gw.set(e,c),a.set(e,l),o.push(e),c===1&&i&&_w.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),yw++,function(){o.forEach(function(e){var t=gw.get(e)-1,i=a.get(e)-1;gw.set(e,t),a.set(e,i),t||(_w.has(e)||e.removeAttribute(r),_w.delete(e)),i||e.removeAttribute(n)}),yw--,yw||(gw=new WeakMap,gw=new WeakMap,_w=new WeakMap,vw={})}},Cw=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||hw(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Sw(r,i,n,`aria-hidden`)):function(){return null}};export{rt as $,Y_ as A,u as At,bm as B,_v as C,te as Ct,ev as D,me as Dt,iv as E,T as Et,V_ as F,pf as G,vf as H,B_ as I,st as J,mf as K,P_ as L,Q_ as M,Z_ as N,$_ as O,fe as Ot,H_ as P,et as Q,lh as R,xv as S,g as St,fv as T,b as Tt,df as U,xf as V,ff as W,at as X,ot as Y,it as Z,ex as _,w as _t,NS as a,qe as at,Ov as b,C as bt,PS as c,Ie as ct,Ex as d,je as dt,nt as et,Sx as f,Ee as ft,ax as g,_ as gt,vx as h,be as ht,VS as i,Xe as it,X_ as j,J_ as k,d as kt,qx as l,Me as lt,bx as m,xe as mt,mw as n,$e as nt,FS as o,Ge as ot,yx as p,Te as pt,Tf as q,iC as r,Qe as rt,MS as s,We as st,Cw as t,Ze as tt,Bx as u,Ae as ut,Bv as v,ee as vt,vv as w,re as wt,kv as x,S as xt,Fv as y,le as yt,Vm as z};
@@ -0,0 +1 @@
1
+ import{s as e}from"./button-CG0GNEOD.js";var t=e(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]);export{t};
@@ -0,0 +1,4 @@
1
+ function e(e){return e.split(/[\\/]/).at(-1)??e}function t(e){let t=0,n=0;for(let r of e.diff.split(`
2
+ `))r.startsWith(`+`)&&!r.startsWith(`+++`)?t+=1:r.startsWith(`-`)&&!r.startsWith(`---`)&&(n+=1);return{additions:t,removals:n}}function n(e){let n=[],r=new Map;for(let t of e){let e=t.path.replaceAll(`\\`,`/`),i=r.get(e);i===void 0?(r.set(e,n.length),n.push(t)):n[i]=t}let i=0,a=0;for(let e of n){let n=t(e);i+=n.additions,a+=n.removals}return{additions:i,changes:n,removals:a}}function r(e){let t=e.path.replace(/^[/\\]+/,``).replaceAll(`\\`,`/`);return{additionPath:e.kind===`delete`?`/dev/null`:`b/${t}`,deletionPath:e.kind===`create`?`/dev/null`:`a/${t}`}}function i(e){let t=e.diff.trimEnd(),{additionPath:n,deletionPath:i}=r(e),a=`--- ${i}\n+++ ${n}`;if(/^---\s/m.test(t)&&/^\+\+\+\s/m.test(t))return t;if(/^@@\s/m.test(t))return`${a}\n${t}`;let o=t.length===0?[]:t.split(`
3
+ `),s=0,c=0,l=0,u=o.map(e=>e.startsWith(`+`)?(s+=1,e):e.startsWith(`-`)?(c+=1,e):(l+=1,` ${e}`)),d=c+l,f=s+l;return[a,`@@ -1,${String(d)} +1,${String(f)} @@`,...u].join(`
4
+ `)}export{n as i,e as n,i as r,t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-BHcdOhhw.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CVaUQXZF.js","assets/index-C_O4z_mI.js","assets/button-CG0GNEOD.js","assets/bundle-mjs-rHxsej31.js","assets/es2015-CIXyxC_2.js","assets/checkbox-Bvl7MRXT.js","assets/file-tree-DRpR7Mu2.js","assets/file-CEs2ZXvf.js","assets/provider-connection-queries-C40YvSEy.js","assets/index-B3NtDmQp.css","assets/engine-compile-DQ0HPfe0.js","assets/lib-DrPFkMXk.js","assets/code-languages-CfwYbccP.js","assets/shiki-bundle-DzEBOJSk.js","assets/file-change-D7aZLgtG.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CVaUQXZF.js";import{s as r,t as i,u as a}from"./button-CG0GNEOD.js";import{O as o,a as s,c,o as l}from"./es2015-CIXyxC_2.js";import{i as u,l as d,r as f,t as p}from"./file-tree-DRpR7Mu2.js";import{A as m,F as h,Q as g,j as _,lt as v}from"./index-C_O4z_mI.js";import{n as y,t as b}from"./file-change-D7aZLgtG.js";var x=r(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),S=r(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),C=r(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),w=r(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),T=e(t(),1),E=n();function D(e,t){return e.name.localeCompare(t.name,`en`)}function O(e){let t=[e.name],n=e;for(;n.files.length===0&&n.directories.size===1;){let e=n.directories.values().next().value;if(e===void 0)break;t.push(e.name),n=e}let r=[...n.directories.values()].sort(D).map(O),i=n.files.toSorted(D);return{children:[...r,...i],name:t.join(`/`),path:n.path,type:`folder`}}function k(e){let t={directories:new Map,files:[],name:``,path:``};return e.forEach((e,n)=>{let r=e.path.split(/[\\/]/),i=r.at(-1)??e.path,a=t,o=``;for(let e of r.slice(0,-1)){o=o.length===0?e:`${o}/${e}`;let t=a.directories.get(e);t===void 0&&(t={directories:new Map,files:[],name:e,path:o},a.directories.set(e,t)),a=t}let{additions:s,removals:c}=b(e);a.files.push({additions:s,changeIndex:n,name:i,path:r.join(`/`),removals:c,type:`file`})}),[...[...t.directories.values()].sort(D).map(O),...t.files.toSorted(D)]}function A(e,t=new Set){for(let n of e)n.type===`folder`&&(t.add(n.path),A(n.children,t));return t}function j({fileLabel:e,nodes:t,showStats:n}){return t.map(t=>t.type===`folder`?(0,E.jsx)(u,{name:t.name,path:t.path,children:(0,E.jsx)(j,{fileLabel:e,nodes:t.children,showStats:n})},t.path):(0,E.jsx)(f,{"aria-label":e(t),icon:(0,E.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),name:t.name,path:t.path,trailing:n?(0,E.jsxs)(`span`,{"aria-hidden":`true`,className:`ml-auto flex shrink-0 items-center gap-1 text-meta`,children:[(0,E.jsxs)(`span`,{className:`font-medium text-diff-added`,children:[`+`,t.additions]}),(0,E.jsxs)(`span`,{className:`font-medium text-diff-removed`,children:[`-`,t.removals]})]}):void 0},`${t.path}:${String(t.changeIndex)}`))}function M({nodes:e,onSelect:t,selectedPath:n,showStats:r=!0}){let{t:i}=a(`workbench`),o=(0,T.useMemo)(()=>A(e),[e]);return(0,E.jsx)(p,{"aria-label":i(`diff.changedFilesNavigation`),defaultExpanded:o,onSelect:t,selectedPath:n,children:(0,E.jsx)(j,{fileLabel:e=>r?i(`diff.fileStats`,{additions:e.additions,path:e.path,removals:e.removals}):e.path,nodes:e,showStats:r})})}var N=(0,T.lazy)(()=>v(()=>import(`./patch-diff-viewer-BHcdOhhw.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),P=`(max-width: 760px)`;function F(){return typeof window>`u`||!window.matchMedia(P).matches}function I(e){return e===`ArrowUp`?`previous`:e===`ArrowDown`?`next`:null}function L(e,t,n){return n<=0?0:Math.min(Math.max(e+(t===`next`?1:-1),0),n-1)}function R({changes:e,currentIndex:t,navigationFooter:n,onClose:r,onCurrentIndexChange:u,renderContent:f,showStats:p=!0,titleId:m}){let{t:h}=a(`workbench`),_=(0,T.useRef)(null),[v,b]=(0,T.useState)(F),D=(0,T.useMemo)(()=>k(e),[e]),O=(0,T.useMemo)(()=>new Map(e.map((e,t)=>[e.path.replaceAll(`\\`,`/`),t])),[e]);if((0,T.useEffect)(()=>{b(F())},[e]),(0,T.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=I(n.key);r!==null&&(n.preventDefault(),u(L(t,r,e.length)))};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n)}},[e.length,t,u]),(0,T.useLayoutEffect)(()=>{_.current!==null&&(_.current.scrollTop=0)},[t]),e.length===0)return null;let A=e[0];if(A===void 0)return null;let j=e[t]??A,P=j.path.replaceAll(`\\`,`/`),R=y(j.path),z=h(v?`diff.collapseChangedFilesNavigation`:`diff.expandChangedFilesNavigation`),B=n=>{u(L(t,n,e.length))};return(0,E.jsxs)(`section`,{className:`grid h-full min-h-0 w-full min-w-0 grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,E.jsxs)(`header`,{className:`flex min-h-toolbar min-w-0 items-center gap-2 px-3 shadow-toolbar sm:px-4`,children:[(0,E.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,id:m,title:j.path,children:R}),(0,E.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:j.path,children:j.path})]}),(0,E.jsxs)(`span`,{className:`shrink-0 text-label text-muted-foreground`,children:[t+1,` / `,e.length]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.previousFile`),disabled:t===0,onClick:()=>{B(`previous`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.previousFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.nextFile`),disabled:t===e.length-1,onClick:()=>{B(`next`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.nextFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-controls":`file-review-navigation`,"aria-expanded":v,"aria-label":z,onClick:()=>{b(e=>!e)},size:`icon-sm`,type:`button`,variant:`ghost`,children:v?(0,E.jsx)(C,{className:`size-3.5`,"aria-hidden":`true`}):(0,E.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:z})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(c,{asChild:!0,children:(0,E.jsx)(i,{"aria-label":h(`diff.closeReview`),onClick:r,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(g,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(l,{children:h(`diff.closeReview`)})]})]})]}),(0,E.jsxs)(`div`,{className:`relative grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] bg-content ${v?`workbench:grid-cols-[minmax(0,1fr)_minmax(12rem,26%)]`:``}`,children:[(0,E.jsx)(`section`,{"aria-label":h(`diff.reviewContent`),className:`min-h-0 min-w-0 overflow-auto`,ref:_,children:f===void 0?(0,E.jsx)(T.Suspense,{fallback:(0,E.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:h(`diff.loading`)}),children:(0,E.jsx)(N,{change:j})}):f(j)}),(0,E.jsxs)(`aside`,{"aria-label":h(`diff.changedFilesNavigation`),className:`absolute inset-y-0 right-0 z-10 grid min-h-0 w-[min(16rem,82%)] grid-rows-[auto_minmax(0,1fr)] border-l border-separator bg-panel shadow-panel workbench:static workbench:z-auto workbench:w-auto workbench:shadow-none`,hidden:!v,id:`file-review-navigation`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-toolbar items-center gap-2 border-b border-separator px-3`,children:[(0,E.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,E.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-label font-semibold`,children:h(`diff.changedFiles`)}),(0,E.jsx)(`span`,{className:`text-meta text-muted-foreground`,children:e.length})]}),(0,E.jsxs)(`div`,{className:`min-h-0 overflow-y-auto px-2 py-2`,children:[(0,E.jsx)(M,{nodes:D,onSelect:e=>{let t=O.get(e);t!==void 0&&u(t)},selectedPath:P,showStats:p}),n]})]})]})]})}function z({changes:e,onClose:t}){let[n,r]=(0,T.useState)(0);if((0,T.useEffect)(()=>{e!==null&&r(0)},[e]),e===null||e.length===0)return null;let i=`file-review-dialog-title`;return(0,E.jsx)(m,{onOpenChange:e=>{e||t()},open:!0,children:(0,E.jsxs)(_,{"aria-labelledby":i,className:`h-[min(86dvh,58rem)] max-w-[78rem] overflow-hidden p-0`,children:[(0,E.jsx)(h,{className:`sr-only`,children:y(e[0]?.path??``)}),(0,E.jsx)(R,{changes:e,currentIndex:n,onClose:t,onCurrentIndexChange:r,titleId:i})]})})}export{x as a,S as i,R as n,C as r,z as t};