@srouterhq/server 0.0.0-stage → 0.9.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 (1027) hide show
  1. package/LICENSE +21 -0
  2. package/client/dist/assets/am-TQ7Jmdqe.js +1 -0
  3. package/client/dist/assets/ar-Bf5a7yfC.js +1 -0
  4. package/client/dist/assets/az-CrosE1xH.js +1 -0
  5. package/client/dist/assets/bg-BvWnmcUz.js +1 -0
  6. package/client/dist/assets/bn-ams5TsJp.js +1 -0
  7. package/client/dist/assets/cs-Dh67CaJ_.js +1 -0
  8. package/client/dist/assets/da-9WlT8Iq7.js +1 -0
  9. package/client/dist/assets/de-lWhJJzz7.js +1 -0
  10. package/client/dist/assets/el-Cu7_GhNq.js +1 -0
  11. package/client/dist/assets/es-BZuzsBcP.js +1 -0
  12. package/client/dist/assets/fa-Dwdn-jKS.js +1 -0
  13. package/client/dist/assets/fi-BFrFyOTy.js +1 -0
  14. package/client/dist/assets/fr-XhbtmPpj.js +1 -0
  15. package/client/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  16. package/client/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  17. package/client/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  18. package/client/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  19. package/client/dist/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
  20. package/client/dist/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
  21. package/client/dist/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
  22. package/client/dist/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
  23. package/client/dist/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
  24. package/client/dist/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
  25. package/client/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  26. package/client/dist/assets/gu-D0uhLUB8.js +1 -0
  27. package/client/dist/assets/ha-CVlm9pqp.js +1 -0
  28. package/client/dist/assets/he-CMIFeoWr.js +1 -0
  29. package/client/dist/assets/hi-ENTwhBpn.js +1 -0
  30. package/client/dist/assets/hr-fc03vMy_.js +1 -0
  31. package/client/dist/assets/hu-YBo2BIYt.js +1 -0
  32. package/client/dist/assets/id-BEWXYX69.js +1 -0
  33. package/client/dist/assets/ig-BKLZFKka.js +1 -0
  34. package/client/dist/assets/index-D9I4KtvR.js +145 -0
  35. package/client/dist/assets/index-txhEmCdb.css +2 -0
  36. package/client/dist/assets/it-Bzmei1Y2.js +1 -0
  37. package/client/dist/assets/ja-BfcpuqEl.js +1 -0
  38. package/client/dist/assets/ka-CnWjRgLo.js +1 -0
  39. package/client/dist/assets/km-BAjPR3Qj.js +1 -0
  40. package/client/dist/assets/kn-B15WKU5m.js +1 -0
  41. package/client/dist/assets/ko-C61fAB-w.js +1 -0
  42. package/client/dist/assets/lt-CYTr4_YW.js +1 -0
  43. package/client/dist/assets/ml-CtqxgyH3.js +1 -0
  44. package/client/dist/assets/mr-X5TMY7aR.js +1 -0
  45. package/client/dist/assets/ms-DSg8RqPS.js +1 -0
  46. package/client/dist/assets/my-D7RqR8uE.js +1 -0
  47. package/client/dist/assets/ne-DaflxkDj.js +1 -0
  48. package/client/dist/assets/nl-BOqqtsC8.js +1 -0
  49. package/client/dist/assets/no-BSHp_StB.js +1 -0
  50. package/client/dist/assets/or-BkLR9Vub.js +1 -0
  51. package/client/dist/assets/pa-CarJ2XgI.js +1 -0
  52. package/client/dist/assets/pl-C2n0V-0k.js +1 -0
  53. package/client/dist/assets/pt-BR-CqJdNhg2.js +1 -0
  54. package/client/dist/assets/pt-PT-C_HpMyKz.js +1 -0
  55. package/client/dist/assets/ro-DVRZqSAS.js +1 -0
  56. package/client/dist/assets/ru-DwAJG7VC.js +1 -0
  57. package/client/dist/assets/si-BxUezXm0.js +1 -0
  58. package/client/dist/assets/sk-eI1VcIfY.js +1 -0
  59. package/client/dist/assets/sr-CJF3auCr.js +1 -0
  60. package/client/dist/assets/srouter-logo-C6ZfjGIi.svg +14 -0
  61. package/client/dist/assets/sv-nqvwHAq_.js +1 -0
  62. package/client/dist/assets/sw-DWynE2pW.js +1 -0
  63. package/client/dist/assets/ta-BVM12knC.js +1 -0
  64. package/client/dist/assets/te-oyzEkF7_.js +1 -0
  65. package/client/dist/assets/th-COVeE0ZQ.js +1 -0
  66. package/client/dist/assets/tl-DsJANnQz.js +1 -0
  67. package/client/dist/assets/tr-B-Fl-urO.js +1 -0
  68. package/client/dist/assets/uk-C5qketAO.js +1 -0
  69. package/client/dist/assets/ur-QU9KugfV.js +1 -0
  70. package/client/dist/assets/uz-DL9cG_mY.js +1 -0
  71. package/client/dist/assets/vi-CQiVy3Pu.js +1 -0
  72. package/client/dist/assets/yo-DqazMdrZ.js +1 -0
  73. package/client/dist/assets/zh-CN-DnYL_Kio.js +1 -0
  74. package/client/dist/assets/zh-TW-5bdbosKj.js +1 -0
  75. package/client/dist/favicon.svg +14 -0
  76. package/client/dist/icons.svg +24 -0
  77. package/client/dist/index.html +37 -0
  78. package/dist/app.d.ts +4 -0
  79. package/dist/app.d.ts.map +1 -0
  80. package/dist/app.js +372 -0
  81. package/dist/app.js.map +1 -0
  82. package/dist/db/index.d.ts +49 -0
  83. package/dist/db/index.d.ts.map +1 -0
  84. package/dist/db/index.js +203 -0
  85. package/dist/db/index.js.map +1 -0
  86. package/dist/db/migrate/TEMPLATE.d.ts +4 -0
  87. package/dist/db/migrate/TEMPLATE.d.ts.map +1 -0
  88. package/dist/db/migrate/TEMPLATE.js +18 -0
  89. package/dist/db/migrate/TEMPLATE.js.map +1 -0
  90. package/dist/db/migrate/cli.d.ts +2 -0
  91. package/dist/db/migrate/cli.d.ts.map +1 -0
  92. package/dist/db/migrate/cli.js +177 -0
  93. package/dist/db/migrate/cli.js.map +1 -0
  94. package/dist/db/migrate/defaults.d.ts +52 -0
  95. package/dist/db/migrate/defaults.d.ts.map +1 -0
  96. package/dist/db/migrate/defaults.js +126 -0
  97. package/dist/db/migrate/defaults.js.map +1 -0
  98. package/dist/db/migrate/runner.d.ts +16 -0
  99. package/dist/db/migrate/runner.d.ts.map +1 -0
  100. package/dist/db/migrate/runner.js +178 -0
  101. package/dist/db/migrate/runner.js.map +1 -0
  102. package/dist/db/migrations/20260101_000000_legacy_baseline.d.ts +4 -0
  103. package/dist/db/migrations/20260101_000000_legacy_baseline.d.ts.map +1 -0
  104. package/dist/db/migrations/20260101_000000_legacy_baseline.js +2240 -0
  105. package/dist/db/migrations/20260101_000000_legacy_baseline.js.map +1 -0
  106. package/dist/db/migrations/20260627_000001_custom_provider_modalities.d.ts +4 -0
  107. package/dist/db/migrations/20260627_000001_custom_provider_modalities.d.ts.map +1 -0
  108. package/dist/db/migrations/20260627_000001_custom_provider_modalities.js +27 -0
  109. package/dist/db/migrations/20260627_000001_custom_provider_modalities.js.map +1 -0
  110. package/dist/db/migrations/20260627_000002_catalog_model_state.d.ts +4 -0
  111. package/dist/db/migrations/20260627_000002_catalog_model_state.d.ts.map +1 -0
  112. package/dist/db/migrations/20260627_000002_catalog_model_state.js +30 -0
  113. package/dist/db/migrations/20260627_000002_catalog_model_state.js.map +1 -0
  114. package/dist/db/migrations/20260628_120000_request_aggregates.d.ts +6 -0
  115. package/dist/db/migrations/20260628_120000_request_aggregates.d.ts.map +1 -0
  116. package/dist/db/migrations/20260628_120000_request_aggregates.js +104 -0
  117. package/dist/db/migrations/20260628_120000_request_aggregates.js.map +1 -0
  118. package/dist/db/migrations/20260630_000001_github_gpt41_context.d.ts +9 -0
  119. package/dist/db/migrations/20260630_000001_github_gpt41_context.d.ts.map +1 -0
  120. package/dist/db/migrations/20260630_000001_github_gpt41_context.js +22 -0
  121. package/dist/db/migrations/20260630_000001_github_gpt41_context.js.map +1 -0
  122. package/dist/db/migrations/20260706_000001_request_client_info.d.ts +4 -0
  123. package/dist/db/migrations/20260706_000001_request_client_info.d.ts.map +1 -0
  124. package/dist/db/migrations/20260706_000001_request_client_info.js +30 -0
  125. package/dist/db/migrations/20260706_000001_request_client_info.js.map +1 -0
  126. package/dist/db/migrations/20260706_000002_custom_model_tool_support.d.ts +17 -0
  127. package/dist/db/migrations/20260706_000002_custom_model_tool_support.d.ts.map +1 -0
  128. package/dist/db/migrations/20260706_000002_custom_model_tool_support.js +20 -0
  129. package/dist/db/migrations/20260706_000002_custom_model_tool_support.js.map +1 -0
  130. package/dist/db/migrations/20260714_000001_profile_chain_backfill.d.ts +12 -0
  131. package/dist/db/migrations/20260714_000001_profile_chain_backfill.d.ts.map +1 -0
  132. package/dist/db/migrations/20260714_000001_profile_chain_backfill.js +45 -0
  133. package/dist/db/migrations/20260714_000001_profile_chain_backfill.js.map +1 -0
  134. package/dist/db/migrations/20260720_000001_key_health_error.d.ts +5 -0
  135. package/dist/db/migrations/20260720_000001_key_health_error.d.ts.map +1 -0
  136. package/dist/db/migrations/20260720_000001_key_health_error.js +16 -0
  137. package/dist/db/migrations/20260720_000001_key_health_error.js.map +1 -0
  138. package/dist/db/migrations/20260726_000001_cooldown_probe_provenance.d.ts +4 -0
  139. package/dist/db/migrations/20260726_000001_cooldown_probe_provenance.d.ts.map +1 -0
  140. package/dist/db/migrations/20260726_000001_cooldown_probe_provenance.js +38 -0
  141. package/dist/db/migrations/20260726_000001_cooldown_probe_provenance.js.map +1 -0
  142. package/dist/db/migrations/20260726_000002_request_attempts.d.ts +4 -0
  143. package/dist/db/migrations/20260726_000002_request_attempts.d.ts.map +1 -0
  144. package/dist/db/migrations/20260726_000002_request_attempts.js +43 -0
  145. package/dist/db/migrations/20260726_000002_request_attempts.js.map +1 -0
  146. package/dist/db/migrations/20260726_000003_model_source_provenance.d.ts +4 -0
  147. package/dist/db/migrations/20260726_000003_model_source_provenance.d.ts.map +1 -0
  148. package/dist/db/migrations/20260726_000003_model_source_provenance.js +80 -0
  149. package/dist/db/migrations/20260726_000003_model_source_provenance.js.map +1 -0
  150. package/dist/db/migrations/20260726_000004_media_model_meta.d.ts +4 -0
  151. package/dist/db/migrations/20260726_000004_media_model_meta.d.ts.map +1 -0
  152. package/dist/db/migrations/20260726_000004_media_model_meta.js +34 -0
  153. package/dist/db/migrations/20260726_000004_media_model_meta.js.map +1 -0
  154. package/dist/db/migrations/20260726_000005_request_served_model.d.ts +4 -0
  155. package/dist/db/migrations/20260726_000005_request_served_model.d.ts.map +1 -0
  156. package/dist/db/migrations/20260726_000005_request_served_model.js +31 -0
  157. package/dist/db/migrations/20260726_000005_request_served_model.js.map +1 -0
  158. package/dist/db/migrations/20260726_000006_attempt_error_summary.d.ts +4 -0
  159. package/dist/db/migrations/20260726_000006_attempt_error_summary.d.ts.map +1 -0
  160. package/dist/db/migrations/20260726_000006_attempt_error_summary.js +29 -0
  161. package/dist/db/migrations/20260726_000006_attempt_error_summary.js.map +1 -0
  162. package/dist/db/migrations/20260727_000001_agent_compatibility.d.ts +4 -0
  163. package/dist/db/migrations/20260727_000001_agent_compatibility.d.ts.map +1 -0
  164. package/dist/db/migrations/20260727_000001_agent_compatibility.js +41 -0
  165. package/dist/db/migrations/20260727_000001_agent_compatibility.js.map +1 -0
  166. package/dist/db/migrations/20260728_000001_tombstone_provenance.d.ts +12 -0
  167. package/dist/db/migrations/20260728_000001_tombstone_provenance.d.ts.map +1 -0
  168. package/dist/db/migrations/20260728_000001_tombstone_provenance.js +37 -0
  169. package/dist/db/migrations/20260728_000001_tombstone_provenance.js.map +1 -0
  170. package/dist/db/migrations/20260729_000001_custom_model_endpoint_identity.d.ts +4 -0
  171. package/dist/db/migrations/20260729_000001_custom_model_endpoint_identity.d.ts.map +1 -0
  172. package/dist/db/migrations/20260729_000001_custom_model_endpoint_identity.js +145 -0
  173. package/dist/db/migrations/20260729_000001_custom_model_endpoint_identity.js.map +1 -0
  174. package/dist/db/migrations/20260802_000001_custom_endpoint_host_labels.d.ts +6 -0
  175. package/dist/db/migrations/20260802_000001_custom_endpoint_host_labels.d.ts.map +1 -0
  176. package/dist/db/migrations/20260802_000001_custom_endpoint_host_labels.js +52 -0
  177. package/dist/db/migrations/20260802_000001_custom_endpoint_host_labels.js.map +1 -0
  178. package/dist/db/migrations/20260805_000001_key_model_scope.d.ts +6 -0
  179. package/dist/db/migrations/20260805_000001_key_model_scope.d.ts.map +1 -0
  180. package/dist/db/migrations/20260805_000001_key_model_scope.js +17 -0
  181. package/dist/db/migrations/20260805_000001_key_model_scope.js.map +1 -0
  182. package/dist/db/migrations/20260805_000002_client_profiles.d.ts +4 -0
  183. package/dist/db/migrations/20260805_000002_client_profiles.d.ts.map +1 -0
  184. package/dist/db/migrations/20260805_000002_client_profiles.js +33 -0
  185. package/dist/db/migrations/20260805_000002_client_profiles.js.map +1 -0
  186. package/dist/db/migrations/20260810_000001_api_key_proxy.d.ts +4 -0
  187. package/dist/db/migrations/20260810_000001_api_key_proxy.d.ts.map +1 -0
  188. package/dist/db/migrations/20260810_000001_api_key_proxy.js +33 -0
  189. package/dist/db/migrations/20260810_000001_api_key_proxy.js.map +1 -0
  190. package/dist/db/migrations/20260819_000001_custom_model_tombstones.d.ts +4 -0
  191. package/dist/db/migrations/20260819_000001_custom_model_tombstones.d.ts.map +1 -0
  192. package/dist/db/migrations/20260819_000001_custom_model_tombstones.js +19 -0
  193. package/dist/db/migrations/20260819_000001_custom_model_tombstones.js.map +1 -0
  194. package/dist/db/migrations/20260820_000001_playground_conversations.d.ts +4 -0
  195. package/dist/db/migrations/20260820_000001_playground_conversations.d.ts.map +1 -0
  196. package/dist/db/migrations/20260820_000001_playground_conversations.js +47 -0
  197. package/dist/db/migrations/20260820_000001_playground_conversations.js.map +1 -0
  198. package/dist/db/migrations/20260823_000001_server_logs.d.ts +4 -0
  199. package/dist/db/migrations/20260823_000001_server_logs.d.ts.map +1 -0
  200. package/dist/db/migrations/20260823_000001_server_logs.js +53 -0
  201. package/dist/db/migrations/20260823_000001_server_logs.js.map +1 -0
  202. package/dist/db/migrations/20260823_000002_backups_table.d.ts +8 -0
  203. package/dist/db/migrations/20260823_000002_backups_table.d.ts.map +1 -0
  204. package/dist/db/migrations/20260823_000002_backups_table.js +22 -0
  205. package/dist/db/migrations/20260823_000002_backups_table.js.map +1 -0
  206. package/dist/db/migrations/20260823_000003_attempt_key_label.d.ts +19 -0
  207. package/dist/db/migrations/20260823_000003_attempt_key_label.d.ts.map +1 -0
  208. package/dist/db/migrations/20260823_000003_attempt_key_label.js +28 -0
  209. package/dist/db/migrations/20260823_000003_attempt_key_label.js.map +1 -0
  210. package/dist/db/migrations/20260823_000004_profile_auto_include.d.ts +14 -0
  211. package/dist/db/migrations/20260823_000004_profile_auto_include.d.ts.map +1 -0
  212. package/dist/db/migrations/20260823_000004_profile_auto_include.js +25 -0
  213. package/dist/db/migrations/20260823_000004_profile_auto_include.js.map +1 -0
  214. package/dist/db/migrations/20260901_000001_idempotency_claims.d.ts +4 -0
  215. package/dist/db/migrations/20260901_000001_idempotency_claims.d.ts.map +1 -0
  216. package/dist/db/migrations/20260901_000001_idempotency_claims.js +46 -0
  217. package/dist/db/migrations/20260901_000001_idempotency_claims.js.map +1 -0
  218. package/dist/db/migrations/20260901_000002_quota_observation_lookup.d.ts +4 -0
  219. package/dist/db/migrations/20260901_000002_quota_observation_lookup.d.ts.map +1 -0
  220. package/dist/db/migrations/20260901_000002_quota_observation_lookup.js +37 -0
  221. package/dist/db/migrations/20260901_000002_quota_observation_lookup.js.map +1 -0
  222. package/dist/db/migrations/20260901_000003_request_caller.d.ts +4 -0
  223. package/dist/db/migrations/20260901_000003_request_caller.d.ts.map +1 -0
  224. package/dist/db/migrations/20260901_000003_request_caller.js +27 -0
  225. package/dist/db/migrations/20260901_000003_request_caller.js.map +1 -0
  226. package/dist/db/migrations/20260902_000001_analytics_latency_percentile_index.d.ts +4 -0
  227. package/dist/db/migrations/20260902_000001_analytics_latency_percentile_index.d.ts.map +1 -0
  228. package/dist/db/migrations/20260902_000001_analytics_latency_percentile_index.js +35 -0
  229. package/dist/db/migrations/20260902_000001_analytics_latency_percentile_index.js.map +1 -0
  230. package/dist/db/migrations/20260903_000001_mcp_enabled_default.d.ts +4 -0
  231. package/dist/db/migrations/20260903_000001_mcp_enabled_default.d.ts.map +1 -0
  232. package/dist/db/migrations/20260903_000001_mcp_enabled_default.js +37 -0
  233. package/dist/db/migrations/20260903_000001_mcp_enabled_default.js.map +1 -0
  234. package/dist/db/migrations/20260903_000002_response_cache.d.ts +4 -0
  235. package/dist/db/migrations/20260903_000002_response_cache.d.ts.map +1 -0
  236. package/dist/db/migrations/20260903_000002_response_cache.js +53 -0
  237. package/dist/db/migrations/20260903_000002_response_cache.js.map +1 -0
  238. package/dist/db/migrations/20260904_000001_key_monthly_budget.d.ts +13 -0
  239. package/dist/db/migrations/20260904_000001_key_monthly_budget.d.ts.map +1 -0
  240. package/dist/db/migrations/20260904_000001_key_monthly_budget.js +35 -0
  241. package/dist/db/migrations/20260904_000001_key_monthly_budget.js.map +1 -0
  242. package/dist/db/migrations/20260913_000001_request_model_attribution.d.ts +4 -0
  243. package/dist/db/migrations/20260913_000001_request_model_attribution.d.ts.map +1 -0
  244. package/dist/db/migrations/20260913_000001_request_model_attribution.js +68 -0
  245. package/dist/db/migrations/20260913_000001_request_model_attribution.js.map +1 -0
  246. package/dist/db/migrations/20260914_000001_key_monthly_usage.d.ts +5 -0
  247. package/dist/db/migrations/20260914_000001_key_monthly_usage.d.ts.map +1 -0
  248. package/dist/db/migrations/20260914_000001_key_monthly_usage.js +37 -0
  249. package/dist/db/migrations/20260914_000001_key_monthly_usage.js.map +1 -0
  250. package/dist/db/migrations/20260915_000001_quota_snapshot_freshness.d.ts +4 -0
  251. package/dist/db/migrations/20260915_000001_quota_snapshot_freshness.d.ts.map +1 -0
  252. package/dist/db/migrations/20260915_000001_quota_snapshot_freshness.js +28 -0
  253. package/dist/db/migrations/20260915_000001_quota_snapshot_freshness.js.map +1 -0
  254. package/dist/db/migrations/20261004_000001_unified_key_sr_prefix.d.ts +4 -0
  255. package/dist/db/migrations/20261004_000001_unified_key_sr_prefix.d.ts.map +1 -0
  256. package/dist/db/migrations/20261004_000001_unified_key_sr_prefix.js +25 -0
  257. package/dist/db/migrations/20261004_000001_unified_key_sr_prefix.js.map +1 -0
  258. package/dist/db/migrations/20261005_000001_key_budget_period.d.ts +10 -0
  259. package/dist/db/migrations/20261005_000001_key_budget_period.d.ts.map +1 -0
  260. package/dist/db/migrations/20261005_000001_key_budget_period.js +78 -0
  261. package/dist/db/migrations/20261005_000001_key_budget_period.js.map +1 -0
  262. package/dist/db/migrations/20261005_000002_key_budget_period_auto.d.ts +21 -0
  263. package/dist/db/migrations/20261005_000002_key_budget_period_auto.d.ts.map +1 -0
  264. package/dist/db/migrations/20261005_000002_key_budget_period_auto.js +41 -0
  265. package/dist/db/migrations/20261005_000002_key_budget_period_auto.js.map +1 -0
  266. package/dist/db/model-pricing.d.ts +39 -0
  267. package/dist/db/model-pricing.d.ts.map +1 -0
  268. package/dist/db/model-pricing.js +274 -0
  269. package/dist/db/model-pricing.js.map +1 -0
  270. package/dist/db/node-sqlite.d.ts +9 -0
  271. package/dist/db/node-sqlite.d.ts.map +1 -0
  272. package/dist/db/node-sqlite.js +87 -0
  273. package/dist/db/node-sqlite.js.map +1 -0
  274. package/dist/db/types.d.ts +22 -0
  275. package/dist/db/types.d.ts.map +1 -0
  276. package/dist/db/types.js +2 -0
  277. package/dist/db/types.js.map +1 -0
  278. package/dist/docs/docs-page.d.ts +2 -0
  279. package/dist/docs/docs-page.d.ts.map +1 -0
  280. package/dist/docs/docs-page.js +319 -0
  281. package/dist/docs/docs-page.js.map +1 -0
  282. package/dist/docs/openapi.d.ts +1896 -0
  283. package/dist/docs/openapi.d.ts.map +1 -0
  284. package/dist/docs/openapi.js +1096 -0
  285. package/dist/docs/openapi.js.map +1 -0
  286. package/dist/env.d.ts +2 -0
  287. package/dist/env.d.ts.map +1 -0
  288. package/dist/env.js +9 -0
  289. package/dist/env.js.map +1 -0
  290. package/dist/index.d.ts +2 -0
  291. package/dist/index.d.ts.map +1 -0
  292. package/dist/index.js +144 -0
  293. package/dist/index.js.map +1 -0
  294. package/dist/lib/anthropic-documents.d.ts +41 -0
  295. package/dist/lib/anthropic-documents.d.ts.map +1 -0
  296. package/dist/lib/anthropic-documents.js +132 -0
  297. package/dist/lib/anthropic-documents.js.map +1 -0
  298. package/dist/lib/app-version.d.ts +5 -0
  299. package/dist/lib/app-version.d.ts.map +1 -0
  300. package/dist/lib/app-version.js +61 -0
  301. package/dist/lib/app-version.js.map +1 -0
  302. package/dist/lib/attempt-trace.d.ts +23 -0
  303. package/dist/lib/attempt-trace.d.ts.map +1 -0
  304. package/dist/lib/attempt-trace.js +32 -0
  305. package/dist/lib/attempt-trace.js.map +1 -0
  306. package/dist/lib/budget.d.ts +6 -0
  307. package/dist/lib/budget.d.ts.map +1 -0
  308. package/dist/lib/budget.js +40 -0
  309. package/dist/lib/budget.js.map +1 -0
  310. package/dist/lib/client-classifier.d.ts +10 -0
  311. package/dist/lib/client-classifier.d.ts.map +1 -0
  312. package/dist/lib/client-classifier.js +126 -0
  313. package/dist/lib/client-classifier.js.map +1 -0
  314. package/dist/lib/client-context.d.ts +10 -0
  315. package/dist/lib/client-context.d.ts.map +1 -0
  316. package/dist/lib/client-context.js +39 -0
  317. package/dist/lib/client-context.js.map +1 -0
  318. package/dist/lib/config.d.ts +33 -0
  319. package/dist/lib/config.d.ts.map +1 -0
  320. package/dist/lib/config.js +94 -0
  321. package/dist/lib/config.js.map +1 -0
  322. package/dist/lib/content.d.ts +33 -0
  323. package/dist/lib/content.d.ts.map +1 -0
  324. package/dist/lib/content.js +201 -0
  325. package/dist/lib/content.js.map +1 -0
  326. package/dist/lib/credential.d.ts +11 -0
  327. package/dist/lib/credential.d.ts.map +1 -0
  328. package/dist/lib/credential.js +18 -0
  329. package/dist/lib/credential.js.map +1 -0
  330. package/dist/lib/crypto.d.ts +31 -0
  331. package/dist/lib/crypto.d.ts.map +1 -0
  332. package/dist/lib/crypto.js +206 -0
  333. package/dist/lib/crypto.js.map +1 -0
  334. package/dist/lib/custom-provider-cleanup.d.ts +13 -0
  335. package/dist/lib/custom-provider-cleanup.d.ts.map +1 -0
  336. package/dist/lib/custom-provider-cleanup.js +43 -0
  337. package/dist/lib/custom-provider-cleanup.js.map +1 -0
  338. package/dist/lib/db-backup.d.ts +31 -0
  339. package/dist/lib/db-backup.d.ts.map +1 -0
  340. package/dist/lib/db-backup.js +255 -0
  341. package/dist/lib/db-backup.js.map +1 -0
  342. package/dist/lib/endpoint-scope.d.ts +42 -0
  343. package/dist/lib/endpoint-scope.d.ts.map +1 -0
  344. package/dist/lib/endpoint-scope.js +95 -0
  345. package/dist/lib/endpoint-scope.js.map +1 -0
  346. package/dist/lib/env-drift.d.ts +17 -0
  347. package/dist/lib/env-drift.d.ts.map +1 -0
  348. package/dist/lib/env-drift.js +108 -0
  349. package/dist/lib/env-drift.js.map +1 -0
  350. package/dist/lib/error-classify.d.ts +40 -0
  351. package/dist/lib/error-classify.d.ts.map +1 -0
  352. package/dist/lib/error-classify.js +687 -0
  353. package/dist/lib/error-classify.js.map +1 -0
  354. package/dist/lib/error-redaction.d.ts +8 -0
  355. package/dist/lib/error-redaction.d.ts.map +1 -0
  356. package/dist/lib/error-redaction.js +45 -0
  357. package/dist/lib/error-redaction.js.map +1 -0
  358. package/dist/lib/fallback-loop.d.ts +306 -0
  359. package/dist/lib/fallback-loop.d.ts.map +1 -0
  360. package/dist/lib/fallback-loop.js +1336 -0
  361. package/dist/lib/fallback-loop.js.map +1 -0
  362. package/dist/lib/file-permissions.d.ts +98 -0
  363. package/dist/lib/file-permissions.d.ts.map +1 -0
  364. package/dist/lib/file-permissions.js +159 -0
  365. package/dist/lib/file-permissions.js.map +1 -0
  366. package/dist/lib/gemini-wire.d.ts +76 -0
  367. package/dist/lib/gemini-wire.d.ts.map +1 -0
  368. package/dist/lib/gemini-wire.js +392 -0
  369. package/dist/lib/gemini-wire.js.map +1 -0
  370. package/dist/lib/guardrails.d.ts +37 -0
  371. package/dist/lib/guardrails.d.ts.map +1 -0
  372. package/dist/lib/guardrails.js +106 -0
  373. package/dist/lib/guardrails.js.map +1 -0
  374. package/dist/lib/header-value.d.ts +8 -0
  375. package/dist/lib/header-value.d.ts.map +1 -0
  376. package/dist/lib/header-value.js +55 -0
  377. package/dist/lib/header-value.js.map +1 -0
  378. package/dist/lib/image-normalize.d.ts +21 -0
  379. package/dist/lib/image-normalize.d.ts.map +1 -0
  380. package/dist/lib/image-normalize.js +218 -0
  381. package/dist/lib/image-normalize.js.map +1 -0
  382. package/dist/lib/inbound-chat.d.ts +48 -0
  383. package/dist/lib/inbound-chat.d.ts.map +1 -0
  384. package/dist/lib/inbound-chat.js +406 -0
  385. package/dist/lib/inbound-chat.js.map +1 -0
  386. package/dist/lib/key-parser.d.ts +79 -0
  387. package/dist/lib/key-parser.d.ts.map +1 -0
  388. package/dist/lib/key-parser.js +701 -0
  389. package/dist/lib/key-parser.js.map +1 -0
  390. package/dist/lib/key-proxy.d.ts +49 -0
  391. package/dist/lib/key-proxy.d.ts.map +1 -0
  392. package/dist/lib/key-proxy.js +92 -0
  393. package/dist/lib/key-proxy.js.map +1 -0
  394. package/dist/lib/log-redaction.d.ts +28 -0
  395. package/dist/lib/log-redaction.d.ts.map +1 -0
  396. package/dist/lib/log-redaction.js +166 -0
  397. package/dist/lib/log-redaction.js.map +1 -0
  398. package/dist/lib/model-scope.d.ts +9 -0
  399. package/dist/lib/model-scope.d.ts.map +1 -0
  400. package/dist/lib/model-scope.js +29 -0
  401. package/dist/lib/model-scope.js.map +1 -0
  402. package/dist/lib/one-time-code.d.ts +15 -0
  403. package/dist/lib/one-time-code.d.ts.map +1 -0
  404. package/dist/lib/one-time-code.js +41 -0
  405. package/dist/lib/one-time-code.js.map +1 -0
  406. package/dist/lib/output-cap.d.ts +24 -0
  407. package/dist/lib/output-cap.d.ts.map +1 -0
  408. package/dist/lib/output-cap.js +80 -0
  409. package/dist/lib/output-cap.js.map +1 -0
  410. package/dist/lib/password.d.ts +3 -0
  411. package/dist/lib/password.d.ts.map +1 -0
  412. package/dist/lib/password.js +27 -0
  413. package/dist/lib/password.js.map +1 -0
  414. package/dist/lib/process-safety-net.d.ts +32 -0
  415. package/dist/lib/process-safety-net.d.ts.map +1 -0
  416. package/dist/lib/process-safety-net.js +123 -0
  417. package/dist/lib/process-safety-net.js.map +1 -0
  418. package/dist/lib/provider-identity.d.ts +37 -0
  419. package/dist/lib/provider-identity.d.ts.map +1 -0
  420. package/dist/lib/provider-identity.js +110 -0
  421. package/dist/lib/provider-identity.js.map +1 -0
  422. package/dist/lib/provider-size-parser.d.ts +6 -0
  423. package/dist/lib/provider-size-parser.d.ts.map +1 -0
  424. package/dist/lib/provider-size-parser.js +72 -0
  425. package/dist/lib/provider-size-parser.js.map +1 -0
  426. package/dist/lib/provider-timeout.d.ts +17 -0
  427. package/dist/lib/provider-timeout.d.ts.map +1 -0
  428. package/dist/lib/provider-timeout.js +70 -0
  429. package/dist/lib/provider-timeout.js.map +1 -0
  430. package/dist/lib/proxy.d.ts +180 -0
  431. package/dist/lib/proxy.d.ts.map +1 -0
  432. package/dist/lib/proxy.js +1002 -0
  433. package/dist/lib/proxy.js.map +1 -0
  434. package/dist/lib/request-log.d.ts +4 -0
  435. package/dist/lib/request-log.d.ts.map +1 -0
  436. package/dist/lib/request-log.js +161 -0
  437. package/dist/lib/request-log.js.map +1 -0
  438. package/dist/lib/reset-code.d.ts +5 -0
  439. package/dist/lib/reset-code.d.ts.map +1 -0
  440. package/dist/lib/reset-code.js +39 -0
  441. package/dist/lib/reset-code.js.map +1 -0
  442. package/dist/lib/retry-hint.d.ts +14 -0
  443. package/dist/lib/retry-hint.d.ts.map +1 -0
  444. package/dist/lib/retry-hint.js +36 -0
  445. package/dist/lib/retry-hint.js.map +1 -0
  446. package/dist/lib/route-live.d.ts +29 -0
  447. package/dist/lib/route-live.d.ts.map +1 -0
  448. package/dist/lib/route-live.js +97 -0
  449. package/dist/lib/route-live.js.map +1 -0
  450. package/dist/lib/sampling-params.d.ts +183 -0
  451. package/dist/lib/sampling-params.d.ts.map +1 -0
  452. package/dist/lib/sampling-params.js +386 -0
  453. package/dist/lib/sampling-params.js.map +1 -0
  454. package/dist/lib/scheduler.d.ts +13 -0
  455. package/dist/lib/scheduler.d.ts.map +1 -0
  456. package/dist/lib/scheduler.js +11 -0
  457. package/dist/lib/scheduler.js.map +1 -0
  458. package/dist/lib/served-model.d.ts +16 -0
  459. package/dist/lib/served-model.d.ts.map +1 -0
  460. package/dist/lib/served-model.js +0 -0
  461. package/dist/lib/served-model.js.map +1 -0
  462. package/dist/lib/server-logs.d.ts +132 -0
  463. package/dist/lib/server-logs.d.ts.map +1 -0
  464. package/dist/lib/server-logs.js +473 -0
  465. package/dist/lib/server-logs.js.map +1 -0
  466. package/dist/lib/setup-code.d.ts +5 -0
  467. package/dist/lib/setup-code.d.ts.map +1 -0
  468. package/dist/lib/setup-code.js +35 -0
  469. package/dist/lib/setup-code.js.map +1 -0
  470. package/dist/lib/structured-output.d.ts +9 -0
  471. package/dist/lib/structured-output.d.ts.map +1 -0
  472. package/dist/lib/structured-output.js +72 -0
  473. package/dist/lib/structured-output.js.map +1 -0
  474. package/dist/lib/system-prompt.d.ts +30 -0
  475. package/dist/lib/system-prompt.d.ts.map +1 -0
  476. package/dist/lib/system-prompt.js +66 -0
  477. package/dist/lib/system-prompt.js.map +1 -0
  478. package/dist/lib/task-type.d.ts +18 -0
  479. package/dist/lib/task-type.d.ts.map +1 -0
  480. package/dist/lib/task-type.js +92 -0
  481. package/dist/lib/task-type.js.map +1 -0
  482. package/dist/lib/think-tags.d.ts +37 -0
  483. package/dist/lib/think-tags.d.ts.map +1 -0
  484. package/dist/lib/think-tags.js +203 -0
  485. package/dist/lib/think-tags.js.map +1 -0
  486. package/dist/lib/tool-args.d.ts +36 -0
  487. package/dist/lib/tool-args.d.ts.map +1 -0
  488. package/dist/lib/tool-args.js +190 -0
  489. package/dist/lib/tool-args.js.map +1 -0
  490. package/dist/lib/tool-call-rescue.d.ts +62 -0
  491. package/dist/lib/tool-call-rescue.d.ts.map +1 -0
  492. package/dist/lib/tool-call-rescue.js +258 -0
  493. package/dist/lib/tool-call-rescue.js.map +1 -0
  494. package/dist/lib/tool-capability.d.ts +13 -0
  495. package/dist/lib/tool-capability.d.ts.map +1 -0
  496. package/dist/lib/tool-capability.js +70 -0
  497. package/dist/lib/tool-capability.js.map +1 -0
  498. package/dist/lib/tool-validate.d.ts +44 -0
  499. package/dist/lib/tool-validate.d.ts.map +1 -0
  500. package/dist/lib/tool-validate.js +165 -0
  501. package/dist/lib/tool-validate.js.map +1 -0
  502. package/dist/lib/ttfb-budget.d.ts +13 -0
  503. package/dist/lib/ttfb-budget.d.ts.map +1 -0
  504. package/dist/lib/ttfb-budget.js +153 -0
  505. package/dist/lib/ttfb-budget.js.map +1 -0
  506. package/dist/lib/url-guard.d.ts +47 -0
  507. package/dist/lib/url-guard.d.ts.map +1 -0
  508. package/dist/lib/url-guard.js +229 -0
  509. package/dist/lib/url-guard.js.map +1 -0
  510. package/dist/lib/wake-detect.d.ts +12 -0
  511. package/dist/lib/wake-detect.d.ts.map +1 -0
  512. package/dist/lib/wake-detect.js +99 -0
  513. package/dist/lib/wake-detect.js.map +1 -0
  514. package/dist/middleware/errorHandler.d.ts +3 -0
  515. package/dist/middleware/errorHandler.d.ts.map +1 -0
  516. package/dist/middleware/errorHandler.js +45 -0
  517. package/dist/middleware/errorHandler.js.map +1 -0
  518. package/dist/middleware/rateLimit.d.ts +4 -0
  519. package/dist/middleware/rateLimit.d.ts.map +1 -0
  520. package/dist/middleware/rateLimit.js +125 -0
  521. package/dist/middleware/rateLimit.js.map +1 -0
  522. package/dist/middleware/requireAuth.d.ts +3 -0
  523. package/dist/middleware/requireAuth.d.ts.map +1 -0
  524. package/dist/middleware/requireAuth.js +17 -0
  525. package/dist/middleware/requireAuth.js.map +1 -0
  526. package/dist/providers/aclide.d.ts +18 -0
  527. package/dist/providers/aclide.d.ts.map +1 -0
  528. package/dist/providers/aclide.js +174 -0
  529. package/dist/providers/aclide.js.map +1 -0
  530. package/dist/providers/aihorde.d.ts +42 -0
  531. package/dist/providers/aihorde.d.ts.map +1 -0
  532. package/dist/providers/aihorde.js +192 -0
  533. package/dist/providers/aihorde.js.map +1 -0
  534. package/dist/providers/airforce.d.ts +11 -0
  535. package/dist/providers/airforce.d.ts.map +1 -0
  536. package/dist/providers/airforce.js +32 -0
  537. package/dist/providers/airforce.js.map +1 -0
  538. package/dist/providers/base.d.ts +177 -0
  539. package/dist/providers/base.d.ts.map +1 -0
  540. package/dist/providers/base.js +354 -0
  541. package/dist/providers/base.js.map +1 -0
  542. package/dist/providers/blaze.d.ts +11 -0
  543. package/dist/providers/blaze.d.ts.map +1 -0
  544. package/dist/providers/blaze.js +33 -0
  545. package/dist/providers/blaze.js.map +1 -0
  546. package/dist/providers/blockrun.d.ts +14 -0
  547. package/dist/providers/blockrun.d.ts.map +1 -0
  548. package/dist/providers/blockrun.js +36 -0
  549. package/dist/providers/blockrun.js.map +1 -0
  550. package/dist/providers/clod.d.ts +11 -0
  551. package/dist/providers/clod.d.ts.map +1 -0
  552. package/dist/providers/clod.js +39 -0
  553. package/dist/providers/clod.js.map +1 -0
  554. package/dist/providers/cloudflare.d.ts +15 -0
  555. package/dist/providers/cloudflare.d.ts.map +1 -0
  556. package/dist/providers/cloudflare.js +175 -0
  557. package/dist/providers/cloudflare.js.map +1 -0
  558. package/dist/providers/cohere.d.ts +11 -0
  559. package/dist/providers/cohere.d.ts.map +1 -0
  560. package/dist/providers/cohere.js +117 -0
  561. package/dist/providers/cohere.js.map +1 -0
  562. package/dist/providers/dreamprompting.d.ts +11 -0
  563. package/dist/providers/dreamprompting.d.ts.map +1 -0
  564. package/dist/providers/dreamprompting.js +41 -0
  565. package/dist/providers/dreamprompting.js.map +1 -0
  566. package/dist/providers/electronhub.d.ts +10 -0
  567. package/dist/providers/electronhub.d.ts.map +1 -0
  568. package/dist/providers/electronhub.js +56 -0
  569. package/dist/providers/electronhub.js.map +1 -0
  570. package/dist/providers/experiential.d.ts +10 -0
  571. package/dist/providers/experiential.d.ts.map +1 -0
  572. package/dist/providers/experiential.js +33 -0
  573. package/dist/providers/experiential.js.map +1 -0
  574. package/dist/providers/gizmo.d.ts +15 -0
  575. package/dist/providers/gizmo.d.ts.map +1 -0
  576. package/dist/providers/gizmo.js +54 -0
  577. package/dist/providers/gizmo.js.map +1 -0
  578. package/dist/providers/google.d.ts +30 -0
  579. package/dist/providers/google.d.ts.map +1 -0
  580. package/dist/providers/google.js +766 -0
  581. package/dist/providers/google.js.map +1 -0
  582. package/dist/providers/index.d.ts +13 -0
  583. package/dist/providers/index.d.ts.map +1 -0
  584. package/dist/providers/index.js +561 -0
  585. package/dist/providers/index.js.map +1 -0
  586. package/dist/providers/llmtr.d.ts +15 -0
  587. package/dist/providers/llmtr.d.ts.map +1 -0
  588. package/dist/providers/llmtr.js +51 -0
  589. package/dist/providers/llmtr.js.map +1 -0
  590. package/dist/providers/logfare.d.ts +11 -0
  591. package/dist/providers/logfare.d.ts.map +1 -0
  592. package/dist/providers/logfare.js +33 -0
  593. package/dist/providers/logfare.js.map +1 -0
  594. package/dist/providers/lucidity.d.ts +11 -0
  595. package/dist/providers/lucidity.d.ts.map +1 -0
  596. package/dist/providers/lucidity.js +37 -0
  597. package/dist/providers/lucidity.js.map +1 -0
  598. package/dist/providers/modelscope.d.ts +50 -0
  599. package/dist/providers/modelscope.d.ts.map +1 -0
  600. package/dist/providers/modelscope.js +143 -0
  601. package/dist/providers/modelscope.js.map +1 -0
  602. package/dist/providers/moondream.d.ts +17 -0
  603. package/dist/providers/moondream.d.ts.map +1 -0
  604. package/dist/providers/moondream.js +140 -0
  605. package/dist/providers/moondream.js.map +1 -0
  606. package/dist/providers/openai-compat.d.ts +140 -0
  607. package/dist/providers/openai-compat.d.ts.map +1 -0
  608. package/dist/providers/openai-compat.js +537 -0
  609. package/dist/providers/openai-compat.js.map +1 -0
  610. package/dist/providers/opencode-free.d.ts +24 -0
  611. package/dist/providers/opencode-free.d.ts.map +1 -0
  612. package/dist/providers/opencode-free.js +262 -0
  613. package/dist/providers/opencode-free.js.map +1 -0
  614. package/dist/providers/pollinations.d.ts +32 -0
  615. package/dist/providers/pollinations.d.ts.map +1 -0
  616. package/dist/providers/pollinations.js +65 -0
  617. package/dist/providers/pollinations.js.map +1 -0
  618. package/dist/providers/router9.d.ts +16 -0
  619. package/dist/providers/router9.d.ts.map +1 -0
  620. package/dist/providers/router9.js +42 -0
  621. package/dist/providers/router9.js.map +1 -0
  622. package/dist/providers/sail.d.ts +44 -0
  623. package/dist/providers/sail.d.ts.map +1 -0
  624. package/dist/providers/sail.js +302 -0
  625. package/dist/providers/sail.js.map +1 -0
  626. package/dist/providers/septor.d.ts +10 -0
  627. package/dist/providers/septor.d.ts.map +1 -0
  628. package/dist/providers/septor.js +36 -0
  629. package/dist/providers/septor.js.map +1 -0
  630. package/dist/providers/speechify.d.ts +14 -0
  631. package/dist/providers/speechify.d.ts.map +1 -0
  632. package/dist/providers/speechify.js +28 -0
  633. package/dist/providers/speechify.js.map +1 -0
  634. package/dist/providers/speka.d.ts +12 -0
  635. package/dist/providers/speka.d.ts.map +1 -0
  636. package/dist/providers/speka.js +37 -0
  637. package/dist/providers/speka.js.map +1 -0
  638. package/dist/providers/waterfall.d.ts +11 -0
  639. package/dist/providers/waterfall.d.ts.map +1 -0
  640. package/dist/providers/waterfall.js +33 -0
  641. package/dist/providers/waterfall.js.map +1 -0
  642. package/dist/providers/xkiro.d.ts +71 -0
  643. package/dist/providers/xkiro.d.ts.map +1 -0
  644. package/dist/providers/xkiro.js +119 -0
  645. package/dist/providers/xkiro.js.map +1 -0
  646. package/dist/providers/zhipu.d.ts +43 -0
  647. package/dist/providers/zhipu.d.ts.map +1 -0
  648. package/dist/providers/zhipu.js +95 -0
  649. package/dist/providers/zhipu.js.map +1 -0
  650. package/dist/routes/analytics.d.ts +2 -0
  651. package/dist/routes/analytics.d.ts.map +1 -0
  652. package/dist/routes/analytics.js +738 -0
  653. package/dist/routes/analytics.js.map +1 -0
  654. package/dist/routes/anthropic.d.ts +7 -0
  655. package/dist/routes/anthropic.d.ts.map +1 -0
  656. package/dist/routes/anthropic.js +1076 -0
  657. package/dist/routes/anthropic.js.map +1 -0
  658. package/dist/routes/auth.d.ts +2 -0
  659. package/dist/routes/auth.d.ts.map +1 -0
  660. package/dist/routes/auth.js +310 -0
  661. package/dist/routes/auth.js.map +1 -0
  662. package/dist/routes/backups.d.ts +2 -0
  663. package/dist/routes/backups.d.ts.map +1 -0
  664. package/dist/routes/backups.js +127 -0
  665. package/dist/routes/backups.js.map +1 -0
  666. package/dist/routes/cache.d.ts +2 -0
  667. package/dist/routes/cache.d.ts.map +1 -0
  668. package/dist/routes/cache.js +40 -0
  669. package/dist/routes/cache.js.map +1 -0
  670. package/dist/routes/client-profiles.d.ts +2 -0
  671. package/dist/routes/client-profiles.d.ts.map +1 -0
  672. package/dist/routes/client-profiles.js +128 -0
  673. package/dist/routes/client-profiles.js.map +1 -0
  674. package/dist/routes/compression.d.ts +2 -0
  675. package/dist/routes/compression.d.ts.map +1 -0
  676. package/dist/routes/compression.js +82 -0
  677. package/dist/routes/compression.js.map +1 -0
  678. package/dist/routes/conversations.d.ts +3 -0
  679. package/dist/routes/conversations.d.ts.map +1 -0
  680. package/dist/routes/conversations.js +215 -0
  681. package/dist/routes/conversations.js.map +1 -0
  682. package/dist/routes/docs.d.ts +2 -0
  683. package/dist/routes/docs.d.ts.map +1 -0
  684. package/dist/routes/docs.js +21 -0
  685. package/dist/routes/docs.js.map +1 -0
  686. package/dist/routes/embeddings.d.ts +2 -0
  687. package/dist/routes/embeddings.d.ts.map +1 -0
  688. package/dist/routes/embeddings.js +255 -0
  689. package/dist/routes/embeddings.js.map +1 -0
  690. package/dist/routes/fallback.d.ts +2 -0
  691. package/dist/routes/fallback.d.ts.map +1 -0
  692. package/dist/routes/fallback.js +631 -0
  693. package/dist/routes/fallback.js.map +1 -0
  694. package/dist/routes/free-tier.d.ts +22 -0
  695. package/dist/routes/free-tier.d.ts.map +1 -0
  696. package/dist/routes/free-tier.js +175 -0
  697. package/dist/routes/free-tier.js.map +1 -0
  698. package/dist/routes/gemini.d.ts +2 -0
  699. package/dist/routes/gemini.d.ts.map +1 -0
  700. package/dist/routes/gemini.js +218 -0
  701. package/dist/routes/gemini.js.map +1 -0
  702. package/dist/routes/health.d.ts +2 -0
  703. package/dist/routes/health.d.ts.map +1 -0
  704. package/dist/routes/health.js +72 -0
  705. package/dist/routes/health.js.map +1 -0
  706. package/dist/routes/keys.d.ts +17 -0
  707. package/dist/routes/keys.d.ts.map +1 -0
  708. package/dist/routes/keys.js +1787 -0
  709. package/dist/routes/keys.js.map +1 -0
  710. package/dist/routes/logs.d.ts +2 -0
  711. package/dist/routes/logs.d.ts.map +1 -0
  712. package/dist/routes/logs.js +88 -0
  713. package/dist/routes/logs.js.map +1 -0
  714. package/dist/routes/mcp.d.ts +4 -0
  715. package/dist/routes/mcp.d.ts.map +1 -0
  716. package/dist/routes/mcp.js +563 -0
  717. package/dist/routes/mcp.js.map +1 -0
  718. package/dist/routes/media.d.ts +2 -0
  719. package/dist/routes/media.d.ts.map +1 -0
  720. package/dist/routes/media.js +180 -0
  721. package/dist/routes/media.js.map +1 -0
  722. package/dist/routes/models.d.ts +2 -0
  723. package/dist/routes/models.d.ts.map +1 -0
  724. package/dist/routes/models.js +439 -0
  725. package/dist/routes/models.js.map +1 -0
  726. package/dist/routes/ollama.d.ts +7 -0
  727. package/dist/routes/ollama.d.ts.map +1 -0
  728. package/dist/routes/ollama.js +595 -0
  729. package/dist/routes/ollama.js.map +1 -0
  730. package/dist/routes/profiles.d.ts +3 -0
  731. package/dist/routes/profiles.d.ts.map +1 -0
  732. package/dist/routes/profiles.js +431 -0
  733. package/dist/routes/profiles.js.map +1 -0
  734. package/dist/routes/proxy.d.ts +32 -0
  735. package/dist/routes/proxy.d.ts.map +1 -0
  736. package/dist/routes/proxy.js +2793 -0
  737. package/dist/routes/proxy.js.map +1 -0
  738. package/dist/routes/responses.d.ts +1161 -0
  739. package/dist/routes/responses.d.ts.map +1 -0
  740. package/dist/routes/responses.js +1521 -0
  741. package/dist/routes/responses.js.map +1 -0
  742. package/dist/routes/settings.d.ts +2 -0
  743. package/dist/routes/settings.d.ts.map +1 -0
  744. package/dist/routes/settings.js +549 -0
  745. package/dist/routes/settings.js.map +1 -0
  746. package/dist/routes/status.d.ts +3 -0
  747. package/dist/routes/status.d.ts.map +1 -0
  748. package/dist/routes/status.js +214 -0
  749. package/dist/routes/status.js.map +1 -0
  750. package/dist/routes/update.d.ts +31 -0
  751. package/dist/routes/update.d.ts.map +1 -0
  752. package/dist/routes/update.js +536 -0
  753. package/dist/routes/update.js.map +1 -0
  754. package/dist/routes/url-tokens.d.ts +2 -0
  755. package/dist/routes/url-tokens.d.ts.map +1 -0
  756. package/dist/routes/url-tokens.js +31 -0
  757. package/dist/routes/url-tokens.js.map +1 -0
  758. package/dist/scripts/export-catalog.d.ts +2 -0
  759. package/dist/scripts/export-catalog.d.ts.map +1 -0
  760. package/dist/scripts/export-catalog.js +114 -0
  761. package/dist/scripts/export-catalog.js.map +1 -0
  762. package/dist/scripts/rotate-encryption-key.d.ts +81 -0
  763. package/dist/scripts/rotate-encryption-key.d.ts.map +1 -0
  764. package/dist/scripts/rotate-encryption-key.js +232 -0
  765. package/dist/scripts/rotate-encryption-key.js.map +1 -0
  766. package/dist/scripts/routing-sim.d.ts +2 -0
  767. package/dist/scripts/routing-sim.d.ts.map +1 -0
  768. package/dist/scripts/routing-sim.js +130 -0
  769. package/dist/scripts/routing-sim.js.map +1 -0
  770. package/dist/scripts/test-all-models.d.ts +2 -0
  771. package/dist/scripts/test-all-models.d.ts.map +1 -0
  772. package/dist/scripts/test-all-models.js +56 -0
  773. package/dist/scripts/test-all-models.js.map +1 -0
  774. package/dist/services/anthropic-map.d.ts +39 -0
  775. package/dist/services/anthropic-map.d.ts.map +1 -0
  776. package/dist/services/anthropic-map.js +138 -0
  777. package/dist/services/anthropic-map.js.map +1 -0
  778. package/dist/services/auth.d.ts +30 -0
  779. package/dist/services/auth.d.ts.map +1 -0
  780. package/dist/services/auth.js +124 -0
  781. package/dist/services/auth.js.map +1 -0
  782. package/dist/services/auto-discover.d.ts +77 -0
  783. package/dist/services/auto-discover.d.ts.map +1 -0
  784. package/dist/services/auto-discover.js +1047 -0
  785. package/dist/services/auto-discover.js.map +1 -0
  786. package/dist/services/backups.d.ts +67 -0
  787. package/dist/services/backups.d.ts.map +1 -0
  788. package/dist/services/backups.js +444 -0
  789. package/dist/services/backups.js.map +1 -0
  790. package/dist/services/builtin-model-discovery.d.ts +107 -0
  791. package/dist/services/builtin-model-discovery.d.ts.map +1 -0
  792. package/dist/services/builtin-model-discovery.js +296 -0
  793. package/dist/services/builtin-model-discovery.js.map +1 -0
  794. package/dist/services/cache.d.ts +190 -0
  795. package/dist/services/cache.d.ts.map +1 -0
  796. package/dist/services/cache.js +617 -0
  797. package/dist/services/cache.js.map +1 -0
  798. package/dist/services/catalog-sync.d.ts +257 -0
  799. package/dist/services/catalog-sync.d.ts.map +1 -0
  800. package/dist/services/catalog-sync.js +1041 -0
  801. package/dist/services/catalog-sync.js.map +1 -0
  802. package/dist/services/compression/config.d.ts +33 -0
  803. package/dist/services/compression/config.d.ts.map +1 -0
  804. package/dist/services/compression/config.js +158 -0
  805. package/dist/services/compression/config.js.map +1 -0
  806. package/dist/services/compression/engines/aging.d.ts +2 -0
  807. package/dist/services/compression/engines/aging.d.ts.map +1 -0
  808. package/dist/services/compression/engines/aging.js +53 -0
  809. package/dist/services/compression/engines/aging.js.map +1 -0
  810. package/dist/services/compression/engines/custom-filters.d.ts +4 -0
  811. package/dist/services/compression/engines/custom-filters.d.ts.map +1 -0
  812. package/dist/services/compression/engines/custom-filters.js +49 -0
  813. package/dist/services/compression/engines/custom-filters.js.map +1 -0
  814. package/dist/services/compression/engines/dedup.d.ts +2 -0
  815. package/dist/services/compression/engines/dedup.d.ts.map +1 -0
  816. package/dist/services/compression/engines/dedup.js +61 -0
  817. package/dist/services/compression/engines/dedup.js.map +1 -0
  818. package/dist/services/compression/engines/filter-definitions.d.ts +75 -0
  819. package/dist/services/compression/engines/filter-definitions.d.ts.map +1 -0
  820. package/dist/services/compression/engines/filter-definitions.js +45 -0
  821. package/dist/services/compression/engines/filter-definitions.js.map +1 -0
  822. package/dist/services/compression/engines/hard-budget.d.ts +2 -0
  823. package/dist/services/compression/engines/hard-budget.d.ts.map +1 -0
  824. package/dist/services/compression/engines/hard-budget.js +52 -0
  825. package/dist/services/compression/engines/hard-budget.js.map +1 -0
  826. package/dist/services/compression/engines/index.d.ts +9 -0
  827. package/dist/services/compression/engines/index.d.ts.map +1 -0
  828. package/dist/services/compression/engines/index.js +9 -0
  829. package/dist/services/compression/engines/index.js.map +1 -0
  830. package/dist/services/compression/engines/jsoncompact.d.ts +3 -0
  831. package/dist/services/compression/engines/jsoncompact.d.ts.map +1 -0
  832. package/dist/services/compression/engines/jsoncompact.js +145 -0
  833. package/dist/services/compression/engines/jsoncompact.js.map +1 -0
  834. package/dist/services/compression/engines/lite.d.ts +2 -0
  835. package/dist/services/compression/engines/lite.d.ts.map +1 -0
  836. package/dist/services/compression/engines/lite.js +34 -0
  837. package/dist/services/compression/engines/lite.js.map +1 -0
  838. package/dist/services/compression/engines/read-lifecycle.d.ts +2 -0
  839. package/dist/services/compression/engines/read-lifecycle.d.ts.map +1 -0
  840. package/dist/services/compression/engines/read-lifecycle.js +70 -0
  841. package/dist/services/compression/engines/read-lifecycle.js.map +1 -0
  842. package/dist/services/compression/engines/relevance.d.ts +2 -0
  843. package/dist/services/compression/engines/relevance.d.ts.map +1 -0
  844. package/dist/services/compression/engines/relevance.js +74 -0
  845. package/dist/services/compression/engines/relevance.js.map +1 -0
  846. package/dist/services/compression/engines/toolfilter.d.ts +2 -0
  847. package/dist/services/compression/engines/toolfilter.d.ts.map +1 -0
  848. package/dist/services/compression/engines/toolfilter.js +195 -0
  849. package/dist/services/compression/engines/toolfilter.js.map +1 -0
  850. package/dist/services/compression/fidelity-gate.d.ts +12 -0
  851. package/dist/services/compression/fidelity-gate.d.ts.map +1 -0
  852. package/dist/services/compression/fidelity-gate.js +90 -0
  853. package/dist/services/compression/fidelity-gate.js.map +1 -0
  854. package/dist/services/compression/helpers.d.ts +9 -0
  855. package/dist/services/compression/helpers.d.ts.map +1 -0
  856. package/dist/services/compression/helpers.js +52 -0
  857. package/dist/services/compression/helpers.js.map +1 -0
  858. package/dist/services/compression/pipeline.d.ts +7 -0
  859. package/dist/services/compression/pipeline.d.ts.map +1 -0
  860. package/dist/services/compression/pipeline.js +245 -0
  861. package/dist/services/compression/pipeline.js.map +1 -0
  862. package/dist/services/compression/preservation.d.ts +27 -0
  863. package/dist/services/compression/preservation.d.ts.map +1 -0
  864. package/dist/services/compression/preservation.js +109 -0
  865. package/dist/services/compression/preservation.js.map +1 -0
  866. package/dist/services/compression/registry.d.ts +6 -0
  867. package/dist/services/compression/registry.d.ts.map +1 -0
  868. package/dist/services/compression/registry.js +16 -0
  869. package/dist/services/compression/registry.js.map +1 -0
  870. package/dist/services/compression/stats.d.ts +29 -0
  871. package/dist/services/compression/stats.d.ts.map +1 -0
  872. package/dist/services/compression/stats.js +55 -0
  873. package/dist/services/compression/stats.js.map +1 -0
  874. package/dist/services/compression/types.d.ts +90 -0
  875. package/dist/services/compression/types.d.ts.map +1 -0
  876. package/dist/services/compression/types.js +2 -0
  877. package/dist/services/compression/types.js.map +1 -0
  878. package/dist/services/context-handoff.d.ts +22 -0
  879. package/dist/services/context-handoff.d.ts.map +1 -0
  880. package/dist/services/context-handoff.js +164 -0
  881. package/dist/services/context-handoff.js.map +1 -0
  882. package/dist/services/cooldown-probe.d.ts +24 -0
  883. package/dist/services/cooldown-probe.d.ts.map +1 -0
  884. package/dist/services/cooldown-probe.js +181 -0
  885. package/dist/services/cooldown-probe.js.map +1 -0
  886. package/dist/services/custom-endpoint.d.ts +58 -0
  887. package/dist/services/custom-endpoint.d.ts.map +1 -0
  888. package/dist/services/custom-endpoint.js +167 -0
  889. package/dist/services/custom-endpoint.js.map +1 -0
  890. package/dist/services/custom-media-register.d.ts +22 -0
  891. package/dist/services/custom-media-register.d.ts.map +1 -0
  892. package/dist/services/custom-media-register.js +45 -0
  893. package/dist/services/custom-media-register.js.map +1 -0
  894. package/dist/services/custom-model-register.d.ts +50 -0
  895. package/dist/services/custom-model-register.d.ts.map +1 -0
  896. package/dist/services/custom-model-register.js +103 -0
  897. package/dist/services/custom-model-register.js.map +1 -0
  898. package/dist/services/custom-model-seed.d.ts +18 -0
  899. package/dist/services/custom-model-seed.d.ts.map +1 -0
  900. package/dist/services/custom-model-seed.js +42 -0
  901. package/dist/services/custom-model-seed.js.map +1 -0
  902. package/dist/services/custom-model-sync.d.ts +37 -0
  903. package/dist/services/custom-model-sync.d.ts.map +1 -0
  904. package/dist/services/custom-model-sync.js +118 -0
  905. package/dist/services/custom-model-sync.js.map +1 -0
  906. package/dist/services/custom-model-tombstone.d.ts +5 -0
  907. package/dist/services/custom-model-tombstone.d.ts.map +1 -0
  908. package/dist/services/custom-model-tombstone.js +30 -0
  909. package/dist/services/custom-model-tombstone.js.map +1 -0
  910. package/dist/services/declarative-config.d.ts +356 -0
  911. package/dist/services/declarative-config.d.ts.map +1 -0
  912. package/dist/services/declarative-config.js +427 -0
  913. package/dist/services/declarative-config.js.map +1 -0
  914. package/dist/services/degradation.d.ts +40 -0
  915. package/dist/services/degradation.d.ts.map +1 -0
  916. package/dist/services/degradation.js +119 -0
  917. package/dist/services/degradation.js.map +1 -0
  918. package/dist/services/embeddings.d.ts +76 -0
  919. package/dist/services/embeddings.d.ts.map +1 -0
  920. package/dist/services/embeddings.js +319 -0
  921. package/dist/services/embeddings.js.map +1 -0
  922. package/dist/services/fusion.d.ts +162 -0
  923. package/dist/services/fusion.d.ts.map +1 -0
  924. package/dist/services/fusion.js +789 -0
  925. package/dist/services/fusion.js.map +1 -0
  926. package/dist/services/gemini-map.d.ts +14 -0
  927. package/dist/services/gemini-map.d.ts.map +1 -0
  928. package/dist/services/gemini-map.js +78 -0
  929. package/dist/services/gemini-map.js.map +1 -0
  930. package/dist/services/health.d.ts +52 -0
  931. package/dist/services/health.d.ts.map +1 -0
  932. package/dist/services/health.js +352 -0
  933. package/dist/services/health.js.map +1 -0
  934. package/dist/services/idempotency.d.ts +49 -0
  935. package/dist/services/idempotency.d.ts.map +1 -0
  936. package/dist/services/idempotency.js +140 -0
  937. package/dist/services/idempotency.js.map +1 -0
  938. package/dist/services/key-budget.d.ts +74 -0
  939. package/dist/services/key-budget.d.ts.map +1 -0
  940. package/dist/services/key-budget.js +200 -0
  941. package/dist/services/key-budget.js.map +1 -0
  942. package/dist/services/media.d.ts +123 -0
  943. package/dist/services/media.d.ts.map +1 -0
  944. package/dist/services/media.js +954 -0
  945. package/dist/services/media.js.map +1 -0
  946. package/dist/services/model-discovery.d.ts +126 -0
  947. package/dist/services/model-discovery.d.ts.map +1 -0
  948. package/dist/services/model-discovery.js +662 -0
  949. package/dist/services/model-discovery.js.map +1 -0
  950. package/dist/services/model-groups.d.ts +149 -0
  951. package/dist/services/model-groups.d.ts.map +1 -0
  952. package/dist/services/model-groups.js +314 -0
  953. package/dist/services/model-groups.js.map +1 -0
  954. package/dist/services/model-listing.d.ts +18 -0
  955. package/dist/services/model-listing.d.ts.map +1 -0
  956. package/dist/services/model-listing.js +94 -0
  957. package/dist/services/model-listing.js.map +1 -0
  958. package/dist/services/model-retirement.d.ts +29 -0
  959. package/dist/services/model-retirement.d.ts.map +1 -0
  960. package/dist/services/model-retirement.js +86 -0
  961. package/dist/services/model-retirement.js.map +1 -0
  962. package/dist/services/model-state.d.ts +90 -0
  963. package/dist/services/model-state.d.ts.map +1 -0
  964. package/dist/services/model-state.js +342 -0
  965. package/dist/services/model-state.js.map +1 -0
  966. package/dist/services/model-weight-overrides.d.ts +48 -0
  967. package/dist/services/model-weight-overrides.d.ts.map +1 -0
  968. package/dist/services/model-weight-overrides.js +127 -0
  969. package/dist/services/model-weight-overrides.js.map +1 -0
  970. package/dist/services/notification-emitter.d.ts +50 -0
  971. package/dist/services/notification-emitter.d.ts.map +1 -0
  972. package/dist/services/notification-emitter.js +177 -0
  973. package/dist/services/notification-emitter.js.map +1 -0
  974. package/dist/services/opencode-free-sync.d.ts +29 -0
  975. package/dist/services/opencode-free-sync.d.ts.map +1 -0
  976. package/dist/services/opencode-free-sync.js +206 -0
  977. package/dist/services/opencode-free-sync.js.map +1 -0
  978. package/dist/services/penalty-inspector.d.ts +56 -0
  979. package/dist/services/penalty-inspector.d.ts.map +1 -0
  980. package/dist/services/penalty-inspector.js +167 -0
  981. package/dist/services/penalty-inspector.js.map +1 -0
  982. package/dist/services/profile-models.d.ts +5 -0
  983. package/dist/services/profile-models.d.ts.map +1 -0
  984. package/dist/services/profile-models.js +62 -0
  985. package/dist/services/profile-models.js.map +1 -0
  986. package/dist/services/provider-credential.d.ts +19 -0
  987. package/dist/services/provider-credential.d.ts.map +1 -0
  988. package/dist/services/provider-credential.js +51 -0
  989. package/dist/services/provider-credential.js.map +1 -0
  990. package/dist/services/provider-quota.d.ts +64 -0
  991. package/dist/services/provider-quota.d.ts.map +1 -0
  992. package/dist/services/provider-quota.js +563 -0
  993. package/dist/services/provider-quota.js.map +1 -0
  994. package/dist/services/quirks.d.ts +0 -0
  995. package/dist/services/quirks.d.ts.map +1 -0
  996. package/dist/services/quirks.js +0 -0
  997. package/dist/services/quirks.js.map +1 -0
  998. package/dist/services/quota-forecast.d.ts +50 -0
  999. package/dist/services/quota-forecast.d.ts.map +1 -0
  1000. package/dist/services/quota-forecast.js +150 -0
  1001. package/dist/services/quota-forecast.js.map +1 -0
  1002. package/dist/services/quota-outlook.d.ts +4 -0
  1003. package/dist/services/quota-outlook.d.ts.map +1 -0
  1004. package/dist/services/quota-outlook.js +92 -0
  1005. package/dist/services/quota-outlook.js.map +1 -0
  1006. package/dist/services/ratelimit.d.ts +249 -0
  1007. package/dist/services/ratelimit.d.ts.map +1 -0
  1008. package/dist/services/ratelimit.js +1182 -0
  1009. package/dist/services/ratelimit.js.map +1 -0
  1010. package/dist/services/request-retention.d.ts +60 -0
  1011. package/dist/services/request-retention.d.ts.map +1 -0
  1012. package/dist/services/request-retention.js +229 -0
  1013. package/dist/services/request-retention.js.map +1 -0
  1014. package/dist/services/router.d.ts +384 -0
  1015. package/dist/services/router.d.ts.map +1 -0
  1016. package/dist/services/router.js +1986 -0
  1017. package/dist/services/router.js.map +1 -0
  1018. package/dist/services/scoring.d.ts +156 -0
  1019. package/dist/services/scoring.d.ts.map +1 -0
  1020. package/dist/services/scoring.js +435 -0
  1021. package/dist/services/scoring.js.map +1 -0
  1022. package/dist/services/url-tokens.d.ts +15 -0
  1023. package/dist/services/url-tokens.d.ts.map +1 -0
  1024. package/dist/services/url-tokens.js +55 -0
  1025. package/dist/services/url-tokens.js.map +1 -0
  1026. package/package.json +77 -4
  1027. package/README.md +0 -3
@@ -0,0 +1,145 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],B=-1;function V(e){return{current:e}}function H(e){0>B||(e.current=z[B],z[B]=null,B--)}function U(e,t){B++,z[B]=e.current,e.current=t}var ee=V(null),W=V(null),te=V(null),ne=V(null);function re(e,t){switch(U(te,t),U(W,e),U(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}H(ee),U(ee,e)}function ie(){H(ee),H(W),H(te)}function ae(e){e.memoizedState!==null&&U(ne,e);var t=ee.current,n=qd(t,e.type);t!==n&&(U(W,e),U(ee,n))}function oe(e){W.current===e&&(H(ee),H(W)),ne.current===e&&(H(ne),rp._currentValue=R)}var se,ce;function le(e){if(se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||``,ce=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+se+e+ce}var ue=!1;function de(e,t){if(!e||ue)return``;ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?le(n):``}function fe(e,t){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le(`Lazy`);case 13:return e.child!==t&&t!==null?le(`Suspense Fallback`):le(`Suspense`);case 19:return le(`SuspenseList`);case 0:case 15:return de(e.type,!1);case 11:return de(e.type.render,!1);case 1:return de(e.type,!0);case 31:return le(`Activity`);default:return``}}function pe(e){try{var t=``,n=null;do t+=fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var me=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ge=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ve=t.unstable_requestPaint,ye=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=L.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function Qe(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[et])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),yt={},bt={};function xt(e){return me.call(bt,e)?!0:me.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function At(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Vt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Wt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Gt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(Su(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,"passive",{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return cn=i.slice(e,1<r?1-r:void 0)}function un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dn(){return!0}function fn(){return!1}function pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?dn:fn,this.isPropagationStopped=fn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=m({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=m({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(m({},xn,{dataTransfer:0})),wn=pn(m({},gn,{relatedTarget:0})),Tn=pn(m({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(m({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(m({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(m({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(m({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(m({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(m({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(m({},xn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Rn=pn(m({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=Ad(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){Sd(e,0)}function rr(e){if(kt(dt(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(nn){var or;if(nn){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){er&&(er.detachEvent(`onpropertychange`,ur),tr=er=null)}function ur(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Yt(e)),en(nr,t)}}function dr(e,t,n){e===`focusin`?(lr(),er=t,tr=n,er.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!me.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=nn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==At(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&_r(Er,r)||(Er=r,r=Ad(Tr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};nn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Nr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Pr=Nr(`animationend`),Fr=Nr(`animationiteration`),Ir=Nr(`animationstart`),G=Nr(`transitionrun`),Lr=Nr(`transitionstart`),Rr=Nr(`transitioncancel`),zr=Nr(`transitionend`),Br=new Map,Vr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),gt(t,[e])}var Ur=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,ee.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var K=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=K.get(e);return n===void 0?(t={value:e,source:t,stack:pe(t)},K.set(e,t),t):n}return{value:e,source:t,stack:pe(t)}}var di=[],fi=0,pi=null,mi=0,hi=[],gi=0,_i=null,vi=1,yi=``;function bi(e,t){di[fi++]=mi,di[fi++]=pi,pi=e,mi=t}function xi(e,t,n){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,_i=e;var r=vi;e=yi;var i=32-je(r)-1;r&=~(1<<i),n+=1;var a=32-je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vi=1<<32-je(t)+i|n<<i|r,yi=a+e}else vi=1<<a|n<<i|r,yi=e}function Si(e){e.return!==null&&(bi(e,1),xi(e,1,0))}function Ci(e){for(;e===pi;)pi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null;for(;e===_i;)_i=hi[--gi],hi[gi]=null,yi=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null}function wi(e,t){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,vi=t.id,yi=t.overflow,_i=e}var Ti=null,Ei=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ti=Ti.return}}function Pi(e){if(e!==Ti)return!1;if(!Di)return Ni(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Jd(e.type,e.memoizedProps)),n=!n),n&&Ei&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=hf(e)}else t===27?(t=Ei,nf(e.type)?(e=mf,mf=null,Ei=e):Ei=t):Ei=Ti?pf(e.stateNode.nextSibling):null;return!0}function Fi(){Ei=Ti=null,Di=!1}function Ii(){var e=Oi;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=V(null),zi=null,Bi=null;function Vi(e,t,n){U(Ri,t._currentValue),t._currentValue=n}function Hi(e){e._currentValue=Ri.current,H(Ri)}function Ui(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Wi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ui(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ui(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Gi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ne.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&Wi(t,e,n,r),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qi(e){zi=e,Bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ji(e){return Xi(zi,e)}function Yi(e,t){return zi===null&&qi(e),Xi(e,t)}function Xi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Bi===null){if(e===null)throw Error(i(308));Bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Bi=Bi.next=t;return n}var Zi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Qi=t.unstable_scheduleCallback,$i=t.unstable_NormalPriority,ea={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ta(){return{controller:new Zi,data:new Map,refCount:0}}function na(e){e.refCount--,e.refCount===0&&Qi($i,function(){e.controller.abort()})}var ra=null,ia=0,aa=0,oa=null;function sa(e,t){if(ra===null){var n=ra=[];ia=0,aa=md(),oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(ca,ca),t}function ca(){if(--ia===0&&ra!==null){oa!==null&&(oa.status=`fulfilled`);var e=ra;ra=null,aa=0,oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ua=I.S;I.S=function(e,t){nu=ye(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var da=V(null);function fa(){var e=da.current;return e===null?Ll.pooledCache:e}function pa(e,t){t===null?U(da,da.current):U(da,t.pool)}function ma(){var e=fa();return e===null?null:{parent:ea._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=oi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(F(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Yi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Yi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Yi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Di&&bi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Di&&bi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Di&&bi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Di&&bi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Di&&bi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Di&&bi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Yi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Il&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=oa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(zl&f)===f:(r&f)===f){f!==0&&f===aa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Na=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=V(null),Ka=V(0);function qa(e,t){e=Gl,U(Ka,e),U(Ga,t),Gl=e|t.baseLanes}function Ja(){U(Ka,Gl),U(Ga,Ga.current)}function Ya(){Gl=Ka.current,H(Ga),H(Ka)}var Xa=V(null),Za=null;function Qa(e){var t=e.alternate;U(ro,ro.current&1),U(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){U(ro,ro.current),U(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(U(ro,ro.current),U(Xa,e),Za===null&&(Za=e)):to(e)}function to(){U(ro,ro.current),U(Xa,Xa.current)}function no(e){H(Xa),Za===e&&(Za=null),H(ro)}var ro=V(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,oo=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return ao=a,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){I.H=Ps;var t=so!==null&&so.next!==null;if(ao=0,co=so=oo=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Ki(e)&&($s=!0))}function xo(e,t,n,r){oo=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Ls,o=t(n,r)}while(uo);return o}function So(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(oo.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}ao=0,co=so=oo=null,uo=!1,mo=po=0,ho=null}function q(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?oo.memoizedState=co=e:co=co.next=e,co}function Eo(){if(so===null){var e=oo.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?oo.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw oo.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?oo.memoizedState=co=e:co=co.next=e}return co}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=ba(ho,e,t),t=oo,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===C)return Ji(e)}throw Error(i(438,String(e)))}function Ao(e){var t=null,n=oo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=oo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Do(),oo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),so,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(zl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===aa&&(d=!0);else if((ao&p)===p){u=u.next,p===aa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,oo.lanes|=p,ql|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,oo.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&($s=!0,d&&(n=oa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);gr(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=oo,a=Eo(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||ao&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=oo.updateQueue,t===null?(t=Do(),oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Bo(e){var t=Xr(e,2);t!==null&&_u(t,e,2)}function Vo(e){var t=q();if(typeof e==`function`){var n=e;if(e=n(),fo){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,so,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(Di){var n=Ll.formState;if(n!==null){a:{var r=oo;if(Di){if(Ei){b:{for(var i=Ei,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=pf(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=q(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,oo,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,oo,!1,r.queue),r=q(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,oo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),so,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===ha?_a:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(oo.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=so;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=oo.updateQueue,t===null&&(t=Do(),oo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=q();oo.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(oo.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){oo.flags|=4;var t=oo.updateQueue;if(t===null)t=Do(),oo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Il&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||ao&1073741824&&!(zl&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),oo.lanes|=e,ql|=e,n)}function _s(e,t,n,r){return gr(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(zl&261930)?($s=!0,e.memoizedState=n):(e=gu(),oo.lanes|=e,ql|=e,t):(e=gs(e,n,r),gr(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,As(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,la(c,r),hu(e)):ks(e,t,r,hu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,R,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},hu())}function Cs(){return Ji(rp)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ia(n);var r=La(t,e,n);r!==null&&(_u(r,t,n),Ra(r,t,n)),t={cache:ta()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Yr(e,t,n,r),n!==null&&(_u(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,hu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Jr(e,t,i,0),Ll===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return _u(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&_u(t,e,2)}function js(e){var t=e.alternate;return e===oo||t!==null&&t===oo}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ps={readContext:Ji,use:ko,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Ps.useEffectEvent=_o;var Fs={readContext:Ji,use:ko,useCallback:function(e,t){return q().memoizedState=[e,t===void 0?null:t],e},useContext:Ji,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=q();t=t===void 0?null:t;var r=e();if(fo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=q();if(n!==void 0){var i=n(t);if(fo){Ae(!0);try{n(t)}finally{Ae(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){var t=q();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,oo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(q(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,oo,e.queue,!0,!1),q().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oo,a=q();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));zl&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=q(),t=Ll.identifierPrefix;if(Di){var n=yi,r=vi;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=q();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,oo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return q().memoizedState=Es.bind(null,oo)},useEffectEvent:function(e){var t=q(),n={impl:e};return t.memoizedState=n,function(){if(Il&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Ji,use:ko,useCallback:ms,useContext:Ji,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),so.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Ji,use:ko,useCallback:ms,useContext:Ji,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,so,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(_u(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(_u(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(_u(t,e,n),Ra(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Ur(e)}function Ws(e){console.error(e)}function Gs(e){Ur(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=Ia(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Gi(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ku(),!1}if(Di)return t=Xa.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=Js(e.stateNode,r,a),za(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return qi(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(Di&&s&&Si(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref){if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=fa();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Gi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return ja(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if($a(t),(e=Ei)?(e=lf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a){if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if($s||Gi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Ll,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),_u(r,e,s),Qs;ku(),t=cc(e,t,n)}else e=o.treeContext,Ei=pf(s.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return qi(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!$s?(wo(e,t,i),Tc(e,t,i)):(Di&&r&&Si(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return qi(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!$s?(wo(e,t,a),Tc(e,t,a)):(Di&&r&&Si(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(qi(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=Ji(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Ji(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=Ji(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Na||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=Ji(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Na||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Fi(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ma()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ro.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Di){if(a?Qa(t):to(t),(e=Ei)?(e=lf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):(Qa(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Li({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Gi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Ll,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),_u(s,e,r),Qs;uf(c)||ku(),t=xc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=pf(c.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ma():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return ja(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ui(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,U(ro,o),ec(e,t,r,n),r=Di?mi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Gi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ki(e)))}function Dc(e,t,n){switch(t.tag){case 3:re(t,t.stateNode.containerInfo),Vi(t,ea,e.memoizedState.cache),Fi();break;case 27:case 5:ae(t);break;case 4:re(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Gi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),U(ro,ro.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Vi(t,ea,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}}else $s=!1,Di&&t.flags&1048576&&xi(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=tc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(re(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Vi(t,ea,r),r!==o.cache&&Wi(t,[ea],n,!0),Va(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=ui(Error(i(424)),t),Li(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=pf(e.firstChild),Ti=t,Di=!0,Oi=null,ki=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Gd(te.current).createElement(n),r[et]=t,r[tt]=e,zd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Di&&(r=t.stateNode=_f(t.type,t.pendingProps,te.current),Ti=t,ki=!0,a=Ei,nf(t.type)?(mf=a,Ei=pf(r.firstChild)):Ei=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=sf(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=pf(r.firstChild),ki=!1,a=!0)),a||ji(t)),ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),rp._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=cf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||ji(t)),null;case 13:return vc(e,t,n);case 4:return re(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,qi(t),a=Ji(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return qi(t),r=Ji(ea),e===null?(a=fa(),a===null&&(a=Ll,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Vi(t,ea,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Vi(t,ea,r),r!==a.cache&&Wi(t,[ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Vi(t,ea,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw Sa=va,ga}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t)){if(Eu())e.flags|=8192;else throw Sa=va,ga}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,Zl|=t)}function Nc(e,t){if(!Di)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Hi(ea),ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(oe(t),n=te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=ee.current,Pi(t)?Mi(t,e):(e=_f(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=ee.current,Pi(t))Mi(t,o);else{var s=Gd(te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=te.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||ji(t,!0)}else e=Gd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return ie(),e===null&&Ed(t.stateNode.containerInfo),Pc(t),null;case 10:return Hi(t.type),Pc(t),null;case 19:if(H(ro),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return U(ro,ro.current&1|2),Di&&bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ye()>ru&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Pc(t),null}else 2*ye()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ye(),e.sibling=null,n=ro.current,U(ro,a?n&1|2:n&1),Di&&bi(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&H(da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Hi(ea),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hi(ea),ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return oe(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(ro),null;case 4:return ie(),null;case 10:return Hi(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&H(da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hi(ea),null;case 25:return null;default:return null}}function Lc(e,t){switch(Ci(t),t.tag){case 3:Hi(ea),ie();break;case 26:case 27:case 5:oe(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:H(ro);break;case 10:Hi(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&H(da);break;case 24:Hi(ea)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){qu(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[tt]=t}catch(t){qu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[et]=e,t[tt]=n}catch(t){qu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,J=null;function tl(e,t){if(e=e.containerInfo,Ud=fp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,J=t;J!==null;)if(t=J,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,J=e;else for(;J!==null;){switch(t=J,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Rc(5,n);break;case 1:if(_l(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(_l(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?yl(e,n,!!(n.subtreeFlags&8772)):_l(e,n),Zc=i,Qc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(ke&&typeof ke.onCommitFiberUnmount==`function`)try{ke.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=il,i=al;nf(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),vf(n.stateNode),il=r,al=i;break;case 5:Qc||Uc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null){if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){qu(n,t,e)}}break;case 18:il!==null&&(al?(e=il,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),ol(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,ol(e,t,n),Qc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){qu(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){qu(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function fl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=pl;if(fl(t,e),hl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,pt(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode)}else e.stateNode=Vf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Gf=null,a=pl,pl=xf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){qu(e,e.return,t)}$c&&($c=!1,gl(e));break;case 4:r=pl,pl=xf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=ye()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,fl(t,e),Qc=d,Zc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||vl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),vl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),vl(t);break;case 27:vf(t.stateNode);case 26:case 5:Uc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:yl(i,a,n),Rc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Hc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&na(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cl(e,t,n,r),t=t.sibling}function Cl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e)));break;case 12:if(i&2048){Sl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,wl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Sl(e,t,n,r):Tl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function wl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:wl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,wl(a,o,s,c,i)):u._visibility&2?wl(a,o,s,c,i):Tl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:wl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:wl(a,o,s,c,i)}t=t.sibling}}function Tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Tl(n,r),i&2048&&bl(r.alternate,r);break;case 24:Tl(n,r),i&2048&&xl(r.alternate,r);break;default:Tl(n,r)}t=t.sibling}}var El=8192;function Dl(e,t,n){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Ol(e,t,n),e=e.sibling}function Ol(e,t,n){switch(e.tag){case 26:Dl(e,t,n),e.flags&El&&e.memoizedState!==null&&Xf(n,pl,e.memoizedState,e.memoizedProps);break;case 5:Dl(e,t,n);break;case 3:case 4:var r=pl;pl=xf(e.stateNode.containerInfo),Dl(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=El,El=16777216,Dl(e,t,n),El=r):Dl(e,t,n));break;default:Dl(e,t,n)}}function kl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];J=r,Nl(r,e)}kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&zc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ml(e)):Al(e);break;default:Al(e)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];J=r,Nl(r,e)}kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Ml(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ml(t));break;default:Ml(t)}e=e.sibling}}function Nl(e,t){for(;J!==null;){var n=J;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,J=r;else a:for(n=e;J!==null;){r=J;var i=r.sibling,a=r.return;if(rl(r),r===n){J=null;break a}if(i!==null){i.return=a,J=i;break a}J=a}}}var Pl={getCacheForType:function(e){var t=Ji(ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ji(ea).controller.signal}},Fl=typeof WeakMap==`function`?WeakMap:Map,Il=0,Ll=null,Rl=null,zl=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return Il&2&&zl!==0?zl&-zl:I.T===null?Ze():md()}function gu(){if(Xl===0){if(!(zl&536870912)||Di){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),Xl=e}else Xl=536870912}return e=Xa.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===Ll&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,zl,Xl,!1)),We(e,n),(!(Il&2)||e!==Ll)&&(e===Ll&&(!(Il&2)&&(Jl|=n),Kl===4&&xu(e,zl,Xl,!1)),od(e))}function vu(e,t,n){if(Il&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Be(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-ye(),10<a)){if(xu(r,t,Xl,!Hl),ze(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Zd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qt},Ol(t,a,d);var m=(a&62914560)===a?tu-ye():(a&4194048)===a?nu-ye():0;if(m=Qf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!gr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function Su(){return Il&6?!0:(sd(0,!1),!1)}function Cu(){if(Rl!==null){if(Bl===0)var e=Rl.return;else e=Rl,Bi=zi=null,To(e),Ta=null,Ea=0,e=Rl;for(;e!==null;)Lc(e.alternate,e),e=e.return;Rl=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),Ll=e,Rl=n=ri(e.current,null),zl=t,Bl=0,Vl=null,Hl=!1,Ul=Be(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-je(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,qr(),n}function Tu(e,t){oo=null,I.H=Ps,t===ha||t===_a?(t=Ca(),Bl=3):t===ga?(t=Ca(),Bl=4):Bl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,Rl===null&&(Kl=1,Ks(e,ui(t,e.current)))}function Eu(){var e=Xa.current;return e===null?!0:(zl&4194048)===zl?Za===null:(zl&62914560)===zl||zl&536870912?e===Za:!1}function Du(){var e=I.H;return I.H=Ps,e===null?Ps:e}function Ou(){var e=I.A;return I.A=Pl,e}function ku(){Kl=4,Hl||(zl&4194048)!==zl&&Xa.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||Ll===null||xu(Ll,zl,Xl,!1)}function Au(e,t,n){var r=Il;Il|=2;var i=Du(),a=Ou();(Ll!==e||zl!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&Rl!==null){var s=Rl,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,Bi=zi=null,Il=r,I.H=i,I.A=a,Rl===null&&(Ll=null,zl=0,qr()),o}function ju(){for(;Rl!==null;)Pu(Rl)}function Mu(e,t){var n=Il;Il|=2;var r=Du(),a=Ou();Ll!==e||zl!==t?(iu=null,ru=ye()+500,wu(e,t)):Ul=Be(e,t);a:do try{if(Bl!==0&&Rl!==null){t=Rl;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(ya(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||Ll!==e||(Bl=7),od(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:ya(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(Rl.tag){case 26:s=Rl.memoizedState;case 5:case 27:var c=Rl;if(s?Yf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)Rl=l;else{var u=c.return;u===null?Rl=null:(Rl=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return Bi=zi=null,I.H=r,I.A=a,Il=n,Rl===null?(Ll=null,zl=0,qr(),Kl):0}function Nu(){for(;Rl!==null&&!_e();)Pu(Rl)}function Pu(e){var t=Oc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,zl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,zl);break;case 5:To(t);default:Lc(n,t),t=Rl=ii(t,Gl),t=Oc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Iu(e,t,n,r){Bi=zi=null,To(t),Ta=null,Ea=0;var i=t.return;try{if(Zs(e,i,t,n,zl)){Kl=1,Ks(e,ui(n,e.current)),Rl=null;return}}catch(t){if(i!==null)throw Rl=i,t;Kl=1,Ks(e,ui(n,e.current)),Rl=null;return}t.flags&32768?(Di||r===1?e=!0:Ul||zl&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Fc(t.alternate,t,Gl);if(n!==null){Rl=n;return}if(t=t.sibling,t!==null){Rl=t;return}Rl=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,Rl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Rl=e;return}Rl=e=n}while(e!==null);Kl=6,Rl=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(Il&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ge(e,n,o,s,c,l),e===Ll&&(Rl=Ll=null,zl=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(Ce,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Il,Il|=4;try{tl(e,t,n)}finally{Il=s,L.p=a,I.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Il;Il|=4;try{ml(t,e);var a=Wd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{Il=i,L.p=r,I.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Il;Il|=4;try{nl(e,t.alternate,t)}finally{Il=i,L.p=r,I.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,ve();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),Xe(n),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot==`function`)try{ke.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,na(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=Xe(lu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,Il&6)throw Error(i(331));var c=Il;if(Il|=4,jl(o.current),Cl(o,o.current,s,n),Il=c,sd(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{L.p=a,I.T=r,Uu(e,t)}}function Ku(e,t,n){t=ui(n,t),t=Js(e.stateNode,t,2),e=La(e,t,2),e!==null&&(We(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=ui(n,e),n=Ys(2),r=La(t,n,2),r!==null&&(Xs(n,r,t,e),We(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(zl&n)===n&&(Kl===4||Kl===3&&(zl&62914560)===zl&&300>ye()-tu?!(Il&2)&&wu(e,0):Yl|=n,Zl===zl&&(Zl=0)),od(e)}function Xu(e,t){t===0&&(t=He()),e=Xr(e,t),e!==null&&(We(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return he(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=zl,a=ze(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=ye(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=zl,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ge(r),Xe(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=dd.bind(null,e),n=he(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ge(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=zl;return r=ze(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,ye()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){ef(function(){Il&6?he(xe,cd):ld()})}function md(){if(ad===0){var e=aa;e===0&&(e=Fe,Fe<<=1,!(Fe&261888)&&(Fe=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Vr.length;vd++){var yd=Vr[vd];Hr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Hr(Pr,`onAnimationEnd`),Hr(Fr,`onAnimationIteration`),Hr(Ir,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(G,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[rt];n===void 0&&(n=t[rt]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,mt.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}en(function(){var r=a,i=Yt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case Pr:case Fr:case Ir:l=Tn;break;case zr:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=tn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?lt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c)){if(ar)v=mr;else{v=fr;var y=dr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(Bn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=Ad(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=tn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=tn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=tn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
9
+ `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Wt.get(n)||n,St(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Ht(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}Rt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e!==Yd&&(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=L.d;L.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Su();return e||t}function wf(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=ft(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);pt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=ft(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),pt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=ft(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),pt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=te.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Mt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),pt(t),e.head.appendChild(t))}function zf(e){return`[src="`+Mt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,pt(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function op(e){return e?(e=$r,e):$r}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(_u(n,e,t),Ra(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&_u(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=hu();t=Ye(t);var n=Xr(e,t);n!==null&&_u(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,hp(e,t,n,r)}finally{L.p=a,I.T=i}}function mp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,hp(e,t,n,r)}finally{L.p=a,I.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}od(a),!(Il&6)&&(ru=ye()+500,sd(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&_u(s,a,2),Su(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=Yt(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,hu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Su(),t[nt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.6`)throw Error(i(527,Hp,`19.2.6`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Oe=Wp.inject(Up),ke=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[nt]=t.current,Ed(e),new Bp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=x(t,n),t=s(t),t in S)return;S[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:b,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,T=/^[\\/]{2}/;function E(e,t){return t+e.replace(/\\/g,`/`)}var D=`popstate`;function O(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function k(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return P(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:F(t)}return L(t,n,null,e)}function A(e,t){if(e===!1||e==null)throw Error(t)}function j(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function M(){return Math.random().toString(36).substring(2,10)}function N(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function P(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||M(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function L(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=O(e)?e:P(h.location,e,t);n&&n(r,e),l=u()+1;let d=N(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=O(e)?e:P(h.location,e,t);n&&n(r,e),l=u();let i=N(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return R(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(D,d),c=e,()=>{i.removeEventListener(D,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function R(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),A(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&T.test(i)&&(i=r+i),new URL(i,r)}function z(e,t,n=`/`){return B(e,t,n,!1)}function B(e,t,n,r,i){let a=me((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??V(e),s=null,c=pe(a);for(let e=0;s==null&&e<o.length;++e)s=le(o[e],c,r);return s}function V(e){let t=H(e);return ee(t),t}function H(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;A(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Se([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(A(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),H(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of U(e.path))a(e,t,!0,n)}),t}function U(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=U(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ee(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var W=/^:[\w-]+$/,te=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(W.test(t)?te:t===``?re:ie),r)}function ce(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function le(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):ue(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Se([a,d.pathname]),pathnameBase:we(Se([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Se([a,d.pathnameBase]))}return o}function ue(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fe(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fe(e,t=!1,n=!0){j(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function pe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return j(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function me(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=xe(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Te(r),hash:Ee(i)}}function ge(e,t){let n=Ce(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function be(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},A(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),A(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),A(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xe=e=>e.replace(/[\\/]{2,}/g,`/`),Se=e=>xe(e.join(`/`)),Ce=e=>e.replace(/\/+$/,``),we=e=>Ce(e).replace(/^\/*/,`/`),Te=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,De=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Oe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ke(e){return Se(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ae=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function je(e,t){let n=e;if(typeof n!=`string`||!w.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ae)try{let e=new URL(window.location.href),r=T.test(n)?new URL(E(n,e.protocol)):new URL(n),a=me(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{j(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Me=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Me);var Ne=[`GET`,...Me];new Set(Ne);var Pe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Fe(e){try{return Pe.includes(new URL(e).protocol)}catch{return!1}}var Ie=v.createContext(null);Ie.displayName=`DataRouter`;var Le=v.createContext(null);Le.displayName=`DataRouterState`;var Re=v.createContext(!1);function ze(){return v.useContext(Re)}var Be=v.createContext({isTransitioning:!1});Be.displayName=`ViewTransition`;var Ve=v.createContext(new Map);Ve.displayName=`Fetchers`;var He=v.createContext(null);He.displayName=`Await`;var Ue=v.createContext(null);Ue.displayName=`Navigation`;var We=v.createContext(null);We.displayName=`Location`;var Ge=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ge.displayName=`Route`;var Ke=v.createContext(null);Ke.displayName=`RouteError`;var qe=`REACT_ROUTER_ERROR`,Je=`REDIRECT`,Ye=`ROUTE_ERROR_RESPONSE`;function Xe(e){if(e.startsWith(`${qe}:${Je}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ze(e){if(e.startsWith(`${qe}:${Ye}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new De(t.status,t.statusText,t.data)}catch{}}function Qe(e,{relative:t}={}){A($e(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(Ue),{hash:i,pathname:a,search:o}=ot(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Se([n,a])),r.createHref({pathname:s,search:o,hash:i})}function $e(){return v.useContext(We)!=null}function et(){return A($e(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(We).location}var tt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function nt(e){v.useContext(Ue).static||v.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=v.useContext(Ge);return e?Ct():it()}function it(){A($e(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(Ie),{basename:t,navigator:n}=v.useContext(Ue),{matches:r}=v.useContext(Ge),{pathname:i}=et(),a=JSON.stringify(ye(r)),o=v.useRef(!1);return nt(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(j(o.current,tt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=be(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Se([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function at(){let{matches:e}=v.useContext(Ge);return e[e.length-1]?.params??{}}function ot(e,{relative:t}={}){let{matches:n}=v.useContext(Ge),{pathname:r}=et(),i=JSON.stringify(ye(n));return v.useMemo(()=>be(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function st(e,t){return ct(e,t)}function ct(e,t,n){A($e(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(Ue),{matches:i}=v.useContext(Ge),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Tt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=et(),d;if(t){let e=typeof t==`string`?I(t):t;A(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):z(e,{pathname:p});j(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),j(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=ht(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Se([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Se([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(We.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function lt(){let e=St(),t=Oe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var ut=v.createElement(lt,null),dt=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ze(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Ge.Provider,{value:this.props.routeContext},v.createElement(Ke.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(pt,{error:e},t):t}};dt.contextType=Re;var ft=new WeakMap;function pt({children:e,error:t}){let{basename:n}=v.useContext(Ue);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Xe(t.digest);if(e){let r=ft.get(t);if(r)throw r;let i=je(e.location,n),a=i.absoluteURL||i.to;if(Fe(a))throw Error(`Invalid redirect location`);if(Ae&&!ft.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ft.set(t,n),n}}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function mt({routeContext:e,match:t,children:n}){let r=v.useContext(Ie);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ge.Provider,{value:e},n)}function ht(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);A(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ut,o&&(s<0&&c===0?(Tt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(dt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _t(e){let t=v.useContext(Ie);return A(t,gt(e)),t}function vt(e){let t=v.useContext(Le);return A(t,gt(e)),t}function yt(e){let t=v.useContext(Ge);return A(t,gt(e)),t}function bt(e){let t=yt(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xt(){return bt(`useRouteId`)}function St(){let e=v.useContext(Ke),t=vt(`useRouteError`),n=bt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ct(){let{router:e}=_t(`useNavigate`),t=bt(`useNavigate`),n=v.useRef(!1);return nt(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{j(n.current,tt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var wt={};function Tt(e,t,n){!t&&!wt[e]&&(wt[e]=!0,j(!1,n))}v.memo(Et);function Et({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ct(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Dt({to:e,replace:t,state:n,relative:r}){A($e(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(Ue);j(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=v.useContext(Ge),{pathname:o}=et(),s=rt(),c=be(e,ye(a),o,r===`path`),l=JSON.stringify(c);return v.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Ot(e){A(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function kt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){A(!$e(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=me(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return j(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(Ue.Provider,{value:c},v.createElement(We.Provider,{children:t,value:h}))}function At({children:e,location:t}){return st(jt(e),t)}v.Component;function jt(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,jt(e.props.children,i));return}A(e.type===Ot,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=jt(e.props.children,i)),n.push(a)}),n}var Mt=`get`,Nt=`application/x-www-form-urlencoded`;function Pt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ft(e){return Pt(e)&&e.tagName.toLowerCase()===`button`}function It(e){return Pt(e)&&e.tagName.toLowerCase()===`form`}function Lt(e){return Pt(e)&&e.tagName.toLowerCase()===`input`}function Rt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zt(e,t){return e.button===0&&(!t||t===`_self`)&&!Rt(e)}var Bt=null;function Vt(){if(Bt===null)try{new FormData(document.createElement(`form`),0),Bt=!1}catch{Bt=!0}return Bt}var Ht=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ut(e){return e!=null&&!Ht.has(e)?(j(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nt}"`),null):e}function Wt(e,t){let n,r,i,a,o;if(It(e)){let o=e.getAttribute(`action`);r=o?me(o,t):null,n=e.getAttribute(`method`)||Mt,i=Ut(e.getAttribute(`enctype`))||Nt,a=new FormData(e)}else if(Ft(e)||Lt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?me(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Mt,i=Ut(e.getAttribute(`formenctype`))||Ut(o.getAttribute(`enctype`))||Nt,a=new FormData(o,e),!Vt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Pt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Mt,r=null,i=Nt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Gt(e,t){if(e===!1||e==null)throw Error(t)}function Kt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&me(i.pathname,t)===`/`?`${Ce(t)}/_root.${r}`:`${Ce(i.pathname)}.${r}`,i}async function qt(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Jt(e){return e!=null&&typeof e.page==`string`}function Yt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Xt(e,t,n){return tn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await qt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Yt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Zt(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Qt(e,t,{includeHydrateFallback:n}={}){return $t(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function $t(e){return[...new Set(e)]}function en(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function tn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Jt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(en(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function nn(){let e=v.useContext(Ie);return Gt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function rn(){let e=v.useContext(Le);return Gt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var an=v.createContext(void 0);an.displayName=`FrameworkContext`;function on(){let e=v.useContext(an);return Gt(e,`You must render this element inside a <HydratedRouter> element`),e}function sn(e,t){let n=v.useContext(an),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:cn(s,p),onBlur:cn(c,m),onMouseEnter:cn(l,p),onMouseLeave:cn(u,m),onTouchStart:cn(d,p)}]:[a,f,{}]:[!1,f,{}]}function cn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ln({page:e,...t}){let n=ze(),{nonce:r}=on(),{router:i}=nn(),a=v.useMemo(()=>z(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(dn,{page:e,matches:a,...t}):v.createElement(fn,{page:e,matches:a,...t})):null}function un(e){let{manifest:t,routeModules:n}=on(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return Xt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function dn({page:e,matches:t,...n}){let r=et(),{future:i}=on(),{basename:a}=nn(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Kt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function fn({page:e,matches:t,...n}){let r=et(),{future:i,manifest:a,routeModules:o}=on(),{basename:s}=nn(),{loaderData:c,matches:l}=rn(),u=v.useMemo(()=>Zt(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>Zt(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Kt(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>Qt(d,a),[d,a]),m=un(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function pn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var mn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{mn&&(window.__reactRouterVersion=`7.18.2`)}catch{}function hn({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=k({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(kt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var gn=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(Ue),y=typeof l==`string`&&w.test(l),b=je(l,h);l=b.to;let x=Qe(l,{relative:r}),S=et(),C=null;if(o){let e=be(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Se([h,e.pathname])),C=g.createHref(e)}let[T,E,D]=sn(n,p),O=xn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(b.isExternal||i),j=v.createElement(`a`,{...p,...D,href:(A?C:void 0)||b.absoluteURL||x,onClick:A?k:e,ref:pn(m,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return T&&!y?v.createElement(v.Fragment,null,j,v.createElement(ln,{page:x})):j});gn.displayName=`Link`;var _n=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ot(a,{relative:c.relative}),d=et(),f=v.useContext(Le),{navigator:p,basename:m}=v.useContext(Ue),h=f!=null&&En(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=me(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(gn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});_n.displayName=`NavLink`;var vn=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Mt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(Ue),g=wn(),_=Tn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&w.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});vn.displayName=`Form`;function yn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bn(e){let t=v.useContext(Ie);return A(t,yn(e)),t}function xn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=rt(),d=et(),f=ot(e,{relative:o});return v.useCallback(p=>{if(zt(p,t)){p.preventDefault();let t=n===void 0?F(d)===F(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Sn=0,Cn=()=>`__${String(++Sn)}__`;function wn(){let{router:e}=bn(`useSubmit`),{basename:t}=v.useContext(Ue),n=xt(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Wt(e,t);if(a.navigate===!1){let e=a.fetcherKey||Cn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Tn(e,{relative:t}={}){let{basename:n}=v.useContext(Ue),r=v.useContext(Ge);A(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ot(e||`.`,{relative:t})},o=et();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Se([n,a.pathname])),F(a)}function En(e,{relative:t}={}){let n=v.useContext(Be);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=bn(`useViewTransitionState`),i=ot(e,{relative:t});if(!n.isTransitioning)return!1;let a=me(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=me(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ue(i.pathname,o)!=null||ue(i.pathname,a)!=null}var Dn=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(){}},On=new class extends Dn{#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`}},kn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},An=new class{#e=kn;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 jn(e){setTimeout(e,0)}var Mn=typeof window>`u`||`Deno`in globalThis;function Nn(){}function Pn(e,t){return typeof e==`function`?e(t):e}function Fn(e){return typeof e==`number`&&e>=0&&e!==1/0}function In(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ln(e,t){return typeof e==`function`?e(t):e}function Rn(e,t){return typeof e==`function`?e(t):e}function zn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Vn(o,t.options))return!1}else if(!Un(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 Bn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Hn(t.options.mutationKey)!==Hn(a))return!1}else if(!Un(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Vn(e,t){return(t?.queryKeyHashFn||Hn)(e)}function Hn(e){return JSON.stringify(e,(e,t)=>Jn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Un(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Un(e[n],t[n])):!1}var Wn=Object.prototype.hasOwnProperty;function Gn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=qn(e)&&qn(t);if(!r&&!(Jn(e)&&Jn(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:Wn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Gn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Kn(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 qn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jn(e){if(!Yn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Yn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Yn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Xn(e){return new Promise(t=>{An.setTimeout(t,e)})}function Zn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Gn(e,t)}function Qn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function $n(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var er=Symbol();function tr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===er?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function nr(e,t){return typeof e==`function`?e(...t):!!e}function rr(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 ir=(()=>{let e=()=>Mn;return{isServer(){return e()},setIsServer(t){e=t}}})();function ar(){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 or=jn;function sr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=or,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 cr=sr(),lr=new class extends Dn{#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 ur(e){return Math.min(1e3*2**e,3e4)}function dr(e){return(e??`online`)!==`online`||lr.isOnline()}var fr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function pr(e){let t=!1,n=0,r,i=ar(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new fr(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>On.isFocused()&&(e.networkMode===`always`||lr.isOnline())&&e.canRun(),u=()=>dr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{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(d).catch(r=>{if(a())return;let i=e.retry??(ir.isServer()?0:3),o=e.retryDelay??ur,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){f(r);return}n++,e.onFail?.(n,r),Xn(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var mr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fn(this.gcTime)&&(this.#e=An.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ir.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(An.clearTimeout(this.#e),this.#e=void 0)}};function hr(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=>{rr(e,()=>t.signal,()=>n=!0)},u=tr(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?$n:Qn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?_r:gr,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:gr(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function gr(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 _r(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vr=class extends mr{#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=xr(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=xr(this.options);e.data!==void 0&&(this.setState(br(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Zn(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(Nn).catch(Nn):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=>Rn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===er||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Ln(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:!In(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=tr(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`?hr(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=pr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof fr&&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 fr){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,...yr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...br(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),cr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function yr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function br(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function xr(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 Sr=class extends Dn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ar(),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),wr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tr(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 Rn(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&&!Kn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Er(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Rn(this.options.enabled,this.#t)!==Rn(t.enabled,this.#t)||Ln(this.options.staleTime,this.#t)!==Ln(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Rn(this.options.enabled,this.#t)!==Rn(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 Or(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(Nn)),t}#g(){this.#b();let e=Ln(this.options.staleTime,this.#t);if(ir.isServer()||this.#r.isStale||!Fn(e))return;let t=In(this.#r.dataUpdatedAt,e)+1;this.#d=An.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,!(ir.isServer()||Rn(this.options.enabled,this.#t)===!1||!Fn(this.#p)||this.#p===0)&&(this.#f=An.setInterval(()=>{(this.options.refetchIntervalInBackground||On.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(An.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(An.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&&wr(e,t),o=i&&Er(e,n,t,r);(a||o)&&(l={...l,...yr(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=Zn(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=Zn(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,x={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:Dr(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Rn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=ar();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}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),!Kn(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){cr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Cr(e,t){return Rn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Rn(t.retryOnMount,e)!==!1)}function wr(e,t){return Cr(e,t)||e.state.data!==void 0&&Tr(e,t,t.refetchOnMount)}function Tr(e,t,n){if(Rn(t.enabled,e)!==!1&&Ln(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Dr(e,t)}return!1}function Er(e,t,n,r){return(e!==t||Rn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Dr(e,n)}function Dr(e,t){return Rn(t.enabled,e)!==!1&&e.isStaleByTime(Ln(t.staleTime,e))}function Or(e,t){return!Kn(e.getCurrentResult(),t)}var kr=class extends mr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ar(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=pr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),cr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ar(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var jr=class extends Dn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new kr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Mr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Mr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){cr.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Bn(t,e))}findAll(e={}){return this.getAll().filter(t=>Bn(e,t))}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return cr.batch(()=>Promise.all(e.map(e=>e.continue().catch(Nn))))}};function Mr(e){return e.options.scope?.id}var Nr=class extends Dn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Kn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Hn(t.mutationKey)!==Hn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ar();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){cr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Pr=class extends Dn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Vn(r,t),a=this.get(i);return a||(a=new vr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){cr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>zn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>zn(e,t)):t}notify(e){cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Pr,this.#t=e.mutationCache||new jr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=On.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=lr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ln(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Pn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cr.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;cr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return cr.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=cr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return cr.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=cr.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Nn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Nn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ln(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return lr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Hn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Un(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Hn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Un(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Vn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===er&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ir=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),G=o(((e,t)=>{t.exports=Ir()}))(),Lr=v.createContext(void 0),Rr=e=>{let t=v.useContext(Lr);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},zr=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(Lr.Provider,{value:e,children:t})),Br=v.createContext(!1),Vr=()=>v.useContext(Br);Br.Provider;function Hr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ur=v.createContext(Hr()),Wr=()=>v.useContext(Ur),Gr=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?nr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Kr=e=>{v.useEffect(()=>{e.clearReset()},[e])},qr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||nr(n,[e.error,r])),Jr=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))}},Yr=(e,t)=>e.isLoading&&e.isFetching&&!t,Xr=(e,t)=>e?.suspense&&t.isPending,Zr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Qr(e,t,n){let r=Vr(),i=Wr(),a=Rr(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Jr(o),Gr(o,i,s),Kr(i);let c=!a.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(e=>{let t=d?l.subscribe(cr.batchCalls(e)):Nn;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o)},[o,l]),Xr(o,u))throw Zr(o,l,i);if(qr({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!ir.isServer()&&Yr(u,r)&&(c?Zr(o,l,i):s?.promise)?.catch(Nn).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function $r(e,t){return Qr(e,Sr,t)}function ei(e,t){let n=Rr(t),[r]=v.useState(()=>new Nr(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);let i=v.useSyncExternalStore(v.useCallback(e=>r.subscribe(cr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=v.useCallback((e,t)=>{r.mutate(e,t).catch(Nn)},[r]);if(i.error&&nr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ti=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ni=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ri=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ii=e=>{let t=ri(e);return t.charAt(0).toUpperCase()+t.slice(1)},ai={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},oi=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},si=(0,v.createContext)({}),ci=()=>(0,v.useContext)(si),li=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ci()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...ai,width:t??l??ai.width,height:t??l??ai.height,stroke:e??f,strokeWidth:m,className:ti(`lucide`,p,i),...!a&&!oi(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(li,{ref:i,iconNode:t,className:ti(`lucide-${ni(ii(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ii(e),n},ui=K(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),di=K(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),fi=K(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),pi=K(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),mi=K(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),hi=K(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),gi=K(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),_i=K(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),vi=K(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),yi=K(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),bi=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),xi=K(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Si=K(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ci=K(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),wi=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ti=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ei=K(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Di=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Oi=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ki=K(`chevrons-left`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),Ai=K(`chevrons-right`,[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]]),ji=K(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Mi=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ni=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Pi=K(`circle-dollar-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),Fi=K(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Ii=K(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Li=K(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ri=K(`clapperboard`,[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]),zi=K(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Bi=K(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Vi=K(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Hi=K(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),Ui=K(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),Wi=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Gi=K(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ki=K(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),qi=K(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Ji=K(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Yi=K(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Xi=K(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Zi=K(`file-text`,[[`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`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Qi=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),$i=K(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),ea=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),ta=K(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),na=K(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ra=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ia=K(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),aa=K(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),oa=K(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),sa=K(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),ca=K(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),la=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ua=K(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),da=K(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),fa=K(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),pa=K(`merge`,[[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22`,key:`1hyw0i`}],[`path`,{d:`m20 22-5-5`,key:`1m27yz`}]]),ma=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ha=K(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),ga=K(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_a=K(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),va=K(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ya=K(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),ba=K(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),xa=K(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Sa=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ca=K(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),wa=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ta=K(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Ea=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Da=K(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Oa=K(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),ka=K(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Aa=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ja=K(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Ma=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Na=K(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Pa=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Fa=K(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),Ia=K(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),La=K(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Ra=K(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),za=K(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ba=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Va=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ha=K(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ua=K(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Wa=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ga=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Ka(){return typeof window<`u`}function qa(e){return Xa(e)?(e.nodeName||``).toLowerCase():`#document`}function Ja(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ya(e){return((Xa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Xa(e){return Ka()?e instanceof Node||e instanceof Ja(e).Node:!1}function Za(e){return Ka()?e instanceof Element||e instanceof Ja(e).Element:!1}function Qa(e){return Ka()?e instanceof HTMLElement||e instanceof Ja(e).HTMLElement:!1}function $a(e){return!Ka()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ja(e).ShadowRoot}function eo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function to(e){return/^(table|td|th)$/.test(qa(e))}function no(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ro=/transform|translate|scale|rotate|perspective|filter/,io=/paint|layout|strict|content/,ao=e=>!!e&&e!==`none`,oo;function so(e){let t=Za(e)?fo(e):e;return ao(t.transform)||ao(t.translate)||ao(t.scale)||ao(t.rotate)||ao(t.perspective)||!lo()&&(ao(t.backdropFilter)||ao(t.filter))||ro.test(t.willChange||``)||io.test(t.contain||``)}function co(e){let t=mo(e);for(;Qa(t)&&!uo(t);){if(so(t))return t;if(no(t))return null;t=mo(t)}return null}function lo(){return oo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),oo}function uo(e){return/^(html|body|#document)$/.test(qa(e))}function fo(e){return Ja(e).getComputedStyle(e)}function po(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(qa(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||$a(e)&&e.host||Ya(e);return $a(t)?t.host:t}function ho(e){let t=mo(e);return uo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qa(t)&&eo(t)?t:ho(t)}function go(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ho(e),i=r===e.ownerDocument?.body,a=Ja(r);if(i){let e=_o(a);return t.concat(a,a.visualViewport||[],eo(r)?r:[],e&&n?go(e):[])}return t.concat(r,go(r,[],n))}function _o(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var vo={...v},yo={};function bo(e,t){let n=v.useRef(yo);return n.current===yo&&(n.current=e(t)),n}var xo=vo.useInsertionEffect,So=xo&&xo!==vo.useLayoutEffect?xo:e=>e();function Co(e){let t=bo(wo).current;return t.next=e,So(t.effect),t.trampoline}function wo(){let e={next:void 0,callback:To,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function To(){}var q=typeof document<`u`?v.useLayoutEffect:()=>{};function Eo(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Do={};function Oo(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ao(t);let a=Ao(e);return t&&(a=jo(a,t)),n&&(a=jo(a,n)),r&&(a=jo(a,r)),i&&(a=jo(a,i)),a}function ko(e){if(e.length===0)return Do;if(e.length===1)return Ao(e[0]);let t=Ao(e[0]);for(let n=1;n<e.length;n+=1)t=jo(t,e[n]);return t}function Ao(e){return Fo(e)?{...Io(e,Do)}:Mo(e)}function jo(e,t){return Fo(t)?Io(t,e):No(e,t)}function Mo(e){let t={...e};for(let e in t){let n=t[e];Po(e,n)&&(t[e]=Ro(n))}return t}function No(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Eo(e.style,r);break;case`className`:e[n]=Bo(e.className,r);break;default:e[n]=Po(n,r)?Lo(e[n],r):r}}return e}function Po(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Fo(e){return typeof e==`function`}function Io(e,t){return Fo(e)?e(t):e??Do}function Lo(e,t){return t?e?(...n)=>{let r=n[0];if(Vo(r)){let i=r;zo(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ro(t):e}function Ro(e){return e&&((...t)=>{let n=t[0];return Vo(n)&&zo(n),e(...t)})}function zo(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Bo(e,t){return t?e?t+` `+e:t:e}function Vo(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Ho(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Uo=Ho(`https://base-ui.com/production-error`,`Base UI`),Wo=v.createContext(void 0);function Go(e=!1){let t=v.useContext(Wo);if(t===void 0&&!e)throw Error(Uo(16));return t}function Ko(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function qo(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=Go(!0),c=a??s!==void 0,{props:l}=Ko({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;Jo(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Oo({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(zo(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=Jo(a),l=!i&&Yo(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(zo(e),a?.(e),e.target===e.currentTarget&&i&&c&&Jo(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Co(e=>{o.current=e,u()})}}function Jo(e){return Qa(e)&&e.tagName===`BUTTON`}function Yo(e){return!!(e?.tagName===`A`&&e?.href)}function Xo(e,t,n,r){let i=bo(Qo).current;return $o(i,e,t,n,r)&&ts(i,[e,t,n,r]),i.callback}function Zo(e){let t=bo(Qo).current;return es(t,e)&&ts(t,e),t.callback}function Qo(){return{callback:null,cleanup:null,refs:[]}}function $o(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function es(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ts(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var ns=19;function rs(e){return ns>=e}function is(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(rs(19)?n?.ref:t.ref)??null}function as(){}var os=Object.freeze([]),ss=Object.freeze({});function cs(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ls(e,t){return typeof e==`function`?e(t):e}function us(e,t){return typeof e==`function`?e(t):e}function ds(e,t,n={}){let r=t.render,i=fs(t,n);return n.enabled===!1?null:hs(e,r,i,n.state??ss)}function fs(e,t={}){let{className:n,style:r,render:i}=e,{state:a=ss,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ls(n,a):void 0,d=l?us(r,a):void 0,f=l?cs(a,c):ss,p=l&&s?ps(s):void 0,m=l?Eo(f,p)??{}:ss;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Zo([m.ref,is(i),...o]):Xo(m.ref,is(i),o):Xo(null,null)),l?(u!==void 0&&(m.className=Bo(m.className,u)),d!==void 0&&(m.style=Eo(m.style,d)),m):ss}function ps(e){return Array.isArray(e)?ko(e):Oo(void 0,e)}var ms=Symbol.for(`react.lazy`);function hs(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Oo(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===ms&&(i=v.Children.toArray(t)[0]),v.cloneElement(i,e)}if(e&&typeof e==`string`)return gs(e,n);throw Error(Uo(8))}function gs(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var _s=v.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=qo({disabled:i,focusableWhenDisabled:a,native:o});return ds(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function vs(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vs(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function ys(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vs(e))&&(r&&(r+=` `),r+=t);return r}var bs=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xs=ys,Ss=(e,t)=>n=>{if(t?.variants==null)return xs(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bs(t)||bs(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xs(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Cs=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ws=(e,t)=>({classGroupId:e,validator:t}),Ts=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Es=`-`,Ds=[],Os=`arbitrary..`,ks=e=>{let t=Ms(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return js(e);let n=e.split(Es);return As(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Cs(i,t):t:i||Ds}return n[e]||Ds}}},As=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=As(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Es):e.slice(t).join(Es),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},js=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Os+r:void 0})(),Ms=e=>{let{theme:t,classGroups:n}=e;return Ns(n,t)},Ns=(e,t)=>{let n=Ts();for(let r in e){let i=e[r];Ps(i,n,r,t)}return n},Ps=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Fs(i,t,n,r)}},Fs=(e,t,n,r)=>{if(typeof e==`string`){Is(e,t,n);return}if(typeof e==`function`){Ls(e,t,n,r);return}Rs(e,t,n,r)},Is=(e,t,n)=>{let r=e===``?t:zs(t,e);r.classGroupId=n},Ls=(e,t,n,r)=>{if(Bs(e)){Ps(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ws(n,e))},Rs=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ps(o,zs(t,a),n,r)}},zs=(e,t)=>{let n=e,r=t.split(Es),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ts(),n.nextPart.set(t,i)),n=i}return n},Bs=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Vs=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Hs=`!`,Us=`:`,Ws=[],Gs=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ks=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Us){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Hs)?(c=s.slice(0,-1),l=!0):s.startsWith(Hs)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Gs(t,l,c,u)};if(t){let e=t+Us,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Gs(Ws,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},qs=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Js=e=>({cache:Vs(e.cacheSize),parseClassName:Ks(e),sortModifiers:qs(e),postfixLookupClassGroupIds:Ys(e),...ks(e)}),Ys=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Xs=/\s+/,Zs=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Xs),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Hs:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Qs=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=$s(n))&&(i&&(i+=` `),i+=r);return i},$s=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=$s(e[r]))&&(n&&(n+=` `),n+=t);return n},ec=(e,...t)=>{let n,r,i,a,o=o=>(n=Js(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Zs(e,n);return i(e,a),a};return a=o,(...e)=>a(Qs(...e))},tc=[],nc=e=>{let t=t=>t[e]||tc;return t.isThemeGetter=!0,t},rc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ic=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ac=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dc=e=>ac.test(e),fc=e=>!!e&&!Number.isNaN(Number(e)),pc=e=>!!e&&Number.isInteger(Number(e)),mc=e=>e.endsWith(`%`)&&fc(e.slice(0,-1)),hc=e=>oc.test(e),gc=()=>!0,_c=e=>sc.test(e)&&!cc.test(e),vc=()=>!1,yc=e=>lc.test(e),bc=e=>uc.test(e),xc=e=>!wc(e)&&!Mc(e),Sc=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Cc=e=>Bc(e,Wc,vc),wc=e=>rc.test(e),Tc=e=>Bc(e,Gc,_c),Ec=e=>Bc(e,Kc,fc),Dc=e=>Bc(e,Jc,gc),Oc=e=>Bc(e,qc,vc),kc=e=>Bc(e,Hc,vc),Ac=e=>Bc(e,Uc,bc),jc=e=>Bc(e,Yc,yc),Mc=e=>ic.test(e),Nc=e=>Vc(e,Gc),Pc=e=>Vc(e,qc),Fc=e=>Vc(e,Hc),Ic=e=>Vc(e,Wc),Lc=e=>Vc(e,Uc),Rc=e=>Vc(e,Yc,!0),zc=e=>Vc(e,Jc,!0),Bc=(e,t,n)=>{let r=rc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Vc=(e,t,n=!1)=>{let r=ic.exec(e);return r?r[1]?t(r[1]):n:!1},Hc=e=>e===`position`||e===`percentage`,Uc=e=>e===`image`||e===`url`,Wc=e=>e===`length`||e===`size`||e===`bg-size`,Gc=e=>e===`length`,Kc=e=>e===`number`,qc=e=>e===`family-name`,Jc=e=>e===`number`||e===`weight`,Yc=e=>e===`shadow`,Xc=ec(()=>{let e=nc(`color`),t=nc(`font`),n=nc(`text`),r=nc(`font-weight`),i=nc(`tracking`),a=nc(`leading`),o=nc(`breakpoint`),s=nc(`container`),c=nc(`spacing`),l=nc(`radius`),u=nc(`shadow`),d=nc(`inset-shadow`),f=nc(`text-shadow`),p=nc(`drop-shadow`),m=nc(`blur`),h=nc(`perspective`),g=nc(`aspect`),_=nc(`ease`),v=nc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Mc,wc],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Mc,wc,c],T=()=>[dc,`full`,`auto`,...w()],E=()=>[pc,`none`,`subgrid`,Mc,wc],D=()=>[`auto`,{span:[`full`,pc,Mc,wc]},pc,Mc,wc],O=()=>[pc,`auto`,Mc,wc],k=()=>[`auto`,`min`,`max`,`fr`,Mc,wc],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[dc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[dc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[dc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Mc,wc],L=()=>[...b(),Fc,kc,{position:[Mc,wc]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Ic,Cc,{size:[Mc,wc]}],B=()=>[mc,Nc,Tc],V=()=>[``,`none`,`full`,l,Mc,wc],H=()=>[``,fc,Nc,Tc],U=()=>[`solid`,`dashed`,`dotted`,`double`],ee=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],W=()=>[fc,mc,Fc,kc],te=()=>[``,`none`,m,Mc,wc],ne=()=>[`none`,fc,Mc,wc],re=()=>[`none`,fc,Mc,wc],ie=()=>[fc,Mc,wc],ae=()=>[dc,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[hc],breakpoint:[hc],color:[gc],container:[hc],"drop-shadow":[hc],ease:[`in`,`out`,`in-out`],font:[xc],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[hc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[hc],shadow:[hc],spacing:[`px`,fc],text:[hc],"text-shadow":[hc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,dc,wc,Mc,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Mc,wc]}],"container-named":[Sc],columns:[{columns:[fc,wc,Mc,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[pc,`auto`,Mc,wc]}],basis:[{basis:[dc,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[fc,dc,`auto`,`initial`,`none`,wc]}],grow:[{grow:[``,fc,Mc,wc]}],shrink:[{shrink:[``,fc,Mc,wc]}],order:[{order:[pc,`first`,`last`,`none`,Mc,wc]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Nc,Tc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,zc,Dc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,mc,wc]}],"font-family":[{font:[Pc,Oc,t]}],"font-features":[{"font-features":[wc]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Mc,wc]}],"line-clamp":[{"line-clamp":[fc,`none`,Mc,Ec]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Mc,wc]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Mc,wc]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...U(),`wavy`]}],"text-decoration-thickness":[{decoration:[fc,`from-font`,`auto`,Mc,Tc]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[fc,`auto`,Mc,wc]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[pc,Mc,wc]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Mc,wc]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Mc,wc]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},pc,Mc,wc],radial:[``,Mc,wc],conic:[pc,Mc,wc]},Lc,Ac]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":H()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...U(),`hidden`,`none`]}],"divide-style":[{divide:[...U(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...U(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[fc,Mc,wc]}],"outline-w":[{outline:[``,fc,Nc,Tc]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Rc,jc]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Rc,jc]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[fc,Tc]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Rc,jc]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[fc,Mc,wc]}],"mix-blend":[{"mix-blend":[...ee(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[fc]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Mc,wc]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[fc]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Mc,wc]}],filter:[{filter:[``,`none`,Mc,wc]}],blur:[{blur:te()}],brightness:[{brightness:[fc,Mc,wc]}],contrast:[{contrast:[fc,Mc,wc]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Rc,jc]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,fc,Mc,wc]}],"hue-rotate":[{"hue-rotate":[fc,Mc,wc]}],invert:[{invert:[``,fc,Mc,wc]}],saturate:[{saturate:[fc,Mc,wc]}],sepia:[{sepia:[``,fc,Mc,wc]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Mc,wc]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[fc,Mc,wc]}],"backdrop-contrast":[{"backdrop-contrast":[fc,Mc,wc]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,fc,Mc,wc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[fc,Mc,wc]}],"backdrop-invert":[{"backdrop-invert":[``,fc,Mc,wc]}],"backdrop-opacity":[{"backdrop-opacity":[fc,Mc,wc]}],"backdrop-saturate":[{"backdrop-saturate":[fc,Mc,wc]}],"backdrop-sepia":[{"backdrop-sepia":[``,fc,Mc,wc]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Mc,wc]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[fc,`initial`,Mc,wc]}],ease:[{ease:[`linear`,`initial`,_,Mc,wc]}],delay:[{delay:[fc,Mc,wc]}],animate:[{animate:[`none`,v,Mc,wc]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Mc,wc]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":[`scale-3d`],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Mc,wc,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":[`translate-none`],zoom:[{zoom:[pc,Mc,wc]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Mc,wc]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Mc,wc]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[fc,Nc,Tc,Ec]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Zc(...e){return Xc(ys(e))}function Qc(e){return e.includes(`T`)?e:e.replace(` `,`T`)+`Z`}function $c(e,t={hour:`2-digit`,minute:`2-digit`,second:`2-digit`}){if(!e)return`—`;let n=new Date(Qc(e));return isNaN(n.getTime())?`—`:n.toLocaleTimeString([],t)}var el=Ss(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-lg px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-lg px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-lg in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-lg in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(_s,{"data-slot":`button`,className:Zc(el({variant:t,size:n,className:e})),...r})}var tl=v.createContext(void 0);function nl(e){let t=v.useContext(tl);if(t===void 0&&!e)throw Error(Uo(33));return t}var rl=v.createContext(void 0);function il(e){let t=v.useContext(rl);if(t===void 0&&!e)throw Error(Uo(36));return t}var al=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),ol={[al.startingStyle]:``},sl={[al.endingStyle]:``},cl={transitionStatus(e){return e===`starting`?ol:e===`ending`?sl:null}},ll=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=al.startingStyle]=`startingStyle`,e[e.endingStyle=al.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),ul=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),dl={[ul.popupOpen]:``},fl={[ul.popupOpen]:``,[ul.pressed]:``},pl={[ll.open]:``},ml={[ll.closed]:``},hl={[ll.anchorHidden]:``},gl={open(e){return e?dl:null}},_l={open(e){return e?fl:null}},vl={open(e){return e?pl:ml},anchorHidden(e){return e?hl:null}},yl=v.createContext(void 0);function bl(e=!0){let t=v.useContext(yl);if(t===void 0&&!e)throw Error(Uo(25));return t}var xl=`none`,Sl=`trigger-press`,Cl=`trigger-hover`,wl=`trigger-focus`,Tl=`outside-press`,El=`item-press`,Dl=`close-press`,Ol=`focus-out`,kl=`escape-key`,Al=`list-navigation`,jl=`cancel-open`,Ml=`sibling-open`,Nl=`imperative-action`,Pl=`window-resize`;function Fl({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(t);return[i?e:a,v.useCallback(e=>{i||o(e)},[])]}var Il=v.createContext(void 0);function Ll(){let e=v.useContext(Il);if(e===void 0)throw Error(Uo(30));return e}var Rl=typeof navigator<`u`,zl=Jl(),Bl=Xl(),Vl=Yl(),Hl=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Ul=zl.platform===`MacIntel`&&zl.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(zl.platform);Rl&&/firefox/i.test(Vl);var Wl=Rl&&/apple/i.test(navigator.vendor);Rl&&/Edg/i.test(Vl);var Gl=Rl&&/android/i.test(Bl)||/android/i.test(Vl),Kl=Rl&&Bl.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,ql=Vl.includes(`jsdom/`);function Jl(){if(!Rl)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function Yl(){if(!Rl)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Xl(){if(!Rl)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function Zl(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=bl(!0),d=u!==void 0;return v.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:El})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!Kl&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var Ql={type:`regular-item`};function $l(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=v.useRef(null),{getButtonProps:d,buttonRef:f}=qo({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Zl({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>Oo(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Xo(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var eu=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function tu(){return v.useContext(eu)}var nu=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function ru(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=tu(),f=v.useRef(-1),[p,m]=v.useState(a??(i===nu.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=v.useRef(null),g=v.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return q(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),q(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),v.useMemo(()=>({ref:g,index:p}),[p,g])}var iu=0;function au(e,t=`mui`){let[n,r]=v.useState(e),i=e||n;return v.useEffect(()=>{n??(iu+=1,r(`${t}-${iu}`))},[n,t]),i}var ou=vo.useId;function su(e,t){if(ou!==void 0){let n=ou();return e??(t?`${t}-${n}`:n)}return au(e,t)}function cu(e){return su(e,`base-ui`)}var lu=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),uu={checked(e){return e?{[lu.checked]:``}:{[lu.unchecked]:``}},...cl};function du(e,t,n,r){let i=!1,a=!1,o=r??ss;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var fu=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,style:f,...p}=e,m=ru({label:a}),h=nl(!0),g=cu(i),{store:_}=il(),y=_.useState(`isActive`,m.index),b=_.useState(`itemProps`),[x,S]=Fl({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:C,itemRef:w}=$l({closeOnClick:c,disabled:s,highlighted:y,id:g,store:_,nativeButton:o,nodeId:h?.context.nodeId,itemMetadata:Ql}),T=v.useMemo(()=>({disabled:s,highlighted:y,checked:x}),[s,y,x]);function E(e){let t=du(El,e.nativeEvent,void 0,{preventUnmountOnClose(){}});d?.(!x,t),!t.isCanceled&&S(e=>!e)}let D=ds(`div`,e,{state:T,stateAttributesMapping:uu,props:[b,{role:`menuitemcheckbox`,"aria-checked":x,onClick:E},p,C],ref:[w,t,m.ref]});return(0,G.jsx)(Il.Provider,{value:T,children:D})}),pu=[];function mu(e){v.useEffect(e,pu)}var hu=null;globalThis.requestAnimationFrame;var gu=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},_u=class e{static create(){return new e}static request(e){return gu.request(e)}static cancel(e){return gu.cancel(e)}currentId=hu;request(e){this.cancel(),this.currentId=gu.request(()=>{this.currentId=hu,e()})}cancel=()=>{this.currentId!==hu&&(gu.cancel(this.currentId),this.currentId=hu)};disposeEffect=()=>this.cancel};function vu(){let e=bo(_u.create).current;return mu(e.disposeEffect),e}function yu(e,t=!1,n=!1){let[r,i]=v.useState(e&&t?`idle`:void 0),[a,o]=v.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),q(()=>{if(!e&&a&&r!==`ending`&&n){let e=_u.request(()=>{i(`ending`)});return()=>{_u.cancel(e)}}},[e,a,r,n]),q(()=>{if(!e||t)return;let n=_u.request(()=>{i(void 0)});return()=>{_u.cancel(n)}},[t,e]),q(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=_u.request(()=>{i(`idle`)});return()=>{_u.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function bu(e){return e==null?e:`current`in e?e.current:e}var xu=l(h());function Su(e,t=!1,n=!0){let r=vu();return Co((i,a=null)=>{r.cancel();let o=bu(e);if(o==null)return;let s=o,c=()=>{xu.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=al.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Cu(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Co(i),o=Su(r,n,!1);v.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var wu=v.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Ll(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=yu(s.checked);return Cu({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}}),ds(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:uu,props:{"aria-hidden":!0,...o},enabled:a||s.checked})}),Tu=v.createContext(void 0),Eu=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=v.useState(void 0),c=ds(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,G.jsx)(Tu.Provider,{value:s,children:c})}),Du=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=ru({label:a}),f=nl(!0),p=cu(i),{store:m}=il(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=$l({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Ql});return ds(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),Ou=0,ku=class e{static create(){return new e}currentId=Ou;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ou,t()},e)}isStarted(){return this.currentId!==Ou}clear=()=>{this.currentId!==Ou&&(clearTimeout(this.currentId),this.currentId=Ou)};disposeEffect=()=>this.clear};function Au(){let e=bo(ku.create).current;return mu(e.disposeEffect),e}function ju(e){e.preventDefault(),e.stopPropagation()}function Mu(e){return`nativeEvent`in e}function Nu(e){return e.pointerType===``&&e.isTrusted?!0:Gl&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Pu(e){return ql?!1:!Gl&&e.width===0&&e.height===0||Gl&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Fu(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Iu(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Lu=`data-base-ui-focusable`,Ru=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,zu=`ArrowLeft`,Bu=`ArrowRight`,Vu=`ArrowUp`,Hu=`ArrowDown`;function Uu(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Wu(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&$a(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Gu(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ku(e,t){if(!Za(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Wu(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function qu(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ju(e){return e.matches(`html,body`)}function Yu(e){return Qa(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Xu(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ru}`)!=null}function Zu(e){return e?e.getAttribute(`role`)===`combobox`&&Yu(e):!1}function Qu(e){if(!e||ql)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function $u(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ed(e,t){return t!=null&&!Fu(t)?0:typeof e==`function`?e():e}function td(e,t,n){let r=ed(e,n);return typeof r==`number`?r:r?.[t]}function nd(e){return typeof e==`function`?e():e}function rd(e,t){return t||e===`click`||e===`mousedown`}function id(e){return e?.includes(`mouse`)&&e!==`mousedown`}function ad(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function od(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function sd(e){let t=bo(cd,e).current;return t.next=e,q(t.effect),t}function cd(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ld(e){return e?.ownerDocument||document}var ud={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},dd={...ud,position:`fixed`,top:0,left:0},fd={...ud,position:`absolute`},pd=v.forwardRef(function(e,t){let[n,r]=v.useState();q(()=>{Wl&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:dd,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),md=[`top`,`right`,`bottom`,`left`],hd=Math.min,gd=Math.max,_d=Math.round,vd=Math.floor,yd=e=>({x:e,y:e}),bd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function xd(e,t,n){return gd(e,hd(t,n))}function Sd(e,t){return typeof e==`function`?e(t):e}function Cd(e){return e.split(`-`)[0]}function wd(e){return e.split(`-`)[1]}function Td(e){return e===`x`?`y`:`x`}function Ed(e){return e===`y`?`height`:`width`}function Dd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Od(e){return Td(Dd(e))}function kd(e,t,n){n===void 0&&(n=!1);let r=wd(e),i=Od(e),a=Ed(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Rd(o)),[o,Rd(o)]}function Ad(e){let t=Rd(e);return[jd(e),t,jd(t)]}function jd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Md=[`left`,`right`],Nd=[`right`,`left`],Pd=[`top`,`bottom`],Fd=[`bottom`,`top`];function Id(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Nd:Md:t?Md:Nd;case`left`:case`right`:return t?Pd:Fd;default:return[]}}function Ld(e,t,n,r){let i=wd(e),a=Id(Cd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(jd)))),a}function Rd(e){let t=Cd(e);return bd[t]+e.slice(t.length)}function zd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:zd(e)}function Vd(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 Hd(e,t,n){return Math.floor(e/t)!==n}function Ud(e,t){return t<0||t>=e.length}function Wd(e,t){return Kd(e.current,{disabledIndices:t})}function Gd(e,t){return Kd(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Kd(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Zd(e,a,r));return a}function qd(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Zd(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=vd(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Zd(e,r,s))return r}};d&&ju(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Kd(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Kd(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Ud(e,f)&&(f=u)}if(n===`both`){let n=vd(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&ju(t),u%o===o-1?r&&(f=Kd(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Kd(e,{startingIndex:u,disabledIndices:s}),r&&Hd(f,o,n)&&(f=Kd(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Hd(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&ju(t),u%o===0?r&&(f=Kd(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Kd(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Hd(f,o,n)&&(f=Kd(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Hd(f,o,n)&&(f=u));let c=vd(l/o)===n;Ud(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Kd(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Jd(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function Yd(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function Xd(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Zd(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!$d(r)||!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Qd(e){return e.visibility===`hidden`||e.visibility===`collapse`}function $d(e,t=e?fo(e):null){return!e||!e.isConnected||!t||Qd(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var ef=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function tf(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return $a(n)?n.host:null}function nf(e){for(let t of Array.from(e.children))if(qa(t)===`summary`)return t;return null}function rf(e,t){let n=nf(t);return!!n&&(e===n||Wu(n,e))}function af(e){let t=e?qa(e):``;return e!=null&&e.matches(ef)&&(t!==`summary`||e.parentElement!=null&&qa(e.parentElement)===`details`&&nf(e.parentElement)===e)&&(t!==`details`||nf(e)==null)&&(t!==`input`||e.type!==`hidden`)}function of(e){if(!af(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tf(t)){let n=t!==e,r=qa(t)===`slot`;if(t.hasAttribute(`inert`)||n&&qa(t)===`details`&&!t.open&&!rf(e,t)||t.hasAttribute(`hidden`)||!r&&!sf(t,n))return!1}return!0}function sf(e,t){let n=fo(e);return t?n.display!==`none`:$d(e,n)}function cf(e){let t=e.tabIndex;if(t<0){let t=qa(e);if(t===`details`||t===`audio`||t===`video`||Qa(e)&&e.isContentEditable)return 0}return t}function lf(e){if(qa(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function uf(e,t){let n=lf(e);if(!n)return!0;let r=t.find(e=>{let t=lf(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=lf(e);return t?.name===n.name&&t.form===n.form})===n}function df(e){if(Qa(e)&&qa(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Qa(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ff(e,t){df(e).forEach(e=>{af(e)&&t.push(e),ff(e,t)})}function pf(e,t,n){df(e).forEach(e=>{Qa(e)&&e.matches(t)&&n.push(e),pf(e,t,n)})}function mf(e){return of(e)&&cf(e)>=0}function hf(e){let t=[];return ff(e,t),t.filter(of)}function gf(e){let t=hf(e);return t.filter(e=>cf(e)>=0&&uf(e,t))}function _f(e,t){let n=gf(e),r=n.length;if(r===0)return;let i=Uu(ld(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function vf(e){return _f(ld(e).body,1)||e}function yf(e){return _f(ld(e).body,-1)||e}function bf(e,t){if(!e)return null;let n=gf(ld(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function xf(e){return bf(e,1)}function Sf(e){return bf(e,-1)}function Cf(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wu(n,r)}function wf(e){gf(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Tf(e){let t=[];pf(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Ef(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ef(e,t.id,n)])}function Df(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Of(e){return`data-base-ui-${e}`}var kf=0;function Af(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(kf);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),as;let o=requestAnimationFrame(a);return kf=o,()=>{kf===o&&(cancelAnimationFrame(o),kf=0)}}var jf={inert:new WeakMap,"aria-hidden":new WeakMap},Mf=`data-base-ui-inert`,Nf={inert:new WeakSet,"aria-hidden":new WeakSet},Pf=new WeakMap,Ff=0;function If(e){return Nf[e]}function Lf(e){return e?$a(e)?e.host:Lf(e.parentNode):null}var Rf=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Lf(t);return e.contains(n)?n:null}).filter(e=>e!=null),zf=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Bf=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{qa(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Vf(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Rf(t,e),u=i?Rf(t,a):[],d=new Set(u),f=i?Bf(t,zf(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=jf[o],n=If(o);c=n,s=e;let r=Rf(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Bf(t,zf(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Pf.get(e)||0)+1;Pf.set(e,t),m.push(e),t===1&&e.setAttribute(Mf,``)}),Ff+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Pf.get(e)||0)-1;Pf.set(e,t),t||e.removeAttribute(Mf)}),--Ff,Ff||(jf.inert=new WeakMap,jf[`aria-hidden`]=new WeakMap,Nf.inert=new WeakSet,Nf[`aria-hidden`]=new WeakSet,Pf=new WeakMap)}}function Hf(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=ld(e[0]).body;return Vf(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Uf={style:{transition:`none`}},Wf=`data-base-ui-click-trigger`,Gf={fallbackAxisSide:`none`},Kf={fallbackAxisSide:`end`},qf={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Jf=v.createContext(null),Yf=()=>v.useContext(Jf),Xf=Of(`portal`);function Zf(e={}){let{ref:t,container:n,componentProps:r=ss,elementProps:i}=e,a=su(),o=Yf()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=Co(e=>{e!==null&&u(e)}),f=v.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Xa(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=ds(`div`,r,{ref:[t,d],props:[{id:a,[Xf]:``},i]});return{portalNode:l,portalSubtree:s&&p?xu.createPortal(p,s):null}}var Qf=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,renderGuards:s,...c}=e,{portalNode:l,portalSubtree:u}=Zf({container:o,ref:t,componentProps:e,elementProps:c}),d=v.useRef(null),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),[h,g]=v.useState(null),_=v.useRef(!1),y=h?.modal,b=h?.open,x=typeof s==`boolean`?s:!!h&&!h.modal&&h.open&&!!l;v.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Cf(e)&&(e.type===`focusin`?_.current&&=(Tf(l),!1):(wf(l),_.current=!0))}return od(ad(l,`focusin`,e,!0),ad(l,`focusout`,e,!0))},[l,y]),v.useEffect(()=>{!l||b!==!1||(Tf(l),_.current=!1)},[b,l]);let S=v.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,G.jsxs)(v.Fragment,{children:[u,(0,G.jsxs)(Jf.Provider,{value:S,children:[x&&l&&(0,G.jsx)(pd,{"data-type":`outside`,ref:d,onFocus:e=>{Cf(e,l)?p.current?.focus():yf(h?h.domReference:null)?.focus()}}),x&&l&&(0,G.jsx)(`span`,{"aria-owns":l.id,style:qf}),l&&xu.createPortal(a,l),x&&l&&(0,G.jsx)(pd,{"data-type":`outside`,ref:f,onFocus:e=>{Cf(e,l)?m.current?.focus():(vf(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,du(`focus-out`,e.nativeEvent)))}})]})]})});function $f(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ep=class{nodesRef={current:[]};events=$f();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},tp=v.createContext(null),np=v.createContext(null),rp=()=>v.useContext(tp)?.id||null,ip=e=>{let t=v.useContext(np);return e??t};function ap(e){let t=su(),n=ip(e),r=rp();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function op(e){let{children:t,id:n}=e,r=rp();return(0,G.jsx)(tp.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function sp(e){let{children:t,externalTree:n}=e,r=bo(()=>n??new ep).current;return(0,G.jsx)(np.Provider,{value:r,children:t})}function cp(e,t){let n=Ja(Gu(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var lp=20,up=[];function dp(){up=up.filter(e=>e.deref()?.isConnected)}function fp(e){dp(),e&&qa(e)!==`body`&&(up.push(new WeakRef(e)),up.length>lp&&(up=up.slice(-20)))}function pp(){return dp(),up[up.length-1]?.deref()}function mp(e){return e?mf(e)?e:gf(e)[0]||e:null}function hp(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=hf(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return mf(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function gp(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),y=h.useState(`floatingElement`),{events:b,dataRef:x}=h.context,S=Co(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Zu(_)&&C,T=v.useRef([`content`]),E=sd(i),D=sd(a),O=sd(l),k=ip(p),A=Yf(),j=v.useRef(!1),M=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),F=v.useRef(``),I=v.useRef(``),L=v.useRef(null),R=v.useRef(null),z=Xo(L,f,A?.beforeInsideRef),B=Xo(R,A?.afterInsideRef),V=Au(),H=Au(),U=vu(),ee=A!=null,W=$u(y),te=Co((e=W)=>e?gf(e):[]),ne=Co(()=>m?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Wu(W,Uu(ld(W)))&&te().length===0&&!w&&ju(e)}return ad(ld(W),`keydown`,e)},[r,W,s,w,te]),v.useEffect(()=>{if(r||!g)return;let e=ld(W);function t(){N.current=!1}function n(e){let t=Gu(e),n=ne(),r=Wu(y,t)||Wu(_,t)||Wu(A?.portalNode,t)||n.some(e=>e===t||Wu(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0)}function i(){I.current=`keyboard`}return od(ad(e,`pointerdown`,n,!0),ad(e,`pointerup`,t,!0),ad(e,`pointercancel`,t,!0),ad(e,`keydown`,i,!0))},[r,y,_,W,g,A,ne]),v.useEffect(()=>{if(r||!c)return;let e=ld(W);function t(){M.current=!0,H.start(0,()=>{M.current=!1})}function n(e){let t=Gu(e);mf(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Gu(t);queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=ne(),f=n?.hasAttribute(Of(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,bu(d),bu(u)].includes(n),p=!(Wu(_,n)||Wu(y,n)||Wu(n,y)||Wu(A?.portalNode,n)||l.some(e=>e===n||Wu(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>Wu(e,n))||f||k&&(Ef(k.nodesRef.current,a).find(e=>Wu(e.context?.elements.floating,n)||Wu(e.context?.elements.domReference,n))||Df(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,$u(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&hp(W,T),o&&r!==_&&!$d(i)&&Uu(e)===e.body){if(Qa(W)&&(W.focus(),o===`popup`)){U.request(()=>{W.focus()});return}let e=te(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;Qa(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==pp())&&(j.current=!0,h.setOpen(!1,du(Ol,t)))})}function a(){N.current||(x.current.insideReactTree=!0,V.start(0,()=>{x.current.insideReactTree=!1}))}let l=Qa(_)?_:null;if(!(!y&&!l))return od(l&&ad(l,`focusout`,i),l&&ad(l,`pointerdown`,t),y&&ad(y,`focusin`,n),y&&ad(y,`focusout`,i),y&&A&&ad(y,`focusout`,a,!0))},[r,_,y,W,s,k,A,h,c,o,te,w,S,T,x,V,H,U,u,d,ne]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Of(`portal`)}]`)||[]),t=(k?Df(k.nodesRef.current,S()):[]).find(e=>Zu(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Hf([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ne(),t,bu(d),bu(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Hf([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,s,A,w,k,S,u,d,ne]),q(()=>{if(!g||r||!Qa(W))return;let e=ld(W),t=Uu(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||Wu(W,t))return;let i=null,a=()=>(i??=te(W),i[0]||W),o;o=r===!0||r===null?a():bu(r),o||=a();let s=Wu(W,Uu(e));Af(o,{preventScroll:o===W,shouldFocus(){if(s)return!0;let t=Uu(e);return!(t!==o&&Wu(W,t))}})})},[r,g,W,te,E,O]),q(()=>{if(r||!W)return;let e=ld(W);fp(Uu(e));function t(e){if(e.open||(F.current=cp(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Nu(e.nativeEvent)||Pu(e.nativeEvent))j.current=!1;else{let e=!1;ld(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,t);function n(){let e=D.current,t=typeof e==`function`?e(F.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`)return _?.isConnected?_:pp()||null;let n=_?.isConnected?_:pp();return bu(t)||n||null}return()=>{b.off(`openchange`,t);let r=Uu(e),i=ne(),a=Wu(y,r)||i.some(e=>e===r||Wu(e,r))||k&&Ef(k.nodesRef.current,S(),!1).some(e=>Wu(e.context?.elements.floating,r)),o=D.current,s=n();queueMicrotask(()=>{let t=mp(s),n=typeof o!=`boolean`;o&&!j.current&&Qa(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),j.current=!1})}},[r,y,W,D,b,k,_,S,ne]),q(()=>{if(!Hl||g||!y)return;let e=Uu(ld(y));!Qa(e)||!Yu(e)||Wu(y,e)&&e.blur()},[g,y]),q(()=>{if(!(r||!A))return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),q(()=>{if(!(r||!W))return hp(W,T),()=>{queueMicrotask(dp)}},[r,W,T]);let re=!r&&(!s||!w)&&(ee||s);return(0,G.jsxs)(v.Fragment,{children:[re&&(0,G.jsx)(pd,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=te();Af(e[e.length-1])}else A?.portalNode&&(j.current=!1,Cf(e,A.portalNode)?vf(_)?.focus():bu(d??A.beforeOutsideRef)?.focus())}}),n,re&&(0,G.jsx)(pd,{"data-type":`inside`,ref:B,onFocus:e=>{s?Af(te()[0]):A?.portalNode&&(c&&(j.current=!0),Cf(e,A.portalNode)?yf(_)?.focus():bu(u??A.afterOutsideRef)?.focus())}})]})}function _p(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Sl}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=v.useRef(void 0),f=vu(),p=Au(),m=v.useMemo(()=>{function e(e,t,n,r){let i=du(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Fu(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=Gu(o);if(Yu(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Fu(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return v.useMemo(()=>n?{reference:m}:ss,[n,m])}var vp={intentional:`onClick`,sloppy:`onPointerDown`};function yp(){return!1}function bp(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function xp(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=yp,referencePressEvent:s=`sloppy`,bubbles:c,externalTree:l}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=ip(l),h=Co(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,y=Co(()=>a),{escapeKey:b,outsidePress:x}=bp(c),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(!1),E=v.useRef(``),D=v.useRef(null),O=Au(),k=Au(),A=Co(()=>{k.clear(),p.current.insideReactTree=!1}),j=Co(e=>{let t=p.current.floatingContext?.nodeId;return(m?Ef(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=Co(e=>qu(e,u.select(`floatingElement`))||qu(e,u.select(`domReferenceElement`))),N=Co(e=>{o()&&u.setOpen(!1,du(Sl,e.nativeEvent))}),P=Co(e=>{if(!d||!n||!r||e.key!==`Escape`||T.current||!b&&j(`__escapeKeyBubbles`))return;let t=du(kl,Mu(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!b&&!t.isPropagationAllowed&&e.stopPropagation()}),F=Co(()=>{p.current.insideReactTree=!0,k.start(0,A)}),I=Co(e=>{if(!d||!n||e.button!==0)return;let t=Gu(e.nativeEvent);Wu(u.select(`floatingElement`),t)&&(S.current||(S.current=!0,C.current=!1))}),L=Co(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&S.current&&(C.current=!0)});v.useEffect(()=>{if(!d||!n)return;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=x;let e=new ku,t=new ku;function i(){e.clear(),T.current=!0}function a(){e.start(lo()?5:0,()=>{T.current=!1})}function o(){w.current=!0,t.start(0,()=>{w.current=!1})}function s(){S.current=!1,C.current=!1}function c(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&Ef(m.nodesRef.current,t).some(t=>qu(e,t.context?.elements.floating));return M(e)||n}function v(e){if(l(e)){e.type!==`click`&&!M(e)&&(t.clear(),w.current=!1),A();return}if(p.current.insideReactTree){A();return}let n=Gu(e),r=`[${Of(`inert`)}]`,i=Za(n)?n.getRootNode():null,a=Array.from(($a(i)?i:ld(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Wu(e,n))))return;let s=Za(n)?n:null;for(;s&&!uo(s);){let e=mo(s);if(uo(e)||!Za(e))break;s=e}if(!(a.length&&Za(n)&&!Ju(n)&&!Wu(n,u.select(`floatingElement`))&&a.every(e=>!Wu(s,e)))){if(Qa(n)&&!(`touches`in e)){let t=uo(n),r=fo(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&w.current){t.clear(),w.current=!1;return}typeof g==`function`&&!g(e)||j(`__outsidePressBubbles`)||(u.setOpen(!1,du(Tl,e)),A())}}}function k(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||M(e)||v(e)}function N(e){if(c()!==`sloppy`||!u.select(`open`)||!n||M(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=Gu(e);if(!n)return;let r=ad(n,e.type,()=>{t(e),r()})}function I(e){E.current=`touch`,F(e,N)}function L(e){O.clear(),e.type===`pointerdown`&&(E.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?k(e):v(e)})}function R(e){if(!S.current)return;let n=C.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),w.current=!0,A())}}}function z(e){if(c()!==`sloppy`||!D.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(v(e),O.clear(),D.current=null)}function B(e){F(e,z)}function V(e){c()!==`sloppy`||!D.current||M(e)||(D.current.dismissOnTouchEnd&&v(e),O.clear(),D.current=null)}function H(e){F(e,V)}let U=ld(f),ee=od(r&&od(ad(U,`keydown`,P),ad(U,`compositionstart`,i),ad(U,`compositionend`,a)),_&&od(ad(U,`click`,L,!0),ad(U,`pointerdown`,L,!0),ad(U,`pointerup`,R,!0),ad(U,`pointercancel`,R,!0),ad(U,`mousedown`,L,!0),ad(U,`mouseup`,R,!0),ad(U,`touchstart`,I,!0),ad(U,`touchmove`,B,!0),ad(U,`touchend`,H,!0)));return()=>{ee(),e.clear(),t.clear(),s(),w.current=!1}},[p,f,r,_,g,d,n,b,x,P,A,y,j,M,m,u,O]),v.useEffect(A,[g,A]);let R=v.useMemo(()=>({onKeyDown:P,[vp[s]]:N,...s!==`intentional`&&{onClick:N}}),[P,N,s]),z=v.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return v.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function Sp(e,t,n){let{reference:r,floating:i}=e,a=Dd(t),o=Od(t),s=Ed(o),c=Cd(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}}switch(wd(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Cp(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}=Sd(t,e),p=Bd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Vd(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=Vd(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 wp=50,Tp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Cp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Sp(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<wp&&(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}=Sp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ep=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}=Sd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Cd(r),_=Dd(o),v=Cd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Rd(o)]:Ad(o)),x=p!==`none`;!d&&x&&b.push(...Ld(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=kd(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Dd(t)||T.every(e=>Dd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.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=T.filter(e=>{if(x){let t=Dd(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function Dp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Op(e){return md.some(t=>e[t]>=0)}var kp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Sd(e,t);switch(i){case`referenceHidden`:{let e=Dp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Op(e)}}}case`escaped`:{let e=Dp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Op(e)}}}default:return{}}}}},Ap=new Set([`left`,`top`]);async function jp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Cd(n),s=wd(n),c=Dd(n)===`y`,l=Ap.has(o)?-1:1,u=a&&c?-1:1,d=Sd(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 Mp=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 jp(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}}}}},Np=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}=Sd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Dd(Cd(i)),p=Td(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=xd(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=xd(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Pp=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}=Sd(e,t),u={x:n,y:r},d=Dd(i),f=Td(d),p=u[f],m=u[d],h=Sd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=Ap.has(Cd(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}}}},Fp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Sd(e,t),u=await o.detectOverflow(t,l),d=Cd(i),f=wd(i),p=Dd(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=hd(h-u[g],v),x=hd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=gd(u.left,0),t=gd(u.right,0),n=gd(u.top,0),r=gd(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:gd(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:gd(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Ip(e){let t=fo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Qa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=_d(n)!==a||_d(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Lp(e){return Za(e)?e:e.contextElement}function Rp(e){let t=Lp(e);if(!Qa(t))return yd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ip(t),o=(a?_d(n.width):n.width)/r,s=(a?_d(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var zp=yd(0);function Bp(e){let t=Ja(e);return!lo()||!t.visualViewport?zp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ja(e)?!1:t}function Hp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Lp(e),o=yd(1);t&&(r?Za(r)&&(o=Rp(r)):o=Rp(e));let s=Vp(a,n,r)?Bp(a):yd(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){let e=Ja(a),t=r&&Za(r)?Ja(r):r,n=e,i=_o(n);for(;i&&r&&t!==n;){let e=Rp(i),t=i.getBoundingClientRect(),r=fo(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=Ja(i),i=_o(n)}}return Vd({width:u,height:d,x:c,y:l})}function Up(e,t){let n=po(e).scrollLeft;return t?t.left+n:Hp(Ya(e)).left+n}function Wp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Up(e,n),y:n.top+t.scrollTop}}function eee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ya(r),s=t?no(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=yd(1),u=yd(0),d=Qa(r);if((d||!d&&!a)&&((qa(r)!==`body`||eo(o))&&(c=po(r)),d)){let e=Hp(r);l=Rp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Wp(o,c):yd(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 tee(e){return Array.from(e.getClientRects())}function Gp(e){let t=Ya(e),n=po(e),r=e.ownerDocument.body,i=gd(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=gd(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Up(e),s=-n.scrollTop;return fo(r).direction===`rtl`&&(o+=gd(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Kp=25;function qp(e,t){let n=Ja(e),r=Ya(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=lo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Up(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Kp&&(a-=o)}else l<=Kp&&(a+=l);return{width:a,height:o,x:s,y:c}}function Jp(e,t){let n=Hp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qa(e)?Rp(e):yd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yp(e,t,n){let r;if(t===`viewport`)r=qp(e,n);else if(t===`document`)r=Gp(Ya(e));else if(Za(t))r=Jp(t,n);else{let n=Bp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Vd(r)}function Xp(e,t){let n=mo(e);return n===t||!Za(n)||uo(n)?!1:fo(n).position===`fixed`||Xp(n,t)}function nee(e,t){let n=t.get(e);if(n)return n;let r=go(e,[],!1).filter(e=>Za(e)&&qa(e)!==`body`),i=null,a=fo(e).position===`fixed`,o=a?mo(e):e;for(;Za(o)&&!uo(o);){let t=fo(o),n=so(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||eo(o)&&!n&&Xp(e,o))?r=r.filter(e=>e!==o):i=t,o=mo(o)}return t.set(e,r),r}function ree(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?no(t)?[]:nee(t,this._c):[].concat(n),r],o=Yp(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=Yp(t,a[e],i);s=gd(n.top,s),c=hd(n.right,c),l=hd(n.bottom,l),u=gd(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function iee(e){let{width:t,height:n}=Ip(e);return{width:t,height:n}}function aee(e,t,n){let r=Qa(t),i=Ya(t),a=n===`fixed`,o=Hp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=yd(0);function l(){c.x=Up(i)}if(r||!r&&!a){if((qa(t)!==`body`||eo(i))&&(s=po(t)),r){let e=Hp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Wp(i,s):yd(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Zp(e){return fo(e).position===`static`}function Qp(e,t){if(!Qa(e)||fo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ya(e)===n&&(n=n.ownerDocument.body),n}function $p(e,t){let n=Ja(e);if(no(e))return n;if(!Qa(e)){let t=mo(e);for(;t&&!uo(t);){if(Za(t)&&!Zp(t))return t;t=mo(t)}return n}let r=Qp(e,t);for(;r&&to(r)&&Zp(r);)r=Qp(r,t);return r&&uo(r)&&Zp(r)&&!so(r)?n:r||co(e)||n}var em=async function(e){let t=this.getOffsetParent||$p,n=this.getDimensions,r=await n(e.floating);return{reference:aee(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tm(e){return fo(e).direction===`rtl`}var nm={convertOffsetParentRelativeRectToViewportRelativeRect:eee,getDocumentElement:Ya,getClippingRect:ree,getOffsetParent:$p,getElementRects:em,getClientRects:tee,getDimensions:iee,getScale:Rp,isElement:Za,isRTL:tm};function rm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function im(e,t){let n=null,r,i=Ya(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=vd(d),h=vd(i.clientWidth-(u+f)),g=vd(i.clientHeight-(d+p)),_=vd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:gd(0,hd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!rm(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function am(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=Lp(e),u=i||a?[...l?go(l):[],...t?go(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?im(l,n):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?Hp(e):null;c&&g();function g(){let t=Hp(e);h&&!rm(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 om=Mp,sm=Np,cm=Ep,lm=Fp,um=kp,dm=Pp,fm=(e,t,n)=>{let r=new Map,i={platform:nm,...n},a={...i.platform,_c:r};return Tp(e,t,{...i,platform:a})},pm=typeof document<`u`?v.useLayoutEffect:function(){};function mm(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(!mm(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)&&!mm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gm(e,t){let n=hm(e);return Math.round(t*n)/n}function _m(e){let t=v.useRef(e);return pm(()=>{t.current=e}),t}function vm(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);mm(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=_m(c),O=_m(i),k=_m(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),fm(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!mm(T.current,t)&&(T.current=t,xu.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);pm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);pm(()=>(j.current=!0,()=>{j.current=!1}),[]),pm(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gm(N.floating,u.x),r=gm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var ym=(e,t)=>{let n=om(e);return{name:n.name,fn:n.fn,options:[e,t]}},bm=(e,t)=>{let n=sm(e);return{name:n.name,fn:n.fn,options:[e,t]}},xm=(e,t)=>({fn:dm(e).fn,options:[e,t]}),Sm=(e,t)=>{let n=cm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cm=(e,t)=>{let n=lm(e);return{name:n.name,fn:n.fn,options:[e,t]}},wm=(e,t)=>{let n=um(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Uo(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},oee=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Tm=o(((e,t)=>{t.exports=oee()})),see=o((e=>{var t=d(),n=Tm();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),cee=o(((e,t)=>{t.exports=see()})),Em=[],Dm=void 0;function lee(){return Dm}function uee(e){Em.push(e)}function Om(e){let t=(t,n)=>{let r=bo(fee).current,i;try{Dm=r;for(let e of Em)e.before(r);i=e(t,n);for(let e of Em)e.after(r);r.didInitialize=!0}finally{Dm=void 0}return i};return t.displayName=e.displayName||e.name,t}function dee(e){return v.forwardRef(Om(e))}function fee(){return{didInitialize:!1}}var km=Tm(),Am=cee(),pee=rs(19)?Nm:Pm;function jm(e,t,n,r,i){return pee(e,t,n,r,i)}function Mm(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,km.useSyncExternalStore)(e.subscribe,a,a)}uee({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,km.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Nm(e,t,n,r,i){let a=lee();if(!a)return Mm(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function Pm(e,t,n,r,i){return(0,Am.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Fm=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return jm(this,e,t,n,r)}},Im=class extends Fm{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),jm(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=Co(t??as);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Lm={open:Y(e=>e.open),transitionStatus:Y(e=>e.transitionStatus),domReferenceElement:Y(e=>e.domReferenceElement),referenceElement:Y(e=>e.positionReference??e.referenceElement),floatingElement:Y(e=>e.floatingElement),floatingId:Y(e=>e.floatingId)},Rm=class extends Im{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:$f(),nested:n,triggerElements:i},Lm),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Iu(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function zm(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=v.useRef(null);r===void 0&&f.current===null&&(f.current=new Rm({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Za(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Bm={tabIndex:-1,[Lu]:``};function Vm(e,t,n=!1){let r=su(),i=rp()!=null,a=v.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,i));let o=e??a.current;return zm({popupStore:o,treatPopupAsFloatingElement:n,floatingRootContext:o.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:o.setOpen}),{store:o,internalStore:a.current}}function Hm(e,t){let n=v.useRef(null),r=v.useRef(null);return v.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Um(e,t,n){let r=n?.id??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function Wm(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Hm(e,n),o=Co(t=>{if(a(t),!t)return;let i=n.select(`open`),o=n.select(`activeTriggerId`);if(o===e){n.update({activeTriggerElement:t,...i?r:null});return}o==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return q(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function Gm(e){let t=e.useState(`open`);q(()=>{if(!t){e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let n=e.context.triggerElements.size,r={};if(e.state.triggerCount!==n&&(r.triggerCount=n),!e.select(`activeTriggerId`)&&n===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;r.activeTriggerId=e,r.activeTriggerElement=n}}(r.triggerCount!==void 0||r.activeTriggerId!==void 0)&&e.update(r)},[t,e,e.useState(`triggerCount`)])}function Km(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=yu(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=Co(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),s=t.useState(`preventUnmountingOnClose`);return Cu({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}function qm(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:ss,inactiveTriggerProps:ss,popupProps:ss})},[e])}function Jm(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ym=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Xm(){return new Rm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Ym,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Zm(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Xm(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ss,inactiveTriggerProps:ss,popupProps:ss}}function Qm(e,t,n=!1){return new Rm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var $m=Y(e=>e.triggerIdProp??e.activeTriggerId),eh=Y(e=>e.openProp??e.open),th=Y(e=>(e.popupElement?.id??e.floatingId)||void 0);function nh(e,t){return t!==void 0&&eh(e)&&$m(e)===t}function rh(e,t){return nh(e,t)?!0:t!==void 0&&eh(e)&&$m(e)==null&&e.triggerCount===1}var ih={open:eh,mounted:Y(e=>e.mounted),transitionStatus:Y(e=>e.transitionStatus),floatingRootContext:Y(e=>e.floatingRootContext),triggerCount:Y(e=>e.triggerCount),preventUnmountingOnClose:Y(e=>e.preventUnmountingOnClose),payload:Y(e=>e.payload),activeTriggerId:$m,activeTriggerElement:Y(e=>e.mounted?e.activeTriggerElement:null),popupId:th,isTriggerActive:Y((e,t)=>t!==void 0&&$m(e)===t),isOpenedByTrigger:Y((e,t)=>nh(e,t)),isMountedByTrigger:Y((e,t)=>t!==void 0&&$m(e)===t&&e.mounted),triggerProps:Y((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Y((e,t)=>rh(e,t)?th(e):void 0),popupProps:Y(e=>e.popupProps),popupElement:Y(e=>e.popupElement),positionerElement:Y(e=>e.positionerElement)};function ah(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=su(),a=rp()!=null,o=bo(()=>new Rm({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ym,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Za(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function oh(e={}){let{nodeId:t,externalTree:n}=e,r=ah(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=v.useState(null),[f,p]=v.useState(void 0),[m,h]=v.useState(void 0),g=v.useRef(null),_=ip(n),y=v.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),b=vm({...e,elements:{...y,...u&&{reference:u}}}),x=Za(f)?f:null,S=m===void 0?i.state.floatingElement:m;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:x),i.useSyncedValue(`floatingElement`,S);let C=v.useCallback(e=>{let t=Za(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),b.refs.setReference(t)},[b.refs]),w=v.useCallback(e=>{(Za(e)||e===null)&&(g.current=e,p(e)),(Za(b.refs.reference.current)||b.refs.reference.current===null||e!==null&&!Za(e))&&b.refs.setReference(e)},[b.refs,p]),T=v.useCallback(e=>{h(e),b.refs.setFloating(e)},[b.refs]),E=v.useMemo(()=>({...b.refs,setReference:w,setFloating:T,setPositionReference:C,domReference:g}),[b.refs,w,T,C]),D=v.useMemo(()=>({...b.elements,domReference:s}),[b.elements,s]),O=v.useMemo(()=>({...b,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:E,elements:D,nodeId:t,rootStore:i}),[b,E,D,t,i,c,l]);return q(()=>{s&&(g.current=s)},[s]),q(()=>{i.context.dataRef.current.floatingContext=O;let e=_?.nodesRef.current.find(e=>e.id===t);e&&(e.context=O)}),v.useMemo(()=>({...b,context:O,refs:E,elements:D,rootStore:i}),[b,E,D,O,i])}var sh=Kl&&Wl;function ch(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=v.useRef(!1),c=v.useRef(null),l=v.useRef(!0),u=Au();v.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=Ja(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&Qa(e)&&e===Uu(ld(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return od(ad(t,`blur`,r),sh&&ad(t,`keydown`,a,!0),sh&&ad(t,`pointerdown`,o,!0))},[i,n]),v.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);Za(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=v.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Gu(t.nativeEvent);if(Za(a)){if(sh&&!t.relatedTarget){if(!l.current&&!Yu(a))return}else if(!Qu(a))return}let o=Ku(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,du(wl,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,du(wl,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=Za(n)&&n.hasAttribute(Of(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=Uu(ld(e));!n&&t===e||Wu(o.current.floatingContext?.refs.floating.current,t)||Wu(e,t)||a||Ku(n??t,i.context.triggerElements)||i.setOpen(!1,du(wl,r))})}}},[o,r,i,u]);return v.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var lh=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ku,this.restTimeout=new ku,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},uh=new WeakMap;function dh(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&uh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),uh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function fh(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=uh.get(n);a&&a!==e&&dh(a),dh(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,uh.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ph(e){let t=e.context.dataRef.current,n=bo(()=>t.hoverInteractionState??lh.create()).current;return t.hoverInteractionState||=n,mu(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function mh(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=ip(),d=rp(),f=ph(a),p=Au(),m=Co(()=>rd(l.current.openEvent?.type,f.interactedInside)),h=Co(()=>id(l.current.openEvent?.type)),g=Co(()=>{dh(f)});q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),v.useEffect(()=>g,[g]),q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&Za(c)&&s){let e=c,t=s,n=ld(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return fh(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),v.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Ef(u.nodesRef.current,d).length>0)}function t(e){let t=td(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,du(Cl,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=Gu(e);if(!Xu(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,_),g()}function h(n){if(e()&&u){u.events.on(`floating.closed`,_);return}if(Ku(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&Za(o)&&Ef(u.nodesRef.current,r,!1).some(e=>Wu(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),m()||t(n)}}function _(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,_),a.setOpen(!1,du(Cl,t)),u.events.emit(`floating.closed`,t)})}let v=s;return od(v&&ad(v,`mouseenter`,c),v&&ad(v,`mouseleave`,h),v&&ad(v,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,_)})},[n,s,a,l,r,i,m,g,f,u,d,p])}var hh={current:null};function gh(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=hh,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p}=t,m=`rootStore`in e?e.rootStore:e,{dataRef:h,events:g}=m.context,_=ip(l),y=ph(m),b=v.useRef(!1),x=sd(i),S=sd(r),C=sd(o),w=sd(n),T=sd(p),E=sd(f),D=Co(()=>rd(h.current.openEvent?.type,y.interactedInside)),O=Co(()=>T.current?.()!==!1),k=Co((e,t,n)=>{let r=m.context.triggerElements;if(r.hasElement(t))return!e||!Wu(e,t);if(!Za(n))return!1;let i=n;return r.hasMatchingElement(e=>Wu(e,i))&&(!e||!Wu(e,i))}),A=Co(()=>{y.handler&&=(ld(m.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Co(()=>{dh(y)});return u&&(y.handleCloseOptions=x.current?.__options),v.useEffect(()=>A,[A]),v.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Cl,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),v.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=td(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{m.setOpen(!1,du(Cl,e)),_?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),m.setOpen(!1,du(Cl,e)),_?.events.emit(`floating.closed`,e))}let t=c.current??(u?m.select(`domReferenceElement`):null);if(!Za(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Fu(y.pointerType))return;let t=nd(C.current),n=td(S.current,`open`,y.pointerType),r=Gu(e),i=e.currentTarget??null,o=m.select(`domReferenceElement`),s=i;if(Za(r)&&!m.context.triggerElements.hasElement(r)){for(let e of m.context.triggerElements.elements())if(Wu(e,r)){s=e;break}}Za(i)&&Za(o)&&!m.context.triggerElements.hasElement(i)&&Wu(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=m.select(`open`),u=E.current?.()??m.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&Za(s)&&Za(o)&&Wu(o,s)&&d,p=t>0&&!n,h=c&&(l||d)||f,g=!l||c;if(h){O()&&m.setOpen(!0,du(Cl,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&m.setOpen(!0,du(Cl,e,s))}):g&&O()&&m.setOpen(!0,du(Cl,e,s)))}function i(t){if(D()){j();return}A();let n=ld(m.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=h.current.floatingContext??d?.();if(!Ku(t.relatedTarget,m.context.triggerElements)){if(x.current&&r){m.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:_,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===m.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!Wu(m.select(`floatingElement`),t.relatedTarget))&&e(t)}}return s?od(ad(t,`mousemove`,r,{once:!0}),ad(t,`mouseenter`,r),ad(t,`mouseleave`,i)):od(ad(t,`mouseenter`,r),ad(t,`mouseleave`,i))},[A,j,h,S,m,n,x,y,u,k,D,a,s,C,c,_,w,d,E,O]),v.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=m.select(`domReferenceElement`),i=m.select(`open`),o=k(r,n,e.target);if(a&&!Fu(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=m.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;fh(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=nd(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=m.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&m.setOpen(!0,du(Cl,t,n))}y.pointerType===`touch`?xu.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,m,C,O])}var _h=`Escape`;function vh(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function yh(e,t){return vh(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function bh(e,t,n){return vh(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function xh(e,t,n){return vh(t,n?e===zu:e===Bu,e===Hu)}function Sh(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===_h:vh(t,n?e===Bu:e===zu,e===Vu)}function Ch(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,cols:y=1,id:b,resetOnPointerLeave:x=!0,externalTree:S}=t,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=$u(T),k=Zu(E),A=sd(O),j=rp(),M=ip(S),N=v.useRef(f),P=v.useRef(o??-1),F=v.useRef(null),I=v.useRef(!0),L=Co(e=>{i(P.current===-1?null:P.current,e)}),R=v.useRef(L),z=v.useRef(!!T),B=v.useRef(w),V=v.useRef(!1),H=v.useRef(!1),U=v.useRef(null),ee=sd(h),W=sd(w),te=sd(o),ne=sd(x),re=vu(),ie=vu(),ae=Co(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):U.current=Af(e,{sync:V.current,preventScroll:!0})}let t=n.current[P.current],r=H.current;t&&e(t),(V.current?e=>e():e=>re.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),de&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{D.current.orientation=g},[D,g]),q(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(H.current=!0,L())):z.current&&(P.current=-1,R.current()))},[a,w,T,o,L]),q(()=>{if(a){if(!w){V.current=!1;return}if(T){if(r==null){if(V.current=!1,te.current!=null)return;if(z.current&&(P.current=-1,ae()),(!B.current||!z.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ie.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||bh(F.current,g,u)||l?Wd(n):Gd(n),F.current=null,L())};t()}}else Ud(n.current,r)||(P.current=r,ae(),H.current=!1)}}},[a,w,T,r,te,l,n,g,u,L,ae,ie]),q(()=>{if(!a||T||!M||d||!z.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=Uu(ld(T)),r=e.some(e=>e.context&&Wu(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,M,j,d]),q(()=>{R.current=L,B.current=w,z.current=!!T}),q(()=>{w||(F.current=null,N.current=f)},[w,f]);let oe=r!=null,se=Co(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),ce=Co(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),le=Co(()=>Wd(n,ee.current)),ue=Co(e=>{if(I.current=!1,V.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(l&&Sh(e.key,g,u,y)){yh(e.key,ce())||ju(e),C.setOpen(!1,du(Al,e.nativeEvent)),Qa(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=Wd(n,h),i=Gd(n,h);if(k||(e.key===`Home`&&(ju(e),P.current=r,L(e)),e.key===`End`&&(ju(e),P.current=i,L(e))),y>1){let t=Array.from({length:n.current.length},()=>({width:1,height:1})),a=Jd(t,y,!1),o=a.findIndex(e=>e!=null&&!Zd(n.current,e,h)),s=a.reduce((e,t,r)=>t!=null&&!Zd(n.current,t,h)?r:e,-1),l=a[qd(a.map(e=>e==null?null:n.current[e]),{event:e,orientation:g,loopFocus:c,rtl:u,cols:y,disabledIndices:Xd([...(typeof h==`function`?null:h)||n.current.map((e,t)=>Zd(n.current,t,h)?t:void 0),void 0],a),minIndex:o,maxIndex:s,prevIndex:Yd(P.current>i?r:P.current,t,a,y,e.key===`ArrowDown`?`bl`:e.key===(u?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(l!=null&&(P.current=l,L(e)),g===`both`)return}if(yh(e.key,g)){if(ju(e),w&&!d&&Uu(e.currentTarget.ownerDocument)===e.currentTarget){P.current=bh(e.key,g,u)?r:i,L(e);return}bh(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(V.current=!1,P.current=r):P.current=Kd(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,Kd(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(V.current=!1,P.current=i):P.current=Kd(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,Kd(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),Ud(n.current,P.current)&&(P.current=-1),L(e)}}),de=v.useMemo(()=>({onFocus(e){V.current=!0,se(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){V.current=!0,H.current=!1,p&&se(e)},onPointerLeave(e){if(!W.current||!I.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ne.current&&(U.current?.(),U.current=null,P.current=-1,L(e),!d)){let e=A.current,t=Uu(ld(e));e&&Wu(e,t)&&e.focus({preventScroll:!0})}}}),[se,W,A,p,n,L,ne,d]),fe=v.useMemo(()=>d&&w&&oe&&{"aria-activedescendant":`${b}-${r}`},[d,w,oe,b,r]),pe=v.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...k?{}:fe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=Gu(e.nativeEvent);if(t&&!Wu(A.current,t))return;ju(e),C.setOpen(!1,du(Ol,e.nativeEvent)),Qa(E)&&E.focus();return}ue(e)},onPointerMove(){I.current=!0}}),[fe,ue,A,g,k,C,w,d,E]),me=v.useMemo(()=>{function e(e){C.setOpen(!0,du(Al,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&Nu(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&Pu(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=xh(t.key,ce(),u),a=yh(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ue(t);if(!(!n&&!m&&r)){if(o){let e=yh(t.key,ce());F.current=l&&e?null:t.key}if(l){i&&(ju(t),n?(P.current=le(),L(t)):e(t));return}a&&(te.current!=null&&(P.current=te.current),ju(t),!n&&m?e(t):ue(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,f,le,l,L,C,m,g,ce,u,te,d]),he=v.useMemo(()=>({...fe,...me}),[fe,me]);return v.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function wh(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=Au(),p=v.useRef(``),m=v.useRef(l??i??-1),h=v.useRef(null),g=Co(e=>{function t(e){let t=r?.current[e];return!t||$d(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(p.current.length>0&&e.key===` `&&(ju(e),o?.(!0)),p.current.length>0&&p.current[0]!==` `&&s(u,p.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;d&&e.key!==` `&&(ju(e),o?.(!0));let g=p.current===``;g&&(m.current=l??i??-1),u.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(c,()=>{p.current=``,m.current=h.current,o?.(!1)});let _=((g?l??i??-1:m.current)??0)+1,v=s(u,p.current,_);v===-1?e.key!==` `&&(p.current=``,o?.(!1)):(a?.(v),h.current=v)}),_=Co(e=>{let t=e.relatedTarget,n=u.select(`domReferenceElement`),r=u.select(`floatingElement`);Wu(n,t)||Wu(r,t)||(f.clear(),p.current=``,m.current=h.current,o?.(!1))});q(()=>{!d&&l!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[d,l,f]),q(()=>{d&&p.current===``&&(m.current=l??i??-1)},[d,l,i]);let y=v.useMemo(()=>({onKeyDown:g,onBlur:_}),[g,_]);return v.useMemo(()=>s?{reference:y,floating:y}:{},[s,y])}var Th=.1,Eh=Th*Th,Dh=.5;function Oh(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function kh(e,t,n,r,i,a,o,s,c,l){let u=!1;return Oh(e,t,n,r,i,a)&&(u=!u),Oh(e,t,i,a,o,s)&&(u=!u),Oh(e,t,o,s,c,l)&&(u=!u),Oh(e,t,c,l,n,r)&&(u=!u),u}function Ah(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function jh(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Mh(e={}){let{blockPointerEvents:t=!1}=e,n=new ku,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Eh;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Gu(r),g=r.type===`mouseleave`,_=Wu(u,h),v=Wu(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Za(r.relatedTarget)&&Wu(u,r.relatedTarget))return;function y(){return!!(s&&Ef(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=jh(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=jh(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=jh(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=jh(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Ah(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Dh/2:Dh*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Dh+1,o=C||T?S.bottom-Dh:S.top,s=C?T?S.bottom-Dh:S.top:S.bottom-Dh;M=kh(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Dh/2:Dh*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Dh,o=C||T?S.top+Dh:S.bottom,s=C?T?S.top+Dh:S.bottom:S.top+Dh;M=kh(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Dh/2:Dh*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Dh+1,o=w||E?S.right-Dh:S.left,s=w?E?S.right-Dh:S.left:S.right-Dh;M=kh(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Dh/2:Dh*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Dh,o=w||E?S.left+Dh:S.right,s=w?E?S.left+Dh:S.right:S.left+Dh;M=kh(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Nh=v.createContext(void 0);function Ph(e){let t=v.useContext(Nh);if(t===void 0&&!e)throw Error(Uo(69));return t}var Fh=`ArrowUp`,Ih=`ArrowDown`,Lh=`ArrowLeft`,Rh=`ArrowRight`,zh=`Home`,Bh=new Set([Lh,Rh]),Vh=new Set([Fh,Ih]),Hh=new Set([...Bh,...Vh]),Uh=new Set([...Hh,zh,`End`]);function Wh(e){return e===`starting`?Uf:ss}var mee={...vl,...cl},hee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=il(),{side:c,align:l}=nl(),u=Ph(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),y=s.useState(`lastOpenChangeReason`),b=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`activeTriggerElement`),T=s.useState(`hoverEnabled`),E=s.useState(`disabled`),D=_.type===`context-menu`;Cu({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){s.setOpen(!1,du(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),mh(x,{enabled:T&&!E&&!D&&_.type!==`menubar`,closeDelay:C});let O=v.useCallback(e=>{s.set(`popupElement`,e)},[s]),k=ds(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:mee,props:[p,{onKeyDown(e){u&&Uh.has(e.key)&&e.stopPropagation()}},Wh(f),o,{"data-rootownerid":b}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&y!==`outside-press`)&&(A=!0),(0,G.jsx)(gp,{context:x,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:w,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),Gh=v.createContext(void 0);function gee(){let e=v.useContext(Gh);if(e===void 0)throw Error(Uo(32));return e}var _ee=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=il();return i.useState(`mounted`)||n?(0,G.jsx)(Gh.Provider,{value:n,children:(0,G.jsx)(Qf,{ref:t,...r})}):null});function Kh(e){return rs(19)?e:e?`true`:void 0}var vee=v.createContext(void 0);function qh(){return v.useContext(vee)?.direction??`ltr`}var yee=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,offsetParent:d=`real`}=Sd(e,t)||{};if(l==null)return{};let f=Bd(u),p={x:n,y:r},m=Od(i),h=Ed(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=xd(k,j,A),N=!c.arrow&&wd(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),bee=(e,t)=>({...yee(e),options:[e,t]}),xee={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await wm().fn(e)).data?.referenceHidden||a}}}},Jh={sideX:`left`,sideY:`top`},Yh={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Ja(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Jh};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=ld(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Cd(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Jh.sideX,g=f===`top`?`bottom`:Jh.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Xh(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Zh(e,t,n){let{rects:r,placement:i}=e;return{side:Xh(t,Cd(i),n),align:wd(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Qh(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,inline:f,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:_=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=v.useState(null);!h&&C!==null&&w(null);let T=g.side||`flip`,E=g.align||`flip`,D=g.fallbackAxisSide||`end`,O=typeof t==`function`?t:void 0,k=Co(O),A=O?k:t,j=sd(t),M=sd(h),N=qh()===`rtl`,P=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[r],F=a===`center`?P:`${P}-${a}`,I=c,L=+(r===`bottom`),R=+(r===`top`),z=+(r===`right`),B=+(r===`left`);typeof I==`number`?I={top:I+L,right:I+B,bottom:I+R,left:I+z}:I&&={top:(I.top||0)+L,right:(I.right||0)+B,bottom:(I.bottom||0)+R,left:(I.left||0)+z};let V={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:I},H=v.useRef(null),U=sd(i),ee=sd(o),W=typeof i==`function`?0:i,te=typeof o==`function`?0:o,ne=[];f&&ne.push(f),ne.push(ym(e=>{let t=Zh(e,r,N),n=typeof U.current==`function`?U.current(t):U.current,i=typeof ee.current==`function`?ee.current(t):ee.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[W,te,N,r]));let re=E===`none`&&T!==`shift`,ie=!re&&(l||_||T===`shift`),ae=T===`none`?null:Sm({...V,padding:{top:I.top+1,right:I.right+1,bottom:I.bottom+1,left:I.left+1},mainAxis:!_&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),oe=re?null:bm(e=>{let t=ld(e.elements.floating).documentElement;return{...V,rootBoundary:_?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:E!==`none`,crossAxis:ie,limiter:l||_?void 0:xm(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=Dd(Cd(e.placement)),i=r===`y`?t:n,a=r===`y`?I.left+I.right:I.top+I.bottom;return{offset:i/2+a/2}})}},[V,l,_,I,E]);T===`shift`||E===`shift`||a===`center`?ne.push(oe,ae):ne.push(ae,oe),ne.push(Cm({...V,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=Ja(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),bee(e=>({element:H.current||ld(e.elements.floating).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Cd(a),l=Dd(c),u=H.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Zh(e,r,N)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ie&&l===`y`&&b?S:x),{}}},xee,b),q(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,m]);let se=v.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ce,elements:le,x:ue,y:de,middlewareData:fe,update:pe,placement:me,context:he,isPositioned:ge,floatingStyles:_e}=oh({rootContext:m,open:p?h:void 0,placement:F,middleware:ne,strategy:n,whileElementsMounted:p?void 0:(...e)=>am(...e,se),nodeId:y,externalTree:S}),{sideX:ve,sideY:ye}=fe.adaptiveOrigin||Jh,be=ge?n:`fixed`,xe=v.useMemo(()=>{let e=b?{position:be,[ve]:ue,[ye]:de}:{position:be,..._e};return ge||(e.opacity=0),e},[b,be,ve,ue,ye,de,_e,ge]),Se=v.useRef(null);q(()=>{if(!h)return;let e=j.current,t=typeof e==`function`?e():e,n=($h(t)?t.current:t)||null;n!==Se.current&&(ce.setPositionReference(n),Se.current=n)},[h,ce,A,j]),v.useEffect(()=>{if(!h)return;let e=j.current;typeof e!=`function`&&$h(e)&&e.current!==Se.current&&(ce.setPositionReference(e.current),Se.current=e.current)},[h,ce,A,j]),v.useEffect(()=>{if(p&&h&&le.domReference&&le.floating)return am(le.domReference,le.floating,pe,se)},[p,h,le,pe,se]);let Ce=Cd(me),we=Xh(r,Ce,N),Te=wd(me)||`center`,Ee=!!fe.hide?.referenceHidden;q(()=>{x&&h&&ge&&w(Ce)},[x,h,ge,Ce]);let De=v.useMemo(()=>({position:`absolute`,top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Oe=fe.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:xe,arrowStyles:De,arrowRef:H,arrowUncentered:Oe,side:we,align:Te,physicalSide:Ce,anchorHidden:Ee,refs:ce,context:he,isPositioned:ge,update:pe}),[xe,De,H,Oe,we,Te,Ce,Ee,ce,he,ge,pe])}function $h(e){return e!=null&&`current`in e}function eg(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Co(i),o=v.useRef(0),s=bo(ng).current,c=bo(tg).current,[l,u]=v.useState(0),d=v.useRef(l),f=Co((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=Co(e=>{c.delete(e),d.current+=1,u(d.current)}),m=v.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(rg).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);q(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),q(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),q(()=>()=>{n.current=[]},[n]),q(()=>()=>{r&&(r.current=[])},[r]);let h=Co(e=>(s.add(e),()=>{s.delete(e)}));q(()=>{s.forEach(e=>e(m))},[s,m]);let g=v.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,G.jsx)(eu.Provider,{value:g,children:t})}function tg(){return new Map}function ng(){return new Set}function rg(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var ig=v.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function ag(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),ds(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Wh(r),i],stateAttributesMapping:vl})}var og={},sg={},cg=``;function lg(e){if(typeof document>`u`)return!1;let t=ld(e);return Ja(t).innerWidth-t.documentElement.clientWidth>0}function ug(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=ld(e),n=t.documentElement,r=t.body,i=eo(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function dg(e){let t=ld(e),n=t.documentElement,r=t.body,i=eo(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function fg(e){let t=ld(e),n=t.documentElement,r=t.body,i=Ja(n),a=0,o=0,s=!1,c=_u.create();if(Hl&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,og={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cg=n.style.scrollBehavior,sg={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=eo(n)?n:r;if(s=ug(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,og),Object.assign(r.style,sg),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=cg)}function d(){u(),c.request(l)}l();let f=ad(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var pg=new class{lockCount=0;restore=null;timeoutLock=ku.create();timeoutUnlock=ku.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ld(e).documentElement,n=Ja(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=as;return}let r=Ul||!lg(e);this.restore=r?dg(e):fg(e)}};function mg(e=!0,t=null){q(()=>{if(e)return pg.acquire(t)},[e,t])}var hg=20;function gg(e,t,n,r){let[i,a]=v.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=ld(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-hg)},[e,t,n]),mg(e&&(!t||i),r)}var _g=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Gf,style:g,..._}=e,{store:y}=il(),b=gee(),x=bl(!0),S=y.useState(`parent`),C=y.useState(`floatingRootContext`),w=y.useState(`floatingTreeRoot`),T=y.useState(`mounted`),E=y.useState(`open`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),A=y.useState(`transitionStatus`),j=y.useState(`positionerElement`),M=y.useState(`instantType`),N=y.useState(`hasViewport`),P=y.useState(`lastOpenChangeReason`),F=y.useState(`floatingNodeId`),I=y.useState(`floatingParentNodeId`),L=C.useState(`domReferenceElement`),R=v.useRef(null),z=Su(j,!1,!1),B=n,V=c,H=l,U=s,ee=h;S.type===`context-menu`&&(B=n??S.context?.anchor,U??=`start`,!o&&U!==`center`&&(H=e.alignOffset??2,V=e.sideOffset??-5));let W=o,te=U;S.type===`menu`?(W??=`inline-end`,te??=`start`,ee=e.collisionAvoidance??Kf):S.type===`menubar`&&(W??=`bottom`,te??=`start`);let ne=S.type===`context-menu`,re=Qh({anchor:B,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:W,sideOffset:V,align:te,alignOffset:H,arrowPadding:ne?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:b,disableAnchorTracking:m,collisionAvoidance:ee,shiftCrossAxis:ne&&!(`side`in ee&&ee.side===`flip`),externalTree:w,adaptiveOrigin:N?Yh:void 0});v.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&y.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,du(Ml)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[y,w.events,F]),v.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,du(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let ie=Au();v.useEffect(()=>{E||ie.clear()},[E,ie]),v.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==y.select(`floatingParentNodeId`))){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?ie.isStarted()||ie.start(e,()=>{y.setOpen(!1,du(Ml))}):y.setOpen(!1,du(Ml))}else ie.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,y,ie]),v.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:y.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,y,F,I]),q(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return z(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,y]);let ae={open:E,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:S.type===`menu`,instant:M},oe=S.type===`menubar`&&S.context.modal;gg(E&&(oe||D&&P!==`trigger-hover`),O===`touch`,j,k);let se=ag(e,ae,{styles:re.positionerStyles,transitionStatus:A,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),ce=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&P!==`trigger-hover`||S.type===`menubar`&&S.context.modal),le=null;return S.type===`menubar`?le=S.context.contentElement:S.type===void 0&&(le=k),(0,G.jsxs)(tl.Provider,{value:re,children:[ce&&(0,G.jsx)(ig,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:Kh(!E),cutout:le}),(0,G.jsx)(op,{id:F,children:(0,G.jsx)(eg,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:se})})]})});function vg(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}var yg=v.createContext(null);function bg(e){let t=v.useContext(yg);if(t===null&&!e)throw Error(Uo(5));return t}function xg(e){let t=v.useRef(``),n=v.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:v.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Sg(e,t){let n=v.useRef(e),r=Co(t);q(()=>{n.current!==e&&r(n.current)},[e,r]),q(()=>{n.current=e},[e])}function Cg(e,t){let{onClick:n,onPointerDown:r}=xg(Co((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ul?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function wg(e){let[t,n]=v.useState(null),r=Cg(e,n);return Sg(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var See={...ih,disabled:Y(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:Y(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:Y(e=>e.openMethod),allowMouseEnter:Y(e=>e.allowMouseEnter),stickIfOpen:Y(e=>e.stickIfOpen),parent:Y(e=>e.parent),rootId:Y(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:Y(e=>e.activeIndex),isActive:Y((e,t)=>e.activeIndex===t),hoverEnabled:Y(e=>e.hoverEnabled),instantType:Y(e=>e.instantType),lastOpenChangeReason:Y(e=>e.openChangeReason),floatingTreeRoot:Y(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:Y(e=>e.floatingNodeId),floatingParentNodeId:Y(e=>e.floatingParentNodeId),itemProps:Y(e=>e.itemProps),closeDelay:Y(e=>e.closeDelay),hasViewport:Y(e=>e.hasViewport),keyboardEventRelay:Y(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},Cee=class e extends Im{constructor(e){super({...wee(),...e},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new Ym},See),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=bo(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function wee(){return{...Zm(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ep,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ss,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var Tg=v.createContext(void 0);function Eg(){return v.useContext(Tg)}var Dg=Om(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=bl(!0),_=il(!0),y=bg(!0),b=Eg(),x=v.useMemo(()=>b&&_?{type:`menu`,store:_.store}:y?{type:`menubar`,context:y}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,y,b]),S=Cee.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x});vg(()=>{n===void 0&&S.state.open===!1&&a===!0&&S.update({open:!0,activeTriggerId:m})}),S.useControlledProp(`openProp`,n),S.useControlledProp(`triggerIdProp`,p),S.useContextCallback(`onOpenChangeComplete`,i);let C=su(),w=su(),T=S.useState(`floatingTreeRoot`),E=ap(T),D=rp(),O=S.useState(`open`),k=S.useState(`activeTriggerElement`),A=S.useState(`positionerElement`),j=S.useState(`hoverEnabled`),M=S.useState(`disabled`),N=S.useState(`lastOpenChangeReason`),P=S.useState(`parent`),F=S.useState(`activeIndex`),I=S.useState(`payload`),L=S.useState(`floatingParentNodeId`),R=v.useRef(null),z=v.useRef(P.type!==`context-menu`),B=Au(),V=v.useRef(!0),H=Au(),U=L!=null,{openMethod:ee,triggerProps:W}=wg(O);S.useSyncedValues({disabled:o,modal:P.type===void 0?s:void 0,openMethod:ee,rootId:C}),Gm(S);let{forceUnmount:te}=Km(O,S,()=>{S.update({allowMouseEnter:!1,stickIfOpen:!0})});q(()=>{g&&!_?S.update({parent:{type:`context-menu`,context:g},floatingNodeId:E,floatingParentNodeId:D}):_&&S.update({floatingNodeId:E,floatingParentNodeId:D})},[g,_,E,D,S]),v.useEffect(()=>{if(O||(R.current=null),P.type===`context-menu`){if(!O){B.clear(),z.current=!1;return}B.start(500,()=>{z.current=!0})}},[B,O,P.type]),q(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let ne=Co((e,t)=>{let n=t.reason;if(O===e&&t.trigger===k&&N===n||(t.preventUnmountOnClose=()=>{S.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=k??void 0),r?.(e,t),t.isCanceled))return;S.state.floatingRootContext.dispatchOpenChange(e,t);let i=t.event;if(e===!1&&i?.type===`click`&&i.pointerType===`touch`&&!V.current)return;if(!e&&F!==null){let e=S.context.itemDomElements.current[F];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(V.current=!1,H.start(300,()=>{V.current=!0})):(V.current=!0,H.clear());let a=(n===`trigger-press`||n===`item-press`)&&i.detail===0&&i?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};R.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),S.update(s),P.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?S.set(`instantType`,`group`):a||o?S.set(`instantType`,a?`click`:`dismiss`):S.set(`instantType`,void 0)}),re=zm({popupStore:S,floatingId:w,nested:D!=null,onOpenChange:ne}),ie=re.context.events;v.useEffect(()=>{let e=({open:e,eventDetails:t})=>ne(e,t);return ie.on(`setOpen`,e),()=>{ie?.off(`setOpen`,e)}},[ie,ne]);let ae=v.useCallback(()=>{S.setOpen(!1,du(Nl))},[S]);v.useImperativeHandle(u,()=>({unmount:te,close:ae}),[te,ae]);let oe;P.type===`context-menu`&&(oe=P.context),v.useImperativeHandle(oe?.positionerRef,()=>A,[A]),v.useImperativeHandle(oe?.actionsRef,()=>({setOpen:ne}),[ne]);let se=xp(re,{enabled:!M,bubbles:{escapeKey:d&&P.type===`menu`},outsidePress(){return P.type!==`context-menu`||R.current?.type===`contextmenu`||z.current},externalTree:U?T:void 0}),ce=qh(),le=v.useCallback(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),ue=Ch(re,{enabled:!M,listRef:S.context.itemDomElements,activeIndex:F,nested:P.type!==void 0,loopFocus:c,orientation:l,parentOrientation:P.type===`menubar`?P.context.orientation:void 0,rtl:ce===`rtl`,disabledIndices:os,onNavigate:le,openOnArrowKeyDown:P.type!==`context-menu`,externalTree:U?T:void 0,focusItemOnHover:h}),de=v.useCallback(e=>{S.context.typingRef.current=e},[S]),fe=wh(re,{listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:F,resetMs:500,onMatch:e=>{O&&e!==F&&S.set(`activeIndex`,e)},onTyping:de});qm(S,{floatingRootContext:re,activeTriggerProps:v.useMemo(()=>{let e=Oo(fe.reference,ue.reference,se.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,fe.reference,ue.reference,se.reference,W,O]),inactiveTriggerProps:v.useMemo(()=>{let e=Oo(ue.trigger,se.trigger,W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ue.trigger,se.trigger,W]),popupProps:v.useMemo(()=>Oo(Bm,{id:w,role:`menu`,"aria-labelledby":k?.id,onMouseMove(){S.set(`allowMouseEnter`,!0),P.type===`menu`&&S.set(`hoverEnabled`,!1)},onClick(){S.select(`hoverEnabled`)&&S.set(`hoverEnabled`,!1)},onKeyDown(e){let t=S.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},fe.floating,ue.floating,se.floating),[k,w,P.type,S,fe.floating,ue.floating,se.floating]),itemProps:ue.item??ss});let pe=v.useMemo(()=>({store:S,parent:x}),[S,x]),me=(0,G.jsx)(rl.Provider,{value:pe,children:typeof t==`function`?t({payload:I}):t});return P.type===void 0||P.type===`context-menu`?(0,G.jsx)(sp,{externalTree:T,children:me}):me});function Tee(e){let t=il().store,n=v.useMemo(()=>({parentMenu:t}),[t]);return(0,G.jsx)(Tg.Provider,{value:n,children:(0,G.jsx)(Dg,{...e})})}function Og(e){let t=e.getBoundingClientRect(),n=Ja(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Eee(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Go(),{ref:i,index:a}=ru(e),o=n===a,s=v.useRef(null),c=Xo(i,s);return{compositeProps:v.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function Dee(e){let{render:t,className:n,style:r,state:i=ss,props:a=os,refs:o=os,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Eee({metadata:s});return ds(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function kg(e){if(Qa(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!uo(e))return kg(mo(e))}function Ag(e,t){let n=v.useRef(null);function r(t){xu.flushSync(()=>{e.setOpen(!1,du(Ol,t.nativeEvent,t.currentTarget))}),Sf(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&Cf(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{xu.flushSync(()=>{e.setOpen(!1,du(Ol,n.nativeEvent,n.currentTarget))});let i=xf(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&Wu(r,i);){let e=i;if(i=vf(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Oee(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,ld(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:ss,[t,n,r])}var jg=2,kee=dee(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=il(!0),h=d?.store??m?.store;if(!h)throw Error(Uo(85));let g=cu(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),C=jee(),w=Go(!0),T=ip(),E=v.useMemo(()=>T??new ep,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Wm(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:ap(E),floatingParentNodeId:rp(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=qo({disabled:j,native:o});v.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=v.useRef(null),F=Au(),I=Co(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(Wu(P.current,t)||Wu(h.select(`positionerElement`),t)||t===P.current||t!=null&&kg(t)===h.select(`rootId`))return;let n=Og(P.current);e.clientX>=n.left-jg&&e.clientX<=n.right+jg&&e.clientY>=n.top-jg&&e.clientY<=n.bottom+jg||E.events.emit(`close`,{domEvent:e,reason:jl})});v.useEffect(()=>{b&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&ld(P.current).addEventListener(`mouseup`,I,{once:!0})},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=gh(y,{enabled:(c??L)&&!j&&C.type!==`context-menu`&&(!k||L&&!O),handleClose:Mh({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=Aee(b,h.select(`lastOpenChangeReason`)),B=_p(y,{enabled:!j&&C.type!==`context-menu`,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),V=ch(y,{enabled:!j&&L}),H=Oee({open:b,enabled:k,mouseDownAction:`open`}),U=v.useMemo(()=>Oo(V.reference,B.reference),[V.reference,B.reference]),ee=h.useState(`triggerProps`,O),{preFocusGuardRef:W,handlePreFocusGuardFocus:te,handleFocusTargetFocus:ne}=Ag(h,S),re={disabled:j,open:b},ie=[P,t,N,D,S],ae=[U,R??ss,ee,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),ld(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},H,p,M],oe=ds(`button`,e,{enabled:!k,stateAttributesMapping:_l,state:re,ref:ie,props:ae});return k?(0,G.jsx)(Dee,{tag:`button`,render:n,className:r,style:i,state:re,refs:ie,props:ae,stateAttributesMapping:_l}):b?(0,G.jsxs)(v.Fragment,{children:[(0,G.jsx)(pd,{ref:W,onFocus:te},`${g}-pre-focus-guard`),(0,G.jsx)(v.Fragment,{children:oe},g),(0,G.jsx)(pd,{ref:h.context.triggerFocusTargetRef,onFocus:ne},`${g}-post-focus-guard`)]}):(0,G.jsx)(v.Fragment,{children:oe},g)});function Aee(e,t){let n=Au(),[r,i]=v.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function jee(){let e=bl(!0),t=il(!0),n=bg(!0);return v.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}function Mee(e){let[t,n]=v.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var Nee=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return ds(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Pee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=ru(),m=nl(),{store:h}=il(),g=cu(o),_=h.useState(`open`),y=h.useState(`floatingRootContext`),b=h.useState(`floatingTreeRoot`),x=h.useState(`triggerPopupId`,g),S=Hm(g,h),C=v.useCallback(e=>{let t=S(e);return e!==null&&h.select(`open`)&&h.select(`activeTriggerId`)==null&&h.update({activeTriggerId:g,activeTriggerElement:e,closeDelay:u}),t},[S,u,h,g]),w=v.useRef(null),T=v.useCallback(e=>{w.current=e,h.set(`activeTriggerElement`,e)},[h]),E=Eg();if(!E?.parentMenu)throw Error(Uo(37));h.useSyncedValue(`closeDelay`,u);let D=E.parentMenu,O=D.useState(`itemProps`),k=D.useState(`isActive`,p.index),A=v.useMemo(()=>({type:`submenu-trigger`,setActive(){D.set(`activeIndex`,p.index)}}),[D,p.index]),j=h.useState(`disabled`),M=d||j,{getItemProps:N,itemRef:P}=$l({closeOnClick:!1,disabled:M,highlighted:k,id:g,store:h,typingRef:D.context.typingRef,nativeButton:s,itemMetadata:A,nodeId:m?.context.nodeId}),F=h.useState(`hoverEnabled`),I=D.useState(`allowMouseEnter`),L=gh(y,{enabled:F&&c&&!M,handleClose:Mh({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:I?{open:l,close:u}:0,triggerElementRef:w,externalTree:b,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=_p(y,{enabled:!M,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??ss,z=h.useState(`triggerProps`,!0);return delete z.id,ds(`div`,e,{state:{disabled:M,highlighted:k,open:_},stateAttributesMapping:gl,props:[R,L,z,O,{"aria-controls":x,tabIndex:_||k?0:-1,onBlur(){k&&D.set(`activeIndex`,null)}},f,N],ref:[t,p.ref,P,C,T]})});function Mg({...e}){return(0,G.jsx)(Dg,{"data-slot":`dropdown-menu`,...e})}function Ng({...e}){return(0,G.jsx)(kee,{"data-slot":`dropdown-menu-trigger`,...e})}function Pg({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,G.jsx)(_ee,{children:(0,G.jsx)(_g,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,G.jsx)(hee,{"data-slot":`dropdown-menu-content`,className:Zc(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Fee({...e}){return(0,G.jsx)(Eu,{"data-slot":`dropdown-menu-group`,...e})}function Fg({className:e,inset:t,variant:n=`default`,...r}){return(0,G.jsx)(Du,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Zc(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Ig({...e}){return(0,G.jsx)(Tee,{"data-slot":`dropdown-menu-sub`,...e})}function Lg({className:e,inset:t,children:n,...r}){return(0,G.jsxs)(Pee,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:Zc(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(Di,{className:`ml-auto`})]})}function Rg({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,G.jsx)(Pg,{"data-slot":`dropdown-menu-sub-content`,className:Zc(`w-auto min-w-24 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function zg({className:e,children:t,checked:n,inset:r,...i}){return(0,G.jsxs)(fu,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:Zc(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,G.jsx)(wu,{children:(0,G.jsx)(wi,{})})}),t]})}function Bg({className:e,...t}){return(0,G.jsx)(Nee,{"data-slot":`dropdown-menu-separator`,className:Zc(`-mx-1 my-1 h-px bg-border`,e),...t})}var Vg=v.createContext(void 0);function Hg(e){let t=v.useContext(Vg);if(t===void 0&&!e)throw Error(Uo(47));return t}function Ug(){return{...Zm(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Wg={...ih,disabled:Y(e=>e.disabled),instantType:Y(e=>e.instantType),openMethod:Y(e=>e.openMethod),openChangeReason:Y(e=>e.openChangeReason),modal:Y(e=>e.modal),focusManagerModal:Y(e=>e.focusManagerModal),stickIfOpen:Y(e=>e.stickIfOpen),titleElementId:Y(e=>e.titleElementId),descriptionElementId:Y(e=>e.descriptionElementId),openOnHover:Y(e=>e.openOnHover),closeDelay:Y(e=>e.closeDelay),hasViewport:Y(e=>e.hasViewport)},Gg=class e extends Im{constructor(e,t,n=!1){let r={...Ug(),...e},i=new Ym;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=Qm(i,t,n),super(r,{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new ku,triggerElements:i},Wg)}setOpen=(e,t)=>{let n=t.reason===Cl,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)};let a=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&a!=null&&(t.trigger=this.context.triggerElements.getById(a)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let n={open:e,openChangeReason:t.reason};Um(n,e,t.trigger),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),xu.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=Vm(t,(t,r)=>new e(n,t,r));return v.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function Kg({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Gg.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});vg(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`),m=rp()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Jm(u,d),Gm(u);let{forceUnmount:h}=Km(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o,nested:m}),v.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=v.useCallback(()=>{u.setOpen(!1,du(Nl))},[u]);v.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,y=v.useMemo(()=>({store:u}),[u]);return(0,G.jsxs)(Vg.Provider,{value:y,children:[_&&(0,G.jsx)(Jg,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function qg(e){return Hg(!0)?(0,G.jsx)(Kg,{props:e}):(0,G.jsx)(sp,{children:(0,G.jsx)(Kg,{props:e})})}function Jg({store:e,modal:t}){let n=xp(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return qm(e,{activeTriggerProps:n.reference??ss,inactiveTriggerProps:n.trigger??ss,popupProps:v.useMemo(()=>Oo(Bm,n.floating),[n.floating])}),null}var Yg=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Hg(!0),h=s?.store??m?.store;if(!h)throw Error(Uo(74));let g=cu(f),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Wm(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=gh(y,{enabled:y!=null&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:Mh(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=_p(y,{enabled:y!=null,stickIfOpen:E}),j=Cg(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=qo({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?_l.open(e):gl.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=Ag(h,S),z=ds(`button`,e,{state:{disabled:a,open:b},ref:[P,t,C,S],props:[A.reference,k,M,j,{[Wf]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,N],stateAttributesMapping:F});return w&&!O?(0,G.jsxs)(v.Fragment,{children:[(0,G.jsx)(pd,{ref:I,onFocus:L}),(0,G.jsx)(v.Fragment,{children:z},g),(0,G.jsx)(pd,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):(0,G.jsx)(v.Fragment,{children:z},g)}),Xg=v.createContext(void 0);function Zg(){let e=v.useContext(Xg);if(e===void 0)throw Error(Uo(45));return e}var Qg=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Hg();return i.useState(`mounted`)||n?(0,G.jsx)(Xg.Provider,{value:n,children:(0,G.jsx)(Qf,{ref:t,...r})}):null}),$g=v.createContext(void 0);function e_(){let e=v.useContext($g);if(!e)throw Error(Uo(46));return e}var t_=v.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=Kf,..._}=e,{store:y}=Hg(),b=Zg(),x=ap(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),j=y.useState(`transitionStatus`),M=y.useState(`hasViewport`),N=v.useRef(null),P=Su(k,!1,!1),F=Qh({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:b,nodeId:x,collisionAvoidance:g,adaptiveOrigin:M?Yh:void 0}),I=S.useState(`domReferenceElement`);q(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return P(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,y]),gg(w&&D===!0&&T!==`trigger-hover`,O===`touch`,k,E);let L=v.useCallback(e=>{y.set(`positionerElement`,e)},[y]),R=ag(e,{open:w,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,L],hidden:!C,inert:!w});return(0,G.jsxs)($g.Provider,{value:F,children:[C&&D===!0&&T!==`trigger-hover`&&(0,G.jsx)(ig,{ref:y.context.internalBackdropRef,inert:Kh(!w),cutout:E}),(0,G.jsx)(op,{id:x,children:R})]})}),n_=v.createContext(void 0);function r_(){let[e,t]=v.useState(0),n=Co(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:v.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function i_(e){let{value:t,children:n}=e;return(0,G.jsx)(n_.Provider,{value:t,children:n})}var a_={...vl,...cl},o_=v.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Hg(),l=e_(),u=Ph(!0)!=null,{context:d,hasClosePart:f}=r_(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`),A=s.id??E;Cu({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),mh(T,{enabled:O&&!D,closeDelay:k});function j(e){return e!==`touch`||c.context.popupRef.current}let M=a===void 0?j:a,N=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,N);let P=v.useCallback(e=>{c.set(`popupElement`,e)},[c]),F=ds(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,P],props:[_,{id:A,role:`dialog`,...Bm,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&Uh.has(e.key)&&e.stopPropagation()}},Wh(g),s],stateAttributesMapping:a_});return(0,G.jsx)(gp,{context:T,openInteractionType:m,modal:N,disabled:!S||C===`trigger-hover`,initialFocus:M,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Qa(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(i_,{value:d,children:F})})});function s_({...e}){return(0,G.jsx)(qg,{"data-slot":`popover`,...e})}function c_({...e}){return(0,G.jsx)(Yg,{"data-slot":`popover-trigger`,...e})}function l_({className:e,align:t=`center`,sideOffset:n=8,children:r,...i}){return(0,G.jsx)(Qg,{children:(0,G.jsx)(t_,{className:`isolate z-50 outline-none`,align:t,sideOffset:n,children:(0,G.jsx)(o_,{"data-slot":`popover-content`,className:Zc(`z-50 w-72 origin-(--transform-origin) rounded-xl bg-popover p-4 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...i,children:r})})})}var u_=`/`.replace(/\/$/,``),d_=`srouter_dashboard_token`;function f_(){try{return localStorage.getItem(d_)}catch{return null}}function p_(e){try{localStorage.setItem(d_,e)}catch{}}function m_(){try{localStorage.removeItem(d_)}catch{}}var h_=`srouter:unauthorized`;async function X(e,t){let n=f_(),r=new Headers(t?.headers);!(typeof FormData<`u`&&t?.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`),n&&r.set(`Authorization`,`Bearer ${n}`);let i=await fetch(`${u_}${e}`,{...t,headers:r});if(!i.ok){let e=await i.json().catch(()=>({error:{message:i.statusText}}));i.status===401&&e.error?.type===`authentication_error`&&(m_(),window.dispatchEvent(new CustomEvent(h_)));let t=Error(e.error?.message??`HTTP ${i.status}`);throw t.status=i.status,t.code=e.error?.type,t}if(i.status===204)return;let a=await i.text();try{return JSON.parse(a)}catch{throw Error(`Expected JSON from ${e} but got a non-JSON response. The API isn't reachable at this origin — make sure the backend is running and that /api is forwarded to it, not served as the dashboard's static files.`)}}async function g_(){try{await X(`/api/auth/logout`,{method:`POST`})}catch{}m_(),window.dispatchEvent(new CustomEvent(h_))}function __({id:e,error:t}){return t?(0,G.jsx)(`p`,{id:e,role:`alert`,className:`text-xs text-destructive`,children:t}):null}var v_=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),y_={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},b_={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},x_={disabled:!1,...b_},S_={valid(e){return e===null?null:e?{[v_.valid]:``}:{[v_.invalid]:``}}},C_={invalid:void 0,name:void 0,validityData:{state:y_,errors:[],error:``,value:``,initialValue:null},setValidityData:as,disabled:void 0,touched:b_.touched,setTouched:as,dirty:b_.dirty,setDirty:as,filled:b_.filled,setFilled:as,focused:b_.focused,setFocused:as,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:x_,markedDirtyRef:{current:!1},registerFieldControl:as,validation:{getValidationProps:(e=ss)=>e,getInputValidationProps:(e=ss)=>e,inputRef:{current:null},commit:async()=>{}}},w_=v.createContext(C_);function T_(e=!0){let t=v.useContext(w_);if(t.setValidityData===as&&!e)throw Error(Uo(28));return t}var E_=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:as,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function D_(){return v.useContext(E_)}var O_=v.createContext({controlId:void 0,registerControlId:as,labelId:void 0,setLabelId:as,messageIds:[],setMessageIds:as,getDescriptionProps:e=>e});function k_(){return v.useContext(O_)}function A_(e,t,n,r=!0,i){let[a,o]=v.useState(),s=cu(i?`${i}-label`:void 0),c=e??t??a;return q(()=>{let i=e||t||!r?void 0:j_(n.current,s);a!==i&&o(i)}),c}function j_(e,t){let n=M_(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function M_(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function N_(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=k_(),o=cu(t),s=n?i:void 0,c=bo(()=>Symbol(`labelable-control`)),l=v.useRef(!1),u=v.useRef(t!=null),d=Co(()=>{!l.current||a===as||(l.current=!1,a(c.current,void 0))});return q(()=>{if(a===as)return;let e;if(n){let n=r?.current;e=Za(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),v.useEffect(()=>d,[d]),i??o}function P_(e,t,n,r,i=!0){let{registerFieldControl:a}=T_(),o=v.useRef(null);o.current||=Symbol(),q(()=>{let s=o.current;if(!(!s||!i))return a(s,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(s,void 0)}},[e,i,r,t,a,n])}var F_=v.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=T_(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=k_(),O=N_({id:i});q(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let k=v.useRef(null);q(()=>{u&&k.current===Uu(ld(k.current))&&b(!0)},[u,b]);let[A]=Fl({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=Co(()=>C.inputRef.current?.value);return P_(C.inputRef,O,M,N),ds(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:C.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,du(xl,e.nativeEvent)),_(t!==y.initialValue),x(t!==``)},onFocus(){b(!0)},onBlur(e){g(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),C.commit(e.currentTarget.value))}},C.getInputValidationProps(),f],stateAttributesMapping:S_})}),I_=v.forwardRef(function(e,t){return(0,G.jsx)(F_,{ref:t,...e})});function L_({className:e,type:t,...n}){return(0,G.jsx)(I_,{type:t,"data-slot":`input`,className:Zc(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function R_({className:e,label:t,...n}){let[r,i]=(0,v.useState)(!1);return(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(L_,{...n,type:r?`text`:`password`,className:Zc(`pe-9`,e),"aria-label":t}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-label":r?`Hide ${t??`password`}`:`Show ${t??`password`}`,"aria-pressed":r,className:`absolute end-1.5 top-1/2 -translate-y-1/2 rounded-md p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:r?(0,G.jsx)(Yi,{className:`size-4`,"aria-hidden":!0}):(0,G.jsx)(Xi,{className:`size-4`,"aria-hidden":!0})})]})}function z_({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:Zc(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function B_(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function V_(e){return/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim())}var H_={nav:{models:`Models`,playground:`Playground`,keys:`Keys`,agents:`Agents`,analytics:`Analytics`,premium:`Premium`,upgrade:`Upgrade`,settings:`Settings`,signOut:`Sign out`,openMenu:`Open navigation menu`,switchLight:`Switch to light theme`,switchDark:`Switch to dark theme`,switchToChinese:`Switch to Chinese`,switchToEnglish:`Switch to English`,modelsMenu:`Browse model types`,logs:`Logs`,analyticsMenu:`Analytics pages`,notifications:`Notifications`,noNotifications:`No notifications yet`},auth:{createYourAccount:`Create your account`,signIn:`Sign in`,email:`Email`,password:`Password`,emailPlaceholder:`you@example.com`,passwordPlaceholderSetup:`at least 8 characters`,passwordPlaceholderLogin:`your password`,setupDescription:`Set the email and password that will protect this dashboard.`,loginDescription:`Sign in to manage your keys, routing, and analytics.`,createAccount:`Create account`,creating:`Creating…`,signingIn:`Signing in…`,loading:`Loading…`,newPasswordAutoComplete:`new-password`,currentPasswordAutoComplete:`current-password`,serverUnreachableBefore:`Can't reach the server. Make sure the backend is running (`,serverUnreachableAfter:`).`,setupCode:`Setup code`,setupCodePlaceholder:`code from the server logs`,setupCodeHint:`Setting up from another device needs the one-time code printed in the server logs at startup.`,changePassword:`Change password`,changeEmail:`Change email`,forgotPassword:`Forgot password?`,currentPassword:`Current password`,newPassword:`New password`,newEmail:`New email`,resetCode:`Reset code`,resetCodePlaceholder:`code from the server logs`,resetCodeHint:`The code is in the server log. It is never sent by email.`,forgotPasswordDescription:`Click the button below to generate a reset code. The code is written to the server log, never emailed. Enter it here to set a new password.`,requestResetCode:`Send reset code`,requestingResetCode:`Sending…`,resetPassword:`Reset password`,resettingPassword:`Resetting…`,changingPassword:`Changing…`,changingEmail:`Changing…`,backToLogin:`Back to sign in`,passwordChanged:`Password changed successfully.`,emailChanged:`Email changed successfully.`,passwordReset:`Password reset successfully. Please sign in.`,resetCodeDockerHint:`Running in Docker? The code is in the container log: docker logs <container>.`,desktopSessionFailed:`The dashboard could not sign in to the local server. Quit SRouter and open it again.`},common:{save:`Save`,saving:`Saving…`,cancel:`Cancel`,discard:`Discard`,delete:`Delete`,confirm:`Confirm`,copy:`Copy`,copied:`Copied`,copyFailed:`Couldn't copy — select the text and copy it manually`,show:`Show`,hide:`Hide`,apply:`Apply`,applied:`Applied`,applying:`Applying…`,active:`Active`,inactive:`Inactive`,never:`never`,loading:`Loading…`,error:`Error`,noData:`No data yet`,unsavedChanges:`Unsaved changes`,saveChanges:`Save changes`,remove:`Remove`,unknownError:`Unknown error`,model:`Model`,provider:`Provider`,success:`Success`,failures:`Failures`,dismiss:`Dismiss`,status:`Status`},settings:{title:`Settings`,language:`Language`,theme:`Theme`,themeSystem:`System`,themeLight:`Light`,themeDark:`Dark`,searchLanguage:`Search languages…`,noLanguages:`No languages found`,sections:`Settings sections`,sectionGeneral:`General`,sectionCompression:`Compression`,sectionAdvanced:`Advanced`,sectionPreview:`Preview`,generalDescription:`Language and appearance of this dashboard.`,advancedDescription:`Thresholds and safety switches for the compression pipeline.`,compressionTitle:`Prompt compression`,compressionDescription:`Reduce request size before routing while preserving code, errors, paths, numbers, and tool definitions.`,compressionHelp:`Rewrites each request before it is sent to a provider so it uses fewer tokens. Code, errors, file paths and numbers are protected, and any rewrite that damages them is discarded.`,compressionMode:`Mode`,compressionModeHelp:`Off sends requests untouched. Lossless only removes duplicated and wasted text. Standard also shortens tool output. Aggressive additionally condenses older turns.`,compressionOff:`Off`,compressionLossless:`Lossless`,compressionStandard:`Standard`,compressionAggressive:`Aggressive`,syncSchedule:`Model Sync`,syncScheduleHint:`How often the model catalog is refreshed from the server`,syncIntervalOff:`Off`,syncInterval6h:`Every 6h`,syncInterval12h:`Every 12h`,syncInterval24h:`Every 24h`,compressionLossy:`Lossy`,compressionEngines:`Engines`,compressionEnginesHelp:`Each engine is one rewriting step. The mode decides which engines run; switching one off here keeps it out of every mode.`,engineDedup:`Repeated blocks`,engineDedupHelp:`Replaces a block of text that already appeared earlier in the conversation with a short reference to it.`,engineLite:`Whitespace cleanup`,engineLiteHelp:`Trims trailing spaces, collapses repeated blank lines and drops duplicated system messages.`,engineReadLifecycle:`Superseded file reads`,engineReadLifecycleHelp:`Replaces an earlier file read with a note once the same file is read or edited again later.`,engineToolfilter:`Tool output filter`,engineToolfilterHelp:`Shortens command and tool output such as builds, tests and installs. Error and stack-trace lines always survive.`,engineJsoncompact:`JSON tables`,engineJsoncompactHelp:`Re-encodes long JSON arrays that share the same fields as a compact table. Reversible, so nothing is lost.`,engineRelevance:`Relevance filter`,engineRelevanceHelp:`Drops the sentences least related to the latest message once a message exceeds its size budget.`,engineAging:`Older turns`,engineAgingHelp:`Condenses turns beyond the most recent few into a short summary that keeps paths, errors and decisions.`,engineHardBudget:`Token ceiling`,engineHardBudgetHelp:`Removes the least valuable lines until the request fits the token target.`,compressionAutoTrigger:`Auto-trigger above estimated tokens`,compressionAutoTriggerHelp:`Requests estimated above this many tokens switch to Aggressive automatically. Leave empty to disable.`,compressionPrefixFreeze:`Freeze recurring prompt prefixes`,compressionPrefixFreezeHelp:`Leaves a system prompt untouched once the same text has been seen three times, so provider-side prompt caching keeps working.`,compressionTrustProjectFilters:`Trust project filter files`,compressionTrustProjectFiltersHelp:`Also loads tool-output filters from the working directory. Off by default, because a repository could use it to hide output from the model.`,compressionStats:`Size saved`,compressionEstimatedTokensSaved:`Estimated tokens saved`,compressionPreview:`Live preview`,compressionPreviewDescription:`Send a request body through the pipeline to see what a provider would receive.`,compressionPreviewPlaceholder:`Paste request JSON or plain text`,compressionRunPreview:`Run preview`,updatesTitle:`Updates`,checkForUpdates:`Check for updates`,lastChecked:`Last checked: {when}`,currentVersion:`Current build:`,updateAvailable:`Update available`,changelog:`What's changed`,upToDate:`Up to date`,buildAhead:`This build is ahead of official main.`,buildDiverged:`This build has diverged from official main.`,buildUnknown:`This custom build cannot be compared with official main.`,notGitInstall:`This installation does not include commit information.`,checkFailed:`Could not check for updates.`,contactsGithub:`Checks are manual and contact GitHub.`,autoUpdateCheck:`Automatic update check`,autoUpdateCheckHelp:`Checks GitHub once a day for a new release and shows a reminder. Off by default.`,openReleases:`Open GitHub Releases`,restartAfterUpdate:`Restart SRouter after the build completes.`},models:{title:`Models`,chatModelsTab:`Chat models`,fusionTab:`Fusion`,embeddingsTab:`Embeddings`,imageTab:`Image`,videoTab:`Video`,audioTab:`Audio`,imageDesc:`Text-to-image generation models.`,videoDesc:`Text-to-video generation models.`,audioDesc:`Text-to-speech and speech-to-text models.`,mediaHint:`Generate via`,mediaEmpty:`No models yet. They sync from the catalog.`,ttsHeading:`Text to speech`,sttHeading:`Speech to text`,sttHint:`Transcribe via`,sttEmpty:`No speech-to-text models yet. They sync from the catalog.`,newBadge:`New`,monthlyTokenBudget:`Monthly token budget`,remaining:`remaining`,used:`used`,usedScopeHint:`Chat requests only, since the start of this calendar month, summed over every model in the active chain — custom endpoints included. Traffic you send to a provider outside SRouter is not counted.`,legendRemainingTitle:`Remaining / monthly budget for {name} ({platform})`,noPublishedQuota:`+{count} with no published quota`,noPublishedQuotaTitle:`These models have no documented monthly token budget, so there is no remaining figure to show.`,of:`of`,showAllModels:`Show all {count} models`,showLess:`Show less`,vision:`Vision`,visionTitle:`Accepts image input`,tools:`Tools`,toolsTitle:`Emits structured tool calls, so it is eligible for tool-bearing requests`,retired:`Retired`,penalty:`−{value} penalty`,obs:`{count} obs`,tokPerMonth:`{count} tok/mo`,rpmLimit:`{count} rpm`,rpdLimit:`{count} rpd`,noKey:`no key`,dragToReorder:`Drag to reorder`,dragToReorderGroup:`Drag to reorder model`,moveToRank:`Jump to rank`,providerCount:`{count} providers`,servedBy:`Served by {providers}`,viewProviders:`View providers`,backToModels:`Back to models`,providersHeading:`Providers serving this model`,codeSnippetHeading:`Use this model`,modelNotFound:`This model is not available, or it has no configured providers.`,providerIdsHeading:`Provider model ids`,providerIdsHint:`Send the unified model id to fail over across every provider, or a provider-specific id to pin one provider.`,copyModelName:`Copy model name`,settingsHeading:`Provider settings`,settingsHint:`Local edits to catalog models are kept across catalog syncs. Deleted catalog models stay deleted until you add them again through config.`,catalogModel:`catalog`,customModel:`custom`,discoveredModel:`discovered`,localOverride:`local override`,displayName:`Display name`,sizeLabel:`Capability tier`,sizeLabelHint:`Frontier/Large/Medium/Small set the intelligence axis: a higher tier always beats a lower one, and within a tier the intelligence rank still moves the score. A model with no recognized tier scores lowest here, but intelligence is only one of three axes — strong reliability and speed can still win it a route.`,sizeLabelNone:`None (lowest intelligence score)`,contextWindow:`Context`,inFallback:`In chain`,saveModelSettings:`Save model settings`,aggregateBudget:`{count}/mo`,aggregateBudgetTitle:`Total free tokens per month across this model's providers`,rateRpm:`{count} RPM`,rateRpd:`{count} RPD`,rateTitle:`Rate-limited — no fixed monthly token budget`,rateLimitUsage:`{kind} {used}/{limit}`,rateLimitUsageTitle:`Time-window rate-limit usage (used / limit) for the provider with the most headroom`,splitOut:`Don't merge this copy`,splitOutHint:`Give this provider's copy its own separate entry instead of merging it into the unified model. You can merge it back from the copy's own page.`,splitUndo:`Merge back`,splitUndoHint:`This copy is kept separate from its unified model. Merge it back to fail over across all of its providers again.`,splitBadge:`kept separate`,noData:`no data`,noDataTitle:`No requests recorded yet — reliability and speed are unmeasured for this provider.`,bestOfN:`best of {count}`,perProviderScores:`Per-provider scores: {list}`,columnModel:`Model`,columnOn:`On`,noModelsBefore:`No models available. Add API keys on the `,keysPageLink:`Keys page`,noModelsAfter:` first.`,hiddenNoKeys:`Hidden (no keys): {platforms}`,searchPlaceholder:`Search models or providers…`,clearSearch:`Clear search`,ctxAny:`Any context`,ctxBadge:`{size} ctx`,ctxTitle:`Context window`,copyModelId:`Copy model id`,showingCount:`{shown} of {total} models`,clearFilters:`Clear filters`,noMatches:`No models match your filters.`,noModelsTitle:`No models configured`,intelligenceRank:`Intelligence`,speedRank:`Speed`,rankHint:`Rank across the catalog — 1 is best.`,limitRpm:`RPM`,limitRpd:`RPD`,limitTpm:`TPM`,limitTpd:`TPD`,limitRpmHint:`Requests per minute. Leave blank for no limit.`,limitRpdHint:`Requests per day. Leave blank for no limit.`,limitTpmHint:`Tokens per minute. Leave blank for no limit.`,limitTpdHint:`Tokens per day. Leave blank for no limit.`,usageThisMonth:`Monthly usage`,usageEmpty:`No requests yet this month.`,usageRequestsMonth:`{count} req this month`,aliasMergeHeading:`Merge model aliases`,aliasMergeHint:`Requests for the unified model id are also served through these custom-provider aliases (e.g. custom:my-alias).`,aliasMergeAdd:`Add`,aliasMergeRemove:`Remove`,bulkToggle:`Enable or disable every shown model`,enableAll:`Enable all`,disableAll:`Disable all`,enableAllHint:`Turn on every model shown, then Save`,disableAllHint:`Turn off every model shown, then Save`,enabledOfShown:`{enabled} of {shown} shown models are in the chain`},strategies:{explore:`Explore unmeasured models (on by default)`,exploreHint:`On by default: models with no reliability or speed data get a 10% chance to go first so they build a track record. Your real request is what gets sent, so it may be answered by an untested model. For a custom endpoint, use Probe endpoint on the Keys page to test it without live traffic.`,keySelection:`Key selection`,keySelectionAuto:`Auto`,keySelectionLeastRemaining:`Least remaining`,keySelectionHint:`How to choose between several keys on the same provider. Auto keeps the current rotation; Least remaining ranks keys by observed quota and tries the one with the most left first.`,cooldownCeiling:`Longest automatic cooldown`,cooldownCeilingHint:`Caps how long the router's own guesses may bench a failing key and model pair. The ladder normally climbs 2 min, 10 min, 1 h, 24 h, and out-of-credit or tier errors bench for a day. Retry times stated by the provider are never shortened.`,cooldownCeilingDefault:`Default (up to 24 h)`,cooldownCeiling10m:`10 minutes`,cooldownCeiling1h:`1 hour`,cooldownCeiling6h:`6 hours`,moreOptions:`More options`,peakActive:`(peak hours)`,peakActiveHint:`The peak-hours adjustment is active right now, so these are not the preset's own weights: 60% of the speed weight has moved onto reliability.`,peakAdjust:`Peak-hours adjustment`,peakAdjustHint:`Off by default. Inside the window below, move 60% of the speed weight onto reliability — free relays are busiest then, so reliability predicts success better than raw throughput. Fastest and Most reliable are left alone.`,peakFrom:`From`,peakTo:`to`,peakTimezoneLabel:`Timezone`,peakUseBrowserTimezone:`Use browser timezone`,peakTimezoneInvalid:`Unknown timezone.`,peakExemptNote:`This preset is left alone — it already sits at one end of the speed/reliability trade-off.`,title:`Routing strategy`,description:`Pick a routing strategy. In Manual mode you drag to set the order; the other strategies route by live score across reliability, speed and intelligence.`,weightsSummary:`reliability {reliability}% · speed {speed}% · intelligence {intelligence}%`,guardrails:`Guardrails`,guardrailsTooltip:`Always-on guardrails: free-quota headroom × live rate-limit penalty. Below 1.0 means the model is being held back.`,scoreTooltip:`Final routing score = weighted average of the three axes, multiplied by the guardrails. Higher routes first.`,modeManualHint:`Manual mode: requests follow the order below, top-to-bottom. Drag to reorder.`,modeScoreHint:`Scores update from live traffic. The order below is how requests are routed right now.`,manual:`Manual`,manualBlurb:`Route in the exact order you set below. Drag the handles to reorder. No scoring; the chain is followed top-to-bottom.`,balanced:`Balanced`,balancedBlurb:`Reliability leads (50%), with speed and intelligence weighted equally (25% each). A sensible all-round default.`,smartest:`Smartest`,smartestBlurb:`Prefer the most capable model that still works. Intelligence 55%, reliability 35%, speed 10%.`,fastest:`Fastest`,fastestBlurb:`Prefer the fastest model that still works. Speed 55%, reliability 35%, intelligence 10%.`,reliable:`Most reliable`,reliableBlurb:`Maximize success rate above all. Reliability 70%, speed and intelligence 15% each.`,custom:`Custom`,customBlurb:`Set your own balance of reliability, speed and intelligence with sliders. Same engine as the presets, just your weights.`,adjust:`Adjust`,customWeights:`Custom weights`,customWeightsHelp:`Sliders are independent; shares auto-balance to 100%.`,weightReliability:`Reliability`,weightSpeed:`Speed`,weightIntelligence:`Intelligence`,weightRequired:`At least one weight must be above zero.`,scoreColumn:`Score`},penaltyInspector:{title:`Router pressure`,subtitle:`Penalties, cooldowns, and failures from the last {minutes} min`,rowCount:`{count} active`,offChain:`off chain`,penaltyValue:`Penalty {value}`,factor:`score x{factor}`,noCooldown:`No cooldown`,cooldownChip:`{key} - {time}`,resetCooldown:`Reset cooldown`,clearAll:`Clear all`,clearAllHint:`Lift every cooldown, penalty and failure streak now. Pressure rebuilds from the next live results.`,errorsHeading:`{count} recent errors`,noRecentErrors:`No recent errors`,noKey:`no key`,reasons:{penalty:`penalized`,cooldown:`cooldown`,recent_errors:`failing`}},keys:JSON.parse(`{"pageTitle":"Keys","pageDescription":"Provider credentials and the unified API key your apps connect with.","tabProviders":"Providers","checklistSummary":"{configured} of {total} providers configured","checklistKeyless":"no key needed","checklistNoKeyTip":"No key added yet. Click to add one.","checklistSignupLink":"Open {provider} to create an account and get a key","checklistKeylessTip":"Works without a key.","tabQuotaSignals":"Quota signals","tabApiKey":"Unified API key","tabAnthropic":"Anthropic","tabAgents":"Agents","unifiedKey":"Your unified API key","regenerate":"Regenerate","showKey":"Show","hideKey":"Hide","copyKey":"Copy","copyFullKey":"Copy full key","copiedKey":"Copied","baseUrl":"Base URL","endpointChat":"Chat","endpointResponses":"Responses","endpointEmbeddings":"Embeddings","endpointEmbeddingsHint":"model: \\"auto\\" or a family from the Embeddings tab","endpointMessages":"Messages","endpointMessagesHint":"Anthropic-compatible (Claude)","quickStart":"Quick start","quickStartDesc":"Use auto for your active routing chain, or auto:fast to prioritize speed across enabled models. Replace $YOUR_KEY with your unified API key.","exampleAuto":"Auto mode (use the active chain)","exampleFast":"Fast mode (prioritize speed)","anthropicTitle":"Claude (Anthropic) models","anthropicDesc":"Point a Claude or Anthropic SDK client at this server. Anthropic clients send Claude model names — map each to Auto (the router picks a free model) or pin a specific one.","anthropicBaseUrl":"Base URL","anthropicAuth":"Auth header","anthropicAuto":"Auto — router picks the best model","anthropicSave":"Save mapping","anthropicSaved":"Saved","anthropicNote":"Anthropic clients keep their built-in Claude model names; the mapping above decides how each one routes into your pool.","familyDefault":"Default","familyOpus":"Opus","familySonnet":"Sonnet","familyHaiku":"Haiku","familyGeminiPro":"Gemini Pro","familyGeminiFlash":"Gemini Flash","familyGeminiFlashLite":"Gemini Flash-Lite","geminiTitle":"Gemini model mapping","geminiDesc":"Map Gemini Pro, Flash, and Flash-Lite names to Auto or a specific catalog model.","compatibilityTitle":"Agent compatibility","compatibilityDesc":"Control opt-in compatibility surfaces and Claude Code model discovery.","ollamaMode":"Ollama emulation","ollamaModeHint":"Open-loopback never accepts unauthenticated LAN traffic.","ollamaOff":"Off","ollamaLoopback":"Open on loopback","ollamaKeyRequired":"API key required","claudeAliases":"Claude Code discovery aliases","claudeAliasesHint":"Expose claude/<model> aliases so the gateway model picker can list the catalog.","mcpServer":"MCP server","mcpServerHint":"Expose the /mcp endpoint for agent clients. New installs start with it off.","urlTokensTitle":"Revocable URL tokens","urlTokensDesc":"For headerless clients only. URL tokens can leak into history and logs, so revoke them when no longer needed.","urlTokenLabel":"Token label","createUrlToken":"Create token","urlTokenOnce":"Copy this token now. It will not be shown again.","revoked":"Revoked","revoke":"Revoke","selectPlatform":"Select a provider","addKey":"Add key","keyAdded":"Key added","endpointKeysShareModels":"Keys for the same endpoint share its models.","export":"Export","exportAll":"All keys","exportHealthy":"Healthy only","exportKeys":"Export API keys","exportFormat":"Format","exportHealthyOnly":"Healthy keys only","exportHealthyOnlyDesc":"Exclude keys that are currently failing health checks","exportWillExport":"Will export","exportKey":"key","exportKeys plural":"keys","exporting":"Exporting…","exportDownload":"Download","exportSuccess":"Exported {count} keys","adding":"Adding…","selectProvider":"Select a provider…","accountId":"Account ID","label":"Label","noKeyNeeded":"(no key needed)","outboundProxy":"Outbound proxy","outboundProxyDescription":"Route outbound LLM requests through a proxy. Supports SOCKS5, HTTP, and HTTPS.","proxyUrl":"Proxy URL","saveProxy":"Save","savingProxy":"Saving…","testProxy":"Test","testingProxy":"Testing…","proxyTestOk":"Proxy works — {ms}ms round trip","proxyTestFail":"Proxy failed: {reason}","proxyLoadFailed":"Could not load proxy settings.","proxyMode":"Mode","proxyModeForward":"Forward proxy","proxyModeFetchRelay":"Fetch relay","relayToken":"Relay token","relayTokenConfigured":"Configured. Leave unchanged to keep.","relayTokenPlaceholder":"Relay bearer token (optional)","relayHeadersHint":"The relay reads the destination and its own credential from","addCustom":"Add a custom OpenAI-compatible model","addCustomDescription":"Point chat, embedding, image, or audio models at any OpenAI-compatible endpoint. The API key is optional for local servers.","customType":"Type","customTypeChat":"Chat","customTypeEmbedding":"Embedding","customTypeImage":"Image","customTypeAudio":"Audio","customTypeTranscription":"Transcription","customBaseUrl":"Base URL","customModels":"Models","customModel":"Model","customDisplayName":"Display name","customDisplayNamePerModel":"per-model","customDisplayNameOptional":"optional","customFamily":"Family","customFamilyPlaceholder":"defaults to model id","customApiKey":"API key","customCapabilities":"Capabilities","addModel":"Add model","modelAdded":"Model added","addModels":"Add {count} models","addEmbeddingModel":"Add embedding","addImageModel":"Add image model","addAudioModel":"Add audio model","addTranscriptionModel":"Add transcription model","addingCustom":"Adding…","discoverModels":"Fetch models","probeNow":"Probe endpoint","probeConfirm":"Send up to 3 test requests?","probeCapabilities":"reasoning: {reasoning} · tools: {tools}","probeCapYes":"yes","probeCapNo":"no","probeCapUnknown":"unknown","probeSuccess":"Probed {model} in {latency}ms","probeFailed":"Probe failed: {reason}","discoverTitle":"Models on this endpoint","discoverHint":"Pick the models to register. Ones you already added stay locked.","discoverEmpty":"This endpoint returned no models.","discoverAlreadyAdded":"Added","discoverSelectAll":"Select all","modelsAdded":"{count} models added","getApiKey":"Get API key","deleteKeyConfirm":"Delete this key? This cannot be undone.","checkAll":"Check all","checking":"Checking…","editKey":"Edit key","editPlatformLocked":"The provider and endpoint cannot change after creation.","editCredentialHint":"Leave blank to keep the current key.","editCredentialPartsRequired":"Enter both the account ID and API token.","editModels":"Edit models","editModelsHint":"Choose which catalog models this key may serve. Select everything to clear the scope so future catalog models use it too.","editModelsCustomHint":"Choose which registered endpoint models this key may serve. Select everything to clear the scope.","editModelsSync":"Check catalog updates","editModelsSyncing":"Checking…","editModelsSynced":"Model catalog checked","editLabel":"Edit label","saveLabel":"Save label","unifiedKeyDescBefore":"Use this as your OpenAI ","unifiedKeyDescAfter":"; it authenticates requests to this proxy.","serverUnreachableBefore":"Can't reach the server on ","serverUnreachableAfter":". Make sure the backend is running. npm run dev starts both, and the server logs print under the server prefix.","paneProviderKey":"Provider key","paneImportFile":"Import file","paneCustomEndpoint":"Custom endpoint","platform":"Platform","hideAdded":"Hide added providers","apiToken":"API token","keyOptionalPlaceholder":"Optional","bearerTokenPlaceholder":"Bearer token","pasteKeyPlaceholder":"paste key here","pasteSeveral":"Paste several","keyOptionalHint":"Optional: leave blank for the anonymous free tier (rate-limited per IP), or paste your own key to use your account.","enable":"Enable","noProviderKeys":"No provider keys yet. Add one above to start routing.","filterPlaceholder":"Filter providers or keys","filterAll":"All","filterHealthy":"Healthy","filterIssues":"Issues","filterDisabled":"Disabled","noFilterMatch":"No providers match your filters.","providerCountSummary":"{providers} providers · {keys} keys","summaryHealthy":"{count} healthy","summaryIssueOne":"{count} issue","summaryIssueOther":"{count} issues","providerActions":"Provider actions","routeViaProxy":"Route via proxy","checkNow":"Check now","syncModels":"Sync models with upstream","syncModelsResult":"Model list synced: {added} added, {total} live","syncModelsFailed":"Model sync failed: {reason}","syncAllModels":"Sync all providers","syncAllPending":"Syncing…","syncAllResult":"Synced {count} provider(s): {registered} model(s) registered","syncAllFailed":"Sync all failed: {reason}","syncAllNoChanges":"All provider rosters are already up to date","syncAllCatalog":"Catalog: +{inserted} added, ~{updated} updated, -{removed} removed","syncAllDialogTitle":"Sync Results","syncAllDialogSummary":"Changes detected in {changed} of {total} providers","syncAllNew":"+{count} new","syncAllUpdated":"{count} updated","syncAllRetired":"{count} retired","syncAllNewModels":"New models","syncAllUpdatedModels":"Updated models","syncAllRetiredModels":"Retired models","syncAllDialogClose":"Done","proxyEnvHintBefore":"Also configurable via the ","proxyEnvHintAfter":" environment variable (takes precedence). Leave blank to disable. Examples:","importKeys":"Import provider keys","importKeysDescription":"Upload .env, JSON, JSONC, CSV, Markdown, or text files.","importFiles":"Files","importFileCount":"{count} selected","previewFiles":"Preview","previewing":"Previewing…","selected":"Selected","provider":"Provider","keyName":"Key name","keyValue":"Key value","chooseProvider":"Choose provider","noPreviewKeys":"No keys found in those files.","skippedItems":"Skipped:","moreItems":"+{count} more","importSelected":"Import {count}","importing":"Importing…","noImportSelection":"Select at least one row with a provider.","duplicate":"Duplicate","duplicatesFound":"{count} duplicate(s) detected — already exist and will be skipped.","importResult":"Imported {imported}; failed {failed}.","importModelCount":"+{count} models","importResultWithModels":"Imported {imported}; registered {models} models; failed {failed}.","confirmRemove":"Confirm?","quotaSignalsTitle":"Quota signals","quotaSignalsEmptyTitle":"No quota observations yet","quotaSignalsEmptyDesc":"This fills in after providers return rate-limit headers, quota errors, or validation signals.","quotaKeyRef":"key #{id}","quotaPoolRef":"pool {pool}","quotaLimit":"Limit","quotaRemaining":"Remaining","quotaReset":"Reset","quotaObserved":"Observed","modelScope":"Model scope","modelScopeDesc":"Limit this key to specific model IDs. The router skips this key for any other model.","modelScopeAdd":"Add a model ID and press Enter","modelScopeEmpty":"No scope set — this key serves every model of its provider.","modelScopeClear":"Clear scope","modelScopeBadgeOne":"scoped · 1 model","modelScopeBadgeOther":"scoped · {count} models","modelPicker":{"title":"Which models should this key serve?","hint":"Your {provider} key was added and currently serves every model below. Untick any this key isn't allowed to use — the router will skip it for those.","count":"{selected} of {total} selected","allNote":"Everything selected — nothing is saved, and models added to the catalog later will use this key too.","subsetNote":"This key will be limited to the selected models. You can change this later from the key's row.","skip":"Not now","allSaved":"Key serves every catalog model","scopedOne":"Key limited to 1 model","scopedOther":"Key limited to {count} models"},"cpTitle":"Client profiles","cpDesc":"Per-client API keys, each with a system prompt the server always applies.","cpEmpty":"No client profiles yet.","cpNameLabel":"Name","cpNamePlaceholder":"e.g. Support bot","cpPromptLabel":"System prompt (optional)","cpPromptPlaceholder":"Instructions the server prepends to every request made with this key.","cpCreate":"Create profile","cpRotate":"Rotate key","cpKeyOnce":"Copy this key now — it won't be shown again.","cpEnabledAria":"Profile enabled","selectKey":"Select this key","bulkSelected":"{count} selected","bulkEnable":"Enable all","bulkDisable":"Disable all","bulkDelete":"Delete all","bulkDeleteConfirm":"Delete {count}?","bulkResult":"Updated {done}; failed {failed}.","bulkDeleteResult":"Deleted {done}; failed {failed}.","outlookUnavailable":"Unavailable","outlookNoForecasts":"Forecast unavailable. More recent traffic or reliable quota readings are needed.","outlookCoverage":"Forecasts available for {count} of {total} pools.","outlookTraffic":"{count} successful requests through this instance in the last {minutes} minutes.","outlookMinimumTraffic":"An exhaustion forecast needs at least {count} successful requests within {minutes} minutes.","outlookNotReportedHint":"The provider has not reported a usable request balance and limit. Local usage is shown; remaining quota is unavailable.","outlookMissingResetHint":"The provider did not report a valid reset time. Remaining quota cannot support an exhaustion forecast.","outlookConfidenceHint":"This balance is not reliable enough for an exhaustion forecast.","outlookObserved":"Balance observed: {time}","outlookUnavailablePools":"Unavailable quota pools ({count})","outlookTitle":"Quota outlook","outlookInsufficient":"Not enough data","outlookLowBalance":"Low balance","outlookRunningLow":"Running low soon","outlookStale":"Needs fresh data","outlookUnknown":"Unknown","outlookWithinQuota":"Within quota","outlookResetsFirst":"Not before reset","outlookExhausted":"Already exhausted","outlookLastReported":"requests last reported","outlookRequestsLeft":"requests left","outlookNotReported":"Not reported","outlookRate":"Recent rate","outlookRateValue":"{count} req/min","outlookRunsOut":"May run out","outlookStaleHint":"This balance is old or its window has expired. A fresh provider reading is needed.","outlookError":"Could not load quota forecasts. Raw observations are still available below.","outlookRetry":"Retry","outlookAttention":"Quota pools needing attention: {count}","outlookNoWarnings":"No forecast warnings. Pools with insufficient data may still be limited.","outlookHint":"Rates count successful requests through this instance only, not usage elsewhere. Forecasts require recent provider balances and reported resets. Warnings appear below 20% remaining or when quota may run out within two hours, before reset.","outlookRaw":"Raw quota observations","addCustomModel":"Add Custom Model","modelId":"Model ID","modelIdRequired":"Model ID is required","modelDisplayName":"Display Name","modelContextWindow":"Context Window (tokens)","modelRateLimits":"Rate Limits (optional)","modelSupportsTools":"Supports Tool Calling","modelSupportsToolsHint":"Enable if this model can execute function/tool calling","modelSupportsVision":"Supports Vision","modelSupportsVisionHint":"Enable if this model accepts image inputs","createModel":"Create Model","modelAddedSuccess":"Custom model added successfully","modelAddFailed":"Failed to add custom model","testModel":"Test","testingModel":"Testing…","testPassedShort":"Pass","testFailedShort":"Failed","testPassed":"Model test passed in {latency}ms","testFailed":"Model test failed","testThrottled":"Please wait {seconds}s before testing this model again.","noModelsForProvider":"No models configured for this provider.","testModels":"Test models","requestCapLabel":"Request cap","tokenCapLabel":"Token cap","budgetPeriodLabel":"Budget period","budgetPeriodDaily":"Daily","budgetPeriodWeekly":"Weekly","budgetPeriodMonthly":"Monthly","budgetPeriodAuto":"Auto (follow provider)","autoResolvedDaily":"Detected provider cycle: daily","autoResolvedMonthly":"Detected provider cycle: monthly","autoResolvedFallback":"Provider cycle unknown, defaulting to monthly","capUnlimitedPlaceholder":"Unlimited","capEditHint":"Caps reset at the next period boundary, 00:00 UTC. Leave blank for unlimited.","monthlyUsageLine":"{requests} requests, {tokens} tokens this month","monthlyUsageRequests":"{requests} requests","monthlyUsageTokens":"{tokens} tokens","monthlyUsageRequestsRelative":"{used} / {cap} ({remaining} left) requests","monthlyUsageTokensRelative":"{used} / {cap} ({remaining} left) tokens","monthlyUsageReset":"reset {date}"}`),backups:{title:`Backups`,description:`Save the routing data to a .sql file beside the database, and restore it later.`,excludedNote:`A backup carries your providers, models, routing settings and request history. Accounts, sessions and URL tokens are never included, so a dump holds no password hashes or login tokens and restoring one cannot log you out. Provider keys stay encrypted with this server's ENCRYPTION_KEY: a backup can only be restored on a server that still holds that key.`,selectHint:`Back up everything, or pick the tables you need.`,selectAll:`Select all`,deselectAll:`Clear`,fullBackup:`Full backup`,backupSelected:`Back up selected ({count})`,created:`Backup written to {filename}`,list:`Backups on disk`,empty:`No backups yet`,full:`All tables`,tablesCount:`{count} tables`,manual:`Manual`,scheduled:`Scheduled`,preRestore:`Pre-restore`,download:`Download`,restore:`Restore`,confirmRestore:`Replace data?`,restored:`Restored. The previous data was saved as {filename}.`,delete:`Delete backup`,prevPage:`Previous`,nextPage:`Next`,autoTitle:`Automatic backups`,autoHint:`The server writes a full backup on this cadence.`,time:`Time (HH:mm)`,intervalDays:`Every N days`,path:`Folder`,pathPlaceholder:`backups`,pathHint:`Relative to the database directory. Backups cannot be written outside it.`,save:`Save schedule`,saved:`Saved`},status:{healthy:`healthy`,rateLimited:`rate-limited`,invalid:`invalid`,error:`error`,unchecked:`unchecked`},agents:{title:`Coding agents`,description:`Connect coding tools to one free-model gateway with generated, backup-safe configuration.`,apiKey:`API key`,quickstartTitle:`Quick start`,quickstart:`Fastest path: configure Claude Code from the live catalog.`,currentKey:`Current unified key:`,seenRecently:`Seen recently`,setupLabel:`Automatic setup`,setupHint:`Writes this tool's config file for you, pointed at this gateway.`,setupGuideHint:`Prints this tool's setup steps; no files are written.`,manualLabel:`Manual connection`,manualHint:`Base URL and key to enter in the tool's own settings.`,endpoint:`Endpoint`,documentation:`Documentation`,descriptions:{claude:`Anthropic's terminal agent: it plans, edits files, and runs commands in your repo.`,codex:`OpenAI's terminal agent, which runs your task in a local sandbox first.`,cline:`A VS Code extension that asks you to approve every edit and command.`,continue:`A VS Code and JetBrains extension for inline autocomplete and chat while you type.`,aider:`A command-line pair programmer that turns each change into its own git commit.`,opencode:`A provider-agnostic terminal agent with a full-screen text interface.`,goose:`Block's local agent, extended with MCP servers to reach past your code.`,qwen:`A Gemini CLI fork tuned for Qwen models and large repositories.`,roo:`A VS Code extension with switchable modes: architect, coder, debugger.`,kilo:`A VS Code extension merging Roo and Cline, with an orchestrator that splits up work.`,crush:`Charm's terminal agent, written in Go, with one session per project.`,dsh:`DeepSeek's harness, which keeps every provider as a route you can switch between.`,mimo:`Xiaomi's terminal agent, an OpenCode fork that takes any OpenAI-compatible provider.`,cursor:`The AI-first editor; it calls through Cursor's cloud, so it needs a public URL.`,generic:`Anything else that speaks the OpenAI API, set up by hand from a base URL and key.`,atomcode:`AtomGit's terminal agent, written in Rust, that takes any OpenAI-compatible endpoint.`,openclaw:`An always-on personal assistant that answers on WhatsApp, Telegram, Discord and more from your own machine.`,hermes:`Nous Research's self-improving agent with persistent memory and skills, in the terminal or on chat apps.`,pi:`A minimal terminal harness you shape with your own extensions, skills and prompt templates.`}},analytics:{title:`Analytics`,description:`Request volume, latency, token usage, and failures.`,range24h:`24h`,range7d:`7d`,range30d:`30d`,range90d:`90d`,requests:`Requests`,successRate:`Success rate`,inputTokens:`Input tokens`,outputTokens:`Output tokens`,avgLatency:`Avg latency`,p95Latency:`P95 latency`,avgTtft:`Avg TTFT`,estSavings:`Est. savings`,requestsByProvider:`Requests by provider`,requestsByAgent:`Requests by agent`,avgLatencyByProvider:`Avg latency by provider`,ttftByProvider:`Time to first token by provider`,ttftEmpty:`No time to first token recorded yet.`,requestsOverTime:`Requests over time`,tokensOverTime:`Tokens over time`,byModel:`By model`,byPlatform:`By platform`,errors:`Errors`,errorDistribution:`Error distribution`,pinnedRequests:`Pinned requests`,pinnedHonored:`Honored`,fallbackAttempts:`Fallback attempts`,savingsHint:"You actually saved ${actual} over the last {range}. That is what the same tokens would have cost on paid APIs, priced per model. The number shown projects your pace from the last {span} of data to a full 30 days.",savingsHintExact:"You actually saved ${actual} over the last {range}. That is what the same tokens would have cost on paid APIs, priced per model. The number shown is your real 30-day total.",requestsHintPinned:`{pinned} of these requests pinned a specific model by name. {honored} were served by the pinned model; {failed} failed over to a different one. The rest were auto-routed.`,requestsHintAuto:`All requests in this period were auto-routed; no client pinned a specific model by name.`,requestsHintTypes:`{chat} chat and {embedding} embedding requests.`,rangeLabel24h:`24 hours`,rangeLabel7d:`7 days`,rangeLabel30d:`30 days`,rangeLabel90d:`90 days`,spanDays:`{count} days`,spanHours:`{count} hours`,latencyMs:`Latency (ms)`,latency:`Latency`,pinned:`Pinned`,inTokens:`In tokens`,outTokens:`Out tokens`,saved:`Saved`,message:`Message`,time:`Time`,perModelBreakdown:`Per-model breakdown`,usageByKey:`Usage by key`,keyColumn:`Key`,keyLabelFallback:`Key #{id}`,errorsByProvider:`Errors by provider`,recentErrors:`Recent errors`,noErrors:`No errors`,recentCalls:`Recent calls`,clientIp:`Client IP`,clientAgent:`Client app`,requestedModelHint:`Requested {model}, served by fallback`,attempts:`Attempts`,filterAll:`All`,filterCanceled:`Canceled`,providerBreakdown:`Per-provider breakdown`,tokensPerSec:`Tok/s`,allProviders:`All providers`,requestDetailTitle:`Request #{id}`,failoverLadder:`Failover ladder`,failoverLadderHint:`Each hop this request took through the fallback chain, in order.`,noAttemptTrace:`No attempt trace was recorded for this request.`,keyOrdinal:`key #{n}`,keyBadge:`Key #{n}`,attemptTimingHint:`Start offset from request start · attempt duration`,requestedModel:`Requested model`,ttft:`TTFT`,sortBy:`Sort by {column}`,sortHint:`Sorting applies to the {count} loaded rows`,cacheHitRate:`Cache hit rate`,cacheSavedTokens:`{tokens} tokens saved`,cacheHitRateHint:`{hits} hits vs {misses} misses since the server started · {requests} provider calls avoided`},logs:{title:`Logs`,description:`Live server log. New entries stream in while the page is open.`,pause:`Pause`,resume:`Resume`,clear:`Clear logs`,cleared:`Server log cleared`,levelFilter:`Log levels`,levels:{debug:`Debug`,info:`Info`,warn:`Warn`,error:`Error`},countsHint:`Counts are totals for the whole log buffer on the server, not just the entries matching these filters.`,searchPlaceholder:`Search log messages…`,jumpToLatest:`Jump to latest`,showMore:`Show more`,showLess:`Show less`,buffered:`Showing {count} of up to {max} buffered entries`,emptyTitle:`No log entries yet`,emptyDescription:`Entries appear here as the server writes them. Widen the level, provider or search filters if you expected output.`,noLevelsTitle:`No levels selected`,noLevelsDescription:`Turn on at least one level to see log output.`,loadFailed:`Couldn't load the server log.`},playground:{title:`Playground`,description:`Send a chat completion through the router and see which provider serves it.`,autoModel:`Auto (fallback chain)`,fusionModel:`Fusion (multi-model synthesis)`,selectModel:`Select model`,searchModels:`Search models…`,noModelsFound:`No models found`,send:`Send`,sending:`Sending…`,clear:`Clear`,inputPlaceholder:`Type a message… (⏎ to send, ⇧⏎ for newline)`,emptyTitle:`Send a message to get started.`,emptyDescription:`Using {model}. Switch models in the selector above.`,noModels:`No models yet. Add an API key on the Keys page to populate this list.`,copyReply:`Copy reply`,fallback:`fallback`,fallbacks:`fallbacks`,fusionPanel:`Panel`,fusionJudge:`Judge`,fusionTrace:`{count} model responses`,fusionFailed:`no response`,fusionJudgeSynth:`synthesized the final answer`,errorPrefix:`Error:`,systemPromptLabel:`System prompt`,systemPromptPlaceholder:`Optional. Sent as a system message before your chat.`,showSettings:`Show settings`,hideSettings:`Hide settings`,samplingHeading:`Sampling`,samplingHelp:`Switched off, the provider's own default applies. Only the controls you switch on are sent.`,samplingDefault:`Default`,temperature:`Temperature`,topP:`Top P`,maxTokens:`Max tokens`,errorTitle:`Request failed`,attach:`Attach files`,attachTooMany:`You can attach up to {count} files per message.`,attachTooLarge:`{name} is too large. The limit is {max}.`,attachUnsupported:`{name} is not supported. Attach images (PNG, JPEG, WebP, GIF) or text files (TXT, MD, CSV, JSON, LOG).`,attachFailed:`Could not read {name}.`,noVisionBadge:`No images`,visionWarning:`{model} does not accept images. Choose a vision model or Auto.`,dictate:`Dictate`,dictationStop:`Stop recording`,dictationTranscribing:`Transcribing…`,dictationUnavailable:`Add providers for audio models to be able to use dictation.`,dictationModel:`Dictation model`,dictationFailed:`Transcription failed: {reason}`,artifactOpen:`Open preview`,artifactPreview:`Preview`,artifactCode:`Code`,artifactClose:`Close preview`,artifactDownload:`Download`,artifactReload:`Reload preview`,artifactHtml:`HTML page`,artifactSvg:`SVG image`,artifactLines:`lines`,artifactResize:`Resize preview`},playgroundSessions:{heading:`Conversations`,newConversation:`New conversation`,showSidebar:`Show conversations`,hideSidebar:`Hide conversations`,empty:`No saved conversations yet.`,untitled:`Untitled conversation`,rename:`Rename`,renamePlaceholder:`Conversation name`,messageCount:`{count} messages`,justNow:`just now`,minutesAgo:`{count}m ago`,hoursAgo:`{count}h ago`,daysAgo:`{count}d ago`,loadFailed:`Couldn't open that conversation.`,renameFailed:`Couldn't rename that conversation.`,deleteFailed:`Couldn't delete that conversation.`,actions:`Conversation actions`,newChat:`New chat`},embeddings:{title:`Models`,description:`Embeddings fail over within a family only: the same model served by another provider. Vectors from different models are incompatible, so the router never swaps models on you.`,defaultBadge:`Default · auto`,makeDefault:`Make default`,moveUp:`Move up`,moveDown:`Move down`,usageToday:`{count} req today`,usageMonth:`{count} tok this month`,autoDescription:`model: "auto" on POST /v1/embeddings routes to the default family. Naming a family (or a provider model id) pins that family; providers inside it are tried in order.`,unsavedChanges:`Unsaved changes`,saveChanges:`Save changes`,savingChanges:`Saving…`,tokMax:`{tokens} tok max`,emptyTitle:`No embedding models yet`,emptyDesc:`Embedding families appear here once you add a provider key that supports embeddings.`,dragToReorder:`Drag to reorder provider`},fusion:{title:`Fusion`,description:`A panel of models answers in parallel, then a judge synthesizes one stronger answer. Use it by calling the API with model "fusion".`,panelSource:`Panel source`,panelSourceHelp:`Where the panel models come from when a request doesn't specify its own.`,mode:{auto:`Auto (Fallback Chain)`,autoHelp:`Pick a diverse set of models from your Fallback Chain, ranked by your active routing strategy.`,explicit:`Explicit panel`,explicitHelp:`Always use the specific models you choose below.`},panelModels:`Panel models`,selectedCount:`{count} of {max} selected`,noModels:`No models are connected yet. Add an API key, then enable models in the Fallback Chain.`,panelSize:`Panel size`,panelSizeHelp:`How many diverse models to pick automatically (1–{max}).`,judge:`Judge model`,judgeHelp:`The model that synthesizes the panel's answers into one. Auto uses your top-ranked available model.`,judgeAuto:`Auto (top-ranked available)`,strategy:`Strategy`,strategySynthesize:`Synthesize — blend the panel into one answer`,strategyBestOf:`Best of — return the single strongest answer (no judge call)`,strategySynthesizeShort:`Synthesize`,strategyBestOfShort:`Best of`,exposePanel:`Expose panel details`,exposePanelHelp:`Attach each model's answer and the judge metadata under an x_fusion field in the response.`,howToUse:`How to use`,howToUseHelp:`Send a normal chat request with model "fusion". These settings are the default; any request can override them with a "fusion" field.`,unsavedChanges:`Unsaved changes`,save:`Save`,searchPlaceholder:`Search models…`,providerFilterLabel:`Filter by provider`,providerAll:`All providers`,noMatch:`No models match your search.`},premium:{title:`Premium`,description:`The live model catalog, on every device.`,loading:`Loading…`,checkForUpdates:`Check for updates`,syncing:`Syncing…`,catalogFeed:`Catalog feed`,liveFeed:`Live feed`,monthlySnapshot:`Monthly snapshot`,lastChecked:`Last checked: {when}`,liveDescription:`New free models, quota changes, and quirk fixes land here within hours of being shipped. The app checks automatically twice a day; nothing to do.`,snapshotDescription:`Free tier: the catalog refreshes from a monthly snapshot, checked automatically twice a day. Premium switches this to the live feed, updated every 2-3 days.`,lastSyncProblem:`Last sync problem: {error}`,license:`License`,planAnnual:`Premium Annual`,planLifetime:`Premium Lifetime`,expired:`Expired`,inactive:`Inactive`,lifetimeNote:`Lifetime license: never expires.`,renewsOn:`Renews on {date}.`,willNotRenew:`Will not renew. Premium until {date}, then this install falls back to the free monthly catalog.`,keyInactive:`This key is no longer active. The app keeps working on the free monthly catalog.`,manageSubscription:`Manage subscription`,openingPortal:`Opening…`,removeKey:`Remove key from this device`,manageHint:`Manage subscription opens Stripe's billing portal: cancel, update your card, or download invoices. Removing the key only deactivates this device; your purchase is untouched.`,licenseKey:`License key`,licenseKeyPlaceholder:`fla_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`,activate:`Activate`,activating:`Activating…`,keyHint:`Your key is in your purchase email and on the post-checkout page. Lost it?`,recoverKey:`Recover it on the website`,upsellTitle:`Go live for $19 a year`,upsellDescription:`New free models the moment they exist, instead of 30 days later. One key, every device. Cancel anytime; the router stays free forever.`,goPremium:`Go Premium`,bundled:`bundled`,planGeneric:`Premium`},languages:{en:`English`,"zh-CN":`中文 (简体)`,es:`Español`,fr:`Français`,"pt-BR":`Português (Brasil)`,it:`Italiano`,hi:`हिन्दी`,ar:`العربية`,bn:`বাংলা`,ru:`Русский`,ur:`اردو`,id:`Bahasa Indonesia`,de:`Deutsch`,ja:`日本語`,sw:`Kiswahili`,mr:`मराठी`,te:`తెలుగు`,tr:`Türkçe`,ta:`தமிழ்`,vi:`Tiếng Việt`,ko:`한국어`,fa:`فارسی`,th:`ไทย`,gu:`ગુજરાતી`,pl:`Polski`,uk:`Українська`,kn:`ಕನ್ನಡ`,ml:`മലയാളം`,or:`ଓଡ଼ିଆ`,my:`မြန်မာဘာသာ`,pa:`ਪੰਜਾਬੀ`,ro:`Română`,nl:`Nederlands`,ms:`Bahasa Melayu`,tl:`Filipino`,ha:`Hausa`,yo:`Yorùbá`,ig:`Igbo`,am:`አማርኛ`,uz:`Oʻzbekcha`,az:`Azərbaycanca`,si:`සිංහල`,ne:`नेपाली`,km:`ខ្មែរ`,el:`Ελληνικά`,cs:`Čeština`,hu:`Magyar`,sv:`Svenska`,he:`עברית`,da:`Dansk`,fi:`Suomi`,no:`Norsk`,sk:`Slovenčina`,bg:`Български`,hr:`Hrvatski`,sr:`Српски`,lt:`Lietuvių`,"zh-TW":`中文 (繁體)`,"pt-PT":`Português (Portugal)`,ka:`ქართული`},errors:{boundaryTitle:`Something went wrong`,boundaryDescription:`The dashboard hit an unexpected error. Your data is safe. Try again or go back to the models page.`,tryAgain:`Try again`,goHome:`Back to models`},notFound:{title:`Page not found`,description:`This page does not exist or may have moved.`},setup:{title:`Getting started`,subtitle:`Three steps to route your first request.`,progress:`{done} of {total}`,step1Title:`Add a provider key`,step1Desc:`Connect at least one provider account. Free keys work.`,step1Cta:`Add keys`,step2Title:`Send a test request`,step2Desc:`Pick any model in the Playground and say hello.`,step2Cta:`Open Playground`,step3Title:`Connect your app`,step3Desc:`Use your unified API key with any OpenAI-compatible client.`,copyKey:`Copy API key`,copyUrl:`Copy base URL`,copiedKey:`API key copied to clipboard`,copiedUrl:`Base URL copied to clipboard`},palette:{title:`Command palette`,placeholder:`Search pages, models, actions…`,empty:`No results`,groupPages:`Pages`,groupActions:`Actions`,groupModels:`Models`,toggleTheme:`Toggle dark mode`},validation:{required:`Required`,url:`Enter a valid URL starting with http:// or https://`,email:`Enter a valid email address`,passwordMin:`At least {min} characters`},update:{available:`New version available`,whatsNew:`What's new in v{version}`,publishedOn:`Published {date}`,noNotes:`No release notes were published for this version.`,openRelease:`Open release page`,dismissVersion:`Dismiss this version`,dismiss:`Dismiss`},freeTier:{poolsToggle:`Free-tier pools ({count})`,poolsToggleBare:`Free-tier pools`,summary:`{pools} pools · {budget} tokens/mo counted once per pool · {credits} credits-based · {unpublished} unpublished`,pool:`Pool`,models:`Models`,budget:`Monthly budget`,kind:`Kind`,kindDocumented:`Documented`,kindCredits:`Credits`,kindUnpublished:`Unpublished`,remaining:`Remaining`,resetAt:`Resets at`,disabledModels:`({count} off)`,metricTokens:`tokens`,metricRequests:`requests`,metricCredits:`credits`,metricNeurons:`neurons`,metricOther:`units`,empty:`No enabled models with free-tier budget data.`,poolLabel:`{platform} · shared {scope} pool`,poolLabelBare:`{platform} · shared pool`,poolModels:`{count} models`,poolBudget:`{budget}/mo`,poolBudgetTitle:`One monthly allowance for the whole pool, scaled by the {count} usable keys on this platform. Every model listed under it draws from the same budget.`,poolNoQuota:`no published quota`,poolResets:`resets {time}`,independentBudgets:`independent budgets`},chains:{title:`Fallback chains`,description:`Named chains, each callable as auto:<name> in /v1/models.`,count:`{count} chains`,active:`Active`,default:`Default`,activate:`Activate`,activateHint:`Make this the chain the table below edits and the one auto routes through`,deleteHint:`Delete this chain`,deleteConfirm:`Delete chain "{name}"?`,create:`Create`,createPlaceholder:`Chain name`,createFailed:`Could not create the chain.`,nameRules:`Up to 20 characters: letters, digits, hyphens and underscores.`,startEmpty:`Start empty`,startEmptyHint:`Create the chain with no models in it, and keep new catalog models out of it. Unchecked, it starts as a copy of the default chain.`,curated:`Curated`,curatedHint:`New catalog models are not added to this chain automatically.`,renameHint:`Rename this chain`,renameConfirm:`Rename chain "{oldName}" to "{name}"? Clients calling auto:{oldName} must switch to auto:{name}.`,renamePlaceholder:`New chain name`,renameFailed:`Couldn't rename the chain.`},notifications:{catalogAdded:`{count} new models added from catalog`,catalogAddedFrom:`{count} new models added for {provider}`,catalogRemoved:`{count} models removed from catalog`,catalogRemovedFrom:`{count} models removed for {provider}`,catalogUpdated:`{count} models updated from latest catalog`,catalogUpdatedFrom:`{count} models updated for {provider}`,discoverAdded:`{count} new models from provider {provider}`,discoverRemoved:`{count} models removed from provider {provider}`,degraded:`Degraded mode active — only {healthy}/{total} providers healthy ({pct}%)`,updateAvailable:`Update available: v{version}`},routingStrip:{canceled:`Canceled`,title:`Live routing`,mode:`Mode`,processing:`Processing…`,idle:`Waiting for a request…`,failed:`Failed`,afterAttempts:`Success after {n} attempts`,activeCount:`{n} active`}},U_=`en.zh-CN.es.fr.pt-BR.it.hi.ar.bn.ru.ur.id.de.ja.sw.mr.te.tr.ta.vi.ko.fa.th.gu.pl.uk.kn.ml.or.my.pa.ro.nl.ms.tl.ha.yo.ig.am.uz.az.si.ne.km.el.cs.hu.sv.he.da.fi.no.sk.bg.hr.sr.lt.zh-TW.pt-PT.ka`.split(`.`),W_=new Set([`ar`,`he`,`fa`,`ur`]),G_=(0,v.createContext)(null);function Z(){return(0,v.useContext)(G_)||{locale:`en`,setLocale:()=>{},t:e=>e}}var K_=new Set(U_),q_=new Map(U_.map(e=>[e.toLowerCase(),e]));function J_(e){let t=e.replace(`_`,`-`).toLowerCase(),n=q_.get(t);if(n)return n;let[r,i]=t.split(`-`);return r===`zh`?i===`tw`||i===`hk`||i===`mo`||i===`hant`?`zh-TW`:`zh-CN`:r===`pt`?i===`pt`?`pt-PT`:`pt-BR`:r===`nb`||r===`nn`?`no`:r===`fil`?`tl`:q_.get(r)??null}function Y_(){if(typeof window>`u`||typeof navigator>`u`)return`en`;let e=window.localStorage.getItem(`srouter.locale`);if(e&&K_.has(e))return e;let t=navigator.userLanguage,n=navigator.languages?.length?navigator.languages:[navigator.language||t||``];for(let e of n){let t=J_(e);if(t)return t}return`en`}var X_=Object.fromEntries(Object.entries(Object.assign({"./locales/am.json":()=>C(()=>import(`./am-TQ7Jmdqe.js`).then(e=>e.default),[]),"./locales/ar.json":()=>C(()=>import(`./ar-Bf5a7yfC.js`).then(e=>e.default),[]),"./locales/az.json":()=>C(()=>import(`./az-CrosE1xH.js`).then(e=>e.default),[]),"./locales/bg.json":()=>C(()=>import(`./bg-BvWnmcUz.js`).then(e=>e.default),[]),"./locales/bn.json":()=>C(()=>import(`./bn-ams5TsJp.js`).then(e=>e.default),[]),"./locales/cs.json":()=>C(()=>import(`./cs-Dh67CaJ_.js`).then(e=>e.default),[]),"./locales/da.json":()=>C(()=>import(`./da-9WlT8Iq7.js`).then(e=>e.default),[]),"./locales/de.json":()=>C(()=>import(`./de-lWhJJzz7.js`).then(e=>e.default),[]),"./locales/el.json":()=>C(()=>import(`./el-Cu7_GhNq.js`).then(e=>e.default),[]),"./locales/es.json":()=>C(()=>import(`./es-BZuzsBcP.js`).then(e=>e.default),[]),"./locales/fa.json":()=>C(()=>import(`./fa-Dwdn-jKS.js`).then(e=>e.default),[]),"./locales/fi.json":()=>C(()=>import(`./fi-BFrFyOTy.js`).then(e=>e.default),[]),"./locales/fr.json":()=>C(()=>import(`./fr-XhbtmPpj.js`).then(e=>e.default),[]),"./locales/gu.json":()=>C(()=>import(`./gu-D0uhLUB8.js`).then(e=>e.default),[]),"./locales/ha.json":()=>C(()=>import(`./ha-CVlm9pqp.js`).then(e=>e.default),[]),"./locales/he.json":()=>C(()=>import(`./he-CMIFeoWr.js`).then(e=>e.default),[]),"./locales/hi.json":()=>C(()=>import(`./hi-ENTwhBpn.js`).then(e=>e.default),[]),"./locales/hr.json":()=>C(()=>import(`./hr-fc03vMy_.js`).then(e=>e.default),[]),"./locales/hu.json":()=>C(()=>import(`./hu-YBo2BIYt.js`).then(e=>e.default),[]),"./locales/id.json":()=>C(()=>import(`./id-BEWXYX69.js`).then(e=>e.default),[]),"./locales/ig.json":()=>C(()=>import(`./ig-BKLZFKka.js`).then(e=>e.default),[]),"./locales/it.json":()=>C(()=>import(`./it-Bzmei1Y2.js`).then(e=>e.default),[]),"./locales/ja.json":()=>C(()=>import(`./ja-BfcpuqEl.js`).then(e=>e.default),[]),"./locales/ka.json":()=>C(()=>import(`./ka-CnWjRgLo.js`).then(e=>e.default),[]),"./locales/km.json":()=>C(()=>import(`./km-BAjPR3Qj.js`).then(e=>e.default),[]),"./locales/kn.json":()=>C(()=>import(`./kn-B15WKU5m.js`).then(e=>e.default),[]),"./locales/ko.json":()=>C(()=>import(`./ko-C61fAB-w.js`).then(e=>e.default),[]),"./locales/lt.json":()=>C(()=>import(`./lt-CYTr4_YW.js`).then(e=>e.default),[]),"./locales/ml.json":()=>C(()=>import(`./ml-CtqxgyH3.js`).then(e=>e.default),[]),"./locales/mr.json":()=>C(()=>import(`./mr-X5TMY7aR.js`).then(e=>e.default),[]),"./locales/ms.json":()=>C(()=>import(`./ms-DSg8RqPS.js`).then(e=>e.default),[]),"./locales/my.json":()=>C(()=>import(`./my-D7RqR8uE.js`).then(e=>e.default),[]),"./locales/ne.json":()=>C(()=>import(`./ne-DaflxkDj.js`).then(e=>e.default),[]),"./locales/nl.json":()=>C(()=>import(`./nl-BOqqtsC8.js`).then(e=>e.default),[]),"./locales/no.json":()=>C(()=>import(`./no-BSHp_StB.js`).then(e=>e.default),[]),"./locales/or.json":()=>C(()=>import(`./or-BkLR9Vub.js`).then(e=>e.default),[]),"./locales/pa.json":()=>C(()=>import(`./pa-CarJ2XgI.js`).then(e=>e.default),[]),"./locales/pl.json":()=>C(()=>import(`./pl-C2n0V-0k.js`).then(e=>e.default),[]),"./locales/pt-BR.json":()=>C(()=>import(`./pt-BR-CqJdNhg2.js`).then(e=>e.default),[]),"./locales/pt-PT.json":()=>C(()=>import(`./pt-PT-C_HpMyKz.js`).then(e=>e.default),[]),"./locales/ro.json":()=>C(()=>import(`./ro-DVRZqSAS.js`).then(e=>e.default),[]),"./locales/ru.json":()=>C(()=>import(`./ru-DwAJG7VC.js`).then(e=>e.default),[]),"./locales/si.json":()=>C(()=>import(`./si-BxUezXm0.js`).then(e=>e.default),[]),"./locales/sk.json":()=>C(()=>import(`./sk-eI1VcIfY.js`).then(e=>e.default),[]),"./locales/sr.json":()=>C(()=>import(`./sr-CJF3auCr.js`).then(e=>e.default),[]),"./locales/sv.json":()=>C(()=>import(`./sv-nqvwHAq_.js`).then(e=>e.default),[]),"./locales/sw.json":()=>C(()=>import(`./sw-DWynE2pW.js`).then(e=>e.default),[]),"./locales/ta.json":()=>C(()=>import(`./ta-BVM12knC.js`).then(e=>e.default),[]),"./locales/te.json":()=>C(()=>import(`./te-oyzEkF7_.js`).then(e=>e.default),[]),"./locales/th.json":()=>C(()=>import(`./th-COVeE0ZQ.js`).then(e=>e.default),[]),"./locales/tl.json":()=>C(()=>import(`./tl-DsJANnQz.js`).then(e=>e.default),[]),"./locales/tr.json":()=>C(()=>import(`./tr-B-Fl-urO.js`).then(e=>e.default),[]),"./locales/uk.json":()=>C(()=>import(`./uk-C5qketAO.js`).then(e=>e.default),[]),"./locales/ur.json":()=>C(()=>import(`./ur-QU9KugfV.js`).then(e=>e.default),[]),"./locales/uz.json":()=>C(()=>import(`./uz-DL9cG_mY.js`).then(e=>e.default),[]),"./locales/vi.json":()=>C(()=>import(`./vi-CQiVy3Pu.js`).then(e=>e.default),[]),"./locales/yo.json":()=>C(()=>import(`./yo-DqazMdrZ.js`).then(e=>e.default),[]),"./locales/zh-CN.json":()=>C(()=>import(`./zh-CN-DnYL_Kio.js`).then(e=>e.default),[]),"./locales/zh-TW.json":()=>C(()=>import(`./zh-TW-5bdbosKj.js`).then(e=>e.default),[])})).map(([e,t])=>[e.match(/\/([^/]+)\.json$/)?.[1],t])),Z_={en:H_};function Q_(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function $_(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r==null?`{${n}}`:String(r)}):e}function ev({children:e,initialLocale:t}){let[n,r]=(0,v.useState)(()=>t??Y_()),[i,a]=(0,v.useState)(()=>Z_[t??`en`]??H_);(0,v.useEffect)(()=>{window.localStorage.setItem(`srouter.locale`,n),document.documentElement.lang=n,document.documentElement.dir=W_.has(n)?`rtl`:`ltr`},[n]),(0,v.useEffect)(()=>{let e=X_[n];if(!e)return;let t=!0;return e().then(e=>{Z_[n]=e,t&&a(e)}).catch(e=>{console.error(`Failed to load locale "${n}"`,e)}),()=>{t=!1}},[n]);let o=(0,v.useCallback)(e=>{if(!K_.has(e))return;r(e);let t=Z_[e];t&&a(t)},[]),s=(0,v.useMemo)(()=>({locale:n,setLocale:o,t:(e,t)=>{let n=Q_(i,e);if(typeof n==`string`)return $_(n,t);let r=Q_(H_,e);return typeof r==`string`?$_(r,t):e}}),[i,n,o]);return(0,G.jsx)(G_.Provider,{value:s,children:e})}var tv=`/assets/srouter-logo-C6ZfjGIi.svg`;function nv({className:e=`size-5`}){return(0,G.jsx)(`img`,{src:tv,alt:`SRouter`,className:e})}var rv=4,iv={success:5e3,info:5e3,error:null},av=[],ov=1,sv=new Set;function cv(){for(let e of sv)e(av)}function lv(e){return sv.add(e),()=>{sv.delete(e)}}function uv(){return av}function dv(e){av.some(t=>t.id===e)&&(av=av.filter(t=>t.id!==e),cv())}function fv(e,t,n){let r=ov++,i=[...av.filter(n=>n.kind!==e||n.message!==t),{id:r,kind:e,message:t,duration:n??iv[e]}];for(;i.length>rv;){let e=i.findIndex(e=>e.kind!==`error`);i.splice(e===-1?0:e,1)}return av=i,cv(),r}var pv={success:(e,t)=>fv(`success`,e,t),error:(e,t)=>fv(`error`,e,t),info:(e,t)=>fv(`info`,e,t)},mv=8;function Iee(){if(typeof window>`u`)return null;let e=window;return e.__SROUTER_DESKTOP__===!0&&typeof e.__SROUTER_SESSION__==`function`?e.__SROUTER_SESSION__:null}function hv({children:e}){return(0,G.jsx)(`main`,{className:`min-h-dvh flex items-center justify-center bg-background px-4 py-10`,children:(0,G.jsx)(`div`,{className:`w-full max-w-sm`,children:e})})}function gv({mode:e,onAuthed:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),b=e===`setup`,x=r.trim()?b&&!V_(r)?n(`validation.email`):null:n(`validation.required`),S=a?b&&a.length<mv?n(`validation.passwordMin`,{min:mv}):null:n(`validation.required`),C=h&&!!x,w=h&&!!S;async function T(e){if(e.preventDefault(),x||S){g(!0);return}m(!0),f(``);try{let e={email:r,password:a};b&&s&&(e.setupCode=s.trim()),p_((await X(b?`/api/auth/setup`:`/api/auth/login`,{method:`POST`,body:JSON.stringify(e)})).token),t()}catch(e){b&&e.code===`setup_code_required`&&u(!0),f(e.message)}finally{m(!1)}}return _&&!b?(0,G.jsx)(Lee,{onBack:()=>y(!1)}):(0,G.jsxs)(hv,{children:[(0,G.jsxs)(`div`,{className:`mb-7 flex items-center justify-center gap-3`,children:[(0,G.jsx)(nv,{className:`size-11`}),(0,G.jsx)(`span`,{className:`text-2xl font-semibold tracking-tight`,children:`SRouter`})]}),(0,G.jsxs)(`div`,{className:`rounded-3xl border bg-card p-6`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:n(b?`auth.createYourAccount`:`auth.signIn`)}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1.5 mb-6`,children:n(b?`auth.setupDescription`:`auth.loginDescription`)}),(0,G.jsxs)(`form`,{onSubmit:T,className:`space-y-4`,noValidate:!0,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`auth-email`,children:n(`auth.email`)}),(0,G.jsx)(L_,{id:`auth-email`,type:`email`,autoComplete:`username`,autoFocus:!0,value:r,onChange:e=>i(e.target.value),placeholder:n(`auth.emailPlaceholder`),"aria-invalid":C,"aria-describedby":C?`auth-email-error`:void 0}),h&&(0,G.jsx)(__,{id:`auth-email-error`,error:x})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`auth-password`,children:n(`auth.password`)}),(0,G.jsx)(R_,{id:`auth-password`,label:n(`auth.password`),autoComplete:b?`new-password`:`current-password`,value:a,onChange:e=>o(e.target.value),placeholder:n(b?`auth.passwordPlaceholderSetup`:`auth.passwordPlaceholderLogin`),"aria-invalid":w,"aria-describedby":w?`auth-password-error`:void 0}),h&&(0,G.jsx)(__,{id:`auth-password-error`,error:S})]}),b&&l&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`auth-setup-code`,children:n(`auth.setupCode`)}),(0,G.jsx)(L_,{id:`auth-setup-code`,type:`text`,autoComplete:`off`,value:s,onChange:e=>c(e.target.value),placeholder:n(`auth.setupCodePlaceholder`),"aria-describedby":`auth-setup-code-hint`}),(0,G.jsx)(`p`,{id:`auth-setup-code-hint`,className:`text-xs text-muted-foreground`,children:n(`auth.setupCodeHint`)})]}),d&&(0,G.jsx)(`p`,{role:`alert`,className:`rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:d}),(0,G.jsxs)(J,{type:`submit`,className:`w-full h-10`,disabled:p,children:[p&&(0,G.jsx)(la,{className:`animate-spin`,"aria-hidden":!0}),n(p?b?`auth.creating`:`auth.signingIn`:b?`auth.createAccount`:`auth.signIn`)]})]}),!b&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>y(!0),className:`mt-3 w-full text-center text-xs text-muted-foreground hover:text-foreground transition-colors`,children:n(`auth.forgotPassword`)})]})]})}function Lee({onBack:e}){let{t}=Z(),[n,r]=(0,v.useState)(`request`),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),m=o?o.length<mv?t(`validation.passwordMin`,{min:mv}):null:t(`validation.required`),h=i.trim()?null:t(`validation.required`);async function g(){d(!0),l(``);try{await X(`/api/auth/forgot-password`,{method:`POST`}),r(`reset`)}catch(e){l(e.message)}finally{d(!1)}}async function _(e){if(e.preventDefault(),h||m){p(!0);return}d(!0),l(``);try{await X(`/api/auth/reset-password`,{method:`POST`,body:JSON.stringify({resetCode:i.trim(),newPassword:o})}),r(`done`)}catch(e){l(e.message)}finally{d(!1)}}return(0,G.jsxs)(hv,{children:[(0,G.jsxs)(`div`,{className:`mb-7 flex items-center justify-center gap-3`,children:[(0,G.jsx)(nv,{className:`size-11`}),(0,G.jsx)(`span`,{className:`text-2xl font-semibold tracking-tight`,children:`SRouter`})]}),(0,G.jsxs)(`div`,{className:`rounded-3xl border bg-card p-6`,children:[(0,G.jsx)(`h1`,{className:`text-base font-medium`,children:t(`auth.forgotPassword`)}),n===`request`&&(0,G.jsxs)(`div`,{className:`mt-1 space-y-3`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mb-4`,children:t(`auth.forgotPasswordDescription`)}),c&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:c}),(0,G.jsx)(J,{className:`w-full`,disabled:u,onClick:g,children:t(u?`auth.requestingResetCode`:`auth.requestResetCode`)})]}),n===`reset`&&(0,G.jsxs)(`form`,{onSubmit:_,className:`space-y-3 mt-4`,noValidate:!0,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`auth.resetCodeHint`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`auth.resetCodeDockerHint`)}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`reset-code`,children:t(`auth.resetCode`)}),(0,G.jsx)(L_,{id:`reset-code`,type:`text`,autoComplete:`off`,value:i,onChange:e=>a(e.target.value),placeholder:t(`auth.resetCodePlaceholder`),"aria-invalid":f&&!!h}),f&&(0,G.jsx)(__,{error:h})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`reset-new-password`,children:t(`auth.newPassword`)}),(0,G.jsx)(R_,{id:`reset-new-password`,label:t(`auth.newPassword`),autoComplete:`new-password`,value:o,onChange:e=>s(e.target.value),placeholder:t(`auth.passwordPlaceholderSetup`),"aria-invalid":f&&!!m}),f&&(0,G.jsx)(__,{error:m})]}),c&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:c}),(0,G.jsx)(J,{type:`submit`,className:`w-full`,disabled:u,children:t(u?`auth.resettingPassword`:`auth.resetPassword`)})]}),n===`done`&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 mb-4`,children:t(`auth.passwordReset`)}),(0,G.jsx)(`button`,{type:`button`,onClick:e,className:`mt-3 w-full text-center text-xs text-muted-foreground hover:text-foreground transition-colors`,children:t(`auth.backToLogin`)})]})]})}function Ree({mode:e,onClose:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),p=e===`password`,m=a.trim()?p&&a.length<mv?n(`validation.passwordMin`,{min:mv}):!p&&!V_(a)?n(`validation.email`):null:n(`validation.required`),h=r?null:n(`validation.required`);async function g(e){if(e.preventDefault(),m||h){f(!0);return}u(!0),c(``);try{p?(await X(`/api/auth/change-password`,{method:`POST`,body:JSON.stringify({currentPassword:r,newPassword:a})}),pv.success(n(`auth.passwordChanged`))):(await X(`/api/auth/change-email`,{method:`POST`,body:JSON.stringify({currentPassword:r,newEmail:a})}),pv.success(n(`auth.emailChanged`))),t()}catch(e){c(e.message)}finally{u(!1)}}return(0,G.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,G.jsxs)(`div`,{className:`w-full max-w-sm rounded-3xl border bg-card p-6 shadow-xl`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium mb-1`,children:n(p?`auth.changePassword`:`auth.changeEmail`)}),(0,G.jsxs)(`form`,{onSubmit:g,className:`space-y-3 mt-4`,noValidate:!0,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`cred-current-password`,children:n(`auth.currentPassword`)}),(0,G.jsx)(R_,{id:`cred-current-password`,label:n(`auth.currentPassword`),autoComplete:`current-password`,value:r,onChange:e=>i(e.target.value),placeholder:n(`auth.passwordPlaceholderLogin`),"aria-invalid":d&&!!h}),d&&(0,G.jsx)(__,{error:h})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`cred-new-value`,children:n(p?`auth.newPassword`:`auth.newEmail`)}),p?(0,G.jsx)(R_,{id:`cred-new-value`,label:n(`auth.newPassword`),autoComplete:`new-password`,value:a,onChange:e=>o(e.target.value),placeholder:n(`auth.passwordPlaceholderSetup`),"aria-invalid":d&&!!m}):(0,G.jsx)(L_,{id:`cred-new-value`,type:`email`,autoComplete:`email`,value:a,onChange:e=>o(e.target.value),placeholder:n(`auth.emailPlaceholder`),"aria-invalid":d&&!!m}),d&&(0,G.jsx)(__,{error:m})]}),s&&(0,G.jsx)(`p`,{className:`text-destructive text-xs`,children:s}),(0,G.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,className:`flex-1`,onClick:t,disabled:l,children:n(`common.cancel`)}),(0,G.jsx)(J,{type:`submit`,className:`flex-1`,disabled:l,children:n(l?p?`auth.changingPassword`:`auth.changingEmail`:`common.save`)})]})]})]})})}function zee({children:e}){let{t}=Z(),n=Rr(),{data:r,isLoading:i,isError:a,refetch:o}=$r({queryKey:[`auth-status`],queryFn:()=>X(`/api/auth/status`),retry:!1});(0,v.useEffect)(()=>{let e=()=>{o()};return window.addEventListener(h_,e),()=>window.removeEventListener(h_,e)},[o]);let s=Iee(),c=!!s&&!!r&&(r.needsSetup||!r.authenticated),l=(0,v.useRef)(!1),[u,d]=(0,v.useState)(!1);(0,v.useEffect)(()=>{!c||!s||l.current||u||(l.current=!0,(async()=>{try{let e=await s();if(!e)throw Error(`empty session token`);p_(e),n.invalidateQueries(),(await o()).data?.authenticated||d(!0)}catch(e){console.error(`[auth-gate] desktop session repair failed`,e),d(!0)}finally{l.current=!1}})())},[c,s,u,n,o]);function f(){n.invalidateQueries(),o()}return i?(0,G.jsx)(hv,{children:(0,G.jsxs)(`p`,{className:`flex items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(la,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),t(`auth.loading`)]})}):a||!r?(0,G.jsx)(hv,{children:(0,G.jsxs)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-xs text-destructive`,children:[t(`auth.serverUnreachableBefore`),(0,G.jsx)(`code`,{className:`font-mono`,children:`npm run dev`}),t(`auth.serverUnreachableAfter`)]})}):c?u?(0,G.jsx)(hv,{children:(0,G.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-xs text-destructive`,children:t(`auth.desktopSessionFailed`)})}):(0,G.jsx)(hv,{children:(0,G.jsxs)(`p`,{className:`flex items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(la,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),t(`auth.loading`)]})}):r.needsSetup?(0,G.jsx)(gv,{mode:`setup`,onAuthed:f}):r.authenticated?(0,G.jsx)(G.Fragment,{children:e}):(0,G.jsx)(gv,{mode:`login`,onAuthed:f})}async function _v(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return Bee(e)}function Bee(e){if(typeof document>`u`||!document.body)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`-9999px`,document.body.appendChild(t);let n=document.getSelection(),r=n&&n.rangeCount>0?n.getRangeAt(0):null;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t.remove(),r&&n&&(n.removeAllRanges(),n.addRange(r))}}function vv({text:e,className:t,label:n=`Copy`}){let{t:r}=Z(),[i,a]=(0,v.useState)(!1);return(0,G.jsx)(`button`,{type:`button`,"aria-label":i?`Copied`:n,onClick:()=>{_v(e).then(e=>{if(!e){pv.error(r(`common.copyFailed`));return}a(!0),setTimeout(()=>a(!1),1500)})},className:Zc(`inline-flex items-center justify-center rounded-md border bg-background/80 text-muted-foreground transition-colors hover:text-foreground`,t),children:i?(0,G.jsx)(wi,{className:`size-3.5`}):(0,G.jsx)(Wi,{className:`size-3.5`})})}function yv(){return`${window.location.origin}/v1`}function bv({snippet:e}){let{t}=Z();return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border bg-card`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,G.jsx)(vv,{text:e,className:`size-7 shrink-0`,label:t(`common.copy`)}),(0,G.jsx)(`span`,{className:`text-xs font-medium`,children:t(`models.codeSnippetHeading`)})]}),(0,G.jsx)(`pre`,{className:`overflow-x-auto px-4 py-3 text-[11px] leading-relaxed`,children:(0,G.jsx)(`code`,{className:`font-mono`,children:e})})]})}var xv=`srouter:command-palette`;function Vee(){window.dispatchEvent(new CustomEvent(xv))}var Sv=(0,v.createContext)(null);function Cv(){let e=(0,v.useContext)(Sv);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e}async function wv(e,t,n){await _v(e)?pv.success(t):pv.error(n)}function Hee(){let{t:e}=Z(),{resolvedDark:t,setTheme:n}=Cv(),r=rt(),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(0),u=(0,v.useRef)(!1),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useCallback)(()=>{u.current=!0,s(``),l(0),a(!0),requestAnimationFrame(()=>d.current?.focus())},[]),m=(0,v.useCallback)(()=>{u.current=!1,a(!1)},[]);(0,v.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`?(e.preventDefault(),u.current?m():p()):e.key===`Escape`&&u.current&&m()}return window.addEventListener(`keydown`,e),window.addEventListener(xv,p),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(xv,p)}},[p,m]);let{data:h=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`),enabled:i}),{data:g}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`),enabled:i}),_=(0,v.useMemo)(()=>{let i=e=>()=>r(e),a=[{id:`p-chat`,group:`pages`,label:e(`models.chatModelsTab`),keywords:`models chat routing fallback`,icon:ma,run:i(`/models/chat`)},{id:`p-embeddings`,group:`pages`,label:e(`models.embeddingsTab`),keywords:`models embeddings vectors`,icon:aa,run:i(`/models/embeddings`)},{id:`p-image`,group:`pages`,label:e(`models.imageTab`),keywords:`models image generation`,icon:na,run:i(`/models/image`)},{id:`p-video`,group:`pages`,label:e(`models.videoTab`),keywords:`models video text to video generation mp4`,icon:Ri,run:i(`/models/video`)},{id:`p-audio`,group:`pages`,label:e(`models.audioTab`),keywords:`models audio speech tts stt transcription whisper`,icon:vi,run:i(`/models/audio`)},{id:`p-fusion`,group:`pages`,label:e(`models.fusionTab`),keywords:`models fusion synthesis panel judge`,icon:Ga,run:i(`/models/fusion`)},{id:`p-playground`,group:`pages`,label:e(`nav.playground`),keywords:`playground test chat try`,icon:La,run:i(`/playground`)},{id:`p-keys`,group:`pages`,label:e(`nav.keys`),keywords:`keys providers api tokens`,icon:ia,run:i(`/keys`)},{id:`p-agents`,group:`pages`,label:e(`nav.agents`),keywords:`agents claude codex cline ollama gemini`,icon:bi,run:i(`/agents`)},{id:`p-analytics`,group:`pages`,label:e(`nav.analytics`),keywords:`analytics usage stats savings latency`,icon:Si,run:i(`/analytics`)}],o=[{id:`a-theme`,group:`actions`,label:e(`palette.toggleTheme`),keywords:`theme dark light mode toggle`,icon:va,run:()=>{n(t?`light`:`dark`)}},{id:`a-copy-key`,group:`actions`,label:e(`setup.copyKey`),keywords:`copy api key unified token`,icon:Wi,run:()=>{g?.apiKey&&wv(g.apiKey,e(`setup.copiedKey`),e(`common.copyFailed`))}},{id:`a-copy-url`,group:`actions`,label:e(`setup.copyUrl`),keywords:`copy base url endpoint`,icon:Wi,run:()=>{wv(yv(),e(`setup.copiedUrl`),e(`common.copyFailed`))}}],s=new Set,c=[];for(let e of h){if(e.keyCount===0)continue;let t=e.canonicalId??e.modelId;if(s.has(t))continue;s.add(t);let n=e.groupLabel??e.displayName;c.push({id:`m-${t}`,group:`models`,label:n,keywords:`${t} ${e.modelId} ${e.platform}`,icon:xi,run:i(`/models/chat/${encodeURIComponent(t)}`)})}return[...a,...o,...c]},[h,g,r,t,n,e]),y=(0,v.useMemo)(()=>{let e=o.trim().toLowerCase();if(!e)return _.filter(e=>e.group!==`models`).concat(_.filter(e=>e.group===`models`).slice(0,5));let t=_.filter(t=>t.label.toLowerCase().includes(e)||t.keywords.toLowerCase().includes(e));return t.filter(e=>e.group!==`models`).concat(t.filter(e=>e.group===`models`).slice(0,8))},[_,o]);if((0,v.useEffect)(()=>{(f.current?.querySelector(`[data-index="${c}"]`))?.scrollIntoView({block:`nearest`})},[c]),!i)return null;function b(e){m(),e.run()}function x(e){e.key===`ArrowDown`?(e.preventDefault(),l(e=>Math.min(e+1,y.length-1))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>Math.max(e-1,0))):e.key===`Enter`&&y[c]&&(e.preventDefault(),b(y[c]))}let S=[{key:`pages`,labelKey:`palette.groupPages`},{key:`actions`,labelKey:`palette.groupActions`},{key:`models`,labelKey:`palette.groupModels`}],C=-1;return(0,G.jsx)(`div`,{className:`fixed inset-0 z-[70] flex items-start justify-center bg-black/40 px-4 pt-[18vh] backdrop-blur-[2px]`,onMouseDown:e=>{e.target===e.currentTarget&&m()},children:(0,G.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":e(`palette.title`),className:`w-full max-w-lg overflow-hidden rounded-2xl border bg-popover shadow-2xl animate-in fade-in zoom-in-95 duration-150`,onKeyDown:x,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b px-3.5`,children:[(0,G.jsx)(Aa,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`input`,{ref:d,value:o,onChange:e=>{s(e.target.value),l(0)},placeholder:e(`palette.placeholder`),"aria-label":e(`palette.placeholder`),role:`combobox`,"aria-expanded":`true`,"aria-controls":`command-palette-list`,"aria-activedescendant":y[c]?`cmd-${y[c].id}`:void 0,className:`h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),(0,G.jsx)(`kbd`,{className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:`esc`})]}),(0,G.jsxs)(`div`,{ref:f,id:`command-palette-list`,role:`listbox`,className:`max-h-80 overflow-y-auto p-1.5`,children:[y.length===0&&(0,G.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:e(`palette.empty`)}),S.map(t=>{let n=y.filter(e=>e.group===t.key);return n.length===0?null:(0,G.jsxs)(`div`,{className:`mb-1 last:mb-0`,children:[(0,G.jsx)(`p`,{className:`px-2.5 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70`,children:e(t.labelKey)}),n.map(e=>{C+=1;let t=C,n=t===c,r=e.icon;return(0,G.jsxs)(`button`,{id:`cmd-${e.id}`,type:`button`,role:`option`,"aria-selected":n,"data-index":t,onMouseEnter:()=>l(t),onClick:()=>b(e),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-sm transition-colors ${n?`bg-muted text-foreground`:`text-muted-foreground`}`,children:[(0,G.jsx)(r,{className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.id)})]},t.key)})]})]})})}var Uee=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){console.error(`[dashboard] page crashed:`,e)}render(){return this.state.error?(0,G.jsx)(Wee,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}};function Wee({error:e,onRetry:t}){let{t:n}=Z();return(0,G.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,G.jsxs)(`div`,{className:`w-full max-w-md rounded-3xl border bg-card p-8 text-center`,children:[(0,G.jsx)(Mi,{className:`mx-auto size-8 text-destructive`}),(0,G.jsx)(`h1`,{className:`mt-4 text-lg font-semibold`,children:n(`errors.boundaryTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`errors.boundaryDescription`)}),e.message&&(0,G.jsx)(`code`,{className:`mt-3 block truncate rounded-lg bg-muted px-3 py-2 font-mono text-[11px] text-muted-foreground`,title:e.message,children:e.message}),(0,G.jsxs)(`div`,{className:`mt-5 flex items-center justify-center gap-2`,children:[(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:t,children:n(`errors.tryAgain`)}),(0,G.jsx)(gn,{to:`/`,onClick:t,children:(0,G.jsx)(J,{size:`sm`,children:n(`errors.goHome`)})})]})]})})}var Tv=v.createContext(!1),Ev=v.createContext(void 0);function Dv(e){let t=v.useContext(Ev);if(e===!1&&t===void 0)throw Error(Uo(27));return t}var Gee={...vl,...cl},Kee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=Dv(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return ds(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Gee,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),qee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=Dv(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=qo({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,du(Dl,e.nativeEvent))}return ds(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Jee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=Dv(),c=cu(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),ds(`p`,e,{ref:t,props:[{id:c},o]})}),Yee=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),Xee=function(e){return e[e.open=ll.open]=`open`,e[e.closed=ll.closed]=`closed`,e[e.startingStyle=ll.startingStyle]=`startingStyle`,e[e.endingStyle=ll.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Ov=v.createContext(void 0);function Zee(){let e=v.useContext(Ov);if(e===void 0)throw Error(Uo(26));return e}var Qee={...vl,...cl,nestedDialogOpen(e){return e?{[Xee.nestedDialogOpen]:``}:null}},$ee=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,{store:c}=Dv(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`),C=s.id??S;Zee(),Cu({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function w(e){return e!==`touch`||c.context.popupRef.current}let T=o===void 0?w:o,E=g>0,D=c.useStateSetter(`popupElement`),O=ds(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:E},props:[f,{id:C,"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,...Bm,hidden:!m,onKeyDown(e){Uh.has(e.key)&&e.stopPropagation()},style:{[Yee.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,D],stateAttributesMapping:Qee});return(0,G.jsx)(gp,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:T,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:O})}),ete=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Dv(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,G.jsx)(Ov.Provider,{value:n,children:(0,G.jsxs)(Qf,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(ig,{ref:i.context.internalBackdropRef,inert:Kh(!s)}),e.children]})}):null});function tte(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`);Jm(t,a),Gm(t);let{forceUnmount:o}=Km(a,t),s=v.useCallback(()=>{t.setOpen(!1,du(Nl))},[t]);return v.useImperativeHandle(r,()=>({unmount:o,close:s}),[o,s]),{parentContext:n,isDrawer:i}}function nte({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState(`open`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=v.useState(0),[d,f]=v.useState(0),p=l===0,m=xp(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=Gu(t);if(p&&!a){let t=n;return o&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||Wu(t,s)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:p});return mg(i&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{u(e),f(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{u(0),f(0)}),v.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(l+1,d+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,l,d,n]),qm(e,{activeTriggerProps:m.reference??ss,inactiveTriggerProps:m.trigger??ss,popupProps:v.useMemo(()=>Oo(Bm,m.floating),[m.floating]),nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var rte={...ih,modal:Y(e=>e.modal),nested:Y(e=>e.nested),nestedOpenDialogCount:Y(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:Y(e=>e.nestedOpenDrawerCount),disablePointerDismissal:Y(e=>e.disablePointerDismissal),openMethod:Y(e=>e.openMethod),descriptionElementId:Y(e=>e.descriptionElementId),titleElementId:Y(e=>e.titleElementId),viewportElement:Y(e=>e.viewportElement),role:Y(e=>e.role)},ite=class e extends Im{constructor(e,t,n=!1){let r=new Ym,i=ate(e);i.floatingRootContext=Qm(r,t,n),super(i,{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},rte)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};Um(n,e,t.trigger),this.update(n)};static useStore(t,n){return Vm(t,(t,r)=>new e(n,t,r),!0).store}};function ate(e={}){return{...Zm(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function ote(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,y=Dv(!0),b={modal:h,disablePointerDismissal:g,nested:!!y,role:_},x=ite.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b});vg(()=>{let e=r===void 0&&x.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?x.update(e?{...b,...e}:b):e&&x.update(e)}),x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`),T=tte({store:x,actionsRef:l,parentContext:y?.store.context,isDrawer:p}),E=S||C,D=v.useMemo(()=>({store:x}),[x]);return(0,G.jsx)(Tv.Provider,{value:!1,children:(0,G.jsxs)(Ev.Provider,{value:D,children:[E&&(0,G.jsx)(nte,{store:x,dialogRoot:T}),typeof n==`function`?n({payload:w}):n]})})}function ste(e){return ote(e,v.useContext(Tv)?`drawer`:`dialog`)}var cte=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=Dv(),c=cu(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),ds(`h2`,e,{ref:t,props:[{id:c},o]})});function kv({...e}){return(0,G.jsx)(ste,{"data-slot":`dialog`,...e})}function Av({...e}){return(0,G.jsx)(qee,{"data-slot":`dialog-close`,...e})}function jv({className:e,children:t,maxWidth:n=`max-w-lg`,...r}){return(0,G.jsxs)(ete,{children:[(0,G.jsx)(Kee,{"data-slot":`dialog-backdrop`,className:`fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`}),(0,G.jsx)($ee,{"data-slot":`dialog-popup`,className:Zc(`fixed top-1/2 left-1/2 z-50 w-[calc(100%-1.5rem)] max-h-[min(85vh,85dvh)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-2xl border bg-card p-5 text-card-foreground shadow-xl ring-1 ring-foreground/5 duration-150 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 sm:w-[calc(100%-2rem)] sm:rounded-3xl sm:p-6`,n,e),...r,children:t})]})}function Mv({className:e,...t}){return(0,G.jsx)(cte,{"data-slot":`dialog-title`,className:Zc(`font-heading text-base leading-snug font-medium`,e),...t})}function lte({className:e,...t}){return(0,G.jsx)(Jee,{"data-slot":`dialog-description`,className:Zc(`text-sm text-muted-foreground`,e),...t})}function ute(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var dte=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fte=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pte={};function Nv(e,t){return((t||pte).jsx?fte:dte).test(e)}var mte=/[ \t\n\f\r]/g;function hte(e){return typeof e==`object`?e.type===`text`&&Pv(e.value):Pv(e)}function Pv(e){return e.replace(mte,``)===``}var Fv=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Fv.prototype.normal={},Fv.prototype.property={},Fv.prototype.space=void 0;function Iv(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Fv(n,r,t)}function Lv(e){return e.toLowerCase()}var Rv=class{constructor(e,t){this.attribute=t,this.property=e}};Rv.prototype.attribute=``,Rv.prototype.booleanish=!1,Rv.prototype.boolean=!1,Rv.prototype.commaOrSpaceSeparated=!1,Rv.prototype.commaSeparated=!1,Rv.prototype.defined=!1,Rv.prototype.mustUseProperty=!1,Rv.prototype.number=!1,Rv.prototype.overloadedBoolean=!1,Rv.prototype.property=``,Rv.prototype.spaceSeparated=!1,Rv.prototype.space=void 0;var zv=s({boolean:()=>Bv,booleanish:()=>Vv,commaOrSpaceSeparated:()=>Gv,commaSeparated:()=>Wv,number:()=>Q,overloadedBoolean:()=>Hv,spaceSeparated:()=>Uv}),gte=0,Bv=Kv(),Vv=Kv(),Hv=Kv(),Q=Kv(),Uv=Kv(),Wv=Kv(),Gv=Kv();function Kv(){return 2**++gte}var qv=Object.keys(zv),Jv=class extends Rv{constructor(e,t,n,r){let i=-1;if(super(e,t),Yv(this,`space`,r),typeof n==`number`)for(;++i<qv.length;){let e=qv[i];Yv(this,qv[i],(n&zv[e])===zv[e])}}};Jv.prototype.defined=!0;function Yv(e,t,n){n&&(e[t]=n)}function Xv(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Jv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Lv(r)]=r,n[Lv(a.attribute)]=r}return new Fv(t,n,e.space)}var Zv=Xv({properties:{ariaActiveDescendant:null,ariaAtomic:Vv,ariaAutoComplete:null,ariaBusy:Vv,ariaChecked:Vv,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Uv,ariaCurrent:null,ariaDescribedBy:Uv,ariaDetails:null,ariaDisabled:Vv,ariaDropEffect:Uv,ariaErrorMessage:null,ariaExpanded:Vv,ariaFlowTo:Uv,ariaGrabbed:Vv,ariaHasPopup:null,ariaHidden:Vv,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Uv,ariaLevel:Q,ariaLive:null,ariaModal:Vv,ariaMultiLine:Vv,ariaMultiSelectable:Vv,ariaOrientation:null,ariaOwns:Uv,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:Vv,ariaReadOnly:Vv,ariaRelevant:null,ariaRequired:Vv,ariaRoleDescription:Uv,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:Vv,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Qv(e,t){return t in e?e[t]:t}function $v(e,t){return Qv(e,t.toLowerCase())}var ey=Xv({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Wv,acceptCharset:Uv,accessKey:Uv,action:null,allow:null,allowFullScreen:Bv,allowPaymentRequest:Bv,allowUserMedia:Bv,alt:null,as:null,async:Bv,autoCapitalize:null,autoComplete:Uv,autoFocus:Bv,autoPlay:Bv,blocking:Uv,capture:null,charSet:null,checked:Bv,cite:null,className:Uv,cols:Q,colSpan:null,content:null,contentEditable:Vv,controls:Bv,controlsList:Uv,coords:Q|Wv,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Bv,defer:Bv,dir:null,dirName:null,disabled:Bv,download:Hv,draggable:Vv,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Bv,formTarget:null,headers:Uv,height:Q,hidden:Hv,high:Q,href:null,hrefLang:null,htmlFor:Uv,httpEquiv:Uv,id:null,imageSizes:null,imageSrcSet:null,inert:Bv,inputMode:null,integrity:null,is:null,isMap:Bv,itemId:null,itemProp:Uv,itemRef:Uv,itemScope:Bv,itemType:Uv,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Bv,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Bv,muted:Bv,name:null,nonce:null,noModule:Bv,noValidate:Bv,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Bv,optimum:Q,pattern:null,ping:Uv,placeholder:null,playsInline:Bv,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Bv,referrerPolicy:null,rel:Uv,required:Bv,reversed:Bv,rows:Q,rowSpan:Q,sandbox:Uv,scope:null,scoped:Bv,seamless:Bv,selected:Bv,shadowRootClonable:Bv,shadowRootDelegatesFocus:Bv,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:Vv,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Bv,useMap:null,value:Vv,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Uv,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Bv,declare:Bv,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Bv,noHref:Bv,noShade:Bv,noWrap:Bv,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:Vv,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Bv,disableRemotePlayback:Bv,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:$v}),ty=Xv({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Gv,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Uv,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Bv,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wv,g2:Wv,glyphName:Wv,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Gv,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Uv,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gv,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gv,rev:Gv,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gv,requiredFeatures:Gv,requiredFonts:Gv,requiredFormats:Gv,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Gv,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gv,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gv,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Qv}),ny=Xv({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ry=Xv({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$v}),iy=Xv({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ay={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},oy=/[A-Z]/g,sy=/-[a-z]/g,cy=/^data[-\w.:]+$/i;function ly(e,t){let n=Lv(t),r=t,i=Rv;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&cy.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(sy,dy);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sy.test(e)){let n=e.replace(oy,uy);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Jv}return new i(r,t)}function uy(e){return`-`+e.toLowerCase()}function dy(e){return e.charAt(1).toUpperCase()}var fy=Iv([Zv,ey,ny,ry,iy],`html`),py=Iv([Zv,ty,ny,ry,iy],`svg`);function my(e){return e.join(` `).trim()}var hy=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
12
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),gy=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(hy());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),_y=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),vy=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(gy()),r=_y();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),yy=xy(`end`),by=xy(`start`);function xy(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Sy(e){let t=by(e),n=yy(e);if(t&&n)return{start:t,end:n}}function Cy(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ty(e.position):`start`in e||`end`in e?Ty(e):`line`in e||`column`in e?wy(e):``}function wy(e){return Ey(e&&e.line)+`:`+Ey(e&&e.column)}function Ty(e){return wy(e&&e.start)+`-`+wy(e&&e.end)}function Ey(e){return e&&typeof e==`number`?e:1}var Dy=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Cy(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Dy.prototype.file=``,Dy.prototype.name=``,Dy.prototype.reason=``,Dy.prototype.message=``,Dy.prototype.stack=``,Dy.prototype.column=void 0,Dy.prototype.line=void 0,Dy.prototype.ancestors=void 0,Dy.prototype.cause=void 0,Dy.prototype.fatal=void 0,Dy.prototype.place=void 0,Dy.prototype.ruleId=void 0,Dy.prototype.source=void 0;var Oy=l(vy(),1),ky={}.hasOwnProperty,Ay=new Map,jy=/[A-Z]/g,My=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ny=new Set([`td`,`th`]),Py=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Fy(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Ky(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Gy(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?py:fy,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Iy(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Iy(e,t,n){if(t.type===`element`)return Ly(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ry(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return By(e,t,n);if(t.type===`mdxjsEsm`)return zy(e,t);if(t.type===`root`)return Vy(e,t,n);if(t.type===`text`)return Hy(e,t)}function Ly(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=py,e.schema=i),e.ancestors.push(t);let a=Qy(e,t.tagName,!1),o=qy(e,t),s=Yy(e,t);return My.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!hte(e)})),Uy(e,o,a,t),Wy(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ry(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$y(e,t.position)}function zy(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$y(e,t.position)}function By(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=py,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Qy(e,t.name,!0),o=Jy(e,t),s=Yy(e,t);return Uy(e,o,a,t),Wy(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vy(e,t,n){let r={};return Wy(r,Yy(e,t)),e.create(t,e.Fragment,r,n)}function Hy(e,t){return t.value}function Uy(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Gy(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Ky(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=by(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qy(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ky.call(t.properties,i)){let a=Xy(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ny.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Jy(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $y(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $y(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Yy(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ay;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Iy(e,a,o);s!==void 0&&n.push(s)}return n}function Xy(e,t,n){let r=ly(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ute(n):my(n)),r.property===`style`){let t=typeof n==`object`?n:Zy(e,String(n));return e.stylePropertyNameCase===`css`&&(t=eb(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ay[r.property]||r.property:r.attribute,n]}}function Zy(e,t){try{return(0,Oy.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Dy("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Py+`#cannot-parse-style-attribute`,r}}function Qy(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Nv(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Nv(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ky.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$y(e)}function $y(e,t){let n=new Dy("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Py+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function eb(e){let t={},n;for(n in e)ky.call(e,n)&&(t[tb(n)]=e[n]);return t}function tb(e){let t=e.replace(jy,nb);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function nb(e){return`-`+e.toLowerCase()}var rb={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ib={};function ab(e,t){let n=t||ib;return ob(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function ob(e,t,n){if(cb(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return sb(e.children,t,n)}return Array.isArray(e)?sb(e,t,n):``}function sb(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ob(e[i],t,n);return r.join(``)}function cb(e){return!!(e&&typeof e==`object`)}var lb=document.createElement(`i`);function ub(e){let t=`&`+e+`;`;lb.innerHTML=t;let n=lb.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function db(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function fb(e,t){return e.length>0?(db(e,e.length,0,t),e):t}var pb={}.hasOwnProperty;function mb(e){let t={},n=-1;for(;++n<e.length;)hb(t,e[n]);return t}function hb(e,t){let n;for(n in t){let r=(pb.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){pb.call(r,a)||(r[a]=[]);let e=i[a];gb(r[a],Array.isArray(e)?e:e?[e]:[])}}}function gb(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);db(e,0,0,r)}function _b(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function vb(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var yb=jb(/[A-Za-z]/),bb=jb(/[\dA-Za-z]/),xb=jb(/[#-'*+\--9=?A-Z^-~]/);function Sb(e){return e!==null&&(e<32||e===127)}var Cb=jb(/\d/),wb=jb(/[\dA-Fa-f]/),Tb=jb(/[!-/:-@[-`{-~]/);function Eb(e){return e!==null&&e<-2}function Db(e){return e!==null&&(e<0||e===32)}function Ob(e){return e===-2||e===-1||e===32}var kb=jb(/\p{P}|\p{S}/u),Ab=jb(/\s/);function jb(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Mb(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&bb(e.charCodeAt(n+1))&&bb(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Nb(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Ob(r)?(e.enter(n),s(r)):t(r)}function s(r){return Ob(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Pb={tokenize:Fb};function Fb(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Nb(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Eb(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ib={tokenize:Rb},Lb={tokenize:zb};function Rb(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return db(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Lb,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Lb,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Eb(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;db(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zb(e,t,n){return Nb(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Bb(e){if(e===null||Db(e)||Ab(e))return 1;if(kb(e))return 2}function Vb(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Hb={name:`attention`,resolveAll:Ub,tokenize:Wb};function Ub(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Gb(d,-c),Gb(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=fb(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=fb(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=fb(l,Vb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=fb(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=fb(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,db(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Wb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Bb(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Bb(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Gb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Kb={name:`autolink`,tokenize:qb};function qb(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return yb(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||bb(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||bb(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Sb(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):xb(t)?(e.consume(t),l):n(t)}function u(e){return bb(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||bb(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Jb={partial:!0,tokenize:Yb};function Yb(e,t,n){return r;function r(t){return Ob(t)?Nb(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Eb(e)?t(e):n(e)}}var Xb={continuation:{tokenize:Qb},exit:$b,name:`blockQuote`,tokenize:Zb};function Zb(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Ob(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Qb(e,t,n){let r=this;return i;function i(t){return Ob(t)?Nb(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Xb,t,n)(r)}}function $b(e){e.exit(`blockQuote`)}var ex={name:`characterEscape`,tokenize:tx};function tx(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Tb(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var nx={name:`characterReference`,tokenize:rx};function rx(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=bb,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=wb,u):(e.enter(`characterReferenceValue`),a=7,o=Cb,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===bb&&!ub(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var ix={partial:!0,tokenize:sx},ax={concrete:!0,name:`codeFenced`,tokenize:ox};function ox(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Ob(t)?Nb(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Eb(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ix,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Eb(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Ob(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Nb(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Eb(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Eb(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Ob(t)?Nb(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Eb(t)?e.check(ix,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Eb(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Ob(t)?Nb(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Ob(t)?Nb(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Eb(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function sx(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var cx={name:`codeIndented`,tokenize:ux},lx={partial:!0,tokenize:dx};function ux(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Nb(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Eb(t)?e.attempt(lx,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Eb(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function dx(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Eb(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Nb(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Eb(e)?i(e):n(e)}}var fx={name:`codeText`,previous:mx,resolve:px,tokenize:hx};function px(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function mx(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function hx(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Eb(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Eb(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var gx=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&_x(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),_x(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_x(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);_x(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);_x(this.left,t.reverse())}}}};function _x(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vx(e){let t={},n=-1,r,i,a,o,s,c,l,u=new gx(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,yx(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return db(e,0,1/0,u.slice(0)),!l}function yx(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var bx={resolve:Sx,tokenize:Cx},xx={partial:!0,tokenize:wx};function Sx(e){return vx(e),e}function Cx(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Eb(t)?e.check(xx,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function wx(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Nb(e,a,`linePrefix`)}function a(i){if(i===null||Eb(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Tx(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Sb(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Eb(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Db(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Sb(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ex(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Eb(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Eb(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Ob(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Dx(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Eb(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Nb(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Eb(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ox(e,t){let n;return r;function r(i){return Eb(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Ob(i)?Nb(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var kx={name:`definition`,tokenize:jx},Ax={partial:!0,tokenize:Mx};function jx(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ex.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=vb(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Db(t)?Ox(e,l)(t):l(t)}function l(t){return Tx(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ax,d,d)(t)}function d(t){return Ob(t)?Nb(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Eb(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Mx(e,t,n){return r;function r(t){return Db(t)?Ox(e,i)(t):n(t)}function i(t){return Dx(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Ob(t)?Nb(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Eb(e)?t(e):n(e)}}var Nx={name:`hardBreakEscape`,tokenize:Px};function Px(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Eb(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Fx={name:`headingAtx`,resolve:Ix,tokenize:Lx};function Ix(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},db(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Lx(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Db(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Eb(n)?(e.exit(`atxHeading`),t(n)):Ob(n)?Nb(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Db(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Rx=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),zx=[`pre`,`script`,`style`,`textarea`],Bx={concrete:!0,name:`htmlFlow`,resolveTo:Ux,tokenize:Wx},Vx={partial:!0,tokenize:Kx},Hx={partial:!0,tokenize:Gx};function Ux(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Wx(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):yb(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):yb(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return yb(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Db(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&zx.includes(l)?(i=1,r.interrupt?t(s):O(s)):Rx.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||bb(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Ob(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||yb(t)?(e.consume(t),b):Ob(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||bb(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Ob(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Ob(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Eb(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Db(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Ob(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Eb(t)?O(t):Ob(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):Eb(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Vx,R,k)(t)):t===null||Eb(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Hx,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Eb(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return zx.includes(n)?(e.consume(t),L):O(t)}return yb(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||Eb(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function Gx(e,t,n){let r=this;return i;function i(t){return Eb(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Kx(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Jb,t,n)}}var qx={name:`htmlText`,tokenize:Jx};function Jx(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):yb(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):yb(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Eb(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Eb(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Eb(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Eb(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return yb(t)?(e.consume(t),S):n(t)}function S(t){return t===45||bb(t)?(e.consume(t),S):C(t)}function C(t){return Eb(t)?(o=C,N(t)):Ob(t)?(e.consume(t),C):M(t)}function w(t){return t===45||bb(t)?(e.consume(t),w):t===47||t===62||Db(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||yb(t)?(e.consume(t),E):Eb(t)?(o=T,N(t)):Ob(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||bb(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Eb(t)?(o=D,N(t)):Ob(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Eb(t)?(o=O,N(t)):Ob(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Eb(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Db(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Db(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Ob(t)?Nb(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Yx={name:`labelEnd`,resolveAll:$x,resolveTo:eS,tokenize:tS},Xx={tokenize:nS},Zx={tokenize:rS},Qx={tokenize:iS};function $x(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&db(e,0,e.length,n),e}function eS(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=fb(s,e.slice(a+1,a+r+3)),s=fb(s,[[`enter`,u,t]]),s=fb(s,Vb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=fb(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=fb(s,e.slice(o+1)),s=fb(s,[[`exit`,c,t]]),db(e,a,e.length,s),e}function tS(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(vb(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Xx,u,o?u:d)(t):t===91?e.attempt(Zx,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Qx,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function nS(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Db(t)?Ox(e,a)(t):a(t)}function a(t){return t===41?u(t):Tx(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Db(t)?Ox(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Dx(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Db(t)?Ox(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function rS(e,t,n){let r=this;return i;function i(t){return Ex.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(vb(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function iS(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var aS={name:`labelStartImage`,resolveAll:Yx.resolveAll,tokenize:oS};function oS(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var sS={name:`labelStartLink`,resolveAll:Yx.resolveAll,tokenize:cS};function cS(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var lS={name:`lineEnding`,tokenize:uS};function uS(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Nb(e,t,`linePrefix`)}}var dS={name:`thematicBreak`,tokenize:fS};function fS(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Eb(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Ob(t)?Nb(e,s,`whitespace`)(t):s(t))}}var pS={continuation:{tokenize:_S},exit:yS,name:`list`,tokenize:gS},mS={partial:!0,tokenize:bS},hS={partial:!0,tokenize:vS};function gS(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Cb(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(dS,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Cb(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Jb,r.interrupt?n:u,e.attempt(mS,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Ob(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function _S(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Jb,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Nb(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Ob(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hS,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Nb(e,e.attempt(pS,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function vS(e,t,n){let r=this;return Nb(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function yS(e){e.exit(this.containerState.type)}function bS(e,t,n){let r=this;return Nb(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Ob(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var xS={name:`setextUnderline`,resolveTo:SS,tokenize:CS};function SS(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function CS(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Ob(t)?Nb(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Eb(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var wS={tokenize:TS};function TS(e){let t=this,n=e.attempt(Jb,r,e.attempt(this.parser.constructs.flowInitial,i,Nb(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bx,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ES={resolveAll:AS()},DS=kS(`string`),OS=kS(`text`);function kS(e){return{resolveAll:AS(e===`text`?jS:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function AS(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function jS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var MS=s({attentionMarkers:()=>BS,contentInitial:()=>PS,disable:()=>VS,document:()=>NS,flow:()=>IS,flowInitial:()=>FS,insideSpan:()=>zS,string:()=>LS,text:()=>RS}),NS={42:pS,43:pS,45:pS,48:pS,49:pS,50:pS,51:pS,52:pS,53:pS,54:pS,55:pS,56:pS,57:pS,62:Xb},PS={91:kx},FS={[-2]:cx,[-1]:cx,32:cx},IS={35:Fx,42:dS,45:[xS,dS],60:Bx,61:xS,95:dS,96:ax,126:ax},LS={38:nx,92:ex},RS={[-5]:lS,[-4]:lS,[-3]:lS,33:aS,38:nx,42:Hb,60:[Kb,qx],91:sS,92:[Nx,ex],93:Yx,95:Hb,96:fx},zS={null:[Hb,ES]},BS={null:[42,95]},VS={null:[]};function HS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=fb(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Vb(a,l.events,l),l.events):[]}function f(e,t){return WS(p(e),t)}function p(e){return US(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Eb(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&db(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function US(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function WS(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
13
+ `;break;case-3:o=`\r
14
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function GS(e){let t={constructs:mb([MS,...(e||{}).extensions||[]]),content:n(Pb),defined:[],document:n(Ib),flow:n(wS),lazy:{},string:n(DS),text:n(OS)};return t;function n(e){return n;function n(n){return HS(t,e,n)}}}function KS(e){for(;!vx(e););return e}var qS=/[\0\t\n\r]/g;function JS(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(qS.lastIndex=u,c=qS.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var YS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XS(e){return e.replace(YS,ZS)}function ZS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return _b(n.slice(t?2:1),t?16:10)}return ub(n)||e}var QS={}.hasOwnProperty;function $S(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),eC(n)(KS(GS(n).document().write(JS()(e,t,!0))))}function eC(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ue),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(oe),blockQuote:a(te),characterEscape:T,characterReference:T,codeFenced:a(ne),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ne,o),codeText:a(re,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ie),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ae),hardBreakEscape:a(se),hardBreakTrailing:a(se),htmlFlow:a(ce,o),htmlFlowData:T,htmlText:a(ce,o),htmlTextData:T,image:a(le),label:o,link:a(ue),listItem:a(fe),listItemValue:f,listOrdered:a(de,d),listUnordered:a(de),paragraph:a(pe),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(oe),strong:a(me),thematicBreak:a(ge)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:W,autolinkProtocol:ee,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:H,characterReference:U,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:B,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};nC(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];QS.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||iC).call(a,void 0,e[0])}for(r.position={start:tC(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tC(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tC(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||iC).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Cy({start:e.start,end:e.end})+`): it’s not open`);n.position.end=tC(e.end)}function u(){return ab(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vb(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=he(),n.position={start:tC(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tC(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=tC(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=XS(t),n.identifier=vb(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function B(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vb(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function V(e){this.data.characterReferenceType=e.type}function H(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=_b(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ub(t);let i=this.stack[this.stack.length-1];i.value+=r}function U(e){let t=this.stack.pop();t.position.end=tC(e.end)}function ee(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function W(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function te(){return{type:`blockquote`,children:[]}}function ne(){return{type:`code`,lang:null,meta:null,value:``}}function re(){return{type:`inlineCode`,value:``}}function ie(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ae(){return{type:`emphasis`,children:[]}}function oe(){return{type:`heading`,depth:0,children:[]}}function se(){return{type:`break`}}function ce(){return{type:`html`,value:``}}function le(){return{type:`image`,title:null,url:``,alt:null}}function ue(){return{type:`link`,title:null,url:``,children:[]}}function de(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function fe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function pe(){return{type:`paragraph`,children:[]}}function me(){return{type:`strong`,children:[]}}function he(){return{type:`text`,value:``}}function ge(){return{type:`thematicBreak`}}}function tC(e){return{line:e.line,column:e.column,offset:e.offset}}function nC(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?nC(e,r):rC(e,r)}}function rC(e,t){let n;for(n in t)if(QS.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function iC(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Cy({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Cy({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Cy({start:t.start,end:t.end})+`) is still open`)}function aC(e){let t=this;t.parser=n;function n(n){return $S(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function oC(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function sC(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
15
+ `}]}function cC(e,t){let n=t.value?t.value+`
16
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function lC(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uC(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dC(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Mb(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function fC(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pC(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mC(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function hC(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mC(e,t);let i={src:Mb(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function gC(e,t){let n={src:Mb(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _C(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function vC(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mC(e,t);let i={href:Mb(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yC(e,t){let n={href:Mb(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bC(e,t,n){let r=e.all(t),i=n?xC(n):SC(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
17
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
18
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function xC(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=SC(n[r])}return t}function SC(e){return e.spread??e.children.length>1}function CC(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function wC(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TC(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function EC(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DC(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=by(t.children[1]),o=yy(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function OC(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function kC(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var AC=9,jC=32;function MC(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(NC(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(NC(t.slice(i),i>0,!1)),a.join(``)}function NC(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===AC||t===jC;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===AC||t===jC;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function PC(e,t){let n={type:`text`,value:MC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FC(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var IC={blockquote:oC,break:sC,code:cC,delete:lC,emphasis:uC,footnoteReference:dC,heading:fC,html:pC,imageReference:hC,image:gC,inlineCode:_C,linkReference:vC,link:yC,listItem:bC,list:CC,paragraph:wC,root:TC,strong:EC,table:DC,tableCell:kC,tableRow:OC,text:PC,thematicBreak:FC,toml:LC,yaml:LC,definition:LC,footnoteDefinition:LC};function LC(){}var RC=typeof self==`object`?self:globalThis,zC=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new RC[e](t)},BC=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(zC(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(zC(a,o),i)};return r},VC=e=>BC(new Map,e)(0),HC=``,{toString:UC}={},{keys:WC}=Object,GC=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=UC.call(e).slice(8,-1);switch(n){case`Array`:return[1,HC];case`Object`:return[2,HC];case`Date`:return[3,HC];case`RegExp`:return[4,HC];case`Map`:return[5,HC];case`Set`:return[6,HC];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},KC=([e,t])=>e===0&&(t===`function`||t===`symbol`),qC=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=GC(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of WC(r))(e||!KC(GC(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(KC(GC(n))||KC(GC(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!KC(GC(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},JC=(e,{json:t,lossy:n}={})=>{let r=[];return qC(!(t||n),!!t,new Map,r)(e),r},YC=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?VC(JC(e,t)):structuredClone(e):(e,t)=>VC(JC(e,t));function XC(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function ZC(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function QC(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||XC,r=e.options.footnoteBackLabel||ZC,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Mb(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...YC(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
19
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
20
+ `}]}}var $C=(function(e){if(e==null)return iw;if(typeof e==`function`)return rw(e);if(typeof e==`object`)return Array.isArray(e)?ew(e):tw(e);if(typeof e==`string`)return nw(e);throw Error(`Expected function, string, or object as test`)});function ew(e){let t=[],n=-1;for(;++n<e.length;)t[n]=$C(e[n]);return rw(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function tw(e){let t=e;return rw(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function nw(e){return rw(t);function t(t){return t&&t.type===e}}function rw(e){return t;function t(t,n,r){return!!(aw(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function iw(){return!0}function aw(e){return typeof e==`object`&&!!e&&`type`in e}function ow(e){return e}var sw=[];function cw(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=$C(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ow(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=sw,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=lw(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function lw(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?sw:[e]}function uw(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),cw(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var dw={}.hasOwnProperty,fw={};function pw(e,t){let n=t||fw,r=new Map,i=new Map,a={all:s,applyData:hw,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...IC,...n.handlers},one:o,options:n,patch:mw,wrap:_w};return uw(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(dw.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=YC(n);return r.children=a.all(e),r}return YC(e)}return(a.options.unknownHandler||gw)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=vw(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=vw(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function mw(e,t){e.position&&(t.position=Sy(e))}function hw(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,YC(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function gw(e,t){let n=t.data||{},r=`value`in t&&!(dw.call(n,`hProperties`)||dw.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _w(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
21
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
22
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
23
+ `}),n}function vw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yw(e,t){let n=pw(e,t),r=n.one(e,void 0),i=QC(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
24
+ `},i)),a}function bw(e,t){return e&&`run`in e?async function(n,r){let i=yw(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yw(n,{file:r,...e||t})}}function xw(e){if(e)throw e}var Sw=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Cw(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ww(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Tw(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Tw(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Ew={basename:Dw,dirname:Ow,extname:kw,join:Aw,sep:`/`};function Dw(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Nw(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ow(e){if(Nw(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function kw(e){Nw(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Aw(...e){let t=-1,n;for(;++t<e.length;)Nw(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:jw(n)}function jw(e){Nw(e);let t=e.codePointAt(0)===47,n=Mw(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Mw(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Nw(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Pw={cwd:Fw};function Fw(){return`/`}function Iw(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Lw(e){if(typeof e==`string`)e=new URL(e);else if(!Iw(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Rw(e)}function Rw(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var zw=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Bw=class{constructor(e){let t;t=e?Iw(e)?{path:e}:typeof e==`string`||_te(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Pw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<zw.length;){let e=zw[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)zw.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Ew.basename(this.path):void 0}set basename(e){Hw(e,`basename`),Vw(e,`basename`),this.path=Ew.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Ew.dirname(this.path):void 0}set dirname(e){Uw(this.basename,`dirname`),this.path=Ew.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Ew.extname(this.path):void 0}set extname(e){if(Vw(e,`extname`),Uw(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Ew.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Iw(e)&&(e=Lw(e)),Hw(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Ew.basename(this.path,this.extname):void 0}set stem(e){Hw(e,`stem`),Vw(e,`stem`),this.path=Ew.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Dy(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Vw(e,t){if(e&&e.includes(Ew.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Ew.sep+"`")}function Hw(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Uw(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function _te(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var vte=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ww=l(Sw(),1),yte={}.hasOwnProperty,bte=new class e extends vte{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ww()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ww.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(qw(`data`,this.frozen),this.namespace[e]=t,this):yte.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qw(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Xw(e),n=this.parser||this.Parser;return Gw(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Gw(`process`,this.parser||this.Parser),Kw(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Xw(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Ste(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Gw(`processSync`,this.parser||this.Parser),Kw(`processSync`,this.compiler||this.Compiler),this.process(e,r),Yw(`processSync`,`process`,t),n;function r(e,r){t=!0,xw(e),n=r}}run(e,t,n){Jw(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Xw(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Yw(`runSync`,`run`,n),r;function i(e,t){xw(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Xw(t),r=this.compiler||this.Compiler;return Kw(`stringify`,r),Jw(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(qw(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ww.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Cw(o)&&Cw(r)&&(r=(0,Ww.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Gw(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Kw(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function qw(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Jw(e){if(!Cw(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Yw(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Xw(e){return xte(e)?e:new Bw(e)}function xte(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ste(e){return typeof e==`string`||Cte(e)}function Cte(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Zw=[],Qw={allowDangerousHtml:!0},wte=/^(https?|ircs?|mailto|xmpp)$/i,Tte=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ete(e){let t=Dte(e),n=Ote(e);return kte(t.runSync(t.parse(n),n),e)}function Dte(e){let t=e.rehypePlugins||Zw,n=e.remarkPlugins||Zw,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qw}:Qw;return bte().use(aC).use(n).use(bw,r).use(t)}function Ote(e){let t=e.children||``,n=new Bw;return typeof t==`string`?n.value=t:``+t,n}function kte(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Ate;for(let e of Tte)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return uw(e,l),Fy(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in rb)if(Object.hasOwn(rb,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=rb[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Ate(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||wte.test(e.slice(0,t))?e:``}function $w(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function jte(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Mte(e,t,n){let r=$C((n||{}).ignore||[]),i=Nte(t),a=-1;for(;++a<i.length;)cw(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Nte(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Pte(e[0]),Fte(e[1])])}return t}function Pte(e){return typeof e==`string`?new RegExp(jte(e),`g`):e}function Fte(e){return typeof e==`function`?e:function(){return e}}var eT=`phrasing`,tT=[`autolink`,`link`,`image`,`label`];function Ite(){return{transforms:[Ute],enter:{literalAutolink:Rte,literalAutolinkEmail:nT,literalAutolinkHttp:nT,literalAutolinkWww:nT},exit:{literalAutolink:Hte,literalAutolinkEmail:Vte,literalAutolinkHttp:zte,literalAutolinkWww:Bte}}}function Lte(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:eT,notInConstruct:tT},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:eT,notInConstruct:tT},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:eT,notInConstruct:tT}]}}function Rte(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function nT(e){this.config.enter.autolinkProtocol.call(this,e)}function zte(e){this.config.exit.autolinkProtocol.call(this,e)}function Bte(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Vte(e){this.config.exit.autolinkEmail.call(this,e)}function Hte(e){this.exit(e)}function Ute(e){Mte(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Wte],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Gte]],{ignore:[`link`,`linkReference`]})}function Wte(e,t,n,r,i){let a=``;if(!rT(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Kte(n)))return!1;let o=qte(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Gte(e,t,n,r){return!rT(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Kte(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function qte(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$w(e,`(`),a=$w(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rT(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ab(n)||kb(n))&&(!t||n!==47)}iT.peek=nne;function Jte(){this.buffer()}function Yte(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Xte(){this.buffer()}function Zte(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Qte(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vb(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $te(e){this.exit(e)}function ene(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vb(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tne(e){this.exit(e)}function nne(){return`[`}function iT(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function rne(){return{enter:{gfmFootnoteCallString:Jte,gfmFootnoteCall:Yte,gfmFootnoteDefinitionLabelString:Xte,gfmFootnoteDefinition:Zte},exit:{gfmFootnoteCallString:Qte,gfmFootnoteCall:$te,gfmFootnoteDefinitionLabelString:ene,gfmFootnoteDefinition:tne}}}function ine(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:iT},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
25
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?aT:ane))),s(),o}}function ane(e,t,n){return t===0?e:aT(e,t,n)}function aT(e,t,n){return(n?``:` `)+e}var one=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];oT.peek=dne;function sne(){return{canContainEols:[`delete`],enter:{strikethrough:lne},exit:{strikethrough:une}}}function cne(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:one}],handlers:{delete:oT}}}function lne(e){this.enter({type:`delete`,children:[]},e)}function une(e){this.exit(e)}function oT(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function dne(){return`~`}function fne(e){return e.length}function pne(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||fne,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=mne(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=sT(r[d]);else{let e=sT(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
26
+ `)}function mne(e){return e==null?``:String(e)}function sT(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function hne(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),gne);return i(),o}function gne(e,t,n){return`>`+(n?``:` `)+e}function _ne(e,t){return cT(e,t.inConstruct,!0)&&!cT(e,t.notInConstruct,!1)}function cT(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function lT(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
27
+ `&&_ne(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
28
+ `}function vne(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function yne(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bne(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function xne(e,t,n,r){let i=bne(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(yne(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Sne);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(vne(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
29
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
30
+ `),a&&(u+=s.move(a+`
31
+ `)),u+=s.move(c),l(),u}function Sne(e,t,n){return(n?``:` `)+e}function uT(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Cne(e,t,n,r){let i=uT(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
32
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function wne(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function dT(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function fT(e,t,n){let r=Bb(e),i=Bb(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}pT.peek=Tne;function pT(e,t,n,r){let i=wne(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=fT(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=dT(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=fT(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+dT(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Tne(e,t,n){return n.options.emphasis||`*`}function Ene(e,t){let n=!1;return uw(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&ab(e)&&(t.options.setext||n))}function Dne(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Ene(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
33
+ `,after:`
34
+ `});return r(),t(),o+`
35
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
36
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
37
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=dT(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}mT.peek=One;function mT(e){return e.value||``}function One(){return`<`}hT.peek=kne;function hT(e,t,n,r){let i=uT(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function kne(){return`!`}gT.peek=Ane;function gT(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ane(){return`!`}_T.peek=jne;function _T(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function jne(){return"`"}function vT(e,t){let n=ab(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yT.peek=Mne;function yT(e,t,n,r){let i=uT(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(vT(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Mne(e,t,n){return vT(e,n)?`<`:`[`}bT.peek=Nne;function bT(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Nne(){return`[`}function xT(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Pne(e){let t=xT(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Fne(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ST(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ine(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Fne(n):xT(n),s=e.ordered?o===`.`?`)`:`.`:Pne(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ST(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Lne(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Rne(e,t,n,r){let i=Lne(n),a=n.bulletCurrent||xT(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function zne(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Bne=$C([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Vne(e,t,n,r){return(e.children.some(function(e){return Bne(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Hne(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}CT.peek=Une;function CT(e,t,n,r){let i=Hne(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=fT(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=dT(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=fT(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+dT(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Une(e,t,n){return n.options.strong||`*`}function Wne(e,t,n,r){return n.safe(e.value,r)}function Gne(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Kne(e,t,n){let r=(ST(n)+(n.options.ruleSpaces?` `:``)).repeat(Gne(n));return n.options.ruleSpaces?r.slice(0,-1):r}var wT={blockquote:hne,break:lT,code:xne,definition:Cne,emphasis:pT,hardBreak:lT,heading:Dne,html:mT,image:hT,imageReference:gT,inlineCode:_T,link:yT,linkReference:bT,list:Ine,listItem:Rne,paragraph:zne,root:Vne,strong:CT,text:Wne,thematicBreak:Kne};function qne(){return{enter:{table:Jne,tableData:ET,tableHeader:ET,tableRow:Xne},exit:{codeText:Zne,table:Yne,tableData:TT,tableHeader:TT,tableRow:TT}}}function Jne(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Yne(e){this.exit(e),this.data.inTable=void 0}function Xne(e){this.enter({type:`tableRow`,children:[]},e)}function TT(e){this.exit(e)}function ET(e){this.enter({type:`tableCell`,children:[]},e)}function Zne(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Qne));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Qne(e,t){return t===`|`?t:e}function $ne(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
38
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
39
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return pne(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=wT.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function ere(){return{exit:{taskListCheckValueChecked:DT,taskListCheckValueUnchecked:DT,paragraph:nre}}}function tre(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:rre}}}function DT(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function nre(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function rre(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=wT.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ire(){return[Ite(),rne(),sne(),qne(),ere()]}function are(e){return{extensions:[Lte(),ine(e),cne(),$ne(e),tre()]}}var ore={tokenize:fre,partial:!0},OT={tokenize:pre,partial:!0},kT={tokenize:mre,partial:!0},AT={tokenize:hre,partial:!0},sre={tokenize:IT,partial:!0},jT={name:`wwwAutolink`,tokenize:ure,previous:LT},MT={name:`protocolAutolink`,tokenize:dre,previous:RT},NT={name:`emailAutolink`,tokenize:lre,previous:zT},PT={};function cre(){return{text:PT}}for(var FT=48;FT<123;)PT[FT]=NT,FT++,FT===58?FT=65:FT===91&&(FT=97);PT[43]=NT,PT[45]=NT,PT[46]=NT,PT[95]=NT,PT[72]=[NT,MT],PT[104]=[NT,MT],PT[87]=[NT,jT],PT[119]=[NT,jT];function lre(e,t,n){let r=this,i,a;return o;function o(t){return!BT(t)||!zT.call(r,r.previous)||VT(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return BT(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(sre,u,l)(t):t===45||t===95||bb(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&yb(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ure(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!LT.call(r,r.previous)||VT(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(ore,e.attempt(OT,e.attempt(kT,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function dre(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&RT.call(r,r.previous)&&!VT(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(yb(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Sb(t)||Db(t)||Ab(t)||kb(t)?n(t):e.attempt(OT,e.attempt(kT,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function fre(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function pre(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(AT,c,s)(t):t===null||Db(t)||Ab(t)||t!==45&&kb(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function mre(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(AT,t,a)(o):o===null||Db(o)||Ab(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function hre(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Db(o)||Ab(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Db(e)||Ab(e)?t(e):r(e)}function a(e){return yb(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):yb(t)?(e.consume(t),o):n(t)}}function IT(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return bb(e)?n(e):t(e)}}function LT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Db(e)}function RT(e){return!yb(e)}function zT(e){return!(e===47||BT(e))}function BT(e){return e===43||e===45||e===46||e===95||bb(e)}function VT(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var HT={tokenize:_re,partial:!0};function UT(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:qT,continuation:{tokenize:JT},exit:gre}},text:{91:{name:`gfmFootnoteCall`,tokenize:KT},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:WT,resolveTo:GT}}}}function WT(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=vb(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function GT(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function KT(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Db(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(vb(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Db(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function qT(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Db(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=vb(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Db(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Nb(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function JT(e,t,n){return e.check(Jb,t,e.attempt(HT,t,n))}function gre(e){e.exit(`gfmFootnoteDefinition`)}function _re(e,t,n){let r=this;return Nb(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function vre(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&db(o,o.length,0,Vb(s,e.slice(r+1,n),t)),db(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),db(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Bb(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Bb(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var yre=class{constructor(){this.map=[]}add(e,t,n){bre(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function bre(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function xre(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function YT(){return{flow:{null:{name:`table`,tokenize:XT,resolveAll:ZT}}}}function XT(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Eb(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Ob(t)?Nb(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Db(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Ob(t)?Nb(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Ob(t)?Nb(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Eb(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Ob(t)?Nb(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Eb(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Eb(n)?(e.exit(`tableRow`),t(n)):Ob(n)?Nb(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Db(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function ZT(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new yre;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&($T(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=QT(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=QT(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=QT(f,t,o,i,n,d)):(o[0]=o[1],d=QT(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&$T(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=xre(t.events,n))}return e}function QT(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},eE(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=eE(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=eE(t.events,n[2]),a=eE(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},eE(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function $T(e,t,n,r,i){let a=[],o=eE(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function eE(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var tE={name:`tasklistCheck`,tokenize:rE};function nE(){return{text:{91:tE}}}function rE(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Db(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Eb(r)?t(r):Ob(r)?e.check({tokenize:iE},t,n)(r):n(r)}}function iE(e,t,n){return Nb(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function aE(e){return mb([cre(),UT(),vre(e),YT(),nE()])}var oE={};function sE(e){let t=this,n=e||oE,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(aE(n)),a.push(ire()),o.push(are(n))}var cE=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),z=I(`#`,`$`),B=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function V(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function H(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function U(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=V,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ee(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function W(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function te(e,t){e.relevance===void 0&&(e.relevance=1)}var ne=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},re=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ie=`keyword`;function ae(e,t,n=ie){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ae(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,oe(n[0],n[1])]})}}function oe(e,t){return t?Number(t):+!se(e)}function se(e){return re.includes(e.toLowerCase())}var ce={},le=e=>{console.error(e)},ue=(e,...t)=>{console.log(`WARN: ${e}`,...t)},de=(e,t)=>{ce[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ce[`${e}/${t}`]=!0)},fe=Error();function pe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function me(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw le(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),fe;if(typeof e.beginScope!=`object`||e.beginScope===null)throw le(`beginScope must be object`),fe;pe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function he(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw le(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),fe;if(typeof e.endScope!=`object`||e.endScope===null)throw le(`endScope must be object`),fe;pe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ge(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function _e(e){ge(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),me(e),he(e)}function ve(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[H,W,_e,ne].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[U,ee,te].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ae(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return be(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function ye(e){return e?e.endsWithParent||ye(e.starts):!1}function be(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ye(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var xe=`11.12.0`,Se=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ce=i,we=a,Te=Symbol(`nomatch`),Ee=7,De=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ue(s.replace(`{}`,n[1])),ue(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(de(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),de(`10.7.0`,`Please use highlight(code, options) instead.
40
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};z(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,z(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ee&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Te;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}if(r.type===`end`){let e=C(r);if(e!==Te)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(P+=`
41
+ `),1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw le(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=ve(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ce(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Ce(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Ce(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Se(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=we(l,e)}let E=()=>{k(),de(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),de(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(le(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)le(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function V(e){return de(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),de(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:V,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:we,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=xe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in B)typeof B[e]==`object`&&n(B[e]);return Object.assign(e,B),e},Oe=De({});Oe.newInstance=()=>De({}),t.exports=Oe,Oe.HighlightJS=Oe,Oe.default=Oe}))()).default;function lE(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:`css`}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:`javascript`}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var uE=`[A-Za-z$_][0-9A-Za-z$_]*`,dE=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),fE=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],pE=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),mE=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],hE=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],gE=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],_E=[].concat(hE,pE,mE);function vE(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=uE,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:uE,keyword:dE,literal:fE,built_in:_E,"variable.language":gE},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...pE,...mE]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...hE,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}var yE=`[A-Za-z$_][0-9A-Za-z$_]*`,bE=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),xE=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],SE=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),CE=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],wE=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],TE=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],EE=[].concat(wE,SE,CE);function Sre(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=yE,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:yE,keyword:bE,literal:xE,built_in:EE,"variable.language":TE},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...SE,...CE]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...wE,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Cre(e){let t=e.regex,n=Sre(e),r=yE,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:yE,keyword:bE.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:xE,built_in:EE.concat(i),"variable.language":TE},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var wre=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:`number`,begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Tre=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Ere=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Dre=[...Tre,...Ere],Ore=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),kre=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Are=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),jre=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.corner-bottom-left-shape.corner-bottom-right-shape.corner-shape.corner-top-left-shape.corner-top-right-shape.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.unicode-range.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Mre(e){let t=e.regex,n=wre(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+kre.join(`|`)+`)`},{begin:`:(:)?(`+Are.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+jre.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Ore.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Dre.join(`|`)+`)\\b`}]}}var Nre={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function DE(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,Nre,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function OE(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function kE(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function AE(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function jE(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ME(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function NE(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}function PE(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function FE(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={scope:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(16|32|64|128))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.raw.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f16`,`f32`,`f64`,`f128`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:`keyword`,3:`keyword`}},{begin:[/fn/,/\s+/,r],scope:{1:`keyword`,3:`title.function`}},{scope:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{scope:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{scope:`punctuation`,begin:`->`},a]}}var IE=`[0-9](_*[0-9])*`,LE=`\\.(${IE})`,RE=`[0-9a-fA-F](_*[0-9a-fA-F])*`,zE={className:`number`,variants:[{begin:`(\\b(${IE})((${LE})|\\.)?|(${LE}))[eE][+-]?(${IE})[fFdD]?\\b`},{begin:`\\b(${IE})((${LE})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${LE})[fFdD]?\\b`},{begin:`\\b(${IE})[fFdD]\\b`},{begin:`\\b0[xX]((${RE})\\.?|(${RE})?\\.(${RE}))[pP][+-]?(${IE})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${RE})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function BE(e,t,n){return n===-1?``:e.replace(t,r=>BE(e,t,n-1))}function VE(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=`(?:(?:\\s*\\[\\s*])+)?`,i=`(?:\\?(?:\\s+(?:extends|super)\\s+[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)?|[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*<@@@>(?:(?:\\s*\\[\\s*])+)?)`,a=BE(`(?:\\s*<\\s*`+i+`(?:\\s*,\\s*`+i+`)*\\s*>)?`,/<@@@>/g,2),o={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},s={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},c={className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{beginKeywords:`new throw return else yield assert`,relevance:0},{begin:[n,t.concat(a,r,/\s+/),n,r,/\s*/,/=(?!=)/],className:{1:`type`,3:`variable`,6:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(a,r,/\s+/),n,/\s*(?=\()/],className:{1:`type`,3:`title.function`},keywords:o,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,zE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},zE,s]}}cE.registerLanguage(`xml`,lE),cE.registerLanguage(`javascript`,vE),cE.registerLanguage(`typescript`,Cre),cE.registerLanguage(`css`,Mre),cE.registerLanguage(`json`,DE),cE.registerLanguage(`python`,OE),cE.registerLanguage(`bash`,kE),cE.registerLanguage(`shell`,AE),cE.registerLanguage(`markdown`,jE),cE.registerLanguage(`sql`,ME),cE.registerLanguage(`yaml`,NE),cE.registerLanguage(`go`,PE),cE.registerLanguage(`rust`,FE),cE.registerLanguage(`java`,VE);var HE={html:`xml`,htm:`xml`,xhtml:`xml`,svg:`xml`,vue:`xml`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,node:`javascript`,ts:`typescript`,tsx:`typescript`,scss:`css`,less:`css`,jsonc:`json`,json5:`json`,py:`python`,python3:`python`,sh:`bash`,zsh:`bash`,console:`shell`,shellsession:`shell`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`};function UE(e){let t=(e??``).trim().toLowerCase();if(!t)return null;let n=HE[t]??t;return cE.getLanguage(n)?n:null}function WE(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function GE(e,t){let n=UE(t);try{if(n)return{html:cE.highlight(e,{language:n,ignoreIllegals:!0}).value,language:n};if(e.length<=2e4){let t=cE.highlightAuto(e);if(t.language&&t.relevance>=5)return{html:t.value,language:t.language}}}catch{}return{html:WE(e),language:null}}function KE({code:e,language:t,className:n}){let{html:r,language:i}=(0,v.useMemo)(()=>GE(e,t),[e,t]);return(0,G.jsx)(`code`,{className:Zc(`code-highlight block font-mono text-[12.5px] leading-relaxed whitespace-pre`,n),"data-language":i??void 0,dangerouslySetInnerHTML:{__html:r}})}var qE=/^([ \t]{0,3})(`{3,}|~{3,})[ \t]*([^\s`]*)[^\n]*\n([\s\S]*?)\n[ \t]{0,3}\2[ \t]*$/gm;function JE(e,t){let n=e.toLowerCase(),r=t.slice(0,400).trimStart().toLowerCase();return n===`svg`||r.startsWith(`<svg`)&&(n===``||n===`xml`||n===`html`)?`svg`:n===`html`||n===`htm`||n===`xhtml`||(n===``||n===`xml`||n===`markup`)&&(r.startsWith(`<!doctype html`)||r.startsWith(`<html`))?`html`:null}function YE(e,t){return/<title[^>]*>([^<]{1,120})<\/title>/i.exec(t)?.[1]?.trim()||null}function XE(e,t=0){let n=[],r=0;for(let i of e.matchAll(qE)){let e=(i[3]??``).toLowerCase(),a=i[4]??``;r+=1;let o=JE(e,a);o&&n.push({id:`${t}:${r}`,kind:o,language:e,code:a,title:YE(o,a),filename:o===`svg`?`artifact-${r}.svg`:`artifact-${r}.html`})}return n}function ZE(e){return e.kind===`html`?e.code:`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;height:100%;background:#fff}body{display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}svg{max-width:100%;max-height:100%}</style></head><body>${e.code}</body></html>`}var QE=`allow-scripts allow-forms allow-modals allow-popups allow-pointer-lock`;function $E(e){return e===`svg`?`image/svg+xml`:`text/html`}var eD=(0,v.createContext)(null);function tD(e){let t=Array.isArray(e)?e[0]:e;if(!(0,v.isValidElement)(t))return``;let n=t.props.className??``;return/language-([^\s]+)/.exec(n)?.[1]?.toLowerCase()??``}function nD({kind:e,language:t,code:n}){let{t:r}=Z(),i=(0,v.useContext)(eD),a=i.activeCode===n,o=/<title[^>]*>([^<]{1,120})<\/title>/i.exec(n)?.[1]?.trim()||r(e===`svg`?`playground.artifactSvg`:`playground.artifactHtml`),s=e===`svg`?na:di;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i.open(e,t,n),className:Zc(`group/artifact my-2 flex w-full max-w-md items-center gap-3 rounded-xl border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted/60 first:mt-0 last:mb-0`,a&&`border-foreground/40`),"aria-pressed":a,children:[(0,G.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,G.jsx)(s,{className:`size-4`})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:o}),(0,G.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[r(`playground.artifactOpen`),` · `,n.split(`
42
+ `).length,` `,r(`playground.artifactLines`)]})]})]})}function rD(e){return e==null||typeof e==`boolean`?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(rD).join(``):(0,v.isValidElement)(e)?rD(e.props.children):``}function iD({children:e}){if((0,v.useContext)(eD)){let t=tD(e),n=rD(e).replace(/\n$/,``),r=JE(t,n);if(r)return(0,G.jsx)(nD,{kind:r,language:t,code:n})}return(0,G.jsxs)(`pre`,{className:`group relative my-2 overflow-x-auto rounded-lg border bg-background/60 p-3 first:mt-0 last:mb-0`,children:[(0,G.jsx)(vv,{text:rD(e).replace(/\n$/,``),label:`Copy code`,className:`absolute right-2 top-2 size-7 opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100`}),e]})}var aD={p:({children:e})=>(0,G.jsx)(`p`,{className:`my-2 first:mt-0 last:mb-0 whitespace-pre-wrap wrap-break-word`,children:e}),a:({children:e,href:t})=>(0,G.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer noopener`,className:`underline underline-offset-2 decoration-foreground/40 hover:decoration-foreground wrap-break-word`,children:e}),h1:({children:e})=>(0,G.jsx)(`h1`,{className:`mt-4 mb-2 text-base font-semibold tracking-tight first:mt-0`,children:e}),h2:({children:e})=>(0,G.jsx)(`h2`,{className:`mt-4 mb-2 text-sm font-semibold tracking-tight first:mt-0`,children:e}),h3:({children:e})=>(0,G.jsx)(`h3`,{className:`mt-3 mb-1.5 text-sm font-semibold first:mt-0`,children:e}),h4:({children:e})=>(0,G.jsx)(`h4`,{className:`mt-3 mb-1.5 text-sm font-semibold first:mt-0`,children:e}),ul:({children:e})=>(0,G.jsx)(`ul`,{className:`my-2 ml-5 list-disc space-y-1 [&_ul]:my-1 [&_ol]:my-1 first:mt-0 last:mb-0`,children:e}),ol:({children:e})=>(0,G.jsx)(`ol`,{className:`my-2 ml-5 list-decimal space-y-1 [&_ul]:my-1 [&_ol]:my-1 first:mt-0 last:mb-0`,children:e}),li:({children:e})=>(0,G.jsx)(`li`,{className:`leading-relaxed`,children:e}),blockquote:({children:e})=>(0,G.jsx)(`blockquote`,{className:`my-2 border-l-2 border-foreground/20 pl-3 italic text-foreground/80 first:mt-0 last:mb-0`,children:e}),hr:()=>(0,G.jsx)(`hr`,{className:`my-3 border-foreground/15`}),strong:({children:e})=>(0,G.jsx)(`strong`,{className:`font-semibold`,children:e}),em:({children:e})=>(0,G.jsx)(`em`,{className:`italic`,children:e}),del:({children:e})=>(0,G.jsx)(`del`,{className:`opacity-70`,children:e}),table:({children:e})=>(0,G.jsx)(`div`,{className:`my-2 overflow-x-auto first:mt-0 last:mb-0`,children:(0,G.jsx)(`table`,{className:`w-full border-collapse text-xs`,children:e})}),thead:({children:e})=>(0,G.jsx)(`thead`,{className:`bg-background/40`,children:e}),th:({children:e,style:t})=>(0,G.jsx)(`th`,{style:t,className:`border border-foreground/15 px-2 py-1 text-left font-semibold`,children:e}),td:({children:e,style:t})=>(0,G.jsx)(`td`,{style:t,className:`border border-foreground/15 px-2 py-1 align-top`,children:e}),code:({className:e,children:t,...n})=>{if(/language-/.test(e??``)){let n=/language-([^\s]+)/.exec(e??``)?.[1]??null;return(0,G.jsx)(KE,{code:rD(t).replace(/\n$/,``),language:n,className:e})}return(0,G.jsx)(`code`,{className:`rounded bg-background/60 px-1 py-0.5 font-mono text-[0.85em] wrap-break-word`,...n,children:t})},pre:({children:e})=>(0,G.jsx)(iD,{children:e})};function oD({children:e,className:t}){return(0,G.jsx)(`div`,{className:Zc(`text-sm leading-relaxed`,t),children:(0,G.jsx)(Ete,{remarkPlugins:[sE],components:aD,children:e})})}var sD=(0,v.memo)(oD),cD=864e5,lD=`srouter.update_reminder`,uD=`srouter:update-check-changed`;function dD(e,t){let n=e.replace(/^v/,``).split(`.`).map(e=>parseInt(e,10)||0),r=t.replace(/^v/,``).split(`.`).map(e=>parseInt(e,10)||0);for(let e=0;e<Math.max(n.length,r.length);e++){let t=(n[e]??0)-(r[e]??0);if(t!==0)return t}return 0}function fD(){try{let e=window.localStorage.getItem(lD);return e?JSON.parse(e):null}catch{return null}}function pD(e){try{window.localStorage.setItem(lD,JSON.stringify(e))}catch{}}function mD(){let{t:e}=Z(),t=typeof window<`u`?window.__SROUTER_VERSION__??null:null,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(0),f=t??n,p=(0,v.useRef)(!1);(0,v.useEffect)(()=>{p.current=o},[o]),(0,v.useEffect)(()=>{function e(){d(e=>e+1)}return window.addEventListener(uD,e),()=>window.removeEventListener(uD,e)},[]),(0,v.useEffect)(()=>{if(t)return;let e=!1;return X(`/api/settings/version`).then(t=>{e||r(t.version??null)}).catch(()=>{}),()=>{e=!0}},[t]),(0,v.useEffect)(()=>{if(!f)return;let e=!1,t=f,n=u>0;async function r(){try{let r=fD(),i=!n&&r!=null&&Date.now()-r.checkedAt<cD&&r.release!=null,o=i?r.release:null;if(!i){let t=await X(`/api/update/release`);if(e)return;if(`disabled`in t){a(null),pD({checkedAt:Date.now(),release:null,dismissedTag:r?.dismissedTag??null});return}o={...t,tagName:t.tagName.replace(/^v/,``)},pD({checkedAt:Date.now(),release:o,dismissedTag:r?.dismissedTag??null})}if(!o||dD(o.tagName,t)<=0||e||p.current)return;l(r?.dismissedTag??null),a(o)}catch{}}return r(),()=>{e=!0}},[f,u]);function m(e){l(e);let t=fD();pD({checkedAt:t?.checkedAt??Date.now(),release:t?.release??null,dismissedTag:e})}if(!i||c===i.tagName)return null;let h=i.publishedAt?new Date(i.publishedAt).toLocaleDateString():null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(!0),className:`fixed bottom-6 left-4 z-[60] flex max-w-[calc(100vw-2rem)] items-center gap-2 rounded-full border bg-card px-4 py-2 text-sm shadow-lg ring-1 ring-foreground/10 outline-none transition-all duration-150 hover:scale-[1.02] hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 sm:left-6`,children:[(0,G.jsx)(Pa,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:`truncate`,children:[e(`update.available`),` `,(0,G.jsxs)(`span`,{className:`font-semibold tabular-nums`,children:[`v`,f]}),(0,G.jsx)(gi,{className:`ml-1 inline size-3.5`,"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:`font-semibold tabular-nums`,children:[`v`,i.tagName]})]}),(0,G.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":e(`update.dismiss`),onClick:e=>{e.stopPropagation(),m(i.tagName)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.stopPropagation(),m(i.tagName))},className:`ml-1 inline-flex shrink-0 rounded-full text-muted-foreground/70 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-3.5`,"aria-hidden":!0})})]}),(0,G.jsx)(kv,{open:o,onOpenChange:s,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Mv,{children:e(`update.whatsNew`,{version:i.tagName})}),h&&(0,G.jsx)(lte,{className:`mt-1`,children:e(`update.publishedOn`,{date:h})})]}),(0,G.jsx)(Av,{className:`rounded-full p-1 text-muted-foreground/70 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`,"aria-hidden":!0})})]}),i.body?(0,G.jsx)(`div`,{className:`max-h-[45vh] overflow-y-auto rounded-xl border bg-muted/20 p-4`,children:(0,G.jsx)(sD,{children:i.body})}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`update.noNotes`)}),(0,G.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-3`,children:[(0,G.jsxs)(`a`,{href:i.htmlUrl,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1.5 rounded-lg bg-primary px-3.5 py-2 text-sm font-medium text-primary-foreground outline-none transition-opacity hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50`,children:[e(`update.openRelease`),(0,G.jsx)(gi,{className:`size-4`,"aria-hidden":!0})]}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>m(i.tagName),className:`rounded-lg border px-3.5 py-2 text-sm outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50`,children:e(`update.dismissVersion`)})]})]})})]})}var hD=v.createContext(void 0);function gD(){let e=v.useContext(hD);if(e===void 0)throw Error(Uo(63));return e}var _D=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),vD={...S_,checked(e){return e?{[_D.checked]:``}:{[_D.unchecked]:``}}},yD=v.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:y,...b}=e,{clearErrors:x}=D_(),{state:S,setTouched:C,setDirty:w,validityData:T,setFilled:E,setFocused:D,shouldValidateOnChange:O,validationMode:k,disabled:A,name:j,validation:M}=T_(),{labelId:N}=k_(),P=A||m,F=j??l,I=v.useRef(null),L=Xo(I,c,M.inputRef),R=v.useRef(null),z=cu(),B=N_({id:s,implicit:!1,controlRef:R}),V=u?void 0:B,[H,U]=Fl({controlled:n,default:!!i,name:`Switch`,state:`checked`});P_(R,z,H),q(()=>{I.current&&E(I.current.checked)},[I,E]),Sg(H,()=>{x(F),w(H!==T.initialValue),E(H),O()?M.commit(H):M.commit(H,!0)});let{getButtonProps:ee,buttonRef:W}=qo({disabled:P,native:u}),te=A_(a,N,I,!u,V),ne={id:u?B:z,role:`switch`,"aria-checked":H,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":te,onFocus(){P||D(!0)},onBlur(){let e=I.current;!e||P||(C(!0),D(!1),k===`onBlur`&&M.commit(e.checked))},onClick(e){if(f||P)return;e.preventDefault();let t=I.current;t&&t.dispatchEvent(new(Ja(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},re=Oo({checked:H,disabled:P,form:o,id:V,name:F,required:p,style:F?fd:dd,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:L,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=du(xl,e.nativeEvent);d?.(t,n),!n.isCanceled&&U(t)},onFocus(){R.current?.focus()}},M.getInputValidationProps,_===void 0?ss:{value:_}),ie=v.useMemo(()=>({...S,checked:H,disabled:P,readOnly:f,required:p}),[S,H,P,f,p]),ae=ds(`span`,e,{state:ie,ref:[t,R,W],props:[ne,M.getValidationProps,b,ee],stateAttributesMapping:vD});return(0,G.jsxs)(hD.Provider,{value:ie,children:[ae,!H&&F&&g!==void 0&&(0,G.jsx)(`input`,{type:`hidden`,form:o,name:F,value:g}),(0,G.jsx)(`input`,{...re,suppressHydrationWarning:!0})]})}),bD=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return ds(`span`,e,{state:gD(),ref:t,stateAttributesMapping:vD,props:a})});function xD({className:e,size:t=`default`,...n}){return(0,G.jsx)(yD,{"data-slot":`switch`,"data-size":t,className:Zc(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,G.jsx)(bD,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}function SD({text:e,children:t,side:n=`top`,className:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);function s(){let e=i.current;if(!e)return;let t=e.getBoundingClientRect(),r=Math.min(Math.max(t.left+t.width/2,124),window.innerWidth-116-8);o({x:r,y:n===`top`?t.top:t.bottom})}let c=()=>o(null);return(0,v.useEffect)(()=>{if(!a)return;let e=e=>{let t=i.current;if(!t)return;let n=t.getBoundingClientRect();e.clientX>=n.left-4&&e.clientX<=n.right+4&&e.clientY>=n.top-4&&e.clientY<=n.bottom+4||c()},t=()=>c(),n=e=>{e.key===`Escape`&&c()};return document.addEventListener(`mousemove`,e),document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,n)}},[a]),(0,G.jsxs)(`span`,{ref:i,className:r??`inline-flex`,onMouseEnter:s,onMouseLeave:c,onFocus:s,onBlur:c,children:[t,a&&(0,xu.createPortal)((0,G.jsx)(`span`,{role:`tooltip`,style:{position:`fixed`,left:a.x,top:n===`top`?a.y-8:a.y+8,transform:n===`top`?`translate(-50%, -100%)`:`translate(-50%, 0)`,zIndex:9999},className:`pointer-events-none w-56 rounded-lg bg-foreground px-2.5 py-1.5 text-xs leading-snug text-background shadow-md whitespace-pre-line`,children:e}),document.body)]})}function CD({text:e}){return(0,G.jsx)(SD,{text:e,children:(0,G.jsx)(`button`,{type:`button`,"aria-label":e,onClick:e=>e.preventDefault(),className:`inline-flex rounded-full text-muted-foreground/70 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(ra,{className:`size-3.5`})})})}function wD({label:e,hint:t,control:n,children:r}){return(0,G.jsx)(`div`,{className:`border-b border-border/60 py-4 last:border-b-0 last:pb-0`,children:(0,G.jsxs)(`div`,{className:n?`flex flex-wrap items-center justify-between gap-x-6 gap-y-2`:`space-y-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:e}),t&&(0,G.jsx)(CD,{text:t})]}),n??r]})})}function TD({title:e,description:t,hint:n}){return(0,G.jsxs)(`div`,{className:`mb-5 space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`h2`,{className:`font-heading text-base leading-snug font-medium`,children:e}),n&&(0,G.jsx)(CD,{text:n})]}),t&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:t})]})}function ED({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":r,className:`grid gap-1 rounded-xl border p-1 ${i??``}`,children:n.map(n=>{let r=n.icon,i=e===n.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,onClick:()=>t(n.value),className:`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-lg px-2 py-1.5 text-xs transition-colors ${i?`bg-primary font-medium text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`}`,children:[r&&(0,G.jsx)(r,{className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:n.label})]},n.value)})})}function DD(){let{locale:e,setLocale:t,t:n}=Z(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(0),l=(0,v.useMemo)(()=>{let t=new Intl.Collator(e,{sensitivity:`base`});return U_.map(e=>({code:e,name:n(`languages.${e}`)})).sort((e,n)=>t.compare(e.name,n.name))},[e,n]),u=a.trim().toLocaleLowerCase(e),d=u?l.filter(({code:t,name:n})=>`${n} ${t}`.toLocaleLowerCase(e).includes(u)):l,f=l.find(t=>t.code===e)?.name??e;function p(e){t(e),i(!1),o(``)}function m(e){e.key===`ArrowDown`?(e.preventDefault(),c(e=>Math.min(e+1,d.length-1))):e.key===`ArrowUp`?(e.preventDefault(),c(e=>Math.max(e-1,0))):e.key===`Enter`&&d[s]&&(e.preventDefault(),p(d[s].code))}return(0,G.jsxs)(s_,{open:r,onOpenChange:e=>{i(e),o(``),c(0)},children:[(0,G.jsxs)(c_,{"aria-label":n(`settings.language`),className:`flex h-9 w-full items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-3 text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 sm:w-64 dark:bg-input/30`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:f}),(0,G.jsx)(ji,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,G.jsxs)(l_,{align:`start`,className:`w-[min(340px,calc(100vw-3rem))] p-0`,onKeyDown:m,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3`,children:[(0,G.jsx)(Aa,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`input`,{autoFocus:!0,value:a,onChange:e=>{o(e.target.value),c(0)},placeholder:n(`settings.searchLanguage`),"aria-label":n(`settings.searchLanguage`),role:`combobox`,"aria-expanded":`true`,"aria-controls":`settings-language-list`,"aria-activedescendant":d[s]?`settings-language-${d[s].code}`:void 0,className:`h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,G.jsx)(`div`,{id:`settings-language-list`,role:`listbox`,className:`max-h-72 overflow-y-auto p-1`,children:d.length===0?(0,G.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:n(`settings.noLanguages`)}):d.map((t,n)=>(0,G.jsxs)(`button`,{id:`settings-language-${t.code}`,type:`button`,role:`option`,"aria-selected":t.code===e,onMouseEnter:()=>c(n),onClick:()=>p(t.code),className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-start text-sm transition-colors hover:bg-accent hover:text-accent-foreground ${t.code===e?`bg-accent/50`:n===s?`bg-muted`:``}`,children:[(0,G.jsx)(wi,{className:`size-4 shrink-0 ${t.code===e?`opacity-100`:`opacity-0`}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.name}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground`,children:t.code})]},t.code))})]})]})}var OD={system:_a,light:za,dark:va},kD=[{id:`dedup`,tKey:`engineDedup`,lossless:!0},{id:`lite`,tKey:`engineLite`,lossless:!0},{id:`read-lifecycle`,tKey:`engineReadLifecycle`,lossless:!1},{id:`toolfilter`,tKey:`engineToolfilter`,lossless:!1},{id:`jsoncompact`,tKey:`engineJsoncompact`,lossless:!0},{id:`relevance`,tKey:`engineRelevance`,lossless:!1},{id:`aging`,tKey:`engineAging`,lossless:!1},{id:`hard-budget`,tKey:`engineHardBudget`,lossless:!1}],AD=[{id:`general`,tKey:`sectionGeneral`,icon:Na},{id:`compression`,tKey:`sectionCompression`,icon:$i},{id:`advanced`,tKey:`sectionAdvanced`,icon:Ua},{id:`preview`,tKey:`sectionPreview`,icon:Qi}];function jD(e){let{t}=Z(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(`load`),[c,l]=(0,v.useState)(``);return(0,v.useEffect)(()=>{if(!e)return;let n=!1;return Promise.all([X(`/api/settings/compression`),X(`/api/compression/stats`)]).then(([e,t])=>{n||(r(e),a(t),l(``))}).catch(e=>{n||l(e instanceof Error?e.message:t(`common.unknownError`))}).finally(()=>{n||s(null)}),()=>{n=!0}},[e,t]),{config:n,stats:i,busy:o,setBusy:s,error:c,setError:l,patch:(0,v.useCallback)(e=>{r(t=>t&&{...t,...e})},[]),setEngineEnabled:(0,v.useCallback)((e,t)=>{r(n=>n&&{...n,engines:{...n.engines,[e]:{...n.engines[e]??{},enabled:t}}})},[]),save:(0,v.useCallback)(async()=>{if(n){s(`save`),l(``);try{r(await X(`/api/settings/compression`,{method:`PUT`,body:JSON.stringify(n)}))}catch(e){l(e instanceof Error?e.message:t(`common.unknownError`))}finally{s(null)}}},[n,t])}}function MD({state:e}){let{t}=Z(),{config:n,patch:r,setEngineEnabled:i}=e;if(!n)return null;let a=[{value:`off`,label:t(`settings.compressionOff`)},{value:`lossless`,label:t(`settings.compressionLossless`)},{value:`standard`,label:t(`settings.compressionStandard`)},{value:`aggressive`,label:t(`settings.compressionAggressive`)}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(TD,{title:t(`settings.compressionTitle`),description:t(`settings.compressionDescription`),hint:t(`settings.compressionHelp`)}),(0,G.jsx)(wD,{label:t(`settings.compressionMode`),hint:t(`settings.compressionModeHelp`),children:(0,G.jsx)(ED,{value:n.mode,onValueChange:e=>r({mode:e}),options:a,ariaLabel:t(`settings.compressionMode`),className:`grid-cols-2 sm:grid-cols-4`})}),(0,G.jsx)(wD,{label:t(`settings.compressionEngines`),hint:t(`settings.compressionEnginesHelp`),children:(0,G.jsx)(`ul`,{className:`grid gap-2 sm:grid-cols-2`,children:kD.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start justify-between gap-3 rounded-xl border px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t(`settings.${e.tKey}`)}),(0,G.jsx)(CD,{text:t(`settings.${e.tKey}Help`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-mono`,children:e.id}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsx)(`span`,{children:e.lossless?t(`settings.compressionLossless`):t(`settings.compressionLossy`)})]})]}),(0,G.jsx)(xD,{size:`sm`,"aria-label":t(`settings.${e.tKey}`),checked:n.engines[e.id]?.enabled??!0,onCheckedChange:t=>i(e.id,t),className:`mt-0.5`})]},e.id))})})]})}function ND({state:e}){let{t}=Z(),{config:n,patch:r}=e;return n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(TD,{title:t(`settings.sectionAdvanced`),description:t(`settings.advancedDescription`)}),(0,G.jsx)(wD,{label:t(`settings.compressionAutoTrigger`),hint:t(`settings.compressionAutoTriggerHelp`),control:(0,G.jsx)(`input`,{type:`number`,min:1,value:n.autoTriggerEstTokens??``,onChange:e=>r({autoTriggerEstTokens:e.target.value?Number(e.target.value):null}),placeholder:`32000`,"aria-label":t(`settings.compressionAutoTrigger`),className:`h-9 w-32 rounded-lg border border-input bg-transparent px-3 font-mono text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30`})}),(0,G.jsx)(wD,{label:t(`settings.compressionPrefixFreeze`),hint:t(`settings.compressionPrefixFreezeHelp`),control:(0,G.jsx)(xD,{"aria-label":t(`settings.compressionPrefixFreeze`),checked:n.prefixFreeze,onCheckedChange:e=>r({prefixFreeze:e})})}),(0,G.jsx)(wD,{label:t(`settings.compressionTrustProjectFilters`),hint:t(`settings.compressionTrustProjectFiltersHelp`),control:(0,G.jsx)(xD,{"aria-label":t(`settings.compressionTrustProjectFilters`),checked:n.trustProjectFilters,onCheckedChange:e=>r({trustProjectFilters:e})})})]}):null}function PD({state:e}){let{t}=Z(),{config:n,stats:r,busy:i,setBusy:a,setError:o}=e,[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``);async function d(){if(!(!n||!s.trim())){a(`preview`),o(``);try{let e=s;try{e=JSON.parse(s)}catch{}let t=await X(`/api/compression/preview`,{method:`POST`,body:JSON.stringify({mode:n.mode,...e&&typeof e==`object`&&`messages`in e?e:{body:s}})});u(`${JSON.stringify(t.compressed,null,2)}\n\n~${t.stats.estSavedTokens} tokens saved`)}catch(e){o(e instanceof Error?e.message:t(`common.unknownError`))}finally{a(null)}}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(TD,{title:t(`settings.compressionPreview`),description:t(`settings.compressionPreviewDescription`)}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,G.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),placeholder:t(`settings.compressionPreviewPlaceholder`),"aria-label":t(`settings.compressionPreview`),className:`min-h-32 resize-y rounded-xl border border-input bg-transparent p-3 font-mono text-[11px] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30`}),(0,G.jsx)(`pre`,{className:`max-h-52 min-h-32 overflow-auto rounded-xl border bg-muted/30 p-3 text-[11px] whitespace-pre-wrap text-muted-foreground`,children:l})]}),(0,G.jsx)(`button`,{type:`button`,onClick:d,disabled:!s.trim()||i!==null,className:`rounded-lg border px-3 py-1.5 text-xs transition-colors outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:t(i===`preview`?`common.applying`:`settings.compressionRunPreview`)})]}),r&&(0,G.jsxs)(`dl`,{className:`mt-6 grid grid-cols-3 divide-x rounded-xl border py-3 text-center`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dd`,{className:`text-base font-semibold`,children:r.requests}),(0,G.jsx)(`dt`,{className:`text-[10px] text-muted-foreground`,children:t(`analytics.requests`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`dd`,{className:`text-base font-semibold`,children:[`~`,r.estSavedTokens]}),(0,G.jsx)(`dt`,{className:`text-[10px] text-muted-foreground`,children:t(`settings.compressionEstimatedTokensSaved`)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`dd`,{className:`text-base font-semibold`,children:[r.savingsPercent,`%`]}),(0,G.jsx)(`dt`,{className:`text-[10px] text-muted-foreground`,children:t(`settings.compressionStats`)})]})]})]})}function FD(){let{t:e}=Z(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!0);(0,v.useEffect)(()=>{X(`/api/settings/sync-schedule`).then(e=>n(e.interval)).catch(()=>n(`off`)).finally(()=>i(!1))},[]);function a(e){let t=e;n(t),X(`/api/settings/sync-schedule`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({interval:t})}).catch(()=>{n(e=>e??`off`)})}return r?null:(0,G.jsx)(wD,{label:e(`settings.syncSchedule`),hint:e(`settings.syncScheduleHint`),control:(0,G.jsx)(ED,{value:String(t??`off`),onValueChange:a,options:[{value:`off`,label:e(`settings.syncIntervalOff`),icon:yi},{value:`6`,label:`6h`,icon:Bi},{value:`12`,label:`12h`,icon:Bi},{value:`24`,label:`24h`,icon:Bi}],ariaLabel:e(`settings.syncSchedule`),className:`w-full grid-cols-4 sm:w-72`})})}function ID({active:e}){let{t}=Z(),{theme:n,setTheme:r}=Cv();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(TD,{title:t(`settings.sectionGeneral`),description:t(`settings.generalDescription`)}),(0,G.jsx)(wD,{label:t(`settings.language`),control:(0,G.jsx)(DD,{})}),(0,G.jsx)(wD,{label:t(`settings.theme`),control:(0,G.jsx)(ED,{value:n,onValueChange:r,options:[{value:`system`,label:t(`settings.themeSystem`)},{value:`light`,label:t(`settings.themeLight`)},{value:`dark`,label:t(`settings.themeDark`)}].map(e=>({...e,icon:OD[e.value]})),ariaLabel:t(`settings.theme`),className:`w-full grid-cols-3 sm:w-64`})}),(0,G.jsx)(FD,{}),(0,G.jsx)(RD,{active:e})]})}function LD(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(t,{dateStyle:`medium`,timeStyle:`short`}).format(n)}catch{return null}}function RD({active:e}){let{locale:t,t:n}=Z(),r=typeof window<`u`?window.__SROUTER_VERSION__??null:null,[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(!e)return;let t=!1;return X(`/api/settings/update-check`).then(e=>{t||b(e.enabled)}).catch(()=>{}),()=>{t=!0}},[e]);async function x(e){let t=y;b(e);try{let t=await X(`/api/settings/update-check`,{method:`PUT`,body:JSON.stringify({enabled:e})});b(t.enabled),window.dispatchEvent(new Event(uD))}catch{b(t)}}(0,v.useEffect)(()=>{if(!e)return;let t=!1;return X(`/api/update/status`).then(e=>{t||a(e)}).catch(()=>{t||p(!0)}).finally(()=>{t||l(!1)}),()=>{t=!0}},[e]);async function S(){d(!0),p(!1),s(null),_([i?.localSha?`${n(`settings.currentVersion`)} ${i.localSha}`:n(`settings.notGitInstall`),n(`keys.checking`)]);try{let e=await X(`/api/update/check`);s(e),a({status:e.status,installation:e.installation,localSha:e.localSha,lastChecked:e.checkedAt,version:e.version,releasesUrl:i?.releasesUrl??null});let t=e.status===`available`?n(`settings.updateAvailable`):e.status===`current`?n(`settings.upToDate`):e.status===`ahead`?n(`settings.buildAhead`):e.status===`diverged`?n(`settings.buildDiverged`):e.status===`unknown`?n(`settings.buildUnknown`):n(`settings.notGitInstall`);_(e=>[e[0],t])}catch{p(!0),_(e=>e.slice(0,1))}finally{d(!1)}}function C(){h(!0),S()}let w=o,T=w?.localSha??i?.localSha,E=r??w?.version??i?.version??null,D=LD(o?.checkedAt,t),O=LD(o?.remoteDate,t),k=w?.status===`current`?n(`settings.upToDate`):w?.status===`ahead`?n(`settings.buildAhead`):w?.status===`diverged`?n(`settings.buildDiverged`):w?.status===`unknown`?n(`settings.buildUnknown`):w?.status===`unsupported`?n(`settings.notGitInstall`):null,A=w?.status??i?.status;return c&&!i||i?.status===`disabled`||!E&&!T?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(wD,{label:`SRouter`,hint:n(`settings.contactsGithub`),control:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-sm tabular-nums`,children:[E?(0,G.jsxs)(`span`,{children:[`v`,E]}):(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:T}),A===`available`&&(0,G.jsxs)(`button`,{type:`button`,onClick:C,title:n(`settings.updateAvailable`),className:`flex items-center gap-1 text-primary underline underline-offset-2`,children:[(0,G.jsx)(hi,{className:`size-3.5`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:w?.remoteSha?`font-mono`:void 0,children:w?.remoteSha??n(`settings.updateAvailable`)})]}),A===`current`&&(0,G.jsx)(wi,{className:`size-4 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),f&&i?.releasesUrl&&(0,G.jsx)(`a`,{href:i.releasesUrl,target:`_blank`,rel:`noreferrer noopener`,title:i.releasesUrl,className:`text-primary underline underline-offset-2`,children:i.releasesUrl.replace(`https://`,``)}),(0,G.jsx)(`button`,{type:`button`,onClick:C,disabled:c||u,title:n(`settings.checkForUpdates`),"aria-label":n(`settings.checkForUpdates`),className:`inline-flex rounded-full text-muted-foreground/70 outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,G.jsx)(Ea,{className:`size-3.5 ${u?`animate-spin`:``}`,"aria-hidden":!0})})]})}),y!==null&&(0,G.jsx)(wD,{label:n(`settings.autoUpdateCheck`),hint:n(`settings.autoUpdateCheckHelp`),control:(0,G.jsx)(xD,{"aria-label":n(`settings.autoUpdateCheck`),checked:y,onCheckedChange:e=>void x(e)})}),(0,G.jsx)(kv,{open:m,onOpenChange:h,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,className:`p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b px-6 py-5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary`,children:(0,G.jsx)(Ea,{className:`size-4 ${u?`animate-spin`:``}`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Mv,{children:n(`settings.updatesTitle`)}),(E||T)&&(0,G.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:[n(`settings.currentVersion`),` `,(0,G.jsx)(`code`,{className:`font-mono`,children:[E?`v${E}`:null,T].filter(Boolean).join(` · `)})]})]})]}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-me-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{"aria-live":`polite`,className:`space-y-4 px-6 py-5`,children:[g.length>0&&(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl border bg-[oklch(0.17_0.028_255)] text-[oklch(0.87_0.018_255)] shadow-inner dark:bg-black/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-white/10 px-3 py-2 text-[11px] text-[oklch(0.74_0.025_255)]`,children:[(0,G.jsx)(La,{className:`size-3.5`}),(0,G.jsx)(`span`,{children:n(u?`keys.checking`:`settings.updatesTitle`)})]}),(0,G.jsx)(`div`,{className:`space-y-1.5 px-3 py-3 font-mono text-[11px] leading-relaxed`,children:g.map((e,t)=>(0,G.jsxs)(`p`,{className:`flex gap-2 break-words [overflow-wrap:anywhere]`,children:[(0,G.jsx)(`span`,{className:t===g.length-1&&u?`text-amber-400`:`text-emerald-400`,children:`>`}),(0,G.jsx)(`span`,{children:e})]},`${t}-${e}`))})]}),w?.status===`available`&&(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-primary/25 bg-primary/5 p-4`,children:[(0,G.jsx)(Pa,{className:`mt-0.5 size-5 shrink-0 text-primary`}),(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:n(`settings.updateAvailable`)}),w.remoteMessage&&(0,G.jsx)(`p`,{className:`break-words text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:w.remoteMessage}),(w.remoteSha||O)&&(0,G.jsx)(`p`,{className:`break-all font-mono text-[11px] text-muted-foreground`,children:[w.remoteSha,O].filter(Boolean).join(` · `)})]})]}),w.changes&&w.changes.length>0&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,G.jsx)(wi,{className:`size-3.5`}),n(`settings.changelog`)]}),(0,G.jsx)(`ol`,{className:`max-h-52 divide-y overflow-y-auto rounded-xl border`,children:w.changes.map(e=>{let n=LD(e.date,t);return(0,G.jsxs)(`li`,{className:`flex gap-3 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-primary`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`break-words text-xs [overflow-wrap:anywhere]`,children:e.message}),(0,G.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[e.sha,n].filter(Boolean).join(` · `)})]})]},e.sha)})})]}),w.installation===`docker`&&(0,G.jsxs)(`div`,{className:`flex gap-2 rounded-xl border bg-muted/30 p-3`,children:[(0,G.jsx)(La,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`code`,{className:`whitespace-pre-wrap break-all font-mono text-[11px]`,children:`docker compose pull && docker compose up -d`})]}),w.installation===`source`&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2 rounded-xl border bg-muted/30 p-3`,children:[(0,G.jsx)(La,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`code`,{className:`whitespace-pre-wrap break-all font-mono text-[11px]`,children:`git pull && npm ci && npm run build`})]}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`settings.restartAfterUpdate`)})]}),(w.installation===`desktop`||w.installation===`unknown`)&&i?.releasesUrl&&(0,G.jsxs)(`a`,{href:i.releasesUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 text-xs font-medium underline underline-offset-4`,children:[n(`settings.openReleases`),(0,G.jsx)(Ji,{className:`size-3`})]})]}),k&&(0,G.jsxs)(`div`,{className:`flex gap-3 rounded-xl border p-4 ${w?.status===`current`?`border-emerald-500/25 bg-emerald-500/5`:`border-amber-500/25 bg-amber-500/5`}`,children:[w?.status===`current`?(0,G.jsx)(Ni,{className:`mt-0.5 size-5 shrink-0 text-emerald-500`}):(0,G.jsx)(Va,{className:`mt-0.5 size-5 shrink-0 text-amber-500`}),(0,G.jsx)(`p`,{className:`text-sm`,children:k})]}),f&&(0,G.jsxs)(`div`,{role:`alert`,className:`flex gap-3 rounded-xl border border-destructive/25 bg-destructive/5 p-4`,children:[(0,G.jsx)(Va,{className:`mt-0.5 size-5 shrink-0 text-destructive`}),(0,G.jsx)(`p`,{className:`text-sm text-destructive`,children:n(`settings.checkFailed`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-col-reverse items-stretch justify-between gap-3 border-t pt-4 sm:flex-row sm:items-center`,children:[(0,G.jsx)(`div`,{className:`space-y-0.5`,children:D&&(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`settings.lastChecked`,{when:D})})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>void S(),disabled:u,className:`inline-flex items-center justify-center gap-1.5 rounded-lg border px-3 py-2 text-xs transition-colors hover:bg-muted disabled:opacity-50`,children:[(0,G.jsx)(Ea,{className:`size-3.5 ${u?`animate-spin`:``}`}),n(u?`keys.checking`:`settings.checkForUpdates`)]})]})]})]})})]})}function zD({open:e,onOpenChange:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(`general`),a=jD(e),{config:o,busy:s,error:c,save:l}=a,u=r!==`general`,d=u&&!o&&s===`load`;return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-3xl`,className:`flex h-[min(85vh,85dvh)] flex-col overflow-hidden p-0 sm:p-0`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-4 border-b px-5 py-3 sm:px-6`,children:[(0,G.jsx)(Mv,{children:n(`settings.title`)}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-me-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden sm:flex-row`,children:[(0,G.jsx)(`nav`,{"aria-label":n(`settings.sections`),className:`flex shrink-0 gap-1 overflow-x-auto border-b p-2 sm:w-48 sm:flex-col sm:overflow-x-visible sm:border-b-0 sm:border-e sm:p-3`,children:AD.map(e=>{let t=e.icon,a=r===e.id;return(0,G.jsxs)(`button`,{type:`button`,"aria-current":a?`true`:void 0,onClick:()=>i(e.id),className:`inline-flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-start text-xs transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50 sm:text-sm ${a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`}`,children:[(0,G.jsx)(t,{className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`truncate`,children:n(`settings.${e.tKey}`)})]},e.id)})}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4 sm:px-6 sm:py-5`,children:[r===`general`&&(0,G.jsx)(ID,{active:e}),d&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,G.jsx)(la,{className:`size-4 animate-spin`}),n(`common.loading`)]}),u&&o&&(0,G.jsxs)(G.Fragment,{children:[r===`compression`&&(0,G.jsx)(MD,{state:a}),r===`advanced`&&(0,G.jsx)(ND,{state:a}),r===`preview`&&(0,G.jsx)(PD,{state:a})]}),u&&!o&&!d&&c&&(0,G.jsx)(`p`,{className:`text-sm text-destructive`,children:c})]})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-3 border-t px-5 py-2.5 sm:px-6 ${u&&o?``:`invisible`}`,children:[c&&(0,G.jsx)(`p`,{className:`me-auto text-xs text-destructive`,children:c}),(0,G.jsx)(`button`,{type:`button`,onClick:l,disabled:s!==null,className:`rounded-lg bg-primary px-4 py-2 text-xs font-medium text-primary-foreground transition-opacity outline-none hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:n(s===`save`?`common.saving`:`common.saveChanges`)})]})]})})}function BD(e,t){let n=e,r=null,i,a=0,o=!1,s=()=>{o=!0,r=null,i=void 0,t()},c=()=>{o||a>0||r!==null||(r=Date.now(),i=setTimeout(s,Math.max(0,n)))},l=()=>{r!==null&&(n-=Date.now()-r,r=null),i!==void 0&&(clearTimeout(i),i=void 0)};return c(),{pause(){a++,l()},resume(){a>0&&a--,c()},cancel(){o=!0,l()}}}function VD(){let e=(0,v.useSyncExternalStore)(lv,uv,uv);return e.length===0?null:(0,G.jsx)(`div`,{className:`pointer-events-none fixed bottom-6 right-4 z-[60] flex w-full max-w-sm flex-col gap-2 sm:right-6`,children:e.map(e=>(0,G.jsx)(WD,{toast:e},e.id))})}var HD={success:Ni,error:Mi,info:ra},UD={success:`text-emerald-600 dark:text-emerald-400`,error:`text-destructive`,info:`text-muted-foreground`};function WD({toast:e}){let{t}=Z(),n=(0,v.useRef)(null);(0,v.useEffect)(()=>{let t=e.duration;if(t===null)return;let r=BD(t,()=>dv(e.id));document.hasFocus()||r.pause();let i=()=>r.pause(),a=()=>r.resume();window.addEventListener(`blur`,i),window.addEventListener(`focus`,a);let o=n.current,s=()=>r.pause(),c=()=>r.resume();return o?.addEventListener(`mouseenter`,s),o?.addEventListener(`mouseleave`,c),()=>{r.cancel(),window.removeEventListener(`blur`,i),window.removeEventListener(`focus`,a),o?.removeEventListener(`mouseenter`,s),o?.removeEventListener(`mouseleave`,c)}},[e.id,e.duration]);let r=HD[e.kind];return(0,G.jsxs)(`div`,{ref:n,role:e.kind===`error`?`alert`:`status`,"aria-live":e.kind===`error`?`assertive`:`polite`,className:`pointer-events-auto flex items-start gap-2.5 rounded-2xl border bg-card px-3.5 py-2.5 shadow-lg animate-in slide-in-from-bottom-2 fade-in duration-200`,children:[(0,G.jsx)(r,{className:`mt-0.5 size-4 shrink-0 ${UD[e.kind]}`}),(0,G.jsx)(`p`,{className:`min-w-0 flex-1 break-words text-sm leading-snug`,children:e.message}),(0,G.jsx)(`button`,{type:`button`,"aria-label":t(`common.dismiss`),onClick:()=>dv(e.id),className:`rounded-md p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground`,children:(0,G.jsx)(Wa,{className:`size-3.5`})})]})}function GD(){return{data:void 0,isLoading:!1,isError:!1,licensed:!0}}var KD={aihorde:`AI Horde`,airforce:`Airforce`,bai:`Bai`,bazaarlink:`Bazaarlink`,cerebras:`Cerebras`,cohere:`Cohere`,custom:`Custom`,google:`Google`,groq:`Groq`,huggingface:`HuggingFace`,kilo:`Kilo`,mistral:`Mistral`,nara:`Nara`,nvidia:`NVIDIA NIM`,ollama:`Ollama`,openrouter:`OpenRouter`,ovh:`OVH`,radeon:`Radeon`,unorouter:`UnoRouter`,xkiro:`xKIRO`};function qD(e){return KD[e]??e.charAt(0).toUpperCase()+e.slice(1)}function JD(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(`theme`);return e===`light`||e===`dark`?e:`system`}function YD(){return typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function XD({children:e}){let[t,n]=(0,v.useState)(JD),[r,i]=(0,v.useState)(YD),a=t===`system`?r:t===`dark`;(0,v.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>i(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,v.useEffect)(()=>{window.localStorage.setItem(`theme`,t),document.documentElement.dataset.themeChoice=t},[t]),(0,v.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,a),document.documentElement.style.colorScheme=a?`dark`:`light`},[a]);let o=(0,v.useCallback)(e=>{n(e)},[]),s=(0,v.useMemo)(()=>({theme:t,setTheme:o,resolvedDark:a}),[a,o,t]);return(0,G.jsx)(Sv.Provider,{value:s,children:e})}function ZD({value:e,onValueChange:t,options:n,ariaLabel:r,className:i}){return(0,G.jsx)(`div`,{role:`tablist`,"aria-label":r,className:Zc(`inline-flex gap-0.5 overflow-x-auto rounded-xl border p-1 sm:gap-1`,i),children:n.map(n=>(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===n.value,onClick:()=>t(n.value),className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs transition-colors ${e===n.value?`bg-primary text-primary-foreground font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:n.label},n.value))})}function QD({title:e,description:t,actions:n,tabs:r,divider:i=!0}){return(0,G.jsxs)(`div`,{className:`mb-4 sm:mb-6 ${i?`pb-4 sm:pb-6 border-b`:``}`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between sm:gap-6`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight sm:text-2xl`,children:e}),t&&(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground sm:mt-1 sm:text-sm`,children:t})]}),n&&(0,G.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 flex-wrap`,children:n})]}),r&&(0,G.jsx)(`div`,{className:`mt-3 overflow-x-auto`,children:r})]})}function $D({icon:e,title:t,description:n,action:r,className:i}){return(0,G.jsxs)(`div`,{className:Zc(`rounded-2xl border border-dashed p-6 text-center sm:rounded-3xl sm:p-8`,i),children:[e&&(0,G.jsx)(e,{className:`mx-auto mb-3 size-6 text-muted-foreground/50`}),(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:t}),n&&(0,G.jsx)(`div`,{className:`mx-auto mt-1.5 max-w-md text-xs text-muted-foreground sm:text-sm`,children:n}),r&&(0,G.jsx)(`div`,{className:`mt-4 flex flex-wrap items-center justify-center gap-2`,children:r})]})}function eO(e){return ds(e.defaultTagName??`div`,e,e)}var tO=Ss(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function nO({className:e,variant:t=`default`,render:n,...r}){return eO({defaultTagName:`span`,props:Oo({className:Zc(tO({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function rO({url:e}){let{t}=Z();return e?(0,G.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[t(`keys.getApiKey`),(0,G.jsx)(Ji,{className:`size-3`})]}):null}var iO=[{value:`aclide`,label:`ACLIDE (shared monthly credits)`,url:`https://aclide.com/en/dashboard/api-keys`},{value:`speka`,label:`Speka ($1 shared monthly credits)`,url:`https://speka.me/dashboard/keys`},{value:`llmtr`,label:`LLMTR (daily free-model quotas)`,url:`https://llmtr.com`},{value:`gizmo`,label:`Gizmo (monthly free-model requests)`,url:`https://gizmoplatforms.com/developers`},{value:`blockrun`,label:`BlockRun (zero-priced models)`,url:`https://user.blockrun.ai/dashboard/keys`},{value:`moondream`,label:`Moondream ($5 shared monthly credits)`,url:`https://moondream.ai/c/cloud/api-keys`},{value:`google`,label:`Google AI Studio`,url:`https://aistudio.google.com/apikey`},{value:`groq`,label:`Groq`,url:`https://console.groq.com/keys`},{value:`xai`,label:`xAI (Grok)`,url:`https://console.x.ai`},{value:`cerebras`,label:`Cerebras`,url:`https://cloud.cerebras.ai`},{value:`sail`,label:`Sail Research ($5 monthly with payment method)`,url:`https://app.sailresearch.com`},{value:`electronhub`,label:`ElectronHub (shared weekly credits)`,url:`https://app.electronhub.ai`},{value:`experiential`,label:`Experiential Labs (shared monthly credits)`,url:`https://platform.experientiallabs.ai`},{value:`router9`,label:`Router9 (shared monthly credits)`,url:`https://www.router9.com`},{value:`septor`,label:`Septor Labs (daily free-model quota)`,url:`https://septorlabs.com/dashboard`},{value:`clod`,label:`CLōD (shared daily free requests)`,url:`https://newapp.clod.io`},{value:`speechify`,label:`Speechify (monthly free TTS characters)`,url:`https://platform.speechify.ai`},{value:`blaze`,label:`BlazeAPI (daily free tokens; Discord verification)`,url:`https://blazeapi.org/dashboard`},{value:`lucidity`,label:`Lucidity Composite (daily free-model requests)`,url:`https://composite.lucidity.sh`},{value:`airforce`,label:`Api.Airforce (daily free requests; 1 per minute)`,url:`https://api.airforce`},{value:`dreamprompting`,label:`DreamPrompting (rolling 24h free tokens and requests)`,url:`https://dreamprompting.com`},{value:`waterfall`,label:`Waterfall (community free models)`,url:`https://getwaterfall.org`},{value:`logfare`,label:`Logfare (fair-use free models)`,url:`https://logfare.ai`},{value:`bai`,label:`B.AI (promotional free model)`,url:`https://b.ai`},{value:`radeon`,label:`AMD Radeon Cloud (free shared models)`,url:`https://developer.amd.com.cn/radeon/tokenfactory`},{value:`nvidia`,label:`NVIDIA NIM`,url:`https://build.nvidia.com/settings/api-keys`},{value:`mistral`,label:`Mistral`,url:`https://console.mistral.ai/api-keys/`},{value:`openrouter`,label:`OpenRouter`,url:`https://openrouter.ai/keys`},{value:`github`,label:`GitHub Models`,url:`https://github.com/settings/tokens`},{value:`cohere`,label:`Cohere`,url:`https://dashboard.cohere.com/api-keys`},{value:`cloudflare`,label:`Cloudflare Workers AI`,url:`https://dash.cloudflare.com`},{value:`zhipu`,label:`Zhipu AI (Z.ai)`,url:`https://z.ai/manage-apikey/apikey-list`},{value:`ollama`,label:`Ollama Cloud`,url:`https://ollama.com/settings/keys`},{value:`kilo`,label:`Kilo Gateway (no key needed)`,url:`https://app.kilo.ai`,keyless:!0},{value:`pollinations`,label:`Pollinations`,url:`https://enter.pollinations.ai`},{value:`ovh`,label:`OVH AI Endpoints (no key needed)`,url:`https://endpoints.ai.cloud.ovh.net`,keyless:!0},{value:`llm7`,label:`LLM7 (anon ok)`,url:`https://llm7.io`},{value:`huggingface`,label:`HuggingFace Router`,url:`https://huggingface.co/settings/tokens`},{value:`opencode`,label:`OpenCode Zen (paid models only)`,url:`https://opencode.ai/auth`},{value:`opencode-free`,label:`OpenCode Free (no key needed)`,url:`https://opencode.ai`,keyless:!0},{value:`opencode-go`,label:`OpenCode Go (separate tier)`,url:`https://opencode.ai/auth`},{value:`agnes`,label:`Agnes AI (free key)`,url:`https://platform.agnes-ai.com`},{value:`reka`,label:`Reka (prepaid credits)`,url:`https://platform.reka.ai`},{value:`siliconflow`,label:`SiliconFlow (image + TTS)`,url:`https://siliconflow.com`},{value:`routeway`,label:`Routeway (free key)`,url:`https://routeway.ai`},{value:`bazaarlink`,label:`BazaarLink (free key)`,url:`https://bazaarlink.ai`},{value:`ainative`,label:`AINative Studio (free key)`,url:`https://ainative.studio`},{value:`aion`,label:`Aion Labs (free key)`,url:`https://www.aionlabs.ai`},{value:`requesty`,label:`Requesty (free key)`,url:`https://www.requesty.ai`},{value:`navy`,label:`NavyAI (free key)`,url:`https://api.navy`},{value:`nara`,label:`NaraRouter (free key)`,url:`https://router.bynara.id`},{value:`sealion`,label:`SEA-LION (free key)`,url:`https://sea-lion.ai`},{value:`orcarouter`,label:`OrcaRouter (free key)`,url:`https://www.orcarouter.ai`},{value:`unorouter`,label:`UnoRouter (free key)`,url:`https://unorouter.com`},{value:`xkiro`,label:`xKiro (free key)`,url:`https://xkiro.com`},{value:`anyapi`,label:`AnyAPI (free key)`,url:`https://anyapi.ai`},{value:`modelscope`,label:`ModelScope (free key, needs Aliyun cn binding)`,url:`https://modelscope.cn/my/myaccesstoken`},{value:`aihorde`,label:`AI Horde (no key needed, slow)`,url:`https://aihorde.net/register`,keyless:!0},{value:`qianfan`,label:`Baidu Qianfan (free ERNIE, needs cn real-name)`,url:`https://console.bce.baidu.com/qianfan/overview`},{value:`volcengine`,label:`Volcengine Ark (free daily, needs cn real-name)`,url:`https://console.volcengine.com/ark`},{value:`longcat`,label:`LongCat (free daily, email signup ok)`,url:`https://longcat.chat/platform`},{value:`xfyun`,label:`iFlytek Spark (free Lite, needs cn real-name)`,url:`https://console.xfyun.cn`}],aO={value:`custom`,label:`Custom (OpenAI-compatible)`,url:``},oO={chat:`keys.customTypeChat`,embedding:`keys.customTypeEmbedding`,image:`keys.customTypeImage`,audio:`keys.customTypeAudio`,transcription:`keys.customTypeTranscription`};function sO(e){return`${e.kind}:${e.id}`}function cO(e){return e.kind===`chat`?`/api/models/custom/${e.id}`:e.kind===`embedding`?`/api/embeddings/custom/${e.id}`:`/api/media/custom/${e.id}`}var lO={healthy:`bg-emerald-500`,rate_limited:`bg-amber-500`,invalid:`bg-rose-500`,error:`bg-rose-500`,unknown:`bg-muted-foreground/40`},uO={healthy:`status.healthy`,rate_limited:`status.rateLimited`,invalid:`status.invalid`,error:`status.error`,unknown:`status.unchecked`};function dO({pool:e,generatedAt:t,windowMinutes:n,minimumRequests:r}){let{t:i,locale:a}=Z(),o=e=>new Intl.NumberFormat(a).format(e),s=i(`keys.outlookInsufficient`),c=e.warning===`low_balance`?i(`keys.outlookLowBalance`):e.warning===`exhausting_soon`?i(`keys.outlookRunningLow`):e.status===`stale`?i(`keys.outlookStale`):e.status===`unknown`||e.status===`unavailable`?i(`keys.outlookUnavailable`):e.status===`insufficient_data`?s:i(`keys.outlookWithinQuota`),l=e.estimatedExhaustionAt?new Intl.RelativeTimeFormat(a,{numeric:`always`}).format(Math.max(1,Math.ceil((Date.parse(e.estimatedExhaustionAt)-Date.parse(t))/6e4)),`minute`):e.status===`resets_first`?i(`keys.outlookResetsFirst`):e.status===`exhausted`?i(`keys.outlookExhausted`):e.unavailableReason?i(`keys.outlookUnavailable`):s,u=e.unavailableReason!=null,d=iO.find(t=>t.value===e.platform)?.label??e.platform;return(0,G.jsxs)(`article`,{"aria-label":d,className:Zc(`p-4 sm:p-5`,e.warning&&`bg-amber-500/5`),children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-medium`,children:d}),(0,G.jsx)(`p`,{className:`mt-0.5 break-all text-xs text-muted-foreground`,children:e.pool})]}),(0,G.jsxs)(nO,{variant:`outline`,className:Zc(`h-auto max-w-[50%] shrink-0 whitespace-normal text-right`,e.warning&&`border-amber-600/30 text-amber-700 dark:text-amber-300`),children:[e.warning&&(0,G.jsx)(Va,{"aria-hidden":`true`,className:`mr-1 shrink-0`}),c]})]}),e.remainingPct!=null&&e.remaining!=null&&e.limit!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`strong`,{className:`text-xl font-medium tabular-nums text-foreground`,children:o(e.remaining)}),` / `,o(e.limit),` `,i(u?`keys.outlookLastReported`:`keys.outlookRequestsLeft`)]}),(0,G.jsxs)(`span`,{className:`tabular-nums text-foreground`,children:[o(e.remainingPct),`%`]})]}),(0,G.jsx)(`div`,{className:`my-3 h-1 overflow-hidden rounded-full bg-muted`,role:`progressbar`,"aria-label":i(`keys.quotaRemaining`),"aria-valuenow":e.remainingPct,"aria-valuemin":0,"aria-valuemax":100,children:(0,G.jsx)(`div`,{className:Zc(`h-full rounded-full bg-primary/70`,e.warning&&`bg-amber-500/80`),style:{width:`${e.remainingPct}%`}})})]}):(0,G.jsx)(`p`,{className:`my-3 text-sm text-muted-foreground`,children:e.remaining==null?i(`keys.outlookNotReported`):`${o(e.remaining)} ${i(`keys.outlookLastReported`)}`}),(0,G.jsxs)(`dl`,{className:`grid gap-3 text-xs sm:grid-cols-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`keys.outlookRate`)}),(0,G.jsx)(`dd`,{className:`mt-1`,children:i(`keys.outlookRateValue`,{count:o(e.ratePerMin)})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`keys.outlookRunsOut`)}),(0,G.jsx)(`dd`,{className:Zc(`mt-1`,e.warning&&`text-amber-700 dark:text-amber-300`),children:l})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`keys.quotaReset`)}),(0,G.jsx)(`dd`,{className:`mt-1`,children:e.resetAt?new Date(e.resetAt).toLocaleString(a):i(`keys.outlookNotReported`)})]})]}),(0,G.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:i(`keys.outlookTraffic`,{count:o(e.recentRequestCount),minutes:n})}),e.recentRequestCount<r&&(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i(`keys.outlookMinimumTraffic`,{count:r,minutes:n})}),e.unavailableReason&&(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:i(e.unavailableReason===`quota_not_reported`?`keys.outlookNotReportedHint`:e.unavailableReason===`reset_not_reported`?`keys.outlookMissingResetHint`:e.unavailableReason===`low_confidence`?`keys.outlookConfidenceHint`:`keys.outlookStaleHint`)}),u&&e.observedAt&&e.remaining!=null&&(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i(`keys.outlookObserved`,{time:new Date(e.observedAt.includes(`T`)?e.observedAt:e.observedAt.replace(` `,`T`)+`Z`).toLocaleString(a)})})]})}function fO(){let{t:e}=Z(),{data:t,isPending:n,isError:r,refetch:i}=$r({queryKey:[`quota-outlook`],queryFn:()=>X(`/api/fallback/quota-forecast`),refetchInterval:3e4}),a=t?.pools.filter(e=>e.warning).length??0,o=t?.pools.filter(e=>!e.unavailableReason)??[],s=t?.pools.filter(e=>e.unavailableReason)??[],c=o.filter(e=>e.status!==`insufficient_data`).length,l=e=>(0,G.jsx)(dO,{pool:e,generatedAt:t.generatedAt,windowMinutes:t.observationWindowMinutes,minimumRequests:t.minimumRequests},e.pool);return(0,G.jsxs)(`section`,{"aria-label":e(`keys.outlookTitle`),children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.outlookTitle`)}),n?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,role:`status`,children:e(`common.loading`)}):r?(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-muted-foreground`,children:e(`keys.outlookError`)}),(0,G.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>void i(),children:e(`keys.outlookRetry`)})]}):t?.pools.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`mb-4 mt-1 text-xs text-muted-foreground`,children:a>0?e(`keys.outlookAttention`,{count:a}):e(c?`keys.outlookNoWarnings`:`keys.outlookNoForecasts`)}),(0,G.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[e(`keys.outlookCoverage`,{count:c,total:t.pools.length}),` `,e(`keys.outlookTraffic`,{count:t.pools.reduce((e,t)=>e+t.recentRequestCount,0),minutes:t.observationWindowMinutes})]}),o.length>0&&(0,G.jsx)(`div`,{className:`divide-y overflow-hidden rounded-3xl border bg-card`,children:o.map(l)}),s.length>0&&(0,G.jsxs)(`details`,{className:`mt-3 overflow-hidden rounded-3xl border bg-card`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm sm:px-5`,children:e(`keys.outlookUnavailablePools`,{count:s.length})}),(0,G.jsx)(`div`,{className:`divide-y border-t`,children:s.map(l)})]})]}):(0,G.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:e(`keys.quotaSignalsEmptyDesc`)}),(0,G.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:e(`keys.outlookHint`)})]})}function pO(e){return e==null?`—`:new Intl.NumberFormat().format(e)}function mO(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}function hO({states:e}){let{t}=Z();return(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsx)(fO,{}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:t(`keys.outlookRaw`)}),(0,G.jsx)(`div`,{className:`mt-3`,children:e.length===0?(0,G.jsx)($D,{title:t(`keys.quotaSignalsEmptyTitle`),description:t(`keys.quotaSignalsEmptyDesc`),className:`bg-card`}):(0,G.jsx)(`div`,{className:`rounded-3xl border divide-y bg-card overflow-hidden`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`px-4 py-3.5 text-sm`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:e.platform}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e.keyLabel||t(`keys.quotaKeyRef`,{id:e.keyId})}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(`keys.quotaPoolRef`,{pool:e.quotaPoolKey})}),(0,G.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground`,children:e.metric}),(0,G.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:[e.source,` · `,Math.round(e.confidence*100),`%`]})]}),(0,G.jsxs)(`div`,{className:`mt-2 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2 lg:grid-cols-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:t(`keys.quotaLimit`)}),` `,pO(e.limit)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:t(`keys.quotaRemaining`)}),` `,pO(e.remaining)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:t(`keys.quotaReset`)}),` `,mO(e.resetAt)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`text-foreground`,children:t(`keys.quotaObserved`)}),` `,$c(e.observedAt,{hour:`2-digit`,minute:`2-digit`})]})]}),e.notes&&(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:e.notes})]},`${e.platform}:${e.keyId}:${e.quotaPoolKey}:${e.metric}`))})})]})]})}function gO({onConfirm:e,children:t,confirmLabel:n,timeout:r=3e3,variant:i=`ghost`,size:a=`xs`,armedSize:o,className:s,armedClassName:c,disabled:l,title:u,"aria-label":d}){let{t:f}=Z(),[p,m]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!p)return;let e=window.setTimeout(()=>m(!1),r);return()=>window.clearTimeout(e)},[p,r]),(0,G.jsx)(J,{type:`button`,variant:i,size:p?o??a:a,className:Zc(s,p&&(c??`text-destructive`)),disabled:l,title:u,"aria-label":p?void 0:d,onKeyDown:e=>{e.key===`Escape`&&p&&(e.preventDefault(),e.stopPropagation(),m(!1))},onClick:()=>{p?(m(!1),e()):m(!0)},children:p?n??f(`common.confirm`):t})}function _O(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),{data:o,isError:s}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)}),c=ei({mutationFn:()=>X(`/api/settings/api-key/regenerate`,{method:`POST`}),onSuccess:e=>{t.setQueryData([`unified-key`],{apiKey:e.apiKey}),r(!0)}}),l=o?.apiKey??``,u=l?l.slice(0,13)+`•`.repeat(32):`…`,d=`${window.location.origin}/v1`;async function f(){if(!await _v(l)){pv.error(e(`common.copyFailed`));return}a(!0),setTimeout(()=>a(!1),1500)}return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.unifiedKey`)}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:[e(`keys.unifiedKeyDescBefore`),(0,G.jsx)(`code`,{className:`font-mono`,children:`api_key`}),e(`keys.unifiedKeyDescAfter`)]})]}),(0,G.jsx)(gO,{variant:`ghost`,size:`sm`,disabled:c.isPending||s,onConfirm:()=>c.mutate(),children:e(`keys.regenerate`)})]}),s?(0,G.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-xs text-destructive`,children:[e(`keys.serverUnreachableBefore`),(0,G.jsx)(`code`,{className:`font-mono`,children:d.replace(`/v1`,``)}),e(`keys.serverUnreachableAfter`)]}):(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`code`,{className:`flex-1 font-mono text-xs bg-muted px-3 py-2 rounded-lg select-all truncate tabular-nums`,children:n?l:u}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>r(!n),children:e(n?`keys.hideKey`:`keys.showKey`)}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void f(),children:e(i?`keys.copiedKey`:`keys.copyKey`)})]}),(0,G.jsxs)(`div`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.baseUrl`)}),(0,G.jsx)(`code`,{className:`font-mono`,children:d}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.endpointChat`)}),(0,G.jsx)(`code`,{className:`font-mono`,children:`/v1/chat/completions`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.endpointResponses`)}),(0,G.jsx)(`code`,{className:`font-mono`,children:`/v1/responses`}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.endpointMessages`)}),(0,G.jsxs)(`code`,{className:`font-mono`,children:[`/v1/messages `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e(`keys.endpointMessagesHint`),`)`]})]}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.endpointEmbeddings`)}),(0,G.jsxs)(`code`,{className:`font-mono`,children:[`/v1/embeddings `,(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e(`keys.endpointEmbeddingsHint`),`)`]})]})]}),(0,G.jsxs)(`details`,{className:`group mt-4 rounded-xl border bg-muted/40 p-3`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer select-none text-xs font-medium`,children:e(`keys.quickStart`)}),(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:e(`keys.quickStartDesc`)}),(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-[11px] font-medium text-muted-foreground`,children:e(`keys.exampleAuto`)}),(0,G.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-background p-3 font-mono text-[11px] leading-relaxed`,children:(0,G.jsx)(`code`,{children:`curl ${d}/chat/completions \\
43
+ -H "Authorization: Bearer $YOUR_KEY" \\
44
+ -H "Content-Type: application/json" \\
45
+ -d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'`})})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-[11px] font-medium text-muted-foreground`,children:e(`keys.exampleFast`)}),(0,G.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-background p-3 font-mono text-[11px] leading-relaxed`,children:(0,G.jsx)(`code`,{children:`curl ${d}/chat/completions \\
46
+ -H "Authorization: Bearer $YOUR_KEY" \\
47
+ -H "Content-Type: application/json" \\
48
+ -d '{"model":"auto:fast","messages":[{"role":"user","content":"Hello"}]}'`})})]})]})]})]})}function vO({className:e,...t}){return(0,G.jsx)(`textarea`,{"data-slot":`textarea`,className:Zc(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function yO(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),{data:f=[]}=$r({queryKey:[`client-profiles`],queryFn:()=>X(`/api/client-profiles`),enabled:n}),p=()=>t.invalidateQueries({queryKey:[`client-profiles`]}),m=ei({mutationFn:()=>X(`/api/client-profiles`,{method:`POST`,body:JSON.stringify({name:i.trim(),systemPrompt:o.trim()||null})}),onSuccess:e=>{a(``),s(``),l({id:e.id,key:e.key}),p()}}),h=ei({mutationFn:({id:e,...t})=>X(`/api/client-profiles/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:p}),g=ei({mutationFn:e=>X(`/api/client-profiles/${e}/rotate`,{method:`POST`}),onSuccess:e=>{l({id:e.id,key:e.key}),p()}}),_=ei({mutationFn:e=>X(`/api/client-profiles/${e}`,{method:`DELETE`}),onSuccess:(e,t)=>{l(e=>e?.id===t?null:e),p()}});async function y(){if(!c||!await _v(c.key)){pv.error(e(`common.copyFailed`));return}d(!0),setTimeout(()=>d(!1),1500)}return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 p-5 text-start`,"aria-expanded":n,onClick:()=>r(!n),children:[(0,G.jsx)(Di,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-90`:``}`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.cpTitle`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`keys.cpDesc`)})]})]}),n&&(0,G.jsxs)(`div`,{className:`px-5 pb-5 space-y-4`,children:[c&&(0,G.jsxs)(`div`,{className:`rounded-lg border border-primary/40 bg-primary/5 px-3 py-2.5 space-y-1.5`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.cpKeyOnce`)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`code`,{className:`flex-1 font-mono text-xs bg-muted px-3 py-2 rounded-lg select-all truncate`,children:c.key}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:e(u?`common.copied`:`common.copy`)}),(0,G.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>l(null),children:e(`common.dismiss`)})]})]}),f.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.cpEmpty`)}):(0,G.jsx)(`ul`,{className:`divide-y`,children:f.map(t=>(0,G.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium truncate`,children:t.name}),(0,G.jsx)(`code`,{className:`font-mono text-[11px] text-muted-foreground`,children:t.maskedKey})]}),t.systemPrompt&&(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate mt-0.5`,children:t.systemPrompt})]}),(0,G.jsx)(xD,{size:`sm`,checked:t.enabled,onCheckedChange:e=>h.mutate({id:t.id,enabled:e}),"aria-label":e(`keys.cpEnabledAria`)}),(0,G.jsx)(gO,{onConfirm:()=>g.mutate(t.id),size:`icon-xs`,armedSize:`xs`,confirmLabel:e(`keys.cpRotate`),title:e(`keys.cpRotate`),"aria-label":e(`keys.cpRotate`),children:(0,G.jsx)(Da,{className:`size-3.5`})}),(0,G.jsx)(gO,{onConfirm:()=>_.mutate(t.id),size:`icon-xs`,armedSize:`xs`,armedClassName:`text-destructive`,title:e(`common.delete`),"aria-label":e(`common.delete`),children:(0,G.jsx)(Ba,{className:`size-3.5`})})]},t.id))}),(0,G.jsxs)(`form`,{className:`space-y-2 border-t pt-4`,onSubmit:e=>{e.preventDefault(),i.trim()&&m.mutate()},children:[(0,G.jsx)(L_,{value:i,onChange:e=>a(e.target.value),placeholder:e(`keys.cpNamePlaceholder`),"aria-label":e(`keys.cpNameLabel`),maxLength:100}),(0,G.jsx)(vO,{value:o,onChange:e=>s(e.target.value),placeholder:e(`keys.cpPromptPlaceholder`),"aria-label":e(`keys.cpPromptLabel`),rows:3}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:!i.trim()||m.isPending,children:e(`keys.cpCreate`)})]})]})]})}var bO=v.createContext(null),xO=v.createContext(null);function SO(){let e=v.useContext(bO);if(e===null)throw Error(Uo(60));return e}function CO(){let e=v.useContext(xO);if(e===null)throw Error(Uo(61));return e}var Pre=(e,t)=>Object.is(e,t);function wO(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Fre(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&wO(t,e,n))}function TO(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&wO(e,t,n))}function Ire(e,t,n){return e.filter(e=>!wO(t,e,n))}function EO(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function DO(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Lre(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(DO(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function OO(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return EO(e)}function kO(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?EO(e.value):EO(e)}function AO(e,t,n){function r(){return OO(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=DO(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Rre(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(v.Fragment,{children:AO(r,t,n)},i)),e),[])}var jO={id:Y(e=>e.id),labelId:Y(e=>e.labelId),modal:Y(e=>e.modal),multiple:Y(e=>e.multiple),items:Y(e=>e.items),itemToStringLabel:Y(e=>e.itemToStringLabel),itemToStringValue:Y(e=>e.itemToStringValue),isItemEqualToValue:Y(e=>e.isItemEqualToValue),value:Y(e=>e.value),hasSelectedValue:Y(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:kO(t,r)!==``}),hasNullItemLabel:Y((e,t)=>t?Lre(e.items):!1),open:Y(e=>e.open),mounted:Y(e=>e.mounted),forceMount:Y(e=>e.forceMount),transitionStatus:Y(e=>e.transitionStatus),openMethod:Y(e=>e.openMethod),activeIndex:Y(e=>e.activeIndex),selectedIndex:Y(e=>e.selectedIndex),isActive:Y((e,t)=>e.activeIndex===t),isSelected:Y((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>wO(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null||wO(n,i,r)}),isSelectedByFocus:Y((e,t)=>e.selectedIndex===t),popupProps:Y(e=>e.popupProps),triggerProps:Y(e=>e.triggerProps),triggerElement:Y(e=>e.triggerElement),positionerElement:Y(e=>e.positionerElement),listElement:Y(e=>e.listElement),popupSide:Y(e=>e.popupSide),scrollUpArrowVisible:Y(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Y(e=>e.scrollDownArrowVisible),hasScrollArrows:Y(e=>e.hasScrollArrows)};function MO(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function NO(e,t){return Math.max(0,e-t)}function PO(e,t){if(t<=0)return 0;let n=MO(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function zre(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=Pre,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=D_(),{setDirty:D,setTouched:O,setFocused:k,shouldValidateOnChange:A,validityData:j,setFilled:M,name:N,disabled:P,validation:F,validationMode:I}=T_(),L=N_({id:t}),R=P||d,z=N??c,[B,V]=Fl({controlled:n,default:b?r??os:r,name:`Select`,state:`value`}),[H,U]=Fl({controlled:a,default:o,name:`Select`,state:`open`}),ee=v.useRef([]),W=v.useRef([]),te=v.useRef(null),ne=v.useRef(null),re=v.useRef(0),ie=v.useRef(null),ae=v.useRef([]),oe=v.useRef(!1),se=v.useRef(!1),ce=v.useRef(null),le=v.useRef(null),ue=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=v.useRef(!1),{mounted:fe,setMounted:pe,transitionStatus:me}=yu(H),{openMethod:he,triggerProps:ge}=wg(H),_e=bo(()=>new Fm({id:L,labelId:void 0,modal:m,multiple:b,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:B,open:H,mounted:fe,transitionStatus:me,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ve=jm(_e,jO.activeIndex),ye=jm(_e,jO.selectedIndex),be=jm(_e,jO.triggerElement),xe=jm(_e,jO.positionerElement),Se=Mee(he),Ce=he??Se,we=v.useMemo(()=>b&&Array.isArray(B)&&B.length===0?``:kO(B,S),[b,B,S]),Te=v.useMemo(()=>b&&Array.isArray(B)?B.map(e=>kO(e,S)):kO(B,S),[b,B,S]);P_(sd(_e.state.triggerElement),L,B,Co(()=>Te));let Ee=v.useRef(B),De=b?Array.isArray(B)&&B.length>0:B!=null;q(()=>{B!==Ee.current&&_e.set(`forceMount`,!0)},[_e,B]),q(()=>{M(De)},[De,M]),q(function(){let e=ae.current,t;if(b){let n=Array.isArray(B)?B:[];if(n.length===0)t=null;else{let r=n[n.length-1],i=TO(e,r,C);t=i===-1?null:i}}else{let n=TO(e,B,C);t=n===-1?null:n}t===null&&(le.current=null),!H&&_e.set(`selectedIndex`,t)},[De,b,H,B,ae,C,_e,le]),Sg(B,()=>{E(z),D(B!==j.initialValue),A()?F.commit(B):F.commit(B,!0)});let Oe=Co((e,t)=>{if(s?.(e,t),!t.isCanceled&&(U(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),I===`onBlur`&&F.commit(B)),!e&&_e.state.activeIndex!==null)){let e=ee.current[_e.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),ke=Co(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null}),_?.(!1)});Cu({enabled:!h,open:H,ref:te,onComplete(){H||ke()}}),v.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=Co((e,t)=>{i?.(e,t),!t.isCanceled&&V(e)}),je=Co(()=>{let e=_e.state.listElement||te.current;if(!e)return;let t=NO(e.scrollHeight,e.clientHeight),n=PO(e.scrollTop,t),r=n>0,i=n<t;_e.state.scrollUpArrowVisible!==r&&_e.set(`scrollUpArrowVisible`,r),_e.state.scrollDownArrowVisible!==i&&_e.set(`scrollDownArrowVisible`,i)}),Me=ah({open:H,onOpenChange:Oe,elements:{reference:be,floating:xe}}),Ne=_p(Me,{enabled:!f&&!R,event:`mousedown`}),Pe=xp(Me),Fe=Ch(Me,{enabled:!f&&!R,listRef:ee,activeIndex:ve,selectedIndex:ye,disabledIndices:os,onNavigate(e){e===null&&!H||_e.set(`activeIndex`,e)},focusItemOnHover:w}),Ie=wh(Me,{enabled:!f&&!R&&(H||!b),listRef:W,activeIndex:ve,selectedIndex:ye,onMatch(e){H?_e.set(`activeIndex`,e):Ae(ae.current[e],du(`none`))},onTyping(e){oe.current=e}}),Le=v.useMemo(()=>{let e=Oo(Ie.reference,Fe.reference,Pe.reference,Ne.reference,ge);return L&&(e.id=L),e},[Ne.reference,Ie.reference,Fe.reference,Pe.reference,ge,L]),Re=v.useMemo(()=>Oo(Bm,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??ss;vg(()=>{_e.update({popupProps:Re,triggerProps:Le})}),q(()=>{_e.update({id:L,modal:m,multiple:b,value:B,open:H,mounted:fe,transitionStatus:me,popupProps:Re,triggerProps:Le,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:Ce})},[_e,L,m,b,B,H,fe,me,Re,Le,y,x,S,C,Ce]);let Be=v.useMemo(()=>({store:_e,name:z,required:p,disabled:R,readOnly:f,multiple:b,highlightItemOnHover:w,setValue:Ae,setOpen:Oe,listRef:ee,popupRef:te,scrollHandlerRef:ne,handleScrollArrowVisibility:je,scrollArrowsMountedCountRef:re,itemProps:ze,events:Me.context.events,valueRef:ie,valuesRef:ae,labelsRef:W,typingRef:oe,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,validation:F,onOpenChangeComplete:_,keyboardActiveRef:se,alignItemWithTriggerActiveRef:de,initialValueRef:Ee}),[_e,z,p,R,f,b,w,Ae,Oe,ze,Me.context.events,F,_,je]),Ve=Xo(g,F.inputRef),He=b&&Array.isArray(B)&&B.length>0,Ue=b?void 0:z,We=v.useMemo(()=>!b||!Array.isArray(B)||!z?null:B.map(e=>{let t=kO(e,S);return(0,G.jsx)(`input`,{type:`hidden`,form:l,name:z,value:t},t)}),[b,B,l,z,S]);return(0,G.jsx)(bO.Provider,{value:Be,children:(0,G.jsxs)(xO.Provider,{value:Me,children:[T,(0,G.jsx)(`input`,{...F.getInputValidationProps({onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||R||f){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=du(xl,e.nativeEvent);function r(){if(b)return;let e=ae.current.find(e=>kO(e,S).toLowerCase()===t.toLowerCase()||OO(e,x).toLowerCase()===t.toLowerCase());e!=null&&(D(e!==j.initialValue),Ae(e,n),A()&&F.commit(e))}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:L&&Ue==null?`${L}-hidden-input`:void 0,form:l,name:Ue,autoComplete:u,value:we,disabled:R,required:p&&!He,readOnly:f,ref:Ve,style:z?fd:dd,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),We]})})}function Bre(e,t){return e??t}var FO=2,Vre=400,Hre={..._l,...S_,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Ure=v.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=T_(),{labelId:m}=k_(),{store:h,setOpen:g,selectionRef:_,validation:y,readOnly:b,required:x,alignItemWithTriggerActiveRef:S,disabled:C,keyboardActiveRef:w}=SO(),T=p||C||a,E=jm(h,jO.open),D=jm(h,jO.mounted),O=jm(h,jO.value),k=jm(h,jO.triggerProps),A=jm(h,jO.positionerElement),j=jm(h,jO.listElement),M=jm(h,jO.popupSide),N=jm(h,jO.id),P=jm(h,jO.labelId),F=jm(h,jO.hasSelectedValue),I=D&&A?M:null,L=i??N,R=Bre(m,P);N_({id:L});let z=sd(A),B=v.useRef(null),{getButtonProps:V,buttonRef:H}=qo({disabled:T,native:o}),U=Xo(t,B,H,Co(e=>{h.set(`triggerElement`,e)})),ee=Au(),W=Au(),te=Au();v.useEffect(()=>{if(E)return te.start(Vre,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{te.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},W.clear()},[E,_,W,te]);let ne=Oo(k,{id:L,role:`combobox`,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?j?.id??$u(A)?.id:void 0,"aria-labelledby":R,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,ref:U,onFocus(e){u(!0),E&&S.current&&g(!1,du(xl,e.nativeEvent)),ee.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Wu(A,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&y.commit(O))},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(E)return;let t=ld(e.currentTarget);function n(e){if(!B.current)return;let t=e.target;if(Wu(B.current,t)||Wu(z.current,t)||t===B.current)return;let n=Og(B.current);e.clientX>=n.left-FO&&e.clientX<=n.right+FO&&e.clientY>=n.top-FO&&e.clientY<=n.bottom+FO||g(!1,du(jl,e))}W.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},y.getValidationProps,c,V);ne.role=`combobox`;let re={...f,open:E,disabled:T,value:O,readOnly:b,popupSide:I,placeholder:!F};return ds(`button`,e,{ref:[t,B],state:re,stateAttributesMapping:Hre,props:ne})}),Wre={value:()=>null},Gre=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=SO(),u=jm(c,jO.value),d=jm(c,jO.items),f=jm(c,jO.itemToStringLabel),p=jm(c,jO.hasSelectedValue),m=!p&&a!=null&&i==null,h=jm(c,jO.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?Rre(u,d,f):AO(u,d,f)),ds(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Wre})}),Kre=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=SO();return ds(`span`,e,{state:{open:jm(o,jO.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:gl})}),qre=v.createContext(void 0),Jre=v.forwardRef(function(e,t){let{store:n}=SO(),r=jm(n,jO.mounted),i=jm(n,jO.forceMount);return r||i?(0,G.jsx)(qre.Provider,{value:!0,children:(0,G.jsx)(Qf,{ref:t,...e})}):null}),IO=v.createContext(void 0);function LO(){let e=v.useContext(IO);if(!e)throw Error(Uo(59));return e}function RO(e,t){e&&Object.assign(e.style,t)}var zO={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Yre={position:`fixed`},Xre=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Gf,style:_,...y}=e,{store:b,listRef:x,labelsRef:S,alignItemWithTriggerActiveRef:C,selectedItemTextRef:w,valuesRef:T,initialValueRef:E,popupRef:D,setValue:O}=SO(),k=CO(),A=jm(b,jO.open),j=jm(b,jO.mounted),M=jm(b,jO.modal),N=jm(b,jO.value),P=jm(b,jO.openMethod),F=jm(b,jO.positionerElement),I=jm(b,jO.triggerElement),L=jm(b,jO.isItemEqualToValue),R=jm(b,jO.transitionStatus),z=v.useRef(null),B=v.useRef(null),[V,H]=v.useState(h),U=j&&V&&P!==`touch`;!j&&V!==h&&H(h),q(()=>{j||(jO.scrollUpArrowVisible(b.state)&&b.set(`scrollUpArrowVisible`,!1),jO.scrollDownArrowVisible(b.state)&&b.set(`scrollDownArrowVisible`,!1))},[b,j]),v.useImperativeHandle(C,()=>U),gg((U||M)&&A,P===`touch`,F,I);let ee=Qh({anchor:n,floatingRootContext:k,positionMethod:r,mounted:j,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??U,collisionAvoidance:g,keepMounted:!0}),W=U?`none`:ee.side,te=U?Yre:ee.positionerStyles,ne={open:A,side:W,align:ee.align,anchorHidden:ee.anchorHidden};q(()=>{b.set(`popupSide`,ee.side)},[b,ee.side]);let re=ag(e,ne,{styles:te,transitionStatus:R,props:y,refs:[t,Co(e=>{b.set(`positionerElement`,e)})],hidden:!j,inert:!A}),ie=v.useRef(0),ae=Co(e=>{if(e.size===0&&ie.current===0||T.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=du(xl);if(t!==0&&!b.state.multiple&&N!==null&&TO(T.current,N,L)===-1){let e=E.current,t=e!=null&&TO(T.current,e,L)!==-1?e:null;O(t,n),t===null&&(b.set(`selectedIndex`,null),w.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(N)){let e=e=>TO(T.current,e,L)!==-1,t=N.filter(t=>e(t));(t.length!==N.length||t.some(e=>!Fre(N,e,L)))&&(O(t,n),t.length===0&&(b.set(`selectedIndex`,null),w.current=null))}if(A&&U){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};RO(F,e),RO(D.current,e)}}),oe=v.useMemo(()=>({...ee,side:W,alignItemWithTriggerActive:U,setControlledAlignItemWithTrigger:H,scrollUpArrowRef:z,scrollDownArrowRef:B}),[ee,W,U,H]);return(0,G.jsx)(eg,{elementsRef:x,labelsRef:S,onMapChange:ae,children:(0,G.jsxs)(IO.Provider,{value:oe,children:[j&&M&&(0,G.jsx)(ig,{inert:Kh(!A),cutout:I}),re]})})}),BO=`base-ui-disable-scrollbar`,VO={className:BO,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:BO,precedence:`base-ui:low`,children:`.${BO}{scrollbar-width:none}.${BO}::-webkit-scrollbar{display:none}`})}},Zre=v.createContext(void 0),Qre={disableStyleElements:!1};function $re(){return v.useContext(Zre)??Qre}var eie={...vl,...cl},tie=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,keyboardActiveRef:m,multiple:h,handleScrollArrowVisibility:g,scrollHandlerRef:_,listRef:y,highlightItemOnHover:b}=SO(),{side:x,align:S,alignItemWithTriggerActive:C,isPositioned:w,setControlledAlignItemWithTrigger:T,scrollDownArrowRef:E,scrollUpArrowRef:D}=LO(),O=Ph(!0)!=null,k=CO(),A=qh(),{nonce:j,disableStyleElements:M}=$re(),N=jm(s,jO.id),P=jm(s,jO.open),F=jm(s,jO.mounted),I=jm(s,jO.popupProps),L=jm(s,jO.transitionStatus),R=jm(s,jO.triggerElement),z=jm(s,jO.positionerElement),B=jm(s,jO.listElement),V=v.useRef(!1),H=v.useRef(!1),U=v.useRef({}),ee=vu(),W=Co(e=>{if(!z||!c.current||!H.current)return;if(V.current||!C){g();return}let t=z.style.top===`0px`,n=z.style.bottom===`0px`;if(!t&&!n){g();return}let r=WO(z),i=GO(z.getBoundingClientRect().height,`y`,r),a=ld(z),o=getComputedStyle(z),s=parseFloat(o.marginTop),l=parseFloat(o.marginBottom),u=HO(getComputedStyle(c.current)),d=Math.min(a.documentElement.clientHeight-s-l,u),f=e.scrollTop,p=UO(e),m=0,h=null,_=!1,v=!1,y=e=>{z.style.height=`${e}px`},b=(t,n)=>{let r=MO(t,0,d-i);r>0&&y(i+r),e.scrollTop=n,d-(i+r)<=1&&(V.current=!0),g()},x=t?p-f:f,S=Math.min(i+x,d);if(m=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?v=!0:h=0:(_=!0,n&&f<p&&(h=f-(x-(i+x-d)))),m=Math.ceil(m),m!==0&&y(m),v||h!=null){let t=UO(e),n=v?t:MO(h,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(_||m>=d-1)&&(V.current=!0),g()});v.useImperativeHandle(_,()=>W,[W]),Cu({open:P,ref:c,onComplete(){P&&l?.(!0)}});let te={open:P,transitionStatus:L,side:x,align:S};q(()=>{!z||!c.current||Object.keys(U.current).length||(U.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[c,z]),q(()=>{P||C||(H.current=!1,V.current=!1,RO(z,U.current))},[P,C,z,c]),q(()=>{let e=c.current;if(!P||!R||!z||!e||C&&!w||s.state.transitionStatus===`ending`)return;if(!C){H.current=!0,ee.request(g),e.style.removeProperty(`--transform-origin`);return}let t=nie(e);e.style.removeProperty(`--transform-origin`);try{let t=p.current;t?.isConnected||(t=!jO.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=getComputedStyle(z),i=getComputedStyle(e),a=ld(R),o=Ja(z),c=WO(R),l=KO(R.getBoundingClientRect(),c),u=KO(z.getBoundingClientRect(),c),m=l.height,h=B||e,_=h.scrollHeight,v=parseFloat(i.borderBottomWidth),x=parseFloat(r.marginTop)||10,S=parseFloat(r.marginBottom)||10,C=parseFloat(r.minHeight)||100,w=HO(i),E=a.documentElement.clientHeight-x-S,D=a.documentElement.clientWidth,O=E-l.bottom+m,k,j=A===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=KO(n.getBoundingClientRect(),c);k=KO(t.getBoundingClientRect(),c),j=u.left+(A===`rtl`?e.right-k.right:e.left-k.left);let r=e.top-l.top+e.height/2;M=k.top-u.top+k.height/2-r}let N=O+M+S+v,P=Math.min(E,N),F=E-x-S,I=N-P,L=D-5;z.style.left=`${MO(j,5,L-u.width)}px`,z.style.height=`${P}px`,z.style.maxHeight=`auto`,z.style.marginTop=`${x}px`,z.style.marginBottom=`${S}px`,e.style.height=`100%`;let ee=UO(h),W=I>=ee-1;W&&(P=Math.min(E,u.height)-(I-ee));let te=l.top<20||l.bottom>E-20||Math.ceil(P)+1<Math.min(_,C),ne=(o.visualViewport?.scale??1)!==1&&Hl;if(te||ne){H.current=!0,RO(z,U.current),T(!1);return}let re=Math.max(C,P);if(W){let e=Math.max(0,E-N);z.style.top=u.height>=F?`0`:`${e}px`,z.style.height=`${P}px`,h.scrollTop=UO(h)}else z.style.bottom=`0`,h.scrollTop=I;if(k){let t=u.top,n=u.height,r=k.top+k.height/2,i=MO(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(re===E||P>=w)&&(V.current=!0),g(),b&&s.state.selectedIndex===null&&s.state.activeIndex===null&&y.current[0]!=null&&s.set(`activeIndex`,0),H.current=!0}finally{t()}},[s,P,z,R,d,f,p,c,g,C,T,ee,E,D,B,y,b,A,w]),v.useEffect(()=>{if(!C||!z||!P)return;let e=Ja(z);function t(e){u(!1,du(Pl,e))}return ad(e,`resize`,t)},[u,C,z,P]);let ne={...B?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":h||void 0,id:`${N}-list`},onKeyDown(e){m.current=!0,O&&Uh.has(e.key)&&e.stopPropagation()},onMouseMove(){m.current=!1},onScroll(e){B||W(e.currentTarget)},...C&&{style:B?{height:`100%`}:zO}},re=ds(`div`,e,{ref:[t,c],state:te,stateAttributesMapping:eie,props:[I,ne,Wh(L),{className:!B&&C?VO.className:void 0},o]});return(0,G.jsxs)(v.Fragment,{children:[!M&&VO.getElement(j),(0,G.jsx)(gp,{context:k,modal:!1,disabled:!F,returnFocus:a,restoreFocus:!0,children:re})]})});function HO(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function UO(e){return NO(e.scrollHeight,e.clientHeight)}function WO(e){return nm.getScale(e)}function GO(e,t,n){return e/n[t]}function KO(e,t){return Vd({x:GO(e.x,`x`,t),y:GO(e.y,`y`,t),width:GO(e.width,`x`,t),height:GO(e.height,`y`,t)})}var qO=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function nie(e){let{style:t}=e,n={};for(let[e,r]of qO)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of qO){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var rie=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=SO(),{alignItemWithTriggerActive:c}=LO(),l=jm(o,jO.hasScrollArrows),u=jm(o,jO.openMethod),d=jm(o,jO.multiple),f={id:`${jm(o,jO.id)}-list`,role:`listbox`,"aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:zO},className:l&&u!==`touch`?VO.className:void 0};return ds(`div`,e,{ref:[t,Co(e=>{o.set(`listElement`,e)})],props:[f,a]})}),JO=v.createContext(void 0);function YO(){let e=v.useContext(JO);if(!e)throw Error(Uo(57));return e}var iie=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=v.useRef(null),d=ru({label:o,textRef:u,indexGuessBehavior:nu.GuessFromOrder}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:y,multiple:b,selectedItemTextRef:x}=SO(),S=jm(f,jO.isActive,d.index),C=jm(f,jO.isSelected,d.index,a),w=jm(f,jO.isSelectedByFocus,d.index),T=jm(f,jO.isItemEqualToValue),E=d.index,D=E!==-1,O=v.useRef(null);q(()=>{if(!D)return;let e=y.current;return e[E]=a,()=>{delete e[E]}},[D,E,a,y]),q(()=>{if(!D)return;let e=f.state.value,t=e;b&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&wO(a,t,T)&&(f.set(`selectedIndex`,E),u.current&&(x.current=u.current))},[D,E,b,T,f,a,x]);let k=v.useRef(null),A=v.useRef(`mouse`),j=v.useRef(!1),{getButtonProps:M,buttonRef:N}=qo({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),P={disabled:s,selected:C,highlighted:S};function F(e){let t=f.state.value;if(b){let n=Array.isArray(t)?t:[],r=C?Ire(n,a,T):[...n,a];h(r,du(El,e))}else h(a,du(El,e)),m(!1,du(El,e))}function I(){g.current.dragY=0}let L={role:`option`,"aria-selected":C,tabIndex:S?0:-1,onKeyDown(e){k.current=e.key,f.set(`activeIndex`,E),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=e.type===`click`&&A.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Nu(e.nativeEvent)&&(n!==void 0||S),i=t&&!r&&!j.current;j.current=!1,(e.type!==`keydown`||k.current!==null)&&(s||e.type===`keydown`&&k.current===` `&&_.current||i||(k.current=null,F(e.nativeEvent)))},onPointerEnter(e){A.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){A.current=e.pointerType,j.current=!0,I()},onMouseUp(){if(I(),s||A.current===`touch`||j.current)return;let e=!g.current.allowSelectedMouseUp&&C,t=!g.current.allowUnselectedMouseUp&&!C;e||t||(j.current=!0,O.current?.click(),j.current=!1)}},R=ds(`div`,e,{ref:[N,t,d.ref,O],state:P,props:[p,L,l,M]}),z=v.useMemo(()=>({selected:C,index:E,textRef:u,selectedByFocus:w,hasRegistered:D}),[C,E,u,w,D]);return(0,G.jsx)(JO.Provider,{value:z,children:R})})),aie=v.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=YO();return n||r?(0,G.jsx)(oie,{...e,ref:t}):null}),oie=v.memo(v.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=YO(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=yu(s),d=ds(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:cl});return Cu({open:s,ref:c,onComplete(){s||u(!1)}}),d})),sie=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i,hasRegistered:a}=YO(),{firstItemTextRef:o,selectedItemTextRef:s}=SO(),{render:c,className:l,style:u,...d}=e;return ds(`div`,e,{ref:[v.useCallback(e=>{e&&(a&&n===0&&(o.current=e),a&&i&&(s.current=e))},[o,s,n,i,a]),t,r],props:d})})),XO=v.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=SO(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=LO(),_=jm(l,c?jO.scrollUpArrowVisible:jO.scrollDownArrowVisible),v=jm(l,jO.openMethod),y=_&&v!==`touch`,b=Au(),x=c?g:h,{transitionStatus:S,setMounted:C}=yu(y);q(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),Cu({open:y,ref:x,onComplete(){y||C(!1)}});let w=ds(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:S},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=NO(e.scrollHeight,e.clientHeight),r=PO(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=cie(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s]});return y||o?w:null});function cie(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?PO(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?PO(l.offsetTop+l.offsetHeight-r+i,a):a}var lie=v.forwardRef(function(e,t){return(0,G.jsx)(XO,{...e,ref:t,direction:`down`})}),uie=v.forwardRef(function(e,t){return(0,G.jsx)(XO,{...e,ref:t,direction:`up`})}),ZO=zre;function QO({className:e,...t}){return(0,G.jsx)(Gre,{"data-slot":`select-value`,className:Zc(`flex flex-1 text-left`,e),...t})}function $O({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(Ure,{"data-slot":`select-trigger`,"data-size":t,className:Zc(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(Kre,{render:(0,G.jsx)(Ti,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function ek({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,G.jsx)(Jre,{children:(0,G.jsx)(Xre,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,G.jsxs)(tie,{"data-slot":`select-content`,"data-align-trigger":o,className:Zc(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,G.jsx)(die,{}),(0,G.jsx)(rie,{children:t}),(0,G.jsx)(fie,{})]})})})}function tk({className:e,children:t,...n}){return(0,G.jsxs)(iie,{"data-slot":`select-item`,className:Zc(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,G.jsx)(sie,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,G.jsx)(aie,{render:(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,G.jsx)(wi,{className:`pointer-events-none`})})]})}function die({className:e,...t}){return(0,G.jsx)(uie,{"data-slot":`select-scroll-up-button`,className:Zc(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(Oi,{})})}function fie({className:e,...t}){return(0,G.jsx)(lie,{"data-slot":`select-scroll-down-button`,className:Zc(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(Ti,{})})}function pie(e){try{return new URL(e).host}catch{return e}}function mie(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`forward`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),{data:u,isError:d}=$r({queryKey:[`proxy-url`],queryFn:()=>X(`/api/settings/proxy`)}),{data:f=[]}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)});(0,v.useEffect)(()=>{u&&(r(u.proxyUrl),a(u.proxyMode))},[u?.proxyUrl,u?.proxyMode]);let p=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/settings/proxy`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:e=>{t.invalidateQueries({queryKey:[`proxy-url`]}),r(e.proxyUrl),a(e.proxyMode),s(``),l(!1)}}),m=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/settings/proxy/test`,{method:`POST`,body:JSON.stringify(e)})}),h=e=>{e.preventDefault(),p.mutate({proxyUrl:n,proxyMode:i,...c?{fetchRelayToken:o}:{}})},g=u?.enabled??!0,_=u?.active??!1;return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`h2`,{className:`text-sm font-medium flex items-center gap-2`,children:[(0,G.jsx)(ta,{className:`size-3.5 text-muted-foreground`}),e(`keys.outboundProxy`)]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`keys.outboundProxyDescription`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(xD,{checked:g,onCheckedChange:e=>p.mutate({enabled:e}),disabled:p.isPending||!u}),_&&g&&(0,G.jsx)(`span`,{className:`text-[11px] px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-medium`,children:e(`common.active`)})]})]}),d?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.proxyLoadFailed`)}):(0,G.jsxs)(`form`,{onSubmit:h,className:`flex flex-wrap items-end gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:e(`keys.proxyMode`)}),(0,G.jsxs)(ZO,{value:i,onValueChange:e=>a(e),children:[(0,G.jsx)($O,{className:`w-[160px]`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`forward`,label:e(`keys.proxyModeForward`),children:e(`keys.proxyModeForward`)}),(0,G.jsx)(tk,{value:`fetch-relay`,label:e(`keys.proxyModeFetchRelay`),children:e(`keys.proxyModeFetchRelay`)})]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5 flex-1`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:e(`keys.proxyUrl`)}),(0,G.jsx)(L_,{value:n,onChange:e=>r(e.target.value),placeholder:i===`fetch-relay`?`https://relay.example.workers.dev`:`socks5://127.0.0.1:1080`,className:`font-mono text-xs`})]}),i===`fetch-relay`&&(0,G.jsxs)(`div`,{className:`space-y-1.5 flex-1`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:e(`keys.relayToken`)}),(0,G.jsx)(L_,{type:`password`,autoComplete:`new-password`,value:o,onChange:e=>{s(e.target.value),l(!0)},placeholder:u?.fetchRelayTokenConfigured?e(`keys.relayTokenConfigured`):e(`keys.relayTokenPlaceholder`),className:`font-mono text-xs`})]}),(0,G.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,disabled:m.isPending,onClick:()=>m.mutate({proxyUrl:n,proxyMode:i,...o?{fetchRelayToken:o}:{}}),children:m.isPending?e(`keys.testingProxy`):e(`keys.testProxy`)}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:p.isPending,children:p.isPending?e(`keys.savingProxy`):e(`keys.saveProxy`)})]}),m.isSuccess&&(0,G.jsxs)(`p`,{className:`text-xs mt-2 ${m.data.ok?`text-emerald-600 dark:text-emerald-400`:`text-destructive`}`,children:[m.data.ok?e(`keys.proxyTestOk`,{ms:String(m.data.latencyMs)}):e(`keys.proxyTestFail`,{reason:m.data.error??``}),m.data.target&&(0,G.jsx)(`span`,{className:`text-muted-foreground ml-1.5 font-mono`,children:pie(m.data.target)})]}),m.isError&&(0,G.jsx)(`p`,{className:`text-destructive text-xs mt-2`,children:m.error.message}),p.isError&&(0,G.jsx)(`p`,{className:`text-destructive text-xs mt-2`,children:p.error.message}),!d&&g&&f.length>0&&(0,G.jsxs)(`div`,{className:`mt-4 border-t pt-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-medium mb-2`,children:e(`keys.routeViaProxy`)}),(0,G.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:[...iO,aO].filter(e=>f.some(t=>t.platform===e.value)).map(e=>{let t=!(u?.bypassPlatforms??[]).includes(e.value);return(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,G.jsx)(xD,{size:`sm`,checked:t,disabled:p.isPending||!u,onCheckedChange:t=>{let n=t?(u?.bypassPlatforms??[]).filter(t=>t!==e.value):[...u?.bypassPlatforms??[],e.value];p.mutate({bypassPlatforms:n})}})]},e.value)})})]}),(0,G.jsxs)(`div`,{className:`mt-3 text-[11px] text-muted-foreground`,children:[(0,G.jsxs)(`p`,{children:[e(`keys.proxyEnvHintBefore`),(0,G.jsx)(`code`,{className:`font-mono`,children:`PROXY_URL`}),e(`keys.proxyEnvHintAfter`)]}),i===`fetch-relay`?(0,G.jsxs)(`p`,{className:`mt-1`,children:[e(`keys.relayHeadersHint`),` `,(0,G.jsx)(`code`,{className:`font-mono`,children:`Fetch-Relay-Target`}),` + `,(0,G.jsx)(`code`,{className:`font-mono`,children:`Fetch-Relay-Authorization`})]}):(0,G.jsxs)(`ul`,{className:`list-disc list-inside mt-1 space-y-0.5`,children:[(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{className:`font-mono`,children:`socks5://127.0.0.1:1080`})}),(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{className:`font-mono`,children:`socks5h://127.0.0.1:1080`})}),(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{className:`font-mono`,children:`http://proxy.corp.com:8080`})}),(0,G.jsx)(`li`,{children:(0,G.jsx)(`code`,{className:`font-mono`,children:`socks5://user:pass@proxy:1080`})})]})]})]})}function hie(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}async function gie(e,t){let n=f_(),r=`/`.replace(/\/$/,``),i=await fetch(`${r}/api/backups/${e}/download`,{headers:n?{Authorization:`Bearer ${n}`}:{}});if(!i.ok){let e=await i.json().catch(()=>null);pv.error(e?.error?.message??`HTTP ${i.status}`);return}let a=URL.createObjectURL(await i.blob()),o=document.createElement(`a`);o.href=a,o.download=t,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)}function _ie(){let{t:e}=Z(),[t,n]=(0,v.useState)(!1);return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,className:`flex w-full items-start justify-between gap-4 text-left`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`h2`,{className:`text-sm font-medium flex items-center gap-2`,children:[(0,G.jsx)(fi,{className:`size-3.5 text-muted-foreground`}),e(`backups.title`)]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`backups.description`)})]}),(0,G.jsx)(Ti,{className:`mt-1 size-4 shrink-0 text-muted-foreground transition-transform ${t?``:`-rotate-90`}`})]}),t&&(0,G.jsx)(vie,{})]})}function vie(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(1),[i,a]=(0,v.useState)(new Set),{data:o=[]}=$r({queryKey:[`backup-tables`],queryFn:()=>X(`/api/backups/tables`).then(e=>e.tables)}),{data:s}=$r({queryKey:[`backups`,n],queryFn:()=>X(`/api/backups?page=${n}&pageSize=10`)}),{data:c}=$r({queryKey:[`backup-schedule`],queryFn:()=>X(`/api/backups/schedule`)}),l=()=>{t.invalidateQueries({queryKey:[`backups`]}),t.invalidateQueries({queryKey:[`backup-schedule`]})},u=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/backups`,{method:`POST`,body:JSON.stringify(e.length>0?{tables:e}:{})}),onSuccess:t=>{pv.success(e(`backups.created`,{filename:t.backup.filename})),a(new Set),r(1),l()},onError:e=>pv.error(e instanceof Error?e.message:String(e))}),d=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/backups/${e}/restore`,{method:`POST`}),onSuccess:n=>{pv.success(e(`backups.restored`,{filename:n.snapshot.filename})),l(),t.invalidateQueries()},onError:e=>pv.error(e instanceof Error?e.message:String(e))}),f=ei({mutationFn:e=>X(`/api/backups/${e}`,{method:`DELETE`}),onSuccess:l}),p=s?.total??0,m=Math.max(1,Math.ceil(p/10));return(0,G.jsxs)(`div`,{className:`mt-5 space-y-6 border-t pt-5`,children:[(0,G.jsx)(`p`,{className:`rounded-2xl bg-muted/50 px-3 py-2 text-xs text-muted-foreground`,children:e(`backups.excludedNote`)}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground flex-1 min-w-40`,children:e(`backups.selectHint`)}),(0,G.jsx)(J,{variant:`ghost`,size:`xs`,onClick:()=>a(new Set(o)),disabled:o.length===0,children:e(`backups.selectAll`)}),(0,G.jsx)(J,{variant:`ghost`,size:`xs`,onClick:()=>a(new Set),disabled:i.size===0,children:e(`backups.deselectAll`)})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:o.map(e=>{let t=i.has(e);return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>{let n=new Set(i);t?n.delete(e):n.add(e),a(n)},className:`inline-flex h-6 items-center rounded-4xl border px-2 font-mono text-[11px] transition-colors ${t?`border-ring bg-muted`:`border-border hover:bg-muted/50`}`,children:e},e)})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(J,{size:`sm`,onClick:()=>u.mutate([]),disabled:u.isPending,children:e(`backups.fullBackup`)}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>u.mutate([...i]),disabled:u.isPending||i.size===0,children:e(`backups.backupSelected`,{count:i.size})})]})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium`,children:e(`backups.list`)}),s&&s.items.length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`ul`,{className:`divide-y rounded-2xl border`,children:s.items.map(t=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-mono text-xs`,children:t.filename}),(0,G.jsxs)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:[new Date(t.createdAt).toLocaleString(),` · `,hie(t.filesize),` ·`,` `,t.isFull?e(`backups.full`):e(`backups.tablesCount`,{count:t.tables.length})]})]}),(0,G.jsx)(nO,{variant:t.source===`manual`?`outline`:`secondary`,children:t.source===`scheduled`?e(`backups.scheduled`):t.source===`pre-restore`?e(`backups.preRestore`):e(`backups.manual`)}),(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,title:e(`backups.download`),"aria-label":e(`backups.download`),onClick:()=>void gie(t.id,t.filename),children:(0,G.jsx)(Gi,{})}),(0,G.jsx)(gO,{size:`xs`,onConfirm:()=>d.mutate(t.id),disabled:d.isPending,confirmLabel:e(`backups.confirmRestore`),children:e(`backups.restore`)}),(0,G.jsx)(gO,{size:`icon-sm`,armedSize:`xs`,onConfirm:()=>f.mutate(t.id),title:e(`backups.delete`),"aria-label":e(`backups.delete`),children:(0,G.jsx)(Ba,{})})]})]},t.id))}),m>1&&(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(J,{variant:`ghost`,size:`xs`,disabled:n<=1,onClick:()=>r(e=>e-1),children:e(`backups.prevPage`)}),(0,G.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[n,` / `,m]}),(0,G.jsx)(J,{variant:`ghost`,size:`xs`,disabled:n>=m,onClick:()=>r(e=>e+1),children:e(`backups.nextPage`)})]})]}):(0,G.jsx)(`p`,{className:`rounded-2xl border border-dashed px-3 py-6 text-center text-xs text-muted-foreground`,children:e(`backups.empty`)})]}),(0,G.jsx)(yie,{schedule:c?.schedule??null,onSaved:l})]})}function yie({schedule:e,onSaved:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`03:00`),[s,c]=(0,v.useState)(`1`),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1);(0,v.useEffect)(()=>{e&&(i(e.enabled),o(e.time),c(String(e.intervalDays)),u(e.backupPath??``))},[e]);let p=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/backups/schedule`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{f(!0),setTimeout(()=>f(!1),2e3),t()},onError:e=>pv.error(e instanceof Error?e.message:String(e))});return(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-xs font-medium`,children:n(`backups.autoTitle`)}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground mt-0.5`,children:n(`backups.autoHint`)})]}),(0,G.jsx)(xD,{size:`sm`,checked:r,onCheckedChange:i,"aria-label":n(`backups.autoTitle`)})]}),(0,G.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`backups.time`)}),(0,G.jsx)(L_,{type:`time`,value:a,onChange:e=>o(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`backups.intervalDays`)}),(0,G.jsx)(L_,{type:`number`,min:1,max:365,value:s,onChange:e=>c(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`backups.path`)}),(0,G.jsx)(L_,{value:l,onChange:e=>u(e.target.value),placeholder:n(`backups.pathPlaceholder`),className:`font-mono text-xs`})]})]}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`backups.pathHint`)}),(0,G.jsx)(J,{size:`sm`,disabled:p.isPending,onClick:()=>p.mutate({enabled:r,time:a||`03:00`,intervalDays:Math.max(1,Number.parseInt(s,10)||1),backupPath:l.trim()}),children:n(d?`backups.saved`:`backups.save`)})]})}var bie=[{key:`default`,labelKey:`keys.familyDefault`},{key:`opus`,labelKey:`keys.familyOpus`},{key:`sonnet`,labelKey:`keys.familySonnet`},{key:`haiku`,labelKey:`keys.familyHaiku`}];function xie(){let{t:e}=Z(),t=Rr(),n=window.location.origin,{data:r}=$r({queryKey:[`anthropic-map`],queryFn:()=>X(`/api/settings/anthropic-map`)}),{data:i=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)}),[a,o]=(0,v.useState)(null);(0,v.useEffect)(()=>{r?.map&&o(r.map)},[r]);let s=ei({mutationFn:e=>X(`/api/settings/anthropic-map`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>t.invalidateQueries({queryKey:[`anthropic-map`]})}),c=Array.from(new Map(i.filter(e=>e.enabled).map(e=>[e.modelId,e])).values()).sort((e,t)=>e.displayName.localeCompare(t.displayName)),l=!!(a&&r?.map&&JSON.stringify(a)!==JSON.stringify(r.map));return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.anthropicTitle`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 max-w-prose`,children:e(`keys.anthropicDesc`)})]}),(0,G.jsx)(J,{size:`sm`,disabled:!l||s.isPending,onClick:()=>a&&s.mutate(a),children:s.isSuccess&&!l?e(`keys.anthropicSaved`):e(`keys.anthropicSave`)})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-xs mb-4`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.anthropicBaseUrl`)}),(0,G.jsx)(`code`,{className:`font-mono break-all`,children:n}),(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`keys.anthropicAuth`)}),(0,G.jsx)(`code`,{className:`font-mono`,children:`x-api-key`})]}),(0,G.jsx)(`div`,{className:`space-y-2`,children:bie.map(({key:t,labelKey:n})=>(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`w-40 text-xs font-medium shrink-0`,children:e(n)}),(0,G.jsxs)(ZO,{value:a?.[t]??`auto`,onValueChange:e=>o(n=>n&&{...n,[t]:e}),children:[(0,G.jsx)($O,{className:`w-[320px] max-w-full`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`auto`,children:e(`keys.anthropicAuto`)}),a?.[t]&&a[t]!==`auto`&&!c.some(e=>e.modelId===a[t])&&(0,G.jsx)(tk,{value:a[t],children:a[t]}),c.map(e=>(0,G.jsx)(tk,{value:e.modelId,children:e.displayName},e.modelId))]})]})]},t))}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-4 max-w-prose`,children:e(`keys.anthropicNote`)})]})}function nk({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`skeleton`,"aria-hidden":`true`,className:Zc(`animate-pulse rounded-lg bg-muted`,e),...t})}function rk({rows:e=6}){return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border`,children:[(0,G.jsx)(`div`,{className:`border-b bg-muted/30 px-4 py-3`,children:(0,G.jsx)(nk,{className:`h-3 w-40`})}),Array.from({length:e}).map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3.5 last:border-0`,children:[(0,G.jsx)(nk,{className:`size-4 rounded-full`}),(0,G.jsx)(nk,{className:`h-3 w-full max-w-56`}),(0,G.jsx)(nk,{className:`hidden h-3 w-16 sm:block`}),(0,G.jsx)(nk,{className:`ml-auto h-4 w-8 rounded-full`})]},t))]})}function ik({className:e}){return(0,G.jsxs)(`div`,{className:Zc(`rounded-3xl border bg-card p-5`,e),children:[(0,G.jsx)(nk,{className:`h-4 w-48`}),(0,G.jsx)(nk,{className:`mt-3 h-3 w-full max-w-sm`}),(0,G.jsx)(nk,{className:`mt-2 h-3 w-full max-w-xs`})]})}function ak(e,t){let n=t.toLowerCase();return(e.label??``).toLowerCase().includes(n)||(e.maskedKey??``).toLowerCase().includes(n)||(e.baseUrl??``).toLowerCase().includes(n)}var ok=[`fastest`,`reliable`];function sk(e){return e.source===`custom`&&e.keyLabel&&e.keyLabel.trim()?e.keyLabel:e.platform}function ck(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``).replace(/\/+$/,``)}function lk(e,t){let n=sk(e);return e.source!==`custom`||!e.endpointScope||!uk(e,t)?n:`${n} · ${ck(e.endpointScope)}`}function uk(e,t){return e.source!==`custom`||!e.endpointScope?!1:new Set(t.filter(t=>t.platform===e.platform&&t.modelId===e.modelId&&t.source===`custom`&&!!t.endpointScope).map(e=>e.endpointScope)).size>1}function dk(e,t){if(lk(e,t)!==sk(e))return e.endpointScope??void 0}function fk(e,t){return e.qualifiedModelId&&uk(e,t)?e.qualifiedModelId:e.modelId}function pk(e){return e.qualifiedModelId??`${e.platform}:${e.modelId}`}function mk(e){let t=`${e.platform}:${e.modelId}`;return e.qualifiedModelId&&e.qualifiedModelId!==t?[e.qualifiedModelId,t]:[t]}function hk(e,t){let n=mk(t);return e.some(e=>n.includes(e.member))}function gk(e,t){let n=mk(t);return e.filter(e=>!n.includes(e.member))}function _k(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function vk(e){let t=Math.max(0,Math.min(100,e*100));if(t>0&&t<.1)return`<0.1%`;if(t>99.9&&t<100)return`${(Math.floor(t*100)/100).toFixed(2).replace(/0+$/,``).replace(/\.$/,``)}%`;let n=+(t<10);return`${t.toFixed(n).replace(/\.0$/,``)}%`}function yk(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function bk(e){return Math.max(0,...e.map(e=>e.contextWindow??0))}function xk(e){if(!e)return null;let t=e.replace(/free\s*·\s*/gi,``).replace(/\s*per ip\s*/gi,``).replace(/[~?]/g,``).replace(/\s+/g,` `).trim();return t=t.replace(/^\(([^()]*)\)$/,`$1`).trim(),t||null}function Sk(e,t){let n=e.reduce((e,t)=>e+(t.monthlyTokenBudgetTokens??0),0),r=Math.max(0,...e.map(e=>e.rpmLimit??0)),i=Math.max(0,...e.map(e=>e.rpdLimit??0)),a=e.map(e=>xk(e.monthlyTokenBudget)).find(Boolean)??null;return n>0?{text:t(`models.aggregateBudget`,{count:_k(n)}),title:t(`models.aggregateBudgetTitle`)}:r>0?{text:t(`models.rateRpm`,{count:r}),title:t(`models.rateTitle`)}:i>0?{text:t(`models.rateRpd`,{count:i}),title:t(`models.rateTitle`)}:a?{text:a,title:t(`models.rateTitle`)}:null}function Ck(e){let t=null,n=1/0;for(let r of e){let e=[];r.rpm&&e.push({kind:`RPM`,...r.rpm}),r.rpd&&e.push({kind:`RPD`,...r.rpd}),r.tpm&&e.push({kind:`TPM`,...r.tpm});let i=null,a=0;for(let t of e){let e=t.limit>0?t.used/t.limit:0;(i===null||e>a)&&(a=e,i=t)}i&&a<n&&(n=a,t=i)}return!t||n<=0?null:t}function wk(e){let t=e?Ck([e]):null;return t!==null&&t.used>=t.limit}function Tk(e,t){return e.length>0&&e.every(e=>wk(t.get(e.modelDbId)))}var Ek={google:`#4285f4`,groq:`#f55036`,cerebras:`#8b5cf6`,sail:`#0ea5e9`,aclide:`#6366f1`,speka:`#0d9488`,llmtr:`#0f766e`,gizmo:`#7c3aed`,blockrun:`#2563eb`,moondream:`#6d5dfc`,electronhub:`#6366f1`,experiential:`#14b8a6`,router9:`#8b5cf6`,septor:`#0891b2`,clod:`#16a34a`,speechify:`#7c3aed`,blaze:`#f97316`,lucidity:`#6366f1`,airforce:`#0ea5e9`,dreamprompting:`#db2777`,waterfall:`#0d9488`,logfare:`#ca8a04`,bai:`#111827`,radeon:`#ed1c24`,nvidia:`#76b900`,mistral:`#f59e0b`,openrouter:`#ec4899`,github:`#6e7b8b`,cohere:`#d946ef`,cloudflare:`#f38020`,zhipu:`#06b6d4`,ollama:`#000000`,kilo:`#7c3aed`,pollinations:`#a855f7`,llm7:`#0ea5e9`,huggingface:`#ff9d00`,routeway:`#14b8a6`,bazaarlink:`#e11d48`,ainative:`#22c55e`,aion:`#6366f1`,requesty:`#10b981`,navy:`#1d4ed8`,nara:`#2563eb`,sealion:`#0ea5e9`,orcarouter:`#f97316`,unorouter:`#ec4899`,xkiro:`#a855f7`,anyapi:`#0891b2`,modelscope:`#624aff`,aihorde:`#dc2626`,qianfan:`#2932e1`,volcengine:`#00b8d9`,longcat:`#ffd100`,xfyun:`#1f6fd0`};function Dk(e,t,n){let r=new Map;for(let t of e){let e=t.groupKey??`solo:${t.modelDbId}`,n=r.get(e);n?n.push(t):r.set(e,[t])}let i=[...r.entries()].map(([e,n])=>({key:e,label:n[0].groupLabel??n[0].displayName,members:[...n].sort((e,n)=>t?e.priority-n.priority:(n.score??0)-(e.score??0))}));if(i.sort((e,n)=>t?Math.min(...e.members.map(e=>e.priority))-Math.min(...n.members.map(e=>e.priority)):Math.max(...n.members.map(e=>e.score??0))-Math.max(...e.members.map(e=>e.score??0))),n&&!t){let e=e=>wk(n.get(e.modelDbId));for(let t of i)t.members.sort((t,n)=>Number(e(t))-Number(e(n)));i.sort((e,t)=>Number(Tk(e.members,n))-Number(Tk(t.members,n)))}return i}function Ok(e,t){if(!Number.isFinite(e))return-1;let n=Math.trunc(e)-1;return n<0?0:n>t-1?t-1:n}function kk(e,t){return[e.label,e.members[0].canonicalId??``,...e.members.map(e=>e.platform),...e.members.map(e=>e.displayName),...e.members.map(e=>e.modelId),...e.members.map(e=>e.keyLabel??``),...e.members.map(e=>e.endpointScope?ck(e.endpointScope):``)].join(` `).toLowerCase().includes(t)}function Ak({open:e,onOpenChange:t,endpoint:n,onRegistered:r,builtin:i=!1}){let{t:a}=Z(),o=Rr(),[s,c]=(0,v.useState)(new Set),l=$r({queryKey:[`custom-endpoint-models`,i,n.keyId??null,n.baseUrl??null],queryFn:()=>X(`/api/keys/custom/discover-models`,{method:`POST`,body:JSON.stringify(n)}),retry:!1,gcTime:0,staleTime:0}),u=l.data?.models??[],d=ei({meta:{silenceToast:!0},mutationFn:()=>i?X(`/api/keys/discovered-models`,{method:`POST`,body:JSON.stringify({keyId:n.keyId,models:[...s]})}):X(`/api/keys/custom`,{method:`POST`,body:JSON.stringify({...n.keyId===void 0?{baseUrl:n.baseUrl}:{keyId:n.keyId},...n.apiKey?{apiKey:n.apiKey}:{},models:[...s]})}),onSuccess:e=>{for(let e of[`keys`,`health`,`fallback`,`models`])o.invalidateQueries({queryKey:[e]});pv.success(a(`keys.modelsAdded`,{count:e.created})),t(!1),r?.()}}),f=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},p=e=>e.registered||i&&e.kind!==void 0,m=u.filter(e=>!p(e)),h=m.length>0&&m.every(e=>s.has(e.id)),g=()=>{c(e=>{let t=new Set(e);for(let e of m)h?t.delete(e.id):t.add(e.id);return t})},_=s.size;return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,children:[(0,G.jsx)(Mv,{children:a(`keys.discoverTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:a(`keys.discoverHint`)}),l.isPending&&(0,G.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:a(`common.loading`)}),l.isError&&(0,G.jsx)(`p`,{className:`mt-4 text-xs text-destructive`,children:l.error.message}),l.isSuccess&&u.length===0&&(0,G.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:a(`keys.discoverEmpty`)}),u.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-xs font-medium`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:h,disabled:m.length===0,onChange:g,className:`size-4 accent-primary`}),(0,G.jsx)(`span`,{children:a(`keys.discoverSelectAll`)})]}),(0,G.jsx)(`div`,{className:`mt-2 max-h-[45vh] overflow-y-auto rounded-2xl border divide-y`,children:u.map(e=>(0,G.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 text-xs ${p(e)?`bg-muted/40`:`cursor-pointer hover:bg-muted/30`}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:e.registered||s.has(e.id),disabled:p(e),onChange:()=>f(e.id),className:`size-4 accent-primary`}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono`,title:e.id,children:e.id}),e.vision&&(0,G.jsx)(`span`,{title:a(`models.visionTitle`),className:`shrink-0 rounded-full bg-cyan-600/15 px-1.5 py-0.5 text-[10px] text-cyan-700 dark:bg-cyan-400/15 dark:text-cyan-400`,children:a(`models.vision`)}),e.kind&&(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-violet-600/15 px-1.5 py-0.5 text-[10px] text-violet-700 dark:bg-violet-400/15 dark:text-violet-400`,children:e.kind}),e.contextWindow!==void 0&&e.contextWindow>0&&(0,G.jsx)(`span`,{title:a(`models.ctxTitle`),className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground tabular-nums`,children:a(`models.ctxBadge`,{size:yk(e.contextWindow)})}),e.priceNote&&(0,G.jsx)(`span`,{className:`shrink-0 max-w-[140px] truncate rounded-full px-1.5 py-0.5 text-[10px] ${e.isFree?`bg-emerald-600/15 text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-400`:`bg-muted text-muted-foreground`}`,title:e.priceNote,children:e.priceNote}),e.ownedBy&&(0,G.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:e.ownedBy}),e.registered&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:a(`keys.discoverAlreadyAdded`)})]},e.id))})]}),d.isError&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-destructive`,children:d.error.message}),(0,G.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-2`,children:[(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>t(!1),children:a(`common.cancel`)}),(0,G.jsx)(J,{size:`sm`,onClick:()=>d.mutate(),disabled:_===0||d.isPending,children:_===1?a(`keys.addModel`):a(`keys.addModels`,{count:_})})]})]})})}function jk({open:e,onOpenChange:t,baseUrl:n}){let{t:r}=Z(),i=Rr(),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),l=ei({meta:{silenceToast:!0},mutationFn:()=>X(`/api/keys/custom`,{method:`POST`,body:JSON.stringify({baseUrl:n,apiKey:a,label:s.trim()||void 0})}),onSuccess:()=>{for(let e of[`keys`,`health`])i.invalidateQueries({queryKey:[e]});pv.success(r(`keys.keyAdded`)),t(!1)}});return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-md`,children:[(0,G.jsx)(Mv,{children:r(`keys.addKey`)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`keys.endpointKeysShareModels`)}),(0,G.jsx)(`code`,{className:`mt-2 block truncate font-mono text-[11px] text-muted-foreground`,title:n,children:n}),(0,G.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a.trim()&&l.mutate()},className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`endpoint-key`,children:r(`keys.customApiKey`)}),(0,G.jsx)(L_,{id:`endpoint-key`,type:`password`,autoFocus:!0,value:a,onChange:e=>o(e.target.value),placeholder:r(`keys.pasteKeyPlaceholder`),className:`font-mono text-xs`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`endpoint-key-label`,children:r(`keys.label`)}),(0,G.jsx)(L_,{id:`endpoint-key-label`,value:s,onChange:e=>c(e.target.value),placeholder:r(`keys.customDisplayNameOptional`)})]}),l.isError&&(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:l.error.message}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(!1),children:r(`common.cancel`)}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:!a.trim()||l.isPending,children:l.isPending?r(`keys.adding`):r(`keys.addKey`)})]})]})]})})}var Mk=typeof window<`u`&&window.__SROUTER_DESKTOP__===!0;function Nk({keyId:e,maskedKey:t,onOpenChange:n}){let{t:r}=Z(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null);async function f(t){t.preventDefault(),l(!0),s(null);try{let{key:t}=await X(`/api/keys/${e}/reveal`,{method:`POST`,headers:Mk?void 0:{"x-reauth-password":i}});if(!await _v(t)){d(t),s(r(`common.copyFailed`));return}pv.success(r(`keys.copiedKey`)),n(!1)}catch(e){s(e.message),a(``)}finally{l(!1)}}return(0,G.jsx)(kv,{open:!0,onOpenChange:n,children:(0,G.jsxs)(jv,{maxWidth:`max-w-md`,children:[(0,G.jsx)(Mv,{children:r(`keys.copyFullKey`)}),(0,G.jsx)(`code`,{className:`mt-2 block font-mono text-[11px] text-muted-foreground break-all select-all`,children:u??t}),(0,G.jsxs)(`form`,{onSubmit:f,className:`mt-4 space-y-4`,children:[!Mk&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`reveal-password`,children:r(`auth.password`)}),(0,G.jsx)(L_,{id:`reveal-password`,type:`password`,autoFocus:!0,autoComplete:`current-password`,value:i,onChange:e=>a(e.target.value),"aria-invalid":!!o}),(0,G.jsx)(__,{error:o})]}),Mk&&o&&(0,G.jsx)(__,{error:o}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>n(!1),children:r(`common.cancel`)}),(0,G.jsxs)(J,{type:`submit`,size:`sm`,disabled:!Mk&&!i||c,children:[(0,G.jsx)(Wi,{className:`size-3.5`}),r(`keys.copyKey`)]})]})]})]})})}function Pk(e){return e>=1e9?`${(e/1e9).toFixed(1).replace(/\.0$/,``)}B`:e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,``)}K`:String(e)}function Fk(e){let t=e.trim();if(!t)return 0;if(!/^\d+$/.test(t))return null;let n=Number(t);return Number.isSafeInteger(n)?n:null}function Ik(e){return e&&e>0?String(e):``}function Lk({apiKey:e,onOpenChange:t}){let{t:n,locale:r}=Z(),i=Rr(),[a,o]=(0,v.useState)(e.label),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(Ik(e.monthlyRequestCap)),[h,g]=(0,v.useState)(Ik(e.monthlyTokenCap)),[_,y]=(0,v.useState)(e.budgetPeriod??`auto`),b=e.platform===`cloudflare`,x=iO.find(t=>t.value===e.platform),S=(0,v.useMemo)(()=>s.trim()?b?l.trim()?`${l.trim()}:${s.trim()}`:``:s.trim():``,[l,s,b]),C=b&&(l.trim()?!s.trim():s.trim())?n(`keys.editCredentialPartsRequired`):null,w=Fk(p),T=Fk(h),E=w===null||T===null,D=w!==(e.monthlyRequestCap||0),O=T!==(e.monthlyTokenCap||0),k=_!==(e.budgetPeriod??`auto`),A=a!==e.label||!!S||D||O||k,j=ei({mutationFn:t=>X(`/api/keys/${e.id}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:()=>{for(let e of[`keys`,`health`])i.invalidateQueries({queryKey:[e]});t(!1)}});return(0,G.jsx)(kv,{open:!0,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-lg`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsx)(Mv,{children:n(`keys.editKey`)}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:n=>{if(n.preventDefault(),C||E){f(!0);return}let r={};a!==e.label&&(r.label=a),S&&(r.key=S),D&&w!==null&&(r.monthlyRequestCap=w),O&&T!==null&&(r.monthlyTokenCap=T),k&&(r.budgetPeriod=_),Object.keys(r).length>0?j.mutate(r):t(!1)},className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.platform`)}),(0,G.jsx)(L_,{value:x?.label??e.platform,readOnly:!0,className:`bg-muted/30`}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`keys.editPlatformLocked`)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`edit-key-label`,children:n(`keys.label`)}),(0,G.jsx)(L_,{id:`edit-key-label`,value:a,onChange:e=>o(e.target.value),placeholder:n(`keys.customDisplayNameOptional`)})]})]}),e.baseUrl&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.customBaseUrl`)}),(0,G.jsx)(L_,{value:e.baseUrl,readOnly:!0,className:`bg-muted/30 font-mono text-xs`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`edit-key-value`,children:n(b?`keys.apiToken`:`keys.customApiKey`)}),!e.keyless&&(0,G.jsx)(`code`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.maskedKey})]}),b&&(0,G.jsx)(L_,{value:l,onChange:e=>u(e.target.value),placeholder:n(`keys.accountId`),className:`font-mono text-xs`,"aria-invalid":d&&!!C}),(0,G.jsx)(L_,{id:`edit-key-value`,type:`password`,autoComplete:`new-password`,value:s,onChange:e=>c(e.target.value),placeholder:e.keyless?n(`keys.keyOptionalPlaceholder`):n(b?`keys.bearerTokenPlaceholder`:`keys.pasteKeyPlaceholder`),className:`font-mono text-xs`,"aria-invalid":d&&!!C}),d&&(0,G.jsx)(__,{error:C}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.keyless?n(`keys.keyOptionalHint`):n(`keys.editCredentialHint`)})]}),(0,G.jsxs)(`details`,{className:`group`,open:!!(e.monthlyRequestCap||e.monthlyTokenCap)||void 0,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer select-none text-[11px] text-muted-foreground hover:text-foreground`,children:e.monthlyUsage?(()=>{let{requests:t,tokens:i,resetsAt:a}=e.monthlyUsage,o=e.monthlyRequestCap??0,s=e.monthlyTokenCap??0;return`${o>0?n(`keys.monthlyUsageRequestsRelative`,{used:Pk(t),cap:Pk(o),remaining:Pk(Math.max(0,o-t))}):n(`keys.monthlyUsageRequests`,{requests:t.toLocaleString()})} · ${s>0?n(`keys.monthlyUsageTokensRelative`,{used:Pk(i),cap:Pk(s),remaining:Pk(Math.max(0,s-i))}):n(`keys.monthlyUsageTokens`,{tokens:i.toLocaleString()})}${a?` · `+n(`keys.monthlyUsageReset`,{date:new Date(a).toLocaleDateString(r===`id`?`id-ID`:`en-US`,{day:`numeric`,month:`short`})}):``}`})():n(`keys.requestCapLabel`)}),(0,G.jsxs)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`edit-key-budget-period`,children:n(`keys.budgetPeriodLabel`)}),(0,G.jsxs)(ZO,{value:_,onValueChange:e=>y(e),children:[(0,G.jsx)($O,{id:`edit-key-budget-period`,className:`w-full`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`auto`,label:n(`keys.budgetPeriodAuto`),children:n(`keys.budgetPeriodAuto`)}),(0,G.jsx)(tk,{value:`daily`,label:n(`keys.budgetPeriodDaily`),children:n(`keys.budgetPeriodDaily`)}),(0,G.jsx)(tk,{value:`weekly`,label:n(`keys.budgetPeriodWeekly`),children:n(`keys.budgetPeriodWeekly`)}),(0,G.jsx)(tk,{value:`monthly`,label:n(`keys.budgetPeriodMonthly`),children:n(`keys.budgetPeriodMonthly`)})]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`edit-key-request-cap`,children:n(`keys.requestCapLabel`)}),(0,G.jsx)(L_,{id:`edit-key-request-cap`,inputMode:`numeric`,value:p,onChange:e=>m(e.target.value),placeholder:n(`keys.capUnlimitedPlaceholder`),className:`font-mono text-xs`,"aria-invalid":d&&w===null})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`edit-key-token-cap`,children:n(`keys.tokenCapLabel`)}),(0,G.jsx)(L_,{id:`edit-key-token-cap`,inputMode:`numeric`,value:h,onChange:e=>g(e.target.value),placeholder:n(`keys.capUnlimitedPlaceholder`),className:`font-mono text-xs`,"aria-invalid":d&&T===null})]})]}),_===`auto`&&e.resolvedBudgetPeriod&&(0,G.jsx)(`p`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:e.budgetPeriodSource===`daily-limit`?n(`keys.autoResolvedDaily`):e.budgetPeriodSource===`monthly-label`?n(`keys.autoResolvedMonthly`):n(`keys.autoResolvedFallback`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:n(`keys.capEditHint`)})]}),j.isError&&(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:j.error.message}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(!1),children:n(`common.cancel`)}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:!A||j.isPending,children:j.isPending?n(`common.saving`):n(`common.save`)})]})]})]})})}function Rk(e,t){if(!t||t===`custom`)return[];let n=new Set,r=[];for(let i of e)i.platform===t&&(!i.modelId||n.has(i.modelId)||(n.add(i.modelId),r.push({modelId:i.modelId,displayName:i.displayName||i.modelId,sizeLabel:i.sizeLabel||null,contextWindow:i.contextWindow??null})));return r}function zk(e){return e.length>=6}function Bk(e,t){let n=e.filter(e=>t.has(e));return n.length===0?{patch:!1,reason:`empty`}:n.length===e.length?{patch:!1,reason:`all`}:{patch:!0,modelScope:n}}function Vk({apiKey:e,onOpenChange:t}){let{t:n}=Z(),r=Rr(),{data:i=[]}=$r({queryKey:[`models`],queryFn:()=>X(`/api/models`),enabled:e.platform!==`custom`}),a=e.platform===`custom`?(e.models??[]).filter(e=>e.kind===`chat`).map(e=>({modelId:e.modelId,displayName:e.displayName||e.modelId,sizeLabel:null,contextWindow:null})):Rk(i,e.platform),o=a.map(e=>e.modelId),[s,c]=(0,v.useState)(e.modelScope===null),[l,u]=(0,v.useState)(()=>new Set(e.modelScope??[])),d=ei({meta:{silenceToast:!0},mutationFn:()=>X(`/api/catalog/sync`,{method:`POST`}),onSuccess:()=>{r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`models`]}),pv.success(n(`keys.editModelsSynced`))},onError:e=>pv.error(e.message)}),f=ei({meta:{silenceToast:!0},mutationFn:t=>X(`/api/keys/${e.id}`,{method:`PATCH`,body:JSON.stringify({modelScope:t})}),onSuccess:(e,i)=>{r.invalidateQueries({queryKey:[`keys`]}),pv.success(n(i===null?`keys.modelPicker.allSaved`:i.length===1?`keys.modelPicker.scopedOne`:`keys.modelPicker.scopedOther`,...i===null?[]:[{count:i.length}])),t(!1)}}),p=e=>{if(s){c(!1);let t=new Set(o);t.delete(e),u(t);return}u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=e=>s||l.has(e),h=o.length>0&&o.every(m),g=s?o.length:l.size;return(0,G.jsx)(kv,{open:!0,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsx)(Mv,{children:n(`keys.editModels`)}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),e.platform===`custom`?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`keys.editModelsCustomHint`)}):(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsx)(`p`,{className:`max-w-prose text-xs text-muted-foreground`,children:n(`keys.editModelsHint`)}),(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>d.mutate(),disabled:d.isPending,children:d.isPending?n(`keys.editModelsSyncing`):n(`keys.editModelsSync`)})]}),e.platform!==`custom`&&i.length===0&&(0,G.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:n(`common.loading`)}),a.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-xs font-medium`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:h,onChange:()=>{c(!1),u(h?new Set:new Set(o))},className:`size-4 accent-primary`}),(0,G.jsx)(`span`,{children:n(`keys.discoverSelectAll`)}),(0,G.jsx)(`span`,{className:`ml-auto font-normal text-muted-foreground tabular-nums`,children:n(`keys.modelPicker.count`,{selected:g,total:o.length})})]}),(0,G.jsx)(`div`,{className:`mt-2 max-h-[45vh] overflow-y-auto rounded-2xl border divide-y`,children:a.map(e=>(0,G.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 px-3 py-2 text-xs hover:bg-muted/30`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:m(e.modelId),onChange:()=>p(e.modelId),className:`size-4 accent-primary`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.modelId,children:e.displayName}),e.sizeLabel&&(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e.sizeLabel}),e.contextWindow!==null&&e.contextWindow>0&&(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground tabular-nums`,children:n(`models.ctxBadge`,{size:yk(e.contextWindow)})})]},e.modelId))})]}),f.isError&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-destructive`,children:f.error.message}),(0,G.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-2`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(!1),children:n(`common.cancel`)}),(0,G.jsx)(J,{type:`button`,size:`sm`,onClick:()=>f.mutate(h?null:[...l]),disabled:!s&&l.size===0||f.isPending,children:f.isPending?n(`common.saving`):n(`common.save`)})]})]})})}function Hk({apiKey:e,onOpenChange:t}){let{t:n}=Z(),r=Rr(),[i,a]=(0,v.useState)(e.modelScope??[]),[o,s]=(0,v.useState)(``),c=(e.models??[]).filter(e=>e.kind===`chat`&&!i.includes(e.modelId)).map(e=>e.modelId),l=ei({mutationFn:t=>X(`/api/keys/${e.id}`,{method:`PATCH`,body:JSON.stringify({modelScope:t})}),onSuccess:()=>{r.invalidateQueries({queryKey:[`keys`]}),t(!1)}}),u=e=>{let t=e.trim();t&&(a(e=>e.includes(t)?e:[...e,t]),s(``))};return(0,G.jsx)(kv,{open:!0,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-md`,children:[(0,G.jsx)(Mv,{children:n(`keys.modelScope`)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n(`keys.modelScopeDesc`)}),(0,G.jsx)(`code`,{className:`mt-2 block truncate font-mono text-[11px] text-muted-foreground`,children:e.maskedKey}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[i.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`keys.modelScopeEmpty`)}):(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded-md border bg-muted/40 px-2 py-0.5 font-mono text-[11px]`,children:[(0,G.jsx)(`span`,{className:`max-w-[240px] truncate`,title:e,children:e}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(t=>t.filter(t=>t!==e)),"aria-label":n(`common.remove`),className:`text-muted-foreground hover:text-destructive`,children:(0,G.jsx)(Wa,{className:`size-3`})})]},e))}),(0,G.jsx)(L_,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u(o))},placeholder:n(`keys.modelScopeAdd`),className:`h-8 font-mono text-xs`}),c.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:c.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e),className:`max-w-[240px] truncate rounded-md border border-dashed px-2 py-0.5 font-mono text-[11px] text-muted-foreground hover:text-foreground`,title:e,children:[`+ `,e]},e))}),l.isError&&(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:l.error.message}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[(e.modelScope?.length??0)>0&&(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,className:`mr-auto`,onClick:()=>l.mutate(null),disabled:l.isPending,children:n(`keys.modelScopeClear`)}),(0,G.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(!1),children:n(`common.cancel`)}),(0,G.jsx)(J,{type:`button`,size:`sm`,onClick:()=>{let e=o.trim(),t=e&&!i.includes(e)?[...i,e]:i;l.mutate(t.length>0?t:null)},disabled:l.isPending,children:l.isPending?n(`common.saving`):n(`common.save`)})]})]})]})})}var Uk=5e3,Wk=()=>Date.now();function Gk(e,t,n){return e.filter(e=>e.platform===t&&(n==null||e.keyId===n)).sort((e,t)=>e.intelligenceRank-t.intelligenceRank||e.displayName.localeCompare(t.displayName))}function Kk({platform:e,keyId:t,label:n,onOpenChange:r}){let{t:i}=Z(),{data:a=[],isLoading:o}=$r({queryKey:[`models`],queryFn:()=>X(`/api/models`)}),s=Gk(a,e,t),[c,l]=(0,v.useState)({});async function u(e){let t=c[e.id],n=Wk();if(!t?.loading){if(t?.lastTestedAt&&n-t.lastTestedAt<5e3){let e=Math.ceil((Uk-(n-t.lastTestedAt))/1e3);pv.error(i(`keys.testThrottled`,{seconds:e}));return}l(t=>({...t,[e.id]:{loading:!0,lastTestedAt:n}}));try{let t=await X(`/api/models/${e.id}/test`,{method:`POST`});l(n=>({...n,[e.id]:{loading:!1,lastTestedAt:Wk(),result:{success:t.success,latencyMs:t.latencyMs,error:t.error}}})),t.success?pv.success(i(`keys.testPassed`,{latency:t.latencyMs})):pv.error(t.error||i(`keys.testFailed`))}catch(t){let n=(t instanceof Error?t.message:null)||i(`keys.testFailed`);l(t=>({...t,[e.id]:{loading:!1,lastTestedAt:Wk(),result:{success:!1,latencyMs:0,error:n}}})),pv.error(n)}}}return(0,G.jsx)(kv,{open:!0,onOpenChange:r,children:(0,G.jsxs)(jv,{maxWidth:`max-w-2xl`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(Qi,{className:`size-5 text-primary`}),(0,G.jsxs)(Mv,{className:`truncate`,children:[i(`keys.testModels`),` · `,n]})]}),(0,G.jsx)(Av,{"aria-label":i(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),o?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`common.loading`)}):s.length===0?(0,G.jsx)($D,{title:i(`keys.noModelsForProvider`)}):(0,G.jsx)(`ul`,{className:`max-h-[60vh] divide-y overflow-y-auto rounded-2xl border`,"data-testid":`test-models-list`,children:s.map(e=>{let t=c[e.id];return(0,G.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2 text-sm ${e.enabled?``:`opacity-60`}`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium`,children:e.displayName}),(0,G.jsx)(`code`,{className:`block truncate text-[11px] text-muted-foreground`,title:e.modelId,children:e.modelId})]}),t?.result&&!t.loading&&(t.result.success?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-emerald-600 tabular-nums`,role:`status`,children:[(0,G.jsx)(Ni,{className:`size-3.5`}),i(`keys.testPassedShort`),` · `,t.result.latencyMs,`ms`]}):(0,G.jsxs)(`span`,{className:`inline-flex max-w-[260px] items-center gap-1 text-xs text-destructive`,role:`status`,title:t.result.error,children:[(0,G.jsx)(Mi,{className:`size-3.5 flex-shrink-0`}),(0,G.jsxs)(`span`,{className:`truncate`,children:[i(`keys.testFailedShort`),t.result.error?` · ${t.result.error}`:``]})]})),(0,G.jsx)(J,{size:`xs`,variant:`outline`,disabled:t?.loading,onClick:()=>void u(e),"aria-label":`${i(`keys.testModel`)} ${e.displayName}`,children:t?.loading?(0,G.jsx)(la,{className:`size-3 animate-spin`}):i(`keys.testModel`)})]},e.id)})})]})})}function qk(e){let t=`${e.open?`open`:`closed`}:${e.initialPlatform??``}:${e.initialKeyId??``}`;return(0,G.jsx)(Jk,{...e},t)}function Jk({open:e,onOpenChange:t,initialPlatform:n,initialKeyId:r}){let{t:i}=Z(),a=Rr(),[o,s]=(0,v.useState)(n??`groq`),[c,l]=(0,v.useState)(r==null?``:String(r)),{data:u=[]}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`),enabled:e&&o===`custom`}),d=u.filter(e=>e.platform===`custom`&&e.baseUrl),f=d.find(e=>String(e.id)===c),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(!1),P=ei({mutationFn:async e=>X(`/api/models`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{a.invalidateQueries({queryKey:[`models`]}),a.invalidateQueries({queryKey:[`fallback`]}),a.invalidateQueries({queryKey:[`keys`]}),pv.success(i(`keys.modelAddedSuccess`)),t(!1)},onError:e=>{pv.error((e instanceof Error?e.message:null)||i(`keys.modelAddFailed`))}}),F=e=>{e.preventDefault(),N(!0);let t=p.trim();if(!t||!o||o===`custom`&&!f)return;let n={platform:o,modelId:t,displayName:h.trim()||void 0,supportsVision:O,supportsTools:A};if(o===`custom`&&(n.keyId=f.id),_){let e=parseInt(_,10);!isNaN(e)&&e>0&&(n.contextWindow=e)}if(b){let e=parseInt(b,10);!isNaN(e)&&e>0&&(n.rpmLimit=e)}if(S){let e=parseInt(S,10);!isNaN(e)&&e>0&&(n.rpdLimit=e)}if(w){let e=parseInt(w,10);!isNaN(e)&&e>0&&(n.tpmLimit=e)}if(E){let e=parseInt(E,10);!isNaN(e)&&e>0&&(n.tpdLimit=e)}P.mutate(n)},I=[...iO,aO];return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,children:[(0,G.jsxs)(`div`,{className:`mb-5 flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Pa,{className:`size-5 text-primary`}),(0,G.jsx)(Mv,{children:i(`keys.addCustomModel`)})]}),(0,G.jsx)(Av,{"aria-label":i(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:F,className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{htmlFor:`provider-platform-select`,children:i(`keys.provider`)}),(0,G.jsx)(`select`,{id:`provider-platform-select`,value:o,onChange:e=>{s(e.target.value),l(``)},className:`flex h-9 w-full rounded-xl border border-input bg-background px-3 py-1.5 text-sm text-foreground shadow-sm transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,children:I.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),o===`custom`&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{htmlFor:`provider-endpoint-key`,children:i(`keys.paneCustomEndpoint`)}),(0,G.jsxs)(`select`,{id:`provider-endpoint-key`,value:c,onChange:e=>l(e.target.value),"aria-invalid":M&&!f,className:`flex h-9 w-full rounded-xl border border-input bg-background px-3 py-1.5 text-sm`,children:[(0,G.jsx)(`option`,{value:``,children:i(`keys.selectKey`)}),d.map(e=>(0,G.jsxs)(`option`,{value:String(e.id),children:[e.label||e.baseUrl,` (`,e.baseUrl,`)`]},e.id))]}),d.length===0&&(0,G.jsx)(gn,{to:`/keys`,className:`text-sm text-primary underline`,children:i(`keys.addCustom`)}),M&&!f&&(0,G.jsx)(__,{error:i(`keys.selectKey`)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(z_,{htmlFor:`provider-model-id`,children:[i(`keys.modelId`),` `,(0,G.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,G.jsx)(L_,{id:`provider-model-id`,value:p,onChange:e=>m(e.target.value),placeholder:`e.g. meta-llama/llama-3.3-70b-instruct`,"aria-invalid":M&&!p.trim()}),M&&!p.trim()&&(0,G.jsx)(__,{error:i(`keys.modelIdRequired`)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{htmlFor:`provider-display-name`,children:i(`keys.modelDisplayName`)}),(0,G.jsx)(L_,{id:`provider-display-name`,value:h,onChange:e=>g(e.target.value),placeholder:`e.g. Llama 3.3 70B (Custom)`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{htmlFor:`provider-context-window`,children:i(`keys.modelContextWindow`)}),(0,G.jsx)(L_,{id:`provider-context-window`,type:`number`,min:`1`,value:_,onChange:e=>y(e.target.value),placeholder:`e.g. 128000`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5 pt-1`,children:[(0,G.jsx)(z_,{className:`text-xs font-semibold tracking-wider text-muted-foreground uppercase`,children:i(`keys.modelRateLimits`)}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(z_,{htmlFor:`provider-rpm-limit`,className:`text-xs text-muted-foreground`,children:i(`models.limitRpm`)}),(0,G.jsx)(L_,{id:`provider-rpm-limit`,type:`number`,min:`1`,value:b,onChange:e=>x(e.target.value),placeholder:i(`models.limitRpmHint`),className:`h-8 text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(z_,{htmlFor:`provider-rpd-limit`,className:`text-xs text-muted-foreground`,children:i(`models.limitRpd`)}),(0,G.jsx)(L_,{id:`provider-rpd-limit`,type:`number`,min:`1`,value:S,onChange:e=>C(e.target.value),placeholder:i(`models.limitRpdHint`),className:`h-8 text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(z_,{htmlFor:`provider-tpm-limit`,className:`text-xs text-muted-foreground`,children:i(`models.limitTpm`)}),(0,G.jsx)(L_,{id:`provider-tpm-limit`,type:`number`,min:`1`,value:w,onChange:e=>T(e.target.value),placeholder:i(`models.limitTpmHint`),className:`h-8 text-xs`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(z_,{htmlFor:`provider-tpd-limit`,className:`text-xs text-muted-foreground`,children:i(`models.limitTpd`)}),(0,G.jsx)(L_,{id:`provider-tpd-limit`,type:`number`,min:`1`,value:E,onChange:e=>D(e.target.value),placeholder:i(`models.limitTpdHint`),className:`h-8 text-xs`})]})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 pt-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-border/60 bg-card/60 p-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(z_,{htmlFor:`switch-tools`,className:`text-sm font-medium`,children:i(`keys.modelSupportsTools`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`keys.modelSupportsToolsHint`)})]}),(0,G.jsx)(xD,{id:`switch-tools`,checked:A,onCheckedChange:j})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-border/60 bg-card/60 p-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(z_,{htmlFor:`switch-vision`,className:`text-sm font-medium`,children:i(`keys.modelSupportsVision`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`keys.modelSupportsVisionHint`)})]}),(0,G.jsx)(xD,{id:`switch-vision`,checked:O,onCheckedChange:k})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-3`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:i(`common.cancel`)}),(0,G.jsx)(J,{type:`submit`,disabled:P.isPending,children:P.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(la,{className:`mr-2 size-4 animate-spin`}),i(`common.saving`)]}):i(`keys.createModel`)})]})]})]})})}function Yk({onAddKey:e}){let{t}=Z(),n=Rr(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(new Set),[s,c]=(0,v.useState)(new Map),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(`all`),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(new Set),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(null),{data:A=[],isLoading:j}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)}),{data:M}=$r({queryKey:[`health`],queryFn:()=>X(`/api/health`),refetchInterval:3e4}),{data:N}=$r({queryKey:[`proxy-url`],queryFn:()=>X(`/api/settings/proxy`)}),P=N?.bypassPlatforms??[],F=N?.enabled??!0,I=ei({mutationFn:e=>X(`/api/keys/${e}`,{method:`DELETE`}),onSuccess:()=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`keys-providers`]})}}),L=ei({mutationFn:e=>X(cO(e),{method:`DELETE`}),onSuccess:()=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`fallback`]}),n.invalidateQueries({queryKey:[`models`]}),n.invalidateQueries({queryKey:[`embeddings`]}),n.invalidateQueries({queryKey:[`media`]})}}),R=ei({mutationFn:e=>X(`/api/health/check/${e}`,{method:`POST`}),onSuccess:()=>{n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`keys`]})}}),z=ei({mutationFn:e=>X(`/api/keys/platform/${e}/refresh-models`,{method:`POST`}),onSuccess:e=>{for(let e of[`keys`,`models`,`fallback`,`routing`])n.invalidateQueries({queryKey:[e]});pv.success(t(`keys.syncModelsResult`,{added:e.registered,total:e.modelsAvailable}))},onError:e=>{pv.error(t(`keys.syncModelsFailed`,{reason:e instanceof Error?e.message:String(e)}))}}),B=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/keys/custom/probe`,{method:`POST`,body:JSON.stringify({keyId:e})}),onSuccess:e=>{for(let e of[`keys`,`health`,`fallback`])n.invalidateQueries({queryKey:[e]});n.invalidateQueries({queryKey:[`fallback`,`routing`]});let r=e=>t(e===void 0?`keys.probeCapUnknown`:e?`keys.probeCapYes`:`keys.probeCapNo`),i=t(`keys.probeCapabilities`,{reasoning:r(e.reasoning),tools:r(e.toolCalls)});pv.success(`${t(`keys.probeSuccess`,{model:e.modelId,latency:e.latencyMs})} — ${i}`)},onError:e=>{pv.error(t(`keys.probeFailed`,{reason:e instanceof Error?e.message:String(e)}))}}),V=ei({mutationFn:({platform:e,enabled:t})=>X(`/api/keys/platform/${e}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),onSuccess:()=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`fallback`]})}}),H=ei({mutationFn:({id:e,enabled:t})=>X(`/api/keys/${e}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),onSuccess:()=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`fallback`]})}}),U=ei({meta:{silenceToast:!0},mutationFn:async({ids:e,action:t})=>{let n=await Promise.allSettled(e.map(e=>t===`delete`?X(`/api/keys/${e}`,{method:`DELETE`}):X(`/api/keys/${e}`,{method:`PATCH`,body:JSON.stringify({enabled:t===`enable`})})));return{action:t,done:n.filter(e=>e.status===`fulfilled`).length,failed:n.filter(e=>e.status===`rejected`).length}},onSuccess:({action:e,done:r,failed:i})=>{for(let e of[`keys`,`health`,`fallback`])n.invalidateQueries({queryKey:[e]});e===`delete`&&n.invalidateQueries({queryKey:[`keys-providers`]});let a=t(e===`delete`?`keys.bulkDeleteResult`:`keys.bulkResult`,{done:r,failed:i});i>0?pv.error(a):pv.success(a)}}),ee=ei({mutationFn:e=>{let t=P.includes(e)?P.filter(t=>t!==e):[...P,e];return X(`/api/settings/proxy`,{method:`PUT`,body:JSON.stringify({bypassPlatforms:t})})},onSuccess:()=>n.invalidateQueries({queryKey:[`proxy-url`]})});function W(e){i(e.id)}function te(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let ne=new Map;for(let e of M?.keys??[])ne.set(e.id,e);let re=e=>ne.get(e.id)?.status??e.status,ie=[...iO,aO].map(e=>({...e,keys:A.filter(t=>t.platform===e.value)})).filter(e=>e.keys.length>0),ae=ie.length,oe=ie.reduce((e,t)=>e+t.keys.length,0),se=l.trim().toLowerCase();function ce(e){let t=e.keys.some(e=>e.enabled),n=e.keys.some(e=>re(e)!==`healthy`);switch(d){case`healthy`:return t&&!n;case`issues`:return n;case`disabled`:return!t;default:return!0}}let le=ie.map(e=>{if(!se||e.label.toLowerCase().includes(se))return e;let t=e.keys.filter(e=>ak(e,se));return{...e,keys:t}}).filter(e=>e.keys.length>0&&ce(e));function ue(e){if(se)return!0;let t=s.get(e.value);return t===void 0?e.keys.some(e=>re(e)!==`healthy`)||ie.length<=3:t}function de(e,t){c(n=>{let r=new Map(n);return r.set(e,!t),r})}return j?(0,G.jsx)(rk,{rows:4}):A.length===0?(0,G.jsx)($D,{icon:ia,title:t(`keys.noProviderKeys`),action:(0,G.jsxs)(J,{size:`sm`,onClick:e,children:[(0,G.jsx)(wa,{className:`size-3.5`}),t(`keys.addKey`)]})}):(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,G.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,G.jsx)(Aa,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(L_,{value:l,onChange:e=>u(e.target.value),placeholder:t(`keys.filterPlaceholder`),className:`h-8 pl-8`})]}),(0,G.jsx)(ZD,{value:d,onValueChange:f,options:[{value:`all`,label:t(`keys.filterAll`)},{value:`healthy`,label:t(`keys.filterHealthy`)},{value:`issues`,label:t(`keys.filterIssues`)},{value:`disabled`,label:t(`keys.filterDisabled`)}],ariaLabel:t(`keys.filterAll`)}),(0,G.jsx)(`span`,{className:`flex-1`}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t(`keys.providerCountSummary`,{providers:ae,keys:oe})})]}),le.length===0?(0,G.jsx)($D,{title:t(`keys.noFilterMatch`)}):(0,G.jsx)(`div`,{className:`space-y-4`,children:le.map(e=>{let n=ue(e),r=e.keys.filter(e=>re(e)===`healthy`).length,i=e.keys.filter(e=>re(e)!==`healthy`).length,o=e.keys.some(e=>w.has(e.id));return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 pb-2`,children:[(0,G.jsx)(xD,{checked:e.keys.some(e=>e.enabled),onCheckedChange:t=>V.mutate({platform:e.value,enabled:t}),disabled:V.isPending}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>de(e.value,n),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,"aria-expanded":n,children:[(0,G.jsx)(`h3`,{className:`text-sm font-medium`,children:e.label}),(0,G.jsx)(nO,{variant:`secondary`,className:`tabular-nums`,children:e.keys.length}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[r>0&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),t(`keys.summaryHealthy`,{count:r})]}),i>0&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-rose-500`}),t(i===1?`keys.summaryIssueOne`:`keys.summaryIssueOther`,{count:i})]})]})]}),(0,G.jsxs)(Mg,{children:[(0,G.jsx)(Ng,{className:el({variant:`ghost`,size:`icon-xs`}),"aria-label":t(`keys.providerActions`),children:(0,G.jsx)(Ki,{})}),(0,G.jsxs)(Pg,{align:`end`,className:`w-52`,children:[e.value!==`custom`&&(0,G.jsxs)(Fg,{onClick:()=>D({platform:e.value,label:e.label}),children:[t(`keys.testModels`),(0,G.jsx)(Qi,{className:`ml-auto size-3.5`})]}),(0,G.jsxs)(Fg,{onClick:()=>k({platform:e.value}),children:[t(`keys.addCustomModel`),(0,G.jsx)(Pa,{className:`ml-auto size-3.5`})]}),e.url&&(0,G.jsxs)(Fg,{onClick:()=>window.open(e.url,`_blank`,`noopener,noreferrer`),children:[t(`keys.getApiKey`),(0,G.jsx)(Ji,{className:`ml-auto size-3.5`})]}),F&&(0,G.jsx)(zg,{checked:!P.includes(e.value),onCheckedChange:()=>ee.mutate(e.value),closeOnClick:!1,children:t(`keys.routeViaProxy`)})]})]}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>de(e.value,n),"aria-label":t(n?`common.hide`:`common.show`),className:el({variant:`ghost`,size:`icon-xs`}),children:(0,G.jsx)(Ti,{className:`size-4 text-muted-foreground transition-transform ${n?``:`-rotate-90`}`})})]}),(()=>{let n=e.keys.filter(e=>w.has(e.id));if(n.length===0)return null;let r=()=>T(e=>{let t=new Set(e);return n.forEach(e=>t.delete(e.id)),t}),i=e=>{U.mutate({ids:n.map(e=>e.id),action:e}),r()};return(0,G.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 rounded-lg border bg-muted/40 px-3 py-1.5 text-xs`,children:[(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:t(`keys.bulkSelected`,{count:n.length})}),(0,G.jsx)(J,{size:`xs`,variant:`outline`,disabled:U.isPending,onClick:()=>i(`enable`),children:t(`keys.bulkEnable`)}),(0,G.jsx)(J,{size:`xs`,variant:`outline`,disabled:U.isPending,onClick:()=>i(`disable`),children:t(`keys.bulkDisable`)}),(0,G.jsx)(gO,{variant:`outline`,size:`xs`,className:`text-muted-foreground hover:text-destructive`,confirmLabel:t(`keys.bulkDeleteConfirm`,{count:n.length}),onConfirm:()=>i(`delete`),disabled:U.isPending,children:t(`keys.bulkDelete`)}),(0,G.jsx)(J,{size:`xs`,variant:`ghost`,onClick:r,children:t(`common.dismiss`)})]})})(),n&&(0,G.jsx)(`div`,{className:`rounded-xl border divide-y bg-card overflow-hidden sm:rounded-2xl`,children:e.keys.map(e=>{let n=re(e),r=ne.get(e.id),i=r?.lastCheckedAt??e.lastCheckedAt,s=r?.lastHealthError??e.lastHealthError,c=e.models??[],l=c.length>0,u=a.has(e.id),d=R.isPending&&R.variables===e.id;return(0,G.jsxs)(`div`,{className:`bg-card`,children:[(0,G.jsxs)(`div`,{className:`group/krow flex items-center gap-2 px-3 py-2.5 hover:bg-muted/40 transition-colors sm:gap-3 sm:px-4 sm:py-3`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:w.has(e.id),onChange:t=>{T(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})},"aria-label":t(`keys.selectKey`),className:`size-3.5 flex-shrink-0 accent-foreground cursor-pointer transition-opacity focus-visible:opacity-100 ${o?`opacity-100`:`opacity-0 group-hover/krow:opacity-100`}`}),(0,G.jsx)(xD,{size:`sm`,checked:e.enabled,onCheckedChange:t=>H.mutate({id:e.id,enabled:t}),disabled:H.isPending&&H.variables?.id===e.id,"aria-label":t(`keys.enable`)}),(0,G.jsx)(`span`,{className:`size-1.5 rounded-full flex-shrink-0 ${lO[n]??lO.unknown}`}),l&&(0,G.jsx)(J,{type:`button`,variant:`ghost`,size:`xs`,className:`size-6 p-0 text-muted-foreground`,onClick:()=>te(e.id),title:t(u?`common.hide`:`common.show`),children:(0,G.jsx)(Ti,{className:`size-3 transition-transform ${u?`rotate-180`:``}`})}),(0,G.jsx)(`code`,{className:`text-xs font-mono flex-shrink-0 ${e.enabled?``:`opacity-50`}`,children:e.maskedKey}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>W(e),title:t(`keys.editKey`),className:`max-w-[140px] truncate rounded text-xs hover:text-foreground hover:underline underline-offset-2 sm:max-w-[220px] ${e.label?`text-muted-foreground`:`text-muted-foreground/50`} ${e.enabled?``:`opacity-50`}`,children:e.label||t(`keys.editKey`)}),e.baseUrl&&(0,G.jsx)(`code`,{className:`text-[11px] text-muted-foreground font-mono truncate max-w-[150px] sm:max-w-[260px] ${e.enabled?``:`opacity-50`}`,title:e.baseUrl,children:e.baseUrl}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground ${e.enabled?``:`opacity-50`}`,children:uO[n]?t(uO[n]):n}),(e.modelScope?.length??0)>0&&(0,G.jsx)(nO,{variant:`secondary`,className:`text-[10px] text-muted-foreground ${e.enabled?``:`opacity-50`}`,title:e.modelScope.join(`, `),children:t(e.modelScope.length===1?`keys.modelScopeBadgeOne`:`keys.modelScopeBadgeOther`,{count:e.modelScope.length})}),(0,G.jsx)(`div`,{className:`flex-1`}),i&&(0,G.jsx)(`span`,{className:`text-[11px] text-muted-foreground tabular-nums`,children:$c(i,{hour:`2-digit`,minute:`2-digit`})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5 opacity-0 transition-opacity group-hover/krow:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100`,children:[(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>W(e),"aria-label":t(`keys.editKey`),title:t(`keys.editKey`),children:(0,G.jsx)(Sa,{className:`size-3`})}),!e.keyless&&(0,G.jsx)(SD,{text:t(`keys.editModels`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>C(e.id),"aria-label":t(`keys.editModels`),title:t(`keys.editModels`),children:(0,G.jsx)(aa,{className:`size-3`})})}),!e.keyless&&(0,G.jsx)(SD,{text:t(`keys.copyFullKey`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>y({id:e.id,maskedKey:e.maskedKey}),"aria-label":t(`keys.copyFullKey`),children:(0,G.jsx)(Wi,{className:`size-3`})})}),e.platform!==`custom`&&e.modelDiscovery&&(0,G.jsx)(SD,{text:t(`keys.discoverModels`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>m({keyId:e.id,builtin:!0}),"aria-label":t(`keys.discoverModels`),children:(0,G.jsx)(sa,{className:`size-3`})})}),e.platform===`custom`&&e.baseUrl&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(SD,{text:t(`keys.addKey`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>g(e.baseUrl),"aria-label":t(`keys.addKey`),children:(0,G.jsx)(ia,{className:`size-3`})})}),(0,G.jsx)(SD,{text:t(`keys.discoverModels`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>m({keyId:e.id,builtin:!1}),"aria-label":t(`keys.discoverModels`),children:(0,G.jsx)(sa,{className:`size-3`})})}),(0,G.jsx)(SD,{text:t(`keys.addCustomModel`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>k({platform:`custom`,keyId:e.id}),"aria-label":t(`keys.addCustomModel`),children:(0,G.jsx)(Pa,{className:`size-3`})})}),(0,G.jsx)(SD,{text:t(`keys.testModels`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>D({platform:`custom`,keyId:e.id,label:e.label||e.baseUrl}),"aria-label":t(`keys.testModels`),children:(0,G.jsx)(Qi,{className:`size-3`})})}),(0,G.jsx)(SD,{text:t(`keys.probeNow`),children:(0,G.jsx)(gO,{variant:`ghost`,size:`icon-xs`,armedSize:`xs`,confirmLabel:t(`keys.probeConfirm`),onConfirm:()=>B.mutate(e.id),disabled:B.isPending,title:t(`keys.probeNow`),"aria-label":t(`keys.probeNow`),children:(0,G.jsx)(Ga,{className:`size-3 ${B.isPending?`animate-pulse`:``}`})})})]}),!e.keyless&&(0,G.jsx)(SD,{text:t(`keys.modelScope`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>x(e.id),"aria-label":t(`keys.modelScope`),children:(0,G.jsx)(oa,{className:`size-3`})})}),(0,G.jsx)(SD,{text:t(`keys.syncModels`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>z.mutate(e.platform),disabled:z.isPending,"aria-label":t(`keys.syncModels`),children:(0,G.jsx)(Ta,{className:`size-3 ${z.isPending&&z.variables===e.platform?`animate-spin`:``}`})})}),(0,G.jsx)(SD,{text:t(`keys.checkNow`),children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>R.mutate(e.id),disabled:R.isPending,"aria-label":t(`keys.checkNow`),children:(0,G.jsx)(Ea,{className:`size-3 ${d?`animate-spin`:``}`})})}),(0,G.jsx)(gO,{variant:`ghost`,size:`icon-xs`,armedSize:`xs`,className:`text-muted-foreground hover:text-destructive`,confirmLabel:t(`keys.confirmRemove`),onConfirm:()=>I.mutate(e.id),disabled:I.isPending,title:t(`common.remove`),"aria-label":t(`common.remove`),children:(0,G.jsx)(Ba,{className:`size-3`})})]})]}),s&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2 px-3 pb-3 pl-6 text-xs text-destructive sm:px-4 sm:pl-8`,role:`status`,children:[(0,G.jsx)(Mi,{className:`mt-0.5 size-3.5 flex-shrink-0`}),(0,G.jsx)(`span`,{className:`break-words`,title:s,children:s})]}),l&&u&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5 border-t bg-muted/20 px-3 py-2.5 pl-8 sm:gap-2 sm:px-4 sm:py-3 sm:pl-12`,children:c.map(e=>{let n=sO(e);return(0,G.jsxs)(`div`,{className:`inline-flex min-w-0 items-center gap-2 rounded-md border bg-background px-2 py-1 text-[11px]`,children:[(0,G.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:t(oO[e.kind])}),(0,G.jsx)(`span`,{className:`max-w-[180px] truncate font-medium`,title:e.modelId,children:e.displayName}),e.family&&(0,G.jsx)(`code`,{className:`max-w-[160px] truncate text-muted-foreground`,title:e.family,children:e.family}),(0,G.jsx)(gO,{className:`h-5 px-1 text-muted-foreground hover:text-destructive`,disabled:L.isPending,onConfirm:()=>L.mutate(e),title:t(`common.remove`),"aria-label":t(`common.remove`),children:(0,G.jsx)(Ba,{className:`size-3`})})]},n)})})]},e.id)})})]},e.value)})}),p!==null&&(0,G.jsx)(Ak,{open:!0,onOpenChange:e=>{e||m(null)},endpoint:{keyId:p.keyId},builtin:p.builtin}),h!==null&&(0,G.jsx)(jk,{open:!0,onOpenChange:e=>{e||g(null)},baseUrl:h}),E!==null&&(0,G.jsx)(Kk,{platform:E.platform,keyId:E.keyId,label:E.label,onOpenChange:e=>{e||D(null)}}),O!==null&&(0,G.jsx)(qk,{open:!0,initialPlatform:O.platform,initialKeyId:O.keyId,onOpenChange:e=>{e||k(null)}}),_!==null&&(0,G.jsx)(Nk,{keyId:_.id,maskedKey:_.maskedKey,onOpenChange:e=>{e||y(null)}}),(()=>{let e=b===null?void 0:A.find(e=>e.id===b);return e?(0,G.jsx)(Hk,{apiKey:e,onOpenChange:e=>{e||x(null)}}):null})(),(()=>{let e=S===null?void 0:A.find(e=>e.id===S);return e?(0,G.jsx)(Vk,{apiKey:e,onOpenChange:e=>{e||C(null)}}):null})(),(()=>{let e=r===null?void 0:A.find(e=>e.id===r);return e?(0,G.jsx)(Lk,{apiKey:e,onOpenChange:e=>{e||i(null)}}):null})()]})}function Xk({onAddKey:e}){let{t}=Z(),[n,r]=(0,v.useState)(!1),{data:i}=$r({queryKey:[`keys-providers`],queryFn:()=>X(`/api/keys/providers`)});if(!i||i.providers.length===0)return null;let a=i.providers.filter(e=>!e.configured),o=t(`keys.checklistSummary`,{configured:i.summary.configured,total:i.summary.total});return a.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,className:`flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[o,(0,G.jsx)(Ti,{className:`size-3.5 transition-transform ${n?``:`-rotate-90`}`})]}),n&&(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:a.map(n=>{let r=iO.find(e=>e.value===n.platform)?.url;return(0,G.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[(0,G.jsx)(SD,{text:n.keyless?t(`keys.checklistKeylessTip`):t(`keys.checklistNoKeyTip`),children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>e(n.platform),className:`inline-flex h-5 items-center gap-1 rounded-4xl border border-border pr-1.5 pl-2 text-xs font-medium whitespace-nowrap transition-all hover:bg-muted focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 ${r&&!n.keyless?`pr-7`:``}`,children:[(0,G.jsx)(wa,{className:`size-3 text-muted-foreground`}),n.name,n.keyless?(0,G.jsxs)(`span`,{className:`inline-flex text-muted-foreground`,children:[(0,G.jsx)(ua,{className:`size-3.5`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:t(`keys.checklistKeyless`)})]}):(0,G.jsxs)(`span`,{className:`inline-flex text-amber-600 dark:text-amber-400`,children:[(0,G.jsx)(ia,{className:`size-3.5`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:t(`models.noKey`)})]})]})}),r&&!n.keyless&&(0,G.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,title:t(`keys.checklistSignupLink`,{provider:n.name}),"aria-label":t(`keys.checklistSignupLink`,{provider:n.name}),className:`absolute right-1 inline-flex text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground`,children:(0,G.jsx)(Ji,{className:`size-3`,"aria-hidden":`true`})})]},n.platform)})})]})}function Zk({value:e,options:t,onSelect:n,ariaLabel:r,placeholder:i,emptyText:a,header:o,footer:s,align:c=`end`,triggerClassName:l,triggerPlaceholder:u,ariaInvalid:d}){let{t:f}=Z(),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(0),b=h.trim().toLowerCase(),x=b?t.filter(e=>`${e.label} ${e.sub??``} ${e.value} ${(e.platforms??[]).join(` `)}`.toLowerCase().includes(b)):t,S=t.find(t=>t.value===e)?.label??e;function C(e){n(e),m(!1),g(``)}function w(e){e.key===`ArrowDown`?(e.preventDefault(),y(e=>Math.min(e+1,x.length-1))):e.key===`ArrowUp`?(e.preventDefault(),y(e=>Math.max(e-1,0))):e.key===`Enter`&&x[_]&&(e.preventDefault(),C(x[_].value))}return(0,G.jsxs)(s_,{open:p,onOpenChange:e=>{m(e),e?y(0):g(``)},children:[(0,G.jsxs)(c_,{"aria-label":r,"aria-invalid":d||void 0,className:l??`flex h-8 w-[260px] items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-input bg-transparent px-3 text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30`,children:[(0,G.jsx)(`span`,{className:`truncate ${S?``:`text-muted-foreground`}`,title:S||void 0,children:S||u}),(0,G.jsx)(ji,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,G.jsxs)(l_,{align:c,className:`w-[300px] p-0`,onKeyDown:w,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3`,children:[(0,G.jsx)(Aa,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`input`,{autoFocus:!0,value:h,onChange:e=>{g(e.target.value),y(0)},placeholder:i,"aria-label":i,className:`h-9 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),o,(0,G.jsxs)(`div`,{className:`max-h-72 overflow-y-auto p-1`,children:[x.length===0?(0,G.jsx)(`div`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:a}):x.map((t,n)=>(0,G.jsxs)(`button`,{type:`button`,onMouseEnter:()=>y(n),onClick:()=>C(t.value),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground ${t.value===e?`bg-accent/50`:n===_?`bg-muted`:``}`,children:[(0,G.jsx)(wi,{className:`size-4 shrink-0 ${t.value===e?`opacity-100`:`opacity-0`}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate ${t.note?`opacity-50`:``}`,title:t.label,children:t.label}),t.note&&(0,G.jsx)(`span`,{className:`rounded px-1 py-0.5 text-[9px] font-semibold uppercase leading-none tracking-wide bg-amber-500/15 text-amber-600 dark:text-amber-400`,children:t.note}),t.isNew&&(0,G.jsx)(`span`,{className:`rounded px-1 py-0.5 text-[9px] font-semibold uppercase leading-none tracking-wide bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`,children:f(`models.newBadge`)}),t.sub&&((t.platforms?.length??0)>1?(0,G.jsx)(SD,{text:f(`models.servedBy`,{providers:(t.platforms??[]).join(`
49
+ `)}),children:(0,G.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground underline decoration-dotted underline-offset-2`,children:t.sub})}):(0,G.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:t.sub}))]},t.value)),s]})]})]})}function Qk({onSuccess:e,initialPlatform:t}){let{t:n}=Z(),r=Rr(),[i,a]=(0,v.useState)(t??``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),{data:g=[]}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)}),_=(0,v.useMemo)(()=>new Set(g.map(e=>e.platform)),[g]),[y,b]=(0,v.useState)(!1),{data:x=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)});function S(e,t,n){if(typeof e!=`number`)return;let r=iO.find(e=>e.value===t);if(!r||r.keyless&&!n.trim())return;let i=Rk(x,t);if(zk(i))return{keyId:e,platformLabel:r.label,candidates:i}}let C=(0,v.useMemo)(()=>iO.filter(e=>!y||!_.has(e.value)||e.value===i).map(e=>({value:e.value,label:e.label,sub:_.has(e.value)?n(`keys.discoverAlreadyAdded`):void 0})),[y,_,i,n]),w=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/keys`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:(t,i)=>{r.invalidateQueries({queryKey:[`keys`]}),r.invalidateQueries({queryKey:[`health`]}),r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`keys-providers`]}),pv.success(n(`keys.keyAdded`)),t?.notice&&pv.info(t.notice),e(S(t?.id,i.platform,i.key))}}),T=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/keys/import-selected`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:t=>{for(let e of[`keys`,`health`,`fallback`,`keys-providers`])r.invalidateQueries({queryKey:[e]});pv.success(n(`keys.importResult`,{imported:t.imported,failed:t.total-t.imported})),e()}}),E=i===`cloudflare`,D=iO.find(e=>e.value===i)?.keyless??!1,O=!D&&!E,k=m&&O,A=k?[...new Set(o.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean))]:[],j=i?null:n(`validation.required`),M=k?A.length===0?n(`validation.required`):null:!D&&!o.trim()?n(`validation.required`):null,N=E&&!c.trim()?n(`validation.required`):null,P=w.isPending||T.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),j||M||N){p(!0);return}if(p(!1),k){T.mutate({keys:A.map(e=>({platform:i,keyValue:e,keyName:u||void 0}))});return}let t=D?o.trim():E?`${c}:${o}`:o;w.mutate({platform:i,key:t,label:u||void 0})},className:`flex flex-wrap gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.platform`)}),(0,G.jsx)(Zk,{value:i,options:C,onSelect:e=>a(e),ariaLabel:n(`keys.platform`),triggerPlaceholder:n(`keys.selectPlatform`),placeholder:n(`keys.filterPlaceholder`),emptyText:n(`keys.noFilterMatch`),align:`start`,ariaInvalid:f&&!!j,triggerClassName:`flex h-8 w-[220px] items-center justify-between gap-2 whitespace-nowrap rounded-lg border bg-transparent px-3 text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30 ${f&&j?`border-destructive`:`border-input`}`,header:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,G.jsx)(`input`,{id:`hide-added-platforms`,type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`size-3.5 accent-foreground`}),(0,G.jsx)(`label`,{htmlFor:`hide-added-platforms`,className:`text-xs text-muted-foreground`,children:n(`keys.hideAdded`)})]})}),f&&(0,G.jsx)(__,{error:j}),(()=>{let e=iO.find(e=>e.value===i);return e?.url?(0,G.jsx)(`div`,{className:`pt-0.5`,children:(0,G.jsx)(rO,{url:e.url})}):null})()]}),E&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.accountId`)}),(0,G.jsx)(L_,{value:c,onChange:e=>l(e.target.value),placeholder:`a1b2c3d4…`,className:`w-[200px] font-mono text-xs`,"aria-invalid":f&&!!N}),f&&(0,G.jsx)(__,{error:N})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5 flex-1 min-w-[240px]`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(E?`keys.apiToken`:`keys.customApiKey`)}),O&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:`text-[11px] underline-offset-2 hover:underline ${k?`text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:n(`keys.pasteSeveral`)})]}),k?(0,G.jsx)(vO,{value:o,onChange:e=>s(e.target.value),placeholder:`gsk_first…
50
+ gsk_second…`,rows:3,className:`font-mono text-xs`,"aria-invalid":f&&!!M}):(0,G.jsx)(L_,{type:`password`,value:o,onChange:e=>s(e.target.value),placeholder:n(D?`keys.keyOptionalPlaceholder`:E?`keys.bearerTokenPlaceholder`:`keys.pasteKeyPlaceholder`),className:`font-mono text-xs`,"aria-invalid":f&&!!M}),f&&(0,G.jsx)(__,{error:M}),D&&(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n(`keys.keyOptionalHint`)})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.label`)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center space-x-3`,children:[(0,G.jsx)(L_,{value:u,onChange:e=>d(e.target.value),placeholder:n(`keys.customDisplayNameOptional`),className:`w-[160px]`}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:P,children:P?n(`keys.adding`):k&&A.length>1?n(`keys.importSelected`,{count:A.length}):D&&!o.trim()?n(`keys.enable`):n(`keys.addKey`)})]})]})]}),(w.isError||T.isError)&&(0,G.jsx)(`p`,{className:`text-destructive text-xs mt-2`,children:(w.error??T.error).message})]})}function $k({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,G.jsx)(`table`,{"data-slot":`table`,className:Zc(`w-full caption-bottom text-sm`,e),...t})})}function eA({className:e,...t}){return(0,G.jsx)(`thead`,{"data-slot":`table-header`,className:Zc(`[&_tr]:border-b`,e),...t})}function tA({className:e,...t}){return(0,G.jsx)(`tbody`,{"data-slot":`table-body`,className:Zc(`[&_tr:last-child]:border-0`,e),...t})}function nA({className:e,...t}){return(0,G.jsx)(`tr`,{"data-slot":`table-row`,className:Zc(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function rA({className:e,...t}){return(0,G.jsx)(`th`,{"data-slot":`table-head`,className:Zc(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function iA({className:e,...t}){return(0,G.jsx)(`td`,{"data-slot":`table-cell`,className:Zc(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function aA({onImported:e}={}){let{t}=Z(),n=Rr(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),l=[...iO.filter(e=>!e.keyless),aO];function u(e){return e.detectedPlatform===`custom`?e.baseUrl?`custom`:``:l.some(t=>t.value===e.detectedPlatform)?e.detectedPlatform:``}let d=ei({meta:{silenceToast:!0},mutationFn:async e=>{let t=new FormData;return e.forEach(e=>t.append(`files`,e)),X(`/api/keys/preview`,{method:`POST`,body:t})},onSuccess:e=>{o(e.keys.map(e=>{let t=u(e);return{...e,platform:t,selected:t!==``&&!e.isDuplicate,visible:!1,isDuplicate:e.isDuplicate??!1}})),c(e.skipped)}}),f=ei({meta:{silenceToast:!0},mutationFn:e=>X(`/api/keys/import-selected`,{method:`POST`,body:JSON.stringify({keys:e})}),onSuccess:r=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`fallback`]}),n.invalidateQueries({queryKey:[`keys-providers`]}),e&&(pv.success((r.modelsRegistered??0)>0?t(`keys.importResultWithModels`,{imported:r.imported,models:r.modelsRegistered,failed:r.errors.length}):t(`keys.importResult`,{imported:r.imported,failed:r.errors.length})),e())}}),p=a.filter(e=>e.selected&&e.platform&&e.keyValue.trim()).map(e=>({keyName:e.keyName,keyValue:e.keyValue,platform:e.platform,...e.baseUrl?{baseUrl:e.baseUrl}:{},...e.models?.length?{models:e.models}:{}}));function m(e,t){o(n=>n.map((n,r)=>r===e?{...n,...t}:n))}function h(e){let t=Array.from(e.target.files??[]);i(t),o([]),c([]),d.reset(),f.reset()}let g=(0,G.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>d.mutate(r),disabled:r.length===0||d.isPending,children:[(0,G.jsx)(Ha,{className:`size-3.5`}),d.isPending?t(`keys.previewing`):t(`keys.previewFiles`)]}),_=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-[260px] flex-1 space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.importFiles`)}),(0,G.jsx)(L_,{type:`file`,multiple:!0,accept:`.env,.json,.jsonc,.md,.txt,.csv`,onChange:h,className:`cursor-pointer text-xs file:mr-2`})]}),r.length>0&&(0,G.jsx)(`span`,{className:`pb-1 text-xs text-muted-foreground`,children:t(`keys.importFileCount`,{count:r.length})})]}),d.isError&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-destructive`,children:d.error.message}),a.length>0&&(0,G.jsx)(`div`,{className:`mt-4 overflow-x-auto rounded-2xl border`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(rA,{className:`w-10`,children:t(`keys.selected`)}),(0,G.jsx)(rA,{children:t(`keys.provider`)}),(0,G.jsx)(rA,{children:t(`keys.keyName`)}),(0,G.jsx)(rA,{children:t(`keys.keyValue`)})]})}),(0,G.jsx)(tA,{children:a.map((e,n)=>(0,G.jsxs)(nA,{className:e.isDuplicate?`bg-muted/50`:``,children:[(0,G.jsx)(iA,{children:(0,G.jsx)(`input`,{type:`checkbox`,checked:e.selected,disabled:e.isDuplicate,onChange:()=>m(n,{selected:!e.selected}),className:`size-4 accent-primary`})}),(0,G.jsx)(iA,{children:(0,G.jsxs)(ZO,{value:e.platform,onValueChange:e=>m(n,{platform:e,selected:!0}),children:[(0,G.jsx)($O,{className:`w-[190px]`,children:(0,G.jsx)(QO,{placeholder:t(`keys.chooseProvider`)})}),(0,G.jsx)(ek,{children:l.map(e=>(0,G.jsx)(tk,{value:e.value,children:e.label},e.value))})]})}),(0,G.jsx)(iA,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(L_,{value:e.keyName,onChange:e=>m(n,{keyName:e.target.value}),className:`w-[220px] font-mono text-xs`}),e.isDuplicate&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-medium text-amber-600 dark:text-amber-400`,children:t(`keys.duplicate`)}),(e.models?.length??0)>0&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:t(`keys.importModelCount`,{count:e.models.length})})]})}),(0,G.jsx)(iA,{children:(0,G.jsxs)(`div`,{className:`flex min-w-[280px] items-center gap-2`,children:[(0,G.jsx)(L_,{type:e.visible?`text`:`password`,value:e.keyValue,onChange:e=>m(n,{keyValue:e.target.value}),className:`font-mono text-xs`}),(0,G.jsx)(J,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>m(n,{visible:!e.visible}),children:e.visible?t(`common.hide`):t(`common.show`)})]})})]},`${e.keyName}:${n}`))})]})}),a.length===0&&d.isSuccess&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`keys.noPreviewKeys`)}),s.length>0&&(0,G.jsxs)(`div`,{className:`mt-3 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:t(`keys.skippedItems`)}),(0,G.jsxs)(`span`,{children:[` `,s.slice(0,5).join(`, `)]}),s.length>5&&(0,G.jsxs)(`span`,{children:[` `,t(`keys.moreItems`,{count:s.length-5})]})]}),a.length>0&&(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[a.some(e=>e.isDuplicate)&&(0,G.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,children:t(`keys.duplicatesFound`,{count:a.filter(e=>e.isDuplicate).length})}),(0,G.jsx)(J,{type:`button`,size:`sm`,onClick:()=>f.mutate(p),disabled:p.length===0||f.isPending,children:f.isPending?t(`keys.importing`):t(`keys.importSelected`,{count:p.length})}),p.length===0&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`keys.noImportSelection`)})]}),f.isError&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-destructive`,children:f.error.message})]});return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`keys.importKeysDescription`)}),g]}),_]})}function oA(e){let t=new Set;return e.split(/[\n,]+/).map(e=>e.trim()).filter(e=>e.length>0&&!t.has(e)&&t.add(e))}function sA({onAdded:e}={}){let{t}=Z(),n=Rr(),[r,i]=(0,v.useState)(`chat`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!0),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),S=r===`chat`?oA(s):[s.trim()].filter(Boolean),C=r===`chat`&&S.length>1,[w,T]=(0,v.useState)(!1),E=a.trim()?B_(a)?null:t(`validation.url`):t(`validation.required`),D=S.length===0?t(`validation.required`):null,{data:O}=$r({queryKey:[`embeddings`],queryFn:()=>X(`/api/embeddings`)}),k=ei({meta:{silenceToast:!0},mutationFn:({path:e,body:t})=>X(e,{method:`POST`,body:JSON.stringify(t)}),onSuccess:()=>{n.invalidateQueries({queryKey:[`keys`]}),n.invalidateQueries({queryKey:[`health`]}),n.invalidateQueries({queryKey:[`fallback`]}),n.invalidateQueries({queryKey:[`models`]}),n.invalidateQueries({queryKey:[`embeddings`]}),n.invalidateQueries({queryKey:[`media`]}),c(``),u(``),f(``),g(!0),y(!1),e&&(pv.success(t(`keys.modelAdded`)),e())}}),A=e=>{if(e.preventDefault(),E||D){T(!0);return}T(!1);let t={baseUrl:a,model:S[0],displayName:C?void 0:l||void 0,apiKey:p||void 0};if(r===`chat`){k.mutate({path:`/api/keys/custom`,body:{baseUrl:a,models:S,displayName:C?void 0:l||void 0,apiKey:p||void 0,supportsTools:h,supportsVision:_}});return}if(r===`embedding`){k.mutate({path:`/api/embeddings/custom`,body:{...t,family:d||void 0}});return}k.mutate({path:`/api/media/custom`,body:{...t,modality:r}})},j=r===`chat`?`qwen3:4b
51
+ llama3:8b`:r===`embedding`?`text-embedding-3-small`:r===`image`?`gpt-image-1`:r===`transcription`?`Systran/faster-whisper-large-v3`:`gpt-4o-mini-tts`,M=r===`chat`?C?t(`keys.addModels`,{count:S.length}):t(`keys.addModel`):t(r===`embedding`?`keys.addEmbeddingModel`:r===`image`?`keys.addImageModel`:r===`transcription`?`keys.addTranscriptionModel`:`keys.addAudioModel`),N=(0,G.jsxs)(`form`,{onSubmit:A,className:`flex flex-wrap items-end gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customType`)}),(0,G.jsxs)(ZO,{value:r,onValueChange:e=>i(e),children:[(0,G.jsx)($O,{className:`w-[160px]`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`chat`,label:t(`keys.customTypeChat`),children:t(`keys.customTypeChat`)}),(0,G.jsx)(tk,{value:`embedding`,label:t(`keys.customTypeEmbedding`),children:t(`keys.customTypeEmbedding`)}),(0,G.jsx)(tk,{value:`image`,label:t(`keys.customTypeImage`),children:t(`keys.customTypeImage`)}),(0,G.jsx)(tk,{value:`audio`,label:t(`keys.customTypeAudio`),children:t(`keys.customTypeAudio`)}),(0,G.jsx)(tk,{value:`transcription`,label:t(`keys.customTypeTranscription`),children:t(`keys.customTypeTranscription`)})]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5 flex-1 min-w-[240px]`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customBaseUrl`)}),(0,G.jsx)(L_,{value:a,onChange:e=>o(e.target.value),placeholder:`http://127.0.0.1:11434/v1`,className:`font-mono text-xs`,"aria-invalid":w&&!!E}),w&&(0,G.jsx)(__,{error:E})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(r===`chat`?`keys.customModels`:`keys.customModel`)}),r===`chat`&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>x(!0),disabled:!!E,className:`text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline disabled:pointer-events-none disabled:opacity-50`,children:t(`keys.discoverModels`)})]}),(0,G.jsx)(vO,{value:s,onChange:e=>c(e.target.value),placeholder:j,rows:r===`chat`?2:1,className:`w-[200px] font-mono text-xs`,"aria-invalid":w&&!!D}),w&&(0,G.jsx)(__,{error:D})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customDisplayName`)}),(0,G.jsx)(L_,{value:l,onChange:e=>u(e.target.value),placeholder:t(C?`keys.customDisplayNamePerModel`:`keys.customDisplayNameOptional`),disabled:C,className:`w-[150px]`})]}),r===`embedding`&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customFamily`)}),(0,G.jsx)(L_,{value:d,onChange:e=>f(e.target.value),placeholder:O?.families?.[0]?.family??t(`keys.customFamilyPlaceholder`),className:`w-[190px] font-mono text-xs`})]}),r===`chat`&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customCapabilities`)}),(0,G.jsxs)(`div`,{className:`flex h-9 items-center gap-4`,children:[(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,G.jsx)(xD,{size:`sm`,checked:h,onCheckedChange:g}),(0,G.jsx)(`span`,{children:t(`models.tools`)})]}),(0,G.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,G.jsx)(xD,{size:`sm`,checked:_,onCheckedChange:y}),(0,G.jsx)(`span`,{children:t(`models.vision`)})]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:t(`keys.customApiKey`)}),(0,G.jsx)(L_,{type:`password`,value:p,onChange:e=>m(e.target.value),placeholder:t(`keys.customDisplayNameOptional`),className:`w-[150px] font-mono text-xs`})]}),(0,G.jsx)(J,{type:`submit`,size:`sm`,disabled:k.isPending,children:k.isPending?t(`keys.addingCustom`):M})]}),P=k.isError?(0,G.jsx)(`p`,{className:`text-destructive text-xs mt-2`,children:k.error.message}):null;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mb-3`,children:t(`keys.addCustomDescription`)}),N,P,b&&(0,G.jsx)(Ak,{open:b,onOpenChange:x,endpoint:{baseUrl:a,apiKey:p||void 0},onRegistered:e})]})}function cA({keyId:e,platformLabel:t,candidates:n,onOpenChange:r}){let{t:i}=Z(),a=Rr(),o=n.map(e=>e.modelId),[s,c]=(0,v.useState)(()=>new Set(o)),l=ei({meta:{silenceToast:!0},mutationFn:t=>X(`/api/keys/${e}`,{method:`PATCH`,body:JSON.stringify({modelScope:t})}),onSuccess:(e,t)=>{a.invalidateQueries({queryKey:[`keys`]}),pv.success(i(t.length===1?`keys.modelPicker.scopedOne`:`keys.modelPicker.scopedOther`,{count:t.length})),r(!1)}}),u=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},d=o.length>0&&o.every(e=>s.has(e));return(0,G.jsx)(kv,{open:!0,onOpenChange:r,children:(0,G.jsxs)(jv,{maxWidth:`max-w-xl`,children:[(0,G.jsx)(Mv,{children:i(`keys.modelPicker.title`)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i(`keys.modelPicker.hint`,{provider:t})}),(0,G.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-xs font-medium`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:d,onChange:()=>c(d?new Set:new Set(o)),className:`size-4 accent-primary`}),(0,G.jsx)(`span`,{children:i(`keys.discoverSelectAll`)}),(0,G.jsx)(`span`,{className:`ml-auto font-normal text-muted-foreground tabular-nums`,children:i(`keys.modelPicker.count`,{selected:s.size,total:o.length})})]}),(0,G.jsx)(`div`,{className:`mt-2 max-h-[45vh] overflow-y-auto rounded-2xl border divide-y`,children:n.map(e=>(0,G.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 px-3 py-2 text-xs hover:bg-muted/30`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:s.has(e.modelId),onChange:()=>u(e.modelId),className:`size-4 accent-primary`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.modelId,children:e.displayName}),e.sizeLabel&&(0,G.jsx)(`span`,{title:i(`models.sizeLabel`),className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e.sizeLabel}),e.contextWindow!==null&&e.contextWindow>0&&(0,G.jsx)(`span`,{title:i(`models.ctxTitle`),className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground tabular-nums`,children:i(`models.ctxBadge`,{size:yk(e.contextWindow)})})]},e.modelId))}),(0,G.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:i(d?`keys.modelPicker.allNote`:`keys.modelPicker.subsetNote`)}),l.isError&&(0,G.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:l.error.message}),(0,G.jsxs)(`div`,{className:`mt-5 flex items-center justify-end gap-2`,children:[(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>r(!1),disabled:l.isPending,children:i(`keys.modelPicker.skip`)}),(0,G.jsx)(J,{size:`sm`,onClick:()=>{let e=Bk(o,s);if(!e.patch){r(!1);return}l.mutate(e.modelScope)},disabled:s.size===0||l.isPending,children:l.isPending?i(`common.saving`):i(`common.save`)})]})]})})}function lA({open:e,onOpenChange:t,initialPlatform:n}){let{t:r}=Z(),[i,a]=(0,v.useState)(`provider`),o=()=>t(!1),[s,c]=(0,v.useState)(null),l=e=>{o(),c(e??null)},[u,d]=(0,v.useState)(e);return e!==u&&(d(e),e&&n&&a(`provider`)),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-3xl`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsx)(Mv,{children:r(`keys.addKey`)}),(0,G.jsx)(Av,{"aria-label":r(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsx)(ZD,{value:i,onValueChange:a,options:[{value:`provider`,label:r(`keys.paneProviderKey`)},{value:`import`,label:r(`keys.paneImportFile`)},{value:`custom`,label:r(`keys.paneCustomEndpoint`)}],ariaLabel:r(`keys.addKey`),className:`mb-5`}),i===`provider`&&(0,G.jsx)(Qk,{onSuccess:l,initialPlatform:n}),i===`import`&&(0,G.jsx)(aA,{onImported:o}),i===`custom`&&(0,G.jsx)(sA,{onAdded:o})]})}),s&&(0,G.jsx)(cA,{keyId:s.keyId,platformLabel:s.platformLabel,candidates:s.candidates,onOpenChange:()=>c(null)})]})}var uA=[{value:`json`,label:`JSON`,ext:`json`},{value:`env`,label:`.env`,ext:`env`},{value:`csv`,label:`CSV`,ext:`csv`}],dA=`/`.replace(/\/$/,``),fA=typeof window<`u`&&window.__SROUTER_DESKTOP__===!0;async function pA(e,t,n){let r=f_(),i=new URLSearchParams({format:e});t&&i.set(`healthy`,`true`);let a={};r&&(a.Authorization=`Bearer ${r}`),n&&(a[`x-reauth-password`]=n);let o=await fetch(`${dA}/api/keys/export?${i}`,{headers:a});if(!o.ok){let e=await o.json().catch(()=>({error:{message:o.statusText}}));throw Error(e.error?.message??`HTTP ${o.status}`)}let s=await o.blob(),c=uA.find(t=>t.value===e)?.ext??e,l=URL.createObjectURL(s),u=document.createElement(`a`);u.href=l,u.download=`srouter-keys.${c}`,u.click(),URL.revokeObjectURL(l)}function mA({open:e,onOpenChange:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(`json`),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(`options`),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1),{data:h=[]}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)}),g=h.filter(e=>e.exportable),_=a?g.filter(e=>e.status===`healthy`).length:g.length;async function y(e){e?.preventDefault(),m(!0),f(null);try{await pA(r,a,l),pv.success(n(`keys.exportSuccess`,{count:_})),t(!1)}catch(e){f(e.message),u(``)}finally{m(!1)}}return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-md`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsx)(Mv,{children:n(`keys.exportKeys`)}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),s===`password`?(0,G.jsxs)(`form`,{className:`space-y-5`,onSubmit:y,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(z_,{className:`text-xs`,htmlFor:`export-password`,children:n(`auth.password`)}),(0,G.jsx)(L_,{id:`export-password`,type:`password`,autoFocus:!0,autoComplete:`current-password`,placeholder:n(`auth.passwordPlaceholderLogin`),value:l,onChange:e=>u(e.target.value),"aria-invalid":!!d}),(0,G.jsx)(__,{error:d})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/50 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:n(`keys.exportWillExport`)}),(0,G.jsxs)(`span`,{className:`font-medium text-foreground`,children:[_,` `,n(_===1?`keys.exportKey`:`keys.exportKeys plural`)]})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(J,{type:`button`,variant:`outline`,className:`flex-1`,onClick:()=>c(`options`),disabled:p,children:n(`common.cancel`)}),(0,G.jsxs)(J,{type:`submit`,className:`flex-1`,disabled:p||!l,children:[(0,G.jsx)(Gi,{className:`size-3.5`}),n(p?`keys.exporting`:`keys.exportDownload`)]})]})]}):(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.exportFormat`)}),(0,G.jsx)(`div`,{className:`flex gap-2`,children:uA.map(e=>(0,G.jsx)(J,{type:`button`,size:`sm`,variant:r===e.value?`default`:`outline`,onClick:()=>i(e.value),children:e.label},e.value))})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border p-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(z_,{className:`text-xs`,children:n(`keys.exportHealthyOnly`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`keys.exportHealthyOnlyDesc`)})]}),(0,G.jsx)(xD,{size:`sm`,checked:a,onCheckedChange:o})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-muted/50 px-3 py-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:n(`keys.exportWillExport`)}),(0,G.jsxs)(`span`,{className:`font-medium text-foreground`,children:[_,` `,n(_===1?`keys.exportKey`:`keys.exportKeys plural`)]})]}),(0,G.jsxs)(J,{type:`button`,className:`w-full`,onClick:()=>fA?y():c(`password`),disabled:_===0||p,children:[(0,G.jsx)(Gi,{className:`size-3.5`}),n(p?`keys.exporting`:`keys.exportDownload`)]}),fA&&d&&(0,G.jsx)(__,{error:d})]})]})})}var hA=[{key:`default`,labelKey:`keys.familyDefault`},{key:`pro`,labelKey:`keys.familyGeminiPro`},{key:`flash`,labelKey:`keys.familyGeminiFlash`},{key:`flashLite`,labelKey:`keys.familyGeminiFlashLite`}];function gA(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(null),{data:o}=$r({queryKey:[`gemini-map`],queryFn:()=>X(`/api/settings/gemini-map`)}),{data:s}=$r({queryKey:[`agent-compatibility`],queryFn:()=>X(`/api/settings/agent-compatibility`)}),{data:c}=$r({queryKey:[`enable-mcp`],queryFn:()=>X(`/api/settings/enable-mcp`)}),{data:l=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)}),{data:u}=$r({queryKey:[`url-tokens`],queryFn:()=>X(`/api/settings/url-tokens`)}),[d,f]=(0,v.useState)(null),p=d??o?.map??null,m=ei({mutationFn:e=>X(`/api/settings/gemini-map`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{f(null),t.invalidateQueries({queryKey:[`gemini-map`]})}}),h=ei({mutationFn:e=>X(`/api/settings/agent-compatibility`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>t.invalidateQueries({queryKey:[`agent-compatibility`]})}),g=ei({mutationFn:e=>X(`/api/settings/enable-mcp`,{method:`PUT`,body:JSON.stringify({enabled:e})}),onSuccess:()=>t.invalidateQueries({queryKey:[`enable-mcp`]})}),_=ei({mutationFn:()=>X(`/api/settings/url-tokens`,{method:`POST`,body:JSON.stringify({label:n})}),onSuccess:e=>{a(e.token??null),r(``),t.invalidateQueries({queryKey:[`url-tokens`]})}}),y=ei({mutationFn:e=>X(`/api/settings/url-tokens/${e}`,{method:`DELETE`}),onSuccess:()=>t.invalidateQueries({queryKey:[`url-tokens`]})}),b=Array.from(new Map(l.filter(e=>e.enabled).map(e=>[e.modelId,e])).values()).sort((e,t)=>e.displayName.localeCompare(t.displayName)),x=!!d&&!!o&&JSON.stringify(d)!==JSON.stringify(o.map);return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.geminiTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-prose text-xs text-muted-foreground`,children:e(`keys.geminiDesc`)})]}),(0,G.jsx)(J,{size:`sm`,disabled:!x||m.isPending,onClick:()=>d&&m.mutate(d),children:e(`common.save`)})]}),(0,G.jsx)(`div`,{className:`space-y-2`,children:hA.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`w-40 shrink-0 text-xs font-medium`,children:e(t.labelKey)}),(0,G.jsxs)(ZO,{value:p?.[t.key]??`auto`,onValueChange:e=>f(n=>({...n??p??{default:`auto`,pro:`auto`,flash:`auto`,flashLite:`auto`},[t.key]:e})),children:[(0,G.jsx)($O,{className:`w-[320px] max-w-full`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`auto`,children:e(`keys.anthropicAuto`)}),b.map(e=>(0,G.jsx)(tk,{value:e.modelId,children:e.displayName},e.modelId))]})]})]},t.key))})]}),(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.compatibilityTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 mb-4 max-w-prose text-xs text-muted-foreground`,children:e(`keys.compatibilityDesc`)}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:e(`keys.ollamaMode`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.ollamaModeHint`)})]}),(0,G.jsxs)(ZO,{value:s?.ollamaEmulation??`off`,onValueChange:e=>h.mutate({ollamaEmulation:e}),children:[(0,G.jsx)($O,{className:`w-44`,children:(0,G.jsx)(QO,{})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`off`,children:e(`keys.ollamaOff`)}),(0,G.jsx)(tk,{value:`open-loopback`,children:e(`keys.ollamaLoopback`)}),(0,G.jsx)(tk,{value:`key-required`,children:e(`keys.ollamaKeyRequired`)})]})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:e(`keys.claudeAliases`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.claudeAliasesHint`)})]}),(0,G.jsx)(xD,{checked:s?.exposeClaudeDiscoveryAliases??!1,onCheckedChange:e=>h.mutate({exposeClaudeDiscoveryAliases:e})})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:e(`keys.mcpServer`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`keys.mcpServerHint`)})]}),(0,G.jsx)(xD,{checked:c?.enabled??!1,onCheckedChange:e=>g.mutate(e)})]})]})]}),(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`keys.urlTokensTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-prose text-xs text-muted-foreground`,children:e(`keys.urlTokensDesc`)}),(0,G.jsxs)(`div`,{className:`my-4 flex gap-2`,children:[(0,G.jsx)(L_,{value:n,onChange:e=>r(e.target.value),placeholder:e(`keys.urlTokenLabel`),className:`max-w-xs`}),(0,G.jsx)(J,{size:`sm`,onClick:()=>_.mutate(),disabled:_.isPending,children:e(`keys.createUrlToken`)})]}),i&&(0,G.jsxs)(`div`,{className:`mb-4 rounded-xl border border-amber-500/30 bg-amber-500/5 p-3`,children:[(0,G.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:e(`keys.urlTokenOnce`)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`code`,{className:`min-w-0 flex-1 break-all font-mono text-xs`,children:i}),(0,G.jsx)(vv,{text:i,className:`size-7 shrink-0`,label:e(`common.copy`)})]})]}),(0,G.jsx)(`div`,{className:`space-y-2`,children:(u?.tokens??[]).map(t=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-muted/40 px-3 py-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:t.label||t.tokenPrefix}),(0,G.jsx)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:t.tokenPrefix})]}),t.revokedAt?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`keys.revoked`)}):(0,G.jsx)(J,{variant:`outline`,size:`sm`,disabled:y.isPending,onClick:()=>y.mutate(t.id),children:e(`keys.revoke`)})]},t.id))})]})]})}function _A({name:e,className:t}){return(0,G.jsx)(`span`,{className:`inline-block max-w-full truncate rounded-md border px-2 py-0.5 text-[11px] leading-tight font-mono ${t??``}`,title:e,children:e})}function vA({open:e,onOpenChange:t,result:n}){let{t:r}=Z(),[i,a]=(0,v.useState)(()=>n?new Set(n.results.filter(e=>e.error).map(e=>e.platform)):new Set),o=(0,v.useMemo)(()=>[...n?.results??[]].sort((e,t)=>{if(e.error&&!t.error)return-1;if(!e.error&&t.error)return 1;let n=e.registered+e.refreshed+e.retired,r=t.registered+t.refreshed+t.retired;return n>0&&r===0?-1:n===0&&r>0?1:e.platform.localeCompare(t.platform)}),[n?.results]);if(!n)return null;let s=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},c=n.results.filter(e=>e.registered+e.refreshed+e.retired>0).length;return(0,G.jsx)(kv,{open:e,onOpenChange:t,children:(0,G.jsxs)(jv,{maxWidth:`max-w-2xl`,className:`flex flex-col gap-0 p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-5 pt-5 sm:px-6 sm:pt-6`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Mv,{children:r(`keys.syncAllDialogTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground sm:text-sm`,children:r(`keys.syncAllDialogSummary`,{changed:c,total:n.platforms})})]}),(0,G.jsx)(Av,{"aria-label":r(`common.dismiss`),className:`-mr-1 -mt-0.5 shrink-0 rounded-lg p-1.5 text-muted-foreground/60 transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-5 pt-3 sm:px-6`,children:[n.catalogSync&&(n.catalogSync.inserted??0)+(n.catalogSync.removed??0)+(n.catalogSync.updated??0)>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-blue-600 hover:bg-blue-600`,children:[(0,G.jsx)(Ta,{className:`size-3`}),r(`keys.syncAllCatalog`,{inserted:n.catalogSync.inserted??0,removed:n.catalogSync.removed??0,updated:n.catalogSync.updated??0})]}),n.totalRegistered>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-emerald-600 hover:bg-emerald-600`,children:[(0,G.jsx)(wa,{className:`size-3`}),r(`keys.syncAllNew`,{count:n.totalRegistered})]}),n.totalRefreshed>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-amber-500 hover:bg-amber-500`,children:[(0,G.jsx)(Ta,{className:`size-3`}),r(`keys.syncAllUpdated`,{count:n.totalRefreshed})]}),n.totalRetired>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-red-500 hover:bg-red-500`,children:[(0,G.jsx)(ga,{className:`size-3`}),r(`keys.syncAllRetired`,{count:n.totalRetired})]}),n.totalRegistered===0&&n.totalRefreshed===0&&n.totalRetired===0&&(0,G.jsxs)(nO,{variant:`secondary`,className:`gap-1`,children:[(0,G.jsx)(wi,{className:`size-3`}),r(`keys.syncAllNoChanges`)]})]}),(0,G.jsx)(`div`,{className:`mx-5 mt-3 h-px bg-border sm:mx-6`}),(0,G.jsx)(`div`,{className:`mx-5 mt-3 max-h-[50vh] min-h-[3rem] space-y-1.5 overflow-y-auto sm:mx-6`,children:o.map(e=>{let t=e.registered+e.refreshed+e.retired>0,n=!!e.error,a=i.has(e.platform),o=e.newModels.length>0||e.updatedModels.length>0||e.retiredModels.length>0;return(0,G.jsxs)(`div`,{className:`group rounded-xl border transition-all duration-150 ${n?`bg-red-50 dark:bg-red-950/30`:t?`bg-emerald-50/60 dark:bg-emerald-950/20`:`bg-muted/30 hover:bg-muted/50`} ${n?`border-red-200 dark:border-red-800/60`:t?`border-emerald-200/70 dark:border-emerald-800/40`:`border-border/60`}`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-2.5 text-left sm:gap-3 sm:px-4 sm:py-3 ${o?`cursor-pointer`:`cursor-default`}`,onClick:()=>o&&s(e.platform),disabled:!o,children:[o?(0,G.jsx)(Ti,{className:`size-3.5 shrink-0 text-muted-foreground/70 transition-transform duration-200 sm:size-4 ${a?`rotate-180`:``}`}):(0,G.jsx)(`span`,{className:`size-3.5 sm:size-4`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium sm:text-sm`,children:qD(e.platform)}),(0,G.jsx)(`span`,{className:`flex-1`}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:[n&&(0,G.jsxs)(nO,{variant:`destructive`,className:`gap-1 text-[10px] sm:text-xs`,children:[(0,G.jsx)(Mi,{className:`size-3`}),`Error`]}),e.registered>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-emerald-600 text-[10px] hover:bg-emerald-600 sm:text-xs`,children:[(0,G.jsx)(wa,{className:`size-3`}),e.registered,` new`]}),e.refreshed>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-amber-500 text-[10px] hover:bg-amber-500 sm:text-xs`,children:[(0,G.jsx)(Ta,{className:`size-3`}),e.refreshed,` updated`]}),e.retired>0&&(0,G.jsxs)(nO,{variant:`default`,className:`gap-1 border-0 bg-red-500 text-[10px] hover:bg-red-500 sm:text-xs`,children:[(0,G.jsx)(ga,{className:`size-3`}),e.retired,` retired`]}),!t&&!n&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted-foreground sm:text-xs`,children:[e.modelsAvailable,` live`]})]})]}),a&&o&&(0,G.jsxs)(`div`,{className:`border-t border-border/40 px-3 pb-2.5 pt-2 sm:px-4`,children:[e.newModels.length>0&&(0,G.jsxs)(`div`,{className:`mb-2`,children:[(0,G.jsxs)(`span`,{className:`text-[11px] font-medium text-emerald-700 dark:text-emerald-400`,children:[r(`keys.syncAllNewModels`),` (`,e.newModels.length,`)`]}),(0,G.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.newModels.map(e=>(0,G.jsx)(_A,{name:e,className:`border-emerald-200 text-emerald-700 dark:border-emerald-800 dark:text-emerald-400`},e))})]}),e.updatedModels.length>0&&(0,G.jsxs)(`div`,{className:`mb-2`,children:[(0,G.jsxs)(`span`,{className:`text-[11px] font-medium text-amber-700 dark:text-amber-400`,children:[r(`keys.syncAllUpdatedModels`),` (`,e.updatedModels.length,`)`]}),(0,G.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.updatedModels.map(e=>(0,G.jsx)(_A,{name:e,className:`border-amber-200 text-amber-700 dark:border-amber-800 dark:text-amber-400`},e))})]}),e.retiredModels.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`span`,{className:`text-[11px] font-medium text-red-600 dark:text-red-400`,children:[r(`keys.syncAllRetiredModels`),` (`,e.retiredModels.length,`)`]}),(0,G.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.retiredModels.map(e=>(0,G.jsx)(_A,{name:e,className:`border-red-200 text-red-600 line-through dark:border-red-800 dark:text-red-400`},e))})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-2 rounded-lg bg-red-100 px-3 py-2 text-xs text-red-700 dark:bg-red-900/40 dark:text-red-400`,children:e.error})]})]},e.platform)})}),(0,G.jsx)(`div`,{className:`flex items-center justify-end border-t border-border/40 px-5 py-3 sm:px-6`,children:(0,G.jsx)(Av,{className:`inline-flex h-8 items-center justify-center gap-1.5 rounded-lg bg-primary px-4 text-xs font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow outline-none focus-visible:ring-2 focus-visible:ring-ring/50 active:scale-[0.97]`,children:r(`keys.syncAllDialogClose`)})})]})})}var yA=[{id:`providers`,labelKey:`keys.tabProviders`},{id:`quotaSignals`,labelKey:`keys.tabQuotaSignals`},{id:`apiKey`,labelKey:`keys.tabApiKey`},{id:`anthropic`,labelKey:`keys.tabAnthropic`},{id:`agents`,labelKey:`keys.tabAgents`}];function bA(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(`providers`),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!1),m=(e=``)=>{s(e),a(!0)},{data:h=[]}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)}),{data:g}=$r({queryKey:[`health`],queryFn:()=>X(`/api/health`),refetchInterval:3e4}),_=ei({mutationFn:()=>X(`/api/health/check-all`,{method:`POST`}),onSuccess:()=>{t.invalidateQueries({queryKey:[`health`]}),t.invalidateQueries({queryKey:[`keys`]})}}),y=ei({mutationFn:()=>X(`/api/keys/refresh-all-models`,{method:`POST`}),onSuccess:n=>{for(let e of[`keys`,`models`,`fallback`,`routing`])t.invalidateQueries({queryKey:[e]});let r=n.totalRegistered+n.totalRefreshed+n.totalRetired>0,i=n.results.some(e=>e.error);if(r?pv.success(e(`keys.syncAllResult`,{count:n.platforms,registered:n.totalRegistered})):pv.success(e(`keys.syncAllNoChanges`)),i)for(let e of n.results.filter(e=>e.error))pv.error(`${e.platform}: ${e.error}`);d(n),p(!0)},onError:t=>{pv.error(e(`keys.syncAllFailed`,{reason:t instanceof Error?t.message:String(t)}))}});return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`keys.pageTitle`),description:e(`keys.pageDescription`),actions:(0,G.jsxs)(G.Fragment,{children:[(n===`providers`||n===`quotaSignals`)&&h.length>0&&(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>_.mutate(),disabled:_.isPending,children:_.isPending?e(`keys.checking`):e(`keys.checkAll`)}),n===`providers`&&h.length>0&&(0,G.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>y.mutate(),disabled:y.isPending,children:[(0,G.jsx)(Ta,{className:`size-3.5 ${y.isPending?`animate-spin`:``}`}),y.isPending?e(`keys.syncAllPending`):e(`keys.syncAllModels`)]}),h.length>0&&(0,G.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>l(!0),children:[(0,G.jsx)(Gi,{className:`size-3.5`}),e(`keys.export`)]}),n===`providers`&&(0,G.jsxs)(J,{size:`sm`,onClick:()=>m(),children:[(0,G.jsx)(wa,{className:`size-3.5`}),e(`keys.addKey`)]})]}),tabs:(0,G.jsx)(ZD,{value:n,onValueChange:r,options:yA.map(t=>({value:t.id,label:e(t.labelKey)})),ariaLabel:e(`keys.pageTitle`)})}),(0,G.jsxs)(`div`,{className:`space-y-8`,children:[n===`apiKey`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_O,{}),(0,G.jsx)(yO,{}),(0,G.jsx)(mie,{}),(0,G.jsx)(_ie,{})]}),n===`anthropic`&&(0,G.jsx)(xie,{}),n===`agents`&&(0,G.jsx)(gA,{}),n===`quotaSignals`&&(0,G.jsx)(hO,{states:g?.quotaStates??[]}),n===`providers`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xk,{onAddKey:e=>m(e)}),(0,G.jsx)(Yk,{onAddKey:()=>m()})]})]}),(0,G.jsx)(lA,{open:i,onOpenChange:a,initialPlatform:o||void 0}),c&&(0,G.jsx)(mA,{open:c,onOpenChange:l}),(0,G.jsx)(vA,{open:f,onOpenChange:p,result:u})]})}var xA={Frontier:1,Large:2,Medium:3,Small:4};function SA(e){return xA[e??``]??5}function CA(e,t){if(!t)return e.map(e=>({value:e.modelId,label:e.displayName,platform:e.platform,platforms:[e.platform],providerCount:1,sizeTier:SA(e.sizeLabel),intelligenceRank:e.intelligenceRank??999}));let n=new Map;for(let t of e){let e=t.groupKey??t.modelId,r=SA(t.sizeLabel),i=t.intelligenceRank??999,a=n.get(e);a?(a.providerCount++,a.platforms.push(t.platform),(r<a.sizeTier||r===a.sizeTier&&i<a.intelligenceRank)&&(a.sizeTier=r,a.intelligenceRank=i)):n.set(e,{value:t.canonicalId??t.modelId,label:t.groupLabel??t.displayName,platform:t.platform,platforms:[t.platform],providerCount:1,sizeTier:r,intelligenceRank:i})}return[...n.values()]}var wA=`playground.artifactWidth`,TA=.45;function EA(e){return Math.max(320,Math.floor(e-360))}function DA(e,t){return Number.isFinite(e)?Math.round(Math.min(EA(t),Math.max(320,e))):OA(t)}function OA(e){return DA(Math.min(560,e*TA),e)}function kA(e,t){let n=e==null?NaN:Number(e);return Number.isFinite(n)&&n>0?DA(n,t):OA(t)}function AA(e,t,n,r){return DA(e+(t-n),r)}function jA({artifact:e,open:t,width:n,onWidthChange:r,onWidthCommit:i,onClose:a}){let{t:o}=Z(),[s,c]=(0,v.useState)(`preview`),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(null),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=0,t=requestAnimationFrame(()=>{g.current?.offsetWidth,e=requestAnimationFrame(()=>h(!0))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[]);let _=e.title??o(e.kind===`svg`?`playground.artifactSvg`:`playground.artifactHtml`);function y(){let t=new Blob([e.code],{type:$E(e.kind)}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e.filename,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function b(e){e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),p.current={startX:e.clientX,startWidth:n},f(!0)}function x(e){p.current&&r(AA(p.current.startWidth,p.current.startX,e.clientX,window.innerWidth))}function S(e){if(p.current){p.current=null,f(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}i?.(n)}}function C(e){let t=e.key===`ArrowLeft`?24:e.key===`ArrowRight`?-24:0;if(!t)return;e.preventDefault();let a=DA(n+t,window.innerWidth);r(a),i?.(a)}let w=t&&m,T=e=>`inline-flex size-7 items-center justify-center rounded-lg transition-colors ${e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`;return(0,G.jsx)(`div`,{ref:g,className:`relative shrink-0 overflow-hidden ${d?``:`transition-[width] ease-out motion-reduce:transition-none`}`,style:{width:w?n:0,transitionDuration:d?void 0:`280ms`},"data-testid":`artifact-panel`,"data-open":w,"aria-hidden":!t,children:(0,G.jsxs)(`aside`,{className:`absolute inset-y-0 right-0 flex flex-col border-s bg-card`,style:{width:n},"aria-label":_,children:[(0,G.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":o(`playground.artifactResize`),"aria-valuenow":Math.round(n),tabIndex:0,onPointerDown:b,onPointerMove:x,onPointerUp:S,onPointerCancel:S,onKeyDown:C,className:`group/handle absolute inset-y-0 -left-1 z-10 w-2.5 cursor-col-resize outline-none focus-visible:bg-ring/30 ${d?`bg-ring/30`:`hover:bg-ring/20`}`,children:(0,G.jsx)(`div`,{className:`absolute inset-y-0 left-1 w-px bg-transparent transition-colors group-hover/handle:bg-ring/60`})}),(0,G.jsxs)(`div`,{className:`grid shrink-0 grid-cols-[1fr_auto_1fr] items-center gap-2 px-3 py-1.5`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,title:_,children:_}),(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-0.5 rounded-xl border p-0.5`,role:`tablist`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`preview`,"aria-label":o(`playground.artifactPreview`),title:o(`playground.artifactPreview`),className:T(s===`preview`),onClick:()=>c(`preview`),children:(0,G.jsx)(Xi,{className:`size-4`})}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`code`,"aria-label":o(`playground.artifactCode`),title:o(`playground.artifactCode`),className:T(s===`code`),onClick:()=>c(`code`),children:(0,G.jsx)(Vi,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end`,children:[s===`preview`&&(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:()=>u(e=>e+1),"aria-label":o(`playground.artifactReload`),title:o(`playground.artifactReload`),children:(0,G.jsx)(Ea,{className:`size-4`})}),(0,G.jsx)(vv,{text:e.code,label:o(`common.copy`),className:`size-8 border-0 bg-transparent`}),(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:y,"aria-label":o(`playground.artifactDownload`),title:o(`playground.artifactDownload`),children:(0,G.jsx)(Gi,{className:`size-4`})}),(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":o(`playground.artifactClose`),title:o(`playground.artifactClose`),children:(0,G.jsx)(Wa,{className:`size-4`})})]})]}),(0,G.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[s===`preview`?(0,G.jsx)(`iframe`,{title:_,sandbox:QE,srcDoc:ZE(e),className:`h-full w-full border-0 bg-white`},`${e.id}:${l}`):(0,G.jsx)(`pre`,{className:`h-full overflow-auto p-4`,children:(0,G.jsx)(KE,{code:e.code,language:e.language||e.kind})}),d&&(0,G.jsx)(`div`,{className:`absolute inset-0 z-10`,"aria-hidden":`true`})]})]})})}var MA=1024,NA=12e5,PA=3e6,FA=128e3,IA=[`image/png`,`image/jpeg`,`image/webp`,`image/gif`],LA=[`txt`,`md`,`markdown`,`csv`,`tsv`,`json`,`log`],RA=[...IA,...LA.map(e=>`.${e}`)].join(`,`);function zA(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function BA(e){let t=(e.type??``).toLowerCase();if(IA.includes(t))return`image`;let n=zA(e.name);return LA.includes(n)?`text`:!t&&n===``?null:t.startsWith(`text/`)||t===`application/json`?`text`:null}function VA(e,t,n=MA){let r=Math.max(e,t);if(r<=n)return{width:e,height:t};let i=n/r;return{width:Math.max(1,Math.round(e*i)),height:Math.max(1,Math.round(t*i))}}var HA={md:`markdown`,markdown:`markdown`,json:`json`,csv:`csv`,tsv:`tsv`,log:`text`,txt:`text`};function UA(e){return HA[zA(e)]??`text`}function WA(e,t){let n=Math.max(0,...[...t.matchAll(/`+/g)].map(e=>e[0].length)),r="`".repeat(Math.max(3,n+1));return`${e}:\n${r}${UA(e)}\n${t.replace(/\s+$/,``)}\n${r}`}function GA(e,t=[]){return[e.trim(),...t.filter(e=>e.kind===`text`).map(e=>WA(e.name,e.text??``))].filter(Boolean).join(`
52
+
53
+ `)}function KA(e=[]){return e.flatMap(e=>e.kind===`image`&&e.dataUrl?[e.dataUrl]:[])}function qA(e,t=[]){return t.length===0?e:[...e?[{type:`text`,text:e}]:[],...t.map(e=>({type:`image_url`,image_url:{url:e}}))]}function JA(e){let t=e.indexOf(`,`),n=t===-1?e:e.slice(t+1);return Math.floor(n.length*3/4)}function YA(e){return e>=1e6?`${Math.round(e/1e5)/10} MB`:`${Math.round(e/1e3)} KB`}var XA=class extends Error{reason;constructor(e,t){super(t??e),this.reason=e}};async function ZA(e,t){let n=t===`image/png`||t===`image/webp`?[[`image/png`,void 0],[`image/jpeg`,.82],[`image/jpeg`,.6]]:[[`image/jpeg`,.82],[`image/jpeg`,.6]],r=``;for(let[t,i]of n)if(r=e.toDataURL(t,i),JA(r)<=12e5)return r;throw new XA(`too-large`)}async function QA(e){let t;try{t=await createImageBitmap(e)}catch{throw new XA(`unreadable`)}let{width:n,height:r}=VA(t.width,t.height),i=document.createElement(`canvas`);i.width=n,i.height=r;let a=i.getContext(`2d`);if(!a)throw new XA(`unreadable`);return a.drawImage(t,0,0,n,r),t.close?.(),ZA(i,(e.type??``).toLowerCase())}async function $A(e){if(e.size>128e3)throw new XA(`too-large`);try{return await e.text()}catch{throw new XA(`unreadable`)}}function ej(e){let t=[];for(let n of e.split(/\r\n|\r|\n/)){let e=n.trim();!e||e.startsWith(`:`)||e.startsWith(`data:`)&&t.push(e.slice(5).trim())}return t.length>0?t.join(`
54
+ `):null}async function tj(e,t={}){let n=e.getReader(),r=new TextDecoder,i={content:``,reasoning:``,done:!1},a=``,o=e=>{let n=ej(e);if(n===null)return!1;if(n===`[DONE]`)return!0;let r;try{r=JSON.parse(n)}catch{return!1}if(!r||typeof r!=`object`)return!1;let a=r.error;if(a){let e=typeof a.message==`string`?a.message:`Stream error`;return i.error=e,t.onError?.(e),!1}let o=r.usage;o&&typeof o==`object`&&(i.usage=o);let s=r.choices;if(!Array.isArray(s)||s.length===0)return!1;let c=s[0];if(!c||typeof c!=`object`)return!1;typeof c.finish_reason==`string`&&(i.finishReason=c.finish_reason);let l=c.delta;if(!l||typeof l!=`object`)return!1;let u=typeof l.reasoning_content==`string`?l.reasoning_content:typeof l.reasoning==`string`?l.reasoning:``;return u&&(i.reasoning+=u,t.onReasoning?.(u)),typeof l.content==`string`&&l.content.length>0&&(i.content+=l.content,t.onDelta?.(l.content)),!1};try{reading:for(;;){let{done:e,value:t}=await n.read();if(e)break;for(a=(a+r.decode(t,{stream:!0})).replace(/\r\n/g,`
55
+ `);;){let e=a.indexOf(`
56
+
57
+ `);if(e===-1)break;let t=a.slice(0,e);if(a=a.slice(e+2),o(t)){i.done=!0;break reading}}}if(!i.done){a=(a+r.decode()).replace(/\r\n/g,`
58
+ `);for(let e of a.split(`
59
+
60
+ `))if(o(e)){i.done=!0;break}}}finally{try{await n.cancel()}catch{}}return t.onDone?.(i),i}var nj=`absolute inset-y-0 start-0 flex flex-col transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none`;function rj({conversations:e,activeId:t,open:n,onToggle:r,onNew:i,onSelect:a,onRename:o,onDelete:s}){let{t:c}=Z(),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null),[,g]=(0,v.useState)(0);(0,v.useEffect)(()=>{let e=window.setInterval(()=>g(e=>e+1),6e4);return()=>window.clearInterval(e)},[]),(0,v.useEffect)(()=>{l!==null&&h.current?.select()},[l]);let _=e=>{u(e.id),m(e.title)},y=()=>{if(l===null)return;let t=p.trim(),n=e.find(e=>e.id===l);u(null),t&&t!==n?.title&&o(l,t)};return(0,G.jsxs)(`div`,{className:`relative shrink-0 overflow-hidden border-e bg-card transition-[width] duration-200 ease-out motion-reduce:transition-none ${n?`w-60`:`w-11`}`,children:[(0,G.jsxs)(`div`,{className:`${nj} w-11 items-center gap-1 py-3 ${n?`invisible opacity-0`:`visible opacity-100`}`,children:[(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:r,"aria-label":c(`playgroundSessions.showSidebar`),title:c(`playgroundSessions.showSidebar`),children:(0,G.jsx)(Ai,{className:`size-4`})}),(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:i,"aria-label":c(`playgroundSessions.newChat`),title:c(`playgroundSessions.newChat`),children:(0,G.jsx)(Ia,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`${nj} w-60 ${n?`visible opacity-100`:`invisible opacity-0`}`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1.5 border-b border-border/40 px-2 pt-1 pb-2`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:r,"aria-label":c(`playgroundSessions.hideSidebar`),title:c(`playgroundSessions.hideSidebar`),children:(0,G.jsx)(ki,{className:`size-4`})})}),(0,G.jsxs)(J,{variant:`outline`,size:`sm`,className:`w-full justify-center gap-2`,onClick:i,children:[(0,G.jsx)(Ia,{className:`size-4`}),(0,G.jsx)(`span`,{className:`truncate`,children:c(`playgroundSessions.newChat`)})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-1.5`,children:e.length===0?(0,G.jsx)(`p`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:c(`playgroundSessions.empty`)}):(0,G.jsx)(`ul`,{className:`space-y-0.5`,children:e.map(e=>{let n=e.id===t,r=d===e.id;return(0,G.jsx)(`li`,{children:l===e.id?(0,G.jsx)(`input`,{ref:h,value:p,onChange:e=>m(e.target.value),onBlur:y,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),y()),e.key===`Escape`&&(e.preventDefault(),u(null))},"aria-label":c(`playgroundSessions.renamePlaceholder`),placeholder:c(`playgroundSessions.renamePlaceholder`),className:`w-full rounded-lg border bg-background px-2 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring/50`}):(0,G.jsxs)(`div`,{className:`group flex items-center gap-0.5 rounded-lg pr-0.5 transition-colors ${n?`bg-muted`:`hover:bg-muted/60`}`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),onDoubleClick:()=>_(e),className:`min-w-0 flex-1 px-2 py-1.5 text-left`,children:(0,G.jsx)(`span`,{className:`block truncate text-sm`,children:e.title||c(`playgroundSessions.untitled`)})}),(0,G.jsxs)(Mg,{onOpenChange:e=>{e||f(null)},children:[(0,G.jsx)(Ng,{className:`${el({variant:`ghost`,size:`icon-xs`})} shrink-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 data-popup-open:opacity-100 data-pressed:opacity-100`,"aria-label":c(`playgroundSessions.actions`),title:c(`playgroundSessions.actions`),children:(0,G.jsx)(Ki,{className:`size-3.5`})}),(0,G.jsxs)(Pg,{align:`end`,className:`w-40`,children:[(0,G.jsxs)(Fg,{onClick:()=>_(e),children:[(0,G.jsx)(Sa,{}),c(`playgroundSessions.rename`)]}),(0,G.jsxs)(Fg,{variant:`destructive`,closeOnClick:r,onClick:()=>{r?(f(null),s(e.id)):f(e.id)},children:[(0,G.jsx)(Ba,{}),c(r?`common.confirm`:`common.delete`)]})]})]})]})},e.id)})})})]})]})}var ij=`playground.sampling`,aj={temperature:{min:0,max:2,step:.1},topP:{min:0,max:1,step:.05},maxTokens:{min:1,max:1e6,step:1}},oj={temperature:`temperature`,topP:`top_p`,maxTokens:`max_tokens`},sj={temperature:{enabled:!1,value:1},topP:{enabled:!1,value:1},maxTokens:{enabled:!1,value:1024}},cj=[`temperature`,`topP`,`maxTokens`];function lj(e){let t=String(e),n=t.indexOf(`.`);return n===-1?0:t.length-n-1}function uj(e,t){let n=aj[e];if(!Number.isFinite(t))return sj[e].value;let r=Math.min(n.max,Math.max(n.min,t)),i=Math.round((r-n.min)/n.step),a=n.min+i*n.step;return Number(a.toFixed(lj(n.step)))}function dj(e,t){return uj(e,t).toFixed(lj(aj[e].step))}function fj(e,t,n){return{...e,[t]:{...e[t],value:uj(t,n)}}}function pj(e,t,n){return{...e,[t]:{...e[t],enabled:n}}}function mj(e,t){let n=sj[t];if(!e||typeof e!=`object`)return{...n};let r=e;return{enabled:r.enabled===!0,value:typeof r.value==`number`?uj(t,r.value):n.value}}function hj(e){if(!e)return gj(null);try{return gj(JSON.parse(e))}catch{return gj(null)}}function gj(e){let t=e&&typeof e==`object`?e:void 0;return{temperature:mj(t?.temperature,`temperature`),topP:mj(t?.topP,`topP`),maxTokens:mj(t?.maxTokens,`maxTokens`)}}function _j(e){return JSON.stringify(gj(e))}function vj(e){let t={};for(let n of cj){let r=e[n];r.enabled&&(t[oj[n]]=uj(n,r.value))}return t}function yj(e){return cj.filter(t=>e[t].enabled).length}function bj(){try{return hj(localStorage.getItem(ij))}catch{return gj(null)}}function xj(e){try{localStorage.setItem(ij,_j(e))}catch{}}var Sj={temperature:`playground.temperature`,topP:`playground.topP`,maxTokens:`playground.maxTokens`},Cj=`absolute inset-y-0 end-0 flex flex-col transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none`;function wj({field:e,settings:t,onChange:n}){let{t:r}=Z(),i=aj[e],a=t[e],o=r(Sj[e]);return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:`playground-sampling-${e}`,className:`flex-1 truncate text-xs font-medium transition-colors ${a.enabled?``:`text-muted-foreground`}`,children:o}),(0,G.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:a.enabled?dj(e,a.value):r(`playground.samplingDefault`)}),(0,G.jsx)(xD,{size:`sm`,"aria-label":o,checked:a.enabled,onCheckedChange:r=>n(pj(t,e,r))})]}),e===`maxTokens`?(0,G.jsx)(`input`,{id:`playground-sampling-${e}`,type:`number`,inputMode:`numeric`,min:i.min,max:i.max,step:i.step,disabled:!a.enabled,value:a.value,onChange:r=>n(fj(t,e,Number(r.target.value))),"aria-label":o,className:`h-8 w-full rounded-lg border border-input bg-transparent px-2.5 font-mono text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30`}):(0,G.jsx)(`input`,{id:`playground-sampling-${e}`,type:`range`,min:i.min,max:i.max,step:i.step,disabled:!a.enabled,value:a.value,onChange:r=>n(fj(t,e,Number(r.target.value))),"aria-label":o,className:`w-full cursor-pointer accent-primary disabled:cursor-not-allowed disabled:opacity-50`})]})}function Tj({open:e,onToggle:t,modelValue:n,modelOptions:r,onSelectModel:i,dictationValue:a,dictationOptions:o,onSelectDictation:s,noTranscription:c,noModels:l,systemPrompt:u,onSystemPromptChange:d,sampling:f,onSamplingChange:p}){let{t:m}=Z(),h=yj(f)>0||u.trim().length>0;return(0,G.jsxs)(`div`,{className:`relative shrink-0 overflow-hidden border-s bg-card transition-[width] duration-200 ease-out motion-reduce:transition-none ${e?`w-72`:`w-11`}`,children:[(0,G.jsxs)(`div`,{className:`${Cj} w-11 items-center gap-1 py-3 ${e?`invisible opacity-0`:`visible opacity-100`}`,children:[(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:t,"aria-label":m(`playground.showSettings`),title:m(`playground.showSettings`),children:(0,G.jsx)(ki,{className:`size-4`})}),h&&(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary/70`})]}),(0,G.jsxs)(`div`,{className:`${Cj} w-72 ${e?`visible opacity-100`:`invisible opacity-0`}`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 px-2.5 py-1`,children:[(0,G.jsx)(`span`,{className:`flex-1 truncate text-xs font-medium text-muted-foreground`,children:m(`settings.title`)}),(0,G.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:t,"aria-label":m(`playground.hideSettings`),title:m(`playground.hideSettings`),children:(0,G.jsx)(Ai,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`span`,{className:`block text-xs font-medium`,children:m(`common.model`)}),(0,G.jsx)(Zk,{value:n,options:r,onSelect:i,ariaLabel:m(`playground.selectModel`),placeholder:m(`playground.searchModels`),emptyText:m(`playground.noModelsFound`),align:`end`,triggerClassName:`flex h-8 w-full items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-input bg-transparent px-3 text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30`,footer:l?(0,G.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground`,children:m(`playground.noModels`)}):void 0})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`span`,{className:`block text-xs font-medium`,children:m(`playground.dictationModel`)}),c?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:m(`playground.dictationUnavailable`)}):(0,G.jsx)(Zk,{value:a,options:o,onSelect:s,ariaLabel:m(`playground.dictationModel`),placeholder:m(`playground.searchModels`),emptyText:m(`playground.noModelsFound`),align:`end`,triggerClassName:`flex h-8 w-full items-center justify-between gap-2 whitespace-nowrap rounded-lg border border-input bg-transparent px-3 text-sm outline-none transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/30`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`label`,{htmlFor:`playground-system-prompt`,className:`flex items-center gap-1.5 text-xs font-medium`,children:[m(`playground.systemPromptLabel`),u.trim()&&(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary/70`})]}),(0,G.jsx)(`textarea`,{id:`playground-system-prompt`,value:u,onChange:e=>d(e.target.value),placeholder:m(`playground.systemPromptPlaceholder`),rows:4,className:`max-h-64 min-h-[88px] w-full resize-y rounded-lg border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring/50`})]}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`block text-xs font-medium`,children:m(`playground.samplingHeading`)}),(0,G.jsx)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:m(`playground.samplingHelp`)})]}),cj.map(e=>(0,G.jsx)(wj,{field:e,settings:f,onChange:p},e))]})]})]})]})}var Ej=(0,v.createContext)(null);function Dj(){let e=(0,v.useContext)(Ej);if(!e)throw Error(`<Gooey.Item> must be rendered inside a <Gooey> group.`);return e}var Oj=`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 60 -29.5`;function kj({i:e,s:t}){let n=[],r=`bin`;return t.spread!==0&&(n.push((0,G.jsx)(`feMorphology`,{in:r,operator:t.spread>0?`erode`:`dilate`,radius:Math.abs(t.spread),result:`s${e}-er`},`er`)),r=`s${e}-er`),(t.x!==0||t.y!==0)&&(n.push((0,G.jsx)(`feOffset`,{in:r,dx:t.x,dy:t.y,result:`s${e}-o`},`o`)),r=`s${e}-o`),t.blur>0&&(n.push((0,G.jsx)(`feGaussianBlur`,{in:r,stdDeviation:t.blur/2,result:`s${e}-b`},`b`)),r=`s${e}-b`),n.push((0,G.jsx)(`feComposite`,{in:`bin`,in2:r,operator:`out`,result:`s${e}-band`},`band`),(0,G.jsx)(`feFlood`,{floodColor:t.color,result:`s${e}-c`},`c`),(0,G.jsx)(`feComposite`,{in:`s${e}-c`,in2:`s${e}-band`,operator:`in`,result:`s${e}`},`f`)),(0,G.jsx)(G.Fragment,{children:n})}function Aj({i:e,s:t}){let n=[],r=`shape`;return t.spread!==0&&(n.push((0,G.jsx)(`feMorphology`,{in:`bin`,operator:t.spread>0?`dilate`:`erode`,radius:Math.abs(t.spread),result:`s${e}-sp`},`sp`)),r=`s${e}-sp`),t.blur>0&&(n.push((0,G.jsx)(`feGaussianBlur`,{in:r,stdDeviation:t.blur/2,result:`s${e}-b`},`b`)),r=`s${e}-b`),(t.x!==0||t.y!==0)&&(n.push((0,G.jsx)(`feOffset`,{in:r,dx:t.x,dy:t.y,result:`s${e}-o`},`o`)),r=`s${e}-o`),n.push((0,G.jsx)(`feFlood`,{floodColor:t.color,result:`s${e}-c`},`c`),(0,G.jsx)(`feComposite`,{in:`s${e}-c`,in2:r,operator:`in`,result:`s${e}`},`f`)),(0,G.jsx)(G.Fragment,{children:n})}function jj({blur:e,contrast:t,shadows:n,waviness:r=0,wavinessFreq:i=.018}){let a=r>0,o=Math.round((.5-5/12*t)*100)/100;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:e,result:`blur`}),(0,G.jsx)(`feColorMatrix`,{in:`blur`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${t} ${o}`,result:`goo`}),(0,G.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`goo`,operator:`atop`,result:a?`shape-raw`:`shape`}),a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:i,numOctaves:2,seed:`7`,result:`wave-noise`}),(0,G.jsx)(`feDisplacementMap`,{in:`shape-raw`,in2:`wave-noise`,scale:r*2,xChannelSelector:`R`,yChannelSelector:`G`,result:`shape`})]}),n.some(e=>e.inset||e.spread!==0)&&(0,G.jsx)(`feColorMatrix`,{in:`shape`,type:`matrix`,values:Oj,result:`bin`}),n.map((e,t)=>e.inset?(0,G.jsx)(kj,{i:t,s:e},t):(0,G.jsx)(Aj,{i:t,s:e},t)),n.length>0&&(0,G.jsxs)(`feMerge`,{children:[n.map((e,t)=>e.inset?-1:t).filter(e=>e>=0).reverse().map(e=>(0,G.jsx)(`feMergeNode`,{in:`s${e}`},e)),(0,G.jsx)(`feMergeNode`,{in:`shape`}),n.map((e,t)=>e.inset?(0,G.jsx)(`feMergeNode`,{in:`s${t}`},t):null)]})]})}var Mj={blur:7,contrast:40,reach:.8,fade:17,warp:0,mix:1,mixBlur:8,gravity:1.9,waviness:12};function Nj(){let e=new Set,t=new Set,n=()=>t.forEach(e=>e());return{register(t){return e.add(t),n(),()=>{e.delete(t),n()}},subscribe(e){return t.add(e),()=>t.delete(e)},entries:()=>[...e]}}function Pj(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=getComputedStyle(t),a=parseFloat(i.borderTopLeftRadius)||0;return{x:r.left-n.left,y:r.top-n.top,w:r.width,h:r.height,r:Math.min(a,r.width/2,r.height/2)}}var Fj=e=>`${Math.round(e.x*2)},${Math.round(e.y*2)},${Math.round(e.w)},${Math.round(e.h)},${Math.round(e.r)}`;function Ij(e,t=14){let[n,r]=(0,v.useState)(e),i=(0,v.useRef)({value:e,target:e,raf:0,last:0});return(0,v.useEffect)(()=>{let n=i.current;if(n.target=e,n.raf)return;n.last=performance.now();let a=e=>{let i=Math.min(.05,(e-n.last)/1e3);n.last=e;let o=1-Math.exp(-t*i);n.value+=(n.target-n.value)*o,Math.abs(n.value-n.target)<.004&&(n.value=n.target),r(n.value),n.raf=n.value===n.target?0:requestAnimationFrame(a)};return n.raf=requestAnimationFrame(a),()=>{n.raf&&cancelAnimationFrame(n.raf),n.raf=0}},[e,t]),n}function Lj({a:e,b:t,srcA:n,srcB:r,opts:i,width:a,height:o}){let s=`lgm-${(0,v.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,{blur:c,contrast:l,reach:u,fade:d,warp:f,mix:p,mixBlur:m,gravity:h,waviness:g}=i,_={x:e.x+e.w/2,y:e.y+e.h/2},y={x:t.x+t.w/2,y:t.y+t.h/2},b=Math.max(0,Math.hypot(Math.max(Math.abs(_.x-y.x)-(e.w+t.w)/2,0),Math.max(Math.abs(_.y-y.y)-(e.h+t.h)/2,0))),x=Math.max(0,Math.min(1,1-b/Math.max(8,c*2.6))),S=Ij(x*x*(3-2*x)),C=Math.round((.5-5/12*l)*100)/100,w=Math.hypot(e.w,e.h)/2*u*S,T=Math.hypot(t.w,t.h)/2*u*S,E={x:(_.x+y.x)/2,y:(_.y+y.y)/2},D=y.x-_.x,O=y.y-_.y,k=Math.max(.001,Math.hypot(D,O)),A=-O/k,j=D/k,M=Math.max(0,(e.w+t.w)/2-Math.abs(D)),N=Math.max(0,(e.h+t.h)/2-Math.abs(O)),P=.5*(M*Math.abs(A)+N*Math.abs(j))*S,F=Math.round(Math.atan2(j,A)*180/Math.PI),I=Math.round(p*S*100)/100,L=Math.round((2+(c-2)*S)*10)/10,R=Math.round(f*S*10)/10,z=Math.round(L*2.5*10)/10,B=Math.round((.4+(2+c*.8)*S)*10)/10,V=`translate(${e.x}, ${e.y})`,H=`translate(${t.x}, ${t.y})`;return(0,G.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,"data-gooey-imagemelt":``,width:a,height:o,viewBox:`0 0 ${a} ${o}`,style:{position:`absolute`,inset:0,overflow:`visible`,pointerEvents:`none`},children:[(0,G.jsxs)(`defs`,{children:[(0,G.jsx)(`pattern`,{id:`${s}-pa`,patternUnits:`userSpaceOnUse`,width:e.w,height:e.h,children:(0,G.jsx)(`image`,{href:n,width:e.w,height:e.h,preserveAspectRatio:`xMidYMid slice`})}),(0,G.jsx)(`pattern`,{id:`${s}-pb`,patternUnits:`userSpaceOnUse`,width:t.w,height:t.h,children:(0,G.jsx)(`image`,{href:r,width:t.w,height:t.h,preserveAspectRatio:`xMidYMid slice`})}),(0,G.jsxs)(`filter`,{id:`${s}-goo`,x:`-15%`,y:`-15%`,width:`130%`,height:`130%`,colorInterpolationFilters:`sRGB`,children:[(0,G.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:L,result:`b`}),(0,G.jsx)(`feColorMatrix`,{in:`b`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${l} ${C}`,result:`goo`}),(0,G.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:z,result:`bc`}),(0,G.jsx)(`feComposite`,{in:`bc`,in2:`goo`,operator:`in`,result:`mix`}),(0,G.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:(2+g*1.2)/1e3,numOctaves:`2`,seed:`4`,result:`wn`}),(0,G.jsx)(`feDisplacementMap`,{in:`mix`,in2:`wn`,scale:R,xChannelSelector:`R`,yChannelSelector:`G`,result:`warped`}),(0,G.jsx)(`feComposite`,{in:`warped`,in2:`warped`,operator:`over`,result:`s1`}),(0,G.jsx)(`feComposite`,{in:`s1`,in2:`s1`,operator:`over`,result:`s2`}),(0,G.jsx)(`feComposite`,{in:`s2`,in2:`s2`,operator:`over`,result:`solid`}),(0,G.jsx)(`feGaussianBlur`,{in:`solid`,stdDeviation:`0.6`})]}),(0,G.jsx)(`filter`,{id:`${s}-soft`,x:`-60%`,y:`-60%`,width:`220%`,height:`220%`,children:(0,G.jsx)(`feGaussianBlur`,{stdDeviation:d})}),I>.01&&(0,G.jsxs)(`filter`,{id:`${s}-marble`,x:`-25%`,y:`-25%`,width:`150%`,height:`150%`,colorInterpolationFilters:`sRGB`,children:[(0,G.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:m,result:`c`}),(0,G.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:`0.011`,numOctaves:`2`,seed:`5`,result:`n1`}),(0,G.jsx)(`feDisplacementMap`,{in:`c`,in2:`n1`,scale:I*90,xChannelSelector:`R`,yChannelSelector:`G`,result:`d1`}),(0,G.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:`0.019`,numOctaves:`2`,seed:`11`,result:`n2`}),(0,G.jsx)(`feDisplacementMap`,{in:`d1`,in2:`n2`,scale:I*50,xChannelSelector:`R`,yChannelSelector:`G`,result:`d2`}),(0,G.jsx)(`feComposite`,{in:`d2`,in2:`d2`,operator:`over`,result:`m1`}),(0,G.jsx)(`feComposite`,{in:`m1`,in2:`m1`,operator:`over`,result:`m2`}),(0,G.jsx)(`feGaussianBlur`,{in:`m2`,stdDeviation:`0.6`,result:`marble`}),(0,G.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:L,result:`mb`}),(0,G.jsx)(`feColorMatrix`,{in:`mb`,type:`matrix`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${l} ${C}`,result:`mg`}),(0,G.jsx)(`feTurbulence`,{type:`fractalNoise`,baseFrequency:(2+g*1.2)/1e3,numOctaves:`2`,seed:`4`,result:`mwn`}),(0,G.jsx)(`feDisplacementMap`,{in:`mg`,in2:`mwn`,scale:R,xChannelSelector:`R`,yChannelSelector:`G`,result:`mshape`}),(0,G.jsx)(`feComposite`,{in:`marble`,in2:`mshape`,operator:`in`})]}),I>.01&&(0,G.jsx)(`mask`,{id:`${s}-marblemask`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:a,height:o,children:(0,G.jsx)(`g`,{filter:`url(#${s}-soft)`,children:(0,G.jsx)(`ellipse`,{cx:E.x,cy:E.y,rx:(w+T)/2+P,ry:(w+T)/2*h,transform:`rotate(${F}, ${E.x}, ${E.y})`,fill:`#fff`})})}),(0,G.jsx)(`filter`,{id:`${s}-edge`,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:(0,G.jsx)(`feGaussianBlur`,{stdDeviation:B})}),(0,G.jsxs)(`mask`,{id:`${s}-ma`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:a,height:o,children:[(0,G.jsx)(`g`,{filter:`url(#${s}-edge)`,children:(0,G.jsx)(`g`,{transform:V,children:(0,G.jsx)(`rect`,{width:e.w,height:e.h,rx:e.r,fill:`#fff`})})}),(0,G.jsx)(`g`,{filter:`url(#${s}-soft)`,children:(0,G.jsx)(`ellipse`,{cx:E.x,cy:E.y,rx:T+P,ry:T,transform:`rotate(${F}, ${E.x}, ${E.y})`,fill:`#000`})})]}),(0,G.jsxs)(`mask`,{id:`${s}-mb`,maskUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:a,height:o,children:[(0,G.jsx)(`g`,{filter:`url(#${s}-edge)`,children:(0,G.jsx)(`g`,{transform:H,children:(0,G.jsx)(`rect`,{width:t.w,height:t.h,rx:t.r,fill:`#fff`})})}),(0,G.jsx)(`g`,{filter:`url(#${s}-soft)`,children:(0,G.jsx)(`ellipse`,{cx:E.x,cy:E.y,rx:w+P,ry:w,transform:`rotate(${F}, ${E.x}, ${E.y})`,fill:`#000`})})]})]}),(0,G.jsxs)(`g`,{filter:`url(#${s}-goo)`,children:[(0,G.jsx)(`g`,{transform:V,children:(0,G.jsx)(`rect`,{width:e.w,height:e.h,rx:e.r,fill:`url(#${s}-pa)`})}),(0,G.jsx)(`g`,{transform:H,children:(0,G.jsx)(`rect`,{width:t.w,height:t.h,rx:t.r,fill:`url(#${s}-pb)`})})]}),I>.01&&(0,G.jsx)(`g`,{mask:`url(#${s}-marblemask)`,children:(0,G.jsxs)(`g`,{filter:`url(#${s}-marble)`,children:[(0,G.jsx)(`g`,{transform:V,children:(0,G.jsx)(`rect`,{width:e.w,height:e.h,rx:e.r,fill:`url(#${s}-pa)`})}),(0,G.jsx)(`g`,{transform:H,children:(0,G.jsx)(`rect`,{width:t.w,height:t.h,rx:t.r,fill:`url(#${s}-pb)`})})]})}),(0,G.jsx)(`g`,{mask:`url(#${s}-ma)`,children:(0,G.jsx)(`g`,{transform:V,children:(0,G.jsx)(`rect`,{width:e.w,height:e.h,rx:e.r,fill:`url(#${s}-pa)`})})}),(0,G.jsx)(`g`,{mask:`url(#${s}-mb)`,children:(0,G.jsx)(`g`,{transform:H,children:(0,G.jsx)(`rect`,{width:t.w,height:t.h,rx:t.r,fill:`url(#${s}-pb)`})})})]})}function Rj({registry:e}){let{getGroup:t}=Dj(),[,n]=(0,v.useState)(0),[r,i]=(0,v.useState)(null),a=(0,v.useRef)(``);(0,v.useEffect)(()=>e.subscribe(()=>n(e=>e+1)),[e]);let o=e.entries().slice(0,2),s=o.length===2;if((0,v.useEffect)(()=>{if(!s){i(null),a.current=``;return}let e=0,n=()=>{let r=t();if(r){let e=Pj(r,o[0].el),t=Pj(r,o[1].el),n=Fj(e)+`|`+Fj(t);n!==a.current&&(a.current=n,i({a:e,b:t}))}e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[s,o[0]?.el,o[1]?.el,t]),!s||!r)return null;let c=t(),l=c?.offsetWidth??0,u=c?.offsetHeight??0;return(0,G.jsx)(Lj,{a:r.a,b:r.b,srcA:o[0].src,srcB:o[1].src,opts:o[0].opts,width:l,height:u})}function zj({src:e,opts:t,registry:n,children:r}){let i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let r=i.current?.firstElementChild;if(!r)return;let a=e??r.querySelector(`img`)?.src??r.src;if(!a)return;let o=r.style.opacity;r.style.opacity=`0`;let s=n.register({el:r,src:a,opts:t});return()=>{r.style.opacity=o,s()}},[e,t,n]),(0,G.jsx)(`span`,{ref:i,style:{display:`contents`},children:r})}var Bj=typeof window<`u`?v.useLayoutEffect:v.useEffect;function Vj(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);t(e.matches);let n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Hj(e,t){let n=0,r=0,i=e;for(;i&&i!==t&&t.contains(i);)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{x:n,y:r}}function Uj(e,t,n){let r=getComputedStyle(e),i=e=>{let r=e.split(` `)[0];return r.endsWith(`%`)?(parseFloat(r)||0)/100*Math.min(t,n):parseFloat(r)||0};return[i(r.borderTopLeftRadius),i(r.borderTopRightRadius),i(r.borderBottomRightRadius),i(r.borderBottomLeftRadius)]}function Wj(e){return typeof e==`number`?[e,e,e,e]:e}function Gj(e,t,n,r,i){let[a,o,s,c]=i.map(e=>Math.max(0,e)),l=Math.min(1,n/Math.max(1e-6,a+o),n/Math.max(1e-6,c+s),r/Math.max(1e-6,a+c),r/Math.max(1e-6,o+s));return a*=l,o*=l,s*=l,c*=l,`M ${e+a} ${t} H ${e+n-o} A ${o} ${o} 0 0 1 ${e+n} ${t+o} V ${t+r-s} A ${s} ${s} 0 0 1 ${e+n-s} ${t+r} H ${e+c} A ${c} ${c} 0 0 1 ${e} ${t+r-c} V ${t+a} A ${a} ${a} 0 0 1 ${e+a} ${t} Z`}var Kj={massStiffness:320,massDamping:17,sizeStiffness:170,sizeDamping:11.5,radiusStiffness:900,radiusDamping:60,contentBlur:7,roundness:1,cornerDuration:460,cornerDelay:0,cornerEase:`cubic-bezier(0.3, 1.05, 0.4, 1)`,anticipation:90,travel:32},qj=new Map;function Jj(e){let t=qj.get(e);if(t)return t;let n=/cubic-bezier\(([^)]+)\)/.exec(e);if(n){let[e,r,i,a]=n[1].split(`,`).map(Number);t=t=>{if(t<=0)return 0;if(t>=1)return 1;let n=0,o=1;for(let r=0;r<24;r++){let r=(n+o)/2;3*r*(1-r)*(1-r)*e+3*r*r*(1-r)*i+r**3<t?n=r:o=r}let s=(n+o)/2;return 3*s*(1-s)*(1-s)*r+3*s*s*(1-s)*a+s**3}}else t=e===`ease-in-out`?Jj(`cubic-bezier(0.42, 0, 0.58, 1)`):e=>Math.min(1,Math.max(0,e));return qj.set(e,t),t}var Yj={stiffness:380,damping:18,stretch:.18,tail:.46,force:.5,bend:0,bendX:0},Xj=3;function Zj(e){return Math.max(0,e.cornerDelay)+Math.max(1,e.cornerDuration)}function Qj(e,t,n){return Math.max(0,Math.min(e,Math.min(t,n)/2))}function $j(e,t,n,r,i,a){let o=t+(r*(n-e)-i*t)*a;return[e+o*a,o]}function eM(e,t,n,r,i,a){let o=Math.max(1,Math.ceil(a*60)),s=a/o,c=e,l=t;for(;o-->0;){let e=$j(c,l,n,r,i,s);c=e[0],l=e[1]}return[c,l]}function tM(e,t){return Math.round(e/t)*t}var nM=`http://www.w3.org/2000/svg`,rM=0;function iM(e){let t=Math.min(1,Math.max(0,e));return t*t*(3-2*t)}function aM(e,t){let n=document.createElementNS(nM,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function oM(e){try{if(!e.complete||!e.naturalWidth)return null;let t=Math.max(2,Math.min(e.naturalWidth,Math.round((e.offsetWidth||40)*3))),n=Math.max(2,Math.min(e.naturalHeight,Math.round((e.offsetHeight||40)*3)));if(e.naturalWidth<=t*1.5)return null;let r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`);if(!i)return null;let a=Math.max(t/e.naturalWidth,n/e.naturalHeight),o=t/a,s=n/a;return i.drawImage(e,(e.naturalWidth-o)/2,(e.naturalHeight-s)/2,o,s,0,0,t,n),r.toDataURL()}catch{return null}}var sM=class{constructor(e){this.getGroup=e,this.gooBlur=6,this.items=new Set,this.awake=!1,this.clean=0,this.raf=0,this.sourcesReady=!1,this.mo=null,this.interval=null,this.removeListeners=[],this.wake=()=>{this.clean=0,!(this.awake||this.items.size===0)&&(this.awake=!0,this.raf=requestAnimationFrame(this.loop))},this.lastNow=0,this.frameEma=17,this.loop=e=>{if(this.items.size===0){this.awake=!1,this.lastNow=0;return}let t=this.lastNow?Math.min(.25,Math.max(1/240,(e-this.lastNow)/1e3)):1/60;if(this.lastNow&&(this.frameEma+=(Math.min(e-this.lastNow,80)-this.frameEma)*.12),this.lastNow=e,this.measureAll(t)?this.clean=0:this.clean++,this.clean>30){this.awake=!1,this.lastNow=0;return}this.raf=requestAnimationFrame(this.loop)}}add(e){let t={...e,baseW:e.target.offsetWidth||1,baseH:e.target.offsetHeight||1,radiusPx:this.resolveRadius(e),last:null,frame:null,lastBlend:null,melt:null,sim:null,motionEnv:0,tPrev:null,tvx:0,tvy:0,lead01:0,cornerT0:0,lastTargetMoveT:0,lastTargetSize:null,morphActive:!1,round01:0,tailEl:null,tailMidA:null,tailMidB:null,tailPhase:0,bendCur:0,bendCurX:0,bendPathEl:null,lastBendD:null,lastBendVars:null,tailX:0,tailY:0,tailVx:0,tailVy:0,tailR:0,contentBlurred:!1,lastPaint:null,lastTail:null,lastBi:e.blobInset??0,biSmooth:null,meltFade:0,meltRel:null,meltOp:1,meltPhase:0,meltPrev:null,meltGeom:null,meltWroteAt:0,meltAxis:null,meltHostLast:null,ro:new ResizeObserver(()=>{t.baseW=e.target.offsetWidth||1,t.baseH=e.target.offsetHeight||1,t.radiusPx=this.resolveRadius(e),this.syncMelt(t),this.wake()})};if(t.ro.observe(e.target),this.items.add(t),this.refreshMelt(t),e.dynamics?.move){let n=aM(`circle`,{cx:`0`,cy:`0`,r:`0`}),r=aM(`circle`,{cx:`0`,cy:`0`,r:`0`}),i=aM(`circle`,{cx:`0`,cy:`0`,r:`0`});e.blob.parentNode?.insertBefore(n,e.blob),e.blob.parentNode?.insertBefore(r,e.blob),e.blob.parentNode?.insertBefore(i,e.blob),t.tailEl=n,t.tailMidA=r,t.tailMidB=i;let a=aM(`path`,{d:``});e.blob.parentNode?.insertBefore(a,e.blob),t.bendPathEl=a}return this.ensureSources(),this.measureAll(),this.wake(),()=>{t.ro.disconnect(),this.items.delete(t),this.clearBlend(t),t.contentBlurred&&t.target.style.removeProperty(`filter`),t.tailEl?.remove(),t.tailMidA?.remove(),t.tailMidB?.remove(),t.bendPathEl?.remove()}}dispose(){cancelAnimationFrame(this.raf),this.mo?.disconnect(),this.removeListeners.forEach(e=>e()),this.removeListeners=[],this.interval&&clearInterval(this.interval),this.items.forEach(e=>e.ro.disconnect()),this.items.clear(),this.awake=!1,this.sourcesReady=!1}resolveRadius(e){return e.radius==null?Uj(e.target,e.target.offsetWidth,e.target.offsetHeight)[0]:e.radius}syncMelt(e){if(!e.blend)return;let t=e.melt,n=e.target,r=n instanceof HTMLImageElement?[n]:Array.from(n.querySelectorAll(`img`));if(!(t&&t.entries.length===r.length&&t.entries.every((e,t)=>e.el===r[t]))){this.refreshMelt(e);return}for(let e of t.entries)e.radiusPx=Uj(e.el,e.el.offsetWidth,e.el.offsetHeight)[0],e.lastGeom=null}refreshMelt(e){let t=e.blend;if(!t)return;let n=t.host;for(;n.firstChild;)n.removeChild(n.firstChild);let r=e.target,i=r instanceof HTMLImageElement?[r]:Array.from(r.querySelectorAll(`img`)),a=`gooey-melt-${++rM}`,o=String(rM*7%100),s=t.zone??this.gooBlur*2.2+4,c=Math.max(.2,t.warpFreq??1),l=Math.min(.3,Math.max(.01,c/(s*1.1))).toFixed(4),u=String(Math.max(1,Math.round(t.detail??2))),d=t.warpStyle??`fractalNoise`,f=aM(`defs`,{}),p=aM(`radialGradient`,{id:`${a}-g`});p.append(aM(`stop`,{offset:`0%`,"stop-color":`#fff`}),aM(`stop`,{offset:`55%`,"stop-color":`#fff`}),aM(`stop`,{offset:`78%`,"stop-color":`#fff`,"stop-opacity":`0.55`}),aM(`stop`,{offset:`100%`,"stop-color":`#fff`,"stop-opacity":`0`})),f.append(p);let m=e=>{let t=aM(`filter`,{id:`${a}-f${e}`,filterUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`0`,height:`0`,"color-interpolation-filters":`sRGB`}),n=aM(`feTurbulence`,{type:d,baseFrequency:l,numOctaves:u,seed:o,result:`noise0`});t.append(n);let r=aM(`feOffset`,{in:`noise0`,dx:`0`,dy:`0`,result:`noise`}),i=aM(`feDisplacementMap`,{in:`SourceGraphic`,in2:`noise`,scale:`0`,xChannelSelector:`R`,yChannelSelector:`G`,result:`disp`});t.append(r);let s=aM(`feGaussianBlur`,{in:`disp`,stdDeviation:`0`,result:`soft`}),c=aM(`feColorMatrix`,{in:`soft`,type:`saturate`,values:`1.2`,result:`col`}),p=aM(`feColorMatrix`,{in:`noise`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1`,result:`erode`}),m=aM(`feComposite`,{in:`col`,in2:`erode`,operator:`in`});t.append(i,s,c,p,m);let h=aM(`mask`,{id:`${a}-m${e}`,maskUnits:`userSpaceOnUse`,x:`-10000`,y:`-10000`,width:`20000`,height:`20000`}),g=aM(`circle`,{cx:`0`,cy:`0`,r:`0`,fill:`url(#${a}-g)`});h.append(g),f.append(t,h);let _=aM(`g`,{});_.setAttribute(`mask`,`url(#${a}-m${e})`),_.setAttribute(`opacity`,`0`);let v=aM(`g`,{});v.setAttribute(`filter`,`url(#${a}-f${e})`);let y=aM(`g`,{});return v.append(y),_.append(v),{filter:t,disp:i,blurEl:s,erode:p,turb:n,noiseOffset:r,circle:g,gl:_,shift:y}},h=Array.from({length:Xj},(e,t)=>m(`l${t}`));n.append(f,...h.map(e=>e.gl));let g=null;if((t.seamBlur??1)>0){let e=aM(`filter`,{id:`${a}-fs`,filterUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`0`,height:`0`,"color-interpolation-filters":`sRGB`}),t=aM(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`0`});e.append(t);let r=aM(`mask`,{id:`${a}-ms`,maskUnits:`userSpaceOnUse`,x:`-10000`,y:`-10000`,width:`20000`,height:`20000`}),i=aM(`circle`,{cx:`0`,cy:`0`,r:`0`,fill:`url(#${a}-g)`});r.append(i),f.append(e,r);let o=aM(`g`,{});o.setAttribute(`mask`,`url(#${a}-ms)`),o.setAttribute(`opacity`,`0`);let s=aM(`g`,{});s.setAttribute(`filter`,`url(#${a}-fs)`),o.append(s),n.insertBefore(o,f.nextSibling),g={gl:o,filter:e,blurEl:t,circle:i}}let _=i.map((e,t)=>{let n=aM(`pattern`,{id:`${a}-p${t}`,patternUnits:`userSpaceOnUse`,x:`0`,y:`0`,width:`1`,height:`1`}),r=aM(`image`,{width:`1`,height:`1`,preserveAspectRatio:`xMidYMid slice`});r.setAttribute(`href`,e.currentSrc||e.src),n.append(r),f.append(n);let i=h.map(e=>{let n=aM(`rect`,{x:`0`,y:`0`,width:`0`,height:`0`,fill:`url(#${a}-p${t})`});return e.shift.append(n),n});if(g){let e=aM(`rect`,{x:`0`,y:`0`,width:`0`,height:`0`,fill:`url(#${a}-p${t})`});g.gl.firstElementChild.append(e),i.push(e)}return{el:e,rects:i,pattern:n,image:r,radiusPx:Uj(e,e.offsetWidth,e.offsetHeight)[0],lowRes:!1,measured:null,lastGeom:null,lastHole:null}});if(n.setAttribute(`opacity`,`0`),e.melt={layers:h,entries:_,seam:g},t.surface===`image`&&i[0]){let t=aM(`pattern`,{id:`${a}-bp`,patternUnits:`objectBoundingBox`,patternContentUnits:`objectBoundingBox`,width:`1`,height:`1`}),n=aM(`image`,{width:`1`,height:`1`,preserveAspectRatio:`xMidYMid slice`});n.setAttribute(`href`,i[0].currentSrc||i[0].src),t.append(n),f.append(t),e.blob.setAttribute(`fill`,`url(#${a}-bp)`)}else e.blob.removeAttribute(`fill`)}clearBlend(e){e.blend?.host.setAttribute(`opacity`,`0`),e.meltHostLast=null,e.meltWroteAt=0,e.meltAxis=null;for(let t of e.melt?.layers??[])t.last=void 0;e.melt?.seam&&(e.melt.seam.last=void 0,e.melt.seam.gl.setAttribute(`opacity`,`0`));for(let t of e.melt?.entries??[])t.el.style.removeProperty(`mask-image`),t.el.style.removeProperty(`-webkit-mask-image`),t.el.style.removeProperty(`mask-composite`),t.el.style.removeProperty(`-webkit-mask-composite`),t.lastHole=null,t.lastGeom=null}measureAll(e=1/60){let t=this.getGroup();if(!t||this.items.size===0)return!1;let n=t.getBoundingClientRect(),r=!1;for(let e of this.items){let t=e.target.getBoundingClientRect();e.frame={x:t.left-n.left,y:t.top-n.top,w:t.width,h:t.height}}for(let e of this.items)if(!(!e.blend||!e.melt))for(let t of e.melt.entries){let e=t.el.getBoundingClientRect();t.measured={x:e.left-n.left,y:e.top-n.top,w:e.width,h:e.height,ow:t.el.offsetWidth,oh:t.el.offsetHeight}}for(let t of this.items)this.writeBlob(t,e)&&(r=!0);for(let t of this.items)t.blend&&this.writeBlend(t,e)&&(r=!0);return r}effectiveInset(e,t){let n=e.blobInset??0,r=e.bridgeGrow??0;if(r>0&&e.frame){let t=e.frame,i=Math.max(14,this.gooBlur*3),a=1/0;for(let n of this.items){if(n===e||!n.frame)continue;let r=n.frame,i=Math.max(r.x-(t.x+t.w),t.x-(r.x+r.w),0),o=Math.max(r.y-(t.y+t.h),t.y-(r.y+r.h),0),s=Math.hypot(i,o);s<a&&(a=s)}a<i&&(n-=r*iM(1-a/i))}return r<=0?(e.biSmooth=n,n):(e.biSmooth===null?e.biSmooth=n:e.biSmooth+=(n-e.biSmooth)*Math.min(1,t*18),e.biSmooth)}writeBlob(e,t){let n=e.frame,r=e.dynamics;if(!r||!r.evolve&&!r.move){let r=this.effectiveInset(e,t),i=e.last,a=!i||Math.abs(i.x-n.x)>=.05||Math.abs(i.y-n.y)>=.05||Math.abs(i.w-n.w)>=.05||Math.abs(i.h-n.h)>=.05,o=Math.abs(r-e.lastBi)>=.05;if(!a&&!o)return!1;if(e.blob.style.transform=`translate(${n.x+r}px, ${n.y+r}px)`,a||o){let t=Math.max(0,n.w-r*2),i=Math.max(0,n.h-r*2);e.blob.setAttribute(`width`,String(t)),e.blob.setAttribute(`height`,String(i));let a=e.baseW>0?n.w/e.baseW:1;e.blob.setAttribute(`rx`,String(Qj(e.radiusPx*a-r,t,i)))}return e.lastPaint=null,e.last=n,e.lastBi=r,!0}let i=n.x+n.w/2,a=n.y+n.h/2,o;if(r.evolve){let t=e.target.offsetWidth,n=e.target.offsetHeight;o=Uj(e.target,t,n)[0]}else o=e.radiusPx*(e.baseW>0?n.w/e.baseW:1);e.sim||={cx:i,cy:a,w:n.w,h:n.h,r:o,vcx:0,vcy:0,vw:0,vh:0,vr:0};let s=e.sim;if(r.move){let e=r.moveOpts??Yj;[s.cx,s.vcx]=eM(s.cx,s.vcx,i,e.stiffness,e.damping,t),[s.cy,s.vcy]=eM(s.cy,s.vcy,a,e.stiffness,e.damping,t)}else if(r.evolve){let n=r.evolveOpts??Kj,o=e.tPrev?(i-e.tPrev.cx)/t:0,c=e.tPrev?(a-e.tPrev.cy)/t:0;e.tvx=e.tvx*.7+o*.3,e.tvy=e.tvy*.7+c*.3,e.tPrev={cx:i,cy:a};let l=i-s.cx,u=a-s.cy,d=Math.hypot(l,u),f=Math.hypot(e.tvx,e.tvy),p=0,m=0;f>.001?(p=e.tvx/f,m=e.tvy/f):d>.001&&(p=l/d,m=u/d);let h=Math.max(0,n.anticipation)/1e3,g=h>0?1-Math.exp(-t/h):1;e.lead01+=(+(d>.5)-e.lead01)*g;let _=Math.min(Math.max(0,n.travel)*e.lead01,d),v=p*_,y=m*_;[s.cx,s.vcx]=eM(s.cx,s.vcx,i+v,n.massStiffness,n.massDamping,t),[s.cy,s.vcy]=eM(s.cy,s.vcy,a+y,n.massStiffness,n.massDamping,t)}else s.cx=i,s.cy=a,s.vcx=0,s.vcy=0;if(r.evolve){let e=r.evolveOpts??Kj;[s.w,s.vw]=eM(s.w,s.vw,n.w,e.sizeStiffness,e.sizeDamping,t),[s.h,s.vh]=eM(s.h,s.vh,n.h,e.sizeStiffness,e.sizeDamping,t),[s.r,s.vr]=eM(s.r,s.vr,o,e.radiusStiffness,e.radiusDamping,t)}else s.w=n.w,s.h=n.h,s.r=o,s.vw=0,s.vh=0,s.vr=0;let c=``,l=Math.hypot(s.vcx,s.vcy);if(r.move&&l>2){let e=Math.min((r.moveOpts??Yj).stretch,l*6e-4),t=Math.round(Math.atan2(s.vcy,s.vcx)*100)/100;c+=` rotate(${t}rad) scale(${(1+e).toFixed(3)}, ${(1/(1+e*.65)).toFixed(3)}) rotate(${-t}rad)`}if(r.move&&e.tailEl){let n=e=>Math.round(e*10)/10;e.tailR===0&&Math.abs(e.tailX)<.001&&Math.abs(e.tailY)<.001&&(e.tailX=s.cx,e.tailY=s.cy),[e.tailX,e.tailVx]=eM(e.tailX,e.tailVx,s.cx,170,22,t),[e.tailY,e.tailVy]=eM(e.tailY,e.tailVy,s.cy,170,22,t);let i=e.blobInset??0,a=l>.001?s.vcx/l:1,o=l>.001?s.vcy/l:0,c=Math.max(4,Math.abs(a)*s.h+Math.abs(o)*s.w-i*2),u=(Math.abs(a)*s.w+Math.abs(o)*s.h)/2,d=c/2,f=e.tailX-s.cx,p=e.tailY-s.cy,m=Math.hypot(f,p),h=r.moveOpts??Yj,g=u+d*(.2+h.force*1.6);m>g&&(e.tailX=s.cx+f/m*g,e.tailY=s.cy+p/m*g);let _=h.tail,v=Math.max(0,Math.min(1,(l-20)/120)),y=d*_*v;if(e.tailR+=(y-e.tailR)*Math.min(1,t*10),e.tailR<.3)e.lastTail!==`hidden`&&(e.tailEl.setAttribute(`r`,`0`),e.tailMidA?.setAttribute(`r`,`0`),e.tailMidB?.setAttribute(`r`,`0`),e.lastTail=`hidden`);else{e.tailPhase+=l*t*.045;let r=e.tailR*.16,i=-o,c=a,u=Math.sin(e.tailPhase)*r,d=Math.sin(e.tailPhase+2.4)*-r,m=s.cx+f*.45+i*u,h=s.cy+p*.45+c*u,g=s.cx+f*.75+i*d,_=s.cy+p*.75+c*d,v=`${n(e.tailX)},${n(e.tailY)},${n(e.tailR)},${n(m)},${n(h)},${n(g)},${n(_)}`;v!==e.lastTail&&(e.tailEl.setAttribute(`cx`,String(n(e.tailX))),e.tailEl.setAttribute(`cy`,String(n(e.tailY))),e.tailEl.setAttribute(`r`,String(n(e.tailR))),e.tailMidA&&(e.tailMidA.setAttribute(`cx`,String(n(m))),e.tailMidA.setAttribute(`cy`,String(n(h))),e.tailMidA.setAttribute(`r`,String(n(e.tailR*.62)))),e.tailMidB&&(e.tailMidB.setAttribute(`cx`,String(n(g))),e.tailMidB.setAttribute(`cy`,String(n(_))),e.tailMidB.setAttribute(`r`,String(n(e.tailR*.4)))),e.lastTail=v)}}let u=Math.max(0,s.r),d=!1;if(r.evolve){let i=r.evolveOpts??Kj,a=performance.now(),c=e.lastTargetSize;(c?Math.abs(n.w-c.w)+Math.abs(n.h-c.h):0)>.5?(e.morphActive||=(e.cornerT0=a,!0),e.lastTargetMoveT=a):e.morphActive&&a-e.lastTargetMoveT>150&&a-e.cornerT0>Zj(i)&&(e.morphActive=!1),e.lastTargetSize={w:n.w,h:n.h};let l=Zj(i),f=0;if(e.cornerT0>0&&i.roundness>0&&a-e.cornerT0<l){let t=Math.min(1,Math.max(0,(a-e.cornerT0-Math.max(0,i.cornerDelay))/Math.max(1,i.cornerDuration))),n=Jj(i.cornerEase)(t);f=Math.min(1,Math.max(0,(1-n)*i.roundness))}let p=t*8;if(e.round01+=Math.max(-p,Math.min(p,f-e.round01)),d=e.cornerT0>0&&a-e.cornerT0<l+80||Math.abs(f-e.round01)>.004||e.round01>.004,e.round01>.001){let t=Math.max(Math.min(s.w,s.h)/2,u);u+=(t-u)*e.round01,u=Math.max(u,o)}let m=Math.min(1,(Math.hypot(s.vcx,s.vcy)+Math.abs(s.vw)+Math.abs(s.vh))/420);e.motionEnv=Math.max(m,e.motionEnv-t*1.9);let h=e.motionEnv,g=h*h*Math.max(0,i.contentBlur);g>.3?(e.target.style.filter=`blur(${g.toFixed(1)}px)`,e.contentBlurred=!0):e.contentBlurred&&=(e.target.style.removeProperty(`filter`),!1)}let f=e.blobInset??0,p=Math.max(0,s.w-f*2),m=Math.max(0,s.h-f*2),h=Qj(u-f,p,m),g=``;if(r.move&&e.bendPathEl){let n=r.moveOpts??Yj,i=Math.min(p,m)*.5,a=Math.max(-i,Math.min(i,s.vcy*.05))*n.bend,o=Math.min(p,m)*.9,c=Math.max(-o,Math.min(o,s.vcx*.09))*n.bendX;e.bendCur+=(a-e.bendCur)*Math.min(1,t*9),e.bendCurX+=(c-e.bendCurX)*Math.min(1,t*9);let l=Math.round(e.bendCurX*10)/10,u=Math.round(e.bendCur*10)/10,d=`${l},${u}`;if(d!==e.lastBendVars&&(e.target.style.setProperty(`--lg-bend-x`,`${l}px`),e.target.style.setProperty(`--lg-bend-y`,`${u}px`),e.target.style.setProperty(`--lg-bend-xn`,String(l)),e.target.style.setProperty(`--lg-bend-yn`,String(u)),e.lastBendVars=d),(Math.abs(e.bendCur)>.5||Math.abs(e.bendCurX)>.5)&&p>1&&m>1){let t=Math.min(h,p/2,m/2),n=Math.round(e.bendCur*2*10)/10,r=e.bendCurX,i=Math.max(t*.2,Math.min(t*3,r>0?t-.8*r:t+1.6*-r)),a=Math.max(t*.2,Math.min(t*3,r>0?t+1.6*r:t-.8*-r)),o=.5523,s=e=>Math.round(e*10)/10;g=`M ${s(a)} 0 Q ${s(p/2)} ${n} ${s(p-i)} 0 C ${s(p-i+o*i)} 0 ${s(p)} ${s(t-o*t)} ${s(p)} ${s(t)} L ${s(p)} ${s(m-t)} C ${s(p)} ${s(m-t+o*t)} ${s(p-i+o*i)} ${s(m)} ${s(p-i)} ${s(m)} Q ${s(p/2)} ${s(m+e.bendCur*2)} ${s(a)} ${s(m)} C ${s(a-o*a)} ${s(m)} 0 ${s(m-t+o*t)} 0 ${s(m-t)} L 0 ${s(t)} C 0 ${s(t-o*t)} ${s(a-o*a)} 0 ${s(a)} 0 Z`}}let _=g!==``,v={t:`translate(${s.cx-s.w/2+f}px, ${s.cy-s.h/2+f}px)`+c,w:_?`0`:String(p),h:String(m),rx:String(h)},y=e.lastPaint;return(!y||y.t!==v.t)&&(e.blob.style.transform=v.t),(!y||y.w!==v.w)&&e.blob.setAttribute(`width`,v.w),(!y||y.h!==v.h)&&e.blob.setAttribute(`height`,v.h),(!y||y.rx!==v.rx)&&e.blob.setAttribute(`rx`,v.rx),e.lastPaint=v,e.bendPathEl&&(g!==(e.lastBendD??``)&&(e.bendPathEl.setAttribute(`d`,g),e.lastBendD=g),_&&(e.bendPathEl.style.transform=v.t)),e.last=n,!(Math.abs(s.cx-i)<.05&&Math.abs(s.cy-a)<.05&&Math.abs(s.w-n.w)<.05&&Math.abs(s.h-n.h)<.05&&Math.abs(s.r-o)<.05&&l<1&&Math.abs(s.vw)+Math.abs(s.vh)+Math.abs(s.vr)<1&&e.motionEnv<.01&&e.tailR<.3&&!d)}writeBlend(e,t){let n=e.frame,r=e.blend,i=e.melt;if(!i)return!1;let a=r.range??Math.max(10,this.gooBlur*2.5),o=1/0,s=null;for(let t of this.items){if(t===e||!t.frame)continue;let r=t.frame,i=Math.max(r.x-(n.x+n.w),n.x-(r.x+r.w),0),a=Math.max(r.y-(n.y+n.h),n.y-(r.y+r.h),0),c=Math.hypot(i,a);c<o&&(o=c,s=r)}let c=0,l=0;if(s&&o===0){let e=s,t=Math.min(n.x+n.w,e.x+e.w)-Math.max(n.x,e.x),r=Math.min(n.y+n.h,e.y+e.h)-Math.max(n.y,e.y),i=Math.max(1,Math.min(n.w,n.h,e.w,e.h));c=Math.max(0,Math.min(t,r))/i,l=Math.max(0,Math.max(t,r))}let u=0;if(s&&o<a&&r.active!==!1){let e=iM(Math.min(1,(1-o/a)/.65)),t=Math.max(0,Math.min(1,r.strength??1)),n=Math.max(.01,r.sink??.45),i=iM(Math.max(0,Math.min(1,(c-n*.2)/Math.max(.01,n*.8))));u=e**1.25*t*(1-i)}if(u>=e.meltFade)e.meltFade+=(u-e.meltFade)*Math.min(1,t*16),e.meltRel=null;else if(u>.02)e.meltFade+=(u-e.meltFade)*Math.min(1,t*6),e.meltRel=null;else{let n=Math.max(40,Math.max(r.releaseMs??240,r.fadeMs??r.releaseMs??240));e.meltRel||={from:e.meltFade,t:0};let i=e.meltRel;i.t+=t*1e3;let a=Math.min(1,i.t/n);e.meltFade=u+(i.from-u)*(1-a)*(1-a)}u===0&&e.meltFade<.001&&(e.meltFade=0);let d=e.meltFade;if(d<=.001)return e.lastBlend&&e.lastBlend.s!==0?(this.clearBlend(e),e.lastBlend={cx:0,cy:0,s:0,d:0,pk:``},!0):!1;let f=s;if((!f||o>=a)&&e.meltGeom&&(f=e.meltGeom.o),!f)return!1;let p=n.x+n.w<f.x?(n.x+n.w+f.x)/2:f.x+f.w<n.x?(f.x+f.w+n.x)/2:(Math.max(n.x,f.x)+Math.min(n.x+n.w,f.x+f.w))/2,m=n.y+n.h<f.y?(n.y+n.h+f.y)/2:f.y+f.h<n.y?(f.y+f.h+n.y)/2:(Math.max(n.y,f.y)+Math.min(n.y+n.h,f.y+f.h))/2;e.meltGeom={o:{...f}};let h=e.meltRel,g=Math.max(40,r.fadeMs??r.releaseMs??240),_=h?Math.min(1,h.t/g):0,v=h?(1-_)*(1-_):1,y=h?Math.min(1,h.from*(.55+.45*(1-_))):d,b=y*y*(3-2*y);e.meltOp=v<e.meltOp?v:e.meltOp+(v-e.meltOp)*Math.min(1,t*16);let x=r.zone??this.gooBlur*2.2+4,S=Math.min(Math.min(n.w,n.h)*.9,x*(.7+.6*y)),C=Math.max(0,r.flowSpeed??26),w=e.meltPrev,T=w?Math.hypot(n.x-w.x,n.y-w.y)/Math.max(.001,t):0;e.meltPrev={x:n.x,y:n.y};let E=Math.min(t,1/24)*C*.12*Math.min(1,T/40);e.meltPhase+=E;let D=e.lastBlend,O=`${r.seamBlur??``}/${r.strength??``}/${r.warp}/${r.blur}/${r.mix??``}/${r.gravity??``}`;if(E<1e-4&&D&&D.pk===O&&Math.abs(D.cx-p)<.05&&Math.abs(D.cy-m)<.05&&Math.abs(D.s-d)<.005&&Math.abs(D.d-S)<.05)return!1;let k=performance.now();if(this.frameEma>20&&k-e.meltWroteAt<35)return!0;e.meltWroteAt=k;let A=e=>Math.round(e*10)/10,j=r.host,M=i.layers.length,N=f.x+f.w/2,P=f.y+f.h/2,F=N-p,I=P-m,L=Math.hypot(F,I)||1,R=F/L,z=I/L,B=Math.max(0,r.gravity??25)*b,V=A(Math.atan2(z,R)*180/Math.PI),H=e=>Math.round(e*1e3)/1e3,U=Math.max(0,Math.min(1,r.taper??.65)),ee=Math.max(.2,r.warpFreq??1),W=r.zone??this.gooBlur*2.2+4,te=Math.min(.3,Math.max(.01,ee/(W*1.1))),ne=(te*.35).toFixed(4),re=(te*1.6).toFixed(4),ie=Math.abs(R),ae=Math.abs(z),oe=e.meltAxis===`x`?ae>ie*1.25?`y`:`x`:e.meltAxis===`y`?ie>ae*1.25?`x`:`y`:ie>=ae?`x`:`y`;e.meltAxis=oe;let se=oe===`x`?`${ne} ${re}`:`${re} ${ne}`,ce=p+R*S*.05,le=m+z*S*.05,ue=i.layers.map((t,n)=>{let i=M>1?n/(M-1):1,a=.15+.85*i**1.4,o=.45+.55*i,s=.7+.45*i,c=6*Math.sin(e.meltPhase*s),l=2*Math.sin(e.meltPhase*s*1.31+1.7);return[String(tM(r.warp*o*b,.25)),String(tM(r.blur*a*b,.25)),String(tM(R*c-z*l,.5)),String(tM(z*c+R*l,.5)),String(tM(ce,.5)),String(tM(le,.5)),String(tM(S*(.95-.55*i),.5)),String(tM(Math.min(1,b*(.75+.25*i)),.02))]}),de=p-R*S,fe=m-z*S,pe=1-.45*iM(Math.min(1,c*2.2)),me=Math.min(2.2,(B+o)/Math.max(8,2*S))*(.5+U)*pe,he=e=>{let t=H(1+me*e),n=H(1/(1+me*.35*e));return`translate(${A(de)}, ${A(fe)}) rotate(${V}) scale(${t}, ${n}) rotate(${-V}) translate(${A(-de)}, ${A(-fe)})`},ge=Math.max(0,Math.min(1,r.mix??0))*b,_e=e=>{if(e<.002)return`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1`;let t=H(1+4*e);return`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${t} 0 0 0 ${H(1-t*(.38+.12*e))}`},ve=tM(1+Math.min(1.8,o/Math.max(8,2*S)),.05),ye=ve>1.001?`translate(${A(ce)}, ${A(le)}) rotate(${V}) scale(${H(ve)}, 1) rotate(${-V}) translate(${A(-ce)}, ${A(-le)})`:``,be=r.blur*2.5+r.warp+B*.5+me*S+8,xe=tM(S*1.15*ve+be,8),Se=String(tM(ce-xe,8)),Ce=String(tM(le-xe,8)),we=String(tM(xe*2,8));if(i.layers.forEach((e,t)=>{let n=M>1?t/(M-1):1,r=ue[t],i=he(.4+.6*n),a=_e(tM(ge*(.15+.85*n),.01)),o=r.join(`,`)+`|`+se+`|`+i+`|`+a+`|`+ye+`|`+Se+`,`+Ce+`,`+we;e.last!==o&&(e.last=o,e.filter.setAttribute(`x`,Se),e.filter.setAttribute(`y`,Ce),e.filter.setAttribute(`width`,we),e.filter.setAttribute(`height`,we),e.disp.setAttribute(`scale`,r[0]),e.blurEl.setAttribute(`stdDeviation`,r[1]),e.turb.getAttribute(`baseFrequency`)!==se&&e.turb.setAttribute(`baseFrequency`,se),e.noiseOffset.setAttribute(`dx`,r[2]),e.noiseOffset.setAttribute(`dy`,r[3]),e.circle.setAttribute(`cx`,r[4]),e.circle.setAttribute(`cy`,r[5]),e.circle.setAttribute(`r`,r[6]),ye?e.circle.setAttribute(`transform`,ye):e.circle.removeAttribute(`transform`),e.gl.setAttribute(`opacity`,r[7]),e.shift.setAttribute(`transform`,i),e.erode.setAttribute(`values`,a))}),i.seam){let e=i.seam,t=tM((r.seamBlur??r.blur*1.6)*b,.25),n=tM(Math.min(1,b*1.2)*.55,.02),a=tM(S*1.25,.5),o=`${t}|${n}|${tM(ce,.5)},${tM(le,.5)},${a}|${ye}|${Se},${Ce},${we}`;e.last!==o&&(e.last=o,e.filter.setAttribute(`x`,Se),e.filter.setAttribute(`y`,Ce),e.filter.setAttribute(`width`,we),e.filter.setAttribute(`height`,we),e.blurEl.setAttribute(`stdDeviation`,String(t)),e.circle.setAttribute(`cx`,String(tM(ce,.5))),e.circle.setAttribute(`cy`,String(tM(le,.5))),e.circle.setAttribute(`r`,String(a)),ye?e.circle.setAttribute(`transform`,ye):e.circle.removeAttribute(`transform`),e.gl.setAttribute(`opacity`,String(n)))}let Te=n.x+n.w/2,Ee=n.y+n.h/2,De=Math.atan2(m-Ee,p-Te),Oe=r.pull*y,ke=H(e.meltOp).toString()+`|translate(${A(Math.cos(De)*Oe)}px, ${A(Math.sin(De)*Oe)}px)`;if(ke!==e.meltHostLast){e.meltHostLast=ke;let t=ke.split(`|`);j.setAttribute(`opacity`,t[0]),j.style.transform=t[1]}let Ae=Math.max(10,this.gooBlur*2.5),je=s?o<Ae?iM(1-o/Ae):0:d,Me=tM(Math.max(0,1-Math.min(d,je)*2.2),.05).toFixed(2),Ne=(Math.round((1+2*Number(Me))/3*20)/20).toFixed(2);for(let e of i.entries){if(!e.lowRes){let t=oM(e.el);t?(e.image.setAttribute(`href`,t),e.lowRes=!0):e.el.complete&&e.el.naturalWidth&&(e.lowRes=!0)}let t=e.measured;if(!t||t.w<1||t.h<1)continue;let i=t.x,a=t.y,c=(t.ow||t.w)/t.w,u=`${A(i)},${A(a)},${A(t.w)},${A(t.h)},${A(Qj(e.radiusPx/(c||1),t.w,t.h))}`;if(u!==e.lastGeom){e.lastGeom=u;for(let n of e.rects)n.setAttribute(`x`,String(A(i))),n.setAttribute(`y`,String(A(a))),n.setAttribute(`width`,String(A(t.w))),n.setAttribute(`height`,String(A(t.h))),n.setAttribute(`rx`,String(A(Qj(e.radiusPx/(c||1),t.w,t.h))));e.pattern.setAttribute(`x`,String(A(i))),e.pattern.setAttribute(`y`,String(A(a))),e.pattern.setAttribute(`width`,String(A(t.w))),e.pattern.setAttribute(`height`,String(A(t.h))),e.image.setAttribute(`width`,String(A(t.w))),e.image.setAttribute(`height`,String(A(t.h)))}let d=(t.oh||t.h)/t.h;if(Math.hypot(Math.max(i-p,p-(i+t.w),0),Math.max(a-m,m-(a+t.h),0))>S){e.lastHole!==null&&(e.lastHole=null,e.el.style.removeProperty(`mask-image`),e.el.style.removeProperty(`-webkit-mask-image`),e.el.style.removeProperty(`mask-composite`),e.el.style.removeProperty(`-webkit-mask-composite`));continue}let f=t.ow||t.w,h=t.oh||t.h,g=Math.min(f,h)/2,_=(p-i)*c,v=(m-a)*d,y=_-f/2,b=v-h/2,x=Math.hypot(y,b);x<g&&(x<.001?(y=R,b=z):(y/=x,b/=x),_=f/2+y*g,v=h/2+b*g);let C=Math.round(_),w=Math.round(v),T=tM(Math.min(Math.max(S,l*.75)*Math.min(c,d),g),1),E=A(Math.max(Math.hypot(C,w),Math.hypot(C-f,w),Math.hypot(C,w-h),Math.hypot(C-f,w-h)))+2,D;if(o===0&&l>4&&s){let e=s,t=(e.x+e.w/2-i)*c,o=(e.y+e.h/2-a)*d,l=(Math.max(n.x,e.x)-i)*c,u=(Math.max(n.y,e.y)-a)*d,p=(Math.min(n.x+n.w,e.x+e.w)-i)*c,m=(Math.min(n.y+n.h,e.y+e.h)-a)*d,_=Math.round(Math.max(Math.hypot(l-t,u-o),Math.hypot(p-t,u-o),Math.hypot(l-t,m-o),Math.hypot(p-t,m-o))+3),v=Math.round(Math.min(g*2.6,Math.max(T,(r.seamBlur??r.blur*1.6)*3.2))),y=Math.max(0,_-v),b=Math.round(Math.max(Math.hypot(t,o),Math.hypot(t-f,o),Math.hypot(t,o-h),Math.hypot(t-f,o-h)))+2;D=`radial-gradient(circle at ${Math.round(t)}px ${Math.round(o)}px, rgba(255,255,255,${Me}) ${y}px, #fff ${_}px, #fff ${b}px)`}else D=`radial-gradient(circle at ${C}px ${w}px, rgba(255,255,255,${Me}) ${A(T*.2)}px, rgba(255,255,255,${Ne}) ${A(T*.45)}px, #fff ${A(T*.78)}px, #fff ${E}px)`;D!==e.lastHole&&(e.lastHole=D,e.el.style.setProperty(`mask-image`,D),e.el.style.setProperty(`-webkit-mask-image`,D),e.el.style.removeProperty(`mask-composite`),e.el.style.removeProperty(`-webkit-mask-composite`))}return e.lastBlend={cx:p,cy:m,s:d,d:S,pk:O},!0}ensureSources(){if(this.sourcesReady)return;let e=this.getGroup();if(!e)return;this.sourcesReady=!0,this.mo=new MutationObserver(e=>{for(let t of e){let e=t.target;if(!(e instanceof Element)||!e.closest(`[data-gooey-svg], [data-gooey-overlay]`)){this.wake();return}}}),this.mo.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:[`style`,`class`]});let t=()=>this.wake();for(let n of[`transitionrun`,`animationstart`,`pointerdown`])e.addEventListener(n,t,!0),this.removeListeners.push(()=>e.removeEventListener(n,t,!0));window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),this.removeListeners.push(()=>window.removeEventListener(`scroll`,t,!0)),this.interval=setInterval(()=>{!this.awake&&this.measureAll()&&this.wake()},300)}};function cM(e,t){let n=[],r=0,i=``;for(let a of e)a===`(`?r++:a===`)`&&r--,r===0&&(t===`,`?a===`,`:/\s/.test(a))?(i.trim()&&n.push(i.trim()),i=``):i+=a;return i.trim()&&n.push(i.trim()),n}var lM=/^[+-]?(\d+\.?\d*|\.\d+)(px)?$/;function uM(e){if(!e||e.trim()===``||e.trim()===`none`)return[];let t=[];for(let n of cM(e,`,`)){let e=cM(n,` `);if(e.length===0)continue;let r=e.includes(`inset`),i=[],a=[];for(let t of e)t!==`inset`&&(i.length<4&&lM.test(t)?i.push(parseFloat(t)):a.push(t));let[o=0,s=0,c=0,l=0]=i;t.push({x:o,y:s,blur:c,spread:l,color:a.join(` `)||`rgba(0, 0, 0, 0.35)`,inset:r})}return t}var dM=(0,v.forwardRef)(function({blur:e=6,contrast:t=18,fill:n=`#fff`,shadow:r,filterPadding:i=24,waviness:a=0,wavinessFreq:o=.018,className:s,style:c,children:l,...u},d){let f=(0,v.useRef)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)({w:0,h:0}),b=(0,v.useCallback)(e=>{f.current=e,typeof d==`function`?d(e):d&&(d.current=e)},[d]),x=`gooey-${(0,v.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,S=(0,v.useMemo)(()=>uM(r),[r]);Bj(()=>{let e=f.current;if(!e)return;let t=()=>y(t=>t.w===e.offsetWidth&&t.h===e.offsetHeight?t:{w:e.offsetWidth,h:e.offsetHeight});t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let C=(0,v.useMemo)(()=>new sM(()=>f.current),[]),w=(0,v.useMemo)(()=>Nj(),[]);(0,v.useEffect)(()=>()=>C.dispose(),[C]),(0,v.useEffect)(()=>{C.gooBlur=e},[C,e]);let T=(0,v.useMemo)(()=>({portal:p,meltPortal:h,fill:n,getGroup:()=>f.current,engine:C,imageMelt:w}),[p,h,n,C,w]),E=S.filter(e=>e.inset||e.spread!==0),D=S.filter(e=>!e.inset&&e.spread===0).map(e=>`drop-shadow(${e.x}px ${e.y}px ${e.blur}px ${e.color})`).join(` `),O=E.reduce((e,t)=>Math.max(e,Math.max(Math.abs(t.x),Math.abs(t.y))+t.blur*1.5+Math.max(0,t.spread)),0),k=Math.ceil(e*3+O+i);return(0,G.jsxs)(`div`,{...u,ref:b,className:s,style:{position:`relative`,isolation:`isolate`,...c},children:[(0,G.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,"data-gooey-svg":``,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`,zIndex:-1,filter:D||void 0,willChange:`filter, transform`},children:[(0,G.jsx)(`defs`,{children:(0,G.jsx)(`filter`,{id:x,filterUnits:`userSpaceOnUse`,x:-k,y:-k,width:_.w+k*2,height:_.h+k*2,colorInterpolationFilters:`sRGB`,children:(0,G.jsx)(jj,{blur:e,contrast:t,shadows:E,waviness:a,wavinessFreq:o})})}),(0,G.jsx)(`g`,{id:`${x}-sil`,ref:m,filter:`url(#${x})`,style:{fill:n}})]}),(0,G.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,"data-gooey-overlay":``,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,overflow:`visible`,pointerEvents:`none`,zIndex:9999},children:[(0,G.jsx)(`defs`,{children:(0,G.jsx)(`mask`,{id:`${x}-meltmask`,maskUnits:`userSpaceOnUse`,x:-k,y:-k,width:_.w+k*2,height:_.h+k*2,children:(0,G.jsx)(`use`,{href:`#${x}-sil`})})}),(0,G.jsx)(`g`,{mask:`url(#${x}-meltmask)`,children:(0,G.jsx)(`g`,{ref:g})})]}),(0,G.jsxs)(Ej.Provider,{value:T,children:[l,(0,G.jsx)(Rj,{registry:w})]})]})}),fM={snappy:{stiffness:480,damping:34,mass:1},smooth:{stiffness:190,damping:26,mass:1},bouncy:{stiffness:320,damping:17,mass:1}},pM=1/240;function mM(e){let t=0,n=0,r=0,i=-1,a=0,o=[0];for(;r<10;){let s=(-e.stiffness*(t-1)-e.damping*n)/e.mass;if(n+=s*pM,t+=n*pM,r+=pM,o.push(t),t>a&&(a=t),Math.abs(t-1)<.001&&Math.abs(n)<.02){if(i<0&&(i=r),r-i>=.064)break}else i=-1}let s=i>0?i:r,c=Math.round(Math.min(120,Math.max(24,s*90))),l=Math.min(o.length-1,s/pM),u=[];for(let e=0;e<=c;e++){let t=Math.min(o.length-1,Math.round(e/c*l));u.push(Math.round(o[t]*1e4)/1e4)}return u[u.length-1]=1,{duration:s,values:u,overshoots:a>1.001}}var hM=null;function gM(){return hM??=typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`transition-timing-function`,`linear(0, 1)`),hM}var _M=new Map,vM=new Map;function yM(e){let t=vM.get(e);if(t)return t;let n=/^linear\(([^)]+)\)$/.exec(e.trim()),r=/^cubic-bezier\(([^)]+)\)$/.exec(e.trim());if(n){let e=n[1].split(`,`).map(Number);t=t=>{if(t<=0)return e[0];if(t>=1)return e[e.length-1];let n=t*(e.length-1),r=Math.floor(n);return e[r]+(e[r+1]-e[r])*(n-r)}}else if(r){let[e,n,i,a]=r[1].split(`,`).map(Number);t=t=>{if(t<=0)return 0;if(t>=1)return 1;let r=0,o=1;for(let n=0;n<24;n++){let n=(r+o)/2;3*n*(1-n)*(1-n)*e+3*n*n*(1-n)*i+n**3<t?r=n:o=n}let s=(r+o)/2;return 3*s*(1-s)*(1-s)*n+3*s*s*(1-s)*a+s**3}}else t=e===`ease`?yM(`cubic-bezier(0.25, 0.1, 0.25, 1)`):e===`ease-in`?yM(`cubic-bezier(0.42, 0, 1, 1)`):e===`ease-out`?yM(`cubic-bezier(0, 0, 0.58, 1)`):e===`ease-in-out`?yM(`cubic-bezier(0.42, 0, 0.58, 1)`):e=>Math.min(1,Math.max(0,e));return vM.set(e,t),t}function bM(e,t=!1){if(t)return{duration:0,easing:`linear`};let n=e??`smooth`;if(typeof n==`object`&&`duration`in n)return{duration:n.duration,easing:n.ease??`cubic-bezier(0.22, 1, 0.36, 1)`};let r=typeof n==`string`?fM[n]:{stiffness:300,damping:24,mass:1,...n},i=`${r.stiffness}/${r.damping}/${r.mass}/${gM()}`,a=_M.get(i);if(!a){let e=mM(r);a={duration:Math.round(e.duration*1e3),easing:gM()?`linear(${e.values.join(`, `)})`:e.overshoots?`cubic-bezier(0.34, 1.56, 0.64, 1)`:`cubic-bezier(0.22, 1, 0.36, 1)`},_M.set(i,a)}return a}function xM(e){return Array.isArray(e)?e:e?[e]:[]}function SM(e){let t=Dj();return e.observe||xM(e.effect).some(e=>e!==`morph`)?(0,G.jsx)(DM,{...e,ctx:t}):(0,G.jsx)(TM,{...e,ctx:t})}function CM(e){return typeof e==`string`?e:JSON.stringify(e??null)}function wM(e,t){return!!e&&e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h&&e.r.every((e,n)=>e===t.r[n])}function TM({x:e=0,y:t=0,scale:n=1,transition:r=`smooth`,delay:i=0,radius:a,className:o,style:s,children:c,ctx:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(null),m=Vj(),h=CM(r),{duration:g,easing:_}=(0,v.useMemo)(()=>bM(r,m),[h,m]);Bj(()=>{let e=u.current,t=l.getGroup();if(!e||!t)return;let n=()=>{let n=Hj(e,t),r=e.offsetWidth,i=e.offsetHeight,o=e.firstElementChild??e,s=a==null?Uj(o,r,i):Wj(a),c={x:n.x,y:n.y,w:r,h:i,r:s};p(e=>wM(e,c)?e:c)};n();let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[l,a==null?``:JSON.stringify(a)]);let y=(0,v.useRef)(null),b=(e,t,n)=>{let r=`translate(${e}px, ${t}px)`+(n===1?``:` scale(${n})`);u.current&&(u.current.style.transform=r),d.current&&(d.current.style.transform=r)};return Bj(()=>{let r=y.current;if(!r||g<=0||r.x===e&&r.y===t&&r.s===n){y.current={x:e,y:t,s:n},b(e,t,n);return}let a={...r},o=yM(_),s=performance.now()+i,c=0,l=r=>{let i=Math.min(1,Math.max(0,(r-s)/g)),u=o(i),d=a.x+(e-a.x)*u,f=a.y+(t-a.y)*u,p=a.s+(n-a.s)*u;y.current={x:d,y:f,s:p},b(d,f,p),i<1&&(c=requestAnimationFrame(l))};return c=requestAnimationFrame(l),()=>cancelAnimationFrame(c)},[e,t,n,g,_,i]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:u,className:o,style:{display:`inline-block`,...s,willChange:`transform`},children:c}),l.portal&&f&&(0,xu.createPortal)(EM(f,{transformBox:`fill-box`,transformOrigin:`center`,willChange:`transform`},r=>{if(d.current=r,r){let i=y.current??{x:e,y:t,s:n};r.style.transform=`translate(${i.x}px, ${i.y}px)`+(i.s===1?``:` scale(${i.s})`)}}),l.portal)]})}function EM(e,t,n){let[r,i,a,o]=e.r;if(r===i&&i===a&&a===o){let i=Math.max(0,Math.min(r,Math.min(e.w,e.h)/2));return(0,G.jsx)(`rect`,{ref:n,x:e.x,y:e.y,width:e.w,height:e.h,rx:i,style:t})}return(0,G.jsx)(`path`,{ref:n,d:Gj(e.x,e.y,e.w,e.h,e.r),style:t})}function DM({radius:e,blobInset:t,bridgeGrow:n,contactBlur:r,effect:i,evolve:a,move:o,className:s,style:c,children:l,ctx:u}){let d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(null),h=typeof r==`object`?r:{},g=h.blur??8,_=h.warp??26,y=h.pull??4,b=h.range,x=h.zone,S=h.mix??0,C=h.gravity??60,w=h.taper??1,T=h.warpFreq??1.7,E=h.flowSpeed??22,D=h.warpStyle??`fractalNoise`,O=h.detail??2,k=h.active!==!1,A=h.releaseMs??240,j=h.fadeMs,M=h.strength??1,N=h.sink,P=h.surface,F=h.seamBlur,I=xM(i),L={evolve:I.includes(`evolve`),move:I.includes(`move`),evolveOpts:{...Kj,...a},moveOpts:{...Yj,...o}},R=L.evolve||L.move;return Bj(()=>{let i=d.current,a=f.current,o=i?.firstElementChild??null;if(!o||!a)return;let s=r&&p.current?{host:p.current,blur:g,warp:_,pull:y,range:b,zone:x,mix:S,gravity:C,taper:w,warpFreq:T,flowSpeed:E,warpStyle:D,detail:O,active:k,releaseMs:A,fadeMs:j,strength:M,sink:N,surface:P,seamBlur:F}:void 0;return m.current=s??null,u.engine.add({target:o,blob:a,radius:e==null?void 0:Wj(e)[0],blobInset:t,bridgeGrow:n,blend:s,dynamics:R?L:void 0})},[u,e==null?``:JSON.stringify(e),r?`${g}/${_}/${y}/${b??`auto`}/${x??`auto`}/${S}/${C}/${w}/${T}/${E}/${D}/${O}/${P??`liquid`}/${(F??1)>0?`seam`:`noseam`}`:``,I.join(`,`)+(L.evolve?JSON.stringify(L.evolveOpts):``)+(L.move?JSON.stringify(L.moveOpts):``),t,n]),(0,v.useEffect)(()=>{m.current&&(m.current.active=k,m.current.releaseMs=A,m.current.fadeMs=j,m.current.strength=M,m.current.sink=N,m.current.seamBlur=F,u.engine.wake())},[u,k,A,j,M,N,F]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{ref:d,className:s,style:{display:`contents`,...c},children:l}),u.portal&&(0,xu.createPortal)((0,G.jsx)(`rect`,{ref:f,x:0,y:0,width:0,height:0,style:{willChange:`transform`,transformBox:`fill-box`,transformOrigin:`center`}}),u.portal),r!==void 0&&r!==!1&&u.meltPortal&&(0,xu.createPortal)((0,G.jsx)(`g`,{ref:p,opacity:0}),u.meltPortal)]})}function OM(e){return Math.max(.12,1-1.1*Math.min(1,Math.max(0,e)))}function kM(e){let t=Math.max(.25,e?.speed??1),n=OM(e?.bounce??.5)/OM(.5);return{massStiffness:Kj.massStiffness*t*t,massDamping:Kj.massDamping*t*n,sizeStiffness:Kj.sizeStiffness*t*t,sizeDamping:Kj.sizeDamping*t*n,radiusStiffness:Kj.radiusStiffness*t*t,radiusDamping:Kj.radiusDamping*t,cornerDuration:Kj.cornerDuration/t,contentBlur:e?.contentBlur??Kj.contentBlur}}function AM(e){return{warp:26,blur:8,mix:.7,gravity:60,taper:1,warpFreq:1.7,flowSpeed:22,detail:2,zone:18,range:49,releaseMs:110,strength:typeof e==`number`?Math.min(1,Math.max(0,e)):1}}function jM(e){let t=Math.min(1,Math.max(0,e?.springiness??.5)),n=Yj.stiffness*10**(t-.5);return{stiffness:n,damping:Yj.damping*Math.sqrt(n/Yj.stiffness)*(OM(e?.wobble??.5)/OM(.5)),stretch:.5*Math.min(1,Math.max(0,e?.stretch??.36)),tail:.8*Math.min(1,Math.max(0,e?.trail??.575)),...e?.advanced}}function MM(e){return{...jM({springiness:1,stretch:0,trail:0}),bend:Math.min(1,Math.max(0,e?.vertical??.6)),bendX:Math.min(1,Math.max(0,e?.horizontal??.35)),...e?.advanced}}function NM({melt:e,children:t}){let{imageMelt:n}=Dj(),{src:r,...i}=e??{};return(0,G.jsx)(zj,{src:r,opts:{...Mj,...i},registry:n,children:t})}function PM(e){let{effect:t=`morph`,morph:n,move:r,bend:i,melt:a,dissolve:o,observe:s,...c}=e;if(t===`melt`)return(0,G.jsx)(NM,{melt:a,children:c.children});if(t===`bend`)return(0,G.jsx)(SM,{...c,observe:!0,effect:`move`,move:MM(i)});if(t===`move`)return(0,G.jsx)(SM,{...c,observe:!0,effect:`move`,move:jM(r)});let l=n?.advanced,u=!!n?.shape,d=o!==void 0&&o!==!1?typeof o==`object`?{...AM(!0),...o}:AM(o):void 0,f=u?{...kM(n),...l?.evolve}:void 0;return(0,G.jsx)(SM,{...c,observe:s||u||!!d||void 0,effect:u?`evolve`:void 0,evolve:f,contactBlur:d,blobInset:l?.blobInset,bridgeGrow:l?.bridgeGrow})}var FM=Object.assign(dM,{Item:PM}),IM=`auto`,LM=`playground.transcriptionModel`;function RM(e){return e.filter(e=>e.modality===`transcription`&&e.enabled&&e.keyCount>0)}function zM(e){return RM(e).length>0}function BM(e,t){let n=new Map;for(let t of RM(e)){let e=n.get(t.modelId);e?e.push(t):n.set(t.modelId,[t])}let r=[{value:IM,label:t}];for(let[e,t]of n){let n=[...new Set(t.map(e=>e.platform))];r.push({value:e,label:t[0].displayName||e,sub:n.length===1?n[0]:`${n.length} providers`,platforms:n})}return r}function VM(e,t){return!e||e===`auto`?IM:RM(t).some(t=>t.modelId===e)?e:IM}function HM(e){return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg;codecs=opus`].find(e)}function UM(e){return e?e.startsWith(`audio/mp4`)?`dictation.m4a`:e.startsWith(`audio/ogg`)?`dictation.ogg`:`dictation.webm`:`dictation.webm`}function WM(e,t){let n=t.trim();return n?e.trim()?`${e.replace(/\s+$/,``)} ${n}`:n:e}function GM({available:e,model:t,apiKey:n,disabled:r,onText:i,onPhaseChange:a,onStreamChange:o,className:s}){let{t:c}=Z(),[l,u]=(0,v.useState)(`idle`),d=(0,v.useRef)(null),f=(0,v.useRef)([]),p=e=>{u(e),a?.(e)};(0,v.useEffect)(()=>()=>{let e=d.current;e&&e.state!==`inactive`&&e.stop(),e?.stream.getTracks().forEach(e=>e.stop())},[]);async function m(){if(!e){pv.info(c(`playground.dictationUnavailable`));return}if(typeof MediaRecorder>`u`||!navigator.mediaDevices?.getUserMedia){pv.error(c(`playground.dictationFailed`,{reason:`MediaRecorder is not supported in this browser`}));return}let t;try{t=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){pv.error(c(`playground.dictationFailed`,{reason:e instanceof Error?e.message:String(e)}));return}let n=HM(e=>MediaRecorder.isTypeSupported(e)),r=new MediaRecorder(t,n?{mimeType:n}:void 0);f.current=[],r.ondataavailable=e=>{e.data.size>0&&f.current.push(e.data)},r.onstop=()=>{o?.(null),t.getTracks().forEach(e=>e.stop()),g(new Blob(f.current,{type:r.mimeType||n||`audio/webm`}))},d.current=r,r.start(),o?.(t),p(`recording`)}function h(){let e=d.current;e&&e.state!==`inactive`&&e.stop(),d.current=null}async function g(e){p(`transcribing`);try{if(e.size===0)throw Error(`nothing was recorded`);let r=new FormData;r.append(`file`,e,UM(e.type)),r.append(`model`,t),r.append(`response_format`,`json`);let a={};n&&(a.Authorization=`Bearer ${n}`);let o=`/`.replace(/\/$/,``),s=await fetch(`${o}/v1/audio/transcriptions`,{method:`POST`,headers:a,body:r});if(!s.ok){let e=await s.json().catch(()=>null);throw Error(e?.error?.message||`HTTP ${s.status}`)}i((await s.json()).text??``)}catch(e){pv.error(c(`playground.dictationFailed`,{reason:e instanceof Error?e.message:String(e)}))}finally{p(`idle`)}}let _=c(l===`recording`?`playground.dictationStop`:l===`transcribing`?`playground.dictationTranscribing`:`playground.dictate`);return(0,G.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 rounded-full ${l===`recording`?`text-foreground`:`text-muted-foreground hover:text-foreground`} ${s??``}`,onClick:()=>l===`recording`?h():void m(),disabled:r||l===`transcribing`,"aria-label":_,title:_,"aria-pressed":l===`recording`,"data-phase":l,children:l===`transcribing`?(0,G.jsx)(la,{className:`size-4 animate-spin`}):l===`recording`?(0,G.jsx)(Ra,{className:`size-3.5 fill-current`}):(0,G.jsx)(ha,{className:`size-4`})})}function KM(e,t=31,n=3,r=22){let i=e.length;if(t<=0)return[];if(i===0)return Array.from({length:t},()=>n);let a=Math.max(1,Math.floor(i/2))/t,o=[];for(let n=0;n<t;n++){let t=Math.floor(n*a),r=Math.max(t+1,Math.floor((n+1)*a)),s=0;for(let n=t;n<r&&n<i;n++)s+=e[n];o.push(s/(r-t)/255)}let s=Array(t).fill(0),c=Math.floor(t/2);for(let e=0;e<t;e++){let t=Math.ceil(e/2),n=e%2==0?c+t:c-t;s[n]=o[e]}return s.map(e=>n+Math.min(1,Math.max(0,e))*(r-n))}function qM({stream:e,className:t}){let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let t=n.current;if(!t||typeof AudioContext>`u`)return;let r=t.getContext(`2d`);if(!r)return;let i=new AudioContext,a=i.createMediaStreamSource(e),o=i.createAnalyser();o.fftSize=256,o.smoothingTimeConstant=.7,a.connect(o);let s=new Uint8Array(o.frequencyBinCount),c=0,l=()=>{o.getByteFrequencyData(s);let e=window.devicePixelRatio||1,n=t.clientWidth,i=t.clientHeight;(t.width!==Math.round(n*e)||t.height!==Math.round(i*e))&&(t.width=Math.round(n*e),t.height=Math.round(i*e)),r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,n,i),r.fillStyle=getComputedStyle(t).color;let a=Math.max(31,Math.min(91,Math.floor(n/6)|1)),u=KM(s,a,4,Math.max(8,i-8)),d=(n-(a*6-3))/2;u.forEach((e,t)=>{let n=d+t*6,a=(i-e)/2;r.beginPath(),r.roundRect(n,a,3,e,3/2),r.fill()}),c=requestAnimationFrame(l)};return c=requestAnimationFrame(l),()=>{cancelAnimationFrame(c),a.disconnect(),o.disconnect(),i.close()}},[e]),(0,G.jsx)(`canvas`,{ref:n,className:t,"aria-hidden":`true`})}function JM(e,t){return e.trim().length>0||t>0}function YM(e){return e?0:-48}function XM(e,t){return e&&!t}function ZM(e){let t=Math.min(Math.max(0,e),160);return{height:t,grown:t>44}}function QM({inputRef:e,value:t,onChange:n,onKeyDown:r,onPaste:i,placeholder:a,hasContent:o,loading:s,onSend:c,onAttach:l,labels:u,dictation:d}){let[f,p]=(0,v.useState)(!1),m=f&&t!==``,[h,g]=(0,v.useState)(`idle`),[_,y]=(0,v.useState)(null),b=h===`recording`&&_!==null,x=!o||h!==`idle`;(0,v.useEffect)(()=>{if(t!==``)return;let n=e.current;n&&(n.style.height=`auto`)},[t,e]);let S=XM(o,s);return(0,G.jsxs)(FM,{blur:3,contrast:22,fill:`var(--muted)`,className:`flex gap-2 ${m?`items-end`:`items-center`}`,"data-testid":`liquid-composer`,children:[(0,G.jsx)(FM.Item,{className:`min-w-0 flex-1`,children:(0,G.jsxs)(`div`,{className:`flex gap-1 ps-1 pe-2 py-1 ${m?`items-end`:`items-center`}`,style:{borderRadius:28},children:[(0,G.jsx)(J,{variant:`ghost`,size:`icon`,className:`shrink-0 rounded-full text-muted-foreground hover:text-foreground`,onClick:l,disabled:s,"aria-label":u.attach,title:u.attach,children:(0,G.jsx)(ba,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 items-center`,children:[(0,G.jsx)(`textarea`,{ref:e,value:t,onChange:e=>n(e.target.value),onKeyDown:r,onPaste:i,placeholder:a,rows:1,className:`block min-h-[32px] w-full resize-none bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-muted-foreground transition-opacity ${b?`opacity-0`:``}`,style:{height:`auto`,overflow:`hidden`},onInput:e=>{let t=e.target;t.style.height=`auto`;let n=ZM(t.scrollHeight);t.style.height=`${n.height}px`,p(n.grown)}}),b&&(0,G.jsx)(qM,{stream:_,className:`pointer-events-none absolute inset-y-0 left-1 right-1 h-full w-[calc(100%-0.5rem)] text-foreground`})]}),(0,G.jsx)(`div`,{"data-show":x,className:`cmd-mic shrink-0 transition-opacity duration-150 ease-out data-[show=false]:pointer-events-none data-[show=false]:opacity-0`,children:(0,G.jsx)(GM,{available:d.available,model:d.model,apiKey:d.apiKey,disabled:s,onText:d.onText,onPhaseChange:g,onStreamChange:y})})]})}),(0,G.jsx)(FM.Item,{x:YM(o),className:o?void 0:`pointer-events-none`,children:(0,G.jsx)(`button`,{type:`button`,onClick:c,disabled:!S,tabIndex:o?0:-1,"aria-hidden":!o,"aria-label":s?u.sending:u.send,title:s?u.sending:u.send,"data-show":o,className:`flex size-10 items-center justify-center rounded-full text-foreground outline-none transition-opacity duration-150 ease-out hover:bg-foreground/5 focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-default data-[show=false]:pointer-events-none data-[show=false]:opacity-0`,children:(0,G.jsx)(_i,{className:`size-4 ${s?`opacity-40`:``}`})})})]})}var $M=`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>`,eN=`</title><path d="`,tN=`"/></svg>`,nN={title:`Anthropic`,slug:`anthropic`,get svg(){return $M+`Anthropic`+eN+this.path+tN},path:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`,source:`https://www.anthropic.com`,hex:`191919`},rN={title:`Baidu`,slug:`baidu`,get svg(){return $M+`Baidu`+eN+this.path+tN},path:`M9.154 0C7.71 0 6.54 1.658 6.54 3.707c0 2.051 1.171 3.71 2.615 3.71 1.446 0 2.614-1.659 2.614-3.71C11.768 1.658 10.6 0 9.154 0zm7.025.594C14.86.58 13.347 2.589 13.2 3.927c-.187 1.745.25 3.487 2.179 3.735 1.933.25 3.175-1.806 3.422-3.364.252-1.555-.995-3.364-2.362-3.674a1.218 1.218 0 0 0-.261-.03zM3.582 5.535a2.811 2.811 0 0 0-.156.008c-2.118.19-2.428 3.24-2.428 3.24-.287 1.41.686 4.425 3.297 3.864 2.617-.561 2.262-3.68 2.183-4.362-.125-1.018-1.292-2.773-2.896-2.75zm16.534 1.753c-2.308 0-2.617 2.119-2.617 3.616 0 1.43.121 3.425 2.988 3.362 2.867-.063 2.553-3.238 2.553-3.988 0-.745-.62-2.99-2.924-2.99zm-8.264 2.478c-1.424.014-2.708.925-3.323 1.947-1.118 1.868-2.863 3.05-3.112 3.363-.25.309-3.61 2.116-2.864 5.42.746 3.301 3.365 3.237 3.365 3.237s1.93.19 4.171-.31c2.24-.495 4.17.123 4.17.123s5.233 1.748 6.665-1.616c1.43-3.364-.808-5.109-.808-5.109s-2.99-2.306-4.736-4.798c-1.072-1.665-2.348-2.268-3.528-2.257zm-2.234 3.84l1.542.024v8.197H7.758c-1.47-.291-2.055-1.292-2.13-1.462-.072-.173-.488-.976-.268-2.343.635-2.049 2.447-2.196 2.447-2.196h1.81zm3.964 2.39v3.881c.096.413.612.488.612.488h1.614v-4.343h1.689v5.782h-3.915c-1.517-.39-1.59-1.465-1.59-1.465v-4.317zm-5.458 1.147c-.66.197-.978.708-1.05.928-.076.22-.247.78-.1 1.269.294 1.095 1.248 1.144 1.248 1.144h1.37v-3.34z`,source:`https://www.baidu.com`,hex:`2932E1`},iN={title:`DeepSeek`,slug:`deepseek`,get svg(){return $M+`DeepSeek`+eN+this.path+tN},path:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`,source:`https://www.deepseek.com`,hex:`5786FE`},aN={title:`Google Gemini`,slug:`googlegemini`,get svg(){return $M+`Google Gemini`+eN+this.path+tN},path:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,source:`https://gemini.google.com`,hex:`8E75B2`},oN={title:`Kimi`,slug:`kimi`,get svg(){return $M+`Kimi`+eN+this.path+tN},path:`M21.765.351C22.998.351 24 1.353 24 2.586S22.998 4.82 21.765 4.82h-1.974c-.15 0-.26-.12-.26-.26V2.586A2.237 2.237 0 0 1 21.765.35M9.41 13.388l8.447-8.377c.16-.16.07-.471-.14-.471h-4.55s-.1.02-.14.06l-9.099 9.029c-.14.14-.35.02-.35-.21V4.81c0-.15-.1-.27-.221-.27H.22c-.12 0-.22.12-.22.27v18.57c0 .15.1.27.22.27h3.137c.12 0 .22-.12.22-.27v-3.79c0-.08.03-.16.08-.21l2.826-2.796c.07-.07.16-.08.241-.03l7.546 5.551a8.9 8.9 0 0 0 4.018 1.493c.12.01.23-.11.23-.27V19.76c0-.14-.08-.25-.19-.26a5.8 5.8 0 0 1-2.355-.942l-6.533-4.73c-.14-.09-.15-.32-.03-.441`,source:`https://moonshotai.github.io/Branding-Guide`,hex:`000000`,guidelines:`https://moonshotai.github.io/Branding-Guide`},sN={title:`Meta`,slug:`meta`,get svg(){return $M+`Meta`+eN+this.path+tN},path:`M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973a6.624 6.624 0 0 0 .265.86 5.297 5.297 0 0 0 .371.761c.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.756-1.339.186-.325c.061.1.121.196.183.3l2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843a3.743 3.743 0 0 0 .81-.973c.542-.939.861-2.127.861-3.745 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c.07-.109.141-.224.211-.327 1.12-1.667 2.118-2.602 3.358-2.602zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-.524 0-1.038-.237-1.383-.794-.263-.426-.464-1.13-.464-2.046 0-2.221.63-4.535 1.66-6.088.454-.687.964-1.226 1.533-1.533a2.264 2.264 0 0 1 1.088-.285z`,source:`https://www.meta.com`,hex:`0467DF`,guidelines:`https://www.facebook.com/brand/resources/meta/company-brand`},cN={title:`MiniMax`,slug:`minimax`,get svg(){return $M+`MiniMax`+eN+this.path+tN},path:`M11.43 3.92a.86.86 0 1 0-1.718 0v14.236a1.999 1.999 0 0 1-3.997 0V9.022a.86.86 0 1 0-1.718 0v3.87a1.999 1.999 0 0 1-3.997 0V11.49a.57.57 0 0 1 1.139 0v1.404a.86.86 0 0 0 1.719 0V9.022a1.999 1.999 0 0 1 3.997 0v9.134a.86.86 0 0 0 1.719 0V3.92a1.998 1.998 0 1 1 3.996 0v11.788a.57.57 0 1 1-1.139 0zm10.572 3.105a2 2 0 0 0-1.999 1.997v7.63a.86.86 0 0 1-1.718 0V3.923a1.999 1.999 0 0 0-3.997 0v16.16a.86.86 0 0 1-1.719 0V18.08a.57.57 0 1 0-1.138 0v2a1.998 1.998 0 0 0 3.996 0V3.92a.86.86 0 0 1 1.719 0v12.73a1.999 1.999 0 0 0 3.996 0V9.023a.86.86 0 1 1 1.72 0v6.686a.57.57 0 0 0 1.138 0V9.022a2 2 0 0 0-1.998-1.997`,source:`https://github.com/MiniMax-AI/MiniMax-01/blob/57cf223b177e99636c7711a0f179e9fdc9c38e8a/figures/minimax.svg`,hex:`E73562`,license:{type:`custom`,url:`https://github.com/simple-icons/simple-icons/pull/13982#issuecomment-3531627803`}},lN={title:`Mistral AI`,slug:`mistralai`,get svg(){return $M+`Mistral AI`+eN+this.path+tN},path:`M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z`,source:`https://chat.mistral.ai`,hex:`FA520F`},uN={title:`NVIDIA`,slug:`nvidia`,get svg(){return $M+`NVIDIA`+eN+this.path+tN},path:`M8.948 8.798v-1.43a6.7 6.7 0 0 1 .424-.018c3.922-.124 6.493 3.374 6.493 3.374s-2.774 3.851-5.75 3.851c-.398 0-.787-.062-1.158-.185v-4.346c1.528.185 1.837.857 2.747 2.385l2.04-1.714s-1.492-1.952-4-1.952a6.016 6.016 0 0 0-.796.035m0-4.735v2.138l.424-.027c5.45-.185 9.01 4.47 9.01 4.47s-4.08 4.964-8.33 4.964c-.37 0-.733-.035-1.095-.097v1.325c.3.035.61.062.91.062 3.957 0 6.82-2.023 9.593-4.408.459.371 2.34 1.263 2.73 1.652-2.633 2.208-8.772 3.984-12.253 3.984-.335 0-.653-.018-.971-.053v1.864H24V4.063zm0 10.326v1.131c-3.657-.654-4.673-4.46-4.673-4.46s1.758-1.944 4.673-2.262v1.237H8.94c-1.528-.186-2.73 1.245-2.73 1.245s.68 2.412 2.739 3.11M2.456 10.9s2.164-3.197 6.5-3.533V6.201C4.153 6.59 0 10.653 0 10.653s2.35 6.802 8.948 7.42v-1.237c-4.84-.6-6.492-5.936-6.492-5.936z`,source:`https://www.nvidia.com/en-us`,hex:`76B900`},dN={title:`Perplexity`,slug:`perplexity`,get svg(){return $M+`Perplexity`+eN+this.path+tN},path:`M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z`,source:`https://www.perplexity.ai`,hex:`1FB8CD`},fN={title:`QWen`,slug:`qwen`,get svg(){return $M+`QWen`+eN+this.path+tN},path:`M23.919 14.545 20.817 9.17l1.47-2.544a.56.56 0 0 0 0-.566l-1.633-2.83a.57.57 0 0 0-.49-.283h-6.207L12.487.402a.57.57 0 0 0-.49-.284H8.732a.56.56 0 0 0-.49.284L5.139 5.775h-2.94a.56.56 0 0 0-.49.284L.077 8.887a.56.56 0 0 0 0 .567L3.18 14.83l-1.47 2.545a.56.56 0 0 0 0 .566l1.634 2.83a.57.57 0 0 0 .49.283h6.205l1.47 2.545a.57.57 0 0 0 .49.284h3.266a.57.57 0 0 0 .49-.284l3.104-5.375h2.94a.57.57 0 0 0 .49-.283l1.634-2.828a.55.55 0 0 0-.004-.568M8.733.686l1.634 2.828-1.634 2.828H21.8L20.164 9.17H7.425L5.63 6.06Zm1.306 19.801-6.205-.002 1.634-2.83h3.265L2.201 6.344h3.267q3.182 5.517 6.367 11.032zm10.124-5.66L18.53 12l-6.532 11.315-1.634-2.83c2.129-3.673 4.25-7.351 6.373-11.028h3.592l3.102 5.374z`,source:`https://qwen.ai`,hex:`6950EF`},pN={google:`Google`,meta:`Meta`,qwen:`Qwen`,deepseek:`DeepSeek`,mistral:`Mistral AI`,anthropic:`Anthropic`,openai:`OpenAI`,nvidia:`NVIDIA`,moonshot:`Moonshot AI`,zhipu:`Zhipu AI`,minimax:`MiniMax`,baidu:`Baidu`,perplexity:`Perplexity`,cohere:`Cohere`,microsoft:`Microsoft`,xai:`xAI`,tencent:`Tencent`,ibm:`IBM`,ai21:`AI21 Labs`,thinkingmachines:`Thinking Machines`},mN=[[/\bnemotron\b/,`nvidia`],[/\bdeepseek\b/,`deepseek`],[/\b(qwen|qwq|qvq)\b/,`qwen`],[/\b(mistral|mixtral|codestral|magistral|devstral|ministral|pixtral|mathstral|voxtral)\b/,`mistral`],[/\b(gemini|gemma|palm|bison|learnlm)\b/,`google`],[/\b(llama|codellama)\b/,`meta`],[/\bclaude\b/,`anthropic`],[/\b(gpt|chatgpt|davinci|whisper|dall e|dalle)\b|\bo [134]\b/,`openai`],[/\b(kimi|moonshot)\b/,`moonshot`],[/\b(glm|chatglm|cogview|cogvideo)\b/,`zhipu`],[/\b(minimax|abab|hailuo)\b/,`minimax`],[/\bernie\b/,`baidu`],[/\bsonar\b/,`perplexity`],[/\b(command|aya|c4ai)\b/,`cohere`],[/\b(phi|wizardlm|orca)\b/,`microsoft`],[/\bgrok\b/,`xai`],[/\b(hunyuan|hy)\b/,`tencent`],[/\bgranite\b/,`ibm`],[/\bjamba\b/,`ai21`],[/\binkling\b/,`thinkingmachines`]],hN=[[/^(google|gemini)$/,`google`],[/^(meta|meta-llama|facebook)$/,`meta`],[/^qwen$/,`qwen`],[/^deepseek(-ai)?$/,`deepseek`],[/^mistralai$/,`mistral`],[/^anthropic$/,`anthropic`],[/^openai$/,`openai`],[/^nvidia$/,`nvidia`],[/^moonshotai$/,`moonshot`],[/^(zai-org|thudm|zhipuai|zhipu)$/,`zhipu`],[/^minimaxai$/,`minimax`],[/^baidu$/,`baidu`],[/^perplexity(-ai)?$/,`perplexity`],[/^cohereforai$/,`cohere`],[/^microsoft$/,`microsoft`],[/^(x-ai|xai)$/,`xai`],[/^tencent$/,`tencent`],[/^ibm(-granite)?$/,`ibm`],[/^ai21(labs)?$/,`ai21`],[/^thinkingmachines$/,`thinkingmachines`]];function gN(e){if(!e)return null;let t=e.trim().toLowerCase(),n=t.indexOf(`/`),r=n>0?t.slice(0,n):``,i=(n>0?t.slice(n+1):t).replace(/:.*$/,``).replace(/([a-z])(\d)/g,`$1 $2`).replace(/(\d)([a-z])/g,`$1 $2`).replace(/[-_./]/g,` `);for(let[e,t]of mN)if(e.test(i))return{id:t,name:pN[t]};if(r){for(let[e,t]of hN)if(e.test(r))return{id:t,name:pN[t]}}return null}var _N={google:aN,meta:sN,qwen:fN,deepseek:iN,mistral:lN,anthropic:nN,nvidia:uN,moonshot:oN,minimax:cN,baidu:rN,perplexity:dN};function vN({modelId:e,platform:t,className:n=`size-3.5`}){let r=gN(e),i=r?_N[r.id]:void 0,a=[r?.name,t?`via ${t}`:null].filter(Boolean).join(` · `)||t||void 0;return i?(0,G.jsx)(`span`,{title:a,"aria-label":a,className:`inline-flex shrink-0`,"data-maker":r.id,children:(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`#${i.hex}`,"aria-hidden":`true`,focusable:`false`,children:(0,G.jsx)(`path`,{d:i.path})})}):(0,G.jsx)(`span`,{title:a,"aria-label":a,className:`inline-flex shrink-0 text-muted-foreground`,children:(0,G.jsx)(Pa,{className:n,"aria-hidden":`true`})})}var yN=`playground.conversationId`,bN=`playground.sidebarOpen`;function xN(e){let t=e.find(e=>e.role===`user`);if(!t)return``;let n=(t.content.split(`
61
+ `).map(e=>e.trim()).find(Boolean)??``).replace(/\s+/g,` `).trim();return n.length<=40?n:`${n.slice(0,39).trimEnd()}…`}function SN(e){return e.map(e=>{let t={...e};return delete t.streaming,t.meta&&t.meta.fusionStreaming!==void 0&&(t.meta={...t.meta},delete t.meta.fusionStreaming),t})}function CN(){try{let e=localStorage.getItem(yN);if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null}catch{return null}}function wN(e){try{e===null?localStorage.removeItem(yN):localStorage.setItem(yN,String(e))}catch{}}function TN(){return X(`/api/conversations`)}function EN(e){return X(`/api/conversations/${e}`)}function DN(e){return X(`/api/conversations`,{method:`POST`,body:JSON.stringify(e)})}function ON(e,t){return X(`/api/conversations/${e}`,{method:`PUT`,body:JSON.stringify(t)})}function kN(e){return X(`/api/conversations/${e}`,{method:`DELETE`})}function AN(e){return e.model.startsWith(`${e.platform}/`)?e.model:`${e.platform}/${e.model}`}function jN({panel:e,judge:t,streaming:n,answerStarted:r}){let{t:i}=Z(),[a,o]=(0,v.useState)(!0),s=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{r&&!s.current&&o(!1)},[r]),(0,G.jsxs)(`div`,{className:`w-full text-[10px] leading-snug text-muted-foreground/80`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{s.current=!0,o(e=>!e)},className:`inline-flex items-center gap-1 font-mono hover:text-foreground transition-colors`,children:[(0,G.jsx)(Di,{className:`size-3 transition-transform ${a?`rotate-90`:``}`}),i(`playground.fusionTrace`,{count:e.length}),n?` …`:``]}),a&&(0,G.jsxs)(`div`,{className:`mt-1 space-y-2 border-l border-border/60 pl-2.5`,children:[e.map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`font-mono font-medium`,children:AN(e)}),e.status===`failed`?(0,G.jsxs)(`span`,{className:`ml-1.5 text-amber-600 dark:text-amber-400`,children:[i(`playground.fusionFailed`),e.error?`: ${e.error}`:``]}):e.content?(0,G.jsx)(`div`,{className:`whitespace-pre-wrap opacity-80`,children:e.content}):(0,G.jsx)(`span`,{className:`ml-1.5 opacity-60`,children:`…`})]},t)),t&&(0,G.jsxs)(`div`,{className:`pt-1.5 border-t border-border/60`,children:[(0,G.jsx)(`span`,{className:`font-mono font-medium`,children:AN(t)}),(0,G.jsx)(`span`,{className:`ml-1.5 opacity-70`,children:i(`playground.fusionJudgeSynth`)})]})]})]})}function MN({text:e,answerStarted:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(!0),a=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{t&&!a.current&&i(!1)},[t]),(0,G.jsxs)(`div`,{className:`mb-2 text-muted-foreground/80`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>{a.current=!0,i(e=>!e)},className:`inline-flex items-center gap-1 font-mono text-[10px] leading-snug hover:text-foreground transition-colors`,children:[(0,G.jsx)(Di,{className:`size-3 transition-transform ${r?`rotate-90`:``}`}),n(r?`common.hide`:`common.show`)]}),r&&(0,G.jsx)(`div`,{className:`mt-1 whitespace-pre-wrap border-l border-border/60 pl-2.5 text-sm leading-relaxed text-muted-foreground`,children:e})]})}var NN=40,PN=`playground.settingsOpen`;function FN(e){return typeof window>`u`?!0:window.matchMedia(`(min-width: 1024px)`).matches?localStorage.getItem(e)!==`false`:!1}function IN(){let{t:e}=Z(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(()=>localStorage.getItem(`playground.systemPrompt`)??``),a=e=>{i(e),localStorage.setItem(`playground.systemPrompt`,e)},[o,s]=(0,v.useState)(()=>bj()),c=e=>{s(e),xj(e)},[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(()=>localStorage.getItem(`playground.model`)??`auto`),[h,g]=(0,v.useState)([]),[_,y]=(0,v.useState)(!1),b=(0,v.useRef)(null),x=(0,v.useRef)(null),S=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(!0),T=(0,v.useRef)(0),E=(0,v.useRef)(null),D=Rr(),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(()=>FN(bN)),[M,N]=(0,v.useState)(()=>FN(PN)),P=(0,v.useRef)(null),F=(0,v.useRef)(``),I=(0,v.useRef)(null),{data:L=[]}=$r({queryKey:[`playground-conversations`],queryFn:TN}),R=()=>{D.invalidateQueries({queryKey:[`playground-conversations`]})},{data:z}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)}),{data:B}=$r({queryKey:[`media`],queryFn:()=>X(`/api/media`)}),V=B?.models??[],H=zM(V),[U,ee]=(0,v.useState)(()=>localStorage.getItem(`playground.transcriptionModel`)??`auto`),W=e=>{ee(e),localStorage.setItem(LM,e)},te=BM(V,e(`playground.autoModel`)),ne=VM(U,V),[re,ie]=(0,v.useState)(null),[ae,oe]=(0,v.useState)(!1),se=(0,v.useRef)(null),[ce,le]=(0,v.useState)(()=>kA(localStorage.getItem(wA),window.innerWidth)),ue=e=>{let t=DA(e,window.innerWidth);le(t),localStorage.setItem(wA,String(t))},de=e=>{se.current&&=(clearTimeout(se.current),null),ie(e),oe(!0)},fe=()=>{oe(!1),se.current&&clearTimeout(se.current),se.current=setTimeout(()=>{ie(null),se.current=null},280)};(0,v.useEffect)(()=>()=>{se.current&&clearTimeout(se.current)},[]);let pe=(0,v.useCallback)((e,t,n)=>{se.current&&=(clearTimeout(se.current),null),ie({id:`manual:${n.length}:${n.slice(0,40)}`,kind:e,language:t,code:n,title:/<title[^>]*>([^<]{1,120})<\/title>/i.exec(n)?.[1]?.trim()??null,filename:e===`svg`?`artifact.svg`:`artifact.html`}),oe(!0)},[]),me=(0,v.useMemo)(()=>({open:pe,activeCode:re?.code??null}),[pe,re?.code]),he=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(d){he.current=!0;return}if(!he.current)return;he.current=!1;let e=t.length-1,n=t[e];if(!n||n.role!==`assistant`||n.isError)return;let r=XE(n.content,e);if(r.length===0)return;let i=setTimeout(()=>de(r[0]),0);return()=>clearTimeout(i)},[d,t]);let{data:ge=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)}),{data:_e=[]}=$r({queryKey:[`profiles`],queryFn:()=>X(`/api/profiles`)}),ve=_e.filter(e=>e.type===`custom`).map(e=>({value:`auto:${e.name.toLowerCase()}`,label:e.emoji?`${e.emoji} ${e.name}`:e.name,sub:`auto:${e.name.toLowerCase()}`,isNew:!1,platforms:[]})),ye=ge.filter(e=>e.keyCount>0&&e.enabled),be=CA(ye,!0),xe=new Set(ye.filter(e=>e.supportsVision).map(e=>e.canonicalId??e.modelId)),Se=KA(h),Ce=Se.length>0&&p!==`auto`&&p!==`fusion`&&!p.startsWith(`auto:`)&&!xe.has(p);(0,v.useEffect)(()=>{let e=x.current;if(!e)return;T.current=e.scrollTop;let t=()=>{let t=e.scrollTop,n=t<T.current-1;T.current=t,e.scrollHeight-t-e.clientHeight<=NN?w.current=!0:n&&(w.current=!1)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),(0,v.useEffect)(()=>{w.current&&b.current?.scrollIntoView({behavior:`smooth`})},[t]),(0,v.useEffect)(()=>()=>E.current?.abort(),[]);let we=(e,t)=>{P.current=e,F.current=t,k(e),wN(e)},Te=e=>P.current===null?(I.current||=DN({title:xN(e),messages:SN(e),model:p,systemPrompt:r.trim()||null}).then(e=>(we(e.id,e.title),R(),e.id)).catch(e=>(I.current=null,console.error(`[playground] could not create the conversation`,e),null)),I.current):Promise.resolve(P.current),Ee=async e=>{let t=await Te(e);if(t!==null)try{let n=await ON(t,{title:F.current||xN(e),messages:SN(e),model:p,systemPrompt:r.trim()||null});P.current===t&&(F.current=n.title),R()}catch(e){console.error(`[playground] could not save the conversation`,e)}},De=()=>{E.current?.abort(),E.current=null,P.current=null,F.current=``,I.current=null,k(null),wN(null),n([]),g([]),w.current=!0},Oe=()=>{t.length>0&&Ee(t)},ke=async e=>{E.current?.abort(),E.current=null;let t=await EN(e);I.current=null,n(t.messages),g([]),Ue(t.model??`auto`),a(t.systemPrompt??``),we(t.id,t.title),w.current=!0,S.current?.focus()},Ae=t=>{t!==P.current&&(Oe(),ke(t).catch(t=>{console.error(`[playground] could not open the conversation`,t),pv.error(e(`playgroundSessions.loadFailed`)),R()}))},je=()=>{Oe(),De(),S.current?.focus()},Me=(t,n)=>{ON(t,{title:n}).then(e=>{P.current===t&&(F.current=e.title),R()}).catch(t=>{console.error(`[playground] could not rename the conversation`,t),pv.error(e(`playgroundSessions.renameFailed`))})},Ne=t=>{kN(t).then(()=>{P.current===t&&De(),R()}).catch(t=>{console.error(`[playground] could not delete the conversation`,t),pv.error(e(`playgroundSessions.deleteFailed`))})},Pe=()=>{j(e=>(localStorage.setItem(bN,String(!e)),!e))},Fe=()=>{N(e=>(localStorage.setItem(PN,String(!e)),!e))};(0,v.useEffect)(()=>{let e=CN();e!==null&&ke(e).catch(()=>wN(null))},[]);let Ie=async(t,r,i)=>{let a=t.getReader(),o=new TextDecoder,s=``,c=``,l=[],u=null,d=e=>{let t=[...r,{role:`assistant`,content:c,meta:{latency:Date.now()-i,fusionPanel:[...l],fusionJudge:u,fusionStreaming:e}}];return n(t),t};for(d(!0);;){let{done:t,value:n}=await a.read();if(t)break;s+=o.decode(n,{stream:!0});let r=s.split(`
62
+ `);s=r.pop()??``;for(let t of r){let n=t.trim();if(!n.startsWith(`data:`))continue;let r=n.slice(5).trim();if(r===`[DONE]`)continue;let i;try{i=JSON.parse(r)}catch{continue}if(i._fusion)i._fusion.event===`panel`?l.push({platform:i._fusion.platform,model:i._fusion.model,status:i._fusion.status,content:i._fusion.content,error:i._fusion.error}):i._fusion.event===`judge`&&(u={platform:i._fusion.platform,model:i._fusion.model}),d(!0);else if(i.error)c=`${e(`playground.errorPrefix`)} ${i.error.message}`,d(!0);else if(i.choices){let e=i.choices[0]?.delta?.content;e&&(c+=e,d(!0))}}}await Ee(d(!1))},Le=async(e,t,r,i,a)=>{let o=i?{platform:i.split(`/`)[0],model:i.split(`/`).slice(1).join(`/`)}:void 0,s=``,c=``,l=null,u=e=>{let i=[...t];return(s||c||l===null)&&i.push({role:`assistant`,content:s,...c?{reasoning:c}:{},...e?{streaming:!0}:{},meta:{platform:o?.platform,model:o?.model,latency:Date.now()-r,fallbackAttempts:a?parseInt(a):void 0}}),l!==null&&i.push({role:`assistant`,isError:!0,content:l}),n(i),i};await tj(e,{onDelta:e=>{s+=e,u(!0)},onReasoning:e=>{c+=e,u(!0)},onError:e=>{l=e,u(!0)}}),await Ee(u(!1))},Re=async t=>{if(t.length===0)return;let n=[],r=Se.reduce((e,t)=>e+JA(t),0);for(let i of t){if(h.length+n.length>=5){pv.error(e(`playground.attachTooMany`,{count:5}));break}let t=BA(i);if(!t){pv.error(e(`playground.attachUnsupported`,{name:i.name}));continue}try{if(t===`image`){let a=await QA(i);if(r+JA(a)>3e6){pv.error(e(`playground.attachTooLarge`,{name:i.name,max:YA(PA)}));continue}r+=JA(a),n.push({id:`${Date.now()}-${n.length}-${i.name}`,kind:t,name:i.name,dataUrl:a})}else{let e=await $A(i);n.push({id:`${Date.now()}-${n.length}-${i.name}`,kind:t,name:i.name,text:e})}}catch(n){let r=n instanceof XA?n.reason:`unreadable`;pv.error(r===`too-large`?e(`playground.attachTooLarge`,{name:i.name,max:YA(t===`image`?NA:FA)}):e(`playground.attachFailed`,{name:i.name}))}}n.length>0&&g(e=>[...e,...n])},ze=e=>g(t=>t.filter(t=>t.id!==e)),Be=async()=>{let i=l.trim();if(!i&&h.length===0||d)return;let a={role:`user`,content:GA(i,h),...Se.length>0?{images:Se}:{}},s=[...t,a];w.current=!0,n(s),u(``),g([]),f(!0),S.current?.focus(),Te(s);try{let t={"Content-Type":`application/json`};z?.apiKey&&(t.Authorization=`Bearer ${z.apiKey}`);let i=p===`fusion`,a=r.trim(),c={messages:[...a?[{role:`system`,content:a}]:[],...s.map(e=>({role:e.role,content:qA(e.content,e.images)}))],...vj(o)};p!==`auto`&&(c.model=p),c.stream=!0,E.current?.abort();let l=new AbortController;E.current=l;let u=`/`.replace(/\/$/,``),d=Date.now(),f=await fetch(`${u}/v1/chat/completions`,{method:`POST`,headers:t,body:JSON.stringify(c),signal:l.signal}),m=Date.now()-d,h=f.headers.get(`X-Routed-Via`),g=f.headers.get(`X-Fallback-Attempts`);if(!f.ok){let t=await f.json().catch(()=>({error:{message:`HTTP ${f.status}`}})),r=[...s,{role:`assistant`,isError:!0,content:t.error?.message??e(`common.unknownError`)}];n(r),await Ee(r);return}if(i&&f.body){await Ie(f.body,s,d);return}if(!i&&f.body&&(f.headers.get(`Content-Type`)??``).includes(`text/event-stream`)){await Le(f.body,s,d,h,g);return}let _=await f.json(),v=_.choices?.[0]?.message?.content??JSON.stringify(_,null,2),y=_._routed_via??(h?{platform:h.split(`/`)[0],model:h.split(`/`).slice(1).join(`/`)}:void 0),b=_._fusion,x=[...s,{role:`assistant`,content:v,meta:{platform:y?.platform,model:y?.model,latency:m,fallbackAttempts:g?parseInt(g):void 0,fusionPanel:b?.panel,fusionJudge:b?.judge}}];n(x),await Ee(x)}catch(e){if(e?.name===`AbortError`)return;let t=[...s,{role:`assistant`,isError:!0,content:e.message}];n(t),await Ee(t)}finally{f(!1),setTimeout(()=>S.current?.focus(),0)}},Ve=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Be())},He=[{value:`auto`,label:e(`playground.autoModel`),sub:``,isNew:!1,platforms:[]},{value:`fusion`,label:e(`playground.fusionModel`),sub:``,isNew:!1,platforms:[]},...ve,...be.slice().sort((e,t)=>e.sizeTier-t.sizeTier||e.intelligenceRank-t.intelligenceRank||e.label.localeCompare(t.label,void 0,{sensitivity:`base`})).map(t=>({value:t.value,label:t.label,sub:t.providerCount>1?e(`models.providerCount`,{count:t.providerCount}):t.platform,isNew:!1,platforms:t.providerCount>1?t.platforms:[],note:Se.length>0&&!xe.has(t.value)?e(`playground.noVisionBadge`):void 0}))];function Ue(e){m(e),localStorage.setItem(`playground.model`,e)}let We=p===`auto`?e(`playground.autoModel`):p===`fusion`?e(`playground.fusionModel`):p.startsWith(`auto:`)?ve.find(e=>e.value===p)?.label??p:be.find(e=>e.value===p)?.label??p;return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden [&_svg]:stroke-[1.5]`,children:[(0,G.jsx)(rj,{conversations:L,activeId:O,open:A,onToggle:Pe,onNew:je,onSelect:Ae,onRename:Me,onDelete:Ne}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,G.jsx)(`div`,{ref:x,className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:(0,G.jsx)(`div`,{className:`mx-auto h-full w-full max-w-3xl space-y-4`,children:t.length===0?(0,G.jsx)(`div`,{className:`flex items-center justify-center h-full text-center`,children:(0,G.jsxs)(`div`,{className:`space-y-2 max-w-sm`,children:[(0,G.jsx)(`p`,{className:`text-base font-medium`,children:e(`playground.emptyTitle`)}),(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`playground.emptyDescription`,{model:We})})]})}):(0,G.jsxs)(G.Fragment,{children:[t.map((t,n)=>{let r=t.meta?.fusionPanel,i=r?.filter(e=>e.status!==`failed`)??[],a=t.role===`user`||t.content.length>0||!!t.reasoning;return(0,G.jsx)(`div`,{className:`flex ${t.role===`user`?`justify-end`:`justify-start`}`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 ${t.role===`user`?`max-w-[80%] items-end`:`w-full items-start`}`,children:[a&&(0,G.jsxs)(`div`,{className:`group relative text-sm leading-relaxed ${t.role===`user`?`rounded-2xl bg-primary px-4 py-2.5 text-primary-foreground`:t.isError?`rounded-2xl border border-destructive/25 bg-destructive/10 px-4 py-2.5 text-destructive`:`w-full`}`,children:[t.images&&t.images.length>0&&(0,G.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:t.images.map((e,t)=>(0,G.jsx)(`img`,{src:e,alt:``,className:`size-20 rounded-lg object-cover`},t))}),t.isError?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(Mi,{className:`mt-0.5 size-4 shrink-0`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`font-medium`,children:e(`playground.errorTitle`)}),(0,G.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:t.content})]})]}):t.role===`assistant`?(0,G.jsxs)(G.Fragment,{children:[t.reasoning&&(0,G.jsx)(MN,{text:t.reasoning,answerStarted:t.content.length>0}),(0,G.jsx)(eD.Provider,{value:me,children:(0,G.jsx)(sD,{children:t.content})})]}):(0,G.jsx)(`div`,{className:`whitespace-pre-wrap`,children:t.content}),t.meta&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap text-[11px] opacity-70 tabular-nums`,children:[r||t.meta.fusionStreaming?(0,G.jsxs)(G.Fragment,{children:[i.length>0&&(0,G.jsxs)(`span`,{children:[e(`playground.fusionPanel`),`:`,` `,(0,G.jsx)(`span`,{className:`font-mono`,children:i.map(AN).join(`, `)})]}),t.meta.fusionJudge&&(0,G.jsxs)(`span`,{children:[`· `,e(`playground.fusionJudge`),`:`,` `,(0,G.jsx)(`span`,{className:`font-mono`,children:AN(t.meta.fusionJudge)})]}),t.meta.latency!=null&&(0,G.jsxs)(`span`,{children:[`· `,t.meta.latency,` ms`]})]}):(0,G.jsxs)(G.Fragment,{children:[(t.meta.model||t.meta.platform)&&(0,G.jsx)(vN,{modelId:t.meta.model,platform:t.meta.platform,className:`size-3`}),t.meta.model&&(0,G.jsx)(`span`,{className:`font-mono`,children:t.meta.model}),t.meta.latency!=null&&!t.streaming&&(0,G.jsxs)(`span`,{children:[`· `,t.meta.latency,` ms`]}),t.meta.fallbackAttempts!=null&&t.meta.fallbackAttempts>0&&(0,G.jsxs)(`span`,{children:[`· `,t.meta.fallbackAttempts,` `,t.meta.fallbackAttempts>1?e(`playground.fallbacks`):e(`playground.fallback`)]})]}),t.role===`assistant`&&!t.isError&&t.content&&(0,G.jsx)(vv,{text:t.content,label:e(`playground.copyReply`),className:`size-5 border-0 bg-transparent opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-60 hover:!opacity-100`})]}),!t.meta&&t.role===`assistant`&&!t.isError&&t.content&&(0,G.jsx)(vv,{text:t.content,label:e(`playground.copyReply`),className:`mt-1 size-5 border-0 bg-transparent opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-60 hover:!opacity-100`})]}),t.role===`assistant`&&r&&r.length>0&&(0,G.jsx)(jN,{panel:r,judge:t.meta?.fusionJudge,streaming:t.meta?.fusionStreaming,answerStarted:t.content.length>0})]})},n)}),d&&t[t.length-1]?.role===`user`&&(0,G.jsx)(`div`,{className:`flex justify-start`,children:(0,G.jsx)(`div`,{className:`py-2`,children:(0,G.jsxs)(`div`,{className:`flex gap-1`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50 animate-bounce`,style:{animationDelay:`0ms`}}),(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50 animate-bounce`,style:{animationDelay:`150ms`}}),(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50 animate-bounce`,style:{animationDelay:`300ms`}})]})})}),(0,G.jsx)(`div`,{ref:b})]})})}),(0,G.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-4 sm:px-6 pb-4 pt-1 transition-colors ${_?`rounded-2xl bg-primary/5 ring-1 ring-inset ring-primary/40`:``}`,onDragOver:e=>{e.preventDefault(),y(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||y(!1)},onDrop:e=>{e.preventDefault(),y(!1),Re([...e.dataTransfer.files])},children:[h.length>0&&(0,G.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:h.map(t=>(0,G.jsxs)(`div`,{className:`relative flex items-center gap-1.5 rounded-lg border bg-background py-1 pl-1.5 pr-6 text-xs`,children:[t.kind===`image`&&t.dataUrl?(0,G.jsx)(`img`,{src:t.dataUrl,alt:``,className:`size-8 rounded object-cover`}):(0,G.jsx)(Zi,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`max-w-[140px] truncate`,children:t.name}),(0,G.jsx)(`button`,{type:`button`,"aria-label":e(`common.remove`),title:e(`common.remove`),onClick:()=>ze(t.id),className:`absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(Wa,{className:`size-3.5`})})]},t.id))}),Ce&&(0,G.jsxs)(`div`,{className:`mb-2 flex items-start gap-1.5 text-xs text-amber-600 dark:text-amber-400`,children:[(0,G.jsx)(Mi,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:e(`playground.visionWarning`,{model:We})})]}),(0,G.jsx)(`input`,{ref:C,type:`file`,multiple:!0,accept:RA,className:`hidden`,onChange:e=>{Re([...e.target.files??[]]),e.target.value=``}}),(0,G.jsx)(QM,{inputRef:S,value:l,onChange:u,onKeyDown:Ve,onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),Re(t))},placeholder:e(`playground.inputPlaceholder`),hasContent:JM(l,h.length),loading:d,onSend:Be,onAttach:()=>C.current?.click(),labels:{attach:e(`playground.attach`),send:e(`playground.send`),sending:e(`playground.sending`)},dictation:{available:H,model:ne,apiKey:z?.apiKey,onText:e=>{u(t=>WM(t,e)),S.current?.focus()}}})]})]}),re?(0,G.jsx)(jA,{artifact:re,open:ae,width:ce,onWidthChange:le,onWidthCommit:ue,onClose:fe}):(0,G.jsx)(Tj,{open:M,onToggle:Fe,modelValue:p,modelOptions:He,onSelectModel:Ue,noModels:ye.length===0,dictationValue:ne,dictationOptions:te,onSelectDictation:W,noTranscription:!H,systemPrompt:r,onSystemPromptChange:a,sampling:o,onSamplingChange:c})]})}function LN(){var e=[...arguments];return(0,v.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var RN=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function zN(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function BN(e){return`nodeType`in e}function VN(e){return e?zN(e)?e:BN(e)?e.ownerDocument?.defaultView??window:window:window}function HN(e){let{Document:t}=VN(e);return e instanceof t}function UN(e){return!zN(e)&&e instanceof VN(e).HTMLElement}function WN(e){return e instanceof VN(e).SVGElement}function GN(e){return e?zN(e)?e.document:BN(e)?HN(e)?e:UN(e)||WN(e)?e.ownerDocument:document:document:document}var KN=RN?v.useLayoutEffect:v.useEffect;function qN(e){let t=(0,v.useRef)(e);return KN(()=>{t.current=e}),(0,v.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function JN(){let e=(0,v.useRef)(null);return[(0,v.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,v.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function YN(e,t){t===void 0&&(t=[e]);let n=(0,v.useRef)(e);return KN(()=>{n.current!==e&&(n.current=e)},t),n}function XN(e,t){let n=(0,v.useRef)();return(0,v.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ZN(e){let t=qN(e),n=(0,v.useRef)(null);return[n,(0,v.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function QN(e){let t=(0,v.useRef)();return(0,v.useEffect)(()=>{t.current=e},[e]),t.current}var $N={};function eP(e,t){return(0,v.useMemo)(()=>{if(t)return t;let n=$N[e]==null?0:$N[e]+1;return $N[e]=n,e+`-`+n},[e,t])}function tP(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var nP=tP(1),rP=tP(-1);function iP(e){return`clientX`in e&&`clientY`in e}function aP(e){if(!e)return!1;let{KeyboardEvent:t}=VN(e.target);return t&&e instanceof t}function oP(e){if(!e)return!1;let{TouchEvent:t}=VN(e.target);return t&&e instanceof t}function sP(e){if(oP(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return iP(e)?{x:e.clientX,y:e.clientY}:null}var cP=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[cP.Translate.toString(e),cP.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),lP=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function uP(e){return e.matches(lP)?e:e.querySelector(lP)}var dP={display:`none`};function fP(e){let{id:t,value:n}=e;return v.createElement(`div`,{id:t,style:dP},n)}function pP(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return v.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function mP(){let[e,t]=(0,v.useState)(``);return{announce:(0,v.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var hP=(0,v.createContext)(null);function gP(e){let t=(0,v.useContext)(hP);(0,v.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function _P(){let[e]=(0,v.useState)(()=>new Set),t=(0,v.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,v.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var vP={draggable:`
63
+ To pick up a draggable item, press the space bar.
64
+ While dragging, use the arrow keys to move the item.
65
+ Press space again to drop the item in its new position, or press escape to cancel.
66
+ `},yP={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function bP(e){let{announcements:t=yP,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=vP}=e,{announce:a,announcement:o}=mP(),s=eP(`DndLiveRegion`),[c,l]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{l(!0)},[]),gP((0,v.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=v.createElement(v.Fragment,null,v.createElement(fP,{id:r,value:i.draggable}),v.createElement(pP,{id:s,announcement:o}));return n?(0,xu.createPortal)(u,n):u}var xP;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(xP||={});function SP(){}function CP(e,t){return(0,v.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function wP(){var e=[...arguments];return(0,v.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var TP=Object.freeze({x:0,y:0});function EP(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function DP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function OP(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function kP(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function AP(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function jP(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var MP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=jP(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=EP(jP(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(DP)},NP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=kP(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=kP(r),o=i.reduce((e,t,r)=>e+EP(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(DP)};function PP(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var FP=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=PP(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(OP)};function IP(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function LP(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:TP}function RP(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var zP=RP(1);function BP(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function VP(e,t,n){let r=BP(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var HP={ignoreTransform:!1};function UP(e,t){t===void 0&&(t=HP);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=VN(e).getComputedStyle(e);t&&(n=VP(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function WP(e){return UP(e,{ignoreTransform:!0})}function GP(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function KP(e,t){return t===void 0&&(t=VN(e).getComputedStyle(e)),t.position===`fixed`}function qP(e,t){t===void 0&&(t=VN(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function JP(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(HN(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!UN(i)||WN(i)||n.includes(i))return n;let a=VN(e).getComputedStyle(i);return i!==e&&qP(i,a)&&n.push(i),KP(i,a)?n:r(i.parentNode)}return e?r(e):n}function YP(e){let[t]=JP(e,1);return t??null}function XP(e){return!RN||!e?null:zN(e)?e:BN(e)?HN(e)||e===GN(e).scrollingElement?window:UN(e)?e:null:null}function ZP(e){return zN(e)?e.scrollX:e.scrollLeft}function QP(e){return zN(e)?e.scrollY:e.scrollTop}function $P(e){return{x:ZP(e),y:QP(e)}}var eF;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(eF||={});function tF(e){return!RN||!e?!1:e===document.scrollingElement}function nF(e){let t={x:0,y:0},n=tF(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var rF={x:.2,y:.2};function iF(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=rF);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=nF(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=eF.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=eF.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=eF.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=eF.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function aF(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function oF(e){return e.reduce((e,t)=>nP(e,$P(t)),TP)}function sF(e){return e.reduce((e,t)=>e+ZP(t),0)}function cF(e){return e.reduce((e,t)=>e+QP(t),0)}function lF(e,t){if(t===void 0&&(t=UP),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);YP(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var uF=[[`x`,[`left`,`right`],sF],[`y`,[`top`,`bottom`],cF]],dF=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=JP(t),r=oF(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of uF)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},fF=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function pF(e){let{EventTarget:t}=VN(e);return e instanceof t?e:GN(e)}function mF(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var hF;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(hF||={});function gF(e){e.preventDefault()}function _F(e){e.stopPropagation()}var vF;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(vF||={});var yF={start:[vF.Space,vF.Enter],cancel:[vF.Esc],end:[vF.Space,vF.Enter,vF.Tab]},bF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case vF.Right:return{...n,x:n.x+25};case vF.Left:return{...n,x:n.x-25};case vF.Down:return{...n,y:n.y+25};case vF.Up:return{...n,y:n.y-25}}},xF=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new fF(GN(t)),this.windowListeners=new fF(VN(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hF.Resize,this.handleCancel),this.windowListeners.add(hF.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hF.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&lF(n),t(TP)}handleKeyDown(e){if(aP(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=yF,coordinateGetter:a=bF,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:TP;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=rP(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=nF(n),p=aF(n),m={x:Math.min(i===vF.Right?p.right-p.width/2:p.right,Math.max(i===vF.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===vF.Down?p.bottom-p.height/2:p.bottom,Math.max(i===vF.Down?p.top:p.top+p.height/2,u.y))},h=i===vF.Right&&!s||i===vF.Left&&!c,g=i===vF.Down&&!l||i===vF.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===vF.Right&&e<=d.x||i===vF.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===vF.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===vF.Down&&e<=d.y||i===vF.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===vF.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,nP(rP(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};xF.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=yF,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function SF(e){return!!(e&&`distance`in e)}function CF(e){return!!(e&&`delay`in e)}var wF=class{constructor(e,t,n){n===void 0&&(n=pF(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=GN(i),this.documentListeners=new fF(this.document),this.listeners=new fF(n),this.windowListeners=new fF(VN(i)),this.initialCoordinates=sP(r)??TP,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(hF.Resize,this.handleCancel),this.windowListeners.add(hF.DragStart,gF),this.windowListeners.add(hF.VisibilityChange,this.handleCancel),this.windowListeners.add(hF.ContextMenu,gF),this.documentListeners.add(hF.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(CF(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(SF(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(hF.Click,_F,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hF.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=sP(e)??TP,s=rP(n,o);if(!t&&a){if(SF(a)){if(a.tolerance!=null&&mF(s,a.tolerance))return this.handleCancel();if(mF(s,a.distance))return this.handleStart()}if(CF(a)&&mF(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===vF.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},TF={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},EF=class extends wF{constructor(e){let{event:t}=e,n=GN(t.target);super(e,TF,n)}};EF.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var DF={move:{name:`mousemove`},end:{name:`mouseup`}},OF;(function(e){e[e.RightClick=2]=`RightClick`})(OF||={});var Sie=class extends wF{constructor(e){super(e,DF,GN(e.event.target))}};Sie.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==OF.RightClick&&(r?.({event:n}),!0)}}];var kF={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Cie=class extends wF{constructor(e){super(e,kF)}static setup(){return window.addEventListener(kF.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(kF.move.name,e)};function e(){}}};Cie.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var AF;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(AF||={});var jF;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(jF||={});function wie(e){let{acceleration:t,activator:n=AF.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=jF.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=Eie({delta:d,disabled:!a}),[m,h]=JN(),g=(0,v.useRef)({x:0,y:0}),_=(0,v.useRef)({x:0,y:0}),y=(0,v.useMemo)(()=>{switch(n){case AF.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case AF.DraggableRect:return i}},[n,i,c]),b=(0,v.useRef)(null),x=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),S=(0,v.useMemo)(()=>s===jF.TreeOrder?[...l].reverse():l,[s,l]);(0,v.useEffect)(()=>{if(!a||!l.length||!y){h();return}for(let e of S){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=iF(e,i,y,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),b.current=e,m(x,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,x,r,h,a,o,JSON.stringify(y),JSON.stringify(p),m,l,S,u,JSON.stringify(f)])}var Tie={x:{[eF.Backward]:!1,[eF.Forward]:!1},y:{[eF.Backward]:!1,[eF.Forward]:!1}};function Eie(e){let{delta:t,disabled:n}=e,r=QN(t);return XN(e=>{if(n||!r||!e)return Tie;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[eF.Backward]:e.x[eF.Backward]||i.x===-1,[eF.Forward]:e.x[eF.Forward]||i.x===1},y:{[eF.Backward]:e.y[eF.Backward]||i.y===-1,[eF.Forward]:e.y[eF.Forward]||i.y===1}}},[n,t,r])}function Die(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return XN(e=>t==null?null:r??e??null,[r,t])}function Oie(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var MF;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(MF||={});var NF;(function(e){e.Optimized=`optimized`})(NF||={});var PF=new Map;function kie(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,v.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,v.useRef)(e),d=g(),f=YN(d),p=(0,v.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,v.useRef)(null),h=XN(t=>{if(d&&!n)return PF;if(!t||t===PF||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new dF(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,v.useEffect)(()=>{u.current=e},[e]),(0,v.useEffect)(()=>{d||p()},[n,d]),(0,v.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,v.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case MF.Always:return!1;case MF.BeforeDragging:return n;default:return!n}}}function FF(e,t){return XN(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function Aie(e,t){return FF(e,t)}function jie(e){let{callback:t,disabled:n}=e,r=qN(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function IF(e){let{callback:t,disabled:n}=e,r=qN(t),i=(0,v.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,v.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Mie(e){return new dF(UP(e),e)}function LF(e,t,n){t===void 0&&(t=Mie);let[r,i]=(0,v.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=jie({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=IF({callback:a});return KN(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function Nie(e){return LP(e,FF(e))}var RF=[];function Pie(e){let t=(0,v.useRef)(e),n=XN(n=>e?n&&n!==RF&&e&&t.current&&e.parentNode===t.current.parentNode?n:JP(e):RF,[e]);return(0,v.useEffect)(()=>{t.current=e},[e]),n}function Fie(e){let[t,n]=(0,v.useState)(null),r=(0,v.useRef)(e),i=(0,v.useCallback)(e=>{let t=XP(e.target);t&&n(e=>e?(e.set(t,$P(t)),new Map(e)):null)},[]);return(0,v.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=XP(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,$P(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{XP(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,v.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>nP(e,t),TP):oF(e):TP,[e,t])}function zF(e,t){t===void 0&&(t=[]);let n=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n.current=null},t),(0,v.useEffect)(()=>{let t=e!==TP;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?rP(e,n.current):TP}function Iie(e){(0,v.useEffect)(()=>{if(!RN)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Lie(e,t){return(0,v.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function BF(e){return(0,v.useMemo)(()=>e?GP(e):null,[e])}var VF=[];function Rie(e,t){t===void 0&&(t=UP);let[n]=e,r=BF(n?VN(n):null),[i,a]=(0,v.useState)(VF);function o(){a(()=>e.length?e.map(e=>tF(e)?r:new dF(t(e),e)):VF)}let s=IF({callback:o});return KN(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function zie(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return UN(t)?t:e}function Bie(e){let{measure:t}=e,[n,r]=(0,v.useState)(null),i=IF({callback:(0,v.useCallback)(e=>{for(let{target:n}of e)if(UN(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=ZN((0,v.useCallback)(e=>{let n=zie(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,v.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Vie=[{sensor:EF,options:{}},{sensor:xF,options:{}}],Hie={current:{}},HF={draggable:{measure:WP},droppable:{measure:WP,strategy:MF.WhileDragging,frequency:NF.Optimized},dragOverlay:{measure:UP}},UF=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Uie={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new UF,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:SP},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:HF,measureDroppableContainers:SP,windowRect:null,measuringScheduled:!1},Wie={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:SP,draggableNodes:new Map,over:null,measureDroppableContainers:SP},WF=(0,v.createContext)(Wie),GF=(0,v.createContext)(Uie);function Gie(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new UF}}}function Kie(e,t){switch(t.type){case xP.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xP.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case xP.DragEnd:case xP.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xP.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new UF(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case xP.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new UF(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case xP.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new UF(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function qie(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,v.useContext)(WF),a=QN(r),o=QN(n?.id);return(0,v.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!aP(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=uP(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Jie(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Yie(e){return(0,v.useMemo)(()=>({draggable:{...HF.draggable,...e?.draggable},droppable:{...HF.droppable,...e?.droppable},dragOverlay:{...HF.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Xie(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,v.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;KN(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=LP(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=YP(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var KF=(0,v.createContext)({...TP,scaleX:1,scaleY:1}),qF;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(qF||={});var JF=(0,v.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Vie,collisionDetection:o=FP,measuring:s,modifiers:c,...l}=e,[u,d]=(0,v.useReducer)(Kie,void 0,Gie),[f,p]=_P(),[m,h]=(0,v.useState)(qF.Uninitialized),g=m===qF.Initialized,{draggable:{active:_,nodes:y,translate:b},droppable:{containers:x}}=u,S=_==null?null:y.get(_),C=(0,v.useRef)({initial:null,translated:null}),w=(0,v.useMemo)(()=>_==null?null:{id:_,data:S?.data??Hie,rect:C},[_,S]),T=(0,v.useRef)(null),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)(null),A=YN(l,Object.values(l)),j=eP(`DndDescribedBy`,t),M=(0,v.useMemo)(()=>x.getEnabled(),[x]),N=Yie(s),{droppableRects:P,measureDroppableContainers:F,measuringScheduled:I}=kie(M,{dragging:g,dependencies:[b.x,b.y],config:N.droppable}),L=Die(y,_),R=(0,v.useMemo)(()=>O?sP(O):null,[O]),z=Te(),B=Aie(L,N.draggable.measure);Xie({activeNode:_==null?null:y.get(_),config:z.layoutShiftCompensation,initialRect:B,measure:N.draggable.measure});let V=LF(L,N.draggable.measure,B),H=LF(L?L.parentElement:null),U=(0,v.useRef)({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=x.getNodeFor(U.current.over?.id),W=Bie({measure:N.dragOverlay.measure}),te=W.nodeRef.current??L,ne=g?W.rect??V:null,re=!!(W.nodeRef.current&&W.rect),ie=Nie(re?null:V),ae=BF(te?VN(te):null),oe=Pie(g?ee??L:null),se=Rie(oe),ce=Jie(c,{transform:{x:b.x-ie.x,y:b.y-ie.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:V,containerNodeRect:H,draggingNodeRect:ne,over:U.current.over,overlayNodeRect:W.rect,scrollableAncestors:oe,scrollableAncestorRects:se,windowRect:ae}),le=R?nP(R,b):null,ue=Fie(oe),de=zF(ue),fe=zF(ue,[V]),pe=nP(ce,de),me=ne?zP(ne,ce):null,he=w&&me?o({active:w,collisionRect:me,droppableRects:P,droppableContainers:M,pointerCoordinates:le}):null,ge=AP(he,`id`),[_e,ve]=(0,v.useState)(null),ye=IP(re?ce:nP(ce,fe),_e?.rect??null,V),be=(0,v.useRef)(null),xe=(0,v.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=y.get(T.current);if(!i)return;let a=e.nativeEvent,o=new n({active:T.current,activeNode:i,event:a,options:r,context:U,onAbort(e){if(!y.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!y.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=y.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,xu.unstable_batchedUpdates)(()=>{r?.(i),h(qF.Initializing),d({type:xP.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),D(be.current),k(a)})},onMove(e){d({type:xP.DragMove,coordinates:e})},onEnd:s(xP.DragEnd),onCancel:s(xP.DragCancel)});be.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=U.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===xP.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=xP.DragCancel)}T.current=null,(0,xu.unstable_batchedUpdates)(()=>{d({type:e}),h(qF.Uninitialized),ve(null),D(null),k(null),be.current=null;let t=e===xP.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[y]),Se=Oie(a,(0,v.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=y.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,xe(n,t))},[y,xe]));Iie(a),KN(()=>{V&&m===qF.Initializing&&h(qF.Initialized)},[V,m]),(0,v.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=U.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:pe.x,y:pe.y},over:i};(0,xu.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[pe.x,pe.y]),(0,v.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=U.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(ge),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,xu.unstable_batchedUpdates)(()=>{ve(s),a?.(c),f({type:`onDragOver`,event:c})})},[ge]),KN(()=>{U.current={activatorEvent:O,active:w,activeNode:L,collisionRect:me,collisions:he,droppableRects:P,draggableNodes:y,draggingNode:te,draggingNodeRect:ne,droppableContainers:x,over:_e,scrollableAncestors:oe,scrollAdjustedTranslate:pe},C.current={initial:ne,translated:me}},[w,L,he,me,y,te,ne,P,x,_e,oe,pe]),wie({...z,delta:b,draggingRect:me,pointerCoordinates:le,scrollableAncestors:oe,scrollableAncestorRects:se});let Ce=(0,v.useMemo)(()=>({active:w,activeNode:L,activeNodeRect:V,activatorEvent:O,collisions:he,containerNodeRect:H,dragOverlay:W,draggableNodes:y,droppableContainers:x,droppableRects:P,over:_e,measureDroppableContainers:F,scrollableAncestors:oe,scrollableAncestorRects:se,measuringConfiguration:N,measuringScheduled:I,windowRect:ae}),[w,L,V,O,he,H,W,y,x,P,_e,F,oe,se,N,I,ae]),we=(0,v.useMemo)(()=>({activatorEvent:O,activators:Se,active:w,activeNodeRect:V,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:y,over:_e,measureDroppableContainers:F}),[O,Se,w,V,d,j,y,_e,F]);return v.createElement(hP.Provider,{value:p},v.createElement(WF.Provider,{value:we},v.createElement(GF.Provider,{value:Ce},v.createElement(KF.Provider,{value:ye},i)),v.createElement(qie,{disabled:n?.restoreFocus===!1})),v.createElement(bP,{...n,hiddenTextDescribedById:j}));function Te(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Zie=(0,v.createContext)(null),YF=`button`,Qie=`Draggable`;function $ie(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=eP(Qie),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,v.useContext)(WF),{role:p=YF,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,v.useContext)(g?KF:Zie),[y,b]=ZN(),[x,S]=ZN(),C=Lie(o,t),w=YN(n);return KN(()=>(d.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,v.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===YF?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:C,node:y,over:f,setNodeRef:b,setActivatorNodeRef:S,transform:_}}function eae(){return(0,v.useContext)(GF)}var tae=`Droppable`,nae={timeout:25};function rae(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=eP(tae),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,v.useContext)(WF),u=(0,v.useRef)({disabled:n}),d=(0,v.useRef)(!1),f=(0,v.useRef)(null),p=(0,v.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...nae,...i},_=YN(h??r),y=IF({callback:(0,v.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[b,x]=ZN((0,v.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y])),S=YN(t);return(0,v.useEffect)(()=>{!y||!b.current||(y.disconnect(),d.current=!1,y.observe(b.current))},[b,y]),(0,v.useEffect)(()=>(s({type:xP.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:f,data:S}}),()=>s({type:xP.UnregisterDroppable,key:a,id:r})),[r]),(0,v.useEffect)(()=>{n!==u.current.disabled&&(s({type:xP.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function XF(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function iae(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function ZF(e){return e!==null&&e>=0}function aae(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oae(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var QF=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=XF(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},$F={scaleX:1,scaleY:1},eI=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...$F}:null}let s=sae(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...$F}:r<t&&r>=a?{x:0,y:o.height+s,...$F}:{x:0,y:0,...$F}};function sae(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var tI=`Sortable`,nI=v.createContext({activeIndex:-1,containerId:tI,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:QF,disabled:{draggable:!1,droppable:!1}});function rI(e){let{children:t,id:n,items:r,strategy:i=QF,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=eae(),d=eP(tI,n),f=s.rect!==null,p=(0,v.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,v.useRef)(p),y=!aae(p,_.current),b=g!==-1&&h===-1||y,x=oae(a);KN(()=>{y&&m&&u(p)},[y,p,m,u]),(0,v.useEffect)(()=>{_.current=p},[p]);let S=(0,v.useMemo)(()=>({activeIndex:h,containerId:d,disabled:x,disableTransforms:b,items:p,overIndex:g,useDragOverlay:f,sortedRects:iae(p,c),strategy:i}),[h,d,x.draggable,x.droppable,b,p,g,c,f,i]);return v.createElement(nI.Provider,{value:S},t)}var cae=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return XF(n,r,i).indexOf(t)},lae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},uae={duration:200,easing:`ease`},iI=`transform`,dae=cP.Transition.toString({property:iI,duration:0,easing:`linear`}),fae={roleDescription:`sortable`};function pae(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,v.useState)(null),s=(0,v.useRef)(n);return KN(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=UP(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,v.useEffect)(()=>{a&&o(null)},[a]),a}function aI(e){let{animateLayoutChanges:t=lae,attributes:n,disabled:r,data:i,getNewIndex:a=cae,id:o,strategy:s,resizeObserverConfig:c,transition:l=uae}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:y}=(0,v.useContext)(nI),b=mae(r,p),x=u.indexOf(o),S=(0,v.useMemo)(()=>({sortable:{containerId:d,index:x,items:u},...i}),[d,i,x,u]),C=(0,v.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=rae({id:o,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:P,over:F,setActivatorNodeRef:I,transform:L}=$ie({id:o,data:S,attributes:{...fae,...n},disabled:b.draggable}),R=LN(D,M),z=!!O,B=z&&!m&&ZF(f)&&ZF(g),V=!_&&P,H=B?(V&&B?L:null)??(s??y)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:x}):null,U=ZF(f)&&ZF(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):x,ee=O?.id,W=(0,v.useRef)({activeId:ee,items:u,newIndex:U,containerId:d}),te=u!==W.current.items,ne=t({active:O,containerId:d,isDragging:P,isSorting:z,id:o,index:x,items:u,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:l,wasDragging:W.current.activeId!=null}),re=pae({disabled:!ne,index:x,node:T,rect:w});return(0,v.useEffect)(()=>{z&&W.current.newIndex!==U&&(W.current.newIndex=U),d!==W.current.containerId&&(W.current.containerId=d),u!==W.current.items&&(W.current.items=u)},[z,U,d,u]),(0,v.useEffect)(()=>{if(ee===W.current.activeId)return;if(ee!=null&&W.current.activeId==null){W.current.activeId=ee;return}let e=setTimeout(()=>{W.current.activeId=ee},50);return()=>clearTimeout(e)},[ee]),{active:O,activeIndex:f,attributes:j,data:S,rect:w,index:x,newIndex:U,items:u,isOver:E,isSorting:z,isDragging:P,listeners:N,node:T,overIndex:g,over:F,setNodeRef:R,setActivatorNodeRef:I,setDroppableNodeRef:D,setDraggableNodeRef:M,transform:re??H,transition:ie()};function ie(){if(re||te&&W.current.newIndex===x)return dae;if(!(V&&!aP(k)||!l)&&(z||ne))return cP.Transition.toString({...l,property:iI})}}function mae(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function oI(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var hae=[vF.Down,vF.Right,vF.Up,vF.Left],sI=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(hae.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case vF.Down:r.top<a.top&&t.push(n);break;case vF.Up:r.top>a.top&&t.push(n);break;case vF.Left:r.left>a.left&&t.push(n);break;case vF.Right:r.left<a.left&&t.push(n)}});let c=NP({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=AP(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=JP(c).some((e,t)=>s[t]!==e),i=cI(e,t),a=gae(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:rP(u,l)}}}};function cI(e,t){return!oI(e)||!oI(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function gae(e,t){return!oI(e)||!oI(t)||!cI(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var _ae=[{key:`reliability`,tKey:`weightReliability`,color:`#22c55e`},{key:`speed`,tKey:`weightSpeed`,color:`#3b82f6`},{key:`intelligence`,tKey:`weightIntelligence`,color:`#a855f7`}];function vae({saved:e,onSave:t,saving:n}){let{t:r}=Z(),[i,a]=(0,v.useState)(()=>c(e)),[o,s]=(0,v.useState)(!1);function c(e){let t=e??{reliability:1/3,speed:1/3,intelligence:1/3};return{reliability:Math.round(t.reliability*100),speed:Math.round(t.speed*100),intelligence:Math.round(t.intelligence*100)}}function l(e,t){a({...i,[e]:t}),s(!0)}function u(){d<=0||(t({reliability:i.reliability/100,speed:i.speed/100,intelligence:i.intelligence/100}),s(!1))}let d=i.reliability+i.speed+i.intelligence;return(0,G.jsxs)(s_,{onOpenChange:t=>{t&&(a(c(e)),s(!1))},children:[(0,G.jsxs)(c_,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:[(0,G.jsx)(Na,{className:`size-3.5`}),r(`strategies.adjust`)]}),(0,G.jsx)(l_,{align:`start`,className:`w-80`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-sm font-medium`,children:r(`strategies.customWeights`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:r(`strategies.customWeightsHelp`)})]}),_ae.map(e=>{let t=d>0?Math.round(i[e.key]/d*100):0,n=r(`strategies.${e.tKey}`);return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between text-xs`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm`,style:{background:e.color}}),n]}),(0,G.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[t,`%`]})]}),(0,G.jsx)(`input`,{type:`range`,min:0,max:100,step:1,value:i[e.key],onChange:t=>l(e.key,Number(t.target.value)),className:`w-full cursor-pointer`,style:{accentColor:e.color},"aria-label":`${n} weight`})]},e.key)}),d<=0&&(0,G.jsx)(`p`,{className:`text-xs text-amber-600 dark:text-amber-500`,children:r(`strategies.weightRequired`)}),(0,G.jsx)(J,{size:`sm`,className:`w-full`,disabled:!o||d<=0||n,onClick:u,children:r(n?`common.applying`:o?`common.apply`:`common.applied`)})]})})]})}var lI=`srouter.setup.dismissed`,uI=`srouter.setup.connected`;function dI(e){try{return localStorage.getItem(e)===`1`}catch{return!1}}function fI(e){try{localStorage.setItem(e,`1`)}catch{}}function yae(){let{t:e}=Z(),[t,n]=(0,v.useState)(()=>dI(lI)),[r,i]=(0,v.useState)(()=>dI(uI)),{data:a}=$r({queryKey:[`keys`],queryFn:()=>X(`/api/keys`)}),{data:o}=$r({queryKey:[`setup-summary`],queryFn:()=>X(`/api/analytics/summary?range=30d`),staleTime:3e4}),{data:s}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)});if(t||!a||!o)return null;let c=a.length>0,l=(o.totalRequests??0)>0;if(c&&l)return null;let u=[c,l,r].filter(Boolean).length;function d(t,n){_v(t).then(t=>{if(!t){pv.error(e(`common.copyFailed`));return}pv.success(n),i(!0),fI(uI)})}return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-semibold`,children:e(`setup.title`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`setup.subtitle`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e(`setup.progress`,{done:u,total:3})}),(0,G.jsx)(`button`,{type:`button`,"aria-label":e(`common.dismiss`),onClick:()=>{n(!0),fI(lI)},className:`rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground`,children:(0,G.jsx)(Wa,{className:`size-3.5`})})]})]}),(0,G.jsxs)(`ol`,{className:`mt-4 space-y-1`,children:[(0,G.jsx)(pI,{index:1,done:c,title:e(`setup.step1Title`),description:e(`setup.step1Desc`),action:(0,G.jsx)(gn,{to:`/keys`,children:(0,G.jsxs)(J,{variant:`outline`,size:`sm`,children:[e(`setup.step1Cta`),(0,G.jsx)(hi,{"data-icon":`inline-end`,className:`size-3.5`})]})})}),(0,G.jsx)(pI,{index:2,done:l,title:e(`setup.step2Title`),description:e(`setup.step2Desc`),action:(0,G.jsx)(gn,{to:`/playground`,children:(0,G.jsxs)(J,{variant:`outline`,size:`sm`,children:[e(`setup.step2Cta`),(0,G.jsx)(hi,{"data-icon":`inline-end`,className:`size-3.5`})]})})}),(0,G.jsx)(pI,{index:3,done:r,title:e(`setup.step3Title`),description:e(`setup.step3Desc`),action:(0,G.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,G.jsxs)(J,{variant:`outline`,size:`sm`,disabled:!s?.apiKey,onClick:()=>s?.apiKey&&d(s.apiKey,e(`setup.copiedKey`)),children:[(0,G.jsx)(Wi,{"data-icon":`inline-start`,className:`size-3.5`}),e(`setup.copyKey`)]}),(0,G.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>d(yv(),e(`setup.copiedUrl`)),children:[(0,G.jsx)(Wi,{"data-icon":`inline-start`,className:`size-3.5`}),e(`setup.copyUrl`)]})]})})]})]})}function pI({index:e,done:t,title:n,description:r,action:i}){return(0,G.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-xl px-2 py-2.5 sm:flex-nowrap`,children:[(0,G.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-medium tabular-nums ${t?`bg-emerald-600 text-white dark:bg-emerald-500`:`border text-muted-foreground`}`,children:t?(0,G.jsx)(wi,{className:`size-3`}):e}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`text-sm ${t?`text-muted-foreground line-through decoration-muted-foreground/40`:`font-medium`}`,children:n}),!t&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r})]}),!t&&(0,G.jsx)(`div`,{className:`ml-8 shrink-0 sm:ml-0`,children:i})]})}function mI({value:e,color:t}){let n=e??0;return(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`div`,{className:`h-1.5 w-12 rounded-full bg-muted overflow-hidden`,children:(0,G.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${Math.round(n*100)}%`,backgroundColor:t}})}),(0,G.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums w-7 text-right`,children:e===void 0?`–`:Math.round(n*100)})]})}function hI(){let{t:e}=Z();return(0,G.jsx)(SD,{text:e(`models.noDataTitle`),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 cursor-help`,children:[(0,G.jsx)(`div`,{className:`h-1.5 w-12 rounded-full border border-dashed border-muted-foreground/30`}),(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60 whitespace-nowrap`,children:e(`models.noData`)})]})})}function bae(e){let t=e.filter(e=>e!==void 0);return t.length===0?null:{min:Math.min(...t),max:Math.max(...t)}}function gI({values:e,color:t}){let n=bae(e);if(n===null)return(0,G.jsx)(mI,{value:void 0,color:t});let r=Math.round(n.min*100),i=Math.round(n.max*100);return r===i?(0,G.jsx)(mI,{value:n.max,color:t}):(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`div`,{className:`relative h-1.5 w-12 rounded-full bg-muted overflow-hidden`,children:(0,G.jsx)(`div`,{className:`absolute inset-y-0 rounded-full`,style:{left:`${r}%`,width:`${Math.max(4,i-r)}%`,backgroundColor:t}})}),(0,G.jsxs)(`span`,{className:`font-mono text-[11px] text-muted-foreground tabular-nums min-w-7 text-right whitespace-nowrap`,children:[r,`–`,i]})]})}function _I(){let{t:e}=Z();return(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`text-left text-muted-foreground border-b`,children:[(0,G.jsx)(`th`,{className:`py-2 pl-3 pr-1 w-6`}),(0,G.jsx)(`th`,{className:`py-2 pr-2 w-6 text-center font-medium`,children:`#`}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:e(`models.columnModel`)}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm`,style:{background:`#22c55e`}}),e(`strategies.weightReliability`)]})}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm`,style:{background:`#3b82f6`}}),e(`strategies.weightSpeed`)]})}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm`,style:{background:`#a855f7`}}),e(`strategies.weightIntelligence`)]})}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:(0,G.jsx)(SD,{text:e(`strategies.guardrailsTooltip`),children:(0,G.jsx)(`span`,{className:`underline decoration-dotted underline-offset-2 cursor-help`,children:e(`strategies.guardrails`)})})}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium text-right`,children:(0,G.jsx)(SD,{text:e(`strategies.scoreTooltip`),children:(0,G.jsx)(`span`,{className:`underline decoration-dotted underline-offset-2 cursor-help`,children:e(`strategies.scoreColumn`)})})}),(0,G.jsx)(`th`,{className:`py-2 pr-3 font-medium text-right`,children:e(`models.columnOn`)})]})})}function vI({rows:e,size:t=`sm`}){let{t:n}=Z(),r=Ck(e);if(!r)return null;let i=r.limit>0?r.used/r.limit:0,a=r.used>=r.limit?`bg-red-600/15 text-red-700 dark:text-red-400`:i>=.7?`bg-amber-600/15 text-amber-700 dark:text-amber-400`:`bg-muted text-muted-foreground`,o=t===`md`?`text-[11px] px-2 py-0.5`:`text-[10px] px-1.5 py-0.5`;return(0,G.jsx)(`span`,{title:n(`models.rateLimitUsageTitle`),className:`rounded-full tabular-nums ${o} ${a}`,children:n(`models.rateLimitUsage`,{kind:r.kind,used:r.used,limit:r.limit})})}function xae({row:e,rank:t,draggable:n,dragHandle:r,onToggle:i,providerName:a,providerTitle:o,rateUsage:s}){let{t:c}=Z(),l=(e.headroom??1)*(e.rateLimit??1);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`td`,{className:`py-2 pl-3 pr-1 w-6 align-middle`,children:n?r:(0,G.jsx)(`span`,{className:`text-muted-foreground/30 select-none`,children:`·`})}),(0,G.jsx)(`td`,{className:`py-2 pr-2 w-6 text-center font-mono text-xs text-muted-foreground tabular-nums align-middle`,children:t}),(0,G.jsxs)(`td`,{className:`py-2 pr-3 align-middle`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:e.displayName}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,title:o,children:a??sk(e)}),(0,G.jsx)(vI,{rows:s?[s]:[]}),e.supportsVision&&(0,G.jsx)(`span`,{title:c(`models.visionTitle`),className:`text-[10px] rounded-full px-1.5 py-0.5 bg-cyan-600/15 text-cyan-700 dark:bg-cyan-400/15 dark:text-cyan-400`,children:c(`models.vision`)}),e.supportsTools&&(0,G.jsx)(`span`,{title:c(`models.toolsTitle`),className:`text-[10px] rounded-full px-1.5 py-0.5 bg-violet-600/15 text-violet-700 dark:bg-violet-400/15 dark:text-violet-400`,children:c(`models.tools`)}),e.retiredUpstream&&(0,G.jsx)(`span`,{title:e.retiredReason??void 0,className:`text-[10px] rounded-full px-1.5 py-0.5 bg-rose-600/15 text-rose-700 dark:bg-rose-400/15 dark:text-rose-400`,children:c(`models.retired`)}),(e.penalty??0)>0&&(0,G.jsx)(`span`,{className:`text-[10px] text-amber-600 dark:text-amber-400`,children:c(`models.penalty`,{value:e.penalty})}),e.totalRequests!==void 0&&e.totalRequests>0&&(0,G.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60 tabular-nums`,children:c(`models.obs`,{count:e.totalRequests})})]}),(0,G.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70 tabular-nums mt-0.5`,children:[(e.monthlyTokenBudgetTokens??0)>0?c(`models.tokPerMonth`,{count:e.monthlyTokenBudget})+(e.keyCount>1?` × ${e.keyCount}`:``):null,e.rpmLimit?c(`models.rpmLimit`,{count:e.rpmLimit}):null,e.rpdLimit?c(`models.rpdLimit`,{count:e.rpdLimit}):null].filter(Boolean).join(` · `)||xk(e.monthlyTokenBudget)||`—`})]}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:e.totalRequests===0?(0,G.jsx)(hI,{}):(0,G.jsx)(mI,{value:e.reliability,color:`#22c55e`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:e.totalRequests===0?(0,G.jsx)(hI,{}):(0,G.jsx)(mI,{value:e.speed,color:`#3b82f6`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:(0,G.jsx)(mI,{value:e.intelligence,color:`#a855f7`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle font-mono text-[11px] text-muted-foreground tabular-nums`,children:l<.999?`×${l.toFixed(2)}`:`—`}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle text-right font-mono text-xs font-medium tabular-nums`,children:e.score===void 0?`–`:e.score.toFixed(3)}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle text-right`,children:(0,G.jsx)(xD,{checked:e.enabled,onCheckedChange:t=>i(e.modelDbId,t)})})]})}var yI=(0,G.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`currentColor`,children:[(0,G.jsx)(`circle`,{cx:`9`,cy:`6`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`15`,cy:`6`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`9`,cy:`12`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`15`,cy:`12`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`9`,cy:`18`,r:`1.5`}),(0,G.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1.5`})]});function Sae({rank:e,onMoveRank:t}){let{t:n}=Z(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=(0,v.useRef)(!1);function c(){if(s.current)return;s.current=!0,i(!1);let n=Number.parseInt(a,10);Number.isFinite(n)&&n>0&&n!==e&&t(n)}function l(){s.current=!0,i(!1)}return r?(0,G.jsx)(`input`,{type:`number`,min:1,autoFocus:!0,value:a,onChange:e=>o(e.target.value),onClick:e=>e.stopPropagation(),onBlur:c,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&c(),e.key===`Escape`&&l()},"aria-label":n(`models.moveToRank`),className:`w-9 rounded border bg-background px-1 py-0.5 text-center font-mono text-xs tabular-nums`}):(0,G.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),s.current=!1,o(String(e)),i(!0)},title:n(`models.moveToRank`),"aria-label":n(`models.moveToRank`),className:`w-full text-center font-mono text-xs text-muted-foreground tabular-nums underline decoration-dotted decoration-transparent underline-offset-2 hover:decoration-current hover:text-foreground transition-colors`,children:e})}function bI({group:e,rank:t,dragHandle:n,editableRank:r,onMoveRank:i,onToggleGroup:a,allRows:o,rateUsage:s}){let{t:c}=Z(),l=e.members.some(e=>e.enabled),u=e.members.length===1,d=e.members.reduce((e,t)=>(t.score??-1)>(e.score??-1)?t:e,e.members[0]),f=(d.headroom??1)*(d.rateLimit??1),p=s?e.members.flatMap(e=>s.get(e.modelDbId)??[]):[],m=o??e.members,h=e.members.filter(e=>(e.totalRequests??0)>0),g=e.members.map(e=>`${lk(e,m)} ${e.score===void 0?`–`:e.score.toFixed(3)}`).join(`
67
+ `),_=e.members.some(e=>e.supportsVision),v=e.members.some(e=>e.supportsTools),y=Sk(e.members,c),b=bk(e.members),x=encodeURIComponent(e.members[0].canonicalId??e.members[0].modelId),S=e.members[0].canonicalId??e.members[0].modelId;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`td`,{className:`py-2 pl-3 pr-1 w-6 align-middle`,children:n??(0,G.jsx)(`span`,{className:`text-muted-foreground/30 select-none`,children:`·`})}),(0,G.jsx)(`td`,{className:`py-2 pr-2 w-6 text-center font-mono text-xs text-muted-foreground tabular-nums align-middle`,children:r&&i?(0,G.jsx)(Sae,{rank:t,onMoveRank:i}):t}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,G.jsxs)(gn,{to:`/models/chat/${x}`,"aria-label":c(`models.viewProviders`),onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 flex-wrap text-left min-w-0`,children:[(0,G.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),u?(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,title:dk(e.members[0],m),children:lk(e.members[0],m)}):(0,G.jsx)(SD,{text:c(`models.servedBy`,{providers:e.members.map(e=>lk(e,m)).join(`
68
+ `)}),children:(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground`,children:c(`models.providerCount`,{count:e.members.length})})}),y&&(0,G.jsx)(`span`,{title:y.title,className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:y.text}),(0,G.jsx)(vI,{rows:p}),b>0&&(0,G.jsx)(`span`,{title:c(`models.ctxTitle`),className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:c(`models.ctxBadge`,{size:yk(b)})}),_&&(0,G.jsx)(`span`,{title:c(`models.visionTitle`),className:`text-[10px] rounded-full px-1.5 py-0.5 bg-cyan-600/15 text-cyan-700 dark:bg-cyan-400/15 dark:text-cyan-400`,children:c(`models.vision`)}),v&&(0,G.jsx)(`span`,{title:c(`models.toolsTitle`),className:`text-[10px] rounded-full px-1.5 py-0.5 bg-violet-600/15 text-violet-700 dark:bg-violet-400/15 dark:text-violet-400`,children:c(`models.tools`)})]}),(0,G.jsx)(`span`,{onClick:e=>e.stopPropagation(),className:`shrink-0`,children:(0,G.jsx)(vv,{text:S,label:c(`models.copyModelId`),className:`size-6 border-0 bg-transparent hover:bg-muted opacity-0 transition-opacity group-hover/row:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100`})})]})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:h.length===0?(0,G.jsx)(hI,{}):(0,G.jsx)(gI,{values:h.map(e=>e.reliability),color:`#22c55e`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:h.length===0?(0,G.jsx)(hI,{}):(0,G.jsx)(gI,{values:h.map(e=>e.speed),color:`#3b82f6`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle`,children:(0,G.jsx)(gI,{values:e.members.map(e=>e.intelligence),color:`#a855f7`})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle font-mono text-[11px] text-muted-foreground tabular-nums`,children:f<.999?`×${f.toFixed(2)}`:`—`}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle text-right font-mono text-xs font-medium tabular-nums`,children:u?d.score===void 0?`–`:d.score.toFixed(3):(0,G.jsx)(SD,{text:c(`models.perProviderScores`,{list:g}),children:(0,G.jsxs)(`span`,{className:`inline-flex flex-col items-end cursor-help`,children:[(0,G.jsx)(`span`,{children:d.score===void 0?`–`:d.score.toFixed(3)}),(0,G.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground/60 whitespace-nowrap`,children:c(`models.bestOfN`,{count:e.members.length})})]})})}),(0,G.jsx)(`td`,{className:`py-2 pr-3 align-middle text-right`,onClick:e=>e.stopPropagation(),children:(0,G.jsx)(xD,{checked:l,onCheckedChange:t=>a(e.members.map(e=>e.modelDbId),t)})})]})}function Cae({group:e,rank:t,editableRank:n,onMoveRank:r,onToggleGroup:i,allRows:a,rateUsage:o}){let{t:s}=Z(),{attributes:c,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:p}=aI({id:`grp:${e.key}`}),m=e.members.some(e=>e.enabled),h=m&&o!==void 0&&Tk(e.members,o),g=rt(),_=encodeURIComponent(e.members[0].canonicalId??e.members[0].modelId),v=(0,G.jsx)(`button`,{...c,...l,onClick:e=>e.stopPropagation(),className:`cursor-grab active:cursor-grabbing text-muted-foreground/50 hover:text-foreground transition-colors`,"aria-label":s(`models.dragToReorderGroup`),children:yI});return(0,G.jsx)(`tr`,{ref:u,style:{transform:cP.Transform.toString(d),transition:f},onClick:()=>g(`/models/chat/${_}`),className:`group/row border-b last:border-0 bg-card cursor-pointer transition-colors hover:[&>td]:bg-muted/50 [&>td:first-child]:rounded-l-lg [&>td:last-child]:rounded-r-lg ${p?`opacity-50`:``} ${m?h?`opacity-60`:``:`opacity-50`}`,children:(0,G.jsx)(bI,{group:e,rank:t,dragHandle:v,editableRank:n,onMoveRank:r,onToggleGroup:i,allRows:a,rateUsage:o})})}function wae(e){let t=e=>typeof e.intelligenceRank==`number`&&Number.isFinite(e.intelligenceRank)?e.intelligenceRank:1/0;return e.map((e,t)=>({m:e,i:t})).sort((e,n)=>t(e.m)-t(n.m)||e.i-n.i).map(({m:e})=>e)}function Tae(e,t){let n=wae(e),r=[],i=0;for(let e of n){let n=e.used??0,a=Math.max(0,e.budget-n);if(e.budget<=0){i+=1;continue}r.push({...e,usedTokens:n,remainingTokens:a,widthPct:t>0?a/t*100:0})}return{rows:r,unpublishedCount:i}}var Eae=126;function Dae({data:e}){let{t}=Z(),{totalBudget:n,totalUsed:r,models:i}=e,a=Math.max(0,n-r),o=n>0?vk(a/n):`0%`,s=n>0?Math.min(100,r/n*100):0,{rows:c,unpublishedCount:l}=Tae(i,n),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(),g=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=g.current;if(!e)return;let t=()=>{h(e.scrollHeight),p(e.scrollHeight>127)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[c.length,l]),(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between mb-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:t(`models.monthlyTokenBudget`)}),(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[(0,G.jsx)(`span`,{className:`text-foreground font-medium`,children:_k(a)}),` `,t(`models.remaining`),(0,G.jsx)(`span`,{className:`mx-1.5`,children:`·`}),o,` `,t(`models.of`),` `,_k(n),r>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`mx-1.5`,children:`·`}),(0,G.jsxs)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,title:t(`models.usedScopeHint`),children:[(0,G.jsx)(`span`,{className:`text-foreground font-medium`,children:_k(r)}),` `,t(`models.used`)]})]})]})]}),(0,G.jsxs)(`div`,{className:`flex h-2.5 rounded-full overflow-hidden bg-muted`,children:[c.map(e=>(0,G.jsx)(`div`,{title:`${e.displayName} (${e.platform}): ${_k(e.remainingTokens)} ${t(`models.remaining`)}, ${_k(e.usedTokens)} ${t(`models.used`)}`,style:{width:`${e.widthPct}%`,backgroundColor:Ek[e.platform]??`#94a3b8`}},`${e.platform}:${e.modelId??e.displayName}`)),r>0&&(0,G.jsx)(`div`,{title:`Used: ${_k(r)}`,className:`bg-muted-foreground/30`,style:{width:`${s}%`}})]}),(0,G.jsx)(`div`,{ref:g,className:`mt-4 overflow-hidden transition-[max-height] duration-300 ease-in-out`,style:f?{maxHeight:u?m:Eae}:void 0,children:(0,G.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-5 gap-y-1.5 text-xs tabular-nums`,children:c.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm flex-shrink-0`,style:{backgroundColor:Ek[e.platform]??`#94a3b8`}}),(0,G.jsx)(`span`,{className:`truncate`,children:e.displayName}),(0,G.jsx)(`span`,{className:`flex-1`}),(0,G.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:t(`models.legendRemainingTitle`,{name:e.displayName,platform:e.platform}),children:[_k(e.remainingTokens),(0,G.jsx)(`span`,{className:`mx-0.5`,children:`/`}),_k(e.budget)]})]},`${e.platform}:${e.modelId??e.displayName}`))})}),l>0&&(0,G.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,title:t(`models.noPublishedQuotaTitle`),children:t(`models.noPublishedQuota`,{count:l})}),f&&(0,G.jsxs)(`button`,{onClick:()=>d(e=>!e),className:`mt-2 flex w-full items-center justify-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[u?t(`models.showLess`):t(`models.showAllModels`,{count:c.length}),(0,G.jsx)(Ti,{className:`size-3.5 transition-transform duration-300 ${u?`rotate-180`:``}`})]})]})}function xI({show:e,children:t}){let[n,r]=(0,v.useState)(e);return(0,v.useEffect)(()=>{if(e){r(!0);return}let t=setTimeout(()=>r(!1),300);return()=>clearTimeout(t)},[e]),n?(0,G.jsx)(`div`,{className:`fixed inset-x-0 bottom-4 z-50 flex justify-center px-4 pointer-events-none duration-300 sm:bottom-6 sm:px-6 ${e?`animate-in slide-in-from-bottom-4 fade-in`:`animate-out slide-out-to-bottom-4 fade-out fill-mode-forwards`}`,children:(0,G.jsx)(`div`,{className:`pointer-events-auto flex items-center gap-2 rounded-2xl border bg-card px-3 py-1.5 shadow-lg ring-1 ring-foreground/5 sm:gap-3 sm:rounded-full sm:px-4 sm:py-2`,children:t})}):null}function SI(){let{t:e}=Z(),t=e=>`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg transition-colors ${e?`bg-primary text-primary-foreground font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`;return(0,G.jsxs)(`div`,{className:`inline-flex gap-0.5 sm:gap-1 rounded-xl border p-1 overflow-x-auto`,children:[(0,G.jsx)(_n,{to:`/models/chat`,className:({isActive:e})=>t(e),children:e(`models.chatModelsTab`)}),(0,G.jsx)(_n,{to:`/models/embeddings`,className:({isActive:e})=>t(e),children:e(`models.embeddingsTab`)}),(0,G.jsx)(_n,{to:`/models/image`,className:({isActive:e})=>t(e),children:e(`models.imageTab`)}),(0,G.jsx)(_n,{to:`/models/video`,className:({isActive:e})=>t(e),children:e(`models.videoTab`)}),(0,G.jsx)(_n,{to:`/models/audio`,className:({isActive:e})=>t(e),children:e(`models.audioTab`)}),(0,G.jsx)(_n,{to:`/models/fusion`,className:({isActive:e})=>t(e),children:e(`models.fusionTab`)})]})}var CI=`srouter.penaltyInspector.collapsed`;function Oae(){try{let e=localStorage.getItem(CI);return e===null||e===`1`}catch{return!0}}function kae(e){let t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t}s`;let n=Math.ceil(t/60);return n<60?`${n}m`:`${Math.ceil(n/60)}h`}function Aae(e){let t=new Date(`${e.replace(` `,`T`)}Z`);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function jae(e){return e>=8?`bg-red-600/15 text-red-700 dark:text-red-400`:e>=5?`bg-orange-600/15 text-orange-700 dark:text-orange-400`:e>=3?`bg-amber-600/15 text-amber-700 dark:text-amber-400`:e>0?`bg-emerald-600/15 text-emerald-700 dark:text-emerald-400`:`bg-muted text-muted-foreground`}function Mae(){let{t:e}=Z(),[t,n]=(0,v.useState)(Oae),{data:r}=$r({queryKey:[`fallback`,`penalty-inspector`],queryFn:()=>X(`/api/fallback/penalty-inspector`),refetchInterval:5e3}),i=Rr(),a=ei({mutationFn:e=>X(`/api/keys/${e}/cooldowns`,{method:`DELETE`}),onSuccess:()=>{i.invalidateQueries({queryKey:[`fallback`,`penalty-inspector`]}),i.invalidateQueries({queryKey:[`keys`]})}}),o=ei({mutationFn:()=>X(`/api/fallback/penalty-inspector`,{method:`DELETE`}),onSuccess:()=>{i.invalidateQueries({queryKey:[`fallback`]}),i.invalidateQueries({queryKey:[`keys`]})}}),s=r?.rows??[];if(s.length===0)return null;function c(){n(e=>{let t=!e;try{localStorage.setItem(CI,t?`1`:`0`)}catch{}return t})}return(0,G.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:c,"aria-expanded":!t,"aria-label":e(t?`common.show`:`common.hide`),className:`flex w-full flex-wrap items-center justify-between gap-2 px-4 py-3 text-left ${t?``:`border-b`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Va,{className:`size-4 text-amber-600 dark:text-amber-400`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`penaltyInspector.title`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`penaltyInspector.subtitle`,{minutes:r?.lookbackMinutes??30})})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground tabular-nums`,children:e(`penaltyInspector.rowCount`,{count:s.length})}),(0,G.jsx)(Ti,{className:`size-4 text-muted-foreground transition-transform ${t?`-rotate-90`:``}`})]})]}),!t&&(0,G.jsxs)(`div`,{className:`divide-y`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-4 py-2`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`penaltyInspector.clearAllHint`)}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>o.mutate(),disabled:o.isPending,className:`inline-flex items-center gap-1.5 rounded-lg border border-destructive/30 bg-destructive/10 px-2.5 py-1 text-xs text-destructive transition-colors hover:bg-destructive/20 disabled:opacity-50`,children:[(0,G.jsx)(qi,{className:`size-3.5`}),e(`penaltyInspector.clearAll`)]})]}),s.map(t=>(0,G.jsxs)(`div`,{className:`grid gap-3 px-4 py-3 lg:grid-cols-[minmax(14rem,1.2fr)_minmax(10rem,0.8fr)_minmax(14rem,1.3fr)]`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`truncate text-sm font-medium`,children:t.displayName}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.platform}),!t.fallbackEnabled&&(0,G.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e(`penaltyInspector.offChain`)})]}),(0,G.jsx)(`code`,{className:`mt-0.5 block truncate font-mono text-[11px] text-muted-foreground`,children:t.modelId}),(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:t.reasons.map(t=>(0,G.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e(`penaltyInspector.reasons.${t}`)},t))})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,G.jsx)($i,{className:`size-3.5 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`rounded-full px-2 py-0.5 tabular-nums ${jae(t.penalty.value)}`,children:e(`penaltyInspector.penaltyValue`,{value:t.penalty.value})}),t.penalty.value>0&&(0,G.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e(`penaltyInspector.factor`,{factor:t.penalty.rateLimitFactor.toFixed(2)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,G.jsx)(zi,{className:`size-3.5 text-muted-foreground`}),t.cooldowns.length===0?(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e(`penaltyInspector.noCooldown`)}):t.cooldowns.map(t=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sky-600/15 px-2 py-0.5 text-sky-700 dark:text-sky-400`,children:[e(`penaltyInspector.cooldownChip`,{key:t.keyLabel||`#${t.keyId}`,time:kae(t.expiresInMs)}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>a.mutate(t.keyId),disabled:a.isPending,"aria-label":e(`penaltyInspector.resetCooldown`),title:e(`penaltyInspector.resetCooldown`),className:`rounded-full p-0.5 transition-colors hover:bg-sky-700/20 disabled:opacity-50`,children:(0,G.jsx)(Ta,{className:`size-3`})})]},`${t.keyId}:${t.expiresAtMs}`))]})]}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`mb-1 text-xs text-muted-foreground`,children:e(`penaltyInspector.errorsHeading`,{count:t.recentErrorCount})}),t.recentErrors.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`penaltyInspector.noRecentErrors`)}):(0,G.jsx)(`div`,{className:`space-y-1`,children:t.recentErrors.map(t=>(0,G.jsxs)(`div`,{className:`min-w-0 text-xs`,children:[(0,G.jsx)(`span`,{className:`mr-2 text-muted-foreground tabular-nums`,children:Aae(t.createdAt)}),(0,G.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:t.keyLabel||(t.keyId?`#${t.keyId}`:e(`penaltyInspector.noKey`))}),(0,G.jsx)(`span`,{title:t.error,className:`break-words`,children:t.error})]},t.id))})]})]},`${t.platform}:${t.modelId}:${t.modelDbId??`missing`}`))]})]})}var Nae={priority:`manual`,balanced:`balanced`,smartest:`smartest`,fastest:`fastest`,reliable:`reliable`,custom:`custom`};function Pae(e){return(iO.find(t=>t.value===e)?.label??e).split(` (`)[0]}function wI({processing:e}){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-5 flex-1 rounded-full ${e?`sr-flow-line text-primary`:`bg-border`}`})}function TI({sub:e,icon:t,label:n,tone:r=`text-foreground`}){return(0,G.jsxs)(`div`,{className:`min-w-0 shrink-0 rounded-xl border bg-background px-3 py-2`,children:[e&&(0,G.jsx)(`div`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,G.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5 text-sm font-medium ${r}`,children:[t,(0,G.jsx)(`span`,{className:`max-w-[10rem] truncate`,children:n})]})]})}function Fae({strategy:e}){let{t}=Z(),{data:n}=$r({queryKey:[`analytics`,`live`],queryFn:()=>X(`/api/analytics/live`),refetchInterval:3e3}),r=n?.active??[],i=n?.last??null,a=r.length>0,o=r[r.length-1]??i,s=a?(0,G.jsx)(TI,{label:t(`routingStrip.processing`),tone:`text-primary`,icon:(0,G.jsx)(la,{className:`size-4 shrink-0 animate-spin`})}):i&&i.outcome===`ok`&&i.attempt>1?(0,G.jsx)(TI,{label:t(`routingStrip.afterAttempts`,{n:i.attempt}),tone:`text-emerald-600 dark:text-emerald-400`,icon:(0,G.jsx)(Ea,{className:`size-4 shrink-0`})}):i&&i.outcome===`ok`?(0,G.jsx)(TI,{label:t(`common.success`),tone:`text-emerald-600 dark:text-emerald-400`,icon:(0,G.jsx)(Ni,{className:`size-4 shrink-0`})}):i&&i.outcome===`canceled`?(0,G.jsx)(TI,{label:t(`routingStrip.canceled`),tone:`text-muted-foreground`,icon:(0,G.jsx)(Fi,{className:`size-4 shrink-0`})}):i?(0,G.jsx)(TI,{label:t(`routingStrip.failed`),tone:`text-destructive`,icon:(0,G.jsx)(Ii,{className:`size-4 shrink-0`})}):(0,G.jsx)(TI,{label:t(`routingStrip.idle`),tone:`text-muted-foreground`,icon:(0,G.jsx)(Li,{className:`size-4 shrink-0`})});return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-4 sm:p-5`,"aria-label":t(`routingStrip.title`),children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:t(`routingStrip.title`)}),a&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-medium text-primary`,children:[(0,G.jsx)(la,{className:`size-3 animate-spin`}),t(`routingStrip.activeCount`,{n:r.length})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 overflow-x-auto`,children:[(0,G.jsx)(TI,{label:`SRouter`,icon:(0,G.jsx)(nv,{className:`size-4 shrink-0`})}),(0,G.jsx)(wI,{processing:a}),(0,G.jsx)(TI,{sub:t(`routingStrip.mode`),label:t(`strategies.${Nae[e]}`),icon:(0,G.jsx)(ea,{className:`size-4 shrink-0 text-muted-foreground`})}),(0,G.jsx)(wI,{processing:a}),(0,G.jsx)(TI,{sub:t(`common.provider`),label:o?Pae(o.platform):`—`,icon:(0,G.jsx)(ja,{className:`size-4 shrink-0 text-muted-foreground`})}),(0,G.jsx)(wI,{processing:a}),s]})]})}var EI=Array.from({length:24},(e,t)=>t);function DI(e){return`${String(e).padStart(2,`0`)}:00`}function Iae(e){if(!e.trim())return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}}function Lae({routing:e,strategy:t,saving:n,onSave:r}){let{t:i}=Z(),[a,o]=(0,v.useState)(e.peakTimezone),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{o(e.peakTimezone),c(!1)},[e.peakTimezone]);let l=e.peakHoursAdjust,u=ok.includes(t);function d(t){let n=t.trim();if(n===e.peakTimezone){c(!1);return}if(!Iae(n)){c(!0);return}c(!1),r({peakTimezone:n})}return(0,G.jsxs)(`div`,{className:`mt-2`,children:[(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:l,disabled:n,onChange:e=>r({peakHoursAdjust:e.target.checked}),className:`size-3.5 accent-foreground`}),(0,G.jsx)(`span`,{children:i(`strategies.peakAdjust`)}),(0,G.jsx)(SD,{text:i(`strategies.peakAdjustHint`),children:(0,G.jsx)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,children:`?`})})]}),l&&(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1.5 pl-5.5 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:i(`strategies.peakFrom`)}),(0,G.jsx)(`select`,{value:e.peakStartHour,disabled:n,"aria-label":i(`strategies.peakFrom`),onChange:e=>r({peakStartHour:Number(e.target.value)}),className:`rounded-lg border bg-card px-1.5 py-0.5 tabular-nums outline-none focus:border-foreground/30`,children:EI.map(e=>(0,G.jsx)(`option`,{value:e,children:DI(e)},e))}),(0,G.jsx)(`span`,{children:i(`strategies.peakTo`)}),(0,G.jsx)(`select`,{value:e.peakEndHour,disabled:n,"aria-label":i(`strategies.peakTo`),onChange:e=>r({peakEndHour:Number(e.target.value)}),className:`rounded-lg border bg-card px-1.5 py-0.5 tabular-nums outline-none focus:border-foreground/30`,children:EI.map(e=>(0,G.jsx)(`option`,{value:e,children:DI(e)},e))}),(0,G.jsx)(`span`,{children:i(`strategies.peakTimezoneLabel`)}),(0,G.jsx)(`input`,{value:a,disabled:n,"aria-label":i(`strategies.peakTimezoneLabel`),onChange:e=>o(e.target.value),onBlur:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d(e.target.value)},className:`w-40 rounded-lg border bg-card px-1.5 py-0.5 outline-none focus:border-foreground/30 ${s?`border-destructive`:``}`}),(0,G.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(o(e),d(e))},className:`underline decoration-dotted underline-offset-2 hover:text-foreground`,children:i(`strategies.peakUseBrowserTimezone`)}),s&&(0,G.jsx)(`span`,{className:`text-destructive`,children:i(`strategies.peakTimezoneInvalid`)}),u&&(0,G.jsx)(`span`,{className:`basis-full text-muted-foreground/80`,children:i(`strategies.peakExemptNote`)})]})]})}var OI=`srouter.chainManager.collapsed`;function Rae(){try{let e=localStorage.getItem(OI);return e===null||e===`1`}catch{return!0}}function zae(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!0),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(Rae),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),{data:g=[]}=$r({queryKey:[`profiles`],queryFn:()=>X(`/api/profiles`)}),{data:_}=$r({queryKey:[`profiles`,`active`],queryFn:()=>X(`/api/profiles/active`)}),y=async()=>{await t.refetchQueries({queryKey:[`profiles`,`active`],exact:!0}),t.invalidateQueries({queryKey:[`profiles`]}),t.invalidateQueries({queryKey:[`fallback`]})},b=ei({mutationFn:e=>X(`/api/profiles`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:()=>{y(),r(``),s(``)},onError:t=>s(t.message||e(`chains.createFailed`))}),x=ei({mutationFn:e=>X(`/api/profiles/active`,{method:`POST`,body:JSON.stringify({profileId:e})}),onSuccess:y}),S=ei({mutationFn:e=>X(`/api/profiles/${e}`,{method:`DELETE`}),onSuccess:y}),C=ei({mutationFn:({profileId:e,name:t})=>X(`/api/profiles/${e}`,{method:`PUT`,body:JSON.stringify({name:t})}),onSuccess:()=>{y(),d(null),h(``)},onError:t=>h(t.message||e(`chains.renameFailed`))});if(g.length===0)return null;let w=_?.activeProfileId??null;function T(){l(e=>{let t=!e;try{localStorage.setItem(OI,t?`1`:`0`)}catch{}return t})}return(0,G.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:T,"aria-expanded":!c,"aria-label":e(c?`common.show`:`common.hide`),className:`flex w-full flex-wrap items-center justify-between gap-2 px-4 py-3 text-left ${c?``:`border-b`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(aa,{className:`size-4 text-muted-foreground`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`chains.title`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`chains.description`)})]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground tabular-nums`,children:e(`chains.count`,{count:g.length})}),(0,G.jsx)(Ti,{className:`size-4 text-muted-foreground transition-transform ${c?`-rotate-90`:``}`})]})]}),!c&&(0,G.jsxs)(`div`,{className:`p-4`,children:[(0,G.jsx)(`div`,{className:`space-y-2`,children:g.map(t=>{let n=t.id===w,r=t.type==="default"||t.type===`builtin`;return u===t.id?(0,G.jsxs)(`form`,{className:`flex items-center gap-2 rounded-xl border border-foreground/25 bg-muted/50 px-3 py-2`,onSubmit:n=>{n.preventDefault();let r=f.trim();!r||C.isPending||r!==t.name&&!window.confirm(e(`chains.renameConfirm`,{oldName:t.name,name:r}))||C.mutate({profileId:t.id,name:r})},children:[(0,G.jsx)(L_,{autoFocus:!0,value:f,onChange:e=>{p(e.target.value),h(``)},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),d(null),h(``))},"aria-label":e(`chains.renamePlaceholder`),placeholder:e(`chains.renamePlaceholder`),className:`h-7 max-w-48 text-sm`}),(0,G.jsx)(J,{type:`submit`,size:`sm`,variant:`secondary`,className:`h-7 px-2 text-xs`,disabled:!f.trim()||C.isPending,children:e(`common.save`)}),(0,G.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs`,onClick:()=>{d(null),h(``)},children:e(`common.cancel`)}),m&&(0,G.jsx)(`span`,{className:`text-xs text-rose-600 dark:text-rose-400`,children:m})]},t.id):(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-xl border px-3 py-2 ${n?`border-foreground/25 bg-muted/50`:`border-transparent hover:bg-muted/40`}`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,title:t.name,children:[t.emoji||(0,G.jsx)(aa,{className:`size-3.5 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`truncate`,children:t.name})]}),(0,G.jsxs)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:[`auto:`,t.name.toLowerCase()]}),n&&(0,G.jsxs)(nO,{variant:`secondary`,className:`gap-1`,children:[(0,G.jsx)(wi,{className:`size-3`}),e(`chains.active`)]}),r&&!n&&(0,G.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e(`chains.default`)}),t.auto_include_new_models===0&&(0,G.jsx)(SD,{text:e(`chains.curatedHint`),children:(0,G.jsx)(`span`,{className:`cursor-help text-[11px] text-muted-foreground underline decoration-dotted underline-offset-2`,children:e(`chains.curated`)})}),(0,G.jsx)(`span`,{className:`flex-1`}),!n&&(0,G.jsx)(SD,{text:e(`chains.activateHint`),children:(0,G.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:x.isPending,onClick:()=>x.mutate(t.id),children:e(`chains.activate`)})}),!r&&(0,G.jsx)(SD,{text:e(`chains.renameHint`),children:(0,G.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground`,"aria-label":e(`chains.renameHint`),disabled:C.isPending,onClick:()=>{d(t.id),p(t.name),h(``)},children:(0,G.jsx)(Sa,{className:`size-3.5`})})}),!r&&(0,G.jsx)(SD,{text:e(`chains.deleteHint`),children:(0,G.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-rose-600`,"aria-label":e(`chains.deleteHint`),disabled:S.isPending,onClick:()=>{window.confirm(e(`chains.deleteConfirm`,{name:t.name}))&&S.mutate(t.id)},children:(0,G.jsx)(Ba,{className:`size-3.5`})})})]},t.id)})}),(0,G.jsxs)(`form`,{className:`mt-3 flex gap-2`,onSubmit:e=>{e.preventDefault();let t=n.trim();t&&!b.isPending&&b.mutate({name:t,empty:i})},children:[(0,G.jsx)(L_,{value:n,onChange:e=>{r(e.target.value),s(``)},placeholder:e(`chains.createPlaceholder`),"aria-label":e(`chains.createPlaceholder`),className:`h-8`}),(0,G.jsxs)(J,{type:`submit`,size:`sm`,className:`h-8`,disabled:!n.trim()||b.isPending,children:[(0,G.jsx)(wa,{className:`size-3.5`}),e(`chains.create`)]})]}),(0,G.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked),className:`size-3.5 accent-foreground`}),(0,G.jsx)(`span`,{children:e(`chains.startEmpty`)}),(0,G.jsx)(SD,{text:e(`chains.startEmptyHint`),children:(0,G.jsx)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,children:`?`})})]}),o?(0,G.jsx)(`p`,{className:`mt-1.5 text-xs text-rose-600 dark:text-rose-400`,children:o}):(0,G.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:e(`chains.nameRules`)})]})]})}var Bae=[{key:`priority`,tKey:`manual`},{key:`balanced`,tKey:`balanced`},{key:`smartest`,tKey:`smartest`},{key:`fastest`,tKey:`fastest`},{key:`reliable`,tKey:`reliable`},{key:`custom`,tKey:`custom`}],Vae=[{key:0,tKey:`ctxAny`},{key:32e3,label:`32K+`},{key:128e3,label:`128K+`},{key:1e6,label:`1M+`}],kI=50,AI=`srouter.routingMoreOptions.collapsed`;function Hae(){try{let e=localStorage.getItem(AI);return e===null||e===`1`}catch{return!0}}function Uae(){let{t:e}=Z(),t=rt(),n=Rr(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(Hae),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(0),{data:h,isPending:g}=$r({queryKey:[`profiles`,`active`],queryFn:()=>X(`/api/profiles/active`)}),_=h?.activeProfileId??null,{data:y=[],isLoading:b}=$r({queryKey:[`fallback`,`chain`,_],queryFn:()=>X(_==null?`/api/fallback`:`/api/fallback?profile=${_}`),enabled:!g}),x=g||b;(0,v.useEffect)(()=>{i(e=>e&&e.profileId!==_?null:e)},[_]);let S=r&&r.profileId===_?r.entries:null,C=e=>i(e===null?null:{profileId:_,entries:e}),{data:w}=$r({queryKey:[`fallback`,`token-usage`],queryFn:()=>X(`/api/fallback/token-usage`)}),{data:T}=$r({queryKey:[`fallback`,`routing`],queryFn:()=>X(`/api/fallback/routing`),refetchInterval:15e3}),{data:E}=$r({queryKey:[`fallback`,`rate-limit-usage`],queryFn:()=>X(`/api/fallback/rate-limit-usage`),refetchInterval:15e3}),D=(0,v.useMemo)(()=>new Map((E?.rows??[]).map(e=>[e.modelDbId,e])),[E]),O=ei({mutationFn:e=>X(`/api/fallback`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{n.invalidateQueries({queryKey:[`fallback`]}),C(null)}}),k=ei({mutationFn:e=>X(`/api/fallback/routing`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>n.invalidateQueries({queryKey:[`fallback`,`routing`]})}),A=T?.strategy??`balanced`,j=T?.keySelectionStrategy??`auto`,M=A===`priority`,N=(0,v.useMemo)(()=>new Map((T?.scores??[]).map(e=>[e.modelDbId,e])),[T?.scores]),P=(0,v.useMemo)(()=>S??y,[S,y]),F=(0,v.useMemo)(()=>P.filter(e=>e.keyCount>0),[P]),I=(0,v.useMemo)(()=>[...new Set(P.filter(e=>e.keyCount===0).map(e=>e.platform))],[P]),L=(0,v.useMemo)(()=>F.map(e=>({...N.get(e.modelDbId)??{},...e})),[F,N]),R=wP(CP(EF),CP(xF,{coordinateGetter:sI}));function z(){O.mutate(P.map(e=>({modelDbId:e.modelDbId,priority:e.priority,enabled:e.enabled})))}function B(){o(e=>{let t=!e;try{localStorage.setItem(AI,t?`1`:`0`)}catch{}return t})}let V=S!==null,H=(0,v.useMemo)(()=>Dk(L,M,D),[L,M,D]),U=(0,v.useMemo)(()=>new Map(H.map((e,t)=>[e.key,t+1])),[H]),ee=s.trim().toLowerCase(),W=ee!==``||l||d||p>0,te=(0,v.useMemo)(()=>H.filter(e=>!(l&&!e.members.some(e=>e.supportsVision)||d&&!e.members.some(e=>e.supportsTools)||p>0&&bk(e.members)<p||ee&&!kk(e,ee))),[H,l,d,p,ee]),ne=M&&!W,[re,ie]=(0,v.useState)(kI),ae=te.slice(0,re),oe=te.length>re,se=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!oe)return;let e=se.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&ie(e=>e+kI)},{rootMargin:`600px`});return t.observe(e),()=>t.disconnect()},[oe,re]);function ce(){c(``),u(!1),f(!1),m(0)}function le(e,t){let n=new Set(e);C(P.map(e=>n.has(e.modelDbId)?{...e,enabled:t}:e))}let ue=te.flatMap(e=>e.members.map(e=>e.modelDbId)),de=te.filter(e=>e.members.some(e=>e.enabled)).length;function fe(e){let t=new Set(ue);C(P.map(n=>t.has(n.modelDbId)?{...n,enabled:e}:n))}function pe(e){let t=[];for(let n of e)for(let e of n.members)t.push(e.modelDbId);let n=P.filter(e=>e.keyCount===0).map(e=>e.modelDbId),r=new Map([...t,...n].map((e,t)=>[e,t+1]));C(P.map(e=>({...e,priority:r.get(e.modelDbId)??e.priority})))}function me(e,t){let n=H.findIndex(t=>t.key===e);if(n<0)return;let r=Ok(t,H.length);r!==n&&pe(XF(H,n,r))}function he(e){let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=H.findIndex(e=>`grp:${e.key}`===String(t.id)),i=H.findIndex(e=>`grp:${e.key}`===String(n.id));r<0||i<0||pe(XF(H,r,i))}return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`models.title`),description:e(`strategies.description`),divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(yae,{}),(0,G.jsx)(Fae,{strategy:A}),w&&w.totalBudget>0&&(0,G.jsx)(Dae,{data:w}),(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-4 sm:p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between mb-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`strategies.title`)}),T?.weights&&(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e(`strategies.weightsSummary`,{reliability:Math.round(T.weights.reliability*100),speed:Math.round(T.weights.speed*100),intelligence:Math.round(T.weights.intelligence*100)}),T.peakAdjusted&&(0,G.jsx)(SD,{text:e(`strategies.peakActiveHint`),children:(0,G.jsx)(`span`,{className:`ml-1 cursor-help underline decoration-dotted underline-offset-2`,children:e(`strategies.peakActive`)})})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-1 rounded-xl border p-1`,children:[Bae.map(t=>(0,G.jsx)(SD,{text:e(`strategies.${t.tKey}Blurb`),children:(0,G.jsx)(`button`,{disabled:k.isPending,onClick:()=>k.mutate({strategy:t.key}),className:`px-3 py-1.5 text-xs rounded-lg transition-colors ${t.key===A?`bg-primary text-primary-foreground font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:e(`strategies.${t.tKey}`)})},t.key)),A===`custom`&&T&&(0,G.jsx)(vae,{saved:T.customWeights,saving:k.isPending,onSave:e=>k.mutate({strategy:`custom`,weights:e})})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:B,"aria-expanded":!a,className:`inline-flex items-center gap-1 rounded-lg px-1.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[e(`strategies.moreOptions`),(0,G.jsx)(Ti,{className:`size-3.5 transition-transform ${a?`-rotate-90`:``}`})]})]}),(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:e(M?`strategies.modeManualHint`:`strategies.modeScoreHint`)}),!a&&(0,G.jsxs)(`div`,{className:`mt-3 flex flex-col items-start gap-2 border-t pt-3`,children:[(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:e(`strategies.keySelection`)}),(0,G.jsxs)(`select`,{value:j,disabled:k.isPending,onChange:e=>k.mutate({strategy:A,keySelectionStrategy:e.target.value}),className:`rounded-lg border bg-background px-2 py-1.5 text-xs text-foreground`,children:[(0,G.jsx)(`option`,{value:`auto`,children:e(`strategies.keySelectionAuto`)}),(0,G.jsx)(`option`,{value:`least-remaining`,children:e(`strategies.keySelectionLeastRemaining`)})]}),(0,G.jsx)(SD,{text:e(`strategies.keySelectionHint`),children:(0,G.jsx)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,children:`?`})})]}),(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:e(`strategies.cooldownCeiling`)}),(0,G.jsxs)(`select`,{value:T?.cooldownCeilingMs==null?``:String(T.cooldownCeilingMs),disabled:k.isPending,onChange:e=>k.mutate({strategy:A,cooldownCeilingMs:e.target.value===``?null:Number(e.target.value)}),className:`rounded-lg border bg-background px-2 py-1.5 text-xs text-foreground`,children:[(0,G.jsx)(`option`,{value:``,children:e(`strategies.cooldownCeilingDefault`)}),(0,G.jsx)(`option`,{value:`600000`,children:e(`strategies.cooldownCeiling10m`)}),(0,G.jsx)(`option`,{value:`3600000`,children:e(`strategies.cooldownCeiling1h`)}),(0,G.jsx)(`option`,{value:`21600000`,children:e(`strategies.cooldownCeiling6h`)})]}),(0,G.jsx)(SD,{text:e(`strategies.cooldownCeilingHint`),children:(0,G.jsx)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,children:`?`})})]}),!M&&(0,G.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:T?.exploreEnabled??!0,disabled:!T||k.isPending,onChange:e=>k.mutate({strategy:A,exploreEnabled:e.target.checked}),className:`size-3.5 accent-foreground`}),(0,G.jsx)(`span`,{children:e(`strategies.explore`)}),(0,G.jsx)(SD,{text:e(`strategies.exploreHint`),children:(0,G.jsx)(`span`,{className:`cursor-help underline decoration-dotted underline-offset-2`,children:`?`})})]}),!M&&T&&(0,G.jsx)(Lae,{routing:T,strategy:A,saving:k.isPending,onSave:e=>k.mutate({strategy:A,...e})})]})]}),(0,G.jsx)(zae,{}),(0,G.jsx)(Mae,{}),x?(0,G.jsx)(rk,{rows:8}):H.length===0?(0,G.jsx)($D,{icon:xi,title:e(`models.noModelsTitle`),description:(0,G.jsxs)(G.Fragment,{children:[e(`models.noModelsBefore`),(0,G.jsx)(gn,{to:`/keys`,className:`underline text-foreground`,children:e(`models.keysPageLink`)}),e(`models.noModelsAfter`)]}),action:(0,G.jsx)(gn,{to:`/keys`,children:(0,G.jsx)(J,{size:`sm`,children:e(`setup.step1Cta`)})})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`relative w-full sm:max-w-xs`,children:[(0,G.jsx)(Aa,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:e(`models.searchPlaceholder`),"aria-label":e(`models.searchPlaceholder`),className:`w-full rounded-xl border bg-card py-1.5 pl-9 pr-8 text-sm outline-none transition-colors focus:border-foreground/30`}),s&&(0,G.jsx)(`button`,{onClick:()=>c(``),"aria-label":e(`models.clearSearch`),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`button`,{onClick:()=>u(e=>!e),"aria-pressed":l,className:`px-3 py-1.5 text-xs rounded-lg border transition-colors ${l?`bg-primary text-primary-foreground border-primary font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:e(`models.vision`)}),(0,G.jsx)(`button`,{onClick:()=>f(e=>!e),"aria-pressed":d,className:`px-3 py-1.5 text-xs rounded-lg border transition-colors ${d?`bg-primary text-primary-foreground border-primary font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:e(`models.tools`)}),(0,G.jsx)(`div`,{className:`inline-flex items-center gap-1 rounded-xl border p-1`,role:`group`,"aria-label":e(`models.ctxTitle`),children:Vae.map(t=>(0,G.jsx)(`button`,{onClick:()=>m(t.key),className:`px-2.5 py-1 text-xs rounded-lg transition-colors tabular-nums ${p===t.key?`bg-primary text-primary-foreground font-medium`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:t.tKey?e(`models.${t.tKey}`):t.label},t.key))}),(0,G.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded-xl border p-1`,role:`group`,"aria-label":e(`models.bulkToggle`),children:[(0,G.jsx)(SD,{text:e(`models.enableAllHint`),children:(0,G.jsx)(`button`,{onClick:()=>fe(!0),disabled:de===te.length,className:`rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:hover:bg-transparent`,children:e(`models.enableAll`)})}),(0,G.jsx)(SD,{text:e(`models.disableAllHint`),children:(0,G.jsx)(`button`,{onClick:()=>fe(!1),disabled:de===0,className:`rounded-lg px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:hover:bg-transparent`,children:e(`models.disableAll`)})})]})]})]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`models.enabledOfShown`,{enabled:de,shown:te.length})}),W&&(0,G.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:e(`models.showingCount`,{shown:te.length,total:H.length})}),(0,G.jsx)(`button`,{onClick:ce,className:`underline hover:text-foreground`,children:e(`models.clearFilters`)})]}),te.length===0?(0,G.jsx)($D,{title:e(`models.noMatches`),action:(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:ce,children:e(`models.clearFilters`)})}):ne?(0,G.jsx)(JF,{sensors:R,collisionDetection:MP,onDragEnd:he,children:(0,G.jsx)(`div`,{className:`rounded-2xl border overflow-x-auto`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(_I,{}),(0,G.jsx)(rI,{items:ae.map(e=>`grp:${e.key}`),strategy:eI,children:(0,G.jsx)(`tbody`,{children:ae.map(e=>(0,G.jsx)(Cae,{group:e,rank:U.get(e.key)??0,editableRank:!0,onMoveRank:t=>me(e.key,t),onToggleGroup:le,allRows:L,rateUsage:D},e.key))})})]})})}):(0,G.jsx)(`div`,{className:`rounded-2xl border overflow-x-auto`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(_I,{}),(0,G.jsx)(`tbody`,{children:ae.map(e=>(0,G.jsx)(`tr`,{onClick:()=>t(`/models/chat/${encodeURIComponent(e.members[0].canonicalId??e.members[0].modelId)}`),className:`group/row border-b last:border-0 cursor-pointer transition-colors hover:[&>td]:bg-muted/50 [&>td:first-child]:rounded-l-lg [&>td:last-child]:rounded-r-lg ${e.members.some(e=>e.enabled)?Tk(e.members,D)?`opacity-60`:``:`opacity-50`}`,children:(0,G.jsx)(bI,{group:e,rank:U.get(e.key)??0,onToggleGroup:le,allRows:L,rateUsage:D})},e.key))})]})}),oe&&(0,G.jsx)(`div`,{ref:se,className:`h-px`,"aria-hidden":`true`}),(0,G.jsxs)(xI,{show:V,children:[(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`common.unsavedChanges`)}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>C(null),children:e(`common.discard`)}),(0,G.jsx)(J,{size:`sm`,onClick:z,disabled:O.isPending,children:O.isPending?e(`common.saving`):e(`common.saveChanges`)})]}),I.length>0&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`models.hiddenNoKeys`,{platforms:I.join(`, `)})})]})]})]})}function jI(e){return e.trim().toLowerCase().replace(/[\s\-_]+/g,` `)}function Wae(e,t){let n=jI(t);return e.filter(e=>jI(e.into)===n).flatMap(e=>e.keys)}function Gae(e,t,n){let r=n.trim();if(!r)return e;let i=jI(t),a=e.filter(e=>jI(e.into)===i),o=e.filter(e=>jI(e.into)!==i),s=[...new Set([...a.flatMap(e=>e.keys),r])];return[...o,{into:t,keys:s}]}function Kae(e,t,n){let r=jI(t);return e.map(e=>jI(e.into)===r?{...e,keys:e.keys.filter(e=>e!==n)}:e).filter(e=>e.keys.length>0)}var MI=1e3,qae=[`Frontier`,`Large`,`Medium`,`Small`];function NI(e){let t=e.trim();if(t===``)return;let n=Number(t);return Number.isInteger(n)?n:void 0}function PI(e){if(e.trim()===``)return null;let t=NI(e);return t!==void 0&&t>0?t:void 0}function FI(e){let t=NI(e);return t!==void 0&&t>=1&&t<=1e3?t:void 0}function II(e){return e==null?``:String(e)}function LI(e){return{displayName:e.displayName,contextWindow:II(e.contextWindow),intelligenceRank:II(e.intelligenceRank),speedRank:II(e.speedRank),sizeLabel:e.sizeLabel,rpmLimit:II(e.rpmLimit),rpdLimit:II(e.rpdLimit),tpmLimit:II(e.tpmLimit),tpdLimit:II(e.tpdLimit),supportsVision:e.supportsVision,supportsTools:e.supportsTools,fallbackEnabled:e.enabled}}function Jae(e,t){let n=t.displayName.trim(),r={intelligenceRank:FI(t.intelligenceRank),speedRank:FI(t.speedRank),contextWindow:PI(t.contextWindow),rpmLimit:PI(t.rpmLimit),rpdLimit:PI(t.rpdLimit),tpmLimit:PI(t.tpmLimit),tpdLimit:PI(t.tpdLimit)},i={displayName:n.length===0,intelligenceRank:r.intelligenceRank===void 0,speedRank:r.speedRank===void 0,contextWindow:r.contextWindow===void 0,rpmLimit:r.rpmLimit===void 0,rpdLimit:r.rpdLimit===void 0,tpmLimit:r.tpmLimit===void 0,tpdLimit:r.tpdLimit===void 0,sizeLabel:!1,supportsVision:!1,supportsTools:!1},a={};return n!==e.displayName&&(a.displayName=n),r.intelligenceRank!==e.intelligenceRank&&(a.intelligenceRank=r.intelligenceRank),r.speedRank!==e.speedRank&&(a.speedRank=r.speedRank),t.sizeLabel!==e.sizeLabel&&(a.sizeLabel=t.sizeLabel),r.contextWindow!==(e.contextWindow??null)&&(a.contextWindow=r.contextWindow),r.rpmLimit!==(e.rpmLimit??null)&&(a.rpmLimit=r.rpmLimit),r.rpdLimit!==(e.rpdLimit??null)&&(a.rpdLimit=r.rpdLimit),r.tpmLimit!==(e.tpmLimit??null)&&(a.tpmLimit=r.tpmLimit),r.tpdLimit!==(e.tpdLimit??null)&&(a.tpdLimit=r.tpdLimit),t.supportsVision!==e.supportsVision&&(a.supportsVision=t.supportsVision),t.supportsTools!==e.supportsTools&&(a.supportsTools=t.supportsTools),t.fallbackEnabled!==e.enabled&&(a.fallbackEnabled=t.fallbackEnabled),{patch:Object.values(i).some(Boolean)?null:a,invalid:i,dirty:Object.keys(a).length>0}}function Yae(){let{t:e}=Z(),{id:t}=at(),n=t?decodeURIComponent(t):``,r=Rr(),{data:i=[],isLoading:a}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)}),{data:o}=$r({queryKey:[`fallback`,`routing`],queryFn:()=>X(`/api/fallback/routing`)}),{data:s}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)}),{data:c}=$r({queryKey:[`unify`],queryFn:()=>X(`/api/settings/unify`)}),{data:l}=$r({queryKey:[`fallback`,`rate-limit-usage`],queryFn:()=>X(`/api/fallback/rate-limit-usage`),refetchInterval:15e3}),u=(0,v.useMemo)(()=>new Map((l?.rows??[]).map(e=>[e.modelDbId,e])),[l]),d=ei({mutationFn:e=>X(`/api/fallback`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>r.invalidateQueries({queryKey:[`fallback`]})}),f=ei({mutationFn:({modelDbId:e,patch:t})=>X(`/api/models/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:()=>{r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`fallback`,`routing`]}),r.invalidateQueries({queryKey:[`models`]})}}),p=ei({mutationFn:e=>X(`/api/models/${e}`,{method:`DELETE`}),onSuccess:()=>{r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`fallback`,`routing`]}),r.invalidateQueries({queryKey:[`models`]})}}),m=ei({mutationFn:e=>X(`/api/settings/unify`,{method:`PUT`,body:JSON.stringify({overrides:{merges:c?.overrides.merges??[],splits:e}})}),onSuccess:()=>{r.invalidateQueries({queryKey:[`unify`]}),r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`fallback`,`routing`]}),r.invalidateQueries({queryKey:[`models`]})}}),[h,g]=(0,v.useState)(``),_=ei({mutationFn:e=>X(`/api/settings/unify`,{method:`PUT`,body:JSON.stringify({overrides:{merges:e,splits:c?.overrides.splits??[]}})}),onSuccess:()=>{r.invalidateQueries({queryKey:[`unify`]}),r.invalidateQueries({queryKey:[`fallback`]}),r.invalidateQueries({queryKey:[`fallback`,`routing`]}),r.invalidateQueries({queryKey:[`models`]}),g(``)}}),y=c?.overrides.splits??[];function b(e,t){if(c){if(hk(y,e))return{kind:`undo`,pending:m.isPending,onClick:()=>m.mutate(gk(y,e))};if(!(t<2))return{kind:`split`,pending:m.isPending,onClick:()=>m.mutate([...y,{member:pk(e)}])}}}let x=(o?.strategy??`balanced`)===`priority`,S=new Map((o?.scores??[]).map(e=>[e.modelDbId,e])),C=i.filter(e=>e.keyCount>0&&(e.canonicalId??e.modelId)===n).map(e=>({...S.get(e.modelDbId)??{},...e})).sort((e,t)=>x?e.priority-t.priority:(t.score??0)-(e.score??0)),w=i;function T(e,t){d.mutate(i.map(n=>({modelDbId:n.modelDbId,priority:n.priority,enabled:n.modelDbId===e?t:n.enabled})))}let E=C[0]?.groupLabel??C[0]?.displayName??n,D=C.length?Sk(C,e):null,O=C.some(e=>e.supportsVision),k=C.some(e=>e.supportsTools),A=(0,v.useMemo)(()=>c?.overrides.merges??[],[c]),j=(0,v.useMemo)(()=>Wae(A,E),[A,E]),M=()=>{h.trim()&&_.mutate(Gae(A,E,h))},N=`curl ${`${window.location.origin}/v1`}/chat/completions \\
69
+ -H "Authorization: Bearer ${s?.apiKey||`YOUR_API_KEY`}" \\
70
+ -H "Content-Type: application/json" \\
71
+ -d '{
72
+ "model": "${n}",
73
+ "messages": [
74
+ { "role": "user", "content": "Hello!" }
75
+ ]
76
+ }'`;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:E,description:e(`models.providersHeading`),divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(gn,{to:`/models/chat`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)(Ei,{className:`size-4`}),e(`models.backToModels`)]}),a?(0,G.jsx)(rk,{rows:3}):C.length===0?(0,G.jsx)(`div`,{className:`rounded-3xl border border-dashed p-6 sm:p-8 text-center`,children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`models.modelNotFound`)})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,G.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px] text-foreground`,children:[(0,G.jsx)(`code`,{className:`min-w-0 truncate font-mono`,children:n}),(0,G.jsx)(vv,{text:n,label:e(`models.copyModelId`),className:`size-4 shrink-0 border-0 bg-transparent`})]}),(0,G.jsx)(`span`,{className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground`,children:e(`models.providerCount`,{count:C.length})}),D&&(0,G.jsx)(`span`,{title:D.title,className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:D.text}),(0,G.jsx)(vI,{size:`md`,rows:C.flatMap(e=>u.get(e.modelDbId)??[])}),O&&(0,G.jsx)(`span`,{title:e(`models.visionTitle`),className:`text-[11px] rounded-full px-2 py-0.5 bg-cyan-600/15 text-cyan-700 dark:bg-cyan-400/15 dark:text-cyan-400`,children:e(`models.vision`)}),k&&(0,G.jsx)(`span`,{title:e(`models.toolsTitle`),className:`text-[11px] rounded-full px-2 py-0.5 bg-violet-600/15 text-violet-700 dark:bg-violet-400/15 dark:text-violet-400`,children:e(`models.tools`)})]}),(0,G.jsx)(`div`,{className:`rounded-2xl border overflow-x-auto`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(_I,{}),(0,G.jsx)(`tbody`,{children:C.map((e,t)=>(0,G.jsx)(`tr`,{className:`border-b last:border-0 ${e.enabled?wk(u.get(e.modelDbId))?`opacity-60`:``:`opacity-50`}`,children:(0,G.jsx)(xae,{row:e,rank:t+1,draggable:!1,onToggle:T,providerName:lk(e,w),providerTitle:dk(e,w),rateUsage:u.get(e.modelDbId)})},e.modelDbId))})]})}),(0,G.jsxs)(`div`,{className:`rounded-2xl border bg-card p-4`,children:[(0,G.jsxs)(`div`,{className:`mb-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`models.settingsHeading`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`models.settingsHint`)})]}),(0,G.jsx)(`div`,{className:`space-y-3`,children:C.map(e=>(0,G.jsx)(Xae,{model:e,endpointLabel:lk(e,w),endpointTitle:dk(e,w),saving:f.isPending&&f.variables?.modelDbId===e.modelDbId,deleting:p.isPending&&p.variables===e.modelDbId,onSave:t=>f.mutate({modelDbId:e.modelDbId,patch:t}),onDelete:()=>p.mutate(e.modelDbId),splitAction:b(e,C.length)},e.modelDbId))})]}),(0,G.jsxs)(`div`,{className:`rounded-2xl border bg-card p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`models.providerIdsHeading`)}),(0,G.jsx)(`p`,{className:`mt-0.5 mb-3 text-xs text-muted-foreground`,children:e(`models.providerIdsHint`)}),(0,G.jsx)(`div`,{className:`space-y-1.5`,children:C.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`w-28 max-w-[16rem] shrink-0 basis-auto truncate text-muted-foreground sm:w-auto sm:min-w-28`,title:dk(t,w),children:lk(t,w)}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[11px]`,children:fk(t,w)}),(0,G.jsx)(SD,{text:e(`models.copyModelName`),children:(0,G.jsx)(vv,{text:fk(t,w),label:e(`models.copyModelName`),className:`border-0 bg-transparent`})})]},t.modelDbId))})]}),(0,G.jsxs)(`div`,{className:`rounded-2xl border bg-card p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`models.aliasMergeHeading`)}),(0,G.jsx)(`p`,{className:`mt-0.5 mb-3 text-xs text-muted-foreground`,children:e(`models.aliasMergeHint`)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(L_,{value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),M())},placeholder:`custom:my-alias`,className:`font-mono text-xs`,"aria-label":e(`models.aliasMergeHeading`)}),(0,G.jsx)(J,{type:`button`,size:`sm`,disabled:_.isPending||!h.trim(),onClick:M,children:e(`models.aliasMergeAdd`)})]}),j.length>0&&(0,G.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:j.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground`,children:t}),(0,G.jsx)(J,{type:`button`,size:`xs`,variant:`ghost`,className:`text-muted-foreground`,disabled:_.isPending,onClick:()=>_.mutate(Kae(A,E,t)),children:e(`models.aliasMergeRemove`)})]},t))})]}),(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border bg-card`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,G.jsx)(vv,{text:N,className:`size-7 shrink-0`,label:e(`common.copy`)}),(0,G.jsx)(`span`,{className:`text-xs font-medium`,children:e(`models.codeSnippetHeading`)})]}),(0,G.jsx)(`pre`,{className:`overflow-x-auto px-4 py-3 text-[11px] leading-relaxed`,children:(0,G.jsx)(`code`,{className:`font-mono`,children:N})})]})]})]})]})}function Xae({model:e,endpointLabel:t,endpointTitle:n,saving:r,deleting:i,onSave:a,onDelete:o,splitAction:s}){let{t:c}=Z(),{modelDbId:l,displayName:u,contextWindow:d,intelligenceRank:f,speedRank:p,sizeLabel:m,rpmLimit:h,rpdLimit:g,tpmLimit:_,tpdLimit:y,supportsVision:b,supportsTools:x,enabled:S}=e,C=(0,v.useMemo)(()=>({displayName:u,contextWindow:d,intelligenceRank:f,speedRank:p,sizeLabel:m,rpmLimit:h,rpdLimit:g,tpmLimit:_,tpdLimit:y,supportsVision:b,supportsTools:x,enabled:S}),[u,d,f,p,m,h,g,_,y,b,x,S]),[w,T]=(0,v.useState)(()=>LI(C));(0,v.useEffect)(()=>T(LI(C)),[l,C]);let E=(e,t)=>T(n=>({...n,[e]:t})),{patch:D,invalid:O,dirty:k}=Jae(C,w),A=k&&D!==null&&!r&&!i,j=e.source===`custom`?c(`models.customModel`):e.source===`discovered`?c(`models.discoveredModel`):c(`models.catalogModel`),M=new Set(e.overrideFields??[]);function N(){!A||!D||a(D)}return(0,G.jsxs)(`div`,{className:`rounded-xl border bg-background/60 p-3`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium`,title:n,children:t}),(0,G.jsx)(`code`,{className:`min-w-0 truncate rounded-full bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.modelId}),(0,G.jsx)(vv,{text:e.modelId,label:c(`models.copyModelId`),className:`size-6 shrink-0`}),(0,G.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:j}),e.hasOverrides&&(0,G.jsx)(`span`,{className:`rounded-full bg-emerald-600/15 px-1.5 py-0.5 text-[10px] text-emerald-700 dark:text-emerald-400`,children:c(`models.localOverride`)}),s?.kind===`undo`&&(0,G.jsx)(`span`,{className:`rounded-full bg-amber-600/15 px-1.5 py-0.5 text-[10px] text-amber-700 dark:text-amber-400`,children:c(`models.splitBadge`)}),s&&(0,G.jsx)(SD,{text:c(s.kind===`split`?`models.splitOutHint`:`models.splitUndoHint`),children:(0,G.jsxs)(J,{type:`button`,size:`xs`,variant:`ghost`,className:`ml-auto text-muted-foreground`,disabled:s.pending,onClick:s.onClick,children:[s.kind===`split`?(0,G.jsx)(Fa,{className:`size-3`}):(0,G.jsx)(pa,{className:`size-3`}),c(s.kind===`split`?`models.splitOut`:`models.splitUndo`)]})})]}),(0,G.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(12rem,1fr)_8rem_auto_auto_auto_auto] md:items-end`,children:[(0,G.jsxs)(`label`,{className:`space-y-1 text-xs text-muted-foreground`,children:[(0,G.jsx)(RI,{text:c(`models.displayName`),overridden:M.has(`displayName`)}),(0,G.jsx)(L_,{value:w.displayName,onChange:e=>E(`displayName`,e.target.value),"aria-invalid":O.displayName,className:`text-sm`})]}),(0,G.jsx)(zI,{label:c(`models.contextWindow`),value:w.contextWindow,invalid:O.contextWindow,overridden:M.has(`contextWindow`),onChange:e=>E(`contextWindow`,e)}),(0,G.jsxs)(`label`,{className:`flex h-8 items-center gap-2 text-xs`,children:[(0,G.jsx)(xD,{size:`sm`,checked:w.supportsTools,onCheckedChange:e=>E(`supportsTools`,e)}),(0,G.jsx)(RI,{text:c(`models.tools`),overridden:M.has(`supportsTools`)})]}),(0,G.jsxs)(`label`,{className:`flex h-8 items-center gap-2 text-xs`,children:[(0,G.jsx)(xD,{size:`sm`,checked:w.supportsVision,onCheckedChange:e=>E(`supportsVision`,e)}),(0,G.jsx)(RI,{text:c(`models.vision`),overridden:M.has(`supportsVision`)})]}),(0,G.jsxs)(`label`,{className:`flex h-8 items-center gap-2 text-xs`,children:[(0,G.jsx)(xD,{size:`sm`,checked:w.fallbackEnabled,onCheckedChange:e=>E(`fallbackEnabled`,e)}),(0,G.jsx)(`span`,{children:c(`models.inFallback`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,G.jsx)(SD,{text:c(`models.saveModelSettings`),children:(0,G.jsx)(J,{type:`button`,size:`icon-sm`,variant:`ghost`,disabled:!A,onClick:N,children:(0,G.jsx)(Oa,{className:`size-3.5`})})}),(0,G.jsx)(gO,{variant:`destructive`,size:`icon-sm`,armedSize:`xs`,armedClassName:``,disabled:r||i,onConfirm:o,"aria-label":c(`common.delete`),children:(0,G.jsx)(Ba,{className:`size-3.5`})})]})]}),(0,G.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-7`,children:[(0,G.jsxs)(`label`,{className:`col-span-2 space-y-1 text-xs text-muted-foreground sm:col-span-3 md:col-span-1`,title:c(`models.sizeLabelHint`),children:[(0,G.jsx)(RI,{text:c(`models.sizeLabel`),overridden:M.has(`sizeLabel`)}),(0,G.jsxs)(ZO,{value:w.sizeLabel,onValueChange:e=>E(`sizeLabel`,e??``),children:[(0,G.jsx)($O,{className:`w-full`,"aria-label":c(`models.sizeLabel`),children:(0,G.jsx)(QO,{placeholder:c(`models.sizeLabelNone`)})}),(0,G.jsxs)(ek,{children:[qae.map(e=>(0,G.jsx)(tk,{value:e,children:e},e)),(0,G.jsx)(tk,{value:``,children:c(`models.sizeLabelNone`)})]})]})]}),(0,G.jsx)(zI,{label:c(`models.intelligenceRank`),hint:c(`models.rankHint`),min:1,max:MI,value:w.intelligenceRank,invalid:O.intelligenceRank,overridden:M.has(`intelligenceRank`),onChange:e=>E(`intelligenceRank`,e)}),(0,G.jsx)(zI,{label:c(`models.speedRank`),hint:c(`models.rankHint`),min:1,max:MI,value:w.speedRank,invalid:O.speedRank,overridden:M.has(`speedRank`),onChange:e=>E(`speedRank`,e)}),(0,G.jsx)(zI,{label:c(`models.limitRpm`),hint:c(`models.limitRpmHint`),value:w.rpmLimit,invalid:O.rpmLimit,overridden:M.has(`rpmLimit`),onChange:e=>E(`rpmLimit`,e)}),(0,G.jsx)(zI,{label:c(`models.limitRpd`),hint:c(`models.limitRpdHint`),value:w.rpdLimit,invalid:O.rpdLimit,overridden:M.has(`rpdLimit`),onChange:e=>E(`rpdLimit`,e)}),(0,G.jsx)(zI,{label:c(`models.limitTpm`),hint:c(`models.limitTpmHint`),value:w.tpmLimit,invalid:O.tpmLimit,overridden:M.has(`tpmLimit`),onChange:e=>E(`tpmLimit`,e)}),(0,G.jsx)(zI,{label:c(`models.limitTpd`),hint:c(`models.limitTpdHint`),value:w.tpdLimit,invalid:O.tpdLimit,overridden:M.has(`tpdLimit`),onChange:e=>E(`tpdLimit`,e)})]})]})}function RI({text:e,overridden:t}){let{t:n}=Z();return(0,G.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e,t&&(0,G.jsx)(`span`,{title:n(`models.localOverride`),"aria-label":n(`models.localOverride`),className:`size-1.5 shrink-0 rounded-full bg-emerald-600 dark:bg-emerald-400`})]})}function zI({label:e,hint:t,value:n,invalid:r,overridden:i,onChange:a,min:o=1,max:s}){return(0,G.jsxs)(`label`,{className:`space-y-1 text-xs text-muted-foreground`,title:t,children:[(0,G.jsx)(RI,{text:e,overridden:i}),(0,G.jsx)(L_,{type:`number`,min:o,max:s,step:1,value:n,onChange:e=>a(e.target.value),"aria-invalid":r,className:`text-sm tabular-nums`})]})}function Zae(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>n&&!(e.platform===n||e.platforms.includes(n))?!1:!r||`${e.label} ${e.value} ${e.platform} ${e.platforms.join(` `)}`.toLowerCase().includes(r))}function Qae(e){let t=new Set;for(let n of e){t.add(n.platform);for(let e of n.platforms)t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))}var BI=`__auto__`,VI=`__all__`;function $ae(){let{t:e}=Z(),t=Rr(),{data:n,isLoading:r}=$r({queryKey:[`fusion-config`],queryFn:()=>X(`/api/settings/fusion`)}),{data:i=[]}=$r({queryKey:[`fallback`],queryFn:()=>X(`/api/fallback`)}),{data:a}=$r({queryKey:[`unify`],queryFn:()=>X(`/api/settings/unify`)}),o=a?.enabled??!0,s=(0,v.useMemo)(()=>i.filter(e=>e.keyCount>0&&e.enabled),[i]),c=(0,v.useMemo)(()=>CA(s,o),[s,o]),[l,u]=(0,v.useState)(`auto`),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(BI),[h,g]=(0,v.useState)(4),[_,y]=(0,v.useState)(`synthesize`),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(VI),E=(0,v.useMemo)(()=>Qae(c),[c]),D=(0,v.useMemo)(()=>Zae(c,S,w===VI?null:w),[c,S,w]);(0,v.useEffect)(()=>{n&&(u(n.config.mode),f(n.config.models),m(n.config.judge??BI),g(n.config.k),y(n.config.strategy),x(n.config.expose_panel))},[n]);let O=n?.maxK??8,k=ei({mutationFn:e=>X(`/api/settings/fusion`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:e=>t.setQueryData([`fusion-config`],e)}),A={mode:l,models:d,judge:p===BI?null:p,k:Math.min(Math.max(h||1,1),O),strategy:_,expose_panel:b},j=!!n&&JSON.stringify({...n.config,judge:n.config.judge??null})!==JSON.stringify(A),M=e=>{f(t=>t.includes(e)?t.filter(t=>t!==e):t.length>=O?t:[...t,e])};return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`fusion.title`),description:e(`fusion.description`),divider:!1,tabs:(0,G.jsx)(SI,{})}),r?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):(0,G.jsxs)(`div`,{className:`space-y-8`,children:[(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.panelSource`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`fusion.panelSourceHelp`)})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-3`,children:[`auto`,`explicit`].map(t=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(t),className:`rounded-xl border p-3 text-left transition-colors ${l===t?`border-foreground bg-muted/50`:`hover:bg-muted/30`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:e(`fusion.mode.${t}`)}),l===t&&(0,G.jsx)(wi,{className:`size-4`})]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e(`fusion.mode.${t}Help`)})]},t))})]}),l===`explicit`&&(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.panelModels`)}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`fusion.selectedCount`,{count:d.length,max:O})})]}),c.length===0?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`fusion.noModels`)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`div`,{className:`relative flex-1`,children:[(0,G.jsx)(Aa,{className:`pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(L_,{value:S,onChange:e=>C(e.target.value),placeholder:e(`fusion.searchPlaceholder`),className:`pl-8`})]}),(0,G.jsxs)(ZO,{value:w,onValueChange:e=>T(e??VI),children:[(0,G.jsx)($O,{className:`w-44 shrink-0`,"aria-label":e(`fusion.providerFilterLabel`),children:(0,G.jsx)(QO,{children:t=>t===VI?e(`fusion.providerAll`):E.find(e=>e===t)??t})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:VI,children:e(`fusion.providerAll`)}),E.map(e=>(0,G.jsx)(tk,{value:e,children:e},e))]})]})]}),(0,G.jsx)(`div`,{className:`max-h-80 overflow-y-auto rounded-xl border divide-y`,children:D.length===0?(0,G.jsx)(`p`,{className:`px-3 py-6 text-center text-xs text-muted-foreground`,children:e(`fusion.noMatch`)}):D.map(t=>{let n=d.includes(t.value),r=!n&&d.length>=O;return(0,G.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>M(t.value),className:`flex w-full items-center gap-3 px-3 py-2 text-left transition-colors ${n?`bg-muted/50`:r?`opacity-40`:`hover:bg-muted/30`}`,children:[(0,G.jsx)(`span`,{className:`flex size-4 items-center justify-center rounded border ${n?`bg-primary text-primary-foreground`:``}`,children:n&&(0,G.jsx)(wi,{className:`size-3`})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:t.label}),(0,G.jsx)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:t.value})]}),(0,G.jsx)(nO,{variant:`secondary`,className:`text-[10px]`,children:t.providerCount>1?e(`models.providerCount`,{count:t.providerCount}):t.platform})]},t.value)})})]})]}),l===`auto`&&(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.panelSize`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`fusion.panelSizeHelp`,{max:O})}),(0,G.jsx)(L_,{type:`number`,min:1,max:O,value:h,onChange:e=>g(Number(e.target.value)),className:`w-28`})]}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.judge`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`fusion.judgeHelp`)}),(0,G.jsxs)(ZO,{value:p,onValueChange:e=>m(e??BI),children:[(0,G.jsx)($O,{className:`w-full max-w-md`,children:(0,G.jsx)(QO,{children:t=>!t||t===BI?e(`fusion.judgeAuto`):c.find(e=>e.value===t)?.label??t})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:BI,children:e(`fusion.judgeAuto`)}),c.map(t=>(0,G.jsx)(tk,{value:t.value,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{children:t.label}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.providerCount>1?e(`models.providerCount`,{count:t.providerCount}):t.platform})]})},t.value))]})]})]}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.strategy`)}),(0,G.jsxs)(ZO,{value:_,onValueChange:e=>{e&&y(e)},children:[(0,G.jsx)($O,{className:`w-full max-w-md`,children:(0,G.jsx)(QO,{children:t=>e(t===`best_of`?`fusion.strategyBestOfShort`:`fusion.strategySynthesizeShort`)})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`synthesize`,children:e(`fusion.strategySynthesize`)}),(0,G.jsx)(tk,{value:`best_of`,children:e(`fusion.strategyBestOf`)})]})]})]}),(0,G.jsxs)(`section`,{className:`flex items-center justify-between rounded-xl border p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 pr-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.exposePanel`)}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`fusion.exposePanelHelp`)})]}),(0,G.jsx)(xD,{checked:b,onCheckedChange:x})]}),(0,G.jsxs)(`section`,{className:`rounded-xl border bg-muted/30 p-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,G.jsx)(aa,{className:`size-4`}),(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`fusion.howToUse`)})]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:e(`fusion.howToUseHelp`)}),(0,G.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-background p-3 text-[11px] leading-relaxed font-mono border`,children:`POST /v1/chat/completions
77
+ {
78
+ "model": "fusion",
79
+ "messages": [ ... ]
80
+ }`})]})]}),(0,G.jsxs)(xI,{show:j,children:[(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`fusion.unsavedChanges`)}),(0,G.jsx)(J,{size:`sm`,onClick:()=>k.mutate(A),disabled:k.isPending,children:k.isPending?e(`common.loading`):e(`fusion.save`)})]})]})}function HI({rows:e,total:t,requestsToday:n,unit:r}){let{t:i}=Z(),a=e.filter(e=>e.amount>0),o=e=>r===`tokens`?_k(e):String(e);return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 mb-3`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:i(`models.usageThisMonth`)}),(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[r===`tokens`?i(`embeddings.usageMonth`,{count:o(t)}):i(`models.usageRequestsMonth`,{count:t}),(0,G.jsx)(`span`,{className:`mx-1.5`,children:`·`}),i(`embeddings.usageToday`,{count:n})]})]}),t>0?(0,G.jsx)(`div`,{className:`flex h-2.5 rounded-full overflow-hidden bg-muted`,children:a.map((e,n)=>(0,G.jsx)(`div`,{title:`${e.label}${e.platform?` (${e.platform})`:``}: ${o(e.amount)}`,style:{width:`${e.amount/t*100}%`,backgroundColor:Ek[e.platform??``]??`#94a3b8`}},n))}):(0,G.jsx)(`div`,{className:`h-2.5 rounded-full bg-muted`}),(0,G.jsx)(`div`,{className:`mt-4 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-5 gap-y-1.5 text-xs tabular-nums`,children:e.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-sm flex-shrink-0`,style:{backgroundColor:Ek[e.platform??``]??`#94a3b8`}}),(0,G.jsx)(`span`,{className:`truncate`,children:e.label}),e.quotaLabel&&(0,G.jsx)(`span`,{className:`truncate text-muted-foreground/70 font-normal`,children:e.quotaLabel}),(0,G.jsx)(`span`,{className:`flex-1`}),(0,G.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:o(e.amount)})]},t))}),t===0&&(0,G.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:i(`models.usageEmpty`)})]})}function UI(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function eoe({provider:e,index:t,count:n,onMove:r,onToggle:i,onDelete:a,deleting:o}){let{t:s}=Z(),{attributes:c,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:p}=aI({id:e.id});return(0,G.jsxs)(`div`,{ref:u,style:{transform:cP.Transform.toString(d),transition:f},className:`flex items-center gap-3 py-2 bg-card ${e.enabled?``:`opacity-50`} ${p?`opacity-50 relative z-10`:``}`,children:[n>1&&(0,G.jsx)(`button`,{...c,...l,"aria-label":s(`embeddings.dragToReorder`),className:`cursor-grab active:cursor-grabbing text-muted-foreground/50 hover:text-foreground transition-colors`,children:yI}),(0,G.jsx)(`span`,{className:`w-5 text-center font-mono text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:e.platform}),(0,G.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.modelId}),e.keyCount===0&&(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-amber-600/15 text-amber-700 dark:bg-amber-400/15 dark:text-amber-400`,children:s(`models.noKey`)})]}),(0,G.jsx)(`div`,{className:`text-[11px] text-muted-foreground/70`,children:e.quotaLabel})]}),n>1&&(0,G.jsxs)(`div`,{className:`flex gap-0.5`,children:[(0,G.jsx)(`button`,{onClick:()=>r(-1),disabled:t===0,"aria-label":s(`embeddings.moveUp`),className:`rounded-md p-1 text-muted-foreground/60 hover:text-foreground disabled:opacity-25 transition-colors`,children:(0,G.jsx)(_i,{className:`size-3.5`})}),(0,G.jsx)(`button`,{onClick:()=>r(1),disabled:t===n-1,"aria-label":s(`embeddings.moveDown`),className:`rounded-md p-1 text-muted-foreground/60 hover:text-foreground disabled:opacity-25 transition-colors`,children:(0,G.jsx)(mi,{className:`size-3.5`})})]}),(0,G.jsx)(xD,{checked:e.enabled,onCheckedChange:i}),e.isCustom&&(0,G.jsx)(gO,{className:`text-muted-foreground hover:text-destructive`,onConfirm:a,disabled:o,children:s(`common.remove`)})]})}function toe(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),{data:o,isLoading:s}=$r({queryKey:[`embeddings`],queryFn:()=>X(`/api/embeddings`)}),{data:c}=$r({queryKey:[`embeddings`,`usage`],queryFn:()=>X(`/api/embeddings/usage`),refetchInterval:3e4}),l=new Map((c?.families??[]).map(e=>[e.family,e])),u=ei({mutationFn:e=>X(`/api/embeddings`,{method:`PUT`,body:JSON.stringify(e)}),onSuccess:()=>{t.invalidateQueries({queryKey:[`embeddings`]}),r(null),a(null)}}),d=ei({mutationFn:e=>X(`/api/embeddings/custom/${e}`,{method:`DELETE`}),onSuccess:()=>{t.invalidateQueries({queryKey:[`embeddings`]}),t.invalidateQueries({queryKey:[`embeddings`,`usage`]}),r(null)}}),f=n??o?.families??[],p=i??o?.defaultFamily??``,m=n!==null||i!==null;function h(e,t,n){r(f.map(r=>r.family===e?{...r,providers:r.providers.map(e=>e.id===t?{...e,...n}:e)}:r))}function g(e,t,n){r(f.map(r=>{if(r.family!==e)return r;let i=[...r.providers],a=t+n;return a<0||a>=i.length?r:([i[t],i[a]]=[i[a],i[t]],{...r,providers:i.map((e,t)=>({...e,priority:t+1}))})}))}let _=wP(CP(EF),CP(xF,{coordinateGetter:sI}));function y(e,t){let{active:n,over:i}=t;!i||n.id===i.id||r(f.map(t=>{if(t.family!==e)return t;let r=t.providers.findIndex(e=>e.id===n.id),a=t.providers.findIndex(e=>e.id===i.id);return r<0||a<0?t:{...t,providers:XF(t.providers,r,a).map((e,t)=>({...e,priority:t+1}))}}))}function b(){u.mutate({...i===null?{}:{defaultFamily:i},...n===null?{}:{providers:f.flatMap(e=>e.providers.map(e=>({id:e.id,priority:e.priority,enabled:e.enabled})))}})}function x(){r(null),a(null)}return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`embeddings.title`),description:e(`embeddings.description`),divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`embeddings.autoDescription`)}),c&&c.families.length>0&&(0,G.jsx)(HI,{unit:`tokens`,total:c.totalTokensMonth??0,requestsToday:c.totalRequestsToday??0,rows:c.families.map(e=>({label:e.family,platform:e.platform??null,quotaLabel:e.quotaLabel??null,amount:e.tokensMonth,requestsToday:e.requestsToday}))}),s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ik,{}),(0,G.jsx)(ik,{})]}):f.length===0?(0,G.jsx)($D,{icon:aa,title:e(`embeddings.emptyTitle`),description:e(`embeddings.emptyDesc`),action:(0,G.jsx)(gn,{to:`/keys`,children:(0,G.jsx)(J,{size:`sm`,children:e(`setup.step1Cta`)})})}):f.map(t=>{let n=l.get(t.family),r=t.providers.every(e=>e.keyCount===0);return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5 ${r?`opacity-60`:``}`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 mb-3 flex-wrap`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline gap-2.5 min-w-0`,children:[(0,G.jsx)(gn,{to:`/models/embeddings/${encodeURIComponent(t.family)}`,className:`text-sm font-medium font-mono truncate hover:underline`,children:t.family}),(0,G.jsxs)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:[t.dimensions,`d`]}),t.maxInputTokens&&(0,G.jsx)(`span`,{className:`text-[11px] text-muted-foreground/70 tabular-nums`,children:e(`embeddings.tokMax`,{tokens:UI(t.maxInputTokens)})}),t.family===p?(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-primary text-primary-foreground font-medium`,children:e(`embeddings.defaultBadge`)}):(0,G.jsx)(`button`,{onClick:()=>a(t.family),className:`text-[11px] text-muted-foreground hover:text-foreground underline decoration-dotted underline-offset-2 transition-colors`,children:e(`embeddings.makeDefault`)})]}),(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:n?(0,G.jsxs)(G.Fragment,{children:[e(`embeddings.usageToday`,{count:n.requestsToday}),` · `,e(`embeddings.usageMonth`,{count:UI(n.tokensMonth)})]}):`—`})]}),(0,G.jsx)(JF,{sensors:_,collisionDetection:MP,onDragEnd:e=>y(t.family,e),children:(0,G.jsx)(rI,{items:t.providers.map(e=>e.id),strategy:eI,children:(0,G.jsx)(`div`,{className:`divide-y`,children:t.providers.map((e,n)=>(0,G.jsx)(eoe,{provider:e,index:n,count:t.providers.length,onMove:e=>g(t.family,n,e),onToggle:n=>h(t.family,e.id,{enabled:n}),onDelete:()=>d.mutate(e.id),deleting:d.isPending},e.id))})})})]},t.family)}),(0,G.jsxs)(xI,{show:m,children:[(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`embeddings.unsavedChanges`)}),(0,G.jsx)(J,{variant:`outline`,size:`sm`,onClick:x,children:e(`common.discard`)}),(0,G.jsx)(J,{size:`sm`,onClick:b,disabled:u.isPending,children:u.isPending?e(`embeddings.savingChanges`):e(`embeddings.saveChanges`)})]})]})]})}function WI(e){let t=new Map;for(let n of e){let e=t.get(n.displayName);e?e.push(n):t.set(n.displayName,[n])}return[...t.entries()].map(([e,t])=>({label:e,slug:encodeURIComponent(e),members:t})).sort((e,t)=>e.label.localeCompare(t.label))}function noe({group:e,detailBase:t,onToggle:n,onDeleteCustom:r,deletePending:i}){let{t:a}=Z(),o=e.members.some(e=>e.enabled),s=e.members.map(e=>e.quotaLabel).find(Boolean);return(0,G.jsxs)(`section`,{className:`rounded-3xl border bg-card p-5 ${o?``:`opacity-60`}`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(gn,{to:`${t}/${e.slug}`,className:`text-sm font-medium hover:underline`,children:e.label}),e.members.length>1?(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground`,children:a(`models.providerCount`,{count:e.members.length})}):(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.members[0].platform}),s&&(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:s})]}),(0,G.jsx)(`div`,{className:`divide-y`,children:e.members.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-3 py-2 ${e.enabled?``:`opacity-50`}`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium`,children:e.platform}),e.keyCount===0&&(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-amber-600/15 text-amber-700 dark:bg-amber-400/15 dark:text-amber-400`,children:a(`models.noKey`)})]}),(0,G.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.modelId})]}),(0,G.jsx)(xD,{checked:e.enabled,onCheckedChange:t=>n(e.id,t)}),e.isCustom&&(0,G.jsx)(gO,{className:`text-muted-foreground hover:text-destructive`,onConfirm:()=>r(e.id),disabled:i,children:a(`common.remove`)})]},e.id))})]})}function GI({modality:e}){let{t}=Z(),n=Rr(),{data:r,isLoading:i}=$r({queryKey:[`media`],queryFn:()=>X(`/api/media`)}),{data:a}=$r({queryKey:[`media`,`usage`,e],queryFn:()=>X(`/api/media/usage?modality=${e}`),refetchInterval:3e4}),{data:o}=$r({queryKey:[`media`,`usage`,`transcription`],queryFn:()=>X(`/api/media/usage?modality=transcription`),enabled:e===`audio`,refetchInterval:3e4}),s=ei({mutationFn:({id:e,enabled:t})=>X(`/api/media/${e}`,{method:`PUT`,body:JSON.stringify({enabled:t})}),onSuccess:()=>n.invalidateQueries({queryKey:[`media`]})}),c=ei({mutationFn:e=>X(`/api/media/custom/${e}`,{method:`DELETE`}),onSuccess:()=>n.invalidateQueries({queryKey:[`media`]})}),l=r?.models??[],u=WI(l.filter(t=>t.modality===e)),d=WI(l.filter(e=>e.modality===`transcription`)),f=t(`models.title`),p=t(e===`image`?`models.imageDesc`:e===`video`?`models.videoDesc`:`models.audioDesc`),m=e===`image`?`/v1/images/generations`:e===`video`?`/v1/videos/generations`:`/v1/audio/speech`,h=(e,t)=>e.map(e=>(0,G.jsx)(noe,{group:e,detailBase:t,onToggle:(e,t)=>s.mutate({id:e,enabled:t}),onDeleteCustom:e=>c.mutate(e),deletePending:c.isPending},e.slug));return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:f,description:p,divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[e===`audio`&&(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:t(`models.ttsHeading`)}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`models.mediaHint`),` `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[11px]`,children:m})]}),a&&a.models.length>0&&(0,G.jsx)(HI,{unit:`requests`,total:a.totalRequestsMonth,requestsToday:a.totalRequestsToday,rows:a.models.map(e=>({label:e.displayName,platform:e.platform,quotaLabel:[e.platform,e.quotaLabel].filter(Boolean).join(` · `),amount:e.requestsMonth,requestsToday:e.requestsToday}))}),i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ik,{}),(0,G.jsx)(ik,{})]}):u.length===0?(0,G.jsx)($D,{icon:e===`image`?na:e===`video`?Ri:vi,title:t(`models.mediaEmpty`)}):h(u,`/models/${e}`)]}),e===`audio`&&(0,G.jsxs)(`div`,{className:`mt-10 space-y-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:t(`models.sttHeading`)}),(0,G.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`models.sttHint`),` `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[11px]`,children:`/v1/audio/transcriptions`})]}),o&&o.models.length>0&&(0,G.jsx)(HI,{rows:o.models.map(e=>({label:e.displayName,platform:e.platform,quotaLabel:[e.platform,e.quotaLabel].filter(Boolean).join(` · `),amount:e.requestsMonth,requestsToday:e.requestsToday})),total:o.totalRequestsMonth,requestsToday:o.totalRequestsToday,unit:`requests`}),i?(0,G.jsx)(ik,{}):d.length===0?(0,G.jsx)($D,{icon:ha,title:t(`models.sttEmpty`)}):h(d,`/models/transcription`)]})]})}function roe(){return(0,G.jsx)(GI,{modality:`image`})}function ioe(){return(0,G.jsx)(GI,{modality:`video`})}function aoe(){return(0,G.jsx)(GI,{modality:`audio`})}function KI({modality:e}){let{t}=Z(),{id:n}=at(),r=n?decodeURIComponent(n):``,i=Rr(),{data:a,isLoading:o}=$r({queryKey:[`media`],queryFn:()=>X(`/api/media`)}),{data:s}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)}),c=ei({mutationFn:e=>X(`/api/media/${e.mediaId}`,{method:`PUT`,body:JSON.stringify({enabled:e.enabled})}),onSuccess:()=>i.invalidateQueries({queryKey:[`media`]})}),l=(a?.models??[]).filter(t=>t.modality===e&&t.displayName===r),u=l.map(e=>e.quotaLabel).find(Boolean),d=l[0]?.modelId??`auto`,f=yv(),p=s?.apiKey||`YOUR_API_KEY`,m=e===`image`?`curl ${f}/images/generations \\
81
+ -H "Authorization: Bearer ${p}" \\
82
+ -H "Content-Type: application/json" \\
83
+ -d '{
84
+ "model": "${d}",
85
+ "prompt": "a red cat"
86
+ }'`:e===`video`?`curl ${f}/videos/generations \\
87
+ -H "Authorization: Bearer ${p}" \\
88
+ -H "Content-Type: application/json" \\
89
+ -d '{
90
+ "model": "${d}",
91
+ "prompt": "a sunrise over a quiet lake"
92
+ }' --output video.mp4`:e===`transcription`?`curl ${f}/audio/transcriptions \\
93
+ -H "Authorization: Bearer ${p}" \\
94
+ -F file=@audio.mp3 \\
95
+ -F model="${d}"`:`curl ${f}/audio/speech \\
96
+ -H "Authorization: Bearer ${p}" \\
97
+ -H "Content-Type: application/json" \\
98
+ -d '{
99
+ "model": "${d}",
100
+ "input": "Hello world"
101
+ }' --output speech.mp3`;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:r||t(`models.providersHeading`),description:t(`models.providersHeading`),divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(gn,{to:e===`transcription`?`/models/audio`:`/models/${e}`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)(Ei,{className:`size-4`}),t(`models.backToModels`)]}),o?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`common.loading`)}):l.length===0?(0,G.jsx)(`div`,{className:`rounded-3xl border border-dashed p-6 sm:p-8 text-center`,children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`models.modelNotFound`)})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(`span`,{className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground`,children:t(`models.providerCount`,{count:l.length})}),u&&(0,G.jsx)(`span`,{className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:u})]}),(0,G.jsxs)(`div`,{className:`rounded-2xl border bg-card p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:t(`models.providerIdsHeading`)}),(0,G.jsx)(`p`,{className:`mt-0.5 mb-3 text-xs text-muted-foreground`,children:t(`models.providerIdsHint`)}),(0,G.jsx)(`div`,{className:`space-y-1.5`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs ${e.enabled?``:`opacity-50`}`,children:[(0,G.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground sm:w-28`,children:e.platform}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[11px]`,children:e.modelId}),e.keyCount===0&&(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-amber-600/15 text-amber-700 dark:bg-amber-400/15 dark:text-amber-400`,children:t(`models.noKey`)}),(0,G.jsx)(vv,{text:e.modelId,label:t(`models.copyModelName`)}),(0,G.jsx)(xD,{checked:e.enabled,onCheckedChange:t=>c.mutate({mediaId:e.id,enabled:t})})]},e.id))})]}),(0,G.jsx)(bv,{snippet:m})]})]})]})}function ooe(){let{t:e}=Z(),{id:t}=at(),n=t?decodeURIComponent(t):``,{data:r,isLoading:i}=$r({queryKey:[`embeddings`],queryFn:()=>X(`/api/embeddings`)}),{data:a}=$r({queryKey:[`unified-key`],queryFn:()=>X(`/api/settings/api-key`)}),o=(r?.families??[]).find(e=>e.family===n),s=`curl ${yv()}/embeddings \\
102
+ -H "Authorization: Bearer ${a?.apiKey||`YOUR_API_KEY`}" \\
103
+ -H "Content-Type: application/json" \\
104
+ -d '{
105
+ "model": "${n}",
106
+ "input": "hello world"
107
+ }'`;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:n||e(`models.providersHeading`),description:e(`models.providersHeading`),divider:!1,tabs:(0,G.jsx)(SI,{})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(gn,{to:`/models/embeddings`,className:`inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground`,children:[(0,G.jsx)(Ei,{className:`size-4`}),e(`models.backToModels`)]}),i?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(`span`,{className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground`,children:e(`models.providerCount`,{count:o.providers.length})}),(0,G.jsxs)(`span`,{className:`text-[11px] rounded-full px-2 py-0.5 bg-muted text-muted-foreground tabular-nums`,children:[o.dimensions,`d`]})]}),(0,G.jsxs)(`div`,{className:`rounded-2xl border bg-card p-4`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`models.providerIdsHeading`)}),(0,G.jsx)(`p`,{className:`mt-0.5 mb-3 text-xs text-muted-foreground`,children:e(`models.providerIdsHint`)}),(0,G.jsx)(`div`,{className:`space-y-1.5`,children:o.providers.map(t=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs ${t.enabled?``:`opacity-50`}`,children:[(0,G.jsx)(`span`,{className:`w-28 shrink-0 text-muted-foreground`,children:t.platform}),(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[11px]`,children:t.modelId}),t.keyCount===0&&(0,G.jsx)(`span`,{className:`text-[10px] rounded-full px-1.5 py-0.5 bg-amber-600/15 text-amber-700 dark:bg-amber-400/15 dark:text-amber-400`,children:e(`models.noKey`)}),(0,G.jsx)(vv,{text:t.modelId,label:e(`models.copyModelName`)})]},t.id))})]}),(0,G.jsx)(bv,{snippet:s})]}):(0,G.jsx)(`div`,{className:`rounded-3xl border border-dashed p-6 sm:p-8 text-center`,children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`models.modelNotFound`)})})]})]})}var soe=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function qI(e){return typeof e==`string`&&soe.includes(e)}var coe=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function JI(e){return typeof e==`string`&&coe.has(e)}function YI(e){return typeof e==`string`&&e.startsWith(`data-`)}function XI(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(JI(n)||YI(n))&&(t[n]=e[n]);return t}function ZI(e){if(e==null)return null;if((0,v.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return XI(t)}return typeof e==`object`&&!Array.isArray(e)?XI(e):null}function QI(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(JI(n)||YI(n)||qI(n))&&(t[n]=e[n]);return t}function loe(e){return e==null?null:(0,v.isValidElement)(e)?QI(e.props):typeof e==`object`&&!Array.isArray(e)?QI(e):null}var uoe=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function $I(){return $I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$I.apply(null,arguments)}function doe(e,t){if(e==null)return{};var n,r,i=foe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function foe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eL=(0,v.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=doe(e,uoe),d=a||{width:r,height:i,x:0,y:0},f=ys(`recharts-surface`,o);return v.createElement(`svg`,$I({},QI(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),v.createElement(`title`,null,c),v.createElement(`desc`,null,l),n)}),poe=[`children`,`className`];function tL(){return tL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tL.apply(null,arguments)}function moe(e,t){if(e==null)return{};var n,r,i=hoe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hoe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nL=v.forwardRef((e,t)=>{var{children:n,className:r}=e,i=moe(e,poe),a=ys(`recharts-layer`,r);return v.createElement(`g`,tL({className:a},QI(i),{ref:t}),n)}),rL=(0,v.createContext)(null),goe=()=>(0,v.useContext)(rL);function iL(e){return function(){return e}}var aL=Math.cos,oL=Math.sin,sL=Math.sqrt,cL=Math.PI;cL/2;var lL=2*cL,uL=Math.PI,dL=2*uL,fL=1e-6,_oe=dL-fL;function pL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function voe(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return pL;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var mL=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?pL:voe(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>fL){if(!(Math.abs(u*s-c*l)>fL)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((uL-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>fL&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>fL||Math.abs(this._y1-l)>fL)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%dL+dL),d>_oe?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>fL&&this._append`A${n},${n},0,${+(d>=uL)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};mL.prototype;function hL(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new mL(t)}Array.prototype.slice;function gL(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _L(e){this._context=e}_L.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function vL(e){return new _L(e)}function yL(e){return e[0]}function bL(e){return e[1]}function xL(e,t){var n=iL(!0),r=null,i=vL,a=null,o=hL(s);e=typeof e==`function`?e:e===void 0?yL:iL(e),t=typeof t==`function`?t:t===void 0?bL:iL(t);function s(s){var c,l=(s=gL(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:iL(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:iL(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:iL(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function SL(e,t,n){var r=null,i=iL(!0),a=null,o=vL,s=null,c=hL(l);e=typeof e==`function`?e:e===void 0?yL:iL(+e),t=typeof t==`function`?t:iL(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?bL:iL(+n);function l(l){var u,d,f,p=(l=gL(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return xL().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:iL(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:iL(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:iL(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:iL(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:iL(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:iL(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:iL(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var CL=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function yoe(e){return new CL(e,!0)}function boe(e){return new CL(e,!1)}var wL={draw(e,t){let n=sL(t/cL);e.moveTo(n,0),e.arc(0,0,n,0,lL)}},xoe={draw(e,t){let n=sL(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},TL=sL(1/3),Soe=TL*2,Coe={draw(e,t){let n=sL(t/Soe),r=n*TL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},woe={draw(e,t){let n=sL(t),r=-n/2;e.rect(r,r,n,n)}},Toe=.8908130915292852,EL=oL(cL/10)/oL(7*cL/10),Eoe=oL(lL/10)*EL,Doe=-aL(lL/10)*EL,Ooe={draw(e,t){let n=sL(t*Toe),r=Eoe*n,i=Doe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=lL*t/5,o=aL(a),s=oL(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},DL=sL(3),koe={draw(e,t){let n=-sL(t/(DL*3));e.moveTo(0,n*2),e.lineTo(-DL*n,-n),e.lineTo(DL*n,-n),e.closePath()}},OL=-.5,kL=sL(3)/2,AL=1/sL(12),Aoe=(AL/2+1)*3,joe={draw(e,t){let n=sL(t/Aoe),r=n/2,i=n*AL,a=r,o=n*AL+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(OL*r-kL*i,kL*r+OL*i),e.lineTo(OL*a-kL*o,kL*a+OL*o),e.lineTo(OL*s-kL*c,kL*s+OL*c),e.lineTo(OL*r+kL*i,OL*i-kL*r),e.lineTo(OL*a+kL*o,OL*o-kL*a),e.lineTo(OL*s+kL*c,OL*c-kL*s),e.closePath()}};function Moe(e,t){let n=null,r=hL(i);e=typeof e==`function`?e:iL(e||wL),t=typeof t==`function`?t:iL(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:iL(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:iL(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function jL(){}function ML(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function NL(e){this._context=e}NL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ML(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ML(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Noe(e){return new NL(e)}function PL(e){this._context=e}PL.prototype={areaStart:jL,areaEnd:jL,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ML(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Poe(e){return new PL(e)}function FL(e){this._context=e}FL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ML(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Foe(e){return new FL(e)}function IL(e){this._context=e}IL.prototype={areaStart:jL,areaEnd:jL,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ioe(e){return new IL(e)}function LL(e){return e<0?-1:1}function RL(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(LL(a)+LL(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function zL(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function BL(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function VL(e){this._context=e}VL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:BL(this,this._t0,zL(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,BL(this,zL(this,n=RL(this,e,t)),n);break;default:BL(this,this._t0,n=RL(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function HL(e){this._context=new UL(e)}(HL.prototype=Object.create(VL.prototype)).point=function(e,t){VL.prototype.point.call(this,t,e)};function UL(e){this._context=e}UL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function WL(e){return new VL(e)}function GL(e){return new HL(e)}function KL(e){this._context=e}KL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=qL(e),i=qL(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function qL(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function JL(e){return new KL(e)}function YL(e,t){this._context=e,this._t=t}YL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function XL(e){return new YL(e,.5)}function ZL(e){return new YL(e,0)}function QL(e){return new YL(e,1)}function $L(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function eR(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function tR(e,t){return e[t]}function nR(e){let t=[];return t.key=e,t}function rR(){var e=iL([]),t=eR,n=$L,r=tR;function i(i){var a=Array.from(e.apply(this,arguments),nR),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=gL(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:iL(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:iL(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?eR:typeof e==`function`?e:iL(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??$L,i):n},i}function iR(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}$L(e,t)}}function aR(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}$L(e,t)}}function oR(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,$L(e,t)}}var sR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),cR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),lR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}e.toKey=t})),uR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),dR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=uR(),n=lR();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),fR=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=sR(),n=cR(),r=lR(),i=dR();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),pR=o(((e,t)=>{t.exports=fR().get})),mR=4;function hR(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:mR),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function gR(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+hR(i)+n},``)}var _R=l(pR()),vR=e=>e===0?0:e>0?1:-1,yR=e=>typeof e==`number`&&e!=+e,bR=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,xR=e=>(typeof e==`number`||e instanceof Number)&&!yR(e),SR=e=>xR(e)||typeof e==`string`,CR=0,wR=e=>{var t=++CR;return`${e||``}${t}`},TR=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!xR(e)&&typeof e!=`string`)return n;var i;if(bR(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return yR(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},ER=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function DR(e,t,n){return xR(e)&&xR(t)?hR(e+n*(t-e)):t}function OR(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,_R.default)(e,t))===n)}var kR=e=>e==null,AR=e=>kR(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function jR(e){return e!=null}function MR(){}var NR=[`type`,`size`,`sizeType`];function PR(){return PR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PR.apply(null,arguments)}function FR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function IR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FR(Object(n),!0).forEach(function(t){LR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LR(e,t,n){return(t=RR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RR(e){var t=zR(e,`string`);return typeof t==`symbol`?t:t+``}function zR(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function BR(e,t){if(e==null)return{};var n,r,i=VR(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VR(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var HR={symbolCircle:wL,symbolCross:xoe,symbolDiamond:Coe,symbolSquare:woe,symbolStar:Ooe,symbolTriangle:koe,symbolWye:joe},UR=Math.PI/180,WR=e=>HR[`symbol${AR(e)}`]||wL,GR=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*UR;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},KR=(e,t)=>{HR[`symbol${AR(e)}`]=t},qR=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=IR(IR({},BR(e,NR)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=WR(a),t=Moe().type(e).size(GR(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=QI(i);return xR(c)&&xR(l)&&xR(n)?v.createElement(`path`,PR({},u,{className:ys(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};qR.registerSymbol=KR;var JR=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,YR=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,v.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{qI(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},XR=(e,t,n)=>r=>(e(t,n,r),null),ZR=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];qI(i)&&typeof a==`function`&&(r||={},r[i]=XR(a,t,n))}),r};function QR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QR(Object(n),!0).forEach(function(t){ez(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ez(e,t,n){return(t=tz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tz(e){var t=nz(e,`string`);return typeof t==`symbol`?t:t+``}function nz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rz(e,t){var n=$R({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function iz(){return iz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iz.apply(null,arguments)}function az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?az(Object(n),!0).forEach(function(t){sz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):az(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sz(e,t,n){return(t=cz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cz(e){var t=lz(e,`string`);return typeof t==`symbol`?t:t+``}function lz(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var uz=32,dz={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function fz(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function pz(e){var{data:t,iconType:n,inactiveColor:r}=e,i=uz/2,a=uz/6,o=uz/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return v.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:fz(t.payload),x1:0,y1:i,x2:uz,y2:i,className:`recharts-legend-icon`});if(c===`line`)return v.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o}
108
+ A${a},${a},0,1,1,${2*o},${i}
109
+ H${uz}M${2*o},${i}
110
+ A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return v.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${uz/8}h${uz}v${uz*3/4}h${-uz}z`,className:`recharts-legend-icon`});if(v.isValidElement(t.legendIcon)){var l=oz({},t);return delete l.legendIcon,v.cloneElement(t.legendIcon,l)}return v.createElement(qR,{fill:s,cx:i,cy:i,size:uz,sizeType:`diameter`,type:c})}function mz(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:uz,height:uz},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=ys({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?oz({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return v.createElement(`li`,iz({className:f,style:l,key:`legend-item-${r}`},ZR(e,t,r)),v.createElement(eL,{width:n,height:n,viewBox:c,style:u,"aria-label":`${t.value} legend icon`},v.createElement(pz,{data:t,iconType:o,inactiveColor:a})),v.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var hz=e=>{var t=rz(e,dz),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return v.createElement(`ul`,{className:`recharts-default-legend`,style:a},v.createElement(mz,iz({},t,{payload:n})))},gz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),_z=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),vz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),yz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),bz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=yz();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),xz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),Sz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=bz(),n=xz();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),Cz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=fR();function n(e){return function(n){return t.get(n,e)}}e.property=n})),wz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),Tz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),Ez=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),Dz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=wz(),n=Tz(),r=Ez();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n!=`string`||n===``:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!n.isPrimitive(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!r(e[s],t[s],s,e,t,i))return!1}return!0}finally{i?.delete(t)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0||e instanceof Set&&c([...e],[...t],n,r)}e.isMatchWith=i,e.isSetMatch=l})),Oz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Dz();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),kz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),Az=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),jz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),Mz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.globalThis=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)()})),Nz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Mz();function n(e){return t.globalThis.Buffer!==void 0&&t.globalThis.Buffer.isBuffer(e)}e.isBuffer=n})),Pz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),Fz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=kz(),n=Az(),r=jz(),i=Nz(),a=Tz(),o=Pz();function s(e,t){return c(e,void 0,e,new Map,t)}function c(e,t,n,r=new Map,s=void 0){let d=s?.(e,t,n,r);if(d!==void 0)return d;if(a.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=c(e[i],i,n,r,s);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[i,a]of e)t.set(i,c(a,i,n,r,s));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let i of e)t.add(c(i,void 0,n,r,s));return t}if(i.isBuffer(e))return e.subarray();if(o.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=c(e[i],i,n,r,s);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),l(t,e,n,r,s),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),l(t,e,n,r,s),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),l(t,e,n,r,s),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,l(t,e,n,r,s),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),l(t,e,n,r,s),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),l(t,e,n,r,s),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),l(t,e,n,r,s),t}if(typeof e==`object`&&u(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),l(t,e,n,r,s),t}return e}function l(e,n,r=e,i,a){let o=[...Object.keys(n),...t.getSymbols(n)];for(let t=0;t<o.length;t++){let s=o[t],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=c(n[s],s,r,i,a))}}function u(e){switch(n.getTag(e)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=c,e.copyProperties=l})),Iz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Fz();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),Lz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Oz(),n=Iz();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),Rz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Fz(),n=Az(),r=jz();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),zz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Rz();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),Bz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),Vz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Az();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),Hz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cR(),n=Bz(),r=Vz(),i=dR();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||r.isArguments(s))&&n.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),Uz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Oz(),n=lR(),r=zz(),i=fR(),a=Hz();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e)}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),Wz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=vz(),n=Cz(),r=Lz(),i=Uz();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),Gz=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gz(),n=_z(),r=vz(),i=Sz(),a=Wz();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),Kz=l(o(((e,t)=>{t.exports=Gz().uniqBy}))());function qz(e,t,n){return t===!0?(0,Kz.default)(e,n):typeof t==`function`?(0,Kz.default)(e,t):e}var Jz=(0,v.createContext)(null),Yz=e=>e,Xz=()=>{var e=(0,v.useContext)(Jz);return e?e.store.dispatch:Yz},Zz=()=>{},Qz=()=>Zz,$z=(e,t)=>e===t;function eB(e){var t=(0,v.useContext)(Jz),n=(0,v.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:Zz,[t,e]);return(0,Am.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Qz,t?t.store.getState:Zz,t?t.store.getState:Zz,n,$z)}function tB(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function nB(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function rB(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var iB=e=>Array.isArray(e)?e:[e];function aB(e){let t=Array.isArray(e[0])?e[0]:e;return rB(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function oB(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var sB=class{constructor(e){this.value=e}deref(){return this.value}},cB=typeof WeakRef<`u`?WeakRef:sB,lB=0,uB=1;function dB(){return{s:lB,v:void 0,o:null,p:null}}function fB(e,t={}){let n=dB(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=dB(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=dB(),e.set(n,t)):t=r}}let s=t,c;if(t.s===uB)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new cB(c):c}return s.s=uB,s.v=c,c}return o.clearCache=()=>{n=dB(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function pB(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),tB(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=fB,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=iB(c),p=iB(u),m=aB(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=oB(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=pB(fB),mB=Object.assign((e,t=$)=>{nB(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>mB}),hB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),gB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),_B=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gB(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),vB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=hB(),n=_B(),r=dR();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;r<l.length;r++){let i=t.compareValues(e.criteria[r],n.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),yB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),bB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Bz(),n=bz(),r=wz(),i=Ez();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?i.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),xB=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=vB(),n=yB(),r=bB();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),SB=l(o(((e,t)=>{t.exports=xB().sortBy}))()),CB=e=>e.legend.settings,wB=e=>e.legend.size,TB=$([e=>e.legend.payload,CB],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,SB.default)(r,n):r});function EB(){return eB(TB)}var DB=1;function OB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,v.useState)({height:0,left:0,top:0,width:0});return[t,(0,v.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>DB||Math.abs(i.left-t.left)>DB||Math.abs(i.top-t.top)>DB||Math.abs(i.width-t.width)>DB)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function kB(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var AB=typeof Symbol==`function`&&Symbol.observable||`@@observable`,jB=()=>Math.random().toString(36).substring(7).split(``).join(`.`),MB={INIT:`@@redux/INIT${jB()}`,REPLACE:`@@redux/REPLACE${jB()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jB()}`};function NB(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function PB(e,t,n){if(typeof e!=`function`)throw Error(kB(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(kB(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(kB(1));return n(PB)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(kB(3));return i}function d(e){if(typeof e!=`function`)throw Error(kB(4));if(c)throw Error(kB(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(kB(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!NB(e))throw Error(kB(7));if(e.type===void 0)throw Error(kB(8));if(typeof e.type!=`string`)throw Error(kB(17));if(c)throw Error(kB(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(kB(10));r=e,f({type:MB.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(kB(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[AB](){return this}}}return f({type:MB.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[AB]:m}}function FB(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:MB.INIT})===void 0)throw Error(kB(12));if(n(void 0,{type:MB.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(kB(13))})}function IB(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{FB(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(kB(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function LB(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function RB(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(kB(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=LB(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function zB(e){return NB(e)&&`type`in e&&typeof e.type==`string`}var BB=Symbol.for(`immer-nothing`),VB=Symbol.for(`immer-draftable`),HB=Symbol.for(`immer-state`);function UB(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var WB=Object,GB=WB.getPrototypeOf,KB=`constructor`,qB=`prototype`,JB=`configurable`,YB=`enumerable`,XB=`writable`,ZB=`value`,QB=e=>!!e&&!!e[HB];function $B(e){return e?nV(e)||lV(e)||!!e[VB]||!!e[KB]?.[VB]||uV(e)||dV(e):!1}var eV=WB[qB][KB].toString(),tV=new WeakMap;function nV(e){if(!e||!fV(e))return!1;let t=GB(e);if(t===null||t===WB[qB])return!0;let n=WB.hasOwnProperty.call(t,KB)&&t[KB];if(n===Object)return!0;if(!pV(n))return!1;let r=tV.get(n);return r===void 0&&(r=Function.toString.call(n),tV.set(n,r)),r===eV}function rV(e,t,n=!0){iV(e)===0?(n?Reflect.ownKeys(e):WB.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function iV(e){let t=e[HB];return t?t.type_:lV(e)?1:uV(e)?2:dV(e)?3:0}var aV=(e,t,n=iV(e))=>n===2?e.has(t):WB[qB].hasOwnProperty.call(e,t),oV=(e,t,n=iV(e))=>n===2?e.get(t):e[t],sV=(e,t,n,r=iV(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function cV(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var lV=Array.isArray,uV=e=>e instanceof Map,dV=e=>e instanceof Set,fV=e=>typeof e==`object`,pV=e=>typeof e==`function`,mV=e=>typeof e==`boolean`;function hV(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var gV=e=>e.copy_||e.base_,_V=e=>e.modified_?e.copy_:e.base_;function vV(e,t){if(uV(e))return new Map(e);if(dV(e))return new Set(e);if(lV(e))return Array[qB].slice.call(e);let n=nV(e);if(t===!0||t===`class_only`&&!n){let t=WB.getOwnPropertyDescriptors(e);delete t[HB];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[XB]===!1&&(a[XB]=!0,a[JB]=!0),(a.get||a.set)&&(t[i]={[JB]:!0,[XB]:!0,[YB]:a[YB],[ZB]:e[i]})}return WB.create(GB(e),t)}{let t=GB(e);if(t!==null&&n)return{...e};let r=WB.create(t);return WB.assign(r,e)}}function yV(e,t=!1){return SV(e)||QB(e)||!$B(e)?e:(iV(e)>1&&WB.defineProperties(e,{set:xV,add:xV,clear:xV,delete:xV}),WB.freeze(e),t&&rV(e,(e,t)=>{yV(t,!0)},!1),e)}function bV(){UB(2)}var xV={[ZB]:bV};function SV(e){return e===null||!fV(e)||WB.isFrozen(e)}var CV=`MapSet`,wV=`Patches`,TV=`ArrayMethods`,EV={};function DV(e){let t=EV[e];return t||UB(0,e),t}var OV=e=>!!EV[e],kV,AV=()=>kV,jV=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:OV(CV)?DV(CV):void 0,arrayMethodsPlugin_:OV(TV)?DV(TV):void 0});function MV(e,t){t&&(e.patchPlugin_=DV(wV),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function NV(e){PV(e),e.drafts_.forEach(IV),e.drafts_=null}function PV(e){e===kV&&(kV=e.parent_)}var FV=e=>kV=jV(kV,e);function IV(e){let t=e[HB];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function LV(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[HB].modified_&&(NV(t),UB(4)),$B(e)&&(e=RV(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[HB].base_,e,t)}else e=RV(t,n);return zV(t,e,!0),NV(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===BB?void 0:e}function RV(e,t){if(SV(t))return t;let n=t[HB];if(!n)return qV(t,e.handledSet_,e);if(!VV(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);GV(n,e)}return n.copy_}function zV(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yV(t,n)}function BV(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var VV=(e,t)=>e.scope_===t,HV=[];function UV(e,t,n,r){let i=gV(e),a=e.type_;if(r!==void 0&&oV(i,r,a)===t){sV(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;rV(i,(e,n)=>{if(QB(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??HV;for(let e of o)sV(i,e,n,a)}function WV(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!VV(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=_V(i);UV(e,i.draft_??i,a,n),GV(i,r)})}function GV(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}BV(e)}}function KV(e,t,n){let{scope_:r}=e;if(QB(n)){let i=n[HB];VV(i,r)&&i.callbacks_.push(function(){tH(e),UV(e,n,_V(i),t)})}else $B(n)&&e.callbacks_.push(function(){let i=gV(e);e.type_===3?i.has(n)&&qV(n,r.handledSet_,r):oV(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&qV(oV(e.copy_,t,e.type_),r.handledSet_,r)})}function qV(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||QB(e)||t.has(e)||!$B(e)||SV(e)?e:(t.add(e),rV(e,(r,i)=>{if(QB(i)){let t=i[HB];VV(t,n)&&(sV(e,r,_V(t),e.type_),BV(t))}else $B(i)&&qV(i,t,n)}),e)}function JV(e,t){let n=lV(e),r={type_:+!!n,scope_:t?t.scope_:AV(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=YV;n&&(i=[r],a=XV);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var YV={get(e,t){if(t===HB)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=gV(e);if(!aV(i,t,e.type_))return QV(e,i,t);let a=i[t];if(e.finalized_||!$B(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&hV(t))return a;if(a===ZV(e.base_,t)){tH(e);let n=e.type_===1?+t:t,r=rH(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in gV(e)},ownKeys(e){return Reflect.ownKeys(gV(e))},set(e,t,n){let r=$V(gV(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=ZV(gV(e),t),i=r?.[HB];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(cV(n,r)&&(n!==void 0||aV(e.base_,t,e.type_)))return!0;tH(e),eH(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),KV(e,t,n),!0)},deleteProperty(e,t){return tH(e),ZV(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),eH(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=gV(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[XB]:!0,[JB]:e.type_!==1||t!==`length`,[YB]:r[YB],[ZB]:n[t]}},defineProperty(){UB(11)},getPrototypeOf(e){return GB(e.base_)},setPrototypeOf(){UB(12)}},XV={};for(let e in YV){let t=YV[e];XV[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}XV.deleteProperty=function(e,t){return XV.set.call(this,e,t,void 0)},XV.set=function(e,t,n){return YV.set.call(this,e[0],t,n,e[0])};function ZV(e,t){let n=e[HB];return(n?gV(n):e)[t]}function QV(e,t,n){let r=$V(t,n);return r?ZB in r?r[ZB]:r.get?.call(e.draft_):void 0}function $V(e,t){if(!(t in e))return;let n=GB(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=GB(n)}}function eH(e){e.modified_||(e.modified_=!0,e.parent_&&eH(e.parent_))}function tH(e){e.copy_||=(e.assigned_=new Map,vV(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nH=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(pV(e)&&!pV(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}pV(t)||UB(6),n!==void 0&&!pV(n)&&UB(7);let r;if($B(e)){let i=FV(this),a=rH(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?NV(i):PV(i)}return MV(i,n),LV(r,i)}if(!e||!fV(e)){if(r=t(e),r===void 0&&(r=e),r===BB&&(r=void 0),this.autoFreeze_&&yV(r,!0),n){let t=[],i=[];DV(wV).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}UB(1,e)},this.produceWithPatches=(e,t)=>{if(pV(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},mV(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),mV(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),mV(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){$B(e)||UB(8),QB(e)&&(e=iH(e));let t=FV(this),n=rH(t,e,void 0);return n[HB].isManual_=!0,PV(t),n}finishDraft(e,t){let n=e&&e[HB];(!n||!n.isManual_)&&UB(9);let{scope_:r}=n;return MV(r,t),LV(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=DV(wV).applyPatches_;return QB(e)?r(e,t):this.produce(e,e=>r(e,t))}};function rH(e,t,n,r){let[i,a]=uV(t)?DV(CV).proxyMap_(t,n):dV(t)?DV(CV).proxySet_(t,n):JV(t,n);return(n?.scope_??AV()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?WV(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function iH(e){return QB(e)||UB(10,e),aH(e)}function aH(e){if(!$B(e)||SV(e))return e;let t=e[HB],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=vV(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=vV(e,!0);return rV(n,(e,t)=>{sV(n,e,aH(t))},r),t&&(t.finalized_=!1),n}var oH=new nH().produce;function sH(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var cH=sH(),lH=sH,uH=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?LB:LB.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function dH(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(bU(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>zB(t)&&t.type===e,n}var fH=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function pH(e){return $B(e)?oH(e,()=>{}):e}function mH(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function hH(e){return typeof e==`boolean`}var gH=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new fH;return t&&(hH(t)?a.push(cH):a.push(lH(t.extraArgument))),a},_H=`RTK_autoBatch`,vH=()=>e=>({payload:e,meta:{[_H]:!0}}),yH=e=>t=>{setTimeout(t,e)},bH=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},xH=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?bH(window.requestAnimationFrame,100):yH(10):e.type===`callback`?e.queueNotification:yH(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[_H],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},SH=e=>function(t){let{autoBatch:n=!0}=t??{},r=new fH(e);return n&&r.push(xH(typeof n==`object`?n:void 0)),r};function CH(e){let t=gH(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(NB(n))c=IB(n);else throw Error(bU(1));let l;l=typeof r==`function`?r(t):t();let u=LB;i&&(u=uH({trace:!1,...typeof i==`object`&&i}));let d=SH(RB(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return PB(c,o,p)}function wH(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(bU(28));if(r in t)throw Error(bU(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function TH(e){return typeof e==`function`}function EH(e,t){let[n,r,i]=wH(t),a;if(TH(e))a=()=>pH(e());else{let t=pH(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(QB(e)){let r=n(e,t);return r===void 0?e:r}if($B(e))return oH(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}}return e},e)}return o.getInitialState=a,o}var DH=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,OH=(e=21)=>{let t=``,n=e;for(;n--;)t+=DH[Math.random()*64|0];return t},kH=Symbol.for(`rtk-slice-createasyncthunk`);function AH(e,t){return`${e}/${t}`}function jH({creators:e}={}){let t=e?.asyncThunk?.[kH];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(bU(11));let i=(typeof e.reducers==`function`?e.reducers(PH()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(bU(12));if(n in o.sliceCaseReducersByType)throw Error(bU(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:AH(n,r),createNotation:typeof e.reducers==`function`};IH(a)?RH(o,a,s,t):FH(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?wH(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return EH(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=mH(d,r,m)),i}function i(t=l){return mH(mH(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=MH(a,t,()=>mH(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function MH(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var NH=jH();function PH(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function FH({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!LH(r))throw Error(bU(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?dH(e,o):dH(e))}function IH(e){return e._reducerDefinitionType===`asyncThunk`}function LH(e){return e._reducerDefinitionType===`reducerWithPrepare`}function RH({type:e,reducerName:t},n,r,i){if(!i)throw Error(bU(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||zH,pending:s||zH,rejected:c||zH,settled:l||zH})}function zH(){}var BH=`task`,VH=`listener`,HH=`completed`,UH=`cancelled`,WH=`task-${UH}`,GH=`task-${HH}`,KH=`${VH}-${UH}`,qH=`${VH}-${HH}`,JH=class{constructor(e){this.code=e,this.message=`${BH} ${UH} (reason: ${e})`}code;name=`TaskAbortError`;message},YH=(e,t)=>{if(typeof e!=`function`)throw TypeError(bU(32))},XH=()=>{},ZH=(e,t=XH)=>(e.catch(t),e),QH=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),$H=e=>{if(e.aborted)throw new JH(e.reason)};function eU(e,t){let n=XH;return new Promise((r,i)=>{let a=()=>i(new JH(e.reason));if(e.aborted){a();return}n=QH(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=XH})}var tU=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof JH?`cancelled`:`rejected`,error:e}}finally{t?.()}},nU=e=>t=>ZH(eU(e,t).then(t=>($H(e),t))),rU=e=>{let t=nU(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:iU}=Object,aU={},oU=`listenerMiddleware`,sU=(e,t)=>{let n=t=>QH(e,()=>t.abort(e.reason));return(r,i)=>{YH(r,`taskExecutor`);let a=new AbortController;n(a);let o=tU(async()=>{$H(e),$H(a.signal);let t=await r({pause:nU(a.signal),delay:rU(a.signal),signal:a.signal});return $H(a.signal),t},()=>a.abort(GH));return i?.autoJoin&&t.push(o.catch(XH)),{result:nU(e)(o),cancel(){a.abort(WH)}}}},cU=(e,t)=>{let n=async(n,r)=>{$H(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await eU(t,Promise.race(a));return $H(t),e}finally{i()}};return((e,t)=>ZH(n(e,t)))},lU=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=dH(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(bU(21));return YH(a,`options.listener`),{predicate:i,type:t,effect:a}},uU=iU(e=>{let{type:t,predicate:n,effect:r}=lU(e);return{id:OH(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(bU(22))}}},{withTypes:()=>uU}),dU=(e,t)=>{let{type:n,effect:r,predicate:i}=lU(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},fU=e=>{e.pending.forEach(e=>{e.abort(KH)})},pU=(e,t)=>()=>{for(let e of t.keys())fU(e);e.clear()},mU=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},hU=iU(dH(`${oU}/add`),{withTypes:()=>hU}),gU=dH(`${oU}/removeAll`),_U=iU(dH(`${oU}/remove`),{withTypes:()=>_U}),vU=(...e)=>{console.error(`${oU}/error`,...e)},yU=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=vU}=e;YH(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&fU(e)}),c=(e=>{let n=dU(t,e)??uU(e);return s(n)});iU(c,{withTypes:()=>c});let l=e=>{let n=dU(t,e);return n&&(n.unsubscribe(),e.cancelActive&&fU(n)),!!n};iU(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=cU(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,iU({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:rU(u.signal),pause:nU(u.signal),extra:a,signal:u.signal,fork:sU(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(KH),n.delete(e))})},cancel:()=>{u.abort(KH),e.pending.delete(u)},throwIfCancelled:()=>{$H(u.signal)}})))}catch(e){e instanceof JH||mU(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(qH),i(e),e.pending.delete(u)}},d=pU(t,n);return{middleware:e=>n=>r=>{if(!zB(r))return n(r);if(hU.match(r))return c(r.payload);if(gU.match(r)){d();return}if(_U.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===aU)throw Error(bU(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,mU(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=aU}return s},startListening:c,stopListening:l,clearListeners:d}};function bU(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var xU=NH({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:SU,setLayout:CU,setChartSize:wU,setScale:TU}=xU.actions,EU=xU.reducer;function DU(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function OU(e){return Number.isFinite(e)}function kU(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function AU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AU(Object(n),!0).forEach(function(t){MU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MU(e,t,n){return(t=NU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NU(e){var t=PU(e,`string`);return typeof t==`symbol`?t:t+``}function PU(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function FU(e,t,n){return kR(e)||kR(t)?n:SR(t)?(0,_R.default)(e,t,n):typeof t==`function`?t(e):n}var IU=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&xR(e[a]))return jU(jU({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&xR(e[o]))return jU(jU({},e),{},{[o]:e[o]+(i||0)})}return e},LU=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,RU=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},zU=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?vR(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return OU(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(jR):c&&l?l.map((e,t)=>{var n=o.map(e);return OU(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(jR):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return OU(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(jR):o.domain().map((e,t)=>{var n=o.map(e);return OU(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(jR)},BU=(e,t)=>{if(!t||t.length!==2||!xR(t[0])||!xR(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!xR(e[0])||e[0]<n)&&(i[0]=n),(!xR(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},VU={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=yR(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:iR,none:$L,silhouette:aR,wiggle:oR,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=yR(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},HU=(e,t,n)=>{var r=VU[n]??$L,i=rR().keys(t).value((e,t)=>Number(FU(e,t,0))).order(eR).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=FU(e[i],t[r],0);Array.isArray(a)&&a.length===2&&xR(a[0])&&xR(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function UU(e){return e==null?void 0:String(e)}function WU(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!kR(i[t.dataKey])){var s=OR(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=FU(i,kR(o)?t.dataKey:o),l=t.scale.map(c);return xR(l)?l:null}var GU=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=FU(a,t.dataKey,t.scale.domain()[o]);if(kR(s))return null;var c=t.scale.map(s);return xR(c)?c-i/2+r:null},KU=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},qU=e=>{var t=e.flat(2).filter(xR);return[Math.min(...t),Math.max(...t)]},JU=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],YU=(e,t,n)=>{if(e!=null)return JU(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=qU(DU(r,t,n));return!OU(i[0])||!OU(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},XU=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ZU=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,QU=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,SB.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function $U(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return jU(jU({},t),{},{dataKey:n,payload:r,value:i,name:a})}function eW(e,t){if(e)return String(e);if(typeof t==`string`)return t}var tW=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},nW=(e,t)=>t===`centric`?e.angle:e.radius,rW=e=>e.layout.width,iW=e=>e.layout.height,aW=e=>e.layout.scale,oW=e=>e.layout.margin,sW=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),cW=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),lW=`data-recharts-item-index`;function uW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uW(Object(n),!0).forEach(function(t){fW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fW(e,t,n){return(t=pW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pW(e){var t=mW(e,`string`);return typeof t==`symbol`?t:t+``}function mW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hW=e=>e.brush.height;function gW(e){return cW(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function _W(e){return cW(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function vW(e){return sW(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function yW(e){return sW(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var bW=$([rW,iW,oW,hW,gW,_W,vW,yW,CB,wB],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=dW(dW({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=IU(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return dW(dW({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),xW=$(bW,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),SW=$(rW,iW,(e,t)=>({x:0,y:0,width:e,height:t})),CW=(0,v.createContext)(null),wW=()=>(0,v.useContext)(CW)!=null,TW=e=>e.brush,EW=$([TW,bW,oW],(e,t,n)=>({height:e.height,x:xR(e.x)?e.x:t.left,y:xR(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:xR(e.width)?e.width:t.width})),DW=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),OW=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=DW();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),kW=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=OW();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),AW=o(((e,t)=>{t.exports=kW().throttle})),jW=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},MW={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},NW=(e,t,n)=>{var{width:r=MW.width,height:i=MW.height,aspect:a,maxHeight:o}=n,s=bR(r)?e:Number(r),c=bR(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},PW={width:0,height:0,overflow:`visible`},FW={width:0,overflowX:`visible`},IW={height:0,overflowY:`visible`},LW={},RW=e=>{var{width:t,height:n}=e,r=bR(t),i=bR(n);return r&&i?PW:r?FW:i?IW:LW};function zW(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=MW.width,a=MW.height):i===void 0?i=r&&r>0?void 0:MW.width:a===void 0&&(a=r&&r>0?void 0:MW.height),{width:i,height:a}}var BW=l(AW());function VW(){return VW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VW.apply(null,arguments)}function HW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HW(Object(n),!0).forEach(function(t){WW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WW(e,t,n){return(t=GW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GW(e){var t=KW(e,`string`);return typeof t==`symbol`?t:t+``}function KW(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qW=(0,v.createContext)(MW.initialDimension);function JW(e){return kU(e.width)&&kU(e.height)}function YW(e){var{children:t,width:n,height:r}=e,i=(0,v.useMemo)(()=>({width:n,height:r}),[n,r]);return JW(i)?v.createElement(qW.Provider,{value:i},t):null}var XW=()=>(0,v.useContext)(qW),ZW=(0,v.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=MW.initialDimension,width:i,height:a,minWidth:o=MW.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=MW.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,v.useRef)(null),g=(0,v.useRef)();g.current=p,(0,v.useImperativeHandle)(t,()=>h.current);var[_,y]=(0,v.useState)({containerWidth:r.width,containerHeight:r.height}),b=(0,v.useCallback)((e,t)=>{y(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,v.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return MR;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;b(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=(0,BW.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return b(n,r),t.observe(h.current),()=>{t.disconnect()}},[b,u]);var{containerWidth:x,containerHeight:S}=_;jW(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:C,calculatedHeight:w}=NW(x,S,{width:i,height:a,aspect:n,maxHeight:c});return jW(C!=null&&C>0||w!=null&&w>0,`The width(%s) and height(%s) of chart should be greater than 0,
111
+ please check the style of container, or the props width(%s) and height(%s),
112
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
113
+ height and width.`,C,w,i,a,o,s,n),v.createElement(`div`,{id:d?`${d}`:void 0,className:ys(`recharts-responsive-container`,f),style:UW(UW({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},v.createElement(`div`,{style:RW({width:i,height:a})},v.createElement(YW,{width:C,height:w},l)))}),QW=(0,v.forwardRef)((e,t)=>{var n=XW();if(kU(n.width)&&kU(n.height))return e.children;var{width:r,height:i}=zW({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=NW(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return xR(a)&&xR(o)?v.createElement(YW,{width:a,height:o},e.children):v.createElement(ZW,VW({},e,{width:r,height:i,ref:t}))});function $W(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var eG=()=>{var e=wW(),t=eB(xW),n=eB(EW),r=eB(TW)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},tG={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},nG=()=>eB(bW)??tG,rG=()=>eB(rW),iG=()=>eB(iW),aG=()=>eB(e=>e.layout.margin),oG=e=>e.layout.layoutType,sG=()=>eB(oG),cG=()=>{var e=sG();if(e===`horizontal`||e===`vertical`)return e},lG=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},uG=()=>sG()!==void 0,dG=e=>{var t=Xz(),n=wW(),{width:r,height:i}=e,a=XW(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,v.useEffect)(()=>{!n&&kU(o)&&kU(s)&&t(wU({width:o,height:s}))},[t,n,o,s]),null},fG=Symbol.for(`immer-nothing`),pG=Symbol.for(`immer-draftable`),mG=Symbol.for(`immer-state`);function hG(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var gG=Object.getPrototypeOf;function _G(e){return!!e&&!!e[mG]}function vG(e){return e?xG(e)||Array.isArray(e)||!!e[pG]||!!e.constructor?.[pG]||DG(e)||OG(e):!1}var yG=Object.prototype.constructor.toString(),bG=new WeakMap;function xG(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;if(typeof n!=`function`)return!1;let r=bG.get(n);return r===void 0&&(r=Function.toString.call(n),bG.set(n,r)),r===yG}function SG(e,t,n=!0){CG(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function CG(e){let t=e[mG];return t?t.type_:Array.isArray(e)?1:DG(e)?2:OG(e)?3:0}function wG(e,t){return CG(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function TG(e,t,n){let r=CG(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function EG(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function DG(e){return e instanceof Map}function OG(e){return e instanceof Set}function kG(e){return e.copy_||e.base_}function AG(e,t){if(DG(e))return new Map(e);if(OG(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=xG(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[mG];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(gG(e),t)}{let t=gG(e);if(t!==null&&n)return{...e};let r=Object.create(t);return Object.assign(r,e)}}function jG(e,t=!1){return PG(e)||_G(e)||!vG(e)?e:(CG(e)>1&&Object.defineProperties(e,{set:NG,add:NG,clear:NG,delete:NG}),Object.freeze(e),t&&Object.values(e).forEach(e=>jG(e,!0)),e)}function MG(){hG(2)}var NG={value:MG};function PG(e){return typeof e!=`object`||!e||Object.isFrozen(e)}var FG={};function IG(e){let t=FG[e];return t||hG(0,e),t}var LG;function RG(){return LG}function zG(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function BG(e,t){t&&(IG(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function VG(e){HG(e),e.drafts_.forEach(WG),e.drafts_=null}function HG(e){e===LG&&(LG=e.parent_)}function UG(e){return LG=zG(LG,e)}function WG(e){let t=e[mG];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function GG(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[mG].modified_&&(VG(t),hG(4)),vG(e)&&(e=KG(t,e),t.parent_||JG(t,e)),t.patches_&&IG(`Patches`).generateReplacementPatches_(n[mG].base_,e,t.patches_,t.inversePatches_)):e=KG(t,n,[]),VG(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===fG?void 0:e}function KG(e,t,n){if(PG(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[mG];if(!i)return SG(t,(r,a)=>qG(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return JG(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),SG(a,(r,a)=>qG(e,i,t,r,a,n,o),r),JG(e,t,!1),n&&e.patches_&&IG(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function qG(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=PG(i);if(!(s&&!o)){if(_G(i)){let o=KG(e,i,a&&t&&t.type_!==3&&!wG(t.assigned_,r)?a.concat(r):void 0);if(TG(n,r,o),_G(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(vG(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;KG(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(DG(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&JG(e,i)}}}function JG(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jG(t,n)}function YG(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:RG(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=XG;n&&(i=[r],a=ZG);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var XG={get(e,t){if(t===mG)return e;let n=kG(e);if(!wG(n,t))return $G(e,n,t);let r=n[t];return e.finalized_||!vG(r)?r:r===QG(e.base_,t)?(nK(e),e.copy_[t]=iK(r,e)):r},has(e,t){return t in kG(e)},ownKeys(e){return Reflect.ownKeys(kG(e))},set(e,t,n){let r=eK(kG(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=QG(kG(e),t),i=r?.[mG];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(EG(n,r)&&(n!==void 0||wG(e.base_,t)))return!0;nK(e),tK(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return QG(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nK(e),tK(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=kG(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){hG(11)},getPrototypeOf(e){return gG(e.base_)},setPrototypeOf(){hG(12)}},ZG={};SG(XG,(e,t)=>{ZG[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),ZG.deleteProperty=function(e,t){return ZG.set.call(this,e,t,void 0)},ZG.set=function(e,t,n){return XG.set.call(this,e[0],t,n,e[0])};function QG(e,t){let n=e[mG];return(n?kG(n):e)[t]}function $G(e,t,n){let r=eK(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function eK(e,t){if(!(t in e))return;let n=gG(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=gG(n)}}function tK(e){e.modified_||(e.modified_=!0,e.parent_&&tK(e.parent_))}function nK(e){e.copy_||=AG(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var rK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&hG(6),n!==void 0&&typeof n!=`function`&&hG(7);let r;if(vG(e)){let i=UG(this),a=iK(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?VG(i):HG(i)}return BG(i,n),GG(r,i)}if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===fG&&(r=void 0),this.autoFreeze_&&jG(r,!0),n){let t=[],i=[];IG(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}hG(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){vG(e)||hG(8),_G(e)&&(e=aK(e));let t=UG(this),n=iK(e,void 0);return n[mG].isManual_=!0,HG(t),n}finishDraft(e,t){let n=e&&e[mG];(!n||!n.isManual_)&&hG(9);let{scope_:r}=n;return BG(r,t),GG(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=IG(`Patches`).applyPatches_;return _G(e)?r(e,t):this.produce(e,e=>r(e,t))}};function iK(e,t){let n=DG(e)?IG(`MapSet`).proxyMap_(e,t):OG(e)?IG(`MapSet`).proxySet_(e,t):YG(e,t);return(t?t.scope_:RG()).drafts_.push(n),n}function aK(e){return _G(e)||hG(10,e),oK(e)}function oK(e){if(!vG(e)||PG(e))return e;let t=e[mG],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=AG(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=AG(e,!0);return SG(n,(e,t)=>{TG(n,e,oK(t))},r),t&&(t.finalized_=!1),n}new rK().produce;function sK(e){return e}var cK=NH({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(sK(t.payload))},prepare:vH()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=iH(e).payload.indexOf(sK(n));i>-1&&(e.payload[i]=sK(r))},prepare:vH()},removeLegendPayload:{reducer(e,t){var n=iH(e).payload.indexOf(sK(t.payload));n>-1&&e.payload.splice(n,1)},prepare:vH()}}}),{setLegendSize:lK,setLegendSettings:uK,addLegendPayload:dK,replaceLegendPayload:fK,removeLegendPayload:pK}=cK.actions,mK=cK.reducer,hK=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=hK()}))();function gK(e){e()}function _K(){let e=null,t=null;return{clear(){e=null,t=null},notify(){gK(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var vK={notify(){},get:()=>[]};function yK(e,t){let n,r=vK,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=_K())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=vK)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var bK=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,xK=typeof navigator<`u`&&navigator.product===`ReactNative`,SK=bK||xK?v.useLayoutEffect:v.useEffect;function CK(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function wK(e,t){if(CK(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!CK(e[n[r]],t[n[r]]))return!1;return!0}var TK=Symbol.for(`react-redux-context`),EK=typeof globalThis<`u`?globalThis:{};function DK(){if(!v.createContext)return{};let e=EK[TK]??=new Map,t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var OK=DK();function kK(e){let{children:t,context:n,serverState:r,store:i}=e,a=v.useMemo(()=>{let e=yK(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=v.useMemo(()=>i.getState(),[i]);SK(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||OK;return v.createElement(s.Provider,{value:a},t)}var AK=kK,jK=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function MK(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function NK(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(jK.has(n)){if(e[n]==null&&t[n]==null)continue;if(!wK(e[n],t[n]))return!1}else if(!MK(e[n],t[n]))return!1;return!0}var PK=[`contextPayload`];function FK(){return FK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FK.apply(null,arguments)}function IK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IK(Object(n),!0).forEach(function(t){RK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RK(e,t,n){return(t=zK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zK(e){var t=BK(e,`string`);return typeof t==`symbol`?t:t+``}function BK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function VK(e,t){if(e==null)return{};var n,r,i=HK(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function HK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function UK(e){return e.value}function WK(e){var{contextPayload:t}=e,n=VK(e,PK),r=qz(t,e.payloadUniqBy,UK),i=LK(LK({},n),{},{payload:r});return v.isValidElement(e.content)?v.cloneElement(e.content,i):typeof e.content==`function`?v.createElement(e.content,i):v.createElement(hz,i)}function GK(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),LK(LK({},l),u)}function KK(e){var t=Xz();return(0,v.useEffect)(()=>{t(uK(e))},[t,e]),null}function qK(e){var t=Xz();return(0,v.useEffect)(()=>(t(lK(e)),()=>{t(lK({width:0,height:0}))}),[t,e]),null}function JK(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var YK={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function XK(e){var t=rz(e,YK),n=EB(),r=goe(),i=aG(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=OB([n]),d=rG(),f=iG();if(d==null||f==null)return null;var p=d-(i?.left||0)-(i?.right||0),m=JK(t.layout,o,a,p),h=c?s:LK(LK({position:`absolute`,width:m?.width||a||`auto`,height:m?.height||o||`auto`},GK(s,t,i,d,f,l)),s),g=c??r;if(g==null||n==null)return null;var _=v.createElement(`div`,{className:`recharts-legend-wrapper`,style:h,ref:u},v.createElement(KK,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&v.createElement(qK,{width:l.width,height:l.height}),v.createElement(WK,FK({},t,m,{margin:i,chartWidth:d,chartHeight:f,contextPayload:n})));return(0,xu.createPortal)(_,g)}var ZK=v.memo(XK,NK);ZK.displayName=`Legend`;function QK(){return QK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QK.apply(null,arguments)}function $K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$K(Object(n),!0).forEach(function(t){tq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$K(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tq(e,t,n){return(t=nq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nq(e){var t=rq(e,`string`);return typeof t==`symbol`?t:t+``}function rq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function iq(e){return Array.isArray(e)&&SR(e[0])&&SR(e[1])?e.join(` ~ `):e}var aq={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function oq(e,t){return t==null?e:(0,SB.default)(e,t)}var sq=e=>{var{separator:t=aq.separator,contentStyle:n,itemStyle:r,labelStyle:i=aq.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=aq.accessibilityLayer}=e,p=()=>{if(a&&a.length){var e={padding:0,margin:0},n=oq(a,s).map((e,n)=>{if(!e||e.type===`none`)return null;var i=e.formatter||o||iq,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=eq(eq({},aq.itemStyle),{},{color:e.color||aq.itemStyle.color},r);return v.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},SR(u)?v.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,SR(u)?v.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,v.createElement(`span`,{className:`recharts-tooltip-item-value`},l),v.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return v.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=eq(eq({},aq.contentStyle),n),h=eq({margin:0},i),g=!kR(u),_=g?u:``,y=ys(`recharts-default-tooltip`,c),b=ys(`recharts-tooltip-label`,l);g&&d&&a!=null&&(_=d(u,a));var x=f?{role:`status`,"aria-live":`assertive`}:{};return v.createElement(`div`,QK({className:y,style:m},x),v.createElement(`p`,{className:b,style:h},v.isValidElement(_)?_:`${_}`),p())},cq=`recharts-tooltip-wrapper`,lq={visibility:`hidden`};function uq(e){var{coordinate:t,translateX:n,translateY:r}=e;return ys(cq,{[`${cq}-right`]:xR(n)&&t&&xR(t.x)&&n>=t.x,[`${cq}-left`]:xR(n)&&t&&xR(t.x)&&n<t.x,[`${cq}-bottom`]:xR(r)&&t&&xR(t.y)&&r>=t.y,[`${cq}-top`]:xR(r)&&t&&xR(t.y)&&r<t.y})}function dq(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:s,viewBox:c,viewBoxDimension:l}=e;if(a&&xR(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(u<f?d:u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function fq(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function pq(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=dq({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=dq({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=fq({translateX:d,translateY:f,useTranslate3d:c})):u=lq,{cssProperties:u,cssClasses:uq({translateX:d,translateY:f,coordinate:n})}}var mq={devToolsEnabled:!0,isSsr:!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)};function hq(){var[e,t]=(0,v.useState)(()=>mq.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,v.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function gq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gq(Object(n),!0).forEach(function(t){vq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vq(e,t,n){return(t=yq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yq(e){var t=bq(e,`string`);return typeof t==`symbol`?t:t+``}function bq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xq(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active)return`transform ${e.animationDuration}ms ${e.animationEasing}`}function Sq(e){var t=hq(),[n,r]=v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));v.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(_q(_q({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=pq({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=_q(_q({},e.hasPortalFromProps?{}:_q(_q({transition:xq({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return v.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var Cq=v.memo(Sq),wq=()=>eB(e=>e.rootProps.accessibilityLayer)??!0;function Tq(){return Tq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tq.apply(null,arguments)}function Eq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Dq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Eq(Object(n),!0).forEach(function(t){Oq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oq(e,t,n){return(t=kq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kq(e){var t=Aq(e,`string`);return typeof t==`symbol`?t:t+``}function Aq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jq={curveBasisClosed:Poe,curveBasisOpen:Foe,curveBasis:Noe,curveBumpX:yoe,curveBumpY:boe,curveLinearClosed:Ioe,curveLinear:vL,curveMonotoneX:WL,curveMonotoneY:GL,curveNatural:JL,curveStep:XL,curveStepAfter:QL,curveStepBefore:ZL},Mq=e=>OU(e.x)&&OU(e.y),Nq=e=>e.base!=null&&Mq(e.base)&&Mq(e),Pq=e=>e.x,Fq=e=>e.y,Iq=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${AR(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=jq[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return jq[n]||vL},Lq={connectNulls:!1,type:`linear`},Rq=e=>{var{type:t=Lq.type,points:n=[],baseLine:r,layout:i,connectNulls:a=Lq.connectNulls}=e,o=Iq(t,i),s=a?n.filter(Mq):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>Dq(Dq({},e),{},{base:r[t]}));return c=i===`vertical`?SL().y(Fq).x1(Pq).x0(e=>e.base.x):SL().x(Pq).y1(Fq).y0(e=>e.base.y),c.defined(Nq).curve(o)(a?l.filter(Nq):l)}return(i===`vertical`&&xR(r)?SL().y(Fq).x1(Pq).x0(r):xR(r)?SL().x(Pq).y1(Fq).y0(r):xL().x(Pq).y(Fq)).defined(Mq).curve(o)(s)},zq=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=sG();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?Rq(o):r;return v.createElement(`path`,Tq({},XI(e),YR(e),{className:ys(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},Bq=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Vq(){return Vq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vq.apply(null,arguments)}function Hq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Uq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hq(Object(n),!0).forEach(function(t){Wq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wq(e,t,n){return(t=Gq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gq(e){var t=Kq(e,`string`);return typeof t==`symbol`?t:t+``}function Kq(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qq(e,t){if(e==null)return{};var n,r,i=Jq(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Yq=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,Xq=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=qq(e,Bq),l=Uq({x:t,y:n,top:r,left:i,width:a,height:o},c);return!xR(t)||!xR(n)||!xR(a)||!xR(o)||!xR(r)||!xR(i)?null:v.createElement(`path`,Vq({},QI(l),{className:ys(`recharts-cross`,s),d:Yq(t,n,a,o,r,i)}))};function Zq(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function Qq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qq(Object(n),!0).forEach(function(t){eJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eJ(e,t,n){return(t=tJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tJ(e){var t=nJ(e,`string`);return typeof t==`symbol`?t:t+``}function nJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rJ=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),iJ=(e,t,n)=>e.map(e=>`${rJ(e)} ${t}ms ${n}`).join(`,`),aJ=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),oJ=(e,t)=>Object.keys(t).reduce((n,r)=>$q($q({},n),{},{[r]:e(r,t[r])}),{});function sJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sJ(Object(n),!0).forEach(function(t){lJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lJ(e,t,n){return(t=uJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uJ(e){var t=dJ(e,`string`);return typeof t==`symbol`?t:t+``}function dJ(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var fJ=(e,t,n)=>e+(t-e)*n,pJ=e=>{var{from:t,to:n}=e;return t!==n},mJ=(e,t,n)=>{var r=oJ((t,n)=>{if(pJ(n)){var[r,i]=e(n.from,n.to,n.velocity);return cJ(cJ({},n),{},{from:r,velocity:i})}return n},t);return n<1?oJ((e,t)=>pJ(t)&&r[e]!=null?cJ(cJ({},t),{},{velocity:fJ(t.velocity,r[e].velocity,n),from:fJ(t.from,r[e].from,n)}):t,t):mJ(e,r,n-1)};function hJ(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>cJ(cJ({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>oJ((e,t)=>t.from,s),l=()=>!Object.values(s).filter(pJ).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=mJ(n,s,f),i(cJ(cJ(cJ({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function gJ(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:cJ(cJ({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=oJ((e,t)=>fJ(...t,n(d)),c);if(a(cJ(cJ(cJ({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=oJ((e,t)=>fJ(...t,n(1)),c);a(cJ(cJ(cJ({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var _J=(e,t,n,r,i,a)=>{var o=aJ(e,t);return n==null?()=>(i(cJ(cJ({},e),t)),()=>{}):n.isStepper===!0?hJ(e,t,n,o,i,a):gJ(e,t,n,r,o,i,a)},vJ=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],yJ=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),bJ=(e,t)=>n=>yJ(vJ(e,t),n),xJ=(e,t)=>n=>yJ([...vJ(e,t).map((e,t)=>e*t).slice(1),0],n),SJ=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},CJ=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=SJ(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},wJ=(e,t,n,r)=>{var i=bJ(e,n),a=bJ(t,r),o=xJ(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},TJ=function(){return wJ(...CJ(...arguments))},EJ=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},DJ=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return TJ(e);case`spring`:return EJ();default:if(e.split(`(`)[0]===`cubic-bezier`)return TJ(e)}return typeof e==`function`?e:null};function OJ(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var kJ=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function AJ(){return OJ(new kJ)}var jJ=(0,v.createContext)(AJ);function MJ(e,t){var n=(0,v.useContext)(jJ);return(0,v.useMemo)(()=>t??n(e),[e,t,n])}var NJ={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},PJ={t:0},FJ={t:1};function IJ(e){var t=rz(e,NJ),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=hq(),d=n===`auto`?!mq.isSsr&&!u:n,f=MJ(t.animationId,t.animationManager),[p,m]=(0,v.useState)(d?PJ:FJ),h=(0,v.useRef)(null);return(0,v.useEffect)(()=>{d||m(FJ)},[d]),(0,v.useEffect)(()=>{if(!d||!r)return MR;var e=_J(PJ,FJ,DJ(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function LJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,v.useRef)(wR(t)),r=(0,v.useRef)(e);return r.current!==e&&(n.current=wR(t),r.current=e),n.current}var RJ=[`radius`],zJ=[`radius`],BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ;function XJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XJ(Object(n),!0).forEach(function(t){QJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QJ(e,t,n){return(t=$J(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $J(e){var t=eY(e,`string`);return typeof t==`symbol`?t:t+``}function eY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tY(){return tY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tY.apply(null,arguments)}function nY(e,t){if(e==null)return{};var n,r,i=rY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iY(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var aY=(e,t,n,r,i)=>{var a=hR(n),o=hR(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=+(o>=0&&a>=0||o<0&&a<0),d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=gR(BJ||=iY([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=gR(VJ||=iY([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=gR(HJ||=iY([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=gR(UJ||=iY([`A `,`,`,`,0,0,`,`,
114
+ `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=gR(WJ||=iY([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=gR(GJ||=iY([`A `,`,`,`,0,0,`,`,
115
+ `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=gR(KJ||=iY([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=gR(qJ||=iY([`A `,`,`,`,0,0,`,`,
116
+ `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=gR(JJ||=iY(`M .,.
117
+ A .,.,0,0,.,.,.
118
+ L .,.
119
+ A .,.,0,0,.,.,.
120
+ L .,.
121
+ A .,.,0,0,.,.,.
122
+ L .,.
123
+ A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=gR(YJ||=iY([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},oY={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},sY=e=>{var t=rz(e,oY),n=(0,v.useRef)(null),[r,i]=(0,v.useState)(-1);(0,v.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:h}=t,g=(0,v.useRef)(s),_=(0,v.useRef)(c),y=(0,v.useRef)(a),b=(0,v.useRef)(o),x=LJ((0,v.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var S=ys(`recharts-rectangle`,u);if(!h){var C=QI(t),{radius:w}=C,T=nY(C,RJ);return v.createElement(`path`,tY({},T,{x:hR(a),y:hR(o),width:hR(s),height:hR(c),radius:typeof l==`number`?l:void 0,className:S,d:aY(a,o,s,c,l)}))}var E=g.current,D=_.current,O=y.current,k=b.current,A=`0px ${r===-1?1:r}px`,j=`${r}px ${r}px`,M=iJ([`strokeDasharray`],f,typeof d==`string`?d:oY.animationEasing);return v.createElement(IJ,{animationId:x,key:x,canBegin:r>0,duration:f,easing:d,isActive:h,begin:p},e=>{var r=DR(E,s,e),i=DR(D,c,e),u=DR(O,a,e),d=DR(k,o,e);n.current&&(g.current=r,_.current=i,y.current=u,b.current=d);var f=m?e>0?{transition:M,strokeDasharray:j}:{strokeDasharray:A}:{strokeDasharray:j},p=QI(t),{radius:h}=p,x=nY(p,zJ);return v.createElement(`path`,tY({},x,{radius:typeof l==`number`?l:void 0,className:S,d:aY(u,d,r,i,l),ref:n,style:ZJ(ZJ({},f),t.style)}))})};function cY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cY(Object(n),!0).forEach(function(t){uY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uY(e,t,n){return(t=dY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dY(e){var t=fY(e,`string`);return typeof t==`symbol`?t:t+``}function fY(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pY=Math.PI/180,mY=e=>e*180/Math.PI,hY=(e,t,n,r)=>({x:e+Math.cos(-pY*r)*n,y:t+Math.sin(-pY*r)*n}),gY=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},_Y=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},vY=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=_Y({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:mY(c),angleInRadian:c}},yY=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},bY=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},xY=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=vY({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(i<o||i>s||i===0)return null;var{startAngle:c,endAngle:l}=yY(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}else{for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}return d?lY(lY({},t),{},{radius:i,angle:bY(u,t)}):null};function SY(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[hY(t,n,r,i),hY(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var CY,wY,TY,EY,DY,OY,kY;function AY(){return AY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AY.apply(null,arguments)}function jY(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var MY=(e,t)=>vR(t-e)*Math.min(Math.abs(t-e),359.999),NY=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/pY,d=c?i:i+a*u,f=hY(t,n,l,d),p=hY(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:hY(t,n,l*Math.cos(u*pY),m),theta:u}},PY=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=MY(a,o),c=a+s,l=hY(t,n,i,a),u=hY(t,n,i,c),d=gR(CY||=jY([`M `,`,`,`
124
+ A `,`,`,`,0,
125
+ `,`,`,`,
126
+ `,`,`,`
127
+ `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=hY(t,n,r,a),p=hY(t,n,r,c);d+=gR(wY||=jY([`L `,`,`,`
128
+ A `,`,`,`,0,
129
+ `,`,`,`,
130
+ `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=gR(TY||=jY([`L `,`,`,` Z`]),t,n);return d},FY=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=vR(l-c),{circleTangency:d,lineTangency:f,theta:p}=NY({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=NY({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?gR(EY||=jY([`M `,`,`,`
131
+ a`,`,`,`,0,0,1,`,`,0
132
+ a`,`,`,`,0,0,1,`,`,0
133
+ `]),f.x,f.y,a,a,a*2,a,a,-a*2):PY({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=gR(DY||=jY([`M `,`,`,`
134
+ A`,`,`,`,0,0,`,`,`,`,`,`
135
+ A`,`,`,`,0,`,`,`,`,`,`,`,`
136
+ A`,`,`,`,0,0,`,`,`,`,`,`
137
+ `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=NY({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=NY({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=gR(OY||=jY([`L`,`,`,`
138
+ A`,`,`,`,0,0,`,`,`,`,`,`
139
+ A`,`,`,`,0,`,`,`,`,`,`,`,`
140
+ A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=gR(kY||=jY([`L`,`,`,`Z`]),t,n);return v},IY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},LY=e=>{var t=rz(e,IY),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a<i||l===u)return null;var f=ys(`recharts-sector`,d),p=a-i,m=TR(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?FY({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):PY({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return v.createElement(`path`,AY({},QI(t),{className:f,d:h}))};function RY(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(JR(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=hY(r,i,a,s),l=hY(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return SY(t)}}var zY=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=gB();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),BY=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=zY();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),VY=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=bB(),n=BY();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e<r?1:-1:n.toFinite(i);let a=Math.max(Math.ceil((r-e)/(i||1)),0),o=Array(a);for(let t=0;t<a;t++)o[t]=e,e+=i;return o}e.range=r})),HY=o(((e,t)=>{t.exports=VY().range})),UY=e=>e.chartData,WY=$([UY],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),GY=(e,t,n,r)=>r?WY(e):UY(e),KY=(e,t,n)=>n?WY(e):UY(e),qY=$([GY],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});$([WY],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});var JY=$([UY],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t==null?[]:t.slice(n,r+1)});function YY(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(OU(t)&&OU(n))return!0}return!1}function XY(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function ZY(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(OU(n))i=n;else if(typeof n==`function`)return;if(OU(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(YY(o))return o}}function QY(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(YY(r))return XY(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(xR(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&&XU.test(i)){var c=XU.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(xR(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&ZU.test(a)){var u=ZU.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(YY(f))return t==null?f:XY(f,t,n)}}}var $Y=l(o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0){if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}))());function eX(e){return e===0?1:Math.floor(new $Y.default(e).abs().log(10).toNumber())+1}function tX(e,t,n){for(var r=new $Y.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var nX=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},rX=(e,t,n)=>{if(e.lte(0))return new $Y.default(0);var r=eX(e.toNumber()),i=new $Y.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new $Y.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new $Y.default(s.toNumber()):new $Y.default(Math.ceil(s.toNumber()))},iX=(e,t,n)=>{if(e.lte(0))return new $Y.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new $Y.default(i).abs().log(10).toNumber()),o=new $Y.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new $Y.default(10).pow(l))}var u=r[c]??1,d=new $Y.default(u).mul(o);return t?d:new $Y.default(Math.ceil(d.toNumber()))},aX=(e,t,n)=>{var r=new $Y.default(1),i=new $Y.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new $Y.default(10).pow(eX(e)-1),i=new $Y.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new $Y.default(Math.floor(e)))}else e===0?i=new $Y.default(Math.floor((t-1)/2)):n||(i=new $Y.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new $Y.default(c-o).mul(r)).toNumber());return s},oX=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:rX;if(!Number.isFinite((t-e)/(n-1)))return{step:new $Y.default(0),tickMin:new $Y.default(0),tickMax:new $Y.default(0)};var o=a(new $Y.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new $Y.default(0):(s=new $Y.default(e).add(t).div(2),s=s.sub(new $Y.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new $Y.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?oX(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new $Y.default(c).mul(o)),tickMax:s.add(new $Y.default(l).mul(o))})},sX=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=nX([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return aX(s,r,i);var{step:u,tickMin:d,tickMax:f}=oX(s,c,o,i,0,a===`snap125`?iX:rX),p=tX(d,f.add(new $Y.default(.1).mul(u)),u);return t>n?p.reverse():p},cX=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=nX([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?iX:rX,l=Math.max(t,2),u=c(new $Y.default(s).sub(o).div(l-1),i,0),d=[...tX(new $Y.default(o),new $Y.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},lX=e=>e.rootProps.maxBarSize,uX=e=>e.rootProps.barGap,dX=e=>e.rootProps.barCategoryGap,fX=e=>e.rootProps.barSize,pX=e=>e.rootProps.stackOffset,mX=e=>e.rootProps.reverseStackOrder,hX=e=>e.options.chartName,gX=e=>e.rootProps.syncId,_X=e=>e.rootProps.syncMethod,vX=e=>e.options.eventEmitter,yX={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},bX={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:yX.axis},xX={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:yX.axis},SX=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function CX(e,t,n){if(n!==`auto`)return n;if(e!=null)return LU(e,t)?`category`:`number`}function wX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wX(Object(n),!0).forEach(function(t){EX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function EX(e,t,n){return(t=DX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DX(e){var t=OX(e,`string`);return typeof t==`symbol`?t:t+``}function OX(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var kX={allowDataOverflow:bX.allowDataOverflow,allowDecimals:bX.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:bX.angleAxisId,includeHidden:!1,name:void 0,reversed:bX.reversed,scale:bX.scale,tick:bX.tick,tickCount:void 0,ticks:void 0,type:bX.type,unit:void 0,niceTicks:`auto`},AX={allowDataOverflow:xX.allowDataOverflow,allowDecimals:xX.allowDecimals,allowDuplicatedCategory:xX.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:xX.radiusAxisId,includeHidden:xX.includeHidden,name:void 0,reversed:xX.reversed,scale:xX.scale,tick:xX.tick,tickCount:xX.tickCount,ticks:void 0,type:xX.type,unit:void 0,niceTicks:`auto`},jX=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},lG],(e,t)=>{if(e!=null)return e;var n=CX(t,`angleAxis`,kX.type)??`category`;return TX(TX({},kX),{},{type:n})}),MX=$([(e,t)=>e.polarAxis.radiusAxis[t],lG],(e,t)=>{if(e!=null)return e;var n=CX(t,`radiusAxis`,AX.type)??`category`;return TX(TX({},AX),{},{type:n})}),NX=e=>e.polarOptions,PX=$([rW,iW,bW],gY),FX=$([NX,PX],(e,t)=>{if(e!=null)return TR(e.innerRadius,t,0)}),IX=$([NX,PX],(e,t)=>{if(e!=null)return TR(e.outerRadius,t,t*.8)}),LX=$([NX],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});$([jX,LX],SX);var RX=$([PX,FX,IX],(e,t,n)=>{if(e!=null&&t!=null&&n!=null)return[t,n]});$([MX,RX],SX);var zX=$([oG,NX,FX,IX,rW,iW],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:TR(o,i,i/2),cy:TR(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),BX=(e,t)=>t,VX=(e,t,n)=>n;function HX(e){return e?.id}function UX(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(t!=null&&t.length!==0){var n=HX(e);t.forEach((t,r)=>{var s=a==null||i?r:String(FU(t,a,null)),c=FU(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function WX(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var GX=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function KX(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function qX(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var JX=e=>{var t=oG(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiusAxis`},YX=e=>e.tooltip.settings.axisId;function XX(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i}}return r}}}}}var ZX=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!YY(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];OU(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function QX(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $X(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function eZ(e){let t,n,r;e.length===2?(t=e===QX||e===$X?e:tZ,n=e,r=e):(t=QX,n=(t,n)=>QX(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function tZ(){return 0}function nZ(e){return e===null?NaN:+e}function*rZ(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var iZ=eZ(QX),aZ=iZ.right;iZ.left,eZ(nZ).center;var oZ=class extends Map{constructor(e,t=uZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(sZ(this,e))}has(e){return super.has(sZ(this,e))}set(e,t){return super.set(cZ(this,e),t)}delete(e){return super.delete(lZ(this,e))}};function sZ({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function cZ({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function lZ({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function uZ(e){return typeof e==`object`&&e?e.valueOf():e}function dZ(e=QX){if(e===QX)return fZ;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function fZ(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var pZ=Math.sqrt(50),mZ=Math.sqrt(10),hZ=Math.sqrt(2);function gZ(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=pZ?10:a>=mZ?5:a>=hZ?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?gZ(e,t,n*2):[s,c,l]}function _Z(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?gZ(t,e,n):gZ(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function vZ(e,t,n){return t=+t,e=+e,n=+n,gZ(e,t,n)[2]}function yZ(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?vZ(t,e,n):vZ(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function bZ(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function xZ(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function SZ(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?fZ:dZ(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));SZ(e,t,u,d,i)}let a=e[t],o=n,s=r;for(CZ(e,n,t),i(e[r],a)>0&&CZ(e,n,r);o<s;){for(CZ(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?CZ(e,n,s):(++s,CZ(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function CZ(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function wZ(e,t,n){if(e=Float64Array.from(rZ(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xZ(e);if(t>=1)return bZ(e);var r,i=(r-1)*t,a=Math.floor(i),o=bZ(SZ(e,a).subarray(0,a+1));return o+(xZ(e.subarray(a+1))-o)*(i-a)}}function TZ(e,t,n=nZ){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function EZ(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function DZ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function OZ(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t)}return this}var kZ=Symbol(`implicit`);function AZ(){var e=new oZ,t=[],n=[],r=kZ;function i(i){let a=e.get(i);if(a===void 0){if(r!==kZ)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new oZ;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return AZ(t,n).unknown(r)},DZ.apply(i,arguments),i}function jZ(){var e=AZ().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=EZ(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return jZ(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},DZ.apply(d(),arguments)}function MZ(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return MZ(t())},e}function NZ(){return MZ(jZ.apply(null,arguments).paddingInner(1))}function PZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function FZ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function IZ(){}var LZ=.7,RZ=1/LZ,zZ=`\\s*([+-]?\\d+)\\s*`,BZ=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,VZ=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,HZ=/^#([0-9a-f]{3,8})$/,UZ=RegExp(`^rgb\\(${zZ},${zZ},${zZ}\\)$`),WZ=RegExp(`^rgb\\(${VZ},${VZ},${VZ}\\)$`),GZ=RegExp(`^rgba\\(${zZ},${zZ},${zZ},${BZ}\\)$`),KZ=RegExp(`^rgba\\(${VZ},${VZ},${VZ},${BZ}\\)$`),qZ=RegExp(`^hsl\\(${BZ},${VZ},${VZ}\\)$`),JZ=RegExp(`^hsla\\(${BZ},${VZ},${VZ},${BZ}\\)$`),YZ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};PZ(IZ,eQ,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XZ,formatHex:XZ,formatHex8:ZZ,formatHsl:QZ,formatRgb:$Z,toString:$Z});function XZ(){return this.rgb().formatHex()}function ZZ(){return this.rgb().formatHex8()}function QZ(){return pQ(this).formatHsl()}function $Z(){return this.rgb().formatRgb()}function eQ(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=HZ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tQ(t):n===3?new aQ(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?nQ(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?nQ(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=UZ.exec(e))?new aQ(t[1],t[2],t[3],1):(t=WZ.exec(e))?new aQ(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=GZ.exec(e))?nQ(t[1],t[2],t[3],t[4]):(t=KZ.exec(e))?nQ(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qZ.exec(e))?fQ(t[1],t[2]/100,t[3]/100,1):(t=JZ.exec(e))?fQ(t[1],t[2]/100,t[3]/100,t[4]):YZ.hasOwnProperty(e)?tQ(YZ[e]):e===`transparent`?new aQ(NaN,NaN,NaN,0):null}function tQ(e){return new aQ(e>>16&255,e>>8&255,e&255,1)}function nQ(e,t,n,r){return r<=0&&(e=t=n=NaN),new aQ(e,t,n,r)}function rQ(e){return e instanceof IZ||(e=eQ(e)),e?(e=e.rgb(),new aQ(e.r,e.g,e.b,e.opacity)):new aQ}function iQ(e,t,n,r){return arguments.length===1?rQ(e):new aQ(e,t,n,r??1)}function aQ(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}PZ(aQ,iQ,FZ(IZ,{brighter(e){return e=e==null?RZ:RZ**+e,new aQ(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?LZ:LZ**+e,new aQ(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aQ(uQ(this.r),uQ(this.g),uQ(this.b),lQ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oQ,formatHex:oQ,formatHex8:sQ,formatRgb:cQ,toString:cQ}));function oQ(){return`#${dQ(this.r)}${dQ(this.g)}${dQ(this.b)}`}function sQ(){return`#${dQ(this.r)}${dQ(this.g)}${dQ(this.b)}${dQ((isNaN(this.opacity)?1:this.opacity)*255)}`}function cQ(){let e=lQ(this.opacity);return`${e===1?`rgb(`:`rgba(`}${uQ(this.r)}, ${uQ(this.g)}, ${uQ(this.b)}${e===1?`)`:`, ${e})`}`}function lQ(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uQ(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dQ(e){return e=uQ(e),(e<16?`0`:``)+e.toString(16)}function fQ(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hQ(e,t,n,r)}function pQ(e){if(e instanceof hQ)return new hQ(e.h,e.s,e.l,e.opacity);if(e instanceof IZ||(e=eQ(e)),!e)return new hQ;if(e instanceof hQ)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new hQ(o,s,c,e.opacity)}function mQ(e,t,n,r){return arguments.length===1?pQ(e):new hQ(e,t,n,r??1)}function hQ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}PZ(hQ,mQ,FZ(IZ,{brighter(e){return e=e==null?RZ:RZ**+e,new hQ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?LZ:LZ**+e,new hQ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new aQ(vQ(e>=240?e-240:e+120,i,r),vQ(e,i,r),vQ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hQ(gQ(this.h),_Q(this.s),_Q(this.l),lQ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=lQ(this.opacity);return`${e===1?`hsl(`:`hsla(`}${gQ(this.h)}, ${_Q(this.s)*100}%, ${_Q(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function gQ(e){return e=(e||0)%360,e<0?e+360:e}function _Q(e){return Math.max(0,Math.min(1,e||0))}function vQ(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var yQ=e=>()=>e;function bQ(e,t){return function(n){return e+n*t}}function xQ(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function SQ(e){return(e=+e)==1?CQ:function(t,n){return n-t?xQ(t,n,e):yQ(isNaN(t)?n:t)}}function CQ(e,t){var n=t-e;return n?bQ(e,n):yQ(isNaN(e)?t:e)}var wQ=(function e(t){var n=SQ(t);function r(e,t){var r=n((e=iQ(e)).r,(t=iQ(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=CQ(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function TQ(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function EQ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function DQ(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=IQ(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function OQ(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function kQ(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function AQ(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=IQ(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var jQ=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,MQ=new RegExp(jQ.source,`g`);function NQ(e){return function(){return e}}function PQ(e){return function(t){return e(t)+``}}function FQ(e,t){var n=jQ.lastIndex=MQ.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=jQ.exec(e))&&(i=MQ.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:kQ(r,i)})),n=MQ.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?PQ(c[0].x):NQ(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function IQ(e,t){var n=typeof t,r;return t==null||n===`boolean`?yQ(t):(n===`number`?kQ:n===`string`?(r=eQ(t))?(t=r,wQ):FQ:t instanceof eQ?wQ:t instanceof Date?OQ:EQ(t)?TQ:Array.isArray(t)?DQ:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?AQ:kQ)(e,t)}function LQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function RQ(e,t){t===void 0&&(t=e,e=IQ);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function zQ(e){return function(){return e}}function BQ(e){return+e}var VQ=[0,1];function HQ(e){return e}function UQ(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:zQ(isNaN(t)?NaN:.5)}function WQ(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function GQ(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=UQ(i,r),a=n(o,a)):(r=UQ(r,i),a=n(a,o)),function(e){return a(r(e))}}function KQ(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=UQ(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=aZ(e,t,1,r)-1;return a[n](i[n](t))}}function qQ(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function JQ(){var e=VQ,t=VQ,n=IQ,r,i,a,o=HQ,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==HQ&&(o=WQ(e[0],e[n-1])),s=n>2?KQ:GQ,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),kQ))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,BQ),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=LQ,u()},d.clamp=function(e){return arguments.length?(o=e?!0:HQ,u()):o!==HQ},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function YQ(){return JQ()(HQ,HQ)}function XQ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function ZQ(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function QQ(e){return e=ZQ(Math.abs(e)),e?e[1]:NaN}function $Q(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function e$(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var t$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function n$(e){if(!(t=t$.exec(e)))throw Error(`invalid format: `+e);var t;return new r$({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}n$.prototype=r$.prototype;function r$(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}r$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function i$(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var a$;function o$(e,t){var n=ZQ(e,t);if(!n)return a$=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(a$=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+ZQ(e,Math.max(0,t+a-1))[0]}function s$(e,t){var n=ZQ(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var c$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:XQ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>s$(e*100,t),r:s$,s:o$,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function l$(e){return e}var u$=Array.prototype.map,d$=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function f$(e){var t=e.grouping===void 0||e.thousands===void 0?l$:$Q(u$.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?l$:e$(u$.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=n$(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):c$[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=c$[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=i$(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&a$!==void 0?d$[8+a$/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(QQ(t)/3)))*3,r=10**-n,i=l((e=n$(e),e.type=`f`,e),{suffix:d$[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var p$,m$,h$;g$({thousands:`,`,grouping:[3],currency:[`$`,``]});function g$(e){return p$=f$(e),m$=p$.format,h$=p$.formatPrefix,p$}function _$(e){return Math.max(0,-QQ(Math.abs(e)))}function v$(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(QQ(t)/3)))*3-QQ(Math.abs(e)))}function y$(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,QQ(t)-QQ(e))+1}function b$(e,t,n,r){var i=yZ(e,t,n),a;switch(r=n$(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=v$(i,o))&&(r.precision=a),h$(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=y$(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=_$(i))&&(r.precision=a-(r.type===`%`)*2)}return m$(r)}function x$(e){var t=e.domain;return e.ticks=function(e){var n=t();return _Z(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return b$(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=vZ(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function S$(){var e=YQ();return e.copy=function(){return qQ(e,S$())},DZ.apply(e,arguments),x$(e)}function C$(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,BQ),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return C$(e).unknown(t)},e=arguments.length?Array.from(e,BQ):[0,1],x$(n)}function w$(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function T$(e){return Math.log(e)}function E$(e){return Math.exp(e)}function D$(e){return-Math.log(-e)}function O$(e){return-Math.exp(-e)}function k$(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function A$(e){return e===10?k$:e===Math.E?Math.exp:t=>e**+t}function j$(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function M$(e){return(t,n)=>-e(-t,n)}function N$(e){let t=e(T$,E$),n=t.domain,r=10,i,a;function o(){return i=j$(r),a=A$(r),n()[0]<0?(i=M$(i),a=M$(a),e(D$,O$)):e(T$,E$),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=_Z(o,s,p))}else m=_Z(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=n$(n)).precision==null&&(n.trim=!0),n=m$(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(w$(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function P$(){let e=N$(JQ()).domain([1,10]);return e.copy=()=>qQ(e,P$()).base(e.base()),DZ.apply(e,arguments),e}function F$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function I$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function L$(e){var t=1,n=e(F$(t),I$(t));return n.constant=function(n){return arguments.length?e(F$(t=+n),I$(t)):t},x$(n)}function R$(){var e=L$(JQ());return e.copy=function(){return qQ(e,R$()).constant(e.constant())},DZ.apply(e,arguments)}function z$(e){return function(t){return t<0?-((-t)**+e):t**+e}}function B$(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function V$(e){return e<0?-e*e:e*e}function H$(e){var t=e(HQ,HQ),n=1;function r(){return n===1?e(HQ,HQ):n===.5?e(B$,V$):e(z$(n),z$(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},x$(t)}function U$(){var e=H$(JQ());return e.copy=function(){return qQ(e,U$()).exponent(e.exponent())},DZ.apply(e,arguments),e}function W$(){return U$.apply(null,arguments).exponent(.5)}function G$(e){return Math.sign(e)*e*e}function K$(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function q$(){var e=YQ(),t=[0,1],n=!1,r;function i(t){var i=K$(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(G$(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,BQ)).map(G$)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return q$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},DZ.apply(i,arguments),x$(i)}function J$(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=TZ(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[aZ(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(QX),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return J$().domain(e).range(t).unknown(r)},DZ.apply(a,arguments)}function Y$(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[aZ(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Y$().domain([e,t]).range(i).unknown(a)},DZ.apply(x$(o),arguments)}function X$(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[aZ(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return X$().domain(e).range(t).unknown(n)},DZ.apply(i,arguments)}var Z$=new Date,Q$=new Date;function $$(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>$$(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(Z$.setTime(+t),Q$.setTime(+r),e(Z$),e(Q$),Math.floor(n(Z$,Q$))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var e1=$$(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);e1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?$$(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):e1),e1.range;var t1=1e3,n1=t1*60,r1=n1*60,i1=r1*24,a1=i1*7,o1=i1*30,s1=i1*365,c1=$$(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*t1)},(e,t)=>(t-e)/t1,e=>e.getUTCSeconds());c1.range;var l1=$$(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*t1)},(e,t)=>{e.setTime(+e+t*n1)},(e,t)=>(t-e)/n1,e=>e.getMinutes());l1.range;var u1=$$(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*n1)},(e,t)=>(t-e)/n1,e=>e.getUTCMinutes());u1.range;var d1=$$(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*t1-e.getMinutes()*n1)},(e,t)=>{e.setTime(+e+t*r1)},(e,t)=>(t-e)/r1,e=>e.getHours());d1.range;var f1=$$(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*r1)},(e,t)=>(t-e)/r1,e=>e.getUTCHours());f1.range;var p1=$$(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*n1)/i1,e=>e.getDate()-1);p1.range;var m1=$$(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/i1,e=>e.getUTCDate()-1);m1.range;var h1=$$(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/i1,e=>Math.floor(e/i1));h1.range;function g1(e){return $$(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*n1)/a1)}var _1=g1(0),v1=g1(1),y1=g1(2),b1=g1(3),x1=g1(4),S1=g1(5),C1=g1(6);_1.range,v1.range,y1.range,b1.range,x1.range,S1.range,C1.range;function w1(e){return $$(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/a1)}var T1=w1(0),E1=w1(1),D1=w1(2),O1=w1(3),k1=w1(4),A1=w1(5),j1=w1(6);T1.range,E1.range,D1.range,O1.range,k1.range,A1.range,j1.range;var M1=$$(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());M1.range;var N1=$$(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());N1.range;var P1=$$(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());P1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:$$(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),P1.range;var F1=$$(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());F1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:$$(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),F1.range;function I1(e,t,n,r,i,a){let o=[[c1,1,t1],[c1,5,5*t1],[c1,15,15*t1],[c1,30,30*t1],[a,1,n1],[a,5,5*n1],[a,15,15*n1],[a,30,30*n1],[i,1,r1],[i,3,3*r1],[i,6,6*r1],[i,12,12*r1],[r,1,i1],[r,2,2*i1],[n,1,a1],[t,1,o1],[t,3,3*o1],[e,1,s1]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=eZ(([,,e])=>e).right(o,i);if(a===o.length)return e.every(yZ(t/s1,n/s1,r));if(a===0)return e1.every(Math.max(yZ(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[L1,R1]=I1(F1,N1,T1,h1,f1,u1),[z1,B1]=I1(P1,M1,_1,p1,d1,l1);function V1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function H1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function U1(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function W1(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Z1(i),u=Q1(i),d=Z1(a),f=Q1(a),p=Z1(o),m=Q1(o),h=Z1(s),g=Q1(s),_=Z1(c),v=Q1(c),y={a:N,A:P,b:F,B:I,c:null,d:y0,e:y0,f:w0,g:F0,G:L0,H:b0,I:x0,j:S0,L:C0,m:T0,M:E0,p:L,q:R,Q:o2,s:s2,S:D0,u:O0,U:k0,V:j0,w:M0,W:N0,x:null,X:null,y:P0,Y:I0,Z:R0,"%":a2},b={a:z,A:B,b:V,B:H,c:null,d:z0,e:z0,f:W0,g:t2,G:r2,H:B0,I:V0,j:H0,L:U0,m:G0,M:K0,p:U,q:ee,Q:o2,s:s2,S:q0,u:J0,U:Y0,V:Z0,w:Q0,W:$0,x:null,X:null,y:e2,Y:n2,Z:i2,"%":a2},x={a:E,A:D,b:O,B:k,c:A,d:l0,e:l0,f:h0,g:a0,G:i0,H:d0,I:d0,j:u0,L:m0,m:c0,M:f0,p:T,q:s0,Q:_0,s:v0,S:p0,u:e0,U:t0,V:n0,w:$1,W:r0,x:j,X:M,y:a0,Y:i0,Z:o0,"%":g0};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=G1[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=U1(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=H1(U1(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?E1.ceil(a):E1(a),a=m1.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=V1(U1(r.y,0,1)),o=a.getDay(),a=o>4||o===0?v1.ceil(a):v1(a),a=p1.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?H1(U1(r.y,0,1)).getUTCDay():V1(U1(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,H1(r)):V1(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in G1?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function B(e){return a[e.getUTCDay()]}function V(e){return c[e.getUTCMonth()]}function H(e){return s[e.getUTCMonth()]}function U(e){return i[+(e.getUTCHours()>=12)]}function ee(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var G1={"-":``,_:` `,0:`0`},K1=/^\s*\d+/,q1=/^%/,J1=/[\\^$*+?|[\]().{}]/g;function Y1(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function X1(e){return e.replace(J1,`\\$&`)}function Z1(e){return RegExp(`^(?:`+e.map(X1).join(`|`)+`)`,`i`)}function Q1(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function $1(e,t,n){var r=K1.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function e0(e,t,n){var r=K1.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function t0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function n0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function r0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function i0(e,t,n){var r=K1.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function a0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function o0(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function s0(e,t,n){var r=K1.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function c0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function l0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function u0(e,t,n){var r=K1.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function d0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function f0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function p0(e,t,n){var r=K1.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function m0(e,t,n){var r=K1.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function h0(e,t,n){var r=K1.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function g0(e,t,n){var r=q1.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _0(e,t,n){var r=K1.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function v0(e,t,n){var r=K1.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function y0(e,t){return Y1(e.getDate(),t,2)}function b0(e,t){return Y1(e.getHours(),t,2)}function x0(e,t){return Y1(e.getHours()%12||12,t,2)}function S0(e,t){return Y1(1+p1.count(P1(e),e),t,3)}function C0(e,t){return Y1(e.getMilliseconds(),t,3)}function w0(e,t){return C0(e,t)+`000`}function T0(e,t){return Y1(e.getMonth()+1,t,2)}function E0(e,t){return Y1(e.getMinutes(),t,2)}function D0(e,t){return Y1(e.getSeconds(),t,2)}function O0(e){var t=e.getDay();return t===0?7:t}function k0(e,t){return Y1(_1.count(P1(e)-1,e),t,2)}function A0(e){var t=e.getDay();return t>=4||t===0?x1(e):x1.ceil(e)}function j0(e,t){return e=A0(e),Y1(x1.count(P1(e),e)+(P1(e).getDay()===4),t,2)}function M0(e){return e.getDay()}function N0(e,t){return Y1(v1.count(P1(e)-1,e),t,2)}function P0(e,t){return Y1(e.getFullYear()%100,t,2)}function F0(e,t){return e=A0(e),Y1(e.getFullYear()%100,t,2)}function I0(e,t){return Y1(e.getFullYear()%1e4,t,4)}function L0(e,t){var n=e.getDay();return e=n>=4||n===0?x1(e):x1.ceil(e),Y1(e.getFullYear()%1e4,t,4)}function R0(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Y1(t/60|0,`0`,2)+Y1(t%60,`0`,2)}function z0(e,t){return Y1(e.getUTCDate(),t,2)}function B0(e,t){return Y1(e.getUTCHours(),t,2)}function V0(e,t){return Y1(e.getUTCHours()%12||12,t,2)}function H0(e,t){return Y1(1+m1.count(F1(e),e),t,3)}function U0(e,t){return Y1(e.getUTCMilliseconds(),t,3)}function W0(e,t){return U0(e,t)+`000`}function G0(e,t){return Y1(e.getUTCMonth()+1,t,2)}function K0(e,t){return Y1(e.getUTCMinutes(),t,2)}function q0(e,t){return Y1(e.getUTCSeconds(),t,2)}function J0(e){var t=e.getUTCDay();return t===0?7:t}function Y0(e,t){return Y1(T1.count(F1(e)-1,e),t,2)}function X0(e){var t=e.getUTCDay();return t>=4||t===0?k1(e):k1.ceil(e)}function Z0(e,t){return e=X0(e),Y1(k1.count(F1(e),e)+(F1(e).getUTCDay()===4),t,2)}function Q0(e){return e.getUTCDay()}function $0(e,t){return Y1(E1.count(F1(e)-1,e),t,2)}function e2(e,t){return Y1(e.getUTCFullYear()%100,t,2)}function t2(e,t){return e=X0(e),Y1(e.getUTCFullYear()%100,t,2)}function n2(e,t){return Y1(e.getUTCFullYear()%1e4,t,4)}function r2(e,t){var n=e.getUTCDay();return e=n>=4||n===0?k1(e):k1.ceil(e),Y1(e.getUTCFullYear()%1e4,t,4)}function i2(){return`+0000`}function a2(){return`%`}function o2(e){return+e}function s2(e){return Math.floor(e/1e3)}var c2,l2,u2;d2({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function d2(e){return c2=W1(e),l2=c2.format,c2.parse,u2=c2.utcFormat,c2.utcParse,c2}function f2(e){return new Date(e)}function p2(e){return e instanceof Date?+e:+new Date(+e)}function m2(e,t,n,r,i,a,o,s,c,l){var u=YQ(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,p2)):f().map(f2)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(w$(n,e)):u},u.copy=function(){return qQ(u,m2(e,t,n,r,i,a,o,s,c,l))},u}function h2(){return DZ.apply(m2(z1,B1,P1,M1,_1,p1,d1,l1,c1,l2).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function g2(){return DZ.apply(m2(L1,R1,F1,N1,T1,m1,f1,u1,c1,u2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _2(){var e=0,t=1,n,r,i,a,o=HQ,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(IQ),l.rangeRound=u(LQ),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function v2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function y2(){var e=x$(_2()(HQ));return e.copy=function(){return v2(e,y2())},OZ.apply(e,arguments)}function b2(){var e=N$(_2()).domain([1,10]);return e.copy=function(){return v2(e,b2()).base(e.base())},OZ.apply(e,arguments)}function x2(){var e=L$(_2());return e.copy=function(){return v2(e,x2()).constant(e.constant())},OZ.apply(e,arguments)}function S2(){var e=H$(_2());return e.copy=function(){return v2(e,S2()).exponent(e.exponent())},OZ.apply(e,arguments)}function C2(){return S2.apply(null,arguments).exponent(.5)}function w2(){var e=[],t=HQ;function n(n){if(n!=null&&!isNaN(n=+n))return t((aZ(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(QX),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>wZ(e,r/t))},n.copy=function(){return w2(t).domain(e)},OZ.apply(n,arguments)}function T2(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=HQ,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=RQ(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(IQ),p.rangeRound=m(LQ),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function E2(){var e=x$(T2()(HQ));return e.copy=function(){return v2(e,E2())},OZ.apply(e,arguments)}function D2(){var e=N$(T2()).domain([.1,1,10]);return e.copy=function(){return v2(e,D2()).base(e.base())},OZ.apply(e,arguments)}function O2(){var e=L$(T2());return e.copy=function(){return v2(e,O2()).constant(e.constant())},OZ.apply(e,arguments)}function k2(){var e=H$(T2());return e.copy=function(){return v2(e,k2()).exponent(e.exponent())},OZ.apply(e,arguments)}function A2(){return k2.apply(null,arguments).exponent(.5)}var j2=s({scaleBand:()=>jZ,scaleDiverging:()=>E2,scaleDivergingLog:()=>D2,scaleDivergingPow:()=>k2,scaleDivergingSqrt:()=>A2,scaleDivergingSymlog:()=>O2,scaleIdentity:()=>C$,scaleImplicit:()=>kZ,scaleLinear:()=>S$,scaleLog:()=>P$,scaleOrdinal:()=>AZ,scalePoint:()=>NZ,scalePow:()=>U$,scaleQuantile:()=>J$,scaleQuantize:()=>Y$,scaleRadial:()=>q$,scaleSequential:()=>y2,scaleSequentialLog:()=>b2,scaleSequentialPow:()=>S2,scaleSequentialQuantile:()=>w2,scaleSequentialSqrt:()=>C2,scaleSequentialSymlog:()=>x2,scaleSqrt:()=>W$,scaleSymlog:()=>R$,scaleThreshold:()=>X$,scaleTime:()=>h2,scaleUtc:()=>g2,tickFormat:()=>b$});function M2(e){var t=j2;if(e in t&&typeof t[e]==`function`)return t[e]();var n=`scale${AR(e)}`;if(n in t&&typeof t[n]==`function`)return t[n]()}function N2(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=M2(e);if(r!=null)return r.domain(t).range(n),r}}function P2(e,t,n,r){if(n!=null&&r!=null)return typeof e.scale==`function`?N2(e.scale,n,r):N2(t,n,r)}function F2(e){return`scale${AR(e)}`}function I2(e){return F2(e)in j2}var L2=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return I2(r)?r:`point`}};function R2(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function z2(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=R2(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function B2(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):z2(e,void 0)}var V2=l(HY());function H2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function U2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?H2(Object(n),!0).forEach(function(t){W2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function W2(e,t,n){return(t=G2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G2(e){var t=K2(e,`string`);return typeof t==`symbol`?t:t+``}function K2(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var q2=[0,`auto`],J2={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},Y2=(e,t)=>e.cartesianAxis.xAxis[t],X2=(e,t)=>Y2(e,t)??J2,Z2={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:q2,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},Q2=(e,t)=>e.cartesianAxis.yAxis[t],$2=(e,t)=>Q2(e,t)??Z2,e4={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},t4=(e,t)=>e.cartesianAxis.zAxis[t]??e4,n4=(e,t,n)=>{switch(t){case`xAxis`:return X2(e,n);case`yAxis`:return $2(e,n);case`zAxis`:return t4(e,n);case`angleAxis`:return jX(e,n);case`radiusAxis`:return MX(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},r4=(e,t,n)=>{switch(t){case`xAxis`:return X2(e,n);case`yAxis`:return $2(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},i4=(e,t,n)=>{switch(t){case`xAxis`:return X2(e,n);case`yAxis`:return $2(e,n);case`angleAxis`:return jX(e,n);case`radiusAxis`:return MX(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},a4=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function o4(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var s4=e=>e.graphicalItems.cartesianItems,c4=$([BX,VX],o4),l4=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0||!e.hide),u4=$([s4,n4,c4],l4,{memoizeOptions:{resultEqualityCheck:KX}}),d4=$([u4],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(WX)),f4=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),p4=$([u4],f4),m4=e=>e.map(e=>e.data).filter(Boolean).flat(1),h4=$([u4],e=>e.some(e=>!e.data)),g4=$([u4],m4,{memoizeOptions:{resultEqualityCheck:KX}}),_4=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},v4=$([g4,GY],_4),Loe=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:FU(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:FU(e,t.dataKey)})),y4=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:s,dataEndIndex:c}=r,l=Loe(e,t,n);return i&&t?.dataKey!=null&&a.length>0?[...o.slice(s,c+1).map(e=>({value:FU(e,t.dataKey)})).filter(e=>e.value!=null),...l]:l},b4=$([v4,n4,u4,GY,h4,g4],y4);function x4(e){if(SR(e)||e instanceof Date){var t=Number(e);if(OU(t))return t}}function S4(e){if(Array.isArray(e)){var t=[x4(e[0]),x4(e[1])];return YY(t)?t:void 0}var n=x4(e);if(n!=null)return[n,n]}function C4(e){return e.map(x4).filter(jR)}function Roe(e,t){var n=x4(e),r=x4(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var zoe=$([b4],e=>e?.map(e=>e.value).sort(Roe));function w4(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function Boe(e,t,n){if(!n||!n.length)return[];var r;if(typeof t==`number`&&!yR(t))r=t;else if(Array.isArray(t)){var i=C4(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:C4(n.flatMap(t=>{var n=FU(e,t.dataKey),i,a;if(Array.isArray(n)?[i,a]=n:i=a=n,!(!OU(i)||!OU(a)))return[r-i,r+a]}))}var T4=e=>i4(e,JX(e),YX(e)),E4=$([T4],e=>e?.dataKey),Voe=$([d4,GY,T4],UX),D4=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:HU(e,o.map(HX),n),graphicalItems:o}]}))},O4=$([Voe,d4,pX,mX],D4),k4=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=YU(e,i,a);if(o==null||o[0]!==0||o[1]!==0)return o}},Hoe=$([n4],e=>e.allowDataOverflow),A4=e=>{if(e==null||!(`domain`in e))return q2;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=C4(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??q2},j4=$([n4],A4),M4=$([j4,Hoe],ZY),Uoe=$([O4,UY,BX,M4],k4,{memoizeOptions:{resultEqualityCheck:GX}}),N4=e=>e.errorBars,Woe=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>w4(n,e)),P4=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},F4=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],o,s;if(n.length>0&&n.forEach(e=>{var n=e.data==null?a:[...e.data],c=r[e.id]?.filter(e=>w4(i,e));n.forEach(n=>{var r=FU(n,t.dataKey??e.dataKey),i=Boe(n,r,c);if(i.length>=2){var a=Math.min(...i),l=Math.max(...i);(o==null||a<o)&&(o=a),(s==null||l>s)&&(s=l)}var u=S4(r);u!=null&&(o=o==null?u[0]:Math.min(o,u[0]),s=s==null?u[1]:Math.max(s,u[1]))})}),t?.dataKey!=null&&n.length===0&&e.forEach(e=>{var n=S4(FU(e,t.dataKey));n!=null&&(o=o==null?n[0]:Math.min(o,n[0]),s=s==null?n[1]:Math.max(s,n[1]))}),OU(o)&&OU(s))return[o,s]},Goe=$([v4,n4,p4,N4,BX,qY],F4,{memoizeOptions:{resultEqualityCheck:GX}});function Koe(e){var{value:t}=e;if(SR(t)||t instanceof Date)return t}var qoe=(e,t,n)=>{var r=e.map(Koe).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&ER(r))?(0,V2.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},I4=e=>e.referenceElements.dots,L4=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),Joe=$([I4,BX,VX],L4),R4=e=>e.referenceElements.areas,Yoe=$([R4,BX,VX],L4),z4=e=>e.referenceElements.lines,Xoe=$([z4,BX,VX],L4),B4=(e,t)=>{if(e!=null){var n=C4(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Zoe=$(Joe,BX,B4),V4=(e,t)=>{if(e!=null){var n=C4(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Qoe=$([Yoe,BX],V4);function $oe(e){if(e.x!=null)return C4([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:C4(t)}function ese(e){if(e.y!=null)return C4([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:C4(t)}var H4=(e,t)=>{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?$oe(e):ese(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},tse=$(Zoe,$([Xoe,BX],H4),Qoe,(e,t,n)=>P4(e,n,t)),U4=(e,t,n,r,i,a,o,s)=>n??QY(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?P4(r,a,i):P4(a,i),e.allowDataOverflow),nse=$([n4,j4,M4,Uoe,Goe,tse,oG,BX],U4,{memoizeOptions:{resultEqualityCheck:GX}}),rse=[0,1],W4=(e,t,n,r,i,a,o)=>{if(e!=null&&n!=null&&n.length!==0||o!==void 0){var{dataKey:s,type:c}=e,l=LU(t,a);return l&&s==null?(0,V2.default)(0,n?.length??0):c===`category`?qoe(r,e,l):i===`expand`&&!l?rse:o}},G4=$([n4,oG,v4,b4,pX,BX,nse],W4),K4=$([n4,a4,hX],L2),q4=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=A4(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&YY(e)){if(a)return sX(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return cX(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&YY(e))return sX(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&YY(e))return cX(e,t.tickCount,t.allowDecimals,`adaptive`)}}},J4=$([G4,i4,K4],q4),Y4=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&YY(t)&&Array.isArray(n)&&n.length>0){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},ise=$([n4,G4,J4,BX],Y4),X4=$($(b4,n4,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(C4(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(c!=null&&l!=null){var u=l-c;n=Math.min(n,u)}}return n/o}}),oG,dX,bW,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!OU(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=TR(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),ase=(e,t,n)=>{var r=X2(e,t);return r==null||typeof r.padding!=`string`?0:X4(e,`xAxis`,t,n,r.padding)},ose=(e,t,n)=>{var r=$2(e,t);return r==null||typeof r.padding!=`string`?0:X4(e,`yAxis`,t,n,r.padding)},sse=$(X2,ase,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),cse=$($2,ose,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),lse=$([bW,sse,EW,TW,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),use=$([bW,oG,cse,EW,TW,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Z4=(e,t,n,r)=>{switch(t){case`xAxis`:return lse(e,n,r);case`yAxis`:return use(e,n,r);case`zAxis`:return t4(e,n)?.range;case`angleAxis`:return LX(e);case`radiusAxis`:return RX(e,n);default:return}},Q4=$([n4,Z4],SX),$4=$([n4,K4,$([K4,ise],ZX),Q4],P2),e3=(e,t,n,r)=>{if(n!=null&&n.dataKey!=null){var{type:i,scale:a}=n;if(LU(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},t3=$([oG,b4,i4,BX],e3),n3=$([$4],XX);$([$4],B2),$([$4,zoe],z2),$([u4,N4,BX],Woe);function r3(e,t){return e.id<t.id?-1:+(e.id>t.id)}var i3=(e,t)=>t,a3=(e,t,n)=>n,dse=$(sW,i3,a3,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(r3)),fse=$(cW,i3,a3,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(r3)),o3=(e,t)=>({width:e.width,height:t.height}),pse=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),s3=$(bW,X2,o3),mse=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},hse=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},gse=$(iW,bW,dse,i3,a3,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=o3(t,n);o??=mse(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),_se=$(rW,bW,fse,i3,a3,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=pse(t,n);o??=hse(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),vse=$([bW,X2,(e,t)=>{var n=X2(e,t);if(n!=null)return gse(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),yse=$([bW,$2,(e,t)=>{var n=$2(e,t);if(n!=null)return _se(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),c3=$(bW,$2,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),l3=(e,t,n)=>{switch(t){case`xAxis`:return s3(e,n).width;case`yAxis`:return c3(e,n).height;default:return}},u3=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=LU(e,r),c=t.map(e=>e.value),l=c.filter(e=>e!=null);if(o&&s&&a===`category`&&i&&ER(l))return c}},d3=$([oG,b4,n4,BX],u3),f3=$([oG,r4,K4,n3,d3,t3,Z4,J4,BX],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=LU(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),p3=$([oG,i4,K4,n3,J4,Z4,d3,t3,BX],(e,t,n,r,i,a,o,s,c)=>{if(t!=null&&r!=null){var l=LU(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?vR(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return OU(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(jR):l&&s?s.map((e,t)=>{var n=r.map(e);return OU(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(jR):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return OU(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(jR):r.domain().map((e,t)=>{var n=r.map(e);return OU(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(jR)}}),m3=$([oG,i4,n3,Z4,d3,t3,BX],(e,t,n,r,i,a,o)=>{if(t!=null&&n!=null&&r!=null&&r[0]!==r[1]){var s=LU(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?vR(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return OU(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(jR):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return OU(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(jR):n.domain().map((e,t)=>{var r=n.map(e);return OU(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(jR)}}),h3=$(n4,n3,(e,t)=>{if(e!=null&&t!=null)return U2(U2({},e),{},{scale:t})});$((e,t,n)=>t4(e,n),$([$([n4,K4,G4,Q4],P2)],XX),(e,t)=>{if(e!=null&&t!=null)return U2(U2({},e),{},{scale:t})});var bse=$([oG,sW,cW],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var g3=e=>e.options.defaultTooltipEventType,_3=e=>e.options.validateTooltipEventTypes;function v3(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function y3(e,t){return v3(t,g3(e),_3(e))}function xse(e){return eB(t=>y3(t,e))}var b3=(e,t)=>{var n,r=Number(t);if(!(yR(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},Sse=e=>e.tooltip.settings,x3={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},S3=NH({name:`tooltip`,initialState:{itemInteraction:{click:x3,hover:x3},axisInteraction:{click:x3,hover:x3},keyboardInteraction:x3,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(sK(t.payload))},prepare:vH()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=iH(e).tooltipItemPayloads.indexOf(sK(n));i>-1&&(e.tooltipItemPayloads[i]=sK(r))},prepare:vH()},removeTooltipEntrySettings:{reducer(e,t){var n=iH(e).tooltipItemPayloads.indexOf(sK(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:vH()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Cse,replaceTooltipEntrySettings:wse,removeTooltipEntrySettings:Tse,setTooltipSettingsState:Ese,setActiveMouseOverItemIndex:C3,mouseLeaveItem:Dse,mouseLeaveChart:w3,setActiveClickItemIndex:Ose,setMouseOverAxisIndex:T3,setMouseClickAxisIndex:kse,setSyncInteraction:E3,setKeyboardInteraction:D3}=S3.actions,Ase=S3.reducer;function O3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O3(Object(n),!0).forEach(function(t){jse(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jse(e,t,n){return(t=Mse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mse(e){var t=Nse(e,`string`);return typeof t==`symbol`?t:t+``}function Nse(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pse(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function Fse(e){return e.index!=null}var A3=(e,t,n,r)=>{if(t==null)return x3;var i=Pse(e,t,n);if(i==null)return x3;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Fse(i)){if(a)return k3(k3({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return k3(k3({},x3),{},{coordinate:i.coordinate})};function Ise(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Lse(e,t){var n=Ise(e),r=t[0],i=t[1];return n!==void 0&&n>=Math.min(r,i)&&n<=Math.max(r,i)}function Rse(e,t,n){if(n==null||t==null)return!0;var r=FU(e,t);return r==null||!YY(n)||Lse(r,n)}var j3=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!OU(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||Rse(l,n,r)?String(c):null},M3=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},N3=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},P3=e=>e.options.tooltipPayloadSearcher,F3=e=>e.tooltip;function I3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?I3(Object(n),!0).forEach(function(t){zse(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zse(e,t,n){return(t=Bse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bse(e){var t=Vse(e,`string`);return typeof t==`symbol`?t:t+``}function Vse(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Hse(e){if(typeof e==`string`||typeof e==`number`)return e}function Use(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function Wse(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function R3(e){if(typeof e==`string`)return e}function Gse(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?Hse(e.name):void 0,unit:`unit`in e?Use(e.unit):void 0,dataKey:`dataKey`in e?Wse(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?R3(e.color):void 0,fill:`fill`in e?R3(e.fill):void 0}}function Kse(e,t){return e??t}var z3=(e,t,n,r,i,a,o)=>{if(t!=null&&a!=null){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=Kse(d,s),m=Array.isArray(p)?DU(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?OR(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=Gse(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=L3(L3({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push($U({tooltipEntrySettings:o,dataKey:i,payload:a,value:FU(a,i),name:r==null?void 0:String(r)}))}):e.push($U({tooltipEntrySettings:f,dataKey:h,payload:_,value:FU(_,h),name:FU(_,g)??f?.name})),e},[])}},B3=$([T4,a4,hX],L2),V3=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),T4,$([JX,YX],o4)],l4,{memoizeOptions:{resultEqualityCheck:KX}}),qse=$([V3],e=>e.filter(WX)),H3=$([V3],m4,{memoizeOptions:{resultEqualityCheck:KX}}),Jse=$([V3],e=>e.some(e=>!e.data)),U3=$([H3,UY],_4),Yse=$([qse,UY,T4],UX),W3=$([U3,T4,V3,UY,Jse,H3],y4),G3=$([T4],A4),K3=$([G3,$([T4],e=>e.allowDataOverflow)],ZY),Xse=$([$([Yse,$([V3],e=>e.filter(WX)),pX,mX],D4),UY,JX,K3],k4),Zse=$([U3,T4,$([V3],f4),N4,JX,JY],F4,{memoizeOptions:{resultEqualityCheck:GX}}),Qse=$([$([I4,JX,YX],L4),JX],B4),$se=$([$([R4,JX,YX],L4),JX],V4),q3=$([T4,oG,U3,W3,pX,JX,$([T4,G3,K3,Xse,Zse,$([Qse,$([$([z4,JX,YX],L4),JX],H4),$se],P4),oG,JX],U4)],W4),ece=$([T4,q3,$([q3,T4,B3],q4),JX],Y4),J3=e=>Z4(e,JX(e),YX(e),!1),Y3=$([T4,J3],SX),X3=$([$([T4,B3,ece,Y3],P2)],XX),Z3=$([oG,T4,B3,X3,J3,$([oG,W3,T4,JX],u3),$([oG,W3,T4,JX],e3),JX],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=LU(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?vR(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return OU(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(jR):r.domain().map((e,t)=>{var n=r.map(e);return OU(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(jR)}}}),Q3=$([g3,_3,Sse],(e,t,n)=>v3(n.shared,e,t)),$3=e=>e.tooltip.settings.trigger,e6=e=>e.tooltip.settings.defaultIndex,t6=$([F3,Q3,$3,e6],A3),n6=$([t6,U3,E4,q3],j3),r6=$([Z3,n6],b3),i6=$([t6],e=>{if(e)return e.dataKey}),tce=$([t6],e=>{if(e)return e.graphicalItemId}),a6=$([F3,Q3,$3,e6],N3),nce=$([t6,$([rW,iW,oG,bW,Z3,e6,a6],M3)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),rce=$([t6],e=>e?.active??!1),ice=$([$([a6,n6,UY,E4,r6,P3,Q3],z3)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function o6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o6(Object(n),!0).forEach(function(t){ace(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ace(e,t,n){return(t=oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oce(e){var t=sce(e,`string`);return typeof t==`symbol`?t:t+``}function sce(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var cce=()=>eB(T4),lce=()=>{var e=cce(),t=eB(Z3),n=eB(X3);return QU(!e||!n?void 0:s6(s6({},e),{},{scale:n}),t)};function c6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c6(Object(n),!0).forEach(function(t){uce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uce(e,t,n){return(t=dce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dce(e){var t=fce(e,`string`);return typeof t==`symbol`?t:t+``}function fce(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pce=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},mce=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return l6(l6(l6({},r),hY(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return l6(l6(l6({},r),hY(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function hce(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var u6=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(s!=null&&c!=null&&l!=null){if(vR(c-s)!==vR(l-c)){var d=[];if(vR(l-c)===vR(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},gce=()=>eB(hX),d6=(e,t)=>t,f6=(e,t,n)=>n,p6=(e,t,n,r)=>r,_ce=$(Z3,e=>(0,SB.default)(e,e=>e.coordinate)),m6=$([F3,d6,f6,p6],A3),h6=$([m6,U3,E4,q3],j3),vce=(e,t,n)=>{if(t!=null){var r=F3(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},g6=$([F3,d6,f6,p6],N3),_6=$([rW,iW,oG,bW,Z3,p6,g6],M3),yce=$([m6,_6],(e,t)=>e.coordinate??t),v6=$([Z3,h6],b3),bce=$([g6,h6,UY,E4,v6,P3,d6],z3),xce=$([m6,h6],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Sce=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&hce(e,o)){var s=u6(tW(e,t),a,i,n,r),c=pce(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},Cce=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=xY(e,n);if(s){var c=u6(nW(s,t),o,a,r,i),l=mce(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},wce=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?Sce(e,t,r,i,a,o,s):Cce(e,t,n,r,i,a,o)},Tce=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Ece=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(yX));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:qX}});function y6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?y6(Object(n),!0).forEach(function(t){Dce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dce(e,t,n){return(t=Oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oce(e){var t=kce(e,`string`);return typeof t==`symbol`?t:t+``}function kce(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ace={zIndexMap:Object.values(yX).reduce((e,t)=>b6(b6({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},jce=new Set(Object.values(yX));function Mce(e){return jce.has(e)}var x6=NH({name:`zIndex`,initialState:Ace,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:vH()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!Mce(n)&&delete e.zIndexMap[n])},prepare:vH()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=sK(r):e.zIndexMap[n].element=sK(r):e.zIndexMap[n]={consumers:0,element:i?void 0:sK(r),panoramaElement:i?sK(r):void 0}},prepare:vH()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:vH()}}}),{registerZIndexPortal:Nce,unregisterZIndexPortal:S6,registerZIndexPortalElement:Pce,unregisterZIndexPortalElement:Fce}=x6.actions,Ice=x6.reducer;function C6(e){var{zIndex:t,children:n}=e,r=uG()&&t!==void 0&&t!==0,i=wW(),a=(0,v.useRef)(void 0),o=(0,v.useRef)(new Set),s=Xz(),c=eB(e=>Tce(e,t,i));if((0,v.useLayoutEffect)(()=>{if(!r){var e=o.current;e.forEach(e=>{s(S6({zIndex:e}))}),e.clear(),a.current=void 0;return}if(o.current.has(t)||(s(Nce({zIndex:t})),o.current.add(t)),c){a.current=c;var n=o.current;n.forEach(e=>{e!==t&&(s(S6({zIndex:e})),n.delete(e))})}},[s,t,r,c]),(0,v.useLayoutEffect)(()=>{var e=o.current;return()=>{e.forEach(e=>{s(S6({zIndex:e}))}),e.clear()}},[s]),!r)return n;var l=c??a.current;return l?(0,xu.createPortal)(n,l):null}function w6(){return w6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w6.apply(null,arguments)}function T6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T6(Object(n),!0).forEach(function(t){Lce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lce(e,t,n){return(t=Rce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rce(e){var t=zce(e,`string`);return typeof t==`symbol`?t:t+``}function zce(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bce(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return(0,v.isValidElement)(t)?(0,v.cloneElement)(t,r):(0,v.createElement)(n,r)}function Vce(e){var{coordinate:t,payload:n,index:r,offset:i,tooltipAxisBandSize:a,layout:o,cursor:s,tooltipEventType:c,chartName:l}=e,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=Xq,h=yX.cursorLine;else if(l===`BarChart`)p=Zq(o,u,i,a),m=sY,h=yX.cursorRectangle;else if(o===`radial`&&JR(u)){var{cx:g,cy:_,radius:y,startAngle:b,endAngle:x}=SY(u);p={cx:g,cy:_,startAngle:b,endAngle:x,innerRadius:y,outerRadius:y},m=LY,h=yX.cursorLine}else p={points:RY(o,u,i)},m=zq,h=yX.cursorLine;var S=typeof s==`object`&&`className`in s?s.className:void 0,C=E6(E6(E6(E6({stroke:`#ccc`,pointerEvents:`none`},i),p),ZI(s)),{},{payload:d,payloadIndex:f,className:ys(`recharts-tooltip-cursor`,S)});return v.createElement(C6,{zIndex:e.zIndex??h},v.createElement(Bce,{cursor:s,cursorComp:m,cursorProps:C}))}function Hce(e){var t=lce(),n=nG(),r=sG(),i=gce();return t==null||n==null||r==null||i==null?null:v.createElement(Vce,w6({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var D6=(0,v.createContext)(null),Uce=()=>(0,v.useContext)(D6),Wce=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,O6=new Wce,k6=`recharts.syncEvent.tooltip`,A6=`recharts.syncEvent.brush`,j6=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!yR(n))return e[n]}},M6=NH({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),Gce=M6.reducer,{createEventEmitter:Kce}=M6.actions;function qce(e){return e.tooltip.syncInteraction}var N6=NH({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=sK(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:P6,setDataStartEndIndexes:Jce,setComputedData:Yce}=N6.actions,Xce=N6.reducer,Zce=[`x`,`y`];function F6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?F6(Object(n),!0).forEach(function(t){Qce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qce(e,t,n){return(t=$ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ce(e){var t=ele(e,`string`);return typeof t==`symbol`?t:t+``}function ele(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tle(e,t){if(e==null)return{};var n,r,i=nle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rle(){var e=eB(gX),t=eB(vX),n=Xz(),r=eB(_X),i=eB(Z3),a=sG(),o=eG(),s=eB(e=>e.rootProps.className);(0,v.useEffect)(()=>{if(e==null)return MR;var s=(s,c,l)=>{if(t!==l&&e===s){if(c.payload.active===!1){n(E3({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=tle(d,Zce),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=I6(I6({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(I6(I6({},c),{},{payload:I6(I6({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(x==null||o==null){n(E3({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(b==null){n(E3({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(E3({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return O6.on(k6,s),()=>{O6.off(k6,s)}},[s,n,t,e,r,i,a,o])}function ile(){var e=eB(gX),t=eB(vX),n=Xz();(0,v.useEffect)(()=>{if(e==null)return MR;var r=(r,i,a)=>{t!==a&&e===r&&n(Jce(i))};return O6.on(A6,r),()=>{O6.off(A6,r)}},[n,t,e])}function ale(){var e=Xz();(0,v.useEffect)(()=>{e(Kce())},[e]),rle(),ile()}function ole(e,t,n,r,i,a){var o=eB(n=>vce(n,e,t)),s=eB(tce),c=eB(vX),l=eB(gX),u=eB(_X),d=eB(qce)?.sourceViewBox!=null,f=eG();(0,v.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=E3({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});O6.emit(k6,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}function L6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L6(Object(n),!0).forEach(function(t){sle(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sle(e,t,n){return(t=cle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cle(e){var t=lle(e,`string`);return typeof t==`symbol`?t:t+``}function lle(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ule(e){return e.dataKey}function dle(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e==`function`?v.createElement(e,t):v.createElement(sq,t)}var z6=[],fle={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function B6(e){var t=rz(e,fle),{active:n,allowEscapeViewBox:r,animationDuration:i,animationEasing:a,content:o,filterNull:s,isAnimationActive:c,offset:l,payloadUniqBy:u,position:d,reverseDirection:f,useTranslate3d:p,wrapperStyle:m,cursor:h,shared:g,trigger:_,defaultIndex:y,portal:b,axisId:x}=t,S=Xz(),C=typeof y==`number`?String(y):y;(0,v.useEffect)(()=>{S(Ese({shared:g,trigger:_,axisId:x,active:n,defaultIndex:C}))},[S,g,_,x,n,C]);var w=eG(),T=wq(),E=xse(g),{activeIndex:D,isActive:O}=eB(e=>xce(e,E,_,C))??{},k=eB(e=>bce(e,E,_,C)),A=eB(e=>v6(e,E,_,C)),j=eB(e=>yce(e,E,_,C)),M=k,N=Uce(),P=n??O??!1,[F,I]=OB([M,P]),L=E===`axis`?A:void 0;ole(E,_,j,L,D,P);var R=b??N;if(R==null||w==null||E==null)return null;var z=M??z6;P||(z=z6),s&&z.length&&(z=qz(z.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,ule));var B=z.length>0,V=R6(R6({},t),{},{payload:z,label:L,active:P,activeIndex:D,coordinate:j,accessibilityLayer:T}),H=v.createElement(Cq,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:P,coordinate:j,hasPayload:B,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:w,wrapperStyle:m,lastBoundingBox:F,innerRef:I,hasPortalFromProps:!!b},dle(o,V));return v.createElement(v.Fragment,null,(0,xu.createPortal)(H,R),P&&v.createElement(Hce,{cursor:h,tooltipEventType:E,coordinate:j,payload:z,index:D}))}var V6=e=>null;V6.displayName=`Cell`;function ple(e,t,n){return(t=mle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mle(e){var t=hle(e,`string`);return typeof t==`symbol`?t:t+``}function hle(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var gle=class{constructor(e){ple(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function H6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?H6(Object(n),!0).forEach(function(t){vle(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H6(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vle(e,t,n){return(t=yle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yle(e){var t=ble(e,`string`);return typeof t==`symbol`?t:t+``}function ble(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var U6=_le({},{cacheSize:2e3,enableCache:!0}),W6=new gle(U6.cacheSize),xle={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},G6=`recharts_measurement_span`;function Sle(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var K6=(e,t)=>{try{var n=document.getElementById(G6);n||(n=document.createElement(`span`),n.setAttribute(`id`,G6),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,xle,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},q6=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||mq.isSsr)return{width:0,height:0};if(!U6.enableCache)return K6(e,t);var n=Sle(e,t),r=W6.get(n);if(r)return r;var i=K6(e,t);return W6.set(n,i),i},J6;function Cle(e,t,n){return(t=wle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=Tle(e,`string`);return typeof t==`symbol`?t:t+``}function Tle(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Y6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,X6=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Ele=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Dle=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Ole={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},kle=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function Ale(e){return kle.includes(e)}var Z6=`NaN`;function jle(e,t){return e*Ole[t]}var Q6=class e{static parse(t){var[,n,r]=Dle.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,yR(e)&&(this.unit=``),t!==``&&!Ele.test(t)&&(this.num=NaN,this.unit=``),Ale(t)&&(this.num=jle(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return yR(this.num)}};J6=Q6,Cle(Q6,`NaN`,new J6(NaN,``));function $6(e){if(e==null||e.includes(Z6))return Z6;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=Y6.exec(t)??[],a=Q6.parse(n??``),o=Q6.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return Z6;t=t.replace(Y6,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=X6.exec(t)??[],d=Q6.parse(c??``),f=Q6.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return Z6;t=t.replace(X6,p.toString())}return t}var e8=/\(([^()]*)\)/;function Mle(e){for(var t=e,n;(n=e8.exec(t))!=null;){var[,r]=n;t=t.replace(e8,$6(r))}return t}function Nle(e){var t=e.replace(/\s+/g,``);return t=Mle(t),t=$6(t),t}function Ple(e){try{return Nle(e)}catch{return Z6}}function t8(e){var t=Ple(e.slice(5,-1));return t===Z6?``:t}var Fle=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],Ile=[`dx`,`dy`,`angle`,`className`,`breakAll`];function n8(){return n8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n8.apply(null,arguments)}function r8(e,t){if(e==null)return{};var n,r,i=Lle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var i8=/[ \f\n\r\t\v\u2028\u2029]+/,a8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];return kR(t)||(i=n?t.toString().split(``):t.toString().split(i8)),{wordsWithComputedWidth:i.map(e=>({word:e,width:q6(e,r).width})),spaceWidth:n?0:q6(`\xA0`,r).width}}catch{return null}};function o8(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function Rle(e){return kR(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var s8=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),c8=e=>e.reduce((e,t)=>e.width>t.width?e:t),zle=`…`,l8=(e,t,n,r,i,a,o,s)=>{var c=a8({breakAll:n,style:r,children:e.slice(0,t)+zle});if(!c)return[!1,[]];var l=s8(c.wordsWithComputedWidth,a,o,s);return[l.length>i||c8(l).width>Number(a),l]},Ble=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=xR(a),u=String(o),d=s8(t,r,n,i);if(!l||i||!(d.length>a||c8(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=l8(u,g-1,c,s,a,r,n,i),[y]=l8(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},u8=e=>[{words:kR(e)?[]:e.toString().split(i8),width:void 0}],Vle=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!mq.isSsr){var s,c,l=a8({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return u8(r);return Ble({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return u8(r)},d8=`#808080`,Hle={angle:0,breakAll:!1,capHeight:`0.71em`,fill:d8,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},f8=(0,v.forwardRef)((e,t)=>{var n=rz(e,Hle),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=r8(n,Fle),f=(0,v.useMemo)(()=>Vle({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:h,className:g,breakAll:_}=d,y=r8(d,Ile);if(!SR(r)||!SR(i)||f.length===0)return null;var b=Number(r)+(xR(p)?p:0),x=Number(i)+(xR(m)?m:0);if(!OU(b)||!OU(x))return null;var S;switch(u){case`start`:S=t8(`calc(${o})`);break;case`middle`:S=t8(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:S=t8(`calc(${f.length-1} * -${a})`)}var C=[],w=f[0];if(c&&w!=null){var T=w.width,{width:E}=d;C.push(`scale(${xR(E)&&xR(T)?E/T:1})`)}return h&&C.push(`rotate(${h}, ${b}, ${x})`),C.length&&(y.transform=C.join(` `)),v.createElement(`text`,n8({},QI(y),{ref:t,x:b,y:x,className:ys(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?d8:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return v.createElement(`tspan`,{x:b,dy:t===0?S:a,key:`${n}-${t}`},n)}))});f8.displayName=`Text`;function p8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p8(Object(n),!0).forEach(function(t){Ule(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ule(e,t,n){return(t=Wle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wle(e){var t=Gle(e,`string`);return typeof t==`symbol`?t:t+``}function Gle(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Kle=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=$W(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?m8({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?m8({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?m8({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?m8({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?m8({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?m8({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?m8({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?m8({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(xR(n.x)||bR(n.x))&&(xR(n.y)||bR(n.y))?m8({x:o+TR(n.x,m),y:s+TR(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):m8({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},qle=[`labelRef`],Jle=[`content`];function h8(e,t){if(e==null)return{};var n,r,i=Yle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function g8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g8(Object(n),!0).forEach(function(t){Xle(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xle(e,t,n){return(t=Zle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zle(e){var t=Qle(e,`string`);return typeof t==`symbol`?t:t+``}function Qle(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function v8(){return v8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v8.apply(null,arguments)}var y8=(0,v.createContext)(null),$le=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,v.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return v.createElement(y8.Provider,{value:c},s)},b8=()=>{var e=(0,v.useContext)(y8),t=eG();return e||(t?$W(t):void 0)},eue=(0,v.createContext)(null),tue=()=>{var e=(0,v.useContext)(eue),t=eB(zX);return e||t},nue=e=>{var{value:t,formatter:n}=e,r=kR(e.children)?t:e.children;return typeof n==`function`?n(r):r},x8=e=>e!=null&&typeof e==`function`,rue=(e,t)=>vR(t-e)*Math.min(Math.abs(t-e),360),iue=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,h=rue(d,f),g=h>=0?1:-1,_,y;switch(t){case`insideStart`:_=d+g*a,y=p;break;case`insideEnd`:_=f-g*a,y=!p;break;case`end`:_=f+g*a,y=p;break;default:throw Error(`Unsupported position ${t}`)}y=h<=0?y:!y;var b=hY(s,c,m,_),x=hY(s,c,m,_+(y?1:-1)*359),S=`M${b.x},${b.y}
141
+ A${m},${m},0,1,${+!y},
142
+ ${x.x},${x.y}`,C=kR(e.id)?wR(`recharts-radial-line-`):e.id;return v.createElement(`text`,v8({},r,{dominantBaseline:`central`,className:ys(`recharts-radial-bar-label`,o)}),v.createElement(`defs`,null,v.createElement(`path`,{id:C,d:S})),v.createElement(`textPath`,{xlinkHref:`#${C}`},n))},aue=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=hY(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=hY(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},S8=e=>e!=null&&`cx`in e&&xR(e.cx),oue={angle:0,offset:5,zIndex:yX.label,position:`middle`,textBreakAll:!1};function sue(e){if(!S8(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function C8(e){var t=rz(e,oue),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=tue(),f=b8(),p=n==null?i===`center`?f:d??f:S8(n)?n:$W(n),m,h,g=sue(p);if(!p||kR(a)&&kR(o)&&!(0,v.isValidElement)(s)&&typeof s!=`function`)return null;var _=_8(_8({},t),{},{viewBox:p});if((0,v.isValidElement)(s)){var{labelRef:y}=_,b=h8(_,qle);return(0,v.cloneElement)(s,b)}if(typeof s==`function`){var{content:x}=_,S=h8(_,Jle);if(m=(0,v.createElement)(s,S),(0,v.isValidElement)(m))return m}else m=nue(t);var C=QI(t);if(S8(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return iue(t,i,m,C,p);h=aue(p,t.offset,t.position)}else{if(!g)return null;var w=Kle({viewBox:g,position:i,offset:t.offset,parentViewBox:S8(r)?void 0:r,clamp:!0});h=_8(_8({x:w.x,y:w.y,textAnchor:w.horizontalAnchor,verticalAnchor:w.verticalAnchor},w.width===void 0?{}:{width:w.width}),w.height===void 0?{}:{height:w.height})}return v.createElement(C6,{zIndex:t.zIndex},v.createElement(f8,v8({ref:u,className:ys(`recharts-label`,c)},C,h,{textAnchor:o8(C.textAnchor)?C.textAnchor:h.textAnchor,breakAll:l}),m))}C8.displayName=`Label`;var cue=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(C8,v8({key:`label-implicit`},r)):SR(e)?v.createElement(C8,v8({key:`label-implicit`,value:e},r)):(0,v.isValidElement)(e)?e.type===C8?(0,v.cloneElement)(e,_8({key:`label-implicit`},r)):v.createElement(C8,v8({key:`label-implicit`,content:e},r)):x8(e)?v.createElement(C8,v8({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?v.createElement(C8,v8({},e,{key:`label-implicit`},r)):null};function lue(e){var{label:t,labelRef:n}=e;return cue(t,b8(),n)||null}var uue=[`valueAccessor`],due=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function w8(){return w8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w8.apply(null,arguments)}function T8(e,t){if(e==null)return{};var n,r,i=fue(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var pue=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Rle(t))return t},E8=(0,v.createContext)(void 0),D8=E8.Provider,O8=(0,v.createContext)(void 0);O8.Provider;function mue(){return(0,v.useContext)(E8)}function hue(){return(0,v.useContext)(O8)}function k8(e){var{valueAccessor:t=pue}=e,n=T8(e,uue),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=T8(n,due),l=mue(),u=hue(),d=l||u;return!d||!d.length?null:v.createElement(C6,{zIndex:s??yX.label},v.createElement(nL,{className:`recharts-label-list`},d.map((e,i)=>{var s=kR(r)?t(e,i):FU(e.payload,r),l=kR(a)?{}:{id:`${a}-${i}`};return v.createElement(C8,w8({key:`label-${i}`},QI(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}k8.displayName=`LabelList`;function A8(e){var{label:t}=e;return t?t===!0?v.createElement(k8,{key:`labelList-implicit`}):v.isValidElement(t)||x8(t)?v.createElement(k8,{key:`labelList-implicit`,content:t}):typeof t==`object`?v.createElement(k8,w8({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}function j8(){return j8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j8.apply(null,arguments)}var M8=e=>{var{cx:t,cy:n,r,className:i}=e,a=ys(`recharts-dot`,i);return xR(t)&&xR(n)&&xR(r)?v.createElement(`circle`,j8({},XI(e),YR(e),{className:a,cx:t,cy:n,r})):null},N8=NH({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=sK(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=sK(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:gue,removeRadiusAxis:_ue,addAngleAxis:vue,removeAngleAxis:yue}=N8.actions,bue=N8.reducer;function xue(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}var Sue=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),Cue=o(((e,t)=>{t.exports=Sue()}))(),P8=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,F8=null,I8=null,L8=e=>{if(e===F8&&Array.isArray(I8))return I8;var t=[];return v.Children.forEach(e,e=>{kR(e)||((0,Cue.isFragment)(e)?t=t.concat(L8(e.props.children)):t.push(e))}),I8=t,F8=e,t};function wue(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>P8(e)):[P8(t)],L8(e).forEach(e=>{var t=(0,_R.default)(e,`type.displayName`)||(0,_R.default)(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var R8=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0,Tue=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),Eue=o(((e,t)=>{t.exports=Tue().isPlainObject})),Due,Oue,kue,Aue,jue;function z8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?z8(Object(n),!0).forEach(function(t){Mue(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mue(e,t,n){return(t=Nue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nue(e){var t=Pue(e,`string`);return typeof t==`symbol`?t:t+``}function Pue(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function V8(){return V8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V8.apply(null,arguments)}function H8(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var U8=(e,t,n,r,i)=>{var a=n-r,o=gR(Due||=H8([`M `,`,`,``]),e,t);return o+=gR(Oue||=H8([`L `,`,`,``]),e+n,t),o+=gR(kue||=H8([`L `,`,`,``]),e+n-a/2,t+i),o+=gR(Aue||=H8([`L `,`,`,``]),e+n-a/2-r,t+i),o+=gR(jue||=H8([`L `,`,`,` Z`]),e,t),o},Fue={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Iue=e=>{var t=rz(e,Fue),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,v.useRef)(null),[p,m]=(0,v.useState)(-1),h=(0,v.useRef)(i),g=(0,v.useRef)(a),_=(0,v.useRef)(o),y=(0,v.useRef)(n),b=(0,v.useRef)(r),x=LJ(e,`trapezoid-`);if((0,v.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var S=ys(`recharts-trapezoid`,s);if(!d)return v.createElement(`g`,null,v.createElement(`path`,V8({},QI(t),{className:S,d:U8(n,r,i,a,o)})));var C=h.current,w=g.current,T=_.current,E=y.current,D=b.current,O=`0px ${p===-1?1:p}px`,k=`${p}px ${p}px`,A=iJ([`strokeDasharray`],l,c);return v.createElement(IJ,{animationId:x,key:x,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=DR(C,i,e),c=DR(w,a,e),l=DR(T,o,e),u=DR(E,n,e),d=DR(D,r,e);f.current&&(h.current=s,g.current=c,_.current=l,y.current=u,b.current=d);var p=e>0?{transition:A,strokeDasharray:k}:{strokeDasharray:O};return v.createElement(`path`,V8({},QI(t),{className:S,d:U8(u,d,s,c,l),ref:f,style:B8(B8({},p),t.style)}))})},Lue=l(Eue()),Rue=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function zue(e,t){if(e==null)return{};var n,r,i=Bue(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function W8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?W8(Object(n),!0).forEach(function(t){Vue(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vue(e,t,n){return(t=Hue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hue(e){var t=Uue(e,`string`);return typeof t==`symbol`?t:t+``}function Uue(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wue(e,t){return G8(G8({},t),e)}function Gue(e,t){return e===`symbols`}function K8(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return v.createElement(sY,n);case`trapezoid`:return v.createElement(Iue,n);case`sector`:return v.createElement(LY,n);case`symbols`:if(Gue(t,n))return v.createElement(qR,n);break;case`curve`:return v.createElement(zq,n);default:return null}}function Kue(e){return(0,v.isValidElement)(e)?e.props:e}function q8(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=zue(e,Rue),o;if((0,v.isValidElement)(t))o=(0,v.cloneElement)(t,G8(G8({},a),Kue(t)));else if(typeof t==`function`)o=t(a,a.index);else if((0,Lue.default)(t)&&typeof t!=`boolean`){var s=Wue(t,a);o=v.createElement(K8,{shapeType:n,elementProps:s})}else{var c=a;o=v.createElement(K8,{shapeType:n,elementProps:c})}return a.isActive?v.createElement(nL,{className:r},o):v.createElement(nL,{className:i},o)}var J8=(e,t,n)=>{var r=Xz();return(i,a)=>o=>{e?.(i,a,o),r(C3({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Y8=e=>{var t=Xz();return(n,r)=>i=>{e?.(n,r,i),t(Dse())}},X8=(e,t,n)=>{var r=Xz();return(i,a)=>o=>{e?.(i,a,o),r(Ose({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Z8(e){var{tooltipEntrySettings:t}=e,n=Xz(),r=wW(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(Cse(t)):i.current!==t&&n(wse({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(Tse(i.current)),null)},[n]),null}function Q8(e){var{legendPayload:t}=e,n=Xz(),r=wW(),i=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{r||(i.current===null?n(dK(t)):i.current!==t&&n(fK({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,v.useLayoutEffect)(()=>()=>{i.current&&=(n(pK(i.current)),null)},[n]),null}var que=v.useId??(()=>{var[e]=v.useState(()=>wR(`uid-`));return e});function Jue(e,t){var n=que();return t||(e?`${e}-${n}`:n)}var Yue=(0,v.createContext)(void 0),$8=e=>{var{id:t,type:n,children:r}=e,i=Jue(`recharts-${n}`,t);return v.createElement(Yue.Provider,{value:i},r(i))},e5=NH({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(sK(t.payload))},prepare:vH()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=iH(e).cartesianItems.indexOf(sK(n));i>-1&&(e.cartesianItems[i]=sK(r))},prepare:vH()},removeCartesianGraphicalItem:{reducer(e,t){var n=iH(e).cartesianItems.indexOf(sK(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:vH()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(sK(t.payload))},prepare:vH()},removePolarGraphicalItem:{reducer(e,t){var n=iH(e).polarItems.indexOf(sK(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:vH()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=iH(e).polarItems.indexOf(sK(n));i>-1&&(e.polarItems[i]=sK(r))},prepare:vH()}}}),{addCartesianGraphicalItem:Xue,replaceCartesianGraphicalItem:Zue,removeCartesianGraphicalItem:Que,addPolarGraphicalItem:$ue,removePolarGraphicalItem:ede,replacePolarGraphicalItem:tde}=e5.actions,nde=e5.reducer,t5=(0,v.memo)(e=>{var t=Xz(),n=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{n.current===null?t(Xue(e)):n.current!==e&&t(Zue({prev:n.current,next:e})),n.current=e},[t,e]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(Que(n.current)),null)},[t]),null}),rde=[`points`];function n5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?n5(Object(n),!0).forEach(function(t){ide(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ide(e,t,n){return(t=ade(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ade(e){var t=ode(e,`string`);return typeof t==`symbol`?t:t+``}function ode(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function i5(){return i5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i5.apply(null,arguments)}function sde(e,t){if(e==null)return{};var n,r,i=cde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lde(e){var{option:t,dotProps:n,className:r}=e;if((0,v.isValidElement)(t))return(0,v.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=ys(r,typeof t==`boolean`?``:t.className),a=n??{},{points:o}=a,s=sde(a,rde);return v.createElement(M8,i5({},s,{className:i}))}function ude(e,t){return e==null?!1:t?!0:e.length===1}function dde(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:s,clipPathId:c,zIndex:l=yX.scatter}=e;if(!ude(t,n))return null;var u=R8(n),d=loe(n),f=t.map((e,r)=>{var s=r5(r5(r5({r:3},o),d),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return v.createElement(lde,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),p={};return s&&c!=null&&(p.clipPath=`url(#clipPath-${u?``:`dots-`}${c})`),v.createElement(C6,{zIndex:l},v.createElement(nL,i5({className:r},p),f))}function a5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?a5(Object(n),!0).forEach(function(t){fde(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fde(e,t,n){return(t=pde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pde(e){var t=mde(e,`string`);return typeof t==`symbol`?t:t+``}function mde(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var s5=NH({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=sK(t.payload)},prepare:vH()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=sK(r))},prepare:vH()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:vH()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=sK(t.payload)},prepare:vH()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=sK(r))},prepare:vH()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:vH()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=sK(t.payload)},prepare:vH()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=sK(r))},prepare:vH()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:vH()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&r===a[1]&&r!==i.width&&Math.abs(r-(a[0]??0))<=1)return;var o=[...a,r].slice(-3);e.yAxis[n]=o5(o5({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:hde,replaceXAxis:gde,removeXAxis:_de,addYAxis:vde,replaceYAxis:yde,removeYAxis:bde,addZAxis:xde,replaceZAxis:Sde,removeZAxis:Cde,updateYAxisWidth:wde}=s5.actions,Tde=s5.reducer,Ede=$([$([bW],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),rW,iW],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),c5=()=>eB(Ede),Dde=()=>eB(ice);function l5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?l5(Object(n),!0).forEach(function(t){Ode(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ode(e,t,n){return(t=kde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=Ade(e,`string`);return typeof t==`symbol`?t:t+``}function Ade(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var jde=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var s=u5(u5(u5({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),ZI(i)),YR(i)),c=(0,v.isValidElement)(i)?(0,v.cloneElement)(i,s):typeof i==`function`?i(s):v.createElement(M8,s);return v.createElement(nL,{className:`recharts-active-dot`,clipPath:o},c)};function Mde(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=yX.activeDot}=e,s=eB(n6),c=Dde();if(t==null||c==null)return null;var l=t.find(e=>c.includes(e.payload));return kR(l)?null:v.createElement(C6,{zIndex:o},v.createElement(jde,{point:l,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var d5=(e,t,n)=>{var r=n??e;if(!kR(r))return TR(r,t,0)},Nde=(e,t,n)=>{var r={},i=e.filter(WX),a=e.filter(e=>e.stackId==null),o=i.reduce((e,t)=>{var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},r),s=Object.entries(o).map(e=>{var[r,i]=e;return{stackId:r,dataKeys:i.map(e=>e.dataKey),barSize:d5(t,n,i[0]?.barSize)}}),c=a.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>e!=null),barSize:d5(t,n,e.barSize)}));return[...s,...c]};function f5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?f5(Object(n),!0).forEach(function(t){Pde(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pde(e,t,n){return(t=Fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fde(e){var t=Ide(e,`string`);return typeof t==`symbol`?t:t+``}function Ide(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Lde(e,t,n,r,i){var a=r.length;if(!(a<1)){var o=TR(e,n,0,!0),s,c=[];if(OU(r[0]?.barSize)){var l=!1,u=n/a,d=r.reduce((e,t)=>e+(t.barSize||0),0);d+=(a-1)*o,d>=n&&(d-=(a-1)*o,o=0),d>=n&&u>0&&(l=!0,u*=.9,d=a*u);var f={offset:((n-d)/2>>0)-o,size:0};s=r.reduce((e,t)=>{var n={stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:f.offset+f.size+o,size:l?u:t.barSize??0}},r=[...e,n];return f=n.position,r},c)}else{var p=TR(t,n,0,!0);n-2*p-(a-1)*o<=0&&(o=0);var m=(n-2*p-(a-1)*o)/a;m>1&&(m>>=0);var h=OU(i)?Math.min(m,i):m;s=r.reduce((e,t,n)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(m+o)*n+(m-h)/2,size:h}}],c)}return s}}var Rde=(e,t,n,r,i,a,o)=>{var s=kR(o)?t:o,c=Lde(n,r,i===a?a:i,e,s);return i!==a&&c!=null&&(c=c.map(e=>p5(p5({},e),{},{position:p5(p5({},e.position),{},{offset:e.position.offset-i/2})}))),c},zde=(e,t)=>{var n=HX(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(e=>e.key===n)}}}},Bde=(e,t)=>{if(e!=null&&t!=null){var n=e.find(e=>e.stackId===t.stackId&&t.dataKey!=null&&e.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Vde(e,t){return e&&typeof e==`object`&&`zIndex`in e&&typeof e.zIndex==`number`&&OU(e.zIndex)?e.zIndex:t}var Hde=e=>{var{chartData:t}=e,n=Xz(),r=wW();return(0,v.useEffect)(()=>r?()=>{}:(n(P6(t)),()=>{n(P6(void 0))}),[t,n,r]),null},m5={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},h5=NH({name:`brush`,initialState:m5,reducers:{setBrushSettings(e,t){return t.payload==null?m5:t.payload}}}),{setBrushSettings:Ude}=h5.actions,Wde=h5.reducer;function Gde(e){return(e%180+180)%180}var Kde=function(e){var{width:t,height:n}=e,r=Gde(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},g5=NH({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=iH(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=iH(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(sK(t.payload))},removeLine:(e,t)=>{var n=iH(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:qde,removeDot:Jde,addArea:Yde,removeArea:Xde,addLine:Zde,removeLine:Qde}=g5.actions,$de=g5.reducer,efe=(0,v.createContext)(void 0),tfe=e=>{var{children:t}=e,[n]=(0,v.useState)(`${wR(`recharts`)}-clip`),r=c5();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return v.createElement(efe.Provider,{value:n},v.createElement(`defs`,null,v.createElement(`clipPath`,{id:n},v.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)};function _5(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function nfe(e,t,n){return Kde({width:e.width+t.width,height:e.height+t.height},n)}function rfe(e,t,n){var r=n===`width`,{x:i,y:a,width:o,height:s}=e;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function v5(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function ife(e,t){return _5(e,t+1)}function afe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:s}=t,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:_5(r,l)};var a=c,d,f=()=>(d===void 0&&(d=n(t,a)),d),p=t.coordinate,m=c===0||v5(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function ofe(e,t,n,r,i){var a=(r||[]).slice().length;if(a===0)return[];for(var{start:o,end:s}=t,c=1;c<=a;c++){for(var l=(a-1)%c,u=o,d=!0,f=function(){var t=r[m];if(t==null)return 0;var a=m,o,c=()=>(o===void 0&&(o=n(t,a)),o),f=t.coordinate,p=m===l||v5(e,f,c,u,s);if(!p)return d=!1,1;p&&(u=f+e*(c()/2+i))},p,m=l;m<a&&(p=f(),p===0||p!==1);m+=c);if(d){for(var h=[],g=l;g<a;g+=c){var _=r[g];_!=null&&h.push(_)}return h}}return[]}function y5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?y5(Object(n),!0).forEach(function(t){sfe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sfe(e,t,n){return(t=cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cfe(e){var t=lfe(e,`string`);return typeof t==`symbol`?t:t+``}function lfe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ufe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:s}=t,{end:c}=t,l=function(t){var r=a[t];if(r==null)return 1;var l=r,u,d=()=>(u===void 0&&(u=n(r,t)),u);if(t===o-1){var f=e*(l.coordinate+e*d()/2-c);a[t]=l=b5(b5({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else a[t]=l=b5(b5({},l),{},{tickCoord:l.coordinate});l.tickCoord!=null&&v5(e,l.tickCoord,d,s,c)&&(c=l.tickCoord-e*(d()/2+i),a[t]=b5(b5({},l),{},{isShow:!0}))},u=o-1;u>=0;u--)if(l(u))continue;return a}function dfe(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,{start:c,end:l}=t;if(a){var u=r[s-1];if(u!=null){var d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=b5(b5({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),u.tickCoord!=null&&v5(e,u.tickCoord,()=>d,c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=b5(b5({},u),{},{isShow:!0}))}}for(var p=a?s-1:s,m=function(t){var r=o[t];if(r==null)return 1;var a=r,s,u=()=>(s===void 0&&(s=n(r,t)),s);if(t===0){var d=e*(a.coordinate-e*u()/2-c);o[t]=a=b5(b5({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else o[t]=a=b5(b5({},a),{},{tickCoord:a.coordinate});a.tickCoord!=null&&v5(e,a.tickCoord,u,c,l)&&(c=a.tickCoord+e*(u()/2+i),o[t]=b5(b5({},a),{},{isShow:!0}))},h=0;h<p;h++)if(m(h))continue;return o}function x5(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:s,interval:c,tickFormatter:l,unit:u,angle:d}=e;if(!i||!i.length||!r)return[];if(xR(c)||mq.isSsr)return ife(i,xR(c)?c:0)??[];var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?q6(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=(e,r)=>{var i=typeof l==`function`?l(e.value,r):e.value;return p===`width`?nfe(q6(i,{fontSize:t,letterSpacing:n}),m,d):q6(i,{fontSize:t,letterSpacing:n})[p]},g=i[0],_=i[1],v=i.length>=2&&g!=null&&_!=null?vR(_.coordinate-g.coordinate):1,y=rfe(a,v,p);return c===`equidistantPreserveStart`?afe(v,y,h,i,o):c===`equidistantPreserveEnd`?ofe(v,y,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?dfe(v,y,h,i,o,c===`preserveStartEnd`):ufe(v,y,h,i,o),f.filter(e=>e.isShow))}var ffe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var s=n?n.getBoundingClientRect().width:0,c=i+a,l=o+c+s+(n?r:0);return Math.round(l)}return 0},S5=NH({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=sK(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:pfe,removeRenderedTicks:mfe}=S5.actions,hfe=S5.reducer,gfe=[`axisLine`,`width`,`height`,`className`,`hide`,`ticks`,`axisType`,`axisId`];function _fe(e,t){if(e==null)return{};var n,r,i=vfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function C5(){return C5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C5.apply(null,arguments)}function w5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?w5(Object(n),!0).forEach(function(t){yfe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yfe(e,t,n){return(t=bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bfe(e){var t=xfe(e,`string`);return typeof t==`symbol`?t:t+``}function xfe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var E5={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:`bottom`,ticks:[],stroke:`#666`,tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:`preserveEnd`,zIndex:yX.axis};function Sfe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:s,otherSvgProps:c}=e;if(!s)return null;var l=T5(T5(T5({},c),XI(s)),{},{fill:`none`});if(a===`top`||a===`bottom`){var u=+(a===`top`&&!o||a===`bottom`&&o);l=T5(T5({},l),{},{x1:t,y1:n+u*i,x2:t+r,y2:n+u*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);l=T5(T5({},l),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return v.createElement(`line`,C5({},l,{className:ys(`recharts-cartesian-axis-line`,(0,_R.default)(s,`className`))}))}function Cfe(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h=s?-1:1,g=e.tickSize||o,_=xR(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case`top`:l=u=e.coordinate,f=n+ +!s*i,d=f-h*g,m=d-h*c,p=_;break;case`left`:d=f=e.coordinate,u=t+ +!s*r,l=u-h*g,p=l-h*c,m=_;break;case`right`:d=f=e.coordinate,u=t+ +s*r,l=u+h*g,p=l+h*c,m=_;break;default:l=u=e.coordinate,f=n+ +s*i,d=f+h*g,m=d+h*c,p=_}return{line:{x1:l,y1:d,x2:u,y2:f},tick:{x:p,y:m}}}function wfe(e,t){switch(e){case`left`:return t?`start`:`end`;case`right`:return t?`end`:`start`;default:return`middle`}}function Tfe(e,t){switch(e){case`left`:case`right`:return`middle`;case`top`:return t?`start`:`end`;default:return t?`end`:`start`}}function Efe(e){var{option:t,tickProps:n,value:r}=e,i,a=ys(n.className,`recharts-cartesian-axis-tick-value`);if(v.isValidElement(t))i=v.cloneElement(t,T5(T5({},n),{},{className:a}));else if(typeof t==`function`)i=t(T5(T5({},n),{},{className:a}));else{var o=`recharts-cartesian-axis-tick-value`;typeof t!=`boolean`&&(o=ys(o,xue(t))),i=v.createElement(f8,C5({},n,{className:o}),r)}return i}function Dfe(e){var{ticks:t,axisType:n,axisId:r}=e,i=Xz();return(0,v.useEffect)(()=>r==null||n==null?MR:(i(pfe({ticks:t.map(e=>({value:e.value,coordinate:e.coordinate,offset:e.offset,index:e.index})),axisId:r,axisType:n})),()=>{i(mfe({axisId:r,axisType:n}))}),[i,t,r,n]),null}var Ofe=(0,v.forwardRef)((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:s,padding:c,tickTextProps:l,orientation:u,mirror:d,x:f,y:p,width:m,height:h,tickSize:g,tickMargin:_,fontSize:y,letterSpacing:b,getTicksConfig:x,events:S,axisType:C,axisId:w}=e,T=x5(T5(T5({},x),{},{ticks:n}),y,b),E=XI(x),D=ZI(r),O=o8(E.textAnchor)?E.textAnchor:wfe(u,d),k=Tfe(u,d),A={};typeof i==`object`&&(A=i);var j=T5(T5({},E),{},{fill:`none`},A),M=T.map(e=>T5({entry:e},Cfe(e,f,p,m,h,u,g,d,_))),N=M.map(e=>{var{entry:t,line:n}=e;return v.createElement(nL,{className:`recharts-cartesian-axis-tick`,key:`tick-${t.value}-${t.coordinate}-${t.tickCoord}`},i&&v.createElement(`line`,C5({},j,n,{className:ys(`recharts-cartesian-axis-tick-line`,(0,_R.default)(i,`className`))})))}),P=M.map((e,t)=>{var{entry:n,tick:i}=e,u=T5(T5({},T5(T5(T5(T5({verticalAnchor:k},E),{},{textAnchor:O,stroke:`none`,fill:a},i),{},{index:t,payload:n,visibleTicksCount:T.length,tickFormatter:o,padding:c},l),{},{angle:l?.angle??E.angle??0})),D);return v.createElement(nL,C5({className:`recharts-cartesian-axis-tick-label`,key:`tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`},ZR(S,n,t)),r&&v.createElement(Efe,{option:r,tickProps:u,value:`${typeof o==`function`?o(n.value,t):n.value}${s||``}`}))});return v.createElement(`g`,{className:`recharts-cartesian-axis-ticks recharts-${C}-ticks`},v.createElement(Dfe,{ticks:T,axisId:w,axisType:C}),P.length>0&&v.createElement(C6,{zIndex:yX.label},v.createElement(`g`,{className:`recharts-cartesian-axis-tick-labels recharts-${C}-tick-labels`,ref:t},P)),N.length>0&&v.createElement(`g`,{className:`recharts-cartesian-axis-tick-lines recharts-${C}-tick-lines`},N))}),kfe=(0,v.forwardRef)((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:s,axisType:c,axisId:l}=e,u=_fe(e,gfe),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>ffe({ticks:h.current,label:e.labelRef?.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}));var g=(0,v.useCallback)(e=>{if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`);h.current=t;var n=t[0];if(n){var r=window.getComputedStyle(n),i=r.fontSize,a=r.letterSpacing;(i!==d||a!==p)&&(f(i),m(a))}}},[d,p]);return o||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(C6,{zIndex:e.zIndex},v.createElement(nL,{className:ys(`recharts-cartesian-axis`,a)},v.createElement(Sfe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:XI(e)}),v.createElement(Ofe,{ref:g,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:p,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:l}),v.createElement($le,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(lue,{label:e.label,labelRef:e.labelRef}),e.children)))}),D5=v.forwardRef((e,t)=>{var n=rz(e,E5);return v.createElement(kfe,C5({},n,{ref:t}))});D5.displayName=`CartesianAxis`;var Afe=[`x1`,`y1`,`x2`,`y2`,`key`],jfe=[`offset`],Mfe=[`xAxisId`,`yAxisId`],Nfe=[`xAxisId`,`yAxisId`];function O5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O5(Object(n),!0).forEach(function(t){Pfe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pfe(e,t,n){return(t=Ffe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ffe(e){var t=Ife(e,`string`);return typeof t==`symbol`?t:t+``}function Ife(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function A5(){return A5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A5.apply(null,arguments)}function j5(e,t){if(e==null)return{};var n,r,i=Lfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Rfe=e=>{var{fill:t}=e;if(!t||t===`none`)return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:s}=e;return v.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function M5(e){var{option:t,lineItemProps:n}=e,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t==`function`)r=t(n);else{var{x1:i,y1:a,x2:o,y2:s,key:c}=n,l=XI(j5(n,Afe))??{},{offset:u}=l,d=j5(l,jfe);r=v.createElement(`line`,A5({},d,{x1:i,y1:a,x2:o,y2:s,fill:`none`,key:c}))}return r}function zfe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=j5(e,Mfe),c=i.map((e,i)=>{var a=k5(k5({},s),{},{x1:t,y1:e,x2:t+n,y2:e,key:`line-${i}`,index:i});return v.createElement(M5,{key:`line-${i}`,option:r,lineItemProps:a})});return v.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},c)}function Bfe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,s=j5(e,Nfe),c=i.map((e,i)=>{var a=k5(k5({},s),{},{x1:e,y1:t,x2:e,y2:t+n,key:`line-${i}`,index:i});return v.createElement(M5,{option:r,lineItemProps:a,key:`line-${i}`})});return v.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},c)}function Vfe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:s,horizontal:c=!0}=e;if(!c||!t||!t.length||s==null)return null;var l=s.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,s)=>{var c=l[s+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=s%t.length;return v.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:u,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},u)}function Hfe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:s,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var l=c.map(e=>Math.round(e+i-i)).sort((e,t)=>e-t);i!==l[0]&&l.unshift(0);var u=l.map((e,t)=>{var c=l[t+1],u=c==null?i+o-e:c-e;if(u<=0)return null;var d=t%n.length;return v.createElement(`rect`,{key:`react-${t}`,x:e,y:a,width:u,height:s,stroke:`none`,fill:n[d],fillOpacity:r,className:`recharts-cartesian-grid-bg`})});return v.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},u)}var Ufe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return RU(x5(k5(k5(k5({},E5),n),{},{ticks:zU(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Wfe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return RU(x5(k5(k5(k5({},E5),n),{},{ticks:zU(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Gfe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:yX.grid};function N5(e){var t=rG(),n=iG(),r=nG(),i=k5(k5({},rz(e,Gfe)),{},{x:xR(e.x)?e.x:r.left,y:xR(e.y)?e.y:r.top,width:xR(e.width)?e.width:r.width,height:xR(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:s,y:c,width:l,height:u,syncWithTicks:d,horizontalValues:f,verticalValues:p}=i,m=wW(),h=eB(e=>f3(e,`xAxis`,a,m)),g=eB(e=>f3(e,`yAxis`,o,m));if(!kU(l)||!kU(u)||!xR(s)||!xR(c))return null;var _=i.verticalCoordinatesGenerator||Ufe,y=i.horizontalCoordinatesGenerator||Wfe,{horizontalPoints:b,verticalPoints:x}=i;if((!b||!b.length)&&typeof y==`function`){var S=f&&f.length,C=y({yAxis:g?k5(k5({},g),{},{ticks:S?f:g.ticks}):void 0,width:t??l,height:n??u,offset:r},S?!0:d);jW(Array.isArray(C),`horizontalCoordinatesGenerator should return Array but instead it returned [${typeof C}]`),Array.isArray(C)&&(b=C)}if((!x||!x.length)&&typeof _==`function`){var w=p&&p.length,T=_({xAxis:h?k5(k5({},h),{},{ticks:w?p:h.ticks}):void 0,width:t??l,height:n??u,offset:r},w?!0:d);jW(Array.isArray(T),`verticalCoordinatesGenerator should return Array but instead it returned [${typeof T}]`),Array.isArray(T)&&(x=T)}return v.createElement(C6,{zIndex:i.zIndex},v.createElement(`g`,{className:`recharts-cartesian-grid`},v.createElement(Rfe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(Vfe,A5({},i,{horizontalPoints:b})),v.createElement(Hfe,A5({},i,{verticalPoints:x})),v.createElement(zfe,A5({},i,{offset:r,horizontalPoints:b,xAxis:h,yAxis:g})),v.createElement(Bfe,A5({},i,{offset:r,verticalPoints:x,xAxis:h,yAxis:g}))))}N5.displayName=`CartesianGrid`;var P5=NH({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:Kfe,replaceErrorBar:qfe,removeErrorBar:Jfe}=P5.actions,Yfe=P5.reducer,Xfe=[`children`];function Zfe(e,t){if(e==null)return{};var n,r,i=Qfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var $fe=(0,v.createContext)({data:[],xAxisId:`xAxis-0`,yAxisId:`yAxis-0`,dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0});function F5(e){var{children:t}=e,n=Zfe(e,Xfe);return v.createElement($fe.Provider,{value:n},t)}function I5(e,t){var n=eB(t=>X2(t,e)),r=eB(e=>$2(e,t)),i=n?.allowDataOverflow??J2.allowDataOverflow,a=r?.allowDataOverflow??Z2.allowDataOverflow;return{needClip:i||a,needClipX:i,needClipY:a}}function L5(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=c5(),{needClipX:a,needClipY:o,needClip:s}=I5(t,n);if(!s||!i)return null;var{x:c,y:l,width:u,height:d}=i;return v.createElement(`clipPath`,{id:`clipPath-${r}`},v.createElement(`rect`,{x:a?c:c-u/2,y:o?l:l-d/2,width:a?u:u*2,height:o?d:d*2}))}var R5=(e,t,n,r)=>h3(e,`xAxis`,t,r),z5=(e,t,n,r)=>m3(e,`xAxis`,t,r),B5=(e,t,n,r)=>h3(e,`yAxis`,n,r),V5=(e,t,n,r)=>m3(e,`yAxis`,n,r),epe=$([oG,R5,B5,z5,V5],(e,t,n,r,i)=>LU(e,`xAxis`)?QU(t,r,!1):QU(n,i,!1)),tpe=(e,t,n,r,i)=>i;function npe(e){return e.type===`line`}var rpe=$([oG,R5,B5,z5,V5,$([s4,tpe],(e,t)=>e.filter(npe).find(e=>e.id===t)),epe,GY],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return wpe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function ipe(e){var t=ZI(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var ape=[`id`],ope=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],spe=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function H5(){return H5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H5.apply(null,arguments)}function U5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?U5(Object(n),!0).forEach(function(t){cpe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cpe(e,t,n){return(t=lpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lpe(e){var t=upe(e,`string`);return typeof t==`symbol`?t:t+``}function upe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function G5(e,t){if(e==null)return{};var n,r,i=dpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var fpe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:eW(n,t),payload:e}]},ppe=v.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:MR,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:eW(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return v.createElement(Z8,{tooltipEntrySettings:d})}),K5=(e,t)=>`${t}px ${e}px`;function mpe(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var hpe=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return K5(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...mpe(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function gpe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=XI(G5(r,ape));return v.createElement(dde,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function _pe(e){var{showLabels:t,children:n,points:r}=e,i=(0,v.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return W5(W5({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return v.createElement(D8,{value:t?i:void 0},n)}function q5(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=W5(W5({},QI(G5(a,ope))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return v.createElement(v.Fragment,null,r?.length>1&&v.createElement(q8,H5({shapeType:`curve`,option:u},d,{pathRef:n})),v.createElement(gpe,{points:r,clipPathId:t,props:a}))}function vpe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function ype(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:f,width:p,height:m,onAnimationEnd:h,onAnimationStart:g}=n,_=i.current,y=LJ(o,`recharts-line-`),b=(0,v.useRef)(y),[x,S]=(0,v.useState)(!1),C=!x,w=(0,v.useCallback)(()=>{typeof h==`function`&&h(),S(!1)},[h]),T=(0,v.useCallback)(()=>{typeof g==`function`&&g(),S(!0)},[g]),E=vpe(r.current),D=(0,v.useRef)(0);b.current!==y&&(D.current=a.current,b.current=y);var O=D.current;return v.createElement(_pe,{points:o,showLabels:C},n.children,v.createElement(IJ,{animationId:y,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:w,onAnimationStart:T,key:y},e=>{var l=DR(O,E+O,e),u=Math.min(l,E),d=c?s?hpe(u,E,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):K5(E,u):s==null?void 0:String(s);if(e>0&&E>0&&(i.current=o,a.current=Math.max(a.current,u)),_){var h=_.length/o.length,g=e===1?o:o.map((t,n)=>{var r=Math.floor(n*h);if(_[r]){var i=_[r];return W5(W5({},t),{},{x:DR(i.x,t.x,e),y:DR(i.y,t.y,e)})}return f?W5(W5({},t),{},{x:DR(p*2,t.x,e),y:DR(m/2,t.y,e)}):W5(W5({},t),{},{x:t.x,y:t.y})});return i.current=g,v.createElement(q5,{props:n,points:g,clipPathId:t,pathRef:r,strokeDasharray:d})}return v.createElement(q5,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),v.createElement(A8,{label:n.label}))}function bpe(e){var{clipPathId:t,props:n}=e,r=(0,v.useRef)(null),i=(0,v.useRef)(0),a=(0,v.useRef)(null);return v.createElement(ype,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var xpe=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:FU(e.payload,t)}),Spe=class extends v.Component{render(){var{hide:e,dot:t,points:n,className:r,xAxisId:i,yAxisId:a,top:o,left:s,width:c,height:l,id:u,needClip:d,zIndex:f}=this.props;if(e)return null;var p=ys(`recharts-line`,r),m=u,{r:h,strokeWidth:g}=ipe(t),_=R8(t),y=h*2+g,b=d?`url(#clipPath-${_?``:`dots-`}${m})`:void 0;return v.createElement(C6,{zIndex:f},v.createElement(nL,{className:p},d&&v.createElement(`defs`,null,v.createElement(L5,{clipPathId:m,xAxisId:i,yAxisId:a}),!_&&v.createElement(`clipPath`,{id:`clipPath-dots-${m}`},v.createElement(`rect`,{x:s-y/2,y:o-y/2,width:c+y,height:l+y}))),v.createElement(F5,{xAxisId:i,yAxisId:a,data:n,dataPointFormatter:xpe,errorBarOffset:0},v.createElement(bpe,{props:this.props,clipPathId:m}))),v.createElement(Mde,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}},J5={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:yX.line,type:`linear`};function Cpe(e){var t=rz(e,J5),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:f,xAxisId:p,yAxisId:m,id:h}=t,g=G5(t,spe),{needClip:_}=I5(p,m),y=c5(),b=sG(),x=wW(),S=eB(e=>rpe(e,p,m,x,h));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var{height:C,width:w,x:T,y:E}=y;return v.createElement(Spe,H5({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:_}))}function wpe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=FU(e,o);if(t===`horizontal`)return{x:WU({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(kR(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=kR(l)?null:n.scale.map(l),d=WU({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function Tpe(e){var t=rz(e,J5),n=wW();return v.createElement($8,{id:t.id,type:`line`},e=>v.createElement(v.Fragment,null,v.createElement(Q8,{legendPayload:fpe(t)}),v.createElement(ppe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),v.createElement(t5,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),v.createElement(Cpe,H5({},t,{id:e}))))}var Y5=v.memo(Tpe,NK);Y5.displayName=`Line`;function X5(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function Z5(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var Epe=`Invariant failed`;function Dpe(e,t){if(!e)throw Error(Epe)}function Q5(){return Q5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q5.apply(null,arguments)}function $5(e){return v.createElement(q8,Q5({shapeType:`rectangle`,activeClassName:`recharts-active-bar`,inActiveClassName:`recharts-inactive-bar`},e))}var Ope=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,r)=>{if(xR(e))return e;var i=xR(n)||kR(n);return i?e(n,r):(!i&&Dpe(!1,`minPointSize callback function received a value with type of ${typeof n}. Currently only numbers or null/undefined are supported.`),t)}},kpe=(e,t,n)=>n,e7=$([s4,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`bar`).find(e=>e.id===t)),Ape=$([e7],e=>e?.maxBarSize),jpe=(e,t,n,r)=>r,Mpe=$([oG,s4,X5,Z5,kpe],(e,t,n,r,i)=>t.filter(t=>e===`horizontal`?t.xAxisId===n:t.yAxisId===r).filter(e=>e.isPanorama===i).filter(e=>e.hide===!1).filter(e=>e.type===`bar`)),Npe=(e,t,n)=>{var r=oG(e),i=X5(e,t),a=Z5(e,t);if(i!=null&&a!=null)return r===`horizontal`?O4(e,`yAxis`,a,n):O4(e,`xAxis`,i,n)},Ppe=$([Mpe,fX,(e,t)=>{var n=oG(e),r=X5(e,t),i=Z5(e,t);if(r!=null&&i!=null)return n===`horizontal`?l3(e,`xAxis`,r):l3(e,`yAxis`,i)}],Nde),Fpe=(e,t,n)=>{var r=e7(e,t);if(r==null)return 0;var i=X5(e,t),a=Z5(e,t);if(i==null||a==null)return 0;var o=oG(e),s=lX(e),{maxBarSize:c}=r,l=kR(c)?s:c,u,d;return o===`horizontal`?(u=h3(e,`xAxis`,i,n),d=m3(e,`xAxis`,i,n)):(u=h3(e,`yAxis`,a,n),d=m3(e,`yAxis`,a,n)),QU(u,d,!0)??l??0},t7=(e,t,n)=>{var r=oG(e),i=X5(e,t),a=Z5(e,t);if(i!=null&&a!=null){var o,s;return r===`horizontal`?(o=h3(e,`xAxis`,i,n),s=m3(e,`xAxis`,i,n)):(o=h3(e,`yAxis`,a,n),s=m3(e,`yAxis`,a,n)),QU(o,s)}},Ipe=$([bW,SW,(e,t,n)=>{var r=X5(e,t);if(r!=null)return h3(e,`xAxis`,r,n)},(e,t,n)=>{var r=Z5(e,t);if(r!=null)return h3(e,`yAxis`,r,n)},(e,t,n)=>{var r=X5(e,t);if(r!=null)return m3(e,`xAxis`,r,n)},(e,t,n)=>{var r=Z5(e,t);if(r!=null)return m3(e,`yAxis`,r,n)},$([$([Ppe,lX,uX,dX,Fpe,t7,Ape],Rde),e7],Bde),oG,KY,t7,$([Npe,e7],zde),e7,jpe],(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:h}=c;if(!(d==null||o==null||t==null||s!==`horizontal`&&s!==`vertical`||n==null||r==null||i==null||a==null||l==null)){var{data:g}=d,_=g!=null&&g.length>0?g:p?.slice(m,h+1);if(_!=null)return ume({layout:s,barSettings:d,pos:o,parentViewBox:t,bandSize:l,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:_,offset:e,cells:f,dataStartIndex:m})}}),Lpe=[`index`];function n7(){return n7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n7.apply(null,arguments)}function Rpe(e,t){if(e==null)return{};var n,r,i=zpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r7=(0,v.createContext)(void 0),Bpe=e=>{var t=(0,v.useContext)(r7);if(t!=null)return t.stackId;if(e!=null)return UU(e)},Vpe=(e,t)=>`recharts-bar-stack-clip-path-${e}-${t}`,Hpe=e=>{var t=(0,v.useContext)(r7);if(t!=null){var{stackId:n}=t;return`url(#${Vpe(n,e)})`}},i7=e=>{var{index:t}=e,n=Rpe(e,Lpe),r=Hpe(t);return v.createElement(nL,n7({className:`recharts-bar-stack-layer`,clipPath:r},n))},Upe=[`onMouseEnter`,`onMouseLeave`,`onClick`],Wpe=[`value`,`background`,`tooltipPosition`],Gpe=[`id`],Kpe=[`onMouseEnter`,`onClick`,`onMouseLeave`];function a7(){return a7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a7.apply(null,arguments)}function o7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?o7(Object(n),!0).forEach(function(t){qpe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qpe(e,t,n){return(t=Jpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jpe(e){var t=Ype(e,`string`);return typeof t==`symbol`?t:t+``}function Ype(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c7(e,t){if(e==null)return{};var n,r,i=Xpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Zpe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:eW(n,t),payload:e}]},Qpe=v.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:s,tooltipType:c,id:l}=e,u={dataDefinedOnItem:void 0,getPosition:MR,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:eW(a,t),hide:o,type:c,color:i,unit:s,graphicalItemId:l}};return v.createElement(Z8,{tooltipEntrySettings:u})});function $pe(e){var t=eB(n6),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:s,onClick:c}=a,l=c7(a,Upe),u=J8(o,r,a.id),d=Y8(s),f=X8(c,r,a.id);if(!i||n==null)return null;var p=ZI(i);return v.createElement(C6,{zIndex:Vde(i,yX.barBackground)},n.map((e,n)=>{var{value:a,background:o,tooltipPosition:s}=e,c=c7(e,Wpe);if(!o)return null;var m=u(e,n),h=d(e,n),g=f(e,n),_=s7(s7(s7(s7(s7({option:i,isActive:String(n)===t},c),{},{fill:`#eee`},o),p),ZR(l,e,n)),{},{onMouseEnter:m,onMouseLeave:h,onClick:g,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return v.createElement($5,a7({key:`background-bar-${n}`},_))}))}function eme(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return s7(s7({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return v.createElement(D8,{value:t?i:void 0},n)}function tme(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,s=eB(n6),c=eB(i6),l=n&&String(i.originalDataIndex)===s&&(c==null||o===c),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>{var e;return l?(d(!0),e=requestAnimationFrame(()=>{p(!0)})):p(!1),()=>{cancelAnimationFrame(e)}},[l]);var m=(0,v.useCallback)(()=>{l||d(!1)},[l]),h=l&&f,g=l||u,_=l?n===!0?t:n:t,y=v.createElement($5,a7({},r,{name:String(r.name)},i,{isActive:h,option:_,index:a,dataKey:o,onTransitionEnd:m}));return g?v.createElement(C6,{zIndex:yX.activeBar},v.createElement(i7,{index:i.originalDataIndex},y)):y}function nme(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return v.createElement($5,a7({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function rme(e){var{data:t,props:n}=e,r=XI(n)??{},{id:i}=r,a=c7(r,Gpe),{shape:o,dataKey:s,activeBar:c}=n,{onMouseEnter:l,onClick:u,onMouseLeave:d}=n,f=c7(n,Kpe),p=J8(l,s,i),m=Y8(d),h=X8(u,s,i);return t?v.createElement(v.Fragment,null,t.map((e,t)=>v.createElement(i7,a7({index:e.originalDataIndex,key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${t}`,className:`recharts-bar-rectangle`},ZR(f,e,t),{onMouseEnter:p(e,t),onMouseLeave:m(e,t),onClick:h(e,t)}),c?v.createElement(tme,{shape:o,activeBar:c,baseProps:a,entry:e,index:t,dataKey:s}):v.createElement(nme,{shape:o,baseProps:a,entry:e,index:t,dataKey:s})))):null}function ime(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,onAnimationEnd:l,onAnimationStart:u}=t,d=n.current,f=LJ(t,`recharts-bar-`),[p,m]=(0,v.useState)(!1),h=!p,g=(0,v.useCallback)(()=>{typeof l==`function`&&l(),m(!1)},[l]),_=(0,v.useCallback)(()=>{typeof u==`function`&&u(),m(!0)},[u]);return v.createElement(eme,{showLabels:h,rects:r},v.createElement(IJ,{animationId:f,begin:o,duration:s,isActive:a,easing:c,onAnimationEnd:g,onAnimationStart:_,key:f},e=>{var a=e===1?r:r?.map((t,n)=>{var r=d&&d[n];if(r)return s7(s7({},t),{},{x:DR(r.x,t.x,e),y:DR(r.y,t.y,e),width:DR(r.width,t.width,e),height:DR(r.height,t.height,e)});if(i===`horizontal`){var a=DR(0,t.height,e),o=DR(t.stackedBarStart,t.y,e);return s7(s7({},t),{},{y:o,height:a})}var s=DR(0,t.width,e),c=DR(t.stackedBarStart,t.x,e);return s7(s7({},t),{},{width:s,x:c})});return e>0&&(n.current=a??null),a==null?null:v.createElement(nL,null,v.createElement(rme,{props:t,data:a}))}),v.createElement(A8,{label:t.label}),t.children)}function ame(e){var t=(0,v.useRef)(null);return v.createElement(ime,{previousRectanglesRef:t,props:e})}var l7=0,ome=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:FU(e,t)}},sme=class extends v.PureComponent{render(){var{hide:e,data:t,dataKey:n,className:r,xAxisId:i,yAxisId:a,needClip:o,background:s,id:c}=this.props;if(e||t==null)return null;var l=ys(`recharts-bar`,r),u=c;return v.createElement(nL,{className:l,id:c},o&&v.createElement(`defs`,null,v.createElement(L5,{clipPathId:u,xAxisId:i,yAxisId:a})),v.createElement(nL,{className:`recharts-bar-rectangles`,clipPath:o?`url(#clipPath-${u})`:void 0},v.createElement($pe,{data:t,dataKey:n,background:s,allOtherBarProps:this.props}),v.createElement(ame,this.props)))}},cme={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:`ease`,background:!1,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`rect`,minPointSize:l7,xAxisId:0,yAxisId:0,zIndex:yX.bar};function lme(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u}=e,{needClip:d}=I5(t,n),f=sG(),p=wW(),m=wue(e.children,V6),h=eB(t=>Ipe(t,e.id,p,m));if(f!==`vertical`&&f!==`horizontal`)return null;var g,_=h?.[0];return g=_==null||_.height==null||_.width==null?0:f===`vertical`?_.height/2:_.width/2,v.createElement(F5,{xAxisId:t,yAxisId:n,data:h,dataPointFormatter:ome,errorBarOffset:g},v.createElement(sme,a7({},e,{layout:f,needClip:d,data:h,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:s,animationDuration:c,animationEasing:l,isAnimationActive:u})))}function ume(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:s,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:f,offset:p,cells:m,parentViewBox:h,dataStartIndex:g}=e,_=t===`horizontal`?c:s,v=d?_.scale.domain():null,y=KU({numericAxis:_}),b=_.scale.map(y);return f.map((e,f)=>{var _,x,S,C,w,T;if(d){var E=d[f+g];if(E==null)return null;_=BU(E,v)}else _=FU(e,n),Array.isArray(_)||(_=[y,_]);var D=Ope(r,l7)(_[1],f);if(t===`horizontal`){var O=c.scale.map(_[0]),k=c.scale.map(_[1]);if(O==null||k==null)return null;x=GU({axis:s,ticks:l,bandSize:o,offset:a.offset,entry:e,index:f}),S=k??O??void 0,C=a.size;var A=O-k;if(w=yR(A)?0:A,T={x,y:p.top,width:C,height:p.height},Math.abs(D)>0&&Math.abs(w)<Math.abs(D)){var j=vR(w||D)*(Math.abs(D)-Math.abs(w));S-=j,w+=j}}else{var M=s.scale.map(_[0]),N=s.scale.map(_[1]);if(M==null||N==null)return null;if(x=M,S=GU({axis:c,ticks:u,bandSize:o,offset:a.offset,entry:e,index:f}),C=N-M,w=a.size,T={x:p.left,y:S,width:p.width,height:w},Math.abs(D)>0&&Math.abs(C)<Math.abs(D)){var P=vR(C||D)*(Math.abs(D)-Math.abs(C));C+=P}}return x==null||S==null||C==null||w==null||!i&&(C===0||w===0)?null:s7(s7({},e),{},{stackedBarStart:b,x,y:S,width:C,height:w,value:d?_:_[1],payload:e,background:T,tooltipPosition:{x:x+C/2,y:S+w/2},parentViewBox:h,originalDataIndex:f},m&&m[f]&&m[f].props)}).filter(Boolean)}function dme(e){var t=rz(e,cme),n=Bpe(t.stackId),r=wW();return v.createElement($8,{id:t.id,type:`bar`},e=>v.createElement(v.Fragment,null,v.createElement(Q8,{legendPayload:Zpe(t)}),v.createElement(Qpe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),v.createElement(t5,{type:`bar`,id:e,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),v.createElement(C6,{zIndex:t.zIndex},v.createElement(lme,a7({},t,{id:e})))))}var u7=v.memo(dme,NK);u7.displayName=`Bar`;var fme=[`domain`,`range`],pme=[`domain`,`range`];function d7(e,t){if(e==null)return{};var n,r,i=mme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function f7(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function p7(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=d7(e,fme),{domain:a,range:o}=t,s=d7(t,pme);return!f7(n,a)||!f7(r,o)?!1:NK(i,s)}var hme=[`type`],gme=[`dangerouslySetInnerHTML`,`ticks`,`scale`],_me=[`id`,`scale`];function m7(){return m7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m7.apply(null,arguments)}function h7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h7(Object(n),!0).forEach(function(t){vme(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vme(e,t,n){return(t=yme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yme(e){var t=bme(e,`string`);return typeof t==`symbol`?t:t+``}function bme(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _7(e,t){if(e==null)return{};var n,r,i=xme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Sme(e){var t=Xz(),n=(0,v.useRef)(null),r=cG(),{type:i}=e,a=_7(e,hme),o=CX(r,`xAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return g7(g7({},a),{},{type:o})},[a,o]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(hde(s)):n.current!==s&&t(gde({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(_de(n.current)),null)},[t]),null}var Cme=e=>{var{xAxisId:t,className:n}=e,r=eB(SW),i=wW(),a=`xAxis`,o=eB(e=>p3(e,a,t,i)),s=eB(e=>s3(e,t)),c=eB(e=>vse(e,t)),l=eB(e=>Y2(e,t));if(s==null||c==null||l==null)return null;var{dangerouslySetInnerHTML:u,ticks:d,scale:f}=e,p=_7(e,gme),{id:m,scale:h}=l,g=_7(l,_me);return v.createElement(D5,m7({},p,g,{x:c.x,y:c.y,width:s.width,height:s.height,className:ys(`recharts-${a} ${a}`,n),viewBox:r,ticks:o,axisType:a,axisId:t}))},wme={allowDataOverflow:J2.allowDataOverflow,allowDecimals:J2.allowDecimals,allowDuplicatedCategory:J2.allowDuplicatedCategory,angle:J2.angle,axisLine:E5.axisLine,height:J2.height,hide:!1,includeHidden:J2.includeHidden,interval:J2.interval,label:!1,minTickGap:J2.minTickGap,mirror:J2.mirror,orientation:J2.orientation,padding:J2.padding,reversed:J2.reversed,scale:J2.scale,tick:J2.tick,tickCount:J2.tickCount,tickLine:E5.tickLine,tickSize:E5.tickSize,type:J2.type,niceTicks:J2.niceTicks,xAxisId:0},v7=v.memo(e=>{var t=rz(e,wme);return v.createElement(v.Fragment,null,v.createElement(Sme,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(Cme,t))},p7);v7.displayName=`XAxis`;var Tme=[`type`],Eme=[`dangerouslySetInnerHTML`,`ticks`,`scale`],Dme=[`id`,`scale`];function y7(){return y7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y7.apply(null,arguments)}function b7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?b7(Object(n),!0).forEach(function(t){Ome(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b7(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ome(e,t,n){return(t=kme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kme(e){var t=Ame(e,`string`);return typeof t==`symbol`?t:t+``}function Ame(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function S7(e,t){if(e==null)return{};var n,r,i=jme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Mme(e){var t=Xz(),n=(0,v.useRef)(null),r=cG(),{type:i}=e,a=S7(e,Tme),o=CX(r,`yAxis`,i),s=(0,v.useMemo)(()=>{if(o!=null)return x7(x7({},a),{},{type:o})},[o,a]);return(0,v.useLayoutEffect)(()=>{s!=null&&(n.current===null?t(vde(s)):n.current!==s&&t(yde({prev:n.current,next:s})),n.current=s)},[s,t]),(0,v.useLayoutEffect)(()=>()=>{n.current&&=(t(bde(n.current)),null)},[t]),null}function Nme(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=eB(SW),c=wW(),l=Xz(),u=`yAxis`,d=eB(e=>c3(e,t)),f=eB(e=>yse(e,t)),p=eB(e=>p3(e,u,t,c)),m=eB(e=>Q2(e,t));if((0,v.useLayoutEffect)(()=>{if(!(r!==`auto`||!d||x8(i)||(0,v.isValidElement)(i)||m==null)){var e=a.current;if(e){var n=e.getCalculatedWidth();Math.round(d.width)!==Math.round(n)&&l(wde({id:t,width:n}))}}},[p,d,l,i,t,r,m]),d==null||f==null||m==null)return null;var{dangerouslySetInnerHTML:h,ticks:g,scale:_}=e,y=S7(e,Eme),{id:b,scale:x}=m,S=S7(m,Dme);return v.createElement(D5,y7({},y,S,{ref:a,labelRef:o,x:f.x,y:f.y,tickTextProps:r===`auto`?{width:void 0}:{width:r},width:d.width,height:d.height,className:ys(`recharts-${u} ${u}`,n),viewBox:s,ticks:p,axisType:u,axisId:t}))}var Pme={allowDataOverflow:Z2.allowDataOverflow,allowDecimals:Z2.allowDecimals,allowDuplicatedCategory:Z2.allowDuplicatedCategory,angle:Z2.angle,axisLine:E5.axisLine,hide:!1,includeHidden:Z2.includeHidden,interval:Z2.interval,label:!1,minTickGap:Z2.minTickGap,mirror:Z2.mirror,orientation:Z2.orientation,padding:Z2.padding,reversed:Z2.reversed,scale:Z2.scale,tick:Z2.tick,tickCount:Z2.tickCount,tickLine:E5.tickLine,tickSize:E5.tickSize,type:Z2.type,niceTicks:Z2.niceTicks,width:Z2.width,yAxisId:0},C7=v.memo(e=>{var t=rz(e,Pme);return v.createElement(v.Fragment,null,v.createElement(Mme,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(Nme,t))},p7);C7.displayName=`YAxis`;var w7=$([(e,t)=>t,oG,zX,JX,Y3,Z3,_ce,bW],wce);function Fme(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function T7(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Fme(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var E7=dH(`mouseClick`),D7=yU();D7.startListening({actionCreator:E7,effect:(e,t)=>{var n=e.payload,r=w7(t.getState(),T7(n));r?.activeIndex!=null&&t.dispatch(kse({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var O7=dH(`mouseMove`),k7=yU(),A7=null,j7=null,M7=null;k7.startListening({actionCreator:O7,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);A7!==null&&(cancelAnimationFrame(A7),A7=null),j7!==null&&(typeof r!=`number`||!a)&&(clearTimeout(j7),j7=null),M7=T7(n);var o=()=>{var e=t.getState(),n=y3(e,e.tooltip.settings.shared);if(!M7){A7=null,j7=null;return}if(n===`axis`){var r=w7(e,M7);r?.activeIndex==null?t.dispatch(w3()):t.dispatch(T3({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}A7=null,j7=null};if(!a){o();return}r===`raf`?A7=requestAnimationFrame(o):typeof r==`number`&&j7===null&&(j7=setTimeout(o,r))}});function Ime(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var N7={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},P7=NH({name:`rootProps`,initialState:N7,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??N7.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Lme=P7.reducer,{updateOptions:Rme}=P7.actions,F7=NH({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:zme}=F7.actions,Bme=F7.reducer,I7=dH(`keyDown`),L7=dH(`focus`),R7=dH(`blur`),z7=yU(),B7=null,V7=null,H7=null;z7.startListening({actionCreator:I7,effect:(e,t)=>{H7=e.payload,B7!==null&&(cancelAnimationFrame(B7),B7=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);V7!==null&&(typeof n!=`number`||!i)&&(clearTimeout(V7),V7=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=H7;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=j3(n,U3(e),E4(e),q3(e)),a=i==null?-1:Number(i),o=!Number.isFinite(a)||a<0,s=Z3(e),c=U3(e),l=y3(e,e.tooltip.settings.shared);if(r===`Enter`){if(o)return;var u=_6(e,l,`hover`,String(n.index));t.dispatch(D3({active:!n.active,activeIndex:n.index,activeCoordinate:u}));return}var d=bse(e)===`left-to-right`?1:-1,f=r===`ArrowRight`?1:-1,p;if(o){var m=E4(e),h=q3(e),g=f*d,_=e=>({active:!1,index:String(e),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(p=-1,g>0){for(var v=0;v<c.length;v++)if(j3(_(v),c,m,h)!=null){p=v;break}}else for(var y=c.length-1;y>=0;y--)if(j3(_(y),c,m,h)!=null){p=y;break}if(p<0)return}else{p=a+f*d;var b=s?.length||c.length;if(b===0||p>=b||p<0)return}var x=_6(e,l,`hover`,String(p));t.dispatch(D3({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}finally{B7=null,V7=null}};if(!i){a();return}n===`raf`?B7=requestAnimationFrame(a):typeof n==`number`&&V7===null&&(a(),H7=null,V7=setTimeout(()=>{H7?a():(V7=null,B7=null)},n))}}),z7.startListening({actionCreator:L7,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=_6(n,y3(n,n.tooltip.settings.shared),`hover`,String(i));t.dispatch(D3({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),z7.startListening({actionCreator:R7,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(D3({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function U7(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var W7=dH(`externalEvent`),G7=yU(),K7=new Map,q7=new Map,J7=new Map;G7.startListening({actionCreator:W7,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=U7(r);J7.set(i,{handler:n,reactEvent:a});var o=K7.get(i);o!==void 0&&(cancelAnimationFrame(o),K7.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=q7.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),q7.delete(i));var f=()=>{var e=J7.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:nce(a),activeDataKey:i6(a),activeIndex:n6(a),activeLabel:r6(a),activeTooltipIndex:n6(a),isTooltipActive:rce(a)};n&&n(o,r)}finally{K7.delete(i),q7.delete(i),J7.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);K7.set(i,p)}else if(typeof s==`number`){if(!q7.has(i)){f();var m=setTimeout(f,s);q7.set(i,m)}}else f()}}});var Vme=$([$([F3],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),Y7=dH(`touchMove`),X7=yU(),Z7=null,Q7=null,$7=null,e9=null;X7.startListening({actionCreator:Y7,effect:(e,t)=>{var n=e.payload;if(n.touches!=null&&n.touches.length!==0){e9=U7(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);Z7!==null&&(cancelAnimationFrame(Z7),Z7=null),Q7!==null&&(typeof r!=`number`||!a)&&(clearTimeout(Q7),Q7=null),$7=Array.from(n.touches).map(e=>T7({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(e9!=null){var e=t.getState(),n=y3(e,e.tooltip.settings.shared);if(n===`axis`){var r=$7?.[0];if(r==null){Z7=null,Q7=null;return}var i=w7(e,r);i?.activeIndex!=null&&t.dispatch(T3({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=e9.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(lW),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=V3(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=Vme(e,s,c);t.dispatch(C3({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}Z7=null,Q7=null}};if(!a){o();return}r===`raf`?Z7=requestAnimationFrame(o):typeof r==`number`&&Q7===null&&(o(),e9=null,Q7=setTimeout(()=>{e9?o():(Q7=null,Z7=null)},r))}}});var t9={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},n9=NH({name:`eventSettings`,initialState:t9,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=sK(t.payload.throttledEvents))}}}),{setEventSettings:Hme}=n9.actions,Ume=n9.reducer,Wme=IB({brush:Wde,cartesianAxis:Tde,chartData:Xce,errorBars:Yfe,eventSettings:Ume,graphicalItems:nde,layout:EU,legend:mK,options:Gce,polarAxis:bue,polarOptions:Bme,referenceElements:$de,renderedTicks:hfe,rootProps:Lme,tooltip:Ase,zIndex:Ice}),Gme=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return CH({reducer:Wme,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([D7.middleware,k7.middleware,z7.middleware,G7.middleware,X7.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(xH({type:`raf`}))},devTools:mq.devToolsEnabled&&{serialize:{replacer:Ime},name:`recharts-${t}`}})};function Kme(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=wW(),a=(0,v.useRef)(null);if(i)return n;a.current??=Gme(t,r);var o=Jz;return v.createElement(AK,{context:o,store:a.current},n)}function qme(e){var{layout:t,margin:n}=e,r=Xz(),i=wW();return(0,v.useEffect)(()=>{i||(r(CU(t)),r(SU(n)))},[r,i,t,n]),null}var Jme=(0,v.memo)(qme,NK);function Yme(e){var t=Xz();return(0,v.useEffect)(()=>{t(Rme(e))},[t,e]),null}var Xme=(0,v.memo)(e=>{var t=Xz();return(0,v.useEffect)(()=>{t(Hme(e))},[t,e]),null},NK);function r9(e){var{zIndex:t,isPanorama:n}=e,r=(0,v.useRef)(null),i=Xz();return(0,v.useLayoutEffect)(()=>(r.current&&i(Pce({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Fce({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function i9(e){var{children:t,isPanorama:n}=e,r=eB(Ece);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return v.createElement(v.Fragment,null,i.map(e=>v.createElement(r9,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>v.createElement(r9,{key:e,zIndex:e,isPanorama:n})))}var Zme=[`children`];function Qme(e,t){if(e==null)return{};var n,r,i=$me(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $me(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function a9(){return a9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a9.apply(null,arguments)}var ehe={width:`100%`,height:`100%`,display:`block`},the=(0,v.forwardRef)((e,t)=>{var n=rG(),r=iG(),i=wq();if(!kU(n)||!kU(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),v.createElement(eL,a9({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:ehe,ref:t}),a)}),nhe=e=>{var{children:t}=e,n=eB(EW);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return v.createElement(eL,{width:r,height:i,x:o,y:a},t)},o9=(0,v.forwardRef)((e,t)=>{var{children:n}=e,r=Qme(e,Zme);return wW()?v.createElement(nhe,null,v.createElement(i9,{isPanorama:!0},n)):v.createElement(the,a9({ref:t},r),v.createElement(i9,{isPanorama:!1},n))});function rhe(){var e=Xz(),[t,n]=(0,v.useState)(null),r=eB(aW);return(0,v.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;OU(n)&&n!==r&&e(TU(n))}},[t,e,r]),n}function s9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ihe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?s9(Object(n),!0).forEach(function(t){ahe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ahe(e,t,n){return(t=ohe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ohe(e){var t=she(e,`string`);return typeof t==`symbol`?t:t+``}function she(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c9(){return c9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c9.apply(null,arguments)}var che=()=>(ale(),null);function l9(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var lhe=(0,v.forwardRef)((e,t)=>{var n=(0,v.useRef)(null),[r,i]=(0,v.useState)({containerWidth:l9(e.style?.width),containerHeight:l9(e.style?.height)}),a=(0,v.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),n.current!=null&&(n.current.disconnect(),n.current=null),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,v.useEffect)(()=>()=>{n.current?.disconnect()},[a]),v.createElement(v.Fragment,null,v.createElement(dG,{width:r.containerWidth,height:r.containerHeight}),v.createElement(`div`,c9({ref:o},e)))}),uhe=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,v.useState)({containerWidth:l9(n),containerHeight:l9(r)}),o=(0,v.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,v.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return v.createElement(v.Fragment,null,v.createElement(dG,{width:i.containerWidth,height:i.containerHeight}),v.createElement(`div`,c9({ref:s},e)))}),dhe=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return v.createElement(v.Fragment,null,v.createElement(dG,{width:n,height:r}),v.createElement(`div`,c9({ref:t},e)))}),fhe=(0,v.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?v.createElement(uhe,c9({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?v.createElement(dhe,c9({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(dG,{width:n,height:r}),v.createElement(`div`,c9({ref:t},e)))});function phe(e){return e?lhe:fhe}var mhe=(0,v.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:h,style:g,width:_,responsive:y,dispatchTouchEvents:b=!0}=e,x=(0,v.useRef)(null),S=Xz(),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(null),D=rhe(),O=XW(),k=O?.width>0?O.width:_,A=O?.height>0?O.height:i,j=(0,v.useCallback)(e=>{D(e),typeof t==`function`&&t(e),w(e),E(e),e!=null&&(x.current=e)},[D,t,w,E]),M=(0,v.useCallback)(e=>{S(E7(e)),S(W7({handler:a,reactEvent:e}))},[S,a]),N=(0,v.useCallback)(e=>{S(O7(e)),S(W7({handler:l,reactEvent:e}))},[S,l]),P=(0,v.useCallback)(e=>{S(w3()),S(W7({handler:u,reactEvent:e}))},[S,u]),F=(0,v.useCallback)(e=>{S(O7(e)),S(W7({handler:d,reactEvent:e}))},[S,d]),I=(0,v.useCallback)(()=>{S(L7())},[S]),L=(0,v.useCallback)(()=>{S(R7())},[S]),R=(0,v.useCallback)(e=>{S(I7(e.key))},[S]),z=(0,v.useCallback)(e=>{S(W7({handler:o,reactEvent:e}))},[S,o]),B=(0,v.useCallback)(e=>{S(W7({handler:s,reactEvent:e}))},[S,s]),V=(0,v.useCallback)(e=>{S(W7({handler:c,reactEvent:e}))},[S,c]),H=(0,v.useCallback)(e=>{S(W7({handler:f,reactEvent:e}))},[S,f]),U=(0,v.useCallback)(e=>{S(W7({handler:h,reactEvent:e}))},[S,h]),ee=(0,v.useCallback)(e=>{b&&S(Y7(e)),S(W7({handler:m,reactEvent:e}))},[S,b,m]),W=(0,v.useCallback)(e=>{S(W7({handler:p,reactEvent:e}))},[S,p]),te=phe(y);return v.createElement(D6.Provider,{value:C},v.createElement(rL.Provider,{value:T},v.createElement(te,{width:k??g?.width,height:A??g?.height,className:ys(`recharts-wrapper`,r),style:ihe({position:`relative`,cursor:`default`,width:k,height:A},g),onClick:M,onContextMenu:z,onDoubleClick:B,onFocus:I,onBlur:L,onKeyDown:R,onMouseDown:V,onMouseEnter:N,onMouseLeave:P,onMouseMove:F,onMouseUp:H,onTouchEnd:W,onTouchMove:ee,onTouchStart:U,ref:j},v.createElement(che,null),n)))}),hhe=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function ghe(e,t){if(e==null)return{};var n,r,i=_he(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _he(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vhe=(0,v.forwardRef)((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=XI(ghe(e,hhe));return c?v.createElement(v.Fragment,null,v.createElement(dG,{width:n,height:r}),v.createElement(o9,{otherAttributes:d,title:l,desc:u},a)):v.createElement(mhe,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(o9,{otherAttributes:d,title:l,desc:u,ref:t},v.createElement(tfe,null,a)))});function u9(){return u9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u9.apply(null,arguments)}function d9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yhe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?d9(Object(n),!0).forEach(function(t){bhe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bhe(e,t,n){return(t=xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xhe(e){var t=She(e,`string`);return typeof t==`symbol`?t:t+``}function She(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Che=yhe({accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,layout:`horizontal`,margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:`none`,syncMethod:`index`},t9),f9=(0,v.forwardRef)(function(e,t){var n=rz(e.categoricalChartProps,Che),{chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,categoricalChartProps:s}=e,c={chartName:r,defaultTooltipEventType:i,validateTooltipEventTypes:a,tooltipPayloadSearcher:o,eventEmitter:void 0};return v.createElement(Kme,{preloadedState:{options:c},reduxStoreName:s.id??r},v.createElement(Hde,{chartData:s.data}),v.createElement(Jme,{layout:n.layout,margin:n.margin}),v.createElement(Xme,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),v.createElement(Yme,{baseValue:n.baseValue,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),v.createElement(vhe,u9({},n,{ref:t})))}),whe=[`axis`],p9=(0,v.forwardRef)((e,t)=>v.createElement(f9,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:whe,tooltipPayloadSearcher:j6,categoricalChartProps:e,ref:t})),The=[`axis`,`item`],m9=(0,v.forwardRef)((e,t)=>v.createElement(f9,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:The,tooltipPayloadSearcher:j6,categoricalChartProps:e,ref:t}));function h9({column:e,label:t,align:n=`left`,className:r,sort:i,onToggle:a}){let{t:o}=Z(),s=i?.column===e?i.direction:null,c=s===`asc`?_i:s===`desc`?mi:ji;return(0,G.jsx)(rA,{className:[n===`right`?`text-right`:``,r].filter(Boolean).join(` `)||void 0,"aria-sort":s===`asc`?`ascending`:s===`desc`?`descending`:`none`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>a(e),"aria-label":o(`analytics.sortBy`,{column:t}),className:`inline-flex items-center gap-1 select-none ${n===`right`?`flex-row-reverse`:``}`,children:[(0,G.jsx)(`span`,{children:t}),(0,G.jsx)(c,{className:`size-3 shrink-0 ${s?``:`text-muted-foreground opacity-60`}`,"aria-hidden":`true`})]})})}function Ehe(e,t,n,r){let i=r(e,n),a=r(t,n);return i===null&&a===null?0:i===null?1:a===null?-1:typeof i==`number`&&typeof a==`number`?i-a:String(i).localeCompare(String(a))}function Dhe(e,t){try{let n=localStorage.getItem(e);if(!n)return null;let r=JSON.parse(n);if(typeof r.column==`string`&&t.includes(r.column)&&(r.direction===`asc`||r.direction===`desc`))return{column:r.column,direction:r.direction}}catch{}return null}function Ohe(e,t){try{t===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t))}catch{}}function khe(e,t){return!e||e.column!==t?{column:t,direction:`asc`}:e.direction===`asc`?{column:t,direction:`desc`}:null}function g9(e,t,n){if(!t)return e;let r=t.direction===`asc`?1:-1;return e.slice().sort((e,i)=>{let a=n(e,t.column),o=n(i,t.column);return a===null||o===null?a===o?0:a===null?1:-1:r*Ehe(e,i,t.column,n)})}function _9(e,t){let[n,r]=(0,v.useState)(()=>Dhe(e,t));return(0,v.useEffect)(()=>Ohe(e,n),[e,n]),{sort:n,toggle:(0,v.useMemo)(()=>e=>r(t=>khe(t,e)),[])}}var v9=5.5,Ahe=13,jhe=8,Mhe=280,y9=e=>Math.abs(e)*Math.PI/180;function Nhe(e){return Ahe/Math.sin(y9(e))}function Phe(e,t){return Math.ceil(t*v9*Math.sin(y9(e)))+jhe}function Fhe(e){return Math.floor(Mhe/Nhe(e))}var b9=[{angle:-30,maxChars:18},{angle:-45,maxChars:18},{angle:-90,maxChars:12}];function x9(e,t=18){return e.length<=t?e:e.slice(0,t-1)+`…`}function S9(e=0){let t=b9.find(t=>e<=Fhe(t.angle))??b9[b9.length-1];return{interval:0,angle:t.angle,textAnchor:`end`,height:Phe(t.angle,t.maxChars),tickFormatter:e=>x9(e,t.maxChars)}}var Ihe=Math.min(18,Math.floor(120/v9));function Lhe(){return{interval:0,width:128,tickFormatter:e=>x9(e,Ihe)}}var C9=[`24h`,`7d`,`30d`,`90d`],w9=`analytics.range`;function Rhe(){try{let e=localStorage.getItem(w9);if(e&&C9.includes(e))return e}catch{}return`7d`}var zhe=[`time`,`ip`,`agent`,`model`,`provider`,`status`,`attempts`,`inTokens`,`outTokens`,`latency`],Bhe=`analytics.recentCallsSort`;function Vhe(e){return e===`success`?2:+(e===`canceled`)}var Hhe=(e,t)=>{switch(t){case`time`:return e.createdAt;case`ip`:return e.clientIp;case`agent`:return e.clientUserAgent;case`model`:return e.modelId;case`provider`:return e.platform===`custom`&&e.keyLabel?e.keyLabel:e.platform;case`status`:return Vhe(e.status);case`attempts`:return e.attemptCount;case`inTokens`:return e.inputTokens;case`outTokens`:return e.outputTokens;case`latency`:return e.latencyMs}},Uhe=[`model`,`provider`,`requests`,`pinned`,`success`,`latency`,`inTokens`,`outTokens`,`saved`],Whe=`analytics.byModelSort`,Ghe=(e,t)=>{switch(t){case`model`:return e.displayName;case`provider`:return e.endpoint??e.platform;case`requests`:return e.requests;case`pinned`:return e.pinnedRequests;case`success`:return e.successRate;case`latency`:return e.avgLatencyMs;case`inTokens`:return e.totalInputTokens;case`outTokens`:return e.totalOutputTokens;case`saved`:return e.estimatedCost??null}},Khe=[`label`,`provider`,`requests`,`success`,`latency`,`inTokens`,`outTokens`],qhe=`analytics.byKeySort`,Jhe=(e,t)=>{switch(t){case`label`:return e.label||`#${e.keyId}`;case`provider`:return e.platform;case`requests`:return e.requests;case`success`:return e.successRate;case`latency`:return e.avgLatencyMs;case`inTokens`:return e.totalInputTokens;case`outTokens`:return e.totalOutputTokens}};function T9(e){return e===`success`?`text-muted-foreground`:e===`canceled`?`text-amber-600 dark:text-amber-400`:`text-destructive`}function Yhe(e){if(!e)return`—`;let t=e.split(` `)[0];return t.length>32?t.slice(0,32)+`…`:t}function E9(e){return e?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e):`0`}function D9({icon:e,label:t,value:n,sub:r,hint:i,className:a}){let o=(0,G.jsxs)(`div`,{className:`rounded-3xl border bg-card px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground uppercase tracking-wider`,children:t}),(0,G.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,G.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`})})]}),(0,G.jsx)(`p`,{className:`text-xl font-semibold tabular-nums mt-1 ${a??``}`,children:n}),r?(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground tabular-nums truncate`,children:r}):null]});return i?(0,G.jsx)(SD,{text:i,side:`bottom`,className:`block`,children:o}):o}function O9({icon:e,title:t,actions:n,children:r}){return(0,G.jsxs)(`div`,{className:`rounded-3xl border bg-card`,children:[(0,G.jsxs)(`div`,{className:`px-4 py-3 border-b flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,G.jsx)(e,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`}),t]}),n]}),(0,G.jsx)(`div`,{className:`p-4`,children:r})]})}function k9({platform:e}){return(0,G.jsx)(`span`,{className:`size-2 rounded-full flex-shrink-0`,style:{backgroundColor:Ek[e]??`#94a3b8`}})}function A9(e){return e>=1e3?`${(e/1e3).toFixed(1)} s`:`${e} ms`}function j9({label:e,value:t,mono:n}){return(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground uppercase tracking-wider`,children:e}),(0,G.jsx)(`p`,{className:`text-sm mt-0.5 break-words ${n?`tabular-nums`:``}`,children:t})]})}function Xhe({requestId:e,onClose:t}){let{t:n}=Z(),{data:r,isLoading:i}=$r({queryKey:[`analytics`,`request-detail`,e],queryFn:()=>X(`/api/analytics/requests/${e}`),enabled:e!=null});return(0,G.jsx)(kv,{open:e!=null,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(jv,{maxWidth:`max-w-2xl`,children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(ui,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`}),(0,G.jsx)(Mv,{children:n(`analytics.requestDetailTitle`,{id:e??``})})]}),(0,G.jsx)(Av,{"aria-label":n(`common.dismiss`),className:`-mr-1 rounded-lg p-1 text-muted-foreground/70 transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,G.jsx)(Wa,{className:`size-4`})})]}),i||!r?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(nk,{className:`h-24 rounded-xl`}),(0,G.jsx)(nk,{className:`h-32 rounded-xl`})]}):(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3`,children:[(0,G.jsx)(j9,{label:n(`analytics.time`),value:$c(r.createdAt,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),mono:!0}),(0,G.jsx)(j9,{label:n(`common.status`),value:(0,G.jsx)(`span`,{className:r.status===`success`?``:T9(r.status),children:r.status})}),(0,G.jsx)(j9,{label:n(`common.provider`),value:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(k9,{platform:r.platform}),r.platform]})}),(0,G.jsx)(j9,{label:n(`common.model`),value:r.modelId}),r.requestedModel&&r.requestedModel!==r.modelId&&(0,G.jsx)(j9,{label:n(`analytics.requestedModel`),value:r.requestedModel}),(0,G.jsx)(j9,{label:`${n(`analytics.inTokens`)} / ${n(`analytics.outTokens`)}`,value:`${E9(r.inputTokens)} / ${E9(r.outputTokens)}`,mono:!0}),(0,G.jsx)(j9,{label:n(`analytics.latency`),value:A9(r.latencyMs??0),mono:!0}),(0,G.jsx)(j9,{label:n(`analytics.ttft`),value:r.ttfbMs==null?`—`:A9(r.ttfbMs),mono:!0}),(0,G.jsx)(j9,{label:n(`analytics.clientIp`),value:r.clientIp??`—`,mono:!0}),(0,G.jsx)(j9,{label:n(`analytics.clientAgent`),value:r.clientUserAgent??`—`})]}),r.error&&(0,G.jsxs)(`div`,{className:`rounded-xl border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-destructive uppercase tracking-wider`,children:n(`analytics.message`)}),(0,G.jsx)(`p`,{className:`text-xs text-destructive/90 mt-1 break-words`,children:r.error})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,G.jsx)(ea,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`}),n(`analytics.failoverLadder`)]}),(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:n(`analytics.failoverLadderHint`)}),r.attempts.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:n(`analytics.noAttemptTrace`)}):(0,G.jsx)(`ol`,{className:`mt-3 space-y-2`,children:r.attempts.map(e=>(0,G.jsxs)(`li`,{className:`rounded-xl border px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsxs)(`span`,{className:`w-6 text-muted-foreground tabular-nums`,children:[`#`,e.ordinal+1]}),(0,G.jsx)(k9,{platform:e.platform}),(0,G.jsx)(`span`,{className:`font-medium`,children:e.platform}),(0,G.jsx)(`span`,{className:`text-muted-foreground truncate`,title:e.modelId,children:e.modelId}),(0,G.jsx)(SD,{text:e.keyLabel?`${n(`analytics.keyBadge`,{n:e.keyOrdinal})} · ${e.keyLabel}`:n(`analytics.keyBadge`,{n:e.keyOrdinal}),children:(0,G.jsx)(nO,{variant:`outline`,children:n(`analytics.keyOrdinal`,{n:e.keyOrdinal})})}),(0,G.jsx)(nO,{variant:e.outcome===`ok`||e.outcome===`committed`?`secondary`:e.outcome===`client_abort`?`outline`:`destructive`,children:e.outcome}),(0,G.jsxs)(`span`,{className:`ml-auto whitespace-nowrap text-muted-foreground tabular-nums`,title:n(`analytics.attemptTimingHint`),children:[`+`,A9(e.startOffsetMs),` · `,A9(e.durationMs)]})]}),e.errorSummary&&(0,G.jsx)(`p`,{className:`mt-1 pl-8 text-xs text-destructive/90 break-words`,children:e.errorSummary})]},e.ordinal))})]})]})]})})}var M9={fontSize:11,fill:`var(--muted-foreground)`},N9=`var(--border)`,P9=`var(--foreground)`,F9={backgroundColor:`var(--popover)`,border:`1px solid var(--border)`,borderRadius:8,fontSize:12};function I9(e){if(!e)return``;let t=e.includes(`T`)?e:`${e}T00:00:00`,n=new Date(t);return isNaN(n.getTime())?e:n.toLocaleString([],{month:`short`,day:`numeric`,...e.includes(`T`)?{hour:`2-digit`,minute:`2-digit`}:{}})}var L9=`var(--series-a)`,R9=`var(--series-b)`,Zhe=`
143
+ .analytics-viz { --series-a: #2a78d6; --series-b: #1baf7a; }
144
+ .dark .analytics-viz { --series-a: #3987e5; --series-b: #199e70; }
145
+ `;function Qhe(){let{t:e}=Z(),[t,n]=(0,v.useState)(Rhe),r=e=>{n(e);try{localStorage.setItem(w9,e)}catch{}},[i]=(0,v.useState)(()=>Date.now()),{data:a,isLoading:o}=$r({queryKey:[`analytics`,`summary`,t],queryFn:()=>X(`/api/analytics/summary?range=${t}`)}),{data:s}=$r({queryKey:[`cache`,`stats`],queryFn:()=>X(`/api/cache/stats`)}),{data:c=[]}=$r({queryKey:[`analytics`,`by-platform`,t],queryFn:()=>X(`/api/analytics/by-platform?range=${t}`)}),l=new Map(c.map(e=>[e.providerId,e.endpoint??e.platform])),{data:u=[]}=$r({queryKey:[`analytics`,`by-client`,t],queryFn:()=>X(`/api/analytics/by-client?range=${t}`)}),d=-new Date().getTimezoneOffset(),{data:f=[]}=$r({queryKey:[`analytics`,`timeline`,t,d],queryFn:()=>X(`/api/analytics/timeline?range=${t}&tzOffset=${d}`)}),{data:p=[]}=$r({queryKey:[`analytics`,`by-model`,t],queryFn:()=>X(`/api/analytics/by-model?range=${t}`)}),{data:m=[]}=$r({queryKey:[`analytics`,`by-key`,t],queryFn:()=>X(`/api/analytics/by-key?range=${t}`)}),{data:h=[]}=$r({queryKey:[`analytics`,`errors`,t],queryFn:()=>X(`/api/analytics/errors?range=${t}`)}),{data:g}=$r({queryKey:[`analytics`,`error-distribution`,t],queryFn:()=>X(`/api/analytics/error-distribution?range=${t}`)}),[_,y]=(0,v.useState)(`all`),[b,x]=(0,v.useState)(`all`),[S,C]=(0,v.useState)(null),{data:w}=$r({queryKey:[`analytics`,`requests`,t,_,b],queryFn:()=>{let e=new URLSearchParams({range:t,limit:`100`});return _!==`all`&&e.set(`status`,_),b!==`all`&&e.set(`provider`,b),X(`/api/analytics/requests?${e}`)}}),T=_9(Bhe,zhe),E=_9(Whe,Uhe),D=_9(qhe,Khe),O=(0,v.useMemo)(()=>g9(w?.rows??[],T.sort,Hhe),[w?.rows,T.sort]),k=(0,v.useMemo)(()=>g9(p,E.sort,Ghe),[p,E.sort]),A=(0,v.useMemo)(()=>g9(m,D.sort,Jhe),[m,D.sort]),j=T.sort&&w&&w.total>w.rows.length?e(`analytics.sortHint`,{count:w.rows.length}):null,{data:M}=$r({queryKey:[`analytics`,`summary`,`30d`],queryFn:()=>X(`/api/analytics/summary?range=30d`)}),N=a?.estimatedCostSavings??0,P=M?.estimatedCostSavings??0,F=(()=>{if(!M?.firstRequestAt)return 30;let e=new Date(M.firstRequestAt.replace(` `,`T`)+`Z`).getTime(),t=(i-e)/864e5;return Number.isFinite(t)?Math.min(Math.max(t,1/24),30):30})(),I=F<29.5,L=I?30/F*P:P,R=e(t===`24h`?`analytics.rangeLabel24h`:t===`7d`?`analytics.rangeLabel7d`:t===`30d`?`analytics.rangeLabel30d`:`analytics.rangeLabel90d`),z=F>=2?e(`analytics.spanDays`,{count:Math.round(F)}):e(`analytics.spanHours`,{count:Math.max(1,Math.round(F*24))}),B=I?e(`analytics.savingsHint`,{actual:N.toFixed(2),range:R,span:z}):e(`analytics.savingsHintExact`,{actual:N.toFixed(2),range:R}),V=a?.pinnedRequests??0,H=a?.pinHonoredRequests??0,U=a?.requestTypeCounts?.chat??0,ee=a?.requestTypeCounts?.embedding??0,W=(V>0?e(`analytics.requestsHintPinned`,{pinned:V,honored:H,failed:V-H}):e(`analytics.requestsHintAuto`))+` `+e(`analytics.requestsHintTypes`,{chat:U,embedding:ee}),te=a?.avgTtfbMs,ne=te==null?`—`:`${te} ms`,re=a?.p95LatencyMs,ie=re==null?`—`:`${re} ms`,ae=c.some(e=>(e.avgTtfbMs??0)>0);return(0,G.jsxs)(`div`,{className:`analytics-viz`,children:[(0,G.jsx)(`style`,{children:Zhe}),(0,G.jsx)(QD,{title:e(`analytics.title`),description:e(`analytics.description`),actions:(0,G.jsx)(ZD,{value:t,onValueChange:r,options:C9.map(t=>({value:t,label:e(t===`24h`?`analytics.range24h`:t===`7d`?`analytics.range7d`:t===`30d`?`analytics.range30d`:`analytics.range90d`)})),ariaLabel:e(`analytics.title`)})}),(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3`,children:o?Array.from({length:s?.enabled?9:8}).map((e,t)=>(0,G.jsx)(nk,{className:`h-[74px] rounded-3xl`},t)):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(D9,{icon:ui,label:e(`analytics.requests`),value:a?.totalRequests??0,hint:W}),(0,G.jsx)(D9,{icon:Ni,label:e(`analytics.successRate`),value:`${a?.successRate??0}%`}),(0,G.jsx)(D9,{icon:mi,label:e(`analytics.inputTokens`),value:E9(a?.totalInputTokens)}),(0,G.jsx)(D9,{icon:_i,label:e(`analytics.outputTokens`),value:E9(a?.totalOutputTokens)}),(0,G.jsx)(D9,{icon:$i,label:e(`analytics.avgLatency`),value:`${a?.avgLatencyMs??0} ms`}),(0,G.jsx)(D9,{icon:Bi,label:e(`analytics.p95Latency`),value:ie}),(0,G.jsx)(D9,{icon:Ga,label:e(`analytics.avgTtft`),value:ne}),(0,G.jsx)(D9,{icon:Pi,label:e(`analytics.estSavings`),value:`$${L.toFixed(2)}`,hint:B}),s?.enabled&&(0,G.jsx)(D9,{icon:fi,label:e(`analytics.cacheHitRate`),value:`${Math.round(s.hitRate*100)}%`,sub:e(`analytics.cacheSavedTokens`,{tokens:E9(s.savedTokens)}),hint:e(`analytics.cacheHitRateHint`,{hits:s.lookupHits,misses:s.lookupMisses,requests:s.estimatedRequestsSaved})})]})}),(0,G.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsx)(O9,{icon:Ci,title:e(`analytics.requestsOverTime`),children:f.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(p9,{data:f,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:`timestamp`,tick:M9,tickLine:!1,axisLine:{stroke:N9},tickFormatter:I9}),(0,G.jsx)(C7,{tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(ZK,{wrapperStyle:{fontSize:12},iconType:`line`}),(0,G.jsx)(Y5,{type:`monotone`,dataKey:`successCount`,name:e(`common.success`),stroke:P9,strokeWidth:1.5,dot:!1}),(0,G.jsx)(Y5,{type:`monotone`,dataKey:`failureCount`,name:e(`common.failures`),stroke:`var(--destructive)`,strokeWidth:1.5,dot:!1})]})})})}),(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsx)(O9,{icon:Hi,title:e(`analytics.tokensOverTime`),children:f.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(p9,{data:f,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:`timestamp`,tick:M9,tickLine:!1,axisLine:{stroke:N9},tickFormatter:I9}),(0,G.jsx)(C7,{tick:M9,tickLine:!1,axisLine:!1,tickFormatter:e=>E9(e)}),(0,G.jsx)(B6,{contentStyle:F9,formatter:e=>E9(Number(e))}),(0,G.jsx)(ZK,{wrapperStyle:{fontSize:12},iconType:`line`}),(0,G.jsx)(Y5,{type:`monotone`,dataKey:`inputTokens`,name:e(`analytics.inputTokens`),stroke:L9,strokeWidth:2,dot:!1}),(0,G.jsx)(Y5,{type:`monotone`,dataKey:`outputTokens`,name:e(`analytics.outputTokens`),stroke:R9,strokeWidth:2,dot:!1})]})})})}),(0,G.jsx)(O9,{icon:ja,title:e(`analytics.requestsByProvider`),children:c.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:c,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:e=>e.endpoint??e.platform,tick:M9,tickLine:!1,axisLine:{stroke:N9},...S9(c.length)}),(0,G.jsx)(C7,{tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(u7,{dataKey:`requests`,name:e(`analytics.requests`),fill:P9,radius:[3,3,0,0],maxBarSize:24})]})})}),(0,G.jsx)(O9,{icon:bi,title:e(`analytics.requestsByAgent`),children:u.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:u,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:`clientAgent`,tick:M9,tickLine:!1,axisLine:{stroke:N9},...S9(u.length)}),(0,G.jsx)(C7,{tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(u7,{dataKey:`requests`,name:e(`analytics.requests`),fill:R9,radius:[3,3,0,0],maxBarSize:24})]})})}),(0,G.jsx)(O9,{icon:$i,title:e(`analytics.avgLatencyByProvider`),children:c.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:c,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:e=>e.endpoint??e.platform,tick:M9,tickLine:!1,axisLine:{stroke:N9},...S9(c.length)}),(0,G.jsx)(C7,{unit:`ms`,tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(ZK,{wrapperStyle:{fontSize:12},iconType:`rect`}),(0,G.jsx)(u7,{dataKey:`avgLatencyMs`,name:e(`analytics.avgLatency`),fill:L9,radius:[3,3,0,0],maxBarSize:24}),(0,G.jsx)(u7,{dataKey:`p95LatencyMs`,name:e(`analytics.p95Latency`),fill:R9,radius:[3,3,0,0],maxBarSize:24})]})})}),(0,G.jsx)(O9,{icon:Ga,title:e(`analytics.ttftByProvider`),children:c.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):ae?(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:c,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:e=>e.endpoint??e.platform,tick:M9,tickLine:!1,axisLine:{stroke:N9},...S9(c.length)}),(0,G.jsx)(C7,{unit:`ms`,tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(u7,{dataKey:`avgTtfbMs`,name:e(`analytics.avgTtft`),fill:L9,radius:[3,3,0,0],maxBarSize:24})]})}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`analytics.ttftEmpty`)})}),(0,G.jsx)(O9,{icon:Va,title:e(`analytics.errorDistribution`),children:g?.byCategory?.length?(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:g.byCategory,layout:`vertical`,margin:{top:6,right:12,left:8,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9,horizontal:!1}),(0,G.jsx)(v7,{type:`number`,tick:M9,tickLine:!1,axisLine:{stroke:N9},allowDecimals:!1}),(0,G.jsx)(C7,{type:`category`,dataKey:`category`,tick:M9,tickLine:!1,axisLine:!1,...Lhe()}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(u7,{dataKey:`count`,name:e(`analytics.errors`),fill:`var(--destructive)`,radius:[0,3,3,0],maxBarSize:24})]})}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`analytics.noErrors`)})}),(0,G.jsx)(O9,{icon:Mi,title:e(`analytics.errorsByProvider`),children:g?.byPlatform?.length?(0,G.jsx)(QW,{width:`100%`,height:240,children:(0,G.jsxs)(m9,{data:g.byPlatform,margin:{top:6,right:6,left:-12,bottom:0},children:[(0,G.jsx)(N5,{strokeDasharray:`2 4`,stroke:N9}),(0,G.jsx)(v7,{dataKey:e=>e.endpoint??e.platform,tick:M9,tickLine:!1,axisLine:{stroke:N9},...S9(g.byPlatform.length)}),(0,G.jsx)(C7,{tick:M9,tickLine:!1,axisLine:!1}),(0,G.jsx)(B6,{contentStyle:F9}),(0,G.jsx)(u7,{dataKey:`count`,name:e(`analytics.errors`),fill:`var(--destructive)`,radius:[3,3,0,0],maxBarSize:24})]})}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`analytics.noErrors`)})}),(0,G.jsx)(O9,{icon:Mi,title:e(`analytics.recentErrors`),children:h.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`analytics.noErrors`)}):(0,G.jsx)(`div`,{className:`max-h-[240px] overflow-auto -mx-4`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(rA,{className:`pl-4`,children:e(`common.provider`)}),(0,G.jsx)(rA,{children:e(`analytics.message`)}),(0,G.jsx)(rA,{className:`text-right pr-4`,children:e(`analytics.time`)})]})}),(0,G.jsx)(tA,{children:h.slice(0,20).map(e=>(0,G.jsxs)(nA,{children:[(0,G.jsx)(iA,{className:`pl-4 text-xs`,children:e.endpoint??e.platform}),(0,G.jsx)(iA,{className:`text-xs max-w-[200px]`,children:e.error?(0,G.jsx)(SD,{text:e.error,side:`top`,className:`block truncate`,children:e.error}):null}),(0,G.jsx)(iA,{className:`text-right text-xs text-muted-foreground tabular-nums pr-4`,children:$c(e.createdAt,{hour:`2-digit`,minute:`2-digit`})})]},e.id))})]})})}),(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsxs)(O9,{icon:ca,title:e(`analytics.recentCalls`),actions:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(ZD,{value:_,onValueChange:y,options:[{value:`all`,label:e(`analytics.filterAll`)},{value:`success`,label:e(`common.success`)},{value:`error`,label:e(`analytics.errors`)},{value:`canceled`,label:e(`analytics.filterCanceled`)}],ariaLabel:e(`common.status`)}),(0,G.jsxs)(ZO,{value:b,onValueChange:e=>x(e??`all`),children:[(0,G.jsx)($O,{size:`sm`,"aria-label":e(`common.provider`),children:(0,G.jsx)(QO,{children:t=>!t||t===`all`?e(`analytics.allProviders`):l.get(t)??t})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`all`,children:e(`analytics.allProviders`)}),c.map(e=>(0,G.jsx)(tk,{value:e.providerId,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(k9,{platform:e.platform}),(0,G.jsx)(`span`,{children:e.endpoint??e.platform})]})},e.providerId))]})]})]}),children:[j&&(0,G.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground`,children:j}),w?.rows?.length?(0,G.jsx)(`div`,{className:`max-h-[420px] overflow-auto -mx-4`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(h9,{column:`time`,label:e(`analytics.time`),className:`pl-4`,sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`ip`,label:e(`analytics.clientIp`),sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`agent`,label:e(`analytics.clientAgent`),sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`model`,label:e(`common.model`),sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`provider`,label:e(`common.provider`),sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`status`,label:e(`common.status`),sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`attempts`,label:e(`analytics.attempts`),align:`right`,sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`inTokens`,label:e(`analytics.inTokens`),align:`right`,sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`outTokens`,label:e(`analytics.outTokens`),align:`right`,sort:T.sort,onToggle:T.toggle}),(0,G.jsx)(h9,{column:`latency`,label:e(`analytics.latency`),align:`right`,className:`pr-4`,sort:T.sort,onToggle:T.toggle})]})}),(0,G.jsx)(tA,{children:O.map(t=>(0,G.jsxs)(nA,{onClick:()=>C(t.id),className:`cursor-pointer`,children:[(0,G.jsx)(iA,{className:`pl-4 text-xs text-muted-foreground tabular-nums whitespace-nowrap`,children:$c(t.createdAt,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,G.jsx)(iA,{className:`text-xs font-medium tabular-nums`,children:t.clientIp??`—`}),(0,G.jsx)(iA,{className:`text-xs text-muted-foreground`,title:t.clientUserAgent??void 0,children:Yhe(t.clientUserAgent)}),(0,G.jsxs)(iA,{className:`text-xs max-w-[220px] truncate`,title:t.requestedModel&&t.requestedModel!==t.modelId?e(`analytics.requestedModelHint`,{model:t.requestedModel}):void 0,children:[t.modelId,t.requestedModel&&t.requestedModel!==t.modelId?` *`:``]}),(0,G.jsx)(iA,{className:`text-xs text-muted-foreground`,children:t.platform===`custom`&&t.keyLabel?t.keyLabel:t.platform}),(0,G.jsx)(iA,{className:`text-xs ${T9(t.status)}`,title:t.error??void 0,children:t.status}),(0,G.jsx)(iA,{className:`text-right text-xs tabular-nums ${t.attemptCount>1?`font-medium`:`text-muted-foreground`}`,children:t.attemptCount>0?t.attemptCount:`—`}),(0,G.jsx)(iA,{className:`text-right text-xs tabular-nums`,children:E9(t.inputTokens)}),(0,G.jsx)(iA,{className:`text-right text-xs tabular-nums`,children:E9(t.outputTokens)}),(0,G.jsxs)(iA,{className:`text-right text-xs tabular-nums pr-4`,children:[t.latencyMs,` ms`]})]},t.id))})]})}):(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)})]})}),(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsx)(O9,{icon:ya,title:e(`analytics.providerBreakdown`),children:c.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(`div`,{className:`max-h-[360px] overflow-auto -mx-4`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(rA,{className:`pl-4`,children:e(`common.provider`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.requests`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`common.success`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.errors`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.avgLatency`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.p95Latency`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.avgTtft`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.tokensPerSec`)}),(0,G.jsx)(rA,{className:`text-right`,children:e(`analytics.inTokens`)}),(0,G.jsx)(rA,{className:`text-right pr-4`,children:e(`analytics.outTokens`)})]})}),(0,G.jsx)(tA,{children:c.map(e=>(0,G.jsxs)(nA,{children:[(0,G.jsx)(iA,{className:`pl-4 text-sm font-medium`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(k9,{platform:e.platform}),e.endpoint??e.platform]})}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.requests}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[e.successRate,`%`]}),(0,G.jsx)(iA,{className:`text-right tabular-nums ${e.errorCount>0?`text-destructive`:``}`,children:e.errorCount>0?e.errorCount:`—`}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[e.avgLatencyMs,` ms`]}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.p95LatencyMs==null?`—`:`${e.p95LatencyMs} ms`}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.avgTtfbMs==null?`—`:`${e.avgTtfbMs} ms`}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.avgTokensPerSecond==null?`—`:e.avgTokensPerSecond}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:E9(e.totalInputTokens)}),(0,G.jsx)(iA,{className:`text-right tabular-nums pr-4`,children:E9(e.totalOutputTokens)})]},e.providerId))})]})})})}),(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsx)(O9,{icon:aa,title:e(`analytics.perModelBreakdown`),children:p.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`common.noData`)}):(0,G.jsx)(`div`,{className:`max-h-[360px] overflow-auto -mx-4`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(h9,{column:`model`,label:e(`common.model`),className:`pl-4`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`provider`,label:e(`common.provider`),sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`requests`,label:e(`analytics.requests`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`pinned`,label:e(`analytics.pinned`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`success`,label:e(`common.success`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`latency`,label:e(`analytics.latency`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`inTokens`,label:e(`analytics.inTokens`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`outTokens`,label:e(`analytics.outTokens`),align:`right`,sort:E.sort,onToggle:E.toggle}),(0,G.jsx)(h9,{column:`saved`,label:e(`analytics.saved`),align:`right`,className:`pr-4`,sort:E.sort,onToggle:E.toggle})]})}),(0,G.jsx)(tA,{children:k.map(e=>(0,G.jsxs)(nA,{children:[(0,G.jsx)(iA,{className:`pl-4 text-sm font-medium`,children:e.displayName}),(0,G.jsx)(iA,{className:`text-xs text-muted-foreground`,children:e.endpoint??e.platform}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.requests}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:e.pinnedRequests>0?e.pinnedRequests:`—`}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[e.successRate,`%`]}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[e.avgLatencyMs,` ms`]}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:E9(e.totalInputTokens)}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:E9(e.totalOutputTokens)}),(0,G.jsxs)(iA,{className:`text-right tabular-nums pr-4`,children:[`$`,(e.estimatedCost??0).toFixed(2)]})]},`${e.providerId??e.platform}:${e.modelId}`))})]})})})}),m.length>0&&(0,G.jsx)(`div`,{className:`lg:col-span-2`,children:(0,G.jsx)(O9,{icon:ia,title:e(`analytics.usageByKey`),children:(0,G.jsx)(`div`,{className:`max-h-[360px] overflow-auto -mx-4`,children:(0,G.jsxs)($k,{children:[(0,G.jsx)(eA,{children:(0,G.jsxs)(nA,{children:[(0,G.jsx)(h9,{column:`label`,label:e(`analytics.keyColumn`),className:`pl-4`,sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`provider`,label:e(`common.provider`),sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`requests`,label:e(`analytics.requests`),align:`right`,sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`success`,label:e(`common.success`),align:`right`,sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`latency`,label:e(`analytics.latency`),align:`right`,sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`inTokens`,label:e(`analytics.inTokens`),align:`right`,sort:D.sort,onToggle:D.toggle}),(0,G.jsx)(h9,{column:`outTokens`,label:e(`analytics.outTokens`),align:`right`,className:`pr-4`,sort:D.sort,onToggle:D.toggle})]})}),(0,G.jsx)(tA,{children:A.map(t=>(0,G.jsxs)(nA,{children:[(0,G.jsx)(iA,{className:`pl-4 text-sm font-medium`,children:t.label||e(`analytics.keyLabelFallback`,{id:t.keyId})}),(0,G.jsx)(iA,{className:`text-xs text-muted-foreground`,children:t.platform??`—`}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:t.requests}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[t.successRate,`%`]}),(0,G.jsxs)(iA,{className:`text-right tabular-nums`,children:[t.avgLatencyMs,` ms`]}),(0,G.jsx)(iA,{className:`text-right tabular-nums`,children:E9(t.totalInputTokens)}),(0,G.jsx)(iA,{className:`text-right tabular-nums pr-4`,children:E9(t.totalOutputTokens)})]},t.keyId))})]})})})})]})]}),(0,G.jsx)(Xhe,{requestId:S,onClose:()=>C(null)})]})}var z9=[`debug`,`info`,`warn`,`error`],$he=[`info`,`warn`,`error`],ege=2e3,tge=3e3,B9={debug:0,info:0,warn:0,error:0};function nge(e){let t=new URLSearchParams;t.set(`levels`,V9(e.levels));let n=e.q?.trim();n&&t.set(`q`,n);let r=e.provider?.trim();return r&&r!==`all`&&t.set(`provider`,r),e.sinceId!=null&&t.set(`sinceId`,String(e.sinceId)),t.set(`limit`,String(e.limit??200)),`/api/logs?${t.toString()}`}function V9(e){let t=new Set(e);return z9.filter(e=>t.has(e)).join(`,`)}function rge(e,t,n=ege){if(!t.length)return e;let r=new Set(e.map(e=>e.id)),i=[];for(let e of t)r.has(e.id)||(r.add(e.id),i.push(e));if(!i.length)return e;let a=[...e,...i];return a.length>n?a.slice(a.length-n):a}function ige(e,t){if(typeof t.nextId==`number`&&Number.isFinite(t.nextId))return t.nextId;let n=e??null;for(let e of t.entries)(n==null||e.id>n)&&(n=e.id);return n}function age(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),z9.filter(e=>n.has(e))}function oge(e,t){let n=new Set(e),r=!1;for(let e of t){let t=e.provider?.trim();!t||n.has(t)||(n.add(t),r=!0)}return r?[...n].sort((e,t)=>e.localeCompare(t)):e}function H9(e,t){return String(e).padStart(t,`0`)}function sge(e){let t=new Date(e);return Number.isNaN(t.getTime())?`--:--:--.---`:`${H9(t.getHours(),2)}:${H9(t.getMinutes(),2)}:${H9(t.getSeconds(),2)}.${H9(t.getMilliseconds(),3)}`}function U9(e,t=400){return e.length>t}function cge(e,t=400){return U9(e,t)?`${e.slice(0,t)}…`:e}var lge=300,uge=40,W9={debug:`bg-muted text-muted-foreground`,info:`bg-sky-600/15 text-sky-700 dark:text-sky-400`,warn:`bg-amber-600/15 text-amber-700 dark:text-amber-400`,error:`bg-destructive/10 text-destructive`};function G9({children:e}){return(0,G.jsx)(`span`,{className:`rounded bg-muted px-1 py-px text-[10px] text-muted-foreground`,children:e})}function dge({entry:e,expanded:t,onToggleExpand:n,expandLabel:r,collapseLabel:i}){let a=U9(e.message);return(0,G.jsxs)(`div`,{"data-log-level":e.level,className:`flex items-start gap-2 rounded-lg px-2 py-1 font-mono text-[11px] leading-relaxed hover:bg-muted/40`,children:[(0,G.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:sge(e.ts)}),(0,G.jsx)(nO,{variant:`secondary`,className:Zc(`h-4 shrink-0 rounded px-1 font-mono text-[10px] uppercase`,W9[e.level]),children:e.level}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(e.source||e.provider||e.model||e.event||e.requestId)&&(0,G.jsxs)(`span`,{className:`me-1.5 inline-flex flex-wrap items-center gap-1 align-top`,children:[e.source&&(0,G.jsx)(G9,{children:e.source}),e.provider&&(0,G.jsx)(G9,{children:e.provider}),e.model&&(0,G.jsx)(G9,{children:e.model}),e.event&&(0,G.jsx)(G9,{children:e.event}),e.requestId&&(0,G.jsxs)(G9,{children:[`#`,e.requestId]})]}),(0,G.jsx)(`span`,{className:`whitespace-pre-wrap wrap-break-word`,children:a&&!t?cge(e.message):e.message}),a&&(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`ms-1.5 align-baseline text-[10px] text-muted-foreground underline underline-offset-2 hover:text-foreground`,children:t?i:r})]})]})}function fge(){let{t:e}=Z(),t=Rr(),[n,r]=(0,v.useState)(()=>[...$he]),[i,a]=(0,v.useState)(`all`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)([]),[m,h]=(0,v.useState)(B9),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(()=>new Set),[x,S]=(0,v.useState)({following:!0,seenId:null}),C=(0,v.useRef)(null),w=(0,v.useRef)(0),T=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(!0),O=(0,v.useRef)(0),k=(0,v.useCallback)(()=>{w.current+=1,C.current=null,D.current=!0,O.current=0,p([]),b(new Set),S({following:!0,seenId:null})},[]);(0,v.useEffect)(()=>{let e=o.trim();if(e===c)return;let t=window.setTimeout(()=>{l(e),k()},lge);return()=>window.clearTimeout(t)},[o,c,k]);let A=$r({queryKey:[`logs`,`${V9(n)}|${c}|${i}`],enabled:n.length>0,queryFn:async()=>{let e=w.current,t=await X(nge({levels:n,q:c,provider:i,sinceId:C.current,limit:200}));if(w.current!==e)return t;let r=t.entries??[];return C.current=ige(C.current,{entries:r,nextId:t.nextId}),h(t.counts??B9),_(e=>oge(e,r)),p(e=>rge(e,r)),t},refetchInterval:!u&&tge,refetchIntervalInBackground:!1,refetchOnWindowFocus:!u,refetchOnReconnect:!u}),j=ei({mutationFn:()=>X(`/api/logs/clear`,{method:`POST`}),onSuccess:()=>{k(),h(B9),_([]),pv.success(e(`logs.cleared`)),t.invalidateQueries({queryKey:[`logs`]})}}),M=f.length?f[f.length-1].id:null,N=e=>{let t=e.currentTarget,n=t.scrollTop,r=n<O.current-1;O.current=n,t.scrollHeight-n-t.clientHeight<=uge?(D.current=!0,S(e=>e.following?e:{following:!0,seenId:null})):r&&(D.current=!1,S(e=>e.following?{following:!1,seenId:M}:e))};(0,v.useEffect)(()=>{f.length&&D.current&&E.current?.scrollIntoView({behavior:`smooth`})},[f]);let P=()=>{D.current=!0,S({following:!0,seenId:null}),E.current?.scrollIntoView({behavior:`smooth`})},F=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},I=A.isPending&&!A.isError,L=!x.following&&M!=null&&(x.seenId==null||M>x.seenId);return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`logs.title`),description:e(`logs.description`),actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,"aria-pressed":u,onClick:()=>d(e=>!e),children:[u?(0,G.jsx)(Ca,{}):(0,G.jsx)(xa,{}),e(u?`logs.resume`:`logs.pause`)]}),(0,G.jsxs)(gO,{variant:`outline`,size:`sm`,disabled:j.isPending,onConfirm:()=>j.mutate(),children:[(0,G.jsx)(Ba,{}),e(`logs.clear`)]})]})}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,role:`group`,"aria-label":e(`logs.levelFilter`),children:z9.map(t=>{let i=n.includes(t);return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":i,"data-level":t,onClick:()=>{r(e=>age(e,t)),k()},className:Zc(`inline-flex h-7 items-center gap-1.5 rounded-4xl border border-transparent px-2.5 text-xs font-medium transition-colors`,i?W9[t]:`bg-muted/40 text-muted-foreground hover:text-foreground`),children:[e(`logs.levels.${t}`),(0,G.jsx)(`span`,{className:`tabular-nums opacity-70`,children:m[t]})]},t)})}),(0,G.jsxs)(ZO,{value:i,onValueChange:e=>{a(e??`all`),k()},children:[(0,G.jsx)($O,{size:`sm`,"aria-label":e(`common.provider`),children:(0,G.jsx)(QO,{children:t=>!t||t===`all`?e(`analytics.allProviders`):t})}),(0,G.jsxs)(ek,{children:[(0,G.jsx)(tk,{value:`all`,children:e(`analytics.allProviders`)}),g.map(e=>(0,G.jsx)(tk,{value:e,children:e},e))]})]}),(0,G.jsx)(L_,{value:o,onChange:e=>s(e.target.value),placeholder:e(`logs.searchPlaceholder`),"aria-label":e(`logs.searchPlaceholder`),className:`h-7 w-full sm:w-64`})]}),(0,G.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:e(`logs.countsHint`)}),A.isError&&(0,G.jsxs)(`div`,{className:`mb-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2.5 text-xs text-destructive`,children:[e(`logs.loadFailed`),` `,A.error instanceof Error?A.error.message:String(A.error??``)]}),(0,G.jsxs)(`div`,{className:`relative rounded-3xl border bg-card`,children:[(0,G.jsxs)(`div`,{ref:T,onScroll:N,className:`max-h-[65vh] min-h-[240px] overflow-y-auto p-3`,children:[n.length===0?(0,G.jsx)($D,{className:`border-0`,icon:ka,title:e(`logs.noLevelsTitle`),description:e(`logs.noLevelsDescription`)}):I?(0,G.jsx)(`div`,{className:`space-y-1.5`,children:Array.from({length:8}).map((e,t)=>(0,G.jsx)(nk,{className:`h-4 rounded`},t))}):f.length===0?A.isError?null:(0,G.jsx)($D,{className:`border-0`,icon:ka,title:e(`logs.emptyTitle`),description:e(`logs.emptyDescription`)}):f.map(t=>(0,G.jsx)(dge,{entry:t,expanded:y.has(t.id),onToggleExpand:()=>F(t.id),expandLabel:e(`logs.showMore`),collapseLabel:e(`logs.showLess`)},t.id)),(0,G.jsx)(`div`,{ref:E})]}),L&&(0,G.jsxs)(J,{type:`button`,size:`sm`,variant:`secondary`,onClick:P,className:`absolute inset-x-0 bottom-3 mx-auto w-fit shadow-sm`,children:[(0,G.jsx)(pi,{}),e(`logs.jumpToLatest`)]})]}),f.length>0&&(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:e(`logs.buffered`,{count:f.length,max:2e3})})]})}function pge(){let{t:e}=Z();return(0,G.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,G.jsxs)(`div`,{className:`w-full max-w-md rounded-3xl border bg-card p-6 sm:p-8 text-center`,children:[(0,G.jsx)(Ui,{className:`mx-auto size-8 text-muted-foreground`}),(0,G.jsx)(`h1`,{className:`mt-4 text-lg font-semibold`,children:e(`notFound.title`)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`notFound.description`)}),(0,G.jsx)(`div`,{className:`mt-5`,children:(0,G.jsx)(gn,{to:`/`,children:(0,G.jsx)(J,{size:`sm`,children:e(`errors.goHome`)})})})]})})}var mge={claude:{tint:`[--mk:#D37152] dark:[--mk:#D97757]`,art:(0,G.jsx)(`path`,{d:`m4.67 15.8 4.67-2.62 0.08-0.23-0.08-0.13h-0.23l-0.78-0.05-2.67-0.07-2.31-0.1-2.24-0.12-0.56-0.12-0.53-0.7 0.05-0.35 0.47-0.32 0.68 0.06 1.5 0.1 2.25 0.16 1.63 0.1 2.42 0.25h0.38l0.05-0.16-0.13-0.1-0.1-0.1L6.89 9.98l-2.52-1.67-1.32-0.96-0.72-0.49-0.36-0.46-0.16-1 0.65-0.72 0.87 0.06 0.22 0.06 0.88 0.68 1.89 1.46 2.46 1.82 0.36 0.3 0.14-0.1 0.02-0.07-0.16-0.27-1.34-2.42-1.43-2.46-0.64-1.02-0.17-0.61c-0.06-0.25-0.1-0.46-0.1-0.72L6.22 0.37 6.62 0.24l0.99 0.13 0.41 0.36 0.61 1.4 0.99 2.21 1.54 3 0.45 0.89 0.24 0.82 0.09 0.25h0.16v-0.14l0.13-1.69 0.23-2.07 0.23-2.67 0.08-0.75 0.37-0.9 0.74-0.49 0.58 0.28 0.47 0.68-0.07 0.44-0.28 1.83-0.55 2.87-0.36 1.92h0.21l0.24-0.24 0.97-1.29 1.63-2.04 0.72-0.81 0.84-0.9 0.54-0.43h1.02l0.75 1.12-0.34 1.15-1.05 1.33-0.87 1.13-1.25 1.68-0.78 1.35 0.07 0.11 0.19-0.02 2.82-0.6 1.53-0.28 1.82-0.31 0.82 0.38 0.09 0.39-0.32 0.8-1.95 0.48-2.28 0.46-3.4 0.81-0.04 0.03 0.05 0.06 1.53 0.14 0.66 0.04h1.6l2.99 0.22 0.78 0.52 0.47 0.63-0.08 0.48-1.2 0.61-1.62-0.38-3.79-0.9-1.3-0.32h-0.18v0.11l1.08 1.06 1.98 1.79 2.48 2.31 0.13 0.57-0.32 0.45-0.34-0.05-2.18-1.64-0.84-0.74-1.91-1.6h-0.13v0.17l0.44 0.64 2.32 3.49 0.12 1.07-0.17 0.35-0.6 0.21-0.66-0.12-1.36-1.91L14.23 18.02l-1.13-1.92-0.14 0.08-0.67 7.18-0.31 0.37-0.72 0.28-0.6-0.46-0.32-0.74 0.32-1.46 0.38-1.91 0.31-1.51 0.28-1.88 0.17-0.63-0.01-0.04-0.14 0.02-1.42 1.95-2.16 2.92-1.71 1.83-0.41 0.16-0.71-0.37 0.07-0.66 0.4-0.58 2.36-3.01 1.42-1.86 0.92-1.08-0.01-0.16h-0.05l-6.28 4.08-1.12 0.14-0.48-0.45 0.06-0.74 0.23-0.24 1.89-1.3Z`})},codex:{tint:`[--mk:#000000] dark:[--mk:#FFFFFF]`,art:(0,G.jsx)(`path`,{d:`M9.46 9.06v-2.07c0-0.17 0.07-0.31 0.22-0.39l4.16-2.4c0.57-0.33 1.24-0.48 1.94-0.48 2.62 0 4.27 2.03 4.27 4.19 0 0.15 0 0.33-0.02 0.5L15.72 5.87c-0.26-0.15-0.52-0.15-0.78 0L9.46 9.06Zm9.72 8.07V12.18c0-0.31-0.13-0.52-0.39-0.68L13.32 8.32l1.79-1.02c0.15-0.09 0.28-0.09 0.44 0l4.16 2.4c1.2 0.7 2.01 2.18 2.01 3.62 0 1.66-0.98 3.18-2.53 3.82Zm-11.01-4.36-1.79-1.05c-0.15-0.09-0.22-0.22-0.22-0.39V6.53c0-2.33 1.79-4.1 4.21-4.1 0.92 0 1.77 0.31 2.49 0.85l-4.3 2.49c-0.26 0.15-0.39 0.37-0.39 0.68v6.32ZM12.02 14.99l-2.56-1.44V10.5L12.02 9.06l2.56 1.44v3.05L12.02 14.99Zm1.65 6.63c-0.92 0-1.77-0.31-2.49-0.85l4.3-2.49c0.26-0.15 0.39-0.37 0.39-0.68V11.28l1.81 1.05c0.15 0.09 0.22 0.22 0.22 0.39v4.8c0 2.33-1.81 4.1-4.23 4.1v0Zm-5.17-4.86-4.16-2.4c-1.2-0.7-2.01-2.18-2.01-3.62 0-1.68 1-3.18 2.55-3.82v4.97c0 0.31 0.13 0.52 0.39 0.68l5.45 3.16-1.79 1.02c-0.15 0.09-0.28 0.09-0.44 0ZM8.26 20.33c-2.46 0-4.27-1.85-4.27-4.14 0-0.17 0.02-0.35 0.04-0.52L8.33 18.15c0.26 0.15 0.52 0.15 0.78 0l5.47-3.16v2.07c0 0.17-0.07 0.31-0.22 0.39L10.2 19.85c-0.57 0.33-1.24 0.48-1.94 0.48h0Zm5.41 2.59c2.64 0 4.84-1.88 5.34-4.36C21.45 17.93 23.02 15.64 23.02 13.31c0-1.53-0.65-3.01-1.83-4.08 0.11-0.46 0.17-0.92 0.17-1.37 0-3.12-2.53-5.45-5.45-5.45-0.59 0-1.16 0.09-1.72 0.28C13.21 1.73 11.86 1.12 10.38 1.12c-2.64 0-4.84 1.88-5.34 4.36C2.59 6.11 1.02 8.4 1.02 10.74c0 1.53 0.65 3.01 1.83 4.08-0.11 0.46-0.17 0.92-0.17 1.37 0 3.12 2.53 5.45 5.45 5.45 0.59 0 1.16-0.09 1.72-0.28 0.98 0.96 2.33 1.57 3.82 1.57Z`})},cline:{tint:`[--mk:#18181B] dark:[--mk:#FAFAFA]`,art:(0,G.jsx)(`path`,{d:`m18.42 10.69-1.14-2.28V8.97c0-2.18-1.75-3.94-3.91-3.94h-1.94c0.14-0.29 0.22-0.61 0.22-0.96A2.18 2.18 0 0 0 12.2 1.88a2.18 2.18 0 0 0-2.18 2.19c0 0.34 0.08 0.67 0.22 0.96H8.3c-2.16 0-3.91 1.76-3.91 3.94v1.31L3.23 12.57c-0.12 0.23-0.12 0.5 0 0.73l1.16 2.25v1.31C4.39 19.04 6.14 20.8 8.3 20.8h7.81c2.16 0 3.91-1.76 3.91-3.94V15.55l1.14-2.26c0.11-0.23 0.11-0.49 0-0.72m-10.13 1.86a1.79 1.79 0 0 1-1.78 1.79 1.79 1.79 0 0 1-1.78-1.79v-3.19A1.79 1.79 0 0 1 9.23 9.45a1.79 1.79 0 0 1 1.78 1.79zm5.74 0a1.79 1.79 0 0 1-1.78 1.79 1.79 1.79 0 0 1-1.78-1.79v-3.19A1.79 1.79 0 0 1 14.97 9.45a1.79 1.79 0 0 1 1.78 1.79z`})},continue:{tint:`[--mk:#000000] dark:[--mk:#FFFFFF]`,art:(0,G.jsx)(`path`,{d:`M19.28 4.39L18.05 6.52L21.15 11.88C21.17 11.92 21.19 11.97 21.19 12.01C21.19 12.06 21.17 12.11 21.15 12.15L18.05 17.51L19.28 19.64L23.68 12.01L19.28 4.39V4.39ZM17.58 6.24L18.8 4.12H16.35L15.13 6.24H17.58H17.58ZM15.13 6.79L17.99 11.74H20.44L17.58 6.79H15.13ZM17.58 17.24L20.44 12.29H17.99L15.13 17.24H17.58ZM15.13 17.79L16.35 19.91H18.8L17.58 17.79H15.12H15.13ZM6.82 20.43C6.77 20.43 6.73 20.42 6.69 20.4C6.65 20.37 6.61 20.34 6.59 20.3L3.49 14.93H1.04L5.44 22.55H14.24L13.01 20.43H6.83H6.82ZM13.49 20.16L14.71 22.28L15.94 20.15L14.71 18.03L13.49 20.15V20.16ZM14.24 17.76H8.53L7.3 19.88H13.01L14.24 17.76ZM8.05 17.49L5.19 12.53L3.96 14.66L6.82 19.61L8.05 17.49ZM1.03 14.38H3.48L4.71 12.26H2.26L1.03 14.38ZM6.57 3.74C6.6 3.7 6.63 3.67 6.67 3.65C6.71 3.62 6.76 3.61 6.81 3.61H13.01L14.23 1.48H5.42L1.02 9.11H3.47L6.56 3.75L6.57 3.74ZM4.71 11.78L3.48 9.66H1.03L2.26 11.78H4.71ZM6.81 4.43L3.96 9.38L5.18 11.51L8.04 6.56L6.81 4.43ZM13.01 4.16H7.29L8.51 6.28H14.23L13.01 4.16ZM14.71 6L15.93 3.88L14.71 1.76L13.49 3.88L14.71 6Z`})},aider:{tint:`[--mk:#07A160] dark:[--mk:#02F191]`,scale:.96,art:(0,G.jsx)(`path`,{d:`M14.78 0.67c0.12 0.12 0.17 0.72 0.18 2.38l0.01 1.82 1.29 0.03c0.71 0.02 1.3 0.05 1.33 0.07 0.02 0.02 0.06 0.28 0.09 0.57 0.03 0.29 0.1 0.75 0.15 1.03 0.1 0.51 0.1 0.48-0.1 1.39-0.08 0.4-0.08 2.18 0.01 2.62 0.13 0.6 0.13 0.95 0.03 1.48-0.14 0.73-0.14 2.17 0.01 2.74 0.14 0.53 0.14 1.27 0.01 1.97-0.05 0.29-0.1 0.65-0.1 0.79l0 0.26 1.21 0c0.66 0 1.24 0.02 1.29 0.05 0.06 0.04 0.11 0.3 0.16 0.89 0.05 0.45 0.1 0.91 0.12 1 0.04 0.23-0.14 2.16-0.22 2.31-0.06 0.11-0.13 0.11-1.28 0.1-0.81-0.01-1.24-0.04-1.29-0.08-0.13-0.13-0.2-1.8-0.13-3 0.04-0.61 0.05-1.13 0.03-1.16-0.05-0.08-2.49-0.07-2.58 0.01-0.07 0.07-0.05 0.87 0.05 1.56 0.05 0.33 0.05 0.57 0.01 0.84-0.04 0.21-0.08 0.59-0.1 0.86-0.05 0.74-0.08 0.84-0.25 0.92-0.11 0.05-1.3 0.07-4.06 0.07l-3.91 0-0.07-0.2c-0.19-0.58-0.26-2.01-0.16-3.19 0.03-0.33 0.04-0.68 0.01-0.77l-0.04-0.16-1.16 0c-1.26 0-1.51-0.02-1.56-0.17-0.07-0.2-0.1-2.34-0.04-3.12 0.09-1.11-0.01-1.04 1.55-1.08 0.69-0.02 1.27-0.05 1.3-0.07 0.02-0.02 0.01-0.31-0.03-0.63-0.04-0.32-0.1-0.78-0.13-1-0.04-0.33-0.03-0.54 0.07-1.02 0.06-0.33 0.13-0.78 0.16-0.99 0.02-0.22 0.06-0.43 0.09-0.47 0.04-0.07 0.77-0.09 3.98-0.11l3.93-0.03 0.05-0.18c0.03-0.11 0.02-0.43-0.02-0.78-0.07-0.69-0.04-2.07 0.07-2.72 0.06-0.36 0.06-0.45-0.01-0.49-0.05-0.03-1.79-0.05-3.89-0.05l-3.8 0-0.16-0.15c-0.11-0.1-0.16-0.2-0.16-0.34 0-0.11-0.03-0.52-0.06-0.91-0.06-0.77 0.03-2.69 0.13-2.82 0.03-0.04 0.16-0.08 0.28-0.09 0.47-0.04 7.66-0.02 7.7 0.02z`})},opencode:{tint:`[--mk:#17181C] [--mk2:#E6E5E6] dark:[--mk:#FFFFFF] dark:[--mk2:#5A5858]`,art:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{fill:`var(--mk2)`,d:`M15.68 10.26v7.04H8.35v-7.04z`}),(0,G.jsx)(`path`,{d:`M19.35 20.82H4.68V3.22h14.67zM15.68 6.74H8.35v10.56h7.33z`})]})},goose:{tint:`[--mk:#101010] dark:[--mk:#FFFFFF]`,art:(0,G.jsx)(`path`,{d:`M23.8 21.2L21.9 19.7C20.9 18.9 20 17.9 19.3 16.7 18.4 15.2 17.1 13.8 15.5 12.9L14.8 12.4C14.5 12.2 14.3 12 14.3 11.6 14.3 11.4 14.3 11.3 14.5 11.1 14.9 10.5 17 8.2 17.4 7.9 17.8 7.5 18.4 7.2 18.9 6.8 19 6.8 19 6.7 19.1 6.7 19.3 6.5 19.4 6.4 19.5 6.2 20.1 5.6 20.1 5 20.1 5 20 4.8 19.8 4.4 19.4 4.2 19.8 4.1 20.2 4.3 20.4 4.5 20.7 4.1 20.8 3.9 21.1 3.4 21.1 3.3 21.2 3.2 21 3 20.9 2.9 20.7 2.9 20.6 3 20 3.3 19.5 3.6 19 3.9 19 3.9 18.5 3.9 17.8 4.5 17.6 4.6 17.5 4.8 17.4 4.9 17.3 5 17.2 5.1 17.2 5.1 16.8 5.6 16.5 6.2 16.1 6.7 15.8 7 13.5 9.2 12.9 9.6 12.8 9.7 12.6 9.7 12.4 9.7 12.1 9.7 11.8 9.5 11.6 9.2L11.2 8.5C10.2 6.9 8.9 5.6 7.3 4.7 6.2 4 5.2 3.2 4.3 2.1L2.8 0.3C2.7 0.2 2.6 0.2 2.5 0.3 2.3 0.6 2 1.4 1.7 2.3 1.7 2.3 1.7 2.4 1.7 2.4 2.1 2.8 2.8 3.6 3.7 4.3 3.7 4.4 3.7 4.5 3.6 4.5 2.9 4.3 2.1 3.9 1.6 3.7 1.5 3.6 1.5 3.7 1.5 3.7 1.4 4.4 1.4 5.2 1.4 6 1.4 6 1.5 6 1.5 6 2.1 6.3 3.1 6.7 4.2 6.9 4.3 7 4.3 7.1 4.2 7.1 3.4 7.2 2.5 7.3 1.8 7.3 1.7 7.3 1.7 7.3 1.7 7.4 1.9 7.9 2.1 8.4 2.3 8.9 2.4 9.1 2.5 9.3 2.6 9.5 2.7 9.6 2.7 9.6 2.7 9.6 3.3 9.6 4 9.5 4.7 9.4 4.8 9.4 4.9 9.5 4.8 9.6 4.3 9.9 3.8 10.2 3.4 10.4 3.3 10.4 3.3 10.5 3.3 10.6 3.6 11 3.9 11.3 4.2 11.7 4.2 11.7 5.9 13.4 5.9 13.5 6.9 12.5 8.5 11.4 10.2 10.5 7.9 12.4 6.6 13.8 5.9 14.6L5.5 15.2C5.2 15.6 5 15.9 4.8 16.3 4.3 17.5 3.3 20.1 3.3 20.1 3.2 20.3 3.3 20.5 3.4 20.6 3.6 20.7 3.8 20.8 4 20.7 4 20.7 6.5 19.8 7.7 19.2 8.1 19 8.5 18.8 8.8 18.6L9.5 18C9.9 17.8 10.4 17.8 10.7 18.2L12.4 19.8C12.7 20.1 13.1 20.4 13.4 20.7 13.5 20.8 13.6 20.7 13.6 20.7 13.8 20.2 14.1 19.7 14.4 19.2 14.5 19.1 14.7 19.2 14.6 19.3 14.5 20 14.5 20.7 14.4 21.3 14.4 21.3 14.4 21.4 14.5 21.4 14.7 21.5 14.9 21.6 15.2 21.7 15.7 22 16.2 22.2 16.7 22.3 16.7 22.3 16.8 22.3 16.8 22.2 16.8 21.5 16.8 20.7 16.9 19.8 17 19.8 17.1 19.8 17.1 19.8 17.3 20.9 17.7 21.9 18 22.5 18 22.6 18 22.6 18.1 22.6 18.9 22.7 19.6 22.7 20.3 22.6 20.4 22.6 20.4 22.5 20.4 22.5 20.1 21.9 19.8 21.2 19.5 20.4 19.5 20.3 19.6 20.3 19.7 20.3 20.4 21.2 21.2 22 21.6 22.3 21.7 22.3 21.7 22.3 21.7 22.3 22.7 22 23.4 21.7 23.7 21.5 23.8 21.5 23.9 21.3 23.8 21.3L23.8 21.2Z`})},qwen:{tint:`[--mk:#6950EF] dark:[--mk:#6950EF]`,art:(0,G.jsx)(`path`,{d:`M22.73 14.3 19.94 9.48l1.32-2.29a0.5 0.5 0 0 0 0-0.51l-1.47-2.54a0.51 0.51 0 0 0-0.44-0.25h-5.58L12.46 1.6a0.51 0.51 0 0 0-0.44-0.26H9.09a0.5 0.5 0 0 0-0.44 0.26L5.86 6.43h-2.64a0.5 0.5 0 0 0-0.44 0.26L1.31 9.22a0.5 0.5 0 0 0 0 0.51L4.1 14.56l-1.32 2.29a0.5 0.5 0 0 0 0 0.51l1.47 2.54a0.51 0.51 0 0 0 0.44 0.25h5.57l1.32 2.29a0.51 0.51 0 0 0 0.44 0.26h2.93a0.51 0.51 0 0 0 0.44-0.26l2.79-4.83h2.64a0.51 0.51 0 0 0 0.44-0.25l1.47-2.54a0.49 0.49 0 0 0 0-0.51M9.09 1.85l1.47 2.54-1.47 2.54H20.83L19.36 9.48H7.91L6.3 6.68Zm1.17 17.79-5.57 0 1.47-2.54h2.93L3.22 6.94h2.93q2.86 4.96 5.72 9.91zm9.09-5.08L17.89 12.02l-5.87 10.16-1.47-2.54c1.91-3.3 3.82-6.6 5.73-9.91h3.23l2.79 4.83z`})},roo:{tint:`[--mk:#000000] dark:[--mk:#FFFFFF]`,art:(0,G.jsx)(`path`,{d:`M19.48 5.42l-0.43 1.56c-0.02 0.08-0.11 0.13-0.19 0.1l-7.01-2.17c-0.05-0.01-0.1 0-0.14 0.03l-7.21 5.79c-0.02 0.02-0.04 0.03-0.07 0.03l-4.3 0.66c-0.08 0.01-0.13 0.08-0.13 0.16l0.03 0.62c0 0.08 0.06 0.14 0.14 0.14l5 0.31c0.03 0 0.05 0 0.08-0.01l3.65-1.84c0.05-0.03 0.11-0.02 0.16 0.01l2.34 1.75c0.04 0.03 0.06 0.07 0.06 0.12l-0.02 2.9c0 0.03 0.01 0.06 0.03 0.09l3.67 5.27c0.03 0.04 0.07 0.06 0.12 0.06h1.25c0.11 0 0.19-0.12 0.13-0.22l-2.71-4.96c-0.02-0.04-0.02-0.1 0-0.14l1.37-2.61c0.01-0.03 0.04-0.05 0.06-0.06l4.87-2.47c0.05-0.02 0.11-0.02 0.15 0.01l1.4 0.93c0.02 0.02 0.05 0.02 0.08 0.02h1.28c0.12 0 0.19-0.13 0.13-0.23l-3.54-5.86c-0.07-0.11-0.24-0.09-0.28 0.04Z`})},kilo:{tint:`[--mk:#949107] dark:[--mk:#FAF74F]`,scale:.95,art:(0,G.jsx)(`path`,{d:`M16.43 19.72H19.95V22.53H15.52L13.61 20.62V16.2H16.43V19.72ZM22.76 15.29L20.85 13.38H16.43V16.2L19.95 16.2V19.72H22.76V15.29ZM10.79 13.38H7.98V16.2H10.79V13.38ZM1.64 20.62L3.55 22.53H10.79V19.72H4.46V13.38H1.64V20.62ZM19.57 7.75V3.33L17.66 1.41H13.61V4.23H16.76V7.75H13.61V10.57H22.76V7.75H19.57ZM4.46 1.41H1.64V10.57H4.46V7.4H7.98V10.57H10.79V7.4L7.98 4.58H4.46V1.41ZM10.79 1.41H7.98V4.58H10.79V1.41Z`})},cursor:{tint:`[--mk:#26251E] dark:[--mk:#EDECEC]`,art:(0,G.jsx)(`path`,{d:`M11.83 2.32 4.08 6.79a0.68 0.68 0 0 0-0.34 0.59v9.03c0 0.24 0.13 0.46 0.34 0.58l7.75 4.48a0.81 0.81 0 0 0 0.81 0l7.75-4.48a0.68 0.68 0 0 0 0.34-0.58V7.38a0.68 0.68 0 0 0-0.34-0.59L12.63 2.32a0.81 0.81 0 0 0-0.8 0M4.69 7.32h14.96c0.21 0 0.35 0.23 0.24 0.42L12.42 20.7c-0.05 0.09-0.18 0.05-0.18-0.05V12.16a0.48 0.48 0 0 0-0.24-0.41l-7.35-4.24c-0.09-0.05-0.05-0.19 0.05-0.19`})},crush:{tint:`[--mk:#6B50FF] dark:[--mk:#6B50FF]`},dsh:{tint:`[--mk:#4D6BFE] dark:[--mk:#4D6BFE]`},mimo:{tint:`[--mk:#000000] dark:[--mk:#FFFFFF]`},atomcode:{tint:`[--mk:#3C82F6] dark:[--mk:#3C82F6]`},openclaw:{tint:`[--mk:#991B1B] dark:[--mk:#FF4D4D]`,art:(0,G.jsxs)(`g`,{transform:`translate(0 0) scale(0.2)`,children:[(0,G.jsx)(`path`,{d:`M60 10 C30 10 15 35 15 55 C15 75 30 95 45 100 L45 110 L55 110 L55 100 C55 100 60 102 65 100 L65 110 L75 110 L75 100 C90 95 105 75 105 55 C105 35 90 10 60 10Z`}),(0,G.jsx)(`path`,{d:`M20 45 C5 40 0 50 5 60 C10 70 20 65 25 55 C28 48 25 45 20 45Z`}),(0,G.jsx)(`path`,{d:`M100 45 C115 40 120 50 115 60 C110 70 100 65 95 55 C92 48 95 45 100 45Z`}),(0,G.jsx)(`path`,{d:`M45 15 Q35 5 30 8`,fill:`none`,stroke:`var(--mk, currentColor)`,strokeWidth:3,strokeLinecap:`round`}),(0,G.jsx)(`path`,{d:`M75 15 Q85 5 90 8`,fill:`none`,stroke:`var(--mk, currentColor)`,strokeWidth:3,strokeLinecap:`round`})]})},hermes:{tint:`[--mk:#000000] dark:[--mk:#FFFFFF]`},pi:{tint:`[--mk:#111111] dark:[--mk:#F6F6F6]`,art:(0,G.jsxs)(`g`,{transform:`translate(1.5 1.5) scale(0.0375)`,children:[(0,G.jsx)(`path`,{d:`M420 280H280V140H0V0H420V280Z`}),(0,G.jsx)(`path`,{d:`M560 560H420V280H560V560Z`}),(0,G.jsx)(`path`,{d:`M140 560H0V140H140V280H280V420H140V560Z`})]})},generic:{tint:``,art:(0,G.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,G.jsx)(`rect`,{x:`2.8`,y:`4.3`,width:`18.4`,height:`15.4`,rx:`3.6`}),(0,G.jsx)(`path`,{d:`M7.6 10.4 10.1 12.9 7.6 15.4`}),(0,G.jsx)(`path`,{d:`M12.6 15.4h4.4`})]})}};function hge({scale:e,children:t,...n}){return(0,G.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`var(--mk, currentColor)`,"aria-hidden":`true`,...n,children:e?(0,G.jsx)(`g`,{transform:`translate(12 12) scale(${e}) translate(-12 -12)`,children:t}):t})}function gge(e){return e.replace(/[^A-Za-z0-9]/g,``).slice(0,2).toUpperCase()}function _ge({id:e,name:t,className:n}){let r=mge[e];return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:Zc(`flex size-9 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground`,r?.tint,n),children:r?.art?(0,G.jsx)(hge,{className:`size-5`,scale:r.scale,children:r.art}):(0,G.jsx)(`span`,{className:`font-mono text-[11px] font-semibold`,style:{color:`var(--mk, currentColor)`},children:gge(t)})})}function vge({className:e,size:t=`default`,...n}){return(0,G.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:Zc(`group/card flex flex-col gap-4 overflow-hidden rounded-3xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-3xl *:[img:last-child]:rounded-b-3xl`,e),...n})}function yge({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-header`,className:Zc(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-3xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function bge({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-title`,className:Zc(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function xge({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-description`,className:Zc(`text-sm text-muted-foreground`,e),...t})}function Sge({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-action`,className:Zc(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}function Cge({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-content`,className:Zc(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}var wge=[{id:`claude`,name:`Claude Code`,category:`code`,configType:`file`,protocol:`Anthropic Messages`,baseUrlSupport:`root`,command:`setup-claude`,docsUrl:`https://docs.anthropic.com/en/docs/claude-code`},{id:`codex`,name:`Codex CLI`,category:`code`,configType:`file`,protocol:`OpenAI Responses`,baseUrlSupport:`/v1`,command:`setup-codex`,docsUrl:`https://developers.openai.com/codex`},{id:`cline`,name:`Cline`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-cline`,docsUrl:`https://docs.cline.bot`},{id:`continue`,name:`Continue`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-continue`,docsUrl:`https://docs.continue.dev`},{id:`aider`,name:`Aider`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-aider`,docsUrl:`https://aider.chat/docs`},{id:`opencode`,name:`OpenCode`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-opencode`,docsUrl:`https://opencode.ai/docs`},{id:`goose`,name:`Goose`,category:`agent`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-goose`,docsUrl:`https://block.github.io/goose`},{id:`qwen`,name:`Qwen Code`,category:`code`,configType:`file`,protocol:`OpenAI or Gemini`,baseUrlSupport:`/v1`,command:`setup-qwen`,docsUrl:`https://qwenlm.github.io/qwen-code-docs`},{id:`roo`,name:`Roo Code`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-roo`,docsUrl:`https://docs.roocode.com`},{id:`kilo`,name:`Kilo Code`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-kilo`,docsUrl:`https://kilocode.ai/docs`},{id:`crush`,name:`Crush`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-crush`,docsUrl:`https://github.com/charmbracelet/crush`},{id:`dsh`,name:`DeepSeek Harness`,category:`agent`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-dsh`,docsUrl:`https://github.com/deepseek-ai/deepseek-harness`},{id:`mimo`,name:`MiMo Code`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-mimo`,docsUrl:`https://mimo.xiaomi.com/mimocode`},{id:`atomcode`,name:`AtomCode`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-atomcode`,docsUrl:`https://atomcode.atomgit.com/docs/en/`},{id:`openclaw`,name:`OpenClaw`,category:`agent`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-openclaw`,docsUrl:`https://docs.openclaw.ai/gateway/config-tools/custom-providers`},{id:`hermes`,name:`Hermes Agent`,category:`agent`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/`},{id:`pi`,name:`Pi`,category:`code`,configType:`file`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-pi`,docsUrl:`https://pi.dev/docs/latest/models`},{id:`cursor`,name:`Cursor`,category:`code`,configType:`guide`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-cursor`,docsUrl:`https://docs.cursor.com`},{id:`generic`,name:`Generic OpenAI client`,category:`agent`,configType:`guide`,protocol:`OpenAI Chat`,baseUrlSupport:`/v1`,command:`setup-generic`,docsUrl:`https://platform.openai.com/docs/api-reference/chat`}],Tge={claude:`claude-code`,codex:`codex`,cline:`cline`,continue:`continue`,aider:`aider`,opencode:`opencode`,goose:`goose`,qwen:`qwen-code`,roo:`roo`,kilo:`kilo-code`,crush:`crush`,dsh:`deepseek-harness`,mimo:`mimo-code`,atomcode:`atomcode`,openclaw:`openclaw`,hermes:`hermes-agent`,pi:`pi`,cursor:`cursor`};function Ege(e){return e.length<12?`••••••••`:`${e.slice(0,8)}${`•`.repeat(12)}${e.slice(-4)}`}function Dge(){let{t:e}=Z(),[t,n]=(0,v.useState)(!1),{data:r}=$r({queryKey:[`api-key`],queryFn:()=>X(`/api/settings/api-key`)}),{data:i=[]}=$r({queryKey:[`analytics`,`by-client`,`30d`],queryFn:()=>X(`/api/analytics/by-client?range=30d`)}),a=Date.now()-6048e5,o=new Map(i.filter(e=>e.lastSeenAt&&Date.parse(e.lastSeenAt)>=a).map(e=>[e.clientAgent,e])),s=window.location.origin,c=r?.apiKey?t?r.apiKey:Ege(r.apiKey):`…`;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(QD,{title:e(`agents.title`),description:e(`agents.description`),actions:(0,G.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>n(e=>!e),children:[e(t?`common.hide`:`common.show`),` `,e(`agents.apiKey`)]})}),(0,G.jsxs)(`section`,{className:`mb-6 rounded-3xl border bg-card p-4 sm:p-5`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:e(`agents.quickstartTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 max-w-prose text-xs text-muted-foreground`,children:e(`agents.quickstart`)}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2`,children:[(0,G.jsxs)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-xs`,children:[`npx srouter setup-claude --url `,s]}),(0,G.jsx)(vv,{text:`npx srouter setup-claude --url ${s}`,className:`size-7 shrink-0`,label:e(`common.copy`)})]}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,G.jsx)(`span`,{children:e(`agents.currentKey`)}),(0,G.jsx)(`code`,{className:`font-mono break-all`,children:c})]})]}),(0,G.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:wge.map(t=>{let n=o.get(Tge[t.id]??t.id),i=`npx srouter ${t.command} --url ${s}`,a=t.baseUrlSupport===`root`?s:`${s}/v1`,l=`BASE_URL=${a}\nAPI_KEY=${r?.apiKey??`<unified-key>`}`,u=`BASE_URL=${a}\nAPI_KEY=${c}`,d=`agents.descriptions.${t.id}`,f=e(d);return(0,G.jsxs)(vge,{size:`sm`,children:[(0,G.jsxs)(yge,{children:[(0,G.jsx)(_ge,{id:t.id,name:t.name,className:`mb-1.5`}),(0,G.jsx)(bge,{children:t.name}),(0,G.jsx)(xge,{className:`text-xs`,children:f===d?`${t.protocol} · ${t.baseUrlSupport}`:f}),(0,G.jsx)(Sge,{children:n&&(0,G.jsxs)(nO,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600 dark:text-emerald-400`,children:[(0,G.jsx)(Ni,{}),e(`agents.seenRecently`)]})})]}),(0,G.jsxs)(Cge,{className:`flex flex-1 flex-col gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:e(`agents.setupLabel`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.configType===`guide`?e(`agents.setupGuideHint`):e(`agents.setupHint`)}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-xl bg-muted/50 px-3 py-2`,children:[(0,G.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[11px]`,children:i}),(0,G.jsx)(vv,{text:i,className:`size-7 shrink-0`,label:e(`common.copy`)})]})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-xs font-medium`,children:e(`agents.manualLabel`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`agents.manualHint`)}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-start gap-2 rounded-xl border px-3 py-2`,children:[(0,G.jsx)(`code`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-[11px]`,children:u}),(0,G.jsx)(vv,{text:l,className:`size-7 shrink-0`,label:e(`common.copy`)})]})]}),(0,G.jsxs)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noreferrer`,className:`mt-auto inline-flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground`,children:[e(`agents.documentation`),` `,(0,G.jsx)(Ji,{className:`size-3`})]})]})]},t.id)})})]})}var Oge=new Fr({defaultOptions:{queries:{staleTime:3e4}},mutationCache:new jr({onError:(e,t,n,r)=>{r.meta?.silenceToast||pv.error(e instanceof Error?e.message:String(e))}})}),K9=[{to:`/models`,labelKey:`nav.models`},{to:`/playground`,labelKey:`nav.playground`},{to:`/keys`,labelKey:`nav.keys`},{to:`/agents`,labelKey:`nav.agents`},{to:`/analytics`,labelKey:`nav.analytics`}],q9={"/models":{ariaKey:`nav.modelsMenu`,items:[{to:`/models/chat`,labelKey:`models.chatModelsTab`},{to:`/models/embeddings`,labelKey:`models.embeddingsTab`},{to:`/models/image`,labelKey:`models.imageTab`},{to:`/models/video`,labelKey:`models.videoTab`},{to:`/models/audio`,labelKey:`models.audioTab`},{to:`/models/fusion`,labelKey:`models.fusionTab`}],isActive:e=>e.startsWith(`/models`)},"/analytics":{ariaKey:`nav.analyticsMenu`,items:[{to:`/analytics`,labelKey:`nav.analytics`},{to:`/logs`,labelKey:`nav.logs`}],isActive:e=>e.startsWith(`/analytics`)||e.startsWith(`/logs`)}},kge=typeof navigator<`u`&&/mac/i.test(navigator.platform);function J9({to:e,children:t}){return(0,G.jsx)(_n,{to:e,className:({isActive:e})=>`relative text-sm px-1 py-4 transition-colors duration-150 ${e?`text-foreground font-medium after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:rounded-full after:bg-linear-to-r after:from-[#046CD6] after:to-[#F90E01] dark:after:from-[#14AFE6]`:`text-muted-foreground hover:text-foreground`}`,children:t})}function Age(){return(0,G.jsxs)(gn,{to:`/`,className:`flex items-center gap-2 transition-opacity hover:opacity-70`,children:[(0,G.jsx)(nv,{className:`size-6`}),(0,G.jsx)(`span`,{className:`font-semibold tracking-tight text-base`,children:`SRouter`})]})}var Y9=typeof window<`u`&&window.__SROUTER_DESKTOP__===!0,X9=typeof window<`u`?window.__SROUTER_PLATFORM__:void 0,Z9=Y9&&(X9?X9===`darwin`:typeof navigator<`u`&&/Macintosh|Mac OS X/.test(navigator.userAgent));Y9&&(document.documentElement.classList.add(`desktop`),Z9&&document.documentElement.classList.add(`desktop-mac`));function Q9({showUpgrade:e,upgradeLabel:t,settingsLabel:n,signOutLabel:r,changeEmailLabel:i,changePasswordLabel:a,onUpgrade:o,onOpenSettings:s,onChangeEmail:c,onChangePassword:l}){return(0,G.jsxs)(G.Fragment,{children:[e&&(0,G.jsxs)(Fg,{onClick:o,children:[(0,G.jsx)(Pa,{}),t]}),(0,G.jsxs)(Fg,{onClick:s,children:[(0,G.jsx)(Ma,{}),n]}),!Y9&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Bg,{}),(0,G.jsxs)(Fg,{onClick:c,children:[(0,G.jsx)(`span`,{className:`flex size-4 items-center justify-center font-serif text-xs font-bold`,children:`@`}),i]}),(0,G.jsxs)(Fg,{onClick:l,children:[(0,G.jsx)(ia,{}),a]}),(0,G.jsxs)(Fg,{onClick:()=>g_(),children:[(0,G.jsx)(da,{}),r]})]})]})}function jge(){let{t:e}=Z(),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(0);function s(){X(`/api/settings/notifications`).then(e=>{i(e.notifications),o(e.unread)}).catch(()=>{})}(0,v.useEffect)(()=>{s();let e=setInterval(s,3e4);return()=>clearInterval(e)},[]);function c(){X(`/api/settings/notifications/read`,{method:`POST`}).then(()=>{s()}).catch(()=>{})}let l=e=>{switch(e){case`added`:return(0,G.jsx)(`span`,{className:`text-green-500`,children:`+`});case`removed`:return(0,G.jsx)(`span`,{className:`text-red-500`,children:`-`});case`updated`:return(0,G.jsx)(`span`,{className:`text-blue-500`,children:`↻`});case`degraded`:return(0,G.jsx)(`span`,{className:`text-amber-500`,children:`⚠`});case`update_available`:return(0,G.jsx)(`span`,{className:`text-violet-500`,children:`⬆`});default:return null}},u=(e,t)=>{if(t)return``;switch(e){case`degraded`:return`bg-amber-50 dark:bg-amber-950/20`;case`update_available`:return`bg-violet-50 dark:bg-violet-950/20`;default:return``}};return(0,G.jsxs)(s_,{open:t,onOpenChange:e=>{n(e),e&&c()},children:[(0,G.jsxs)(c_,{className:`relative rounded-lg p-2 text-muted-foreground transition-colors hover:text-foreground ${el({variant:`ghost`,size:`icon`})}`,"aria-label":e(`nav.notifications`),children:[(0,G.jsx)(yi,{className:`size-4`}),a>0&&(0,G.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-medium text-primary-foreground`,children:a>9?`9+`:a})]}),(0,G.jsxs)(l_,{align:`end`,className:`w-80 p-0`,children:[(0,G.jsx)(`div`,{className:`border-b px-4 py-2.5 text-sm font-medium`,children:e(`nav.notifications`)}),r.length===0?(0,G.jsx)(`div`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:e(`nav.noNotifications`)}):(0,G.jsx)(`div`,{className:`max-h-72 overflow-y-auto`,children:r.map(t=>{let n=t.data?e(t.data.key,{...t.data.vars,provider:t.platform?qD(t.platform):``}):t.displayName;return(0,G.jsxs)(`div`,{className:`flex items-start gap-2 border-b px-4 py-2.5 last:border-0 ${u(t.type,t.read)}`,children:[(0,G.jsx)(`span`,{className:`mt-0.5 text-sm`,children:l(t.type)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium`,children:n}),t.message&&(0,G.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:t.message})]}),(0,G.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:new Date(t.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]},t.id)})})]})]})}function Mge(){let{t:e}=Z(),t=et(),n=rt(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(null),{licensed:s}=GD(),c=!s;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`header`,{className:`sticky top-0 z-40 border-b backdrop-blur ${Z9?`bg-background/45`:`bg-background/80`}`,style:Y9?{WebkitAppRegion:`drag`}:void 0,children:(0,G.jsxs)(`div`,{className:`mx-auto flex max-w-6xl items-center px-4 sm:px-6 ${Z9?`pl-20 sm:pl-20`:``}`,style:Z9?{minHeight:52}:void 0,children:[(0,G.jsx)(Age,{}),(0,G.jsx)(`nav`,{className:`ms-8 hidden items-center gap-5 lg:ms-10 lg:gap-6 md:flex`,style:Y9?{WebkitAppRegion:`no-drag`}:void 0,children:K9.map(t=>{let r=q9[t.to];return r?(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsx)(J9,{to:t.to,children:e(t.labelKey)}),(0,G.jsxs)(Mg,{children:[(0,G.jsx)(Ng,{"aria-label":e(r.ariaKey),className:`rounded-md p-1 text-muted-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(Ti,{className:`size-3.5`})}),(0,G.jsx)(Pg,{align:`start`,className:`w-44`,children:r.items.map(t=>(0,G.jsx)(Fg,{onClick:()=>n(t.to),children:e(t.labelKey)},t.to))})]})]},t.to):(0,G.jsx)(J9,{to:t.to,children:e(t.labelKey)},t.to)})}),(0,G.jsxs)(`div`,{className:`ms-auto hidden items-center gap-1 md:flex`,style:Y9?{WebkitAppRegion:`no-drag`}:void 0,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:Vee,"aria-label":e(`palette.title`),className:el({variant:`ghost`,size:`sm`}),children:[(0,G.jsx)(Aa,{className:`size-3.5`}),(0,G.jsx)(`kbd`,{className:`text-[10px] text-muted-foreground`,children:kge?`⌘K`:`Ctrl K`})]}),(0,G.jsx)(jge,{}),(0,G.jsxs)(Mg,{children:[(0,G.jsx)(Ng,{className:el({variant:`ghost`,size:`icon`}),"aria-label":e(`nav.openMenu`),children:(0,G.jsx)(Ki,{})}),(0,G.jsx)(Pg,{align:`end`,className:`w-48`,children:(0,G.jsx)(Q9,{showUpgrade:c,upgradeLabel:e(`nav.upgrade`),settingsLabel:e(`nav.settings`),signOutLabel:e(`nav.signOut`),changeEmailLabel:e(`auth.changeEmail`),changePasswordLabel:e(`auth.changePassword`),onUpgrade:()=>n(`/keys`),onOpenSettings:()=>i(!0),onChangeEmail:()=>o(`email`),onChangePassword:()=>o(`password`)})})]})]}),(0,G.jsx)(`div`,{className:`ms-auto md:hidden`,children:(0,G.jsxs)(Mg,{children:[(0,G.jsx)(Ng,{className:el({variant:`ghost`,size:`icon`}),"aria-label":e(`nav.openMenu`),children:(0,G.jsx)(fa,{})}),(0,G.jsxs)(Pg,{align:`end`,className:`w-52`,children:[(0,G.jsx)(Fee,{children:K9.map(r=>{let i=q9[r.to];return i?(0,G.jsxs)(Ig,{children:[(0,G.jsx)(Lg,{className:i.isActive(t.pathname)?`bg-accent text-accent-foreground font-medium`:void 0,children:e(r.labelKey)}),(0,G.jsx)(Rg,{children:i.items.map(t=>(0,G.jsx)(Fg,{onClick:()=>n(t.to),children:e(t.labelKey)},t.to))})]},r.to):(0,G.jsx)(Fg,{onClick:()=>n(r.to),className:t.pathname===r.to?`bg-accent text-accent-foreground font-medium`:void 0,children:e(r.labelKey)},r.to)})}),(0,G.jsx)(Bg,{}),(0,G.jsx)(Q9,{showUpgrade:c,upgradeLabel:e(`nav.upgrade`),settingsLabel:e(`nav.settings`),signOutLabel:e(`nav.signOut`),changeEmailLabel:e(`auth.changeEmail`),changePasswordLabel:e(`auth.changePassword`),onUpgrade:()=>n(`/keys`),onOpenSettings:()=>i(!0),onChangeEmail:()=>o(`email`),onChangePassword:()=>o(`password`)})]})]})})]})}),(0,G.jsx)(zD,{open:r,onOpenChange:i}),a&&(0,G.jsx)(Ree,{mode:a,onClose:()=>o(null)})]})}function Nge({children:e}){let t=et();return(0,G.jsx)(Uee,{children:e},t.pathname)}var $9=new Set([`/playground`]);function Pge({children:e}){let t=et(),n=$9.has(t.pathname);return(0,G.jsx)(`main`,{className:n?`flex min-h-0 flex-1 flex-col`:`mx-auto w-full max-w-6xl px-4 py-6 sm:px-6 sm:py-8`,children:e})}function Fge({children:e}){let t=et(),n=$9.has(t.pathname);return(0,G.jsx)(`div`,{className:`flex flex-col ${n?`h-dvh overflow-hidden`:`min-h-screen`} ${Z9?`desktop-backdrop`:`bg-background`}`,children:e})}function Ige(){return(0,G.jsx)(zr,{client:Oge,children:(0,G.jsx)(XD,{children:(0,G.jsx)(ev,{children:(0,G.jsx)(hn,{basename:`/`,children:(0,G.jsx)(zee,{children:(0,G.jsxs)(Fge,{children:[(0,G.jsx)(Mge,{}),(0,G.jsx)(Pge,{children:(0,G.jsx)(Nge,{children:(0,G.jsxs)(At,{children:[(0,G.jsx)(Ot,{path:`/`,element:(0,G.jsx)(Dt,{to:`/models/chat`,replace:!0})}),(0,G.jsx)(Ot,{path:`/models`,element:(0,G.jsx)(Dt,{to:`/models/chat`,replace:!0})}),(0,G.jsx)(Ot,{path:`/models/chat`,element:(0,G.jsx)(Uae,{})}),(0,G.jsx)(Ot,{path:`/models/chat/:id`,element:(0,G.jsx)(Yae,{})}),(0,G.jsx)(Ot,{path:`/models/fusion`,element:(0,G.jsx)($ae,{})}),(0,G.jsx)(Ot,{path:`/models/embeddings`,element:(0,G.jsx)(toe,{})}),(0,G.jsx)(Ot,{path:`/models/embeddings/:id`,element:(0,G.jsx)(ooe,{})}),(0,G.jsx)(Ot,{path:`/models/image`,element:(0,G.jsx)(roe,{})}),(0,G.jsx)(Ot,{path:`/models/image/:id`,element:(0,G.jsx)(KI,{modality:`image`})}),(0,G.jsx)(Ot,{path:`/models/video`,element:(0,G.jsx)(ioe,{})}),(0,G.jsx)(Ot,{path:`/models/video/:id`,element:(0,G.jsx)(KI,{modality:`video`})}),(0,G.jsx)(Ot,{path:`/models/audio`,element:(0,G.jsx)(aoe,{})}),(0,G.jsx)(Ot,{path:`/models/audio/:id`,element:(0,G.jsx)(KI,{modality:`audio`})}),(0,G.jsx)(Ot,{path:`/models/transcription/:id`,element:(0,G.jsx)(KI,{modality:`transcription`})}),(0,G.jsx)(Ot,{path:`/playground`,element:(0,G.jsx)(IN,{})}),(0,G.jsx)(Ot,{path:`/keys`,element:(0,G.jsx)(bA,{})}),(0,G.jsx)(Ot,{path:`/agents`,element:(0,G.jsx)(Dge,{})}),(0,G.jsx)(Ot,{path:`/fallback`,element:(0,G.jsx)(Dt,{to:`/models/chat`,replace:!0})}),(0,G.jsx)(Ot,{path:`/analytics`,element:(0,G.jsx)(Qhe,{})}),(0,G.jsx)(Ot,{path:`/logs`,element:(0,G.jsx)(fge,{})}),(0,G.jsx)(Ot,{path:`/premium`,element:(0,G.jsx)(Dt,{to:`/keys`,replace:!0})}),(0,G.jsx)(Ot,{path:`/test`,element:(0,G.jsx)(Dt,{to:`/playground`,replace:!0})}),(0,G.jsx)(Ot,{path:`/health`,element:(0,G.jsx)(Dt,{to:`/keys`,replace:!0})}),(0,G.jsx)(Ot,{path:`*`,element:(0,G.jsx)(pge,{})})]})})}),(0,G.jsx)(VD,{}),(0,G.jsx)(Hee,{}),(0,G.jsx)(mD,{})]})})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(v.StrictMode,{children:(0,G.jsx)(Ige,{})}));