@nextclaw/ui 0.12.8 → 0.12.10

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 (227) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/assets/ChannelsList-M9FTK1Ak.js +8 -0
  3. package/dist/assets/DocBrowser-CH7-GxlL.js +1 -0
  4. package/dist/assets/{DocBrowser-BMxf9CIK.js → DocBrowser-DMfr0Oow.js} +1 -1
  5. package/dist/assets/{DocBrowserContext-Ce28gRXt.js → DocBrowserContext-BXydqby-.js} +1 -1
  6. package/dist/assets/{LogoBadge-o92MOA2L.js → LogoBadge-hO7tY7hE.js} +1 -1
  7. package/dist/assets/ModelConfig-CNIgLf0e.js +1 -0
  8. package/dist/assets/{ProviderScopedModelInput-CmTIzgI7.js → ProviderScopedModelInput-B3HWP4oz.js} +1 -1
  9. package/dist/assets/ProvidersList-CHjMnRhX.js +1 -0
  10. package/dist/assets/RuntimeConfig-psp8nMSG.js +1 -0
  11. package/dist/assets/SearchConfig-CSoKip1f.js +1 -0
  12. package/dist/assets/{SecretsConfig-Ba1RPJaG.js → SecretsConfig-MEt6MjuD.js} +2 -2
  13. package/dist/assets/SessionsConfig-DifCiXwR.js +2 -0
  14. package/dist/assets/{app-query-client-DniXoIN5.js → app-query-client-9jNewezV.js} +1 -1
  15. package/dist/assets/{book-open-DocgeQtR.js → book-open-DzdUViDm.js} +1 -1
  16. package/dist/assets/chat-page-CLp0UV0Y.js +58 -0
  17. package/dist/assets/chat-session-display-DsYHx0RZ.js +1 -0
  18. package/dist/assets/{chunk-JZWAC4HX-BvKvh1R8.js → chunk-JZWAC4HX-C5dEc8hV.js} +1 -1
  19. package/dist/assets/{client-CVqPF5ie.js → client-C-8fH7-c.js} +1 -1
  20. package/dist/assets/{config-Bop2oB18.js → config-CBScxsdV.js} +1 -1
  21. package/dist/assets/config-split-page-BUout_Ak.js +1 -0
  22. package/dist/assets/{createLucideIcon-DVv8taGY.js → createLucideIcon-dy5ie7Ox.js} +1 -1
  23. package/dist/assets/desktop-update-config-2BS6BMkW.js +1 -0
  24. package/dist/assets/{dist-DmAlInRu.js → dist-BruyLa92.js} +1 -1
  25. package/dist/assets/{dist-Da5Gm_pO.js → dist-Cy7_j6hA.js} +1 -1
  26. package/dist/assets/download-BD0ETkB-.js +1 -0
  27. package/dist/assets/{external-link-DFjw3x1B.js → external-link-kZSAO8nT.js} +1 -1
  28. package/dist/assets/{hash-DJtaCejM.js → hash-BHJC2Ovu.js} +1 -1
  29. package/dist/assets/i18n-CpTZLchQ.js +1 -0
  30. package/dist/assets/index-mW8W2FUu.css +1 -0
  31. package/dist/assets/index-zDZfXoI4.js +6 -0
  32. package/dist/assets/{infiniteQueryBehavior-DHSEQ3OH.js → infiniteQueryBehavior-CyER9hv0.js} +1 -1
  33. package/dist/assets/loader-circle-Bc2gCU33.js +1 -0
  34. package/dist/assets/{logos-DEFUIR12.js → logos-B7gRObP8.js} +1 -1
  35. package/dist/assets/marketplace-page-3qVMnF3d.js +1 -0
  36. package/dist/assets/marketplace-page-BhFIeQzI.js +49 -0
  37. package/dist/assets/mcp-marketplace-page-DYfteJ1D.js +40 -0
  38. package/dist/assets/{page-layout-Da3i3r6G.js → page-layout-0UcO9H9Z.js} +1 -1
  39. package/dist/assets/play-CKDjSQFL.js +1 -0
  40. package/dist/assets/plus-CG0QrVY_.js +1 -0
  41. package/dist/assets/{refresh-ccw-D6HkNtfz.js → refresh-ccw-COVhNHtN.js} +1 -1
  42. package/dist/assets/{refresh-cw-DRcvRrnc.js → refresh-cw-Bcv40SXy.js} +1 -1
  43. package/dist/assets/remote-access-page-CWHG-sug.js +1 -0
  44. package/dist/assets/{rotate-cw-BmDKfXtH.js → rotate-cw-oHMKJMC8.js} +1 -1
  45. package/dist/assets/{save-DHGmi2e9.js → save-EqJPOF0G.js} +1 -1
  46. package/dist/assets/search-BCAlB8nz.js +1 -0
  47. package/dist/assets/security-config-Slh0Mayz.js +1 -0
  48. package/dist/assets/select-CVz0t7MF.js +41 -0
  49. package/dist/assets/setting-row-CbVHAuQt.js +1 -0
  50. package/dist/assets/skeleton-D5rdKvzy.js +1 -0
  51. package/dist/assets/{status-dot-DurKKSwA.js → status-dot-DpPtVzQT.js} +1 -1
  52. package/dist/assets/{switch-0rmPBRKI.js → switch-CM29eCAR.js} +1 -1
  53. package/dist/assets/{tabs-custom-5JLVL6v8.js → tabs-custom-YcZUWn3o.js} +1 -1
  54. package/dist/assets/tag-chip-DMXdnLcj.js +1 -0
  55. package/dist/assets/{trash-2-C6caKPoz.js → trash-2-mJT6oWa2.js} +1 -1
  56. package/dist/assets/{use-infinite-scroll-loader-dwnaa_qi.js → use-infinite-scroll-loader-DJ1L81Dz.js} +1 -1
  57. package/dist/assets/{useConfirmDialog-mMeWD_yo.js → useConfirmDialog-BsVuqu1x.js} +1 -1
  58. package/dist/assets/{useMutation-BmxxvCNf.js → useMutation-CNcz2fgt.js} +1 -1
  59. package/dist/assets/x-Czwxm82I.js +1 -0
  60. package/dist/index.html +95 -21
  61. package/dist/manifest.webmanifest +30 -0
  62. package/dist/offline.html +102 -0
  63. package/dist/pwa-192.png +0 -0
  64. package/dist/pwa-512.png +0 -0
  65. package/dist/runtime-icons/claude.ico +0 -0
  66. package/dist/runtime-icons/codex-openai.svg +6 -0
  67. package/dist/runtime-icons/hermes-agent.png +0 -0
  68. package/dist/sw.js +80 -0
  69. package/index.html +73 -1
  70. package/package.json +5 -5
  71. package/public/manifest.webmanifest +30 -0
  72. package/public/offline.html +102 -0
  73. package/public/pwa-192.png +0 -0
  74. package/public/pwa-512.png +0 -0
  75. package/public/runtime-icons/claude.ico +0 -0
  76. package/public/runtime-icons/codex-openai.svg +6 -0
  77. package/public/runtime-icons/hermes-agent.png +0 -0
  78. package/public/sw.js +80 -0
  79. package/src/account/components/account-panel.tsx +217 -97
  80. package/src/account/managers/account.manager.ts +3 -2
  81. package/src/api/chat-session-type.types.ts +7 -0
  82. package/src/api/runtime-control.types.ts +8 -0
  83. package/src/api/server-path.ts +27 -4
  84. package/src/api/types.ts +25 -10
  85. package/src/app.tsx +227 -54
  86. package/src/components/agents/agent-dialogs.tsx +499 -0
  87. package/src/components/agents/agents-page.test.tsx +238 -0
  88. package/src/components/agents/agents-page.tsx +435 -0
  89. package/src/components/chat/ChatSidebar.test.tsx +43 -1
  90. package/src/components/chat/ChatSidebar.tsx +35 -35
  91. package/src/components/chat/adapters/chat-message.summary-truncation.test.ts +66 -0
  92. package/src/components/chat/adapters/file-operation/card.ts +9 -0
  93. package/src/components/chat/adapters/file-operation/diff.ts +14 -0
  94. package/src/components/chat/{ChatConversationPanel.test.tsx → chat-conversation-panel.test.tsx} +127 -206
  95. package/src/components/chat/chat-conversation-panel.tsx +482 -0
  96. package/src/components/chat/chat-page-shell.tsx +19 -13
  97. package/src/components/chat/chat-session-type-option-item.test.tsx +46 -0
  98. package/src/components/chat/chat-session-type-option-item.tsx +68 -0
  99. package/src/components/chat/chat-session-workspace-file-preview.test.tsx +178 -0
  100. package/src/components/chat/chat-session-workspace-file-preview.tsx +278 -0
  101. package/src/components/chat/chat-session-workspace-panel-nav.tsx +203 -0
  102. package/src/components/chat/chat-session-workspace-panel.tsx +318 -0
  103. package/src/components/chat/chat-sidebar-project-groups.tsx +11 -36
  104. package/src/components/chat/chat-sidebar-session-item.tsx +32 -2
  105. package/src/components/chat/containers/chat-message-list.container.test.tsx +49 -0
  106. package/src/components/chat/containers/chat-message-list.container.tsx +4 -0
  107. package/src/components/chat/managers/chat-session-list.manager.test.ts +12 -0
  108. package/src/components/chat/managers/chat-session-list.manager.ts +7 -0
  109. package/src/components/chat/ncp/__tests__/ncp-session-adapter.cancelled-tool.test.ts +77 -0
  110. package/src/components/chat/ncp/ncp-chat-page.tsx +9 -7
  111. package/src/components/chat/ncp/ncp-chat-thread.manager.ts +179 -41
  112. package/src/components/chat/ncp/ncp-session-adapter.test.ts +36 -1
  113. package/src/components/chat/ncp/ncp-session-adapter.ts +20 -0
  114. package/src/components/chat/ncp/page/ncp-chat-derived-state.ts +62 -13
  115. package/src/components/chat/ncp/tests/ncp-chat-thread.manager.test.ts +189 -0
  116. package/src/components/chat/presenter/chat-presenter-context.tsx +13 -2
  117. package/src/components/chat/session-header/chat-session-header-actions.test.tsx +26 -0
  118. package/src/components/chat/session-header/chat-session-header-actions.tsx +19 -1
  119. package/src/components/chat/stores/chat-input.store.ts +2 -1
  120. package/src/components/chat/stores/chat-thread.store.ts +27 -1
  121. package/src/components/chat/useChatSessionTypeState.ts +10 -1
  122. package/src/components/chat/workspace/chat-session-workspace-file-breadcrumbs.tsx +86 -0
  123. package/src/components/common/BrandHeader.tsx +3 -1
  124. package/src/components/common/session-context-icon.tsx +15 -2
  125. package/src/components/common/{TagInput.tsx → tag-input.tsx} +25 -17
  126. package/src/components/config/ChannelForm.test.tsx +89 -3
  127. package/src/components/config/ChannelForm.tsx +157 -188
  128. package/src/components/config/ChannelsList.test.tsx +163 -119
  129. package/src/components/config/ChannelsList.tsx +90 -101
  130. package/src/components/config/ProviderForm.tsx +108 -146
  131. package/src/components/config/ProvidersList.tsx +100 -123
  132. package/src/components/config/RuntimeConfig.tsx +141 -2
  133. package/src/components/config/SearchConfig.tsx +423 -393
  134. package/src/components/config/channel-form-fields-section.tsx +70 -37
  135. package/src/components/config/config-split-page.tsx +109 -0
  136. package/src/components/config/provider-enabled-field.tsx +17 -10
  137. package/src/components/config/runtime-control-card.test.tsx +56 -0
  138. package/src/components/config/runtime-control-card.tsx +25 -0
  139. package/src/components/config/runtime-presence-card.tsx +93 -79
  140. package/src/components/layout/AppLayout.tsx +25 -37
  141. package/src/components/layout/app-layout.test.tsx +46 -14
  142. package/src/components/layout/runtime-status-entry.test.tsx +157 -0
  143. package/src/components/layout/runtime-status-entry.tsx +143 -0
  144. package/src/components/marketplace/marketplace-detail-doc.ts +93 -0
  145. package/src/components/marketplace/marketplace-list-card.tsx +288 -0
  146. package/src/components/marketplace/marketplace-page-data.ts +129 -0
  147. package/src/components/marketplace/marketplace-page.test.tsx +339 -0
  148. package/src/components/marketplace/marketplace-page.tsx +596 -0
  149. package/src/components/marketplace/mcp/mcp-marketplace-card.tsx +128 -0
  150. package/src/components/marketplace/mcp/mcp-marketplace-dialogs.tsx +191 -0
  151. package/src/components/marketplace/mcp/mcp-marketplace-doc.ts +152 -0
  152. package/src/components/marketplace/mcp/mcp-marketplace-page.test.tsx +223 -0
  153. package/src/components/marketplace/mcp/mcp-marketplace-page.tsx +414 -0
  154. package/src/components/providers/ThemeProvider.tsx +5 -0
  155. package/src/components/remote/remote-access-page.test.tsx +105 -0
  156. package/src/components/remote/remote-access-page.tsx +248 -0
  157. package/src/components/ui/notice-card.tsx +129 -0
  158. package/src/components/ui/setting-row.tsx +51 -0
  159. package/src/components/ui/tag-chip.tsx +39 -0
  160. package/src/components/ui/textarea.tsx +19 -0
  161. package/src/hooks/server-path/use-server-path-read.ts +20 -0
  162. package/src/hooks/useConfig.ts +2 -1
  163. package/src/index.css +24 -0
  164. package/src/lib/app-resource-uri.test.ts +20 -0
  165. package/src/lib/app-resource-uri.ts +29 -0
  166. package/src/lib/chat-message.ts +14 -3
  167. package/src/lib/i18n.chat.ts +12 -1
  168. package/src/lib/i18n.pwa.ts +62 -0
  169. package/src/lib/i18n.remote.ts +1 -1
  170. package/src/lib/i18n.runtime-control.ts +31 -0
  171. package/src/lib/i18n.ts +7 -10
  172. package/src/lib/session-context.utils.test.ts +71 -0
  173. package/src/lib/session-context.utils.ts +28 -3
  174. package/src/lib/session-project/workspace-file-breadcrumb.test.ts +83 -0
  175. package/src/lib/session-project/workspace-file-breadcrumb.ts +188 -0
  176. package/src/pwa/components/pwa-install-entry.test.tsx +110 -0
  177. package/src/pwa/components/pwa-install-entry.tsx +205 -0
  178. package/src/pwa/managers/pwa-install.manager.test.ts +160 -0
  179. package/src/pwa/managers/pwa-install.manager.ts +232 -0
  180. package/src/pwa/managers/pwa-runtime.manager.ts +196 -0
  181. package/src/pwa/managers/pwa-shell-theme.manager.test.ts +30 -0
  182. package/src/pwa/managers/pwa-shell-theme.manager.ts +46 -0
  183. package/src/pwa/pwa-install-banner.storage.ts +55 -0
  184. package/src/pwa/pwa.types.ts +22 -0
  185. package/src/pwa/register-pwa.ts +14 -0
  186. package/src/pwa/stores/pwa.store.ts +17 -0
  187. package/src/vite-env.d.ts +9 -0
  188. package/dist/assets/ChannelsList-KIQIxluX.js +0 -8
  189. package/dist/assets/DocBrowser-CyDgAtO9.js +0 -1
  190. package/dist/assets/MarketplacePage-BySqkYDh.js +0 -49
  191. package/dist/assets/MarketplacePage-C0olZaek.js +0 -1
  192. package/dist/assets/McpMarketplacePage-DqKaiXO9.js +0 -40
  193. package/dist/assets/ModelConfig-IrmzoslW.js +0 -1
  194. package/dist/assets/ProvidersList-8_Kalfwl.js +0 -1
  195. package/dist/assets/RemoteAccessPage-CyQlSjPf.js +0 -1
  196. package/dist/assets/RuntimeConfig-Bk0uYBhf.js +0 -1
  197. package/dist/assets/SearchConfig-DNBR-UbE.js +0 -1
  198. package/dist/assets/SessionsConfig-Doqp5ghH.js +0 -2
  199. package/dist/assets/chat-page-Bph8M5zo.js +0 -58
  200. package/dist/assets/chat-session-display-CoN3Wmn-.js +0 -1
  201. package/dist/assets/config-layout-DmlGaay2.js +0 -1
  202. package/dist/assets/desktop-update-config-1KBrqLBC.js +0 -1
  203. package/dist/assets/i18n-CwHZ-9vt.js +0 -1
  204. package/dist/assets/index-DafCdM4F.css +0 -1
  205. package/dist/assets/index-DdksE6U3.js +0 -6
  206. package/dist/assets/loader-circle-PsSP0H9n.js +0 -1
  207. package/dist/assets/play-DBQbBxTA.js +0 -1
  208. package/dist/assets/plus-DUOVbsyQ.js +0 -1
  209. package/dist/assets/popover-C_mWOFzI.js +0 -1
  210. package/dist/assets/search-MChQRYR1.js +0 -1
  211. package/dist/assets/security-config-CbXfPZzr.js +0 -1
  212. package/dist/assets/select-Caud8QvU.js +0 -41
  213. package/dist/assets/skeleton-B-4vRq_Z.js +0 -1
  214. package/dist/assets/x-DuMhMATD.js +0 -1
  215. package/src/components/agents/AgentDialogs.tsx +0 -400
  216. package/src/components/agents/AgentsPage.test.tsx +0 -217
  217. package/src/components/agents/AgentsPage.tsx +0 -352
  218. package/src/components/chat/ChatConversationPanel.tsx +0 -256
  219. package/src/components/chat/chat-child-session-panel.tsx +0 -270
  220. package/src/components/config/config-layout.ts +0 -10
  221. package/src/components/marketplace/MarketplacePage.test.tsx +0 -322
  222. package/src/components/marketplace/MarketplacePage.tsx +0 -827
  223. package/src/components/marketplace/mcp/McpMarketplacePage.test.tsx +0 -208
  224. package/src/components/marketplace/mcp/McpMarketplacePage.tsx +0 -580
  225. package/src/components/remote/RemoteAccessPage.test.tsx +0 -103
  226. package/src/components/remote/RemoteAccessPage.tsx +0 -144
  227. /package/dist/assets/{config-hints-BZoDjXye.js → config-hints-BhTmc9P1.js} +0 -0
