graphdb-workbench 4.0.0-TR22 → 4.0.0-TR23

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 (144) hide show
  1. package/dist/17631.6268d8a2089a4eff7e3e.bundle.js +2 -0
  2. package/dist/17631.6268d8a2089a4eff7e3e.bundle.js.map +1 -0
  3. package/dist/{19057.73fe17753980f4fd2ff9.bundle.js → 19057.9ab70128b78b11fdcb2e.bundle.js} +3 -3
  4. package/dist/19057.9ab70128b78b11fdcb2e.bundle.js.map +1 -0
  5. package/dist/{24690.7972ccea98a83e4669af.bundle.js → 24690.c03623f8b37234af106d.bundle.js} +2 -2
  6. package/dist/24690.c03623f8b37234af106d.bundle.js.map +1 -0
  7. package/dist/54231.a271c2f8a5cf643b3fcf.bundle.js +2 -0
  8. package/dist/54231.a271c2f8a5cf643b3fcf.bundle.js.map +1 -0
  9. package/dist/61716.de882d8c0b90532a1f49.bundle.js +2 -0
  10. package/dist/61716.de882d8c0b90532a1f49.bundle.js.map +1 -0
  11. package/dist/{64709.c3b9f2f3008166dcb26e.bundle.js → 64709.04e167e6246f3e3bdc35.bundle.js} +2 -2
  12. package/dist/64709.04e167e6246f3e3bdc35.bundle.js.map +1 -0
  13. package/dist/{65677.6a74ebccd91d9dc446ba.bundle.js → 65677.a1b18a38dec90d966443.bundle.js} +2 -2
  14. package/dist/{65677.6a74ebccd91d9dc446ba.bundle.js.map → 65677.a1b18a38dec90d966443.bundle.js.map} +1 -1
  15. package/dist/{80933.3b1ed4fd7acf37b60a7c.bundle.js → 80933.a183925871db97b10840.bundle.js} +2 -2
  16. package/dist/80933.a183925871db97b10840.bundle.js.map +1 -0
  17. package/dist/{82917.5228319455133fb9095c.bundle.js → 82917.09510c97161cdf980234.bundle.js} +2 -2
  18. package/dist/{82917.5228319455133fb9095c.bundle.js.map → 82917.09510c97161cdf980234.bundle.js.map} +1 -1
  19. package/dist/{86099.7ef141174709f7916025.bundle.js → 86099.83bf9be6bd62e30a5f21.bundle.js} +2 -2
  20. package/dist/{86099.7ef141174709f7916025.bundle.js.map → 86099.83bf9be6bd62e30a5f21.bundle.js.map} +1 -1
  21. package/dist/assets/i18n/language-config.json +1 -1
  22. package/dist/index.html +8 -8
  23. package/dist/js/angular/clustermanagement/templates/cluster-configuration/cluster-configuration.html +1 -1
  24. package/dist/js/angular/clustermanagement/templates/cluster-configuration/multi-region.html +1 -1
  25. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  26. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  27. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  28. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  29. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  30. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  31. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +7 -7
  32. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  33. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  34. package/dist/js/angular/core/templates/core-errors.html +1 -1
  35. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  36. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  37. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  38. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  39. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  40. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  41. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  42. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  43. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  44. package/dist/js/angular/security/templates/user.html +2 -2
  45. package/dist/js/angular/security/templates/users.html +1 -1
  46. package/dist/js/angular/templates/repositorySize.html +1 -1
  47. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  48. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  49. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  50. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  51. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  52. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  53. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  54. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  55. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  56. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  57. package/dist/legacyWorkbench.dfda71780998d00155c3.js +3 -0
  58. package/dist/{legacyWorkbench.ea9a056c52acc8e36000.js.LICENSE.txt → legacyWorkbench.dfda71780998d00155c3.js.LICENSE.txt} +10 -15
  59. package/dist/legacyWorkbench.dfda71780998d00155c3.js.map +1 -0
  60. package/dist/license-checker-static.json +0 -14
  61. package/dist/license-checker.json +75 -63
  62. package/dist/pages/aclmanagement.html +1 -1
  63. package/dist/pages/autocomplete.html +1 -1
  64. package/dist/pages/choose-repository-type.html +1 -1
  65. package/dist/pages/cluster-management/clusterInfo.html +2 -2
  66. package/dist/pages/create-index.html +1 -1
  67. package/dist/pages/dependencies.html +1 -1
  68. package/dist/pages/domainRangeInfo.html +2 -2
  69. package/dist/pages/edit.html +1 -1
  70. package/dist/pages/explore.html +1 -1
  71. package/dist/pages/export.html +1 -1
  72. package/dist/pages/find.html +1 -1
  73. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  74. package/dist/pages/graphs-visualizations.html +7 -7
  75. package/dist/pages/guides.html +1 -1
  76. package/dist/pages/home.html +1 -1
  77. package/dist/pages/import.html +2 -2
  78. package/dist/pages/jdbc-create.html +1 -1
  79. package/dist/pages/jdbc.html +1 -1
  80. package/dist/pages/monitor/backup-and-restore.html +1 -1
  81. package/dist/pages/monitor/queries.html +1 -1
  82. package/dist/pages/monitor/resources.html +1 -1
  83. package/dist/pages/namespaces.html +2 -2
  84. package/dist/pages/plugins.html +1 -1
  85. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  86. package/dist/pages/rdfrank.html +2 -2
  87. package/dist/pages/repositories.html +1 -1
  88. package/dist/pages/repository.html +1 -1
  89. package/dist/pages/similarity-indexes.html +1 -1
  90. package/dist/pages/sparql-editor.html +1 -1
  91. package/dist/pages/sparql-template-create.html +1 -1
  92. package/dist/pages/sparql-templates.html +1 -1
  93. package/dist/pages/ux-test1.html +2 -2
  94. package/dist/pages/webapi.html +0 -3
  95. package/dist/res/swagger5/LICENSE +202 -0
  96. package/dist/res/swagger5/NOTICE +2 -0
  97. package/dist/res/swagger5/css/onto-theme.css +1 -1
  98. package/dist/res/swagger5/favicon-16x16.png +0 -0
  99. package/dist/res/swagger5/favicon-32x32.png +0 -0
  100. package/dist/res/swagger5/index.html +10 -11
  101. package/dist/res/swagger5/swagger-initializer.js +1 -1
  102. package/dist/res/swagger5/swagger-ui-bundle.js +1 -1
  103. package/dist/res/swagger5/swagger-ui-bundle.js.LICENSE.txt +131 -1
  104. package/dist/res/swagger5/swagger-ui.css +1 -1
  105. package/dist/res/swagger5/swagger-ui.css.map +1 -1
  106. package/package.json +4 -1
  107. package/dist/17631.b26df249b2885762a7be.bundle.js +0 -2
  108. package/dist/17631.b26df249b2885762a7be.bundle.js.map +0 -1
  109. package/dist/19057.73fe17753980f4fd2ff9.bundle.js.map +0 -1
  110. package/dist/24690.7972ccea98a83e4669af.bundle.js.map +0 -1
  111. package/dist/30513.b6ca0b93f726b09a3d5c.bundle.js +0 -1
  112. package/dist/34634.6da3e4beb406cec3ea9d.bundle.js +0 -1
  113. package/dist/46128.48f42544c37c1401e73c.bundle.js +0 -1
  114. package/dist/54231.2d67e3505a83fdae51c7.bundle.js +0 -2
  115. package/dist/54231.2d67e3505a83fdae51c7.bundle.js.map +0 -1
  116. package/dist/57222.526c8686283962c30c59.bundle.js +0 -1
  117. package/dist/61716.c5aa53159a0d73d4a8fe.bundle.js +0 -2
  118. package/dist/61716.c5aa53159a0d73d4a8fe.bundle.js.map +0 -1
  119. package/dist/64269.ce56d4605aaf4874e2e9.bundle.js +0 -2
  120. package/dist/64269.ce56d4605aaf4874e2e9.bundle.js.map +0 -1
  121. package/dist/64709.c3b9f2f3008166dcb26e.bundle.js.map +0 -1
  122. package/dist/77387.7c54c74f31e955cbf454.bundle.js +0 -1
  123. package/dist/80933.3b1ed4fd7acf37b60a7c.bundle.js.map +0 -1
  124. package/dist/86176.4f39335f05e6a6ac5b78.bundle.js +0 -1
  125. package/dist/92090.38b61e7ec51a9265b893.bundle.js +0 -2
  126. package/dist/92090.38b61e7ec51a9265b893.bundle.js.map +0 -1
  127. package/dist/css/lib/swagger-ui.min.css +0 -1
  128. package/dist/css/swagger.custom.css +0 -1
  129. package/dist/legacyWorkbench.ea9a056c52acc8e36000.js +0 -3
  130. package/dist/legacyWorkbench.ea9a056c52acc8e36000.js.map +0 -1
  131. package/dist/res/swagger5/README.md +0 -3
  132. package/dist/res/swagger5/oauth2-redirect.html +0 -79
  133. package/dist/res/swagger5/swagger-ui-es-bundle-core.js +0 -2
  134. package/dist/res/swagger5/swagger-ui-es-bundle-core.js.LICENSE.txt +0 -1
  135. package/dist/res/swagger5/swagger-ui-es-bundle-core.js.map +0 -1
  136. package/dist/res/swagger5/swagger-ui-es-bundle.js +0 -2
  137. package/dist/res/swagger5/swagger-ui-es-bundle.js.LICENSE.txt +0 -1
  138. package/dist/res/swagger5/swagger-ui-es-bundle.js.map +0 -1
  139. package/dist/res/swagger5/swagger-ui-standalone-preset.js +0 -2
  140. package/dist/res/swagger5/swagger-ui-standalone-preset.js.LICENSE.txt +0 -1
  141. package/dist/res/swagger5/swagger-ui-standalone-preset.js.map +0 -1
  142. package/dist/res/swagger5/swagger-ui.js +0 -1
  143. package/dist/res/swagger5/swagger-ui.js.map +0 -1
  144. /package/dist/{19057.73fe17753980f4fd2ff9.bundle.js.LICENSE.txt → 19057.9ab70128b78b11fdcb2e.bundle.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ export const __webpack_esm_id__=17631;export const __webpack_esm_ids__=[9297,17631,35197,57578,83427,93966];export const __webpack_esm_modules__={93966(){function e(e,t,n,a,o){e.externalIntegrationConfiguration=o.externalIntegrationConfiguration,e.difyExtension=o.difyExtensionUrl,e.queryMethods=o.queryMethodsUrl,e.agentId=o.agentId,e.agentName=o.agentName,e.close=()=>{t.dismiss({})},e.onCloseExternalIntegrationConfigurationModal=()=>{t.dismiss({})}}angular.module("graphdb.framework.ttyg.controllers.external-integration-configuration-modal",[]).controller("ExternalIntegrationConfigurationModalController",e),e.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},17631(e,t,n){var a=n(18786),o=n(22723),i=n(35197);function E(e,t,n,E,l){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:(E,r,s)=>{E.selectedAgent=void 0,E.selectedAgentsFilter=void 0,E.deletingAgent=void 0,E.onEditAgent=t=>{e.emit(i.I.EDIT_AGENT,t)},E.onExternalIntegration=e=>{l.open(e)},E.onCloneAgent=t=>{e.emit(i.I.CLONE_AGENT,t)},E.onDeleteAgent=E=>{const l=n.instant("ttyg.agent.delete_agent_modal.title"),r=(0,a.Gz)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:(0,o.escape)(E.name)}));t.openConfirmation(l,r,()=>e.emit(i.I.DELETE_AGENT,E))},E.onAgentsFilterChange=e=>{E.selectedAgentsFilter=e,E.selectedAgentsFilter&&E.agentList.filterByRepository(E.selectedAgentsFilter.key)};const d=()=>{const e=E.agentListFilterModel.find(e=>e.selected);E.selectedAgentsFilter=e||E.agentListFilterModel[0],E.onAgentsFilterChange(E.selectedAgentsFilter)},c=[];c.push(E.$watch("agentListFilterModel",d)),c.push(e.subscribe(i.I.DELETING_AGENT,e=>{E.deletingAgent=e})),c.push(e.onSelectedAgentChanged(e=>{E.selectedAgent=e})),E.$on("$destroy",()=>{c.forEach(e=>e())}),d()}}}n(83427),angular.module("graphdb.framework.ttyg.directives.agent-list",["graphdb.framework.ttyg.services.externalIntegrationModal"]).directive("agentList",E),E.$inject=["TTYGContextService","ModalService","$translate","$uibModal","ExternalIntegrationModalService"]},9297(e,t,n){n.d(t,{A1:()=>i,LE:()=>a,OJ:()=>o});const a=100,o="ALL",i={CREATE:"create",EDIT:"edit",CLONE:"clone"}},83427(e,t,n){n(93966);var a=n(9297);function o(e,t,n){return{open:function(o){return t.getExternalUrl().then(t=>{const n=function(e,t){return{agentName:e.name,agentId:e.id,queryMethodsUrl:`${t}/rest/llm/tool/ttyg/${e.id}`,difyExtensionUrl:`${t}/rest/llm/ttyg/${e.id}/dify`}}(o,t.data);return e.open({templateUrl:"js/angular/ttyg/templates/modal/external-integration-configuration-modal.html",controller:"ExternalIntegrationConfigurationModalController",windowClass:"external-integration-configuration-modal",backdrop:"static",resolve:{dialogModel:()=>n}}).result.then(()=>{}).catch(()=>{})}).catch(e=>{n.error(getError(e,0,a.LE))})}}}angular.module("graphdb.framework.ttyg.services.externalIntegrationModal",["graphdb.framework.ttyg.controllers.external-integration-configuration-modal"]).factory("ExternalIntegrationModalService",o),o.$inject=["$uibModal","LocationsRestService","toastr"]},35197(e,t,n){n.d(t,{I:()=>i});var a=n(22723);function o(e){let t,n,o,E,l,r={};const s=()=>(0,a.cloneDeep)(t),d=()=>(0,a.cloneDeep)(n),c=e=>{n=(0,a.cloneDeep)(e),u(i.CHAT_LIST_UPDATED,d())},g=e=>{n.appendChat(e),c(n)},C=()=>(0,a.cloneDeep)(o),A=e=>{o&&o.id===e.id||(o=(0,a.cloneDeep)(e),u(i.SELECT_CHAT,C()))},_=()=>(0,a.cloneDeep)(E),T=()=>(0,a.cloneDeep)(r),S=e=>!!r[e],u=(t,n)=>{e.emitSync(t,(0,a.cloneDeep)(n))},p=(t,n)=>e.subscribeSync(t,e=>n(e));return{resetContext:()=>{t=void 0,n=void 0,o=void 0,E=void 0,r={},l=void 0},emit:u,subscribe:p,getChats:d,updateChats:c,addChat:g,replaceChat:(e,t)=>{n.replaceChat(e,t),c(n)},createChat:e=>{g(e),A(e),u(i.CREATE_CHAT_SUCCESSFUL,e)},onChatsListChanged:e=>(n&&angular.isFunction(e)&&e(d()),p(i.CHAT_LIST_UPDATED,t=>e(t))),getSelectedChat:C,selectChat:A,deselectChat:()=>{o=void 0,u(i.SELECT_CHAT,C())},deleteChat:e=>{n.deleteChat(e),c(n)},onSelectedChatChanged:e=>(angular.isFunction(e)&&e(C()),p(i.SELECT_CHAT,t=>e(t))),updateSelectedChat:e=>{o&&o.id&&e&&o.id!==e.id||(o=(0,a.cloneDeep)(e),u(i.SELECTED_CHAT_UPDATED,C()))},onSelectedChatUpdated:e=>(o&&angular.isFunction(e)&&e(C()),p(i.SELECTED_CHAT_UPDATED,t=>e(t))),onLastMessageReceived:e=>(o&&angular.isFunction(e)&&e(C()),p(i.LAST_MESSAGE_RECEIVED,t=>e(t))),updateAgents:e=>{t=(0,a.cloneDeep)(e),u(i.AGENT_LIST_UPDATED,s())},onAgentsListChanged:e=>(t&&angular.isFunction(e)&&e(s()),p(i.AGENT_LIST_UPDATED,t=>e(t))),getAgents:s,getAgent:e=>{if(t)return(0,a.cloneDeep)(t.getAgent(e))},selectAgent:e=>{E=(0,a.cloneDeep)(e),u(i.AGENT_SELECTED,_())},getSelectedAgent:_,onSelectedAgentChanged:e=>(E&&angular.isFunction(e)&&e(_()),p(i.AGENT_SELECTED,t=>e(t))),getDefaultAgent:()=>(0,a.cloneDeep)(l),setDefaultAgent:e=>{l=e},hasExplainResponse:S,toggleExplainResponse:e=>{S(e)&&(r[e].expanded=!r[e].expanded,u(i.EXPLAIN_RESPONSE_CACHE_UPDATED,T()))},getExplainResponse:e=>(0,a.cloneDeep)(r[e]),addExplainResponseCache:e=>{r[e.answerId]=(0,a.cloneDeep)(e),u(i.EXPLAIN_RESPONSE_CACHE_UPDATED,T())},onExplainResponseCacheUpdated:e=>(angular.isFunction(e)&&e(T()),p(i.EXPLAIN_RESPONSE_CACHE_UPDATED,t=>e(t)))}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",o),o.$inject=["EventEmitterService","TTYGService"];const i={CREATE_CHAT:"createChat",CREATE_CHAT_SUCCESSFUL:"chatCreated",CREATE_CHAT_FAILURE:"chatCreationFailed",RENAME_CHAT:"renameChat",RENAME_CHAT_SUCCESSFUL:"chatRenamed",RENAME_CHAT_FAILURE:"chatRenamedFailure",SELECT_CHAT:"selectChat",SELECTED_CHAT_UPDATED:"selectChatUpdated",LAST_MESSAGE_RECEIVED:"lastMessageReceived",DELETING_CHAT:"deletingChat",DELETE_CHAT:"deleteChat",DELETE_CHAT_SUCCESSFUL:"chatDeleted",DELETE_CHAT_FAILURE:"chatDeletedFailure",CHAT_EXPORT:"chatExport",CHAT_EXPORT_SUCCESSFUL:"chatExportSuccess",CHAT_EXPORT_FAILURE:"chatExportFailure",CHAT_LIST_UPDATED:"chatListUpdated",ASK_QUESTION:"askQuestion",ASK_QUESTION_FAILURE:"askQuestionFailure",CONTINUE_CHAT_RUN:"continueChatRun",CANCEL_PENDING_QUESTION:"cancelPendingQuestion",PENDING_QUESTION_CANCELED_SUCCESSFUL:"pendingQuestionCanceledSuccessful",CANCEL_PENDING_QUESTION_FAILURE:"cancelPendingQuestionFailed",ASK_QUESTION_STARTING:"askQuestionStarting",LOAD_CHATS:"loadChats",LOAD_CHAT_SUCCESSFUL:"loadChatSuccess",LOAD_CHAT_FAILURE:"loadChatFailure",AGENT_LIST_UPDATED:"agentListUpdated",OPEN_AGENT_SETTINGS:"openAgentSettings",EDIT_AGENT:"editAgent",CLONE_AGENT:"cloneAgent",DELETE_AGENT:"deleteAgent",AGENT_DELETED:"agentDeleted",DELETING_AGENT:"deletingAgent",AGENT_SELECTED:"agentSelected",GO_TO_CREATE_SIMILARITY_VIEW:"goToCreateSimilarityView",GO_TO_CONNECTORS_VIEW:"goToConnectorsView",GO_TO_AUTOCOMPLETE_INDEX_VIEW:"goToAutocompleteIndexView",EXPLAIN_RESPONSE:"explainResponse",EXPLAIN_RESPONSE_CACHE_UPDATED:"explainResponseCacheUpdated",GO_TO_SPARQL_EDITOR:"openQueryInSparqlEditor",ASK_QUESTION_STATE_CHANGED:"askQuestionStateChanged"}}};
2
+ //# sourceMappingURL=17631.6268d8a2089a4eff7e3e.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"17631.6268d8a2089a4eff7e3e.bundle.js","mappings":"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","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/external-integration-configuration-modal.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/agent-list.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/constants.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/externalIntegrationModal.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-context.service.js"],"sourcesContent":["angular\n .module('graphdb.framework.ttyg.controllers.external-integration-configuration-modal', [])\n .controller('ExternalIntegrationConfigurationModalController', ExternalIntegrationConfigurationModalController);\n\nExternalIntegrationConfigurationModalController.$inject = [\n '$scope',\n '$uibModalInstance',\n 'ModalService',\n '$translate',\n 'dialogModel'\n];\n\nfunction ExternalIntegrationConfigurationModalController($scope, $uibModalInstance, ModalService, $translate, dialogModel) {\n // =========================\n // Public variables\n // =========================\n\n $scope.externalIntegrationConfiguration = dialogModel.externalIntegrationConfiguration;\n $scope.difyExtension = dialogModel.difyExtensionUrl;\n $scope.queryMethods = dialogModel.queryMethodsUrl;\n $scope.agentId = dialogModel.agentId;\n $scope.agentName = dialogModel.agentName;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Closes the modal when the user clicks the close button.\n */\n $scope.close = () => {\n $uibModalInstance.dismiss({});\n };\n\n $scope.onCloseExternalIntegrationConfigurationModal = () => {\n $uibModalInstance.dismiss({});\n };\n}\n","import {decodeHTML} from \"../../../../app\";\nimport {escape} from \"lodash\";\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport 'angular/ttyg/services/externalIntegrationModal.service';\n\nconst modules = [\n 'graphdb.framework.ttyg.services.externalIntegrationModal',\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.agent-list', modules)\n .directive('agentList', AgentListComponent);\n\nAgentListComponent.$inject = ['TTYGContextService', 'ModalService', '$translate', '$uibModal', 'ExternalIntegrationModalService'];\n\nfunction AgentListComponent(TTYGContextService, ModalService, $translate, $uibModal, ExternalIntegrationModalService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/agent-list.html',\n scope: {\n agentList: '=',\n agentListFilterModel: '=',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n\n /**\n * Selected agent.\n * @type {AgentModel|undefined}\n */\n $scope.selectedAgent = undefined;\n\n /**\n * The selected agents filter.\n * @type {{key: string, label: string}|undefined}\n */\n $scope.selectedAgentsFilter = undefined;\n\n /**\n * An event instance holding the agent to be deleted and if the progress is ongoing.\n * @type {agentId: string, inProgress: boolean}\n */\n $scope.deletingAgent = undefined;\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Triggers the agent edit process.\n * @param {AgentModel} agent\n */\n $scope.onEditAgent = (agent) => {\n TTYGContextService.emit(TTYGEventName.EDIT_AGENT, agent);\n };\n\n /**\n * Opens a modal to copy the external integration for a given agent.\n *\n * Used when the agent is already provided.\n *\n * @function\n * @param {AgentModel} agent - The agent for which to configure the integration.\n */\n $scope.onExternalIntegration = (agent) => {\n ExternalIntegrationModalService.open(agent);\n };\n\n /**\n * Triggers the agent clone process.\n * @param {AgentModel} agent\n */\n $scope.onCloneAgent = (agent) => {\n TTYGContextService.emit(TTYGEventName.CLONE_AGENT, agent);\n };\n\n /**\n * Triggers the agent delete process.\n * @param {AgentModel} agent\n */\n $scope.onDeleteAgent = (agent) => {\n const title = $translate.instant('ttyg.agent.delete_agent_modal.title');\n const confirmDeleteMessage = decodeHTML($translate.instant('ttyg.agent.delete_agent_modal.body', {agentName: escape(agent.name)}));\n ModalService.openConfirmation(title, confirmDeleteMessage, () => TTYGContextService.emit(TTYGEventName.DELETE_AGENT, agent));\n };\n\n /**\n * Filters the agents based on the selected repository.\n * @param {AgentListFilterModel} selectedFilter\n */\n $scope.onAgentsFilterChange = (selectedFilter) => {\n $scope.selectedAgentsFilter = selectedFilter;\n if ($scope.selectedAgentsFilter) {\n $scope.agentList.filterByRepository($scope.selectedAgentsFilter.key);\n }\n };\n\n // =========================\n // Private functions\n // =========================\n\n const updateSelectedAgentsFilter = () => {\n const selectedFilter = $scope.agentListFilterModel.find((filter) => filter.selected);\n $scope.selectedAgentsFilter = selectedFilter || $scope.agentListFilterModel[0];\n $scope.onAgentsFilterChange($scope.selectedAgentsFilter);\n };\n\n /**\n * Handles the progress of deletion of an agent.\n * @param {{agentId: string, inProgress: boolean}} event\n */\n const onDeletingAgent = (event) => {\n $scope.deletingAgent = event;\n };\n\n /**\n * Handles the selection of an agent.\n * @param {AgentModel} agent\n */\n const onSelectedAgentChanged = (agent) => {\n $scope.selectedAgent = agent;\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push($scope.$watch('agentListFilterModel', updateSelectedAgentsFilter));\n subscriptions.push(TTYGContextService.subscribe(TTYGEventName.DELETING_AGENT, onDeletingAgent));\n subscriptions.push(TTYGContextService.onSelectedAgentChanged(onSelectedAgentChanged));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n\n function initialize() {\n updateSelectedAgentsFilter();\n }\n initialize();\n },\n };\n}\n","/**\n * The length of the message to be cut and displayed to the user from the error\n * server's response.\n * @type {number}\n */\nexport const TTYG_ERROR_MSG_LENGTH = 100;\n\n/**\n * The key to use when filtering agents indicating that all agents should be shown.\n * @type {string}\n */\nexport const AGENTS_FILTER_ALL_KEY = 'ALL';\n\n/**\n * An enum with possible agent operations. This is used in the agent settings modal.\n */\nexport const AGENT_OPERATION = {\n CREATE: 'create',\n EDIT: 'edit',\n CLONE: 'clone'\n};\n","import 'angular/ttyg/controllers/external-integration-configuration-modal.controller';\nimport {TTYG_ERROR_MSG_LENGTH} from \"./constants\";\n\nangular\n .module('graphdb.framework.ttyg.services.externalIntegrationModal',\n ['graphdb.framework.ttyg.controllers.external-integration-configuration-modal'])\n .factory('ExternalIntegrationModalService', ExternalIntegrationModalService)\n\nExternalIntegrationModalService.$inject = ['$uibModal', 'LocationsRestService', 'toastr'];\n\nfunction ExternalIntegrationModalService($uibModal, LocationsRestService, toastr) {\n function buildDialogModel(agent, baseUrl) {\n return {\n agentName: agent.name,\n agentId: agent.id,\n queryMethodsUrl: `${baseUrl}/rest/llm/tool/ttyg/${agent.id}`,\n difyExtensionUrl: `${baseUrl}/rest/llm/ttyg/${agent.id}/dify`\n };\n }\n\n function open(agent) {\n return LocationsRestService.getExternalUrl()\n .then((response) => {\n const dialogModel = buildDialogModel(agent, response.data);\n\n return $uibModal.open({\n templateUrl: 'js/angular/ttyg/templates/modal/external-integration-configuration-modal.html',\n controller: 'ExternalIntegrationConfigurationModalController',\n windowClass: 'external-integration-configuration-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: () => dialogModel\n }\n }).result\n .then(() => {\n // Modal was closed with success - do nothing\n })\n .catch(() => {\n // Modal was dismissed — do nothing\n });\n })\n .catch((error) => {\n // Catches API failure\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n }\n\n return {open};\n}\n","import {cloneDeep} from 'lodash';\n\nangular\n .module('graphdb.framework.ttyg.services.ttygcontext', [])\n .factory('TTYGContextService', TTYGContextService);\n\nTTYGContextService.$inject = ['EventEmitterService', 'TTYGService'];\n\nfunction TTYGContextService(EventEmitterService) {\n /**\n * The list of agents.\n * @type {AgentListModel}\n * @private\n */\n let _agents = undefined;\n\n /**\n * The ChatsListModel.\n * @type {ChatsListModel}\n * @private\n */\n let _chats = undefined;\n\n /**\n * The currently selected in the UI chat which is used for conversation.\n * @type {ChatModel|undefined}\n * @private\n */\n let _selectedChat = undefined;\n\n /**\n * The currently selected in the UI agent which is used for conversation.\n * @type {AgentModel|undefined}\n * @private\n */\n let _selectedAgent = undefined;\n\n /**\n * Stores information about loaded explain responses.\n * The key is the answer ID, and the value is an instance of {@see ExplainResponseModel} that holds the explanation message.\n *\n * @type {{[key: string]: ExplainResponseModel}}\n */\n let _explainCache = {};\n\n /**\n * The default agent values.\n * @type {AgentModel|undefined}\n * @private\n */\n let _defaultAgent = undefined;\n\n const resetContext = () => {\n _agents = undefined;\n _chats = undefined;\n _selectedChat = undefined;\n _selectedAgent = undefined;\n _explainCache = {};\n _defaultAgent = undefined;\n };\n\n /**\n * @return {Promise<AgentModel>}\n */\n const getDefaultAgent = () => {\n return cloneDeep(_defaultAgent);\n };\n\n const setDefaultAgent = (agent) => {\n _defaultAgent = agent;\n };\n\n /**\n * @return {AgentListModel}\n */\n const getAgents = () => {\n return cloneDeep(_agents);\n };\n\n const getAgent = (agentId) => {\n if (_agents) {\n return cloneDeep(_agents.getAgent(agentId));\n }\n };\n\n /**\n * @return {ChatsListModel}\n */\n const getChats = () => {\n return cloneDeep(_chats);\n };\n\n /**\n * @param {ChatsListModel} chats\n */\n const updateChats = (chats) => {\n _chats = cloneDeep(chats);\n emit(TTYGEventName.CHAT_LIST_UPDATED, getChats());\n };\n\n /**\n * Deletes the chat with the provided <code>chatId</code>.\n * @param {ChatModel} chat\n */\n const deleteChat = (chat) => {\n _chats.deleteChat(chat);\n updateChats(_chats);\n };\n\n const addChat = (newChat) => {\n _chats.appendChat(newChat);\n updateChats(_chats);\n };\n\n const replaceChat = (newChat, oldChat) => {\n _chats.replaceChat(newChat, oldChat);\n updateChats(_chats);\n };\n\n const createChat = (newChat) => {\n addChat(newChat);\n selectChat(newChat);\n emit(TTYGEventName.CREATE_CHAT_SUCCESSFUL, newChat);\n };\n\n /** Subscribes to the 'chatListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onChatsListChanged = (callback) => {\n if (_chats && angular.isFunction(callback)) {\n callback(getChats());\n }\n return subscribe(TTYGEventName.CHAT_LIST_UPDATED, (chats) => callback(chats));\n };\n\n /**\n * @return {ChatModel}\n */\n const getSelectedChat = () => {\n return cloneDeep(_selectedChat);\n };\n\n /**\n * Updates the selected chat with the provided <code>selectedChat</code> and emits the 'selectChat' event\n * to notify listeners that a new chat has been selected.\n *\n * @param {ChatModel} selectedChat - The chat object to select.\n */\n const selectChat = (selectedChat) => {\n if (!_selectedChat || _selectedChat.id !== selectedChat.id) {\n _selectedChat = cloneDeep(selectedChat);\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n }\n };\n\n const deselectChat = () => {\n _selectedChat = undefined;\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n };\n\n /**\n * Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatChanged = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECT_CHAT, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the selected chat and emits the 'selectChatUpdated' event to notify listeners that a property\n * of the selected chat has changed.\n *\n * If the ID of the passed chat differs from the current selected chat, no action will occur.\n *\n * The selected chat can be updated through {@link TTYGContextService#selectChat}.\n *\n * @param {ChatModel} chat - The chat object that is being updated.\n */\n const updateSelectedChat = (chat) => {\n if (!_selectedChat || !_selectedChat.id || !chat || _selectedChat.id === chat.id) {\n _selectedChat = cloneDeep(chat);\n emit(TTYGEventName.SELECTED_CHAT_UPDATED, getSelectedChat());\n }\n };\n\n /** Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatUpdated = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECTED_CHAT_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /** Subscribes to the 'lastMessageReceived' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onLastMessageReceived = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.LAST_MESSAGE_RECEIVED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @param {AgentListModel} agents\n */\n const updateAgents = (agents) => {\n _agents = cloneDeep(agents);\n emit(TTYGEventName.AGENT_LIST_UPDATED, getAgents());\n };\n\n /**\n * Subscribes to the 'agentListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onAgentsListChanged = (callback) => {\n if (_agents && angular.isFunction(callback)) {\n callback(getAgents());\n }\n return subscribe(TTYGEventName.AGENT_LIST_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @return {AgentModel}\n */\n const getSelectedAgent = () => {\n return cloneDeep(_selectedAgent);\n };\n\n /**\n * Updates the selected agent with the provided <code>selectedAgent</code> and emits the 'agentSelected' event\n * to notify listeners that a new agent has been selected.\n *\n * @param {AgentModel} selectedAgent - The instance of selected agent.\n */\n const selectAgent = (selectedAgent) => {\n _selectedAgent = cloneDeep(selectedAgent);\n emit(TTYGEventName.AGENT_SELECTED, getSelectedAgent());\n };\n\n const _getExplainResponseCache = () => {\n return cloneDeep(_explainCache);\n };\n\n /**\n * Gets the explain response.\n * @param {string} answerId\n * @return {ExplainResponseModel}\n */\n const getExplainResponse = (answerId) => {\n return cloneDeep(_explainCache[answerId]);\n };\n\n /**\n * Adds the <code>explainResponse</code> into the explain response cache.\n *\n * @param {ExplainResponseModel} explainResponse\n */\n const addExplainResponseCache = (explainResponse) => {\n _explainCache[explainResponse.answerId] = cloneDeep(explainResponse);\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n };\n\n const hasExplainResponse = (answerId) => {\n return !!_explainCache[answerId];\n };\n\n const toggleExplainResponse = (answerId) => {\n if (hasExplainResponse(answerId)) {\n _explainCache[answerId].expanded = !_explainCache[answerId].expanded;\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n }\n };\n\n /**\n * Subscribes to the 'explainResponseCacheUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onExplainResponseCacheUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(_getExplainResponseCache());\n }\n return subscribe(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, (explainResponses) => callback(explainResponses));\n };\n\n /**\n * Subscribes to the 'agentSelected' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedAgentChanged = (callback) => {\n if (_selectedAgent && angular.isFunction(callback)) {\n callback(getSelectedAgent());\n }\n return subscribe(TTYGEventName.AGENT_SELECTED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Emits an event with a deep-cloned payload using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to emit. It must be a value from {@link TTYGEventName}.\n * @param {*} payload - The data to emit with the event. The payload is deep-cloned before emission.\n */\n const emit = (tTYGEventName, payload) => {\n EventEmitterService.emitSync(tTYGEventName, cloneDeep(payload));\n };\n\n /**\n * Subscribes to an event with the specified callback using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to subscribe to. It must be a value from {@link TTYGEventName}.\n * @param {function} callback - The function to call when the event is emitted.\n * @return {function} - Returns a function that can be called to unsubscribe from the event.\n */\n const subscribe = (tTYGEventName, callback) => {\n return EventEmitterService.subscribeSync(tTYGEventName, (payload) => callback(payload));\n };\n\n return {\n resetContext,\n emit,\n subscribe,\n // chats\n getChats,\n updateChats,\n addChat,\n replaceChat,\n createChat,\n onChatsListChanged,\n getSelectedChat,\n selectChat,\n deselectChat,\n deleteChat,\n onSelectedChatChanged,\n updateSelectedChat,\n onSelectedChatUpdated,\n onLastMessageReceived,\n // agents\n updateAgents,\n onAgentsListChanged,\n getAgents,\n getAgent,\n selectAgent,\n getSelectedAgent,\n onSelectedAgentChanged,\n getDefaultAgent,\n setDefaultAgent,\n // chat explain\n hasExplainResponse,\n toggleExplainResponse,\n getExplainResponse,\n addExplainResponseCache,\n onExplainResponseCacheUpdated,\n };\n}\n\nexport const TTYGEventName = {\n /**\n * Emitting the \"createChat\" event triggers a backend request to create a new chat.\n */\n CREATE_CHAT: 'createChat',\n\n /**\n * This event is emitted when a chat is successfully created.\n */\n CREATE_CHAT_SUCCESSFUL: 'chatCreated',\n\n /**\n * This event is emitted when the creation of a chat fails.\n */\n CREATE_CHAT_FAILURE: 'chatCreationFailed',\n\n RENAME_CHAT: 'renameChat',\n RENAME_CHAT_SUCCESSFUL: 'chatRenamed',\n RENAME_CHAT_FAILURE: 'chatRenamedFailure',\n\n /**\n * Emitting the \"selectChat\" event when the selected chat has been changed.\n */\n SELECT_CHAT: 'selectChat',\n\n /**\n * Emitting the \"selectChatUpdated\" event when the selected chat has been updated.\n */\n SELECTED_CHAT_UPDATED: 'selectChatUpdated',\n\n /**\n * Emitting the \"lastMessageReceived\" event when the final answer message has been received.\n */\n LAST_MESSAGE_RECEIVED: 'lastMessageReceived',\n\n /**\n * This event will be emitted when the chat delete request is in progress. The payload will contain the chat ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_CHAT: 'deletingChat',\n\n /**\n * This event will be emitted when the delete chat process is triggered but before the chat delete request is sent.\n */\n DELETE_CHAT: 'deleteChat',\n\n /**\n * This event will be emitted when the chat was successfully deleted.\n */\n DELETE_CHAT_SUCCESSFUL: 'chatDeleted',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n\n /**\n * This event is emitted when the deletion of a chat fails.\n */\n DELETE_CHAT_FAILURE: 'chatDeletedFailure',\n\n CHAT_EXPORT: 'chatExport',\n CHAT_EXPORT_SUCCESSFUL: 'chatExportSuccess',\n CHAT_EXPORT_FAILURE: 'chatExportFailure',\n CHAT_LIST_UPDATED: 'chatListUpdated',\n\n /**\n * Emitting the \"askQuestion\" event triggers a request to the backend to retrieve an answer to a question.\n */\n ASK_QUESTION: 'askQuestion',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n ASK_QUESTION_FAILURE: 'askQuestionFailure',\n\n /**\n * Emitting the \"continueChatRun\" event triggers a request to the backend to retrieve more remaining answers from the same chat run.\n */\n CONTINUE_CHAT_RUN: 'continueChatRun',\n\n /**\n * Emitting the \"cancelPendingQuestion\" event triggers the cancellation of a pending question in a chat.\n */\n CANCEL_PENDING_QUESTION: \"cancelPendingQuestion\",\n\n /**\n * This event is emitted when the cancellation of the pending question succeeds.\n */\n PENDING_QUESTION_CANCELED_SUCCESSFUL: \"pendingQuestionCanceledSuccessful\",\n\n /**\n * This event is emitted when the cancellation of the pending question fails.\n */\n CANCEL_PENDING_QUESTION_FAILURE: \"cancelPendingQuestionFailed\",\n\n /**\n * This event will be fired before a question is sent to BE for processing.\n */\n ASK_QUESTION_STARTING: \"askQuestionStarting\",\n\n /**\n * Emitting the \"loadChats\" event will trigger an action to loads all chats from backend server.\n */\n LOAD_CHATS: 'loadChats',\n LOAD_CHAT_SUCCESSFUL: 'loadChatSuccess',\n LOAD_CHAT_FAILURE: 'loadChatFailure',\n\n AGENT_LIST_UPDATED: 'agentListUpdated',\n\n /**\n * This event will be emitted when the create agent process is triggered through the UI but before the agent create\n * request is sent. This is used to open the agent settings dialog.\n */\n OPEN_AGENT_SETTINGS: 'openAgentSettings',\n\n /**\n * This event will be emitted when an agent needs to be edited.\n */\n EDIT_AGENT: 'editAgent',\n\n /**\n * This event will be emitted when an agent needs to be cloned.\n */\n CLONE_AGENT: 'cloneAgent',\n\n /**\n * This event will be emitted when the delete agent process is triggered but before the agent delete request is sent.\n */\n DELETE_AGENT: 'deleteAgent',\n\n /**\n * This event will be emitted when the agent was successfully deleted.\n */\n AGENT_DELETED: 'agentDeleted',\n\n /**\n * This event will be emitted when the agent delete request is in progress. The payload will contain the agent ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_AGENT: 'deletingAgent',\n\n /**\n * This event will be emitted when an agent is selected by the user through the UI.\n */\n AGENT_SELECTED: 'agentSelected',\n\n /**\n * This event will trigger the opening of the similarity view.\n */\n GO_TO_CREATE_SIMILARITY_VIEW: \"goToCreateSimilarityView\",\n\n /**\n * This event will trigger the opening of the connectors view.\n */\n GO_TO_CONNECTORS_VIEW: \"goToConnectorsView\",\n\n /**\n * This event will trigger the opening of the \"Autocomplete index\" view.\n */\n GO_TO_AUTOCOMPLETE_INDEX_VIEW: \"goToAutocompleteIndexView\",\n\n /**\n * This event will trigger fetching a new explanation of how the answer was generated.\n */\n EXPLAIN_RESPONSE: \"explainResponse\",\n\n /**\n * This event will be emitted when the cache with explain responses changed.\n */\n EXPLAIN_RESPONSE_CACHE_UPDATED: \"explainResponseCacheUpdated\",\n\n /**\n * This event will trigger the opening of the sparql view.\n */\n GO_TO_SPARQL_EDITOR: \"openQueryInSparqlEditor\",\n\n /**\n * This event will be emitted when there is a change in the state of the question being asked. (e.g., currently being sent)\n */\n ASK_QUESTION_STATE_CHANGED: \"askQuestionStateChanged\",\n};\n"],"names":["ExternalIntegrationConfigurationModalController","$scope","$uibModalInstance","ModalService","$translate","dialogModel","externalIntegrationConfiguration","difyExtension","difyExtensionUrl","queryMethods","queryMethodsUrl","agentId","agentName","close","dismiss","onCloseExternalIntegrationConfigurationModal","angular","module","controller","$inject","AgentListComponent","TTYGContextService","$uibModal","ExternalIntegrationModalService","restrict","templateUrl","scope","agentList","agentListFilterModel","link","element","attrs","selectedAgent","undefined","selectedAgentsFilter","deletingAgent","onEditAgent","agent","emit","TTYGEventName","EDIT_AGENT","onExternalIntegration","open","onCloneAgent","CLONE_AGENT","onDeleteAgent","title","instant","confirmDeleteMessage","decodeHTML","escape","name","openConfirmation","DELETE_AGENT","onAgentsFilterChange","selectedFilter","filterByRepository","key","updateSelectedAgentsFilter","find","filter","selected","subscriptions","push","$watch","subscribe","DELETING_AGENT","event","onSelectedAgentChanged","$on","removeAllSubscribers","forEach","subscription","directive","TTYG_ERROR_MSG_LENGTH","AGENTS_FILTER_ALL_KEY","AGENT_OPERATION","CREATE","EDIT","CLONE","LocationsRestService","toastr","getExternalUrl","then","response","baseUrl","id","buildDialogModel","data","windowClass","backdrop","resolve","result","catch","error","getError","factory","EventEmitterService","_agents","_chats","_selectedChat","_selectedAgent","_defaultAgent","_explainCache","getAgents","cloneDeep","getChats","updateChats","chats","CHAT_LIST_UPDATED","addChat","newChat","appendChat","getSelectedChat","selectChat","selectedChat","SELECT_CHAT","getSelectedAgent","_getExplainResponseCache","hasExplainResponse","answerId","tTYGEventName","payload","emitSync","callback","subscribeSync","resetContext","replaceChat","oldChat","createChat","CREATE_CHAT_SUCCESSFUL","onChatsListChanged","isFunction","deselectChat","deleteChat","chat","onSelectedChatChanged","updateSelectedChat","SELECTED_CHAT_UPDATED","onSelectedChatUpdated","onLastMessageReceived","LAST_MESSAGE_RECEIVED","updateAgents","agents","AGENT_LIST_UPDATED","onAgentsListChanged","getAgent","selectAgent","AGENT_SELECTED","getDefaultAgent","setDefaultAgent","toggleExplainResponse","expanded","EXPLAIN_RESPONSE_CACHE_UPDATED","getExplainResponse","addExplainResponseCache","explainResponse","onExplainResponseCacheUpdated","explainResponses","CREATE_CHAT","CREATE_CHAT_FAILURE","RENAME_CHAT","RENAME_CHAT_SUCCESSFUL","RENAME_CHAT_FAILURE","DELETING_CHAT","DELETE_CHAT","DELETE_CHAT_SUCCESSFUL","DELETE_CHAT_FAILURE","CHAT_EXPORT","CHAT_EXPORT_SUCCESSFUL","CHAT_EXPORT_FAILURE","ASK_QUESTION","ASK_QUESTION_FAILURE","CONTINUE_CHAT_RUN","CANCEL_PENDING_QUESTION","PENDING_QUESTION_CANCELED_SUCCESSFUL","CANCEL_PENDING_QUESTION_FAILURE","ASK_QUESTION_STARTING","LOAD_CHATS","LOAD_CHAT_SUCCESSFUL","LOAD_CHAT_FAILURE","OPEN_AGENT_SETTINGS","AGENT_DELETED","GO_TO_CREATE_SIMILARITY_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_AUTOCOMPLETE_INDEX_VIEW","EXPLAIN_RESPONSE","GO_TO_SPARQL_EDITOR","ASK_QUESTION_STATE_CHANGED"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
- /*! For license information please see 19057.73fe17753980f4fd2ff9.bundle.js.LICENSE.txt */
2
- export const __webpack_esm_id__=19057;export const __webpack_esm_ids__=[19057,34427,35700,40971,66583,69416,81821,90418];export const __webpack_esm_modules__={90418(){function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,n,a){const o=t.find("div"),i=()=>{e.ngDisabled||e.$apply(()=>{o.html().length&&!o.text().trim().length&&o.empty(),a.$setViewValue(o[0].innerText)})};a.$render=()=>{o.html(a.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return;n.deleteFromDocument();const a=n.getRangeAt(0),o=document.createDocumentFragment(),r=t.split("\n");r.forEach((e,t)=>{o.appendChild(document.createTextNode(e)),t<r.length-1&&o.appendChild(document.createElement("br"))}),a.insertNode(o),n.collapseToEnd(),i()};e.$on("$destroy",()=>{o.off("blur keyup change input",i),o.off("paste",r)}),o.on("blur keyup change input",i),o.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]},81821(){function e(e){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(t,n){t.editableModel={};const a=[];let o;t.onKeydown=e=>{"Enter"===e.key?(r(),t.editableModel.text!==t.text&&t.onSave({newText:t.editableModel.text,source:t.source})):"Escape"===e.key&&i()},t.onCancelEditing=()=>{i()},t.onSelect=()=>{o?(r(),t.onDblclick({source:t.source})):o=e(function(){t.onClick({source:t.source}),r()},250)};const i=()=>{r(),t.onCancel()},r=()=>{e.cancel(o),o=void 0};a.push(t.$watch("isEditing",a=>{a&&(t.editableModel.text=t.source[t.fieldName],e(()=>{const e=n.find("input")[0];e.focus(),e.select()},0))})),t.$on("$destroy",()=>{a.forEach(e=>e()),r()})}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",e),e.$inject=["$timeout"]},35700(e,t,n){n.d(t,{h:()=>a});const a={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},19057(e,t,n){n(61716),n(542),n(17631),n(83077),n(37949),n(66583),n(34427),n(79796),n(75384);var a=n(35197),o=(n(40971),n(9297)),i=n(12454),r=n(88881),s=n(32401),c=n(79069),l=n(46094),d=n(47775),g=n(69416),h=n(18786),m=n(35700),u=n(7809),p=n(16664),E=n(57154);function C(e,t,n,C,A,I,f,_,v,T,y,b,S,w,N){const L=(0,E.service)(E.AuthorizationService),R=[],O={filter_all:f.instant("ttyg.agent.btn.filter.all")};let k;C.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",C.isHelpVisible=!1,C.showChats=!0,C.showAgents=!1,C.chats=void 0,C.loadingChats=!1,C.loadingChat=!1,C.initialized=!1,C.agents=void 0,C.selectedAgent=void 0,C.loadingAgents=!1,C.reloadingAgents=!1,C.connectorID=void 0,C.canMaintainRepo=!1,C.agentListFilterModel=[],C.activeRepositoryList=[],C.onopen=C.onclose=()=>angular.noop(),C.startNewChat=()=>{w.getChats().containsNewChats()||w.deselectChat()},C.toggleChatsListSidebar=()=>{C.showChats=!C.showChats},C.toggleAgentsListSidebar=()=>{C.showAgents=!C.showAgents},C.onToggleHelp=()=>{C.isHelpVisible=!C.isHelpVisible},C.onExportSelectedChat=()=>{F(w.getSelectedChat())};const D=()=>{const e=w.getDefaultAgent();return e?Promise.resolve(e):S.getDefaultAgent().then(e=>(w.setDefaultAgent(e),e))};C.onOpenNewAgentSettings=()=>{D().then(e=>{const t=(0,l.Y)(v.getActiveRepositoryObject());e.repositoryId=t.id;const n=(0,s.qC)(new i.TI({}),e,o.A1.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(t,C.activeRepositoryList,n,o.A1.CREATE)}},size:"lg"}}).then(e=>{_.open(e).result.then(G)}).catch(e=>{T.error(getError(e,0,o.LE))})},C.onOpenAgentSettings=e=>{let t=e;t||(t=w.getSelectedAgent()),D().then(e=>{const n=(0,s.qC)(t,e,o.A1.EDIT),a=(0,l.Y)(v.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(a,C.activeRepositoryList,n,o.A1.EDIT)}},size:"lg"}}).then(e=>{_.open(e).result.then(e=>{const t=w.getSelectedAgent();t&&e.id===t.id&&w.selectAgent(e),G()})}).catch(e=>{T.error(getError(e,0,o.LE))})},C.onOpenCloneAgentSettings=e=>{D().then(t=>{const n=(0,s.qC)(e,t,o.A1.CLONE);n.name=`clone-${n.name}`;const a=(0,l.Y)(v.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(a,C.activeRepositoryList,n,o.A1.CLONE)}},size:"lg"}}).then(e=>{_.open(e).result.then(e=>{const t=w.getSelectedAgent();t&&e.id===t.id&&w.selectAgent(e),G()})}).catch(e=>{T.error(getError(e,0,o.LE))})};const U=()=>(C.loadingChats=!0,S.getConversations().then(e=>w.updateChats(e)).catch(e=>{T.error(getError(e,0,o.LE)),M(new r.Fe)}).finally(()=>{C.loadingChats=!1})),G=()=>(C.reloadingAgents=!0,S.getAgents().then(e=>w.updateAgents((0,s.hL)(e,L))).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{C.reloadingAgents=!1})),$=(e,t,n)=>{if(e.timestamp=n.timestamp,t.answers=t.answers||[],t.answers.push(...n.messages),w.updateSelectedChat(e),n.continueRunId)w.emit(a.I.CONTINUE_CHAT_RUN,new u.p(t,n.continueRunId));else{const t=w.getChats();t.updateChatTimestamp(e.id,n.timestamp),t.updateChatName(e.id,n.chatName),e.name=n.name,w.updateChats(t),w.emit(a.I.LAST_MESSAGE_RECEIVED,e)}},M=e=>{e.isEmpty()?C.showChats=!1:(C.showChats=!0,w.getSelectedChat()||N.getChatId()||w.selectChat(C.chats.getFirstChat()))},F=e=>{S.exportConversation(e.id).then(function({data:t,filename:n}){(0,d.saveAs)(t,n),w.emit(a.I.CHAT_EXPORT_SUCCESSFUL,e)}).catch(()=>{w.emit(a.I.CHAT_EXPORT_FAILURE),T.error(f.instant("ttyg.chat.messages.export_failure"))})},x=()=>{const e=v.getActiveRepository(),t=v.getLocalReadableGraphdbRepositories().map(t=>new i.x_(t.id,t.id,t.id===e));C.agentListFilterModel=[new i.x_(o.OJ,O.filter_all),...t]},H=(e,t,n)=>{if(e!==v.getActiveRepository()){const a=v.getRepository(e);a&&y.openConfirmationModal({title:f.instant("common.confirm"),message:(0,h.Gz)(f.instant(t,{repositoryId:a.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{v.setRepository(a),j(n)})}else j(n)},j=e=>{t.open(e,"_blank")},P=e=>{t.open(`sparql?query=${encodeURIComponent(e)}&execute=true`,"_blank")},Q=()=>{const e=N.getChatId(),t=w.getChats();e&&t?.getChat(e)&&w.selectChat(w.getChats().getChat(e))};function q(){C.activeRepositoryList=v.getLocalReadableGraphdbRepositories().filter(e=>L.canMaintainRepo(e)).map(e=>new c.rx({value:e.id,label:e.id,data:{repository:e}})),((e=!0)=>(C.loadingAgents=e,S.getAgents().then(e=>w.updateAgents((0,s.hL)(e,L))).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{C.loadingAgents=!1})))().then(()=>(C.initialized=!0,x(),U())).then(Q),C.canMaintainRepo=L.isAdminOrRepoManager()||L.isRepoMaintainer()}R.push(C.$watch(C.getActiveRepositoryObject,e=>{const t=(0,E.service)(E.AuthorizationService);e&&!t.hasGqlRights(e)&&q()}),w.onSelectedChatChanged(e=>{k=void 0,e&&!e.isNew()?S.getConversation(e.id).then(t=>{w.updateSelectedChat(t),N.saveChat(e)}).catch(t=>{t.status===m.h.NOT_FOUND&&((e=>{y.openModalAlert({title:f.instant("ttyg.chat.dialog.chat_is_missing.title"),message:f.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then(function(){w.deleteChat(e)})})(e),w.emit(a.I.LOAD_CHAT_FAILURE,e))}):e&&w.updateSelectedChat(e)}),w.onChatsListChanged(e=>{C.chats=e,M(e)}),w.subscribe(w.onAgentsListChanged(e=>{C.agents=e})),w.subscribe(a.I.CREATE_CHAT,e=>{S.createChat(e).then(t=>{const n=r.i.getNewChat();n.name="New chat",n.id=t,w.createChat(n),N.saveChat(n),e.chatId=t,w.emit(a.I.ASK_QUESTION,e)}).catch(t=>{w.emit(a.I.CREATE_CHAT_FAILURE,e.chatId),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.RENAME_CHAT,e=>{S.renameConversation(e).then(()=>{w.emit(a.I.RENAME_CHAT_SUCCESSFUL),w.emit(a.I.LOAD_CHATS)}).catch(()=>{w.emit(a.I.RENAME_CHAT_FAILURE),T.error(f.instant("ttyg.chat.messages.rename_failure"))})}),w.subscribe(a.I.DELETE_CHAT,e=>{w.emit(a.I.DELETING_CHAT,{chatId:e.id,inProgress:!0}),S.deleteConversation(e.id).then(()=>{w.emit(a.I.DELETE_CHAT_SUCCESSFUL,e);const t=w.getChats();t.deleteChat(e),w.updateChats(t)}).catch(()=>{w.emit(a.I.DELETE_CHAT_FAILURE),T.error(f.instant("ttyg.chat.messages.delete_failure"))}).finally(()=>w.emit(a.I.DELETING_CHAT,{chatId:e.id,inProgress:!1}))}),w.subscribe(a.I.CANCEL_PENDING_QUESTION,e=>{const t=e.chatId||w.getSelectedChat().id;k=S.cancelPendingQuestion(t).then(e=>(w.emit(a.I.PENDING_QUESTION_CANCELED_SUCCESSFUL),e)).catch(e=>(w.emit(a.I.CANCEL_PENDING_QUESTION_FAILURE),e))}),w.subscribe(a.I.CHAT_EXPORT,F),w.subscribe(a.I.ASK_QUESTION,e=>{w.emit(a.I.ASK_QUESTION_STARTING,e.chatId),k=void 0,S.askQuestion(e).then(t=>{const n=w.getSelectedChat();if(n&&n.id===e.chatId){if(n.isNew()){n.new=!1;const e=w.getChats();e.setChatAsOld(n.id),w.updateChats(e)}((e,t,n)=>{k?k.then(a=>{const o=w.getSelectedChat();o&&o.id!==t.chatId||(new p.Z({message:a.data.message,status:a.data.runStatus,isTerminalState:!0,tokenUsageInfo:n.tokenUsageInfo}).addToChatAnswer(n),e.chatHistory.appendItem(t),$(e,t,n))}):(e.chatHistory.appendItem(t),$(e,t,n))})(n,e,t)}w.emit(a.I.ASK_QUESTION_STATE_CHANGED,{isAsking:!1,chatId:e.chatId})}).catch(t=>{w.emit(a.I.ASK_QUESTION_FAILURE,e.chatId),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.CONTINUE_CHAT_RUN,e=>{S.continueChatRun(e).then(t=>{const n=e.chatId,a=w.getSelectedChat();if(a&&a.id===n){const e=a.chatHistory.items,n=e[e.length-1];$(a,n,t)}}).catch(t=>{w.emit(a.I.ASK_QUESTION_FAILURE,e.chatId),T.error(getError(t,0,o.LE)),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.LOAD_CHATS,U),w.subscribe(a.I.OPEN_AGENT_SETTINGS,C.onOpenNewAgentSettings),w.subscribe(a.I.EDIT_AGENT,C.onOpenAgentSettings),w.subscribe(a.I.CLONE_AGENT,C.onOpenCloneAgentSettings),w.subscribe(a.I.DELETE_AGENT,e=>{w.emit(a.I.DELETING_AGENT,{agentId:e.id,inProgress:!0}),S.deleteAgent(e.id).then(()=>G()).then(()=>{w.emit(a.I.AGENT_DELETED,e),C.selectedAgent&&C.selectedAgent.id===e.id&&(C.selectedAgent=void 0)}).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{w.emit(a.I.DELETING_AGENT,{agentId:e.id,inProgress:!1})})}),w.subscribe(a.I.AGENT_SELECTED,e=>{C.selectedAgent=e?(0,s.hb)(e,L):void 0}),w.subscribe(a.I.GO_TO_CREATE_SIMILARITY_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body","similarity/index/create")}),w.subscribe(a.I.GO_TO_AUTOCOMPLETE_INDEX_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_autocomplete_index.body","autocomplete")}),w.subscribe(a.I.GO_TO_CONNECTORS_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body","connectors")}),w.subscribe(a.I.GO_TO_SPARQL_EDITOR,e=>{if(e.repositoryId!==v.getActiveRepository()){const t=v.getRepository(e.repositoryId);t&&y.openConfirmation(f.instant("common.confirm"),(0,h.Gz)(f.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:e.repositoryId})),()=>{v.setRepository(t),P(e.query)})}else P(e.query)}),n.$on("$translateChangeSuccess",()=>{O.filter_all=f.instant("ttyg.agent.btn.filter.all"),x()})),C.$on("$destroy",function(){R.forEach(e=>e()),w.resetContext()})}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal","graphdb.framework.core.directives.help-info-popover"]).controller("TTYGViewCtrl",C),C.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},17631(e,t,n){var a=n(18786),o=n(35197);function i(e,t,n,i,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:(i,s,c)=>{i.selectedAgent=void 0,i.selectedAgentsFilter=void 0,i.deletingAgent=void 0,i.onEditAgent=t=>{e.emit(o.I.EDIT_AGENT,t)},i.onExternalIntegration=e=>{r.open(e)},i.onCloneAgent=t=>{e.emit(o.I.CLONE_AGENT,t)},i.onDeleteAgent=i=>{const r=n.instant("ttyg.agent.delete_agent_modal.title"),s=(0,a.Gz)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:i.name}));t.openConfirmation(r,s,()=>e.emit(o.I.DELETE_AGENT,i))},i.onAgentsFilterChange=e=>{i.selectedAgentsFilter=e,i.selectedAgentsFilter&&i.agentList.filterByRepository(i.selectedAgentsFilter.key)};const l=()=>{const e=i.agentListFilterModel.find(e=>e.selected);i.selectedAgentsFilter=e||i.agentListFilterModel[0],i.onAgentsFilterChange(i.selectedAgentsFilter)},d=[];d.push(i.$watch("agentListFilterModel",l)),d.push(e.subscribe(o.I.DELETING_AGENT,e=>{i.deletingAgent=e})),d.push(e.onSelectedAgentChanged(e=>{i.selectedAgent=e})),i.$on("$destroy",()=>{d.forEach(e=>e())}),l()}}}n(83427),angular.module("graphdb.framework.ttyg.directives.agent-list",["graphdb.framework.ttyg.services.externalIntegrationModal"]).directive("agentList",i),i.$inject=["TTYGContextService","ModalService","$translate","$uibModal","ExternalIntegrationModalService"]},83077(e,t,n){var a=n(79069),o=n(35197);function i(e,t,n,i,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:n=>{n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=(a,c)=>{if(!c.isCompatible)return a.stopPropagation(),void a.preventDefault();if(s(c),r.saveAgent(c),n.selectedAgent=c,e.selectAgent(c),c.isRepositoryDeleted&&c.canEditAgent){const n=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),a=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");i.openConfirmation(n,a,()=>e.emit(o.I.EDIT_AGENT,c))}};const s=e=>{n.agentOptionsList.forEach(t=>{t.selected=t.data.agent===e})},c=e=>{s(e),n.selectedAgent=e},l=[];l.push(e.onAgentsListChanged(t=>{var o;o=t,n.agentOptionsList=o.agents.map(e=>new a.rx({value:e.id,label:e.name,data:{agent:e}})),(()=>{let t;const a=r.getAgentId();a&&n.agentOptionsList.forEach(e=>{e.data.agent.id===a&&(t=e.data.agent)}),!t&&n.agentOptionsList[0]&&(t=n.agentOptionsList[0].data.agent),c(t),e.selectAgent(t)})()})),l.push(e.subscribe(o.I.AGENT_DELETED,t=>{n.selectedAgent&&n.selectedAgent.id===t.id&&(n.selectedAgent.isDeleted=!0,e.selectAgent(n.selectedAgent))})),l.push(e.onSelectedAgentChanged(c)),n.$on("$destroy",()=>{l.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",i),i.$inject=["TTYGContextService","$translate","$sce","ModalService","TTYGStorageService"]},61716(e,t,n){n(81821);var a=n(35197),o=n(23285),i=n(18786);function r(e,t,n,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:s=>{s.selectedChat=void 0,s.renamedChat=void 0,s.deletingChat=void 0,s.onSelectChatForRenaming=e=>{s.renamedChat=e},s.onSelectChat=t=>{if(!s.selectedChat||s.selectedChat.id!==t.id){const n=e.getChats().getNonPersistedChat();n&&e.deleteChat(n),e.selectChat(t),s.renamedChat=void 0}},s.onDeleteChat=o=>{const r=n.instant("ttyg.dialog.delete.title"),s=(0,i.Gz)(n.instant("ttyg.dialog.delete.body",{chatName:o.name}));t.openConfirmation(r,s,()=>e.emit(a.I.DELETE_CHAT,o))},s.onRenameChat=(t,n)=>{n.name=t,s.renamedChat=void 0,e.emit(a.I.RENAME_CHAT,n)},s.onExportChat=t=>{e.emit(a.I.CHAT_EXPORT,t)},s.onCancelChatRenaming=()=>{s.renamedChat=void 0},s.getHumanReadableChatGroupTimestamp=e=>(0,o.Q)(n,r,e);const c=e=>{s.selectedChat=e},l=[e.onSelectedChatChanged(c),e.onSelectedChatUpdated(c),e.onChatsListChanged(e=>{s.chatList=e}),e.subscribe(a.I.DELETING_CHAT,e=>{s.deletingChat=e}),e.subscribe(a.I.ASK_QUESTION_STATE_CHANGED,t=>{const n=e.getChats();n.setChatAsAsking(t.chatId,t.isAsking),e.updateChats(n)})];s.$on("$destroy",()=>{l.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",r),r.$inject=["TTYGContextService","ModalService","$translate","$filter"]},542(e,t,n){n(79119),n(90418);var a=n(35197),o=n(16664),i=n(94608),r=n(22723),s=n(18786);function c(e,t,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:(e,c,l)=>{e.chat=void 0,e.selectedAgent=void 0,e.chatItem=void 0,e.askingChatItem=void 0,e.waitingForLastMessage=!1,e.loadingChat=!0,e.showCancelButton=!1,e.ask=()=>{e.chatItem.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(e.chatItem),e.chatItem.chatId?g(e.chatItem):d(),e.chatItem=u(),E(),p()},e.cancelPendingQuestion=()=>{e.showCancelButton=!1,n.emit(a.I.CANCEL_PENDING_QUESTION,e.chatItem)},e.regenerateQuestion=t=>{const n=u();n.setQuestionMessage(t.getQuestionMessage()),n.question.timestamp=Date.now(),e.askingChatItem=n,g(n),E()},e.isAskDisabled=()=>!(e.chatItem.question.message&&e.selectedAgent&&!e.selectedAgent.isDeleted&&!e.waitingForLastMessage&&!e.loadingChat&&!e.askingChatItem),e.onKeypressOnInput=t=>{e.askingChatItem||"Enter"!==t.key||t.shiftKey||t.ctrlKey||e.isAskDisabled()||(t.preventDefault(),e.ask())},e.onAskHowDeliveredAnswer=()=>{const n=u();n.setQuestionMessage(t.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(n),g(n),E()},e.getAgentName=e=>{const a=n.getAgent(e);return a?a.name:(0,s.Gz)(t.instant("ttyg.chat_panel.deleted_agent"))};const d=()=>{n.emit(a.I.CREATE_CHAT,e.chatItem)},g=e=>{n.emit(a.I.ASK_QUESTION,e)},h=(t,o)=>{e.waitingForLastMessage=t,e.showCancelButton=t,n.emit(a.I.ASK_QUESTION_STATE_CHANGED,{isAsking:t,chatId:o})},m=t=>{e.chatItem=(0,r.cloneDeep)(e.askingChatItem),e.askingChatItem=void 0,h(!1,t)},u=()=>{const t=new i.T;return t.question=new o.Z({role:o.W.USER}),e.chat&&(t.chatId=e.chat.id),e.selectedAgent&&(t.agentId=e.selectedAgent.id),t},p=()=>{setTimeout(()=>{const e=document.querySelector(".question-input");e&&e.focus()})},E=()=>{setTimeout(()=>{const e=c.find(".chat-details")[0];e&&(e.scrollTop=e.scrollHeight)})},C=()=>{e.chat=void 0,e.loadingChat=!1,e.chatItem=u(),e.askingChatItem=void 0,h(!1),p()},A=[e.$watchCollection("chat.chatHistory.items",E),n.onSelectedChatUpdated(t=>{if(e.chat=t,!e.chat||e.chat.isNew())return;e.loadingChat=!1;const a=e.chatItem.question.message;if(e.chatItem=u(),e.chatItem.question.message=a,e.askingChatItem=void 0,e.chat){const t=e.chat.chatHistory.getLast();t&&t.agentId&&n.selectAgent(n.getAgent(t.agentId))}p()}),n.onLastMessageReceived(e=>{h(!1,e.chatId)}),n.onSelectedAgentChanged(t=>{e.selectedAgent=t,e.selectedAgent&&e.chatItem&&(e.chatItem.agentId=e.selectedAgent.id),p()}),n.onSelectedChatChanged(t=>{t?(e.loadingChat=!t.isNew(),e.chatItem=u(),h(!1,t.id),p()):C()}),n.subscribe(a.I.LOAD_CHAT_FAILURE,()=>{e.loadingChat=!1,e.chatItem=u(),p()}),n.subscribe(a.I.ASK_QUESTION_FAILURE,m),n.subscribe(a.I.CREATE_CHAT_FAILURE,m),n.subscribe(a.I.DELETE_CHAT_SUCCESSFUL,t=>{e.chat&&t.id===e.chat.id&&C()}),n.subscribe(a.I.ASK_QUESTION_STARTING,e=>{h(!0,e)})];e.$on("$destroy",()=>{A.forEach(e=>e())}),e.chatItem=u(),p()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail","graphdb.framework.core.directives.editable-content"]).directive("chatPanel",c),c.$inject=["toastr","$translate","TTYGContextService"]},34427(){angular.module("graphdb.framework.core.directives.help-info-popover",[]).directive("helpInfoPopover",function(){return{restrict:"E",scope:{helpInfo:"="},templateUrl:"js/angular/ttyg/templates/modal/helpInfoPopoverTemplate.html",link:function(e,t){e.isPopoverOpen=!1;const n=()=>{e.$apply(()=>{e.isPopoverOpen=!0})},a=()=>{e.$apply(()=>{e.isPopoverOpen=!1})};t.on("mouseenter",n),t.on("mouseleave",a),e.$on("$destroy",function(){t.off("mouseenter",n),t.off("mouseleave",a)})}}})},37949(e,t,n){var a=n(35197),o=n(57154);function i(e,t){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{canCreateAgent:"="},link:n=>{n.talkToGraphDocumentationLink=o.UriUtil.resolveDocumentationUrl(t.shortVersion,"talk-to-graph.html"),n.onCreateAgent=()=>{e.emit(a.I.OPEN_AGENT_SETTINGS)}}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",i),i.$inject=["TTYGContextService","productInfo"]},66583(){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",function(){return{link:function(e,t){setTimeout(function(){const n=t[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?t.attr("title",e.chat.name):t.removeAttr("title"))},0)}}})},69416(e,t,n){n.d(t,{k:()=>a});class a{constructor(e,t,n,a){this.activeRepositoryInfo=e,this.activeRepositoryList=t,this.agentFormModel=n,this.operation=a}}},40971(){function e(e,t){const n={agent:{id:void 0},chat:{id:void 0}},a=()=>{let a=e.get(t.TTYG);return a||(a=n),a.agent||(a.agent={}),a.chat||(a.chat={}),a};return{saveAgent:function(n){const o=a();o.agent.id=n?n.id:void 0,e.set(t.TTYG,o)},getAgentId:function(){const e=a();if(e.agent)return e.agent.id},saveChat:function(n){const o=a();o.chat.id=n?n.id:void 0,e.set(t.TTYG,o)},getChatId:function(){const e=a();if(e.chat)return e.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",e),e.$inject=["LocalStorageAdapter","LSKeys"]},47775(e,t,n){var a,o=o||function(e){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},a=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o=e.webkitRequestFileSystem,i=e.requestFileSystem||o||e.mozRequestFileSystem,r=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",c=0,l=function(t){var a=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?a():setTimeout(a,500)},d=function(e,t,n){for(var a=(t=[].concat(t)).length;a--;){var o=e["on"+t[a]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){r(e)}}},g=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},h=function(t,r){t=g(t);var h,m,u,p=this,E=t.type,C=!1,A=function(){d(p,"writestart progress write writeend".split(" "))},I=function(){!C&&h||(h=n().createObjectURL(t)),m?m.location.href=h:null==e.open(h,"_blank")&&"undefined"!=typeof safari&&(e.location.href=h),p.readyState=p.DONE,A(),l(h)},f=function(e){return function(){if(p.readyState!==p.DONE)return e.apply(this,arguments)}},_={create:!0,exclusive:!1};if(p.readyState=p.INIT,r||(r="download"),a)return h=n().createObjectURL(t),a.href=h,a.download=r,void setTimeout(function(){var e,t;e=a,t=new MouseEvent("click"),e.dispatchEvent(t),A(),l(h),p.readyState=p.DONE});e.chrome&&E&&E!==s&&(u=t.slice||t.webkitSlice,t=u.call(t,0,t.size,s),C=!0),o&&"download"!==r&&(r+=".download"),(E===s||o)&&(m=e),i?(c+=t.size,i(e.TEMPORARY,c,f(function(e){e.root.getDirectory("saved",_,f(function(e){var n=function(){e.getFile(r,_,f(function(e){e.createWriter(f(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),p.readyState=p.DONE,d(p,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&I()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=p["on"+e]}),n.write(t),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING}),I)}),I)};e.getFile(r,{create:!1},f(function(e){e.remove(),n()}),f(function(e){e.code===e.NOT_FOUND_ERR?n():I()}))}),I)}),I)):I()},m=h.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(g(e),t)}:(m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,function(e,t){return new h(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=o:null!==n.amdD&&null!=n.amdO&&(void 0===(a=function(){return o}.apply(t,[]))||(e.exports=a))}};
3
- //# sourceMappingURL=19057.73fe17753980f4fd2ff9.bundle.js.map
1
+ /*! For license information please see 19057.9ab70128b78b11fdcb2e.bundle.js.LICENSE.txt */
2
+ export const __webpack_esm_id__=19057;export const __webpack_esm_ids__=[19057,34427,35700,40971,66583,69416,81821,90418];export const __webpack_esm_modules__={90418(){function e(){return{restrict:"E",require:"ngModel",scope:{ngModel:"=",ngDisabled:"=",placeholder:"@"},templateUrl:"js/angular/core/templates/editable-content/editable-content.html",link:function(e,t,n,a){const o=t.find("div"),i=()=>{e.ngDisabled||e.$apply(()=>{o.html().length&&!o.text().trim().length&&o.empty(),a.$setViewValue(o[0].innerText)})};a.$render=()=>{o.html(a.$viewValue||"")};const r=e=>{e.preventDefault();const t=(e.originalEvent||e).clipboardData.getData("text/plain"),n=window.getSelection();if(!n.rangeCount)return;n.deleteFromDocument();const a=n.getRangeAt(0),o=document.createDocumentFragment(),r=t.split("\n");r.forEach((e,t)=>{o.appendChild(document.createTextNode(e)),t<r.length-1&&o.appendChild(document.createElement("br"))}),a.insertNode(o),n.collapseToEnd(),i()};e.$on("$destroy",()=>{o.off("blur keyup change input",i),o.off("paste",r)}),o.on("blur keyup change input",i),o.on("paste",r)}}}angular.module("graphdb.framework.core.directives.editable-content",[]).directive("editableContent",e),e.$inject=[]},81821(){function e(e){return{restrict:"E",scope:{fieldName:"@",source:"=",onSave:"&",onCancel:"&",onClick:"&",onDblclick:"&",isEditing:"="},templateUrl:"js/angular/core/directives/inline-editable-text/templates/inline-editable-text.template.html",link:function(t,n){t.editableModel={};const a=[];let o;t.onKeydown=e=>{"Enter"===e.key?(r(),t.editableModel.text!==t.text&&t.onSave({newText:t.editableModel.text,source:t.source})):"Escape"===e.key&&i()},t.onCancelEditing=()=>{i()},t.onSelect=()=>{o?(r(),t.onDblclick({source:t.source})):o=e(function(){t.onClick({source:t.source}),r()},250)};const i=()=>{r(),t.onCancel()},r=()=>{e.cancel(o),o=void 0};a.push(t.$watch("isEditing",a=>{a&&(t.editableModel.text=t.source[t.fieldName],e(()=>{const e=n.find("input")[0];e.focus(),e.select()},0))})),t.$on("$destroy",()=>{a.forEach(e=>e()),r()})}}}angular.module("graphdb.framework.core.directives.inline-editable-text",[]).directive("inlineEditableText",e),e.$inject=["$timeout"]},35700(e,t,n){n.d(t,{h:()=>a});const a={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,CONFLICT:409,INTERNAL_SERVER_ERROR:500,SERVICE_UNAVAILABLE:503}},19057(e,t,n){n(61716),n(542),n(17631),n(83077),n(37949),n(66583),n(34427),n(79796),n(75384);var a=n(35197),o=(n(40971),n(9297)),i=n(12454),r=n(88881),s=n(32401),c=n(79069),l=n(46094),d=n(47775),g=n(69416),h=n(18786),m=n(35700),u=n(7809),p=n(16664),E=n(57154);function C(e,t,n,C,A,I,f,_,v,T,y,b,S,w,N){const L=(0,E.service)(E.AuthorizationService),R=[],O={filter_all:f.instant("ttyg.agent.btn.filter.all")};let k;C.helpTemplateUrl="js/angular/ttyg/templates/chatInfo.html",C.isHelpVisible=!1,C.showChats=!0,C.showAgents=!1,C.chats=void 0,C.loadingChats=!1,C.loadingChat=!1,C.initialized=!1,C.agents=void 0,C.selectedAgent=void 0,C.loadingAgents=!1,C.reloadingAgents=!1,C.connectorID=void 0,C.canMaintainRepo=!1,C.agentListFilterModel=[],C.activeRepositoryList=[],C.onopen=C.onclose=()=>angular.noop(),C.startNewChat=()=>{w.getChats().containsNewChats()||w.deselectChat()},C.toggleChatsListSidebar=()=>{C.showChats=!C.showChats},C.toggleAgentsListSidebar=()=>{C.showAgents=!C.showAgents},C.onToggleHelp=()=>{C.isHelpVisible=!C.isHelpVisible},C.onExportSelectedChat=()=>{F(w.getSelectedChat())};const D=()=>{const e=w.getDefaultAgent();return e?Promise.resolve(e):S.getDefaultAgent().then(e=>(w.setDefaultAgent(e),e))};C.onOpenNewAgentSettings=()=>{D().then(e=>{const t=(0,l.Y)(v.getActiveRepositoryObject());e.repositoryId=t.id;const n=(0,s.qC)(new i.TI({}),e,o.A1.CREATE);return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(t,C.activeRepositoryList,n,o.A1.CREATE)}},size:"lg"}}).then(e=>{_.open(e).result.then(G)}).catch(e=>{T.error(getError(e,0,o.LE))})},C.onOpenAgentSettings=e=>{let t=e;t||(t=w.getSelectedAgent()),D().then(e=>{const n=(0,s.qC)(t,e,o.A1.EDIT),a=(0,l.Y)(v.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(a,C.activeRepositoryList,n,o.A1.EDIT)}},size:"lg"}}).then(e=>{_.open(e).result.then(e=>{const t=w.getSelectedAgent();t&&e.id===t.id&&w.selectAgent(e),G()})}).catch(e=>{T.error(getError(e,0,o.LE))})},C.onOpenCloneAgentSettings=e=>{D().then(t=>{const n=(0,s.qC)(e,t,o.A1.CLONE);n.name=`clone-${n.name}`;const a=(0,l.Y)(v.getActiveRepositoryObject());return{templateUrl:"js/angular/ttyg/templates/modal/agent-settings-modal.html",controller:"AgentSettingsModalController",windowClass:"agent-settings-modal",backdrop:"static",resolve:{dialogModel:function(){return new g.k(a,C.activeRepositoryList,n,o.A1.CLONE)}},size:"lg"}}).then(e=>{_.open(e).result.then(e=>{const t=w.getSelectedAgent();t&&e.id===t.id&&w.selectAgent(e),G()})}).catch(e=>{T.error(getError(e,0,o.LE))})};const U=()=>(C.loadingChats=!0,S.getConversations().then(e=>w.updateChats(e)).catch(e=>{T.error(getError(e,0,o.LE)),M(new r.Fe)}).finally(()=>{C.loadingChats=!1})),G=()=>(C.reloadingAgents=!0,S.getAgents().then(e=>w.updateAgents((0,s.hL)(e,L))).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{C.reloadingAgents=!1})),$=(e,t,n)=>{if(e.timestamp=n.timestamp,t.answers=t.answers||[],t.answers.push(...n.messages),w.updateSelectedChat(e),n.continueRunId)w.emit(a.I.CONTINUE_CHAT_RUN,new u.p(t,n.continueRunId));else{const t=w.getChats();t.updateChatTimestamp(e.id,n.timestamp),t.updateChatName(e.id,n.chatName),e.name=n.name,w.updateChats(t),w.emit(a.I.LAST_MESSAGE_RECEIVED,e)}},M=e=>{e.isEmpty()?C.showChats=!1:(C.showChats=!0,w.getSelectedChat()||N.getChatId()||w.selectChat(C.chats.getFirstChat()))},F=e=>{S.exportConversation(e.id).then(function({data:t,filename:n}){(0,d.saveAs)(t,n),w.emit(a.I.CHAT_EXPORT_SUCCESSFUL,e)}).catch(()=>{w.emit(a.I.CHAT_EXPORT_FAILURE),T.error(f.instant("ttyg.chat.messages.export_failure"))})},x=()=>{const e=v.getActiveRepository(),t=v.getLocalReadableGraphdbRepositories().map(t=>new i.x_(t.id,t.id,t.id===e));C.agentListFilterModel=[new i.x_(o.OJ,O.filter_all),...t]},H=(e,t,n)=>{if(e!==v.getActiveRepository()){const a=v.getRepository(e);a&&y.openConfirmationModal({title:f.instant("common.confirm"),message:(0,h.Gz)(f.instant(t,{repositoryId:a.id})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{v.setRepository(a),j(n)})}else j(n)},j=e=>{t.open(e,"_blank")},P=e=>{t.open(`sparql?query=${encodeURIComponent(e)}&execute=true`,"_blank")},Q=()=>{const e=N.getChatId(),t=w.getChats();e&&t?.getChat(e)&&w.selectChat(w.getChats().getChat(e))};function q(){C.activeRepositoryList=v.getLocalReadableGraphdbRepositories().filter(e=>L.canMaintainRepo(e)).map(e=>new c.rx({value:e.id,label:e.id,data:{repository:e}})),((e=!0)=>(C.loadingAgents=e,S.getAgents().then(e=>w.updateAgents((0,s.hL)(e,L))).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{C.loadingAgents=!1})))().then(()=>(C.initialized=!0,x(),U())).then(Q),C.canMaintainRepo=L.isAdminOrRepoManager()||L.isRepoMaintainer()}R.push(C.$watch(C.getActiveRepositoryObject,e=>{const t=(0,E.service)(E.AuthorizationService);e&&!t.hasGqlRights(e)&&q()}),w.onSelectedChatChanged(e=>{k=void 0,e&&!e.isNew()?S.getConversation(e.id).then(t=>{w.updateSelectedChat(t),N.saveChat(e)}).catch(t=>{t.status===m.h.NOT_FOUND&&((e=>{y.openModalAlert({title:f.instant("ttyg.chat.dialog.chat_is_missing.title"),message:f.instant("ttyg.chat.dialog.chat_is_missing.body")}).result.then(function(){w.deleteChat(e)})})(e),w.emit(a.I.LOAD_CHAT_FAILURE,e))}):e&&w.updateSelectedChat(e)}),w.onChatsListChanged(e=>{C.chats=e,M(e)}),w.subscribe(w.onAgentsListChanged(e=>{C.agents=e})),w.subscribe(a.I.CREATE_CHAT,e=>{S.createChat(e).then(t=>{const n=r.i.getNewChat();n.name="New chat",n.id=t,w.createChat(n),N.saveChat(n),e.chatId=t,w.emit(a.I.ASK_QUESTION,e)}).catch(t=>{w.emit(a.I.CREATE_CHAT_FAILURE,e.chatId),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.RENAME_CHAT,e=>{S.renameConversation(e).then(()=>{w.emit(a.I.RENAME_CHAT_SUCCESSFUL),w.emit(a.I.LOAD_CHATS)}).catch(()=>{w.emit(a.I.RENAME_CHAT_FAILURE),T.error(f.instant("ttyg.chat.messages.rename_failure"))})}),w.subscribe(a.I.DELETE_CHAT,e=>{w.emit(a.I.DELETING_CHAT,{chatId:e.id,inProgress:!0}),S.deleteConversation(e.id).then(()=>{w.emit(a.I.DELETE_CHAT_SUCCESSFUL,e);const t=w.getChats();t.deleteChat(e),w.updateChats(t)}).catch(()=>{w.emit(a.I.DELETE_CHAT_FAILURE),T.error(f.instant("ttyg.chat.messages.delete_failure"))}).finally(()=>w.emit(a.I.DELETING_CHAT,{chatId:e.id,inProgress:!1}))}),w.subscribe(a.I.CANCEL_PENDING_QUESTION,e=>{const t=e.chatId||w.getSelectedChat().id;k=S.cancelPendingQuestion(t).then(e=>(w.emit(a.I.PENDING_QUESTION_CANCELED_SUCCESSFUL),e)).catch(e=>(w.emit(a.I.CANCEL_PENDING_QUESTION_FAILURE),e))}),w.subscribe(a.I.CHAT_EXPORT,F),w.subscribe(a.I.ASK_QUESTION,e=>{w.emit(a.I.ASK_QUESTION_STARTING,e.chatId),k=void 0,S.askQuestion(e).then(t=>{const n=w.getSelectedChat();if(n&&n.id===e.chatId){if(n.isNew()){n.new=!1;const e=w.getChats();e.setChatAsOld(n.id),w.updateChats(e)}((e,t,n)=>{k?k.then(a=>{const o=w.getSelectedChat();o&&o.id!==t.chatId||(new p.Z({message:a.data.message,status:a.data.runStatus,isTerminalState:!0,tokenUsageInfo:n.tokenUsageInfo}).addToChatAnswer(n),e.chatHistory.appendItem(t),$(e,t,n))}):(e.chatHistory.appendItem(t),$(e,t,n))})(n,e,t)}w.emit(a.I.ASK_QUESTION_STATE_CHANGED,{isAsking:!1,chatId:e.chatId})}).catch(t=>{w.emit(a.I.ASK_QUESTION_FAILURE,e.chatId),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.CONTINUE_CHAT_RUN,e=>{S.continueChatRun(e).then(t=>{const n=e.chatId,a=w.getSelectedChat();if(a&&a.id===n){const e=a.chatHistory.items,n=e[e.length-1];$(a,n,t)}}).catch(t=>{w.emit(a.I.ASK_QUESTION_FAILURE,e.chatId),T.error(getError(t,0,o.LE)),T.error(getError(t,0,o.LE))})}),w.subscribe(a.I.LOAD_CHATS,U),w.subscribe(a.I.OPEN_AGENT_SETTINGS,C.onOpenNewAgentSettings),w.subscribe(a.I.EDIT_AGENT,C.onOpenAgentSettings),w.subscribe(a.I.CLONE_AGENT,C.onOpenCloneAgentSettings),w.subscribe(a.I.DELETE_AGENT,e=>{w.emit(a.I.DELETING_AGENT,{agentId:e.id,inProgress:!0}),S.deleteAgent(e.id).then(()=>G()).then(()=>{w.emit(a.I.AGENT_DELETED,e),C.selectedAgent&&C.selectedAgent.id===e.id&&(C.selectedAgent=void 0)}).catch(e=>{T.error(getError(e,0,o.LE))}).finally(()=>{w.emit(a.I.DELETING_AGENT,{agentId:e.id,inProgress:!1})})}),w.subscribe(a.I.AGENT_SELECTED,e=>{C.selectedAgent=e?(0,s.hb)(e,L):void 0}),w.subscribe(a.I.GO_TO_CREATE_SIMILARITY_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_similarity.body","similarity/index/create")}),w.subscribe(a.I.GO_TO_AUTOCOMPLETE_INDEX_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_autocomplete_index.body","autocomplete")}),w.subscribe(a.I.GO_TO_CONNECTORS_VIEW,e=>{H(e.repositoryId,"ttyg.agent.create_agent_modal.dialog.confirm_repository_change_before_open_connectors.body","connectors")}),w.subscribe(a.I.GO_TO_SPARQL_EDITOR,e=>{if(e.repositoryId!==v.getActiveRepository()){const t=v.getRepository(e.repositoryId);t&&y.openConfirmation(f.instant("common.confirm"),(0,h.Gz)(f.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:e.repositoryId})),()=>{v.setRepository(t),P(e.query)})}else P(e.query)}),n.$on("$translateChangeSuccess",()=>{O.filter_all=f.instant("ttyg.agent.btn.filter.all"),x()})),C.$on("$destroy",function(){R.forEach(e=>e()),w.resetContext()})}angular.module("graphdb.framework.ttyg.controllers.ttyg-view",["toastr","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.ttyg-service","graphdb.framework.ttyg.services.ttygcontext","graphdb.framework.ttyg.services.ttygstorage","graphdb.framework.ttyg.directives.chat-list","graphdb.framework.ttyg.directives.chat-panel","graphdb.framework.ttyg.directives.agent-list","graphdb.framework.ttyg.directives.agent-select-menu","graphdb.framework.ttyg.directives.no-agents-view","graphdb.framework.ttyg.directives.show-tooltip-on-overflow","graphdb.framework.ttyg.controllers.agent-settings-modal","graphdb.framework.core.directives.help-info-popover"]).controller("TTYGViewCtrl",C),C.$inject=["$jwtAuth","$window","$rootScope","$scope","$http","$timeout","$translate","$uibModal","$repositories","toastr","ModalService","LocalStorageAdapter","TTYGService","TTYGContextService","TTYGStorageService"]},17631(e,t,n){var a=n(18786),o=n(22723),i=n(35197);function r(e,t,n,r,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-list.html",scope:{agentList:"=",agentListFilterModel:"="},link:(r,c,l)=>{r.selectedAgent=void 0,r.selectedAgentsFilter=void 0,r.deletingAgent=void 0,r.onEditAgent=t=>{e.emit(i.I.EDIT_AGENT,t)},r.onExternalIntegration=e=>{s.open(e)},r.onCloneAgent=t=>{e.emit(i.I.CLONE_AGENT,t)},r.onDeleteAgent=r=>{const s=n.instant("ttyg.agent.delete_agent_modal.title"),c=(0,a.Gz)(n.instant("ttyg.agent.delete_agent_modal.body",{agentName:(0,o.escape)(r.name)}));t.openConfirmation(s,c,()=>e.emit(i.I.DELETE_AGENT,r))},r.onAgentsFilterChange=e=>{r.selectedAgentsFilter=e,r.selectedAgentsFilter&&r.agentList.filterByRepository(r.selectedAgentsFilter.key)};const d=()=>{const e=r.agentListFilterModel.find(e=>e.selected);r.selectedAgentsFilter=e||r.agentListFilterModel[0],r.onAgentsFilterChange(r.selectedAgentsFilter)},g=[];g.push(r.$watch("agentListFilterModel",d)),g.push(e.subscribe(i.I.DELETING_AGENT,e=>{r.deletingAgent=e})),g.push(e.onSelectedAgentChanged(e=>{r.selectedAgent=e})),r.$on("$destroy",()=>{g.forEach(e=>e())}),d()}}}n(83427),angular.module("graphdb.framework.ttyg.directives.agent-list",["graphdb.framework.ttyg.services.externalIntegrationModal"]).directive("agentList",r),r.$inject=["TTYGContextService","ModalService","$translate","$uibModal","ExternalIntegrationModalService"]},83077(e,t,n){var a=n(79069),o=n(35197);function i(e,t,n,i,r){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/agent-select-menu.html",scope:{},link:n=>{n.agentOptionsList=[],n.selectedAgent=void 0,n.onAgentSelected=(a,c)=>{if(!c.isCompatible)return a.stopPropagation(),void a.preventDefault();if(s(c),r.saveAgent(c),n.selectedAgent=c,e.selectAgent(c),c.isRepositoryDeleted&&c.canEditAgent){const n=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.title"),a=t.instant("ttyg.agent.agent_select_menu.configure_agent_modal.body");i.openConfirmation(n,a,()=>e.emit(o.I.EDIT_AGENT,c))}};const s=e=>{n.agentOptionsList.forEach(t=>{t.selected=t.data.agent===e})},c=e=>{s(e),n.selectedAgent=e},l=[];l.push(e.onAgentsListChanged(t=>{var o;o=t,n.agentOptionsList=o.agents.map(e=>new a.rx({value:e.id,label:e.name,data:{agent:e}})),(()=>{let t;const a=r.getAgentId();a&&n.agentOptionsList.forEach(e=>{e.data.agent.id===a&&(t=e.data.agent)}),!t&&n.agentOptionsList[0]&&(t=n.agentOptionsList[0].data.agent),c(t),e.selectAgent(t)})()})),l.push(e.subscribe(o.I.AGENT_DELETED,t=>{n.selectedAgent&&n.selectedAgent.id===t.id&&(n.selectedAgent.isDeleted=!0,e.selectAgent(n.selectedAgent))})),l.push(e.onSelectedAgentChanged(c)),n.$on("$destroy",()=>{l.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.agent-select-menu",[]).directive("agentSelectMenu",i),i.$inject=["TTYGContextService","$translate","$sce","ModalService","TTYGStorageService"]},61716(e,t,n){n(81821);var a=n(35197),o=n(23285),i=n(18786),r=n(22723);function s(e,t,n,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-list.html",link:c=>{c.selectedChat=void 0,c.renamedChat=void 0,c.deletingChat=void 0,c.onSelectChatForRenaming=e=>{c.renamedChat=e},c.onSelectChat=t=>{if(!c.selectedChat||c.selectedChat.id!==t.id){const n=e.getChats().getNonPersistedChat();n&&e.deleteChat(n),e.selectChat(t),c.renamedChat=void 0}},c.onDeleteChat=o=>{const s=n.instant("ttyg.dialog.delete.title"),c=(0,i.Gz)(n.instant("ttyg.dialog.delete.body",{chatName:(0,r.escape)(o.name)}));t.openConfirmation(s,c,()=>e.emit(a.I.DELETE_CHAT,o))},c.onRenameChat=(t,n)=>{n.name=t,c.renamedChat=void 0,e.emit(a.I.RENAME_CHAT,n)},c.onExportChat=t=>{e.emit(a.I.CHAT_EXPORT,t)},c.onCancelChatRenaming=()=>{c.renamedChat=void 0},c.getHumanReadableChatGroupTimestamp=e=>(0,o.Q)(n,s,e);const l=e=>{c.selectedChat=e},d=[e.onSelectedChatChanged(l),e.onSelectedChatUpdated(l),e.onChatsListChanged(e=>{c.chatList=e}),e.subscribe(a.I.DELETING_CHAT,e=>{c.deletingChat=e}),e.subscribe(a.I.ASK_QUESTION_STATE_CHANGED,t=>{const n=e.getChats();n.setChatAsAsking(t.chatId,t.isAsking),e.updateChats(n)})];c.$on("$destroy",()=>{d.forEach(e=>e())})}}}angular.module("graphdb.framework.ttyg.directives.chat-list",["graphdb.framework.core.directives.inline-editable-text"]).directive("chatList",s),s.$inject=["TTYGContextService","ModalService","$translate","$filter"]},542(e,t,n){n(79119),n(90418);var a=n(35197),o=n(16664),i=n(94608),r=n(22723),s=n(18786);function c(e,t,n){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-panel.html",link:(e,c,l)=>{e.chat=void 0,e.selectedAgent=void 0,e.chatItem=void 0,e.askingChatItem=void 0,e.waitingForLastMessage=!1,e.loadingChat=!0,e.showCancelButton=!1,e.ask=()=>{e.chatItem.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(e.chatItem),e.chatItem.chatId?g(e.chatItem):d(),e.chatItem=u(),E(),p()},e.cancelPendingQuestion=()=>{e.showCancelButton=!1,n.emit(a.I.CANCEL_PENDING_QUESTION,e.chatItem)},e.regenerateQuestion=t=>{const n=u();n.setQuestionMessage(t.getQuestionMessage()),n.question.timestamp=Date.now(),e.askingChatItem=n,g(n),E()},e.isAskDisabled=()=>!(e.chatItem.question.message&&e.selectedAgent&&!e.selectedAgent.isDeleted&&!e.waitingForLastMessage&&!e.loadingChat&&!e.askingChatItem),e.onKeypressOnInput=t=>{e.askingChatItem||"Enter"!==t.key||t.shiftKey||t.ctrlKey||e.isAskDisabled()||(t.preventDefault(),e.ask())},e.onAskHowDeliveredAnswer=()=>{const n=u();n.setQuestionMessage(t.instant("ttyg.chat_panel.btn.derive_answer.label")),n.question.timestamp=Date.now(),e.askingChatItem=(0,r.cloneDeep)(n),g(n),E()},e.getAgentName=e=>{const a=n.getAgent(e);return a?(0,r.escape)(a.name):(0,s.Gz)(t.instant("ttyg.chat_panel.deleted_agent"))};const d=()=>{n.emit(a.I.CREATE_CHAT,e.chatItem)},g=e=>{n.emit(a.I.ASK_QUESTION,e)},h=(t,o)=>{e.waitingForLastMessage=t,e.showCancelButton=t,n.emit(a.I.ASK_QUESTION_STATE_CHANGED,{isAsking:t,chatId:o})},m=t=>{e.chatItem=(0,r.cloneDeep)(e.askingChatItem),e.askingChatItem=void 0,h(!1,t)},u=()=>{const t=new i.T;return t.question=new o.Z({role:o.W.USER}),e.chat&&(t.chatId=e.chat.id),e.selectedAgent&&(t.agentId=e.selectedAgent.id),t},p=()=>{setTimeout(()=>{const e=document.querySelector(".question-input");e&&e.focus()})},E=()=>{setTimeout(()=>{const e=c.find(".chat-details")[0];e&&(e.scrollTop=e.scrollHeight)})},C=()=>{e.chat=void 0,e.loadingChat=!1,e.chatItem=u(),e.askingChatItem=void 0,h(!1),p()},A=[e.$watchCollection("chat.chatHistory.items",E),n.onSelectedChatUpdated(t=>{if(e.chat=t,!e.chat||e.chat.isNew())return;e.loadingChat=!1;const a=e.chatItem.question.message;if(e.chatItem=u(),e.chatItem.question.message=a,e.askingChatItem=void 0,e.chat){const t=e.chat.chatHistory.getLast();t&&t.agentId&&n.selectAgent(n.getAgent(t.agentId))}p()}),n.onLastMessageReceived(e=>{h(!1,e.chatId)}),n.onSelectedAgentChanged(t=>{e.selectedAgent=t,e.selectedAgent&&e.chatItem&&(e.chatItem.agentId=e.selectedAgent.id),p()}),n.onSelectedChatChanged(t=>{t?(e.loadingChat=!t.isNew(),e.chatItem=u(),h(!1,t.id),p()):C()}),n.subscribe(a.I.LOAD_CHAT_FAILURE,()=>{e.loadingChat=!1,e.chatItem=u(),p()}),n.subscribe(a.I.ASK_QUESTION_FAILURE,m),n.subscribe(a.I.CREATE_CHAT_FAILURE,m),n.subscribe(a.I.DELETE_CHAT_SUCCESSFUL,t=>{e.chat&&t.id===e.chat.id&&C()}),n.subscribe(a.I.ASK_QUESTION_STARTING,e=>{h(!0,e)})];e.$on("$destroy",()=>{A.forEach(e=>e())}),e.chatItem=u(),p()}}}angular.module("graphdb.framework.ttyg.directives.chat-panel",["graphdb.framework.ttyg.directives.chat-item-detail","graphdb.framework.core.directives.editable-content"]).directive("chatPanel",c),c.$inject=["toastr","$translate","TTYGContextService"]},34427(){angular.module("graphdb.framework.core.directives.help-info-popover",[]).directive("helpInfoPopover",function(){return{restrict:"E",scope:{helpInfo:"="},templateUrl:"js/angular/ttyg/templates/modal/helpInfoPopoverTemplate.html",link:function(e,t){e.isPopoverOpen=!1;const n=()=>{e.$apply(()=>{e.isPopoverOpen=!0})},a=()=>{e.$apply(()=>{e.isPopoverOpen=!1})};t.on("mouseenter",n),t.on("mouseleave",a),e.$on("$destroy",function(){t.off("mouseenter",n),t.off("mouseleave",a)})}}})},37949(e,t,n){var a=n(35197),o=n(57154);function i(e,t){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/no-agents-view.html",scope:{canCreateAgent:"="},link:n=>{n.talkToGraphDocumentationLink=o.UriUtil.resolveDocumentationUrl(t.shortVersion,"talk-to-graph.html"),n.onCreateAgent=()=>{e.emit(a.I.OPEN_AGENT_SETTINGS)}}}}angular.module("graphdb.framework.ttyg.directives.no-agents-view",[]).directive("noAgentsView",i),i.$inject=["TTYGContextService","productInfo"]},66583(){angular.module("graphdb.framework.ttyg.directives.show-tooltip-on-overflow",[]).directive("showTooltipOnOverflow",function(){return{link:function(e,t){setTimeout(function(){const n=t[0].querySelector(".editable-text-element");n&&(n.scrollWidth>n.clientWidth?t.attr("title",e.chat.name):t.removeAttr("title"))},0)}}})},69416(e,t,n){n.d(t,{k:()=>a});class a{constructor(e,t,n,a){this.activeRepositoryInfo=e,this.activeRepositoryList=t,this.agentFormModel=n,this.operation=a}}},40971(){function e(e,t){const n={agent:{id:void 0},chat:{id:void 0}},a=()=>{let a=e.get(t.TTYG);return a||(a=n),a.agent||(a.agent={}),a.chat||(a.chat={}),a};return{saveAgent:function(n){const o=a();o.agent.id=n?n.id:void 0,e.set(t.TTYG,o)},getAgentId:function(){const e=a();if(e.agent)return e.agent.id},saveChat:function(n){const o=a();o.chat.id=n?n.id:void 0,e.set(t.TTYG,o)},getChatId:function(){const e=a();if(e.chat)return e.chat.id}}}angular.module("graphdb.framework.ttyg.services.ttygstorage",[]).factory("TTYGStorageService",e),e.$inject=["LocalStorageAdapter","LSKeys"]},47775(e,t,n){var a,o=o||function(e){if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},a=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o=e.webkitRequestFileSystem,i=e.requestFileSystem||o||e.mozRequestFileSystem,r=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",c=0,l=function(t){var a=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?a():setTimeout(a,500)},d=function(e,t,n){for(var a=(t=[].concat(t)).length;a--;){var o=e["on"+t[a]];if("function"==typeof o)try{o.call(e,n||e)}catch(e){r(e)}}},g=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},h=function(t,r){t=g(t);var h,m,u,p=this,E=t.type,C=!1,A=function(){d(p,"writestart progress write writeend".split(" "))},I=function(){!C&&h||(h=n().createObjectURL(t)),m?m.location.href=h:null==e.open(h,"_blank")&&"undefined"!=typeof safari&&(e.location.href=h),p.readyState=p.DONE,A(),l(h)},f=function(e){return function(){if(p.readyState!==p.DONE)return e.apply(this,arguments)}},_={create:!0,exclusive:!1};if(p.readyState=p.INIT,r||(r="download"),a)return h=n().createObjectURL(t),a.href=h,a.download=r,void setTimeout(function(){var e,t;e=a,t=new MouseEvent("click"),e.dispatchEvent(t),A(),l(h),p.readyState=p.DONE});e.chrome&&E&&E!==s&&(u=t.slice||t.webkitSlice,t=u.call(t,0,t.size,s),C=!0),o&&"download"!==r&&(r+=".download"),(E===s||o)&&(m=e),i?(c+=t.size,i(e.TEMPORARY,c,f(function(e){e.root.getDirectory("saved",_,f(function(e){var n=function(){e.getFile(r,_,f(function(e){e.createWriter(f(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),p.readyState=p.DONE,d(p,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&I()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=p["on"+e]}),n.write(t),p.abort=function(){n.abort(),p.readyState=p.DONE},p.readyState=p.WRITING}),I)}),I)};e.getFile(r,{create:!1},f(function(e){e.remove(),n()}),f(function(e){e.code===e.NOT_FOUND_ERR?n():I()}))}),I)}),I)):I()},m=h.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(g(e),t)}:(m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,function(e,t){return new h(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=o:null!==n.amdD&&null!=n.amdO&&(void 0===(a=function(){return o}.apply(t,[]))||(e.exports=a))}};
3
+ //# sourceMappingURL=19057.9ab70128b78b11fdcb2e.bundle.js.map