@trilogy-data/trilogy-studio-components 0.1.12 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/{ChatCreatorModal-kIXgcJQp.js → ChatCreatorModal-D-CByWEF.js} +12 -12
  2. package/dist/{Dashboard-B-YfrO5u.js → Dashboard-CCWjUVBq.js} +347 -348
  3. package/dist/{DashboardCreatorInline-C6fr4jNo.js → DashboardCreatorInline-DRlxDEBN.js} +1 -1
  4. package/dist/{DashboardMobile-D911XYkl.js → DashboardMobile-GOPaxc9_.js} +104 -103
  5. package/dist/{LLMConnectionList-DZbu1kGq.js → LLMConnectionList-ByLjIXLO.js} +1168 -1213
  6. package/dist/{LLMView-C4RQS1B8.js → LLMView-B7XLbzBx.js} +53 -51
  7. package/dist/Manager-B2wTf-lw.js +4 -0
  8. package/dist/{ResultComponent-fVgARLAb.js → ResultComponent-BKuWOt_p.js} +37 -34
  9. package/dist/Sidebar-CMy9ptnW.js +2188 -0
  10. package/dist/TutorialPage-9YzXa97t.js +509 -0
  11. package/dist/{WelcomePage-LRJvygaE.js → WelcomePage-BMcBpSQ7.js} +4 -4
  12. package/dist/components/AssetAutoImporter.vue.d.ts.map +1 -1
  13. package/dist/components/ChartControlPanel.vue.d.ts.map +1 -1
  14. package/dist/components/CodeBlock.vue.d.ts.map +1 -1
  15. package/dist/components/ConfirmDialog.vue.d.ts +25 -0
  16. package/dist/components/ConfirmDialog.vue.d.ts.map +1 -0
  17. package/dist/components/ContextMenu.vue.d.ts +4 -2
  18. package/dist/components/ContextMenu.vue.d.ts.map +1 -1
  19. package/dist/components/DataTable.vue.d.ts +9 -0
  20. package/dist/components/DataTable.vue.d.ts.map +1 -1
  21. package/dist/components/EditableTitle.vue.d.ts.map +1 -1
  22. package/dist/components/HintComponent.vue.d.ts +1 -1
  23. package/dist/components/HintComponent.vue.d.ts.map +1 -1
  24. package/dist/components/LoadingButton.vue.d.ts.map +1 -1
  25. package/dist/components/MarkdownRenderer.vue.d.ts +1 -0
  26. package/dist/components/MarkdownRenderer.vue.d.ts.map +1 -1
  27. package/dist/components/ModalDialog.vue.d.ts +36 -0
  28. package/dist/components/ModalDialog.vue.d.ts.map +1 -0
  29. package/dist/components/PopupModal.vue.d.ts.map +1 -1
  30. package/dist/components/SimpleEditor.vue.d.ts +117 -0
  31. package/dist/components/SimpleEditor.vue.d.ts.map +1 -1
  32. package/dist/components/StatusIcon.vue.d.ts +3 -3
  33. package/dist/components/StatusIcon.vue.d.ts.map +1 -1
  34. package/dist/components/StoreTokenModal.vue.d.ts +18 -0
  35. package/dist/components/StoreTokenModal.vue.d.ts.map +1 -0
  36. package/dist/components/SymbolsPane.vue.d.ts.map +1 -1
  37. package/dist/components/VegaLiteChart.vue.d.ts.map +1 -1
  38. package/dist/components/chartRenderManager.d.ts +2 -0
  39. package/dist/components/chartRenderManager.d.ts.map +1 -1
  40. package/dist/components/community/AddStoreModal.vue.d.ts +46 -1
  41. package/dist/components/community/AddStoreModal.vue.d.ts.map +1 -1
  42. package/dist/components/community/CommunityModelCard.vue.d.ts +3 -3
  43. package/dist/components/community/CommunityModelCard.vue.d.ts.map +1 -1
  44. package/dist/components/community/CommunityModelHeader.vue.d.ts +7 -4
  45. package/dist/components/community/CommunityModelHeader.vue.d.ts.map +1 -1
  46. package/dist/components/community/CommunityModels.vue.d.ts +4 -4
  47. package/dist/components/community/CommunityModels.vue.d.ts.map +1 -1
  48. package/dist/components/community/CommunityRemote.vue.d.ts.map +1 -1
  49. package/dist/components/connection/ConnectionDatabase.vue.d.ts.map +1 -1
  50. package/dist/components/connection/ConnectionSchema.vue.d.ts.map +1 -1
  51. package/dist/components/connection/ConnectionTable.vue.d.ts +9 -0
  52. package/dist/components/connection/ConnectionTable.vue.d.ts.map +1 -1
  53. package/dist/components/dashboard/Dashboard.vue.d.ts +4 -4
  54. package/dist/components/dashboard/Dashboard.vue.d.ts.map +1 -1
  55. package/dist/components/dashboard/DashboardAddItemModal.vue.d.ts +4 -4
  56. package/dist/components/dashboard/DashboardAddItemModal.vue.d.ts.map +1 -1
  57. package/dist/components/dashboard/DashboardCTA.vue.d.ts +4 -4
  58. package/dist/components/dashboard/DashboardCTA.vue.d.ts.map +1 -1
  59. package/dist/components/dashboard/DashboardChart.vue.d.ts +1 -1
  60. package/dist/components/dashboard/DashboardChart.vue.d.ts.map +1 -1
  61. package/dist/components/dashboard/DashboardChartEditor.vue.d.ts +234 -2
  62. package/dist/components/dashboard/DashboardChartEditor.vue.d.ts.map +1 -1
  63. package/dist/components/dashboard/DashboardDataSelector.vue.d.ts.map +1 -1
  64. package/dist/components/dashboard/DashboardEditorDialog.vue.d.ts +42 -0
  65. package/dist/components/dashboard/DashboardEditorDialog.vue.d.ts.map +1 -0
  66. package/dist/components/dashboard/DashboardFilter.vue.d.ts +0 -1
  67. package/dist/components/dashboard/DashboardFilter.vue.d.ts.map +1 -1
  68. package/dist/components/dashboard/DashboardFilterAutocomplete.vue.d.ts.map +1 -1
  69. package/dist/components/dashboard/DashboardGridItem.vue.d.ts +4 -4
  70. package/dist/components/dashboard/DashboardGridItem.vue.d.ts.map +1 -1
  71. package/dist/components/dashboard/DashboardHeader.vue.d.ts.map +1 -1
  72. package/dist/components/dashboard/DashboardHeaderFilterInput.vue.d.ts +1 -0
  73. package/dist/components/dashboard/DashboardHeaderFilterInput.vue.d.ts.map +1 -1
  74. package/dist/components/dashboard/DashboardImportPopup.vue.d.ts +5 -7
  75. package/dist/components/dashboard/DashboardImportPopup.vue.d.ts.map +1 -1
  76. package/dist/components/dashboard/DashboardImportSelector.vue.d.ts +4 -1
  77. package/dist/components/dashboard/DashboardImportSelector.vue.d.ts.map +1 -1
  78. package/dist/components/dashboard/DashboardMarkdown.vue.d.ts +1 -20
  79. package/dist/components/dashboard/DashboardMarkdown.vue.d.ts.map +1 -1
  80. package/dist/components/dashboard/DashboardMarkdownEditor.vue.d.ts +234 -1
  81. package/dist/components/dashboard/DashboardMarkdownEditor.vue.d.ts.map +1 -1
  82. package/dist/components/dashboard/DashboardMobile.vue.d.ts +3 -3
  83. package/dist/components/dashboard/DashboardMobile.vue.d.ts.map +1 -1
  84. package/dist/components/dashboard/DashboardSharePopup.vue.d.ts +5 -7
  85. package/dist/components/dashboard/DashboardSharePopup.vue.d.ts.map +1 -1
  86. package/dist/components/dashboard/DashboardTable.vue.d.ts +9 -1
  87. package/dist/components/dashboard/DashboardTable.vue.d.ts.map +1 -1
  88. package/dist/components/dashboard/useDashboard.d.ts.map +1 -1
  89. package/dist/components/dashboard/useDashboardItemShell.d.ts +28 -0
  90. package/dist/components/dashboard/useDashboardItemShell.d.ts.map +1 -0
  91. package/dist/components/editor/Editor.vue.d.ts +20 -6
  92. package/dist/components/editor/Editor.vue.d.ts.map +1 -1
  93. package/dist/components/editor/EditorCreatorInline.vue.d.ts.map +1 -1
  94. package/dist/components/editor/EditorHeader.vue.d.ts +10 -3
  95. package/dist/components/editor/EditorHeader.vue.d.ts.map +1 -1
  96. package/dist/components/editor/ResultComponent.vue.d.ts +75 -181
  97. package/dist/components/editor/ResultComponent.vue.d.ts.map +1 -1
  98. package/dist/components/editor/Results.vue.d.ts +9 -0
  99. package/dist/components/editor/Results.vue.d.ts.map +1 -1
  100. package/dist/components/editor/editorHelpers.d.ts +1 -1
  101. package/dist/components/editor/editorHelpers.d.ts.map +1 -1
  102. package/dist/components/jobs/JobsAddStoreModal.vue.d.ts +14 -0
  103. package/dist/components/jobs/JobsAddStoreModal.vue.d.ts.map +1 -0
  104. package/dist/components/jobs/JobsView.vue.d.ts +6 -0
  105. package/dist/components/jobs/JobsView.vue.d.ts.map +1 -0
  106. package/dist/components/layout/MobileSidebarLayout.vue.d.ts.map +1 -1
  107. package/dist/components/layout/SidebarLayout.vue.d.ts.map +1 -1
  108. package/dist/components/layout/TabbedBrowser.vue.d.ts +1 -12
  109. package/dist/components/layout/TabbedBrowser.vue.d.ts.map +1 -1
  110. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
  111. package/dist/components/llm/ArtifactsPane.vue.d.ts +11 -2
  112. package/dist/components/llm/ArtifactsPane.vue.d.ts.map +1 -1
  113. package/dist/components/llm/ChatArtifact.vue.d.ts +10 -0
  114. package/dist/components/llm/ChatArtifact.vue.d.ts.map +1 -1
  115. package/dist/components/llm/ChatCreatorModal.vue.d.ts +1 -9
  116. package/dist/components/llm/ChatCreatorModal.vue.d.ts.map +1 -1
  117. package/dist/components/llm/LLMChat.vue.d.ts +9 -36
  118. package/dist/components/llm/LLMChat.vue.d.ts.map +1 -1
  119. package/dist/components/llm/LLMChatSplitView.vue.d.ts +55 -185
  120. package/dist/components/llm/LLMChatSplitView.vue.d.ts.map +1 -1
  121. package/dist/components/llm/LLMEditorRefinement.vue.d.ts +47 -180
  122. package/dist/components/llm/LLMEditorRefinement.vue.d.ts.map +1 -1
  123. package/dist/components/llm/toolCallDisplay.d.ts +13 -0
  124. package/dist/components/llm/toolCallDisplay.d.ts.map +1 -0
  125. package/dist/components/model/ModelCard.vue.d.ts +22 -5
  126. package/dist/components/model/ModelCard.vue.d.ts.map +1 -1
  127. package/dist/components/model/ModelConcept.vue.d.ts.map +1 -1
  128. package/dist/components/model/ModelCreator.vue.d.ts +3 -0
  129. package/dist/components/model/ModelCreator.vue.d.ts.map +1 -1
  130. package/dist/components/model/ModelSelector.vue.d.ts.map +1 -1
  131. package/dist/components/sidebar/CommunityModelList.vue.d.ts +284 -0
  132. package/dist/components/sidebar/CommunityModelList.vue.d.ts.map +1 -0
  133. package/dist/components/sidebar/CommunityModelListItem.vue.d.ts +7 -7
  134. package/dist/components/sidebar/CommunityModelListItem.vue.d.ts.map +1 -1
  135. package/dist/components/sidebar/ConnectionCreatorInline.vue.d.ts.map +1 -1
  136. package/dist/components/sidebar/ConnectionIcon.vue.d.ts.map +1 -1
  137. package/dist/components/sidebar/ConnectionList.vue.d.ts +21 -71
  138. package/dist/components/sidebar/ConnectionList.vue.d.ts.map +1 -1
  139. package/dist/components/sidebar/ConnectionListItem.vue.d.ts +15 -61
  140. package/dist/components/sidebar/ConnectionListItem.vue.d.ts.map +1 -1
  141. package/dist/components/sidebar/ConnectionRefresh.vue.d.ts.map +1 -1
  142. package/dist/components/sidebar/CreateEditorFromDatasourcePopup.vue.d.ts.map +1 -1
  143. package/dist/components/sidebar/DashboardList.vue.d.ts +33 -75
  144. package/dist/components/sidebar/DashboardList.vue.d.ts.map +1 -1
  145. package/dist/components/sidebar/DashboardListItem.vue.d.ts +13 -59
  146. package/dist/components/sidebar/DashboardListItem.vue.d.ts.map +1 -1
  147. package/dist/components/sidebar/DuckDBImporter.vue.d.ts +1 -0
  148. package/dist/components/sidebar/DuckDBImporter.vue.d.ts.map +1 -1
  149. package/dist/components/sidebar/EditorList.vue.d.ts +190 -67
  150. package/dist/components/sidebar/EditorList.vue.d.ts.map +1 -1
  151. package/dist/components/sidebar/EditorListItem.vue.d.ts +16 -59
  152. package/dist/components/sidebar/EditorListItem.vue.d.ts.map +1 -1
  153. package/dist/components/sidebar/GenericSidebarItem.vue.d.ts.map +1 -1
  154. package/dist/components/sidebar/JobsList.vue.d.ts +12 -0
  155. package/dist/components/sidebar/JobsList.vue.d.ts.map +1 -0
  156. package/dist/components/sidebar/JobsListItem.vue.d.ts +25 -0
  157. package/dist/components/sidebar/JobsListItem.vue.d.ts.map +1 -0
  158. package/dist/components/sidebar/LLMConnectionCreator.vue.d.ts.map +1 -1
  159. package/dist/components/sidebar/LLMConnectionList.vue.d.ts +14 -356
  160. package/dist/components/sidebar/LLMConnectionList.vue.d.ts.map +1 -1
  161. package/dist/components/sidebar/LLMConnectionListItem.vue.d.ts +15 -190
  162. package/dist/components/sidebar/LLMConnectionListItem.vue.d.ts.map +1 -1
  163. package/dist/components/sidebar/ModelSidebar.vue.d.ts +15 -0
  164. package/dist/components/sidebar/ModelSidebar.vue.d.ts.map +1 -1
  165. package/dist/components/sidebar/Sidebar.vue.d.ts +3966 -0
  166. package/dist/components/sidebar/Sidebar.vue.d.ts.map +1 -0
  167. package/dist/components/sidebar/SidebarList.vue.d.ts.map +1 -1
  168. package/dist/components/sidebar/SidebarOverflowMenu.vue.d.ts +19 -0
  169. package/dist/components/sidebar/SidebarOverflowMenu.vue.d.ts.map +1 -0
  170. package/dist/components/sidebar/SidebarTagChip.vue.d.ts +6 -0
  171. package/dist/components/sidebar/SidebarTagChip.vue.d.ts.map +1 -0
  172. package/dist/components/tutorial/TutorialPrompt.vue.d.ts +97 -186
  173. package/dist/components/tutorial/TutorialPrompt.vue.d.ts.map +1 -1
  174. package/dist/components/useConfirmationState.d.ts +10 -0
  175. package/dist/components/useConfirmationState.d.ts.map +1 -0
  176. package/dist/composables/useClickOutside.d.ts +12 -0
  177. package/dist/composables/useClickOutside.d.ts.map +1 -0
  178. package/dist/connections/index.d.ts +1 -0
  179. package/dist/connections/index.d.ts.map +1 -1
  180. package/dist/connections/remoteProject.d.ts +23 -0
  181. package/dist/connections/remoteProject.d.ts.map +1 -0
  182. package/dist/{cssMode-DCSjJlZ5.js → cssMode-Cfy3yIk-.js} +1 -1
  183. package/dist/dashboards/base.d.ts +2 -1
  184. package/dist/dashboards/base.d.ts.map +1 -1
  185. package/dist/dashboards/prompts.d.ts +1 -1
  186. package/dist/dashboards/prompts.d.ts.map +1 -1
  187. package/dist/dashboards/spec.d.ts +4 -0
  188. package/dist/dashboards/spec.d.ts.map +1 -1
  189. package/dist/data/index.d.ts +1 -0
  190. package/dist/data/index.d.ts.map +1 -1
  191. package/dist/data/localStorage.d.ts +3 -3
  192. package/dist/data/localStorage.d.ts.map +1 -1
  193. package/dist/data/remoteStoreStorage.d.ts +46 -0
  194. package/dist/data/remoteStoreStorage.d.ts.map +1 -0
  195. package/dist/data/storage.d.ts +6 -6
  196. package/dist/data/storage.d.ts.map +1 -1
  197. package/dist/data/tutorial/reference.d.ts.map +1 -1
  198. package/dist/editors/editor.d.ts +19 -5
  199. package/dist/editors/editor.d.ts.map +1 -1
  200. package/dist/editors/fileTypes.d.ts +12 -0
  201. package/dist/editors/fileTypes.d.ts.map +1 -0
  202. package/dist/editors/helpers.d.ts +2 -0
  203. package/dist/editors/helpers.d.ts.map +1 -1
  204. package/dist/{freemarker2-BKjHRYvq.js → freemarker2-Dy8u-XQv.js} +1 -1
  205. package/dist/{handlebars-D_px6u7k.js → handlebars-BDrD8h_c.js} +1 -1
  206. package/dist/{html-Bm-h8fTq.js → html-CKz7V4Cn.js} +1 -1
  207. package/dist/{htmlMode-YODzRvjv.js → htmlMode-BZE5C9QD.js} +1 -1
  208. package/dist/{javascript-DZrwO1Xq.js → javascript-Cav2mApM.js} +1 -1
  209. package/dist/{jsonMode-_ThxxZQx.js → jsonMode-B6434NZu.js} +1 -1
  210. package/dist/{liquid-I2p3UrJy.js → liquid-Cq-Omf5B.js} +1 -1
  211. package/dist/llm/chatToolExecutor.d.ts.map +1 -1
  212. package/dist/llm/editorRefinementToolExecutor.d.ts.map +1 -1
  213. package/dist/llm/toolLoopCore.d.ts.map +1 -1
  214. package/dist/{main-Bjg9NFbT.js → main-C-6acy1R.js} +54550 -52400
  215. package/dist/main.css +1 -1
  216. package/dist/main.js +16 -16
  217. package/dist/main.umd.cjs +580 -559
  218. package/dist/{mdx-e5VczKhJ.js → mdx-DYvw7-lF.js} +1 -1
  219. package/dist/models/helpers.d.ts +16 -4
  220. package/dist/models/helpers.d.ts.map +1 -1
  221. package/dist/models/model.d.ts +1 -0
  222. package/dist/models/model.d.ts.map +1 -1
  223. package/dist/monaco/editorHelpers.d.ts.map +1 -1
  224. package/dist/prism-clike-SH1s-yiH.js +31 -0
  225. package/dist/prism-javascript-CLux6jF8.js +137 -0
  226. package/dist/prism-json-iVb7He6L.js +25 -0
  227. package/dist/prism-markdown-tjNeCMi3.js +300 -0
  228. package/dist/prism-markup-BNGj0Tvm.js +173 -0
  229. package/dist/prism-python-DBk-6kcY.js +71 -0
  230. package/dist/prism-typescript-Crma_dEX.js +55 -0
  231. package/dist/{python-CUAfebEu.js → python-BTTSwl4o.js} +1 -1
  232. package/dist/{razor-B95YKGrm.js → razor-BVBhJqGl.js} +1 -1
  233. package/dist/remotes/genericStoreMetadata.d.ts +8 -0
  234. package/dist/remotes/genericStoreMetadata.d.ts.map +1 -0
  235. package/dist/remotes/jobs.d.ts +38 -0
  236. package/dist/remotes/jobs.d.ts.map +1 -0
  237. package/dist/remotes/jobsService.d.ts +15 -0
  238. package/dist/remotes/jobsService.d.ts.map +1 -0
  239. package/dist/remotes/models.d.ts +2 -1
  240. package/dist/remotes/models.d.ts.map +1 -1
  241. package/dist/remotes/remoteStoreSync.d.ts +7 -0
  242. package/dist/remotes/remoteStoreSync.d.ts.map +1 -0
  243. package/dist/remotes/storeService.d.ts +2 -1
  244. package/dist/remotes/storeService.d.ts.map +1 -1
  245. package/dist/stores/Manager.vue.d.ts +9 -0
  246. package/dist/stores/Manager.vue.d.ts.map +1 -1
  247. package/dist/stores/communityApiStore.d.ts +6 -0
  248. package/dist/stores/communityApiStore.d.ts.map +1 -1
  249. package/dist/stores/editorStore.d.ts +7 -2
  250. package/dist/stores/editorStore.d.ts.map +1 -1
  251. package/dist/stores/index.d.ts +1 -0
  252. package/dist/stores/index.d.ts.map +1 -1
  253. package/dist/stores/jobsApiStore.d.ts +45 -0
  254. package/dist/stores/jobsApiStore.d.ts.map +1 -0
  255. package/dist/stores/modelStore.d.ts.map +1 -1
  256. package/dist/stores/queryExecutionService.d.ts +6 -4
  257. package/dist/stores/queryExecutionService.d.ts.map +1 -1
  258. package/dist/stores/resolver.d.ts +4 -4
  259. package/dist/stores/resolver.d.ts.map +1 -1
  260. package/dist/stores/useScreenNavigation.d.ts +3 -1
  261. package/dist/stores/useScreenNavigation.d.ts.map +1 -1
  262. package/dist/stores/userSettingsStore.d.ts.map +1 -1
  263. package/dist/{tsMode-BcjYt2WB.js → tsMode-z99lZ8eT.js} +1 -1
  264. package/dist/{typescript-Ck_cSGyE.js → typescript-BXQnMlGm.js} +1 -1
  265. package/dist/useDashboard-3deVRse_.js +3502 -0
  266. package/dist/utility/markdownRenderer.d.ts.map +1 -1
  267. package/dist/utility/prism.d.ts +5 -0
  268. package/dist/utility/prism.d.ts.map +1 -0
  269. package/dist/utils/terminalOutput.d.ts +3 -0
  270. package/dist/utils/terminalOutput.d.ts.map +1 -0
  271. package/dist/views/ConnectionView.vue.d.ts +9 -0
  272. package/dist/views/ConnectionView.vue.d.ts.map +1 -1
  273. package/dist/views/IDE.vue.d.ts +7 -0
  274. package/dist/views/IDE.vue.d.ts.map +1 -0
  275. package/dist/views/LLMView.vue.d.ts +232 -846
  276. package/dist/views/LLMView.vue.d.ts.map +1 -1
  277. package/dist/views/MobileIDE.vue.d.ts +6 -0
  278. package/dist/views/MobileIDE.vue.d.ts.map +1 -0
  279. package/dist/views/ModelView.vue.d.ts +46 -10
  280. package/dist/views/ModelView.vue.d.ts.map +1 -1
  281. package/dist/views/ResponsiveIDE.vue.d.ts.map +1 -1
  282. package/dist/views/TutorialPage.vue.d.ts +465 -907
  283. package/dist/views/TutorialPage.vue.d.ts.map +1 -1
  284. package/dist/{xml-Do52fQeS.js → xml-Ci-UOFva.js} +1 -1
  285. package/dist/{yaml-C8U7HH0M.js → yaml-XEOisXAU.js} +1 -1
  286. package/package.json +1 -1
  287. package/dist/Manager-CoKiEZT-.js +0 -4
  288. package/dist/Sidebar-esb9EqnY.js +0 -1862
  289. package/dist/TutorialPage-DfA2845i.js +0 -482
  290. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts +0 -52
  291. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts.map +0 -1
  292. package/dist/components/editor/EditorCreatorIcon.vue.d.ts +0 -61
  293. package/dist/components/editor/EditorCreatorIcon.vue.d.ts.map +0 -1
  294. package/dist/useDashboard-BnXAbWPO.js +0 -3352
