libre-webui 0.16.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +232 -154
  2. package/backend/dist/db.d.ts.map +1 -1
  3. package/backend/dist/db.js +155 -6
  4. package/backend/dist/db.js.map +1 -1
  5. package/backend/dist/index.d.ts.map +1 -1
  6. package/backend/dist/index.js +17 -10
  7. package/backend/dist/index.js.map +1 -1
  8. package/backend/dist/middleware/auth.d.ts.map +1 -1
  9. package/backend/dist/middleware/auth.js +35 -3
  10. package/backend/dist/middleware/auth.js.map +1 -1
  11. package/backend/dist/models/userModel.d.ts +23 -0
  12. package/backend/dist/models/userModel.d.ts.map +1 -1
  13. package/backend/dist/models/userModel.js +89 -24
  14. package/backend/dist/models/userModel.js.map +1 -1
  15. package/backend/dist/routes/agentCli.d.ts +3 -0
  16. package/backend/dist/routes/agentCli.d.ts.map +1 -0
  17. package/backend/dist/routes/agentCli.js +35 -0
  18. package/backend/dist/routes/agentCli.js.map +1 -0
  19. package/backend/dist/routes/auth.d.ts.map +1 -1
  20. package/backend/dist/routes/auth.js +46 -33
  21. package/backend/dist/routes/auth.js.map +1 -1
  22. package/backend/dist/routes/chat.d.ts.map +1 -1
  23. package/backend/dist/routes/chat.js +30 -1
  24. package/backend/dist/routes/chat.js.map +1 -1
  25. package/backend/dist/routes/documents.d.ts.map +1 -1
  26. package/backend/dist/routes/documents.js +49 -41
  27. package/backend/dist/routes/documents.js.map +1 -1
  28. package/backend/dist/routes/embeddings.js +2 -2
  29. package/backend/dist/routes/embeddings.js.map +1 -1
  30. package/backend/dist/routes/huggingfaceHub.d.ts.map +1 -1
  31. package/backend/dist/routes/huggingfaceHub.js +3 -1
  32. package/backend/dist/routes/huggingfaceHub.js.map +1 -1
  33. package/backend/dist/routes/imageGen.d.ts.map +1 -1
  34. package/backend/dist/routes/imageGen.js +2 -0
  35. package/backend/dist/routes/imageGen.js.map +1 -1
  36. package/backend/dist/routes/media.d.ts +3 -0
  37. package/backend/dist/routes/media.d.ts.map +1 -0
  38. package/backend/dist/routes/media.js +429 -0
  39. package/backend/dist/routes/media.js.map +1 -0
  40. package/backend/dist/routes/ollama.d.ts.map +1 -1
  41. package/backend/dist/routes/ollama.js +15 -83
  42. package/backend/dist/routes/ollama.js.map +1 -1
  43. package/backend/dist/routes/personas.d.ts.map +1 -1
  44. package/backend/dist/routes/personas.js +2 -0
  45. package/backend/dist/routes/personas.js.map +1 -1
  46. package/backend/dist/routes/plugins.d.ts.map +1 -1
  47. package/backend/dist/routes/plugins.js +28 -0
  48. package/backend/dist/routes/plugins.js.map +1 -1
  49. package/backend/dist/routes/systemDiagnostics.d.ts +3 -0
  50. package/backend/dist/routes/systemDiagnostics.d.ts.map +1 -0
  51. package/backend/dist/routes/systemDiagnostics.js +49 -0
  52. package/backend/dist/routes/systemDiagnostics.js.map +1 -0
  53. package/backend/dist/routes/tts.d.ts.map +1 -1
  54. package/backend/dist/routes/tts.js +4 -0
  55. package/backend/dist/routes/tts.js.map +1 -1
  56. package/backend/dist/routes/users.d.ts.map +1 -1
  57. package/backend/dist/routes/users.js +58 -0
  58. package/backend/dist/routes/users.js.map +1 -1
  59. package/backend/dist/routes/work.d.ts.map +1 -1
  60. package/backend/dist/routes/work.js +107 -2
  61. package/backend/dist/routes/work.js.map +1 -1
  62. package/backend/dist/services/agentCliService.d.ts +30 -0
  63. package/backend/dist/services/agentCliService.d.ts.map +1 -0
  64. package/backend/dist/services/agentCliService.js +328 -0
  65. package/backend/dist/services/agentCliService.js.map +1 -0
  66. package/backend/dist/services/authService.d.ts +15 -9
  67. package/backend/dist/services/authService.d.ts.map +1 -1
  68. package/backend/dist/services/authService.js +34 -29
  69. package/backend/dist/services/authService.js.map +1 -1
  70. package/backend/dist/services/chatGenerationService.d.ts.map +1 -1
  71. package/backend/dist/services/chatGenerationService.js +19 -1
  72. package/backend/dist/services/chatGenerationService.js.map +1 -1
  73. package/backend/dist/services/chatRequestService.d.ts +8 -2
  74. package/backend/dist/services/chatRequestService.d.ts.map +1 -1
  75. package/backend/dist/services/chatRequestService.js +30 -3
  76. package/backend/dist/services/chatRequestService.js.map +1 -1
  77. package/backend/dist/services/documentService.d.ts +11 -10
  78. package/backend/dist/services/documentService.d.ts.map +1 -1
  79. package/backend/dist/services/documentService.js +62 -54
  80. package/backend/dist/services/documentService.js.map +1 -1
  81. package/backend/dist/services/encryptionService.d.ts.map +1 -1
  82. package/backend/dist/services/encryptionService.js +18 -8
  83. package/backend/dist/services/encryptionService.js.map +1 -1
  84. package/backend/dist/services/galleryService.d.ts +23 -1
  85. package/backend/dist/services/galleryService.d.ts.map +1 -1
  86. package/backend/dist/services/galleryService.js +125 -8
  87. package/backend/dist/services/galleryService.js.map +1 -1
  88. package/backend/dist/services/mediaGenerationJobService.d.ts +25 -0
  89. package/backend/dist/services/mediaGenerationJobService.d.ts.map +1 -0
  90. package/backend/dist/services/mediaGenerationJobService.js +82 -0
  91. package/backend/dist/services/mediaGenerationJobService.js.map +1 -0
  92. package/backend/dist/services/pluginAudioGenerationService.d.ts +34 -0
  93. package/backend/dist/services/pluginAudioGenerationService.d.ts.map +1 -0
  94. package/backend/dist/services/pluginAudioGenerationService.js +211 -0
  95. package/backend/dist/services/pluginAudioGenerationService.js.map +1 -0
  96. package/backend/dist/services/pluginCapabilityRegistryService.d.ts.map +1 -1
  97. package/backend/dist/services/pluginCapabilityRegistryService.js +6 -0
  98. package/backend/dist/services/pluginCapabilityRegistryService.js.map +1 -1
  99. package/backend/dist/services/pluginEmbeddingService.d.ts +2 -0
  100. package/backend/dist/services/pluginEmbeddingService.d.ts.map +1 -1
  101. package/backend/dist/services/pluginEmbeddingService.js +66 -35
  102. package/backend/dist/services/pluginEmbeddingService.js.map +1 -1
  103. package/backend/dist/services/pluginImageGenerationService.d.ts +2 -0
  104. package/backend/dist/services/pluginImageGenerationService.d.ts.map +1 -1
  105. package/backend/dist/services/pluginImageGenerationService.js +63 -38
  106. package/backend/dist/services/pluginImageGenerationService.js.map +1 -1
  107. package/backend/dist/services/pluginService.d.ts +38 -1
  108. package/backend/dist/services/pluginService.d.ts.map +1 -1
  109. package/backend/dist/services/pluginService.js +390 -69
  110. package/backend/dist/services/pluginService.js.map +1 -1
  111. package/backend/dist/services/pluginTTSService.d.ts +2 -0
  112. package/backend/dist/services/pluginTTSService.d.ts.map +1 -1
  113. package/backend/dist/services/pluginTTSService.js +27 -2
  114. package/backend/dist/services/pluginTTSService.js.map +1 -1
  115. package/backend/dist/services/pluginUsageService.d.ts +82 -0
  116. package/backend/dist/services/pluginUsageService.d.ts.map +1 -0
  117. package/backend/dist/services/pluginUsageService.js +238 -0
  118. package/backend/dist/services/pluginUsageService.js.map +1 -0
  119. package/backend/dist/services/pluginVideoGenerationService.d.ts +45 -0
  120. package/backend/dist/services/pluginVideoGenerationService.d.ts.map +1 -0
  121. package/backend/dist/services/pluginVideoGenerationService.js +198 -0
  122. package/backend/dist/services/pluginVideoGenerationService.js.map +1 -0
  123. package/backend/dist/services/preferencesService.d.ts.map +1 -1
  124. package/backend/dist/services/preferencesService.js +15 -1
  125. package/backend/dist/services/preferencesService.js.map +1 -1
  126. package/backend/dist/services/registrationPolicy.d.ts +5 -0
  127. package/backend/dist/services/registrationPolicy.d.ts.map +1 -0
  128. package/backend/dist/services/registrationPolicy.js +21 -0
  129. package/backend/dist/services/registrationPolicy.js.map +1 -0
  130. package/backend/dist/services/simpleGitHubOAuth.d.ts.map +1 -1
  131. package/backend/dist/services/simpleGitHubOAuth.js +8 -12
  132. package/backend/dist/services/simpleGitHubOAuth.js.map +1 -1
  133. package/backend/dist/services/simpleHuggingFaceOAuth.d.ts.map +1 -1
  134. package/backend/dist/services/simpleHuggingFaceOAuth.js +7 -12
  135. package/backend/dist/services/simpleHuggingFaceOAuth.js.map +1 -1
  136. package/backend/dist/services/systemDiagnosticsService.d.ts +117 -0
  137. package/backend/dist/services/systemDiagnosticsService.d.ts.map +1 -0
  138. package/backend/dist/services/systemDiagnosticsService.js +326 -0
  139. package/backend/dist/services/systemDiagnosticsService.js.map +1 -0
  140. package/backend/dist/services/turnstileService.d.ts +2 -1
  141. package/backend/dist/services/turnstileService.d.ts.map +1 -1
  142. package/backend/dist/services/turnstileService.js +28 -2
  143. package/backend/dist/services/turnstileService.js.map +1 -1
  144. package/backend/dist/services/workAgentGuidance.js +1 -1
  145. package/backend/dist/services/workAgentGuidance.js.map +1 -1
  146. package/backend/dist/services/workAgentService.d.ts.map +1 -1
  147. package/backend/dist/services/workAgentService.js +37 -0
  148. package/backend/dist/services/workAgentService.js.map +1 -1
  149. package/backend/dist/services/workHostWorkspaceService.d.ts +22 -0
  150. package/backend/dist/services/workHostWorkspaceService.d.ts.map +1 -0
  151. package/backend/dist/services/workHostWorkspaceService.js +136 -0
  152. package/backend/dist/services/workHostWorkspaceService.js.map +1 -0
  153. package/backend/dist/services/workModelProviderService.d.ts +3 -0
  154. package/backend/dist/services/workModelProviderService.d.ts.map +1 -1
  155. package/backend/dist/services/workModelProviderService.js +37 -4
  156. package/backend/dist/services/workModelProviderService.js.map +1 -1
  157. package/backend/dist/services/workPreviewProxyService.d.ts +27 -0
  158. package/backend/dist/services/workPreviewProxyService.d.ts.map +1 -0
  159. package/backend/dist/services/workPreviewProxyService.js +514 -0
  160. package/backend/dist/services/workPreviewProxyService.js.map +1 -0
  161. package/backend/dist/services/workRuntimeService.d.ts +65 -3
  162. package/backend/dist/services/workRuntimeService.d.ts.map +1 -1
  163. package/backend/dist/services/workRuntimeService.js +536 -14
  164. package/backend/dist/services/workRuntimeService.js.map +1 -1
  165. package/backend/dist/services/workTaskService.d.ts +3 -3
  166. package/backend/dist/services/workTaskService.d.ts.map +1 -1
  167. package/backend/dist/services/workTaskService.js +10 -6
  168. package/backend/dist/services/workTaskService.js.map +1 -1
  169. package/backend/dist/services/workTerminalService.d.ts +46 -0
  170. package/backend/dist/services/workTerminalService.d.ts.map +1 -0
  171. package/backend/dist/services/workTerminalService.js +241 -0
  172. package/backend/dist/services/workTerminalService.js.map +1 -0
  173. package/backend/dist/storage.d.ts.map +1 -1
  174. package/backend/dist/storage.js +3 -3
  175. package/backend/dist/storage.js.map +1 -1
  176. package/backend/dist/types/index.d.ts +78 -2
  177. package/backend/dist/types/index.d.ts.map +1 -1
  178. package/backend/dist/types/index.js.map +1 -1
  179. package/backend/dist/types/work.d.ts +53 -0
  180. package/backend/dist/types/work.d.ts.map +1 -1
  181. package/backend/dist/utils/chatDocumentContext.d.ts +1 -1
  182. package/backend/dist/utils/chatDocumentContext.d.ts.map +1 -1
  183. package/backend/dist/utils/chatDocumentContext.js +4 -4
  184. package/backend/dist/utils/chatDocumentContext.js.map +1 -1
  185. package/backend/dist/utils/chatProviderSelection.d.ts.map +1 -1
  186. package/backend/dist/utils/chatProviderSelection.js +7 -5
  187. package/backend/dist/utils/chatProviderSelection.js.map +1 -1
  188. package/backend/dist/utils/pluginDefinitionTrust.js +1 -1
  189. package/backend/dist/utils/pluginValidation.d.ts +3 -2
  190. package/backend/dist/utils/pluginValidation.d.ts.map +1 -1
  191. package/backend/dist/utils/pluginValidation.js +30 -2
  192. package/backend/dist/utils/pluginValidation.js.map +1 -1
  193. package/backend/dist/utils/workGit.d.ts +14 -0
  194. package/backend/dist/utils/workGit.d.ts.map +1 -0
  195. package/backend/dist/utils/workGit.js +207 -0
  196. package/backend/dist/utils/workGit.js.map +1 -0
  197. package/backend/dist/websocketServer.d.ts +1 -0
  198. package/backend/dist/websocketServer.d.ts.map +1 -1
  199. package/backend/dist/websocketServer.js +156 -35
  200. package/backend/dist/websocketServer.js.map +1 -1
  201. package/backend/dist/workTerminalServer.d.ts +17 -0
  202. package/backend/dist/workTerminalServer.d.ts.map +1 -0
  203. package/backend/dist/workTerminalServer.js +226 -0
  204. package/backend/dist/workTerminalServer.js.map +1 -0
  205. package/backend/package.json +1 -1
  206. package/frontend/dist/assets/index-ChhWhug2.css +1 -0
  207. package/frontend/dist/assets/index-CmZntyR1.js +3 -0
  208. package/frontend/dist/assets/xterm-CmMoOwwu.css +1 -0
  209. package/frontend/dist/index.html +28 -6
  210. package/frontend/dist/js/ArtifactContainer-CBAbdoIJ.js +1 -0
  211. package/frontend/dist/js/{ArtifactDemoPage-CWDhGWrz.js → ArtifactDemoPage-BWN0MWCx.js} +1 -1
  212. package/frontend/dist/js/ArtifactSlideOutPanel-D-AvYkfk.js +1 -0
  213. package/frontend/dist/js/{Button-DBk-AREB.js → Button-CRwzOaDZ.js} +1 -1
  214. package/frontend/dist/js/ChatPage-w2FkF_fE.js +16 -0
  215. package/frontend/dist/js/FirstTimeSetup-CzBxl7UH.js +1 -0
  216. package/frontend/dist/js/GalleryPage-Cv8pniRW.js +1 -0
  217. package/frontend/dist/js/HomePage-Vyj4ndU4.js +1 -0
  218. package/frontend/dist/js/LibreClawPage-CYhLgQB-.js +1 -0
  219. package/frontend/dist/js/{ModelManagerModals-DltRprHU.js → ModelManagerModals-C2rwHd01.js} +1 -1
  220. package/frontend/dist/js/ModelSelector-D7kDjZV9.js +1 -0
  221. package/frontend/dist/js/ModelsPage-BnUddkrs.js +2 -0
  222. package/frontend/dist/js/{PersonasPage-C2pqDsWA.js → PersonasPage-BL5XlrEm.js} +2 -2
  223. package/frontend/dist/js/PluginUsagePage-BXqweCCs.js +1 -0
  224. package/frontend/dist/js/RichMessageContent-nAEaPTpH.js +3 -0
  225. package/frontend/dist/js/SettingsModal-DZYCI5-y.js +1 -0
  226. package/frontend/dist/js/SystemPage-jdHYfn9A.js +1 -0
  227. package/frontend/dist/js/UserManagementPage-BpOnt6os.js +1 -0
  228. package/frontend/dist/js/WorkPage-DAp1T1dl.js +5 -0
  229. package/frontend/dist/js/addon-fit-Cj0_dfHF.js +1 -0
  230. package/frontend/dist/js/api-BCqWXjZI.js +19 -0
  231. package/frontend/dist/js/appStore-CDM6V5ny.js +2 -0
  232. package/frontend/dist/js/ar-DS8gs8WK.js +2 -0
  233. package/frontend/dist/js/authStore-Bl5ofD_h.js +4 -0
  234. package/frontend/dist/js/bn-CrMPJwTR.js +2 -0
  235. package/frontend/dist/js/cs-BL116Ezu.js +2 -0
  236. package/frontend/dist/js/da-TDNaKzqy.js +2 -0
  237. package/frontend/dist/js/de-DkIqdAB5.js +2 -0
  238. package/frontend/dist/js/es-CHRXt6Fd.js +2 -0
  239. package/frontend/dist/js/{estree-BRklD62a.js → estree-BFya-bSu.js} +1 -1
  240. package/frontend/dist/js/fr-8715yUKq.js +2 -0
  241. package/frontend/dist/js/hi-C2O08SBU.js +2 -0
  242. package/frontend/dist/js/{html-BgGIAGmn.js → html-DJot0Wwf.js} +1 -1
  243. package/frontend/dist/js/id-Dq7UXUEV.js +2 -0
  244. package/frontend/dist/js/is-B3dbbhSl.js +2 -0
  245. package/frontend/dist/js/it-CLSuu2K7.js +2 -0
  246. package/frontend/dist/js/ja-CthrqyCR.js +2 -0
  247. package/frontend/dist/js/ko-BJvFDJ82.js +2 -0
  248. package/frontend/dist/js/{markdown-CM2nBJJi.js → markdown-CXwWsPYG.js} +1 -1
  249. package/frontend/dist/js/ms-QV0202Mj.js +2 -0
  250. package/frontend/dist/js/nl-Dob1m1pV.js +2 -0
  251. package/frontend/dist/js/pl-urfOKnYI.js +2 -0
  252. package/frontend/dist/js/pt-D52Xkpi0.js +2 -0
  253. package/frontend/dist/js/ru-CwnW9Xe2.js +2 -0
  254. package/frontend/dist/js/{standalone-CUBo-NGt.js → standalone-C0NjJpWr.js} +1 -1
  255. package/frontend/dist/js/sv-BNclj-Fo.js +2 -0
  256. package/frontend/dist/js/th-BlQ4PL57.js +2 -0
  257. package/frontend/dist/js/tr-B80aZ1px.js +2 -0
  258. package/frontend/dist/js/{typescript-Dcy9qxSB.js → typescript-d0TUM2-0.js} +1 -1
  259. package/frontend/dist/js/ui-vendor-ChfdHf5M.js +177 -0
  260. package/frontend/dist/js/uk-DZuuaI56.js +2 -0
  261. package/frontend/dist/js/utils-DmZD5uA3.js +1 -0
  262. package/frontend/dist/js/vi-Bg42fPfF.js +2 -0
  263. package/frontend/dist/js/work-DVgm81bJ.js +1 -0
  264. package/frontend/dist/js/xterm-DKl1QLiw.js +7 -0
  265. package/frontend/dist/js/zh-BSt87zs6.js +2 -0
  266. package/package.json +3 -3
  267. package/plugins/openrouter.json +89 -0
  268. package/backend/dist/services/systemSettingsService.d.ts +0 -12
  269. package/backend/dist/services/systemSettingsService.d.ts.map +0 -1
  270. package/backend/dist/services/systemSettingsService.js +0 -70
  271. package/backend/dist/services/systemSettingsService.js.map +0 -1
  272. package/frontend/dist/assets/index-BVgyQN3z.js +0 -5
  273. package/frontend/dist/assets/index-Dme2Ozol.css +0 -1
  274. package/frontend/dist/js/ArtifactContainer-CbMAYwvr.js +0 -1
  275. package/frontend/dist/js/ArtifactSlideOutPanel-CzUpDM59.js +0 -1
  276. package/frontend/dist/js/ChatPage-D0fdzy7a.js +0 -16
  277. package/frontend/dist/js/FirstTimeSetup-CfnOmy9w.js +0 -1
  278. package/frontend/dist/js/GalleryPage-CMkCur9v.js +0 -1
  279. package/frontend/dist/js/LibreClawPage-CHEfny1k.js +0 -1
  280. package/frontend/dist/js/ModelSelector-COnlNsVM.js +0 -1
  281. package/frontend/dist/js/ModelsPage-nxheiYJp.js +0 -2
  282. package/frontend/dist/js/RichMessageContent-Cz9y-bgl.js +0 -3
  283. package/frontend/dist/js/SettingsModal-B6Se68Hd.js +0 -1
  284. package/frontend/dist/js/UserManagementPage-DQeL-Twp.js +0 -1
  285. package/frontend/dist/js/WorkPage-AcZMp8OB.js +0 -2
  286. package/frontend/dist/js/api-Fi-lJlfu.js +0 -19
  287. package/frontend/dist/js/ar-KceI0PfT.js +0 -2
  288. package/frontend/dist/js/bn-DsKo2dzS.js +0 -2
  289. package/frontend/dist/js/cs-6UKhKj0A.js +0 -2
  290. package/frontend/dist/js/da-CJgZ3YuL.js +0 -2
  291. package/frontend/dist/js/de-BZAmOuCT.js +0 -2
  292. package/frontend/dist/js/es-CD4u7no9.js +0 -2
  293. package/frontend/dist/js/fr-Cou2jOS3.js +0 -2
  294. package/frontend/dist/js/hi-ZxkbNCyB.js +0 -2
  295. package/frontend/dist/js/id-DT9CqaWQ.js +0 -2
  296. package/frontend/dist/js/is-BWSbAIoq.js +0 -2
  297. package/frontend/dist/js/it-CdNoTXm3.js +0 -2
  298. package/frontend/dist/js/ja-CIuQg0xv.js +0 -2
  299. package/frontend/dist/js/ko-BWRUjDOH.js +0 -2
  300. package/frontend/dist/js/ms-gJstIj2a.js +0 -2
  301. package/frontend/dist/js/nl-CydjVNUw.js +0 -2
  302. package/frontend/dist/js/pl-DPN9mAa5.js +0 -2
  303. package/frontend/dist/js/pt-MRXGqIjQ.js +0 -2
  304. package/frontend/dist/js/ru-CvQ9GkJF.js +0 -2
  305. package/frontend/dist/js/sv-BxS2fvhU.js +0 -2
  306. package/frontend/dist/js/th-DMxyn6e4.js +0 -2
  307. package/frontend/dist/js/tr-BTPldUaA.js +0 -2
  308. package/frontend/dist/js/ui-vendor-CAFEDSaO.js +0 -177
  309. package/frontend/dist/js/uk-BGxZOKgp.js +0 -2
  310. package/frontend/dist/js/useBaseQuery-CFTidwqz.js +0 -1
  311. package/frontend/dist/js/useQuery-UsSBfWzs.js +0 -1
  312. package/frontend/dist/js/utils-pTFqSV8c.js +0 -1
  313. package/frontend/dist/js/vi-82JkwFsQ.js +0 -2
  314. package/frontend/dist/js/zh-Bxxfwci3.js +0 -2
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/RichMessageContent-nAEaPTpH.js","js/rolldown-runtime-QTnfLwEv.js","js/markdown-core-GI9BPwrB.js","js/router-vendor-BjDI9mRe.js","js/utils-DmZD5uA3.js","js/utils-vendor-Cbaj0BC5.js","js/appStore-CDM6V5ny.js","js/demoMode-BhEpMVh5.js","js/logger-DbNs3-DK.js","js/markdown-math-E4O1gcxj.js","assets/markdown-math-CYlHEDRF.css","js/SettingsModal-DZYCI5-y.js","js/useTranslation-Cs6iTP4m.js","js/ui-vendor-ChfdHf5M.js","js/api-BCqWXjZI.js","js/authStore-Bl5ofD_h.js","js/Button-CRwzOaDZ.js","js/HomePage-Vyj4ndU4.js","js/work-DVgm81bJ.js","js/ChatPage-w2FkF_fE.js","js/react-vendor-DyG_ODzn.js","js/artifactHtml-B7Oy2e__.js","js/ArtifactContainer-CBAbdoIJ.js","js/OptimizedSyntaxHighlighter-Ci9sRc78.js","js/syntax-highlight-pM1xnNpY.js","js/ModelSelector-D7kDjZV9.js","js/ModelsPage-BnUddkrs.js","js/PersonasPage-BL5XlrEm.js","js/GalleryPage-Cv8pniRW.js","js/LibreClawPage-CYhLgQB-.js","js/WorkPage-DAp1T1dl.js","js/UserManagementPage-BpOnt6os.js","js/PluginUsagePage-BXqweCCs.js","js/SystemPage-jdHYfn9A.js","js/ArtifactDemoPage-BWN0MWCx.js","js/ArtifactSlideOutPanel-D-AvYkfk.js","js/FirstTimeSetup-CzBxl7UH.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"../js/rolldown-runtime-QTnfLwEv.js";import{d as t,f as n}from"../js/markdown-core-GI9BPwrB.js";import{n as r,t as i}from"../js/react-vendor-DyG_ODzn.js";import{_ as a,a as o,c as s,d as c,g as l,h as u,i as d,m as f,n as p,o as m,r as h,s as g,t as _,u as v,v as y}from"../js/router-vendor-BjDI9mRe.js";import{r as b,t as x}from"../js/useTranslation-Cs6iTP4m.js";import{B as S,Bt as C,D as w,F as T,Ft as E,Ht as D,It as O,K as ee,L as te,Mt as ne,N as k,Pt as re,Rt as ie,S as ae,St as oe,U as se,W as ce,Xt as A,Y as le,Zt as ue,an as de,b as fe,bt as pe,c as me,cn as he,dn as ge,en as _e,f as ve,fn as j,h as ye,jt as be,k as xe,kt as Se,n as Ce,nn as we,o as Te,ot as Ee,pn as M,q as De,rn as Oe,s as ke,st as Ae,tt as je,u as Me,v as Ne,vt as Pe,w as Fe,wt as Ie,y as Le,yt as Re}from"../js/ui-vendor-ChfdHf5M.js";import{a as ze,o as Be,t as Ve}from"../js/utils-vendor-Cbaj0BC5.js";import{n as He}from"../js/demoMode-BhEpMVh5.js";import{t as N}from"../js/logger-DbNs3-DK.js";import{A as Ue,O as We,k as Ge,p as Ke}from"../js/api-BCqWXjZI.js";import{i as qe,n as Je,o as Ye,t as P}from"../js/utils-DmZD5uA3.js";import{a as Xe,c as Ze,h as Qe,l as $e,n as F,p as et,r as tt,u as nt}from"../js/authStore-Bl5ofD_h.js";import{t as rt}from"../js/appStore-CDM6V5ny.js";import{t as I}from"../js/Button-CRwzOaDZ.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var it,at,ot={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},st=new(it=new WeakMap,at=new WeakMap,class{constructor(){a(this,it,ot),a(this,at,!1)}setTimeoutProvider(e){f(it,this,e)}setTimeout(e,t){return u(it,this).setTimeout(e,t)}clearTimeout(e){u(it,this).clearTimeout(e)}setInterval(e,t){return u(it,this).setInterval(e,t)}clearInterval(e){u(it,this).clearInterval(e)}});function ct(e){setTimeout(e,0)}var lt=typeof window>`u`||`Deno`in globalThis;function L(){}function ut(e,t){return typeof e==`function`?e(t):e}function dt(e){return typeof e==`number`&&e>=0&&e!==1/0}function ft(e,t){return Math.max(e+(t||0)-Date.now(),0)}function pt(e,t){return typeof e==`function`?e(t):e}function R(e,t){return typeof e==`function`?e(t):e}function mt(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==gt(o,t.options))return!1}else if(!vt(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ht(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_t(t.options.mutationKey)!==_t(a))return!1}else if(!vt(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gt(e,t){return(t?.queryKeyHashFn||_t)(e)}function _t(e){return JSON.stringify(e,(e,t)=>Ct(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function vt(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>vt(e[n],t[n])):!1}var yt=Object.prototype.hasOwnProperty;function bt(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=St(e)&&St(t);if(!r&&!(Ct(e)&&Ct(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:yt.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=bt(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function xt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function St(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ct(e){if(!wt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!wt(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function wt(e){return Object.prototype.toString.call(e)===`[object Object]`}function Tt(e){return new Promise(t=>{st.setTimeout(t,e)})}function Et(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:bt(e,t)}function Dt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ot(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kt=Symbol();function At(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===kt?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jt(e,t){return typeof e==`function`?e(...t):!!e}function Mt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Nt=(()=>{let e=()=>lt;return{isServer(){return e()},setIsServer(t){e=t}}})(),Pt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ft,It,Lt,Rt=new(Ft=new WeakMap,It=new WeakMap,Lt=new WeakMap,class extends Pt{constructor(){super(),a(this,Ft,void 0),a(this,It,void 0),a(this,Lt,void 0),f(Lt,this,e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}})}onSubscribe(){u(It,this)||this.setEventListener(u(Lt,this))}onUnsubscribe(){this.hasListeners()||(u(It,this)?.call(this),f(It,this,void 0))}setEventListener(e){f(Lt,this,e),u(It,this)?.call(this),f(It,this,e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()}))}setFocused(e){u(Ft,this)!==e&&(f(Ft,this,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof u(Ft,this)==`boolean`?u(Ft,this):globalThis.document?.visibilityState!==`hidden`}}),zt=ct;function Bt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=zt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var z=Bt(),Vt,Ht,Ut,Wt=new(Vt=new WeakMap,Ht=new WeakMap,Ut=new WeakMap,class extends Pt{constructor(){super(),a(this,Vt,!0),a(this,Ht,void 0),a(this,Ut,void 0),f(Ut,this,e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}})}onSubscribe(){u(Ht,this)||this.setEventListener(u(Ut,this))}onUnsubscribe(){this.hasListeners()||(u(Ht,this)?.call(this),f(Ht,this,void 0))}setEventListener(e){f(Ut,this,e),u(Ht,this)?.call(this),f(Ht,this,e(this.setOnline.bind(this)))}setOnline(e){u(Vt,this)!==e&&(f(Vt,this,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return u(Vt,this)}});function Gt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function Kt(e){return Math.min(1e3*2**e,3e4)}function qt(e){return(e??`online`)===`online`?Wt.isOnline():!0}var Jt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Yt(e){let t=!1,n=0,r,i=Gt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Jt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Rt.isFocused()&&(e.networkMode===`always`||Wt.isOnline())&&e.canRun(),u=()=>qt(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Nt.isServer()?0:3),o=e.retryDelay??Kt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Tt(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Xt,Zt=(Xt=new WeakMap,class{constructor(){a(this,Xt,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dt(this.gcTime)&&f(Xt,this,st.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nt.isServer()?1/0:300*1e3))}clearGcTimeout(){u(Xt,this)!==void 0&&(st.clearTimeout(u(Xt,this)),f(Xt,this,void 0))}});function Qt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Mt(e,()=>t.signal,()=>n=!0)},u=At(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Ot:Dt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?en:$t,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:$t(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function $t(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function en(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function tn(e,t){return t?$t(e,t)!=null:!1}function nn(e,t){return!t||!e.getPreviousPageParam?!1:en(e,t)!=null}function rn(e,t){y(e,t),t.add(e)}var an,on,sn,B,cn,V,ln,un,H,dn=(an=new WeakMap,on=new WeakMap,sn=new WeakMap,B=new WeakMap,cn=new WeakMap,V=new WeakMap,ln=new WeakMap,un=new WeakMap,H=new WeakSet,class extends Zt{constructor(e){super(),rn(this,H),a(this,an,void 0),a(this,on,void 0),a(this,sn,void 0),a(this,B,void 0),a(this,cn,void 0),a(this,V,void 0),a(this,ln,void 0),a(this,un,void 0),f(un,this,!1),f(ln,this,e.defaultOptions),this.setOptions(e.options),this.observers=[],f(cn,this,e.client),f(B,this,u(cn,this).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,f(on,this,gn(this.options)),this.state=e.state??u(on,this),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return u(an,this)}get promise(){return u(V,this)?.promise}setOptions(e){if(this.options={...u(ln,this),...e},e?._type&&f(an,this,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=gn(this.options);e.data!==void 0&&(this.setState(hn(e.data,e.dataUpdatedAt)),f(on,this,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&u(B,this).remove(this)}setData(e,t){let n=Et(this.state.data,e,this.options);return l(H,this,pn).call(this,{data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){l(H,this,pn).call(this,{type:`setState`,state:e})}cancel(e){let t=u(V,this)?.promise;return u(V,this)?.cancel(e),t?t.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return u(on,this)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>R(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kt||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>pt(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ft(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),u(V,this)?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),u(V,this)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),u(B,this).notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(u(V,this)&&(u(un,this)||l(H,this,fn).call(this)?u(V,this).cancel({revert:!0}):u(V,this).cancelRetry()),this.scheduleGc()),u(B,this).notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||l(H,this,pn).call(this,{type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&u(V,this)?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(u(V,this))return u(V,this).continueRetry(),u(V,this).promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(f(un,this,!0),n.signal)})},i=()=>{let e=At(this.options,t),n=(()=>{let e={client:u(cn,this),queryKey:this.queryKey,meta:this.meta};return r(e),e})();return f(un,this,!1),this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:u(cn,this),state:this.state,fetchFn:i};return r(e),e})();(u(an,this)===`infinite`?Qt(this.options.pages):this.options.behavior)?.onFetch(a,this),f(sn,this,this.state),(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&l(H,this,pn).call(this,{type:`fetch`,meta:a.fetchOptions?.meta}),f(V,this,Yt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Jt&&e.revert&&this.setState({...u(sn,this),fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{l(H,this,pn).call(this,{type:`failed`,failureCount:e,error:t})},onPause:()=>{l(H,this,pn).call(this,{type:`pause`})},onContinue:()=>{l(H,this,pn).call(this,{type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{let e=await u(V,this).start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),u(B,this).config.onSuccess?.(e,this),u(B,this).config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Jt){if(e.silent)return u(V,this).promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw l(H,this,pn).call(this,{type:`error`,error:e}),u(B,this).config.onError?.(e,this),u(B,this).config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}});function fn(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}function pn(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...mn(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...hn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return f(sn,this,e.manual?n:void 0),n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),z.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),u(B,this).notify({query:this,type:`updated`,action:e})})}function mn(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qt(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function hn(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function gn(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var U,W,_n,G,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,K,kn=(U=new WeakMap,W=new WeakMap,_n=new WeakMap,G=new WeakMap,vn=new WeakMap,yn=new WeakMap,bn=new WeakMap,xn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tn=new WeakMap,En=new WeakMap,Dn=new WeakMap,On=new WeakMap,K=new WeakSet,class extends Pt{constructor(e,t){super(),rn(this,K),a(this,U,void 0),a(this,W,void 0),a(this,_n,void 0),a(this,G,void 0),a(this,vn,void 0),a(this,yn,void 0),a(this,bn,void 0),a(this,xn,void 0),a(this,Sn,void 0),a(this,Cn,void 0),a(this,wn,void 0),a(this,Tn,void 0),a(this,En,void 0),a(this,Dn,void 0),a(this,On,new Set),this.options=t,f(U,this,e),f(xn,this,null),f(bn,this,Gt()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(W,this).addObserver(this),Bn(u(W,this),this.options)?l(K,this,An).call(this):this.updateResult(),l(K,this,Pn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vn(u(W,this),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vn(u(W,this),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(K,this,Fn).call(this),l(K,this,In).call(this),u(W,this).removeObserver(this)}setOptions(e){let t=this.options,n=u(W,this);if(this.options=u(U,this).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof R(this.options.enabled,u(W,this))!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);l(K,this,Ln).call(this),u(W,this).setOptions(this.options),t._defaulted&&!xt(this.options,t)&&u(U,this).getQueryCache().notify({type:`observerOptionsUpdated`,query:u(W,this),observer:this});let r=this.hasListeners();r&&Hn(u(W,this),n,this.options,t)&&l(K,this,An).call(this),this.updateResult(),r&&(u(W,this)!==n||R(this.options.enabled,u(W,this))!==R(t.enabled,u(W,this))||pt(this.options.staleTime,u(W,this))!==pt(t.staleTime,u(W,this)))&&l(K,this,jn).call(this);let i=l(K,this,Mn).call(this);r&&(u(W,this)!==n||R(this.options.enabled,u(W,this))!==R(t.enabled,u(W,this))||i!==u(Dn,this))&&l(K,this,Nn).call(this,i)}getOptimisticResult(e){let t=u(U,this).getQueryCache().build(u(U,this),e),n=this.createResult(t,e);return Wn(this,n)&&(f(G,this,n),f(yn,this,this.options),f(vn,this,u(W,this).state)),n}getCurrentResult(){return u(G,this)}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&u(bn,this).status===`pending`&&u(bn,this).reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){u(On,this).add(e)}getCurrentQuery(){return u(W,this)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=u(U,this).defaultQueryOptions(e),n=u(U,this).getQueryCache().build(u(U,this),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return l(K,this,An).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),u(G,this)))}createResult(e,t){let n=u(W,this),r=this.options,i=u(G,this),a=u(vn,this),o=u(yn,this),s=e===n?u(_n,this):e.state,{state:c}=e,l={...c},d=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Bn(e,t),o=i&&Hn(e,n,t,r);(a||o)&&(l={...l,...mn(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:g}=l;p=l.data;let _=!1;if(t.placeholderData!==void 0&&p===void 0&&g===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,_=!0):e=typeof t.placeholderData==`function`?t.placeholderData(u(wn,this)?.state.data,u(wn,this)):t.placeholderData,e!==void 0&&(g=`success`,p=Et(i?.data,e,t),d=!0)}if(t.select&&p!==void 0&&!_)if(i&&p===a?.data&&t.select===u(Sn,this))p=u(Cn,this);else try{f(Sn,this,t.select),p=t.select(p),p=Et(i?.data,p,t),f(Cn,this,p),f(xn,this,null)}catch(e){f(xn,this,e)}u(xn,this)&&(m=u(xn,this),p=u(Cn,this),h=Date.now(),g=`error`);let v=l.fetchStatus===`fetching`,y=g===`pending`,b=g===`error`,x=y&&v,S=p!==void 0,C={status:g,fetchStatus:l.fetchStatus,isPending:y,isSuccess:g===`success`,isError:b,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:l.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:b&&!S,isPaused:l.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:b&&S,isStale:Un(e,t),refetch:this.refetch,promise:u(bn,this),isEnabled:R(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=C.data!==void 0,r=C.status===`error`&&!t,i=e=>{r?e.reject(C.error):t&&e.resolve(C.data)},a=()=>{i(f(bn,this,C.promise=Gt()))},o=u(bn,this);switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||C.data!==o.value)&&a();break;case`rejected`:(!r||C.error!==o.reason)&&a();break}}return C}updateResult(){let e=u(G,this),t=this.createResult(u(W,this),this.options);f(vn,this,u(W,this).state),f(yn,this,this.options),u(vn,this).data!==void 0&&f(wn,this,u(W,this)),!xt(t,e)&&(f(G,this,t),l(K,this,Rn).call(this,{listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!u(On,this).size)return!0;let r=new Set(n??u(On,this));return this.options.throwOnError&&r.add(`error`),Object.keys(u(G,this)).some(t=>{let n=t;return u(G,this)[n]!==e[n]&&r.has(n)})})()}))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(K,this,Pn).call(this)}});function An(e){l(K,this,Ln).call(this);let t=u(W,this).fetch(this.options,e);return e?.throwOnError||(t=t.catch(L)),t}function jn(){l(K,this,Fn).call(this);let e=pt(this.options.staleTime,u(W,this));if(Nt.isServer()||u(G,this).isStale||!dt(e))return;let t=ft(u(G,this).dataUpdatedAt,e)+1;f(Tn,this,st.setTimeout(()=>{u(G,this).isStale||this.updateResult()},t))}function Mn(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(u(W,this)):this.options.refetchInterval)??!1}function Nn(e){l(K,this,In).call(this),f(Dn,this,e),!(Nt.isServer()||R(this.options.enabled,u(W,this))===!1||!dt(u(Dn,this))||u(Dn,this)===0)&&f(En,this,st.setInterval(()=>{(this.options.refetchIntervalInBackground||Rt.isFocused())&&l(K,this,An).call(this)},u(Dn,this)))}function Pn(){l(K,this,jn).call(this),l(K,this,Nn).call(this,l(K,this,Mn).call(this))}function Fn(){u(Tn,this)!==void 0&&(st.clearTimeout(u(Tn,this)),f(Tn,this,void 0))}function In(){u(En,this)!==void 0&&(st.clearInterval(u(En,this)),f(En,this,void 0))}function Ln(){let e=u(U,this).getQueryCache().build(u(U,this),this.options);if(e===u(W,this))return;let t=u(W,this);f(W,this,e),f(_n,this,e.state),this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}function Rn(e){z.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(u(G,this))}),u(U,this).getQueryCache().notify({query:u(W,this),type:`observerResultsUpdated`})})}function zn(e,t){return R(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&R(t.retryOnMount,e)===!1)}function Bn(e,t){return zn(e,t)||e.state.data!==void 0&&Vn(e,t,t.refetchOnMount)}function Vn(e,t,n){if(R(t.enabled,e)!==!1&&pt(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Un(e,t)}return!1}function Hn(e,t,n,r){return(e!==t||R(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Un(e,n)}function Un(e,t){return R(t.enabled,e)!==!1&&e.isStaleByTime(pt(t.staleTime,e))}function Wn(e,t){return!xt(e.getCurrentResult(),t)}var Gn,Kn=(Gn=new WeakMap,class extends Pt{constructor(e={}){super(),a(this,Gn,void 0),this.config=e,f(Gn,this,new Map)}build(e,t,n){let r=t.queryKey,i=t.queryHash??gt(r,t),a=this.get(i);return a||(a=new dn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){u(Gn,this).has(e.queryHash)||(u(Gn,this).set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=u(Gn,this).get(e.queryHash);t&&(e.destroy(),t===e&&u(Gn,this).delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){z.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(Gn,this).get(e)}getAll(){return[...u(Gn,this).values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>mt(e,t)):t}notify(e){z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){z.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){z.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),qn,Jn,q,Yn,Xn,Zn=(qn=new WeakMap,Jn=new WeakMap,q=new WeakMap,Yn=new WeakMap,Xn=new WeakSet,class extends Zt{constructor(e){super(),rn(this,Xn),a(this,qn,void 0),a(this,Jn,void 0),a(this,q,void 0),a(this,Yn,void 0),f(qn,this,e.client),this.mutationId=e.mutationId,f(q,this,e.mutationCache),f(Jn,this,[]),this.state=e.state||$n(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){u(Jn,this).includes(e)||(u(Jn,this).push(e),this.clearGcTimeout(),u(q,this).notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){f(Jn,this,u(Jn,this).filter(t=>t!==e)),this.scheduleGc(),u(q,this).notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){u(Jn,this).length||(this.state.status===`pending`?this.scheduleGc():u(q,this).remove(this))}continue(){return u(Yn,this)?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{l(Xn,this,Qn).call(this,{type:`continue`})},n={client:u(qn,this),meta:this.options.meta,mutationKey:this.options.mutationKey};f(Yn,this,Yt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{l(Xn,this,Qn).call(this,{type:`failed`,failureCount:e,error:t})},onPause:()=>{l(Xn,this,Qn).call(this,{type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(q,this).canRun(this)}));let r=this.state.status===`pending`,i=!u(Yn,this).canStart();try{if(r)t();else{l(Xn,this,Qn).call(this,{type:`pending`,variables:e,isPaused:i}),u(q,this).config.onMutate&&await u(q,this).config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&l(Xn,this,Qn).call(this,{type:`pending`,context:t,variables:e,isPaused:i})}let a=await u(Yn,this).start();return await u(q,this).config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await u(q,this).config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),l(Xn,this,Qn).call(this,{type:`success`,data:a}),a}catch(t){try{await u(q,this).config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await u(q,this).config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw l(Xn,this,Qn).call(this,{type:`error`,error:t}),t}finally{u(q,this).runNext(this)}}});function Qn(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),z.batch(()=>{u(Jn,this).forEach(t=>{t.onMutationUpdate(e)}),u(q,this).notify({mutation:this,type:`updated`,action:e})})}function $n(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var er,tr,nr,rr=(er=new WeakMap,tr=new WeakMap,nr=new WeakMap,class extends Pt{constructor(e={}){super(),a(this,er,void 0),a(this,tr,void 0),a(this,nr,void 0),this.config=e,f(er,this,new Set),f(tr,this,new Map),f(nr,this,0)}build(e,t,n){var r;let i=new Zn({client:e,mutationCache:this,mutationId:f(nr,this,(r=u(nr,this),++r)),options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){u(er,this).add(e);let t=ir(e);if(typeof t==`string`){let n=u(tr,this).get(t);n?n.push(e):u(tr,this).set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(u(er,this).delete(e)){let t=ir(e);if(typeof t==`string`){let n=u(tr,this).get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&u(tr,this).delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ir(e);if(typeof t==`string`){let n=u(tr,this).get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=ir(e);return typeof t==`string`?(u(tr,this).get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){z.batch(()=>{u(er,this).forEach(e=>{this.notify({type:`removed`,mutation:e})}),u(er,this).clear(),u(tr,this).clear()})}getAll(){return Array.from(u(er,this))}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ht(t,e))}findAll(e={}){return this.getAll().filter(t=>ht(e,t))}notify(e){z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return z.batch(()=>Promise.all(e.map(e=>e.continue().catch(L))))}});function ir(e){return e.options.scope?.id}var J,ar,or,sr,cr,lr,ur,dr,fr=(J=new WeakMap,ar=new WeakMap,or=new WeakMap,sr=new WeakMap,cr=new WeakMap,lr=new WeakMap,ur=new WeakMap,dr=new WeakMap,class{constructor(e={}){a(this,J,void 0),a(this,ar,void 0),a(this,or,void 0),a(this,sr,void 0),a(this,cr,void 0),a(this,lr,void 0),a(this,ur,void 0),a(this,dr,void 0),f(J,this,e.queryCache||new Kn),f(ar,this,e.mutationCache||new rr),f(or,this,e.defaultOptions||{}),f(sr,this,new Map),f(cr,this,new Map),f(lr,this,0)}mount(){var e;f(lr,this,(e=u(lr,this),e++,e)),u(lr,this)===1&&(f(ur,this,Rt.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(J,this).onFocus())})),f(dr,this,Wt.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(J,this).onOnline())})))}unmount(){var e;f(lr,this,(e=u(lr,this),e--,e)),u(lr,this)===0&&(u(ur,this)?.call(this),f(ur,this,void 0),u(dr,this)?.call(this),f(dr,this,void 0))}isFetching(e){return u(J,this).findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return u(ar,this).findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return u(J,this).get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=u(J,this).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(pt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return u(J,this).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=u(J,this).get(r.queryHash)?.state.data,a=ut(t,i);if(a!==void 0)return u(J,this).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return z.batch(()=>u(J,this).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return u(J,this).get(t.queryHash)?.state}removeQueries(e){let t=u(J,this);z.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=u(J,this);return z.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=z.batch(()=>u(J,this).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(L).catch(L)}invalidateQueries(e,t={}){return z.batch(()=>(u(J,this).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=z.batch(()=>u(J,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(L)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(L)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=u(J,this).build(this,t);return n.isStaleByTime(pt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(L).catch(L)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(L).catch(L)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Wt.isOnline()?u(ar,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(J,this)}getMutationCache(){return u(ar,this)}getDefaultOptions(){return u(or,this)}setDefaultOptions(e){f(or,this,e)}setQueryDefaults(e,t){u(sr,this).set(_t(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...u(sr,this).values()],n={};return t.forEach(t=>{vt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){u(cr,this).set(_t(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...u(cr,this).values()],n={};return t.forEach(t=>{vt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...u(or,this).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gt(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===kt&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...u(or,this).mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){u(J,this).clear(),u(ar,this).clear()}}),Y=e(n(),1),X=t(),pr=Y.createContext(void 0),mr=e=>{let t=Y.useContext(pr);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},hr=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(pr.Provider,{value:e,children:t}));function gr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _r=Y.createContext(gr()),vr=()=>Y.useContext(_r),yr=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?jt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},br=e=>{Y.useEffect(()=>{e.clearReset()},[e])},xr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||jt(n,[e.error,r])),Sr=Y.createContext(!1),Cr=()=>Y.useContext(Sr);Sr.Provider;var wr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Tr=(e,t)=>e.isLoading&&e.isFetching&&!t,Er=(e,t)=>e?.suspense&&t.isPending,Dr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Or(e,t,n){let r=Cr(),i=vr(),a=mr(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,wr(o),yr(o,i,s),br(i);let l=!a.getQueryCache().get(o.queryHash),[u]=Y.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=f?u.subscribe(z.batchCalls(e)):L;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Y.useEffect(()=>{u.setOptions(o)},[o,u]),Er(o,d))throw Dr(o,u,i);if(xr({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Nt.isServer()&&Tr(d,r)&&(l?Dr(o,u,i):s?.promise)?.catch(L).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function kr(e,t){return Or(e,kn,t)}var Ar=e(i(),1),Z=e=>typeof e==`string`,jr=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Mr=e=>e==null?``:String(e),Nr=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Pr=/###/g,Fr=e=>e&&e.includes(`###`)?e.replace(Pr,`.`):e,Ir=e=>!e||Z(e),Lr=(e,t,n)=>{let r=Z(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Ir(e))return{};let t=Fr(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Ir(e)?{}:{obj:e,k:Fr(r[i])}},Rr=(e,t,n)=>{let{obj:r,k:i}=Lr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Lr(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Lr(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},zr=(e,t,n,r)=>{let{obj:i,k:a}=Lr(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Br=(e,t)=>{let{obj:n,k:r}=Lr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Vr=(e,t,n)=>{let r=Br(e,n);return r===void 0?Br(t,n):r},Hr=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(Object.prototype.hasOwnProperty.call(e,r)?Z(e[r])||e[r]instanceof String||Z(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Hr(e[r],t[r],n):e[r]=t[r]);return e},Ur=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Wr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Gr=e=>Z(e)?e.replace(/[&<>"'\/]/g,e=>Wr[e]):e,Kr=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},qr=[` `,`,`,`?`,`!`,`;`],Jr=new Kr(20),Yr=(e,t,n)=>{t=t||``,n=n||``;let r=qr.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=Jr.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Xr=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Zr=e=>e?.replace(/_/g,`-`),Qr={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},$r=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Qr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>Z(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),Z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ei=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ti=class extends ei{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Z(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Br(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Z(n)?s:Xr(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Rr(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Z(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Br(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Hr(s,n,i):s={...s,...n},Rr(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},ni={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},ri=Symbol(`i18next/PATH_KEY`);function ii(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===ri?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function ai(e,t){let{[ri]:n}=e(ii()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var oi=e=>!Z(e)&&typeof e!=`boolean`&&typeof e!=`number`,si=class e extends ei{constructor(e,t={}){super(),Nr([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=$r.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=oi(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Yr(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Z(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Z(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||(i={}),t==null)return``;typeof t==`function`&&(t=ai(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?ai(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Z(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=oi(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(O)&&!(Z(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:oi(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Z(v)&&Array.isArray(m))m=m.join(v),m&&(m=this.extendTranslation(m,t,i,r));else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Z(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Z(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=ni.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Z(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?ai(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Z(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Z(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Z(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},ci=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$r.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Zr(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Zr(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Z(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Z(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Z(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},li={zero:0,one:1,two:2,few:3,many:4,other:5},ui={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},di=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=$r.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Zr(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),ui;if(!e.match(/-|_/))return ui;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule(`dev`,t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule(`dev`,t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>li[e]-li[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},fi=(e,t,n,r=`.`,i=!0)=>{let a=Vr(e,t,n);return!a&&i&&Z(n)&&(a=Xr(e,n,r),a===void 0&&(a=Xr(t,n,r))),a},pi=e=>e.replace(/\$/g,`$$$$`),mi=class{constructor(e={}){this.logger=$r.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Gr:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?Ur(i):a||`{{`,this.suffix=o?Ur(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?Ur(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?Ur(l):``,this.nestingPrefix=d?Ur(d):f||Ur(`$t(`),this.nestingSuffix=p?Ur(p):m||Ur(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=fi(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(fi(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>pi(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?pi(this.escape(e)):pi(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Z(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!Z(a)&&!this.useRawValueToEscape&&(a=Mr(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${Ur(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Z(i))return i;Z(i)||(i=Mr(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},hi=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||(n.currency=i.trim()):t===`relativetime`&&!i.includes(`:`)?n.range||(n.range=i.trim()):i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},gi=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Zr(r),i),t[o]=s),s(n)}},_i=e=>(t,n,r)=>e(Zr(n),r)(t),vi=class{constructor(e={}){this.logger=$r.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?gi:_i;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=gi(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator),a=[];for(let e=0;e<i.length;e++){let t=i[e];for(;t.indexOf(`(`)>-1&&!t.includes(`)`)&&e+1<i.length;)t=`${t}${this.formatSeparator}${i[++e]}`;a.push(t)}return a.reduce((e,t)=>{let{formatName:i,formatOptions:a}=hi(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},yi=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},bi=class extends ei{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=$r.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{zr(n.loaded,[i],a),yi(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Z(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},xi=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Si=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Ci=()=>{},wi=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Q=class e extends ei{constructor(e={},t){if(super(),this.options=Si(e),this.services={},this.logger=$r,this.modules={external:[]},wi(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Z(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=xi();this.options={...n,...this.options,...Si(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?$r.init(r(this.modules.logger),this.options):$r.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:vi;let t=new ci(this.options);this.store=new ti(this.options.resources,this.options);let n=this.services;n.logger=$r,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new di(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new mi(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new bi(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new si(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ci),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=jr(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Ci){let n=t,r=Z(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=jr();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ci),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&ni.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=jr();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Z(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Z(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=ai(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=ai(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=ai(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return Z(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=jr();return this.options.ns?(Z(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=jr();Z(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new ci(xi());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Ci){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ti(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...xi().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new mi(n)}return a.translator=new si(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var{slice:Ti,forEach:Ei}=[];function Di(e){return Ei.call(Ti.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Oi(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var ki=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ai=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!ki.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!ki.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},ji={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Ai(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},Mi={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return ji.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&ji.create(n,e,r,i,a)}},Ni={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},Pi={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},Fi=null,Ii=()=>{if(Fi!==null)return Fi;try{if(Fi=typeof window<`u`&&window.localStorage!==null,!Fi)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{Fi=!1}return Fi},Li={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&Ii())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Ii()&&window.localStorage.setItem(n,e)}},Ri=null,zi=()=>{if(Ri!==null)return Ri;try{if(Ri=typeof window<`u`&&window.sessionStorage!==null,!Ri)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{Ri=!1}return Ri},Bi={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&zi())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&zi()&&window.sessionStorage.setItem(n,e)}},Vi={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Hi={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},Ui={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Wi={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},Gi=!1;try{document.cookie,Gi=!0}catch{}var Ki=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];Gi||Ki.splice(1,1);var qi=()=>({order:Ki,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),Ji=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Di(t,this.options||{},qi()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Mi),this.addDetector(Ni),this.addDetector(Li),this.addDetector(Bi),this.addDetector(Vi),this.addDetector(Hi),this.addDetector(Ui),this.addDetector(Wi),this.addDetector(Pi)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!Oi(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};Ji.type=`languageDetector`;var Yi={common:{loading:`Loading...`,save:`Save`,saving:`Saving...`,cancel:`Cancel`,delete:`Delete`,edit:`Edit`,close:`Close`,back:`Back`,next:`Next`,confirm:`Confirm`,error:`Error`,success:`Success`,warning:`Warning`,or:`or`,optional:`optional`,enabled:`Enabled`,disabled:`Disabled`,on:`On`,off:`Off`,yes:`Yes`,no:`No`,search:`Search`,noResults:`No results found`,retry:`Retry`,refresh:`Refresh`,download:`Download`,upload:`Upload`,export:`Export`,import:`Import`,reset:`Reset`,apply:`Apply`,clear:`Clear`,all:`All`,none:`None`,default:`Default`,custom:`Custom`,remove:`Remove`},brand:{name:`Libre WebUI`,shortName:`Libre`},auth:{login:{title:`Welcome Back`,subtitle:`Sign in to your account to continue`,username:`Username`,usernamePlaceholder:`Enter your username`,password:`Password`,passwordPlaceholder:`Enter your password`,signIn:`Sign In`,signingIn:`Signing in...`,noAccount:`Don't have an account?`,signUpHere:`Sign up here`,loginSuccess:`Login successful!`,loginFailed:`Login failed`,checkCredentials:`Login failed. Please check your credentials.`,approvalPending:`Your account is waiting for administrator approval.`,enterBoth:`Please enter both username and password`,githubSuccess:`GitHub login successful!`,githubFailed:`GitHub authentication failed`,githubVerifyFailed:`Failed to verify GitHub authentication`},signup:{title:`Create Account`,subtitle:`Sign up for your new account`,username:`Username`,usernamePlaceholder:`Choose a username`,email:`Email`,emailPlaceholder:`your@email.com`,password:`Password`,passwordPlaceholder:`Choose a password`,confirmPassword:`Confirm Password`,confirmPasswordPlaceholder:`Confirm your password`,createAccount:`Create Account`,creatingAccount:`Creating account...`,hasAccount:`Already have an account?`,signInHere:`Sign in here`,signupSuccess:`Account created successfully!`,approvalPending:`Registration received. An administrator must approve your account.`,awaitingApproval:`Awaiting approval`,awaitingApprovalDescription:`Your account has been created, but an administrator must activate it before you can sign in.`,backToSignIn:`Back to sign in`,signupFailed:`Signup failed`,tryAgain:`Signup failed. Please try again.`,usernameRequired:`Username and password are required`,passwordMismatch:`Passwords do not match`,passwordTooShort:`Password must be at least 6 characters long`},logout:{button:`Log out`,success:`Logged out successfully`},oauth:{continueWith:`Continue with {{provider}}`,connectingTo:`Connecting to {{provider}}...`,github:`GitHub`,huggingFace:`Hugging Face`},checkingAuth:`Checking authentication...`,welcome:`Welcome`,noEmail:`No email provided`,role:`Role`,id:`ID`,userId:`User ID`,signInDescription:`Sign in with your GitHub account to continue`,signInWithGitHub:`Sign in with GitHub`,jwtActive:`JWT Authentication Active`,jwtDescription:`JWT-based authentication with GitHub OAuth`,github:`GitHub`,provider:`Provider`,tagline:`Your AI stack should answer to you.`,selfHosted:`Self-hosted · Apache 2.0`,highlights:{local:{title:`Local first`,body:`Your conversations and files stay on the machine you run this on.`},providers:{title:`Any provider`,body:`Local models through Ollama, plus the remote providers you choose to add.`},work:{title:`Isolated Work`,body:`Give a model a sandboxed workspace with files, a terminal, and a preview.`}}},setup:{welcome:{title:`Welcome to Libre WebUI`,subtitle:`Let's Get Started`,description:`Set up your Libre WebUI instance in just a few steps`,createAdmin:`Create Admin Account`,features:{secure:{title:`Secure & Private`,description:`Your conversations stay on your device`},fast:{title:`Fast & Responsive`,description:`Optimized for speed and performance`},openSource:{title:`Open Source`,description:`Free and open source software`}}},admin:{title:`Create Admin Account`,subtitle:`Administrator Setup`,description:`Create the first admin account for your Libre WebUI instance`,usernamePlaceholder:`Enter admin username`,passwordPlaceholder:`Enter password (min 6 characters)`,confirmPlaceholder:`Confirm your password`,creating:`Creating...`,createAdmin:`Create Admin`,success:`Admin account created successfully!`,failed:`Failed to create admin account`,approvalUnexpected:`The initial administrator could not be activated. Please try again.`,fillAllFields:`Please fill in all fields`,note:`This will be the primary administrator account for your Libre WebUI instance`},encryptionKey:{title:`Save Your Encryption Key`,subtitle:`Important: Save This Key`,description:`This encryption key protects your sensitive data. Store it securely - you'll need it if you ever need to restore your database.`,warning:`Warning`,warningText:`If you lose this key and need to restore your database, your encrypted data (API keys, preferences) will be unrecoverable.`,label:`Your Encryption Key`,loading:`Loading...`,copyToClipboard:`Copy to clipboard`,copied:`Encryption key copied to clipboard!`,copyFailed:`Failed to copy key to clipboard`,envNote:`This key is also saved in your backend/.env file as ENCRYPTION_KEY`,acknowledgment:`I have saved my encryption key in a secure location and understand that losing it may result in data loss.`,confirmRequired:`Please confirm that you have saved the encryption key`,continue:`Continue to Libre WebUI`}},chat:{greeting:{morning:`Good morning`,afternoon:`Good afternoon`,evening:`Good evening`,night:`Good night`},welcome:{helpToday:`What can I help with today?`,helpTonight:`What can I help with tonight?`,variety:{create:{title:`What should we make?`,subtitle:`Start with a thought, a sketch, or a stubborn problem.`},explore:{title:`Where should we begin?`,subtitle:`Bring the question you keep returning to.`},imagine:{title:`What are you imagining?`,subtitle:`We can shape it together.`},focus:{title:`What deserves your attention?`,subtitle:`Let's make the next step clear.`},untangle:{title:`What's tangled?`,subtitle:`Give me the messy version first.`},momentum:{title:`Ready when you are.`,subtitle:`Pick up an idea, plan, or unfinished thread.`},open:{title:`What's on your mind?`,subtitle:`Small thought or ambitious project. Both work.`},challenge:{title:`What are we solving?`,subtitle:`Tell me what isn't working yet.`},draft:{title:`Let's start somewhere.`,subtitle:`It doesn't have to be polished.`},possibility:{title:`What could this become?`,subtitle:`Show me the raw material.`},unexpected:{title:`Make something unexpected.`,subtitle:`Give me a constraint, a mood, or a half-formed idea.`}}},input:{placeholder:`Send a message`,messagePlaceholder:`Message...`,attachImages:`Attach images`,attachments:`Attachments and advanced features`,sendMessage:`Send message`,stopGeneration:`Stop generation`},session:{new:`New Chat`,work:`Work`,chat:`Chat`,private:`Private`,incognito:`Incognito Chat`,privateMode:`Private Mode`,privateDescription:`This conversation won't be saved`,privateTooltip:`Start a private conversation that won't be saved`,deleteConfirm:`Are you sure you want to delete this chat?`,generatingTitle:`Generating title`,noChats:`No chats yet`,createFirst:`Create your first chat above`,chats:`Chats`,renameChat:`Rename chat`,deleteChat:`Delete chat`},persona:{applied:`Persona applied`,label:`Persona`,removeFailed:`Failed to remove persona`},model:{updated:`Model updated`,noModels:`No models available`,noModelsDescription:`No models available. Make sure Ollama is running and has models installed.`,pullCommand:`ollama pull llama3.2:3b`,noModelsTooltip:`No models available. Please ensure Ollama is running and models are installed.`,selectBeforePrivateChat:`Select an available model before starting private chat`,selectBeforeSending:`Select an available model before sending`},footer:{disclaimer:`LLM can make mistakes - verify important information`,images:`{{count}} image`,images_plural:`{{count}} images`,structuredOutput:`Structured output`},mediaUpload:{dropImagesHere:`Drop images here or`,supportedFormats:`Supports: JPG, PNG, GIF, WebP (max 10MB each)`,browse:`browse`},structuredOutput:{title:`Response Format`,none:`None (Natural Language)`,noneDescription:`Default natural language response`,json:`JSON`,jsonDescription:`Structured JSON format`,list:`List`,listDescription:`Array of items`,summary:`Summary`,summaryDescription:`Document summary with key points`,analysis:`Analysis`,analysisDescription:`Structured analysis with pros/cons`,custom:`Custom Schema`,customDescription:`Define your own JSON schema`,customSchema:`Custom JSON schema`,schemaPreview:`Schema Preview`,applySchema:`Apply Schema`,cancel:`Cancel`,enabled:`Structured output enabled`}},sidebar:{navigation:{chat:`Chat`,models:`Models`,personas:`Personas`,imagine:`Imagine`,agents:`Agents`,work:`Work`,settings:`Settings`,usageAnalytics:`Provider Usage`,system:`System`,userManagement:`User Management`,signOut:`Sign Out`,exploreLabel:`Explore`},toggleSize:`Toggle sidebar size`,expandSidebar:`Expand sidebar`},user:{menu:{changePicture:`Change Picture`,settings:`Settings`,usageAnalytics:`Provider Usage`,system:`System`,userManagement:`User Management`,logout:`Log out`},avatar:{title:`Change Profile Picture`,updated:`Profile picture updated`,updateFailed:`Failed to update profile picture`,saving:`Saving...`,label:`Avatar`,uploadAvatarImage:`Upload avatar image`,dragAndDrop:`Drag and drop an image or click to browse`,chooseImage:`Choose Image`,uploading:`Uploading...`,enterImageUrl:`Or enter image URL`,supportedFormats:`Supports: JPG, PNG, GIF, WebP (max 2MB). Square images work best.`,customAvatar:`Custom avatar image`,clickToChange:`Click to change or remove`,removed:`Avatar removed`,uploaded:`Avatar uploaded successfully`,invalidFile:`Please select a valid image file`,fileTooLarge:`Avatar image size must be less than 2MB`,readFailed:`Failed to read image file`,uploadFailed:`Failed to upload avatar image`},profile:{noEmail:`No email provided`}},settings:JSON.parse(`{"title":"Settings","tabs":{"appearance":"Appearance","model":"Model","systemMessage":"System Message","plugins":"Plugins","generation":"Generation","documents":"Documents","tts":"Speech","imageGen":"Images","data":"Data","about":"About"},"appearance":{"title":"Appearance","language":{"title":"Language","description":"Select your preferred language"},"theme":{"title":"Theme","light":"Light","dark":"Dark","amoled":"Pure Black","system":"System"},"accent":{"title":"Accent color","custom":"Custom color","useColor":"Use {{color}} accent","behaviorTitle":"Interface palette","behaviorDescription":"Choose whether the accent stays on controls or adapts the entire light or dark interface.","defaultStyle":"Default","defaultStyleDescription":"Keep the neutral light and dark surfaces.","adaptedStyle":"Adapt to accent","adaptedStyleDescription":"Tint surfaces, borders, and text with your accent."},"chatInterface":{"title":"Chat Interface","showUsername":"Show Username","showUsernameDescription":"Display username in chat messages"},"background":{"title":"Background Image","enable":"Enable background image","enableDescription":"Show custom background with blur effect","blur":"Blur","opacity":"Opacity","upload":"Upload background image","dragDrop":"Drag and drop an image or click to browse","chooseImage":"Choose Image"}},"saveSettings":"Save Settings","model":{"title":"Model Settings","defaultModel":"Default Model","defaultModelDescription":"This model will be used by default for new conversations","selectModel":"Select a model","specializedModels":"Specialized Models","visionModel":"Vision Model","selectVisionModel":"Use the current chat model","visionModelDescription":"Used automatically whenever the outgoing chat context contains images. Choose a model that supports image input.","visionModelUpdateFailed":"Failed to update vision model: {{error}}","visionModelNoProvider":"This vision model has no provider identity. Select an available model.","persona":"Persona","updateAll":"Update All Models","updateAllDescription":"Check for updates and pull latest versions of all installed models","updateAllButton":"Update All","updating":"Updating models...","currentModelInfo":"Current Model Info","name":"Name","size":"Size","family":"Family","format":"Format","status":"Status","statusStarting":"Starting...","statusComplete":"Complete","statusError":"Error","bulkOperations":"Bulk Operations","autoTitle":{"title":"Auto Title Generation","enable":"Enable Auto Title","enableDescription":"Automatically generate titles for new conversations","taskModel":"Task Model","selectTaskModel":"Select task model","taskModelDescription":"Model used for generating conversation titles"},"updatingModel":"Updating {{name}} ({{current}}/{{total}})","modelsProgress":"{{current}} of {{total}} models"},"systemMessage":{"title":"System Message","description":"Set a custom system message that will be used for all new conversations.","placeholder":"Enter a system message...","saved":"System message saved","saveFailed":"Failed to save system message"},"plugins":{"title":"Plugins","description":"Manage your installed plugins","providerConnections":"Provider connections","providerConnectionsDescription":"Connect, configure, and inspect model providers through plugins.","providers":"Providers","searchProviders":"Search providers","noProvidersFound":"No providers match your search.","selectProvider":"Select a provider","selectProviderDescription":"Choose a provider to inspect its connection and model catalog.","addNew":"Add New Plugin","upload":"Upload Plugin","addJson":"Add JSON","uploading":"Uploading...","jsonPlaceholder":"Paste plugin JSON configuration...","install":"Install Plugin","noPlugins":"No plugins installed","noPluginsDescription":"Add a plugin to extend functionality","loading":"Loading plugins...","installed":"Installed Plugins","active":"Active Plugins","activeLabel":"Active","inactive":"Inactive","activate":"Activate","deactivate":"Deactivate","models":"models","apiKeySet":"API Key Set","apiKeyConfiguration":"API Key Configuration","apiKeyDescription":"Store a personal API key for {{name}}.","apiKeyEnvAlternative":"Alternatively, set the","environmentVariable":"environment variable","apiKeyConfigured":"API key configured","apiKeyPlaceholder":"Enter your API key...","saveApiKey":"Save API Key","showApiKey":"Show API key","hideApiKey":"Hide API key","configure":"Configure","providerSettings":"Provider settings","status":"Status","defaultEndpoint":"Default endpoint","modelCatalog":"Model catalog","modelCatalogDescription":"Discovered and configured models for this provider and its capabilities.","refreshModels":"Refresh models","noModelsConfigured":"No models are configured for this provider.","modelId":"Model ID","capabilities":"Capabilities","modelCatalogUpdated":"Model catalog updated: {{count}} models.","modelCatalogUnchanged":"Model catalog is already up to date.","modelCatalogNeedsApiKey":"Add a valid API key for this provider to load its live model list.","modelCatalogUnavailable":"Could not load the provider's model list.","modelCatalogRefreshFailed":"Failed to refresh the model catalog","capability":{"chat":"Chat","embedding":"Embedding","image":"Image","speech":"Speech","transcription":"Transcription"},"exportPlugin":"Export plugin","deletePlugin":"Delete plugin","apiKey":{"title":"API Key","placeholder":"Enter API key","save":"Save Key","remove":"Remove Key","configured":"API Key Configured","notConfigured":"API Key Required","saved":"API key saved successfully","removed":"API key removed","saveFailed":"Failed to save API key","removeFailed":"Failed to remove API key","enterKey":"Please enter an API key"},"variables":"Variables"},"generation":{"title":"Generation Options","description":"Configure how the AI generates responses","advancedSettings":"Advanced generation settings","advancedSettingsDescription":"Sampling, token limits, context, penalties, and stop sequences","coreParameters":"Core Parameters","temperature":"Temperature","temperatureDescription":"Controls randomness. Lower values are more focused, higher values more creative.","topP":"Top P","topPDescription":"Controls diversity via nucleus sampling. Lower values focus on likely tokens.","topK":"Top K","topKDescription":"Limits token selection to top K most likely. Set to 0 to disable.","minP":"Min P","minPDescription":"Minimum probability threshold for token selection.","generationControl":"Generation Control","maxTokens":"Max Tokens","maxTokensDescription":"Maximum number of tokens to generate in the response.","repeatPenalty":"Repeat Penalty","repeatPenaltyDescription":"Penalizes repeated tokens. Higher values reduce repetition.","contextLength":"Context Length","contextLengthDescription":"Maximum context window size for conversations.","seed":"Seed","optional":"optional","random":"Random","seedDescription":"Set a specific seed for reproducible outputs.","advancedOptions":"Advanced Options","presencePenalty":"Presence Penalty","presencePenaltyDescription":"Penalizes tokens that appear in the context.","frequencyPenalty":"Frequency Penalty","frequencyPenaltyDescription":"Penalizes frequently used tokens.","stopSequences":"Stop Sequences","commaSeparated":"comma separated","stopSequencesDescription":"Custom tokens that will stop generation when encountered.","resetDefaults":"Reset to Defaults","saveOptions":"Save Options","embeddingSettings":"Embedding Settings","enableEmbeddings":"Enable Document Embeddings"},"documents":{"title":"Document Settings","embeddings":{"title":"Embeddings","enable":"Enable document embeddings","model":"Embedding Model","modelDescription":"Select the model used for document embedding","chunkSize":"Chunk Size","chunkSizeInTokens":"(in tokens)","chunkSizeDescription":"Size of text chunks for embedding","chunkOverlap":"Chunk Overlap","chunkOverlapInTokens":"(in tokens)","chunkOverlapDescription":"Overlap between consecutive chunks","similarityThreshold":"Similarity Threshold","similarityDescription":"Minimum similarity score to include results","status":"Embedding Status","statusLabel":"Status","available":"Available","unavailable":"Unavailable","chunksWithEmbeddings":"Chunks with embeddings","coverage":"Coverage","regenerate":"Regenerate Embeddings","regenerating":"Regenerating..."}},"tts":{"title":"Text-to-Speech","description":"Configure text-to-speech settings for reading messages aloud","loadingProviders":"Loading TTS providers...","noProviders":"No TTS Providers","noProvidersDescription":"Configure a plugin with TTS support to enable text-to-speech","enable":"Enable TTS","enableDescription":"Allow text-to-speech for assistant messages","autoPlay":"Auto-play Responses","autoPlayDescription":"Automatically read new assistant messages aloud","streamSentences":"Stream Sentences","streamSentencesDescription":"Play audio sentence by sentence instead of waiting for the full message. Recommended for local TTS to avoid timeouts on long messages.","voiceConfiguration":"Voice Configuration","model":"TTS Model","modelDescription":"Select the model for text-to-speech generation","voice":"Voice","selectVoice":"Select a voice","voiceDescription":"Choose the voice for text-to-speech","speed":"Speed","speedSlow":"0.5x","speedNormal":"1.0x","speedFast":"2.0x","availableProviders":"Available Providers","models":"models","test":"Test","testing":"Testing...","stop":"Stop"},"imageGen":{"title":"Image Generation","description":"Configure image generation settings and providers","loadingProviders":"Loading image generation providers...","noProviders":"No Image Generation Providers","noProvidersDescription":"Configure a plugin with image generation support","enable":"Enable Image Generation","enableDescription":"Allow AI image generation in conversations","configuration":"Configuration","model":"Model","modelDescription":"Select the model for image generation","size":"Size","sizeDescription":"Resolution of generated images","quality":"Quality","qualityDescription":"Quality level of generated images","style":"Style","styleDescription":"Style preset for generated images","availableProviders":"Available Providers","models":"models"},"data":{"title":"Data Management","export":"Export Data","exportDescription":"Download all your data including preferences, sessions, and documents.","exportAll":"Export All Data","import":"Import Data","importDescription":"Import data from a previous export.","importData":"Import Data","importing":"Importing...","clearSessions":"Clear Sessions","clearSessionsDescription":"Delete all chat sessions. This action cannot be undone.","clearAll":"Clear All","clearing":"Clearing...","importOptions":"Import Options","importOptionsDescription":"Choose how to handle existing data","skipDuplicates":"Skip duplicates","overwrite":"Overwrite existing","importResults":"Import Results","preferences":"Preferences","imported":"Imported","failed":"Failed","sessions":"Sessions","importedLabel":"imported","skipped":"skipped","documents":"Documents","errors":"Errors"},"about":{"title":"About","versionLabel":"Version","ollama":{"title":"Ollama Status","version":"Version","healthy":"Healthy","unhealthy":"Unhealthy"},"stats":{"models":"Models","sessions":"Sessions"},"features":{"privacy":{"title":"Privacy First","description":"Your data stays on your device"},"openSource":{"title":"Open Source","description":"Free and open source software"},"localInference":{"title":"Local Inference","description":"Run AI models locally with Ollama"}},"openSourceBy":"Open source by {{company}}","links":{"title":"Links","github":"GitHub","githubDescription":"View source code and contribute","website":"Website","websiteDescription":"Visit our website","ollama":"Ollama","ollamaDescription":"Learn more about Ollama","documentation":"Documentation","reportIssue":"Report Issues","reportIssueDescription":"Bug reports & feature requests","gitlab":"GitLab Mirror","gitlabDescription":"Self-hosted GitLab repository","documentationDescription":"Guides, tutorials and API reference"},"version":"Version {{version}}"},"groups":{"general":"General","chat":"Chat","media":"Speech & images","connections":"Connections"}}`),models:{title:`Models`,subtitle:`Pull, manage, and monitor your Ollama models`,installed:`Installed Models`,available:`Available Models`,pull:`Pull Model`,pulling:`Pulling...`,delete:`Delete Model`,deleting:`Deleting...`,size:`Size`,modified:`Modified`,family:`Family`,parameters:`Parameters`,quantization:`Quantization`,noModels:`No models installed`,pullFirst:`Pull a model to get started`,noModelsFound:`No models found`},personas:{title:`Personas`,create:`Create Persona`,edit:`Edit Persona`,delete:`Delete Persona`,name:`Name`,description:`Description`,systemPrompt:`System Prompt`,model:`Model`,avatar:`Avatar`,background:`Background`,noPersonas:`No personas created`,createFirst:`Create your first persona to customize your chat experience`},gallery:{title:`Gallery`,subtitle:`Your AI-generated images, videos, and audio`,imageCount:`{{count}} images`,generate:`Generate Image`,generateDescription:`Create images with AI`,generating:`Generating...`,prompt:`Prompt`,promptPlaceholder:`Describe the image you want to generate...`,noImages:`No images generated yet`,download:`Download`,delete:`Delete`,regenerate:`Regenerate`,model:`Model`,size:`Size`,quality:`Quality`,created:`Created`},errors:{generic:`An error occurred`,network:`Network error. Please check your connection.`,unauthorized:`You are not authorized to perform this action.`,notFound:`The requested resource was not found.`,serverError:`Server error. Please try again later.`,validation:`Please check your input and try again.`},keyboard:{title:`Keyboard Shortcuts`,toggleSidebar:`Toggle sidebar`,openSettings:`Open settings`,toggleDarkMode:`Toggle dark mode`,showShortcuts:`Show keyboard shortcuts`,closeModals:`Close modals`,groups:{navigation:`Navigation`,settings:`Settings`,general:`General`,chat:`Chat`},actions:{sendMessage:`Send message`,newLine:`New line in message`},footer:`Press {{key1}} or {{key2}} to show this help`,tooltip:`Keyboard shortcuts`},modelManager:{title:`Models`,loading:`Loading models...`,systemStatus:{online:`Ollama Online`,offline:`Ollama Offline`,models:`model`,models_plural:`models`,running:`running`,vram:`VRAM`},sections:{pull:`Pull New Model`,library:`Browse Library`,huggingface:`HuggingFace Hub`,running:`Running Models`,local:`Local Models`,advanced:`Advanced Actions`},pull:{placeholder:`Enter model name (e.g., llama3.2:3b, deepseek-r1:14b)`,button:`Pull`,cancel:`Cancel`,popular:`Popular models:`,browseAll:`Browse all models on ollama.com`,success:`Model {{name}} pulled successfully`,cancelled:`Model pull cancelled`,failed:`Failed to pull model`,enterName:`Please enter a model name`,restricted:`Model installation is restricted to administrators on this instance.`},progress:{starting:`Initializing...`,pulling:`Downloading model...`,pullingLayer:`pulling`,verifying:`Verifying integrity...`,verifyingDigest:`verifying sha256 digest`,writing:`Writing manifest...`,cleaning:`Cleaning up...`},library:{available:`available`,search:`Search models...`,noResults:`No models found matching your criteria`,installed:`Installed`,more:`+{{count}} more`,refresh:`Refresh Library`},huggingface:{browseAll:`Browse all on HuggingFace`,checkingGguf:`Checking for GGUF files...`,noGgufAvailable:`No GGUF files available for direct Ollama pull`,ggufFilesCount:`GGUF Files ({{count}}) - Pull directly to Ollama`,noModelsFound:`No models found`,noResults:`No models found. Try adjusting your search or filters.`,browseAllLink:`Browse all`,search:`Search HuggingFace models...`,by:`by`,gated:`Gated`,viewOnHF:`View on HuggingFace`,sortDownloads:`Downloads`,sortLikes:`Likes`,sortRecent:`Recent`,taskTextGeneration:`Text Generation`,taskTextToSpeech:`Text to Speech`,taskTextToImage:`Text to Image`,taskSpeechRecognition:`Speech Recognition`,tasks:{textGen:`Text Generation`,tts:`Text to Speech`,image:`Text to Image`,stt:`Speech Recognition`},sort:{downloads:`Most Downloads`,likes:`Most Liked`,recent:`Recently Updated`}},local:{noModels:`No models installed yet`,pullToStart:`Pull a model above to get started`,installed:`installed`,running:`Running`,info:`Info`,copy:`Copy`,delete:`Delete`,deleteConfirm:`Are you sure you want to delete model "{{name}}"?`,deleteSuccess:`Model {{name}} deleted successfully`,deleteFailed:`Failed to delete model`},advanced:{createModel:`Create Model`,fromModelfile:`From Modelfile`,copyModel:`Copy Model`,duplicateExisting:`Duplicate existing`,testEmbeddings:`Test Embeddings`,generateVectors:`Generate vectors`,healthCheck:`Health Check`,testConnection:`Test connection`,healthy:`Ollama is healthy!`},modals:{details:{title:`Model Details`,info:`Model Information`,family:`Family`,parameters:`Parameters`,quantization:`Quantization`,format:`Format`,systemPrompt:`System Prompt`,template:`Template`,license:`License`,modelfile:`Modelfile`,noDetails:`No details available`},copy:{title:`Copy Model`,source:`Source Model`,selectModel:`Select a model...`,newName:`New Model Name`,placeholder:`e.g., my-custom-model`,copying:`Copying...`,button:`Copy Model`,success:`Model copied to {{name}}`,failed:`Failed to copy model`,enterBoth:`Please enter both source and destination names`},create:{title:`Create Custom Model`,name:`Model Name`,namePlaceholder:`e.g., my-assistant`,modelfile:`Modelfile`,modelfilePlaceholder:`FROM llama3.2
3
+ SYSTEM You are a helpful assistant.`,see:`See`,docs:`Modelfile docs`,docsLink:`for syntax reference`,creating:`Creating...`,button:`Create Model`,success:`Model {{name}} created successfully`,failed:`Failed to create model`,enterBoth:`Please enter model name and Modelfile content`},embeddings:{title:`Test Embeddings`,model:`Embedding Model`,selectModel:`Select a model...`,recommended:`Recommended: nomic-embed-text, mxbai-embed-large`,input:`Input Text`,placeholder:`Enter text to generate embeddings for...`,generating:`Generating...`,button:`Generate Embeddings`,result:`Result ({{count}} dimensions)`,success:`Generated {{count}}-dimensional embedding vector`,failed:`Failed to generate embeddings`,enterBoth:`Please select a model and enter text`}}},personaManager:{title:`Personas`,subtitle:`Create and manage AI personas with custom personalities, memories, and behaviors`,loading:`Loading personas...`,createButton:`Create Persona`,importExport:`Import/Export`,stats:{title:`Your Personas`,count:`{{count}} persona created`,count_plural:`{{count}} personas created`},empty:{title:`No personas yet`,description:`Create your first persona to get started with personalized AI interactions`,button:`Create Your First Persona`},deleteConfirm:`Are you sure you want to delete "{{name}}"?`,deleteSuccess:`Persona "{{name}}" deleted successfully`,downloadSuccess:`Persona "{{name}}" downloaded successfully`,failed:`Failed to {{action}} persona`},personaForm:{title:{create:`Create New Persona`,edit:`Edit Persona`},subtitle:{create:`Create a new AI persona with custom personality, memory systems, and adaptive learning capabilities`,edit:`Customize your AI persona with advanced memory, adaptive learning, and intelligent parameters`},loading:`Loading form...`,saved:`Saved`,tabs:{basic:`Basic`,parameters:`Parameters`,memory:`Memory & Learning`,advanced:`Advanced`},basic:{name:`Name`,namePlaceholder:`Enter persona name`,model:`Model`,selectModel:`Select a model`,description:`Description`,descriptionPlaceholder:`Describe your persona...`,systemPrompt:`System Prompt`,systemPromptPlaceholder:`Enter the system prompt that defines your persona behavior...`,systemPromptHint:`The system prompt defines how your persona will behave and respond.`},parameters:{temperature:`Temperature`,temperatureHint:`Controls creativity vs consistency`,topP:`Top-P`,topPHint:`Controls response diversity`,topK:`Top-K`,topKHint:`Limits vocabulary to top-k tokens`,contextWindow:`Context Window`,contextWindowHint:`Maximum conversation history length`,maxTokens:`Max Tokens`,maxTokensHint:`Maximum response length`,repeatPenalty:`Repeat Penalty`,repeatPenaltyHint:`Reduces repetitive responses`},memory:{title:`Memory System`,subtitle:`Persona remembers conversations over time`,enableHint:`Enable the memory system to let your persona remember conversations and build context over time.`,loading:`Loading memory status...`,noData:`No memory data yet`,memories:`Memories`,mbUsed:`MB Used`,lastBackup:`Last Backup`,never:`Never`,maxMemories:`Maximum Memories`,maxMemoriesHint:`How many memories this persona can store`,retention:`Memory Retention`,retentionHint:`Days to keep memories before cleanup`,autoCleanup:`Auto-cleanup old memories`,wipeAll:`Wipe All Memories`,wipeCannot:`This cannot be undone`,wipeButton:`Wipe`,wiping:`Wiping...`,wipeConfirm:`Are you sure you want to wipe all memories? This cannot be undone.`,wipeSuccess:`Wiped {{count}} memories`},learning:{title:`Adaptive Learning`,subtitle:`Persona evolves based on interactions`,enableHint:`Enable adaptive learning to let your persona evolve and personalize responses based on your interactions.`,speed:`Learning Speed`,slow:`Slow`,slowDesc:`Gradual changes`,balanced:`Balanced`,balancedDesc:`Moderate pace`,fast:`Fast`,fastDesc:`Quick adaptation`,autoAdapt:`Auto-adapt to user preferences`,whatLearns:`What the persona learns:`,conversationTone:`Conversation tone`,responseStyle:`Response style`,userPreferences:`User preferences`,topicInterests:`Topic interests`},advanced:{embeddingModel:`Embedding Model`,embeddingHint:`Select the model used for memory encoding and semantic search. Embedding models are shown first, followed by other available models.`,noModels:`No models found`,embeddingModels:`Embedding Models`,otherModels:`Other Models`,installHint:`Install an embedding model:`,recommended:`Recommended: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed`,aboutTitle:`About Advanced Settings`,aboutDescription:`The embedding model is used by the memory system to understand semantic meaning and find relevant memories during conversations. Choose a model that matches your use case and available resources.`},actions:{cancel:`Cancel`,save:`Save`,saving:`Saving...`,saveClose:`Save & Close`,create:`Create`},success:{created:`Persona created`,updated:`Persona updated`},error:{saveFailed:`Failed to save`}},personaCard:{enhanced:`Enhanced`,systemPrompt:`System Prompt`,memories:`memories`,use:`Use`,editTooltip:`Edit persona`,downloadTooltip:`Download persona`,backup:`Backup`,exportDNA:`Export DNA`,wipeMemories:`Wipe Memories`,wipeConfirm:`Are you sure you want to wipe all memories for this persona? This action cannot be undone.`,wipeSuccess:`Wiped {{count}} memories`,backupSuccess:`Persona backup downloaded successfully`,dnaSuccess:`Persona DNA exported successfully`,failed:`Failed to {{action}}`},userManager:{title:`User Management`,subtitle:`Manage user accounts and permissions`,pageDescription:`Manage user accounts, permissions, and access controls for your Libre WebUI instance.`,loading:`Loading users...`,createUser:`Create User`,search:`Search users...`,noUsers:`No users found`,noUsersMatching:`No users matching your search`,columns:{user:`User`,email:`Email`,role:`Role`,created:`Created`,actions:`Actions`},roles:{admin:`Admin`,user:`User`},noEmail:`No email`,deleteConfirm:`Are you sure you want to delete user "{{name}}"?`,deleteSuccess:`User deleted successfully`,deleteFailed:`Failed to delete user`,cannotDeleteSelf:`You cannot delete your own account`,approval:{title:`Pending approvals`,description:`Review new registrations before allowing them into this instance.`,registered:`Registered`,activate:`Activate account`,reject:`Reject registration`,approved:`{{name}} can now sign in.`,failed:`The account could not be approved.`,notification:`{{count}} registration(s) are waiting for your approval.`,notificationBadge:`{{count}} pending user approvals`},form:{title:{create:`Create User`,edit:`Edit User`},username:`Username`,usernamePlaceholder:`Enter username`,email:`Email`,emailPlaceholder:`Enter email (optional)`,password:`Password`,passwordPlaceholder:`Enter password`,passwordHint:`Leave blank to keep current password`,role:`Role`,creating:`Creating...`,updating:`Updating...`,createButton:`Create User`,updateButton:`Update User`,createSuccess:`User created successfully`,updateSuccess:`User updated successfully`,createFailed:`Failed to create user`,updateFailed:`Failed to update user`}},usageAnalytics:{eyebrow:`Administration`,title:`Provider Usage`,description:`Follow outbound API calls and model consumption across the enabled plugins on this instance.`,days:`{{count}} days`,refresh:`Refresh usage`,loadFailed:`Provider usage could not be loaded.`,metrics:{calls:`Calls`,tokens:`Tokens`},cards:{calls:`API calls`,callsDetail:`Across {{count}} active user(s)`,tokens:`Reported tokens`,tokensDetail:`Usage reported on {{count}} call(s)`,success:`Success rate`,successDetail:`{{count}} failed call(s)`,latency:`Average latency`,latencyDetail:`End-to-end provider time`},activity:{title:`Consumption over time`,callsDescription:`Daily outbound requests to enabled plugins`,tokensDescription:`Daily token totals reported by providers`,chartLabel:`Daily provider {{metric}} chart`},models:{title:`Model consumption`,description:`The models carrying the most traffic in this period.`,model:`Model`,success:`Success`,latency:`Latency`},providers:{title:`Enabled plugin traffic`},capabilities:{title:`Capability mix`,characters:`{{count}} characters`,images:`{{count}} images`,jobs:`{{count}} video jobs`,inputs:`{{count}} inputs`,reportedTokens:`{{count}} reported tokens`},empty:{title:`No provider calls yet`,description:`Calls will appear here after an enabled plugin handles chat, Work, embedding, image, speech, sound, or video requests.`},privacyNote:`Usage is metered on the server at the outbound plugin boundary. Libre WebUI stores provider, model, timing, status, and reported counters—never prompts, responses, endpoints, credentials, or provider error bodies. Token totals include only calls where the provider returned usage metadata.`},systemPage:{eyebrow:`Administration`,title:`System`,description:`Monitor the machine and runtime hosting this Libre WebUI instance.`,updated:`Updated {{date}}`,refresh:`Refresh system information`,loadFailed:`System information could not be loaded.`,cards:{uptime:`Host uptime`,uptimeDetail:`Running since {{date}}`,memory:`Memory used`,memoryDetail:`{{used}} of {{total}}`,freeSpace:`Free space`,freeSpaceDetail:`{{label}} · {{total}} total`,containers:`Running containers`,containersDetail:`{{total}} container(s) known to Docker`,dockerUnavailable:`Docker unavailable`,unavailable:`Unavailable`},host:{title:`Host & runtime`,description:`Operating system, processor, and Libre WebUI process details.`,container:`Container runtime`,native:`Native runtime`,hostname:`Hostname`,operatingSystem:`Operating system`,processor:`Processor`,logicalCpus:`logical CPUs`,loadAverage:`Load average · 1 / 5 / 15 min`,libreVersion:`Libre WebUI`,nodeVersion:`Node.js`,process:`Process`,workingDirectory:`Working directory`},memory:{title:`Memory`,description:`Runtime-visible system memory and application process usage.`,usedOf:`{{used}} used of {{total}}`,free:`{{value}} free`,processRss:`Process RSS`,heapUsed:`V8 heap used`,heapTotal:`V8 heap total`,external:`External memory`},storage:{title:`Storage`,description:`Available space for the runtime filesystem and persistent application data.`,used:`{{value}} used`,free:`{{value}} free`,empty:`Filesystem information is unavailable in this runtime.`},docker:{title:`Docker`,description:`Read-only Docker Engine status and a reduced list of containers.`,connected:`Connected`,unavailable:`Unavailable`,unavailableDetail:`Docker Engine diagnostics are unavailable.`,socketStatus:`Local socket: {{status}}`,mounted:`mounted`,notMounted:`not mounted`,running:`Running`,stopped:`Stopped`,paused:`Paused`,total:`Total`,version:`Version`,host:`Host`,architecture:`Architecture`,cpus:`CPUs`,memory:`Memory`,container:`Container`,image:`Image`,state:`State`,created:`Created`,empty:`Docker is connected and no containers are currently listed.`},network:{title:`Network`,description:`Runtime-visible interfaces, addresses, and Linux traffic counters.`,internal:`internal`,empty:`No network interfaces are visible to the application runtime.`},securityNote:`This page is restricted to administrators. The server returns operational summaries only: it does not expose environment variables, credentials, Docker labels, mounts, container commands, or inspect payloads. When Libre WebUI runs in a container, host-level CPU and memory details come from Docker Engine when its local socket is available; other values describe the application runtime.`},chatHistory:{label:`Conversation history`,jumpToTurn:`Jump to turn {{index}} of {{total}}`},chatMessage:{you:`You`,assistant:`Assistant`,system:`System`,copy:`Copy`,copyMessage:`Copy message`,copied:`Copied!`,regenerate:`Regenerate`,regenerateResponse:`Regenerate response`,edit:`Edit`,editSystemMessage:`Edit system message`,saveChanges:`Save changes`,cancelEditing:`Cancel editing`,delete:`Delete`,deleteConfirm:`Delete this message?`,branch:`Branch`,speaking:`Speaking...`,speakMessage:`Speak message`,stopSpeaking:`Stop speaking`,showMore:`Show more`,showLess:`Show less`,thinking:`Thinking`,systemMessagePlaceholder:`Enter your system message...`,fullSizeImage:`Full size image`,startConversation:`Start a conversation`,startConversationDescription:`Send a message to begin chatting with your AI assistant. Ask questions, get help with code, or have a natural conversation.`,scrollToBottom:`Scroll to bottom`,newMessages:`New messages`},imageGallery:{title:`Image Gallery`,noImages:`No images yet`,noImagesHint:`Generate your first image using the panel on the right`,delete:`Delete`,download:`Download`,deleteConfirm:`Are you sure you want to delete this image?`,deleteSuccess:`Image deleted`,deleteFailed:`Failed to delete image`,downloadFailed:`Failed to download image`,loadMore:`Load More ({{current}} of {{total}})`,loadFailed:`Failed to load gallery`},imageGeneration:{title:`Generate Image`,prompt:`Prompt`,promptPlaceholder:`Describe the image you want to create...`,model:`Model`,selectModel:`Select model`,noModels:`No image generation models available`,configurePlugin:`Configure a plugin with image generation support`,size:`Size`,quality:`Quality`,style:`Style`,generate:`Generate`,generating:`Generating...`,success:`Image generated successfully`,failed:`Failed to generate image`,enterPrompt:`Please enter a prompt`,promptTooLong:`Prompt exceeds maximum length of {{max}} characters`},mediaGeneration:{title:`Generate media`,description:`Create video, sound, music, or speech with an activated media provider.`,image:`Image`,video:`Video`,audio:`Audio`,sound:`Sound`,speech:`Speech`,model:`Model`,voice:`Voice or voice ID`,resolution:`Resolution`,aspectRatio:`Aspect ratio`,duration:`Duration`,providerDefault:`Provider default`,generateAudio:`Generate audio with the video when supported`,prompt:`Prompt`,text:`Text to speak`,videoPlaceholder:`Describe the scene, motion, camera, and lighting...`,audioPlaceholder:`Enter the text you want the voice to speak...`,soundPlaceholder:`Describe the sound, music, atmosphere, or spoken response you want...`,generate:`Generate`,generating:`Generating… this can take several minutes`,success:`Media generated and saved to Imagine`,failed:`Failed to generate media`,loadFailed:`Failed to load media providers`,noModels:`No {{kind}} models are available. Activate a compatible provider and save its credential first.`},mediaGallery:{itemCount:`{{count}} items`,empty:`No generated media yet`,emptyHint:`Generate an image, video, or voice clip and it will appear here.`,filters:{all:`All`,image:`Images`,video:`Videos`,audio:`Audio`}},errorBoundary:{title:`Something went wrong`,description:`We encountered an unexpected error. Please try refreshing the page.`,tryAgain:`Refresh Page`,goHome:`Go to Home`,errorDetails:`Error Details (Development)`},documents:{title:`Documents`,upload:`Upload Document`,uploading:`Uploading...`,noDocuments:`No documents uploaded`,uploadHint:`Upload documents to use in your conversations`,delete:`Delete`,deleteConfirm:`Are you sure you want to delete this document?`,deleteSuccess:`Document deleted`,deleteFailed:`Failed to delete document`,uploadSuccess:`Document uploaded successfully`,uploadFailed:`Failed to upload document`,types:`Supported: PDF, TXT, MD, DOCX`,unsupportedFileType:`Only PDF and TXT files are supported`,fileSizeTooLarge:`File size must be less than 10MB`,uploadSuccessWithName:`Document "{{name}}" uploaded successfully`,removeSuccess:`Document removed successfully`,removeFailed:`Failed to remove document`,removeError:`An error occurred while removing the document`,clickToUpload:`Click to upload`,orDragAndDrop:`or drag and drop`,fileTypesAndSize:`PDF or TXT files up to 10MB`,uploadedDocuments:`Uploaded Documents`,removeDocument:`Remove document`},ttsButton:{speak:`Speak`,stop:`Stop`,speaking:`Speaking...`,generateFailed:`Failed to generate speech`,playbackFailed:`Audio playback failed`,stopSpeaking:`Stop speaking`,generatingSpeech:`Generating speech...`,readAloud:`Read aloud`},artifacts:{title:`Artifacts`,code:`Code`,preview:`Preview`,copy:`Copy code`,copied:`Copied!`,download:`Download`,expand:`Expand`,collapse:`Collapse`,openInNewTab:`Open in new tab`,invalidSvg:`Invalid SVG content`,invalidJson:`Invalid JSON content`,previewMode:`Preview mode`,codeMode:`Code mode`,copyContent:`Copy content`,openInPanel:`Open in panel`,openInNewWindow:`Open in new window`,created:`Created`,closePanelEsc:`Close panel (Esc)`,copyButton:`Copy`,open:`Open`,dragEdgeToResize:`Drag edge to resize`,previewUnavailable:`Preview unavailable`,previewUnavailableDescription:`This artifact does not contain renderable preview content. Switch to code view to inspect the source.`},personaImportExport:{title:`Import & Export Personas`,description:`Export your personas to share them or import personas from others`,exportPersonas:`Export Personas`,importPersonas:`Import Personas`,noPersonasToExport:`No personas to export`,personasAvailable:`{{count}} persona available`,personasAvailable_plural:`{{count}} personas available`,exportAll:`Export All`,uploadJsonFile:`Upload JSON File`,pasteJsonLabel:`Paste JSON Data`,pasteJsonPlaceholder:`Paste persona JSON data here...`,importing:`Importing...`,importButton:`Import Persona(s)`,expectedFormat:`Expected JSON Format:`,exportSuccess:`Persona "{{name}}" exported successfully`,exportFailed:`Failed to export persona`,exportAllSuccess:`All {{count}} personas exported successfully`,exportAllFailed:`Failed to export personas`,pasteJsonData:`Please paste the persona JSON data`,importMultipleSuccess:`Successfully imported {{count}} personas`,importMultipleFailed:`Failed to import {{count}} personas`,importNoneFailed:`Failed to import any personas`,importSuccess:`Persona imported successfully`,importFailed:`Failed to import persona`},generationStats:{details:`Details`,promptTokens:`Prompt tokens:`,generatedTokens:`Generated tokens:`,totalTokens:`Total tokens:`,speed:`Speed:`,promptEval:`Prompt eval:`,generation:`Generation:`,modelLoad:`Model load:`,totalTime:`Total time:`,generatedAt:`Generated at:`},userMenu:{loggedOut:`Logged out successfully`,pictureUpdated:`Profile picture updated`,failedUpdateAvatar:`Failed to update avatar`,failedUpdatePicture:`Failed to update profile picture`,noEmail:`No email provided`,changePicture:`Change Picture`,settings:`Settings`,userManagement:`User Management`,signOut:`Sign Out`,changeProfilePicture:`Change Profile Picture`},pluginManager:{title:`Plugin Manager`,upload:`Upload`,addJson:`Add JSON`,browseHF:`Browse HF Hub`,confirmDelete:`Are you sure you want to delete this plugin?`,uploading:`Uploading plugin...`,pasteJson:`Paste plugin JSON here...`,installPlugin:`Install Plugin`,loading:`Loading plugins...`,noPlugins:`No Plugins Installed`,noPluginsDescription:`Upload a plugin file or add a plugin from JSON to get started.`,active:`Active`,id:`ID`,endpoint:`Endpoint`,activate:`Activate`,deactivate:`Deactivate`,activePlugin:`Active Plugin`,activePluginDescription:`All chat requests will be routed through this plugin`,variables:{title:`Variables`,save:`Save`,saving:`Saving...`,saved:`Variables saved`,saveFailed:`Failed to save variables`,resetDefaults:`Reset to Defaults`,reset:`Variables reset to defaults`,resetFailed:`Failed to reset variables`,sensitiveSet:`Value is set (enter new value to change)`,showValue:`Show {{label}} value`,hideValue:`Hide {{label}} value`,connection:`Connection`,advanced:`Advanced parameters`,inherited:`Use provider default`,inheritedValue:`Use provider default ({{value}})`,enabled:`Enabled`,disabled:`Disabled`,required:`A value is required`,fullApiEndpoint:`Full API endpoint URL`,endpointHelp:`Enter the complete request URL, including its operation path (for example, /v1/chat/completions), not only the provider base URL.`,invalidUrl:`Enter a valid full API endpoint URL, for example https://provider.example/v1/chat/completions`,insecureUrl:`API endpoints must use HTTP or HTTPS.`,httpWarning:`HTTP does not encrypt credentials or traffic. Use it only on a trusted network.`,invalidBaseUrl:`Base URLs cannot contain a query string or fragment.`,invalidApiPath:`Must start with / and contain no URL, query, fragment, or .. segment`,tooLong:`Value is too long`}},huggingface:{title:`HuggingFace Model Browser`,subtitle:`Browse and select models from the Hub`,searchPlaceholder:`Search models...`,filters:`Filters`,task:`Task`,sortBy:`Sort By`,noModels:`No models found`,adjustSearch:`Try adjusting your search or filters`,gated:`Gated`,selected:`Selected`,select:`Select`,refresh:`Refresh`,modelsFound:`models found`},demoMode:{title:`Demo Mode`,github:`GitHub`},libreClaw:{title:`Agents`,subtitle:`Local agent runs, approvals, schedules, memory, tools, and usage.`,dashboard:`Dashboard`,connection:{disconnectedTitle:`Libre Claw daemon is not connected`,disconnectedDescription:`Start it locally with <command>libre-claw start</command> or set <env>LIBRE_CLAW_BASE_URL</env> in the backend environment.`},status:{connected:`Connected`,disconnected:`Disconnected`,activeRuns:`{{count}} active`,activeRuns_plural:`{{count}} active`},states:{queued:`Queued`,running:`Running`,blocked:`Blocked`,done:`Done`,failed:`Failed`,cancelled:`Cancelled`},startRun:{title:`Start Agent Run`,placeholder:`Ask Libre Claw to inspect a repo, fix a bug, run a review, schedule a report...`,chatRun:`Chat run`,goalMode:`Goal mode`,providerOverride:`Provider override`,modelOverride:`Model override`,run:`Run`},modelRoute:{title:`Model Route`,providerPlaceholder:`provider`,modelPlaceholder:`model`,persistGlobal:`Persist to Libre Claw global config`,saveModel:`Save model`,theme:`Libre Claw theme`,saveTheme:`Save theme`},runs:{title:`Runs`,empty:`No Libre Claw runs yet.`},timeline:{title:`Run Timeline`,empty:`Select a run to inspect its events.`,streaming:`Streaming...`,assistantResponse:`Assistant response`,resultOk:`ok`,resultError:`error`,labels:{userMessage:`User message`,toolCall:`Tool call`,toolResult:`Tool result`,approvalRequest:`Approval request`,approvalResponse:`Approval response`,runStarted:`Run started`,runFinished:`Run finished`,usage:`Usage`,error:`Error`}},approvals:{needed:`Approval needed`,allowOnce:`Allow once`,alwaysAllowTool:`Always allow tool`,deny:`Deny`,toolApprovalRequested:`Tool approval requested`},automations:{title:`Automations`,namePlaceholder:`Name`,schedulePlaceholder:`daily 09:00`,promptPlaceholder:`Automation prompt`,create:`Create`,empty:`No scheduled Libre Claw automations.`,runNow:`Run now`,pause:`Pause`,resume:`Resume`,routes:{report:`Report`,telegram:`Telegram`},status:{active:`Active`,paused:`Paused`}},usageFallback:{title:`Usage And Fallback`,usage:`Usage`,fallbackRoute:`Fallback Route`,noUsage:`No usage records yet.`},metrics:{provider:`Provider`,model:`Model`,input:`Input`,output:`Output`,cached:`Cached`,reasoning:`Reasoning`,cost:`Cost`,tool:`Tool`,resolution:`Resolution`,state:`State`,stopReason:`Stop reason`,tokens:`{{formatted}} token`,tokens_plural:`{{formatted}} tokens`},fallbacks:{tool:`tool`,unknown:`unknown`,resolved:`resolved`,unknownError:`Unknown error`},toasts:{loadStatusFailed:`Could not load Libre Claw status`,enterTask:`Enter a task for Libre Claw`,runStarted:`Libre Claw run started`,startRunFailed:`Could not start Libre Claw run`,runCancelled:`Run cancelled`,cancelRunFailed:`Could not cancel run`,approved:`Approved`,denied:`Denied`,resolvePermissionFailed:`Could not resolve permission`,providerModelRequired:`Provider and model are required`,modelUpdated:`Libre Claw model updated`,updateModelFailed:`Could not update model`,themeUpdated:`Libre Claw theme updated`,updateThemeFailed:`Could not update theme`,automationRequired:`Automation name, schedule, and prompt are required`,automationCreated:`Automation created`,createAutomationFailed:`Could not create automation`,automationUpdated:`Automation updated`,updateAutomationFailed:`Could not update automation`}},work:{title:`Work`,subtitle:`Isolated model workspaces`,tasks:{title:`Work tasks`,subtitle:`Persistent local workspaces`,new:`New task`,emptyTitle:`No Work tasks yet`,empty:`Your Work tasks will appear here after you send the first message.`,untitled:`Untitled task`,actions:`Task actions`,delete:`Delete task`,deleteNamed:`Delete {{title}}`,deleteConfirm:`Delete “{{title}}” and its workspace permanently?`,close:`Close Work tasks`,open:`Open Work tasks`,rename:`Task title`,loading:`Loading task…`,notFound:`This Work task is unavailable`,back:`Start a new task`,status:`Status: {{status}}`},landing:{title:`Start a new Work task`,description:`Give a local or configured provider model a durable, isolated workspace. It can inspect files, run tools, and continue where it left off when you return.`,isolated:`Isolated`,isolatedBody:`Every task gets its own container and files.`,durable:`Durable`,durableBody:`Return to its conversation and workspace later.`,controlled:`Controlled`,controlledBody:`The runtime and task files stay isolated from the host.`},composer:{placeholder:`Describe what you want to build or change…`,model:`Work model`,noModels:`No Work-compatible models`,cancel:`Stop`,send:`Run`,hint:`Each task keeps its own files and history. Review model output before using it.`,remoteTitle:`Remote provider`,remoteHint:`Conversation and tool output are sent to the configured service. One autonomous run can make multiple provider calls and may incur charges. Workspace files stay local unless a tool returns their contents.`,remoteDismiss:`Dismiss`,remoteDismissLabel:`Dismiss remote provider notice`,remoteDismissFailed:`Could not save the remote provider preference.`,noModelSelected:`No Work-compatible model is selected.`},conversation:{ready:`Workspace ready`,empty:`Continue the task below. This conversation and its files stay attached to this workspace.`,loadOlder:`Load older messages`},status:{preparing:`Preparing isolated workspace…`,running:`Working in the local workspace…`},statusLabels:{idle:`Idle`,thinking:`Thinking`,complete:`Complete`,needsInput:`Needs input`,error:`Error`},live:{connecting:`Connecting to live updates…`,reconnecting:`Reconnecting to live updates…`,unavailable:`Live updates unavailable`,newActivity:`New activity`,skillsLoaded:`Workspace skills · {{count}}`},runtime:{unavailable:`Runtime unavailable`,ready:`Runtime ready`,readyOllama:`Docker ready`,readyPlugin:`Docker + plugin ready`,readyHybrid:`Docker + models ready`,reason:`Docker and an available Ollama or plugin model provider are required.`},workspace:{label:`Workspace views`,files:`Files`,activity:`Activity`,preview:`Preview`,resize:`Resize conversation and workspace`,resizeHint:`Drag to resize. Use arrow keys for precise control. Double-click or press Enter to reset.`,splitSize:`Conversation {{conversation}}%, workspace {{workspace}}%`,terminal:`Terminal`},files:{discard:`Discard unsaved file changes?`,leaveWithDraft:`Leave this file? Your unsaved edit will remain as a browser draft.`,up:`Parent folder`,back:`Back to files`,empty:`No files in this folder yet.`,select:`Select a file to inspect and edit it.`,editorLabel:`File editor: {{path}}`,format:`Format`,formatted:`Code formatted.`,formatFailed:`Could not format this file.`,formatShortcut:`Format (Shift+Alt+F)`,formatTooLarge:`Formatting is limited to files under 100,000 characters and 4,000 lines.`,formatUnsupported:`Formatting is not available for this file type.`,saveShortcut:`Save (⌘/Ctrl+S)`,highlightPaused:`Live highlighting is paused for large files to keep editing responsive.`,plainTextLarge:`Plain text · large file`,changes:`Changes`,changesSince:`What changed since the last turn`,diffLabel:`Changes since the last turn: {{path}}`,diffFolded:`{{count}} unchanged lines`},activity:{empty:`Commands, file operations, and tool results will appear here.`,toolActivity:`Tool activity`,details:`Details`,kinds:{message:`Message`,toolCall:`Tool call`,toolResult:`Tool result`,error:`Error`}},preview:{command:`Optional start command`,start:`Start preview`,stop:`Stop preview`,open:`Open`,starting:`Starting preview…`,frameTitle:`Workspace preview`,failed:`The preview could not start. Check Activity, then try another command.`,empty:`Start the app inside this workspace to inspect it here.`},mobile:{surface:`Task surface`,conversation:`Conversation`,workspace:`Workspace`},toasts:{runFailed:`Could not start the Work task.`,updateFailed:`Could not update this task.`,renameFailed:`Could not rename this task.`,cancelled:`Work run stopped.`,cancelFailed:`Could not stop the Work run.`,deleteFailed:`Could not delete this Work task.`,saveFailed:`Could not save this file.`,saved:`File saved.`,previewFailed:`Could not start the preview.`,previewStopFailed:`Could not stop the preview.`},terminal:{connecting:`Opening a shell in the sandbox…`,closed:`Terminal session ended.`,failed:`The terminal session could not start.`,reconnect:`Reconnect`,unavailable:`The interactive terminal is not available in this deployment.`,blockedByRun:`The model is using this container. The terminal opens when the turn finishes.`,taskRunning:`Model turn in progress`}},personaBackground:{label:`Background Image`,uploadBackgroundImage:`Upload background image`,dragAndDrop:`Drag and drop an image or click to browse`,chooseImage:`Choose Image`,uploading:`Uploading...`,enterImageUrl:`Or enter image URL`,supportedFormats:`Supports: JPG, PNG, GIF, WebP (max 5MB). Wide landscape images work best.`,customBackground:`Custom background image`,clickToChange:`Click to change or remove`,removed:`Background removed`,uploaded:`Background uploaded successfully`,invalidFile:`Please select a valid image file`,fileTooLarge:`Background image size must be less than 5MB`,readFailed:`Failed to read image file`,uploadFailed:`Failed to upload background image`},modelSelector:{searchInstalled:`Search installed models...`,searchOllama:`Search Ollama library...`,searchHuggingFace:`Search HuggingFace...`,selectModel:`Select a model`,personas:`Personas`,ollamaModels:`Ollama Models`,pluginModels:`Plugin Models`,actions:`Actions`,installed:`Installed`,use:`Use`,pull:`Pull`,pullRestricted:`Model installation is restricted to administrators on this instance.`,adminOnlyPull:`Admins only`}},Xi={en:{translation:Yi}},Zi=[{code:`en`,name:`English`,nativeName:`English`,dir:`ltr`},{code:`ar`,name:`Arabic`,nativeName:`العربية`,dir:`rtl`},{code:`bn`,name:`Bengali`,nativeName:`বাংলা`,dir:`ltr`},{code:`cs`,name:`Czech`,nativeName:`Čeština`,dir:`ltr`},{code:`da`,name:`Danish`,nativeName:`Dansk`,dir:`ltr`},{code:`de`,name:`German`,nativeName:`Deutsch`,dir:`ltr`},{code:`es`,name:`Spanish`,nativeName:`Español`,dir:`ltr`},{code:`fr`,name:`French`,nativeName:`Français`,dir:`ltr`},{code:`hi`,name:`Hindi`,nativeName:`हिन्दी`,dir:`ltr`},{code:`id`,name:`Indonesian`,nativeName:`Bahasa Indonesia`,dir:`ltr`},{code:`is`,name:`Icelandic`,nativeName:`Íslenska`,dir:`ltr`},{code:`it`,name:`Italian`,nativeName:`Italiano`,dir:`ltr`},{code:`ja`,name:`Japanese`,nativeName:`日本語`,dir:`ltr`},{code:`ko`,name:`Korean`,nativeName:`한국어`,dir:`ltr`},{code:`ms`,name:`Malay`,nativeName:`Bahasa Melayu`,dir:`ltr`},{code:`nl`,name:`Dutch`,nativeName:`Nederlands`,dir:`ltr`},{code:`pl`,name:`Polish`,nativeName:`Polski`,dir:`ltr`},{code:`pt`,name:`Portuguese`,nativeName:`Português`,dir:`ltr`},{code:`ru`,name:`Russian`,nativeName:`Русский`,dir:`ltr`},{code:`sv`,name:`Swedish`,nativeName:`Svenska`,dir:`ltr`},{code:`th`,name:`Thai`,nativeName:`ไทย`,dir:`ltr`},{code:`tr`,name:`Turkish`,nativeName:`Türkçe`,dir:`ltr`},{code:`uk`,name:`Ukrainian`,nativeName:`Українська`,dir:`ltr`},{code:`vi`,name:`Vietnamese`,nativeName:`Tiếng Việt`,dir:`ltr`},{code:`zh`,name:`Chinese`,nativeName:`中文`,dir:`ltr`}],Qi=[`ar`,`he`,`fa`,`ur`],$i=Zi.map(e=>e.code),ea={en:()=>Promise.resolve(Yi),ar:()=>d(()=>import(`../js/ar-DS8gs8WK.js`).then(e=>e.default),[]),bn:()=>d(()=>import(`../js/bn-CrMPJwTR.js`).then(e=>e.default),[]),cs:()=>d(()=>import(`../js/cs-BL116Ezu.js`).then(e=>e.default),[]),da:()=>d(()=>import(`../js/da-TDNaKzqy.js`).then(e=>e.default),[]),de:()=>d(()=>import(`../js/de-DkIqdAB5.js`).then(e=>e.default),[]),es:()=>d(()=>import(`../js/es-CHRXt6Fd.js`).then(e=>e.default),[]),fr:()=>d(()=>import(`../js/fr-8715yUKq.js`).then(e=>e.default),[]),hi:()=>d(()=>import(`../js/hi-C2O08SBU.js`).then(e=>e.default),[]),id:()=>d(()=>import(`../js/id-Dq7UXUEV.js`).then(e=>e.default),[]),is:()=>d(()=>import(`../js/is-B3dbbhSl.js`).then(e=>e.default),[]),it:()=>d(()=>import(`../js/it-CLSuu2K7.js`).then(e=>e.default),[]),ja:()=>d(()=>import(`../js/ja-CthrqyCR.js`).then(e=>e.default),[]),ko:()=>d(()=>import(`../js/ko-BJvFDJ82.js`).then(e=>e.default),[]),ms:()=>d(()=>import(`../js/ms-QV0202Mj.js`).then(e=>e.default),[]),nl:()=>d(()=>import(`../js/nl-Dob1m1pV.js`).then(e=>e.default),[]),pl:()=>d(()=>import(`../js/pl-urfOKnYI.js`).then(e=>e.default),[]),pt:()=>d(()=>import(`../js/pt-D52Xkpi0.js`).then(e=>e.default),[]),ru:()=>d(()=>import(`../js/ru-CwnW9Xe2.js`).then(e=>e.default),[]),sv:()=>d(()=>import(`../js/sv-BNclj-Fo.js`).then(e=>e.default),[]),th:()=>d(()=>import(`../js/th-BlQ4PL57.js`).then(e=>e.default),[]),tr:()=>d(()=>import(`../js/tr-B80aZ1px.js`).then(e=>e.default),[]),uk:()=>d(()=>import(`../js/uk-DZuuaI56.js`).then(e=>e.default),[]),vi:()=>d(()=>import(`../js/vi-Bg42fPfF.js`).then(e=>e.default),[]),zh:()=>d(()=>import(`../js/zh-BSt87zs6.js`).then(e=>e.default),[])},ta=e=>{let t=e?.toLowerCase().split(`-`)[0];return $i.includes(t)?t:`en`},na=e=>Qi.includes(ta(e)),ra=e=>{if(typeof document>`u`)return;let t=ta(e);document.documentElement.lang=t,document.documentElement.dir=na(t)?`rtl`:`ltr`},ia=async e=>{let t=ta(e);if(!Q.hasResourceBundle(t,`translation`)){let e=await ea[t]();Q.addResourceBundle(t,`translation`,e,!0,!0)}return t},aa=async e=>{let t=await ia(e);return await Q.changeLanguage(t),t};if(typeof window<`u`){let e=navigator.language;try{e=window.localStorage.getItem(`i18nextLng`)||e}catch{}ra(e),Q.on(`languageChanged`,ra)}var oa=(async()=>{Q.isInitialized||await Q.use(Ji).use(b).init({resources:Xi,fallbackLng:`en`,supportedLngs:$i,nonExplicitSupportedLngs:!0,load:`languageOnly`,debug:!1,interpolation:{escapeValue:!1},detection:{order:[`localStorage`,`navigator`,`htmlTag`],caches:[`localStorage`],lookupLocalStorage:`i18nextLng`}});let e=ta(Q.language||Q.resolvedLanguage);if(e!==`en`)try{await ia(e),ta(Q.language)===e&&await Q.changeLanguage(e)}catch{await Q.changeLanguage(`en`)}ra(Q.resolvedLanguage||Q.language||`en`)})(),sa={id:`home`,kind:`home`,path:`/`},ca=[`/models`,`/personas`,`/gallery`,`/agents`,`/users`,`/usage`,`/system`,`/artifacts`],la=e=>{if(e===`/`||e===`/home`)return sa;if(e===`/chat`)return{id:`chat:new`,kind:`chat`,path:`/chat`};let t=e.match(/^\/c\/([^/]+)$/);if(t)return{id:`chat:${t[1]}`,kind:`chat`,path:e};if(e===`/work`)return{id:`work:new`,kind:`work`,path:`/work`};let n=e.match(/^\/work\/([^/]+)$/);return n?{id:`work:${n[1]}`,kind:`work`,path:e}:ca.includes(e)?{id:`page:${e}`,kind:`page`,path:e}:null},ua=e=>[sa,...e.filter(e=>e.id!==sa.id)],da=Be()(Ve((e,t)=>({tabs:[sa],activeTabId:sa.id,syncWithPath:t=>{let n=la(t);n&&e(e=>{let t=ua(e.tabs),r=t.find(e=>e.id===n.id);if(r)return{tabs:t,activeTabId:r.id};let i=t.find(t=>t.id===e.activeTabId);return i&&i.kind===n.kind&&i.id.endsWith(`:new`)&&!n.id.endsWith(`:new`)?{tabs:t.map(e=>e.id===i.id?n:e),activeTabId:n.id}:{tabs:[...t,n],activeTabId:n.id}})},closeTab:e=>t().closeTabs([e]),closeTabs:(n,r)=>{let i=t(),a=ua(i.tabs),o=new Set(n.filter(e=>e!==sa.id&&a.some(t=>t.id===e)));if(o.size===0)return null;let s=a.findIndex(e=>e.id===i.activeTabId),c=a.filter(e=>!o.has(e.id));if(!o.has(i.activeTabId))return e({tabs:c}),null;let l=r?c.find(e=>e.id===r):void 0,u=a.slice(0,Math.max(0,s)).reverse().find(e=>!o.has(e.id)),d=l??u??c[0]??sa;return e({tabs:c,activeTabId:d.id}),d},reset:()=>e({tabs:[sa],activeTabId:sa.id})}),{name:`libre-webui-tabs`,merge:(e,t)=>{let n=e??{},r=Array.isArray(n.tabs)?ua(n.tabs.filter(e=>!!e&&typeof e.id==`string`&&typeof e.path==`string`&&la(e.path)?.id===e.id)):t.tabs,i=r.some(e=>e.id===n.activeTabId)?n.activeTabId:sa.id;return{...t,tabs:r,activeTabId:i}}})),fa=`welcomePromptIndex`,pa=`libre:welcome-prompt-change`,ma=[`time`,`create`,`explore`,`imagine`,`focus`,`untangle`,`momentum`,`open`,`challenge`,`draft`,`possibility`,`unexpected`],ha=0,ga=e=>Number.isInteger(e)&&e>=0&&e<ma.length,_a=()=>{if(typeof window>`u`)return ha;try{let e=window.sessionStorage.getItem(fa),t=Number(e);e!==null&&ga(t)&&(ha=t)}catch{}return ha},va=()=>{let e=(_a()+1)%ma.length;if(ha=e,typeof window<`u`){try{window.sessionStorage.setItem(fa,String(e))}catch{}window.dispatchEvent(new Event(pa))}return e},ya=e=>ma[e]??`time`,ba=r(),xa=({label:e,error:t,helper:n,className:r,id:i,...a})=>{let o=(0,Y.useId)(),s=i||`input-${o}`;return(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,X.jsx)(`label`,{htmlFor:s,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,X.jsx)(`input`,{id:s,className:P(`block w-full rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`placeholder:text-ink-subtle transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus-visible:outline-none dark:focus:border-primary-400 dark:focus:ring-primary-400/20`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,r),...a}),t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-ink-muted`,children:n})]})},Sa=Y.forwardRef(({label:e,error:t,helper:n,className:r,id:i,...a},o)=>{let s=(0,Y.useId)(),c=i||`textarea-${s}`;return(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,X.jsx)(`label`,{htmlFor:c,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,X.jsx)(`textarea`,{ref:o,id:c,className:P(`block w-full resize-none rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`placeholder:text-ink-subtle transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus-visible:outline-none dark:focus:border-primary-400 dark:focus:ring-primary-400/20`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,r),...a}),t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-ink-muted`,children:n})]})});Sa.displayName=`Textarea`;var Ca=({label:e,error:t,helper:n,options:r,className:i,id:a,...o})=>{let s=(0,Y.useId)(),c=a||`select-${s}`;return(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[e&&(0,X.jsx)(`label`,{htmlFor:c,className:`block text-sm font-medium tracking-[-0.005em] text-ink-muted`,children:e}),(0,X.jsx)(`select`,{id:c,className:P(`block w-full rounded-xl border border-line bg-surface-raised px-3.5 py-2.5 text-base text-ink shadow-none`,`transition-[background-color,border-color,box-shadow,color] duration-150 ease-out`,`focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 focus-visible:outline-none dark:focus:border-primary-400 dark:focus:ring-primary-400/20`,`disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-subtle disabled:opacity-70`,t&&`border-error-500 focus:border-error-500 focus:ring-error-500/20`,i),...o,children:r.map((e,t)=>(0,X.jsx)(`option`,{value:e.value,children:e.label},e.key??`${e.value}-${t}`))}),t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-error-600 dark:text-error-400`,children:t}),n&&!t&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-ink-muted`,children:n})]})},wa=[/^ {0,3}(?:`{3,}|~{3,})/m,/`[^`\n]+`/,/^\s{0,3}#{1,6}\s/m,/^\s{0,3}[-*+]\s/m,/^\s{0,3}\d+\.\s/m,/^\s{0,3}>\s/m,/\[[^\]]+\]\([^)]+\)/,/!\[[^\]]*]\([^)]+\)/,/\|.*\|/,/\*\*[^*]+\*\*/,/__[^_]+__/,/~~[^~]+~~/,/\\\[[\s\S]*?\\\]/,/\\\([\s\S]*?\\\)/,/\$\$[\s\S]*?\$\$/,/(^|[^$])\$[^$\n]+\$/],Ta=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Ea(e){let t=[],n=/^( {0,3})(`{3,}|~{3,})([^\n\r]*)(?:\r?\n|$)/gm,r;for(;r=n.exec(e);){let i=r[1].length,a=r[2],o=a[0],s=r[3].trim();if(o==="`"&&s.includes("`"))continue;let c=n.lastIndex,l=RegExp(`^ {0,3}${Ta(o)}{${a.length},}[ \\t]*(?:\\r?\\n|$)`,`gm`);l.lastIndex=c;let u=l.exec(e),d=s.split(/\s+/)[0]||null;if(!u){t.push({start:r.index,end:e.length,codeStart:c,codeEnd:e.length,indent:i,language:d,complete:!1});break}t.push({start:r.index,end:l.lastIndex,codeStart:c,codeEnd:u.index,indent:i,language:d,complete:!0}),n.lastIndex=l.lastIndex}return t}function Da(e){return/<(?:html|head|body)(?:\s|>)|<\/(?:head|body|html)\s*>/i.test(e)}function Oa(e,t){return e.start<t.end&&t.start<e.end}function ka(e,t){let n=/^( {0,3})(<!doctype\s+html(?:\s|>|$)|<html(?:\s[^>\n\r]*)?>)/gim,r;for(;r=n.exec(e);){let n=r.index+r[1].length;if(t.some(e=>n>=e.start&&n<e.end))continue;let i=e.slice(n);if(!Da(i.slice(r[2].length)))continue;let a=/<\/html\s*>/i.exec(i),o=a?n+a.index+a[0].length:e.length;return{start:r.index,end:o,codeStart:n,codeEnd:o,indent:0,language:`html`,complete:!!a}}return null}function Aa(e){let t=Ea(e),n=ka(e,t);return n?[...t.filter(e=>!Oa(e,n)),n].sort((e,t)=>e.start-t.start):t}function ja(e,t){return t===0?e:e.replace(RegExp(`^ {1,${t}}`,`gm`),``)}function Ma(e){return wa.some(t=>t.test(e))}function Na(e){let t=[],n=Aa(e),r=0;for(let i of n){let n=e.slice(r,i.start);n&&t.push({type:`text`,content:n}),t.push({type:`code`,language:i.language,content:ja(e.slice(i.codeStart,i.codeEnd),i.indent),complete:i.complete}),r=i.end}let i=e.slice(r);return(i||t.length===0)&&t.push({type:`text`,content:i}),t}function Pa(e){let t=e=>e.replace(/\\\[([\s\S]*?)\\\]/g,(e,t)=>`$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g,(e,t)=>`$${t}$`),n=e=>{let n=/`[^`\n]+`/g,r=``,i=0,a;for(;a=n.exec(e);)r+=t(e.slice(i,a.index)),r+=a[0],i=n.lastIndex;return r+t(e.slice(i))},r=Ea(e),i=``,a=0;for(let t of r)i+=n(e.slice(a,t.start)),i+=e.slice(t.start,t.end),a=t.end;return i+=n(e.slice(a)),i}var Fa=N(`components:ui:message-code-block`);function Ia({code:e,language:t,state:n,children:r}){let{t:i}=x(),[a,o]=Y.useState(null),s=Y.useRef(null),c=a===e,l=t||`text`,u=i(c?`artifacts.copied`:`artifacts.copy`),d=`${u}: ${l}`;return Y.useEffect(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]),(0,X.jsxs)(`div`,{dir:`ltr`,"data-testid":`code-block`,"data-state":n,"data-language":l,className:`group relative my-4 overflow-hidden rounded-xl border border-line bg-surface-subtle text-left text-ink shadow-[0_12px_32px_rgba(13,17,23,0.1)] dark:border-white/10 dark:bg-[#0D1117] dark:text-[#E6EDF3] dark:shadow-[0_12px_32px_rgba(13,17,23,0.16)]`,children:[(0,X.jsxs)(`div`,{className:`flex h-10 items-center justify-between border-b border-line bg-surface-raised/70 px-3.5 dark:border-white/10 dark:bg-white/[0.035]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(he,{className:`h-3.5 w-3.5 shrink-0 text-ink-subtle dark:text-[#8B949E]`}),(0,X.jsx)(`span`,{className:`truncate font-mono text-[11px] font-medium lowercase tracking-[-0.01em] text-ink-muted dark:text-[#B1BAC4]`,children:l})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n===`streaming`&&(0,X.jsx)(`span`,{role:`status`,"aria-label":i(`common.loading`),className:`flex h-7 w-7 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary-400`})}),(0,X.jsx)(`button`,{type:`button`,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),o(e),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{o(null),s.current=null},2e3)}catch(e){Fa.error(`Failed to copy code:`,e)}},disabled:!e,className:`flex h-7 w-7 items-center justify-center rounded-md text-ink-subtle transition-colors hover:bg-surface-subtle hover:text-ink focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-400/70 disabled:cursor-default disabled:opacity-35 dark:text-[#8B949E] dark:hover:bg-white/[0.08] dark:hover:text-[#E6EDF3]`,title:u,"aria-label":d,children:c?(0,X.jsx)(re,{className:`h-3.5 w-3.5 text-green-400`}):(0,X.jsx)(Ie,{className:`h-3.5 w-3.5`})}),(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:c?d:``})]})]}),r]})}var La=`#0D1117`,Ra=`rgb(var(--color-surface-subtle))`,za=`max-h-[60vh] min-h-12 overflow-auto bg-surface-subtle p-4 text-left font-mono text-[14px] leading-6 text-ink whitespace-pre tabular-nums dark:bg-[#0D1117] dark:text-[#E6EDF3]`,Ba={maxHeight:`60vh`,minHeight:`3rem`,overflow:`auto`,padding:`1rem`,fontSize:`14px`,lineHeight:`1.5rem`,fontFamily:`"JetBrains Mono", ui-monospace, SFMono-Regular, monospace`,whiteSpace:`pre`};function Va({content:e}){return e?(0,X.jsx)(`div`,{dir:`auto`,className:`whitespace-pre-wrap break-words leading-relaxed`,children:e}):null}function Ha({content:e,language:t,complete:n}){let r=n?e.replace(/\r?\n$/,``):e,i=Y.useRef(null),a=Y.useRef(!0);return Y.useLayoutEffect(()=>{let e=i.current;e&&a.current&&(e.scrollTop=e.scrollHeight)},[r]),(0,X.jsx)(Ia,{code:r,language:t,state:n?`complete`:`streaming`,children:(0,X.jsx)(`pre`,{ref:i,onScroll:()=>{let e=i.current;e&&(a.current=e.scrollHeight-e.scrollTop-e.clientHeight<24)},className:za,children:(0,X.jsx)(`code`,{children:r})})})}var Ua=({content:e,className:t,segments:n,isStreaming:r=!0})=>{let i=Y.useMemo(()=>n??Na(e),[e,n]),a=i[i.length-1],o=a?.type===`code`&&!a.complete;return(0,X.jsxs)(`div`,{className:P(`text-sm leading-relaxed text-gray-700 dark:text-dark-700`,t),children:[i.map((e,t)=>e.type===`code`?(0,X.jsx)(Ha,{...e},`${e.type}-${t}`):(0,X.jsx)(Va,{content:e.content},`${e.type}-${t}`)),r&&!o&&(0,X.jsx)(`span`,{"data-testid":`message-streaming-cursor`,"aria-hidden":`true`,className:`ms-1 inline-block h-5 w-1 animate-pulse rounded-full bg-primary-500 align-text-bottom`})]})},Wa=Y.lazy(()=>d(()=>import(`../js/RichMessageContent-nAEaPTpH.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])));function Ga({content:e,className:t}){return(0,X.jsx)(`div`,{dir:`auto`,className:P(`text-sm leading-relaxed text-gray-700 dark:text-dark-700 whitespace-pre-wrap break-words`,t),children:e})}var Ka=({content:e,className:t,isStreaming:n=!1})=>{let r=Y.useMemo(()=>n?Na(e):[],[e,n]),i=r.some(e=>e.type===`code`);if(n&&i)return(0,X.jsx)(Ua,{content:e,className:t,segments:r});let a;return a=Ma(e)?(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(Ua,{content:e,className:t,isStreaming:!1}),children:(0,X.jsx)(Wa,{content:e,className:t})}):(0,X.jsx)(Ga,{content:e,className:t}),(0,X.jsxs)(X.Fragment,{children:[a,n&&(0,X.jsx)(`span`,{"data-testid":`message-streaming-cursor`,"aria-hidden":`true`,className:`ms-1 inline-block h-5 w-1 animate-pulse rounded-full bg-primary-500 align-text-bottom`})]})},qa=({children:e,htmlFor:t,className:n=``})=>(0,X.jsx)(`label`,{htmlFor:t,className:P(`text-sm font-medium tracking-[-0.005em] text-ink-muted`,n),children:e}),Ja=({children:e,className:t=``,...n})=>(0,X.jsx)(`div`,{...n,className:P(`rounded-2xl border border-line bg-surface-raised shadow-card`,t),children:e}),Ya=({children:e,className:t=``})=>(0,X.jsx)(`div`,{className:P(`flex flex-col space-y-1.5 p-6`,t),children:e}),Xa=({children:e,className:t=``})=>(0,X.jsx)(`h3`,{className:P(`text-lg font-semibold leading-tight tracking-[-0.02em] text-ink`,t),children:e}),Za=({children:e,className:t=``})=>(0,X.jsx)(`p`,{className:P(`text-sm leading-relaxed text-ink-muted`,t),children:e}),Qa=({children:e,className:t=``})=>(0,X.jsx)(`div`,{className:P(`p-6 pt-0`,t),children:e}),$a={narrow:`max-w-4xl`,default:`max-w-6xl`,wide:`max-w-7xl`},eo=({children:e,width:t=`default`,className:n,contentClassName:r,...i})=>(0,X.jsx)(`div`,{"data-testid":`page-scroll-region`,className:P(`scroll-region h-full min-h-0 scrollbar-thin`,n),...i,children:(0,X.jsx)(`div`,{className:P(`mx-auto w-full px-4 pb-16 pt-7 sm:px-6 sm:pb-20 sm:pt-10 lg:px-8`,$a[t],r),children:e})}),to=({title:e,description:t,eyebrow:n,actions:r,meta:i,className:a,...o})=>(0,X.jsxs)(`header`,{className:P(`mb-8 flex flex-col gap-6 border-b border-gray-200/70 pb-7 text-start dark:border-white/[0.08] sm:mb-10 sm:pb-9 md:flex-row md:items-end md:justify-between`,a),...o,children:[(0,X.jsxs)(`div`,{className:`min-w-0 max-w-3xl`,children:[n&&(0,X.jsx)(`div`,{className:`mb-3 text-[11px] font-medium uppercase tracking-[0.18em] text-gray-500 dark:text-dark-500 rtl:tracking-normal`,children:n}),(0,X.jsx)(`h1`,{className:`text-balance text-3xl font-normal leading-[1.02] tracking-[-0.04em] text-gray-950 dark:text-dark-950 sm:text-5xl rtl:leading-[1.15] rtl:tracking-normal`,children:e}),t&&(0,X.jsx)(`p`,{className:`mt-4 max-w-2xl text-sm leading-6 text-gray-600 dark:text-dark-600 sm:text-base sm:leading-7`,children:t}),i&&(0,X.jsx)(`div`,{className:`mt-4`,children:i})]}),r&&(0,X.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 md:justify-end`,children:r})]}),no=N(`components:avatar-upload`),ro=({value:e,onChange:t,className:n=``})=>{let{t:r}=x(),i=(0,Y.useRef)(null),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(!1),l=async e=>{if(!e.type.startsWith(`image/`)){M.error(r(`user.avatar.invalidFile`));return}if(e.size>2*1024*1024){M.error(r(`user.avatar.fileTooLarge`));return}o(!0);try{let n=new FileReader;n.onload=e=>{let n=e.target?.result;t(n),M.success(r(`user.avatar.uploaded`))},n.onerror=()=>{M.error(r(`user.avatar.readFailed`))},n.readAsDataURL(e)}catch(e){no.error(`Failed to upload avatar:`,e),M.error(r(`user.avatar.uploadFailed`))}finally{o(!1)}},u=e=>{let t=e.target.files?.[0];t&&l(t)},d=e=>{e.preventDefault(),c(!0)},f=e=>{e.preventDefault(),c(!1)},p=e=>{e.preventDefault(),c(!1);let t=e.dataTransfer.files?.[0];t&&l(t)},m=()=>{t(``),M.success(r(`user.avatar.removed`))},h=()=>e||null;return(0,X.jsx)(`div`,{className:`space-y-4 ${n}`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 dark:text-dark-600 mb-2`,children:r(`user.avatar.label`)}),(0,X.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,X.jsx)(`div`,{className:`flex-shrink-0`,children:(0,X.jsx)(`div`,{className:`w-20 h-20 rounded-full overflow-hidden bg-gray-100 dark:bg-dark-200 border-2 border-gray-300 dark:border-dark-300 flex items-center justify-center`,children:h()?(0,X.jsx)(`img`,{src:h(),alt:`Avatar preview`,className:`w-full h-full object-cover`}):(0,X.jsx)(ke,{className:`h-8 w-8 text-gray-400 dark:text-gray-500`})})}),(0,X.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[e?(0,X.jsxs)(`div`,{className:`flex items-center gap-3 p-3 bg-gray-50 dark:bg-dark-200 rounded-lg`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:r(`user.avatar.customAvatar`)}),(0,X.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:r(`user.avatar.clickToChange`)})]}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:m,className:`text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/20`,children:(0,X.jsx)(Ce,{className:`h-4 w-4`})})]}):(0,X.jsxs)(`div`,{className:`border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors ${s?`border-primary-500 bg-primary-50 dark:bg-primary-900/20`:`border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500`}`,onDragOver:d,onDragLeave:f,onDrop:p,onClick:()=>i.current?.click(),children:[(0,X.jsx)(Me,{className:`h-8 w-8 mx-auto text-gray-400 dark:text-gray-500 mb-2`}),(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100 mb-2`,children:r(`user.avatar.uploadAvatarImage`)}),(0,X.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-2`,children:r(`user.avatar.dragAndDrop`)}),(0,X.jsxs)(I,{variant:`outline`,size:`sm`,disabled:a,className:`mx-auto`,children:[(0,X.jsx)(Me,{className:`h-4 w-4 mr-2`}),r(a?`user.avatar.uploading`:`user.avatar.chooseImage`)]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{className:`block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1`,children:r(`user.avatar.enterImageUrl`)}),(0,X.jsx)(`input`,{type:`url`,value:e,onChange:e=>t(e.target.value),className:`w-full px-3 py-2 text-sm border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-50 text-gray-900 dark:text-dark-800`,placeholder:`https://example.com/avatar.jpg`})]})]})]}),(0,X.jsx)(`input`,{ref:i,type:`file`,accept:`image/*`,onChange:u,className:`hidden`}),(0,X.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mt-2`,children:r(`user.avatar.supportedFormats`)})]})})};function io({open:e,value:t,saving:n,onChange:r,onClose:i,onSave:a}){let{t:o}=x();return e?(0,ba.createPortal)((0,X.jsx)(`div`,{className:`fixed inset-0 z-[2147483647] flex items-center justify-center bg-gray-950/55 p-4 backdrop-blur-md`,onClick:i,children:(0,X.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`avatar-modal-title`,className:`bg-white dark:bg-dark-25 rounded-3xl shadow-[0_24px_80px_rgba(0,0,0,0.24)] p-6 w-full max-w-md border border-black/[0.07] dark:border-white/[0.08] animate-scale-in`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,X.jsx)(`h3`,{id:`avatar-modal-title`,className:`text-lg font-medium tracking-[-0.02em] text-gray-950 dark:text-dark-950`,children:o(`user.avatar.title`)}),(0,X.jsx)(`button`,{onClick:i,className:`p-2 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-xl transition-colors`,children:(0,X.jsx)(Ce,{size:20,className:`text-gray-500`})})]}),(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(ro,{value:t,onChange:r}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-3 pt-4 border-t border-gray-200 dark:border-dark-300`,children:[(0,X.jsx)(`button`,{onClick:i,className:`px-4 py-2 text-sm font-medium text-gray-700 dark:text-dark-700 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-xl transition-colors`,children:o(`common.cancel`)}),(0,X.jsx)(`button`,{onClick:a,disabled:n,className:`px-4 py-2 text-sm font-medium text-white bg-gray-950 hover:bg-gray-800 dark:bg-white dark:text-gray-950 dark:hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed rounded-xl transition-colors`,children:o(n?`common.saving`:`common.save`)})]})]})]})}),document.body):null}var ao={sm:`text-[1.0625rem] leading-none`,md:`text-[1.625rem] leading-none`,lg:`text-[2.5rem] leading-none`},oo=({className:e,size:t=`md`,wordmark:n=!0})=>(0,X.jsxs)(`span`,{dir:`ltr`,className:P(`libre-brand inline-flex items-baseline whitespace-nowrap`,ao[t],e),children:[`Libre`,n&&(0,X.jsx)(`span`,{className:`ms-1 font-normal tracking-[-0.035em]`,children:`WebUI`})]}),so=()=>{let{theme:e,toggleTheme:t}=rt(),n=e.mode===`light`?`dark`:`light`,r=e.mode===`light`?(0,X.jsx)(te,{className:`h-4 w-4 text-ink-muted transition-colors duration-150 group-hover:text-ink motion-reduce:transition-none`,strokeWidth:1.75,"aria-hidden":`true`}):(0,X.jsx)(ye,{className:`h-4 w-4 text-ink-muted transition-colors duration-150 group-hover:text-ink motion-reduce:transition-none`,strokeWidth:1.75,"aria-hidden":`true`}),i=`Switch to ${n} mode`;return(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:t,className:`h-9 w-9 rounded-full p-0`,"aria-label":i,title:`${i} (⌘D)`,children:r})};function co({sidebarCompact:e,isElectron:t,showWork:n,activeMode:r,selectedModel:i,modelCount:a,onToggleCompact:o,onStartWork:s,onCreateSession:c}){let{t:l}=x(),u=!i||a===0,d=u?l(`chat.model.noModelsTooltip`):``;return(0,X.jsxs)(`div`,{className:P(e?`px-2 pb-3 pt-3`:`px-4 pb-4 pt-4`,t&&`pt-10`),children:[(0,X.jsx)(`div`,{className:P(`flex items-center`,e?`justify-center mb-3`:`justify-between mb-4`),children:e?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(oo,{size:`sm`,wordmark:!1,className:`text-gray-950 dark:text-dark-950 text-base tracking-[-0.035em]`}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:o,className:`h-9 w-9 p-0 rounded-xl text-gray-500 dark:text-dark-600 hover:bg-white/80 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation`,title:l(`sidebar.expandSidebar`),"aria-label":l(`sidebar.expandSidebar`),children:(0,X.jsx)(be,{className:`h-4 w-4 rtl:rotate-180`})}),(0,X.jsx)(so,{})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(oo,{size:`sm`,className:`text-gray-950 dark:text-dark-950 tracking-[-0.035em]`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,X.jsx)(so,{}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:o,className:`h-9 w-9 p-0 rounded-xl text-gray-500 dark:text-dark-600 hover:bg-white/80 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation`,title:l(`sidebar.toggleSize`),"aria-label":l(`sidebar.toggleSize`),children:(0,X.jsx)(ne,{className:`h-4 w-4 rtl:rotate-180`})})]})]})}),(0,X.jsxs)(`div`,{className:P(`grid w-full gap-2`,e||!n?`grid-cols-1`:`grid-cols-2`),"data-testid":`sidebar-create-actions`,children:[n&&(0,X.jsxs)(I,{variant:r===`work`?`primary`:`secondary`,onClick:s,className:P(`h-10 rounded-xl shadow-none touch-manipulation`,e&&`w-full p-0`),size:`sm`,title:l(`chat.session.work`),"aria-label":l(`chat.session.work`),"aria-pressed":r===`work`,"data-testid":`sidebar-work-button`,children:[(0,X.jsx)(ie,{className:`h-4 w-4`}),!e&&l(`chat.session.work`)]}),(0,X.jsxs)(I,{variant:r===`chat`?`primary`:`secondary`,onClick:c,disabled:u,className:P(`h-10 rounded-xl shadow-none touch-manipulation`,e&&`w-full p-0`),size:`sm`,title:u?d:l(`chat.session.chat`),"aria-label":l(`chat.session.chat`),"aria-pressed":r===`chat`,"data-testid":`sidebar-chat-button`,children:[(0,X.jsx)(S,{className:`h-4 w-4`}),!e&&l(`chat.session.chat`)]})]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`sidebar-search-button`,onClick:()=>window.dispatchEvent(new Event(`libre:open-palette`)),title:l(`palette.search`,`Search`),"aria-label":l(`palette.search`,`Search`),className:P(`mt-2 flex items-center gap-2.5 rounded-xl text-[13px] text-gray-500 transition-colors hover:bg-white/60 hover:text-gray-950 dark:text-dark-600 dark:hover:bg-dark-200/60 dark:hover:text-dark-950 outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 touch-manipulation`,e?`h-11 w-11 justify-center p-0 mx-auto`:`w-full px-2.5 py-2`),children:[(0,X.jsx)(Fe,{className:`h-4 w-4 shrink-0`}),!e&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`flex-1 text-start`,children:l(`palette.search`,`Search`)}),(0,X.jsxs)(`span`,{className:`font-mono text-[10px] tracking-wide text-gray-400 dark:text-dark-500`,children:[qe()?`⌘`:`Ctrl`,`K`]})]})]})]})}var lo=[{path:`/models`,icon:oe,labelKey:`sidebar.navigation.models`},{path:`/personas`,icon:ke,labelKey:`sidebar.navigation.personas`},{path:`/gallery`,icon:_e,labelKey:`sidebar.navigation.imagine`},{path:`/agents`,icon:D,labelKey:`sidebar.navigation.agents`}];function uo({sidebarCompact:e,activePath:t,showAgents:n,onMobileNavigate:r}){let{t:i}=x();return(0,X.jsx)(`div`,{className:P(`pb-3`,e?`px-2`:`px-3`),children:(0,X.jsx)(`nav`,{"data-testid":`sidebar-navigation`,"aria-label":i(`sidebar.navigation.exploreLabel`,`Explore`),className:P(`flex gap-1`,e?`flex-col items-center`:`items-center`),children:lo.filter(e=>e.path!==`/agents`||n).map(({path:n,icon:a,labelKey:o})=>{let s=t===n,c=i(o);return(0,X.jsx)(_,{to:n,onClick:r,title:c,"aria-label":c,"aria-current":s?`page`:void 0,className:P(`flex items-center justify-center rounded-xl transition-colors duration-150 touch-manipulation outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30`,e?`h-11 w-11`:`h-9 flex-1`,s?`bg-white text-gray-950 ring-1 ring-black/[0.04] dark:bg-dark-200 dark:text-dark-950 dark:ring-white/[0.06]`:`text-gray-500 hover:bg-white/60 hover:text-gray-950 dark:text-dark-600 dark:hover:bg-dark-200/60 dark:hover:text-dark-950`),children:(0,X.jsx)(a,{className:`h-[18px] w-[18px] shrink-0`})},n)})})})}function fo({sessions:e,personas:t,currentSessionId:n,generatingTitleForSession:r,sidebarCompact:i,editingSessionId:a,editingTitle:o,onEditingTitleChange:s,onSelectSession:c,onStartEditing:l,onSaveEdit:u,onCancelEdit:d,onDeleteSession:f}){let{t:p,i18n:m}=x();return(0,X.jsx)(`div`,{"data-testid":`sidebar-session-scroll-region`,className:`scroll-region min-h-0 flex-1 scrollbar-thin border-t border-black/[0.05] dark:border-white/[0.05]`,style:{willChange:`scroll-position`},children:(0,X.jsxs)(`div`,{className:P(`px-3 py-3`,i&&`px-2`),children:[!i&&e.length>0&&(0,X.jsxs)(`div`,{className:`flex items-center justify-between mb-2 px-1`,children:[(0,X.jsx)(`h3`,{className:`text-[10px] font-semibold text-gray-500 dark:text-dark-500 uppercase tracking-[0.16em] rtl:tracking-normal`,children:p(`chat.session.chats`)}),(0,X.jsx)(`span`,{className:`text-[10px] tabular-nums text-gray-400 dark:text-dark-500 font-medium`,children:e.length})]}),e.length===0?(0,X.jsxs)(`div`,{className:P(`text-center py-8`,i?`px-1`:`px-2`),children:[(0,X.jsx)(`div`,{className:P(`mx-auto mb-3 bg-white/70 dark:bg-dark-200 rounded-xl flex items-center justify-center ring-1 ring-black/[0.04] dark:ring-white/[0.05]`,i?`w-8 h-8`:`w-12 h-12`),children:(0,X.jsx)(S,{className:P(`text-gray-400 dark:text-gray-500`,i?`h-4 w-4`:`h-5 w-5`)})}),!i&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-600 dark:text-dark-600`,children:p(`chat.session.noChats`)}),(0,X.jsx)(`p`,{className:`text-xs mt-1 text-gray-400 dark:text-dark-500`,children:p(`chat.session.createFirst`)})]})]}):(0,X.jsx)(`div`,{className:P(`space-y-0.5`,i&&`space-y-1`),children:e.map(e=>{let h=n===e.id,g=e.personaId?t[e.personaId]:null;return(0,X.jsx)(`div`,{className:P(`group relative cursor-pointer transition-colors duration-150 touch-manipulation outline-none`,i?`rounded-xl p-1 flex items-center justify-center`:`rounded-lg px-2.5 py-2`,h?`bg-white ring-1 ring-black/[0.04] dark:bg-dark-200 dark:ring-white/[0.05]`:`hover:bg-white/60 dark:hover:bg-dark-200/60`),onClick:()=>c(e),title:i?`${e.title} - ${e.model}`:void 0,children:i?(0,X.jsx)(`div`,{className:`flex items-center justify-center w-full h-10`,children:(0,X.jsx)(`div`,{className:P(`flex h-9 w-9 items-center justify-center rounded-xl text-[11px] font-semibold uppercase transition-colors`,r===e.id?`bg-white text-primary-600 animate-pulse dark:bg-dark-200 dark:text-primary-400`:h?`bg-gray-950 text-white dark:bg-white dark:text-gray-950`:`bg-white/70 text-gray-500 ring-1 ring-black/[0.04] dark:bg-dark-200/70 dark:text-dark-600 dark:ring-white/[0.05]`),children:e.title.trim().charAt(0)||`•`})}):a===e.id?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(xa,{value:o,onChange:e=>s(e.target.value),onKeyDown:t=>{t.key===`Enter`?u(e.id):t.key===`Escape`&&d()},className:`text-sm h-8`,autoFocus:!0}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>u(e.id),className:`h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 active:bg-gray-200 dark:active:bg-dark-400 touch-manipulation`,children:(0,X.jsx)(re,{className:`h-3 w-3`})}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:d,className:`h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 active:bg-gray-200 dark:active:bg-dark-400 touch-manipulation`,children:(0,X.jsx)(Ce,{className:`h-3 w-3`})})]}):(0,X.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,X.jsxs)(`div`,{className:`flex-1 min-w-0 me-2`,children:[(0,X.jsx)(`h3`,{className:`text-[13px] font-medium truncate leading-tight text-gray-900 dark:text-dark-900`,children:r===e.id?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`animate-pulse`,children:p(`chat.session.generatingTitle`)}),(0,X.jsxs)(`span`,{className:`inline-flex`,children:[(0,X.jsx)(`span`,{className:`animate-bounce`,style:{animationDelay:`0ms`},children:`.`}),(0,X.jsx)(`span`,{className:`animate-bounce`,style:{animationDelay:`150ms`},children:`.`}),(0,X.jsx)(`span`,{className:`animate-bounce`,style:{animationDelay:`300ms`},children:`.`})]})]}):Ye(e.title,32)}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5`,children:[(0,X.jsx)(`span`,{dir:`auto`,className:P(`text-[11px] tabular-nums`,h?`text-gray-500 dark:text-dark-600`:`text-gray-400 dark:text-dark-500`),children:Je(e.updatedAt,m.language)}),(0,X.jsx)(`span`,{className:`text-gray-300 dark:text-dark-400`,children:`•`}),e.personaId?g?(0,X.jsxs)(`span`,{className:P(`flex items-center gap-1 text-[11px] font-medium`,h?`text-primary-600 dark:text-primary-400`:`text-primary-500 dark:text-primary-500`),title:g.description||g.name,children:[g.avatar&&!g.avatar.startsWith(`data:`)&&(0,X.jsx)(`span`,{className:`text-[10px]`,children:g.avatar}),(0,X.jsx)(`span`,{className:`truncate max-w-[100px]`,children:g.name})]}):(0,X.jsx)(`span`,{className:P(`text-[11px] font-medium italic`,h?`text-gray-500 dark:text-gray-500`:`text-gray-400 dark:text-gray-600`),children:`Persona`}):(0,X.jsx)(`span`,{dir:`ltr`,className:P(`font-mono text-[10px] truncate max-w-[108px]`,h?`text-gray-700 dark:text-gray-300`:`text-gray-600 dark:text-gray-400`),title:e.model,children:e.model})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100 transition-opacity duration-150 shrink-0`,children:[(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:t=>l(e,t),className:`h-7 w-7 sm:h-7 sm:w-7 p-0 hover:bg-gray-100 dark:hover:bg-dark-300 rounded-lg touch-manipulation`,title:p(`chat.session.renameChat`),children:(0,X.jsx)(we,{className:`h-3 w-3`})}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:t=>f(e.id,t),className:`h-7 w-7 sm:h-7 sm:w-7 p-0 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg touch-manipulation`,title:p(`chat.session.deleteChat`),children:(0,X.jsx)(ve,{className:`h-3 w-3`})})]})]})},e.id)})})]})})}function po({user:e,size:t}){let n=t===`sm`?`w-7 h-7`:`w-8 h-8`,r=t===`sm`?`text-xs`:`text-sm`;return e.avatar?(0,X.jsx)(`img`,{src:e.avatar,alt:e.username,className:`${n} rounded-full object-cover ring-1 ring-black/10 dark:ring-white/10`,title:`${e.username} (${e.role})`}):(0,X.jsx)(`div`,{className:`${n} bg-gray-950 dark:bg-white rounded-full flex items-center justify-center`,title:`${e.username} (${e.role})`,children:(0,X.jsx)(`span`,{className:`text-white dark:text-gray-950 ${r} font-medium`,children:e.username.charAt(0).toUpperCase()})})}function mo({requiresAuth:e,user:t,isAdmin:n,pendingApprovalCount:r,sidebarCompact:i,userMenuOpen:a,userMenuRef:o,onToggleUserMenu:s,onOpenSettings:c,onOpenAvatar:l,onLogout:u,onMobileNavigate:d,onCloseUserMenu:f}){let{t:p}=x();return!e||!t?null:(0,X.jsx)(`div`,{className:P(`border-t border-black/[0.05] dark:border-white/[0.05]`,i?`p-2`:`p-3`),children:i?(0,X.jsxs)(`div`,{className:`flex flex-col items-center space-y-2`,children:[(0,X.jsx)(po,{user:t,size:`sm`}),n&&(0,X.jsxs)(_,{to:`/users`,onClick:d,className:`relative w-10 h-10 flex items-center justify-center rounded-xl text-gray-600 dark:text-dark-600 hover:bg-white/70 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation transition-colors duration-150`,title:p(`sidebar.navigation.userManagement`),children:[(0,X.jsx)(ke,{className:`h-4 w-4`}),r>0&&(0,X.jsx)(`span`,{"data-testid":`pending-user-notification-badge`,className:`absolute -end-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-error-500 px-1 text-[10px] font-semibold text-white shadow-subtle`,"aria-label":p(`userManager.approval.notificationBadge`,{count:r,defaultValue:`{{count}} pending user approvals`}),children:r>99?`99+`:r})]}),n&&(0,X.jsx)(_,{to:`/system`,onClick:d,className:`w-10 h-10 flex items-center justify-center rounded-xl text-gray-600 dark:text-dark-600 hover:bg-white/70 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation transition-colors duration-150`,title:p(`sidebar.navigation.system`),children:(0,X.jsx)(ae,{className:`h-4 w-4`})}),n&&(0,X.jsx)(_,{to:`/usage`,onClick:d,className:`w-10 h-10 flex items-center justify-center rounded-xl text-gray-600 dark:text-dark-600 hover:bg-white/70 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation transition-colors duration-150`,title:p(`sidebar.navigation.usageAnalytics`),children:(0,X.jsx)(E,{className:`h-4 w-4`})}),(0,X.jsx)(`button`,{onClick:c,className:`w-10 h-10 flex items-center justify-center rounded-xl text-gray-600 dark:text-dark-600 hover:bg-white/70 dark:hover:bg-dark-200 hover:text-gray-950 dark:hover:text-dark-950 touch-manipulation transition-colors duration-150`,title:p(`sidebar.navigation.settings`),children:(0,X.jsx)(fe,{className:`h-4 w-4`})}),(0,X.jsx)(`button`,{onClick:u,className:`w-10 h-10 flex items-center justify-center rounded-xl text-gray-500 dark:text-dark-500 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-600 dark:hover:text-red-400 touch-manipulation transition-colors duration-150`,title:p(`sidebar.navigation.signOut`),children:(0,X.jsx)(se,{className:`h-4 w-4`})})]}):(0,X.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,X.jsxs)(`button`,{onClick:s,className:`relative w-full p-2.5 rounded-xl hover:bg-white/70 dark:hover:bg-dark-200 transition-colors duration-150 text-start touch-manipulation outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(po,{user:t,size:`sm`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:t.username}),(0,X.jsxs)(`div`,{className:`flex items-center mt-0.5`,children:[t.role===`admin`&&(0,X.jsx)(Ne,{size:10,className:`text-primary-500 me-1`}),(0,X.jsx)(`span`,{className:`text-[11px] text-gray-500 dark:text-dark-500 capitalize`,children:t.role})]})]}),(0,X.jsx)(be,{className:P(`h-4 w-4 text-gray-400 dark:text-dark-500 transition-transform duration-150 rtl:rotate-180`,a&&`rotate-90 rtl:rotate-90`)})]}),n&&r>0&&(0,X.jsx)(`span`,{"data-testid":`pending-user-notification-badge`,className:`absolute -end-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-error-500 px-1 text-[10px] font-semibold text-white shadow-subtle`,"aria-label":p(`userManager.approval.notificationBadge`,{count:r,defaultValue:`{{count}} pending user approvals`}),children:r>99?`99+`:r})]}),a&&(0,X.jsxs)(`div`,{"data-testid":`sidebar-user-menu`,className:`scroll-region absolute bottom-full left-0 right-0 z-50 mb-2 max-h-[calc(100dvh-1rem)] rounded-2xl border border-black/[0.07] bg-white/95 py-2 shadow-[0_18px_60px_rgba(15,23,42,0.16)] backdrop-blur-xl animate-scale-in scrollbar-thin dark:border-white/[0.08] dark:bg-dark-25/95`,children:[(0,X.jsx)(`div`,{className:`px-3 py-2 border-b border-gray-100 dark:border-dark-200/50`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(po,{user:t,size:`md`}),(0,X.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:t.username}),(0,X.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 truncate`,children:t.email||p(`user.profile.noEmail`)})]})]})}),(0,X.jsxs)(`div`,{className:`py-1`,children:[(0,X.jsxs)(`button`,{onClick:()=>{l(t.avatar||``),f()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-gray-700 dark:text-dark-700 hover:bg-gray-100/70 dark:hover:bg-dark-200/70 transition-colors duration-150 text-start`,children:[(0,X.jsx)(O,{className:`h-4 w-4 shrink-0`}),p(`user.menu.changePicture`)]}),n&&(0,X.jsxs)(_,{to:`/users`,onClick:()=>{f(),d()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-gray-700 dark:text-dark-700 hover:bg-gray-100/70 dark:hover:bg-dark-200/70 transition-colors duration-150`,children:[(0,X.jsx)(ke,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 text-start`,children:p(`user.menu.userManagement`)}),r>0&&(0,X.jsx)(`span`,{className:`ms-2 rounded-full bg-error-500 px-1.5 py-0.5 text-[10px] font-semibold text-white`,children:r>99?`99+`:r})]}),n&&(0,X.jsxs)(_,{to:`/system`,onClick:()=>{f(),d()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-gray-700 dark:text-dark-700 hover:bg-gray-100/70 dark:hover:bg-dark-200/70 transition-colors duration-150`,children:[(0,X.jsx)(ae,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 text-start`,children:p(`user.menu.system`)})]}),n&&(0,X.jsxs)(_,{to:`/usage`,onClick:()=>{f(),d()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-gray-700 dark:text-dark-700 hover:bg-gray-100/70 dark:hover:bg-dark-200/70 transition-colors duration-150`,children:[(0,X.jsx)(E,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 text-start`,children:p(`user.menu.usageAnalytics`)})]}),(0,X.jsx)(`div`,{className:`border-t border-gray-100 dark:border-dark-200/50 my-1`}),(0,X.jsxs)(`button`,{onClick:()=>{c(),f()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-gray-700 dark:text-dark-700 hover:bg-gray-100/70 dark:hover:bg-dark-200/70 transition-colors duration-150 text-start`,children:[(0,X.jsx)(fe,{className:`h-4 w-4 shrink-0`}),p(`user.menu.settings`)]}),(0,X.jsxs)(`button`,{onClick:()=>{u(),f()},className:`w-full flex items-center gap-3 px-3 py-2.5 text-[13px] text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors duration-150 text-start`,children:[(0,X.jsx)(se,{className:`h-4 w-4 shrink-0`}),p(`user.menu.logout`)]})]})]})]})})}var ho={idle:{labelKey:`work.statusLabels.idle`,label:`Idle`,color:`rgb(255, 255, 255)`,animated:!1},preparing:{labelKey:`work.statusLabels.thinking`,label:`Thinking`,color:`rgb(48, 121, 255)`,animated:!0},running:{labelKey:`work.statusLabels.thinking`,label:`Thinking`,color:`rgb(48, 121, 255)`,animated:!0},completed:{labelKey:`work.statusLabels.complete`,label:`Complete`,color:`rgb(76, 212, 117)`,animated:!1},needs_input:{labelKey:`work.statusLabels.needsInput`,label:`Needs input`,color:`rgb(255, 204, 0)`,animated:!1},cancelled:{labelKey:`work.statusLabels.needsInput`,label:`Needs input`,color:`rgb(255, 204, 0)`,animated:!1},failed:{labelKey:`work.statusLabels.error`,label:`Error`,color:`rgb(255, 61, 129)`,animated:!1}};function go({tasks:e,currentTaskId:t,loading:n,actionLoading:r,sidebarCompact:i,onSelectTask:a,onDeleteTask:o}){let{t:s,i18n:c}=x();return(0,X.jsx)(`div`,{"data-testid":`sidebar-work-task-scroll-region`,className:`scroll-region min-h-0 flex-1 border-t border-black/[0.05] scrollbar-thin dark:border-white/[0.05]`,style:{willChange:`scroll-position`},children:(0,X.jsxs)(`div`,{className:P(`px-3 py-3`,i&&`px-2`),children:[!i&&e.length>0&&(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between px-1`,children:[(0,X.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-gray-500 dark:text-dark-500 rtl:tracking-normal`,children:s(`work.tasks.title`,{defaultValue:`Work tasks`})}),(0,X.jsx)(`span`,{className:`text-[10px] font-medium tabular-nums text-gray-400 dark:text-dark-500`,children:e.length})]}),n&&e.length===0?(0,X.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex items-center justify-center py-10 text-gray-400 dark:text-dark-500`,children:[(0,X.jsx)(Oe,{"aria-hidden":`true`,className:`h-5 w-5 animate-spin`}),(0,X.jsx)(`span`,{className:`sr-only`,children:s(`work.tasks.loading`,{defaultValue:`Loading Work tasks`})})]}):e.length===0?(0,X.jsxs)(`div`,{className:P(`py-8 text-center`,i?`px-1`:`px-2`),children:[(0,X.jsx)(`div`,{className:P(`mx-auto mb-3 flex items-center justify-center rounded-xl bg-white/70 ring-1 ring-black/[0.04] dark:bg-dark-200 dark:ring-white/[0.05]`,i?`h-8 w-8`:`h-12 w-12`),children:(0,X.jsx)(ie,{className:P(`text-gray-400 dark:text-gray-500`,i?`h-4 w-4`:`h-5 w-5`)})}),!i&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-gray-600 dark:text-dark-600`,children:s(`work.tasks.emptyTitle`,{defaultValue:`No Work tasks yet`})}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-gray-400 dark:text-dark-500`,children:s(`work.tasks.empty`,{defaultValue:`Your Work tasks will appear here after you send the first message.`})})]})]}):(0,X.jsx)(`div`,{"data-testid":`sidebar-work-task-list`,className:P(`space-y-0.5`,i&&`space-y-1`),children:e.map(e=>{let n=t===e.id,l=ho[e.status],u=s(l.labelKey,{defaultValue:l.label});return(0,X.jsxs)(`div`,{"data-testid":`sidebar-work-task-item`,"data-task-id":e.id,className:P(`group relative transition-colors duration-150 outline-none`,i?`flex items-center justify-center rounded-xl p-1`:`rounded-xl px-3 py-2.5`,n?`bg-white ring-1 ring-black/[0.04] dark:bg-dark-200 dark:ring-white/[0.05]`:`hover:bg-white/60 dark:hover:bg-dark-200/60`),children:[(0,X.jsxs)(`button`,{type:`button`,"aria-current":n?`page`:void 0,className:P(`w-full text-start outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30`,i?`flex h-10 items-center justify-center`:`pe-8`),title:i?`${e.title} · ${e.model}`:void 0,onClick:()=>a(e.id),children:[i?(0,X.jsxs)(`span`,{className:P(`relative flex h-9 w-9 items-center justify-center rounded-xl text-[11px] font-semibold uppercase transition-colors`,n?`bg-gray-950 text-white dark:bg-white dark:text-gray-950`:`bg-white/70 text-gray-500 ring-1 ring-black/[0.04] dark:bg-dark-200/70 dark:text-dark-600 dark:ring-white/[0.05]`),children:[e.title.trim().charAt(0)||`•`,(0,X.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`sidebar-work-task-status`,"data-status-label":u,className:P(`absolute -bottom-0.5 -end-0.5 h-2.5 w-2.5 rounded-full border-2 border-gray-100 dark:border-dark-50`,l.animated&&`animate-pulse`,e.status===`idle`&&`ring-1 ring-black/20 dark:ring-white/20`),style:{backgroundColor:l.color}})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`sidebar-work-task-status`,"data-status-label":u,className:P(`h-2 w-2 shrink-0 rounded-full`,l.animated&&`animate-pulse`,e.status===`idle`&&`ring-1 ring-black/20 dark:ring-white/20`),style:{backgroundColor:l.color}}),(0,X.jsx)(`span`,{dir:`auto`,className:`min-w-0 flex-1 truncate text-[13px] font-medium leading-tight text-gray-900 dark:text-dark-900`,children:Ye(e.title||s(`work.tasks.untitled`,{defaultValue:`Untitled task`}),32)})]}),(0,X.jsxs)(`span`,{className:`mt-1 flex items-center gap-1.5 ps-4 text-[11px] text-gray-400 dark:text-dark-500`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:Je(e.updatedAt,c.language)}),(0,X.jsx)(`span`,{className:`text-gray-300 dark:text-dark-400`,children:`•`}),(0,X.jsx)(`span`,{dir:`ltr`,className:`min-w-0 truncate font-medium text-gray-600 dark:text-gray-400`,title:e.model,children:e.model})]})]}),(0,X.jsx)(`span`,{className:`sr-only`,children:s(`work.tasks.status`,{defaultValue:`Status: {{status}}`,status:u})})]}),!i&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-work-task-delete`,disabled:r,className:P(`absolute end-2 top-1/2 -translate-y-1/2 rounded-lg p-1.5 text-gray-400 transition-[color,background-color,opacity] hover:bg-error-500/10 hover:text-error-600 focus:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-error-500/30 disabled:cursor-not-allowed disabled:opacity-40 group-focus-within:opacity-100 group-hover:opacity-100 dark:text-dark-500`,n?`opacity-100`:`opacity-0`),"aria-label":s(`work.tasks.deleteNamed`,{defaultValue:`Delete {{title}}`,title:e.title||s(`work.tasks.untitled`,{defaultValue:`Untitled task`})}),onClick:t=>{t.stopPropagation(),o(e)},children:(0,X.jsx)(ve,{"aria-hidden":`true`,className:`h-3.5 w-3.5`})})]},e.id)})})]})})}function _o(e){let{t}=x(),n=(0,Y.useRef)(null),r=kr({queryKey:[`users`,`pending-approvals`],enabled:e,queryFn:async()=>{let e=await Ge.getPendingApprovals();if(!e.success||!e.data)throw Error(e.message||`Could not load pending accounts`);return e.data},refetchInterval:6e4,refetchOnWindowFocus:!0});return(0,Y.useEffect)(()=>{if(!r.data)return;let e=n.current,i=e?!!(r.data.count>e.count||r.data.latestCreatedAt&&r.data.latestCreatedAt!==e.latestCreatedAt):r.data.count>0;n.current=r.data,i&&j(t(`userManager.approval.notification`,{count:r.data.count,defaultValue:`{{count}} registration(s) are waiting for your approval.`}),{icon:`👤`})},[r.data,t]),{...r,pendingApprovalCount:r.data?.count??0}}var vo=N(`components:sidebar`),yo=Y.lazy(()=>d(()=>import(`../js/SettingsModal-DZYCI5-y.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([11,1,2,12,13,8,7,14,3,5,4,15,6,16]))),bo=({isOpen:e,onClose:t,className:n})=>{let{t:r}=x(),i=v(),a=c(),{sessions:o,deleteSession:s,updateSessionTitle:l,selectedModel:u,models:d,currentSession:f,generatingTitleForSession:p,personas:m}=nt(),h=$e(e=>e.tasks),g=$e(e=>e.loadingTasks),_=$e(e=>e.actionLoading),y=$e(e=>e.deleteTask),{user:b,isAdmin:S,systemInfo:C,setUser:w}=F(),{backgroundImage:T,sidebarCompact:E,toggleSidebarCompact:D}=rt(),O=S(),{pendingApprovalCount:ee}=_o(!!(b&&O&&C?.requiresAuth)),[te,ne]=(0,Y.useState)(null),[k,re]=(0,Y.useState)(``),[ie,ae]=(0,Y.useState)(!1),[oe,se]=(0,Y.useState)(!1),[ce,A]=(0,Y.useState)(!1),[le,ue]=(0,Y.useState)(``),[de,fe]=(0,Y.useState)(!1),pe=(0,Y.useRef)(null),me=(0,Y.useRef)(null),he=i.pathname.match(/^\/c\/([^/]+)$/)?.[1]||null,ge=f?.id||he,_e=()=>{window.innerWidth<768&&!E&&D()},ve=()=>{let{setCurrentSession:e}=nt.getState();va(),e(null),sessionStorage.setItem(`forceWelcomeScreen`,`true`)};(0,Y.useEffect)(()=>{let e=e=>{pe.current&&!pe.current.contains(e.target)&&se(!1)};if(oe)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[oe]),(0,Y.useEffect)(()=>{let t=t=>{me.current&&!me.current.contains(t.target)&&window.innerWidth<768&&e&&!E&&D()};if(e&&!E&&window.innerWidth<768)return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[e,E,D]);let ye=async()=>{fe(!0);try{let e=await Ge.updateMyAvatar(le||null);e.success&&e.data?(w(e.data),j.success(r(`user.avatar.updated`)),A(!1)):j.error(e.message||r(`user.avatar.updateFailed`))}catch(e){vo.error(`Failed to update avatar:`,e),j.error(r(`user.avatar.updateFailed`))}finally{fe(!1)}},be=()=>{ve(),a(`/chat`,{replace:!0}),_e()},xe=()=>{$e.getState().clearError(),a(`/work`),_e()},Se=e=>{a(`/c/${e.id}`,{replace:!0}),_e()},Ce=e=>{a(`/work/${e}`,{replace:!0}),_e()},we=async e=>{if(window.confirm(r(`work.tasks.deleteConfirm`,{defaultValue:`Delete “{{title}}” and its workspace permanently?`,title:e.title||r(`work.tasks.untitled`,{defaultValue:`Untitled task`})})))try{await y(e.id),Xe(e.id),da.getState().closeTab(`work:${e.id}`),Ne===e.id&&a(`/work`,{replace:!0,state:{deletedWorkTaskId:e.id}})}catch(e){vo.error(`Failed to delete Work task:`,e),j.error(r(`work.toasts.deleteFailed`,{defaultValue:`Could not delete this Work task.`}))}},Te=async(e,t)=>{if(t.stopPropagation(),vo.debug(`Delete session clicked:`,e),window.confirm(r(`chat.session.deleteConfirm`)))try{vo.debug(`Attempting to delete session:`,e);let t=ge===e;if(await s(e),vo.debug(`Session deleted successfully`),da.getState().closeTab(`chat:${e}`),t){let t=o.filter(t=>t.id!==e);t.length>0?a(`/c/${t[0].id}`,{replace:!0}):a(`/`,{replace:!0})}}catch(e){vo.error(`Error deleting session:`,e)}},Ee=(e,t)=>{t.stopPropagation(),ne(e.id),re(e.title)},M=async e=>{k.trim()&&await l(e,k.trim()),ne(null),re(``)},De=()=>{ne(null),re(``)},Oe=async()=>{try{await We.logout();let{logout:e}=F.getState();e(),a(`/login`),j.success(r(`auth.logout.success`))}catch(e){vo.error(`Logout error:`,e);let{logout:t}=F.getState();t(),a(`/login`)}},ke=()=>{ae(!0),_e()},Ae=e=>{ue(e),A(!0)},je=window.location.protocol===`file:`,Me=i.pathname===`/work`||i.pathname.startsWith(`/work/`),Ne=i.pathname.match(/^\/work\/([^/]+)$/)?.[1]||null,Pe=i.pathname===`/`||i.pathname===`/chat`||i.pathname.startsWith(`/c/`),Fe=C?.requiresAuth===!1||S();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{ref:me,"data-testid":`sidebar`,className:P(`fixed inset-y-0 start-0 z-50 border-e border-black/[0.06] dark:border-white/[0.06] transform transition-[width,transform,background-color] duration-200 ease-out shadow-[0_24px_80px_rgba(15,23,42,0.12)]`,E?`w-18`:`w-72 max-sm:w-64`,e?`translate-x-0`:`ltr:-translate-x-full rtl:translate-x-full`,`lg:shadow-none`,T?`bg-gray-100/75 dark:bg-dark-50/75 backdrop-blur-xl`:`bg-gray-100 dark:bg-dark-50`,`overscroll-behavior-contain`,n),style:{WebkitOverflowScrolling:`touch`},children:[je&&(0,X.jsx)(`div`,{className:`absolute top-0 start-16 end-0 h-8 z-[60]`,style:{WebkitAppRegion:`drag`}}),(0,X.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,X.jsx)(co,{sidebarCompact:E,isElectron:je,showWork:Fe,activeMode:Me?`work`:Pe?`chat`:null,selectedModel:u,modelCount:d.length,onToggleCompact:D,onStartWork:xe,onCreateSession:be}),(0,X.jsx)(uo,{sidebarCompact:E,activePath:i.pathname,showAgents:Fe,onMobileNavigate:_e}),Me&&Fe?(0,X.jsx)(go,{tasks:h,currentTaskId:Ne,loading:g,actionLoading:_,sidebarCompact:E,onSelectTask:Ce,onDeleteTask:e=>void we(e)}):(0,X.jsx)(fo,{sessions:o,personas:m,currentSessionId:ge,generatingTitleForSession:p,sidebarCompact:E,editingSessionId:te,editingTitle:k,onEditingTitleChange:re,onSelectSession:Se,onStartEditing:Ee,onSaveEdit:M,onCancelEdit:De,onDeleteSession:Te}),(0,X.jsx)(mo,{requiresAuth:C?.requiresAuth,user:b,isAdmin:O,pendingApprovalCount:ee,sidebarCompact:E,userMenuOpen:oe,userMenuRef:pe,onToggleUserMenu:()=>se(e=>!e),onOpenSettings:ke,onOpenAvatar:Ae,onLogout:Oe,onMobileNavigate:_e,onCloseUserMenu:()=>se(!1)})]})]}),ie&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(yo,{isOpen:ie,onClose:()=>ae(!1)})}),(0,X.jsx)(io,{open:ce,value:le,saving:de,onChange:ue,onClose:()=>A(!1),onSave:ye})]})},$=({children:e,requireAuth:t=!0,requireAdmin:n=!1})=>{let{isAuthenticated:r,user:i,systemInfo:a,isLoading:s}=F();return v(),s?(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50 dark:bg-dark-50`,children:(0,X.jsx)(`div`,{className:`w-8 h-8 border-4 border-gray-200 dark:border-dark-300 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin`})}):a&&!a.requiresAuth?(0,X.jsx)(X.Fragment,{children:e}):t&&!r?(0,X.jsx)(o,{to:`/login`,replace:!0}):n&&(!i||i.role!==`admin`)?(0,X.jsx)(o,{to:`/`,replace:!0}):(0,X.jsx)(X.Fragment,{children:e})},xo=N(`components:error-boundary`),So=({error:e})=>{let{t}=x();return(0,X.jsx)(`div`,{className:`min-h-screen bg-gray-50 dark:bg-dark-50 flex items-center justify-center p-4 text-gray-900 dark:text-dark-800`,children:(0,X.jsx)(`div`,{className:`w-full max-w-md rounded-2xl border border-gray-200 dark:border-dark-300 bg-white/95 dark:bg-dark-100/95 shadow-card backdrop-blur-sm`,children:(0,X.jsxs)(`div`,{className:`p-6 text-center`,children:[(0,X.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-2xl bg-primary-100 text-primary-700 dark:bg-primary-900/35 dark:text-primary-300 ring-1 ring-primary-200 dark:ring-primary-800/60`,children:(0,X.jsx)(A,{className:`h-6 w-6`})}),(0,X.jsx)(`h1`,{className:`mb-2 text-xl font-semibold text-gray-950 dark:text-dark-950`,children:t(`errorBoundary.title`)}),(0,X.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-gray-600 dark:text-dark-600`,children:t(`errorBoundary.description`)}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:justify-center`,children:[(0,X.jsxs)(`button`,{onClick:()=>window.location.reload(),className:`inline-flex items-center justify-center gap-2 rounded-xl bg-primary-600 px-4 py-2.5 text-sm font-medium text-white shadow-sm transition-all hover:bg-primary-700 hover:shadow-md focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:focus:ring-offset-dark-100`,children:[(0,X.jsx)(w,{className:`h-4 w-4`}),t(`errorBoundary.tryAgain`)]}),(0,X.jsxs)(`button`,{onClick:()=>{window.location.assign(`/`)},className:`inline-flex items-center justify-center gap-2 rounded-xl border border-gray-200 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 shadow-sm transition-all hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:border-dark-300 dark:bg-dark-50 dark:text-dark-700 dark:hover:bg-dark-200 dark:focus:ring-offset-dark-100`,children:[(0,X.jsx)(de,{className:`h-4 w-4`}),t(`common.home`,`Home`)]})]}),!1]})})})},Co=class extends Y.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){xo.error(`ErrorBoundary caught an error:`,e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,X.jsx)(So,{error:this.state.error}):this.props.children}},wo=(e,t=!0)=>{let n=(0,Y.useCallback)(n=>{if(!t)return;let r=n.target;if(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.contentEditable===`true`||r.isContentEditable)return;if(n.key===`?`||n.key===`/`&&n.shiftKey){let t=e.find(e=>e.key===`?`||e.key===`h`);if(t){n.preventDefault(),n.stopPropagation(),t.action();return}}let i=e.find(e=>{let t=e.key.toLowerCase()===n.key.toLowerCase(),r=!!e.metaKey,i=n.metaKey||n.ctrlKey,a=r?i:!0,o=e.ctrlKey?n.ctrlKey:!0,s=!!e.shiftKey===n.shiftKey,c=!!e.altKey===n.altKey;return t&&a&&o&&s&&c});i&&(n.preventDefault(),n.stopPropagation(),i.action())},[e,t]);(0,Y.useEffect)(()=>{if(t)return document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`keydown`,n)}},[n,t])},To=e=>{let t=[];e.metaKey&&t.push(navigator.platform.includes(`Mac`)?`⌘`:`Ctrl`),e.ctrlKey&&t.push(`Ctrl`),e.shiftKey&&t.push(`⇧`),e.altKey&&t.push(navigator.platform.includes(`Mac`)?`⌥`:`Alt`);let n=e.key.toUpperCase();return e.key===`,`&&(n=`,`),e.key===` `&&(n=`Space`),e.key===`Enter`&&(n=`↩`),e.key===`Escape`&&(n=`Esc`),t.push(n),t.join(`+`)},Eo=({isOpen:e,onClose:t,shortcuts:n})=>{let{t:r}=x();if(!e)return null;let i={navigation:n.filter(e=>e.description.includes(`sidebar`)||e.description.includes(`Toggle`)),settings:n.filter(e=>e.description.includes(`settings`)||e.description.includes(`dark mode`)),general:n.filter(e=>!e.description.includes(`sidebar`)&&!e.description.includes(`settings`)&&!e.description.includes(`dark mode`)&&!e.description.includes(`Toggle`))};return(0,X.jsx)(`div`,{className:`fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4`,children:(0,X.jsxs)(`div`,{className:`flex max-h-[calc(100dvh-2rem)] min-h-0 w-full max-w-md flex-col overflow-hidden rounded-xl bg-white shadow-2xl dark:bg-dark-100 sm:max-h-[80dvh]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between p-6 border-b border-gray-200 dark:border-dark-300`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(De,{className:`h-5 w-5 text-gray-700 dark:text-dark-600`}),(0,X.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900 dark:text-dark-800`,children:r(`keyboard.title`)})]}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:t,className:`h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200`,children:(0,X.jsx)(Ce,{className:`h-4 w-4`})})]}),(0,X.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 space-y-6 p-6 scrollbar-thin`,children:[Object.entries(i).map(([e,t])=>t.length===0?null:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 dark:text-dark-600 mb-3`,children:r(`keyboard.groups.${e}`)}),(0,X.jsx)(`div`,{className:`space-y-2`,children:t.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-600 dark:text-dark-500`,children:e.description}),(0,X.jsx)(`kbd`,{className:`px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 text-gray-700 dark:text-dark-600 rounded border border-gray-300 dark:border-dark-400`,children:To(e)})]},t))})]},e)),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium text-gray-700 dark:text-dark-600 mb-3`,children:r(`keyboard.groups.chat`)}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-600 dark:text-dark-500`,children:r(`keyboard.actions.sendMessage`)}),(0,X.jsx)(`kbd`,{className:`px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 text-gray-700 dark:text-dark-600 rounded border border-gray-300 dark:border-dark-400`,children:`Enter`})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between py-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-gray-600 dark:text-dark-500`,children:r(`keyboard.actions.newLine`)}),(0,X.jsx)(`kbd`,{className:`px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 text-gray-700 dark:text-dark-600 rounded border border-gray-300 dark:border-dark-400`,children:`Shift+Enter`})]})]})]})]}),(0,X.jsx)(`div`,{className:`px-6 py-4 bg-gray-50 dark:bg-dark-200 border-t border-gray-200 dark:border-dark-300`,children:(0,X.jsxs)(`p`,{className:`text-xs text-gray-500 dark:text-dark-400 text-center`,children:[r(`keyboard.footer`,{key1:`?`,key2:`H`}).split(`?`)[0],(0,X.jsx)(`kbd`,{className:`px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 rounded`,children:`?`}),r(`keyboard.footer`,{key1:`?`,key2:`H`}).split(`?`)[1].split(`H`)[0],(0,X.jsx)(`kbd`,{className:`px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 rounded`,children:`H`}),r(`keyboard.footer`,{key1:`?`,key2:`H`}).split(`H`)[1]]})})]})})},Do=({onClick:e,className:t})=>{let{t:n}=x(),[r,i]=(0,Y.useState)(!1);return(0,X.jsxs)(I,{variant:`ghost`,size:`sm`,onClick:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:P(`fixed bottom-4 end-4 h-10 w-10 p-0 bg-white/80 dark:bg-dark-100/80 backdrop-blur-sm border border-gray-200 dark:border-dark-300 shadow-lg hover:shadow-xl transition-all duration-200 z-50`,`hover:bg-white dark:hover:bg-dark-100`,t),title:n(`keyboard.tooltip`),children:[(0,X.jsx)(De,{className:`h-4 w-4`}),r&&(0,X.jsx)(`div`,{className:`absolute bottom-full mb-2 end-0 px-2 py-1 text-xs bg-gray-900 text-white rounded whitespace-nowrap`,children:n(`keyboard.tooltip`)})]})},Oo=({message:e=`This is a demo version for presentation purposes only. The Ollama backend is not connected.`,onDismiss:t,className:n})=>{let[r,i]=(0,Y.useState)(!1),{t:a}=x();return r?null:(0,X.jsx)(`div`,{className:P(`bg-gray-950 text-white dark:bg-white dark:text-gray-950`,`border-b border-black/10 dark:border-white/10`,`px-4 py-2`,n),children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between max-w-6xl mx-auto gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,X.jsx)(`div`,{className:`flex-shrink-0`,children:(0,X.jsx)(le,{className:`h-4 w-4 text-white/65 dark:text-gray-950/60`})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`p`,{className:`shrink-0 text-xs font-semibold tracking-wide`,children:a(`demoMode.title`)}),(0,X.jsx)(`p`,{className:`hidden truncate text-xs text-white/60 dark:text-gray-950/60 sm:block`,children:e})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 ml-4`,children:[(0,X.jsxs)(I,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-white/70 hover:bg-white/10 hover:text-white dark:text-gray-950/70 dark:hover:bg-black/[0.06] dark:hover:text-gray-950`,onClick:()=>window.open(`https://github.com/libre-webui/libre-webui`,`_blank`),title:`View on GitHub`,children:[(0,X.jsx)(pe,{className:`h-4 w-4`}),(0,X.jsx)(`span`,{className:`ml-1 hidden sm:inline`,children:a(`demoMode.github`)})]}),(0,X.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>{i(!0),t?.()},className:`h-8 w-8 p-0 text-white/70 hover:bg-white/10 hover:text-white dark:text-gray-950/70 dark:hover:bg-black/[0.06] dark:hover:text-gray-950`,title:`Dismiss`,children:(0,X.jsx)(Ce,{className:`h-4 w-4`})})]})]})})},ko=()=>{let{preferences:e,backgroundImage:t}=rt(),n=e.backgroundSettings||{enabled:!1,imageUrl:``,blurAmount:10,opacity:.6},r=t||n.imageUrl;return!n.enabled||!r?null:(0,X.jsx)(`div`,{"data-testid":`app-background`,className:`fixed inset-0 pointer-events-none z-0`,style:{backgroundImage:`url(${r})`,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`,filter:`blur(${n.blurAmount}px)`,opacity:n.opacity,transform:`scale(1.1)`}})},Ao=e=>{va(),nt.getState().setCurrentSession(null),sessionStorage.setItem(`forceWelcomeScreen`,`true`),e(`/chat`)},jo=e=>{va(),nt.getState().setCurrentSession(null),sessionStorage.removeItem(`pendingMessage`),sessionStorage.setItem(`forceWelcomeScreen`,`true`),e(`/chat?incognito=1`)},Mo=e=>{$e.getState().clearError(),e(`/work`)},No={"/models":{icon:oe,labelKey:`sidebar.navigation.models`},"/personas":{icon:ke,labelKey:`sidebar.navigation.personas`},"/gallery":{icon:_e,labelKey:`sidebar.navigation.imagine`},"/agents":{icon:D,labelKey:`sidebar.navigation.agents`},"/users":{icon:Te,labelKey:`sidebar.navigation.userManagement`},"/usage":{icon:E,labelKey:`usageAnalytics.title`},"/system":{icon:ae,labelKey:`systemPage.title`},"/artifacts":{icon:T,labelKey:`tabs.artifacts`}},Po=e=>e.kind===`home`?de:e.kind===`chat`?S:e.kind===`work`?ie:No[e.path]?.icon??T,Fo=()=>qe()?`⌘`:`Ctrl`,Io=new Set([`/agents`,`/users`,`/usage`,`/system`]),Lo=e=>e.kind===`work`||Io.has(e.path),Ro=()=>{let{t:e}=x(),t=v(),n=c(),r=da(e=>e.tabs),i=da(e=>e.activeTabId),a=da(e=>e.syncWithPath),o=da(e=>e.closeTab),s=da(e=>e.closeTabs),l=nt(e=>e.sessions),u=nt(e=>e.currentSession),d=$e(e=>e.tasks),{systemInfo:f,isAdmin:p}=F(),[m,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(null),y=(0,Y.useRef)(null),b=(0,Y.useRef)(null),C=(0,Y.useRef)(null),w=p(),T=f?.requiresAuth===!1||w,E=T,D=T?r:r.filter(e=>!Lo(e));(0,Y.useEffect)(()=>{a(t.pathname)},[t.pathname,a]),(0,Y.useEffect)(()=>{(C.current?.querySelector(`[data-active="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},[D.length,i]),(0,Y.useEffect)(()=>{if(!f||T)return;let e=r.filter(Lo).map(e=>e.id);if(e.length===0)return;let t=s(e,`home`);t&&n(t.path,{replace:!0})},[s,n,T,f,r]),(0,Y.useEffect)(()=>{if(!m&&!g)return;let e=e=>{let t=e.target;!y.current?.contains(t)&&!b.current?.contains(t)&&(h(!1),_(null))},t=e=>{e.key===`Escape`&&(h(!1),_(null))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g,m]),(0,Y.useEffect)(()=>{g&&b.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus()},[g]);let O=t=>{if(t.kind===`home`)return e(`tabs.home`,`Home`);if(t.kind===`chat`){if(t.id===`chat:new`)return u?.isPrivate?e(`chat.session.incognito`,`Incognito Chat`):e(`tabs.newChat`,`New Chat`);let n=t.id.slice(5);return l.find(e=>e.id===n)?.title||e(`tabs.chat`,`Chat`)}if(t.kind===`work`){if(t.id===`work:new`)return e(`tabs.work`,`Work`);let n=t.id.slice(5);return d.find(e=>e.id===n)?.title||e(`tabs.work`,`Work`)}let n=No[t.path];return n?e(n.labelKey,t.path.slice(1)):t.path.slice(1)},te=(e,t)=>{e.stopPropagation(),e.preventDefault();let r=o(t.id);r&&n(r.path)},ne=(e,t,n)=>{h(!1),_({tabId:e.id,x:Math.max(8,Math.min(t,window.innerWidth-224-8)),y:Math.max(8,Math.min(n,window.innerHeight-176-8))})},re=(e,t)=>{e.preventDefault(),e.stopPropagation(),ne(t,e.clientX,e.clientY)},ae=(e,t)=>{if(e.key!==`ContextMenu`&&!(e.shiftKey&&e.key===`F10`))return;e.preventDefault();let n=e.currentTarget.getBoundingClientRect();ne(t,n.left+12,n.bottom+4)},oe=e=>{let t=Array.from(b.current?.querySelectorAll(`[role="menuitem"]:not(:disabled)`)??[]);if(t.length===0)return;let n=t.indexOf(document.activeElement),r=n;if(e.key===`ArrowDown`)r=(n+1+t.length)%t.length;else if(e.key===`ArrowUp`)r=(n-1+t.length)%t.length;else if(e.key===`Home`)r=0;else if(e.key===`End`)r=t.length-1;else return;e.preventDefault(),t[r]?.focus()},se=(e,t)=>{let r=s(e,t);_(null),r&&n(r.path)},ce=[{key:`chat`,label:e(`tabs.newChat`,`New Chat`),icon:S,shortcut:`${Fo()}⇧O`,action:()=>Ao(n)},{key:`incognito-chat`,label:e(`chat.session.incognito`,`Incognito Chat`),icon:Ae,action:()=>jo(n)},...E?[{key:`work`,label:e(`tabs.newWork`,`New Work`),icon:ie,shortcut:`${Fo()}⇧U`,action:()=>Mo(n)}]:[],...[`/models`,`/personas`,`/gallery`].map(t=>({key:t,label:e(No[t].labelKey,t.slice(1)),icon:No[t].icon,action:()=>n(t)})),...T?[{key:`/agents`,label:e(No[`/agents`].labelKey,`Agents`),icon:No[`/agents`].icon,separatorBefore:!0,action:()=>n(`/agents`)}]:[],...w?[`/users`,`/system`,`/usage`].map(t=>({key:t,label:e(No[t].labelKey,t.slice(1)),icon:No[t].icon,action:()=>n(t)})):[]],A=g?D.find(e=>e.id===g.tabId):void 0,le=A?D.findIndex(e=>e.id===A.id):-1,de=A?D.filter(e=>e.id!==`home`&&e.id!==A.id).map(e=>e.id):[],fe=le>=0?D.slice(le+1).filter(e=>e.id!==`home`).map(e=>e.id):[],pe=D.filter(e=>e.id!==`home`).map(e=>e.id);return(0,X.jsxs)(`div`,{"data-testid":`app-tab-bar`,className:`relative z-20 flex h-9 flex-none items-center gap-1 px-1 pb-1 lg:px-0`,children:[(0,X.jsx)(`div`,{ref:C,role:`tablist`,"aria-label":e(`tabs.label`,`Open tabs`),className:`flex min-w-0 items-center gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:D.map(t=>{let r=t.id===`chat:new`&&u?.isPrivate?Ae:Po(t),a=t.id===i;return(0,X.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a,"data-active":a||void 0,"data-tab-id":t.id,"data-testid":`app-tab`,title:O(t),onClick:()=>n(t.path),onContextMenu:e=>re(e,t),onKeyDown:e=>ae(e,t),onAuxClick:e=>{e.button===1&&t.id!==`home`&&te(e,t)},className:P(`group flex h-7 min-w-0 flex-none items-center gap-1.5 rounded-lg border text-[13px] transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40`,t.id===`home`?`px-2.5`:`ps-2.5 pe-1`,a?`border-black/[0.06] bg-gray-50 text-gray-950 shadow-subtle dark:border-white/[0.07] dark:bg-dark-100 dark:text-dark-950`:`border-transparent text-gray-500 hover:bg-white/60 hover:text-gray-900 dark:text-dark-600 dark:hover:bg-dark-200/60 dark:hover:text-dark-900`),children:[(0,X.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`max-w-[9rem] truncate`,children:O(t)}),t.id!==`home`&&(0,X.jsx)(`span`,{role:`button`,tabIndex:-1,"aria-label":e(`tabs.close`,`Close tab`),"data-testid":`app-tab-close`,onClick:e=>te(e,t),className:P(`flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-opacity hover:bg-black/[0.06] hover:text-gray-700 dark:text-dark-500 dark:hover:bg-white/[0.08] dark:hover:text-dark-800`,a?`opacity-100`:`sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-visible:opacity-100`),children:(0,X.jsx)(Ce,{className:`h-3 w-3`})})]},t.id)})}),g&&A&&(0,X.jsxs)(`div`,{ref:b,role:`menu`,"aria-label":e(`tabs.actions`,`Tab actions`),"data-testid":`app-tab-context-menu`,onContextMenu:e=>e.preventDefault(),onKeyDown:oe,className:`fixed z-[100] w-56 rounded-xl border border-line bg-surface-overlay/95 p-1 shadow-overlay backdrop-blur-xl animate-fade-in motion-reduce:animate-none`,style:{left:g.x,top:g.y},children:[(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-testid":`app-tab-context-close`,disabled:A.id===`home`,onClick:()=>{let e=o(A.id);_(null),e&&n(e.path)},className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-ink-muted transition-colors hover:bg-black/[0.05] hover:text-ink disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]`,children:[(0,X.jsx)(Ce,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{children:e(`tabs.close`,`Close tab`)})]}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-testid":`app-tab-context-close-others`,disabled:de.length===0,onClick:()=>se(de,A.id),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-ink-muted transition-colors hover:bg-black/[0.05] hover:text-ink disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]`,children:[(0,X.jsx)(ue,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{children:e(`tabs.closeOthers`,`Close other tabs`)})]}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-testid":`app-tab-context-close-right`,disabled:fe.length===0,onClick:()=>se(fe,A.id),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-ink-muted transition-colors hover:bg-black/[0.05] hover:text-ink disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]`,children:[(0,X.jsx)(k,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{children:e(`tabs.closeRight`,`Close tabs to the right`)})]}),(0,X.jsx)(`div`,{className:`mx-2 my-1 h-px bg-line`,role:`separator`}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,"data-testid":`app-tab-context-close-all`,disabled:pe.length===0,onClick:()=>se(pe,`home`),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-ink-muted transition-colors hover:bg-black/[0.05] hover:text-ink disabled:cursor-not-allowed disabled:opacity-40 dark:hover:bg-white/[0.06]`,children:[(0,X.jsx)(ee,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{children:e(`tabs.closeAll`,`Close all tabs`)})]})]}),(0,X.jsxs)(`div`,{className:`relative flex-none`,ref:y,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":e(`tabs.new`,`New tab`),"aria-expanded":m,"data-testid":`app-tab-new`,onClick:()=>h(e=>!e),className:`flex h-7 w-7 items-center justify-center rounded-lg text-gray-500 transition-colors hover:bg-white/60 hover:text-gray-900 dark:text-dark-600 dark:hover:bg-dark-200/60 dark:hover:text-dark-900 outline-none focus-visible:ring-2 focus-visible:ring-primary-500/40`,children:(0,X.jsx)(xe,{className:`h-4 w-4`})}),m&&(0,X.jsx)(`div`,{role:`menu`,"data-testid":`app-tab-new-menu`,className:`absolute start-0 top-full z-50 mt-1 w-56 rounded-xl border border-line bg-surface-overlay/95 p-1 shadow-overlay backdrop-blur-xl animate-fade-in motion-reduce:animate-none`,children:ce.map(e=>(0,X.jsxs)(Y.Fragment,{children:[e.separatorBefore&&(0,X.jsx)(`div`,{className:`mx-2 my-1 h-px bg-line`,role:`separator`}),(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{h(!1),e.action()},className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-ink-muted transition-colors hover:bg-black/[0.05] hover:text-ink dark:hover:bg-white/[0.06]`,children:[(0,X.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-start`,children:e.label}),e.shortcut&&(0,X.jsx)(`span`,{className:`font-mono text-[10px] tracking-wide text-ink-subtle`,children:e.shortcut})]})]},e.key))})]})]})},zo=({onOpenSettings:e})=>{let{t,i18n:n}=x(),r=c(),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(0),d=(0,Y.useRef)(null),f=(0,Y.useRef)(null),p=nt(e=>e.sessions),m=$e(e=>e.tasks),h=rt(e=>e.toggleTheme),{systemInfo:g,isAdmin:_}=F(),v=g?.requiresAuth===!1||_(),y=v,b=qe()?`⌘`:`Ctrl`;(0,Y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),s(``),u(0),a(e=>!e))},t=()=>{s(``),u(0),a(!0)};return document.addEventListener(`keydown`,e,!0),window.addEventListener(`libre:open-palette`,t),()=>{document.removeEventListener(`keydown`,e,!0),window.removeEventListener(`libre:open-palette`,t)}},[]),(0,Y.useEffect)(()=>{if(!i)return;let e=window.requestAnimationFrame(()=>d.current?.focus());return()=>window.cancelAnimationFrame(e)},[i]);let C=(0,Y.useCallback)(()=>a(!1),[]),w=(0,Y.useMemo)(()=>{let i=t(`palette.actions`,`Actions`),a=[{id:`action:new-chat`,section:i,label:t(`tabs.newChat`,`New Chat`),icon:S,hint:`${b}⇧O`,run:()=>Ao(r)},{id:`action:incognito-chat`,section:i,label:t(`chat.session.incognito`,`Incognito Chat`),icon:Ae,run:()=>jo(r)},...v?[{id:`action:new-work`,section:i,label:t(`tabs.newWork`,`New Work`),icon:ie,hint:`${b}⇧U`,run:()=>Mo(r)}]:[],{id:`action:home`,section:i,label:t(`tabs.home`,`Home`),icon:de,run:()=>r(`/`)},{id:`action:models`,section:i,label:t(`sidebar.navigation.models`,`Models`),icon:oe,run:()=>r(`/models`)},{id:`action:personas`,section:i,label:t(`sidebar.navigation.personas`,`Personas`),icon:ke,run:()=>r(`/personas`)},{id:`action:gallery`,section:i,label:t(`sidebar.navigation.imagine`,`Imagine`),icon:_e,run:()=>r(`/gallery`)},...y?[{id:`action:agents`,section:i,label:t(`sidebar.navigation.agents`,`Agents`),icon:D,run:()=>r(`/agents`)}]:[],{id:`action:settings`,section:i,label:t(`palette.settings`,`Settings`),icon:fe,hint:`${b},`,run:e},{id:`action:theme`,section:i,label:t(`palette.toggleTheme`,`Toggle theme`),icon:te,hint:`${b}D`,run:h}],o=[...p].sort((e,t)=>t.updatedAt-e.updatedAt).map(e=>({id:`session:${e.id}`,section:t(`palette.chats`,`Chats`),label:e.title||t(`tabs.chat`,`Chat`),icon:S,hint:Je(e.updatedAt,n.language),keywords:e.model,run:()=>r(`/c/${e.id}`)})),s=v?[...m].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:`work:${e.id}`,section:t(`palette.work`,`Work`),label:e.title||t(`work.tasks.untitled`,`Untitled task`),icon:ie,hint:e.status,run:()=>r(`/work/${e.id}`)})):[];return[...a,...o,...s]},[t,b,r,e,h,p,m,v,y,n.language]),T=(0,Y.useMemo)(()=>{let e=o.trim().toLowerCase();if(!e){let e=w.filter(e=>e.id.startsWith(`action:`)),t=w.filter(e=>e.id.startsWith(`session:`)).slice(0,4),n=w.filter(e=>e.id.startsWith(`work:`)).slice(0,3);return[...e,...t,...n]}return w.filter(t=>`${t.label} ${t.keywords??``}`.toLowerCase().includes(e)).slice(0,20)},[w,o]);(0,Y.useEffect)(()=>{(f.current?.querySelector(`[data-selected="true"]`))?.scrollIntoView({block:`nearest`})},[l,T.length]);let E=e=>{e&&(C(),e.run())};if(!i)return null;let O=``;return(0,ba.createPortal)((0,X.jsx)(`div`,{"data-testid":`command-palette`,className:`fixed inset-0 z-[120] flex items-start justify-center bg-black/25 px-4 pt-[14vh] backdrop-blur-[2px] dark:bg-black/45`,onMouseDown:e=>{e.target===e.currentTarget&&C()},children:(0,X.jsxs)(`div`,{className:`w-full max-w-lg overflow-hidden rounded-2xl border border-line bg-surface-overlay/95 shadow-overlay backdrop-blur-xl animate-scale-in motion-reduce:animate-none`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-line px-3.5`,children:[(0,X.jsx)(Fe,{className:`h-4 w-4 shrink-0 text-ink-subtle`}),(0,X.jsx)(`input`,{ref:d,"data-testid":`command-palette-input`,value:o,onChange:e=>{s(e.target.value),u(0)},onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),C()):e.key===`ArrowDown`?(e.preventDefault(),u(e=>Math.min(T.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),u(e=>Math.max(0,e-1))):e.key===`Enter`&&(e.preventDefault(),E(T[l]))},placeholder:t(`palette.placeholder`,`Search chats, Work, actions…`),className:`h-11 w-full bg-transparent text-sm text-ink outline-none placeholder:text-ink-subtle`}),(0,X.jsx)(`kbd`,{className:`shrink-0 rounded-md border border-line px-1.5 py-0.5 font-mono text-[10px] text-ink-subtle`,children:`esc`})]}),(0,X.jsxs)(`div`,{ref:f,className:`max-h-[19rem] overflow-y-auto p-1.5 scrollbar-thin`,children:[T.length===0&&(0,X.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-ink-subtle`,children:t(`palette.empty`,`No matches.`)}),T.map((e,t)=>{let n=e.section!==O;return O=e.section,(0,X.jsxs)(Y.Fragment,{children:[n&&(0,X.jsx)(`p`,{className:`px-2.5 pb-1 pt-2 text-[10px] font-medium uppercase tracking-[0.08em] text-ink-subtle first:pt-1`,children:e.section}),(0,X.jsxs)(`button`,{type:`button`,"data-selected":t===l||void 0,onMouseEnter:()=>u(t),onClick:()=>E(e),className:P(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-start text-sm transition-colors`,t===l?`bg-black/[0.05] text-ink dark:bg-white/[0.07]`:`text-ink-muted`),children:[(0,X.jsx)(e.icon,{className:`h-4 w-4 shrink-0 text-ink-subtle`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint&&(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-ink-subtle`,children:e.hint})]})]},e.id)})]})]})}),document.body)},Bo=N(`user-service`),Vo=class{static async initializeAuth(){let{setLoading:e,setSystemInfo:t,login:n}=F.getState();try{e(!0),Bo.debug(`Starting auth initialization...`),Bo.debug(`Fetching system info...`);let r=await We.getSystemInfo();Bo.debug(`System info response:`,r),r.success&&r.data?(Bo.debug(`Setting system info:`,r.data),t(r.data)):Bo.error(`System info response failed:`,r);let i=localStorage.getItem(`auth-token`);if(i)try{let e=(await d(async()=>{let{default:e}=await import(`../js/utils-vendor-Cbaj0BC5.js`).then(e=>e.i);return{default:e}},__vite__mapDeps([5,1,2]))).default,t=e.defaults.headers.common;e.defaults.headers.common.Authorization=`Bearer ${i}`;let r=await We.verifyToken();if(r.success&&r.data){let e=F.getState().systemInfo;e&&n(r.data,i,e)}e.defaults.headers.common=t}catch(e){Bo.error(`Token verification failed:`,e),localStorage.removeItem(`auth-token`)}}catch(e){Bo.error(`Auth initialization error:`,e)}finally{e(!1)}}};ze.interceptors.request.use(e=>{let t=localStorage.getItem(`auth-token`);return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),ze.interceptors.response.use(e=>e,e=>{if(e.response?.status===401){localStorage.removeItem(`auth-token`);let{logout:e}=F.getState();e();let t=window.location.protocol===`file:`;window.location.href=t?`#/login`:`/login`}return Promise.reject(e)});var Ho=N(`initialize`),Uo=()=>{let e=(0,Y.useRef)(!1),t=(0,Y.useRef)(!1),{loadSessions:n,loadModels:r,loadPreferences:i,setSelectedModel:a,models:o}=nt(),{loadPreferences:s}=rt(),{loadPlugins:c,plugins:l}=Ze();(0,Y.useEffect)(()=>{e.current||t.current||(async()=>{t.current=!0;try{Ho.debug(`Initializing Libre WebUI...`),await Vo.initializeAuth();let t=F.getState();if(t.requiresAuth()&&!t.isAuthenticated){Ho.debug(`Authentication required; deferring protected app initialization`),e.current=!0;return}try{!(await Ke.checkHealth()).success&&!He()&&M.error(`Ollama service is not available. Plugin models may still be used.`)}catch(e){Ho.warn(`Ollama health check failed; continuing provider initialization:`,e),He()||M.error(`Ollama service is not available. Plugin models may still be used.`)}await Promise.all([s(),i()]),await Promise.all([r(),n(),c()]),e.current=!0,Ho.debug(`Libre WebUI initialized successfully`)}catch(t){He()?(await Promise.all([s(),i()]),await Promise.all([r(),n(),c()]),e.current=!0):(Ho.error(`Failed to initialize app:`,t),M.error(`Failed to connect to the backend service`))}finally{t.current=!1}})()},[s,i,r,n,c]),(0,Y.useEffect)(()=>{if(o.length>0){let e=o.filter(e=>!e.name.includes(`embed`))[0]||o[0],{selectedModel:t,selectedProviderType:n,selectedProviderId:r}=nt.getState();if(t){if(!Qe(o,{model:t,providerType:n,providerId:r})&&n!==`ollama`&&n!==`plugin`){let t=et(e);Ho.debug(`Legacy selected model not available, falling back to:`,t.model),a(t.model,t.providerType,t.providerId)}}else{let t=et(e);Ho.debug(`No model selected, using first available:`,t.model),a(t.model,t.providerType,t.providerId)}}},[o,a]),(0,Y.useEffect)(()=>{e.current&&(Ho.debug(`Plugin availability changed, reloading models...`),r())},[l,r])},Wo=N(`components:git-hub-auth-button`),Go=()=>{let{t:e}=x(),[t,n]=(0,Y.useState)(!1),[r,i]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{(async()=>{try{let e=await fetch(`${Ue}/auth/oauth/github/status`,{method:`GET`,credentials:`include`});if(e.ok){let t=await e.json();i(t.configured||!1),Wo.debug(`GitHub OAuth configured:`,t.configured)}else Wo.debug(`GitHub OAuth status check failed`),i(!1)}catch(e){Wo.debug(`GitHub OAuth not configured:`,e),i(!1)}})()},[]),r?(0,X.jsx)(`button`,{type:`button`,onClick:()=>{if(!r||t)return;n(!0);let e=`${Ue}/auth/oauth/github`;window.location.href=e},disabled:t,className:`flex h-11 w-full items-center justify-center rounded-xl border border-line bg-surface-raised px-4 text-sm font-medium text-ink shadow-subtle transition-colors hover:border-line-strong hover:bg-surface-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none`,children:t?(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(Oe,{size:16,className:`me-2 animate-spin`}),e(`auth.oauth.connectingTo`,{provider:e(`auth.oauth.github`)})]}):(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(Ee,{size:16,className:`me-2`}),e(`auth.oauth.continueWith`,{provider:e(`auth.oauth.github`)})]})}):null},Ko=N(`components:hugging-face-auth-button`),qo=()=>{let{t:e}=x(),[t,n]=(0,Y.useState)(!1),[r,i]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{(async()=>{try{let e=await fetch(`${Ue}/auth/oauth/huggingface/status`,{method:`GET`,credentials:`include`});if(e.ok){let t=await e.json();i(t.configured||!1),Ko.debug(`Hugging Face OAuth configured:`,t.configured)}else Ko.debug(`Hugging Face OAuth status check failed`),i(!1)}catch(e){Ko.debug(`Hugging Face OAuth not configured:`,e),i(!1)}})()},[]),r?(0,X.jsx)(`button`,{type:`button`,onClick:()=>{if(!r||t)return;n(!0);let e=`${Ue}/auth/oauth/huggingface`;window.location.href=e},disabled:t,className:`flex h-11 w-full items-center justify-center rounded-xl border border-line bg-surface-raised px-4 text-sm font-medium text-ink shadow-subtle transition-colors hover:border-line-strong hover:bg-surface-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none`,children:t?(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(Oe,{size:16,className:`me-2 animate-spin`}),e(`auth.oauth.connectingTo`,{provider:e(`auth.oauth.huggingFace`)})]}):(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(`span`,{className:`me-2 text-base`,children:`🤗`}),e(`auth.oauth.continueWith`,{provider:e(`auth.oauth.huggingFace`)})]})}):null},Jo=N(`hooks:oauth-providers`),Yo=async e=>{try{let t=await fetch(`${Ue}/auth/oauth/${e}/status`,{method:`GET`,credentials:`include`});return t.ok?!!(await t.json()).configured:!1}catch(t){return Jo.debug(`${e} OAuth not configured:`,t),!1}},Xo=()=>{let[e,t]=(0,Y.useState)({github:!1,huggingface:!1});return(0,Y.useEffect)(()=>{let e=!0;return Promise.all([Yo(`github`),Yo(`huggingface`)]).then(([n,r])=>{e&&t({github:n,huggingface:r})}),()=>{e=!1}},[]),{...e,hasAny:e.github||e.huggingface}},Zo=N(`components:turnstile-widget`),Qo=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,$o=null,es=()=>window.turnstile?Promise.resolve():$o||($o=new Promise((e,t)=>{let n=document.querySelector(`script[src="${Qo}"]`);if(n){n.addEventListener(`load`,()=>e(),{once:!0}),n.addEventListener(`error`,t,{once:!0});return}let r=document.createElement(`script`);r.src=Qo,r.async=!0,r.defer=!0,r.onload=()=>e(),r.onerror=t,document.head.appendChild(r)}),$o),ts=({siteKey:e,action:t,disabled:n=!1,errorMessage:r,onTokenChange:i})=>{let a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),[s,c]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{let n=!1,r=a.current;return i(``),es().then(()=>{n||!r||!window.turnstile||(r.innerHTML=``,o.current=window.turnstile.render(r,{sitekey:e,theme:`auto`,action:t,callback:e=>i(e),"expired-callback":()=>i(``),"error-callback":()=>i(``)}))}).catch(e=>{Zo.error(`Turnstile script failed to load:`,e),n||c(!0)}),()=>{n=!0,i(``),o.current&&window.turnstile?.remove?window.turnstile.remove(o.current):r&&(r.innerHTML=``),o.current=null}},[t,i,e]),(0,Y.useEffect)(()=>{n&&o.current&&(window.turnstile?.reset(o.current),i(``))},[n,i]),s?(0,X.jsx)(`div`,{className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300`,children:r}):(0,X.jsx)(`div`,{className:`rounded-lg border border-accent-200 bg-accent-50/40 p-3 transition-opacity dark:border-accent-800/70 dark:bg-accent-950/20 ${n?`pointer-events-none opacity-60`:``}`,"aria-label":`Security verification`,children:(0,X.jsx)(`div`,{ref:a,className:`min-h-[65px]`})})},ns=N(`components:login-form`),rs={username:`demo`,password:`demo`},is=({onLogin:e,onShowSignup:t,initialApprovalPending:n=!1,bare:r=!1})=>{let{t:i}=x(),a=He(),o=Xo(),[s,l]=(0,Y.useState)(a?rs.username:``),[u,d]=(0,Y.useState)(a?rs.password:``),[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(n),[v,y]=(0,Y.useState)(``),b=c(),{login:S,systemInfo:C}=F(),w=C?.turnstile?.siteKey,T=!!(C?.turnstile?.enabled&&w&&!a),E=(0,Y.useCallback)(e=>{y(e)},[]),D=(0,Y.useMemo)(()=>m||T&&!v,[m,T,v]),O=async t=>{t.preventDefault();let n=a?rs.username:s.trim(),r=a?rs.password:u.trim();if(!n||!r){j.error(i(`auth.login.enterBoth`));return}if(T&&!v){j.error(i(`auth.login.verificationFailed`,`Security verification failed. Please refresh and try again.`));return}h(!0),_(!1);try{localStorage.removeItem(`auth-token`);let t=await We.login({username:n,password:r,turnstileToken:v});t.success&&t.data?(S(t.data.user,t.data.token,t.data.systemInfo),j.success(i(`auth.login.loginSuccess`)),e?.(),b(`/`)):j.error(t.message||i(`auth.login.loginFailed`))}catch(e){ns.error(`Login error:`,e);let t=e;t.response?.data?.code===`ACCOUNT_PENDING`?(_(!0),j.error(t.response.data.message||i(`auth.login.approvalPending`,`Your account is waiting for administrator approval.`))):j.error(i(`auth.login.checkCredentials`))}finally{y(``),h(!1)}},ee=e=>{if(e.key===`Enter`){let t=e.currentTarget.form;t&&t.requestSubmit()}};return(0,X.jsxs)(`div`,{className:P(`mx-auto w-full max-w-md`,!r&&`rounded-3xl border border-line bg-surface-raised p-6 shadow-card sm:p-8`),children:[(0,X.jsxs)(`div`,{className:P(`mb-8`,r?`text-start`:`text-center`),children:[(0,X.jsx)(`h1`,{className:`mb-2 text-3xl font-light tracking-[-0.04em] text-ink`,children:i(`auth.login.title`)}),(0,X.jsx)(`p`,{className:`text-sm leading-6 text-ink-muted`,children:i(`auth.login.subtitle`)})]}),(0,X.jsxs)(`form`,{onSubmit:O,className:`space-y-5`,children:[g&&(0,X.jsxs)(`div`,{"data-testid":`login-approval-pending`,role:`status`,className:`flex gap-3 rounded-xl border border-warning-500/30 bg-warning-500/10 p-3 text-start`,children:[(0,X.jsx)(Se,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 shrink-0 text-warning-700 dark:text-warning-400`}),(0,X.jsx)(`p`,{className:`text-xs leading-5 text-ink-muted`,children:i(`auth.login.approvalPending`,`Your account is waiting for administrator approval.`)})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{htmlFor:`username`,className:`mb-2 block text-sm font-medium text-ink`,children:i(`auth.login.username`)}),(0,X.jsx)(`input`,{id:`username`,type:`text`,value:s,onChange:e=>l(e.target.value),onKeyDown:ee,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-muted motion-reduce:transition-none`,placeholder:i(`auth.login.usernamePlaceholder`),required:!0,disabled:m||a})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{htmlFor:`password`,className:`mb-2 block text-sm font-medium text-ink`,children:i(`auth.login.password`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{id:`password`,type:f?`text`:`password`,value:u,onChange:e=>d(e.target.value),onKeyDown:ee,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 pe-11 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:bg-surface-subtle disabled:text-ink-muted motion-reduce:transition-none`,placeholder:i(`auth.login.passwordPlaceholder`),required:!0,disabled:m||a}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>p(!f),className:`absolute inset-y-0 end-0 flex items-center pe-3 text-ink-muted transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-50`,disabled:m||a,"aria-label":f?`Hide characters`:`Reveal characters`,children:f?(0,X.jsx)(Pe,{size:20}):(0,X.jsx)(Re,{size:20})})]})]}),T&&w&&(0,X.jsx)(ts,{siteKey:w,action:`login`,disabled:m,errorMessage:i(`auth.login.verificationFailed`,`Security verification failed. Please refresh and try again.`),onTokenChange:E}),(0,X.jsx)(`button`,{type:`submit`,disabled:D,className:`flex h-11 w-full items-center justify-center rounded-xl border border-transparent bg-ink px-4 text-sm font-medium text-ink-inverse shadow-subtle transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none`,children:m?(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(`div`,{className:`me-2 h-4 w-4 animate-spin rounded-full border-b-2 border-current`}),i(`auth.login.signingIn`)]}):(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(ce,{size:16,className:`me-2`}),i(`auth.login.signIn`)]})})]}),!a&&(0,X.jsxs)(X.Fragment,{children:[o.hasAny&&(0,X.jsxs)(`div`,{className:`mt-6`,children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,X.jsx)(`div`,{className:`w-full border-t border-line`})}),(0,X.jsx)(`div`,{className:`relative flex justify-center text-sm`,children:(0,X.jsx)(`span`,{className:P(`px-2 text-ink-muted`,r?`bg-canvas`:`bg-surface-raised`),children:i(`common.or`)})})]}),(0,X.jsxs)(`div`,{className:`mt-6 space-y-3`,children:[o.github&&(0,X.jsx)(Go,{}),o.huggingface&&(0,X.jsx)(qo,{})]})]}),t&&(0,X.jsx)(`div`,{className:`mt-6 text-center`,children:(0,X.jsxs)(`p`,{className:`text-sm text-ink-muted`,children:[i(`auth.login.noAccount`),` `,(0,X.jsx)(`button`,{onClick:t,className:`font-medium text-primary-600 transition-colors hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:i(`auth.login.signUpHere`)})]})})]})]})},as=N(`components:signup-form`),os=({onSignup:e,onBackToLogin:t,bare:n=!1})=>{let{t:r}=x(),[i,a]=(0,Y.useState)(``),[o,s]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(``),[d,f]=(0,Y.useState)(``),[p,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(``),w=c(),{login:T,systemInfo:E}=F(),D=E?.turnstile?.siteKey,O=!!(E?.turnstile?.enabled&&D),ee=(0,Y.useCallback)(e=>{C(e)},[]),te=(0,Y.useMemo)(()=>_||O&&!S,[_,O,S]),ne=async t=>{if(t.preventDefault(),!i.trim()||!l.trim()){j.error(r(`auth.signup.usernameRequired`));return}if(l!==d){j.error(r(`auth.signup.passwordMismatch`));return}if(l.length<6){j.error(r(`auth.signup.passwordTooShort`));return}if(O&&!S){j.error(r(`auth.signup.tryAgain`));return}v(!0);try{let t=await We.signup({username:i,password:l,email:o,turnstileToken:S});if(t.success&&t.data){if(!(`token`in t.data)){b(!0),j.success(r(`auth.signup.approvalPending`,`Registration received. An administrator must approve your account.`));return}T(t.data.user,t.data.token,t.data.systemInfo),j.success(r(`auth.signup.signupSuccess`)),e?.(),w(`/`)}else j.error(t.message||r(`auth.signup.signupFailed`))}catch(e){as.error(`Signup error:`,e),j.error(r(`auth.signup.tryAgain`))}finally{C(``),v(!1)}},k=e=>{if(e.key===`Enter`){let t=e.currentTarget.form;t&&t.requestSubmit()}};return y?(0,X.jsxs)(`div`,{"data-testid":`signup-approval-pending`,className:P(`mx-auto w-full max-w-md text-center`,!n&&`rounded-3xl border border-line bg-surface-raised p-6 shadow-card sm:p-8`),children:[(0,X.jsx)(`div`,{className:`mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-warning-500/15 text-warning-700 dark:text-warning-400`,children:(0,X.jsx)(Se,{"aria-hidden":`true`,className:`h-6 w-6`})}),(0,X.jsx)(`h1`,{className:`mt-5 text-3xl font-light tracking-[-0.04em] text-ink`,children:r(`auth.signup.awaitingApproval`,`Awaiting approval`)}),(0,X.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-ink-muted`,children:r(`auth.signup.awaitingApprovalDescription`,`Your account has been created, but an administrator must activate it before you can sign in.`)}),(0,X.jsx)(`button`,{type:`button`,onClick:t,className:`mt-6 inline-flex h-11 w-full items-center justify-center rounded-xl border border-line bg-surface px-4 text-sm font-medium text-ink shadow-subtle transition-colors hover:bg-surface-raised`,children:r(`auth.signup.backToSignIn`,`Back to sign in`)})]}):(0,X.jsxs)(`div`,{className:P(`mx-auto w-full max-w-md`,!n&&`rounded-3xl border border-line bg-surface-raised p-6 shadow-card sm:p-8`),children:[(0,X.jsxs)(`div`,{className:P(`mb-8`,n?`text-start`:`text-center`),children:[(0,X.jsx)(`h1`,{className:`mb-2 text-3xl font-light tracking-[-0.04em] text-ink`,children:r(`auth.signup.title`)}),(0,X.jsx)(`p`,{className:`text-sm leading-6 text-ink-muted`,children:r(`auth.signup.subtitle`)})]}),(0,X.jsxs)(`form`,{onSubmit:ne,className:`space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{htmlFor:`username`,className:`mb-2 block text-sm font-medium text-ink`,children:r(`auth.signup.username`)}),(0,X.jsx)(`input`,{id:`username`,type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:k,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none`,placeholder:r(`auth.signup.usernamePlaceholder`),required:!0,disabled:_})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`label`,{htmlFor:`email`,className:`mb-2 block text-sm font-medium text-ink`,children:[r(`auth.signup.email`),` `,(0,X.jsxs)(`span`,{className:`text-ink-muted`,children:[`(`,r(`common.optional`),`)`]})]}),(0,X.jsx)(`input`,{id:`email`,type:`email`,value:o,onChange:e=>s(e.target.value),onKeyDown:k,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none`,placeholder:r(`auth.signup.emailPlaceholder`),disabled:_})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{htmlFor:`password`,className:`mb-2 block text-sm font-medium text-ink`,children:r(`auth.signup.password`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{id:`password`,type:p?`text`:`password`,value:l,onChange:e=>u(e.target.value),onKeyDown:k,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 pe-11 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none`,placeholder:r(`auth.signup.passwordPlaceholder`),required:!0,disabled:_}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>m(!p),className:`absolute inset-y-0 end-0 flex items-center pe-3 text-ink-muted transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-50`,disabled:_,"aria-label":p?`Hide characters`:`Reveal characters`,children:p?(0,X.jsx)(Pe,{size:20}):(0,X.jsx)(Re,{size:20})})]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`label`,{htmlFor:`confirmPassword`,className:`mb-2 block text-sm font-medium text-ink`,children:r(`auth.signup.confirmPassword`)}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`input`,{id:`confirmPassword`,type:h?`text`:`password`,value:d,onChange:e=>f(e.target.value),onKeyDown:k,className:`h-11 w-full rounded-xl border border-line bg-surface px-3 pe-11 text-sm text-ink shadow-subtle outline-none transition-[border-color,box-shadow,background-color] placeholder:text-ink-muted focus:border-line-strong focus:ring-2 focus:ring-primary-500/35 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none`,placeholder:r(`auth.signup.confirmPasswordPlaceholder`),required:!0,disabled:_}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>g(!h),className:`absolute inset-y-0 end-0 flex items-center pe-3 text-ink-muted transition-colors hover:text-ink disabled:cursor-not-allowed disabled:opacity-50`,disabled:_,"aria-label":h?`Hide confirmation`:`Reveal confirmation`,children:h?(0,X.jsx)(Pe,{size:20}):(0,X.jsx)(Re,{size:20})})]})]}),O&&D&&(0,X.jsx)(ts,{siteKey:D,action:`signup`,disabled:_,errorMessage:r(`auth.signup.tryAgain`),onTokenChange:ee}),(0,X.jsx)(`button`,{type:`submit`,disabled:te,className:`flex h-11 w-full items-center justify-center rounded-xl border border-transparent bg-ink px-4 text-sm font-medium text-ink-inverse shadow-subtle transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 focus-visible:ring-offset-canvas disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none`,children:_?(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(`div`,{className:`me-2 h-4 w-4 animate-spin rounded-full border-b-2 border-current`}),r(`auth.signup.creatingAccount`)]}):(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(me,{size:16,className:`me-2`}),r(`auth.signup.createAccount`)]})})]}),(0,X.jsx)(Go,{}),(0,X.jsx)(`div`,{className:`mt-6 text-center`,children:(0,X.jsxs)(`p`,{className:`text-sm text-ink-muted`,children:[r(`auth.signup.hasAccount`),` `,(0,X.jsx)(`button`,{onClick:t,className:`font-medium text-primary-600 transition-colors hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:r(`auth.signup.signInHere`)})]})})]})},ss=`0.18.0`,cs=()=>{let{t:e}=x(),t=c(),n=v(),{isAuthenticated:r,requiresAuth:i,systemInfo:a}=F(),[o,s]=(0,Y.useState)(!1),l=i(),u=a?.signupEnabled??!0,d=new URLSearchParams(n.search).get(`approval`)===`pending`;if((0,Y.useEffect)(()=>{(r||!l)&&t(`/`)},[l,r,t]),r||!l)return null;let f=[{icon:Le,title:e(`auth.highlights.local.title`,`Local first`),body:e(`auth.highlights.local.body`,`Your conversations and files stay on the machine you run this on.`)},{icon:C,title:e(`auth.highlights.providers.title`,`Any provider`),body:e(`auth.highlights.providers.body`,`Local models through Ollama, plus the remote providers you choose to add.`)},{icon:je,title:e(`auth.highlights.work.title`,`Isolated Work`),body:e(`auth.highlights.work.body`,`Give a model a sandboxed workspace with files, a terminal, and a preview.`)}],p=a?.version||ss;return(0,X.jsxs)(`div`,{className:`relative min-h-screen overflow-y-auto bg-canvas text-ink`,children:[(0,X.jsxs)(`header`,{className:`absolute inset-x-0 top-0 z-10 flex h-14 items-center justify-between px-5 sm:px-8`,children:[(0,X.jsx)(oo,{size:`sm`,className:`text-ink lg:invisible`}),(0,X.jsx)(so,{})]}),(0,X.jsxs)(`main`,{className:`grid min-h-screen lg:grid-cols-2`,children:[(0,X.jsxs)(`section`,{className:`relative hidden flex-col justify-between border-e border-line bg-surface px-10 py-12 lg:flex xl:px-16`,children:[(0,X.jsx)(oo,{size:`lg`,className:`relative z-10 text-ink`}),(0,X.jsxs)(`div`,{className:`relative z-10 max-w-lg`,children:[(0,X.jsx)(`p`,{className:`text-[2.6rem] font-light leading-[1.05] tracking-[-0.04em] text-ink xl:text-5xl`,children:e(`auth.tagline`,`Your AI stack should answer to you.`)}),(0,X.jsx)(`ul`,{className:`mt-10 space-y-5`,children:f.map(e=>(0,X.jsxs)(`li`,{className:`flex gap-3`,children:[(0,X.jsx)(e.icon,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 shrink-0 text-ink-subtle`}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`text-[13px] font-medium text-ink`,children:e.title}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[13px] leading-relaxed text-ink-muted`,children:e.body})]})]},e.title))})]}),(0,X.jsxs)(`p`,{className:`relative z-10 font-mono text-[11px] text-ink-subtle`,children:[p?`v${p}`:``,p?` · `:``,e(`auth.selfHosted`,`Self-hosted · Apache 2.0`)]})]}),(0,X.jsx)(`section`,{className:`flex items-center justify-center px-5 pb-12 pt-24 sm:px-8 lg:px-12 lg:py-12`,children:(0,X.jsx)(`div`,{className:`w-full max-w-sm`,children:o&&u?(0,X.jsx)(os,{bare:!0,onBackToLogin:()=>s(!1),onSignup:()=>s(!1)}):(0,X.jsx)(is,{bare:!0,initialApprovalPending:d,onShowSignup:u?()=>s(!0):void 0})})})]})]})},ls=window.location.protocol===`file:`,us=()=>ls?(0,X.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-8 z-50`,style:{WebkitAppRegion:`drag`}}):null,ds=N(`app`),fs=Y.lazy(()=>d(()=>import(`../js/HomePage-Vyj4ndU4.js`),__vite__mapDeps([17,1,2,3,12,13,4,5,15,7,8,14,6,18]))),ps=Y.lazy(()=>d(()=>import(`../js/ChatPage-w2FkF_fE.js`),__vite__mapDeps([19,1,2,20,3,12,13,7,8,14,5,4,15,6,16,21,22,23,24,25]))),ms=Y.lazy(()=>d(()=>import(`../js/ModelsPage-BnUddkrs.js`),__vite__mapDeps([26,1,2,3,12,13,8,7,14,5,4,15,6,16]))),hs=Y.lazy(()=>d(()=>import(`../js/PersonasPage-BL5XlrEm.js`),__vite__mapDeps([27,1,2,12,13,8,7,14,3,5,4,6,16]))),gs=Y.lazy(()=>d(()=>import(`../js/GalleryPage-Cv8pniRW.js`),__vite__mapDeps([28,1,2,20,12,13,8,7,14,3,5,4,6,16]))),_s=Y.lazy(()=>d(()=>import(`../js/LibreClawPage-CYhLgQB-.js`),__vite__mapDeps([29,1,2,12,13,8,7,14,3,5,4,16]))),vs=Y.lazy(()=>d(()=>import(`../js/WorkPage-DAp1T1dl.js`),__vite__mapDeps([30,1,2,3,12,13,14,5,7,8,4,15,6,16,0,9,10,25,20,18]))),ys=Y.lazy(()=>d(()=>import(`../js/UserManagementPage-BpOnt6os.js`),__vite__mapDeps([31,1,2,12,13,8,7,14,3,5,15,4,6,16]))),bs=Y.lazy(()=>d(()=>import(`../js/PluginUsagePage-BXqweCCs.js`),__vite__mapDeps([32,1,2,12,13,14,3,5,7,8,4,16]))),xs=Y.lazy(()=>d(()=>import(`../js/SystemPage-jdHYfn9A.js`),__vite__mapDeps([33,1,2,12,13,14,3,5,7,8,4,16]))),Ss=Y.lazy(()=>d(()=>import(`../js/ArtifactDemoPage-BWN0MWCx.js`),__vite__mapDeps([34,1,2,16,4,5,22,12,13,8,7,6,3,23,24,21]))),Cs=Y.lazy(()=>d(()=>import(`../js/SettingsModal-DZYCI5-y.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([11,1,2,12,13,8,7,14,3,5,4,15,6,16]))),ws=Y.lazy(()=>d(()=>import(`../js/ArtifactSlideOutPanel-D-AvYkfk.js`).then(e=>({default:e.ArtifactSlideOutPanel})),__vite__mapDeps([35,1,2,20,12,13,8,7,4,5,6,3,16,23,24,21]))),Ts=Y.lazy(()=>d(()=>import(`../js/FirstTimeSetup-CzBxl7UH.js`).then(e=>({default:e.FirstTimeSetup})),__vite__mapDeps([36,1,2,12,13,8,7,14,3,5,15,4,6]))),Es=()=>{let{t:e}=x();return(0,X.jsx)(`div`,{className:`flex h-full min-h-screen items-center justify-center bg-gray-50 dark:bg-dark-100`,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`h-8 w-8 rounded-full border-4 border-gray-200 border-t-primary-500 animate-spin dark:border-dark-300 dark:border-t-primary-400`}),(0,X.jsx)(`div`,{className:`text-gray-600 dark:text-dark-600`,children:e(`common.loading`)})]})})},Ds=({isOpen:e,compact:t})=>(0,X.jsx)(`div`,{"aria-hidden":`true`,className:P(`hidden lg:block flex-shrink-0 transition-[width] duration-200 ease-out`,e?t?`w-18`:`w-72`:`w-0`)}),Os=({hasBackground:e,sidebarOpen:t,sidebarCompact:n,onCloseSidebar:r,showDemoBanner:i,demoMessage:a,children:o})=>(0,X.jsxs)(`div`,{className:P(`flex h-dvh min-h-0 text-gray-950 dark:text-dark-900 relative overflow-hidden`,e?`bg-gray-100/60 dark:bg-dark-50/60`:`bg-gray-100 dark:bg-dark-50`),children:[(0,X.jsx)(us,{}),(0,X.jsx)(ko,{}),(0,X.jsx)(bo,{isOpen:t,onClose:r}),(0,X.jsx)(Ds,{isOpen:t,compact:n}),(0,X.jsxs)(`div`,{"data-testid":`app-shell-content`,className:P(`flex-1 basis-0 flex min-h-0 flex-col min-w-0 transition-[margin,background-color] duration-200 ease-out relative z-10 lg:pb-2 lg:pe-2`,ls?`pt-8`:`lg:pt-1.5`,t&&n?`max-lg:ms-18`:`max-lg:ms-0`,e?`bg-white/10 dark:bg-dark-50/10`:`bg-transparent`),children:[i&&(0,X.jsx)(Oo,{message:a}),(0,X.jsx)(Ro,{}),(0,X.jsx)(`main`,{className:P(`min-h-0 flex-1 overflow-hidden lg:rounded-[1.5rem] lg:border lg:border-black/[0.06] dark:lg:border-white/[0.07] lg:shadow-[0_1px_2px_rgba(0,0,0,0.03),0_18px_60px_rgba(15,23,42,0.04)]`,e?`bg-white/30 dark:bg-dark-100/35 backdrop-blur-sm`:`bg-gray-50 dark:bg-dark-100`),children:(0,X.jsx)(Co,{children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(Es,{}),children:o})})})]})]}),ks=({onClick:e})=>{let t=v();return t.pathname===`/chat`||t.pathname.startsWith(`/c/`)?(0,X.jsx)(`div`,{className:`hidden lg:block`,children:(0,X.jsx)(Do,{onClick:e})}):null},As=()=>{let{t:e,i18n:t}=x(),n=c(),[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(0),[d,f]=(0,Y.useState)(!1),{sidebarOpen:p,sidebarCompact:h,setSidebarOpen:g,setSidebarCompact:_,toggleSidebar:v,toggleSidebarCompact:y,toggleTheme:b,backgroundImage:S,preferences:C,artifactPanelOpen:w,closeArtifactPanel:T}=rt(),{systemInfo:E,isLoading:D,user:O,isAuthenticated:ee}=F(),{isDemoMode:te,demoConfig:ne}=rt(),k=E?.requiresAuth===!1||ee,[re,ie]=Y.useState(!1),ae=Y.useRef(!1);Y.useEffect(()=>{(async()=>{if(ae.current){ds.debug(`OAuth already processing, skipping...`);return}ds.debug(`Starting OAuth callback processing...`),ae.current=!0;let e=new URLSearchParams(window.location.search),t=e.get(`token`),n=e.get(`auth`);if(t&&n===`success`){try{let e=await fetch(`${Ue}/auth/me`,{headers:{Authorization:`Bearer ${t}`},credentials:`include`});if(e.ok){let n=await e.json();if(n.success&&n.data){let{login:e,systemInfo:r}=F.getState();e(n.data,t,r||{requiresAuth:!0,hasUsers:!0,userCount:1,signupEnabled:!0,version:`0.1.6`}),ds.debug(`OAuth login successful, showing toast`),M.success(`GitHub login successful!`)}else M.error(`Failed to verify GitHub authentication`)}else M.error(`GitHub authentication verification failed`)}catch(e){ds.error(`OAuth processing error:`,e),M.error(`GitHub authentication failed`)}window.history.replaceState({},document.title,window.location.pathname)}ds.debug(`OAuth processing completed`),ie(!0),ae.current=!1})()},[]),Uo();let oe=()=>{if(S)return!0;let e=C.backgroundSettings;return e?.enabled&&e?.imageUrl},se=[{key:`b`,metaKey:!0,action:()=>{window.innerWidth>=1024?p?y():(_(!1),v()):(!p&&h&&_(!1),v())},description:e(`keyboard.toggleSidebar`)},{key:`,`,metaKey:!0,action:()=>i(!0),description:e(`keyboard.openSettings`)},{key:`o`,metaKey:!0,shiftKey:!0,action:()=>Ao(n),description:e(`keyboard.newChat`,`New chat`)},{key:`u`,metaKey:!0,shiftKey:!0,action:()=>{let{systemInfo:e,isAdmin:t}=F.getState();(e?.requiresAuth===!1||t())&&Mo(n)},description:e(`keyboard.newWork`,`New Work session`)},{key:`d`,metaKey:!0,action:b,description:e(`keyboard.toggleDarkMode`)},{key:`h`,action:()=>o(!0),description:e(`keyboard.showShortcuts`)},{key:`Escape`,action:()=>{i(!1),o(!1)},description:e(`keyboard.closeModals`)}];wo(se,k),Y.useEffect(()=>{if(k)return;let e=window.requestAnimationFrame(()=>{i(!1),o(!1),T()});return()=>window.cancelAnimationFrame(e)},[T,k]),Y.useEffect(()=>{if(!k){tt.disconnect();return}return tt.connect().catch(ds.error),()=>{tt.disconnect()}},[k]),Y.useEffect(()=>{if(!E&&!D&&l<15){let e=setTimeout(async()=>{u(e=>e+1);try{await Vo.initializeAuth()}catch{}},2e3);return()=>clearTimeout(e)}},[E,D,l]);let ce=!d&&E?.requiresAuth===!0&&E?.hasUsers===!1;return D?(0,X.jsxs)(`div`,{className:`min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8`,children:[(0,X.jsx)(`div`,{className:`sm:mx-auto sm:w-full sm:max-w-md`,children:(0,X.jsx)(`div`,{className:`flex flex-col items-center`,children:(0,X.jsx)(oo,{className:`text-gray-900 dark:text-gray-100`})})}),(0,X.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,X.jsx)(`div`,{className:`w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin`})})]}):E?ce&&!d?(0,X.jsx)(Co,{children:(0,X.jsx)(Y.Suspense,{fallback:(0,X.jsx)(Es,{}),children:(0,X.jsx)(Ts,{onComplete:()=>{f(!0)}})})}):re?(0,X.jsxs)(X.Fragment,{children:[E&&!E.requiresAuth?(0,X.jsx)(Os,{hasBackground:!!oe(),sidebarOpen:p,sidebarCompact:h,onCloseSidebar:()=>g(!1),showDemoBanner:te&&ne.showBanner,demoMessage:ne.message,children:(0,X.jsxs)(s,{children:[(0,X.jsx)(m,{path:`/`,element:(0,X.jsx)(fs,{})}),(0,X.jsx)(m,{path:`/chat`,element:(0,X.jsx)(ps,{})}),(0,X.jsx)(m,{path:`/c/:sessionId`,element:(0,X.jsx)(ps,{})}),(0,X.jsx)(m,{path:`/models`,element:(0,X.jsx)(ms,{})}),(0,X.jsx)(m,{path:`/personas`,element:(0,X.jsx)(hs,{})}),(0,X.jsx)(m,{path:`/gallery`,element:(0,X.jsx)(gs,{})}),(0,X.jsx)(m,{path:`/work`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(vs,{})})}),(0,X.jsx)(m,{path:`/work/:taskId`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(vs,{})})}),(0,X.jsx)(m,{path:`/agents`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(_s,{})})}),(0,X.jsx)(m,{path:`/usage`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(bs,{})})}),(0,X.jsx)(m,{path:`/system`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(xs,{})})}),(0,X.jsx)(m,{path:`/login`,element:(0,X.jsx)(cs,{})})]})}):(0,X.jsxs)(s,{children:[(0,X.jsx)(m,{path:`/login`,element:(0,X.jsx)(cs,{})}),(0,X.jsx)(m,{path:`/*`,element:(0,X.jsx)($,{children:(0,X.jsx)(Os,{hasBackground:!!oe(),sidebarOpen:p,sidebarCompact:h,onCloseSidebar:()=>g(!1),showDemoBanner:te&&ne.showBanner,demoMessage:ne.message,children:(0,X.jsxs)(s,{children:[(0,X.jsx)(m,{path:`/`,element:(0,X.jsx)(fs,{})}),(0,X.jsx)(m,{path:`/chat`,element:(0,X.jsx)(ps,{})}),(0,X.jsx)(m,{path:`/c/:sessionId`,element:(0,X.jsx)(ps,{})}),(0,X.jsx)(m,{path:`/models`,element:(0,X.jsx)(ms,{})}),(0,X.jsx)(m,{path:`/personas`,element:(0,X.jsx)(hs,{})}),(0,X.jsx)(m,{path:`/gallery`,element:(0,X.jsx)(gs,{})}),(0,X.jsx)(m,{path:`/work`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(vs,{})})}),(0,X.jsx)(m,{path:`/work/:taskId`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(vs,{})})}),(0,X.jsx)(m,{path:`/agents`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(_s,{})})}),(0,X.jsx)(m,{path:`/artifacts`,element:(0,X.jsx)(Ss,{})}),(0,X.jsx)(m,{path:`/usage`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(bs,{})})}),(0,X.jsx)(m,{path:`/system`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(xs,{})})}),(0,X.jsx)(m,{path:`/users`,element:(0,X.jsx)($,{requireAdmin:!0,children:(0,X.jsx)(ys,{})})})]})})})})]}),k&&r&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Cs,{isOpen:r,onClose:()=>i(!1)})}),(0,X.jsx)(Eo,{isOpen:k&&a,onClose:()=>o(!1),shortcuts:se}),k&&(0,X.jsx)(ks,{onClick:()=>o(!0)}),k&&w&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ws,{})}),(0,X.jsx)(ge,{position:na(t.language)?`top-left`:`top-right`,toastOptions:{duration:4e3,className:`animate-slide-up`,style:{background:`var(--toast-bg)`,color:`var(--toast-color)`,border:`1px solid var(--toast-border)`,borderRadius:`0.75rem`,boxShadow:`0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)`,cursor:`pointer`},success:{iconTheme:{primary:`rgb(var(--color-primary-600))`,secondary:`#ffffff`}},error:{iconTheme:{primary:`rgb(var(--color-primary-600))`,secondary:`#ffffff`}}},containerStyle:{top:80,insetInlineEnd:20}}),k&&(0,X.jsx)(zo,{onOpenSettings:()=>i(!0)})]}):(0,X.jsx)(`div`,{className:`min-h-screen bg-gray-50 dark:bg-dark-50 flex items-center justify-center`,children:(0,X.jsx)(`div`,{className:`w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin`})}):(0,X.jsx)(`div`,{className:`min-h-screen bg-gray-50 dark:bg-dark-50 flex items-center justify-center p-4`,children:(0,X.jsxs)(`div`,{className:`text-center`,children:[(0,X.jsx)(`div`,{className:`mb-8`,children:(0,X.jsx)(oo,{className:`text-gray-900 dark:text-white`})}),(0,X.jsx)(`div`,{className:`flex justify-center mb-4`,children:(0,X.jsx)(`div`,{className:`w-8 h-8 border-4 border-gray-300 dark:border-dark-300 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin`})}),(0,X.jsx)(`p`,{className:`text-gray-600 dark:text-dark-600 text-sm`,children:l>0?`Connecting to backend... (${l}/15)`:`Starting up...`})]})})},js=ls?h([{path:`*`,element:(0,X.jsx)(As,{})}]):p([{path:`*`,element:(0,X.jsx)(As,{})}]),Ms=()=>(0,X.jsx)(Co,{children:(0,X.jsx)(g,{router:js})}),Ns=new fr({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});oa.catch(()=>{ra(`en`)}).then(()=>{Ar.createRoot(document.getElementById(`root`)).render((0,X.jsx)(Y.StrictMode,{children:(0,X.jsx)(hr,{client:Ns,children:(0,X.jsx)(Ms,{})})}))});export{aa as A,tn as B,Pa as C,pa as D,xa as E,kr as F,Or as I,mr as L,ta as M,Zi as N,ya as O,ai as P,kn as R,Ia as S,Sa as T,nn as V,Ua as _,ho as a,za as b,to as c,Qa as d,Za as f,Ka as g,qa as h,Mo as i,na as j,_a as k,eo as l,Xa as m,jo as n,oo as o,Ya as p,Ao as r,ro as s,ts as t,Ja as u,La as v,Ca as w,Ba as x,Ra as y,rn as z};