graphdb-workbench 3.2.0-TR1 → 3.2.0-TR2

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 (345) hide show
  1. package/dist/10142.dae0223e0a1d85ad72fe.bundle.js +2 -0
  2. package/dist/10142.dae0223e0a1d85ad72fe.bundle.js.map +1 -0
  3. package/dist/{10376.e89fa63ff898d45f45fd.bundle.js → 10376.2723c52982b51c64bffb.bundle.js} +2 -2
  4. package/dist/10376.2723c52982b51c64bffb.bundle.js.map +1 -0
  5. package/dist/{12396.4c26c8da50c790b0f39a.bundle.js → 12396.9a7f2862146b6f9adcb1.bundle.js} +2 -2
  6. package/dist/{12396.4c26c8da50c790b0f39a.bundle.js.map → 12396.9a7f2862146b6f9adcb1.bundle.js.map} +1 -1
  7. package/dist/12940.7a45ae43d5f3ba6e7d83.bundle.js +2 -0
  8. package/dist/12940.7a45ae43d5f3ba6e7d83.bundle.js.map +1 -0
  9. package/dist/14824.a3bc164c5bf4313f5276.bundle.js +2 -0
  10. package/dist/14824.a3bc164c5bf4313f5276.bundle.js.map +1 -0
  11. package/dist/{15535.ce8d657c04f3401b9539.bundle.js → 15535.7b170e17ee0a58970ab6.bundle.js} +2 -2
  12. package/dist/{15535.ce8d657c04f3401b9539.bundle.js.map → 15535.7b170e17ee0a58970ab6.bundle.js.map} +1 -1
  13. package/dist/{16162.8f482628d1b34d41d496.bundle.js → 16162.67e7c1f5f313481b1e80.bundle.js} +2 -2
  14. package/dist/{16162.8f482628d1b34d41d496.bundle.js.map → 16162.67e7c1f5f313481b1e80.bundle.js.map} +1 -1
  15. package/dist/18961.5e34171366c281038fe5.bundle.js +2 -0
  16. package/dist/18961.5e34171366c281038fe5.bundle.js.map +1 -0
  17. package/dist/20227.a9333aa1320edea7264b.bundle.js +2 -0
  18. package/dist/20227.a9333aa1320edea7264b.bundle.js.map +1 -0
  19. package/dist/{20287.c42f9d1d913c36e46931.bundle.js → 20287.dd5bc263fe26adf34965.bundle.js} +2 -2
  20. package/dist/{20287.c42f9d1d913c36e46931.bundle.js.map → 20287.dd5bc263fe26adf34965.bundle.js.map} +1 -1
  21. package/dist/{21136.199caea09a1c9ad90393.bundle.js → 21136.b7efcb40fb956ff1109c.bundle.js} +2 -2
  22. package/dist/{21136.199caea09a1c9ad90393.bundle.js.map → 21136.b7efcb40fb956ff1109c.bundle.js.map} +1 -1
  23. package/dist/{21142.b690e00c8884fddb2bb3.bundle.js → 21142.ec45fad4d52b36961d17.bundle.js} +2 -2
  24. package/dist/{21142.b690e00c8884fddb2bb3.bundle.js.map → 21142.ec45fad4d52b36961d17.bundle.js.map} +1 -1
  25. package/dist/{21170.d5e3041241741d21080c.bundle.js → 21170.7832554eab9eaade6ffb.bundle.js} +2 -2
  26. package/dist/{21170.d5e3041241741d21080c.bundle.js.map → 21170.7832554eab9eaade6ffb.bundle.js.map} +1 -1
  27. package/dist/{21195.267abc9d42b711d0f17a.bundle.js → 21195.caae6cc33d755ad52df4.bundle.js} +2 -2
  28. package/dist/{21195.267abc9d42b711d0f17a.bundle.js.map → 21195.caae6cc33d755ad52df4.bundle.js.map} +1 -1
  29. package/dist/{25747.4e00941ec221c4d6ce8f.bundle.js → 25747.c01110e23b922cdd3d9e.bundle.js} +2 -2
  30. package/dist/{25747.4e00941ec221c4d6ce8f.bundle.js.map → 25747.c01110e23b922cdd3d9e.bundle.js.map} +1 -1
  31. package/dist/{27580.f71ebbc69dd1c7785ef3.bundle.js → 27580.5a421770ab66d2dedc37.bundle.js} +2 -2
  32. package/dist/{27580.f71ebbc69dd1c7785ef3.bundle.js.map → 27580.5a421770ab66d2dedc37.bundle.js.map} +1 -1
  33. package/dist/{28050.8ca1fa760c892bfc5466.bundle.js → 28050.6960a4a0961a07a94743.bundle.js} +2 -2
  34. package/dist/28050.6960a4a0961a07a94743.bundle.js.map +1 -0
  35. package/dist/{31636.e34ccc2d6f2dec577446.bundle.js → 31636.54e2817f8ae3998a34b3.bundle.js} +2 -2
  36. package/dist/{31636.e34ccc2d6f2dec577446.bundle.js.map → 31636.54e2817f8ae3998a34b3.bundle.js.map} +1 -1
  37. package/dist/{32489.97fac2c3daa49b143d13.bundle.js → 32489.f7a2dc39cd61c2cd8874.bundle.js} +2 -2
  38. package/dist/{32489.97fac2c3daa49b143d13.bundle.js.map → 32489.f7a2dc39cd61c2cd8874.bundle.js.map} +1 -1
  39. package/dist/33524.79f7e98ef89a46d4aa58.bundle.js +2 -0
  40. package/dist/33524.79f7e98ef89a46d4aa58.bundle.js.map +1 -0
  41. package/dist/{34495.cfa15bda8009fa37c6ff.bundle.js → 34495.be67c06c39909114bbe4.bundle.js} +2 -2
  42. package/dist/{34495.cfa15bda8009fa37c6ff.bundle.js.map → 34495.be67c06c39909114bbe4.bundle.js.map} +1 -1
  43. package/dist/{38360.0a90e77042876c86b279.bundle.js → 38360.efec913bb97c3b8588a4.bundle.js} +2 -2
  44. package/dist/{38360.0a90e77042876c86b279.bundle.js.map → 38360.efec913bb97c3b8588a4.bundle.js.map} +1 -1
  45. package/dist/{38644.3a0954c798ec413a3810.bundle.js → 38644.800252af49cd67310834.bundle.js} +2 -2
  46. package/dist/{38644.3a0954c798ec413a3810.bundle.js.map → 38644.800252af49cd67310834.bundle.js.map} +1 -1
  47. package/dist/{38843.5ef7a063337524ce3bb2.bundle.js → 38843.29e34a5e5293cee51566.bundle.js} +2 -2
  48. package/dist/{38843.5ef7a063337524ce3bb2.bundle.js.map → 38843.29e34a5e5293cee51566.bundle.js.map} +1 -1
  49. package/dist/{39518.4199684f3273d29d9105.bundle.js → 39518.0ca97879b92271d7c5e2.bundle.js} +2 -2
  50. package/dist/{39518.4199684f3273d29d9105.bundle.js.map → 39518.0ca97879b92271d7c5e2.bundle.js.map} +1 -1
  51. package/dist/{39539.c23e4878044d73f2505b.bundle.js → 39539.7cea6717cc3a5ba91617.bundle.js} +2 -2
  52. package/dist/{39539.c23e4878044d73f2505b.bundle.js.map → 39539.7cea6717cc3a5ba91617.bundle.js.map} +1 -1
  53. package/dist/{41453.8bb4c783da2c5077a6e9.bundle.js → 41453.4ae219d972a187c36bfc.bundle.js} +2 -2
  54. package/dist/{41453.8bb4c783da2c5077a6e9.bundle.js.map → 41453.4ae219d972a187c36bfc.bundle.js.map} +1 -1
  55. package/dist/41621.624ba3d867bc05b5c3cc.bundle.js +2 -0
  56. package/dist/41621.624ba3d867bc05b5c3cc.bundle.js.map +1 -0
  57. package/dist/{42129.f44b7b20f9cd376c6e59.bundle.js → 42129.0314e45b4b818b01b71f.bundle.js} +2 -2
  58. package/dist/{42129.f44b7b20f9cd376c6e59.bundle.js.map → 42129.0314e45b4b818b01b71f.bundle.js.map} +1 -1
  59. package/dist/{44444.ad66c8256bc5b653de1a.bundle.js → 44444.02026ff20e2a843dc05b.bundle.js} +2 -2
  60. package/dist/{44444.ad66c8256bc5b653de1a.bundle.js.map → 44444.02026ff20e2a843dc05b.bundle.js.map} +1 -1
  61. package/dist/45069.82993bf600a550fac275.bundle.js +2 -0
  62. package/dist/45069.82993bf600a550fac275.bundle.js.map +1 -0
  63. package/dist/{456.6118cb99d130f4c0410c.bundle.js → 456.634597f220a97bfbeab8.bundle.js} +2 -2
  64. package/dist/456.634597f220a97bfbeab8.bundle.js.map +1 -0
  65. package/dist/45758.9ffd8e7d5f99e2c394a2.bundle.js +2 -0
  66. package/dist/45758.9ffd8e7d5f99e2c394a2.bundle.js.map +1 -0
  67. package/dist/{52264.99261393a7f6e631da3b.bundle.js → 52264.4cf2f1a18d16484f0af1.bundle.js} +2 -2
  68. package/dist/52264.4cf2f1a18d16484f0af1.bundle.js.map +1 -0
  69. package/dist/54419.aec242a64c27ceda6e02.bundle.js +2 -0
  70. package/dist/54419.aec242a64c27ceda6e02.bundle.js.map +1 -0
  71. package/dist/5470.58e107e4c61ae7c22d48.bundle.js +2 -0
  72. package/dist/5470.58e107e4c61ae7c22d48.bundle.js.map +1 -0
  73. package/dist/{55862.1fb5abd075ba11a7e93c.bundle.js → 55862.5e8602827fbf72e60cc2.bundle.js} +2 -2
  74. package/dist/{55862.1fb5abd075ba11a7e93c.bundle.js.map → 55862.5e8602827fbf72e60cc2.bundle.js.map} +1 -1
  75. package/dist/{58306.ba9545cbaee021ebcbce.bundle.js → 58306.94b9336f68d11bdd72f0.bundle.js} +2 -2
  76. package/dist/{58306.ba9545cbaee021ebcbce.bundle.js.map → 58306.94b9336f68d11bdd72f0.bundle.js.map} +1 -1
  77. package/dist/58334.8a2bdb0560e0ce23f792.bundle.js +2 -0
  78. package/dist/58334.8a2bdb0560e0ce23f792.bundle.js.map +1 -0
  79. package/dist/60560.2ef51d3e2d9674450419.bundle.js +2 -0
  80. package/dist/60560.2ef51d3e2d9674450419.bundle.js.map +1 -0
  81. package/dist/64118.fb6952c8ef6fc9117f35.bundle.js +2 -0
  82. package/dist/64118.fb6952c8ef6fc9117f35.bundle.js.map +1 -0
  83. package/dist/66014.d9f7b86d6829ebfe9d0e.bundle.js +2 -0
  84. package/dist/66014.d9f7b86d6829ebfe9d0e.bundle.js.map +1 -0
  85. package/dist/{67888.7d4966e0a22ba655f1b8.bundle.js → 67888.772326168aed83cbad9c.bundle.js} +2 -2
  86. package/dist/67888.772326168aed83cbad9c.bundle.js.map +1 -0
  87. package/dist/69724.56df2d5b2ba312cb8118.bundle.js +2 -0
  88. package/dist/69724.56df2d5b2ba312cb8118.bundle.js.map +1 -0
  89. package/dist/{72379.bac50d0011665a85b6cd.bundle.js → 72379.8a3290df05f18f8c65bd.bundle.js} +2 -2
  90. package/dist/{72379.bac50d0011665a85b6cd.bundle.js.map → 72379.8a3290df05f18f8c65bd.bundle.js.map} +1 -1
  91. package/dist/{73667.3dd4f377e7ef54fd8758.bundle.js → 73667.52fdbdadddafe9e9559b.bundle.js} +2 -2
  92. package/dist/{73667.3dd4f377e7ef54fd8758.bundle.js.map → 73667.52fdbdadddafe9e9559b.bundle.js.map} +1 -1
  93. package/dist/{73793.6d80d47c26ed60a587fd.bundle.js → 73793.7e812bab1754ddd5efb5.bundle.js} +2 -2
  94. package/dist/{73793.6d80d47c26ed60a587fd.bundle.js.map → 73793.7e812bab1754ddd5efb5.bundle.js.map} +1 -1
  95. package/dist/{75282.88819e851ed18720b275.bundle.js → 75282.2f97d3a7d7f3fdd7aebf.bundle.js} +2 -2
  96. package/dist/{75282.88819e851ed18720b275.bundle.js.map → 75282.2f97d3a7d7f3fdd7aebf.bundle.js.map} +1 -1
  97. package/dist/{75849.51ade15bf0074eab76f3.bundle.js → 75849.bd0bdefa903741034a71.bundle.js} +2 -2
  98. package/dist/{75849.51ade15bf0074eab76f3.bundle.js.map → 75849.bd0bdefa903741034a71.bundle.js.map} +1 -1
  99. package/dist/77143.e0cb9ab61d798d7b5e0b.bundle.js +2 -0
  100. package/dist/77143.e0cb9ab61d798d7b5e0b.bundle.js.map +1 -0
  101. package/dist/78070.21b221881c2b49603eb9.bundle.js +2 -0
  102. package/dist/78070.21b221881c2b49603eb9.bundle.js.map +1 -0
  103. package/dist/{78250.6db42146a120459280e4.bundle.js → 78250.73e3013c5b2ebdddbf38.bundle.js} +2 -2
  104. package/dist/{78250.6db42146a120459280e4.bundle.js.map → 78250.73e3013c5b2ebdddbf38.bundle.js.map} +1 -1
  105. package/dist/78681.7b1c9100e03c2346550a.bundle.js +2 -0
  106. package/dist/78681.7b1c9100e03c2346550a.bundle.js.map +1 -0
  107. package/dist/{79329.5a5cbfa466d1c62af915.bundle.js → 79329.3d912887ba7e96090fb4.bundle.js} +2 -2
  108. package/dist/{79329.5a5cbfa466d1c62af915.bundle.js.map → 79329.3d912887ba7e96090fb4.bundle.js.map} +1 -1
  109. package/dist/81837.a989b5e255a0ce6176b2.bundle.js +2 -0
  110. package/dist/81837.a989b5e255a0ce6176b2.bundle.js.map +1 -0
  111. package/dist/82206.fd868720394b9dc2adac.bundle.js +2 -0
  112. package/dist/82206.fd868720394b9dc2adac.bundle.js.map +1 -0
  113. package/dist/82293.5e41c8378272aabf99f6.bundle.js +2 -0
  114. package/dist/82293.5e41c8378272aabf99f6.bundle.js.map +1 -0
  115. package/dist/82896.4787d205b19befaf263a.bundle.js +2 -0
  116. package/dist/82896.4787d205b19befaf263a.bundle.js.map +1 -0
  117. package/dist/{82926.93dbf44f2bcccba34e9b.bundle.js → 82926.93a59d42bf8d49aaac8e.bundle.js} +2 -2
  118. package/dist/{82926.93dbf44f2bcccba34e9b.bundle.js.map → 82926.93a59d42bf8d49aaac8e.bundle.js.map} +1 -1
  119. package/dist/{83136.56d692623cbc60048e03.bundle.js → 83136.4941a19a85eb34ca370a.bundle.js} +2 -2
  120. package/dist/83136.4941a19a85eb34ca370a.bundle.js.map +1 -0
  121. package/dist/{84727.b93b2f9857352d39b241.bundle.js → 84727.2e3214ad60bd59f435e2.bundle.js} +2 -2
  122. package/dist/84727.2e3214ad60bd59f435e2.bundle.js.map +1 -0
  123. package/dist/85281.76d06e1c26137bb4b417.bundle.js +2 -0
  124. package/dist/85281.76d06e1c26137bb4b417.bundle.js.map +1 -0
  125. package/dist/{86639.ab85108411ef0f006e10.bundle.js → 86639.d28da26b8f138f5eb19b.bundle.js} +2 -2
  126. package/dist/86639.d28da26b8f138f5eb19b.bundle.js.map +1 -0
  127. package/dist/89647.219c4eb306757647ae1c.bundle.js +2 -0
  128. package/dist/89647.219c4eb306757647ae1c.bundle.js.map +1 -0
  129. package/dist/{9062.d9049833d076191d3e1a.bundle.js → 9062.3541de664710a36fdac7.bundle.js} +2 -2
  130. package/dist/{9062.d9049833d076191d3e1a.bundle.js.map → 9062.3541de664710a36fdac7.bundle.js.map} +1 -1
  131. package/dist/95953.44049d81dd4879f745f9.bundle.js +2 -0
  132. package/dist/95953.44049d81dd4879f745f9.bundle.js.map +1 -0
  133. package/dist/96248.83e4f0c66a9f58161a66.bundle.js +2 -0
  134. package/dist/96248.83e4f0c66a9f58161a66.bundle.js.map +1 -0
  135. package/dist/98494.969124a68766ebbdee3c.bundle.js +3 -0
  136. package/dist/98494.969124a68766ebbdee3c.bundle.js.map +1 -0
  137. package/dist/99379.1b108abf4421ccee2973.bundle.js +2 -0
  138. package/dist/99379.1b108abf4421ccee2973.bundle.js.map +1 -0
  139. package/dist/{99448.314018d0afb1af150ddf.bundle.js → 99448.384b74c734331e5f8909.bundle.js} +2 -2
  140. package/dist/{99448.314018d0afb1af150ddf.bundle.js.map → 99448.384b74c734331e5f8909.bundle.js.map} +1 -1
  141. package/dist/99893.6ac254ca3f59996b2a52.bundle.js +2 -0
  142. package/dist/99893.6ac254ca3f59996b2a52.bundle.js.map +1 -0
  143. package/dist/api/models/configuration/configuration.d.ts +5 -0
  144. package/dist/api/models/logging/log-level.d.ts +7 -0
  145. package/dist/api/models/logging/logger-config.d.ts +19 -0
  146. package/dist/api/models/logging/logger-definitions.d.ts +7 -0
  147. package/dist/api/models/logging/logger-type.d.ts +3 -0
  148. package/dist/api/models/logging/logger.d.ts +15 -0
  149. package/dist/api/models/storage/storage-data.d.ts +1 -0
  150. package/dist/api/ontotext-workbench-api.d.ts +1 -0
  151. package/dist/api/ontotext-workbench-api.js +1 -1
  152. package/dist/api/ontotext-workbench-api.js.map +1 -1
  153. package/dist/api/services/logging/console/console-logger.service.d.ts +19 -0
  154. package/dist/api/services/logging/index.d.ts +2 -0
  155. package/dist/api/services/logging/logger-provider.d.ts +11 -0
  156. package/dist/api/services/logging/logger-service.d.ts +63 -0
  157. package/dist/api/services/logging/loggers.d.ts +15 -0
  158. package/dist/api/services/logging/test/loggers.spec.d.ts +1 -0
  159. package/dist/api/services/plugins/plugins-rest.service.d.ts +1 -0
  160. package/dist/api/services/plugins/plugins.service.d.ts +1 -0
  161. package/dist/api/services/repository/repository-storage.service.d.ts +1 -0
  162. package/dist/api/services/storage/local-storage-subscription-handler.service.d.ts +1 -0
  163. package/dist/api/services/utils/routing-utils.d.ts +1 -1
  164. package/dist/assets/configuration.default.json +5 -1
  165. package/dist/index.html +10 -8
  166. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  167. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  168. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  169. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  170. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  171. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  172. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
  173. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  174. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  175. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  176. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  177. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  178. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  179. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  180. package/dist/js/angular/graphql/templates/graphql-playground.html +1 -1
  181. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  182. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  183. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  184. package/dist/js/angular/security/templates/user.html +2 -2
  185. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  186. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  187. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  188. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  189. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  190. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  191. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +2 -2
  192. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  193. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  194. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  195. package/dist/legacyWorkbench.2bd696723af2573e8bb7.js +3 -0
  196. package/dist/{legacyWorkbench.57fc12c172f6350ac4c5.js.map → legacyWorkbench.2bd696723af2573e8bb7.js.map} +1 -1
  197. package/dist/{main.b9a83da68ffc43c91de0.js → main.be51ba05166a17f051a0.js} +3 -3
  198. package/dist/main.be51ba05166a17f051a0.js.map +1 -0
  199. package/dist/pages/aclmanagement.html +2 -2
  200. package/dist/pages/autocomplete.html +1 -1
  201. package/dist/pages/choose-repository-type.html +1 -1
  202. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  203. package/dist/pages/create-index.html +1 -1
  204. package/dist/pages/dependencies.html +1 -1
  205. package/dist/pages/domainRangeInfo.html +2 -2
  206. package/dist/pages/edit.html +1 -1
  207. package/dist/pages/explore.html +1 -1
  208. package/dist/pages/export.html +1 -1
  209. package/dist/pages/find.html +1 -1
  210. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  211. package/dist/pages/graphs-visualizations.html +7 -7
  212. package/dist/pages/guides.html +1 -1
  213. package/dist/pages/import.html +2 -2
  214. package/dist/pages/jdbc-create.html +1 -1
  215. package/dist/pages/login.html +1 -1
  216. package/dist/pages/monitor/backup-and-restore.html +1 -1
  217. package/dist/pages/monitor/queries.html +1 -1
  218. package/dist/pages/monitor/resources.html +1 -1
  219. package/dist/pages/namespaces.html +2 -2
  220. package/dist/pages/plugins.html +1 -1
  221. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  222. package/dist/pages/rdfrank.html +2 -2
  223. package/dist/pages/repositories.html +1 -1
  224. package/dist/pages/repository.html +1 -1
  225. package/dist/pages/similarity-indexes.html +1 -1
  226. package/dist/pages/sparql-editor.html +1 -1
  227. package/dist/pages/sparql-template-create.html +1 -1
  228. package/dist/pages/ux-test1.html +2 -2
  229. package/dist/pages/webapi.html +2 -2
  230. package/dist/plugins.js +1 -1
  231. package/dist/res/swagger5/index.html +11 -11
  232. package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
  233. package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
  234. package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
  235. package/dist/shared-components/cjs/onto-footer_6.cjs.entry.js +1 -1
  236. package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
  237. package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
  238. package/dist/shared-components/cjs/translation.service-CC6jY4U-.js +1 -0
  239. package/dist/shared-components/collection/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.js +1 -1
  240. package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
  241. package/dist/shared-components/collection/components/onto-navbar/navbar-service.js +1 -1
  242. package/dist/shared-components/collection/services/logger-provider.js +1 -0
  243. package/dist/shared-components/collection/services/translation.service.js +1 -1
  244. package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
  245. package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
  246. package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
  247. package/dist/shared-components/esm/onto-footer_6.entry.js +1 -1
  248. package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
  249. package/dist/shared-components/esm/translate-label.entry.js +1 -1
  250. package/dist/shared-components/esm/translation.service-nljGIprK.js +1 -0
  251. package/dist/shared-components/shared-components/p-09a97d11.entry.js +1 -0
  252. package/dist/shared-components/shared-components/p-21b82a97.entry.js +1 -0
  253. package/dist/shared-components/shared-components/p-8d20ae56.entry.js +1 -0
  254. package/dist/shared-components/shared-components/{p-91ad7f7f.entry.js → p-9131b137.entry.js} +1 -1
  255. package/dist/shared-components/shared-components/{p-1bc2ac8e.entry.js → p-e454ffc9.entry.js} +1 -1
  256. package/dist/shared-components/shared-components/{p-17bac1e3.entry.js → p-f9aa2123.entry.js} +1 -1
  257. package/dist/shared-components/shared-components/p-nljGIprK.js +1 -0
  258. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  259. package/dist/shared-components/types/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.d.ts +1 -0
  260. package/dist/shared-components/types/components/onto-dropdown/onto-dropdown.d.ts +1 -0
  261. package/dist/shared-components/types/services/logger-provider.d.ts +11 -0
  262. package/dist/shared-components/types/services/translation.service.d.ts +1 -0
  263. package/dist/styleguide.9451f25d197464f4079c.js +2 -0
  264. package/dist/styleguide.9451f25d197464f4079c.js.map +1 -0
  265. package/dist/workbench/workbench/workbenchApp.js +1 -1
  266. package/package.json +1 -1
  267. package/dist/10142.f47cd2aec05492fce7ce.bundle.js +0 -2
  268. package/dist/10142.f47cd2aec05492fce7ce.bundle.js.map +0 -1
  269. package/dist/10376.e89fa63ff898d45f45fd.bundle.js.map +0 -1
  270. package/dist/12940.5b35c2cf5958d8769c0a.bundle.js +0 -2
  271. package/dist/12940.5b35c2cf5958d8769c0a.bundle.js.map +0 -1
  272. package/dist/14824.5d5041c05fca4c0373fa.bundle.js +0 -2
  273. package/dist/14824.5d5041c05fca4c0373fa.bundle.js.map +0 -1
  274. package/dist/18961.c6505525fb0491b48f8b.bundle.js +0 -2
  275. package/dist/18961.c6505525fb0491b48f8b.bundle.js.map +0 -1
  276. package/dist/19968.fdb823f9a12e11a633ec.bundle.js +0 -2
  277. package/dist/19968.fdb823f9a12e11a633ec.bundle.js.map +0 -1
  278. package/dist/20227.ab5dfaab392dbb16ba31.bundle.js +0 -2
  279. package/dist/20227.ab5dfaab392dbb16ba31.bundle.js.map +0 -1
  280. package/dist/28050.8ca1fa760c892bfc5466.bundle.js.map +0 -1
  281. package/dist/33524.35fe079bcb99a78babaf.bundle.js +0 -2
  282. package/dist/33524.35fe079bcb99a78babaf.bundle.js.map +0 -1
  283. package/dist/41621.68c5ebc2104a62e2b41d.bundle.js +0 -2
  284. package/dist/41621.68c5ebc2104a62e2b41d.bundle.js.map +0 -1
  285. package/dist/456.6118cb99d130f4c0410c.bundle.js.map +0 -1
  286. package/dist/45758.6ceb731cbe0576149f31.bundle.js +0 -2
  287. package/dist/45758.6ceb731cbe0576149f31.bundle.js.map +0 -1
  288. package/dist/52264.99261393a7f6e631da3b.bundle.js.map +0 -1
  289. package/dist/54419.f09240da9349be115ab3.bundle.js +0 -2
  290. package/dist/54419.f09240da9349be115ab3.bundle.js.map +0 -1
  291. package/dist/5470.7c17c7d3b58c8c0d0786.bundle.js +0 -2
  292. package/dist/5470.7c17c7d3b58c8c0d0786.bundle.js.map +0 -1
  293. package/dist/58334.6fdc74532b5f755916d8.bundle.js +0 -2
  294. package/dist/58334.6fdc74532b5f755916d8.bundle.js.map +0 -1
  295. package/dist/60560.37740d97b418899a5d21.bundle.js +0 -2
  296. package/dist/60560.37740d97b418899a5d21.bundle.js.map +0 -1
  297. package/dist/64118.9841bd3b9724868b8a63.bundle.js +0 -2
  298. package/dist/64118.9841bd3b9724868b8a63.bundle.js.map +0 -1
  299. package/dist/66014.336bc4291da2fbc96cd1.bundle.js +0 -2
  300. package/dist/66014.336bc4291da2fbc96cd1.bundle.js.map +0 -1
  301. package/dist/67888.7d4966e0a22ba655f1b8.bundle.js.map +0 -1
  302. package/dist/69724.1a97fa707ee1379409e9.bundle.js +0 -2
  303. package/dist/69724.1a97fa707ee1379409e9.bundle.js.map +0 -1
  304. package/dist/77143.f23d8a7fa51df083741c.bundle.js +0 -2
  305. package/dist/77143.f23d8a7fa51df083741c.bundle.js.map +0 -1
  306. package/dist/78070.b5e22ffae27cc3ca7a6f.bundle.js +0 -2
  307. package/dist/78070.b5e22ffae27cc3ca7a6f.bundle.js.map +0 -1
  308. package/dist/78681.39694d37c0f75ea04df6.bundle.js +0 -2
  309. package/dist/78681.39694d37c0f75ea04df6.bundle.js.map +0 -1
  310. package/dist/81837.f10e22eaf72a0642b50e.bundle.js +0 -2
  311. package/dist/81837.f10e22eaf72a0642b50e.bundle.js.map +0 -1
  312. package/dist/82206.8ec983edcf675cfd4531.bundle.js +0 -2
  313. package/dist/82206.8ec983edcf675cfd4531.bundle.js.map +0 -1
  314. package/dist/82293.a9bb9cd640c007cc1e91.bundle.js +0 -2
  315. package/dist/82293.a9bb9cd640c007cc1e91.bundle.js.map +0 -1
  316. package/dist/82896.9aed45baf67510717c6f.bundle.js +0 -2
  317. package/dist/82896.9aed45baf67510717c6f.bundle.js.map +0 -1
  318. package/dist/83136.56d692623cbc60048e03.bundle.js.map +0 -1
  319. package/dist/84727.b93b2f9857352d39b241.bundle.js.map +0 -1
  320. package/dist/85281.27b5a1eb8e7ac2cf8459.bundle.js +0 -2
  321. package/dist/85281.27b5a1eb8e7ac2cf8459.bundle.js.map +0 -1
  322. package/dist/86639.ab85108411ef0f006e10.bundle.js.map +0 -1
  323. package/dist/89647.b1a4e522d685f0b5d60f.bundle.js +0 -2
  324. package/dist/89647.b1a4e522d685f0b5d60f.bundle.js.map +0 -1
  325. package/dist/95953.4ea6a7c68a22779ba299.bundle.js +0 -2
  326. package/dist/95953.4ea6a7c68a22779ba299.bundle.js.map +0 -1
  327. package/dist/96248.1b85f989b0a7852c9b7b.bundle.js +0 -2
  328. package/dist/96248.1b85f989b0a7852c9b7b.bundle.js.map +0 -1
  329. package/dist/98494.a2cdb2a1c5d32d0094f3.bundle.js +0 -3
  330. package/dist/98494.a2cdb2a1c5d32d0094f3.bundle.js.map +0 -1
  331. package/dist/99379.be6c85ef305af6667dc1.bundle.js +0 -2
  332. package/dist/99379.be6c85ef305af6667dc1.bundle.js.map +0 -1
  333. package/dist/99893.2537d77ee1f4df0c846b.bundle.js +0 -2
  334. package/dist/99893.2537d77ee1f4df0c846b.bundle.js.map +0 -1
  335. package/dist/legacyWorkbench.57fc12c172f6350ac4c5.js +0 -3
  336. package/dist/main.b9a83da68ffc43c91de0.js.map +0 -1
  337. package/dist/shared-components/cjs/translation.service-DjdwDpXN.js +0 -1
  338. package/dist/shared-components/esm/translation.service-Hf6024E7.js +0 -1
  339. package/dist/shared-components/shared-components/p-2433b25f.entry.js +0 -1
  340. package/dist/shared-components/shared-components/p-25fa0ee5.entry.js +0 -1
  341. package/dist/shared-components/shared-components/p-6266be98.entry.js +0 -1
  342. package/dist/shared-components/shared-components/p-Hf6024E7.js +0 -1
  343. /package/dist/{98494.a2cdb2a1c5d32d0094f3.bundle.js.LICENSE.txt → 98494.969124a68766ebbdee3c.bundle.js.LICENSE.txt} +0 -0
  344. /package/dist/{legacyWorkbench.57fc12c172f6350ac4c5.js.LICENSE.txt → legacyWorkbench.2bd696723af2573e8bb7.js.LICENSE.txt} +0 -0
  345. /package/dist/{main.b9a83da68ffc43c91de0.js.LICENSE.txt → main.be51ba05166a17f051a0.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__=60560;export const __webpack_ids__=[60560];export const __webpack_modules__={60560:(e,a,t)=>{t.r(a),t.d(a,{onto_cookie_consent:()=>l,onto_cookie_policy_dialog:()=>s});var o=t(87848),i=t(79939),c=t(57154);const l=class{constructor(e){(0,o.r)(this,e),this.consentGiven=(0,o.c)(this,"consentGiven"),this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return(0,o.h)(o.a,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},(0,o.h)("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},(0,o.h)("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},(0,o.h)("span",{key:"aa62410b522125feeb48eaa568a78c761e6b9596"},(0,o.h)("translate-label",{key:"0696068c1aa8738bb3ddf0e548d9140ba12609e1",labelKey:"cookie.cookie_consent"}),(0,o.h)("a",{key:"efd9792a6a424b86606b3904615c53f19a2cdb6e",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},(0,o.h)("translate-label",{key:"12e95d1446f81b47c973e285ee71da5fbfa4934f",labelKey:"cookie.cookie_policy_url_label"})),"."),(0,o.h)("button",{key:"a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},(0,o.h)("translate-label",{key:"5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a",labelKey:"common.button.ok"})))),this.showModal&&(0,o.h)("onto-cookie-policy-dialog",{key:"e54d3f134771ff5f59a288d0d6c9949c6f59567f",dialogHandler:this}))}};var n;l.style=".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:#fff;box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}",function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(n||(n={}));const s=class{constructor(e){(0,o.r)(this,e),this.logger=i.L.logger,this.user=c.ServiceProvider.get(c.SecurityContextService).getAuthenticatedUser(),this.securityService=c.ServiceProvider.get(c.SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(this.logger.error)}render(){var e,a;const t={dialogTitle:i.T.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},l=new c.CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return(0,o.h)("onto-dialog",{key:"5e62d3868af4012577e84bb5c1253539a673083a",config:t},(0,o.h)("div",{key:"16eca81b0a06475b144605d8e59e96451629c96f",slot:"body"},(0,o.h)("section",{key:"e80b33838e3c8d7f98aa56279b0abda6675cae3d"},(0,o.h)("h4",{key:"669acb8c03e02245e73e3e633d3c65727a06f505"},(0,o.h)("translate-label",{key:"071e342001fea0bac249c76e71925794876a4e88",labelKey:"cookie.policy.purpose_heading"})),(0,o.h)("p",{key:"264d4941a7bd54d527c9b17db0d0a277af553a60"},(0,o.h)("translate-label",{key:"e96b4a061dc7b7f35de34b425d32983ced5379e9",labelKey:"cookie.policy.purpose_text"})),(0,o.h)("p",{key:"dde91eecd6bc971a6b99adf4c5dc5db20ea895cc"},(0,o.h)("translate-label",{key:"3d63148dd9dad889b0be3e7d6c5b11872f5a659d",labelKey:"cookie.policy.purpose_enterprise_text"}))),(0,o.h)("section",{key:"2c6108c24450d655a07c4a6cdedf2ffa0b68a99b"},(0,o.h)("h4",{key:"fd11c7d881ee183427577d335b16ccb8e09d44e0"},(0,o.h)("translate-label",{key:"4fc7994e04ae0a4eb934b99d933f9976e6c8440d",labelKey:"cookie.policy.privacy_commitment_heading"})),(0,o.h)("p",{key:"c7c8c430acb67b506732f4ffdf5138582a363f53"},(0,o.h)("translate-label",{key:"c7c476ec48cfbaf842331f2ce868cf1eb7e6af69",labelKey:"cookie.policy.privacy_commitment_text"})),(0,o.h)("ul",{key:"9762f4a7ba0cb70993daaa23fa213072b7589459"},(0,o.h)("li",{key:"53f038d506a52714d2ba63c90c277986fde70e84"},(0,o.h)("translate-label",{key:"36d36a3e084e121d40e8a2c19afea11fc7384612",labelKey:"cookie.policy.privacy_commitment_1"})),(0,o.h)("li",{key:"764c43f6b844dc18aa78c3b1bb6b6ff012e56bd4"},(0,o.h)("translate-label",{key:"222eafa3af9ce55d2fea0a796197cd355289e135",labelKey:"cookie.policy.privacy_commitment_2"})))),(0,o.h)("section",{key:"4e43cd6f18738a953d52e5d249e3d0185faead7c"},(0,o.h)("h4",{key:"9af407bdd0fa5d77293a5f1d004fa109ed2b442d"},(0,o.h)("translate-label",{key:"0e656ea4576feae9a7bd0996eba3fb2d9ad1d43f",labelKey:"cookie.policy.cookies_heading"})),(0,o.h)("p",{key:"c198b97197b54ed6d8b5342b0fb616573c3dacc8"},(0,o.h)("translate-label",{key:"5b92e0bf1249378314e6e0eb2b2928d26ea6335a",labelKey:"cookie.policy.cookies_text"}))),(0,o.h)("section",{key:"2714f502c5a75d1ed1836c59bcb13b2e478777f5"},(0,o.h)("h4",{key:"0f36bdda71a975d35dcb0945e319cdbff47db95f"},(0,o.h)("translate-label",{key:"e1c41bd8de6d78f7d57463726a47cadbf80db251",labelKey:"cookie.policy.manage_cookies_heading"})),(0,o.h)("onto-toggle-switch",{key:"2d3ca12f02eb1d218619642fb007fb30df7473a5",checked:null==l?void 0:l.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:n.STATISTIC}),(0,o.h)("p",{key:"8d4ea408a918657ba6fb173d75010dff14ab92d8"},(0,o.h)("translate-label",{key:"3cdf73f90f86c0c777aa6608bc027a66cf4357c4",labelKey:"cookie.policy.statistic_text"})),(0,o.h)("onto-toggle-switch",{key:"5496e326b60220c122d669de25da36ff580f86a3",checked:null==l?void 0:l.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:n.THIRD_PARTY}),(0,o.h)("p",{key:"6e5eb57eded1cd9039137f97792f484035fd39b4"},(0,o.h)("translate-label",{key:"4f46f1391784782d133d54f48b17b93acdd5e455",labelKey:"cookie.policy.third_party_cookies_text"}))),(0,o.h)("p",{key:"7ddab24add6d05b2cddda126adb7996dfdbac970"},(0,o.h)("span",{key:"3ec5b1a68c7c9bdcc4c771c83dbf39a76f1b53b5"},(0,o.h)("translate-label",{key:"9dedef31386432411256689eff2a087c52906740",labelKey:"cookie.policy.change_cookies"}),(0,o.h)("i",{key:"147b23da37def13f0da4a8afdc04b33205e087b8"}," ",(0,o.h)("translate-label",{key:"bba53a3b3ed74a9f1922528ed9e5d86ad40379a5",labelKey:"menu.setup.label"})," > ",(0,o.h)("translate-label",{key:"3689ef4f4d6d34c9ddd45c42a02387778d87bd1f",labelKey:"menu.my.settings.label"})," > ",(0,o.h)("translate-label",{key:"e7c73135758fd1486ee7e4a3328ba261d77aaa15",labelKey:"security.user.settings"})," > ",(0,o.h)("translate-label",{key:"d248fc63637f1587a672a18a7ea08a8fb1d6b16f",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new c.CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}};s.style="section h4{font-size:x-large;font-weight:bolder;margin-top:12px}"},79939:(e,a,t)=>{t.d(a,{L:()=>c,T:()=>n,s:()=>i});var o=t(57154);function i(e){const a=document.createElement("textarea");return a.innerHTML=e,a.value}class c{static get logger(){return o.Loggers.getLoggerInstance("SharedComponents")}}class l{constructor(){this.languageContextService=o.ServiceProvider.get(o.LanguageContextService),this.translationChangedObservers={},this.logger=c.logger,this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,a=[],t=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const o={parameters:a,callback:t};return this.translationChangedObservers[e].push(o),t(this.translate(e,a)),()=>{const a=this.translationChangedObservers[e].indexOf(o);-1!==a&&this.translationChangedObservers[e].splice(a,1)}}translate(e,a){return this.translateInLocale(e,a)}translateInLocale(e,a){let t=this.translateFromBundle(this.currentBundle,e);return t||(t=this.translateFromBundle(this.defaultBundle,e)),t?(t=this.applyParameters(t,a),i(t)):(this.logger.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,a){if(!e)return;let t=e[a];return"string"!=typeof t&&(t=this.translateAsJsonObject(e,a)),t}translateAsJsonObject(e,a){let t=a.split(".");return this.getTranslation(e,t)}getTranslation(e,a){if(!a||!e)return;const t=e[a.splice(0,1)[0]];return 0===a.length?t:"string"!=typeof t?a.length>0?this.getTranslation(t,a):t:void 0}applyParameters(e,a){return a?a.reduce((e,a)=>l.replaceAll(e,a),e):e}static replaceAll(e,a){return a?e.split(`{{${a.key}}}`).join(a.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(a=>a.callback(this.translate(e,a.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const n=new l}};
2
+ //# sourceMappingURL=60560.2ef51d3e2d9674450419.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"60560.2ef51d3e2d9674450419.bundle.js","mappings":"wOAIA,MAEMA,EAAoB,MACtBC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,GACvBE,KAAKC,cAAeC,EAAAA,EAAAA,GAAYF,KAAM,gBAEtCA,KAAKG,WAAY,EAKjBH,KAAKI,UAAaC,IACdA,EAAMC,iBACNN,KAAKG,WAAY,GAMrBH,KAAKO,mBAAqB,KACtBP,KAAKC,aAAaO,OAE1B,CAMAC,aAAAA,GACIT,KAAKG,WAAY,CACrB,CACAO,MAAAA,GACI,OAAQC,EAAAA,EAAAA,GAAEC,EAAAA,EAAM,CAAEC,IAAK,6CAA8CF,EAAAA,EAAAA,GAAE,MAAO,CAAEE,IAAK,2CAA4CC,MAAO,yBAA0BH,EAAAA,EAAAA,GAAE,UAAW,CAAEE,IAAK,2CAA4CC,MAAO,2BAA4BH,EAAAA,EAAAA,GAAE,OAAQ,CAAEE,IAAK,6CAA8CF,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,SAAU,2BAA4BJ,EAAAA,EAAAA,GAAE,IAAK,CAAEE,IAAK,2CAA4C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AAU5F,SAAS8F,KAAKF,EAAUpC,OAASsB,CACzF,CACAiB,yBAAAA,GACIC,OAAOC,KAAK9G,KAAK2E,6BAA6BoC,QAASC,KACjChH,KAAK2E,4BAA4BqC,IAAc,IACvDD,QAAS5B,GAAaA,EAASE,SAASrF,KAAK4C,UAAUoE,EAAW7B,EAASC,eAE7F,CACAN,uBAAAA,GACI9E,KAAKiH,2BAA6BjH,KAAKyE,uBAAuByC,wBAAyBlB,IAC/EA,IACAhG,KAAK6F,cAAgBG,EACrBhG,KAAK4G,8BAGjB,CACAO,OAAAA,GACQnH,KAAKiH,4BACLjH,KAAKiH,4BAEb,EAEJ,MAAMtE,EAAqB,IAAI6B,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-cookie-consent_2.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-nljGIprK.js"],"sourcesContent":["import { r as registerInstance, c as createEvent, h, a as Host } from './index-I_gcXFWK.js';\nimport { L as LoggerProvider, T as TranslationService } from './translation.service-nljGIprK.js';\nimport { ServiceProvider, SecurityContextService, SecurityService, CookieConsent } from '@ontotext/workbench-api';\n\nconst ontoCookieConsentCss = \".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:#fff;box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}\";\n\nconst OntoCookieConsent = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.consentGiven = createEvent(this, \"consentGiven\");\n /** State to control the visibility of the cookie policy modal */\n this.showModal = false;\n /**\n * Opens the cookie policy modal.\n * @param {Event} event - The event that triggered the modal opening.\n */\n this.openModal = (event) => {\n event.preventDefault();\n this.showModal = true;\n };\n /**\n * Handles the click event on the consent button.\n * Emits the consentGiven event.\n */\n this.handleConsentClick = () => {\n this.consentGiven.emit();\n };\n }\n /**\n * Closes the cookie policy dialog.\n * This method is called when the dialog is closed.\n */\n // eslint-disable-next-line @stencil-community/own-methods-must-be-private\n onDialogClose() {\n this.showModal = false;\n }\n render() {\n return (h(Host, { key: 'dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d' }, h(\"div\", { key: '414c970a3a4b263e8f3f5d066dc8bb22b8194c48', class: \"cookie-consent-modal\" }, h(\"section\", { key: '6a1cccadb167b301738fb6a453b7d300e93ba18b', class: \"cookie-consent-content\" }, h(\"span\", { key: 'aa62410b522125feeb48eaa568a78c761e6b9596' }, h(\"translate-label\", { key: '0696068c1aa8738bb3ddf0e548d9140ba12609e1', labelKey: 'cookie.cookie_consent' }), h(\"a\", { key: 'efd9792a6a424b86606b3904615c53f19a2cdb6e', id: \"cookie-policy-link\", href: \"#\", onClick: this.openModal, class: \"btn btn-link p-0\" }, h(\"translate-label\", { key: '12e95d1446f81b47c973e285ee71da5fbfa4934f', labelKey: 'cookie.cookie_policy_url_label' })), \".\"), h(\"button\", { key: 'a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0', id: \"accept-cookie-policy\", class: \"onto-btn onto-btn-primary\", onClick: this.handleConsentClick }, h(\"translate-label\", { key: '5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a', labelKey: 'common.button.ok' })))), this.showModal && h(\"onto-cookie-policy-dialog\", { key: 'e54d3f134771ff5f59a288d0d6c9949c6f59567f', dialogHandler: this })));\n }\n};\nOntoCookieConsent.style = ontoCookieConsentCss;\n\nconst ontoCookiePolicyDialogCss = \"section h4{font-size:x-large;font-weight:bolder;margin-top:12px}\";\n\nvar CookieType;\n(function (CookieType) {\n CookieType[\"THIRD_PARTY\"] = \"thirdParty\";\n CookieType[\"STATISTIC\"] = \"statistic\";\n})(CookieType || (CookieType = {}));\nconst OntoCookiePolicyDialog = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.logger = LoggerProvider.logger;\n this.user = ServiceProvider.get(SecurityContextService).getAuthenticatedUser();\n this.securityService = ServiceProvider.get(SecurityService);\n }\n toggleChanged(event) {\n this.setUserCookieConsent(this.updateCookieConsent(event.detail));\n this.securityService.updateUserData(this.user)\n .catch(this.logger.error);\n }\n render() {\n var _a, _b;\n const config = {\n dialogTitle: TranslationService.translate('cookie.policy.title'),\n onClose: () => this.dialogHandler.onDialogClose(),\n modalClass: 'cookie-policy-modal',\n };\n const cookieConsent = new CookieConsent((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.appSettings) === null || _b === void 0 ? void 0 : _b.COOKIE_CONSENT);\n return (h(\"onto-dialog\", { key: '5e62d3868af4012577e84bb5c1253539a673083a', config: config }, h(\"div\", { key: '16eca81b0a06475b144605d8e59e96451629c96f', slot: 'body' }, h(\"section\", { key: 'e80b33838e3c8d7f98aa56279b0abda6675cae3d' }, h(\"h4\", { key: '669acb8c03e02245e73e3e633d3c65727a06f505' }, h(\"translate-label\", { key: '071e342001fea0bac249c76e71925794876a4e88', labelKey: 'cookie.policy.purpose_heading' })), h(\"p\", { key: '264d4941a7bd54d527c9b17db0d0a277af553a60' }, h(\"translate-label\", { key: 'e96b4a061dc7b7f35de34b425d32983ced5379e9', labelKey: 'cookie.policy.purpose_text' })), h(\"p\", { key: 'dde91eecd6bc971a6b99adf4c5dc5db20ea895cc' }, h(\"translate-label\", { key: '3d63148dd9dad889b0be3e7d6c5b11872f5a659d', labelKey: 'cookie.policy.purpose_enterprise_text' }))), h(\"section\", { key: '2c6108c24450d655a07c4a6cdedf2ffa0b68a99b' }, h(\"h4\", { key: 'fd11c7d881ee183427577d335b16ccb8e09d44e0' }, h(\"translate-label\", { key: '4fc7994e04ae0a4eb934b99d933f9976e6c8440d', labelKey: 'cookie.policy.privacy_commitment_heading' })), h(\"p\", { key: 'c7c8c430acb67b506732f4ffdf5138582a363f53' }, h(\"translate-label\", { key: 'c7c476ec48cfbaf842331f2ce868cf1eb7e6af69', labelKey: 'cookie.policy.privacy_commitment_text' })), h(\"ul\", { key: '9762f4a7ba0cb70993daaa23fa213072b7589459' }, h(\"li\", { key: '53f038d506a52714d2ba63c90c277986fde70e84' }, h(\"translate-label\", { key: '36d36a3e084e121d40e8a2c19afea11fc7384612', labelKey: 'cookie.policy.privacy_commitment_1' })), h(\"li\", { key: '764c43f6b844dc18aa78c3b1bb6b6ff012e56bd4' }, h(\"translate-label\", { key: '222eafa3af9ce55d2fea0a796197cd355289e135', labelKey: 'cookie.policy.privacy_commitment_2' })))), h(\"section\", { key: '4e43cd6f18738a953d52e5d249e3d0185faead7c' }, h(\"h4\", { key: '9af407bdd0fa5d77293a5f1d004fa109ed2b442d' }, h(\"translate-label\", { key: '0e656ea4576feae9a7bd0996eba3fb2d9ad1d43f', labelKey: 'cookie.policy.cookies_heading' })), h(\"p\", { key: 'c198b97197b54ed6d8b5342b0fb616573c3dacc8' }, h(\"translate-label\", { key: '5b92e0bf1249378314e6e0eb2b2928d26ea6335a', labelKey: 'cookie.policy.cookies_text' }))), h(\"section\", { key: '2714f502c5a75d1ed1836c59bcb13b2e478777f5' }, h(\"h4\", { key: '0f36bdda71a975d35dcb0945e319cdbff47db95f' }, h(\"translate-label\", { key: 'e1c41bd8de6d78f7d57463726a47cadbf80db251', labelKey: 'cookie.policy.manage_cookies_heading' })), h(\"onto-toggle-switch\", { key: '2d3ca12f02eb1d218619642fb007fb30df7473a5', checked: cookieConsent === null || cookieConsent === void 0 ? void 0 : cookieConsent.statistic, labelKey: 'cookie.policy.statistic_cookies', tooltipTranslationKey: 'cookie.policy.statistic_tooltip', context: CookieType.STATISTIC }), h(\"p\", { key: '8d4ea408a918657ba6fb173d75010dff14ab92d8' }, h(\"translate-label\", { key: '3cdf73f90f86c0c777aa6608bc027a66cf4357c4', labelKey: 'cookie.policy.statistic_text' })), h(\"onto-toggle-switch\", { key: '5496e326b60220c122d669de25da36ff580f86a3', checked: cookieConsent === null || cookieConsent === void 0 ? void 0 : cookieConsent.thirdParty, labelKey: 'cookie.policy.third_party_cookies', tooltipTranslationKey: 'cookie.policy.third_party_tooltip', context: CookieType.THIRD_PARTY }), h(\"p\", { key: '6e5eb57eded1cd9039137f97792f484035fd39b4' }, h(\"translate-label\", { key: '4f46f1391784782d133d54f48b17b93acdd5e455', labelKey: 'cookie.policy.third_party_cookies_text' }))), h(\"p\", { key: '7ddab24add6d05b2cddda126adb7996dfdbac970' }, h(\"span\", { key: '3ec5b1a68c7c9bdcc4c771c83dbf39a76f1b53b5' }, h(\"translate-label\", { key: '9dedef31386432411256689eff2a087c52906740', labelKey: 'cookie.policy.change_cookies' }), h(\"i\", { key: '147b23da37def13f0da4a8afdc04b33205e087b8' }, \"\\u00A0\", h(\"translate-label\", { key: 'bba53a3b3ed74a9f1922528ed9e5d86ad40379a5', labelKey: 'menu.setup.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '3689ef4f4d6d34c9ddd45c42a02387778d87bd1f', labelKey: 'menu.my.settings.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: 'e7c73135758fd1486ee7e4a3328ba261d77aaa15', labelKey: 'security.user.settings' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: 'd248fc63637f1587a672a18a7ea08a8fb1d6b16f', labelKey: 'cookie.policy.change_cookies_location4' }), \"\\u00A0\"))))));\n }\n updateCookieConsent(payload) {\n var _a, _b;\n const cookieConsent = new CookieConsent((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.appSettings) === null || _b === void 0 ? void 0 : _b.COOKIE_CONSENT);\n // Context is either 'thirdParty' or 'statistic'\n cookieConsent[payload.context] = payload.checked;\n cookieConsent.updatedAt = new Date().getTime();\n return cookieConsent;\n }\n setUserCookieConsent(cookieConsent) {\n if (!this.user.appSettings) {\n this.user.appSettings = {};\n }\n this.user.appSettings.COOKIE_CONSENT = cookieConsent;\n }\n};\nOntoCookiePolicyDialog.style = ontoCookiePolicyDialogCss;\n\nexport { OntoCookieConsent as onto_cookie_consent, OntoCookiePolicyDialog as onto_cookie_policy_dialog };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["OntoCookieConsent","constructor","hostRef","registerInstance","this","consentGiven","createEvent","showModal","openModal","event","preventDefault","handleConsentClick","emit","onDialogClose","render","h","Host","key","class","labelKey","id","href","onClick","dialogHandler","CookieType","style","OntoCookiePolicyDialog","logger","LoggerProvider","user","ServiceProvider","get","SecurityContextService","getAuthenticatedUser","securityService","SecurityService","toggleChanged","setUserCookieConsent","updateCookieConsent","detail","updateUserData","catch","error","_a","_b","config","dialogTitle","TranslationService","translate","onClose","modalClass","cookieConsent","CookieConsent","appSettings","COOKIE_CONSENT","slot","checked","statistic","tooltipTranslationKey","context","STATISTIC","thirdParty","THIRD_PARTY","payload","updatedAt","Date","getTime","sanitizeHTML","html","element","document","createElement","innerHTML","value","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","onTranslate","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","length","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","forEach","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__=64118;export const __webpack_ids__=[12940,30553,49539,64118,65820,71920,89598,89647,98268];export const __webpack_modules__={12940:(e,t,n)=>{n.r(t);var o=n(5949),r=n(89598),a=n(30553),i=n(304);const s={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"},l=i.LoggerProvider.logger;function c(e){const t=(0,o.A)().use(r.markdownCodeCopyPlugin).use(a.markdownOpenInSparqlEditorPlugin,s);return{renderMarkdown:(n,i)=>{try{return e.trustAsHtml((e=>e?(0,o.A)().use(r.markdownCodeCopyPlugin,e).use(a.markdownOpenInSparqlEditorPlugin,_.merge({},s,e)):t)(i).render(n))}catch(t){return l.error("Error rendering markdown:",t),e.trustAsHtml(n)}}}}angular.module("graphdb.framework.core.services.markdown-service",[]).service("MarkdownService",c),c.$inject=["$sce"]},30553:(e,t,n)=>{n.r(t),n.d(t,{markdownOpenInSparqlEditorPlugin:()=>a});const o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function r(e,t){return t=_.merge({},o,t),(...n)=>{const[o,r]=n,a=o[r],i=o[r].content.replaceAll('"',"&quot;").replaceAll("'","&apos;"),s=e(...n);return"fence"===a.type&&"sparql"===a.info&&s.trim()?`<div style="position: relative">\n ${s}\n <open-in-sparql-editor\n style="${t.buttonStyle}"\n class="${t.buttonClass}"\n execute-query="${t.executeQuery}"\n repository-id="${t.repositoryId}"\n query="${i}">\n </open-in-sparql-editor>\n </div>`:s}}const a=(e,t)=>{e.renderer.rules.code_block=r(e.renderer.rules.code_block,t),e.renderer.rules.fence=r(e.renderer.rules.fence,t)}},64118:(e,t,n)=>{n.r(t),n(89647),n(98268);var o=n(71920),r=n(87252),a=n(65820);function i(e,t,n,i,s){return{restrict:"E",templateUrl:"js/angular/ttyg/templates/chat-item-detail.html",scope:{chatItemDetail:"=",showActions:"=",asking:"=",disabled:"=",onRegenerateQuestion:"&",onAskHowDeliveredAnswer:"&"},link:(l,c,d)=>{l.ExplainQueryType=r.ExplainQueryType,l.repositoryId=void 0,l.markdownContentOptions=void 0,l.agentNameByIdMap={},l.explainResponseModel={},l.loadingExplainResponse={},l.regenerateQuestion=()=>{l.onRegenerateQuestion({chatItem:l.chatItemDetail})},l.explainResponse=o=>{n.hasExplainResponse(o)?n.toggleExplainResponse(o):(l.loadingExplainResponse[o]=!0,i.explainResponse(l.chatItemDetail,o).then(e=>{n.addExplainResponseCache(e)}).catch(()=>{e.error(t.instant("ttyg.chat_panel.messages.explain_response_failure"))}).finally(()=>l.loadingExplainResponse[o]=!1))},l.onAskHowAnswerWasDerived=()=>{l.onAskHowDeliveredAnswer()},l.onTokenUsageInfo=e=>{e.preventDefault(),e.stopPropagation()},l.onOpenInSparqlEditor=e=>{l.chatItemDetail.agentId&&n.emit(o.TTYGEventName.GO_TO_SPARQL_EDITOR,{query:e,repositoryId:l.repositoryId})},l.showRawQuery=e=>{const t=e.rawQuery.replace(/\s+/g,""),n=e.query.replace(/\s+/g,"");return t&&t!==n},l.getRepositoryId=e=>{const t=n.getAgent(l.chatItemDetail.agentId);return t?t.repositoryId:""},l.getHumanReadableQuestionTimestamp=e=>(0,a.getHumanReadableTimestamp)(t,s,e);const p=()=>{l.chatItemDetail.answers.forEach(e=>{l.explainResponseModel[e.id]=n.getExplainResponse(e.id)})},E=[];E.push(n.onExplainResponseCacheUpdated(()=>{p()})),E.push(n.onAgentsListChanged(()=>{l.agentNameByIdMap=n.getAgents().agentNameByIdMap})),l.$on("$destroy",()=>{E.forEach(e=>e())}),l.repositoryId=l.getRepositoryId(),l.markdownContentOptions={repositoryId:l.repositoryId},p()}}}angular.module("graphdb.framework.ttyg.directives.chat-item-detail",["graphdb.framework.core.directives.open-in-sparql-editor","graphdb.framework.core.directives.markdown-content"]).directive("chatItemDetail",i),i.$inject=["toastr","$translate","TTYGContextService","TTYGService","$filter"]},65820:(e,t,n)=>{n.r(t),n.d(t,{getHumanReadableTimestamp:()=>o});const o=(e,t,n,o={})=>{if(!n)return"";const r=new Date(n),a=new Date,i=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(i);s.setDate(i.getDate()-1);const l=new Date(r.getFullYear(),r.getMonth(),r.getDate()),c=o.timeFormat?t("date")(r,o.timeFormat):"";if(l.getTime()===i.getTime())return e.instant("common.dates.today")+c;if(l.getTime()===s.getTime())return e.instant("common.dates.yesterday")+c;{const e=o.dateFormat||"yyyy-MM-dd";return t("date")(r,e)+c}}},71920:(e,t,n)=>{n.r(t),n.d(t,{TTYGEventName:()=>a});var o=n(98980);function r(e){let t,n,r,i,s,l={},c=!1;const d=()=>(0,o.cloneDeep)(t),p=()=>(0,o.cloneDeep)(n),E=e=>{n=(0,o.cloneDeep)(e),C(a.CHAT_LIST_UPDATED,p())},g=()=>(0,o.cloneDeep)(r),u=()=>(0,o.cloneDeep)(i),_=()=>(0,o.cloneDeep)(l),A=e=>!!l[e],T=()=>c,C=(t,n)=>{e.emitSync(t,(0,o.cloneDeep)(n))},m=(t,n)=>e.subscribeSync(t,e=>n(e));return{resetContext:()=>{t=void 0,n=void 0,r=void 0,i=void 0,l={},s=void 0,c=!1},emit:C,subscribe:m,getChats:p,updateChats:E,addChat:e=>{n.appendChat(e),E(n)},replaceChat:(e,t)=>{n.replaceChat(e,t),E(n)},onChatsListChanged:e=>(n&&angular.isFunction(e)&&e(p()),m(a.CHAT_LIST_UPDATED,t=>e(t))),getSelectedChat:g,selectChat:e=>{r&&r.id===e.id||(r=(0,o.cloneDeep)(e),C(a.SELECT_CHAT,g()))},deselectChat:()=>{r=void 0,C(a.SELECT_CHAT,g())},deleteChat:e=>{n.deleteChat(e),E(n)},onSelectedChatChanged:e=>(angular.isFunction(e)&&e(g()),m(a.SELECT_CHAT,t=>e(t))),updateSelectedChat:e=>{r&&r.id&&e&&r.id!==e.id||(r=(0,o.cloneDeep)(e),C(a.SELECTED_CHAT_UPDATED,g()))},onSelectedChatUpdated:e=>(r&&angular.isFunction(e)&&e(g()),m(a.SELECTED_CHAT_UPDATED,t=>e(t))),onLastMessageReceived:e=>(r&&angular.isFunction(e)&&e(g()),m(a.LAST_MESSAGE_RECEIVED,t=>e(t))),updateAgents:e=>{t=(0,o.cloneDeep)(e),C(a.AGENT_LIST_UPDATED,d())},onAgentsListChanged:e=>(t&&angular.isFunction(e)&&e(d()),m(a.AGENT_LIST_UPDATED,t=>e(t))),getAgents:d,getAgent:e=>{if(t)return(0,o.cloneDeep)(t.getAgent(e))},selectAgent:e=>{i=(0,o.cloneDeep)(e),C(a.AGENT_SELECTED,u())},getSelectedAgent:u,onSelectedAgentChanged:e=>(i&&angular.isFunction(e)&&e(u()),m(a.AGENT_SELECTED,t=>e(t))),getDefaultAgent:()=>(0,o.cloneDeep)(s),setDefaultAgent:e=>{s=e},setCanModifyAgent:e=>{c=(0,o.cloneDeep)(e),C(a.CAN_MODIFY_AGENT_UPDATED,T())},getCanModifyAgent:T,onCanUpdateAgentUpdated:e=>(angular.isFunction(e)&&e(T()),m(a.CAN_MODIFY_AGENT_UPDATED,t=>e(t))),hasExplainResponse:A,toggleExplainResponse:e=>{A(e)&&(l[e].expanded=!l[e].expanded,C(a.EXPLAIN_RESPONSE_CACHE_UPDATED,_()))},getExplainResponse:e=>(0,o.cloneDeep)(l[e]),addExplainResponseCache:e=>{l[e.answerId]=(0,o.cloneDeep)(e),C(a.EXPLAIN_RESPONSE_CACHE_UPDATED,_())},onExplainResponseCacheUpdated:e=>(angular.isFunction(e)&&e(_()),m(a.EXPLAIN_RESPONSE_CACHE_UPDATED,t=>e(t)))}}angular.module("graphdb.framework.ttyg.services.ttygcontext",[]).factory("TTYGContextService",r),r.$inject=["EventEmitterService","TTYGService"];const a={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",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",CAN_MODIFY_AGENT_UPDATED:"canModifyAgentUpdated"}},89598:(e,t,n)=>{n.r(t),n.d(t,{markdownCodeCopyPlugin:()=>a});const o={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function r(e,t){return t=_.merge({},o,t),(...n)=>{const[o,r]=n,a=o[r],i=o[r].content.replaceAll('"',"&quot;").replaceAll("'","&apos;"),s=e(...n);return"fence"===a.type&&s.trim()?`<div style="position: relative">\n ${s}\n <copy-to-clipboard\n style="${t.buttonStyle}"\n class="${t.buttonClass}"\n tooltip-text="ttyg.chat_panel.btn.copy_sparql.tooltip"\n text-to-copy="${i}">\n </copy-to-clipboard>\n </div>`:s}}const a=(e,t)=>{e.renderer.rules.code_block=r(e.renderer.rules.code_block,t),e.renderer.rules.fence=r(e.renderer.rules.fence,t)}},89647:(e,t,n)=>{function o(e,t){return{templateUrl:"js/angular/core/templates/markdown-content/markdown-content.html",restrict:"E",scope:{content:"@",options:"="},link:function(n,o){n.markdownContent=void 0;n.markdownContent=t.renderMarkdown(n.content,n.options),n.$evalAsync(()=>{const t=o.find(".markdown-content");e(angular.element(t).contents())(n)})}}}n.r(t),n(12940),angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",o),o.$inject=["$compile","MarkdownService"]},98268:(e,t,n)=>{n.r(t);var o=n(69937);function r(e,t,n,r){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn" gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="fa fa-bracket-curly"></i><i class="fa fa-ellipsis"></i><i class="fa fa-bracket-curly-right"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@"},link:function(a,i){a.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";const s="true"===a.executeQuery;a.onGoToSparqlEditorView=()=>{const r=e.getActiveRepository();r&&r===a.repositoryId?l(a.query):n.openConfirmationModal({title:t.instant("common.confirm"),message:(0,o.Gz)(t.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:a.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{e.setRepository(e.getRepository(a.repositoryId)),l(a.query)})};const l=e=>{r.open(`/sparql?query=${encodeURIComponent(e)}&execute=${s}`,"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",r),r.$inject=["$repositories","$translate","ModalService","$window"]}};
2
+ //# sourceMappingURL=64118.fb6952c8ef6fc9117f35.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"64118.fb6952c8ef6fc9117f35.bundle.js","mappings":"6NAKA,MAAMA,EAAgC,CAClCC,YAAa,4DAGXC,EAASC,EAAAA,eAAeD,OAa9B,SAASE,EAAgBC,GACrB,MAAMC,GAAmBC,EAAAA,EAAAA,KACpBC,IAAIC,EAAAA,wBACJD,IAAIE,EAAAA,iCAAkCV,GAiC3C,MAAO,CACHW,eAXmBA,CAACC,EAAMC,KAC1B,IACI,OAAOR,EAAKS,YAjBCD,IACbA,GACON,EAAAA,EAAAA,KACFC,IAAIC,EAAAA,uBAAwBI,GAC5BL,IAAIE,EAAAA,iCAAkCK,EAAEC,MAAM,CAAC,EAAGhB,EAA+Ba,IAEnFP,EAWqBW,CAAYJ,GAAQK,OAAON,GACvD,CAAE,MAAOO,GAGL,OAFAjB,EAAOkB,MAAM,4BAA6BD,GAEnCd,EAAKS,YAAYF,E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AWgC,QAAQ,kBAC1BoK,SAASC,EAAAA,EAAAA,IAAWrM,EAAWgC,QAAQ,wDAAyD,CAACxC,aAAcsB,EAAOtB,gBACtH8M,iBAAkB,qCAEtB,KACId,EAAce,cAAcf,EAAcgB,cAAc1L,EAAOtB,eAC/DyM,EAA2BnL,EAAO0B,UAgBlD,MAAMyJ,EAA8BzJ,IAEhCkJ,EAAQe,KAAK,iBAAiBC,mBAAmBlK,cAAkBqJ,IAAW,UAEtF,EAER,CApFAzN,QACKC,OAAO,0DAA2D,IAClEmG,UAAU,qBAAsB+G,GAErCA,EAA4BhN,QAAU,CAAC,gBAAiB,aAAc,eAAgB,U","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/markdown.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/plugins/markdown-open-in-sparql-editor-plugin.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/chat-item-detail.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg.utils.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-context.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/plugins/markdown-code-copy-plugin.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/markdown-content/markdown-content.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/open-in-sparql-editor/open-in-sparql-editor.directive.js"],"sourcesContent":["import markdownIt from 'markdown-it';\nimport {markdownCodeCopyPlugin} from \"./plugins/markdown-code-copy-plugin\";\nimport {markdownOpenInSparqlEditorPlugin} from \"./plugins/markdown-open-in-sparql-editor-plugin\";\nimport {LoggerProvider} from \"../logger-provider\";\n\nconst OPEN_IN_SPARQL_PLUGIN_OPTIONS = {\n buttonStyle: 'position: absolute; top: 0; right: 0; margin-right: 24px',\n};\n\nconst logger = LoggerProvider.logger;\n\n/**\n * AngularJS service that provides methods for rendering Markdown text.\n * @class MarkdownService\n * @param {$sce} $sce - AngularJS service for Strict Contextual Escaping.\n */\nangular\n .module('graphdb.framework.core.services.markdown-service', [])\n .service('MarkdownService', MarkdownService);\n\nMarkdownService.$inject = ['$sce'];\n\nfunction MarkdownService($sce) {\n const markdownInstance = markdownIt()\n .use(markdownCodeCopyPlugin)\n .use(markdownOpenInSparqlEditorPlugin, OPEN_IN_SPARQL_PLUGIN_OPTIONS);\n\n /**\n * Retrieves a Markdown-it instance with optional custom configuration.\n * @function getMarkdown\n * @param {Object} [config] - Optional custom configuration for Markdown-it.\n * @return {Object} The Markdown instance.\n */\n const getMarkdown = (config) => {\n if (config) {\n return markdownIt()\n .use(markdownCodeCopyPlugin, config)\n .use(markdownOpenInSparqlEditorPlugin, _.merge({}, OPEN_IN_SPARQL_PLUGIN_OPTIONS, config));\n }\n return markdownInstance;\n };\n\n /**\n * Renders Markdown text into HTML.\n * @function renderMarkdown\n * @param {string} text - The Markdown text to render.\n * @return {string} The rendered HTML, or the original text in case of an error.\n */\n const renderMarkdown = (text, config) => {\n try {\n return $sce.trustAsHtml(getMarkdown(config).render(text));\n } catch (e) {\n logger.error('Error rendering markdown:', e);\n // Return the original text in case of an error\n return $sce.trustAsHtml(text);\n }\n };\n\n return {\n renderMarkdown,\n };\n}\n","const DEFAULT_MARKDOWN_CONFIGURATION = {\n buttonStyle: \"position: absolute; top: 0; right: 0;\",\n buttonClass: \"\"\n};\n\n/**\n * This function enhances the rendering of fenced code blocks in markdown that contain SPARQL queries\n * by appending an \"open in SPARQL editor\" button to each SPARQL code block.\n *\n * @param {Function} origRule The original rule function responsible for rendering code blocks.\n * @param {Object} options The options to customize the rendering. These will be merged with the default configuration.\n * Options model description:\n * ```JSON\n * {\n * // Inline CSS styles applied to position the button inside the code block. Defaults to positioning the button at the top-right of the block.\n * buttonStyle: \"position: absolute; top: 0; right: 0;\",\n * // The CSS class for styling the button.\n * buttonClass: \"\",\n * // A flag that determines whether the SPARQL query should be automatically executed when opened in the SPARQL editor. Defaults to `false`.\n * executeQuery: false,\n * // The ID of the repository that the SPARQL query will be executed against.\n * repositoryId: ''\n * }\n * ```\n *\n * @return {Function} A function that renders a fenced code block with an \"open in SPARQL editor\" button when the block is recognized as containing SPARQL code.\n */\nfunction renderCode(origRule, options) {\n options = _.merge({}, DEFAULT_MARKDOWN_CONFIGURATION, options);\n return (...args) => {\n const [tokens, idx] = args;\n const token = tokens[idx];\n\n const content = tokens[idx].content\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", \"&apos;\");\n const origRendered = origRule(...args);\n\n if (token.type === 'fence' && token.info === 'sparql' && origRendered.trim()) {\n return `<div style=\"position: relative\">\n ${origRendered}\n <open-in-sparql-editor\n style=\"${options.buttonStyle}\"\n class=\"${options.buttonClass}\"\n execute-query=\"${options.executeQuery}\"\n repository-id=\"${options.repositoryId}\"\n query=\"${content}\">\n </open-in-sparql-editor>\n </div>`;\n } else {\n return origRendered;\n }\n };\n}\n\nexport const markdownOpenInSparqlEditorPlugin = (md, options) => {\n md.renderer.rules.code_block = renderCode(md.renderer.rules.code_block, options);\n md.renderer.rules.fence = renderCode(md.renderer.rules.fence, options);\n};\n","import 'angular/core/directives/markdown-content/markdown-content';\nimport 'angular/core/directives/open-in-sparql-editor/open-in-sparql-editor.directive';\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {ExplainQueryType} from \"../../models/ttyg/explain-response\";\nimport {getHumanReadableTimestamp} from \"../services/ttyg.utils\";\n\nconst modules = [\n 'graphdb.framework.core.directives.open-in-sparql-editor',\n 'graphdb.framework.core.directives.markdown-content'\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.chat-item-detail', modules)\n .directive('chatItemDetail', ChatItemDetailComponent);\n\nChatItemDetailComponent.$inject = ['toastr', '$translate', 'TTYGContextService', 'TTYGService', '$filter'];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.ttyg.directives.chat-detail:chatItemDetail\n * @restrict E\n * @description\n *\n * This directive represents a component that displays a chat data.\n *\n * @example\n * <chat-item-detail chat-item=\"chatItem\"></chat-item-detail>\n */\nfunction ChatItemDetailComponent(toastr, $translate, TTYGContextService, TTYGService, $filter) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/chat-item-detail.html',\n scope: {\n chatItemDetail: '=',\n showActions: '=',\n asking: '=',\n disabled: '=',\n onRegenerateQuestion: '&',\n onAskHowDeliveredAnswer: '&'\n },\n link: ($scope, element, attrs) => {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.ExplainQueryType = ExplainQueryType;\n $scope.repositoryId = undefined;\n $scope.markdownContentOptions = undefined;\n\n /**\n * Mapping of agent id to agent name which is used to display the agent name in the UI.\n * @type {{[key: string]: string}}\n */\n $scope.agentNameByIdMap = {};\n\n /**\n * @type {{[key: string]: ExplainResponseModel}}\n */\n $scope.explainResponseModel = {};\n\n /**\n * Mapping of answer id to a boolean value indicating whether the explanation of how the answer was\n * generated is being loaded.\n * @type {{[key: string]: boolean}}\n */\n $scope.loadingExplainResponse = {};\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n $scope.regenerateQuestion = () => {\n $scope.onRegenerateQuestion({chatItem: $scope.chatItemDetail});\n };\n\n /**\n * Extract the explanation of how the answer was generated.\n * @param {string} answerId\n */\n $scope.explainResponse = (answerId) => {\n if (TTYGContextService.hasExplainResponse(answerId)) {\n TTYGContextService.toggleExplainResponse(answerId);\n } else {\n $scope.loadingExplainResponse[answerId] = true;\n TTYGService.explainResponse($scope.chatItemDetail, answerId)\n .then((explainResponse) => {\n TTYGContextService.addExplainResponseCache(explainResponse);\n })\n .catch(() => {\n toastr.error($translate.instant('ttyg.chat_panel.messages.explain_response_failure'));\n })\n .finally(() => $scope.loadingExplainResponse[answerId] = false);\n }\n };\n\n /**\n * Triggers an asking how the answer was generated.\n */\n $scope.onAskHowAnswerWasDerived = () => {\n $scope.onAskHowDeliveredAnswer();\n };\n\n /**\n * Handles the click event on the token usage info button.\n * No additional actions are needed at this time; the handler simply prevents\n * the default button behavior and stops the event from bubbling up.\n *\n * @param {Event} event - The click event object.\n */\n $scope.onTokenUsageInfo = (event) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * Opens <code>query</code> in sparql editor.\n * @param {string} query\n */\n $scope.onOpenInSparqlEditor = (query) => {\n if ($scope.chatItemDetail.agentId) {\n TTYGContextService.emit(TTYGEventName.GO_TO_SPARQL_EDITOR, {\n query,\n repositoryId: $scope.repositoryId\n });\n }\n };\n\n $scope.showRawQuery = (queryMethod) => {\n // TODO: Create a chat panel model and move this check there when the model is updated.\n const rawQueryNoSpaces = queryMethod.rawQuery.replace(/\\s+/g, '');\n const queryNoSpaces = queryMethod.query.replace(/\\s+/g, '');\n return rawQueryNoSpaces && rawQueryNoSpaces !== queryNoSpaces;\n };\n\n $scope.getRepositoryId = (f) => {\n const agent = TTYGContextService.getAgent($scope.chatItemDetail.agentId);\n return agent ? agent.repositoryId : '';\n };\n\n $scope.getHumanReadableQuestionTimestamp = (timestamp) => {\n return getHumanReadableTimestamp($translate, $filter, timestamp);\n };\n\n // =========================\n // Private functions\n // =========================\n const init = () => {\n $scope.repositoryId = $scope.getRepositoryId();\n $scope.markdownContentOptions = {repositoryId: $scope.repositoryId};\n updateExplainResponseModel();\n };\n\n const onExplainResponseCacheUpdated = () => {\n updateExplainResponseModel();\n };\n\n const updateExplainResponseModel = () => {\n $scope.chatItemDetail.answers.forEach((answer) => {\n $scope.explainResponseModel[answer.id] = TTYGContextService.getExplainResponse(answer.id);\n });\n };\n\n const onAgentsListChanged = () => {\n $scope.agentNameByIdMap = TTYGContextService.getAgents().agentNameByIdMap;\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push(TTYGContextService.onExplainResponseCacheUpdated(onExplainResponseCacheUpdated));\n subscriptions.push(TTYGContextService.onAgentsListChanged(onAgentsListChanged));\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n init();\n }\n };\n}\n","export const getHumanReadableTimestamp = ($translate, $filter, timestamp, options = {}) => {\n\n if (!timestamp) {\n return '';\n }\n\n const date = new Date(timestamp);\n const today = new Date();\n\n // Get start of today\n const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate());\n\n // Get start of yesterday\n const yesterdayStart = new Date(todayStart);\n yesterdayStart.setDate(todayStart.getDate() - 1);\n\n // Get start of the timestamp's day\n const dateStart = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n const time = options.timeFormat ? $filter('date')(date, options.timeFormat) : '';\n\n if (dateStart.getTime() === todayStart.getTime()) {\n return $translate.instant('common.dates.today') + time;\n } else if (dateStart.getTime() === yesterdayStart.getTime()) {\n return $translate.instant('common.dates.yesterday') + time;\n } else {\n // ISO format is the least ambiguous if no date format is passed.\n const dateFormat = options.dateFormat || 'yyyy-MM-dd';\n return $filter('date')(date, dateFormat) + time;\n }\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 /**\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 let _canModifyAgent = false;\n\n const resetContext = () => {\n _agents = undefined;\n _chats = undefined;\n _selectedChat = undefined;\n _selectedAgent = undefined;\n _explainCache = {};\n _defaultAgent = undefined;\n _canModifyAgent = false;\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 /** 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 * Updates the \"canModifyAgent\" flag and emits the 'canModifyAgentUpdated' event to notify listeners that the canModifyAgent flag is changed.\n *\n * @param {boolean} canModifyAgent\n */\n const setCanModifyAgent = (canModifyAgent) => {\n _canModifyAgent = cloneDeep(canModifyAgent);\n emit(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, getCanModifyAgent());\n };\n\n const getCanModifyAgent = () => {\n return _canModifyAgent;\n };\n\n /**\n * Subscribes to the 'canModifyAgentUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onCanUpdateAgentUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getCanModifyAgent());\n }\n return subscribe(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, (canModifyAgent) => callback(canModifyAgent));\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 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 setCanModifyAgent,\n getCanModifyAgent,\n onCanUpdateAgentUpdated,\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 \"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 CAN_MODIFY_AGENT_UPDATED: \"canModifyAgentUpdated\",\n};\n","const DEFAULT_MARKDOWN_CONFIGURATION = {\n buttonStyle: \"position: absolute; top: 0; right: 0;\",\n buttonClass: \"\"\n};\n\n/**\n * This function enhances the rendering of code blocks in markdown by appending a \"copy to clipboard\" button to each code block.\n *\n * @param {Function} origRule The original rule function responsible for rendering code blocks.\n * @param {Object} options The options to customize the rendering. These will be merged with the default configuration.\n * Options model description:\n * ```JSON\n * {\n * // Inline CSS styles applied to position the button inside the code block. Defaults to positioning the button at the top-right of the block.\n * buttonStyle: \"position: absolute; top: 0; right: 0;\",\n * // The CSS class for styling the button. The default applies Bootstrap-like styles with a small button size and a secondary theme\n * buttonClass: \"btn btn-link btn-sm secondary\",\n * }\n * ```\n * @return {Function} A function that renders a code block with a \"copy to clipboard\" button, when a fenced code block is detected.\n */\nfunction renderCode(origRule, options) {\n options = _.merge({}, DEFAULT_MARKDOWN_CONFIGURATION, options);\n return (...args) => {\n const [tokens, idx] = args;\n const token = tokens[idx];\n\n const content = tokens[idx].content\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", \"&apos;\");\n const origRendered = origRule(...args);\n\n if (token.type === 'fence' && origRendered.trim()) {\n return `<div style=\"position: relative\">\n ${origRendered}\n <copy-to-clipboard\n style=\"${options.buttonStyle}\"\n class=\"${options.buttonClass}\"\n tooltip-text=\"ttyg.chat_panel.btn.copy_sparql.tooltip\"\n text-to-copy=\"${content}\">\n </copy-to-clipboard>\n </div>`;\n } else {\n return origRendered;\n }\n };\n}\n\nexport const markdownCodeCopyPlugin = (md, options) => {\n md.renderer.rules.code_block = renderCode(md.renderer.rules.code_block, options);\n md.renderer.rules.fence = renderCode(md.renderer.rules.fence, options);\n};\n","import 'angular/core/services/markdown/markdown.service';\n\nconst modules = [\n 'graphdb.framework.core.services.markdown-service'\n];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives.markdown-content:markdownContent\n * @restrict E\n *\n * @description\n * The `markdownContent` directive is used to render and compile Markdown content inside AngularJS applications.\n * It dynamically compiles any AngularJS directives within the rendered Markdown content, ensuring that the\n * directives are properly recognized and executed.\n *\n * @param {string=} content The markdown content to be rendered. This can be passed dynamically from the scope.\n * @param {object=} options Optional configuration object to pass to the Markdown rendering engine, providing\n * customization for how the Markdown is rendered.\n *\n * @example\n * Usage:\n * <markdown-content content=\"markdownText\" options=\"markdownOptions\"></markdown-content>\n */\nangular\n .module('graphdb.framework.core.directives.markdown-content', modules)\n .directive('markdownContent', markdownContentDirective);\n\nmarkdownContentDirective.$inject = ['$compile', 'MarkdownService'];\n\nfunction markdownContentDirective($compile, MarkdownService) {\n return {\n templateUrl: 'js/angular/core/templates/markdown-content/markdown-content.html',\n restrict: 'E',\n scope: {\n content: '@',\n options: '='\n },\n link: function ($scope, element) {\n\n // =========================\n // Public variables\n // =========================\n\n /**\n * The rendered HTML content generated from the provided Markdown.\n *\n * @type {string} markdownContent\n */\n $scope.markdownContent = undefined;\n\n // =========================\n // Private functions\n // =========================\n\n const init = () => {\n $scope.markdownContent = MarkdownService.renderMarkdown($scope.content, $scope.options);\n compileMarkdownAnswerContents();\n };\n\n /**\n * Manually compiles AngularJS directives within the dynamically generated markdown HTML content.\n * AngularJS does not automatically detect and compile directives inside HTML that is dynamically\n * inserted, so this function ensures that the content is compiled after it is rendered.\n */\n const compileMarkdownAnswerContents = () => {\n $scope.$evalAsync(() => {\n // Find the dynamically rendered element that needs to be compiled\n const markdownElement = element.find('.markdown-content');\n $compile(angular.element(markdownElement).contents())($scope);\n });\n };\n\n init();\n }\n };\n}\n","import {decodeHTML} from \"../../../../../app\";\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives.open-in-sparql-editor.directive:openInSparqlEditor\n * @restrict E\n *\n * @description\n * This directive provides a button that allows users to open the SPARQL editor with a pre-defined query.\n * Optionally, it can handle repository switching before opening the editor and executing the query.\n * The directive can also trigger the query execution automatically if specified.\n *\n * @scope\n *\n * @param {string} query The SPARQL query to be opened and optionally executed in the SPARQL editor.\n * @param {string} repositoryId The ID of the repository to be selected before opening the SPARQL editor.\n * @param {string} executeQuery Flag that determines whether the query should be executed upon opening the editor.\n * It accepts 'true' or 'false'. If 'true', the query will be automatically executed.\n *\n * @example\n * <open-in-sparql-editor\n * query=\"SELECT * WHERE {?s ?p ?o}\"\n * repository-id=\"myRepository\"\n * execute-query=\"true\">\n * </open-in-sparql-editor>\n *\n * @requires $repositories\n * @requires $translate\n * @requires ModalService\n * @requires $window\n *\n * @param {string} query The SPARQL query to be executed in the new tab.\n */\n\nangular\n .module('graphdb.framework.core.directives.open-in-sparql-editor', [])\n .directive('openInSparqlEditor', openInSparqlEditorDirective);\n\nopenInSparqlEditorDirective.$inject = ['$repositories', '$translate', 'ModalService', '$window'];\n\nfunction openInSparqlEditorDirective($repositories, $translate, ModalService, $window) {\n return {\n // Note: the line-height of the element must match the line-height of the icon.\n // This defines a composite FontAwesome icon to match the style of the surrounding icons.\n template: `\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class=\"btn btn-link btn-sm open-in-sparql-editor-btn\" gdb-tooltip=\"{{'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip' | translate}}\" ng-click=\"onGoToSparqlEditorView()\" guide-selector=\"open-in-sparql-editor-btn\">\n <i class=\"fa fa-bracket-curly\"></i><i class=\"fa fa-ellipsis\"></i><i class=\"fa fa-bracket-curly-right\"></i>\n </button>\n `,\n restrict: 'E',\n scope: {\n query: '@',\n repositoryId: '@',\n executeQuery: '@'\n },\n link: function ($scope, element) {\n\n // =========================\n // Public variables\n // =========================\n\n $scope.tooltipText = 'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip';\n // =========================\n // Private functions\n // =========================\n const execute = $scope.executeQuery === 'true';\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Opens the SPARQL editor in a new browser tab with the specified query and optional execution.\n */\n $scope.onGoToSparqlEditorView = () => {\n const activeRepositoryId = $repositories.getActiveRepository();\n if (!activeRepositoryId || activeRepositoryId !== $scope.repositoryId) {\n // Open a confirmation modal before switching the repository\n ModalService.openConfirmationModal(\n {\n title: $translate.instant('common.confirm'),\n message: decodeHTML($translate.instant('ttyg.chat_panel.dialog.confirm_repository_change.body', {repositoryId: $scope.repositoryId})),\n confirmButtonKey: 'ttyg.chat_panel.btn.proceed.label'\n },\n () => {\n $repositories.setRepository($repositories.getRepository($scope.repositoryId));\n openInSparqlEditorInNewTab($scope.query);\n }\n );\n } else {\n // No repository switch needed, just open the SPARQL editor\n openInSparqlEditorInNewTab($scope.query);\n }\n };\n // =========================\n // Private functions\n // =========================\n\n /**\n * Opens SPARQL editor view with passed query and handles repository switch if necessary.\n * @param {string} query\n */\n const openInSparqlEditorInNewTab = (query) => {\n // Open the SPARQL editor in a new tab and execute the query\n $window.open(`/sparql?query=${encodeURIComponent(query)}&execute=${execute}`, '_blank');\n };\n }\n };\n}\n"],"names":["OPEN_IN_SPARQL_PLUGIN_OPTIONS","buttonStyle","logger","LoggerProvider","MarkdownService","$sce","markdownInstance","markdownIt","use","markdownCodeCopyPlugin","markdownOpenInSparqlEditorPlugin","renderMarkdown","text","config","trustAsHtml","_","merge","getMarkdown","render","e","error","angular","module","service","$inject","DEFAULT_MARKDOWN_CONFIGURATION","buttonClass","renderCode","origRule","options","args","tokens","idx","token","content","replaceAll","origRendered","type","info","trim","executeQuery","repositoryId","md","renderer","rules","code_block","fence","ChatItemDetailComponent","toastr","$translate","TTYGContextService","TTYGService","$filter","restrict","templateUrl","scope","chatItemDetail","showActions","asking","disabled","onRegenerateQuestion","onAskHowDeliveredAnswer","link","$scope","element","attrs","ExplainQueryType","undefined","markdownContentOptions","agentNameByIdMap","explainResponseModel","loadingExplainResponse","regenerateQuestion","chatItem","explainResponse","answerId","hasExplainResponse","toggleExplainResponse","then","addExplainResponseCache","catch","instant","finally","onAskHowAnswerWasDerived","onTokenUsageInfo","event","preventDefault","stopPropagation","onOpenInSparqlEditor","query","agentId","emit","TTYGEventName","GO_TO_SPARQL_EDITOR","showRawQuery","queryMethod","rawQueryNoSpaces","rawQuery","replace","queryNoSpaces","getRepositoryId","f","agent","getAgent","getHumanReadableQuestionTimestamp","timestamp","getHumanReadableTimestamp","updateExplainResponseModel","answers","forEach","answer","id","getExplainResponse","subscriptions","push","onExplainResponseCacheUpdated","onAgentsListChanged","getAgents","$on","removeAllSubscribers","subscription","directive","date","Date","today","todayStart","getFullYear","getMonth","getDate","yesterdayStart","setDate","dateStart","time","timeFormat","getTime","dateFormat","EventEmitterService","_agents","_chats","_selectedChat","_selectedAgent","_defaultAgent","_explainCache","_canModifyAgent","cloneDeep","getChats","updateChats","chats","CHAT_LIST_UPDATED","getSelectedChat","getSelectedAgent","_getExplainResponseCache","getCanModifyAgent","tTYGEventName","payload","emitSync","subscribe","callback","subscribeSync","resetContext","addChat","newChat","appendChat","replaceChat","oldChat","onChatsListChanged","isFunction","selectChat","selectedChat","SELECT_CHAT","deselectChat","deleteChat","chat","onSelectedChatChanged","updateSelectedChat","SELECTED_CHAT_UPDATED","onSelectedChatUpdated","onLastMessageReceived","LAST_MESSAGE_RECEIVED","updateAgents","agents","AGENT_LIST_UPDATED","selectAgent","selectedAgent","AGENT_SELECTED","onSelectedAgentChanged","getDefaultAgent","setDefaultAgent","setCanModifyAgent","canModifyAgent","CAN_MODIFY_AGENT_UPDATED","onCanUpdateAgentUpdated","expanded","EXPLAIN_RESPONSE_CACHE_UPDATED","explainResponses","factory","CREATE_CHAT","CREATE_CHAT_SUCCESSFUL","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","LOAD_CHATS","LOAD_CHAT_SUCCESSFUL","LOAD_CHAT_FAILURE","OPEN_AGENT_SETTINGS","EDIT_AGENT","CLONE_AGENT","DELETE_AGENT","AGENT_DELETED","DELETING_AGENT","GO_TO_CREATE_SIMILARITY_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_AUTOCOMPLETE_INDEX_VIEW","EXPLAIN_RESPONSE","markdownContentDirective","$compile","markdownContent","$evalAsync","markdownElement","find","contents","openInSparqlEditorDirective","$repositories","ModalService","$window","template","tooltipText","execute","onGoToSparqlEditorView","activeRepositoryId","getActiveRepository","openInSparqlEditorInNewTab","openConfirmationModal","title","message","decodeHTML","confirmButtonKey","setRepository","getRepository","open","encodeURIComponent"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__=66014;export const __webpack_ids__=[15435,56139,56413,66014,71156,83610,84923];export const __webpack_modules__={15435:(n,e,t)=>{t.r(e),t.d(e,{RenderingMode:()=>o});const o={YASGUI:"mode-yasgui",YASQE:"mode-yasqe",YASR:"mode-yasr"}},56139:()=>{function n(n,e){return{showToastMessageWithDelay:function(t){return new Promise(o=>{n.success(e.instant(t)),setTimeout(o,300)})}}}angular.module("graphdb.framework.utils.notifications",[]).factory("Notifications",n),n.$inject=["toastr","$translate"]},56413:(n,e,t)=>{t.r(e),t.d(e,{DEFAULT_SPARQL_QUERY:()=>o,JdbcConfigurationInfo:()=>i});const o="PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\n# Selects two variables to use as columns\nSELECT ?id ?label {\n ?id rdfs:label ?label\n # The following placeholder must be present in the query\n #!filter\n}";class i{constructor(n=o,e=!0,t=void 0){this.query=n,this.jdbcConfigurationName=t,this.isNewJdbcConfiguration=e,this.isValidQuery=!0,this.isValidQueryType=!0,this.hasUndefinedColumns=!1,this.isColumnsEmpty=!1,this.columns=[]}}},66014:(n,e,t)=>{t.r(e),t(76933),t(83351),t(56139),t(82493),t(81655);var o=t(56413),i=t(71156),r=t(84923),s=t(15435),a=t(83610),c=t(85727),u=t(69937),l=t(57154),g=t(304);angular.module("graphdb.framework.jdbc.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.rest.monitoring.service","toastr","graphdb.framework.utils.event-emitter-service"],["graphdb.framework.utils.notifications"]).controller("JdbcListCtrl",f).controller("JdbcCreateCtrl",m),f.$inject=["$scope","$repositories","JdbcRestService","toastr","ModalService","$translate"];const d=g.LoggerProvider.logger;function f(n,e,t,o,i,r){n.getSqlConfigurations=function(){!e.getActiveRepository()||e.isActiveRepoOntopType()||e.isActiveRepoFedXType()?n.jdbcConfigurations=[]:t.getJdbcConfigurations().success(function(e){n.jdbcConfigurations=e}).error(function(n){const e=getError(n);o.error(e,r.instant("jdbc.not.get.SQL.msg"))})},n.$watch(function(){return e.getActiveRepository()},function(){n.getSqlConfigurations()}),n.deleteConfiguration=function(e){i.openSimpleModal({title:r.instant("common.warning"),message:r.instant("jdbc.delete.sql.table.warning.msg",{name:e}),warning:!0}).result.then(function(){t.deleteJdbcConfiguration(e).success(function(){n.getSqlConfigurations()}).error(function(n){o.error(getError(n),r.instant("jdbc.not.delete.sql.msg"))})})}}function m(n,e,t,g,f,m,b,p,C,y,h,j,w,v,R,S){e.emptySparqlResponse='{"head": {"vars": []},"results": {"bindings": []}}',e.getSuggestionSqlType="",e.sqlTypes=[],e.activeTab=1,e.jdbcConfigurationInfo=new o.JdbcConfigurationInfo,e.jdbcConfigurationInfo.jdbcConfigurationName=g.search().name||"",e.saveOrUpdateExecuted=!1,e.jdbcConfigurationInfo.isNewJdbcConfiguration=!e.jdbcConfigurationInfo.jdbcConfigurationName,e.language=R.getLanguage(),e.isDirty=!1,e.prefixes=[],e.loadingControllerResources=!1,e.isQueryRunning=!1,e.canEditActiveRepo=!1;let q=!0,E=!0;e.saveJdbcConfiguration=()=>{if(e.saveOrUpdateExecuted=!0,!e.jdbcConfigurationInfo.jdbcConfigurationName)return;if(!e.isDirty)return void B();const n=e.jdbcConfigurationInfo.isNewJdbcConfiguration?A:J;Q(e.jdbcConfigurationInfo).then(D).then($).then(Y).then(n).catch(n=>{if(!(n instanceof r.JdbcConfigurationError)){const e=getError(n);f.error(e,v.instant("jdbc.not.saved.configuration"))}})},e.getPreview=()=>{e.activeTab=1,e.isQueryRunning=!0,Q(e.jdbcConfigurationInfo).then(D).then($).then(Y).then(n=>(N({render:s.RenderingMode.YASQE,initialQuery:n.query}),n)).then(I).then(([n,e])=>{const t=n&&n.results.bindings&&n.results.bindings.length>0;let o=s.RenderingMode.YASGUI;t||(o=s.RenderingMode.YASQE,f.info(v.instant("jdbc.table.definition"),v.instant("jdbc.preview.sql"))),N({render:o,sparqlResponse:n,initialQuery:e.query})}).catch(n=>{n instanceof r.JdbcConfigurationError?n.jdbcConfigurationInfo&&(n.jdbcConfigurationInfo.isColumnsEmpty||n.jdbcConfigurationInfo.hasUndefinedColumns)&&(x(),e.activeTab=2):f.error(getError(n,0,100),v.instant("jdbc.not.show.preview"))}).finally(()=>{e.isQueryRunning=!1})},e.setActiveTab=n=>{e.activeTab=n;const t=e.jdbcConfigurationInfo.columns;2!==e.activeTab||t&&0!==t.length||Q(e.jdbcConfigurationInfo).then(D).then(()=>{e.getColumnsSuggestions()})},e.setDirty=()=>{e.isDirty=!0},e.getTypeLabel=n=>{switch(n){case"iri":return"VARCHAR: IRI";case"string":return"VARCHAR: String";default:return n.indexOf(" ")>0?n:n.toUpperCase()}},e.selectColumnType=(n,t)=>{e.setDirty();const o=e.jdbcConfigurationInfo.columns.find(e=>e.column_name===n);o.column_type===e.getSuggestionSqlType&&Y(e.jdbcConfigurationInfo).then(e=>y.getColumnsTypeSuggestion(e.query,[n])).then(n=>n.data).then(n=>{(0,a.updateColumn)(o,n),T(o.column_type,t)}).catch(n=>{f.error(getError(n),v.instant("jdbc.not.suggest.column.type"))})},e.deleteColumn=function(n,t){w.openSimpleModal({title:v.instant("common.warning"),message:v.instant("jdbc.warning.delete.column.msg",{columnName:n}),warning:!0}).result.then(function(){e.jdbcConfigurationInfo.columns.splice(t,1),e.setDirty()})},e.getColumnsSuggestions=()=>{e.jdbcConfigurationInfo.columns&&e.jdbcConfigurationInfo.columns.length>0?w.openSimpleModal({title:v.instant("common.warning"),message:v.instant("jdbc.warning.column.type.msg"),warning:!0}).result.then(function(){x()}):x()},e.hasPrecision=n=>"iri"===n||"string"===n||"decimal"===n,e.containsColumnsWithPrecision=n=>n&&n.some(n=>e.hasPrecision(n.column_type)),e.containsColumnsWithScale=n=>n&&n.some(n=>O(n.column_type)),e.isLiteral=n=>"iri"!==n&&"unknown"!==n,e.containsNonLiteralColumnsOnly=n=>n&&n.every(n=>!e.isLiteral(n.column_type));const I=n=>{if(e.canWriteActiveRepo){const t=JSON.stringify({name:e.jdbcConfigurationInfo.jdbcConfigurationName,query:e.jdbcConfigurationInfo.query,columns:e.jdbcConfigurationInfo.columns||[]});return Promise.all([y.getNewSqlTablePreview(t).then(n=>n.data),Promise.resolve(n)])}return Promise.all([y.getExistingSqlTablePreview(e.jdbcConfigurationInfo.jdbcConfigurationName).then(n=>n.data),Promise.resolve(n)])},T=(n,e)=>{n===e?f.info((0,u.Gz)(v.instant("jdbc.same.suggested.sql.type",{type:n})),v.instant("jdbc.suggest.sql.type"),{allowHtml:!0}):f.success((0,u.Gz)(v.instant("jdbc.suggested.sql.type",{type:n})),v.instant("jdbc.suggest.sql.type"),{allowHtml:!0})},_=(n,t=new o.JdbcConfigurationInfo)=>{e.jdbcConfigurationInfo.columns=t.columns,e.jdbcConfigurationInfo.query=t.query,e.jdbcConfigurationInfo.jdbcConfigurationName=g.search().name||"",e.jdbcConfigurationInfo.isNewJdbcConfiguration=!e.jdbcConfigurationInfo.jdbcConfigurationName,e.prefixes=n,N(),W()},A=n=>{const t={name:n.jdbcConfigurationName,query:n.query,columns:n.columns};return y.createNewJdbcConfiguration(t).then(()=>{e.isDirty=!1,e.jdbcConfigurationInfo.isNewConfiguration=!1,f.success(v.instant("jdbc.saved.configuration")),F()})},J=n=>{const t={name:n.jdbcConfigurationName,query:n.query,columns:n.columns};return y.updateJdbcConfiguration(t).then(()=>{e.isDirty=!1,e.jdbcConfigurationInfo.isNewConfiguration=!1,f.success(v.instant("jdbc.configuration.updated")),F()})},N=(n={})=>{const t={};angular.extend(t,e.yasguiConfig||P(),n),e.yasguiConfig=t},P=()=>({showEditorTabs:!1,showToolbar:!1,showResultTabs:!1,showQueryButton:!1,showResultInfo:!1,downloadAsOn:!1,showYasqeResizer:!1,initialQuery:e.jdbcConfigurationInfo.query,componentId:"jdbc-component",prefixes:e.prefixes,maxPersistentResponseSize:0,render:s.RenderingMode.YASQE,getCellContent:k,sparqlResponse:e.emptySparqlResponse,yasqeActionButtons:c.DISABLE_YASQE_BUTTONS_CONFIGURATION,yasqeMode:e.canEditActiveRepo?i.YasqeMode.WRITE:i.YasqeMode.READ}),Q=n=>U().getQueryType().then(e=>(n.isValidQueryType="SELECT"===e,n.isValidQueryType?n:Promise.reject(new r.JdbcConfigurationError("Query type is not valid.")))),D=n=>U().isQueryValid().then(e=>(n.isValidQuery=e,n.isValidQuery?n:Promise.reject(new r.JdbcConfigurationError("Invalid query.")))),$=n=>n.columns&&0!==n.columns.length?e.jdbcConfigurationInfo.columns&&e.jdbcConfigurationInfo.columns.find(n=>"unknown"===n.column_type)?(n.hasUndefinedColumns=!0,Promise.reject(new r.JdbcConfigurationError("There are columns without defined type.",n))):Promise.resolve(n):(n.isColumnsEmpty=!0,f.error(v.instant("jdbc.warning.one.column.msg")),Promise.reject(new r.JdbcConfigurationError("There are not defined columns.",n))),x=()=>{Q(e.jdbcConfigurationInfo).then(D).then(Y).then(L).then(M).then(n=>e.jdbcConfigurationInfo=n).catch(n=>{d.info(n)})},L=n=>y.getColumnNames(n.query).then(e=>[n,e.data]).catch(function(n){f.error(getError(n),v.instant("jdbc.not.suggest.column.names"))}),M=([n,t])=>y.getColumnsTypeSuggestion(n.query,t).then(function(o){return n.columns=(0,a.toJDBCColumns)(t,o.data),n.isColumnsEmpty=n.columns.length,e.setDirty(),n}).catch(function(n){f.error(getError(n),v.instant("jdbc.not.suggest.column.types"))}),U=()=>c.YasguiComponentDirectiveUtil.getOntotextYasguiElement("#query-editor"),Y=n=>U().getQuery().then(e=>(n.query=e,n)),O=n=>"decimal"===n,k=(n,e)=>{let t=n.value;return t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"<div class = 'literal-cell'><p class='nonUri' style='border: none; background-color: transparent; padding: 0; margin: 0'>"+t+"</p></div>"},V=(n,e,t,o)=>{w.openSimpleModal({title:n,message:e,warning:!0}).result.then(function(){angular.isFunction(t)&&t()},function(){angular.isFunction(o)&&o()})},W=()=>{e.getSuggestionSqlType=v.instant("view.jdbc.create.get_suggestion_sql_type"),e.sqlTypes=["string","iri","boolean","byte","short","int","long","float","double","decimal","date","time","timestamp",e.getSuggestionSqlType]},F=()=>{setTimeout(function(){B()},1e3)},B=()=>{g.url("/jdbc")},G=n=>{e.isDirty&&(n.returnValue=!0)},z=()=>{window.removeEventListener("beforeunload",G),H.forEach(n=>n())},H=[],X=l.ServiceProvider.get(l.RepositoryContextService).onSelectedRepositoryChanged(n=>{n&&(E?E=!1:U().abortQuery().then(B))},()=>new Promise(function(n){if(e.jdbcConfigurationInfo.isNewJdbcConfiguration)return void n(!0);const t=()=>{e.isDirty=!1,n(!0)};if(e.isDirty){const e=()=>{n(!1)},o=v.instant("common.confirm"),i=v.instant("jdbc.warning.unsaved.changes");V(o,i,t,e)}else t()}));H.push(X),H.push(t.$on("$translateChangeSuccess",()=>{e.language=R.getLanguage(),W()})),H.push(e.$on("$locationChangeStart",(n,t)=>{if(e.isDirty){n.preventDefault();const e=v.instant("common.confirm"),o=v.instant("jdbc.warning.unsaved.changes");V(e,o,()=>{z();const n=g.absUrl().length-g.url().length,e=t.substring(n);g.path(e)})}else z()})),H.push(e.$on("$destroy",z)),window.addEventListener("beforeunload",G),H.push(e.$watch(e.getActiveRepositoryObject,n=>{n&&(e.canEditActiveRepo=e.canWriteActiveRepo(),q?((()=>{e.loadingControllerResources=!0;const n=m.getActiveRepository();e.jdbcConfigurationInfo.jdbcConfigurationName?Promise.all([m.getPrefixes(n),y.getJdbcConfiguration(e.jdbcConfigurationInfo.jdbcConfigurationName)]).then(([n,e])=>{_(n,e.data)}).finally(()=>e.loadingControllerResources=!1):m.getPrefixes(n).then(n=>_(n)).finally(()=>e.loadingControllerResources=!1)})(),q=!1):U().abortQuery().then(B))}))}m.$inject=["$q","$scope","$rootScope","$location","toastr","$repositories","$window","$timeout","$interval","JdbcRestService","RDF4JRepositoriesRestService","SparqlRestService","ModalService","$translate","$languageService","EventEmitterService"]},71156:(n,e,t)=>{t.r(e),t.d(e,{YasqeMode:()=>o});const o={WRITE:"WRITE",READ:"READ",PROTECTED:"PROTECTED"}},83610:(n,e,t)=>{t.r(e),t.d(e,{JdbcColumn:()=>o,toJDBCColumns:()=>i,updateColumn:()=>r});class o{constructor(){this.column_name="",this.column_type="",this.sparql_type="",this.nullable=!0}}const i=(n=[],e)=>n.map(n=>({column_name:n,column_type:e[n].column_type,nullable:!0,sparql_type:e[n].sparql_type})),r=(n,e)=>{n.column_type=e[n.column_name].column_type,n.sparql_type=e[n.column_name].sparql_type}},84923:(n,e,t)=>{t.r(e),t.d(e,{JdbcConfigurationError:()=>o});class o extends Error{constructor(n,e){super(n),this.jdbcConfigurationInfo=e}}}};
2
+ //# sourceMappingURL=66014.d9f7b86d6829ebfe9d0e.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"66014.d9f7b86d6829ebfe9d0e.bundle.js","mappings":"iMAAO,MAAMA,EAAgB,CACzBC,OAAQ,cACRC,MAAO,aACPC,KAAM,Y,aCGV,SAASC,EAAcC,EAAQC,GAC3B,MAAO,CACHC,0BASJ,SAAmCC,GAC/B,OAAO,IAAIC,QAASC,IAChBL,EAAOM,QAAQL,EAAWM,QAAQJ,IAClCK,WAAWH,EAAG,MAEtB,EACJ,CAvBAI,QACKC,OAAO,wCAAyC,IAChDC,QAAQ,gBAAiBZ,GAE9BA,EAAca,QAAU,CAAC,SAAU,a,yFCJ5B,MAAMC,EAAuB,mOAS7B,MAAMC,EACTC,WAAAA,CAAYC,EAAQH,EAAsBI,GAAyB,EAAMC,OAAwBC,GAC7FC,KAAKJ,MAAQA,EACbI,KAAKF,sBAAwBA,EAC7BE,KAAKH,uBAAyBA,EAC9BG,KAAKC,cAAe,EACpBD,KAAKE,kBAAmB,EACxBF,KAAKG,qBAAsB,EAC3BH,KAAKI,gBAAiB,EACtBJ,KAAKK,QAAU,EACnB,E,2KCIJhB,QAAQC,OAAO,qCARC,CACZ,eACA,+CACA,4CACA,SACA,iDAG0D,CAC1D,0CAECgB,WAAW,eAAgBC,GAC3BD,WAAW,iBAAkBE,GAElCD,EAAaf,QAAU,CAAC,SAAU,gBAAiB,kBAAmB,SAAU,eAAgB,cAEhG,MAAMiB,EAASC,EAAAA,eAAeD,OAE9B,SAASF,EAAaI,EAAQC,EAAeC,EAAiBjC,EAAQkC,EAAcjC,GAChF8B,EAAOI,qBAAuB,YAGtBH,EAAcI,uBACVJ,EAAcK,yBACdL,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src/js/angular/models/ontotext-yasgui/rendering-mode.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/utils/notifications.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/jdbc/jdbc-configuration-info.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/jdbc/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ontotext-yasgui/yasqe-mode.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/jdbc/jdbc-column.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/jdbc/jdbc-configuration-error.js"],"sourcesContent":["export const RenderingMode = {\n YASGUI: 'mode-yasgui',\n YASQE: 'mode-yasqe',\n YASR: 'mode-yasr'\n};\n","angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 300);\n });\n }\n}\n","export const DEFAULT_SPARQL_QUERY = 'PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\\n' +\n '\\n' +\n '# Selects two variables to use as columns\\n' +\n 'SELECT ?id ?label {\\n' +\n ' ?id rdfs:label ?label\\n' +\n ' # The following placeholder must be present in the query\\n' +\n ' #!filter\\n' +\n '}';\n\nexport class JdbcConfigurationInfo {\n constructor(query = DEFAULT_SPARQL_QUERY, isNewJdbcConfiguration = true, jdbcConfigurationName = undefined) {\n this.query = query;\n this.jdbcConfigurationName = jdbcConfigurationName;\n this.isNewJdbcConfiguration = isNewJdbcConfiguration;\n this.isValidQuery = true;\n this.isValidQueryType = true;\n this.hasUndefinedColumns = false;\n this.isColumnsEmpty = false;\n this.columns = [];\n }\n}\n","import 'angular/core/services/repositories.service';\nimport 'angular/rest/monitoring.rest.service';\nimport 'angular/utils/notifications';\nimport 'angular/core/services';\nimport 'angular/core/services/event-emitter-service';\nimport {JdbcConfigurationInfo} from \"../models/jdbc/jdbc-configuration-info\";\nimport {YasqeMode} from \"../models/ontotext-yasgui/yasqe-mode\";\nimport {JdbcConfigurationError} from \"../models/jdbc/jdbc-configuration-error\";\nimport {RenderingMode} from \"../models/ontotext-yasgui/rendering-mode\";\nimport {toJDBCColumns, updateColumn} from \"../models/jdbc/jdbc-column\";\nimport {DISABLE_YASQE_BUTTONS_CONFIGURATION, YasguiComponentDirectiveUtil} from \"../core/directives/yasgui-component/yasgui-component-directive.util\";\nimport {decodeHTML} from \"../../../app\";\nimport {RepositoryContextService, ServiceProvider} from \"@ontotext/workbench-api\";\nimport {LoggerProvider} from \"../core/services/logger-provider\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.rest.monitoring.service',\n 'toastr',\n 'graphdb.framework.utils.event-emitter-service',\n];\n\nangular.module('graphdb.framework.jdbc.controllers', modules, [\n 'graphdb.framework.utils.notifications',\n])\n .controller('JdbcListCtrl', JdbcListCtrl)\n .controller('JdbcCreateCtrl', JdbcCreateCtrl);\n\nJdbcListCtrl.$inject = ['$scope', '$repositories', 'JdbcRestService', 'toastr', 'ModalService', '$translate'];\n\nconst logger = LoggerProvider.logger;\n\nfunction JdbcListCtrl($scope, $repositories, JdbcRestService, toastr, ModalService, $translate) {\n $scope.getSqlConfigurations = function() {\n // Only do this if there is an active repo that isn't an Ontop or FedX repo.\n // Ontop and FedX repos don't support JDBC.\n if ($repositories.getActiveRepository()\n && !$repositories.isActiveRepoOntopType()\n && !$repositories.isActiveRepoFedXType()) {\n JdbcRestService.getJdbcConfigurations().success(function(data) {\n $scope.jdbcConfigurations = data;\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('jdbc.not.get.SQL.msg'));\n });\n } else {\n $scope.jdbcConfigurations = [];\n }\n };\n\n $scope.$watch(function() {\n return $repositories.getActiveRepository();\n }, function() {\n $scope.getSqlConfigurations();\n });\n\n $scope.deleteConfiguration = function(name) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.warning'),\n message: $translate.instant('jdbc.delete.sql.table.warning.msg', {name: name}),\n warning: true,\n }).result\n .then(function() {\n JdbcRestService.deleteJdbcConfiguration(name).success(function() {\n $scope.getSqlConfigurations();\n }).error(function(e) {\n toastr.error(getError(e), $translate.instant('jdbc.not.delete.sql.msg'));\n });\n });\n };\n}\n\nJdbcCreateCtrl.$inject = [\n '$q',\n '$scope',\n '$rootScope',\n '$location',\n 'toastr',\n '$repositories',\n '$window',\n '$timeout',\n '$interval',\n 'JdbcRestService',\n 'RDF4JRepositoriesRestService',\n 'SparqlRestService',\n 'ModalService',\n '$translate',\n '$languageService',\n 'EventEmitterService'];\n\nfunction JdbcCreateCtrl(\n $q,\n $scope,\n $rootScope,\n $location,\n toastr,\n $repositories,\n $window,\n $timeout,\n $interval,\n JdbcRestService,\n RDF4JRepositoriesRestService,\n SparqlRestService,\n ModalService,\n $translate,\n $languageService,\n EventEmitterService) {\n $scope.emptySparqlResponse = \"{\\\"head\\\": {\\\"vars\\\": []},\\\"results\\\": {\\\"bindings\\\": []}}\";\n $scope.getSuggestionSqlType = '';\n $scope.sqlTypes = [];\n $scope.activeTab = 1;\n $scope.jdbcConfigurationInfo = new JdbcConfigurationInfo();\n $scope.jdbcConfigurationInfo.jdbcConfigurationName = $location.search().name || '';\n $scope.saveOrUpdateExecuted = false;\n $scope.jdbcConfigurationInfo.isNewJdbcConfiguration = !$scope.jdbcConfigurationInfo.jdbcConfigurationName;\n $scope.language = $languageService.getLanguage();\n $scope.isDirty = false;\n $scope.prefixes = [];\n $scope.loadingControllerResources = false;\n $scope.isQueryRunning = false;\n $scope.canEditActiveRepo = false;\n\n // This flag is used to prevent loading of the yasgui on consecutive repository change events after\n // the first.\n let initialRepoInitialization = true;\n\n // This flag is used to prevent triggering the repository change event listener on initial subscription.\n let initialRepoChangeTrigger = true;\n\n // =========================\n // Public functions\n // =========================\n\n $scope.saveJdbcConfiguration = () => {\n $scope.saveOrUpdateExecuted = true;\n\n if (!$scope.jdbcConfigurationInfo.jdbcConfigurationName) {\n return;\n }\n\n if (!$scope.isDirty) {\n goToJdbcView();\n return;\n }\n\n const saveOrUpdate = $scope.jdbcConfigurationInfo.isNewJdbcConfiguration ? createConfiguration : updateConfiguration;\n\n validateQueryType($scope.jdbcConfigurationInfo)\n .then(validateQuery)\n .then(validateColumns)\n .then(updateJdbcConfigurationQuery)\n .then(saveOrUpdate)\n .catch((error) => {\n if (!(error instanceof JdbcConfigurationError)) {\n const msg = getError(error);\n toastr.error(msg, $translate.instant('jdbc.not.saved.configuration'));\n }\n });\n };\n\n $scope.getPreview = () => {\n $scope.activeTab = 1;\n\n $scope.isQueryRunning = true;\n validateQueryType($scope.jdbcConfigurationInfo)\n .then(validateQuery)\n .then(validateColumns)\n .then(updateJdbcConfigurationQuery)\n .then((jdbcConfigurationInfo) => {\n updateYasguiConfiguration({render: RenderingMode.YASQE, initialQuery: jdbcConfigurationInfo.query});\n return jdbcConfigurationInfo;\n })\n .then(getSqlTablePreview)\n .then(([tablePreviewResults, jdbcConfigurationInfo]) => {\n const hasResult = tablePreviewResults && tablePreviewResults.results.bindings && tablePreviewResults.results.bindings.length > 0;\n let render = RenderingMode.YASGUI;\n if (!hasResult) {\n render = RenderingMode.YASQE;\n toastr.info($translate.instant('jdbc.table.definition'), $translate.instant('jdbc.preview.sql'));\n }\n updateYasguiConfiguration({\n render,\n sparqlResponse: tablePreviewResults,\n initialQuery: jdbcConfigurationInfo.query,\n });\n })\n .catch((error) => {\n if (!(error instanceof JdbcConfigurationError)) {\n toastr.error(getError(error, 0, 100), $translate.instant('jdbc.not.show.preview'));\n } else {\n if (error.jdbcConfigurationInfo && (error.jdbcConfigurationInfo.isColumnsEmpty || error.jdbcConfigurationInfo.hasUndefinedColumns)) {\n getSuggestions();\n $scope.activeTab = 2;\n }\n }\n })\n .finally(() => {\n $scope.isQueryRunning = false;\n });\n };\n\n $scope.setActiveTab = (tabIndex) => {\n $scope.activeTab = tabIndex;\n const columns = $scope.jdbcConfigurationInfo.columns;\n if ($scope.activeTab === 2 && (!columns || columns.length === 0)) {\n validateQueryType($scope.jdbcConfigurationInfo)\n .then(validateQuery)\n .then(() => {\n $scope.getColumnsSuggestions();\n });\n }\n };\n\n $scope.setDirty = () => {\n $scope.isDirty = true;\n };\n\n $scope.getTypeLabel = (type) => {\n switch (type) {\n case 'iri':\n return 'VARCHAR: IRI';\n case 'string':\n return 'VARCHAR: String';\n default:\n return type.indexOf(' ') > 0 ? type : type.toUpperCase();\n }\n };\n\n $scope.selectColumnType = (columnName, prevColumnType) => {\n $scope.setDirty();\n const column = $scope.jdbcConfigurationInfo.columns.find((column) => column.column_name === columnName);\n\n if (column.column_type === $scope.getSuggestionSqlType) {\n updateJdbcConfigurationQuery($scope.jdbcConfigurationInfo)\n .then((jdbcConfigurationInfo) => JdbcRestService.getColumnsTypeSuggestion(jdbcConfigurationInfo.query, [columnName]))\n .then((response) => response.data)\n .then((columnSuggestion) => {\n updateColumn(column, columnSuggestion);\n notifyColumnTypeChanged(column.column_type, prevColumnType);\n })\n .catch((error) => {\n toastr.error(getError(error), $translate.instant('jdbc.not.suggest.column.type'));\n });\n }\n };\n\n $scope.deleteColumn = function(columnName, index) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.warning'),\n message: $translate.instant('jdbc.warning.delete.column.msg', {columnName: columnName}),\n warning: true,\n }).result\n .then(function() {\n $scope.jdbcConfigurationInfo.columns.splice(index, 1);\n $scope.setDirty();\n });\n };\n\n $scope.getColumnsSuggestions = () => {\n if ($scope.jdbcConfigurationInfo.columns && $scope.jdbcConfigurationInfo.columns.length > 0) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.warning'),\n message: $translate.instant('jdbc.warning.column.type.msg'),\n warning: true,\n }).result\n .then(function() {\n getSuggestions();\n });\n } else {\n getSuggestions();\n }\n };\n\n $scope.hasPrecision = (columnType) => {\n return columnType === 'iri' || columnType === 'string' || columnType === 'decimal';\n };\n\n $scope.containsColumnsWithPrecision = (columns) => {\n return columns && columns.some((el) => $scope.hasPrecision(el.column_type));\n };\n\n $scope.containsColumnsWithScale = (columns) => {\n return columns && columns.some((el) => hasScale(el.column_type));\n };\n\n $scope.isLiteral = (columnType) => {\n return columnType !== 'iri' && columnType !== 'unknown';\n };\n\n $scope.containsNonLiteralColumnsOnly = (columns) => {\n return columns && columns.every((el) => !$scope.isLiteral(el.column_type));\n };\n\n // =========================\n // Private functions\n // =========================\n\n const getSqlTablePreview = (jdbcConfigurationInfo) => {\n if ($scope.canWriteActiveRepo) {\n const sqlView = JSON.stringify({\n name: $scope.jdbcConfigurationInfo.jdbcConfigurationName,\n query: $scope.jdbcConfigurationInfo.query,\n columns: $scope.jdbcConfigurationInfo.columns || [],\n });\n return Promise.all([JdbcRestService.getNewSqlTablePreview(sqlView).then((response) => response.data), Promise.resolve(jdbcConfigurationInfo)]);\n } else {\n return Promise.all([JdbcRestService.getExistingSqlTablePreview($scope.jdbcConfigurationInfo.jdbcConfigurationName).then((response) => response.data), Promise.resolve(jdbcConfigurationInfo)]);\n }\n };\n\n const notifyColumnTypeChanged = (currentColumnType, prevColumnType) => {\n if (currentColumnType === prevColumnType) {\n toastr.info(decodeHTML($translate.instant('jdbc.same.suggested.sql.type', {type: currentColumnType})),\n $translate.instant('jdbc.suggest.sql.type'), {allowHtml: true});\n } else {\n toastr.success(decodeHTML($translate.instant('jdbc.suggested.sql.type', {type: currentColumnType})),\n $translate.instant('jdbc.suggest.sql.type'), {allowHtml: true});\n }\n };\n\n const init = (prefixes, jdbcConfiguration = new JdbcConfigurationInfo()) => {\n $scope.jdbcConfigurationInfo.columns = jdbcConfiguration.columns;\n $scope.jdbcConfigurationInfo.query = jdbcConfiguration.query;\n $scope.jdbcConfigurationInfo.jdbcConfigurationName = $location.search().name || '';\n $scope.jdbcConfigurationInfo.isNewJdbcConfiguration = !$scope.jdbcConfigurationInfo.jdbcConfigurationName;\n $scope.prefixes = prefixes;\n updateYasguiConfiguration();\n updateSqlTypes();\n };\n\n const createConfiguration = (jdbcConfigurationInfo) => {\n const configuration = {\n name: jdbcConfigurationInfo.jdbcConfigurationName,\n query: jdbcConfigurationInfo.query,\n columns: jdbcConfigurationInfo.columns,\n };\n\n return JdbcRestService.createNewJdbcConfiguration(configuration)\n .then(() => {\n $scope.isDirty = false;\n $scope.jdbcConfigurationInfo.isNewConfiguration = false;\n toastr.success($translate.instant('jdbc.saved.configuration'));\n goBack();\n });\n };\n\n const updateConfiguration = (jdbcConfigurationInfo) => {\n const configuration = {\n name: jdbcConfigurationInfo.jdbcConfigurationName,\n query: jdbcConfigurationInfo.query,\n columns: jdbcConfigurationInfo.columns,\n };\n return JdbcRestService.updateJdbcConfiguration(configuration)\n .then(() => {\n $scope.isDirty = false;\n $scope.jdbcConfigurationInfo.isNewConfiguration = false;\n toastr.success($translate.instant('jdbc.configuration.updated'));\n goBack();\n });\n };\n\n\n const updateYasguiConfiguration = (additionalConfiguration = {}) => {\n const config = {};\n angular.extend(config, $scope.yasguiConfig || getDefaultYasguiConfiguration(), additionalConfiguration);\n $scope.yasguiConfig = config;\n };\n\n const getDefaultYasguiConfiguration = () => {\n return {\n showEditorTabs: false,\n showToolbar: false,\n showResultTabs: false,\n showQueryButton: false,\n showResultInfo: false,\n downloadAsOn: false,\n showYasqeResizer: false,\n initialQuery: $scope.jdbcConfigurationInfo.query,\n componentId: 'jdbc-component',\n prefixes: $scope.prefixes,\n maxPersistentResponseSize: 0,\n render: RenderingMode.YASQE,\n getCellContent: getCellContent,\n sparqlResponse: $scope.emptySparqlResponse,\n yasqeActionButtons: DISABLE_YASQE_BUTTONS_CONFIGURATION,\n yasqeMode: $scope.canEditActiveRepo ? YasqeMode.WRITE : YasqeMode.READ,\n };\n };\n\n /**\n * Checks if query mode is valid. The mode have to be \"select\".\n * @param {JdbcConfigurationInfo} jdbcConfiguration - holds information about jdbc configuration.\n * @return {Promise<JdbcConfigurationInfo>}\n */\n const validateQueryType = (jdbcConfiguration) => {\n return getOntotextYasgui().getQueryType()\n .then((queryType) => {\n jdbcConfiguration.isValidQueryType = 'SELECT' === queryType;\n if (!jdbcConfiguration.isValidQueryType) {\n return Promise.reject(new JdbcConfigurationError('Query type is not valid.'));\n }\n return jdbcConfiguration;\n });\n };\n\n /**\n * Checks if query is valid.\n * @param {JdbcConfigurationInfo} jdbcConfigurationInfo - holds information about jdbc configuration.\n * @return {Promise<JdbcConfigurationInfo>}\n */\n const validateQuery = (jdbcConfigurationInfo) => {\n return getOntotextYasgui().isQueryValid()\n .then((valid) => {\n jdbcConfigurationInfo.isValidQuery = valid;\n if (!jdbcConfigurationInfo.isValidQuery) {\n return Promise.reject(new JdbcConfigurationError('Invalid query.'));\n }\n return jdbcConfigurationInfo;\n });\n };\n\n /**\n * Checks if jdbc configuration has columns without defined type.\n * @param {JdbcConfigurationInfo} jdbcConfiguration - holds information about jdbc configuration.\n * @return {Promise<JdbcConfigurationInfo>}\n */\n const validateColumns = (jdbcConfiguration) => {\n if (!jdbcConfiguration.columns || jdbcConfiguration.columns.length === 0) {\n jdbcConfiguration.isColumnsEmpty = true;\n toastr.error($translate.instant('jdbc.warning.one.column.msg'));\n return Promise.reject(new JdbcConfigurationError('There are not defined columns.', jdbcConfiguration));\n }\n const unknownColumn = $scope.jdbcConfigurationInfo.columns && $scope.jdbcConfigurationInfo.columns\n .find((el) => el.column_type === 'unknown');\n if (unknownColumn) {\n jdbcConfiguration.hasUndefinedColumns = true;\n return Promise.reject(new JdbcConfigurationError('There are columns without defined type.', jdbcConfiguration));\n }\n return Promise.resolve(jdbcConfiguration);\n };\n\n const getSuggestions = () => {\n validateQueryType($scope.jdbcConfigurationInfo)\n .then(validateQuery)\n .then(updateJdbcConfigurationQuery)\n .then(getColumnNames)\n .then(getColumnsTypeSuggestion)\n .then((jdbcConfigurationInfo) => $scope.jdbcConfigurationInfo = jdbcConfigurationInfo)\n .catch((error) => {\n logger.info(error);\n });\n };\n\n const getColumnNames = (jdbcConfigurationInfo) => {\n return JdbcRestService.getColumnNames(jdbcConfigurationInfo.query)\n .then((response) => [jdbcConfigurationInfo, response.data])\n .catch(function(e) {\n toastr.error(getError(e), $translate.instant('jdbc.not.suggest.column.names'));\n });\n };\n\n const getColumnsTypeSuggestion = ([jdbcConfigurationInfo, columns]) => {\n return JdbcRestService.getColumnsTypeSuggestion(jdbcConfigurationInfo.query, columns)\n .then(function(response) {\n jdbcConfigurationInfo.columns = toJDBCColumns(columns, response.data);\n jdbcConfigurationInfo.isColumnsEmpty = jdbcConfigurationInfo.columns.length;\n $scope.setDirty();\n return jdbcConfigurationInfo;\n }).catch(function(e) {\n toastr.error(getError(e), $translate.instant('jdbc.not.suggest.column.types'));\n });\n };\n\n const getOntotextYasgui = () => {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElement('#query-editor');\n };\n\n const updateJdbcConfigurationQuery = (jdbcConfigurationInfo) => {\n return getOntotextYasgui().getQuery()\n .then((query) => {\n jdbcConfigurationInfo.query = query;\n return jdbcConfigurationInfo;\n });\n };\n\n const hasScale = (columnType) => {\n return columnType === 'decimal';\n };\n\n const getCellContent = (bindings, _prefixes) => {\n let value = bindings.value;\n value = value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n const entityHtml = \"<p class='nonUri' style='border: none; background-color: transparent; padding: 0; margin: 0'>\"\n + value + \"</p>\";\n return \"<div class = 'literal-cell'>\" + entityHtml + \"</div>\";\n };\n\n const openConfirmDialog = (title, message, onConfirm, onCancel) => {\n ModalService.openSimpleModal({\n title,\n message,\n warning: true,\n }).result.then(function() {\n if (angular.isFunction(onConfirm)) {\n onConfirm();\n }\n }, function() {\n if (angular.isFunction(onCancel)) {\n onCancel();\n }\n });\n };\n\n /**\n * Starts loading of needed data and process the view.\n */\n const loadOntotextYasgui = () => {\n $scope.loadingControllerResources = true;\n const activeRepository = $repositories.getActiveRepository();\n if ($scope.jdbcConfigurationInfo.jdbcConfigurationName) {\n Promise.all([$repositories.getPrefixes(activeRepository), JdbcRestService.getJdbcConfiguration($scope.jdbcConfigurationInfo.jdbcConfigurationName)])\n .then(([prefixes, templateContent]) => {\n init(prefixes, templateContent.data);\n })\n .finally(() => $scope.loadingControllerResources = false);\n } else {\n $repositories.getPrefixes(activeRepository)\n .then((prefixes) => init(prefixes))\n .finally(() => $scope.loadingControllerResources = false);\n }\n };\n\n /**\n * Translates \"Get suggestion...\" sql type option and updates sql type options with it.\n */\n const updateSqlTypes = () => {\n $scope.getSuggestionSqlType = $translate.instant('view.jdbc.create.get_suggestion_sql_type');\n $scope.sqlTypes = ['string', 'iri', 'boolean', 'byte', 'short', 'int', 'long', 'float', 'double', 'decimal', 'date', 'time', 'timestamp', $scope.getSuggestionSqlType];\n };\n\n /**\n * go to jdbc configurations page.\n */\n const goBack = () => {\n // Added timeout a success message to be shown.\n setTimeout(function() {\n goToJdbcView();\n }, 1000);\n };\n\n const goToJdbcView = () => {\n $location.url('/jdbc');\n };\n\n // =========================\n // Subscriptions handlers\n // =========================\n const languageChangedHandler = () => {\n $scope.language = $languageService.getLanguage();\n updateSqlTypes();\n };\n\n const repositoryWillChangeHandler = () => {\n return new Promise(function(resolve) {\n if ($scope.jdbcConfigurationInfo.isNewJdbcConfiguration) {\n resolve(true);\n return;\n }\n\n const onConfirm = () => {\n $scope.isDirty = false;\n resolve(true);\n };\n\n if ($scope.isDirty) {\n const onCancel = () => {\n resolve(false);\n };\n const title = $translate.instant('common.confirm');\n const message = $translate.instant('jdbc.warning.unsaved.changes');\n openConfirmDialog(title, message, onConfirm, onCancel);\n } else {\n onConfirm();\n }\n });\n };\n\n const locationChangedHandler = (event, newPath) => {\n if ($scope.isDirty) {\n event.preventDefault();\n const title = $translate.instant('common.confirm');\n const message = $translate.instant('jdbc.warning.unsaved.changes');\n const onConfirm = () => {\n removeAllListeners();\n const baseLen = $location.absUrl().length - $location.url().length;\n const path = newPath.substring(baseLen);\n $location.path(path);\n };\n openConfirmDialog(title, message, onConfirm);\n } else {\n removeAllListeners();\n }\n };\n\n const beforeunloadHandler = (event) => {\n if ($scope.isDirty) {\n event.returnValue = true;\n }\n };\n\n const removeAllListeners = () => {\n window.removeEventListener('beforeunload', beforeunloadHandler);\n subscriptions.forEach((subscription) => subscription());\n };\n\n const repositoryChangedHandler = (repository) => {\n if (!repository) {\n return;\n }\n if (initialRepoChangeTrigger) {\n initialRepoChangeTrigger = false;\n } else {\n getOntotextYasgui().abortQuery().then(goToJdbcView);\n }\n };\n\n const activeRepositoryHandler = (activeRepo) => {\n if (activeRepo) {\n $scope.canEditActiveRepo = $scope.canWriteActiveRepo();\n if (initialRepoInitialization) {\n loadOntotextYasgui();\n initialRepoInitialization = false;\n } else {\n getOntotextYasgui().abortQuery().then(goToJdbcView);\n }\n }\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n const repositoryContextService = ServiceProvider.get(RepositoryContextService);\n const repositoryChangeSubscription = repositoryContextService.onSelectedRepositoryChanged(repositoryChangedHandler, repositoryWillChangeHandler);\n\n subscriptions.push(repositoryChangeSubscription);\n subscriptions.push($rootScope.$on('$translateChangeSuccess', languageChangedHandler));\n subscriptions.push($scope.$on('$locationChangeStart', locationChangedHandler));\n subscriptions.push($scope.$on('$destroy', removeAllListeners));\n // Prevent go out of the current page? check\n window.addEventListener('beforeunload', beforeunloadHandler);\n\n\n // Wait until the active repository object is set, otherwise \"canWriteActiveRepo()\" may return a wrong result and the \"ontotext-yasgui\"\n // readOnly configuration may be incorrect.\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, activeRepositoryHandler));\n}\n","export const YasqeMode = {\n /**\n * The query can be edited.\n */\n WRITE: 'WRITE',\n\n /**\n * The editor is read-only, but the query can be copied.\n */\n READ: 'READ',\n\n /**\n * The editor is read-only and the query can't be copied.\n */\n PROTECTED: 'PROTECTED'\n};\n","/**\n * DTO\n */\nexport class JdbcColumn {\n constructor() {\n this.column_name = '';\n this.column_type = '';\n this.sparql_type = '';\n this.nullable = true;\n }\n}\n\n/**\n * Constructs an array with {@link JdbcColumn} objects for everyone column of <code>columnNames</code>.\n *\n * @param {string[]} columnNames - array with column names.\n * @param {Object} columnTypes - objects that holds key-value pair. The key is column id, the value is {@link JdbcColumnType} object.\n * @return {JdbcColumn[]} the array with jdbc columns.\n */\nexport const toJDBCColumns = (columnNames = [], columnTypes) => {\n return columnNames.map((columnName) => {\n return {\n column_name: columnName,\n column_type: columnTypes[columnName].column_type,\n nullable: true,\n sparql_type: columnTypes[columnName].sparql_type\n };\n });\n};\n\nexport const updateColumn = (column, columnSuggestion) => {\n column.column_type = columnSuggestion[column.column_name].column_type;\n column.sparql_type = columnSuggestion[column.column_name].sparql_type;\n};\n","export class JdbcConfigurationError extends Error {\n\n constructor(message, jdbcConfigurationInfo) {\n super(message);\n this.jdbcConfigurationInfo = jdbcConfigurationInfo;\n }\n}\n"],"names":["RenderingMode","YASGUI","YASQE","YASR","Notifications","toastr","$translate","showToastMessageWithDelay","message","Promise","r","success","instant","setTimeout","angular","module","factory","$inject","DEFAULT_SPARQL_QUERY","JdbcConfigurationInfo","constructor","query","isNewJdbcConfiguration","jdbcConfigurationName","undefined","this","isValidQuery","isValidQueryType","hasUndefinedColumns","isColumnsEmpty","columns","controller","JdbcListCtrl","JdbcCreateCtrl","logger","LoggerProvider","$scope","$repositories","JdbcRestService","ModalService","getSqlConfigurations","getActiveRepository","isActiveRepoOntopType","isActiveRepoFedXType","jdbcConfigurations","getJdbcConfigurations","data","error","msg","getError","$watch","deleteConfiguration","name","openSimpleModal","title","warning","result","then","deleteJdbcConfiguration","e","$q","$rootScope","$location","$window","$timeout","$interval","RDF4JRepositoriesRestService","SparqlRestService","$languageService","EventEmitterService","emptySparqlResponse","getSuggestionSqlType","sqlTypes","activeTab","jdbcConfigurationInfo","search","saveOrUpdateExecuted","language","getLanguage","isDirty","prefixes","loadingControllerResources","isQueryRunning","canEditActiveRepo","initialRepoInitialization","initialRepoChangeTrigger","saveJdbcConfiguration","goToJdbcView","saveOrUpdate","createConfiguration","updateConfiguration","validateQueryType","validateQuery","validateColumns","updateJdbcConfigurationQuery","catch","JdbcConfigurationError","getPreview","updateYasguiConfiguration","render","initialQuery","getSqlTablePreview","tablePreviewResults","hasResult","results","bindings","length","info","sparqlResponse","getSuggestions","finally","setActiveTab","tabIndex","getColumnsSuggestions","setDirty","getTypeLabel","type","indexOf","toUpperCase","selectColumnType","columnName","prevColumnType","column","find","column_name","column_type","getColumnsTypeSuggestion","response","columnSuggestion","updateColumn","notifyColumnTypeChanged","deleteColumn","index","splice","hasPrecision","columnType","containsColumnsWithPrecision","some","el","containsColumnsWithScale","hasScale","isLiteral","containsNonLiteralColumnsOnly","every","canWriteActiveRepo","sqlView","JSON","stringify","all","getNewSqlTablePreview","resolve","getExistingSqlTablePreview","currentColumnType","decodeHTML","allowHtml","init","jdbcConfiguration","updateSqlTypes","configuration","createNewJdbcConfiguration","isNewConfiguration","goBack","updateJdbcConfiguration","additionalConfiguration","config","extend","yasguiConfig","getDefaultYasguiConfiguration","showEditorTabs","showToolbar","showResultTabs","showQueryButton","showResultInfo","downloadAsOn","showYasqeResizer","componentId","maxPersistentResponseSize","getCellContent","yasqeActionButtons","DISABLE_YASQE_BUTTONS_CONFIGURATION","yasqeMode","YasqeMode","WRITE","READ","getOntotextYasgui","getQueryType","queryType","reject","isQueryValid","valid","getColumnNames","toJDBCColumns","YasguiComponentDirectiveUtil","getOntotextYasguiElement","getQuery","_prefixes","value","replace","openConfirmDialog","onConfirm","onCancel","isFunction","url","beforeunloadHandler","event","returnValue","removeAllListeners","window","removeEventListener","subscriptions","forEach","subscription","repositoryChangeSubscription","ServiceProvider","get","RepositoryContextService","onSelectedRepositoryChanged","repository","abortQuery","repositoryWillChangeHandler","push","$on","languageChangedHandler","locationChangedHandler","newPath","preventDefault","baseLen","absUrl","path","substring","addEventListener","getActiveRepositoryObject","activeRepo","loadOntotextYasgui","activeRepository","getPrefixes","getJdbcConfiguration","templateContent","PROTECTED","JdbcColumn","sparql_type","nullable","columnNames","columnTypes","map","Error","super"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- export const __webpack_id__=67888;export const __webpack_ids__=[9717,67888,73702,82926,96248];export const __webpack_modules__={9717:()=>{function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419:(e,r,o)=>{o.r(r),o(96248);var t=o(28847),s=o(78618);function c(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.ImportResourceStatus,r.toTitleCase=e=>s.toTitleCase(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",c),c.$inject=["$uibModal"]},67888:(e,r,o)=>{o.r(r),o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702:()=>{function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926:()=>{function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.2.0-TR1">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},83136:(e,r,o)=>{o.r(r);var t=o(28847),s=(o(54419),o(9717),o(18025)),c=o(57436),i=o(7796),a=o(56636),l=o(25079);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},u={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function n(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,n,m)=>{o.resources=new c.ImportResourceTreeElement,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=u,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.ImportResourceStatus,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.SortingType,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),u.ALL===o.selectedByStatus?o.resources.setSelection(!0):u.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.ImportResourceStatus.DONE]):u.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.ImportResourceStatus.IMPORTING,t.ImportResourceStatus.NONE,t.ImportResourceStatus.ERROR,t.ImportResourceStatus.PENDING,t.ImportResourceStatus.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),S(),o.displayResources=o.resources.toList().filter(E).filter(A),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},S=()=>{s.SortingType.NAME===o.sortedBy?o.resources.sort(y(o.sortAsc)):s.SortingType.SIZE===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.SortingType.MODIFIED===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.SortingType.IMPORTED===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.SortingType.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},y=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),T=e=>(r,o)=>{const t=(0,l.convertToBytes)(r.importResource.size),s=(0,l.convertToBytes)(o.importResource.size);return e?t-s:s-t},f=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},h=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),E=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),A=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=i.TABS.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.ImportResourceTreeService.toImportResourceTree(e,t),t&&(o.sortedBy=s.SortingType.MODIFIED)):a.ImportResourceTreeService.mergeResourceTree(o.resources,e,t),a.ImportResourceTreeService.calculateElementIndent(o.resources),a.ImportResourceTreeService.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new c.ImportResourceTreeElement)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",n),n.$inject=["$timeout","ImportContextService"]},96248:()=>{function e(e,r,o,t,s){e.message=s,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{console.error("Could not copy text: ",e)})}}angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",e),e.$inject=["$scope","$uibModalInstance","$translate","toastr","message"]}};
2
- //# sourceMappingURL=67888.7d4966e0a22ba655f1b8.bundle.js.map
1
+ export const __webpack_id__=67888;export const __webpack_ids__=[9717,67888,73702,82926,96248];export const __webpack_modules__={9717:()=>{function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419:(e,r,o)=>{o.r(r),o(96248);var t=o(28847),s=o(78618);function c(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.ImportResourceStatus,r.toTitleCase=e=>s.toTitleCase(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",c),c.$inject=["$uibModal"]},67888:(e,r,o)=>{o.r(r),o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702:()=>{function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926:()=>{function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.2.0-TR2">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},83136:(e,r,o)=>{o.r(r);var t=o(28847),s=(o(54419),o(9717),o(18025)),c=o(57436),i=o(7796),a=o(56636),l=o(25079);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},u={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function n(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,n,m)=>{o.resources=new c.ImportResourceTreeElement,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=u,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.ImportResourceStatus,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.SortingType,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),u.ALL===o.selectedByStatus?o.resources.setSelection(!0):u.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.ImportResourceStatus.DONE]):u.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.ImportResourceStatus.IMPORTING,t.ImportResourceStatus.NONE,t.ImportResourceStatus.ERROR,t.ImportResourceStatus.PENDING,t.ImportResourceStatus.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),S(),o.displayResources=o.resources.toList().filter(E).filter(A),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},S=()=>{s.SortingType.NAME===o.sortedBy?o.resources.sort(y(o.sortAsc)):s.SortingType.SIZE===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.SortingType.MODIFIED===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.SortingType.IMPORTED===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.SortingType.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},y=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),T=e=>(r,o)=>{const t=(0,l.convertToBytes)(r.importResource.size),s=(0,l.convertToBytes)(o.importResource.size);return e?t-s:s-t},f=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},h=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),E=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),A=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=i.TABS.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.ImportResourceTreeService.toImportResourceTree(e,t),t&&(o.sortedBy=s.SortingType.MODIFIED)):a.ImportResourceTreeService.mergeResourceTree(o.resources,e,t),a.ImportResourceTreeService.calculateElementIndent(o.resources),a.ImportResourceTreeService.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new c.ImportResourceTreeElement)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",n),n.$inject=["$timeout","ImportContextService"]},96248:(e,r,o)=>{o.r(r);var t=o(304);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",c),c.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.LoggerProvider.logger;function c(e,r,o,t,c){e.message=c,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}}};
2
+ //# sourceMappingURL=67888.772326168aed83cbad9c.bundle.js.map
@@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AhM,EAAOmG,SAAWF,EAAAA,YAAY4D,WAGlCwC,EAAAA,0BAA0BE,kBAAkBvM,EAAOmF,UAAW4G,EAAcC,GAEhFK,EAAAA,0BAA0BG,uBAAuBxM,EAAOmF,WACxDkH,EAAAA,0BAA0BI,6BAA6BzM,EAAOmF,WAC9DqC,IACAb,OASJiF,EAAcvK,KAAKkD,EAAqBmI,oBAAqBtG,GAAepG,EAAOoG,WAAaA,IAChGwF,EAAcvK,KAAKkD,EAAqBoI,qBAAqB,IAAM3M,EAAOmF,UAAY,IAAIC,EAAAA,4BAO1FpF,EAAOsB,IAAI,WALkBsL,KACzBhB,EAAcnK,QAASoL,GAAiBA,QAOxD,CAxTAlL,QACKC,OAAO,2DANI,CACZ,8DACA,oEAKCC,UAAU,qBAAsBwC,GAErCA,EAA4BvC,QAAU,CAAC,WAAY,uB,sCC7BnDH,QACKC,OAAO,4EAA6E,IACpFW,WAAW,wCAAyCuK,GAEzDA,EAAsChL,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMiL,EAASC,EAAAA,eAAeD,OAE9B,SAASD,EAAsC9M,EAAQiN,EAAmBC,EAAYC,EAAQvK,GAC1F5C,EAAO4C,QAAUA,EAGjB5C,EAAOgB,MAAQ,KACXiM,EAAkBG,WAGtBpN,EAAOqN,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUxN,EAAO4C,SAChC6K,KAAK,KACFN,EAAOO,QAAQR,EAAWS,QAAQ,6CAClC3N,EAAOgB,SACP4M,IACAb,EAAOc,MAAM,wBAAyBD,KAGtD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.2.0-TR2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {convertToBytes} from \"../../utils/size-util\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL'\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED'\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info'\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&'\n },\n link: ($scope, element, attrs) => {\n\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = convertToBytes(r1.importResource.size);\n const r2Size = convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n }\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"sourceRoot":""}