@@ -0,0 +1,2188 @@
1
+ import { inject as K, ref as $, onMounted as le, computed as G, resolveComponent as D, createBlock as E, openBlock as m, withCtx as w, createElementBlock as p, Fragment as N, renderList as _, createCommentVNode as M, createVNode as T, normalizeClass as B, toDisplayString as j, createElementVNode as n, createTextVNode as z, defineComponent as ee, withModifiers as Y, watch as pe, withDirectives as I, vModelText as V, unref as x, vModelSelect as ye, normalizeStyle as Ke, vShow as X } from "vue";
2
+ import { S as ne, e as se, g as W, K as L, a as H, f as fe, T as oe, L as he, h as Le, u as re, t as je, i as ge, j as de, k as Se, n as ke, l as Ce, m as we, o as ce, p as ue, q as me, r as Ee, v as $e, D as Ue, w as Ae, x as Re, d as Ne, y as Ve } from "./main-C-6acy1R.js";
3
+ import { d as be, a as Oe, L as Pe, C as Je } from "./LLMConnectionList-ByLjIXLO.js";
4
+ import { D as Be } from "./DashboardCreatorInline-DRlxDEBN.js";
5
+ const Fe = {
6
+ name: "DocumentationSidebar",
7
+ props: {
8
+ activeDocumentationKey: {
9
+ type: String,
10
+ default: "",
11
+ optional: !0
12
+ }
13
+ },
14
+ setup(e) {
15
+ if (!K("editorStore"))
16
+ throw new Error("Editor store is not provided!");
17
+ const l = W("documentationKey") || "", o = $({});
18
+ return le(() => {
19
+ const c = l.split(L)[1];
20
+ let v = `documentation${L}${c}`;
21
+ be.forEach((s) => {
22
+ const i = `documentation${L}${s.title}`;
23
+ o.value[i] = !v.startsWith(i);
24
+ });
25
+ }), {
26
+ documentationNodes: G(() => {
27
+ const r = [];
28
+ return be.forEach((c) => {
29
+ const v = `documentation${L}${c.title}`;
30
+ r.push({
31
+ id: v,
32
+ name: c.title,
33
+ indent: 0,
34
+ count: c.articles.length,
35
+ type: "documentation"
36
+ }), o.value[v] || c.articles.forEach((s) => {
37
+ r.push({
38
+ id: `article${L}${c.title}${L}${s.title}`,
39
+ name: s.displayName || s.title,
40
+ indent: 1,
41
+ count: s.paragraphs.length,
42
+ type: "article"
43
+ });
44
+ });
45
+ }), r;
46
+ }),
47
+ toggleCollapse: (r) => {
48
+ o.value[r] = !o.value[r];
49
+ },
50
+ collapsed: o,
51
+ isActiveNode: (r) => r === e.activeDocumentationKey
52
+ };
53
+ },
54
+ methods: {
55
+ handleClick(e) {
56
+ this.$emit("documentation-key-selected", e);
57
+ }
58
+ },
59
+ components: {
60
+ SidebarList: se,
61
+ SidebarItem: ne
62
+ }
63
+ };
64
+ function qe(e, t, l, o, d, a) {
65
+ const b = D("sidebar-item"), r = D("sidebar-list");
66
+ return m(), E(r, { title: "Documentation" }, {
67
+ actions: w(() => [...t[0] || (t[0] = [])]),
68
+ default: w(() => [
69
+ (m(!0), p(N, null, _(o.documentationNodes, (c) => (m(), E(b, {
70
+ key: c.id,
71
+ "item-id": c.id,
72
+ name: c.name,
73
+ indent: c.indent,
74
+ "is-selected": o.isActiveNode(c.id),
75
+ "is-collapsible": c.type === "documentation",
76
+ "is-collapsed": o.collapsed[c.id],
77
+ icon: c.type === "article" ? "mdi-text-box-outline" : "",
78
+ "extra-info": c.type === "documentation" ? c.count : "",
79
+ itemType: "documentation",
80
+ onClick: a.handleClick,
81
+ onToggle: o.toggleCollapse
82
+ }, null, 8, ["item-id", "name", "indent", "is-selected", "is-collapsible", "is-collapsed", "icon", "extra-info", "onClick", "onToggle"]))), 128))
83
+ ]),
84
+ _: 1
85
+ });
86
+ }
87
+ const ze = /* @__PURE__ */ H(Fe, [["render", qe], ["__scopeId", "data-v-7d844a72"]]), Ge = {
88
+ name: "ModelList",
89
+ props: {
90
+ activeModelKey: String,
91
+ testTag: {
92
+ type: String,
93
+ default: ""
94
+ }
95
+ },
96
+ setup() {
97
+ const e = K("modelStore"), t = K("saveModels"), l = K("editorStore"), o = K("trilogyResolver"), d = re(), a = $(!1), b = d.activeModelKey.value || W("model") || "", r = b.split(L)[0];
98
+ let c = "", v = "", s = "", i = b.split(L);
99
+ if (r === "model" ? c = i[1] : r === "source" ? (c = i[1], v = i[2]) : r === "datasource" ? (c = i[1], v = i[2], s = i[3]) : r === "concept" && (c = i[1], v = i[2], i.length > 5 && (s = i[3])), !e || !t || !l || !o)
100
+ throw new Error("Model store is not provided!");
101
+ let S = {};
102
+ Object.values(e.models).forEach((y) => {
103
+ let u = ["model", y.name].join(L);
104
+ y.name !== c && (S[u] = !0), y.sources.forEach((h) => {
105
+ let Q = ["source", y.name, h.alias].join(L);
106
+ (y.name !== c || h.alias !== v) && (S[Q] = !0), h.datasources.forEach((q) => {
107
+ let te = ["datasource", y.name, h.alias, q.name].join(L);
108
+ (y.name !== c || h.alias !== v || q.name !== s) && (S[te] = !0);
109
+ });
110
+ });
111
+ });
112
+ const C = $(S), g = G(() => {
113
+ const y = [];
114
+ return Object.values(e.models).sort((h, Q) => h.name.localeCompare(Q.name)).forEach((h) => {
115
+ if (h.deleted) return;
116
+ let Q = ["model", h.name].join(L);
117
+ y.push({
118
+ id: Q,
119
+ name: h.name,
120
+ indent: 0,
121
+ count: h.sources.length,
122
+ type: "model",
123
+ concept: null
124
+ }), C.value[Q] || h.sources.forEach((q) => {
125
+ let te = ["source", h.name, q.alias].join(L);
126
+ y.push({
127
+ id: te,
128
+ name: q.alias,
129
+ indent: 1,
130
+ count: q.concepts.length,
131
+ type: "source",
132
+ concept: null
133
+ }), C.value[te] || (q.concepts.forEach((P) => {
134
+ y.push({
135
+ id: ["concept", h.name, q.alias, P.namespace, P.name].join(
136
+ L
137
+ ),
138
+ name: P.namespace === "local" ? P.name : P.namespace + "." + P.name,
139
+ indent: 2,
140
+ count: 0,
141
+ type: "concept",
142
+ concept: P
143
+ });
144
+ }), q.datasources.forEach((P) => {
145
+ let ie = ["datasource", h.name, q.alias, P.name].join(L);
146
+ y.push({
147
+ id: ie,
148
+ name: P.name,
149
+ indent: 2,
150
+ count: P.concepts.length,
151
+ type: "datasource",
152
+ concept: null
153
+ }), C.value[ie] || P.concepts.forEach((k) => {
154
+ y.push({
155
+ id: [
156
+ "concept",
157
+ h.name,
158
+ q.alias,
159
+ P.name,
160
+ k.namespace,
161
+ k.name
162
+ ].join(L),
163
+ name: k.namespace === "local" ? k.name : k.namespace + "." + k.name,
164
+ indent: 3,
165
+ count: 0,
166
+ type: "concept",
167
+ concept: k
168
+ });
169
+ });
170
+ }));
171
+ });
172
+ }), y;
173
+ }), A = (y) => o.resolveModel(
174
+ y,
175
+ e.models[y].sources.map((u) => ({
176
+ alias: u.alias,
177
+ contents: (l.editors[u.editor] || { contents: "" }).contents
178
+ }))
179
+ ).then((u) => {
180
+ e.setModelConfigParseResults(y, u);
181
+ }).catch((u) => {
182
+ e.setModelParseError(y, u.message), console.error("Failed to fetch parse results:", u);
183
+ });
184
+ return {
185
+ creatorVisible: a,
186
+ flatList: g,
187
+ collapsed: C,
188
+ saveModels: t,
189
+ fetchParseResults: A,
190
+ trilogyIcon: je,
191
+ navigationStore: d,
192
+ handleClick: (y) => {
193
+ const u = y.lastIndexOf(L), h = u !== -1 ? y.substring(u + 1) : y;
194
+ d.openTab("models", h, y);
195
+ },
196
+ handleToggle: (y) => {
197
+ C.value[y] = !C.value[y];
198
+ },
199
+ modelStore: e,
200
+ contextMenuItems: (y) => y.type !== "model" ? [] : [
201
+ { id: "refresh-model", label: "Refresh model", icon: "mdi-cog-refresh-outline" },
202
+ { id: "delete-separator", kind: "separator" },
203
+ { id: "delete-model", label: "Delete model", icon: "mdi-trash-can-outline", danger: !0 }
204
+ ],
205
+ handleContextMenuItemClick: (y, u) => {
206
+ switch (u.id) {
207
+ case "refresh-model":
208
+ A(y.name);
209
+ break;
210
+ case "delete-model":
211
+ e.removeModelConfig(y.name);
212
+ break;
213
+ }
214
+ }
215
+ };
216
+ },
217
+ components: {
218
+ SidebarList: se,
219
+ SidebarItem: ne,
220
+ ModelCreator: Le,
221
+ LoadingButton: he,
222
+ Tooltip: oe,
223
+ SidebarOverflowMenu: fe
224
+ }
225
+ }, He = { class: "models-header" }, We = { class: "models-header-actions" }, _e = ["data-testid"], Qe = ["src"], Xe = {
226
+ key: 2,
227
+ class: "mdi mdi-table node-icon"
228
+ }, Ye = {
229
+ key: 0,
230
+ class: "right-container"
231
+ };
232
+ function Ze(e, t, l, o, d, a) {
233
+ const b = D("loading-button"), r = D("model-creator"), c = D("sidebar-overflow-menu"), v = D("sidebar-item"), s = D("sidebar-list");
234
+ return m(), E(s, { title: "Models" }, {
235
+ header: w(() => [
236
+ n("div", He, [
237
+ t[4] || (t[4] = n("h3", { class: "font-sans sidebar-header" }, "Models", -1)),
238
+ n("div", We, [
239
+ n("button", {
240
+ class: "sidebar-control-button sidebar-header-action",
241
+ onClick: t[0] || (t[0] = (i) => o.creatorVisible = !o.creatorVisible),
242
+ "data-testid": l.testTag ? `model-creator-add-${l.testTag}` : "model-creator-add"
243
+ }, [
244
+ t[2] || (t[2] = n("i", { class: "mdi mdi-plus" }, null, -1)),
245
+ z(" " + j(o.creatorVisible ? "Close" : "New"), 1)
246
+ ], 8, _e),
247
+ T(b, {
248
+ class: "sidebar-control-button sidebar-header-action",
249
+ action: o.saveModels,
250
+ "key-combination": ["control", "s"],
251
+ "use-default-style": !1
252
+ }, {
253
+ default: w(() => [...t[3] || (t[3] = [
254
+ z(" Save ", -1)
255
+ ])]),
256
+ _: 1
257
+ }, 8, ["action"])
258
+ ])
259
+ ])
260
+ ]),
261
+ actions: w(() => [
262
+ T(r, {
263
+ visible: o.creatorVisible,
264
+ onClose: t[1] || (t[1] = (i) => o.creatorVisible = !o.creatorVisible)
265
+ }, null, 8, ["visible"])
266
+ ]),
267
+ default: w(() => [
268
+ (m(!0), p(N, null, _(o.flatList, (i) => (m(), E(v, {
269
+ key: i.id,
270
+ "item-id": i.id,
271
+ name: i.name,
272
+ indent: i.indent,
273
+ "is-selected": l.activeModelKey === i.id,
274
+ "is-collapsible": ["model"].includes(i.type) || ["source", "datasource"].includes(i.type) && i.count > 0,
275
+ "is-collapsed": o.collapsed[i.id],
276
+ onClick: o.handleClick,
277
+ onToggle: o.handleToggle
278
+ }, {
279
+ icon: w(() => [
280
+ i.type === "source" ? (m(), p("img", {
281
+ key: 0,
282
+ src: o.trilogyIcon,
283
+ class: "trilogy-icon"
284
+ }, null, 8, Qe)) : i.type === "concept" ? (m(), p("span", {
285
+ key: 1,
286
+ class: B(`purpose-${i.concept.purpose.toLowerCase()}`)
287
+ }, j(i.concept.purpose.charAt(0).toUpperCase()), 3)) : i.type === "datasource" ? (m(), p("i", Xe)) : M("", !0)
288
+ ]),
289
+ "extra-content": w(() => [
290
+ i.type === "model" ? (m(), p("span", Ye, [
291
+ T(c, {
292
+ items: o.contextMenuItems(i),
293
+ tooltip: "Model actions",
294
+ onSelect: (S) => o.handleContextMenuItemClick(i, S)
295
+ }, null, 8, ["items", "onSelect"])
296
+ ])) : M("", !0)
297
+ ]),
298
+ _: 2
299
+ }, 1032, ["item-id", "name", "indent", "is-selected", "is-collapsible", "is-collapsed", "onClick", "onToggle"]))), 128))
300
+ ]),
301
+ _: 1
302
+ });
303
+ }
304
+ const xe = /* @__PURE__ */ H(Ge, [["render", Ze], ["__scopeId", "data-v-46c386ee"]]), et = {
305
+ key: 0,
306
+ class: "mdi mdi-server-network sidebar-icon"
307
+ }, tt = {
308
+ key: 1,
309
+ class: "mdi mdi-folder-outline sidebar-icon"
310
+ }, ot = {
311
+ key: 2,
312
+ class: "mdi mdi-file-outline sidebar-icon"
313
+ }, nt = {
314
+ key: 0,
315
+ class: "tag-container"
316
+ }, st = /* @__PURE__ */ ee({
317
+ __name: "JobsListItem",
318
+ props: {
319
+ item: {},
320
+ activeJobsKey: { default: "" },
321
+ isCollapsed: { type: Boolean, default: !1 }
322
+ },
323
+ emits: ["item-click", "item-toggle", "delete-store", "refresh-store"],
324
+ setup(e, { emit: t }) {
325
+ const l = e, o = t, d = ge(), a = () => {
326
+ o("item-click", l.item);
327
+ }, b = () => {
328
+ o("item-toggle", l.item);
329
+ }, r = (v) => d.getStoreStatus(v), c = (v) => {
330
+ const s = d.errors[v];
331
+ if (s)
332
+ return s;
333
+ const i = d.getStoreStatus(v);
334
+ if (i === "connected")
335
+ return "Ready";
336
+ if (i === "running")
337
+ return "Polling active jobs";
338
+ };
339
+ return (v, s) => (m(), E(ne, {
340
+ "item-id": e.item.key,
341
+ name: e.item.label,
342
+ indent: e.item.indent,
343
+ "is-selected": e.activeJobsKey === e.item.key,
344
+ "is-collapsible": e.item.type === "store" || e.item.type === "directory",
345
+ "is-collapsed": e.isCollapsed,
346
+ itemType: "jobs",
347
+ onClick: a,
348
+ onToggle: b
349
+ }, {
350
+ icon: w(() => [
351
+ e.item.type === "store" ? (m(), p("i", et)) : e.item.type === "directory" ? (m(), p("i", tt)) : (m(), p("i", ot))
352
+ ]),
353
+ "extra-content": w(() => [
354
+ e.item.type === "store" && e.item.store ? (m(), p("span", nt, [
355
+ T(oe, {
356
+ content: "Remove Store",
357
+ position: "left"
358
+ }, {
359
+ default: w(() => [
360
+ n("span", {
361
+ class: "remove-btn hover-icon sidebar-icon-button danger",
362
+ onClick: s[0] || (s[0] = Y((i) => o("delete-store", e.item.store), ["stop"]))
363
+ }, [...s[2] || (s[2] = [
364
+ n("i", { class: "mdi mdi-trash-can-outline" }, null, -1)
365
+ ])])
366
+ ]),
367
+ _: 1
368
+ }),
369
+ T(oe, {
370
+ content: "Refresh Store",
371
+ position: "left"
372
+ }, {
373
+ default: w(() => [
374
+ n("span", {
375
+ class: "hover-icon sidebar-icon-button",
376
+ onClick: s[1] || (s[1] = Y((i) => o("refresh-store", e.item.store.id), ["stop"]))
377
+ }, [...s[3] || (s[3] = [
378
+ n("i", { class: "mdi mdi-refresh" }, null, -1)
379
+ ])])
380
+ ]),
381
+ _: 1
382
+ }),
383
+ T(de, {
384
+ status: r(e.item.store.id),
385
+ message: c(e.item.store.id),
386
+ "test-name": e.item.store.id
387
+ }, null, 8, ["status", "message", "test-name"])
388
+ ])) : M("", !0)
389
+ ]),
390
+ _: 1
391
+ }, 8, ["item-id", "name", "indent", "is-selected", "is-collapsible", "is-collapsed"]));
392
+ }
393
+ }), it = /* @__PURE__ */ H(st, [["__scopeId", "data-v-ace64696"]]), lt = { class: "form-group" }, at = { class: "form-group" }, rt = { class: "form-group" }, dt = {
394
+ key: 0,
395
+ class: "form-error",
396
+ "data-testid": "add-jobs-store-error"
397
+ }, ct = { class: "dialog-actions" }, ut = ["disabled"], mt = /* @__PURE__ */ ee({
398
+ __name: "JobsAddStoreModal",
399
+ props: {
400
+ show: { type: Boolean },
401
+ loading: { type: Boolean }
402
+ },
403
+ emits: ["close", "add"],
404
+ setup(e, { emit: t }) {
405
+ const l = e, o = t, d = $(""), a = $(""), b = $(""), r = $("");
406
+ pe(
407
+ () => l.show,
408
+ (v) => {
409
+ v && (d.value = "", a.value = "", b.value = "", r.value = "");
410
+ }
411
+ );
412
+ const c = () => {
413
+ if (!a.value) {
414
+ r.value = "Base URL is required.";
415
+ return;
416
+ }
417
+ const v = ke(a.value);
418
+ o("add", {
419
+ type: "generic",
420
+ id: we(v),
421
+ name: d.value || Ce(v),
422
+ baseUrl: v,
423
+ token: b.value || void 0
424
+ });
425
+ };
426
+ return (v, s) => (m(), E(Se, {
427
+ show: e.show,
428
+ title: "Add Jobs Store",
429
+ "test-id": "add-jobs-store-modal",
430
+ onClose: s[4] || (s[4] = (i) => v.$emit("close"))
431
+ }, {
432
+ default: w(() => [
433
+ n("form", {
434
+ onSubmit: Y(c, ["prevent"])
435
+ }, [
436
+ n("div", lt, [
437
+ s[5] || (s[5] = n("label", null, "Store Name", -1)),
438
+ I(n("input", {
439
+ "onUpdate:modelValue": s[0] || (s[0] = (i) => d.value = i),
440
+ type: "text",
441
+ placeholder: "Optional, defaults to the store URL",
442
+ "data-testid": "jobs-store-name-input"
443
+ }, null, 512), [
444
+ [V, d.value]
445
+ ])
446
+ ]),
447
+ n("div", at, [
448
+ s[6] || (s[6] = n("label", null, "Base URL", -1)),
449
+ I(n("input", {
450
+ "onUpdate:modelValue": s[1] || (s[1] = (i) => a.value = i),
451
+ type: "url",
452
+ placeholder: "e.g., http://localhost:8100",
453
+ "data-testid": "jobs-store-url-input",
454
+ required: ""
455
+ }, null, 512), [
456
+ [V, a.value]
457
+ ]),
458
+ s[7] || (s[7] = n("small", null, "Must expose `/index.json`, `/files`, `/run`, `/refresh`, and `/jobs/{id}`.", -1))
459
+ ]),
460
+ n("div", rt, [
461
+ s[8] || (s[8] = n("label", null, "Token", -1)),
462
+ I(n("input", {
463
+ "onUpdate:modelValue": s[2] || (s[2] = (i) => b.value = i),
464
+ type: "text",
465
+ placeholder: "Optional X-Trilogy-Token value",
466
+ "data-testid": "jobs-store-token-input"
467
+ }, null, 512), [
468
+ [V, b.value]
469
+ ]),
470
+ s[9] || (s[9] = n("small", null, "Stored in memory only. You’ll need to re-enter it after a full reload.", -1))
471
+ ]),
472
+ r.value ? (m(), p("div", dt, j(r.value), 1)) : M("", !0),
473
+ n("div", ct, [
474
+ n("button", {
475
+ type: "button",
476
+ class: "cancel-btn",
477
+ onClick: s[3] || (s[3] = (i) => v.$emit("close"))
478
+ }, "Cancel"),
479
+ n("button", {
480
+ type: "submit",
481
+ class: "confirm-btn",
482
+ disabled: e.loading
483
+ }, j(e.loading ? "Adding..." : "Add Store"), 9, ut)
484
+ ])
485
+ ], 32)
486
+ ]),
487
+ _: 1
488
+ }, 8, ["show"]));
489
+ }
490
+ }), vt = /* @__PURE__ */ H(mt, [["__scopeId", "data-v-b2a74918"]]), Me = (e, t) => ({
491
+ name: e,
492
+ path: t,
493
+ files: [],
494
+ children: {}
495
+ }), De = (e) => e.slice().sort((t, l) => t.localeCompare(l)), bt = (e, t) => {
496
+ if (!t)
497
+ return e;
498
+ const l = t.split("/").filter(Boolean);
499
+ let o = e, d = "";
500
+ return l.forEach((a) => {
501
+ d = d ? `${d}/${a}` : a, o.children[a] || (o.children[a] = Me(a, d)), o = o.children[a];
502
+ }), o;
503
+ }, Ie = (e, t) => `${e}${L}directory${L}${encodeURIComponent(t)}`, pt = (e, t) => `${e}${L}file${L}${encodeURIComponent(t)}`, yt = (e, t, l, o, d) => {
504
+ De(l).forEach((a) => {
505
+ const b = o ? `${o}/${a}` : a;
506
+ e.push({
507
+ type: "file",
508
+ label: a,
509
+ key: pt(t, b),
510
+ indent: d,
511
+ storeId: t,
512
+ target: b
513
+ });
514
+ });
515
+ }, Te = (e, t, l, o, d) => {
516
+ yt(e, t, l.files, l.path, d), Object.values(l.children).sort((a, b) => a.name.localeCompare(b.name)).forEach((a) => {
517
+ const b = Ie(t, a.path);
518
+ e.push({
519
+ type: "directory",
520
+ label: a.name,
521
+ key: b,
522
+ indent: d,
523
+ storeId: t,
524
+ target: a.path
525
+ }), o[b] || Te(e, t, a, o, d + 1);
526
+ });
527
+ }, ft = (e = {}, t = [], l = {}) => {
528
+ const o = [];
529
+ return t.forEach((d) => {
530
+ var r;
531
+ if (o.push({
532
+ type: "store",
533
+ label: d.name,
534
+ key: d.id,
535
+ indent: 0,
536
+ storeId: d.id,
537
+ store: d
538
+ }), e[d.id])
539
+ return;
540
+ const a = Me("", "");
541
+ (((r = l[d.id]) == null ? void 0 : r.directories) || []).forEach((c) => {
542
+ const v = bt(a, c.directory);
543
+ v.files = De(c.files);
544
+ }), Te(o, d.id, a, e, 1);
545
+ }), o;
546
+ }, ht = { class: "jobs-header" }, gt = {
547
+ key: 0,
548
+ class: "empty-state"
549
+ }, St = {
550
+ key: 1,
551
+ class: "error-container"
552
+ }, kt = { class: "error-text" }, Ct = ["onClick"], wt = /* @__PURE__ */ ee({
553
+ __name: "JobsList",
554
+ props: {
555
+ activeJobsKey: { default: "" }
556
+ },
557
+ emits: ["jobs-key-selected"],
558
+ setup(e, { emit: t }) {
559
+ const l = e, o = t, d = ce(), a = ge(), b = re(), r = K("storageSources", []), c = K("editorStore"), v = K("connectionStore"), s = K("modelStore"), i = $({}), S = $(!1), C = G(
560
+ () => r.find((k) => k.type === "remote")
561
+ ), g = G(
562
+ () => d.stores.filter((k) => k.type === "generic")
563
+ ), A = G(() => g.value.some((k) => !!a.errors[k.id])), O = G(
564
+ () => g.value.filter((k) => !!a.errors[k.id])
565
+ ), U = (k, R, J) => {
566
+ const ae = R.split("/").filter(Boolean);
567
+ let Z = "";
568
+ ae.forEach((ve, sn) => {
569
+ Z = Z ? `${Z}/${ve}` : ve, i.value[Ie(k, Z)] = !1;
570
+ });
571
+ }, f = (k) => {
572
+ const R = k.split(L);
573
+ if (!R.length)
574
+ return;
575
+ const J = R[0];
576
+ if (i.value[J] = !1, R[1] === "directory") {
577
+ U(J, decodeURIComponent(R[2] || ""));
578
+ return;
579
+ }
580
+ if (R[1] === "file") {
581
+ const Z = decodeURIComponent(R[2] || "").split("/").slice(0, -1).join("/");
582
+ Z && U(J, Z);
583
+ }
584
+ }, F = G(
585
+ () => ft(i.value, g.value, a.filesByStore)
586
+ ), y = async (k) => {
587
+ try {
588
+ await d.addStore(k), await a.fetchFilesForStore(k.id), C.value && c && v && s && await Ee(
589
+ C.value,
590
+ k.id,
591
+ c,
592
+ v,
593
+ s
594
+ ), i.value[k.id] = !1, S.value = !1;
595
+ } catch (R) {
596
+ console.error("Failed to add jobs store:", R);
597
+ }
598
+ }, {
599
+ isOpen: u,
600
+ openConfirmation: h,
601
+ closeConfirmation: Q,
602
+ confirm: q
603
+ } = ue((k) => {
604
+ c && v && s && $e(k.id, c, v, s), d.removeStore(k.id), a.clearStoreData(k.id);
605
+ }), te = (k) => {
606
+ b.openTab("jobs", null, k.key), o("jobs-key-selected", k.key);
607
+ }, P = (k) => {
608
+ i.value[k.key] = !i.value[k.key];
609
+ }, ie = async (k) => {
610
+ await a.fetchFilesForStore(k);
611
+ };
612
+ return le(async () => {
613
+ d.loadStoresFromStorage(), g.value.forEach((k) => {
614
+ i.value[k.id] === void 0 && (i.value[k.id] = !0);
615
+ }), l.activeJobsKey ? f(l.activeJobsKey) : g.value[0] && (i.value[g.value[0].id] = !1), await a.refreshAllStores();
616
+ }), (k, R) => (m(), E(se, { title: "Jobs" }, {
617
+ header: w(() => [
618
+ n("div", ht, [
619
+ R[3] || (R[3] = n("h3", { class: "font-sans sidebar-header" }, "Jobs", -1)),
620
+ n("button", {
621
+ class: "sidebar-control-button sidebar-header-action",
622
+ onClick: R[0] || (R[0] = (J) => S.value = !0)
623
+ }, [...R[2] || (R[2] = [
624
+ n("i", { class: "mdi mdi-plus" }, null, -1),
625
+ z(" New ", -1)
626
+ ])])
627
+ ])
628
+ ]),
629
+ default: w(() => [
630
+ g.value.length ? M("", !0) : (m(), p("div", gt, " Add a Trilogy local server to browse files and run jobs. ")),
631
+ A.value ? (m(), p("div", St, [
632
+ (m(!0), p(N, null, _(O.value, (J) => (m(), p("div", {
633
+ key: J.id,
634
+ class: "error-item"
635
+ }, [
636
+ n("span", kt, j(J.name) + ": " + j(x(a).errors[J.id]), 1),
637
+ n("button", {
638
+ onClick: (ae) => x(a).clearStoreError(J.id),
639
+ class: "clear-error"
640
+ }, "x", 8, Ct)
641
+ ]))), 128))
642
+ ])) : M("", !0),
643
+ (m(!0), p(N, null, _(F.value, (J) => (m(), E(it, {
644
+ key: J.key,
645
+ item: J,
646
+ "is-collapsed": i.value[J.key],
647
+ "active-jobs-key": e.activeJobsKey,
648
+ onItemClick: te,
649
+ onItemToggle: P,
650
+ onDeleteStore: x(h),
651
+ onRefreshStore: ie
652
+ }, null, 8, ["item", "is-collapsed", "active-jobs-key", "onDeleteStore"]))), 128)),
653
+ T(vt, {
654
+ show: S.value,
655
+ onClose: R[1] || (R[1] = (J) => S.value = !1),
656
+ onAdd: y
657
+ }, null, 8, ["show"]),
658
+ T(me, {
659
+ show: x(u),
660
+ title: "Confirm Store Removal",
661
+ message: "Remove this jobs store? Imported models remain untouched.",
662
+ "confirm-label": "Remove",
663
+ onClose: x(Q),
664
+ onConfirm: x(q)
665
+ }, null, 8, ["show", "onClose", "onConfirm"])
666
+ ]),
667
+ _: 1
668
+ }));
669
+ }
670
+ }), $t = /* @__PURE__ */ H(wt, [["__scopeId", "data-v-bd82dbfb"]]), Mt = {
671
+ class: "popup-content",
672
+ "data-testid": "dashboard-import-popup"
673
+ }, Dt = { class: "popup-header" }, It = { class: "popup-body" }, Tt = { class: "import-mode-selector" }, Kt = {
674
+ key: 0,
675
+ class: "input-group"
676
+ }, Lt = {
677
+ key: 0,
678
+ class: "error-message"
679
+ }, jt = {
680
+ key: 1,
681
+ class: "input-group"
682
+ }, Et = { class: "url-input-container" }, Ut = ["disabled"], At = {
683
+ key: 0,
684
+ class: "error-message"
685
+ }, Rt = {
686
+ key: 1,
687
+ class: "preview-container"
688
+ }, Nt = { class: "json-preview" }, Vt = { class: "connection-selector" }, Ot = { class: "form-row" }, Pt = ["value"], Jt = {
689
+ key: 0,
690
+ class: "form-row"
691
+ }, Bt = {
692
+ key: 1,
693
+ class: "form-row"
694
+ }, Ft = { class: "form-row" }, qt = { class: "form-row" }, zt = { class: "form-row" }, Gt = { class: "popup-footer" }, Ht = ["disabled"], Wt = /* @__PURE__ */ ee({
695
+ __name: "DashboardImportPopup",
696
+ props: {
697
+ isOpen: { type: Boolean }
698
+ },
699
+ emits: ["close"],
700
+ setup(e, { emit: t }) {
701
+ const l = t, o = K("dashboardStore"), d = K("connectionStore"), a = K("saveDashboards"), b = K("saveAll");
702
+ if (!o || !d || !a || !b)
703
+ throw new Error("Required stores not provided");
704
+ const r = $(""), c = $(""), v = $(null), s = $(!1), i = $(""), S = $("paste"), C = $(null), g = $({
705
+ mdToken: "",
706
+ projectId: "",
707
+ username: "",
708
+ password: "",
709
+ account: "",
710
+ sshPrivateKey: ""
711
+ }), A = $(!0);
712
+ function O() {
713
+ if (!c.value) {
714
+ A.value = !1;
715
+ return;
716
+ }
717
+ if (c.value === "new-motherduck" && !g.value.mdToken) {
718
+ A.value = !1;
719
+ return;
720
+ }
721
+ if (c.value === "new-bigquery-oauth" && !g.value.projectId) {
722
+ A.value = !1;
723
+ return;
724
+ }
725
+ if (c.value === "new-snowflake" && (!g.value.username || !g.value.account || !g.value.sshPrivateKey)) {
726
+ A.value = !1;
727
+ return;
728
+ }
729
+ A.value = !0;
730
+ }
731
+ const U = async () => {
732
+ if (!i.value) {
733
+ C.value = "Please enter a URL", setTimeout(() => {
734
+ C.value = null;
735
+ }, 3e3);
736
+ return;
737
+ }
738
+ s.value = !0, C.value = null;
739
+ try {
740
+ const y = await fetch(i.value);
741
+ if (!y.ok)
742
+ throw new Error(`HTTP error! Status: ${y.status}`);
743
+ const u = await y.text();
744
+ r.value = u, s.value = !1;
745
+ } catch (y) {
746
+ console.error("Error fetching dashboard:", y), C.value = `Failed to fetch from URL: ${y instanceof Error ? y.message : "Unknown error"}`, s.value = !1, setTimeout(() => {
747
+ C.value = null;
748
+ }, 5e3);
749
+ }
750
+ }, f = async () => {
751
+ try {
752
+ const y = Ue.fromSerialized(JSON.parse(r.value));
753
+ y.storage = "local";
754
+ let u = c.value;
755
+ if (u.startsWith("new-")) {
756
+ let h = u.replace("new-", "");
757
+ u = `dashboard-${y.name || "imported"}-connection`, d.connections[u] || d.newConnection(u, h, {
758
+ mdToken: g.value.mdToken,
759
+ projectId: g.value.projectId,
760
+ username: g.value.username,
761
+ password: g.value.password,
762
+ account: g.value.account,
763
+ privateKey: g.value.sshPrivateKey
764
+ });
765
+ }
766
+ y.connection = u, y.id = Math.random().toString(36).substring(2, 15), o.addDashboard(y), F.value = !0, r.value = "", i.value = "", g.value = {
767
+ mdToken: "",
768
+ projectId: "",
769
+ username: "",
770
+ password: "",
771
+ account: "",
772
+ sshPrivateKey: ""
773
+ }, await b(), setTimeout(() => {
774
+ F.value = !1, l("close");
775
+ }, 1500);
776
+ } catch {
777
+ v.value = "Invalid JSON format", setTimeout(() => {
778
+ v.value = null;
779
+ }, 3e3);
780
+ }
781
+ }, F = $(!1);
782
+ return O(), (y, u) => e.isOpen ? (m(), p("div", {
783
+ key: 0,
784
+ class: "popup-overlay",
785
+ onClick: u[11] || (u[11] = Y((h) => l("close"), ["self"]))
786
+ }, [
787
+ n("div", Mt, [
788
+ n("div", Dt, [
789
+ u[12] || (u[12] = n("h3", null, "Import Dashboard", -1)),
790
+ n("button", {
791
+ onClick: u[0] || (u[0] = (h) => l("close")),
792
+ class: "close-button",
793
+ "data-testid": "close-popup-button"
794
+ }, " ✕ ")
795
+ ]),
796
+ n("div", It, [
797
+ n("div", Tt, [
798
+ n("button", {
799
+ class: B(["mode-button", { active: S.value === "paste" }]),
800
+ onClick: u[1] || (u[1] = (h) => S.value = "paste"),
801
+ "data-testid": "paste-mode-button"
802
+ }, " Paste JSON ", 2),
803
+ n("button", {
804
+ class: B(["mode-button", { active: S.value === "url" }]),
805
+ onClick: u[2] || (u[2] = (h) => S.value = "url"),
806
+ "data-testid": "url-mode-button"
807
+ }, " From URL ", 2)
808
+ ]),
809
+ S.value === "paste" ? (m(), p("div", Kt, [
810
+ u[13] || (u[13] = n("label", { for: "dashboard-json" }, "Paste Dashboard JSON", -1)),
811
+ I(n("textarea", {
812
+ id: "dashboard-json",
813
+ "onUpdate:modelValue": u[3] || (u[3] = (h) => r.value = h),
814
+ placeholder: "Paste your dashboard JSON here",
815
+ rows: "16",
816
+ class: "dashboard-textarea",
817
+ "data-testid": "dashboard-json-input"
818
+ }, null, 512), [
819
+ [V, r.value]
820
+ ]),
821
+ v.value ? (m(), p("div", Lt, j(v.value), 1)) : M("", !0)
822
+ ])) : M("", !0),
823
+ S.value === "url" ? (m(), p("div", jt, [
824
+ u[15] || (u[15] = n("label", { for: "dashboard-url" }, "Dashboard URL", -1)),
825
+ n("div", Et, [
826
+ I(n("input", {
827
+ type: "text",
828
+ id: "dashboard-url",
829
+ "onUpdate:modelValue": u[4] || (u[4] = (h) => i.value = h),
830
+ placeholder: "https://example.com/dashboard.json",
831
+ class: "url-input",
832
+ "data-testid": "dashboard-url-input"
833
+ }, null, 512), [
834
+ [V, i.value]
835
+ ]),
836
+ n("button", {
837
+ onClick: U,
838
+ class: "fetch-button",
839
+ disabled: s.value,
840
+ "data-testid": "fetch-url-button"
841
+ }, j(s.value ? "Loading..." : "Fetch"), 9, Ut)
842
+ ]),
843
+ C.value ? (m(), p("div", At, j(C.value), 1)) : M("", !0),
844
+ r.value && S.value === "url" ? (m(), p("div", Rt, [
845
+ u[14] || (u[14] = n("label", null, "Dashboard JSON Preview", -1)),
846
+ n("div", Nt, [
847
+ n("pre", null, j(r.value.length > 500 ? r.value.substring(0, 500) + "..." : r.value), 1)
848
+ ])
849
+ ])) : M("", !0)
850
+ ])) : M("", !0)
851
+ ]),
852
+ n("div", Vt, [
853
+ n("div", Ot, [
854
+ u[21] || (u[21] = n("label", { for: "connection-select" }, "Assign To Connection", -1)),
855
+ I(n("select", {
856
+ id: "connection-select",
857
+ "onUpdate:modelValue": u[5] || (u[5] = (h) => c.value = h),
858
+ class: "connection-dropdown",
859
+ "data-testid": "connection-select",
860
+ onChange: O
861
+ }, [
862
+ u[16] || (u[16] = n("option", {
863
+ value: "",
864
+ disabled: ""
865
+ }, "-- Select Connection --", -1)),
866
+ (m(!0), p(N, null, _(x(d).connections, (h) => (m(), p("option", {
867
+ key: h.name,
868
+ value: h.name
869
+ }, j(h.name), 9, Pt))), 128)),
870
+ u[17] || (u[17] = n("option", { value: "new-duckdb" }, "New DuckDB", -1)),
871
+ u[18] || (u[18] = n("option", { value: "new-motherduck" }, "New MotherDuck", -1)),
872
+ u[19] || (u[19] = n("option", { value: "new-bigquery-oauth" }, "New Bigquery Oauth", -1)),
873
+ u[20] || (u[20] = n("option", { value: "new-snowflake" }, "New Snowflake", -1))
874
+ ], 544), [
875
+ [ye, c.value]
876
+ ])
877
+ ]),
878
+ c.value === "new-motherduck" ? (m(), p("div", Jt, [
879
+ u[22] || (u[22] = n("label", { for: "md-token" }, "MotherDuck Token", -1)),
880
+ I(n("input", {
881
+ type: "text",
882
+ "onUpdate:modelValue": u[6] || (u[6] = (h) => g.value.mdToken = h),
883
+ id: "md-token",
884
+ placeholder: "MotherDuck Token",
885
+ class: "connection-input",
886
+ onInput: O
887
+ }, null, 544), [
888
+ [
889
+ V,
890
+ g.value.mdToken,
891
+ void 0,
892
+ { trim: !0 }
893
+ ]
894
+ ])
895
+ ])) : M("", !0),
896
+ c.value === "new-bigquery-oauth" ? (m(), p("div", Bt, [
897
+ u[23] || (u[23] = n("label", { for: "project-id" }, "BigQuery Project ID", -1)),
898
+ I(n("input", {
899
+ type: "text",
900
+ "onUpdate:modelValue": u[7] || (u[7] = (h) => g.value.projectId = h),
901
+ id: "project-id",
902
+ placeholder: "Billing Project ID",
903
+ class: "connection-input",
904
+ onInput: O
905
+ }, null, 544), [
906
+ [
907
+ V,
908
+ g.value.projectId,
909
+ void 0,
910
+ { trim: !0 }
911
+ ]
912
+ ])
913
+ ])) : M("", !0),
914
+ c.value === "new-snowflake" ? (m(), p(N, { key: 2 }, [
915
+ n("div", Ft, [
916
+ u[24] || (u[24] = n("label", { for: "snowflake-username" }, "Username", -1)),
917
+ I(n("input", {
918
+ type: "text",
919
+ "onUpdate:modelValue": u[8] || (u[8] = (h) => g.value.username = h),
920
+ id: "snowflake-username",
921
+ placeholder: "Snowflake Username",
922
+ class: "connection-input",
923
+ onInput: O
924
+ }, null, 544), [
925
+ [
926
+ V,
927
+ g.value.username,
928
+ void 0,
929
+ { trim: !0 }
930
+ ]
931
+ ])
932
+ ]),
933
+ n("div", qt, [
934
+ u[25] || (u[25] = n("label", { for: "snowflake-account" }, "Account", -1)),
935
+ I(n("input", {
936
+ type: "text",
937
+ "onUpdate:modelValue": u[9] || (u[9] = (h) => g.value.account = h),
938
+ id: "snowflake-account",
939
+ placeholder: "Snowflake Account",
940
+ class: "connection-input",
941
+ onInput: O
942
+ }, null, 544), [
943
+ [
944
+ V,
945
+ g.value.account,
946
+ void 0,
947
+ { trim: !0 }
948
+ ]
949
+ ])
950
+ ]),
951
+ n("div", zt, [
952
+ u[26] || (u[26] = n("label", { for: "snowflake-ssh-private-key" }, "Private Key", -1)),
953
+ I(n("input", {
954
+ type: "text",
955
+ "onUpdate:modelValue": u[10] || (u[10] = (h) => g.value.sshPrivateKey = h),
956
+ id: "snowflake-ssh-private-key",
957
+ placeholder: "Private Key",
958
+ class: "connection-input",
959
+ onInput: O
960
+ }, null, 544), [
961
+ [
962
+ V,
963
+ g.value.sshPrivateKey,
964
+ void 0,
965
+ { trim: !0 }
966
+ ]
967
+ ])
968
+ ])
969
+ ], 64)) : M("", !0)
970
+ ]),
971
+ n("div", Gt, [
972
+ n("button", {
973
+ onClick: f,
974
+ class: "copy-button",
975
+ "data-testid": "import-dashboard-button",
976
+ disabled: !r.value || !c.value || s.value || !A.value
977
+ }, j(F.value ? "Imported!" : "Import"), 9, Ht)
978
+ ])
979
+ ])
980
+ ])) : M("", !0);
981
+ }
982
+ }), _t = /* @__PURE__ */ H(Wt, [["__scopeId", "data-v-103efda3"]]), Qt = {
983
+ name: "DashboardListItem",
984
+ props: {
985
+ item: {
986
+ type: Object,
987
+ required: !0
988
+ },
989
+ isActive: {
990
+ type: Boolean,
991
+ default: !1
992
+ },
993
+ isCollapsed: {
994
+ type: Boolean,
995
+ default: !1
996
+ }
997
+ },
998
+ emits: ["click", "delete", "clone", "toggle"],
999
+ setup(e) {
1000
+ const t = K("connectionStore"), l = K("dashboardStore"), o = K("isMobile", !1);
1001
+ if (!t || !l)
1002
+ throw new Error("Connection/Dashboard stores is not provided!");
1003
+ const d = G(() => e.item.type === "connection" && t.connections[e.item.label] || null), a = G(() => {
1004
+ const r = d.value;
1005
+ return r ? r.running ? "running" : r.connected ? "connected" : "disabled" : "disabled";
1006
+ }), b = G(() => e.item.type === "connection" ? [{ id: "new-dashboard", label: "New dashboard", icon: "mdi-table-plus" }] : e.item.type === "dashboard" ? [
1007
+ { id: "clone-dashboard", label: "Clone dashboard", icon: "mdi-content-copy" },
1008
+ { id: "delete-separator", kind: "separator" },
1009
+ {
1010
+ id: "delete-dashboard",
1011
+ label: "Delete dashboard",
1012
+ icon: "mdi-trash-can-outline",
1013
+ danger: !0
1014
+ }
1015
+ ] : []);
1016
+ return {
1017
+ isMobile: o,
1018
+ dashboardStore: l,
1019
+ connectionInfo: d,
1020
+ connectionStatus: a,
1021
+ contextMenuItems: b
1022
+ };
1023
+ },
1024
+ methods: {
1025
+ handleClick() {
1026
+ this.$emit("click", this.item);
1027
+ },
1028
+ handleToggle() {
1029
+ this.$emit("click", this.item);
1030
+ },
1031
+ handleDelete() {
1032
+ this.$emit("delete", this.item.dashboard);
1033
+ },
1034
+ handleClone() {
1035
+ this.dashboardStore.cloneDashboard(this.item.id);
1036
+ },
1037
+ handleContextMenuItemClick(e) {
1038
+ switch (e.id) {
1039
+ case "new-dashboard": {
1040
+ const t = `${this.item.label} Dashboard ${Date.now().toString().slice(-4)}`, l = this.dashboardStore.newDashboard(t, this.item.label);
1041
+ this.dashboardStore.setActiveDashboard(l.id);
1042
+ break;
1043
+ }
1044
+ case "clone-dashboard":
1045
+ this.handleClone();
1046
+ break;
1047
+ case "delete-dashboard":
1048
+ this.handleDelete();
1049
+ break;
1050
+ }
1051
+ }
1052
+ },
1053
+ components: {
1054
+ SidebarItem: ne,
1055
+ Tooltip: oe,
1056
+ StatusIcon: de,
1057
+ SidebarOverflowMenu: fe
1058
+ }
1059
+ }, Xt = {
1060
+ key: 0,
1061
+ class: "text-light connection-model"
1062
+ }, Yt = { class: "dashboard-actions" }, Zt = ["data-testid"];
1063
+ function xt(e, t, l, o, d, a) {
1064
+ const b = D("tooltip"), r = D("status-icon"), c = D("sidebar-overflow-menu"), v = D("sidebar-item");
1065
+ return l.item.type !== "creator" ? (m(), E(v, {
1066
+ key: 0,
1067
+ "item-id": l.item.key,
1068
+ name: l.item.label,
1069
+ indent: l.item.indent,
1070
+ "is-selected": l.isActive,
1071
+ "is-collapsible": !["dashboard", "creator"].includes(l.item.type),
1072
+ "is-collapsed": l.isCollapsed,
1073
+ itemType: "dashboard",
1074
+ onClick: a.handleClick,
1075
+ onToggle: a.handleToggle
1076
+ }, {
1077
+ icon: w(() => [
1078
+ l.item.type === "dashboard" ? (m(), E(b, {
1079
+ key: 0,
1080
+ content: "Dashboard",
1081
+ position: "right"
1082
+ }, {
1083
+ default: w(() => [...t[1] || (t[1] = [
1084
+ n("i", { class: "mdi mdi-view-dashboard node-icon" }, null, -1)
1085
+ ])]),
1086
+ _: 1
1087
+ })) : M("", !0)
1088
+ ]),
1089
+ name: w(() => {
1090
+ var s, i;
1091
+ return [
1092
+ z(j(l.item.label) + " ", 1),
1093
+ l.item.type === "connection" ? (m(), p("span", Xt, " (" + j((s = o.connectionInfo) != null && s.model ? (i = o.connectionInfo) == null ? void 0 : i.model : "No Model Set") + ") ", 1)) : M("", !0)
1094
+ ];
1095
+ }),
1096
+ "extra-content": w(() => [
1097
+ n("div", Yt, [
1098
+ l.item.type === "connection" ? (m(), p(N, { key: 0 }, [
1099
+ T(r, { status: o.connectionStatus }, null, 8, ["status"]),
1100
+ T(c, {
1101
+ items: o.contextMenuItems,
1102
+ tooltip: "Connection actions",
1103
+ onSelect: a.handleContextMenuItemClick
1104
+ }, null, 8, ["items", "onSelect"])
1105
+ ], 64)) : M("", !0),
1106
+ l.item.type === "dashboard" ? (m(), E(c, {
1107
+ key: 1,
1108
+ items: o.contextMenuItems,
1109
+ tooltip: "Dashboard actions",
1110
+ onSelect: a.handleContextMenuItemClick
1111
+ }, null, 8, ["items", "onSelect"])) : M("", !0)
1112
+ ])
1113
+ ]),
1114
+ _: 1
1115
+ }, 8, ["item-id", "name", "indent", "is-selected", "is-collapsible", "is-collapsed", "onClick", "onToggle"])) : (m(), p("div", {
1116
+ key: 1,
1117
+ "data-testid": `dashboard-list-id-${l.item.key}`,
1118
+ class: "creator-item",
1119
+ onClick: t[0] || (t[0] = (...s) => a.handleClick && a.handleClick(...s))
1120
+ }, j(l.item.label), 9, Zt));
1121
+ }
1122
+ const eo = /* @__PURE__ */ H(Qt, [["render", xt], ["__scopeId", "data-v-1782b723"]]);
1123
+ function to(e, t) {
1124
+ const l = [], o = {};
1125
+ return e.forEach((d) => {
1126
+ const a = d.storage || "local";
1127
+ d.deleted || (o[a] || (o[a] = []), o[a].push(d));
1128
+ }), Object.entries(o).forEach(([d, a]) => {
1129
+ const b = `s-${d}`;
1130
+ if (l.push({
1131
+ type: "storage",
1132
+ label: d === "local" ? "Browser Storage" : "Remote Storage",
1133
+ key: b,
1134
+ id: b,
1135
+ indent: 0
1136
+ }), !t[b]) {
1137
+ const r = {};
1138
+ a.forEach((c) => {
1139
+ const v = c.connection || "default";
1140
+ r[v] || (r[v] = []), r[v].push(c);
1141
+ }), Object.entries(r).forEach(([c, v]) => {
1142
+ const s = `c-${d}-${c}`;
1143
+ l.push({
1144
+ type: "connection",
1145
+ id: s,
1146
+ label: c,
1147
+ key: s,
1148
+ indent: 1
1149
+ }), t[s] || v.forEach((i) => {
1150
+ l.push({
1151
+ type: "dashboard",
1152
+ label: i.name,
1153
+ id: i.id,
1154
+ key: `d-${i.id}`,
1155
+ indent: 2,
1156
+ dashboard: i
1157
+ });
1158
+ });
1159
+ });
1160
+ }
1161
+ }), l;
1162
+ }
1163
+ const oo = {
1164
+ name: "DashboardList",
1165
+ props: {
1166
+ activeDashboardKey: String,
1167
+ testTag: {
1168
+ type: String,
1169
+ default: ""
1170
+ }
1171
+ },
1172
+ setup() {
1173
+ const e = K("dashboardStore"), t = K("connectionStore"), l = K("saveDashboards");
1174
+ if (!e || !t || !l)
1175
+ throw new Error("Dashboard or connection store is not provided!");
1176
+ const o = $({}), d = $(!1), a = $(!1), b = (C) => {
1177
+ o.value[C] === void 0 && (o.value[C] = !1), o.value[C] = !o.value[C];
1178
+ }, r = W("dashboard") || "";
1179
+ le(() => {
1180
+ if (Object.values(e.dashboards).forEach((C) => {
1181
+ let g = `s-${C.storage}`, A = `c-${C.storage}-${C.connection}`;
1182
+ r === C.id ? (o.value[g] = !1, o.value[A] = !1) : (o.value[g] === void 0 ? o.value[g] = !0 : o.value[g] === !1 && (o.value[g] = !1), o.value[A] === void 0 ? o.value[A] = !0 : o.value[A] === !1 && (o.value[A] = !1));
1183
+ }), Object.keys(e.dashboards).length > 0) {
1184
+ const C = Object.values(e.dashboards)[0];
1185
+ o.value[`s-${C.storage}`] = !1;
1186
+ }
1187
+ });
1188
+ const c = G(() => to(Object.values(e.dashboards), o.value)), {
1189
+ isOpen: v,
1190
+ openConfirmation: s,
1191
+ closeConfirmation: i,
1192
+ confirm: S
1193
+ } = ue((C) => {
1194
+ C.delete();
1195
+ });
1196
+ return {
1197
+ connectionStore: t,
1198
+ dashboardStore: e,
1199
+ contentList: c,
1200
+ toggleCollapse: b,
1201
+ collapsed: o,
1202
+ creatorVisible: d,
1203
+ importPopupVisible: a,
1204
+ saveDashboards: l,
1205
+ showDeleteConfirmationState: v,
1206
+ showDeleteConfirmation: s,
1207
+ cancelDelete: i,
1208
+ confirmDelete: S
1209
+ };
1210
+ },
1211
+ methods: {
1212
+ dashboardCreated(e) {
1213
+ console.log("Dashboard created event received:", e), this.$emit("dashboard-key-selected", e);
1214
+ },
1215
+ clickAction(e) {
1216
+ e.type === "dashboard" ? this.$emit("dashboard-key-selected", e.id) : this.toggleCollapse(e.key);
1217
+ }
1218
+ },
1219
+ components: {
1220
+ DashboardCreatorInline: Be,
1221
+ DashboardImportPopup: _t,
1222
+ DashboardListItem: eo,
1223
+ SidebarList: se,
1224
+ LoadingButton: he,
1225
+ ConfirmDialog: me
1226
+ }
1227
+ }, no = { class: "dashboards-header" }, so = ["data-testid"], io = { class: "button-container" };
1228
+ function lo(e, t, l, o, d, a) {
1229
+ const b = D("dashboard-creator-inline"), r = D("dashboard-import-popup"), c = D("dashboard-list-item"), v = D("ConfirmDialog"), s = D("sidebar-list");
1230
+ return m(), E(s, { title: "Dashboards" }, {
1231
+ header: w(() => [
1232
+ n("div", no, [
1233
+ t[5] || (t[5] = n("h3", { class: "font-sans sidebar-header" }, "Dashboards", -1)),
1234
+ n("button", {
1235
+ class: "sidebar-control-button sidebar-header-action",
1236
+ onClick: t[0] || (t[0] = (i) => o.creatorVisible = !o.creatorVisible),
1237
+ "data-testid": l.testTag ? `dashboard-creator-add-${l.testTag}` : "dashboard-creator-add"
1238
+ }, [
1239
+ t[4] || (t[4] = n("i", { class: "mdi mdi-plus" }, null, -1)),
1240
+ z(" " + j(o.creatorVisible ? "Close" : "New"), 1)
1241
+ ], 8, so)
1242
+ ])
1243
+ ]),
1244
+ actions: w(() => [
1245
+ n("div", io, [
1246
+ n("button", {
1247
+ class: "sidebar-control-button sidebar-header-action",
1248
+ onClick: t[1] || (t[1] = (i) => o.importPopupVisible = !0),
1249
+ "data-testid": "dashboard-import-button"
1250
+ }, " Import ")
1251
+ ]),
1252
+ T(b, {
1253
+ visible: o.creatorVisible,
1254
+ onClose: t[2] || (t[2] = (i) => o.creatorVisible = !o.creatorVisible),
1255
+ testTag: l.testTag,
1256
+ onDashboardCreated: a.dashboardCreated
1257
+ }, null, 8, ["visible", "testTag", "onDashboardCreated"]),
1258
+ T(r, {
1259
+ isOpen: o.importPopupVisible,
1260
+ onClose: t[3] || (t[3] = (i) => o.importPopupVisible = !1)
1261
+ }, null, 8, ["isOpen"])
1262
+ ]),
1263
+ default: w(() => [
1264
+ (m(!0), p(N, null, _(o.contentList, (i) => (m(), E(c, {
1265
+ key: i.key,
1266
+ item: i,
1267
+ "is-active": l.activeDashboardKey === i.id,
1268
+ "is-collapsed": o.collapsed[i.key],
1269
+ onClick: (S) => a.clickAction(i),
1270
+ onDelete: o.showDeleteConfirmation
1271
+ }, null, 8, ["item", "is-active", "is-collapsed", "onClick", "onDelete"]))), 128)),
1272
+ T(v, {
1273
+ show: o.showDeleteConfirmationState,
1274
+ title: "Confirm Deletion",
1275
+ message: "Are you sure you want to delete this dashboard? Contents cannot be recovered.",
1276
+ "confirm-label": "Delete",
1277
+ "cancel-test-id": "cancel-dashboard-deletion",
1278
+ "confirm-test-id": "confirm-dashboard-deletion",
1279
+ onClose: o.cancelDelete,
1280
+ onConfirm: o.confirmDelete
1281
+ }, null, 8, ["show", "onClose", "onConfirm"])
1282
+ ]),
1283
+ _: 1
1284
+ });
1285
+ }
1286
+ const ao = /* @__PURE__ */ H(oo, [["render", lo], ["__scopeId", "data-v-e431c8de"]]), ro = {
1287
+ key: 0,
1288
+ class: "mdi mdi-source-repository sidebar-icon"
1289
+ }, co = {
1290
+ key: 1,
1291
+ class: "right-pad"
1292
+ }, uo = {
1293
+ key: 0,
1294
+ class: "tag-container"
1295
+ }, mo = {
1296
+ key: 1,
1297
+ class: "tag-container hover-icon"
1298
+ }, vo = {
1299
+ key: 2,
1300
+ class: "tag-container"
1301
+ }, bo = ["data-testid"], po = /* @__PURE__ */ ee({
1302
+ __name: "CommunityModelListItem",
1303
+ props: {
1304
+ item: {},
1305
+ activeModel: { default: "" },
1306
+ isCollapsed: { type: Boolean, default: !1 },
1307
+ isMobile: { type: Boolean, default: !1 }
1308
+ },
1309
+ emits: ["item-click", "model-selected", "model-details", "item-toggle", "delete-store"],
1310
+ setup(e, { emit: t }) {
1311
+ const l = e, o = t, d = ce(), a = () => {
1312
+ l.item.type === "model" ? o("model-selected", l.item.model, l.item.key, l.item.modelRoot) : o("item-click", l.item.type, l.item.key, l.item.modelRoot);
1313
+ }, b = () => {
1314
+ ["model"].includes(l.item.type) || o("item-toggle", l.item.type, l.item.key, l.item.modelRoot);
1315
+ }, r = () => "", c = (i) => i.id === Re.id, v = (i) => d.getStoreStatus(i.id), s = (i) => {
1316
+ const S = d.errors[i.id];
1317
+ if (S)
1318
+ return `Connection failed: ${S}`;
1319
+ if (d.getStoreStatus(i.id) === "connected")
1320
+ return "Connected";
1321
+ };
1322
+ return (i, S) => (m(), E(ne, {
1323
+ "item-id": e.item.key,
1324
+ name: e.item.label,
1325
+ indent: e.item.indent,
1326
+ "is-selected": e.activeModel === e.item.key,
1327
+ "is-collapsible": !["model"].includes(e.item.type),
1328
+ "is-collapsed": e.isCollapsed,
1329
+ icon: r(),
1330
+ itemType: "community",
1331
+ onClick: a,
1332
+ onToggle: b
1333
+ }, {
1334
+ icon: w(() => [
1335
+ e.item.type === "root" ? (m(), p("i", ro)) : e.item.type === "engine" ? (m(), p("span", co, [
1336
+ T(Oe, {
1337
+ "connection-type": e.item.label
1338
+ }, null, 8, ["connection-type"])
1339
+ ])) : M("", !0)
1340
+ ]),
1341
+ "extra-content": w(() => {
1342
+ var C;
1343
+ return [
1344
+ e.item.type === "model" ? (m(), p("span", uo, [
1345
+ (m(!0), p(N, null, _(((C = e.item.model) == null ? void 0 : C.tags) || [], (g) => (m(), E(Ae, {
1346
+ key: g,
1347
+ label: g
1348
+ }, null, 8, ["label"]))), 128))
1349
+ ])) : e.item.type === "engine" ? (m(), p("span", mo)) : e.item.type === "root" ? (m(), p("span", vo, [
1350
+ e.item.store && !c(e.item.store) ? (m(), E(oe, {
1351
+ key: 0,
1352
+ content: "Remove Store",
1353
+ position: "left"
1354
+ }, {
1355
+ default: w(() => [
1356
+ n("span", {
1357
+ class: "remove-btn hover-icon sidebar-icon-button danger",
1358
+ onClick: S[0] || (S[0] = Y((g) => o("delete-store", e.item.store), ["stop"])),
1359
+ "data-testid": `delete-store-${e.item.store.id}`
1360
+ }, [...S[1] || (S[1] = [
1361
+ n("i", { class: "mdi mdi-trash-can-outline" }, null, -1)
1362
+ ])], 8, bo)
1363
+ ]),
1364
+ _: 1
1365
+ })) : M("", !0),
1366
+ e.item.store ? (m(), E(de, {
1367
+ key: 1,
1368
+ status: v(e.item.store),
1369
+ message: s(e.item.store),
1370
+ "test-name": e.item.store.id
1371
+ }, null, 8, ["status", "message", "test-name"])) : M("", !0)
1372
+ ])) : M("", !0)
1373
+ ];
1374
+ }),
1375
+ _: 1
1376
+ }, 8, ["item-id", "name", "indent", "is-selected", "is-collapsible", "is-collapsed", "icon"]));
1377
+ }
1378
+ }), yo = /* @__PURE__ */ H(po, [["__scopeId", "data-v-afe793de"]]), fo = {
1379
+ name: "AddStoreModal",
1380
+ components: {
1381
+ ModalDialog: Se
1382
+ },
1383
+ props: {
1384
+ show: {
1385
+ type: Boolean,
1386
+ required: !0
1387
+ },
1388
+ loading: {
1389
+ type: Boolean,
1390
+ default: !1
1391
+ }
1392
+ },
1393
+ emits: ["close", "add"],
1394
+ setup(e, { emit: t }) {
1395
+ const l = $("generic"), o = $(""), d = $(""), a = $(""), b = $(""), r = $("main"), c = $(null);
1396
+ return pe(
1397
+ () => e.show,
1398
+ (s) => {
1399
+ s && (l.value = "generic", o.value = "", d.value = "", a.value = "", b.value = "", r.value = "main", c.value = null);
1400
+ }
1401
+ ), {
1402
+ storeType: l,
1403
+ storeName: o,
1404
+ baseUrl: d,
1405
+ owner: a,
1406
+ repo: b,
1407
+ branch: r,
1408
+ error: c,
1409
+ handleSubmit: async () => {
1410
+ c.value = null;
1411
+ try {
1412
+ if (l.value === "generic") {
1413
+ if (!d.value) {
1414
+ c.value = "Please fill in all required fields";
1415
+ return;
1416
+ }
1417
+ const s = ke(d.value), S = {
1418
+ type: "generic",
1419
+ id: we(s),
1420
+ name: o.value || Ce(s),
1421
+ baseUrl: s
1422
+ };
1423
+ t("add", S);
1424
+ } else {
1425
+ if (!o.value || !a.value || !b.value || !r.value) {
1426
+ c.value = "Please fill in all required fields";
1427
+ return;
1428
+ }
1429
+ const i = {
1430
+ type: "github",
1431
+ id: `${a.value}-${b.value}-${r.value}`,
1432
+ name: o.value,
1433
+ owner: a.value,
1434
+ repo: b.value,
1435
+ branch: r.value
1436
+ };
1437
+ t("add", i);
1438
+ }
1439
+ } catch (s) {
1440
+ c.value = s instanceof Error ? s.message : "Failed to add store";
1441
+ }
1442
+ }
1443
+ };
1444
+ }
1445
+ }, ho = { class: "form-group" }, go = { class: "form-group" }, So = { class: "form-group" }, ko = { class: "form-group" }, Co = { class: "form-group" }, wo = { class: "form-group" }, $o = { class: "form-group" }, Mo = {
1446
+ key: 2,
1447
+ class: "form-error",
1448
+ "data-testid": "add-store-error"
1449
+ }, Do = { class: "dialog-actions" }, Io = ["disabled"];
1450
+ function To(e, t, l, o, d, a) {
1451
+ const b = D("ModalDialog");
1452
+ return m(), E(b, {
1453
+ show: l.show,
1454
+ title: "Add Model Store",
1455
+ "test-id": "add-store-modal",
1456
+ onClose: t[9] || (t[9] = (r) => e.$emit("close"))
1457
+ }, {
1458
+ default: w(() => [
1459
+ n("form", {
1460
+ onSubmit: t[8] || (t[8] = Y((...r) => o.handleSubmit && o.handleSubmit(...r), ["prevent"]))
1461
+ }, [
1462
+ n("div", ho, [
1463
+ t[11] || (t[11] = n("label", null, [
1464
+ z("Store Type: "),
1465
+ n("span", { class: "required" }, "*")
1466
+ ], -1)),
1467
+ I(n("select", {
1468
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => o.storeType = r),
1469
+ "data-testid": "store-type-select"
1470
+ }, [...t[10] || (t[10] = [
1471
+ n("option", { value: "generic" }, "Generic", -1),
1472
+ n("option", { value: "github" }, "GitHub Repository", -1)
1473
+ ])], 512), [
1474
+ [ye, o.storeType]
1475
+ ])
1476
+ ]),
1477
+ o.storeType === "generic" ? (m(), p(N, { key: 0 }, [
1478
+ n("div", go, [
1479
+ t[12] || (t[12] = n("label", null, "Store Name:", -1)),
1480
+ I(n("input", {
1481
+ "onUpdate:modelValue": t[1] || (t[1] = (r) => o.storeName = r),
1482
+ type: "text",
1483
+ placeholder: "Optional, defaults to the store URL",
1484
+ "data-testid": "store-name-input"
1485
+ }, null, 512), [
1486
+ [V, o.storeName]
1487
+ ])
1488
+ ]),
1489
+ n("div", So, [
1490
+ t[13] || (t[13] = n("label", null, [
1491
+ z("Base URL: "),
1492
+ n("span", { class: "required" }, "*")
1493
+ ], -1)),
1494
+ I(n("input", {
1495
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => o.baseUrl = r),
1496
+ type: "url",
1497
+ placeholder: "e.g., http://localhost:8000",
1498
+ "data-testid": "store-url-input",
1499
+ required: ""
1500
+ }, null, 512), [
1501
+ [V, o.baseUrl]
1502
+ ]),
1503
+ t[14] || (t[14] = n("small", null, "URL should serve an index.json file at /index.json", -1))
1504
+ ])
1505
+ ], 64)) : M("", !0),
1506
+ o.storeType === "github" ? (m(), p(N, { key: 1 }, [
1507
+ n("div", ko, [
1508
+ t[15] || (t[15] = n("label", null, [
1509
+ z("Display Name: "),
1510
+ n("span", { class: "required" }, "*")
1511
+ ], -1)),
1512
+ I(n("input", {
1513
+ "onUpdate:modelValue": t[3] || (t[3] = (r) => o.storeName = r),
1514
+ type: "text",
1515
+ placeholder: "e.g., My Custom Models",
1516
+ "data-testid": "store-name-input",
1517
+ required: ""
1518
+ }, null, 512), [
1519
+ [V, o.storeName]
1520
+ ])
1521
+ ]),
1522
+ n("div", Co, [
1523
+ t[16] || (t[16] = n("label", null, [
1524
+ z("Repository Owner: "),
1525
+ n("span", { class: "required" }, "*")
1526
+ ], -1)),
1527
+ I(n("input", {
1528
+ "onUpdate:modelValue": t[4] || (t[4] = (r) => o.owner = r),
1529
+ type: "text",
1530
+ placeholder: "e.g., trilogy-data",
1531
+ "data-testid": "github-owner-input",
1532
+ required: ""
1533
+ }, null, 512), [
1534
+ [V, o.owner]
1535
+ ])
1536
+ ]),
1537
+ n("div", wo, [
1538
+ t[17] || (t[17] = n("label", null, [
1539
+ z("Repository Name: "),
1540
+ n("span", { class: "required" }, "*")
1541
+ ], -1)),
1542
+ I(n("input", {
1543
+ "onUpdate:modelValue": t[5] || (t[5] = (r) => o.repo = r),
1544
+ type: "text",
1545
+ placeholder: "e.g., trilogy-public-models",
1546
+ "data-testid": "github-repo-input",
1547
+ required: ""
1548
+ }, null, 512), [
1549
+ [V, o.repo]
1550
+ ])
1551
+ ]),
1552
+ n("div", $o, [
1553
+ t[18] || (t[18] = n("label", null, [
1554
+ z("Branch: "),
1555
+ n("span", { class: "required" }, "*")
1556
+ ], -1)),
1557
+ I(n("input", {
1558
+ "onUpdate:modelValue": t[6] || (t[6] = (r) => o.branch = r),
1559
+ type: "text",
1560
+ placeholder: "e.g., main",
1561
+ "data-testid": "github-branch-input",
1562
+ required: ""
1563
+ }, null, 512), [
1564
+ [V, o.branch]
1565
+ ])
1566
+ ])
1567
+ ], 64)) : M("", !0),
1568
+ o.error ? (m(), p("div", Mo, j(o.error), 1)) : M("", !0),
1569
+ n("div", Do, [
1570
+ n("button", {
1571
+ type: "button",
1572
+ class: "cancel-btn",
1573
+ "data-testid": "add-store-cancel",
1574
+ onClick: t[7] || (t[7] = (r) => e.$emit("close"))
1575
+ }, " Cancel "),
1576
+ n("button", {
1577
+ type: "submit",
1578
+ class: "confirm-btn",
1579
+ "data-testid": "add-store-submit",
1580
+ disabled: l.loading
1581
+ }, j(l.loading ? "Adding..." : "Add Store"), 9, Io)
1582
+ ])
1583
+ ], 32)
1584
+ ]),
1585
+ _: 1
1586
+ }, 8, ["show"]);
1587
+ }
1588
+ const Ko = /* @__PURE__ */ H(fo, [["render", To], ["__scopeId", "data-v-55797388"]]), Lo = (e = {}, t = [], l = {}) => {
1589
+ const o = [];
1590
+ return t.forEach((d) => {
1591
+ const a = d.id, b = d.name, r = {
1592
+ owner: d.type === "github" ? d.owner : "",
1593
+ repo: d.type === "github" ? d.repo : "",
1594
+ branch: d.type === "github" ? d.branch : "main",
1595
+ displayName: b
1596
+ };
1597
+ if (o.push({
1598
+ type: "root",
1599
+ label: b,
1600
+ key: a,
1601
+ indent: 0,
1602
+ modelRoot: r,
1603
+ store: d
1604
+ }), !e[a]) {
1605
+ const c = l[a] || [], v = {};
1606
+ c.forEach((s) => {
1607
+ v[s.engine] || (v[s.engine] = []), v[s.engine].push(s);
1608
+ }), Object.keys(v).sort().forEach((s) => {
1609
+ const i = `${a}${L}${s}`;
1610
+ o.push({
1611
+ type: "engine",
1612
+ label: s,
1613
+ key: i,
1614
+ indent: 1,
1615
+ modelRoot: r,
1616
+ store: d
1617
+ }), e[i] || v[s].forEach((S) => {
1618
+ o.push({
1619
+ type: "model",
1620
+ label: S.name,
1621
+ key: `${i}${L}${S.name}`,
1622
+ indent: 2,
1623
+ model: S,
1624
+ modelRoot: r,
1625
+ store: d
1626
+ });
1627
+ });
1628
+ });
1629
+ }
1630
+ }), o;
1631
+ }, jo = ee({
1632
+ name: "CommunityModelList",
1633
+ setup() {
1634
+ const e = ce(), t = re(), l = K("editorStore"), o = K("connectionStore"), d = K("modelStore"), a = $({}), b = t.activeCommunityModelKey.value || "", r = (U) => {
1635
+ const f = U.split("+");
1636
+ if (f.length > 0 && (a.value[f[0]] = !1, f.length > 1)) {
1637
+ const F = `${f[0]}+${f[1]}`;
1638
+ a.value[F] = !1;
1639
+ }
1640
+ };
1641
+ for (const U of e.stores)
1642
+ a.value[U.id] = !0;
1643
+ b ? r(b) : e.stores.length > 0 && (a.value[e.stores[0].id] = !1);
1644
+ const c = async (U) => {
1645
+ try {
1646
+ await e.addStore(U), e.closeAddStoreModal();
1647
+ } catch (f) {
1648
+ console.error("Failed to add store:", f);
1649
+ }
1650
+ }, {
1651
+ isOpen: v,
1652
+ openConfirmation: s,
1653
+ closeConfirmation: i,
1654
+ confirm: S
1655
+ } = ue((U) => {
1656
+ U.type === "generic" && l && o && d && $e(U.id, l, o, d), e.removeStore(U.id);
1657
+ }), C = (U, f, F) => {
1658
+ t.openTab("community-models", U.name, f), console.log("Selected model:", U.name, "from root:", F);
1659
+ }, g = (U, f, F) => {
1660
+ t.openTab("community-models", null, f);
1661
+ }, A = (U, f, F) => {
1662
+ a.value[f] = !a.value[f];
1663
+ }, O = G(() => Lo(
1664
+ a.value,
1665
+ e.stores,
1666
+ e.filesByStore
1667
+ ));
1668
+ return le(async () => {
1669
+ await e.initialize();
1670
+ }), {
1671
+ communityStore: e,
1672
+ navigationStore: t,
1673
+ handleAddStoreSubmit: c,
1674
+ showDeleteStoreConfirmation: s,
1675
+ cancelDeleteStore: i,
1676
+ confirmDeleteStore: S,
1677
+ showDeleteConfirmationState: v,
1678
+ handleModelSelected: C,
1679
+ handleItemClick: g,
1680
+ handleItemToggle: A,
1681
+ collapsed: a,
1682
+ displayTree: O
1683
+ };
1684
+ },
1685
+ components: {
1686
+ SidebarList: se,
1687
+ CommunityModelListItem: yo,
1688
+ AddStoreModal: Ko,
1689
+ ConfirmDialog: me
1690
+ }
1691
+ }), Eo = { class: "community-header" }, Uo = { class: "community-header-actions" }, Ao = ["disabled"], Ro = ["disabled"], No = {
1692
+ key: 0,
1693
+ class: "error-container"
1694
+ }, Vo = { class: "error-text" }, Oo = ["onClick"];
1695
+ function Po(e, t, l, o, d, a) {
1696
+ const b = D("CommunityModelListItem"), r = D("AddStoreModal"), c = D("ConfirmDialog"), v = D("sidebar-list");
1697
+ return m(), E(v, { title: "Community Models" }, {
1698
+ header: w(() => [
1699
+ n("div", Eo, [
1700
+ t[5] || (t[5] = n("h3", { class: "font-sans sidebar-header" }, "Community Models", -1)),
1701
+ n("div", Uo, [
1702
+ n("button", {
1703
+ class: "sidebar-control-button sidebar-header-action",
1704
+ onClick: t[0] || (t[0] = (s) => e.communityStore.refreshData()),
1705
+ disabled: e.communityStore.loading
1706
+ }, [
1707
+ t[3] || (t[3] = n("i", { class: "mdi mdi-refresh" }, null, -1)),
1708
+ z(" " + j(e.communityStore.loading ? "Refreshing" : "Refresh"), 1)
1709
+ ], 8, Ao),
1710
+ n("button", {
1711
+ class: "sidebar-control-button sidebar-header-action",
1712
+ onClick: t[1] || (t[1] = (s) => e.communityStore.openAddStoreModal()),
1713
+ disabled: e.communityStore.loading
1714
+ }, [...t[4] || (t[4] = [
1715
+ n("i", { class: "mdi mdi-plus" }, null, -1),
1716
+ z(" Add Store ", -1)
1717
+ ])], 8, Ro)
1718
+ ])
1719
+ ])
1720
+ ]),
1721
+ actions: w(() => [...t[6] || (t[6] = [])]),
1722
+ default: w(() => [
1723
+ e.communityStore.hasErrors ? (m(), p("div", No, [
1724
+ (m(!0), p(N, null, _(e.communityStore.errorList, (s) => (m(), p("div", {
1725
+ key: s.root,
1726
+ class: "error-item"
1727
+ }, [
1728
+ n("span", Vo, j(s.name) + ": " + j(s.error), 1),
1729
+ n("button", {
1730
+ onClick: (i) => e.communityStore.clearStoreError(s.root),
1731
+ class: "clear-error"
1732
+ }, "×", 8, Oo)
1733
+ ]))), 128))
1734
+ ])) : M("", !0),
1735
+ (m(!0), p(N, null, _(e.displayTree, (s) => (m(), E(b, {
1736
+ key: s.key,
1737
+ item: s,
1738
+ "is-collapsed": e.collapsed[s.key],
1739
+ "active-model": e.navigationStore.activeCommunityModelKey.value,
1740
+ onItemClick: e.handleItemClick,
1741
+ onItemToggle: e.handleItemToggle,
1742
+ onModelSelected: e.handleModelSelected,
1743
+ onDeleteStore: e.showDeleteStoreConfirmation
1744
+ }, null, 8, ["item", "is-collapsed", "active-model", "onItemClick", "onItemToggle", "onModelSelected", "onDeleteStore"]))), 128)),
1745
+ T(r, {
1746
+ show: e.communityStore.showAddStoreModal,
1747
+ loading: e.communityStore.addingStore,
1748
+ onClose: t[2] || (t[2] = (s) => e.communityStore.closeAddStoreModal()),
1749
+ onAdd: e.handleAddStoreSubmit
1750
+ }, null, 8, ["show", "loading", "onAdd"]),
1751
+ T(c, {
1752
+ show: e.showDeleteConfirmationState,
1753
+ title: "Confirm Store Removal",
1754
+ message: "Are you sure you want to remove this store? This will not delete any imported models.",
1755
+ "confirm-label": "Remove",
1756
+ "cancel-test-id": "cancel-store-deletion",
1757
+ "confirm-test-id": "confirm-store-deletion",
1758
+ onClose: e.cancelDeleteStore,
1759
+ onConfirm: e.confirmDeleteStore
1760
+ }, null, 8, ["show", "onClose", "onConfirm"])
1761
+ ]),
1762
+ _: 1
1763
+ });
1764
+ }
1765
+ const Jo = /* @__PURE__ */ H(jo, [["render", Po], ["__scopeId", "data-v-fb890571"]]), Bo = ee({
1766
+ name: "Sidebar",
1767
+ props: {
1768
+ active: {
1769
+ type: String,
1770
+ default: W("screen")
1771
+ },
1772
+ activeEditor: {
1773
+ type: String,
1774
+ default: W("editor")
1775
+ },
1776
+ activeModelKey: {
1777
+ type: String,
1778
+ default: W("model")
1779
+ },
1780
+ activeDocumentationKey: {
1781
+ type: String,
1782
+ default: W("documentationKey")
1783
+ },
1784
+ activeConnectionKey: {
1785
+ type: String,
1786
+ default: W("connection")
1787
+ },
1788
+ activeJobsKey: {
1789
+ type: String,
1790
+ default: W("jobs")
1791
+ },
1792
+ activeLLMKey: {
1793
+ type: String,
1794
+ default: W("llm")
1795
+ },
1796
+ activeDashboardKey: {
1797
+ type: String,
1798
+ default: W("dashboard")
1799
+ },
1800
+ containerWidth: {
1801
+ type: Number,
1802
+ default: 200
1803
+ }
1804
+ },
1805
+ setup() {
1806
+ const e = $(!1), t = $(null);
1807
+ return {
1808
+ isSaving: e,
1809
+ previousUnSaved: t
1810
+ };
1811
+ },
1812
+ data() {
1813
+ let e = [
1814
+ {
1815
+ name: "dashboard",
1816
+ tooltip: "Chart",
1817
+ icon: "mdi mdi-chart-multiple",
1818
+ screen: "dashboard"
1819
+ },
1820
+ {
1821
+ name: "models",
1822
+ tooltip: "Model",
1823
+ icon: "mdi mdi-set-center",
1824
+ screen: "models"
1825
+ },
1826
+ {
1827
+ name: "community-models",
1828
+ tooltip: "Share & Explore",
1829
+ icon: "mdi mdi-library-outline",
1830
+ screen: "community-models"
1831
+ },
1832
+ {
1833
+ name: "jobs",
1834
+ tooltip: "Jobs",
1835
+ icon: "mdi mdi-playlist-play",
1836
+ screen: "jobs"
1837
+ },
1838
+ {
1839
+ name: "help",
1840
+ tooltip: "Help",
1841
+ icon: "mdi mdi-help",
1842
+ screen: "tutorial"
1843
+ }
1844
+ ], t = [
1845
+ {
1846
+ name: "edit",
1847
+ tooltip: "Query",
1848
+ icon: "mdi mdi-file-document-edit-outline",
1849
+ screen: "editors"
1850
+ },
1851
+ {
1852
+ name: "database",
1853
+ tooltip: "Connect",
1854
+ icon: "mdi mdi-database-outline",
1855
+ screen: "connections"
1856
+ },
1857
+ {
1858
+ name: "llm",
1859
+ tooltip: "AI",
1860
+ icon: "mdi mdi-creation-outline",
1861
+ screen: "llms"
1862
+ }
1863
+ // {
1864
+ // name: "Extensions",
1865
+ // iconClass: "fas fa-puzzle-piece",
1866
+ // component: "Extensions", // Replace with your actual component
1867
+ // },
1868
+ ], l = K("isMobile"), o = K("saveAll"), d = K("unSaved") || 0;
1869
+ if (!l || !o)
1870
+ throw new Error("isMobile is not provided");
1871
+ return {
1872
+ // index of the sidebarItem where the screen == active
1873
+ // selectedIndex: sideBarItems.findIndex((item) => item.screen === active) || 0,
1874
+ trilogyIcon: Ve,
1875
+ sidebarItems: t,
1876
+ sidebarFeatureItems: e,
1877
+ isMobile: l,
1878
+ unSaved: d,
1879
+ saveAll: o,
1880
+ notMobile: !l,
1881
+ contentCollapsed: !1
1882
+ };
1883
+ },
1884
+ components: {
1885
+ EditorList: Ne,
1886
+ ConnectionList: Je,
1887
+ Tooltip: oe,
1888
+ TutorialSidebar: ze,
1889
+ ModelSidebar: xe,
1890
+ JobsList: $t,
1891
+ LLMConnectionList: Pe,
1892
+ DashboardList: ao,
1893
+ CommunityModelList: Jo
1894
+ },
1895
+ watch: {
1896
+ contentCollapsed(e) {
1897
+ this.$emit("content-collapsed", e);
1898
+ },
1899
+ unSaved: {
1900
+ handler(e, t) {
1901
+ t > 0 && e === 0 && !this.isSaving && this.triggerSaveAnimation(), this.previousUnSaved = e;
1902
+ },
1903
+ immediate: !0
1904
+ }
1905
+ },
1906
+ methods: {
1907
+ triggerSaveAnimation() {
1908
+ this.isSaving = !0, setTimeout(() => {
1909
+ this.isSaving = !1;
1910
+ }, 500);
1911
+ },
1912
+ async handleSave() {
1913
+ this.isSaving = !0, await this.saveAll(), setTimeout(() => {
1914
+ this.isSaving = !1;
1915
+ }, 500);
1916
+ },
1917
+ selectItem(e) {
1918
+ if (this.isMobile) {
1919
+ this.$emit("screen-selected", e);
1920
+ return;
1921
+ }
1922
+ e === this.active ? this.contentCollapsed = !this.contentCollapsed : (this.contentCollapsed = !1, this.$emit("screen-selected", e));
1923
+ },
1924
+ toggleCollapse() {
1925
+ this.contentCollapsed = !this.contentCollapsed;
1926
+ },
1927
+ editorSelected(e) {
1928
+ this.$emit("editor-selected", e);
1929
+ },
1930
+ modelKeySelected(e) {
1931
+ this.$emit("model-key-selected", e);
1932
+ },
1933
+ documentationKeySelected(e) {
1934
+ this.$emit("documentation-key-selected", e);
1935
+ },
1936
+ jobsKeySelected(e) {
1937
+ this.$emit("jobs-key-selected", e);
1938
+ },
1939
+ connectionKeySelected(e) {
1940
+ this.$emit("connection-key-selected", e);
1941
+ },
1942
+ dashboardKeySelected(e) {
1943
+ this.$emit("dashboard-key-selected", e);
1944
+ },
1945
+ toggleMobileMenu() {
1946
+ this.$emit("toggle-mobile-menu");
1947
+ },
1948
+ llmKeySelected(e) {
1949
+ this.$emit("llm-key-selected", e);
1950
+ },
1951
+ llmOpenView(e, t, l) {
1952
+ this.$emit("llm-open-view", e, t, l);
1953
+ },
1954
+ createNewChat(e) {
1955
+ this.$emit("create-new-chat", e);
1956
+ },
1957
+ saveEditors() {
1958
+ this.$emit("save-editors");
1959
+ },
1960
+ saveDashboards() {
1961
+ this.$emit("save-dashboards");
1962
+ },
1963
+ openSettings() {
1964
+ console.log("Settings clicked");
1965
+ },
1966
+ openProfile() {
1967
+ console.log("Profile clicked");
1968
+ },
1969
+ getUrl(e) {
1970
+ const t = new URLSearchParams(window.location.search);
1971
+ return t.set("sidebarScreen", e), `#${t.toString()}`;
1972
+ }
1973
+ }
1974
+ }), Fo = { class: "sidebar-container" }, qo = {
1975
+ class: "sidebar-icons",
1976
+ "data-testid": "sidebar-icons"
1977
+ }, zo = { class: "trilogy-icon" }, Go = { class: "trilogy-icon-wrapper" }, Ho = ["src"], Wo = ["title"], _o = ["title"], Qo = {
1978
+ key: 1,
1979
+ class: "sidebar-divider"
1980
+ }, Xo = ["onClick", "data-testid"], Yo = ["onClick", "href", "data-testid"], Zo = ["data-testid"], xo = {
1981
+ key: 2,
1982
+ class: "sidebar-divider"
1983
+ }, en = ["onClick", "data-testid"], tn = ["onClick", "href", "data-testid"], on = ["data-testid"];
1984
+ function nn(e, t, l, o, d, a) {
1985
+ var A, O, U;
1986
+ const b = D("tooltip"), r = D("EditorList"), c = D("ConnectionList"), v = D("LLMConnectionList"), s = D("ModelSidebar"), i = D("JobsList"), S = D("TutorialSidebar"), C = D("DashboardList"), g = D("CommunityModelList");
1987
+ return m(), p("div", Fo, [
1988
+ n("div", qo, [
1989
+ n("div", zo, [
1990
+ n("div", Go, [
1991
+ T(b, {
1992
+ content: e.unSaved ? `Save ${e.unSaved} ${(((A = e.unSaved) == null ? void 0 : A.valueOf()) || 0) > 1 ? "changes" : "change"}` : "All changes saved!"
1993
+ }, {
1994
+ default: w(() => [
1995
+ n("img", {
1996
+ class: B(["trilogy-icon", { spinning: e.isSaving }]),
1997
+ onClick: t[0] || (t[0] = (...f) => e.handleSave && e.handleSave(...f)),
1998
+ src: e.trilogyIcon,
1999
+ "data-testid": "trilogy-icon"
2000
+ }, null, 10, Ho)
2001
+ ]),
2002
+ _: 1
2003
+ }, 8, ["content"]),
2004
+ (((O = e.unSaved) == null ? void 0 : O.valueOf()) || 0) > 0 ? (m(), p("div", {
2005
+ key: 0,
2006
+ class: "unsaved-badge",
2007
+ title: `${e.unSaved} unsaved ${(((U = e.unSaved) == null ? void 0 : U.valueOf()) || 0) > 1 ? "changes" : "change"}`
2008
+ }, j(e.unSaved), 9, Wo)) : M("", !0)
2009
+ ])
2010
+ ]),
2011
+ t[10] || (t[10] = n("div", { class: "trilogy-icon-padding" }, null, -1)),
2012
+ e.isMobile ? M("", !0) : (m(), p("div", {
2013
+ key: 0,
2014
+ class: "sidebar-collapse-btn",
2015
+ onClick: t[1] || (t[1] = (...f) => e.toggleCollapse && e.toggleCollapse(...f)),
2016
+ title: e.contentCollapsed ? "Expand sidebar" : "Collapse sidebar"
2017
+ }, [
2018
+ n("i", {
2019
+ class: B(e.contentCollapsed ? "mdi mdi-chevron-right" : "mdi mdi-chevron-left")
2020
+ }, null, 2)
2021
+ ], 8, _o)),
2022
+ e.isMobile ? M("", !0) : (m(), p("div", Qo)),
2023
+ (m(!0), p(N, null, _(e.sidebarItems, (f, F) => (m(), p("div", {
2024
+ key: f.name,
2025
+ class: B(["sidebar-icon", { selected: e.active == f.screen, "sidebar-icon-margin": !e.isMobile }]),
2026
+ onClick: (y) => e.selectItem(f.screen),
2027
+ "data-testid": `sidebar-icon-${f.screen}`
2028
+ }, [
2029
+ e.isMobile ? (m(), p(N, { key: 1 }, [
2030
+ n("i", {
2031
+ class: B(f.icon),
2032
+ "data-testid": `sidebar-link-${f.screen}`
2033
+ }, null, 10, Zo),
2034
+ n("div", null, j(f.tooltip), 1)
2035
+ ], 64)) : (m(), E(b, {
2036
+ key: 0,
2037
+ content: f.tooltip
2038
+ }, {
2039
+ default: w(() => [
2040
+ n("a", {
2041
+ onClick: Y((y) => e.selectItem(f.screen), ["prevent", "stop"]),
2042
+ href: e.getUrl(f.screen),
2043
+ target: "_blank",
2044
+ "data-testid": `sidebar-link-${f.screen}`
2045
+ }, [
2046
+ n("i", {
2047
+ class: B(f.icon)
2048
+ }, null, 2)
2049
+ ], 8, Yo)
2050
+ ]),
2051
+ _: 2
2052
+ }, 1032, ["content"]))
2053
+ ], 10, Xo))), 128)),
2054
+ e.isMobile ? M("", !0) : (m(), p("div", xo)),
2055
+ (m(!0), p(N, null, _(e.sidebarFeatureItems, (f, F) => (m(), p("div", {
2056
+ key: f.name,
2057
+ class: B(["sidebar-icon", { selected: e.active == f.screen, "sidebar-icon-margin": !e.isMobile }]),
2058
+ onClick: (y) => e.selectItem(f.screen),
2059
+ "data-testid": `sidebar-icon-${f.screen}`
2060
+ }, [
2061
+ e.isMobile ? (m(), p(N, { key: 1 }, [
2062
+ n("i", {
2063
+ class: B(f.icon),
2064
+ "data-testid": `sidebar-link-${f.screen}`
2065
+ }, null, 10, on),
2066
+ n("div", null, j(f.tooltip), 1)
2067
+ ], 64)) : (m(), E(b, {
2068
+ key: 0,
2069
+ content: f.tooltip
2070
+ }, {
2071
+ default: w(() => [
2072
+ n("a", {
2073
+ onClick: Y((y) => e.selectItem(f.screen), ["prevent", "stop"]),
2074
+ href: e.getUrl(f.screen),
2075
+ target: "_blank",
2076
+ "data-testid": `sidebar-link-${f.screen}`
2077
+ }, [
2078
+ n("i", {
2079
+ class: B(f.icon)
2080
+ }, null, 2)
2081
+ ], 8, tn)
2082
+ ]),
2083
+ _: 2
2084
+ }, 1032, ["content"]))
2085
+ ], 10, en))), 128)),
2086
+ n("div", {
2087
+ class: B(["sidebar-bottom-icons", { "sidebar-bottom-icons-mobile": e.isMobile }])
2088
+ }, [
2089
+ n("div", {
2090
+ class: B(["sidebar-icon", { selected: e.active == "settings", "sidebar-icon-margin": !e.isMobile }]),
2091
+ onClick: t[2] || (t[2] = (f) => e.selectItem("settings")),
2092
+ "data-testid": "sidebar-icon-settings"
2093
+ }, [
2094
+ e.isMobile ? (m(), p(N, { key: 1 }, [
2095
+ t[5] || (t[5] = n("i", { class: "mdi mdi-cog-outline" }, null, -1)),
2096
+ t[6] || (t[6] = n("div", null, "Settings", -1))
2097
+ ], 64)) : (m(), E(b, {
2098
+ key: 0,
2099
+ content: "Settings"
2100
+ }, {
2101
+ default: w(() => [...t[4] || (t[4] = [
2102
+ n("i", { class: "mdi mdi-cog-outline" }, null, -1)
2103
+ ])]),
2104
+ _: 1
2105
+ }))
2106
+ ], 2),
2107
+ n("div", {
2108
+ class: B(["sidebar-icon", { selected: e.active == "profile", "sidebar-icon-margin": !e.isMobile }]),
2109
+ "data-testid": "sidebar-icon-profile",
2110
+ onClick: t[3] || (t[3] = (f) => e.selectItem("profile"))
2111
+ }, [
2112
+ e.isMobile ? (m(), p(N, { key: 1 }, [
2113
+ t[8] || (t[8] = n("i", { class: "mdi mdi-account-outline" }, null, -1)),
2114
+ t[9] || (t[9] = n("div", null, "Profile", -1))
2115
+ ], 64)) : (m(), E(b, {
2116
+ key: 0,
2117
+ content: "Profile"
2118
+ }, {
2119
+ default: w(() => [...t[7] || (t[7] = [
2120
+ n("i", { class: "mdi mdi-account-outline" }, null, -1)
2121
+ ])]),
2122
+ _: 1
2123
+ }))
2124
+ ], 2)
2125
+ ], 2)
2126
+ ]),
2127
+ n("div", {
2128
+ class: B(["sidebar-content", { "sidebar-content-collapsed": e.contentCollapsed && !e.isMobile }]),
2129
+ style: Ke(e.contentCollapsed && !e.isMobile ? {} : { width: e.containerWidth - 40 + "px" })
2130
+ }, [
2131
+ I(T(r, {
2132
+ activeEditor: e.activeEditor,
2133
+ onEditorSelected: e.editorSelected,
2134
+ onSaveEditors: e.saveEditors
2135
+ }, null, 8, ["activeEditor", "onEditorSelected", "onSaveEditors"]), [
2136
+ [X, e.active === "editors"]
2137
+ ]),
2138
+ I(T(c, {
2139
+ onConnectionKeySelected: e.connectionKeySelected,
2140
+ onToggleMobileMenu: e.toggleMobileMenu,
2141
+ activeConnectionKey: e.activeConnectionKey
2142
+ }, null, 8, ["onConnectionKeySelected", "onToggleMobileMenu", "activeConnectionKey"]), [
2143
+ [X, e.active === "connections"]
2144
+ ]),
2145
+ I(T(v, {
2146
+ onLlmConnectionKeySelected: e.llmKeySelected,
2147
+ onLlmOpenView: e.llmOpenView,
2148
+ onCreateNewChat: e.createNewChat,
2149
+ activeLLMKey: e.activeLLMKey
2150
+ }, null, 8, ["onLlmConnectionKeySelected", "onLlmOpenView", "onCreateNewChat", "activeLLMKey"]), [
2151
+ [X, e.active === "llms"]
2152
+ ]),
2153
+ I(T(s, {
2154
+ onModelKeySelected: e.modelKeySelected,
2155
+ activeModelKey: e.activeModelKey
2156
+ }, null, 8, ["onModelKeySelected", "activeModelKey"]), [
2157
+ [X, e.active === "models"]
2158
+ ]),
2159
+ I(T(i, {
2160
+ onJobsKeySelected: e.jobsKeySelected,
2161
+ activeJobsKey: e.activeJobsKey
2162
+ }, null, 8, ["onJobsKeySelected", "activeJobsKey"]), [
2163
+ [X, e.active === "jobs"]
2164
+ ]),
2165
+ I(T(S, {
2166
+ onDocumentationKeySelected: e.documentationKeySelected,
2167
+ activeDocumentationKey: e.activeDocumentationKey
2168
+ }, null, 8, ["onDocumentationKeySelected", "activeDocumentationKey"]), [
2169
+ [X, e.active === "tutorial"]
2170
+ ]),
2171
+ I(T(C, {
2172
+ onDashboardKeySelected: e.dashboardKeySelected,
2173
+ onSaveEditors: e.saveDashboards,
2174
+ activeDashboardKey: e.activeDashboardKey,
2175
+ onToggleMobileMenu: e.toggleMobileMenu
2176
+ }, null, 8, ["onDashboardKeySelected", "onSaveEditors", "activeDashboardKey", "onToggleMobileMenu"]), [
2177
+ [X, e.active === "dashboard"]
2178
+ ]),
2179
+ I(T(g, null, null, 512), [
2180
+ [X, e.active === "community-models"]
2181
+ ])
2182
+ ], 6)
2183
+ ]);
2184
+ }
2185
+ const cn = /* @__PURE__ */ H(Bo, [["render", nn], ["__scopeId", "data-v-92bc4461"]]);
2186
+ export {
2187
+ cn as default
2188
+ };