@undefineds.co/xpod 0.4.13 → 0.4.14

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 (253) hide show
  1. package/config/components-ignore.json +11 -7
  2. package/dist/api/ai-gateway/providers/ProviderRegistry.js +1 -1
  3. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +1 -1
  4. package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +1 -1
  5. package/dist/api/container/index.js +1 -0
  6. package/dist/api/container/local.js +30 -12
  7. package/dist/api/container/routes.js +2 -0
  8. package/dist/api/container/types.d.ts +2 -0
  9. package/dist/api/handlers/AdminHandler.d.ts +17 -1
  10. package/dist/api/handlers/AdminHandler.js +40 -3
  11. package/dist/api/handlers/EdgeNodeSignalHandler.js +10 -2
  12. package/dist/api/handlers/NetworkSettingsHandler.d.ts +37 -5
  13. package/dist/api/handlers/NetworkSettingsHandler.js +39 -11
  14. package/dist/api/handlers/ProvisionHandler.d.ts +6 -1
  15. package/dist/api/handlers/ProvisionHandler.js +7 -2
  16. package/dist/api/handlers/ReachabilityHandler.d.ts +6 -0
  17. package/dist/api/handlers/ReachabilityHandler.js +22 -5
  18. package/dist/api/network/NetworkEnvironmentConfigurationStore.d.ts +6 -1
  19. package/dist/api/network/NetworkEnvironmentConfigurationStore.js +72 -16
  20. package/dist/api/runtime.d.ts +9 -0
  21. package/dist/api/runtime.js +15 -2
  22. package/dist/api/service/AiClientConfigurationService.d.ts +1 -1
  23. package/dist/api/service/AiClientConfigurationService.js +1 -1
  24. package/dist/cli/commands/start.d.ts +19 -1
  25. package/dist/cli/commands/start.js +71 -5
  26. package/dist/components/context.jsonld +30 -0
  27. package/dist/edge/EdgeNodeAgent.d.ts +6 -0
  28. package/dist/edge/EdgeNodeAgent.js +1 -1
  29. package/dist/edge/EdgeNodeAgentInitializer.d.ts +2 -0
  30. package/dist/edge/EdgeNodeAgentInitializer.js +1 -0
  31. package/dist/edge/EdgeNodeAgentInitializer.jsonld +19 -0
  32. package/dist/edge/EdgeNodeDnsCoordinator.d.ts +11 -1
  33. package/dist/edge/EdgeNodeDnsCoordinator.js +12 -2
  34. package/dist/edge/EdgeNodeHealthProbeService.d.ts +15 -0
  35. package/dist/edge/EdgeNodeHealthProbeService.js +44 -12
  36. package/dist/edge/EdgeNodeHealthProbeService.jsonld +77 -0
  37. package/dist/edge/ProbeTargetGuard.d.ts +35 -0
  38. package/dist/edge/ProbeTargetGuard.js +142 -0
  39. package/dist/edge/reachability/NodeAccessResolver.d.ts +16 -0
  40. package/dist/edge/reachability/NodeAccessResolver.js +30 -0
  41. package/dist/index.d.ts +3 -1
  42. package/dist/index.js +9 -3
  43. package/dist/main.js +7 -0
  44. package/dist/runtime/Proxy.d.ts +22 -0
  45. package/dist/runtime/Proxy.js +34 -7
  46. package/dist/runtime/bootstrap.d.ts +11 -0
  47. package/dist/runtime/bootstrap.js +21 -1
  48. package/dist/runtime/css-process.d.ts +1 -0
  49. package/dist/runtime/css-process.js +1 -0
  50. package/dist/runtime/host/node/NodeRuntimeHost.js +4 -1
  51. package/dist/runtime/host/types.d.ts +6 -0
  52. package/dist/runtime/index.d.ts +1 -1
  53. package/dist/runtime/index.js +5 -1
  54. package/dist/runtime/lifecycle.js +1 -0
  55. package/dist/runtime/port-finder.d.ts +30 -0
  56. package/dist/runtime/port-finder.js +83 -0
  57. package/dist/runtime/runner/node/NodeGatewayRuntimeRunner.js +1 -0
  58. package/dist/runtime/runner/types.d.ts +5 -0
  59. package/dist/runtime/runtime-types.d.ts +1 -0
  60. package/dist/test-utils/local-managed-client-p2p-e2e-smoke.js +1 -1
  61. package/dist/tunnel/LocalTunnelProvider.d.ts +15 -0
  62. package/dist/tunnel/LocalTunnelProvider.js +87 -18
  63. package/dist/tunnel/LocalTunnelProvider.jsonld +27 -0
  64. package/dist/tunnel/NgrokTunnelProvider.d.ts +4 -0
  65. package/dist/tunnel/NgrokTunnelProvider.js +117 -43
  66. package/dist/tunnel/NgrokTunnelProvider.jsonld +4 -0
  67. package/dist/tunnel/SakuraFrpTunnelProvider.d.ts +65 -3
  68. package/dist/tunnel/SakuraFrpTunnelProvider.js +268 -25
  69. package/dist/tunnel/TunnelLifecycle.d.ts +14 -0
  70. package/dist/tunnel/TunnelLifecycle.js +34 -0
  71. package/dist/tunnel/TunnelProfiles.d.ts +33 -3
  72. package/dist/tunnel/TunnelProfiles.js +105 -78
  73. package/dist/tunnel/TunnelProvider.d.ts +15 -2
  74. package/dist/tunnel/TunnelProvider.jsonld +8 -0
  75. package/dist/tunnel/TunnelProviderCatalog.d.ts +62 -0
  76. package/dist/tunnel/TunnelProviderCatalog.js +130 -0
  77. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -1
  78. package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +1 -1
  79. package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +1 -1
  80. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +1 -1
  81. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +1 -1
  82. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -1
  83. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +1 -1
  84. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -1
  85. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.d.ts +1 -1
  86. package/node_modules/@undefineds.co/ai-connections/dist/AiCustomProviderDialog.d.ts +1 -1
  87. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +1 -1
  88. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +1 -1
  89. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +1 -1
  90. package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.d.ts +1 -1
  91. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -1
  92. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +1 -1
  93. package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.d.ts +1 -1
  94. package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +1 -1
  95. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +1 -1
  96. package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +3 -3
  97. package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +1 -1
  98. package/node_modules/@undefineds.co/ai-connections/dist/collections.js +3 -3
  99. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/ai-connections-client.d.ts +1 -1
  100. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/ai-connections-client.js +1 -1
  101. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.cjs +8 -8
  102. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/index.d.ts +1 -1
  103. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/index.js +1 -1
  104. package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.cjs +3 -3
  105. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -1
  106. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +1 -1
  107. package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +1 -1
  108. package/node_modules/@undefineds.co/ai-connections/dist/display-wording.d.ts +1 -1
  109. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.d.ts +1 -1
  110. package/node_modules/@undefineds.co/ai-connections/dist/error-wording.js +1 -1
  111. package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +1 -1
  112. package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +1 -1
  113. package/node_modules/@undefineds.co/ai-connections/dist/offering-label.d.ts +1 -1
  114. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +1 -1
  115. package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +1 -1
  116. package/node_modules/@undefineds.co/ai-connections/dist/useAiConnectDialog.d.ts +1 -1
  117. package/node_modules/@undefineds.co/ai-connections/package.json +31 -1
  118. package/package.json +5 -6
  119. package/static/app/assets/main.css +1 -1
  120. package/static/auth-callback/assets/{AiConfigContext-DlFyEWy9.js → AiConfigContext-DCXpjzpj.js} +1 -1
  121. package/static/auth-callback/assets/{AiConfigPage-CkYk-SFW.js → AiConfigPage-fe-xMIXa.js} +1 -1
  122. package/static/auth-callback/assets/{DocumentProcessingPanel-CqIr3JqN.js → DocumentProcessingPanel-BGnkfMuU.js} +1 -1
  123. package/static/auth-callback/assets/{IndexLifecyclePanel-C1GKV3Vx.js → IndexLifecyclePanel-42Jups0j.js} +1 -1
  124. package/static/auth-callback/assets/{IndexSubjectPanel-ro9lC6XW.js → IndexSubjectPanel-CYyLOlQU.js} +1 -1
  125. package/static/auth-callback/assets/{ModelAssignmentsPanel-DxNdyKRJ.js → ModelAssignmentsPanel-BOvUH4yr.js} +1 -1
  126. package/static/auth-callback/assets/{ModelsPage-BVtWSPBU.js → ModelsPage-DwyITxt7.js} +3 -3
  127. package/static/auth-callback/assets/NetworkPage-CG9RelJA.js +2 -0
  128. package/static/auth-callback/assets/{PaneListHeader-ByKw8ada.js → PaneListHeader-yvd5ohs6.js} +1 -1
  129. package/static/auth-callback/assets/{SearchIndexingPanel-CulBKcYT.js → SearchIndexingPanel-2_a6ezzj.js} +1 -1
  130. package/static/auth-callback/assets/{StatusSubjectPanel-VOcfrt8o.js → StatusSubjectPanel-8qtVxnzC.js} +1 -1
  131. package/static/auth-callback/assets/{StatusWorkspace-Jsz6hAdE.js → StatusWorkspace-CBdRahCF.js} +1 -1
  132. package/static/auth-callback/assets/{SystemSettingsPage-BFNvGAle.js → SystemSettingsPage-BZJ6vWkg.js} +1 -1
  133. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-DFRdrSfK.js → SystemSettingsSubjectPanel-xm08UhXP.js} +1 -1
  134. package/static/auth-callback/assets/{XpodAiConnectionsPodStore-C6KpvHVg.js → XpodAiConnectionsPodStore-V6vgGfuw.js} +1 -1
  135. package/static/auth-callback/assets/{activity-DnTlb9iM.js → activity-CeM7xly8.js} +1 -1
  136. package/static/auth-callback/assets/{auth-callback-D2UkK5Xj.js → auth-callback-DTG8cSj7.js} +3 -3
  137. package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
  138. package/static/auth-callback/assets/{badge-D7IJuuTM.js → badge-qJo2Zr4d.js} +1 -1
  139. package/static/auth-callback/assets/{collection-runtime-wT1n4GS2.js → collection-runtime-Bztsz31a.js} +1 -1
  140. package/static/auth-callback/assets/{dialog-DickLu5z.js → dialog-D-h6x5x0.js} +1 -1
  141. package/static/auth-callback/assets/{download-kn8WnRu3.js → download-C2ir4lmR.js} +1 -1
  142. package/static/auth-callback/assets/{external-link-B6B8jfSn.js → external-link-THLDL4On.js} +1 -1
  143. package/static/auth-callback/assets/{index-Dz83EEHD.js → index-BRpv4yO3.js} +1 -1
  144. package/static/auth-callback/assets/{index-DHF97YLP.js → index-BlVZb9A7.js} +1 -1
  145. package/static/auth-callback/assets/index-D983R1FV.js +4 -0
  146. package/static/auth-callback/assets/{index-browser-CSghinyi.js → index-browser-3FvR0aaf.js} +1 -1
  147. package/static/auth-callback/assets/{key-round-ChkOx3E1.js → key-round-C9U5j1Ly.js} +1 -1
  148. package/static/auth-callback/assets/{rotate-ccw-B3hE-nyd.js → rotate-ccw-DP45cD4o.js} +1 -1
  149. package/static/auth-callback/assets/{skeleton-kEqR7tpI.js → skeleton-Dn4EiSCS.js} +1 -1
  150. package/static/auth-callback/assets/{waypoints-D6Jo-SZa.js → waypoints-uqFQ3uEG.js} +1 -1
  151. package/static/auth-callback/assets/{workspace-layout-BHwT_cHd.js → workspace-layout-DLYK0Wwu.js} +1 -1
  152. package/static/auth-callback/auth-callback.html +2 -2
  153. package/static/dashboard/assets/{AiConfigContext-BfC3v-x2.js → AiConfigContext-DJcMECNw.js} +1 -1
  154. package/static/dashboard/assets/{AiConfigPage-QNS3u7Ff.js → AiConfigPage-BvE7dOTy.js} +1 -1
  155. package/static/dashboard/assets/{DocumentProcessingPanel-Dr4XLeT4.js → DocumentProcessingPanel-D9780krf.js} +1 -1
  156. package/static/dashboard/assets/{IndexLifecyclePanel-KtM_gpeO.js → IndexLifecyclePanel-SjsUcnbM.js} +1 -1
  157. package/static/dashboard/assets/{IndexSubjectPanel-DLaiKdLc.js → IndexSubjectPanel-C-ym2Tqi.js} +1 -1
  158. package/static/dashboard/assets/{ModelAssignmentsPanel-Bk7TvQRq.js → ModelAssignmentsPanel-BRjZ-arB.js} +1 -1
  159. package/static/dashboard/assets/{ModelsPage-Cci3vlos.js → ModelsPage-BtTU6du3.js} +3 -3
  160. package/static/dashboard/assets/NetworkPage-CV9qpkDg.js +2 -0
  161. package/static/dashboard/assets/{PaneListHeader-qHME_s08.js → PaneListHeader-KyPTTBsv.js} +1 -1
  162. package/static/dashboard/assets/{SearchIndexingPanel-HZPKj8H9.js → SearchIndexingPanel-DolHGawg.js} +1 -1
  163. package/static/dashboard/assets/{StatusSubjectPanel-ij7IpI8d.js → StatusSubjectPanel-_YZvKiYi.js} +1 -1
  164. package/static/dashboard/assets/{StatusWorkspace-Cp02JcaN.js → StatusWorkspace-Dlbh_G40.js} +1 -1
  165. package/static/dashboard/assets/{SystemSettingsPage-BSeuvb8X.js → SystemSettingsPage-Be7QSIoz.js} +1 -1
  166. package/static/dashboard/assets/{SystemSettingsSubjectPanel-CP4_luGS.js → SystemSettingsSubjectPanel-DBp0gja7.js} +1 -1
  167. package/static/dashboard/assets/{XpodAiConnectionsPodStore-urO6zaHL.js → XpodAiConnectionsPodStore-ClpSjzpP.js} +1 -1
  168. package/static/dashboard/assets/{activity-DxjgQNvr.js → activity-lsNbTXJu.js} +1 -1
  169. package/static/dashboard/assets/{badge-53qCrRbl.js → badge-CVatKjaG.js} +1 -1
  170. package/static/dashboard/assets/{collection-runtime-BPAmHG46.js → collection-runtime-Ec4UnY28.js} +1 -1
  171. package/static/dashboard/assets/{dashboard-BcT2ByXw.js → dashboard-BEzsRsvF.js} +2 -2
  172. package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
  173. package/static/dashboard/assets/{dialog-B28YtNhS.js → dialog-BuyelQ4V.js} +1 -1
  174. package/static/dashboard/assets/{download-DkLNceJ4.js → download-B4Nf678F.js} +1 -1
  175. package/static/dashboard/assets/{external-link-D3TXnlo3.js → external-link-PYv9CvKL.js} +1 -1
  176. package/static/dashboard/assets/index-C9XPE-mI.js +4 -0
  177. package/static/dashboard/assets/{index-CFIenkeK.js → index-Cx69bTNh.js} +1 -1
  178. package/static/dashboard/assets/{index-CIiBu9mr.js → index-awr7ulur.js} +1 -1
  179. package/static/dashboard/assets/{key-round-B5ccp6nx.js → key-round-VsY80U1Z.js} +1 -1
  180. package/static/dashboard/assets/{rotate-ccw-DUpfkNnk.js → rotate-ccw-Cz1K4vE9.js} +1 -1
  181. package/static/dashboard/assets/{skeleton-BRe19fO0.js → skeleton-BhNv_8tO.js} +1 -1
  182. package/static/dashboard/assets/{waypoints-BKDMxEvu.js → waypoints-DYS9XFYV.js} +1 -1
  183. package/static/dashboard/assets/{workspace-layout-ZTF7C16h.js → workspace-layout-OZJAFx5V.js} +1 -1
  184. package/static/dashboard/dashboard.html +2 -2
  185. package/static/settings/assets/{AiConfigContext-DsyWgu2i.js → AiConfigContext-B8JS3MXF.js} +1 -1
  186. package/static/settings/assets/{AiConfigPage-CSCBckKo.js → AiConfigPage-C3Zl8LUl.js} +1 -1
  187. package/static/settings/assets/{DocumentProcessingPanel-w9yQDbBe.js → DocumentProcessingPanel-DpDZAQvf.js} +1 -1
  188. package/static/settings/assets/{IndexLifecyclePanel-CUUXI8mP.js → IndexLifecyclePanel-Ec1XF88t.js} +1 -1
  189. package/static/settings/assets/{IndexSubjectPanel-BypAU5TJ.js → IndexSubjectPanel-BulT9BmO.js} +1 -1
  190. package/static/settings/assets/{ModelAssignmentsPanel-BetgXw1G.js → ModelAssignmentsPanel-BcGSmYjb.js} +1 -1
  191. package/static/settings/assets/{ModelsPage-DZpTlTZ3.js → ModelsPage-CvTCKy1T.js} +3 -3
  192. package/static/settings/assets/NetworkPage-DQF5u9Bn.js +2 -0
  193. package/static/settings/assets/{PaneListHeader-BGOqGec4.js → PaneListHeader-D40hqcVl.js} +1 -1
  194. package/static/settings/assets/{SearchIndexingPanel-DYAbpZ_9.js → SearchIndexingPanel-iCUPOx_0.js} +1 -1
  195. package/static/settings/assets/{StatusSubjectPanel-CFgzeQ8Q.js → StatusSubjectPanel-E--ZHSql.js} +1 -1
  196. package/static/settings/assets/{StatusWorkspace-4Z6g4Jvv.js → StatusWorkspace-YjDAx1II.js} +1 -1
  197. package/static/settings/assets/{SystemSettingsPage-C1tlrgvI.js → SystemSettingsPage-CDdV3mC9.js} +1 -1
  198. package/static/settings/assets/{SystemSettingsSubjectPanel-CcURI-1L.js → SystemSettingsSubjectPanel-Br8WazDq.js} +1 -1
  199. package/static/settings/assets/{XpodAiConnectionsPodStore-owBQc5nY.js → XpodAiConnectionsPodStore-CLr38P_Z.js} +1 -1
  200. package/static/settings/assets/{activity-CtBc9cNy.js → activity-C5DAHHTE.js} +1 -1
  201. package/static/settings/assets/{badge--r-FDIhU.js → badge-D8eIyxKt.js} +1 -1
  202. package/static/settings/assets/{collection-runtime-CnhPmwAM.js → collection-runtime-DLc9zil8.js} +1 -1
  203. package/static/settings/assets/{dialog-B7ZRsjN7.js → dialog-CyuR7Va4.js} +1 -1
  204. package/static/settings/assets/{download-DgQ1F8QR.js → download-c0oxZrCz.js} +1 -1
  205. package/static/settings/assets/{external-link-Bz7NckNO.js → external-link-D3Z34fP_.js} +1 -1
  206. package/static/settings/assets/{index-Vv-8Vslg.js → index-CKGbRFlc.js} +1 -1
  207. package/static/settings/assets/index-CSr3-2Cj.js +4 -0
  208. package/static/settings/assets/{index-CkGda_Pg.js → index-ComidxAm.js} +1 -1
  209. package/static/settings/assets/{index-browser-Dq7omlpY.js → index-browser-CAscEbae.js} +1 -1
  210. package/static/settings/assets/{key-round-CvuhloKV.js → key-round-DyjLmXuB.js} +1 -1
  211. package/static/settings/assets/{rotate-ccw-DgFKDaz7.js → rotate-ccw-679HF_ec.js} +1 -1
  212. package/static/settings/assets/{settings-BvqY7K96.js → settings-DKknqu4C.js} +3 -3
  213. package/static/settings/assets/settings-rk080mvG.css +1 -0
  214. package/static/settings/assets/{skeleton-D3OeFDF6.js → skeleton-CkopNkPB.js} +1 -1
  215. package/static/settings/assets/{waypoints-C4WbspTb.js → waypoints-CrqfAftE.js} +1 -1
  216. package/static/settings/assets/{workspace-layout-B9H1Tqrk.js → workspace-layout-UN6c4qTG.js} +1 -1
  217. package/static/settings/settings.html +2 -2
  218. package/node_modules/@undefineds.co/ai-connections-core/package.json +0 -61
  219. package/static/auth-callback/assets/NetworkPage-cEvxRMAl.js +0 -2
  220. package/static/auth-callback/assets/auth-callback-Cx9D_1qj.css +0 -1
  221. package/static/auth-callback/assets/index-Cu0EguPo.js +0 -4
  222. package/static/dashboard/assets/NetworkPage-Ot4G2dX5.js +0 -2
  223. package/static/dashboard/assets/dashboard-Cx9D_1qj.css +0 -1
  224. package/static/dashboard/assets/index-Gp3cLolR.js +0 -4
  225. package/static/settings/assets/NetworkPage-BVkasFGM.js +0 -2
  226. package/static/settings/assets/index-BdXwm8nh.js +0 -4
  227. package/static/settings/assets/settings-Cx9D_1qj.css +0 -1
  228. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/normalize.d.ts +0 -0
  229. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/normalize.js +0 -0
  230. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/request.d.ts +0 -0
  231. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/request.js +0 -0
  232. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/types.d.ts +0 -0
  233. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client/types.js +0 -0
  234. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/base-adapter.d.ts +0 -0
  235. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/base-adapter.js +0 -0
  236. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/codex.d.ts +0 -0
  237. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/codex.js +0 -0
  238. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.d.ts +0 -0
  239. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/index.js +0 -0
  240. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/json-env-adapter.d.ts +0 -0
  241. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/json-env-adapter.js +0 -0
  242. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/pi.d.ts +0 -0
  243. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/pi.js +0 -0
  244. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/transaction.d.ts +0 -0
  245. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/transaction.js +0 -0
  246. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/types.d.ts +0 -0
  247. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/client-config/types.js +0 -0
  248. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/credential-storage.d.ts +0 -0
  249. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/credential-storage.js +0 -0
  250. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/endpoint-urls.d.ts +0 -0
  251. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/endpoint-urls.js +0 -0
  252. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.d.ts +0 -0
  253. /package/node_modules/@undefineds.co/{ai-connections-core/dist → ai-connections/dist/contract}/provider-catalog.js +0 -0