@@ -1,3 +1,3 @@
1
- import{_ as e,i as t,m as n,p as r}from"./i18n-CwHZ-9vt.js";import{n as i,r as a}from"./dist-DmAlInRu.js";import{a as o,i as s,n as c,r as l,t as u}from"./select-Caud8QvU.js";import{t as d}from"./plus-DUOVbsyQ.js";import{t as f}from"./save-DHGmi2e9.js";import{t as p}from"./trash-2-C6caKPoz.js";import{G as m,J as h,K as g,M as _,W as v,c as y,et as b,q as x,tt as S}from"./index-DdksE6U3.js";import{n as C,t as w}from"./page-layout-Da3i3r6G.js";import{t as T}from"./switch-0rmPBRKI.js";var E=e(n(),1),D=r(),O=[`env`,`file`,`exec`];function k(e=``){return{alias:e,source:`env`,prefix:``,path:``,command:``,argsText:``,cwd:``,timeoutMs:5e3}}function A(){return{path:``,source:`env`,provider:``,id:``}}function j(e,t){return t.source===`env`?{...k(e),source:`env`,prefix:t.prefix??``}:t.source===`file`?{...k(e),source:`file`,path:t.path}:{...k(e),source:`exec`,command:t.command,argsText:(t.args??[]).join(`
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-CpTZLchQ.js";import{n as i,r as a}from"./dist-BruyLa92.js";import{a as o,i as s,n as c,r as l,t as u}from"./select-CVz0t7MF.js";import{t as d}from"./plus-CG0QrVY_.js";import{t as f}from"./save-EqJPOF0G.js";import{t as p}from"./trash-2-mJT6oWa2.js";import{W as m,at as h,b as g,it as _,mt as v,nt as y,ot as b,pt as x,rt as S}from"./index-zDZfXoI4.js";import{n as C,t as w}from"./page-layout-0UcO9H9Z.js";import{t as T}from"./switch-CM29eCAR.js";var E=e(n(),1),D=r(),O=[`env`,`file`,`exec`];function k(e=``){return{alias:e,source:`env`,prefix:``,path:``,command:``,argsText:``,cwd:``,timeoutMs:5e3}}function A(){return{path:``,source:`env`,provider:``,id:``}}function j(e,t){return t.source===`env`?{...k(e),source:`env`,prefix:t.prefix??``}:t.source===`file`?{...k(e),source:`file`,path:t.path}:{...k(e),source:`exec`,command:t.command,argsText:(t.args??[]).join(`
2
2
  `),cwd:t.cwd??``,timeoutMs:t.timeoutMs??5e3}}function M(e){return e.source===`env`?{source:`env`,...e.prefix.trim()?{prefix:e.prefix.trim()}:{}}:e.source===`file`?{source:`file`,path:e.path.trim(),format:`json`}:{source:`exec`,command:e.command.trim(),args:e.argsText.split(`
3
- `).map(e=>e.trim()).filter(Boolean),...e.cwd.trim()?{cwd:e.cwd.trim()}:{},timeoutMs:Math.max(1,Math.trunc(e.timeoutMs||5e3))}}function N(){let{data:e,isLoading:n}=y(),r=_(),[N,P]=(0,E.useState)(!0),[F,I]=(0,E.useState)(``),[L,R]=(0,E.useState)(``),[z,B]=(0,E.useState)(``),[V,H]=(0,E.useState)([]),[U,W]=(0,E.useState)([]);(0,E.useEffect)(()=>{let t=e?.secrets;if(!t){P(!0),I(``),R(``),B(``),H([]),W([]);return}P(!!t.enabled),I(t.defaults.env??``),R(t.defaults.file??``),B(t.defaults.exec??``);let n=Object.entries(t.providers).map(([e,t])=>j(e,t)),r=Object.entries(t.refs).map(([e,t])=>({path:e,source:t.source,provider:t.provider??``,id:t.id}));H(n),W(r)},[e?.secrets]);let G=(0,E.useMemo)(()=>{let e=V.map(e=>e.alias.trim()).filter(Boolean);return Array.from(new Set(e))},[V]),K=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},q=(e,t)=>{W(n=>n.map((n,r)=>r===e?{...n,...t}:n))};return n?(0,D.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)}):(0,D.jsxs)(C,{className:`space-y-6`,children:[(0,D.jsx)(w,{title:t(`secretsPageTitle`),description:t(`secretsPageDescription`)}),(0,D.jsxs)(v,{children:[(0,D.jsxs)(x,{children:[(0,D.jsx)(h,{children:t(`secrets`)}),(0,D.jsx)(g,{children:t(`secretsEnabledHelp`)})]}),(0,D.jsxs)(m,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-gray-200 p-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:t(`enabled`)}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`secretsEnabledHelp`)})]}),(0,D.jsx)(T,{checked:N,onCheckedChange:P})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(b,{children:t(`defaultEnvProvider`)}),(0,D.jsxs)(u,{value:F||`__none__`,onValueChange:e=>I(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(b,{children:t(`defaultFileProvider`)}),(0,D.jsxs)(u,{value:L||`__none__`,onValueChange:e=>R(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(b,{children:t(`defaultExecProvider`)}),(0,D.jsxs)(u,{value:z||`__none__`,onValueChange:e=>B(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]})]})]})]}),(0,D.jsxs)(v,{children:[(0,D.jsxs)(x,{children:[(0,D.jsx)(h,{children:t(`secretProvidersTitle`)}),(0,D.jsx)(g,{children:t(`secretProvidersDescription`)})]}),(0,D.jsxs)(m,{className:`space-y-3`,children:[V.map((e,n)=>(0,D.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-3`,children:[(0,D.jsx)(S,{value:e.alias,onChange:e=>K(n,{alias:e.target.value}),placeholder:t(`providerAlias`)}),(0,D.jsxs)(u,{value:e.source,onValueChange:e=>K(n,{source:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{})}),(0,D.jsx)(c,{children:O.map(e=>(0,D.jsx)(l,{value:e,children:e},e))})]}),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>H(e=>e.filter((e,t)=>t!==n)),children:[(0,D.jsx)(p,{className:`h-4 w-4 mr-2`}),t(`removeProvider`)]})]}),e.source===`env`&&(0,D.jsx)(S,{value:e.prefix,onChange:e=>K(n,{prefix:e.target.value}),placeholder:t(`envPrefix`)}),e.source===`file`&&(0,D.jsx)(S,{value:e.path,onChange:e=>K(n,{path:e.target.value}),placeholder:t(`secretFilePath`)}),e.source===`exec`&&(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(S,{value:e.command,onChange:e=>K(n,{command:e.target.value}),placeholder:t(`secretExecCommand`)}),(0,D.jsx)(`textarea`,{className:`min-h-[84px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`,value:e.argsText,onChange:e=>K(n,{argsText:e.target.value}),placeholder:t(`secretExecArgs`)}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:[(0,D.jsx)(S,{value:e.cwd,onChange:e=>K(n,{cwd:e.target.value}),placeholder:t(`secretExecCwd`)}),(0,D.jsx)(S,{type:`number`,min:1,value:e.timeoutMs,onChange:e=>K(n,{timeoutMs:Number.parseInt(e.target.value,10)||5e3}),placeholder:t(`secretExecTimeoutMs`)})]})]})]},`provider-${n}`)),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>H(e=>[...e,k()]),children:[(0,D.jsx)(d,{className:`h-4 w-4 mr-2`}),t(`addSecretProvider`)]})]})]}),(0,D.jsxs)(v,{children:[(0,D.jsxs)(x,{children:[(0,D.jsx)(h,{children:t(`secretRefsTitle`)}),(0,D.jsx)(g,{children:t(`secretRefsDescription`)})]}),(0,D.jsxs)(m,{className:`space-y-3`,children:[U.map((e,n)=>(0,D.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,D.jsx)(S,{value:e.path,onChange:e=>q(n,{path:e.target.value}),placeholder:t(`secretConfigPath`)}),(0,D.jsx)(S,{value:e.id,onChange:e=>q(n,{id:e.target.value}),placeholder:t(`secretId`)}),(0,D.jsxs)(u,{value:e.source,onValueChange:e=>q(n,{source:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{})}),(0,D.jsx)(c,{children:O.map(e=>(0,D.jsx)(l,{value:e,children:e},e))})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,D.jsxs)(u,{value:e.provider||`__none__`,onValueChange:e=>q(n,{provider:e===`__none__`?``:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`secretProviderAlias`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]}),(0,D.jsx)(a,{type:`button`,variant:`outline`,onClick:()=>W(e=>e.filter((e,t)=>t!==n)),children:(0,D.jsx)(p,{className:`h-4 w-4`})})]})]})},`ref-${n}`)),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>W(e=>[...e,A()]),children:[(0,D.jsx)(d,{className:`h-4 w-4 mr-2`}),t(`addSecretRef`)]})]})]}),(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(a,{type:`button`,onClick:()=>{try{let e={};for(let[n,r]of V.entries()){let i=r.alias.trim();if(!i)throw Error(`${t(`providerAlias`)} #${n+1} ${t(`isRequired`)}`);if(e[i])throw Error(`${t(`providerAlias`)}: ${i} (${t(`duplicate`)})`);if(r.source===`file`&&!r.path.trim())throw Error(`${t(`secretFilePath`)} #${n+1} ${t(`isRequired`)}`);if(r.source===`exec`&&!r.command.trim())throw Error(`${t(`secretExecCommand`)} #${n+1} ${t(`isRequired`)}`);e[i]=M(r)}let n={};for(let[r,i]of U.entries()){let a=i.path.trim(),o=i.id.trim();if(!a)throw Error(`${t(`secretConfigPath`)} #${r+1} ${t(`isRequired`)}`);if(!o)throw Error(`${t(`secretId`)} #${r+1} ${t(`isRequired`)}`);let s=i.provider.trim();if(s&&!e[s])throw Error(`${t(`secretProviderAlias`)}: ${s} ${t(`notFound`)}`);n[a]={source:i.source,...s?{provider:s}:{},id:o}}r.mutate({data:{enabled:N,defaults:{env:F.trim()||null,file:L.trim()||null,exec:z.trim()||null},providers:e,refs:n}})}catch(e){let t=e instanceof Error?e.message:String(e);i.error(t)}},disabled:r.isPending,children:[(0,D.jsx)(f,{className:`h-4 w-4 mr-2`}),r.isPending?t(`saving`):t(`save`)]})})]})}export{N as SecretsConfig};
3
+ `).map(e=>e.trim()).filter(Boolean),...e.cwd.trim()?{cwd:e.cwd.trim()}:{},timeoutMs:Math.max(1,Math.trunc(e.timeoutMs||5e3))}}function N(){let{data:e,isLoading:n}=g(),r=m(),[N,P]=(0,E.useState)(!0),[F,I]=(0,E.useState)(``),[L,R]=(0,E.useState)(``),[z,B]=(0,E.useState)(``),[V,H]=(0,E.useState)([]),[U,W]=(0,E.useState)([]);(0,E.useEffect)(()=>{let t=e?.secrets;if(!t){P(!0),I(``),R(``),B(``),H([]),W([]);return}P(!!t.enabled),I(t.defaults.env??``),R(t.defaults.file??``),B(t.defaults.exec??``);let n=Object.entries(t.providers).map(([e,t])=>j(e,t)),r=Object.entries(t.refs).map(([e,t])=>({path:e,source:t.source,provider:t.provider??``,id:t.id}));H(n),W(r)},[e?.secrets]);let G=(0,E.useMemo)(()=>{let e=V.map(e=>e.alias.trim()).filter(Boolean);return Array.from(new Set(e))},[V]),K=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},q=(e,t)=>{W(n=>n.map((n,r)=>r===e?{...n,...t}:n))};return n?(0,D.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)}):(0,D.jsxs)(C,{className:`space-y-6`,children:[(0,D.jsx)(w,{title:t(`secretsPageTitle`),description:t(`secretsPageDescription`)}),(0,D.jsxs)(y,{children:[(0,D.jsxs)(h,{children:[(0,D.jsx)(b,{children:t(`secrets`)}),(0,D.jsx)(_,{children:t(`secretsEnabledHelp`)})]}),(0,D.jsxs)(S,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-gray-200 p-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:t(`enabled`)}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`secretsEnabledHelp`)})]}),(0,D.jsx)(T,{checked:N,onCheckedChange:P})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(x,{children:t(`defaultEnvProvider`)}),(0,D.jsxs)(u,{value:F||`__none__`,onValueChange:e=>I(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(x,{children:t(`defaultFileProvider`)}),(0,D.jsxs)(u,{value:L||`__none__`,onValueChange:e=>R(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(x,{children:t(`defaultExecProvider`)}),(0,D.jsxs)(u,{value:z||`__none__`,onValueChange:e=>B(e===`__none__`?``:e),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`noneOption`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]})]})]})]})]}),(0,D.jsxs)(y,{children:[(0,D.jsxs)(h,{children:[(0,D.jsx)(b,{children:t(`secretProvidersTitle`)}),(0,D.jsx)(_,{children:t(`secretProvidersDescription`)})]}),(0,D.jsxs)(S,{className:`space-y-3`,children:[V.map((e,n)=>(0,D.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-3`,children:[(0,D.jsx)(v,{value:e.alias,onChange:e=>K(n,{alias:e.target.value}),placeholder:t(`providerAlias`)}),(0,D.jsxs)(u,{value:e.source,onValueChange:e=>K(n,{source:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{})}),(0,D.jsx)(c,{children:O.map(e=>(0,D.jsx)(l,{value:e,children:e},e))})]}),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>H(e=>e.filter((e,t)=>t!==n)),children:[(0,D.jsx)(p,{className:`h-4 w-4 mr-2`}),t(`removeProvider`)]})]}),e.source===`env`&&(0,D.jsx)(v,{value:e.prefix,onChange:e=>K(n,{prefix:e.target.value}),placeholder:t(`envPrefix`)}),e.source===`file`&&(0,D.jsx)(v,{value:e.path,onChange:e=>K(n,{path:e.target.value}),placeholder:t(`secretFilePath`)}),e.source===`exec`&&(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(v,{value:e.command,onChange:e=>K(n,{command:e.target.value}),placeholder:t(`secretExecCommand`)}),(0,D.jsx)(`textarea`,{className:`min-h-[84px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`,value:e.argsText,onChange:e=>K(n,{argsText:e.target.value}),placeholder:t(`secretExecArgs`)}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:[(0,D.jsx)(v,{value:e.cwd,onChange:e=>K(n,{cwd:e.target.value}),placeholder:t(`secretExecCwd`)}),(0,D.jsx)(v,{type:`number`,min:1,value:e.timeoutMs,onChange:e=>K(n,{timeoutMs:Number.parseInt(e.target.value,10)||5e3}),placeholder:t(`secretExecTimeoutMs`)})]})]})]},`provider-${n}`)),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>H(e=>[...e,k()]),children:[(0,D.jsx)(d,{className:`h-4 w-4 mr-2`}),t(`addSecretProvider`)]})]})]}),(0,D.jsxs)(y,{children:[(0,D.jsxs)(h,{children:[(0,D.jsx)(b,{children:t(`secretRefsTitle`)}),(0,D.jsx)(_,{children:t(`secretRefsDescription`)})]}),(0,D.jsxs)(S,{className:`space-y-3`,children:[U.map((e,n)=>(0,D.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:(0,D.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,D.jsx)(v,{value:e.path,onChange:e=>q(n,{path:e.target.value}),placeholder:t(`secretConfigPath`)}),(0,D.jsx)(v,{value:e.id,onChange:e=>q(n,{id:e.target.value}),placeholder:t(`secretId`)}),(0,D.jsxs)(u,{value:e.source,onValueChange:e=>q(n,{source:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{})}),(0,D.jsx)(c,{children:O.map(e=>(0,D.jsx)(l,{value:e,children:e},e))})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,D.jsxs)(u,{value:e.provider||`__none__`,onValueChange:e=>q(n,{provider:e===`__none__`?``:e}),children:[(0,D.jsx)(s,{children:(0,D.jsx)(o,{placeholder:t(`secretProviderAlias`)})}),(0,D.jsxs)(c,{children:[(0,D.jsx)(l,{value:`__none__`,children:t(`noneOption`)}),G.map(e=>(0,D.jsx)(l,{value:e,children:e},e))]})]}),(0,D.jsx)(a,{type:`button`,variant:`outline`,onClick:()=>W(e=>e.filter((e,t)=>t!==n)),children:(0,D.jsx)(p,{className:`h-4 w-4`})})]})]})},`ref-${n}`)),(0,D.jsxs)(a,{type:`button`,variant:`outline`,onClick:()=>W(e=>[...e,A()]),children:[(0,D.jsx)(d,{className:`h-4 w-4 mr-2`}),t(`addSecretRef`)]})]})]}),(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(a,{type:`button`,onClick:()=>{try{let e={};for(let[n,r]of V.entries()){let i=r.alias.trim();if(!i)throw Error(`${t(`providerAlias`)} #${n+1} ${t(`isRequired`)}`);if(e[i])throw Error(`${t(`providerAlias`)}: ${i} (${t(`duplicate`)})`);if(r.source===`file`&&!r.path.trim())throw Error(`${t(`secretFilePath`)} #${n+1} ${t(`isRequired`)}`);if(r.source===`exec`&&!r.command.trim())throw Error(`${t(`secretExecCommand`)} #${n+1} ${t(`isRequired`)}`);e[i]=M(r)}let n={};for(let[r,i]of U.entries()){let a=i.path.trim(),o=i.id.trim();if(!a)throw Error(`${t(`secretConfigPath`)} #${r+1} ${t(`isRequired`)}`);if(!o)throw Error(`${t(`secretId`)} #${r+1} ${t(`isRequired`)}`);let s=i.provider.trim();if(s&&!e[s])throw Error(`${t(`secretProviderAlias`)}: ${s} ${t(`notFound`)}`);n[a]={source:i.source,...s?{provider:s}:{},id:o}}r.mutate({data:{enabled:N,defaults:{env:F.trim()||null,file:L.trim()||null,exec:z.trim()||null},providers:e,refs:n}})}catch(e){let t=e instanceof Error?e.message:String(e);i.error(t)}},disabled:r.isPending,children:[(0,D.jsx)(f,{className:`h-4 w-4 mr-2`}),r.isPending?t(`saving`):t(`save`)]})})]})}export{N as SecretsConfig};
@@ -0,0 +1,2 @@
1
+ import{_ as e,i as t,m as n,n as r,p as i,t as a,u as o}from"./i18n-CpTZLchQ.js";import{r as s}from"./dist-BruyLa92.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-CVz0t7MF.js";import{t as p}from"./createLucideIcon-dy5ie7Ox.js";import{t as m}from"./hash-BHJC2Ovu.js";import{t as h}from"./refresh-cw-Bcv40SXy.js";import{t as g}from"./search-BCAlB8nz.js";import{i as _,l as v,n as y,t as b,u as x}from"./chat-session-display-DsYHx0RZ.js";import{A as ee,B as te,Dt as S,E as C,M as w,Mt as T,mt as E,wt as D}from"./index-zDZfXoI4.js";import{n as O,t as k}from"./page-layout-0UcO9H9Z.js";import{t as A}from"./useConfirmDialog-BsVuqu1x.js";var j=p(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),M=p(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`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`}]]),N=e(n(),1),P=i(),F=`__unknown_channel__`;function I(e){return r(e)}function L(e){let t=e.indexOf(`:`);return t<=0?F:e.slice(0,t).trim()||F}function R(e){return e===F?t(`sessionsUnknownChannel`):e}function z(e){return e===`service`?`system`:e===`tool`?`tool`:e}function B(e){let t=[];for(let n of e.parts){if(n.type===`text`||n.type===`rich-text`||n.type===`reasoning`){t.push(n.text);continue}if(n.type===`tool-invocation`){let e=n.toolName?.trim()?`[${n.toolName.trim()}]`:`[tool]`;if(n.state===`result`&&typeof n.result==`string`&&n.result.trim()){t.push(`${e} ${n.result.trim()}`);continue}t.push(e)}}return t.join(`
2
+ `).trim()}function V({session:e,summary:t,channel:n,isSelected:r,onSelect:i}){let s=R(n),c=b(e);return(0,P.jsxs)(`button`,{onClick:i,className:o(`w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group`,r?`bg-brand-50 border border-brand-100/50`:`bg-transparent border border-transparent hover:bg-gray-50/80`),children:[(0,P.jsxs)(`div`,{className:`flex items-start justify-between mb-1.5`,children:[(0,P.jsx)(`div`,{className:o(`font-semibold truncate pr-2 flex-1 text-sm`,r?`text-brand-800`:`text-gray-900`),children:c}),(0,P.jsx)(`div`,{className:o(`text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize`,r?`bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]`:`bg-gray-100 text-gray-500`),children:s})]}),(0,P.jsxs)(`div`,{className:o(`flex items-center text-xs justify-between mt-2 font-medium`,r?`text-brand-600/80`:`text-gray-400`),children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,P.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:t.status===`running`?(0,P.jsx)(v,{status:`running`}):null}),(0,P.jsx)(j,{className:`w-3.5 h-3.5 opacity-70`}),(0,P.jsx)(`span`,{className:`truncate max-w-[100px]`,children:a(t.updatedAt)})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(S,{className:`w-3.5 h-3.5 opacity-70`}),(0,P.jsx)(`span`,{children:t.messageCount})]})]})]})}function H({message:e}){let t=z(e.role),n=t===`user`,r=B(e);return(0,P.jsx)(`div`,{className:o(`flex w-full mb-6`,n?`justify-end`:`justify-start`),children:(0,P.jsxs)(`div`,{className:o(`max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm`,n?`bg-primary text-white rounded-tr-sm`:`bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50`),children:[(0,P.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:n?(0,P.jsx)(x,{className:`w-4 h-4 text-primary-100`}):(0,P.jsx)(T,{className:`w-4 h-4 text-gray-400`})}),(0,P.jsxs)(`div`,{className:`flex-1 space-y-1 overflow-x-hidden`,children:[(0,P.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 mb-2`,children:[(0,P.jsx)(`span`,{className:o(`font-semibold text-xs capitalize`,n?`text-primary-50`:`text-gray-900`),children:t}),(0,P.jsx)(`span`,{className:o(`text-[10px]`,n?`text-primary-200`:`text-gray-400`),children:I(e.timestamp)})]}),(0,P.jsx)(`div`,{className:`whitespace-pre-wrap break-words leading-relaxed text-[15px]`,children:r||`-`})]})]})})}function U(){let[e,n]=(0,N.useState)(``),[r]=(0,N.useState)(100),[i,a]=(0,N.useState)(null),[p,x]=(0,N.useState)(`all`),[T,j]=(0,N.useState)(``),[I,z]=(0,N.useState)(``),[B,U]=(0,N.useState)(!1),W=w({limit:r}),G=ee(i,300),K=te(),q=C(),{confirm:ne,ConfirmDialog:re}=A(),J=(0,N.useMemo)(()=>W.data?.sessions??[],[W.data?.sessions]),Y=(0,N.useMemo)(()=>_(J),[J]),X=(0,N.useMemo)(()=>new Map(J.map(e=>[e.sessionId,e])),[J]),Z=(0,N.useMemo)(()=>Y.filter(t=>p!==`all`&&L(t.key)!==p?!1:y(t,e)),[e,p,Y]),Q=(0,N.useMemo)(()=>Y.find(e=>e.key===i)??null,[i,Y]),$=(0,N.useMemo)(()=>i?X.get(i)??null:null,[i,X]),ie=(0,N.useMemo)(()=>{let e=new Set;for(let t of Y)e.add(L(t.key));return Array.from(e).sort((e,t)=>e===F?1:t===F?-1:e.localeCompare(t))},[Y]);return(0,N.useEffect)(()=>{i&&!X.has(i)&&a(null)},[i,X]),(0,N.useEffect)(()=>{Q?(j(Q.label||``),z(Q.preferredModel||``)):(j(``),z(``)),U(!1)},[Q]),(0,P.jsxs)(O,{fullHeight:!0,children:[(0,P.jsx)(k,{title:t(`sessionsPageTitle`),description:t(`sessionsPageDescription`)}),(0,P.jsxs)(`div`,{className:`flex-1 flex gap-6 min-h-0 relative`,children:[(0,P.jsxs)(`div`,{className:`w-[320px] flex flex-col shrink-0 bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden`,children:[(0,P.jsxs)(`div`,{className:`px-4 py-4 border-b border-gray-100 bg-white z-10 shrink-0 space-y-3`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`span`,{className:`text-[11px] font-semibold text-gray-400 uppercase tracking-wider`,children:[Y.length,` `,t(`sessionsListTitle`)]}),(0,P.jsx)(s,{variant:`ghost`,size:`icon`,className:`h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>W.refetch(),children:(0,P.jsx)(h,{className:o(`h-3.5 w-3.5`,W.isFetching&&`animate-spin`)})})]}),(0,P.jsxs)(f,{value:p,onValueChange:x,children:[(0,P.jsx)(l,{className:`w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700`,children:(0,P.jsx)(c,{placeholder:t(`sessionsAllChannels`)})}),(0,P.jsxs)(u,{className:`rounded-xl shadow-lg border-gray-100 max-w-[280px]`,children:[(0,P.jsx)(d,{value:`all`,className:`rounded-lg text-xs`,children:t(`sessionsAllChannels`)}),ie.map(e=>(0,P.jsx)(d,{value:e,className:`rounded-lg text-xs truncate pr-6`,children:R(e)},e))]})]}),(0,P.jsxs)(`div`,{className:`relative w-full`,children:[(0,P.jsx)(g,{className:`h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400`}),(0,P.jsx)(E,{value:e,onChange:e=>n(e.target.value),placeholder:t(`sessionsSearchPlaceholder`),className:`pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs`})]})]}),(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-1 pb-10 custom-scrollbar relative`,children:W.isLoading?(0,P.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`sessionsLoading`)}):Z.length===0?(0,P.jsxs)(`div`,{className:`text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4`,children:[(0,P.jsx)(M,{className:`w-8 h-8 mx-auto mb-2 text-gray-300`}),t(`sessionsEmpty`)]}):Z.map(e=>{let t=X.get(e.key);return t?(0,P.jsx)(V,{session:e,summary:t,channel:L(e.key),isSelected:i===e.key,onSelect:()=>a(e.key)},e.key):null})})]}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200`,children:[(K.isPending||q.isPending)&&(0,P.jsx)(`div`,{className:`absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20`,children:(0,P.jsx)(`div`,{className:`h-full bg-primary animate-pulse w-1/3 rounded-r-full`})}),i&&Q&&$?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-gray-100 bg-white px-8 py-5 z-10 space-y-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,P.jsx)(`div`,{className:`h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0`,children:(0,P.jsx)(m,{className:`h-6 w-6`})}),(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-1.5`,children:[(0,P.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 tracking-tight`,children:b(Q)}),(0,P.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest`,children:R(L(Q.key))}),$.status===`running`?(0,P.jsx)(v,{status:`running`,className:`h-4 w-4`}):null]}),(0,P.jsx)(`div`,{className:`text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70`,title:i,children:i})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,P.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>U(!B),className:o(`h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold`,B?`bg-gray-100 text-gray-900`:`hover:bg-gray-50 hover:text-gray-900`),children:[(0,P.jsx)(D,{className:`w-3.5 h-3.5 mr-1.5`}),t(`sessionsMetadata`)]}),(0,P.jsx)(s,{variant:`outline`,size:`sm`,onClick:async()=>{i&&await ne({title:t(`sessionsDeleteConfirm`)+`?`,variant:`destructive`,confirmLabel:t(`sessionsDeleteConfirm`)})&&q.mutate({sessionId:i},{onSuccess:()=>a(null)})},className:`h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500`,children:t(`delete`)})]})]}),B&&(0,P.jsxs)(`div`,{className:`flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in`,children:[(0,P.jsx)(E,{placeholder:t(`sessionsLabelPlaceholder`),value:T,onChange:e=>j(e.target.value),className:`h-8 text-sm bg-white`}),(0,P.jsx)(E,{placeholder:t(`sessionsModelPlaceholder`),value:I,onChange:e=>z(e.target.value),className:`h-8 text-sm bg-white`}),(0,P.jsx)(s,{size:`sm`,onClick:()=>{i&&(K.mutate({sessionId:i,data:{label:T.trim()||null,preferredModel:I.trim()||null}}),U(!1))},className:`h-8 px-4 shrink-0 shadow-none`,disabled:K.isPending,children:t(`sessionsSaveMeta`)})]})]}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full`,children:[G.isLoading&&(0,P.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10`,children:(0,P.jsxs)(`div`,{className:`flex flex-col items-center gap-3 animate-pulse`,children:[(0,P.jsx)(h,{className:`w-6 h-6 text-primary animate-spin`}),(0,P.jsx)(`span`,{className:`text-sm font-medium text-gray-500`,children:t(`sessionsHistoryLoading`)})]})}),G.error&&(0,P.jsx)(`div`,{className:`text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm`,children:G.error.message}),!G.isLoading&&G.data?.messages.length===0&&(0,P.jsxs)(`div`,{className:`h-full flex flex-col items-center justify-center text-gray-400`,children:[(0,P.jsx)(S,{className:`w-12 h-12 mb-3 text-gray-300`}),(0,P.jsx)(`p`,{className:`text-sm`,children:t(`sessionsEmpty`)})]}),(0,P.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:(G.data?.messages??[]).map(e=>(0,P.jsx)(H,{message:e},e.id))})]})]}):(0,P.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white`,children:[(0,P.jsx)(`div`,{className:`w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3`,children:(0,P.jsx)(M,{className:`h-8 w-8 text-gray-300 -rotate-3`})}),(0,P.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 mb-2`,children:t(`sessionsNoSelectionTitle`)}),(0,P.jsx)(`p`,{className:`text-sm text-center max-w-sm leading-relaxed`,children:t(`sessionsNoSelectionDescription`)})]})]})]}),(0,P.jsx)(re,{})]})}export{U as SessionsConfig};
@@ -1 +1 @@
1
- import{A as e,C as t,E as n,S as r,T as i,b as a,c as o,d as s,f as c,k as l,m as u,p as d,w as f,x as p,y as m}from"./client-CVqPF5ie.js";import{r as h}from"./infiniteQueryBehavior-DHSEQ3OH.js";var g=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new o({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=_(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){d.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>r(t,e))}findAll(e={}){return this.getAll().filter(t=>r(e,t))}notify(e){d.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return d.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function _(e){return e.options.scope?.id}var v=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??p(r,t),a=this.get(i);return a||(a=new s({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){d.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let n={exact:!0,...e};return this.getAll().find(e=>t(n,e))}findAll(e={}){let n=this.getAll();return Object.keys(e).length>0?n.filter(n=>t(e,n)):n}notify(e){d.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){d.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){d.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y=new class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new v,this.#t=e.mutationCache||new g,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=u.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=c.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(n(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=m(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return d.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;d.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return d.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=d.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return d.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=d.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(f)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(f)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let r=this.#e.build(this,t);return r.isStaleByTime(n(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(f).catch(f)}fetchInfiniteQuery(e){return e.behavior=h(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(f).catch(f)}ensureInfiniteQueryData(e){return e.behavior=h(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return c.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(a(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{i(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(a(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{i(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=p(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===l&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}});export{y as t};
1
+ import{A as e,C as t,E as n,S as r,T as i,b as a,c as o,d as s,f as c,k as l,m as u,p as d,w as f,x as p,y as m}from"./client-C-8fH7-c.js";import{r as h}from"./infiniteQueryBehavior-CyER9hv0.js";var g=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new o({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=_(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){d.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>r(t,e))}findAll(e={}){return this.getAll().filter(t=>r(e,t))}notify(e){d.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return d.batch(()=>Promise.all(e.map(e=>e.continue().catch(f))))}};function _(e){return e.options.scope?.id}var v=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??p(r,t),a=this.get(i);return a||(a=new s({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){d.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let n={exact:!0,...e};return this.getAll().find(e=>t(n,e))}findAll(e={}){let n=this.getAll();return Object.keys(e).length>0?n.filter(n=>t(e,n)):n}notify(e){d.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){d.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){d.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y=new class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new v,this.#t=e.mutationCache||new g,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=u.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=c.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(n(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=m(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return d.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;d.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return d.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=d.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(f).catch(f)}invalidateQueries(e,t={}){return d.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=d.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(f)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(f)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let r=this.#e.build(this,t);return r.isStaleByTime(n(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(f).catch(f)}fetchInfiniteQuery(e){return e.behavior=h(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(f).catch(f)}ensureInfiniteQueryData(e){return e.behavior=h(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return c.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(a(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{i(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(a(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{i(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=p(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===l&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}});export{y as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-dy5ie7Ox.js";var t=e(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]);export{t};