@@ -0,0 +1,2 @@
1
+ import{c as I,v as pe,r as d,Y as U,j as e,C as k,a as C,b as S,d as P,e as R,B as g,Z as se,R as he,N as fe,w as ve,x as be}from"./settings-DKknqu4C.js";import{P as ge}from"./PaneListHeader-D40hqcVl.js";import{N as ie,W as je}from"./waypoints-CrqfAftE.js";import{A as oe}from"./activity-C5DAHHTE.js";import{T as ye,u as Ne}from"./workspace-layout-UN6c4qTG.js";import{E as le}from"./external-link-D3Z34fP_.js";import{B as M}from"./badge-D8eIyxKt.js";import{R as we}from"./rotate-ccw-679HF_ec.js";import{D as ke}from"./download-c0oxZrCz.js";const Ce=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],Se=I("cable",Ce);const Pe=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],de=I("earth",Pe);const Re=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],De=I("lock-keyhole",Re);const Te=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Ae=I("radio",Te);const Ee=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],Le=I("route",Ee);const Ie=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$e=I("shield-check",Ie);const Me=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Oe=I("wifi",Me);async function Ue({fetchImpl:t}){return Z(t,X("/api/network/settings/status"),{method:"GET",credentials:"include",headers:{accept:"application/json"}})}async function qe({fetchImpl:t}){return Z(t,X("/api/network/settings/diagnose"),{method:"POST",credentials:"include",headers:{accept:"application/json"}})}async function ze({fetchImpl:t}){await Z(t,X("/api/network/settings/certificate/renew"),{method:"POST",credentials:"include",headers:{accept:"application/json"}})}async function Ve({podUrl:t,fetchImpl:n,patch:r}){return Z(n,He("/api/network/settings/configuration",t),{method:"PUT",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(r)})}function X(t){const n=typeof window>"u"?"http://localhost":window.location.origin;return new URL(t,n).toString()}function He(t,n){return n?new URL(t,n).toString():X(t)}async function Z(t,n,r){const i=await t(n,r);if(!i.ok)throw await i.arrayBuffer(),new Error("Network settings request failed. Please try again.");if(!i.headers.get("content-type")?.includes("application/json"))throw await i.arrayBuffer(),new Error("Network settings request failed. Please try again.");return await i.json()}const ne=[{id:"overview",label:"Overview",path:"",icon:ie},{id:"endpoints",label:"Endpoints",path:"endpoints",icon:Se},{id:"addresses",label:"Addresses",path:"addresses",icon:de},{id:"domain-dns",label:"Domain & DNS",path:"domain-dns",icon:Le},{id:"https",label:"HTTPS",path:"https",icon:De},{id:"tunnel-profiles",label:"Tunnel Profiles",path:"tunnel-profiles",icon:je},{id:"p2p",label:"P2P",path:"p2p",icon:Ae},{id:"diagnostics",label:"Diagnostics",path:"diagnostics",icon:oe}];function _e(t){const n=["Xpod Network Diagnostics",`Generated: ${t.generatedAt}`,`Canonical URL: ${t.endpoint??"Unavailable"}`],r=t.checks.flatMap(i=>["",`[${i.status.toUpperCase()}] ${i.label}`,...i.detail?[i.detail]:[]]);return[...n,...r].join(`
2
+ `)}function bt(){const t=pe(),[n,r]=d.useState(),[i,s]=d.useState([]),[o,l]=d.useState(),[p,u]=d.useState(),[y,h]=d.useState(!1),[D,T]=d.useState(!1),[B,E]=d.useState(!1),[$,F]=d.useState(!1),[a,m]=d.useState(),v=d.useRef(0),N=d.useRef(0),z=d.useRef(0),V=d.useRef(void 0),H=d.useRef(!0),K=typeof window>"u"?void 0:window.location.origin,w=K?`local-host:${K}`:void 0,A=globalThis.fetch;d.useEffect(()=>(H.current=!0,()=>{H.current=!1,v.current+=1,N.current+=1,z.current+=1}),[]);const W=d.useCallback((c,x)=>H.current&&v.current===c&&V.current===x,[]),G=d.useCallback((c,x)=>H.current&&N.current===c&&V.current===x,[]),J=d.useCallback((c,x)=>H.current&&z.current===c&&V.current===x,[]),_=d.useCallback(async()=>{const c=w;if(!c)return;const x=v.current+1;v.current=x,h(!0),u(void 0);try{const L=await Ue({fetchImpl:A});W(x,c)&&r(L)}catch{W(x,c)&&u("网络设置请求失败,请重试。")}finally{W(x,c)&&h(!1)}},[A,w,W]);d.useEffect(()=>{let c=!1;return V.current=w,v.current+=1,N.current+=1,z.current+=1,queueMicrotask(()=>{c||V.current!==w||(r(void 0),s([]),l(void 0),u(void 0),h(!1),T(!1),E(!1),w&&_())}),()=>{c=!0}},[w,_]);const ue=d.useCallback(async()=>{const c=w;if(!c)return;const x=N.current+1;N.current=x,T(!0),u(void 0);try{const L=await qe({fetchImpl:A});G(x,c)&&(s(L.checks),l(new Date),U({description:"诊断完成"}))}catch{G(x,c)&&u("网络诊断失败,请重试。")}finally{G(x,c)&&T(!1)}},[A,w,G]),me=d.useCallback(async()=>{const c=w;if(!c)return;const x=z.current+1;z.current=x,E(!0),u(void 0);try{await ze({fetchImpl:A}),J(x,c)&&(U({variant:"success",description:"证书续签成功"}),await _())}catch{J(x,c)&&u("证书续签失败,请重试。")}finally{J(x,c)&&E(!1)}},[A,w,J,_]),Y=d.useCallback(async c=>{if(K){F(!0),u(void 0);try{const x=await Ve({fetchImpl:A,patch:c});r(L=>L&&{...L,configuration:x.configuration}),m(x.applyState),U({variant:"success",description:"Network configuration saved"})}catch{u("网络配置保存失败,请重试。")}finally{F(!1)}}},[A,K]),xe=d.useMemo(()=>[{key:"local",title:"本机",values:n?.addresses.local??[]},{key:"lan",title:"局域网",values:n?.addresses.lan??[]},{key:"public",title:"公网",values:n?.addresses.public??[]}],[n]),re=t.pathname.split("/").filter(Boolean).at(-1),b=ne.some(c=>c.path===re)?re:"overview";return e.jsx(ye,{mode:"auto",listHeader:e.jsx(ge,{title:"Network"}),list:e.jsx(Be,{}),mainHeader:e.jsx(Fe,{title:ne.find(c=>(c.path||"overview")===b)?.label??"Overview",loading:y,stale:y&&!!n,onRefresh:_}),main:e.jsxs("section",{className:"flex min-h-full flex-col gap-4 bg-background p-6",children:[p?e.jsx("div",{role:"alert",className:"rounded-md border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:p}):null,(b==="overview"||b==="endpoints")&&e.jsx(Qe,{endpoint:n?.endpoint,loading:y&&!n}),b==="overview"&&e.jsx(Ke,{status:n}),(b==="overview"||b==="addresses")&&e.jsx(tt,{sections:xe,loading:y&&!n,diagnostics:i,checkedAt:o}),b==="overview"&&e.jsx(it,{status:n}),b==="domain-dns"&&e.jsxs(e.Fragment,{children:[e.jsx(at,{status:n}),e.jsx(Ge,{configuration:n?.configuration,saving:$,applyState:a,onSave:Y})]}),b==="https"&&e.jsxs(e.Fragment,{children:[e.jsx(rt,{status:n}),e.jsx(Je,{configuration:n?.configuration,saving:$,applyState:a,onSave:Y})]}),b==="tunnel-profiles"&&e.jsxs(e.Fragment,{children:[e.jsx(We,{title:"Observed tunnel",label:"Tunnel",capability:n?.tunnel}),e.jsx(Ye,{configuration:n?.configuration,providers:n?.providers??[],ingress:n?.ingress,saving:$,applyState:a,onSave:Y})]}),b==="p2p"&&e.jsx(Ze,{configuration:n?.configuration,saving:$,applyState:a,onSave:Y}),(b==="overview"||b==="diagnostics"||b==="https")&&e.jsx(ot,{status:n,endpoint:n?.endpoint,diagnostics:i,diagnosing:D,renewing:B,onDiagnose:ue,onRenewCertificate:me})]}),className:"min-h-full"})}function Be(){const t=Ne();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"Network sections","data-list-navigation":!0,children:ne.map(n=>{const r=n.icon,i=`/network${n.path?`/${n.path}`:""}`;return e.jsxs(fe,{to:i,onClick:()=>t.openMain(),onKeyDown:ve,className:({isActive:s})=>be(s,{compact:!1}),end:n.path==="",children:[e.jsx(r,{className:"h-4 w-4","aria-hidden":"true"}),n.label]},n.id)})})})}function Fe({title:t,loading:n,stale:r,onRefresh:i}){return e.jsxs("div",{className:"flex h-full min-w-0 items-center justify-between gap-4 px-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm font-semibold text-foreground",children:["Network · ",t]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground","aria-live":"polite",children:r?"Refreshing · showing previous snapshot":"接入点、DNS、TLS、隧道与连通性诊断"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:n,children:[e.jsx(he,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"刷新"]})})]})}function Ke({status:t}){const n=t?.addresses.public[0]??t?.addresses.lan[0]??t?.addresses.local[0]??t?.endpoint,r=t?!t.dns.supported||t.dns.status==="unsupported"?"Configure Domain & DNS, then recheck observed DNS.":!t.tls.supported||!["valid","active","ready"].includes(t.tls.status)?"Review HTTPS configuration and certificate renewal evidence.":"No connectivity action is currently required.":"Refresh network status.",i=t?.tunnel.supported===!0;return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:"Preferred access path"}),e.jsx(P,{children:"First address this runtime has configured, in public → LAN → local order"})]}),e.jsxs(R,{className:"space-y-3 text-sm",children:[e.jsx("div",{className:"break-words font-medium",children:n??"Not configured"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-4",children:[e.jsxs(M,{variant:"outline",children:["Local ",t?.addresses.local.length?"configured":"not configured"]}),e.jsxs(M,{variant:"outline",children:["LAN ",t?.addresses.lan.length?"configured":"not configured"]}),e.jsxs(M,{variant:"outline",children:["Public ",t?.addresses.public.length?"configured":"not configured"]}),e.jsxs(M,{variant:"outline",children:["Tunnel ",i?t?.tunnel.status??"unknown":"not observed"]})]}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Configured addresses are not probe results; reachability is reported per route."}),e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[e.jsx("div",{className:"font-medium",children:"Next action"}),e.jsx("div",{className:"mt-1 text-muted-foreground",children:r})]})]})]})}function We({title:t,label:n,capability:r,extra:i}){return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:t}),e.jsx(P,{children:"Observed runtime state"})]}),e.jsx(R,{children:e.jsx(q,{label:n,capability:r,extra:i})})]})}function Q({title:t}){return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:t}),e.jsx(P,{children:"Desired configuration"})]}),e.jsxs(R,{className:"text-sm text-muted-foreground",children:["This runtime does not report a configurable ",t," capability."]})]})}function Ge({configuration:t,saving:n,applyState:r,onSave:i}){const[s,o]=d.useState(t?.domainDns),[l,p]=d.useState("");return d.useEffect(()=>{let u=!1;return queueMicrotask(()=>{u||o(t?.domainDns)}),()=>{u=!0}},[t]),s?e.jsxs(ee,{title:"Saved configuration",applyState:r,children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(j,{name:"domain",label:"Domain",value:s.domain,onChange:u=>o({...s,domain:u})}),e.jsx(j,{name:"provider",label:"DNS provider",value:s.provider,onChange:u=>o({...s,provider:u})}),e.jsx(ce,{name:"recordTtl",label:"Record TTL (seconds)",value:s.recordTtl,min:30,max:86400,onChange:u=>o({...s,recordTtl:u})}),e.jsx(j,{name:"dnsCredential",label:s.credentialConfigured?"Replace credential (configured)":"Credential",value:l,type:"password",onChange:p})]}),e.jsx(ae,{label:"Enable DDNS",checked:s.ddnsEnabled,onChange:u=>o({...s,ddnsEnabled:u})}),e.jsx(te,{label:"Save DNS configuration",saving:n,onClick:()=>i({domainDns:{domain:s.domain,ddnsEnabled:s.ddnsEnabled,provider:s.provider,recordTtl:s.recordTtl,...l?{credential:l}:{}}})})]}):e.jsx(Q,{title:"Domain & DNS"})}function Je({configuration:t,saving:n,applyState:r,onSave:i}){const[s,o]=d.useState(t?.https);return d.useEffect(()=>{let l=!1;return queueMicrotask(()=>{l||o(t?.https)}),()=>{l=!0}},[t]),s?e.jsxs(ee,{title:"Saved configuration",applyState:r,children:[e.jsx(ae,{label:"Enable HTTPS",checked:s.enabled,onChange:l=>o({...s,enabled:l})}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(j,{name:"acmeEmail",label:"ACME email",value:s.acmeEmail,onChange:l=>o({...s,acmeEmail:l})}),e.jsx(j,{name:"acmeDomains",label:"Certificate domains",value:s.domains.join(", "),onChange:l=>o({...s,domains:l.split(",").map(p=>p.trim()).filter(Boolean)})}),e.jsx(j,{name:"certificatePath",label:"Certificate path",value:s.certificatePath??"",onChange:l=>o({...s,certificatePath:l})}),e.jsx(j,{name:"certificateKeyPath",label:"Private-key path",value:s.certificateKeyPath??"",onChange:l=>o({...s,certificateKeyPath:l})}),e.jsx(ce,{name:"renewBeforeDays",label:"Renew before (days)",value:s.renewBeforeDays,min:1,max:90,onChange:l=>o({...s,renewBeforeDays:l})})]}),e.jsx(te,{label:"Save HTTPS configuration",saving:n,onClick:()=>i({https:s})})]}):e.jsx(Q,{title:"HTTPS"})}function Ye({configuration:t,providers:n,ingress:r,saving:i,applyState:s,onSave:o}){const[l,p]=d.useState(t?.tunnelProfiles.activeProfileId??""),[u,y]=d.useState(t?.tunnelProfiles.profiles??[]),[h,D]=d.useState({});if(d.useEffect(()=>{let a=!1;return queueMicrotask(()=>{a||(p(t?.tunnelProfiles.activeProfileId??""),y(t?.tunnelProfiles.profiles??[]),D({}))}),()=>{a=!0}},[t]),!t)return e.jsx(Q,{title:"Tunnel Profiles"});const T=(a,m)=>y(v=>v.map(N=>N.id===a?{...N,...m}:N)),B=n.filter(a=>a.runtimeSupported),E=a=>n.find(m=>m.id===a),$=()=>{const a=`tunnel-${Date.now()}`,m=B[0]?.id??"ngrok";y(v=>[...v,{id:a,provider:m,label:"New tunnel",credentialConfigured:!1,parameters:{}}])},F=a=>{y(m=>m.filter(v=>v.id!==a)),l===a&&p("none")};return e.jsxs(ee,{title:"Saved tunnel profiles",applyState:s,children:[e.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Active profile",e.jsxs("select",{value:l||"none",onChange:a=>p(a.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 sm:max-w-sm",children:[e.jsx("option",{value:"none",children:"None"}),u.map(a=>e.jsxs("option",{value:a.id,children:[a.label," · ",a.provider]},a.id))]})]}),e.jsx("div",{className:"space-y-3",children:u.map(a=>e.jsxs("div",{className:"space-y-3 rounded-md border border-border p-3 text-sm",children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(j,{name:`tunnel-label-${a.id}`,label:"Label",value:a.label,onChange:m=>T(a.id,{label:m})}),e.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Provider",e.jsx("select",{value:a.provider,onChange:m=>T(a.id,{provider:m.target.value,parameters:{}}),className:"block h-10 w-full rounded-md border border-input bg-background px-3",children:B.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))})]}),E(a.provider)?.endpointSource==="declared"?e.jsx(j,{name:`tunnel-url-${a.id}`,label:"Public endpoint (declared)",value:a.publicUrl??"",onChange:m=>T(a.id,{publicUrl:m})}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"The provider reports its public endpoint; there is nothing to type here."}),e.jsx(j,{name:`tunnel-credential-${a.id}`,label:a.credentialConfigured?"Replace credential (configured)":"Credential",type:"password",value:h[a.id]??"",onChange:m=>D(v=>({...v,[a.id]:m}))})]}),e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer font-medium",children:"Provider-specific parameters"}),e.jsx("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:(E(a.provider)?.parameterFields??[]).map(({key:m,label:v})=>e.jsx(j,{name:`tunnel-${m}-${a.id}`,label:v,value:a.parameters?.[m]??"",onChange:N=>T(a.id,{parameters:{...a.parameters,[m]:N}})},m))})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[l===a.id?"Active after restart":"Inactive"," · credential ",a.credentialConfigured?"configured":"missing"]}),e.jsx(g,{type:"button",size:"sm",variant:"ghost",onClick:()=>F(a.id),children:"Remove"})]})]},a.id))}),e.jsx(g,{type:"button",size:"sm",variant:"outline",onClick:$,children:"Add tunnel profile"}),e.jsx(Xe,{ingress:r,descriptor:E(u.find(a=>a.id===l)?.provider??"")}),e.jsx(te,{label:"Save tunnel profiles",saving:i,onClick:()=>o({tunnelProfiles:{activeProfileId:l,profiles:u.map(a=>({id:a.id,provider:a.provider,label:a.label,publicUrl:a.publicUrl,parameters:a.parameters,...h[a.id]?{credential:h[a.id]}:{}}))}})})]})}function Xe({ingress:t,descriptor:n}){if(!t||n?.originOwner!=="console")return null;const r=async()=>{await window.navigator.clipboard.writeText(t.originUrl),U({description:"Tunnel origin copied"})};return e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"ingress-origin",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Tunnel origin (paste into the provider console)"}),e.jsxs("div",{className:"mt-1 flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"break-all font-mono text-sm",children:t.originUrl}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Set the tunnel's local port / service to this address, not the gateway port."})]}),e.jsxs("div",{className:"flex shrink-0 gap-1",children:[e.jsx(g,{type:"button",size:"icon",variant:"ghost","aria-label":"Copy tunnel origin",onClick:()=>{r()},children:e.jsx(se,{className:"h-4 w-4","aria-hidden":"true"})}),n.consoleUrl?e.jsx(g,{type:"button",size:"icon",variant:"ghost","aria-label":`Open ${n.label} console`,onClick:()=>window.open(n.consoleUrl,"_blank","noopener,noreferrer"),children:e.jsx(le,{className:"h-4 w-4","aria-hidden":"true"})}):null]})]})]})}function Ze({configuration:t,saving:n,applyState:r,onSave:i}){const[s,o]=d.useState(t?.p2p);return d.useEffect(()=>{let l=!1;return queueMicrotask(()=>{l||o(t?.p2p)}),()=>{l=!0}},[t]),s?e.jsxs(ee,{title:"Saved P2P configuration",applyState:r,children:[e.jsx(ae,{label:"Enable P2P fallback",checked:s.enabled,onChange:l=>o({...s,enabled:l})}),e.jsx(j,{name:"signalService",label:"Signal service",value:s.signalService,onChange:l=>o({...s,signalService:l})}),e.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Fallback policy",e.jsxs("select",{value:s.fallbackPolicy,onChange:l=>o({...s,fallbackPolicy:l.target.value}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 sm:max-w-sm",children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"when-direct-unavailable",children:"When direct is unavailable"}),e.jsx("option",{value:"prefer-p2p",children:"Prefer P2P"})]})]}),e.jsx(te,{label:"Save P2P configuration",saving:n,onClick:()=>i({p2p:s})})]}):e.jsx(Q,{title:"P2P"})}function ee({title:t,applyState:n,children:r}){return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:t}),e.jsx(P,{children:"Desired configuration · not presented as observed until verified"})]}),e.jsxs(R,{className:"space-y-4",children:[n==="restart-required"?e.jsx("div",{role:"status",className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-200",children:"Saved · restart required"}):null,r]})]})}function j({name:t,label:n,value:r,type:i="text",onChange:s}){return e.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[n,e.jsx("input",{name:t,type:i,value:r,onChange:o=>s(o.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]})}function ce({name:t,label:n,value:r,min:i,max:s,onChange:o}){return e.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[n,e.jsx("input",{name:t,type:"number",value:r,min:i,max:s,onChange:l=>o(l.target.valueAsNumber),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]})}function ae({label:t,checked:n,onChange:r}){return e.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-md border border-border p-3 text-sm font-medium",children:[t,e.jsx("input",{type:"checkbox",checked:n,onChange:i=>r(i.target.checked)})]})}function te({label:t,saving:n,onClick:r}){return e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{type:"button",onClick:r,disabled:n,children:n?"Saving…":t})})}function Qe({endpoint:t,loading:n}){const r=[{label:"Canonical URL",value:t},{label:"API endpoint",value:t?et(t,"/api/"):void 0}],i=async(s,o)=>{await window.navigator.clipboard.writeText(o),U({description:`${s} copied`})};return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsxs(S,{className:"flex items-center gap-2 text-base",children:[e.jsx(de,{className:"h-4 w-4","aria-hidden":"true"}),"接入点"]}),e.jsx(P,{children:n?"正在解析接入点":"Observed endpoints · Currently effective route is the canonical URL"})]}),e.jsx(R,{className:"space-y-3",children:r.map(({label:s,value:o})=>e.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-border p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 break-words text-sm text-foreground",children:o||"Unavailable"})]}),o?e.jsxs("div",{className:"flex shrink-0 gap-1",children:[e.jsx(g,{type:"button",size:"icon",variant:"ghost","aria-label":`Copy ${s}`,onClick:()=>{i(s,o)},children:e.jsx(se,{className:"h-4 w-4","aria-hidden":"true"})}),e.jsx(g,{type:"button",size:"icon",variant:"ghost","aria-label":`Open ${s}`,onClick:()=>window.open(o,"_blank","noopener,noreferrer"),children:e.jsx(le,{className:"h-4 w-4","aria-hidden":"true"})})]}):null]},s))})]})}function et(t,n){try{return new URL(n,t).toString()}catch{return t}}function tt({sections:t,loading:n,diagnostics:r,checkedAt:i}){return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsxs(S,{className:"flex items-center gap-2 text-base",children:[e.jsx(Oe,{className:"h-4 w-4","aria-hidden":"true"}),"网络地址"]}),e.jsx(P,{children:n?"正在刷新地址":"由运行时网络能力上报"})]}),e.jsx(R,{className:"space-y-4",children:t.map(s=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.title}),s.values.length>0?e.jsx("div",{className:"mt-1 space-y-1",children:s.values.map(o=>e.jsx(nt,{scope:s.key,value:o,diagnostics:r,checkedAt:i},o))}):e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"未提供"})]},s.key))})]})}function nt({scope:t,value:n,diagnostics:r,checkedAt:i}){const s=st(n),o=r.find(l=>l.id==="address-configuration");return e.jsxs("div",{className:"rounded-md border border-border p-3 text-sm",children:[e.jsx("div",{className:"break-words font-medium text-foreground",children:n}),e.jsxs("dl",{className:"mt-2 grid gap-x-4 gap-y-1 text-xs sm:grid-cols-2",children:[e.jsx(f,{label:"Interface",value:t==="local"?"Loopback":t==="lan"?"LAN interface (name not reported)":"Public route"}),e.jsx(f,{label:"IP version",value:s.ipVersion}),e.jsx(f,{label:"Port",value:s.port}),e.jsx(f,{label:"Configured",value:o?o.status==="ok"?"Yes":"No":"Not checked"}),e.jsx(f,{label:"Reachability",value:"Not probed"}),e.jsx(f,{label:"Configuration checked",value:o?.checkedAt?O(o.checkedAt):i?i.toLocaleString():"Not checked"})]})]})}function f({label:t,value:n}){return e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("dt",{className:"text-muted-foreground",children:t}),e.jsx("dd",{className:"text-right text-foreground",children:n})]})}function st(t){try{const n=new URL(t),r=n.hostname.replace(/^\[|\]$/g,"");return{ipVersion:r.includes(":")?"IPv6":/^\d{1,3}(?:\.\d{1,3}){3}$/.test(r)?"IPv4":"Resolved hostname",port:n.port||(n.protocol==="https:"?"443":n.protocol==="http:"?"80":"Not reported")}}catch{return{ipVersion:"Not reported",port:"Not reported"}}}function at({status:t}){const n=t?.configuration?.domainDns,r=(t?.addresses.public??[]).map(i=>{try{return new URL(i).hostname}catch{return i}});return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:"Observed DNS"}),e.jsx(P,{children:"Observed state is kept separate from desired DNS policy."})]}),e.jsxs(R,{className:"space-y-3",children:[e.jsx(q,{label:"Runtime status",capability:t?.dns}),e.jsxs("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[e.jsx(f,{label:"Observed hostnames",value:r.join(", ")||"Not reported"}),e.jsx(f,{label:"Expected domain",value:n?.domain||"Not configured"}),e.jsx(f,{label:"Expected value",value:t?.addresses.public[0]||"Not reported"}),e.jsx(f,{label:"Provider",value:n?.provider||"Not configured"})]})]})]})}function rt({status:t}){const n=t?.configuration?.https;return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsx(S,{className:"text-base",children:"Observed HTTPS"}),e.jsx(P,{children:"Certificate evidence reported by the active runtime."})]}),e.jsxs(R,{className:"space-y-3",children:[e.jsx(q,{label:"TLS",capability:t?.tls,extra:t?.tls.expiresAt?`Expires ${O(t.tls.expiresAt)}`:void 0}),e.jsxs("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[e.jsx(f,{label:"Certificate domains",value:t?.tls.domains?.join(", ")||n?.domains.join(", ")||"Not reported"}),e.jsx(f,{label:"Issuer",value:t?.tls.issuer||"Not reported by runtime"}),e.jsx(f,{label:"Validity",value:t?.tls.validFrom?`${O(t.tls.validFrom)} — ${t.tls.expiresAt?O(t.tls.expiresAt):"open"}`:t?.tls.status??"Not reported"}),e.jsx(f,{label:"Expiry",value:t?.tls.expiresAt?O(t.tls.expiresAt):"Not reported"}),e.jsx(f,{label:"Renewal status",value:t?.tls.renewalStatus||(t?.actions.renewCertificate?"Renewal available":"Renewal unavailable")}),e.jsx(f,{label:"Renewal policy",value:n?`${n.renewBeforeDays} days before expiry`:"Not configured"})]})]})]})}function it({status:t}){return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsxs(S,{className:"flex items-center gap-2 text-base",children:[e.jsx(ie,{className:"h-4 w-4","aria-hidden":"true"}),"网络能力"]}),e.jsx(P,{children:"服务端声明的网络支持"})]}),e.jsxs(R,{className:"grid gap-3 text-sm",children:[e.jsx(q,{label:"TLS",capability:t?.tls,extra:t?.tls.expiresAt?`到期时间 ${O(t.tls.expiresAt)}`:void 0}),e.jsx(q,{label:"DNS",capability:t?.dns}),e.jsx(q,{label:"Tunnel",capability:t?.tunnel})]})]})}function ot({status:t,endpoint:n,diagnostics:r,diagnosing:i,renewing:s,onDiagnose:o,onRenewCertificate:l}){const p=r.length>0?_e({generatedAt:new Date().toISOString(),endpoint:n,checks:r}):void 0,u=async()=>{p&&(await window.navigator.clipboard.writeText(p),U({description:"Diagnostic report copied"}))},y=()=>{if(!p)return;const h=URL.createObjectURL(new Blob([p],{type:"text/plain;charset=utf-8"})),D=document.createElement("a");D.href=h,D.download=`xpod-network-diagnostics-${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,D.click(),URL.revokeObjectURL(h)};return e.jsxs(k,{children:[e.jsxs(C,{children:[e.jsxs(S,{className:"flex items-center gap-2 text-base",children:[e.jsx(oe,{className:"h-4 w-4","aria-hidden":"true"}),"操作"]}),e.jsx(P,{children:"仅显示网络能力允许的操作"})]}),e.jsxs(R,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t?.actions.diagnose?e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:o,disabled:i,children:[e.jsx($e,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"连通性诊断"]}):null,t?.actions.renewCertificate?e.jsxs(g,{type:"button",size:"sm",variant:"subtle",onClick:l,disabled:s,children:[e.jsx(we,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"续签证书"]}):null,e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:()=>{u()},disabled:!p,children:[e.jsx(se,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Copy diagnostics"]}),e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:y,disabled:!p,children:[e.jsx(ke,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),"Export diagnostics"]})]}),r.length>0?e.jsx("div",{className:"space-y-2",children:r.map(h=>e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:h.label}),e.jsx(M,{variant:h.status==="ok"?"secondary":"outline",children:h.status})]}),h.detail?e.jsx("div",{className:"mt-1 break-words text-xs text-muted-foreground",children:h.detail}):null]},h.id))}):e.jsx("div",{className:"text-sm text-muted-foreground",children:"尚未运行过诊断。"})]})]})}function q({label:t,capability:n,extra:r}){const i=n?.supported===!0;return e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:i?t:`${t} 不支持`}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[n?.status??"读取中",n?.detail?` · ${n.detail}`:""]})]}),e.jsx(M,{variant:i?"secondary":"outline",children:i?"支持":"不支持"})]}),r?e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:r}):null]})}function O(t){if(!t)return"暂无记录";const n=new Date(t);return Number.isNaN(n.getTime())?"暂无记录":n.toLocaleString()}export{bt as default};
@@ -1 +1 @@
1
- import{j as t}from"./settings-BvqY7K96.js";function s({title:e}){return t.jsx("div",{className:"flex h-full items-center px-4 text-sm font-semibold text-foreground",children:e})}export{s as P};
1
+ import{j as t}from"./settings-DKknqu4C.js";function s({title:e}){return t.jsx("div",{className:"flex h-full items-center px-4 text-sm font-semibold text-foreground",children:e})}export{s as P};
@@ -1 +1 @@
1
- import{r as g,j as n}from"./settings-BvqY7K96.js";import{i as p,A as f}from"./ModelAssignmentsPanel-BetgXw1G.js";import{u as k}from"./AiConfigContext-DsyWgu2i.js";import"./dialog-B7ZRsjN7.js";import"./index-CkGda_Pg.js";import"./ai-connections-C6yaE6WQ.js";import"./XpodAiConnectionsPodStore-owBQc5nY.js";import"./index-browser-Dq7omlpY.js";function w(){const{config:r,capabilities:d,save:o,rebuild:c,saveAndRebuild:i,saving:l,rebuilding:s}=k(),[e,a]=g.useState(r?.searchIndexing);if(g.useEffect(()=>{let t=!1;return queueMicrotask(()=>{t||a(r?.searchIndexing)}),()=>{t=!0}},[r]),!e)return null;const u=async t=>{t.preventDefault(),await o({searchIndexing:e})},x=e.ftsEnabled&&e.vectorEnabled?"all":e.vectorEnabled?"vector":"fts",b=d?.rebuildTargets?.includes(x)===!0,m=p(e,r?.searchIndexing);return n.jsxs(f,{title:"Search & Indexing",description:"Choose which derived search indexes Xpod maintains for this Pod.",onSubmit:u,onRestore:()=>o({searchIndexing:{ftsEnabled:!0,vectorEnabled:!0,progressiveIndexingEnabled:!0,textBackend:"auto",vectorBackend:"auto"}}),saving:l||s,dirty:m,footerActions:n.jsx("button",{type:"button",disabled:!b||l||s,onClick:()=>m?i({searchIndexing:e},x):c(x),className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:s?"Scheduling…":m&&b?"Save and schedule rebuild":b?"Schedule rebuild":"Rebuild unavailable on this runtime"}),children:[n.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[n.jsx(h,{title:"Full-text Search",enabled:e.ftsEnabled,onEnabled:t=>a({...e,ftsEnabled:t}),backend:e.textBackend,onBackend:t=>a({...e,textBackend:t}),backends:[["auto","Auto"],...(d?.textBackends??[]).map(t=>[t,t==="fts5"?"FTS5":"PostgreSQL FTS"])]}),n.jsx(h,{title:"Vector Search",enabled:e.vectorEnabled,onEnabled:t=>a({...e,vectorEnabled:t}),backend:e.vectorBackend,onBackend:t=>a({...e,vectorBackend:t}),backends:[["auto","Auto"],...(d?.vectorBackends??[]).map(t=>[t,t==="vec"?"VEC":"pgvector"])]})]}),n.jsxs("label",{className:"flex items-start justify-between gap-4 rounded-xl border border-border p-4",children:[n.jsxs("span",{children:[n.jsx("span",{className:"block text-sm font-medium",children:"Progressive indexing"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Expand coverage as content becomes relevant instead of embedding everything eagerly."})]}),n.jsx("input",{name:"progressiveIndexingEnabled",type:"checkbox",checked:e.progressiveIndexingEnabled,onChange:t=>a({...e,progressiveIndexingEnabled:t.target.checked}),className:"mt-1 h-4 w-4 rounded border-input"})]})]})}function h({title:r,enabled:d,onEnabled:o,backend:c,onBackend:i,backends:l}){const s=l.filter(([a])=>a!=="auto"),e=v(c);return n.jsxs("section",{className:"rounded-xl border border-border p-4",children:[n.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm font-medium",children:[r,n.jsx("input",{type:"checkbox",checked:d,onChange:a=>o(a.target.checked),className:"h-4 w-4 rounded border-input"})]}),n.jsxs("label",{className:"mt-4 flex items-center justify-between gap-3 text-xs font-medium text-muted-foreground",children:["Choose backend manually",n.jsx("input",{type:"checkbox",checked:e,disabled:s.length===0,onChange:a=>i(a.target.checked?s[0]?.[0]??"auto":"auto"),className:"h-4 w-4 rounded border-input"})]}),e?n.jsxs("label",{className:"mt-3 block space-y-2 text-xs font-medium text-muted-foreground",children:["Backend",n.jsx("select",{value:c,onChange:a=>i(a.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:s.map(([a,u])=>n.jsx("option",{value:a,children:u},a))})]}):n.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Auto selects the runtime-supported backend."})]})}function v(r){return r!=="auto"}export{w as SearchIndexingPanel,v as isManualBackendSelection};
1
+ import{r as g,j as n}from"./settings-DKknqu4C.js";import{i as p,A as f}from"./ModelAssignmentsPanel-BcGSmYjb.js";import{u as k}from"./AiConfigContext-B8JS3MXF.js";import"./dialog-CyuR7Va4.js";import"./index-ComidxAm.js";import"./ai-connections-C6yaE6WQ.js";import"./XpodAiConnectionsPodStore-CLr38P_Z.js";import"./index-browser-CAscEbae.js";function w(){const{config:r,capabilities:d,save:o,rebuild:c,saveAndRebuild:i,saving:l,rebuilding:s}=k(),[e,a]=g.useState(r?.searchIndexing);if(g.useEffect(()=>{let t=!1;return queueMicrotask(()=>{t||a(r?.searchIndexing)}),()=>{t=!0}},[r]),!e)return null;const u=async t=>{t.preventDefault(),await o({searchIndexing:e})},x=e.ftsEnabled&&e.vectorEnabled?"all":e.vectorEnabled?"vector":"fts",b=d?.rebuildTargets?.includes(x)===!0,m=p(e,r?.searchIndexing);return n.jsxs(f,{title:"Search & Indexing",description:"Choose which derived search indexes Xpod maintains for this Pod.",onSubmit:u,onRestore:()=>o({searchIndexing:{ftsEnabled:!0,vectorEnabled:!0,progressiveIndexingEnabled:!0,textBackend:"auto",vectorBackend:"auto"}}),saving:l||s,dirty:m,footerActions:n.jsx("button",{type:"button",disabled:!b||l||s,onClick:()=>m?i({searchIndexing:e},x):c(x),className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:s?"Scheduling…":m&&b?"Save and schedule rebuild":b?"Schedule rebuild":"Rebuild unavailable on this runtime"}),children:[n.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[n.jsx(h,{title:"Full-text Search",enabled:e.ftsEnabled,onEnabled:t=>a({...e,ftsEnabled:t}),backend:e.textBackend,onBackend:t=>a({...e,textBackend:t}),backends:[["auto","Auto"],...(d?.textBackends??[]).map(t=>[t,t==="fts5"?"FTS5":"PostgreSQL FTS"])]}),n.jsx(h,{title:"Vector Search",enabled:e.vectorEnabled,onEnabled:t=>a({...e,vectorEnabled:t}),backend:e.vectorBackend,onBackend:t=>a({...e,vectorBackend:t}),backends:[["auto","Auto"],...(d?.vectorBackends??[]).map(t=>[t,t==="vec"?"VEC":"pgvector"])]})]}),n.jsxs("label",{className:"flex items-start justify-between gap-4 rounded-xl border border-border p-4",children:[n.jsxs("span",{children:[n.jsx("span",{className:"block text-sm font-medium",children:"Progressive indexing"}),n.jsx("span",{className:"block text-xs text-muted-foreground",children:"Expand coverage as content becomes relevant instead of embedding everything eagerly."})]}),n.jsx("input",{name:"progressiveIndexingEnabled",type:"checkbox",checked:e.progressiveIndexingEnabled,onChange:t=>a({...e,progressiveIndexingEnabled:t.target.checked}),className:"mt-1 h-4 w-4 rounded border-input"})]})]})}function h({title:r,enabled:d,onEnabled:o,backend:c,onBackend:i,backends:l}){const s=l.filter(([a])=>a!=="auto"),e=v(c);return n.jsxs("section",{className:"rounded-xl border border-border p-4",children:[n.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm font-medium",children:[r,n.jsx("input",{type:"checkbox",checked:d,onChange:a=>o(a.target.checked),className:"h-4 w-4 rounded border-input"})]}),n.jsxs("label",{className:"mt-4 flex items-center justify-between gap-3 text-xs font-medium text-muted-foreground",children:["Choose backend manually",n.jsx("input",{type:"checkbox",checked:e,disabled:s.length===0,onChange:a=>i(a.target.checked?s[0]?.[0]??"auto":"auto"),className:"h-4 w-4 rounded border-input"})]}),e?n.jsxs("label",{className:"mt-3 block space-y-2 text-xs font-medium text-muted-foreground",children:["Backend",n.jsx("select",{value:c,onChange:a=>i(a.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:s.map(([a,u])=>n.jsx("option",{value:a,children:u},a))})]}):n.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Auto selects the runtime-supported backend."})]})}function v(r){return r!=="auto"}export{w as SearchIndexingPanel,v as isManualBackendSelection};
@@ -1 +1 @@
1
- import{c as L,r as o,j as e,B as N,R as T,C as l,a as u,b as h,d as f,e as m}from"./settings-BvqY7K96.js";import{f as D,a as M,t as _,r as O}from"./admin-C6qCRFiY.js";import{E as q}from"./external-link-Bz7NckNO.js";const G=[["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"}]],U=L("rotate-cw",G);function Q({serviceId:t,title:r}){const[s,d]=o.useState(),[g,R]=o.useState(),[j,k]=o.useState([]),[v,p]=o.useState(),[b,S]=o.useState(!0),[y,w]=o.useState(!1),[C,$]=o.useState(),c=o.useCallback(async a=>{S(!0);try{const[n,A]=await Promise.all([D({signal:a}),M({source:t,level:"error",limit:5})]);d(t==="gateway"?{name:"gateway",status:"running",pid:n.adminData?.pid,uptime:n.adminData?.uptime?n.adminData.uptime*1e3:void 0,restartCount:0}:n.servicesData?.find(E=>E.name===t)),R(n.configData??void 0),k(A),$(n.checkedAt),p(void 0)}catch(n){n instanceof DOMException&&n.name==="AbortError"||p("Service status could not be loaded. The previous snapshot is retained.")}finally{S(!1)}},[t]);o.useEffect(()=>{const a=new AbortController;let n=!0;return Promise.resolve().then(()=>{n&&c(a.signal)}),()=>{n=!1,a.abort()}},[c]);const x=o.useMemo(()=>X(t,g),[g,t]),P=async()=>{const a=t==="gateway"?"the whole Xpod runtime":`${r} only`;if(!window.confirm(`Restart ${a}? Active requests may be interrupted.`))return;w(!0);const n=t==="gateway"?await _():await O(t);w(!1),n?setTimeout(()=>{c()},750):p(`Restart request for ${r} was not accepted by this runtime.`)};return e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{"aria-live":"polite",className:"text-xs text-muted-foreground",children:b?"Refreshing service evidence…":C?`Checked ${C.toLocaleString()}`:"Not checked"}),e.jsxs(N,{type:"button",size:"sm",variant:"outline",onClick:()=>{c()},disabled:b,children:[e.jsx(T,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),v&&e.jsx("div",{role:"alert",className:"rounded-md border border-destructive/30 p-3 text-sm text-destructive",children:v}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:r}),e.jsx(f,{children:"Observed state, endpoint, health evidence, dependencies, and explicitly scoped lifecycle action."})]}),e.jsxs(m,{className:"grid gap-3 text-sm sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(i,{label:"State",value:s?.status??"Unknown"}),e.jsx(i,{label:"PID",value:s?.pid?.toString()??"Not reported"}),e.jsx(i,{label:"Uptime",value:s?.uptime?z(s.uptime):"Not reported"}),e.jsx(i,{label:"Restart count",value:s?.restartCount?.toString()??"Not reported"}),e.jsx(i,{label:"Internal endpoint",value:x.endpoint}),e.jsx(i,{label:"Health check",value:x.healthCheck})]})]}),e.jsxs(l,{children:[e.jsx(u,{children:e.jsx(h,{children:"Dependencies"})}),e.jsx(m,{className:"grid gap-3 text-sm sm:grid-cols-2",children:x.dependencies.map(a=>e.jsx(i,{label:a,value:B(a,t,s)},a))})]}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Recent errors"}),e.jsxs(f,{children:["Latest supervisor errors scoped to ",r,"."]})]}),e.jsxs(m,{className:"space-y-2",children:[j.length?j.map(a=>e.jsxs("div",{className:"rounded-lg border border-border p-3 text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:new Date(a.timestamp).toLocaleString()}),e.jsx("div",{className:"mt-1 break-words",children:a.message})]},`${a.timestamp}-${a.message}`)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No recent errors reported."}),e.jsxs("a",{className:"inline-flex items-center text-sm font-medium text-primary hover:underline",href:`/status/logs?source=${t}`,children:[e.jsx(q,{className:"mr-1.5 h-4 w-4"}),"Open related logs"]})]})]}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Lifecycle"}),e.jsx(f,{children:t==="gateway"?"Gateway is the parent process, so this action restarts the whole Xpod runtime.":`This action restarts ${r} only; dependent requests may briefly fail.`})]}),e.jsx(m,{children:e.jsxs(N,{type:"button",variant:"destructive",onClick:()=>{P()},disabled:y,children:[e.jsx(U,{className:"mr-2 h-4 w-4"}),y?"Restarting…":t==="gateway"?"Restart Xpod runtime…":`Restart ${r}…`]})})]})]})}function X(t,r){const s=r?.env??{};return t==="gateway"?{endpoint:window.location.origin,healthCheck:"GET /service/status",dependencies:["Solid Server","API Server"]}:t==="css"?{endpoint:s.CSS_PORT?`http://127.0.0.1:${s.CSS_PORT}`:"Internal endpoint not reported",healthCheck:"TCP readiness + Solid root request",dependencies:["Authority storage","Identity service"]}:{endpoint:s.API_INTERNAL_URL||(s.API_PORT?`http://127.0.0.1:${s.API_PORT}`:"Internal endpoint not reported"),healthCheck:"GET /health",dependencies:["Solid Server","Configuration store"]}}function B(t,r,s){return s?s.status!=="running"?`${H(r)} is ${s.status}; dependency health is not implied`:`${t} required; direct probe evidence is not reported by this runtime`:"Not reported"}function H(t){return t==="gateway"?"Gateway":t==="css"?"Solid Server":"API Server"}function i({label:t,value:r}){return e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:t}),e.jsx("div",{className:"mt-1 break-all font-medium",children:r})]})}function z(t){const r=Math.floor(t/1e3),s=Math.floor(r/3600),d=Math.floor(r%3600/60);return s?`${s}h ${d}m`:`${d}m ${r%60}s`}export{Q as ServiceStatusPanel};
1
+ import{c as L,r as o,j as e,B as N,R as T,C as l,a as u,b as h,d as f,e as m}from"./settings-DKknqu4C.js";import{f as D,a as M,t as _,r as O}from"./admin-C6qCRFiY.js";import{E as q}from"./external-link-D3Z34fP_.js";const G=[["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"}]],U=L("rotate-cw",G);function Q({serviceId:t,title:r}){const[s,d]=o.useState(),[g,R]=o.useState(),[j,k]=o.useState([]),[v,p]=o.useState(),[b,S]=o.useState(!0),[y,w]=o.useState(!1),[C,$]=o.useState(),c=o.useCallback(async a=>{S(!0);try{const[n,A]=await Promise.all([D({signal:a}),M({source:t,level:"error",limit:5})]);d(t==="gateway"?{name:"gateway",status:"running",pid:n.adminData?.pid,uptime:n.adminData?.uptime?n.adminData.uptime*1e3:void 0,restartCount:0}:n.servicesData?.find(E=>E.name===t)),R(n.configData??void 0),k(A),$(n.checkedAt),p(void 0)}catch(n){n instanceof DOMException&&n.name==="AbortError"||p("Service status could not be loaded. The previous snapshot is retained.")}finally{S(!1)}},[t]);o.useEffect(()=>{const a=new AbortController;let n=!0;return Promise.resolve().then(()=>{n&&c(a.signal)}),()=>{n=!1,a.abort()}},[c]);const x=o.useMemo(()=>X(t,g),[g,t]),P=async()=>{const a=t==="gateway"?"the whole Xpod runtime":`${r} only`;if(!window.confirm(`Restart ${a}? Active requests may be interrupted.`))return;w(!0);const n=t==="gateway"?await _():await O(t);w(!1),n?setTimeout(()=>{c()},750):p(`Restart request for ${r} was not accepted by this runtime.`)};return e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{"aria-live":"polite",className:"text-xs text-muted-foreground",children:b?"Refreshing service evidence…":C?`Checked ${C.toLocaleString()}`:"Not checked"}),e.jsxs(N,{type:"button",size:"sm",variant:"outline",onClick:()=>{c()},disabled:b,children:[e.jsx(T,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),v&&e.jsx("div",{role:"alert",className:"rounded-md border border-destructive/30 p-3 text-sm text-destructive",children:v}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:r}),e.jsx(f,{children:"Observed state, endpoint, health evidence, dependencies, and explicitly scoped lifecycle action."})]}),e.jsxs(m,{className:"grid gap-3 text-sm sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(i,{label:"State",value:s?.status??"Unknown"}),e.jsx(i,{label:"PID",value:s?.pid?.toString()??"Not reported"}),e.jsx(i,{label:"Uptime",value:s?.uptime?z(s.uptime):"Not reported"}),e.jsx(i,{label:"Restart count",value:s?.restartCount?.toString()??"Not reported"}),e.jsx(i,{label:"Internal endpoint",value:x.endpoint}),e.jsx(i,{label:"Health check",value:x.healthCheck})]})]}),e.jsxs(l,{children:[e.jsx(u,{children:e.jsx(h,{children:"Dependencies"})}),e.jsx(m,{className:"grid gap-3 text-sm sm:grid-cols-2",children:x.dependencies.map(a=>e.jsx(i,{label:a,value:B(a,t,s)},a))})]}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Recent errors"}),e.jsxs(f,{children:["Latest supervisor errors scoped to ",r,"."]})]}),e.jsxs(m,{className:"space-y-2",children:[j.length?j.map(a=>e.jsxs("div",{className:"rounded-lg border border-border p-3 text-sm",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:new Date(a.timestamp).toLocaleString()}),e.jsx("div",{className:"mt-1 break-words",children:a.message})]},`${a.timestamp}-${a.message}`)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No recent errors reported."}),e.jsxs("a",{className:"inline-flex items-center text-sm font-medium text-primary hover:underline",href:`/status/logs?source=${t}`,children:[e.jsx(q,{className:"mr-1.5 h-4 w-4"}),"Open related logs"]})]})]}),e.jsxs(l,{children:[e.jsxs(u,{children:[e.jsx(h,{children:"Lifecycle"}),e.jsx(f,{children:t==="gateway"?"Gateway is the parent process, so this action restarts the whole Xpod runtime.":`This action restarts ${r} only; dependent requests may briefly fail.`})]}),e.jsx(m,{children:e.jsxs(N,{type:"button",variant:"destructive",onClick:()=>{P()},disabled:y,children:[e.jsx(U,{className:"mr-2 h-4 w-4"}),y?"Restarting…":t==="gateway"?"Restart Xpod runtime…":`Restart ${r}…`]})})]})]})}function X(t,r){const s=r?.env??{};return t==="gateway"?{endpoint:window.location.origin,healthCheck:"GET /service/status",dependencies:["Solid Server","API Server"]}:t==="css"?{endpoint:s.CSS_PORT?`http://127.0.0.1:${s.CSS_PORT}`:"Internal endpoint not reported",healthCheck:"TCP readiness + Solid root request",dependencies:["Authority storage","Identity service"]}:{endpoint:s.API_INTERNAL_URL||(s.API_PORT?`http://127.0.0.1:${s.API_PORT}`:"Internal endpoint not reported"),healthCheck:"GET /health",dependencies:["Solid Server","Configuration store"]}}function B(t,r,s){return s?s.status!=="running"?`${H(r)} is ${s.status}; dependency health is not implied`:`${t} required; direct probe evidence is not reported by this runtime`:"Not reported"}function H(t){return t==="gateway"?"Gateway":t==="css"?"Solid Server":"API Server"}function i({label:t,value:r}){return e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:t}),e.jsx("div",{className:"mt-1 break-all font-medium",children:r})]})}function z(t){const r=Math.floor(t/1e3),s=Math.floor(r/3600),d=Math.floor(r%3600/60);return s?`${s}h ${d}m`:`${d}m ${r%60}s`}export{Q as ServiceStatusPanel};
@@ -1 +1 @@
1
- import{c as r,D as l,T as x,U as h,v,j as a,O as y,N as p,w as m,x as k}from"./settings-BvqY7K96.js";import{A as u}from"./activity-CtBc9cNy.js";import{W as f,N as w}from"./waypoints-C4WbspTb.js";import{P as g}from"./PaneListHeader-BGOqGec4.js";import{T as N,u as j}from"./workspace-layout-B9H1Tqrk.js";const b=[["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"}]],I=r("boxes",b);const S=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],M=r("braces",S);const L=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],_=r("hard-drive",L);const z=[["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"}]],d=r("scroll-text",z);const D=[["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"}]],H=r("server",D);const O=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],V=r("timer",O);function s(i,t,e,n,o){return{id:i,label:t,path:e,href:`/status/${e}`,end:!0,group:n,icon:o}}const c=[s("overview","Overview","overview","Overview",u),s("gateway","Gateway","services/gateway","Services",f),s("solid-server","Solid Server","services/solid-server","Services",l),s("api-server","API Server","services/api-server","Services",H),s("logs","Logs","logs","Diagnostics",d),s("index-overview","Index Overview","index","Index",I),s("rdf","RDF","index/rdf","Index",M),s("fts","FTS","index/fts","Index",d),s("vector","Vector","index/vector","Index",x),s("retrieval-points","Retrieval Points","index/retrieval-points","Index",w),s("cache","Cache","index/cache","Index",_),s("slow-queries","Slow Queries","index/slow-queries","Index",V),s("benchmark","Benchmark","index/benchmark","Index",h)],q=["Overview","Services","Diagnostics","Index"];function C(){const i=v(),t=[...c].sort((e,n)=>n.path.length-e.path.length).find(e=>i.pathname.endsWith(e.path))??c[0];return a.jsx(N,{mode:"auto",listHeader:a.jsx(g,{title:"Status"}),list:a.jsx(A,{}),mainHeader:a.jsx("div",{className:"flex h-full items-center px-4",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-sm font-semibold",children:["Status · ",t.label]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"Observed state and operational evidence"})]})}),main:a.jsx("section",{className:"min-h-full bg-background",children:a.jsx(y,{})}),className:"min-h-full"})}function A(){const i=j();return a.jsx("aside",{"data-list-navigation":!0,className:"h-full overflow-y-auto border-r border-border bg-muted/20 py-2",children:q.map(t=>a.jsxs("section",{className:"mb-3",children:[a.jsx("h2",{className:"px-5 py-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),c.filter(e=>e.group===t).map(e=>{const n=e.icon;return a.jsxs(p,{to:e.path,end:e.end,onKeyDown:m,onClick:()=>i.openMain(),className:({isActive:o})=>k(o,{compact:!1}),children:[a.jsx(n,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),e.label]},e.id)})]},t))})}export{C as default};
1
+ import{c as r,D as l,T as x,U as h,v,j as a,O as y,N as p,w as m,x as k}from"./settings-DKknqu4C.js";import{A as u}from"./activity-C5DAHHTE.js";import{W as f,N as w}from"./waypoints-CrqfAftE.js";import{P as g}from"./PaneListHeader-D40hqcVl.js";import{T as N,u as j}from"./workspace-layout-UN6c4qTG.js";const b=[["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"}]],I=r("boxes",b);const S=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],M=r("braces",S);const L=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],_=r("hard-drive",L);const z=[["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"}]],d=r("scroll-text",z);const D=[["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"}]],H=r("server",D);const O=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],V=r("timer",O);function s(i,t,e,n,o){return{id:i,label:t,path:e,href:`/status/${e}`,end:!0,group:n,icon:o}}const c=[s("overview","Overview","overview","Overview",u),s("gateway","Gateway","services/gateway","Services",f),s("solid-server","Solid Server","services/solid-server","Services",l),s("api-server","API Server","services/api-server","Services",H),s("logs","Logs","logs","Diagnostics",d),s("index-overview","Index Overview","index","Index",I),s("rdf","RDF","index/rdf","Index",M),s("fts","FTS","index/fts","Index",d),s("vector","Vector","index/vector","Index",x),s("retrieval-points","Retrieval Points","index/retrieval-points","Index",w),s("cache","Cache","index/cache","Index",_),s("slow-queries","Slow Queries","index/slow-queries","Index",V),s("benchmark","Benchmark","index/benchmark","Index",h)],q=["Overview","Services","Diagnostics","Index"];function C(){const i=v(),t=[...c].sort((e,n)=>n.path.length-e.path.length).find(e=>i.pathname.endsWith(e.path))??c[0];return a.jsx(N,{mode:"auto",listHeader:a.jsx(g,{title:"Status"}),list:a.jsx(A,{}),mainHeader:a.jsx("div",{className:"flex h-full items-center px-4",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-sm font-semibold",children:["Status · ",t.label]}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"Observed state and operational evidence"})]})}),main:a.jsx("section",{className:"min-h-full bg-background",children:a.jsx(y,{})}),className:"min-h-full"})}function A(){const i=j();return a.jsx("aside",{"data-list-navigation":!0,className:"h-full overflow-y-auto border-r border-border bg-muted/20 py-2",children:q.map(t=>a.jsxs("section",{className:"mb-3",children:[a.jsx("h2",{className:"px-5 py-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),c.filter(e=>e.group===t).map(e=>{const n=e.icon;return a.jsxs(p,{to:e.path,end:e.end,onKeyDown:m,onClick:()=>i.openMain(),className:({isActive:o})=>k(o,{compact:!1}),children:[a.jsx(n,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),e.label]},e.id)})]},t))})}export{C as default};
@@ -1 +1 @@
1
- import{c as l,D as h,v as u,r as c,j as e,O as x,N as b,w as y,x as g}from"./settings-BvqY7K96.js";import{K as f}from"./key-round-CvuhloKV.js";import{b as v,c as k}from"./admin-C6qCRFiY.js";import{p as j}from"./settings-projection-CUkyprDQ.js";import{P as N}from"./PaneListHeader-BGOqGec4.js";import{T as S,u as w}from"./workspace-layout-B9H1Tqrk.js";const M=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],P=l("box",M);const L=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],C=l("cloud",L);const A=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],_=l("server-cog",A);const D=[["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"}]],H=l("wrench",D),I=[{scope:"account",label:"Account",description:"Your Pod and its session.",items:[{id:"pod",label:"Pod",path:"pod",description:"Current Pod identity and data boundary.",icon:P},{id:"identity-access",label:"Identity & Access",path:"identity-access",description:"Session, WebID, and account access.",icon:f}]},{scope:"node",label:"This node",description:"Shared by every Pod on this machine.",items:[{id:"storage",label:"Storage",path:"storage",description:"Authority storage backend and limits.",icon:h},{id:"runtime",label:"Runtime",path:"runtime",description:"Low-frequency runtime configuration.",icon:_},{id:"cloud",label:"Cloud",path:"cloud",description:"Cloud coordination settings when supported.",icon:C},{id:"advanced",label:"Advanced",path:"advanced",description:"Expert and compatibility controls.",icon:H}]}];function q(){const r=u(),[n,s]=c.useState(!1);c.useEffect(()=>{let t=!1;return Promise.all([v(),k()]).then(([d,p])=>{t||s(j({registered:d?.registered===!0,managed:d?.managed===!0,domainAllocated:p?.allocated===!0}).cloud)}),()=>{t=!0}},[]);const a=c.useMemo(()=>I.map(t=>({...t,items:t.items.filter(d=>d.id!=="cloud"||n)})).filter(t=>t.items.length>0),[n]),o=c.useMemo(()=>a.flatMap(t=>t.items),[a]),i=o.find(t=>r.pathname.endsWith(`/${t.path}`))??o[0],m=a.find(t=>t.items.includes(i))?.scope;return e.jsx(S,{mode:"auto",listHeader:e.jsx(N,{title:"Settings"}),list:e.jsx(z,{groups:a}),mainHeader:e.jsx("div",{className:"flex h-full items-center px-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-sm font-semibold",children:["Settings · ",i.label]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.description}),m==="node"?e.jsx("div",{className:"text-xs text-amber-700 dark:text-amber-300",children:"Applies to every Pod on this machine."}):null]})}),main:e.jsx("section",{className:"min-h-full bg-background",children:e.jsx(x,{})}),className:"min-h-full"})}function z({groups:r}){const n=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"Settings sections","data-list-navigation":!0,children:r.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"px-4 pb-1 pt-3",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s.label}),e.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:s.description})]}),s.items.map(a=>{const o=a.icon;return e.jsxs(b,{to:a.path,"aria-label":a.label,onKeyDown:y,onClick:()=>n.openMain(),className:({isActive:i})=>g(i,{compact:!1}),children:[e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})]},s.scope))})})}export{q as default};
1
+ import{c as l,D as h,v as u,r as c,j as e,O as x,N as b,w as y,x as g}from"./settings-DKknqu4C.js";import{K as f}from"./key-round-DyjLmXuB.js";import{b as v,c as k}from"./admin-C6qCRFiY.js";import{p as j}from"./settings-projection-CUkyprDQ.js";import{P as N}from"./PaneListHeader-D40hqcVl.js";import{T as S,u as w}from"./workspace-layout-UN6c4qTG.js";const M=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],P=l("box",M);const L=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],C=l("cloud",L);const A=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],_=l("server-cog",A);const D=[["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"}]],H=l("wrench",D),I=[{scope:"account",label:"Account",description:"Your Pod and its session.",items:[{id:"pod",label:"Pod",path:"pod",description:"Current Pod identity and data boundary.",icon:P},{id:"identity-access",label:"Identity & Access",path:"identity-access",description:"Session, WebID, and account access.",icon:f}]},{scope:"node",label:"This node",description:"Shared by every Pod on this machine.",items:[{id:"storage",label:"Storage",path:"storage",description:"Authority storage backend and limits.",icon:h},{id:"runtime",label:"Runtime",path:"runtime",description:"Low-frequency runtime configuration.",icon:_},{id:"cloud",label:"Cloud",path:"cloud",description:"Cloud coordination settings when supported.",icon:C},{id:"advanced",label:"Advanced",path:"advanced",description:"Expert and compatibility controls.",icon:H}]}];function q(){const r=u(),[n,s]=c.useState(!1);c.useEffect(()=>{let t=!1;return Promise.all([v(),k()]).then(([d,p])=>{t||s(j({registered:d?.registered===!0,managed:d?.managed===!0,domainAllocated:p?.allocated===!0}).cloud)}),()=>{t=!0}},[]);const a=c.useMemo(()=>I.map(t=>({...t,items:t.items.filter(d=>d.id!=="cloud"||n)})).filter(t=>t.items.length>0),[n]),o=c.useMemo(()=>a.flatMap(t=>t.items),[a]),i=o.find(t=>r.pathname.endsWith(`/${t.path}`))??o[0],m=a.find(t=>t.items.includes(i))?.scope;return e.jsx(S,{mode:"auto",listHeader:e.jsx(N,{title:"Settings"}),list:e.jsx(z,{groups:a}),mainHeader:e.jsx("div",{className:"flex h-full items-center px-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-sm font-semibold",children:["Settings · ",i.label]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.description}),m==="node"?e.jsx("div",{className:"text-xs text-amber-700 dark:text-amber-300",children:"Applies to every Pod on this machine."}):null]})}),main:e.jsx("section",{className:"min-h-full bg-background",children:e.jsx(x,{})}),className:"min-h-full"})}function z({groups:r}){const n=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"Settings sections","data-list-navigation":!0,children:r.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"px-4 pb-1 pt-3",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s.label}),e.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:s.description})]}),s.items.map(a=>{const o=a.icon;return e.jsxs(b,{to:a.path,"aria-label":a.label,onKeyDown:y,onClick:()=>n.openMain(),className:({isActive:i})=>g(i,{compact:!1}),children:[e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})]},s.scope))})})}export{q as default};
@@ -1,4 +1,4 @@
1
- import{y as Z,z as ee,A as te,E as I,F as ie,G as T,H as ce,I as G,J as de,K as le,L as ue,M as he,u as pe,r as u,j as s,B as C,R as fe,C as ge,a as me,b as we,d as be,e as ve,Q as xe,S as ye}from"./settings-BvqY7K96.js";import{d as Ae,e as Se,b as Ce,c as Ie,h as Ne,i as _e,t as je,u as Ee}from"./admin-C6qCRFiY.js";import{a as Re}from"./settings-projection-CUkyprDQ.js";import{e as Ue,a as H}from"./ai-connections-C6yaE6WQ.js";import{R as Pe}from"./rotate-ccw-DgFKDaz7.js";import{S as X}from"./skeleton-D3OeFDF6.js";import{E as ke}from"./external-link-Bz7NckNO.js";class v extends Error{code;constructor(t,r){super(r),this.name="AccountStorageBindingsError",this.code=t}}async function Oe(e){const t=De(e.origin),r=e.controls?.account?.bindings;if(typeof r!="string"||r.trim()==="")throw new v("missing-control","Account storage bindings control is unavailable");const n=e.fetchImpl??fetch,a=Te(r,t),o=a.origin===t?a.href:await Z(a.href,n,e.trustedAccountIndex);if(!o)throw new v("cross-origin","Account storage bindings control is not hosted by this Xpod");const c=ee({Accept:"application/json",...e.headers});let i;try{i=await n(o,{headers:c,credentials:"include"})}catch(l){throw new v("request-failed",l instanceof Error?l.message:"Failed to load Account storage bindings")}if(i.status===401||i.status===403)throw new v("forbidden","Account storage bindings require an authenticated Account");if(!i.ok)throw new v("request-failed",`Account storage bindings request failed (${i.status})`);let d;try{d=await i.json()}catch{throw new v("invalid-response","Account storage bindings response is not valid JSON")}return Le(d,a.origin,We(a,e.trustedAccountIndex,t))}function Le(e,t,r=!1){if(!z(e)||!Array.isArray(e.bindings))throw new v("invalid-response","Account storage bindings response is malformed");const n=[],a=new Set;for(const o of e.bindings){if(!z(o)||typeof o.webId!="string"||typeof o.storageUrl!="string")throw new v("invalid-response","Account storage binding row is malformed");const c=Be(o.webId),i=Fe(o.storageUrl,r?void 0:t);if(!c||!i)throw new v("cross-origin","Account storage binding is outside the trusted storage scope");const d={webId:c,storageUrl:i,...typeof o.label=="string"?{label:o.label}:{}},l=`${d.webId}
1
+ import{y as Z,z as ee,A as te,E as I,F as ie,G as T,H as ce,I as G,J as de,K as le,L as ue,M as he,u as pe,r as u,j as s,B as C,R as fe,C as ge,a as me,b as we,d as be,e as ve,Q as xe,S as ye}from"./settings-DKknqu4C.js";import{d as Ae,e as Se,b as Ce,c as Ie,h as Ne,i as _e,t as je,u as Ee}from"./admin-C6qCRFiY.js";import{a as Re}from"./settings-projection-CUkyprDQ.js";import{e as Ue,a as H}from"./ai-connections-C6yaE6WQ.js";import{R as Pe}from"./rotate-ccw-679HF_ec.js";import{S as X}from"./skeleton-CkopNkPB.js";import{E as ke}from"./external-link-D3Z34fP_.js";class v extends Error{code;constructor(t,r){super(r),this.name="AccountStorageBindingsError",this.code=t}}async function Oe(e){const t=De(e.origin),r=e.controls?.account?.bindings;if(typeof r!="string"||r.trim()==="")throw new v("missing-control","Account storage bindings control is unavailable");const n=e.fetchImpl??fetch,a=Te(r,t),o=a.origin===t?a.href:await Z(a.href,n,e.trustedAccountIndex);if(!o)throw new v("cross-origin","Account storage bindings control is not hosted by this Xpod");const c=ee({Accept:"application/json",...e.headers});let i;try{i=await n(o,{headers:c,credentials:"include"})}catch(l){throw new v("request-failed",l instanceof Error?l.message:"Failed to load Account storage bindings")}if(i.status===401||i.status===403)throw new v("forbidden","Account storage bindings require an authenticated Account");if(!i.ok)throw new v("request-failed",`Account storage bindings request failed (${i.status})`);let d;try{d=await i.json()}catch{throw new v("invalid-response","Account storage bindings response is not valid JSON")}return Le(d,a.origin,We(a,e.trustedAccountIndex,t))}function Le(e,t,r=!1){if(!z(e)||!Array.isArray(e.bindings))throw new v("invalid-response","Account storage bindings response is malformed");const n=[],a=new Set;for(const o of e.bindings){if(!z(o)||typeof o.webId!="string"||typeof o.storageUrl!="string")throw new v("invalid-response","Account storage binding row is malformed");const c=Be(o.webId),i=Fe(o.storageUrl,r?void 0:t);if(!c||!i)throw new v("cross-origin","Account storage binding is outside the trusted storage scope");const d={webId:c,storageUrl:i,...typeof o.label=="string"?{label:o.label}:{}},l=`${d.webId}
2
2
  ${d.storageUrl}`;a.has(l)||(a.add(l),n.push(d))}return n}function De(e){try{return new URL(e??(typeof window>"u"?"http://localhost":window.location.origin)).origin}catch{throw new v("cross-origin","Current Xpod origin is invalid")}}function Te(e,t){try{const r=new URL(e,t);if(!["http:","https:"].includes(r.protocol)||r.username||r.password||r.hash)throw new Error("unsafe control URL");return r}catch{throw new v("cross-origin","Account storage bindings control is not a valid URL")}}function Be(e){if(!te(e))try{const t=new URL(e);return!["http:","https:"].includes(t.protocol)||t.username||t.password?void 0:e}catch{return}}function Fe(e,t){try{const r=new URL(e.trim());return t!==void 0&&r.origin!==t||!["http:","https:"].includes(r.protocol)||r.username||r.password||r.search||r.hash?void 0:(r.pathname=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`,r.href)}catch{return}}function We(e,t,r){if(!t)return!1;try{const n=new URL(t,r);return n.pathname.startsWith("/.account/")&&e.origin===n.origin&&e.pathname.startsWith("/.account/")}catch{return!1}}function z(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}const q="co.undefineds.ai-connections",Me={providerCredentials:"settings/credentials.ttl",providerDefinitions:"settings/providers/__service_access__.ttl",gatewayAccessKeys:".data/ai/gateway/access-keys.ttl",quotaSnapshots:".data/ai/gateway/quota.ttl"},$e=new Set(Ue);function V(e,t){if(!U(e))throw new Error("invalid_descriptor");if(e.appletId!==q)throw new Error("invalid_applet_id");const r=e.service;if(!U(r)||typeof r.webId!="string"||typeof r.label!="string"||!Je(r.webId))throw new Error("invalid_service");if(!Array.isArray(e.resources)||e.resources.length===0)throw new Error("invalid_empty_resources");const n=Ve(t),a=new Set,o=e.resources.map(c=>Ge(c,n,a));return{appletId:q,service:{webId:r.webId,label:r.label},resources:o}}function Ge(e,t,r){if(!U(e)||typeof e.id!="string"||typeof e.url!="string"||e.mediaType!=="text/turtle"||!U(e.access))throw new Error("invalid_resource");const n=He(e.id,t);if(!n||r.has(e.id))throw new Error("invalid_resource");Xe(e.url);let a;try{a=new URL(e.url)}catch{throw new Error("invalid_resource")}if(!Ke(a,t))throw new Error("invalid_resource");if(a.href!==n)throw new Error("invalid_resource");return r.add(e.id),{id:e.id,url:a.href,mediaType:"text/turtle",access:qe(e.access)}}function He(e,t){const r=Me[e];if(r)return new URL(r,t).href;const n=e.startsWith("providerDocument:")?e.slice(17):void 0;if(n&&$e.has(n))return new URL(`settings/providers/${n}.ttl`,t).href}function Xe(e){if(/%(?![0-9a-fA-F]{2})/.test(e)||/%(?:2f|5c)/i.test(e)||e.includes("\\"))throw new Error("invalid_resource");const t=ze(e);if(K(t))throw new Error("invalid_resource");try{const r=decodeURIComponent(t);if(r.includes("\\")||K(r))throw new Error("invalid_resource")}catch{throw new Error("invalid_resource")}}function ze(e){const t=e.split("#",1)[0]??e;return(t.split("?",1)[0]??t).replace(/^[a-z][a-z0-9+.-]*:\/\/[^/\\?#]*/i,"")}function K(e){return e.split("/").some(t=>t==="."||t==="..")}function qe(e){if(Object.keys(e).some(r=>r!=="read"&&r!=="append"&&r!=="write")||e.read!==!0||e.append!==!0||e.write!==!0)throw new Error("invalid_resource");return{read:!0,append:!0,write:!0}}function Ve(e){const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("invalid_current_pod");return t.pathname.endsWith("/")||(t.pathname=`${t.pathname}/`),t}function Ke(e,t){return(e.protocol==="http:"||e.protocol==="https:")&&e.origin===t.origin&&e.pathname.startsWith(t.pathname)}function Je(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function U(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}const Qe=3,Ye=63,Ze=/^[a-z0-9-]+$/;function B(e){return e.trim().toLowerCase()}function re(e){const t=B(e);if(!t)return I.usernameRequired;if(t.length<Qe||t.length>Ye)return I.usernameLength;if(!Ze.test(t))return I.usernameCharset;if(t.startsWith("-")||t.endsWith("-"))return I.usernameHyphen}const et="已有 Pod 的身份绑定尚未确认。请重试读取绑定或返回账号,不需要重新创建 Pod。",tt="暂时无法确认已有 Pod,请重试读取或返回账号。";class x extends Error{code;constructor(t){super(t==="binding-missing"?et:t==="inventory-unavailable"?tt:"账号已切换,请返回当前账号重新操作。"),this.name="FirstPodReadinessError",this.code=t}}function rt(e){const t=G(),r=de(t,{...e.headers}),n=new Headers(r).get("Authorization"),a=()=>{try{e.assertCurrentAccount?.()}catch{throw new x("account-changed")}if(G()!==t||n?.startsWith("CSS-Account-Token ")&&n!==(t?`CSS-Account-Token ${t}`:void 0))throw new x("account-changed")},o=e.fetchImpl??fetch;return{headers:r,assertCurrentAccount:a,fetch:async(i,d)=>{a();const l=await o(i,d);try{a()}catch(b){throw l.body?.cancel().catch(()=>{}),b}const g=async b=>{a();const y=await b();return a(),y},m=l.json.bind(l),w=l.text.bind(l);return l.json=()=>g(m),l.text=()=>g(w),l}}}async function nt(e,t,r,n){n.assertCurrentAccount();let a;try{const i=await e(T(t),{headers:{...n.headers,Accept:"application/json"},credentials:"include"});if(!i.ok)throw new x("inventory-unavailable");a=await i.json()}catch{throw n.assertCurrentAccount(),new x("inventory-unavailable")}if(n.assertCurrentAccount(),!D(a)||!D(a.pods))throw new x("inventory-unavailable");const o=Object.entries(a.pods);if(o.some(([i,d])=>!ae(i)||typeof d!="string"||!d))throw new x("inventory-unavailable");const c=le(r);if(o.some(([i])=>!c||ue(i,c.storageRoot)))throw new x("binding-missing")}function st(e){for(const t of e){if(!t)continue;const r=ut(t);if(!r)continue;const n=B(r).replace(/[^a-z0-9-]/gu,"-").replace(/-+/gu,"-").replace(/^-+|-+$/gu,"");if(n&&!re(n))return n}return""}async function at(e){const t=rt(e),r=t.fetch,n=B(e.username),a=re(n);if(a)throw new Error(a);const o=await ie(e.provisionCode),c=await Z(e.createPodUrl,r,e.trustedAccountIndex);if(!c)throw new Error("Pod creation control is not hosted by this Xpod");await nt(r,c,o,t);const i=await dt(r,n,o);t.assertCurrentAccount();const d=await r(T(c),{method:"POST",headers:{...t.headers,Accept:"application/json","Content-Type":"application/json"},credentials:"include",body:JSON.stringify(ce(n,i?.provisionCode??o,i?.provisionReceipt))});if(t.assertCurrentAccount(),!d.ok){const w=await ct(d);throw d.status===409||ne(w)?new Error(I.podNameTaken):new Error(w||"Failed to create Pod")}const l=await d.json().catch(P);t.assertCurrentAccount();const g=lt(l);if(!e.pickWebIdUrl)return g;const m=await ot({fetchImpl:r,headers:t.headers,maxAttempts:e.maxAttempts,pickWebIdUrl:e.pickWebIdUrl,pollIntervalMs:e.pollIntervalMs});return t.assertCurrentAccount(),m.length>0?m:g}async function ot(e){const t=e.fetchImpl??fetch,r=Math.max(1,e.maxAttempts??30),n=Math.max(0,e.pollIntervalMs??500);for(let a=0;a<r;a+=1){const o=await it(t,e.pickWebIdUrl,e.headers);if(o.length>0)return o;a<r-1&&n>0&&await new Promise(c=>setTimeout(c,n))}return[]}function P(e){if(e instanceof x)throw e}async function it(e,t,r){const n=await e(T(t),{headers:r,credentials:"include"}).catch(P);if(!n?.ok)return[];const a=await n.json().catch(P);if(!Array.isArray(a?.entries))return[];const o=new Set,c=[];for(const i of a.entries){if(!D(i)||typeof i.webId!="string"||typeof i.storageUrl!="string")continue;const d=se(i.webId,i.storageUrl);if(!d)continue;const l=`${d.webId}
3
3
  ${d.storageUrl}`;o.has(l)||(o.add(l),c.push(d))}return c}async function ct(e){const t=await e.text?.().catch(P);if(t)try{const r=JSON.parse(t);return typeof r.message=="string"?r.message:typeof r.error=="string"?r.error:t}catch{return t}}function ne(e){return e?/already (?:is )?(?:a )?resource/iu.test(e)||/already taken/iu.test(e)||/already exists/iu.test(e):!1}async function dt(e,t,r){try{return await he(e,t,r)}catch(n){const a=n instanceof Error?n.message:String(n);throw ne(a)?new Error(I.podNameTaken):n}}function lt(e){if(typeof e?.podUrl!="string")return[];const t=ae(e.podUrl);if(!t)return[];const r=new Set;if(typeof e.webId=="string"&&e.webId.length>0&&r.add(e.webId),Array.isArray(e.webIds))for(const n of e.webIds)typeof n=="string"&&n.length>0&&r.add(n);return Array.from(r).map(n=>se(n,t)).filter(n=>!!n)}function ut(e){try{return new URL(e).pathname.split("/").filter(Boolean)[0]}catch{return e.includes("@")?e.split("@",1)[0]:e}}function se(e,t){if(!te(e))try{const r=new URL(e),n=new URL(t);return!["http:","https:"].includes(r.protocol)||!["http:","https:"].includes(n.protocol)?void 0:(n.pathname=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`,{webId:e,storageUrl:n.href})}catch{return}}function ae(e){try{const t=new URL(e);return!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||t.search?void 0:(t.pathname=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`,t.href)}catch{return}}function D(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ht(e,t){if(e)try{return new URL(new URL(e).pathname,t).toString()}catch{return}}const pt="http://www.w3.org/ns/solid/acp#",ft="http://www.w3.org/ns/auth/acl#";function J(e,{ownerWebId:t,serviceWebId:r},n=!0){const a=n?`
4
4
  <#serviceAccess>
@@ -1,3 +1,3 @@
1
- import{q as h,k as f,s as w,h as J,t as pe}from"./settings-BvqY7K96.js";import{r as me,a as he,b as be}from"./index-browser-Dq7omlpY.js";import{A as ae,s as M,d as B,c as k,o as X,p as ye,b as we,C as L}from"./ai-connections-C6yaE6WQ.js";function ve(e){const t=new TextEncoder().encode(JSON.stringify(e));let r="";for(const o of t)r+=String.fromCharCode(o);return btoa(r)}function Ie(e){const t=atob(e),r=Uint8Array.from(t,o=>o.charCodeAt(0));return JSON.parse(new TextDecoder().decode(r))}function ge(e){return JSON.stringify({algorithm:"PLAINTEXT",encoding:"base64",ciphertext:ve(e.secret),webId:e.webId,credentialIri:e.credentialIri,provider:e.provider})}function Se(e){if(!(typeof e.envelope!="string"||!e.envelope.trim()))try{const t=JSON.parse(e.envelope);if(t.algorithm!=="PLAINTEXT"||t.webId!==e.webId||t.provider!==e.provider||t.credentialIri!==e.credentialIri)return;const r=t.encoding==="base64"?Ie(String(t.ciphertext)):JSON.parse(String(t.ciphertext));return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0}catch{return}}function _e(e){return h.buildId({id:e})}function Re(e){return h.buildId({id:`custom-instance-${encodeURIComponent(e)}.ttl#this`})}function Q(e,t){const r=crypto.randomUUID();return t==="local"?`${e}-local-${r}`:`${e}-${r}`}function et(e){const t=(e.split("#",1)[0]??e).split("/").filter(Boolean).at(-1)??"",r=t.endsWith(".ttl")?t.slice(0,-4):t;if(r)return r.startsWith("custom-")||r==="custom"?"custom":ae.find(o=>r===o||r.startsWith(`${o}-`))}function A(e){if(!e)return;const t=e.split("#",1)[0]??e,r=t.split("/").filter(Boolean).at(-1)??t;if(!r)return;const o=r.endsWith(".ttl")?r:`${r}.ttl`,n=e.indexOf("#");return n<0?o:`${o}${e.slice(n)}`}function R(e){const t=A(e);if(t)return(t.split("#",1)[0]??t).replace(/\.ttl$/u,"")}const xe={"api-key":"添加 API Key","browser-login":"浏览器登录","browser-oauth":"浏览器登录","device-code":"设备码登录","local-session-import":"已有登录态","local-service":"本地服务"};function Ee(e){return e.label??xe[e.id]}function tt(e){return e.map(t=>{const r=Ee(t);return r===t.label?t:{...t,label:r}})}function z(e){switch(e){case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"kimi":return"Kimi";case"bailian":return"百炼";case"deepseek":return"DeepSeek";case"zhipu":return"智谱 AI";case"ollama":return"Ollama";case"custom":return"Custom"}}var Ae=me(),Ce=he();const O=Array.from(new Set([...ae,"zhipu","ollama","custom"])),G=new WeakMap,Pe=J.storage.base.slice(J.storage.base.lastIndexOf("/")+1);function Ue(e){const t=e.indexOf("#");return t<0?e:e.slice(0,t)}function rt(e){Me(),pe({createQueryEngine:async()=>new be.QueryEngine});const t=new URL("settings/-/sparql",e.podUrl).toString();return f.setSparqlEndpoint(t),h.setSparqlEndpoint(t),w.setSparqlEndpoint(t),{credentialsTableDocument(){return f.buildIri(e.podUrl,{id:Pe})},providerTableDocument(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const i=n==="custom"&&o?j(o):x(n);return h.buildIri(e.podUrl,{id:Ue(i)})},async listModels(){return await e.database.init?.(w),(await e.database.select().from(w).execute()).map(ze).filter(U)},async listProviders(){await e.database.init?.(f,h,w);const r=await e.database.select().from(f).execute(),o=await e.database.select().from(h).execute(),n=await e.database.select().from(w).execute();return ke(e,r,o,n)},async createApiKeyCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=c(o.id),a=i??f.buildId({id:Q(n,"apiKey")}),s=1,u=M(n,o.offeringId??B(n,"apiKey")),l=o.baseUrl??X(n,u),d=F(o.proxyUrl),p={id:a,provider:n==="custom"?j(a):x(n),service:"ai",authMode:"apiKey",offeringId:u,status:"active",accountLabel:o.label,label:o.label,baseUrl:l,proxyUrl:d,keyVersion:String(s),reauthRequired:!1,encryptedSecret:$(e,n,a,{type:"apiKey",apiKey:o.apiKey}),encryptionAlgorithm:"PLAINTEXT",metadata:{...k({offeringId:u,baseUrl:l,priority:o.priority}),...o.compatibility?{compatibility:o.compatibility}:{}}};return await ee(e,a,p,i!==void 0),y(e,n,p)},async createLocalCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=c(o.id),a=i??f.buildId({id:Q(n,"local")}),s=M(n,o.offeringId??B(n,"local")),u=o.baseUrl??X(n,s),l={id:a,provider:x(n),service:"ai",authMode:"local",offeringId:s,status:"active",accountLabel:o.label??"Local",label:o.label??"Local",baseUrl:u,keyVersion:"1",reauthRequired:!1,encryptedSecret:$(e,n,a,{type:"local"}),encryptionAlgorithm:"PLAINTEXT",metadata:k({offeringId:s,baseUrl:u,priority:o.priority})};return await ee(e,a,l,i!==void 0),y(e,n,l)},async saveOAuthCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const a=(G.get(e.database)??Promise.resolve()).then(async()=>{await e.database.init?.(f,h);const s=M(n,o.offeringId??B(n,"deviceCode")),l=(await e.database.select().from(f).execute()).find(_=>{const C=y(e,n,_);if(!C||C.authMode!=="deviceCode"&&C.authMode!=="oauth"||re(n,C.offeringId)!==re(n,s)||_.status!=="active"&&_.status!=="disabled")return!1;const fe=T(e,n,C.id,_.encryptedSecret);return Le(o,I(_.metadata),fe)}),d=l&&y(e,n,l),p=I(l?.metadata),m=d&&T(e,n,d.id,l?.encryptedSecret),b=d?.id??f.buildId({id:`${n}-oauth-${crypto.randomUUID()}`}),g=o.accountLabel??"OAuth",S=o.accountId??c(p?.accountId)??c(m?.accountId),H=o.accountSubject??c(p?.authoritativeSubject)??c(m?.accountSubject)??c(m?.authoritativeSubject),N={...l,id:b,provider:x(n),service:"ai",authMode:"deviceCodeOAuth",offeringId:s,status:d?.enabled===!1?"disabled":"active",accountLabel:l?.accountLabel??g,label:l?.label??g,expiresAt:o.expiresAt,scopes:o.scope?o.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String((d?.version??0)+1),reauthRequired:!1,encryptedSecret:$(e,n,b,{type:"deviceCodeOAuth",accessToken:o.accessToken,refreshToken:o.refreshToken,expiresAt:o.expiresAt,scope:o.scope,idToken:o.idToken,accountId:S,accountSubject:H,accountLabel:o.accountLabel,offeringId:s,authorizationMethodId:o.authorizationMethodId}),encryptionAlgorithm:"PLAINTEXT",metadata:{...p,...k({offeringId:s,priority:d?.priority,enabled:d?.enabled,health:"healthy"}),authoritativeSubject:H,accountId:S,authorizationMethodId:o.authorizationMethodId}};if(l){const _={...N};if(delete _.id,!await e.database.updateById(f,b,_))throw new Error("credential_version_conflict")}else await e.database.insert(f).values(N).execute();return y(e,n,N)});return G.set(e.database,a.then(()=>{},()=>{})),a},async updateOAuthCredential(r,o,n,i){const a=v(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(f,h);const s=await e.database.findById(f,o),u=s&&y(e,a,s);if(!s||!u||u.authMode!=="deviceCode")throw new Error("oauth_credential_not_found");if(u.version!==n)throw new Error("credential_version_conflict");const l=T(e,a,o,s.encryptedSecret),d=i.accountId??c(I(s.metadata)?.accountId)??c(l?.accountId),p=i.accountSubject??c(I(s.metadata)?.authoritativeSubject)??c(l?.accountSubject)??c(l?.authoritativeSubject),m=M(a,i.offeringId??u.offeringId),b={expiresAt:i.expiresAt,scopes:i.scope?i.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String(n+1),reauthRequired:!1,status:"active",encryptedSecret:$(e,a,o,{type:"deviceCodeOAuth",accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:i.expiresAt,scope:i.scope,idToken:i.idToken,accountId:d,accountSubject:p,accountLabel:i.accountLabel??c(s.accountLabel),offeringId:m,authorizationMethodId:i.authorizationMethodId??c(I(s.metadata)?.authorizationMethodId)}),accountLabel:i.accountLabel??c(s.accountLabel),label:i.accountLabel??c(s.label),offeringId:m,metadata:{...I(s.metadata),...k({offeringId:m,health:"healthy"}),authoritativeSubject:p,accountId:d,authorizationMethodId:i.authorizationMethodId??c(I(s.metadata)?.authorizationMethodId)}},g=await e.database.updateById(f,o,b);if(!g)throw new Error("credential_version_conflict");return y(e,a,g)},async updateProviderCredential(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(f,h);const a=await e.database.findById(f,o),s=a&&y(e,i,a);if(!a||!s)throw new Error("credential_not_found");if(s.version!==n.expectedVersion)throw new Error("credential_version_conflict");const u={...I(a.metadata),...n.priority===void 0?{}:{priority:n.priority},...n.enabled===void 0?{}:{enabled:n.enabled},...n.baseUrl===void 0?{}:{baseUrl:n.baseUrl},...n.proxyUrl===void 0?{}:{proxyUrl:F(n.proxyUrl)}},l={...n.label===void 0?{}:{accountLabel:n.label,label:n.label},...n.baseUrl===void 0?{}:{baseUrl:n.baseUrl},...n.proxyUrl===void 0?{}:{proxyUrl:F(n.proxyUrl)},...n.enabled===void 0?{}:{status:n.enabled?"active":"disabled"},keyVersion:String(s.version+1),metadata:u},d=await e.database.updateById(f,o,l);if(!d)throw new Error("credential_update_failed");const p=y(e,i,d);if(!p)throw new Error("credential_update_failed");return p},async markCredentialHealth(r,o,n,i){const a=v(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(f);const s=await e.database.findById(f,o),u=s&&y(e,a,s);if(!s||!u)throw new Error("credential_not_found");if(u.version!==i)throw new Error("credential_version_conflict");const l=await e.database.updateById(f,o,{keyVersion:String(u.version+1),metadata:{...I(s.metadata),health:n}});if(!l)throw new Error("credential_update_failed");const d=y(e,a,l);if(!d)throw new Error("credential_update_failed");return d},async deleteProviderCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=await e.database.findById(f,o),a=i&&y(e,n,i);if(a)return await e.database.deleteById(f,o),a},async readCredentialSecret(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const i=await e.database.findById(f,o);if(!i||!y(e,n,i))throw new Error("credential_not_found");const a=T(e,n,o,i.encryptedSecret);if(!a)throw new Error("credential_secret_unavailable");return a},async saveDiscoveredModels(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(f,h,w);const a=await Y(e,o),s=te(i,a);await oe(e.database,s,z(i));const u=await e.database.select().from(w).execute(),l=new Set(u.map(m=>c(m.id)).filter(U)),d=n.map(Ne).filter(U),p=new Set(d.map(m=>m.id));for(const m of u.filter(b=>De(b,s,i))){const b=E(c(m.id),s)??se(c(m.id));b&&!p.has(b)&&c(m.status)!=="unavailable"&&await e.database.updateById(w,String(m.id),{status:"unavailable"})}for(const m of d)await Fe(e.database,s,m,l)},async saveModelSelection(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(h,w);const a=i==="custom"&&n?await Y(e,n):null;if(i==="custom"&&n&&!a)throw new Error("credential_not_found");const s=a?te(i,a):x(i);await oe(e.database,s,z(i));const l=(await e.database.select().from(h).execute()).find(S=>P(c(S.id),s)),d=c(l?.id)??s,p=le(l?.hasModel),m=await e.database.select().from(w).execute(),b=[...new Set(o.map(S=>Ke(i,S,m,a?s:void 0)))];if(!await e.database.updateById(h,d,{hasModel:b}))throw new Error("provider_model_selection_update_failed");e.authenticatedFetch&&await Oe(e,d,p,b)}}}const Te="https://undefineds.co/ns#hasModel";async function Oe(e,t,r,o){const n=D(h,e.podUrl,t),i=r.map(d=>D(w,e.podUrl,d)),a=o.map(d=>D(w,e.podUrl,d)),s=d=>d.map(p=>`<${n}> <${Te}> <${p}> .`).join(`
1
+ import{q as h,k as f,s as w,h as J,t as pe}from"./settings-DKknqu4C.js";import{r as me,a as he,b as be}from"./index-browser-CAscEbae.js";import{A as ae,s as M,d as B,c as k,o as X,p as ye,b as we,C as L}from"./ai-connections-C6yaE6WQ.js";function ve(e){const t=new TextEncoder().encode(JSON.stringify(e));let r="";for(const o of t)r+=String.fromCharCode(o);return btoa(r)}function Ie(e){const t=atob(e),r=Uint8Array.from(t,o=>o.charCodeAt(0));return JSON.parse(new TextDecoder().decode(r))}function ge(e){return JSON.stringify({algorithm:"PLAINTEXT",encoding:"base64",ciphertext:ve(e.secret),webId:e.webId,credentialIri:e.credentialIri,provider:e.provider})}function Se(e){if(!(typeof e.envelope!="string"||!e.envelope.trim()))try{const t=JSON.parse(e.envelope);if(t.algorithm!=="PLAINTEXT"||t.webId!==e.webId||t.provider!==e.provider||t.credentialIri!==e.credentialIri)return;const r=t.encoding==="base64"?Ie(String(t.ciphertext)):JSON.parse(String(t.ciphertext));return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0}catch{return}}function _e(e){return h.buildId({id:e})}function Re(e){return h.buildId({id:`custom-instance-${encodeURIComponent(e)}.ttl#this`})}function Q(e,t){const r=crypto.randomUUID();return t==="local"?`${e}-local-${r}`:`${e}-${r}`}function et(e){const t=(e.split("#",1)[0]??e).split("/").filter(Boolean).at(-1)??"",r=t.endsWith(".ttl")?t.slice(0,-4):t;if(r)return r.startsWith("custom-")||r==="custom"?"custom":ae.find(o=>r===o||r.startsWith(`${o}-`))}function A(e){if(!e)return;const t=e.split("#",1)[0]??e,r=t.split("/").filter(Boolean).at(-1)??t;if(!r)return;const o=r.endsWith(".ttl")?r:`${r}.ttl`,n=e.indexOf("#");return n<0?o:`${o}${e.slice(n)}`}function R(e){const t=A(e);if(t)return(t.split("#",1)[0]??t).replace(/\.ttl$/u,"")}const xe={"api-key":"添加 API Key","browser-login":"浏览器登录","browser-oauth":"浏览器登录","device-code":"设备码登录","local-session-import":"已有登录态","local-service":"本地服务"};function Ee(e){return e.label??xe[e.id]}function tt(e){return e.map(t=>{const r=Ee(t);return r===t.label?t:{...t,label:r}})}function z(e){switch(e){case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"kimi":return"Kimi";case"bailian":return"百炼";case"deepseek":return"DeepSeek";case"zhipu":return"智谱 AI";case"ollama":return"Ollama";case"custom":return"Custom"}}var Ae=me(),Ce=he();const O=Array.from(new Set([...ae,"zhipu","ollama","custom"])),G=new WeakMap,Pe=J.storage.base.slice(J.storage.base.lastIndexOf("/")+1);function Ue(e){const t=e.indexOf("#");return t<0?e:e.slice(0,t)}function rt(e){Me(),pe({createQueryEngine:async()=>new be.QueryEngine});const t=new URL("settings/-/sparql",e.podUrl).toString();return f.setSparqlEndpoint(t),h.setSparqlEndpoint(t),w.setSparqlEndpoint(t),{credentialsTableDocument(){return f.buildIri(e.podUrl,{id:Pe})},providerTableDocument(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const i=n==="custom"&&o?j(o):x(n);return h.buildIri(e.podUrl,{id:Ue(i)})},async listModels(){return await e.database.init?.(w),(await e.database.select().from(w).execute()).map(ze).filter(U)},async listProviders(){await e.database.init?.(f,h,w);const r=await e.database.select().from(f).execute(),o=await e.database.select().from(h).execute(),n=await e.database.select().from(w).execute();return ke(e,r,o,n)},async createApiKeyCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=c(o.id),a=i??f.buildId({id:Q(n,"apiKey")}),s=1,u=M(n,o.offeringId??B(n,"apiKey")),l=o.baseUrl??X(n,u),d=F(o.proxyUrl),p={id:a,provider:n==="custom"?j(a):x(n),service:"ai",authMode:"apiKey",offeringId:u,status:"active",accountLabel:o.label,label:o.label,baseUrl:l,proxyUrl:d,keyVersion:String(s),reauthRequired:!1,encryptedSecret:$(e,n,a,{type:"apiKey",apiKey:o.apiKey}),encryptionAlgorithm:"PLAINTEXT",metadata:{...k({offeringId:u,baseUrl:l,priority:o.priority}),...o.compatibility?{compatibility:o.compatibility}:{}}};return await ee(e,a,p,i!==void 0),y(e,n,p)},async createLocalCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=c(o.id),a=i??f.buildId({id:Q(n,"local")}),s=M(n,o.offeringId??B(n,"local")),u=o.baseUrl??X(n,s),l={id:a,provider:x(n),service:"ai",authMode:"local",offeringId:s,status:"active",accountLabel:o.label??"Local",label:o.label??"Local",baseUrl:u,keyVersion:"1",reauthRequired:!1,encryptedSecret:$(e,n,a,{type:"local"}),encryptionAlgorithm:"PLAINTEXT",metadata:k({offeringId:s,baseUrl:u,priority:o.priority})};return await ee(e,a,l,i!==void 0),y(e,n,l)},async saveOAuthCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const a=(G.get(e.database)??Promise.resolve()).then(async()=>{await e.database.init?.(f,h);const s=M(n,o.offeringId??B(n,"deviceCode")),l=(await e.database.select().from(f).execute()).find(_=>{const C=y(e,n,_);if(!C||C.authMode!=="deviceCode"&&C.authMode!=="oauth"||re(n,C.offeringId)!==re(n,s)||_.status!=="active"&&_.status!=="disabled")return!1;const fe=T(e,n,C.id,_.encryptedSecret);return Le(o,I(_.metadata),fe)}),d=l&&y(e,n,l),p=I(l?.metadata),m=d&&T(e,n,d.id,l?.encryptedSecret),b=d?.id??f.buildId({id:`${n}-oauth-${crypto.randomUUID()}`}),g=o.accountLabel??"OAuth",S=o.accountId??c(p?.accountId)??c(m?.accountId),H=o.accountSubject??c(p?.authoritativeSubject)??c(m?.accountSubject)??c(m?.authoritativeSubject),N={...l,id:b,provider:x(n),service:"ai",authMode:"deviceCodeOAuth",offeringId:s,status:d?.enabled===!1?"disabled":"active",accountLabel:l?.accountLabel??g,label:l?.label??g,expiresAt:o.expiresAt,scopes:o.scope?o.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String((d?.version??0)+1),reauthRequired:!1,encryptedSecret:$(e,n,b,{type:"deviceCodeOAuth",accessToken:o.accessToken,refreshToken:o.refreshToken,expiresAt:o.expiresAt,scope:o.scope,idToken:o.idToken,accountId:S,accountSubject:H,accountLabel:o.accountLabel,offeringId:s,authorizationMethodId:o.authorizationMethodId}),encryptionAlgorithm:"PLAINTEXT",metadata:{...p,...k({offeringId:s,priority:d?.priority,enabled:d?.enabled,health:"healthy"}),authoritativeSubject:H,accountId:S,authorizationMethodId:o.authorizationMethodId}};if(l){const _={...N};if(delete _.id,!await e.database.updateById(f,b,_))throw new Error("credential_version_conflict")}else await e.database.insert(f).values(N).execute();return y(e,n,N)});return G.set(e.database,a.then(()=>{},()=>{})),a},async updateOAuthCredential(r,o,n,i){const a=v(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(f,h);const s=await e.database.findById(f,o),u=s&&y(e,a,s);if(!s||!u||u.authMode!=="deviceCode")throw new Error("oauth_credential_not_found");if(u.version!==n)throw new Error("credential_version_conflict");const l=T(e,a,o,s.encryptedSecret),d=i.accountId??c(I(s.metadata)?.accountId)??c(l?.accountId),p=i.accountSubject??c(I(s.metadata)?.authoritativeSubject)??c(l?.accountSubject)??c(l?.authoritativeSubject),m=M(a,i.offeringId??u.offeringId),b={expiresAt:i.expiresAt,scopes:i.scope?i.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String(n+1),reauthRequired:!1,status:"active",encryptedSecret:$(e,a,o,{type:"deviceCodeOAuth",accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:i.expiresAt,scope:i.scope,idToken:i.idToken,accountId:d,accountSubject:p,accountLabel:i.accountLabel??c(s.accountLabel),offeringId:m,authorizationMethodId:i.authorizationMethodId??c(I(s.metadata)?.authorizationMethodId)}),accountLabel:i.accountLabel??c(s.accountLabel),label:i.accountLabel??c(s.label),offeringId:m,metadata:{...I(s.metadata),...k({offeringId:m,health:"healthy"}),authoritativeSubject:p,accountId:d,authorizationMethodId:i.authorizationMethodId??c(I(s.metadata)?.authorizationMethodId)}},g=await e.database.updateById(f,o,b);if(!g)throw new Error("credential_version_conflict");return y(e,a,g)},async updateProviderCredential(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(f,h);const a=await e.database.findById(f,o),s=a&&y(e,i,a);if(!a||!s)throw new Error("credential_not_found");if(s.version!==n.expectedVersion)throw new Error("credential_version_conflict");const u={...I(a.metadata),...n.priority===void 0?{}:{priority:n.priority},...n.enabled===void 0?{}:{enabled:n.enabled},...n.baseUrl===void 0?{}:{baseUrl:n.baseUrl},...n.proxyUrl===void 0?{}:{proxyUrl:F(n.proxyUrl)}},l={...n.label===void 0?{}:{accountLabel:n.label,label:n.label},...n.baseUrl===void 0?{}:{baseUrl:n.baseUrl},...n.proxyUrl===void 0?{}:{proxyUrl:F(n.proxyUrl)},...n.enabled===void 0?{}:{status:n.enabled?"active":"disabled"},keyVersion:String(s.version+1),metadata:u},d=await e.database.updateById(f,o,l);if(!d)throw new Error("credential_update_failed");const p=y(e,i,d);if(!p)throw new Error("credential_update_failed");return p},async markCredentialHealth(r,o,n,i){const a=v(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(f);const s=await e.database.findById(f,o),u=s&&y(e,a,s);if(!s||!u)throw new Error("credential_not_found");if(u.version!==i)throw new Error("credential_version_conflict");const l=await e.database.updateById(f,o,{keyVersion:String(u.version+1),metadata:{...I(s.metadata),health:n}});if(!l)throw new Error("credential_update_failed");const d=y(e,a,l);if(!d)throw new Error("credential_update_failed");return d},async deleteProviderCredential(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");await e.database.init?.(f,h);const i=await e.database.findById(f,o),a=i&&y(e,n,i);if(a)return await e.database.deleteById(f,o),a},async readCredentialSecret(r,o){const n=v(r);if(!n)throw new Error("unsupported_provider");const i=await e.database.findById(f,o);if(!i||!y(e,n,i))throw new Error("credential_not_found");const a=T(e,n,o,i.encryptedSecret);if(!a)throw new Error("credential_secret_unavailable");return a},async saveDiscoveredModels(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(f,h,w);const a=await Y(e,o),s=te(i,a);await oe(e.database,s,z(i));const u=await e.database.select().from(w).execute(),l=new Set(u.map(m=>c(m.id)).filter(U)),d=n.map(Ne).filter(U),p=new Set(d.map(m=>m.id));for(const m of u.filter(b=>De(b,s,i))){const b=E(c(m.id),s)??se(c(m.id));b&&!p.has(b)&&c(m.status)!=="unavailable"&&await e.database.updateById(w,String(m.id),{status:"unavailable"})}for(const m of d)await Fe(e.database,s,m,l)},async saveModelSelection(r,o,n){const i=v(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(h,w);const a=i==="custom"&&n?await Y(e,n):null;if(i==="custom"&&n&&!a)throw new Error("credential_not_found");const s=a?te(i,a):x(i);await oe(e.database,s,z(i));const l=(await e.database.select().from(h).execute()).find(S=>P(c(S.id),s)),d=c(l?.id)??s,p=le(l?.hasModel),m=await e.database.select().from(w).execute(),b=[...new Set(o.map(S=>Ke(i,S,m,a?s:void 0)))];if(!await e.database.updateById(h,d,{hasModel:b}))throw new Error("provider_model_selection_update_failed");e.authenticatedFetch&&await Oe(e,d,p,b)}}}const Te="https://undefineds.co/ns#hasModel";async function Oe(e,t,r,o){const n=D(h,e.podUrl,t),i=r.map(d=>D(w,e.podUrl,d)),a=o.map(d=>D(w,e.podUrl,d)),s=d=>d.map(p=>`<${n}> <${Te}> <${p}> .`).join(`
2
2
  `),u=[i.length>0?`DELETE DATA { ${s(i)} }`:void 0,a.length>0?`INSERT DATA { ${s(a)} }`:void 0].filter(d=>!!d);if(u.length===0)return;const l=await e.authenticatedFetch(n.split("#",1)[0],{method:"PATCH",headers:{"content-type":"application/sparql-update"},body:u.join(`;
3
3
  `)});if(!l.ok)throw new Error(`provider_model_selection_persist_failed:${l.status}`)}function D(e,t,r){return/^https?:\/\//u.test(r)?r:e.buildIri(t,{id:r})}async function Y(e,t){const r=await e.database.findById(f,t);return r||((await e.database.select().from(f).execute()).find(n=>{const i=c(n.id);return i===t||(i?f.buildIri(e.podUrl,{id:i})===t:!1)})??null)}function Me(){Z(Ae.ActionObserverHttp.prototype),Z(Ce.ActionObserverHttp.prototype)}function Z(e){const t=e;if(t.__xpodObservedActorsPatch)return;const r=t.onRun;t.onRun=function(o,n,i){return Array.isArray(this.observedActors)||(this.observedActors=[]),r.call(this,o,n,i)},t.__xpodObservedActorsPatch=!0}function ke(e,t,r,o){const n=t.filter(i=>c(i.service)==="ai").filter(i=>c(i.status)!=="revoked");return O.map(i=>{const a=n.map(d=>y(e,i,d)).filter(U).sort((d,p)=>d.priority-p.priority||d.id.localeCompare(p.id)),s=r.find(d=>R(c(d.id))===i),l=le(s?.hasModel).map(d=>Be(i,d,o));return{id:i,name:i==="custom"?a.find(d=>d.label)?.label??z(i):z(i),offerings:i==="custom"?Ve(n.filter(d=>y(e,i,d))):ye(i,e.openAiSubscriptionImportAvailable===!0),credentials:a,selectedModels:l,status:qe(a)}})}async function ee(e,t,r,o){if(!(o?await e.database.findById(f,t):null)){await e.database.insert(f).values(r).execute();return}const i={...r};if(delete i.id,!await e.database.updateById(f,t,i))throw new Error("credential_create_failed")}function $(e,t,r,o){return ge({webId:e.webId,provider:t,credentialIri:f.buildIri(e.podUrl,{id:r}),secret:o})}function Le(e,t,r){let o=!1;for(const[n,i]of[[e.accountId,[t?.accountId,r?.accountId]],[e.accountSubject,[t?.authoritativeSubject,r?.accountSubject,r?.authoritativeSubject]]]){const a=[...new Set(i.map(c).filter(U).filter(s=>s.trim()))];if(a.length>1)return!1;if(!(!n?.trim()||!a.length)){if(a[0]!==n)return!1;o=!0}}return o}function y(e,t,r){const o=c(r.id);if(!o)return;const n=q(c(r.provider))??He(o);if(n!==t)return;const i=I(r.metadata),a=ue(r.authMode);if(a)return{id:o,provider:n,offeringId:ce(r,n,a),authMode:a,label:c(r.accountLabel)??c(r.label),enabled:ie(i?.enabled)??c(r.status)==="active",priority:ne(i?.priority)??100,health:Xe(i?.health)??(ie(r.reauthRequired)?"expired":"healthy"),maskedHint:We(e,n,o,r.encryptedSecret),baseUrl:c(r.baseUrl),proxyUrl:Je(c(r.proxyUrl)??c(i?.proxyUrl)),compatibility:$e(i?.compatibility),expiresAt:Qe(r.expiresAt),version:ne(r.keyVersion)??0}}function $e(e){return e==="auto"||e==="openai"||e==="anthropic"?e:void 0}function ce(e,t,r){return c(e.offeringId)??c(I(e.metadata)?.offeringId)??W(c(e.provider))??B(t,r)}function Be(e,t,r){const o=r.find(s=>A(c(s.id))===A(t)),n=c(o?.isProvidedBy),i=o?E(t,n??e)??t:E(t,e)??t,a=o??r.find(s=>{const u=c(s.id),l=c(s.isProvidedBy);return u===t||E(u,e)===i||q(l)===e&&E(u,l??e)===i});return{id:i,provider:e,offeringId:W(c(a?.isProvidedBy)),credentialId:V(n),resourceId:c(a?.id)??t,displayName:c(a?.displayName),availability:c(a?.status)==="unavailable"||!a?"unavailable":"available"}}function ze(e){const t=c(e.isProvidedBy),r=q(t),o=r&&E(c(e.id),t??r);if(!(!r||!o))return{id:o,provider:r,offeringId:W(t),credentialId:V(t),resourceId:c(e.id),displayName:c(e.displayName),availability:c(e.status)==="unavailable"?"unavailable":"available",...je(e)}}function Ne(e){const t=I(e),r=c(t?.id);if(r)return{id:r,displayName:c(t?.displayName),modelType:de(t?.modelType)}}function te(e,t){const r=V(c(t?.provider));return r?j(r):x(e)}function x(e){return _e(e)}function j(e){return Re(e)}function V(e){const t=R(e),r=t?.startsWith("custom-instance-")?t.slice(16):void 0;if(r)try{return decodeURIComponent(r)}catch{return}}function re(e,t){if(!t)return;const r=t.trim().toLowerCase();if(e==="bailian"){if(r==="token-plan")return"token-plan-personal";if(r==="coding-plan")return"coding-plan-pro";if(r==="payg")return"pay-as-you-go"}return r}function P(e,t){const r=A(e),o=A(t);return r!==void 0&&r===o}function De(e,t,r){const o=c(e.isProvidedBy);return P(o,t)?!0:r==="custom"?!1:R(o)?.startsWith(`${r}-`)===!0}function se(e){if(!e)return;const t=e.lastIndexOf("#");if(t<0||t===e.length-1)return;const r=e.slice(t+1);try{return decodeURIComponent(r)}catch{return r}}async function oe(e,t,r){(await e.select().from(h).execute()).some(n=>P(c(n.id),t))||await e.insert(h).values({id:t,displayName:r}).execute()}async function Fe(e,t,r,o){const n=K(t,r.id),i={displayName:r.displayName??r.id,isProvidedBy:t,status:"active",...r.modelType?{modelType:r.modelType}:{}};if(o.has(n)){await e.updateById(w,n,i);return}await e.insert(w).values({id:n,...i}).execute(),o.add(n)}function je(e){const t=de(e.modelType);return t?{modelType:t,...t==="embedding"?{capabilities:["embedding"]}:{}}:{}}function de(e){const t=c(e)?.trim().toLowerCase();return t==="chat"||t==="embedding"?t:void 0}function K(e,t){const r=A(e)??`${e}.ttl`;return`${r.split("#",1)[0]??r}#${encodeURIComponent(t)}`}function Ke(e,t,r,o){const n=c(t.resourceId),i=o??x(e),a=c(t.id),s=a?r.filter(l=>{const d=c(l.isProvidedBy),p=R(d);return(o?P(d,o):p===e||p?.startsWith(`${e}-`)===!0)&&E(c(l.id),d??i)===a}):[],u=o||s.length===1?s[0]:void 0;if(n){const l=r.find(b=>c(b.id)===n);if(!l&&u)return String(u.id);const d=c(l?.isProvidedBy),p=R(d),m=o?P(d,o):p===e||p?.startsWith(`${e}-`)===!0;if(l&&!m)throw new Error("invalid_model_selection_resource");if(!l){const b=a??se(n),g=R(n),S=o?P(g,o):g===e||g?.startsWith(`${e}-`)===!0;if(!b||!S)throw new Error("invalid_model_selection_resource");return K(i,b)}return n}if(!a)throw new Error("invalid_model_selection_resource");return c(u?.id)??K(i,a)}function E(e,t){if(!e)return;const o=A(t)?.split("#",1)[0]??t,n=o.endsWith(".ttl")?`${o}#`:`${o}.ttl#`,i=e.lastIndexOf(n);if(!(i<0))try{return decodeURIComponent(e.slice(i+n.length))}catch{return e.slice(i+n.length)}}function le(e){if(Array.isArray(e))return e.map(c).filter(U);const t=c(e);return t?[t]:[]}function Ve(e){const t=new Map;for(const r of e){const o=I(r.metadata),n=ce(r,"custom",ue(r.authMode)??"apiKey"),i=we(o?.compatibility,n),a=c(r.baseUrl)??c(o?.baseUrl),s=L.find(u=>u.id===n)??L.find(u=>u.id===`${i}-compatible`)??L[0];t.set(n,{...s,id:n,endpoints:a?[{protocol:i==="anthropic"?"anthropic":"chatCompletions",baseUrl:a}]:s.endpoints,modelDiscovery:i==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}})}return t.size>0?[...t.values()]:L}function qe(e){return e.some(t=>t.health==="expired"||t.health==="invalid")?"attention":e.some(t=>t.enabled)?"available":e.length>0?"configured":"unconfigured"}function We(e,t,r,o){const n=T(e,t,r,o),i=c(n?.apiKey);if(i)return i.length<=8?`${i.slice(0,2)}…`:`${i.slice(0,3)}...${i.slice(-4)}`}function T(e,t,r,o){return Se({webId:e.webId,provider:t,credentialIri:f.buildIri(e.podUrl,{id:r}),envelope:o})}function q(e){const t=R(e),r=v(t);return r||O.find(o=>t?.startsWith(`${o}-`))}function W(e){const t=R(e);if(t&&!t.startsWith("custom-instance-")){if(t==="bailian-token-plan-personal")return"token-plan";if(t==="bailian-token-plan-team")return"token-plan-team";if(t==="bailian-coding-plan-pro")return"coding-plan";if(t==="bailian-pay-as-you-go")return"pay-as-you-go";for(const r of O)if(t.startsWith(`${r}-`))return t.slice(r.length+1)}}function He(e){const t=/\/([^/#]+)\.ttl#/u.exec(e);return v(t?.[1])}function v(e){if(typeof e!="string"||!e.trim())return;const t=e.trim().toLowerCase();if(t==="zhipu"||t.startsWith("zhipu-"))return"zhipu";if(O.includes(t))return t;for(const r of O)if(t.startsWith(`${r}-`)||r==="bailian"&&(t==="bailian-token-plan"||t==="bailian-coding-plan"))return r}function F(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{throw new Error("invalid_proxy_url")}if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||!t.hostname)throw new Error("invalid_proxy_url");return t.toString().replace(/\/$/u,"")}function Je(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{return}if(!(!["http:","https:"].includes(t.protocol)||!t.hostname))return t.username="",t.password="",t.search="",t.hash="",t.toString().replace(/\/$/u,"")}function ue(e){if(e==="oauth"||e==="deviceCode"||e==="apiKey"||e==="local")return e;if(e==="deviceCodeOAuth")return"deviceCode"}function Xe(e){if(e==="healthy"||e==="expired"||e==="invalid"||e==="unknown")return e;if(e==="reauthRequired")return"expired";if(e==="disabled")return"unknown"}function I(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function c(e){return typeof e=="string"&&e.trim()?e:void 0}function ne(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function ie(e){if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function Qe(e){return e instanceof Date?e.toISOString():c(e)}function U(e){return e!==void 0}export{Re as a,_e as b,Q as c,rt as d,et as e,R as p,tt as w};
@@ -1 +1 @@
1
- import{c as t}from"./settings-BvqY7K96.js";const c=[["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"}]],o=t("activity",c);export{o as A};
1
+ import{c as t}from"./settings-DKknqu4C.js";const c=[["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"}]],o=t("activity",c);export{o as A};
@@ -1 +1 @@
1
- import{j as a,f as s,g as o,i as d}from"./settings-BvqY7K96.js";const n=o(`inline-flex items-center rounded-lg border px-2.5 py-0.5 text-xs font-semibold transition-all duration-200 ${d}`,{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-sm shadow-primary/20 hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-sm shadow-destructive/20 hover:bg-destructive/90",outline:"border-border/40 text-foreground bg-muted/30 backdrop-blur-sm"}},defaultVariants:{variant:"default"}});function u({className:r,variant:e,...t}){return a.jsx("div",{className:s(n({variant:e}),r),...t})}export{u as B};
1
+ import{j as a,f as s,g as o,i as d}from"./settings-DKknqu4C.js";const n=o(`inline-flex items-center rounded-lg border px-2.5 py-0.5 text-xs font-semibold transition-all duration-200 ${d}`,{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-sm shadow-primary/20 hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-sm shadow-destructive/20 hover:bg-destructive/90",outline:"border-border/40 text-foreground bg-muted/30 backdrop-blur-sm"}},defaultVariants:{variant:"default"}});function u({className:r,variant:e,...t}){return a.jsx("div",{className:s(n({variant:e}),r),...t})}export{u as B};
@@ -1 +1 @@
1
- import{h as u,k as b}from"./settings-BvqY7K96.js";import{c as p}from"./ModelsPage-DZpTlTZ3.js";import{s as L,d as x,o as P,n as R,c as _}from"./ai-connections-C6yaE6WQ.js";import{c as m,a as O,b as I}from"./XpodAiConnectionsPodStore-owBQc5nY.js";import{r as K}from"./layout-DB3pMyTl.js";import"./workspace-layout-B9H1Tqrk.js";import"./index-CkGda_Pg.js";import"./index-Vv-8Vslg.js";import"./dialog-B7ZRsjN7.js";import"./badge--r-FDIhU.js";import"./index-browser-Dq7omlpY.js";async function D(o){const a=o.capabilities.podCollections;if(a)try{return a.load?{collection:await a.load(u,{table:b})}:{collection:a.define(u,{table:b})}}catch{return}}function h(o){return o.includes("#")?K(u,{id:o}):o}async function M(o,a){await o.insert(a).isPersisted.promise}async function C(o,a,l){await o.update(a,d=>{Object.assign(d,l)}).isPersisted.promise}async function U(o,a){await o.delete(a).isPersisted.promise}function g(o,a){const{provider:l}=a,d=L(l,a.offeringId??x(l,a.authMode)),c=a.baseUrl??P(l,d),f=R(a.proxyUrl);return{id:o,service:"ai",provider:l==="custom"?O(o):I(l),authMode:a.authMode,status:"active",accountLabel:a.accountLabel,label:a.accountLabel,keyVersion:"1",reauthRequired:!1,encryptionAlgorithm:"PLAINTEXT",offeringId:d,...c?{baseUrl:c}:{},...f?{proxyUrl:f}:{},metadata:_({offeringId:d,baseUrl:c})}}function N(o,a){const{collection:l}=o,d=async r=>{await U(l,r).catch(()=>{})},c=(r,t)=>{const e=l.get(r);return e?p(e,t):void 0},f=async(r,t,e,n)=>{await M(l,e);try{const s=await n(b.buildId({id:t}))??c(t,r);if(!s)throw new Error("credential_create_failed");return s}catch(i){throw await d(t),i}};return{async createApiKeyCredential(r,t){if(!a.createApiKeyCredential)throw new Error("credential_store_unavailable");const e=m(r,"apiKey"),n=t.label??r;return await f(r,e,g(e,{provider:r,authMode:"apiKey",accountLabel:n,offeringId:t.offeringId,baseUrl:t.baseUrl,proxyUrl:t.proxyUrl}),i=>a.createApiKeyCredential(r,{...t,label:n,id:i}))},async createLocalCredential(r,t){if(!a.createLocalCredential)throw new Error("credential_store_unavailable");const e=m(r,"local"),n=t.label??"Local";return await f(r,e,g(e,{provider:r,authMode:"local",accountLabel:n,offeringId:t.offeringId,baseUrl:t.baseUrl}),i=>a.createLocalCredential(r,{...t,label:n,id:i}))},async updateProviderCredential(r,t,e){const n=h(t);if(!n)throw new Error("credential_not_found");const i={...e.label===void 0?{}:{label:e.label,accountLabel:e.label},...e.enabled===void 0?{}:{status:e.enabled?"active":"disabled"}},s=l.get(n);Object.keys(i).length>0&&await C(l,n,i);const y={...e.priority===void 0?{}:{priority:e.priority},...e.baseUrl===void 0?{}:{baseUrl:e.baseUrl},...e.proxyUrl===void 0?{}:{proxyUrl:e.proxyUrl}};if(Object.keys(y).length===0)return c(n,r);if(!a.updateProviderCredential)throw new Error("credential_store_unavailable");try{return await a.updateProviderCredential(r,t,{expectedVersion:e.expectedVersion,...y})??c(n,r)}catch(w){throw s&&Object.keys(i).length>0&&await C(l,n,{...i.label===void 0?{}:{label:s.label,accountLabel:s.accountLabel},...i.status===void 0?{}:{status:s.status}}).catch(()=>{}),w}},async deleteProviderCredential(r,t){const e=h(t);if(!e)return;const n=c(e,r);return await U(l,e),n}}}export{N as collectionCredentialMutations,h as credentialRowKey,D as openCredentialCollection};
1
+ import{h as u,k as b}from"./settings-DKknqu4C.js";import{c as p}from"./ModelsPage-CvTCKy1T.js";import{s as L,d as x,o as P,n as R,c as _}from"./ai-connections-C6yaE6WQ.js";import{c as m,a as O,b as I}from"./XpodAiConnectionsPodStore-CLr38P_Z.js";import{r as K}from"./layout-DB3pMyTl.js";import"./workspace-layout-UN6c4qTG.js";import"./index-ComidxAm.js";import"./index-CKGbRFlc.js";import"./dialog-CyuR7Va4.js";import"./badge-D8eIyxKt.js";import"./index-browser-CAscEbae.js";async function D(o){const a=o.capabilities.podCollections;if(a)try{return a.load?{collection:await a.load(u,{table:b})}:{collection:a.define(u,{table:b})}}catch{return}}function h(o){return o.includes("#")?K(u,{id:o}):o}async function M(o,a){await o.insert(a).isPersisted.promise}async function C(o,a,l){await o.update(a,d=>{Object.assign(d,l)}).isPersisted.promise}async function U(o,a){await o.delete(a).isPersisted.promise}function g(o,a){const{provider:l}=a,d=L(l,a.offeringId??x(l,a.authMode)),c=a.baseUrl??P(l,d),f=R(a.proxyUrl);return{id:o,service:"ai",provider:l==="custom"?O(o):I(l),authMode:a.authMode,status:"active",accountLabel:a.accountLabel,label:a.accountLabel,keyVersion:"1",reauthRequired:!1,encryptionAlgorithm:"PLAINTEXT",offeringId:d,...c?{baseUrl:c}:{},...f?{proxyUrl:f}:{},metadata:_({offeringId:d,baseUrl:c})}}function N(o,a){const{collection:l}=o,d=async r=>{await U(l,r).catch(()=>{})},c=(r,t)=>{const e=l.get(r);return e?p(e,t):void 0},f=async(r,t,e,n)=>{await M(l,e);try{const s=await n(b.buildId({id:t}))??c(t,r);if(!s)throw new Error("credential_create_failed");return s}catch(i){throw await d(t),i}};return{async createApiKeyCredential(r,t){if(!a.createApiKeyCredential)throw new Error("credential_store_unavailable");const e=m(r,"apiKey"),n=t.label??r;return await f(r,e,g(e,{provider:r,authMode:"apiKey",accountLabel:n,offeringId:t.offeringId,baseUrl:t.baseUrl,proxyUrl:t.proxyUrl}),i=>a.createApiKeyCredential(r,{...t,label:n,id:i}))},async createLocalCredential(r,t){if(!a.createLocalCredential)throw new Error("credential_store_unavailable");const e=m(r,"local"),n=t.label??"Local";return await f(r,e,g(e,{provider:r,authMode:"local",accountLabel:n,offeringId:t.offeringId,baseUrl:t.baseUrl}),i=>a.createLocalCredential(r,{...t,label:n,id:i}))},async updateProviderCredential(r,t,e){const n=h(t);if(!n)throw new Error("credential_not_found");const i={...e.label===void 0?{}:{label:e.label,accountLabel:e.label},...e.enabled===void 0?{}:{status:e.enabled?"active":"disabled"}},s=l.get(n);Object.keys(i).length>0&&await C(l,n,i);const y={...e.priority===void 0?{}:{priority:e.priority},...e.baseUrl===void 0?{}:{baseUrl:e.baseUrl},...e.proxyUrl===void 0?{}:{proxyUrl:e.proxyUrl}};if(Object.keys(y).length===0)return c(n,r);if(!a.updateProviderCredential)throw new Error("credential_store_unavailable");try{return await a.updateProviderCredential(r,t,{expectedVersion:e.expectedVersion,...y})??c(n,r)}catch(w){throw s&&Object.keys(i).length>0&&await C(l,n,{...i.label===void 0?{}:{label:s.label,accountLabel:s.accountLabel},...i.status===void 0?{}:{status:s.status}}).catch(()=>{}),w}},async deleteProviderCredential(r,t){const e=h(t);if(!e)return;const n=c(e,r);return await U(l,e),n}}}export{N as collectionCredentialMutations,h as credentialRowKey,D as openCredentialCollection};
@@ -1 +1 @@
1
- import{j as n,r as i,P as x,l as b,m as _,n as z,o as G,X as H,f as g,i as K}from"./settings-BvqY7K96.js";import{P as R,a as U,c as p,h as V,u as X,R as Y,b as Z,F as q,D as B,d as J,e as C}from"./index-CkGda_Pg.js";var Q=Object.defineProperty,d=(s,e)=>Q(s,"name",{value:e,configurable:!0}),y="Dialog",[O,_e]=z(y),[W,f]=O(y),ee=d(s=>{const{__scopeDialog:e,children:o,open:r,defaultOpen:l,onOpenChange:a,modal:t=!0}=s,c=i.useRef(null),u=i.useRef(null),[P,v]=J({prop:r,defaultProp:l??!1,onChange:a,caller:y}),[A,S]=i.useState(0),[k,L]=i.useState(0);return n.jsx(W,{scope:e,triggerRef:c,contentRef:u,contentId:C(),titleId:C(),descriptionId:C(),titlePresent:A>0,descriptionPresent:k>0,setTitleCount:S,setDescriptionCount:L,open:P,onOpenChange:v,onOpenToggle:i.useCallback(()=>v($=>!$),[v]),modal:t,children:o})},"Dialog"),te="DialogTrigger",oe=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(te,r),t=_(o,a.triggerRef);return n.jsx(x.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":m(a.open),...l,ref:t,onClick:p(e.onClick,a.onOpenToggle)})},"DialogTrigger")),j="DialogPortal",[ae,N]=O(j,{forceMount:void 0}),ne=d(s=>{const{__scopeDialog:e,forceMount:o,children:r,container:l}=s,a=f(j,e);return n.jsx(ae,{scope:e,forceMount:o,children:i.Children.map(r,t=>n.jsx(R,{present:o||a.open,children:n.jsx(U,{asChild:!0,container:l,children:t})}))})},"DialogPortal"),h="DialogOverlay",w=i.forwardRef(d(function(e,o){const r=N(h,e.__scopeDialog),{forceMount:l=r.forceMount,...a}=e,t=f(h,e.__scopeDialog);return t.modal?n.jsx(R,{present:l||t.open,children:n.jsx(re,{...a,ref:o})}):null},"DialogOverlay")),se=G("DialogOverlay.RemoveScroll"),re=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(h,r),t=X(),c=_(o,t);return n.jsx(Y,{as:se,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(x.div,{"data-state":m(a.open),...l,ref:c,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),D="DialogContent",E=i.forwardRef(d(function(e,o){const r=N(D,e.__scopeDialog),{forceMount:l=r.forceMount,...a}=e,t=f(D,e.__scopeDialog);return n.jsx(R,{present:l||t.open,children:t.modal?n.jsx(le,{...a,ref:o}):n.jsx(ie,{...a,ref:o})})},"DialogContent")),le=i.forwardRef(d(function(e,o){const r=f(D,e.__scopeDialog),l=i.useRef(null),a=_(o,r.contentRef,l);return i.useEffect(()=>{const t=l.current;if(t)return V(t)},[]),n.jsx(I,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:p(e.onCloseAutoFocus,t=>{t.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,t=>{const c=t.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&t.preventDefault()}),onFocusOutside:p(e.onFocusOutside,t=>t.preventDefault())})},"DialogContentModal")),ie=i.forwardRef(d(function(e,o){const r=f(D,e.__scopeDialog),l=i.useRef(!1),a=i.useRef(!1);return n.jsx(I,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(l.current||r.triggerRef.current?.focus(),t.preventDefault()),l.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(l.current=!0,t.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=t.target;r.triggerRef.current?.contains(c)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),I=i.forwardRef(d(function(e,o){const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:a,onCloseAutoFocus:t,...c}=e,u=f(D,r);return Z(),n.jsx(n.Fragment,{children:n.jsx(q,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:a,onUnmountAutoFocus:t,children:n.jsx(B,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":m(u.open),...c,ref:o,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),ce="DialogTitle",T=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(ce,r),{setTitleCount:t}=a;return b(()=>(t(c=>c+1),()=>t(c=>c-1)),[t]),n.jsx(x.h2,{id:a.titleId,...l,ref:o})},"DialogTitle")),de="DialogDescription",M=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(de,r),{setDescriptionCount:t}=a;return b(()=>(t(c=>c+1),()=>t(c=>c-1)),[t]),n.jsx(x.p,{id:a.descriptionId,...l,ref:o})},"DialogDescription")),ue="DialogClose",fe=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(ue,r);return n.jsx(x.button,{type:"button",...l,ref:o,onClick:p(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function m(s){return s?"open":"closed"}d(m,"getState");const Re=ee,ye=oe,ge=ne,F=i.forwardRef(({className:s,...e},o)=>n.jsx(w,{ref:o,className:g("fixed inset-0 z-50 bg-black/40","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));F.displayName=w.displayName;const pe=i.forwardRef(({className:s,children:e,variant:o="center",...r},l)=>n.jsxs(ge,{children:[n.jsx(F,{}),n.jsxs(E,{ref:l,className:g(o==="sheet-left"?"fixed inset-y-0 left-0 z-50 flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":o==="sheet-right"?"fixed inset-y-0 right-0 z-50 flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",s),...r,children:[e,n.jsxs(fe,{className:g("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",K),children:[n.jsx(H,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=E.displayName;const De=({className:s,...e})=>n.jsx("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",s),...e});De.displayName="DialogHeader";const xe=({className:s,...e})=>n.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...e});xe.displayName="DialogFooter";const me=i.forwardRef(({className:s,...e},o)=>n.jsx(T,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",s),...e}));me.displayName=T.displayName;const ve=i.forwardRef(({className:s,...e},o)=>n.jsx(M,{ref:o,className:g("text-sm text-muted-foreground",s),...e}));ve.displayName=M.displayName;export{Re as D,pe as a,De as b,me as c,ve as d,xe as e,ye as f};
1
+ import{j as n,r as i,P as x,l as b,m as _,n as z,o as G,X as H,f as g,i as K}from"./settings-DKknqu4C.js";import{P as R,a as U,c as p,h as V,u as X,R as Y,b as Z,F as q,D as B,d as J,e as C}from"./index-ComidxAm.js";var Q=Object.defineProperty,d=(s,e)=>Q(s,"name",{value:e,configurable:!0}),y="Dialog",[O,_e]=z(y),[W,f]=O(y),ee=d(s=>{const{__scopeDialog:e,children:o,open:r,defaultOpen:l,onOpenChange:a,modal:t=!0}=s,c=i.useRef(null),u=i.useRef(null),[P,v]=J({prop:r,defaultProp:l??!1,onChange:a,caller:y}),[A,S]=i.useState(0),[k,L]=i.useState(0);return n.jsx(W,{scope:e,triggerRef:c,contentRef:u,contentId:C(),titleId:C(),descriptionId:C(),titlePresent:A>0,descriptionPresent:k>0,setTitleCount:S,setDescriptionCount:L,open:P,onOpenChange:v,onOpenToggle:i.useCallback(()=>v($=>!$),[v]),modal:t,children:o})},"Dialog"),te="DialogTrigger",oe=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(te,r),t=_(o,a.triggerRef);return n.jsx(x.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":m(a.open),...l,ref:t,onClick:p(e.onClick,a.onOpenToggle)})},"DialogTrigger")),j="DialogPortal",[ae,N]=O(j,{forceMount:void 0}),ne=d(s=>{const{__scopeDialog:e,forceMount:o,children:r,container:l}=s,a=f(j,e);return n.jsx(ae,{scope:e,forceMount:o,children:i.Children.map(r,t=>n.jsx(R,{present:o||a.open,children:n.jsx(U,{asChild:!0,container:l,children:t})}))})},"DialogPortal"),h="DialogOverlay",w=i.forwardRef(d(function(e,o){const r=N(h,e.__scopeDialog),{forceMount:l=r.forceMount,...a}=e,t=f(h,e.__scopeDialog);return t.modal?n.jsx(R,{present:l||t.open,children:n.jsx(re,{...a,ref:o})}):null},"DialogOverlay")),se=G("DialogOverlay.RemoveScroll"),re=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(h,r),t=X(),c=_(o,t);return n.jsx(Y,{as:se,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(x.div,{"data-state":m(a.open),...l,ref:c,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),D="DialogContent",E=i.forwardRef(d(function(e,o){const r=N(D,e.__scopeDialog),{forceMount:l=r.forceMount,...a}=e,t=f(D,e.__scopeDialog);return n.jsx(R,{present:l||t.open,children:t.modal?n.jsx(le,{...a,ref:o}):n.jsx(ie,{...a,ref:o})})},"DialogContent")),le=i.forwardRef(d(function(e,o){const r=f(D,e.__scopeDialog),l=i.useRef(null),a=_(o,r.contentRef,l);return i.useEffect(()=>{const t=l.current;if(t)return V(t)},[]),n.jsx(I,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:p(e.onCloseAutoFocus,t=>{t.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,t=>{const c=t.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&t.preventDefault()}),onFocusOutside:p(e.onFocusOutside,t=>t.preventDefault())})},"DialogContentModal")),ie=i.forwardRef(d(function(e,o){const r=f(D,e.__scopeDialog),l=i.useRef(!1),a=i.useRef(!1);return n.jsx(I,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(l.current||r.triggerRef.current?.focus(),t.preventDefault()),l.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(l.current=!0,t.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=t.target;r.triggerRef.current?.contains(c)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&a.current&&t.preventDefault()}})},"DialogContentNonModal")),I=i.forwardRef(d(function(e,o){const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:a,onCloseAutoFocus:t,...c}=e,u=f(D,r);return Z(),n.jsx(n.Fragment,{children:n.jsx(q,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:a,onUnmountAutoFocus:t,children:n.jsx(B,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":m(u.open),...c,ref:o,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),ce="DialogTitle",T=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(ce,r),{setTitleCount:t}=a;return b(()=>(t(c=>c+1),()=>t(c=>c-1)),[t]),n.jsx(x.h2,{id:a.titleId,...l,ref:o})},"DialogTitle")),de="DialogDescription",M=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(de,r),{setDescriptionCount:t}=a;return b(()=>(t(c=>c+1),()=>t(c=>c-1)),[t]),n.jsx(x.p,{id:a.descriptionId,...l,ref:o})},"DialogDescription")),ue="DialogClose",fe=i.forwardRef(d(function(e,o){const{__scopeDialog:r,...l}=e,a=f(ue,r);return n.jsx(x.button,{type:"button",...l,ref:o,onClick:p(e.onClick,()=>a.onOpenChange(!1))})},"DialogClose"));function m(s){return s?"open":"closed"}d(m,"getState");const Re=ee,ye=oe,ge=ne,F=i.forwardRef(({className:s,...e},o)=>n.jsx(w,{ref:o,className:g("fixed inset-0 z-50 bg-black/40","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));F.displayName=w.displayName;const pe=i.forwardRef(({className:s,children:e,variant:o="center",...r},l)=>n.jsxs(ge,{children:[n.jsx(F,{}),n.jsxs(E,{ref:l,className:g(o==="sheet-left"?"fixed inset-y-0 left-0 z-50 flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":o==="sheet-right"?"fixed inset-y-0 right-0 z-50 flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",s),...r,children:[e,n.jsxs(fe,{className:g("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",K),children:[n.jsx(H,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=E.displayName;const De=({className:s,...e})=>n.jsx("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",s),...e});De.displayName="DialogHeader";const xe=({className:s,...e})=>n.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...e});xe.displayName="DialogFooter";const me=i.forwardRef(({className:s,...e},o)=>n.jsx(T,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",s),...e}));me.displayName=T.displayName;const ve=i.forwardRef(({className:s,...e},o)=>n.jsx(M,{ref:o,className:g("text-sm text-muted-foreground",s),...e}));ve.displayName=M.displayName;export{Re as D,pe as a,De as b,me as c,ve as d,xe as e,ye as f};
@@ -1 +1 @@
1
- import{c as o}from"./settings-BvqY7K96.js";const a=[["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"}]],e=o("download",a);export{e as D};
1
+ import{c as o}from"./settings-DKknqu4C.js";const a=[["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"}]],e=o("download",a);export{e as D};
@@ -1 +1 @@
1
- import{c as a}from"./settings-BvqY7K96.js";const e=[["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"}]],n=a("external-link",e);export{n as E};
1
+ import{c as a}from"./settings-DKknqu4C.js";const e=[["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"}]],n=a("external-link",e);export{n as E};
@@ -1 +1 @@
1
- import{r as P,l as ct,V as ye,n as ve,m as Yt,W as be,j as Q,P as Pt}from"./settings-BvqY7K96.js";var Ae=Object.defineProperty,Re=(t,e)=>Ae(t,"name",{value:e,configurable:!0});function qt(t){const[e,n]=P.useState(void 0);return ct(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,a=Array.isArray(l)?l[0]:l;i=a.inlineSize,c=a.blockSize}else i=t.offsetWidth,c=t.offsetHeight;n({width:i,height:c})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}Re(qt,"useSize");const Oe=["top","right","bottom","left"],q=Math.min,B=Math.max,at=Math.round,st=Math.floor,j=t=>({x:t,y:t}),Pe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ut(t,e,n){return B(t,q(e,n))}function I(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function St(t){return t==="y"?"height":"width"}function z(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Et(t){return Ct(z(t))}function Ce(t,e,n){n===void 0&&(n=!1);const o=et(t),r=Et(t),s=St(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ft(i)),[i,ft(i)]}function Se(t){const e=ft(t);return[Rt(t),e,Rt(e)]}function Rt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ft=["left","right"],Ht=["right","left"],Ee=["top","bottom"],Le=["bottom","top"];function De(t,e,n){switch(t){case"top":case"bottom":return n?e?Ht:Ft:e?Ft:Ht;case"left":case"right":return e?Ee:Le;default:return[]}}function Te(t,e,n,o){const r=et(t);let s=De(U(t),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),e&&(s=s.concat(s.map(Rt)))),s}function ft(t){const e=U(t);return Pe[e]+t.slice(e.length)}function $e(t){var e,n,o,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(r=t.left)!=null?r:0}}function Kt(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function ut(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function kt(t,e,n){let{reference:o,floating:r}=t;const s=z(e),i=Et(e),c=St(i),l=U(e),a=s==="y",d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}const p=et(e);return p&&(f[i]+=m*(p==="end"?1:-1)*(n&&a?-1:1)),f}async function _e(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=I(e,t),p=Kt(f),w=c[m?u==="floating"?"reference":"floating":u],g=ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(b))&&await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1},A=ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:l}):x);return{top:(g.top-A.top+p.top)/v.y,bottom:(A.bottom-g.bottom+p.bottom)/v.y,left:(g.left-A.left+p.left)/v.x,right:(A.right-g.right+p.right)/v.x}}const Me=50,We=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:_e},l=await(i.isRTL==null?void 0:i.isRTL(e));let a=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:u}=kt(a,o,l),m=o,f=0;const p={};for(let h=0;h<s.length;h++){const w=s[h];if(!w)continue;const{name:g,fn:x}=w,{x:b,y:v,data:A,reset:y}=await x({x:d,y:u,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:a,platform:c,elements:{reference:t,floating:e}});d=b??d,u=v??u,p[g]={...p[g],...A},y&&f<Me&&(f++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(a=y.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):y.rects),{x:d,y:u}=kt(a,m,l)),h=-1)}return{x:d,y:u,placement:m,strategy:r,middlewareData:p}},Fe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=e,{element:a,padding:d=0}=I(t,e)||{};if(a==null)return{};const u=Kt(d),m={x:n,y:o},f=Et(r),p=St(f),h=await i.getDimensions(a),w=f==="y",g=w?"top":"left",x=w?"bottom":"right",b=w?"clientHeight":"clientWidth",v=s.reference[p]+s.reference[f]-m[f]-s.floating[p],A=m[f]-s.reference[f],y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let O=y?y[b]:0;(!O||!await(i.isElement==null?void 0:i.isElement(y)))&&(O=c.floating[b]||s.floating[p]);const S=v/2-A/2,$=O/2-h[p]/2-1,C=q(u[g],$),H=q(u[x],$),k=O-h[p]-H,T=O/2-h[p]/2+S,E=Ut(C,T,k),W=!l.arrow&&et(r)!=null&&T!==E&&s.reference[p]/2-(T<C?C:H)-h[p]/2<0,L=W?T<C?T-C:T-k:0;return{[f]:m[f]+L,data:{[f]:E,centerOffset:T-E-L,...W&&{alignmentOffset:L}},reset:W}}}),He=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...w}=I(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=U(r),x=z(c),b=U(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(a.floating)),A=m||(b||!h?[ft(c)]:Se(c)),y=p!=="none";!m&&y&&A.push(...Te(c,h,p,v));const O=[c,...A],S=await l.detectOverflow(e,w),$=[];let C=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&$.push(S[g]),u){const E=Ce(r,i,v);$.push(S[E[0]],S[E[1]])}if(C=[...C,{placement:r,overflows:$}],!$.every(E=>E<=0)){var H,k;const E=(((H=s.flip)==null?void 0:H.index)||0)+1,W=O[E];if(W&&(!(u==="alignment"?x!==z(W):!1)||C.every(R=>z(R.placement)===x?R.overflows[0]>0:!0)))return{data:{index:E,overflows:C},reset:{placement:W}};let L=(k=C.filter(_=>_.overflows[0]<=0).sort((_,R)=>_.overflows[1]-R.overflows[1])[0])==null?void 0:k.placement;if(!L)switch(f){case"bestFit":{var T;const _=(T=C.filter(R=>{if(y){const D=z(R.placement);return D===x||D==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((R,D)=>R[1]-D[1])[0])==null?void 0:T[0];_&&(L=_);break}case"initialPlacement":L=c;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function zt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Nt(t){return Oe.some(e=>t[e]>=0)}const ke=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...s}=I(t,e);switch(r){case"referenceHidden":{const i=await o.detectOverflow(e,{...s,elementContext:"reference"}),c=zt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Nt(c)}}}case"escaped":{const i=await o.detectOverflow(e,{...s,altBoundary:!0}),c=zt(i,n.floating);return{data:{escapedOffsets:c,escaped:Nt(c)}}}default:return{}}}}},Zt=new Set(["left","top"]);async function ze(t,e){const{placement:n,platform:o,elements:r}=t,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=U(n),c=et(n),l=z(n)==="y",a=Zt.has(i)?-1:1,d=s&&l?-1:1,u=I(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof p=="number"&&(f=c==="end"?p*-1:p),l?{x:f*d,y:m*a}:{x:m*a,y:f*d}}const Ne=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=e,l=await ze(e,t);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},Ve=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:b,y:v}=x;return{x:b,y:v}}},...a}=I(t,e),d={x:n,y:o},u=await s.detectOverflow(e,a),m=z(r),f=Ct(m);let p=d[f],h=d[m];const w=(x,b)=>Ut(b+u[x==="y"?"top":"left"],b,b-u[x==="y"?"bottom":"right"]);i&&(p=w(f,p)),c&&(h=w(m,h));const g=l.fn({...e,[f]:p,[m]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[f]:i,[m]:c}}}}}},Be=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,o;const{x:r,y:s,placement:i,rects:c,middlewareData:l}=e,{offset:a=0,mainAxis:d=!0,crossAxis:u=!0}=I(t,e),m={x:r,y:s},f=z(i),p=Ct(f);let h=m[p],w=m[f];const g=I(a,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(d){const A=p==="y"?"height":"width",y=c.reference[p]-c.floating[A]+x.mainAxis,O=c.reference[p]+c.reference[A]-x.mainAxis;h<y?h=y:h>O&&(h=O)}if(u){var b,v;const A=p==="y"?"width":"height",y=Zt.has(U(i)),O=c.reference[f]-c.floating[A]+(y&&((b=l.offset)==null?void 0:b[f])||0)+(y?0:x.crossAxis),S=c.reference[f]+c.reference[A]+(y?0:((v=l.offset)==null?void 0:v[f])||0)-(y?x.crossAxis:0);w<O?w=O:w>S&&(w=S)}return{[p]:h,[f]:w}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:r,elements:s}=e,{apply:i=()=>{},...c}=I(t,e),l=await r.detectOverflow(e,c),a=U(n),d=et(n),u=z(n)==="y",{width:m,height:f}=o.floating;let p,h;a==="top"||a==="bottom"?(p=a,h=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(h=a,p=d==="end"?"top":"bottom");const w=f-l.top-l.bottom,g=m-l.left-l.right,x=q(f-l[p],w),b=q(m-l[h],g),v=e.middlewareData.shift,A=!v;let y=x,O=b;v!=null&&v.enabled.x&&(O=g),v!=null&&v.enabled.y&&(y=w),A&&!d&&(u?O=m-2*B(l.left,l.right):y=f-2*B(l.top,l.bottom)),await i({...e,availableWidth:O,availableHeight:y});const S=await r.getDimensions(s.floating);return m!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}};function pt(){return typeof window<"u"}function nt(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function X(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return pt()?t instanceof Node||t instanceof M(t).Node:!1}function N(t){return pt()?t instanceof Element||t instanceof M(t).Element:!1}function K(t){return pt()?t instanceof HTMLElement||t instanceof M(t).HTMLElement:!1}function Vt(t){return!pt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof M(t).ShadowRoot}function mt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&r!=="inline"&&r!=="contents"}function Ie(t){return/^(table|td|th)$/.test(nt(t))}function ht(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Xe=/transform|translate|scale|rotate|perspective|filter/,Ye=/paint|layout|strict|content/,Z=t=>!!t&&t!=="none";let vt;function Lt(t){const e=N(t)?V(t):t;return Z(e.transform)||Z(e.translate)||Z(e.scale)||Z(e.rotate)||Z(e.perspective)||!Dt()&&(Z(e.backdropFilter)||Z(e.filter))||Xe.test(e.willChange||"")||Ye.test(e.contain||"")}function qe(t){let e=G(t);for(;K(e)&&!ot(e);){if(Lt(e))return e;if(ht(e))return null;e=G(e)}return null}function Dt(){return vt==null&&(vt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vt}function ot(t){return/^(html|body|#document)$/.test(nt(t))}function V(t){return M(t).getComputedStyle(t)}function gt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Vt(t)&&t.host||X(t);return Vt(e)?e.host:e}function Jt(t){const e=G(t);return ot(e)?(t.ownerDocument||t).body:K(e)&&mt(e)?e:Jt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),s=r===((o=t.ownerDocument)==null?void 0:o.body),i=M(r);if(s){const c=Ot(i);return e.concat(i,i.visualViewport||[],mt(r)?r:[],c&&n?rt(c):[])}else return e.concat(r,rt(r,[],n))}function Ot(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=K(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:o,c=at(n)!==s||at(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Tt(t){return N(t)?t:t.contextElement}function tt(t){const e=Tt(t);if(!K(e))return j(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:s}=Qt(e);let i=(s?at(n.width):n.width)/o,c=(s?at(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ue=j(0);function te(t){const e=M(t);return!Dt()||!e.visualViewport?Ue:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ke(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===M(t)}function J(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Tt(t);let i=j(1);e&&(o?N(o)&&(i=tt(o)):i=tt(t));const c=Ke(s,n,o)?te(s):j(0);let l=(r.left+c.x)/i.x,a=(r.top+c.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(s&&o){const m=M(s),f=N(o)?M(o):o;let p=m,h=Ot(p);for(;h&&f!==p;){const w=tt(h),g=h.getBoundingClientRect(),x=V(h),b=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*w.x,v=g.top+(h.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,a*=w.y,d*=w.x,u*=w.y,l+=b,a+=v,p=M(h),h=Ot(p)}}return ut({width:d,height:u,x:l,y:a})}function wt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:J(X(t)).left+n}function ee(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Ze(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const s=r==="fixed",i=X(o),c=e?ht(e.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=j(1);const d=j(0),u=K(o);if((u||!s)&&((nt(o)!=="body"||mt(i))&&(l=gt(o)),u)){const f=J(o);a=tt(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}const m=i&&!u&&!s?ee(i,l):j(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+m.x,y:n.y*a.y-l.scrollTop*a.y+d.y+m.y}}function Ge(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Je(t){const e=gt(t),n=t.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=B(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+wt(t);const i=-e.scrollTop;return V(n).direction==="rtl"&&(s+=B(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Qe=25;function tn(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=M(t),s=X(t),i=r.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,d=0;if(i){const m=!Dt()||e==="fixed";o?m||(a=-i.offsetLeft,d=-i.offsetTop):(c=i.width,l=i.height,m&&(a=i.offsetLeft,d=i.offsetTop))}if(wt(s)<=0){const m=s.ownerDocument,f=m.body,p=getComputedStyle(f),h=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-h),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=Qe&&(c-=g)}return{width:c,height:l,x:a,y:d}}function en(t,e){const n=J(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,s=tt(t),i=t.clientWidth*s.x,c=t.clientHeight*s.y,l=r*s.x,a=o*s.y;return{width:i,height:c,x:l,y:a}}function Bt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=tn(t,n,e);else if(e==="document")o=Je(X(t));else if(N(e))o=en(e,n);else{const r=te(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ut(o)}function nn(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(c=>N(c)&&nt(c)!=="body"),r=null;const s=V(t).position==="fixed";let i=s?G(t):t;for(;N(i)&&!ot(i);){const c=V(i),l=Lt(i),a=r?r.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(u=>u!==i):r=c,i=G(i)}return e.set(t,o),o}function on(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[...n==="clippingAncestors"?ht(e)?[]:nn(e,this._c):[].concat(n),o],c=Bt(e,i[0],r);let l=c.top,a=c.right,d=c.bottom,u=c.left;for(let m=1;m<i.length;m++){const f=Bt(e,i[m],r);l=B(f.top,l),a=q(f.right,a),d=q(f.bottom,d),u=B(f.left,u)}return{width:a-u,height:d-l,x:u,y:l}}function rn(t){const{width:e,height:n}=Qt(t);return{width:e,height:n}}function sn(t,e,n){const o=K(e),r=X(e),s=n==="fixed",i=J(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=j(0);if((o||!s)&&((nt(e)!=="body"||mt(r))&&(c=gt(e)),o)){const m=J(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}!o&&r&&(l.x=wt(r));const a=r&&!o&&!s?ee(r,c):j(0),d=i.left+c.scrollLeft-l.x-a.x,u=i.top+c.scrollTop-l.y-a.y;return{x:d,y:u,width:i.width,height:i.height}}function bt(t){return V(t).position==="static"}function jt(t,e){if(!K(t)||V(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){const n=M(t);if(ht(t))return n;if(!K(t)){let r=G(t);for(;r&&!ot(r);){if(N(r)&&!bt(r))return r;r=G(r)}return n}let o=jt(t,e);for(;o&&Ie(o)&&bt(o);)o=jt(o,e);return o&&ot(o)&&bt(o)&&!Lt(o)?n:o||qe(t)||n}const cn=async function(t){const e=this.getOffsetParent||ne,n=this.getDimensions,o=await n(t.floating);return{reference:sn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ln(t){return V(t).direction==="rtl"}const an={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:X,getClippingRect:on,getOffsetParent:ne,getElementRects:cn,getClientRects:Ge,getDimensions:rn,getScale:tt,isElement:N,isRTL:ln};function oe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fn(t,e,n){let o=null,r;const s=X(t);function i(){var d;clearTimeout(r),(d=o)==null||d.disconnect(),o=null}function c(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),i();const m=t.getBoundingClientRect(),{left:f,top:p,width:h,height:w}=m;if(d||e(),!h||!w)return;const g=st(p),x=st(s.clientWidth-(f+h)),b=st(s.clientHeight-(p+w)),v=st(f),y={rootMargin:-g+"px "+-x+"px "+-b+"px "+-v+"px",threshold:B(0,q(1,u))||1};let O=!0;function S($){const C=$[0].intersectionRatio;if(!oe(m,t.getBoundingClientRect()))return c();if(C!==u){if(!O)return c();C?c(!1,C):r=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{o=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,y)}o.observe(t)}const l=M(t),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),i()}}function un(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Tt(t),d=r||s?[...a?rt(a):[],...e?rt(e):[]]:[];d.forEach(g=>{r&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const u=a&&c?fn(a,n,s):null;let m=-1,f=null;i&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.target===a&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(e)})),n()}),a&&!l&&f.observe(a),e&&f.observe(e));let p,h=l?J(t):null;l&&w();function w(){const g=J(t);h&&!oe(h,g)&&n(),h=g,p=requestAnimationFrame(w)}return n(),()=>{var g;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const dn=Ne,pn=Ve,mn=He,hn=je,gn=ke,It=Fe,wn=Be,xn=(t,e,n)=>{const o=new Map,r=n??{},s={...an,...r.platform,_c:o};return We(t,e,{...r,platform:s})};var yn=typeof document<"u",vn=function(){},lt=yn?P.useLayoutEffect:vn;function dt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!dt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&t.$$typeof)&&!dt(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function re(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(t,e){const n=re(t);return Math.round(e*n)/n}function At(t){const e=P.useRef(t);return lt(()=>{e.current=t}),e}function bn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=t,[d,u]=P.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,f]=P.useState(o);dt(m,o)||f(o);const[p,h]=P.useState(null),[w,g]=P.useState(null),x=P.useCallback(R=>{R!==y.current&&(y.current=R,h(R))},[]),b=P.useCallback(R=>{R!==O.current&&(O.current=R,g(R))},[]),v=s||p,A=i||w,y=P.useRef(null),O=P.useRef(null),S=P.useRef(d),$=l!=null,C=At(l),H=At(r),k=At(a),T=P.useCallback(()=>{if(!y.current||!O.current)return;const R={placement:e,strategy:n,middleware:m};H.current&&(R.platform=H.current),xn(y.current,O.current,R).then(D=>{const F={...D,isPositioned:k.current!==!1};E.current&&!dt(S.current,F)&&(S.current=F,ye.flushSync(()=>{u(F)}))})},[m,e,n,H,k]);lt(()=>{a===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(R=>({...R,isPositioned:!1})))},[a]);const E=P.useRef(!1);lt(()=>(E.current=!0,()=>{E.current=!1}),[]),lt(()=>{if(v&&(y.current=v),A&&(O.current=A),v&&A){if(C.current)return C.current(v,A,T);T()}},[v,A,T,C,$]);const W=P.useMemo(()=>({reference:y,floating:O,setReference:x,setFloating:b}),[x,b]),L=P.useMemo(()=>({reference:v,floating:A}),[v,A]),_=P.useMemo(()=>{const R={position:n,left:0,top:0};if(!L.floating)return R;const D=Xt(L.floating,d.x),F=Xt(L.floating,d.y);return c?{...R,transform:"translate("+D+"px, "+F+"px)",...re(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:F}},[n,c,L.floating,d.x,d.y]);return P.useMemo(()=>({...d,update:T,refs:W,elements:L,floatingStyles:_}),[d,T,W,L,_])}const An=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:r}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?It({element:o.current,padding:r}).fn(n):{}:o?It({element:o,padding:r}).fn(n):{}}}},Rn=(t,e)=>{const n=dn(t);return{name:n.name,fn:n.fn,options:[t,e]}},On=(t,e)=>{const n=pn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Pn=(t,e)=>({fn:wn(t).fn,options:[t,e]}),Cn=(t,e)=>{const n=mn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Sn=(t,e)=>{const n=hn(t);return{name:n.name,fn:n.fn,options:[t,e]}},En=(t,e)=>{const n=gn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Ln=(t,e)=>{const n=An(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Dn=Object.defineProperty,Y=(t,e)=>Dn(t,"name",{value:e,configurable:!0}),ie="Popper",[se,jn]=ve(ie),[Tn,ce]=se(ie),$n=Y(t=>{const{__scopePopper:e,children:n}=t,[o,r]=P.useState(null),[s,i]=P.useState(void 0);return Q.jsx(Tn,{scope:e,anchor:o,onAnchorChange:r,placementState:s,setPlacementState:i,children:n})},"Popper"),_n="PopperAnchor",Mn=P.forwardRef(Y(function(e,n){const{__scopePopper:o,virtualRef:r,...s}=e,i=ce(_n,o),c=P.useRef(null),l=i.onAnchorChange,a=P.useCallback(h=>{c.current=h,h&&l(h)},[l]),d=Yt(n,a),u=P.useRef(null);P.useEffect(()=>{if(!r)return;const h=u.current;u.current=r.current,h!==u.current&&l(u.current)});const m=i.placementState&&xt(i.placementState),f=m?.[0],p=m?.[1];return r?null:Q.jsx(Pt.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...s,ref:d})},"PopperAnchor")),le="PopperContent",[Wn,In]=se(le),Fn=P.forwardRef(Y(function(e,n){const{__scopePopper:o,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:a=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:h,...w}=e,g=ce(le,o),[x,b]=P.useState(null),v=Yt(n,b),[A,y]=P.useState(null),O=qt(A),S=O?.width??0,$=O?.height??0,C=r+(i!=="center"?"-"+i:""),H=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(d)?d:[d],T=k.length>0,E={padding:H,boundary:k.filter(ae),altBoundary:T},{refs:W,floatingStyles:L,placement:_,isPositioned:R,middlewareData:D}=bn({strategy:"fixed",placement:C,whileElementsMounted:Y((...yt)=>un(...yt,{animationFrame:p==="always"}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[Rn({mainAxis:s+$,alignmentAxis:c}),a&&On({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Pn():void 0,...E}),a&&Cn({...E}),Sn({...E,apply:Y(({elements:yt,rects:Wt,availableWidth:he,availableHeight:ge})=>{const{width:we,height:xe}=Wt.reference,it=yt.floating.style;it.setProperty("--radix-popper-available-width",`${he}px`),it.setProperty("--radix-popper-available-height",`${ge}px`),it.setProperty("--radix-popper-anchor-width",`${we}px`),it.setProperty("--radix-popper-anchor-height",`${xe}px`)},"apply")}),A&&Ln({element:A,padding:l}),Hn({arrowWidth:S,arrowHeight:$}),f&&En({strategy:"referenceHidden",...E,boundary:T?E.boundary:void 0})]}),F=g.setPlacementState;ct(()=>(F(_),()=>{F(void 0)}),[_,F]);const[$t,_t]=xt(_),Mt=be(h);ct(()=>{R&&Mt?.()},[R,Mt]);const fe=D.arrow?.x,ue=D.arrow?.y,de=D.arrow?.centerOffset!==0,[pe,me]=P.useState();return ct(()=>{x&&me(window.getComputedStyle(x).zIndex)},[x]),Q.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:R?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Q.jsx(Wn,{scope:o,placedSide:$t,placedAlign:_t,onArrowChange:y,arrowX:fe,arrowY:ue,shouldHideArrow:de,children:Q.jsx(Pt.div,{"data-side":$t,"data-align":_t,...w,ref:v,style:{...w.style,animation:R?w.style?.animation:"none"}})})})},"PopperContent"));function ae(t){return t!==null}Y(ae,"isNotNull");var Hn=Y(t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:r}=e,i=r.arrow?.centerOffset!==0,c=i?0:t.arrowWidth,l=i?0:t.arrowHeight,[a,d]=xt(n),u={start:"0%",center:"50%",end:"100%"}[d],m=(r.arrow?.x??0)+c/2,f=(r.arrow?.y??0)+l/2;let p="",h="";return a==="bottom"?(p=i?u:`${m}px`,h=`${-l}px`):a==="top"?(p=i?u:`${m}px`,h=`${o.floating.height+l}px`):a==="right"?(p=`${-l}px`,h=i?u:`${f}px`):a==="left"&&(p=`${o.floating.width+l}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function xt(t){const[e,n="center"]=t.split("-");return[e,n]}Y(xt,"getSideAndAlignFromPlacement");var Xn=$n,Yn=Mn,qn=Fn,kn=Object.defineProperty,zn=(t,e)=>kn(t,"name",{value:e,configurable:!0}),Nn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Vn=P.forwardRef(zn(function(e,n){return Q.jsx(Pt.span,{...e,ref:n,style:{...Nn,...e.style}})},"VisuallyHidden")),Un=Vn;export{Yn as A,qn as C,Xn as R,Nn as V,Un as a,jn as c};
1
+ import{r as P,l as ct,V as ye,n as ve,m as Yt,W as be,j as Q,P as Pt}from"./settings-DKknqu4C.js";var Ae=Object.defineProperty,Re=(t,e)=>Ae(t,"name",{value:e,configurable:!0});function qt(t){const[e,n]=P.useState(void 0);return ct(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,a=Array.isArray(l)?l[0]:l;i=a.inlineSize,c=a.blockSize}else i=t.offsetWidth,c=t.offsetHeight;n({width:i,height:c})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}Re(qt,"useSize");const Oe=["top","right","bottom","left"],q=Math.min,B=Math.max,at=Math.round,st=Math.floor,j=t=>({x:t,y:t}),Pe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ut(t,e,n){return B(t,q(e,n))}function I(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function St(t){return t==="y"?"height":"width"}function z(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Et(t){return Ct(z(t))}function Ce(t,e,n){n===void 0&&(n=!1);const o=et(t),r=Et(t),s=St(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=ft(i)),[i,ft(i)]}function Se(t){const e=ft(t);return[Rt(t),e,Rt(e)]}function Rt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ft=["left","right"],Ht=["right","left"],Ee=["top","bottom"],Le=["bottom","top"];function De(t,e,n){switch(t){case"top":case"bottom":return n?e?Ht:Ft:e?Ft:Ht;case"left":case"right":return e?Ee:Le;default:return[]}}function Te(t,e,n,o){const r=et(t);let s=De(U(t),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),e&&(s=s.concat(s.map(Rt)))),s}function ft(t){const e=U(t);return Pe[e]+t.slice(e.length)}function $e(t){var e,n,o,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(r=t.left)!=null?r:0}}function Kt(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function ut(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function kt(t,e,n){let{reference:o,floating:r}=t;const s=z(e),i=Et(e),c=St(i),l=U(e),a=s==="y",d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let f;switch(l){case"top":f={x:d,y:o.y-r.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-r.width,y:u};break;default:f={x:o.x,y:o.y}}const p=et(e);return p&&(f[i]+=m*(p==="end"?1:-1)*(n&&a?-1:1)),f}async function _e(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:f=0}=I(e,t),p=Kt(f),w=c[m?u==="floating"?"reference":"floating":u],g=ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(b))&&await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1},A=ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:b,strategy:l}):x);return{top:(g.top-A.top+p.top)/v.y,bottom:(A.bottom-g.bottom+p.bottom)/v.y,left:(g.left-A.left+p.left)/v.x,right:(A.right-g.right+p.right)/v.x}}const Me=50,We=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:_e},l=await(i.isRTL==null?void 0:i.isRTL(e));let a=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:u}=kt(a,o,l),m=o,f=0;const p={};for(let h=0;h<s.length;h++){const w=s[h];if(!w)continue;const{name:g,fn:x}=w,{x:b,y:v,data:A,reset:y}=await x({x:d,y:u,initialPlacement:o,placement:m,strategy:r,middlewareData:p,rects:a,platform:c,elements:{reference:t,floating:e}});d=b??d,u=v??u,p[g]={...p[g],...A},y&&f<Me&&(f++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(a=y.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):y.rects),{x:d,y:u}=kt(a,m,l)),h=-1)}return{x:d,y:u,placement:m,strategy:r,middlewareData:p}},Fe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=e,{element:a,padding:d=0}=I(t,e)||{};if(a==null)return{};const u=Kt(d),m={x:n,y:o},f=Et(r),p=St(f),h=await i.getDimensions(a),w=f==="y",g=w?"top":"left",x=w?"bottom":"right",b=w?"clientHeight":"clientWidth",v=s.reference[p]+s.reference[f]-m[f]-s.floating[p],A=m[f]-s.reference[f],y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let O=y?y[b]:0;(!O||!await(i.isElement==null?void 0:i.isElement(y)))&&(O=c.floating[b]||s.floating[p]);const S=v/2-A/2,$=O/2-h[p]/2-1,C=q(u[g],$),H=q(u[x],$),k=O-h[p]-H,T=O/2-h[p]/2+S,E=Ut(C,T,k),W=!l.arrow&&et(r)!=null&&T!==E&&s.reference[p]/2-(T<C?C:H)-h[p]/2<0,L=W?T<C?T-C:T-k:0;return{[f]:m[f]+L,data:{[f]:E,centerOffset:T-E-L,...W&&{alignmentOffset:L}},reset:W}}}),He=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...w}=I(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=U(r),x=z(c),b=U(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(a.floating)),A=m||(b||!h?[ft(c)]:Se(c)),y=p!=="none";!m&&y&&A.push(...Te(c,h,p,v));const O=[c,...A],S=await l.detectOverflow(e,w),$=[];let C=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&$.push(S[g]),u){const E=Ce(r,i,v);$.push(S[E[0]],S[E[1]])}if(C=[...C,{placement:r,overflows:$}],!$.every(E=>E<=0)){var H,k;const E=(((H=s.flip)==null?void 0:H.index)||0)+1,W=O[E];if(W&&(!(u==="alignment"?x!==z(W):!1)||C.every(R=>z(R.placement)===x?R.overflows[0]>0:!0)))return{data:{index:E,overflows:C},reset:{placement:W}};let L=(k=C.filter(_=>_.overflows[0]<=0).sort((_,R)=>_.overflows[1]-R.overflows[1])[0])==null?void 0:k.placement;if(!L)switch(f){case"bestFit":{var T;const _=(T=C.filter(R=>{if(y){const D=z(R.placement);return D===x||D==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((R,D)=>R[1]-D[1])[0])==null?void 0:T[0];_&&(L=_);break}case"initialPlacement":L=c;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function zt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Nt(t){return Oe.some(e=>t[e]>=0)}const ke=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:r="referenceHidden",...s}=I(t,e);switch(r){case"referenceHidden":{const i=await o.detectOverflow(e,{...s,elementContext:"reference"}),c=zt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Nt(c)}}}case"escaped":{const i=await o.detectOverflow(e,{...s,altBoundary:!0}),c=zt(i,n.floating);return{data:{escapedOffsets:c,escaped:Nt(c)}}}default:return{}}}}},Zt=new Set(["left","top"]);async function ze(t,e){const{placement:n,platform:o,elements:r}=t,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=U(n),c=et(n),l=z(n)==="y",a=Zt.has(i)?-1:1,d=s&&l?-1:1,u=I(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof p=="number"&&(f=c==="end"?p*-1:p),l?{x:f*d,y:m*a}:{x:m*a,y:f*d}}const Ne=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=e,l=await ze(e,t);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},Ve=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:b,y:v}=x;return{x:b,y:v}}},...a}=I(t,e),d={x:n,y:o},u=await s.detectOverflow(e,a),m=z(r),f=Ct(m);let p=d[f],h=d[m];const w=(x,b)=>Ut(b+u[x==="y"?"top":"left"],b,b-u[x==="y"?"bottom":"right"]);i&&(p=w(f,p)),c&&(h=w(m,h));const g=l.fn({...e,[f]:p,[m]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[f]:i,[m]:c}}}}}},Be=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,o;const{x:r,y:s,placement:i,rects:c,middlewareData:l}=e,{offset:a=0,mainAxis:d=!0,crossAxis:u=!0}=I(t,e),m={x:r,y:s},f=z(i),p=Ct(f);let h=m[p],w=m[f];const g=I(a,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:(n=g.mainAxis)!=null?n:0,crossAxis:(o=g.crossAxis)!=null?o:0};if(d){const A=p==="y"?"height":"width",y=c.reference[p]-c.floating[A]+x.mainAxis,O=c.reference[p]+c.reference[A]-x.mainAxis;h<y?h=y:h>O&&(h=O)}if(u){var b,v;const A=p==="y"?"width":"height",y=Zt.has(U(i)),O=c.reference[f]-c.floating[A]+(y&&((b=l.offset)==null?void 0:b[f])||0)+(y?0:x.crossAxis),S=c.reference[f]+c.reference[A]+(y?0:((v=l.offset)==null?void 0:v[f])||0)-(y?x.crossAxis:0);w<O?w=O:w>S&&(w=S)}return{[p]:h,[f]:w}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:r,elements:s}=e,{apply:i=()=>{},...c}=I(t,e),l=await r.detectOverflow(e,c),a=U(n),d=et(n),u=z(n)==="y",{width:m,height:f}=o.floating;let p,h;a==="top"||a==="bottom"?(p=a,h=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(h=a,p=d==="end"?"top":"bottom");const w=f-l.top-l.bottom,g=m-l.left-l.right,x=q(f-l[p],w),b=q(m-l[h],g),v=e.middlewareData.shift,A=!v;let y=x,O=b;v!=null&&v.enabled.x&&(O=g),v!=null&&v.enabled.y&&(y=w),A&&!d&&(u?O=m-2*B(l.left,l.right):y=f-2*B(l.top,l.bottom)),await i({...e,availableWidth:O,availableHeight:y});const S=await r.getDimensions(s.floating);return m!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}};function pt(){return typeof window<"u"}function nt(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function X(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return pt()?t instanceof Node||t instanceof M(t).Node:!1}function N(t){return pt()?t instanceof Element||t instanceof M(t).Element:!1}function K(t){return pt()?t instanceof HTMLElement||t instanceof M(t).HTMLElement:!1}function Vt(t){return!pt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof M(t).ShadowRoot}function mt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&r!=="inline"&&r!=="contents"}function Ie(t){return/^(table|td|th)$/.test(nt(t))}function ht(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Xe=/transform|translate|scale|rotate|perspective|filter/,Ye=/paint|layout|strict|content/,Z=t=>!!t&&t!=="none";let vt;function Lt(t){const e=N(t)?V(t):t;return Z(e.transform)||Z(e.translate)||Z(e.scale)||Z(e.rotate)||Z(e.perspective)||!Dt()&&(Z(e.backdropFilter)||Z(e.filter))||Xe.test(e.willChange||"")||Ye.test(e.contain||"")}function qe(t){let e=G(t);for(;K(e)&&!ot(e);){if(Lt(e))return e;if(ht(e))return null;e=G(e)}return null}function Dt(){return vt==null&&(vt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vt}function ot(t){return/^(html|body|#document)$/.test(nt(t))}function V(t){return M(t).getComputedStyle(t)}function gt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Vt(t)&&t.host||X(t);return Vt(e)?e.host:e}function Jt(t){const e=G(t);return ot(e)?(t.ownerDocument||t).body:K(e)&&mt(e)?e:Jt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),s=r===((o=t.ownerDocument)==null?void 0:o.body),i=M(r);if(s){const c=Ot(i);return e.concat(i,i.visualViewport||[],mt(r)?r:[],c&&n?rt(c):[])}else return e.concat(r,rt(r,[],n))}function Ot(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){const e=V(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=K(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:o,c=at(n)!==s||at(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Tt(t){return N(t)?t:t.contextElement}function tt(t){const e=Tt(t);if(!K(e))return j(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:s}=Qt(e);let i=(s?at(n.width):n.width)/o,c=(s?at(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ue=j(0);function te(t){const e=M(t);return!Dt()||!e.visualViewport?Ue:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ke(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===M(t)}function J(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Tt(t);let i=j(1);e&&(o?N(o)&&(i=tt(o)):i=tt(t));const c=Ke(s,n,o)?te(s):j(0);let l=(r.left+c.x)/i.x,a=(r.top+c.y)/i.y,d=r.width/i.x,u=r.height/i.y;if(s&&o){const m=M(s),f=N(o)?M(o):o;let p=m,h=Ot(p);for(;h&&f!==p;){const w=tt(h),g=h.getBoundingClientRect(),x=V(h),b=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*w.x,v=g.top+(h.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,a*=w.y,d*=w.x,u*=w.y,l+=b,a+=v,p=M(h),h=Ot(p)}}return ut({width:d,height:u,x:l,y:a})}function wt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:J(X(t)).left+n}function ee(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Ze(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const s=r==="fixed",i=X(o),c=e?ht(e.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=j(1);const d=j(0),u=K(o);if((u||!s)&&((nt(o)!=="body"||mt(i))&&(l=gt(o)),u)){const f=J(o);a=tt(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}const m=i&&!u&&!s?ee(i,l):j(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+m.x,y:n.y*a.y-l.scrollTop*a.y+d.y+m.y}}function Ge(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Je(t){const e=gt(t),n=t.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=B(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+wt(t);const i=-e.scrollTop;return V(n).direction==="rtl"&&(s+=B(t.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Qe=25;function tn(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=M(t),s=X(t),i=r.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,d=0;if(i){const m=!Dt()||e==="fixed";o?m||(a=-i.offsetLeft,d=-i.offsetTop):(c=i.width,l=i.height,m&&(a=i.offsetLeft,d=i.offsetTop))}if(wt(s)<=0){const m=s.ownerDocument,f=m.body,p=getComputedStyle(f),h=m.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(s.clientWidth-f.clientWidth-h),g=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;g<=Qe&&(c-=g)}return{width:c,height:l,x:a,y:d}}function en(t,e){const n=J(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,s=tt(t),i=t.clientWidth*s.x,c=t.clientHeight*s.y,l=r*s.x,a=o*s.y;return{width:i,height:c,x:l,y:a}}function Bt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=tn(t,n,e);else if(e==="document")o=Je(X(t));else if(N(e))o=en(e,n);else{const r=te(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ut(o)}function nn(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(c=>N(c)&&nt(c)!=="body"),r=null;const s=V(t).position==="fixed";let i=s?G(t):t;for(;N(i)&&!ot(i);){const c=V(i),l=Lt(i),a=r?r.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(u=>u!==i):r=c,i=G(i)}return e.set(t,o),o}function on(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[...n==="clippingAncestors"?ht(e)?[]:nn(e,this._c):[].concat(n),o],c=Bt(e,i[0],r);let l=c.top,a=c.right,d=c.bottom,u=c.left;for(let m=1;m<i.length;m++){const f=Bt(e,i[m],r);l=B(f.top,l),a=q(f.right,a),d=q(f.bottom,d),u=B(f.left,u)}return{width:a-u,height:d-l,x:u,y:l}}function rn(t){const{width:e,height:n}=Qt(t);return{width:e,height:n}}function sn(t,e,n){const o=K(e),r=X(e),s=n==="fixed",i=J(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=j(0);if((o||!s)&&((nt(e)!=="body"||mt(r))&&(c=gt(e)),o)){const m=J(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}!o&&r&&(l.x=wt(r));const a=r&&!o&&!s?ee(r,c):j(0),d=i.left+c.scrollLeft-l.x-a.x,u=i.top+c.scrollTop-l.y-a.y;return{x:d,y:u,width:i.width,height:i.height}}function bt(t){return V(t).position==="static"}function jt(t,e){if(!K(t)||V(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){const n=M(t);if(ht(t))return n;if(!K(t)){let r=G(t);for(;r&&!ot(r);){if(N(r)&&!bt(r))return r;r=G(r)}return n}let o=jt(t,e);for(;o&&Ie(o)&&bt(o);)o=jt(o,e);return o&&ot(o)&&bt(o)&&!Lt(o)?n:o||qe(t)||n}const cn=async function(t){const e=this.getOffsetParent||ne,n=this.getDimensions,o=await n(t.floating);return{reference:sn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ln(t){return V(t).direction==="rtl"}const an={convertOffsetParentRelativeRectToViewportRelativeRect:Ze,getDocumentElement:X,getClippingRect:on,getOffsetParent:ne,getElementRects:cn,getClientRects:Ge,getDimensions:rn,getScale:tt,isElement:N,isRTL:ln};function oe(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fn(t,e,n){let o=null,r;const s=X(t);function i(){var d;clearTimeout(r),(d=o)==null||d.disconnect(),o=null}function c(d,u){d===void 0&&(d=!1),u===void 0&&(u=1),i();const m=t.getBoundingClientRect(),{left:f,top:p,width:h,height:w}=m;if(d||e(),!h||!w)return;const g=st(p),x=st(s.clientWidth-(f+h)),b=st(s.clientHeight-(p+w)),v=st(f),y={rootMargin:-g+"px "+-x+"px "+-b+"px "+-v+"px",threshold:B(0,q(1,u))||1};let O=!0;function S($){const C=$[0].intersectionRatio;if(!oe(m,t.getBoundingClientRect()))return c();if(C!==u){if(!O)return c();C?c(!1,C):r=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{o=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{o=new IntersectionObserver(S,y)}o.observe(t)}const l=M(t),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),i()}}function un(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Tt(t),d=r||s?[...a?rt(a):[],...e?rt(e):[]]:[];d.forEach(g=>{r&&g.addEventListener("scroll",n),s&&g.addEventListener("resize",n)});const u=a&&c?fn(a,n,s):null;let m=-1,f=null;i&&(f=new ResizeObserver(g=>{let[x]=g;x&&x.target===a&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(e)})),n()}),a&&!l&&f.observe(a),e&&f.observe(e));let p,h=l?J(t):null;l&&w();function w(){const g=J(t);h&&!oe(h,g)&&n(),h=g,p=requestAnimationFrame(w)}return n(),()=>{var g;d.forEach(x=>{r&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),u?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const dn=Ne,pn=Ve,mn=He,hn=je,gn=ke,It=Fe,wn=Be,xn=(t,e,n)=>{const o=new Map,r=n??{},s={...an,...r.platform,_c:o};return We(t,e,{...r,platform:s})};var yn=typeof document<"u",vn=function(){},lt=yn?P.useLayoutEffect:vn;function dt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!dt(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&t.$$typeof)&&!dt(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function re(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(t,e){const n=re(t);return Math.round(e*n)/n}function At(t){const e=P.useRef(t);return lt(()=>{e.current=t}),e}function bn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=t,[d,u]=P.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,f]=P.useState(o);dt(m,o)||f(o);const[p,h]=P.useState(null),[w,g]=P.useState(null),x=P.useCallback(R=>{R!==y.current&&(y.current=R,h(R))},[]),b=P.useCallback(R=>{R!==O.current&&(O.current=R,g(R))},[]),v=s||p,A=i||w,y=P.useRef(null),O=P.useRef(null),S=P.useRef(d),$=l!=null,C=At(l),H=At(r),k=At(a),T=P.useCallback(()=>{if(!y.current||!O.current)return;const R={placement:e,strategy:n,middleware:m};H.current&&(R.platform=H.current),xn(y.current,O.current,R).then(D=>{const F={...D,isPositioned:k.current!==!1};E.current&&!dt(S.current,F)&&(S.current=F,ye.flushSync(()=>{u(F)}))})},[m,e,n,H,k]);lt(()=>{a===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,u(R=>({...R,isPositioned:!1})))},[a]);const E=P.useRef(!1);lt(()=>(E.current=!0,()=>{E.current=!1}),[]),lt(()=>{if(v&&(y.current=v),A&&(O.current=A),v&&A){if(C.current)return C.current(v,A,T);T()}},[v,A,T,C,$]);const W=P.useMemo(()=>({reference:y,floating:O,setReference:x,setFloating:b}),[x,b]),L=P.useMemo(()=>({reference:v,floating:A}),[v,A]),_=P.useMemo(()=>{const R={position:n,left:0,top:0};if(!L.floating)return R;const D=Xt(L.floating,d.x),F=Xt(L.floating,d.y);return c?{...R,transform:"translate("+D+"px, "+F+"px)",...re(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:F}},[n,c,L.floating,d.x,d.y]);return P.useMemo(()=>({...d,update:T,refs:W,elements:L,floatingStyles:_}),[d,T,W,L,_])}const An=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:r}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?It({element:o.current,padding:r}).fn(n):{}:o?It({element:o,padding:r}).fn(n):{}}}},Rn=(t,e)=>{const n=dn(t);return{name:n.name,fn:n.fn,options:[t,e]}},On=(t,e)=>{const n=pn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Pn=(t,e)=>({fn:wn(t).fn,options:[t,e]}),Cn=(t,e)=>{const n=mn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Sn=(t,e)=>{const n=hn(t);return{name:n.name,fn:n.fn,options:[t,e]}},En=(t,e)=>{const n=gn(t);return{name:n.name,fn:n.fn,options:[t,e]}},Ln=(t,e)=>{const n=An(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Dn=Object.defineProperty,Y=(t,e)=>Dn(t,"name",{value:e,configurable:!0}),ie="Popper",[se,jn]=ve(ie),[Tn,ce]=se(ie),$n=Y(t=>{const{__scopePopper:e,children:n}=t,[o,r]=P.useState(null),[s,i]=P.useState(void 0);return Q.jsx(Tn,{scope:e,anchor:o,onAnchorChange:r,placementState:s,setPlacementState:i,children:n})},"Popper"),_n="PopperAnchor",Mn=P.forwardRef(Y(function(e,n){const{__scopePopper:o,virtualRef:r,...s}=e,i=ce(_n,o),c=P.useRef(null),l=i.onAnchorChange,a=P.useCallback(h=>{c.current=h,h&&l(h)},[l]),d=Yt(n,a),u=P.useRef(null);P.useEffect(()=>{if(!r)return;const h=u.current;u.current=r.current,h!==u.current&&l(u.current)});const m=i.placementState&&xt(i.placementState),f=m?.[0],p=m?.[1];return r?null:Q.jsx(Pt.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...s,ref:d})},"PopperAnchor")),le="PopperContent",[Wn,In]=se(le),Fn=P.forwardRef(Y(function(e,n){const{__scopePopper:o,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:a=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:m="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:h,...w}=e,g=ce(le,o),[x,b]=P.useState(null),v=Yt(n,b),[A,y]=P.useState(null),O=qt(A),S=O?.width??0,$=O?.height??0,C=r+(i!=="center"?"-"+i:""),H=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(d)?d:[d],T=k.length>0,E={padding:H,boundary:k.filter(ae),altBoundary:T},{refs:W,floatingStyles:L,placement:_,isPositioned:R,middlewareData:D}=bn({strategy:"fixed",placement:C,whileElementsMounted:Y((...yt)=>un(...yt,{animationFrame:p==="always"}),"whileElementsMounted"),elements:{reference:g.anchor},middleware:[Rn({mainAxis:s+$,alignmentAxis:c}),a&&On({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Pn():void 0,...E}),a&&Cn({...E}),Sn({...E,apply:Y(({elements:yt,rects:Wt,availableWidth:he,availableHeight:ge})=>{const{width:we,height:xe}=Wt.reference,it=yt.floating.style;it.setProperty("--radix-popper-available-width",`${he}px`),it.setProperty("--radix-popper-available-height",`${ge}px`),it.setProperty("--radix-popper-anchor-width",`${we}px`),it.setProperty("--radix-popper-anchor-height",`${xe}px`)},"apply")}),A&&Ln({element:A,padding:l}),Hn({arrowWidth:S,arrowHeight:$}),f&&En({strategy:"referenceHidden",...E,boundary:T?E.boundary:void 0})]}),F=g.setPlacementState;ct(()=>(F(_),()=>{F(void 0)}),[_,F]);const[$t,_t]=xt(_),Mt=be(h);ct(()=>{R&&Mt?.()},[R,Mt]);const fe=D.arrow?.x,ue=D.arrow?.y,de=D.arrow?.centerOffset!==0,[pe,me]=P.useState();return ct(()=>{x&&me(window.getComputedStyle(x).zIndex)},[x]),Q.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:R?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Q.jsx(Wn,{scope:o,placedSide:$t,placedAlign:_t,onArrowChange:y,arrowX:fe,arrowY:ue,shouldHideArrow:de,children:Q.jsx(Pt.div,{"data-side":$t,"data-align":_t,...w,ref:v,style:{...w.style,animation:R?w.style?.animation:"none"}})})})},"PopperContent"));function ae(t){return t!==null}Y(ae,"isNotNull");var Hn=Y(t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:r}=e,i=r.arrow?.centerOffset!==0,c=i?0:t.arrowWidth,l=i?0:t.arrowHeight,[a,d]=xt(n),u={start:"0%",center:"50%",end:"100%"}[d],m=(r.arrow?.x??0)+c/2,f=(r.arrow?.y??0)+l/2;let p="",h="";return a==="bottom"?(p=i?u:`${m}px`,h=`${-l}px`):a==="top"?(p=i?u:`${m}px`,h=`${o.floating.height+l}px`):a==="right"?(p=`${-l}px`,h=i?u:`${f}px`):a==="left"&&(p=`${o.floating.width+l}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function xt(t){const[e,n="center"]=t.split("-");return[e,n]}Y(xt,"getSideAndAlignFromPlacement");var Xn=$n,Yn=Mn,qn=Fn,kn=Object.defineProperty,zn=(t,e)=>kn(t,"name",{value:e,configurable:!0}),Nn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Vn=P.forwardRef(zn(function(e,n){return Q.jsx(Pt.span,{...e,ref:n,style:{...Nn,...e.style}})},"VisuallyHidden")),Un=Vn;export{Yn as A,qn as C,Xn as R,Nn as V,Un as a,jn as c};