graphdb-workbench 3.4.3-RC → 3.4.3

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 (86) hide show
  1. package/dist/{64709.6ace293745d43b76d9ae.bundle.js → 64709.e79c51ee5185765b073c.bundle.js} +2 -2
  2. package/dist/{64709.6ace293745d43b76d9ae.bundle.js.map → 64709.e79c51ee5185765b073c.bundle.js.map} +1 -1
  3. package/dist/65677.47912c97f83049f2d09a.bundle.js +2 -0
  4. package/dist/65677.47912c97f83049f2d09a.bundle.js.map +1 -0
  5. package/dist/80933.5db3ddfce394ee850b92.bundle.js +2 -0
  6. package/dist/80933.5db3ddfce394ee850b92.bundle.js.map +1 -0
  7. package/dist/82917.5c46add8a9b2dcdf239d.bundle.js +2 -0
  8. package/dist/{82917.1c1bc92bab409c22887a.bundle.js.map → 82917.5c46add8a9b2dcdf239d.bundle.js.map} +1 -1
  9. package/dist/86099.f6f43b214d77584dc0ae.bundle.js +2 -0
  10. package/dist/86099.f6f43b214d77584dc0ae.bundle.js.map +1 -0
  11. package/dist/index.html +8 -8
  12. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  13. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  14. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  15. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  16. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  17. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  18. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  19. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  20. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  21. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  22. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  23. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  24. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  25. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  26. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  27. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  28. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  29. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  30. package/dist/js/angular/security/templates/user.html +2 -2
  31. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  32. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  33. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  34. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  35. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  36. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  37. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  38. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  39. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  40. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  41. package/dist/legacyWorkbench.ddf95cc289ced708ce9d.js +3 -0
  42. package/dist/{legacyWorkbench.e2c9ec59ef3468820028.js.map → legacyWorkbench.ddf95cc289ced708ce9d.js.map} +1 -1
  43. package/dist/pages/aclmanagement.html +1 -1
  44. package/dist/pages/autocomplete.html +1 -1
  45. package/dist/pages/choose-repository-type.html +1 -1
  46. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  47. package/dist/pages/create-index.html +1 -1
  48. package/dist/pages/dependencies.html +1 -1
  49. package/dist/pages/domainRangeInfo.html +2 -2
  50. package/dist/pages/edit.html +1 -1
  51. package/dist/pages/explore.html +1 -1
  52. package/dist/pages/export.html +1 -1
  53. package/dist/pages/find.html +1 -1
  54. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  55. package/dist/pages/graphs-visualizations.html +7 -7
  56. package/dist/pages/guides.html +1 -1
  57. package/dist/pages/home.html +1 -1
  58. package/dist/pages/import.html +2 -2
  59. package/dist/pages/jdbc-create.html +1 -1
  60. package/dist/pages/jdbc.html +1 -1
  61. package/dist/pages/monitor/backup-and-restore.html +1 -1
  62. package/dist/pages/monitor/queries.html +1 -1
  63. package/dist/pages/monitor/resources.html +1 -1
  64. package/dist/pages/namespaces.html +2 -2
  65. package/dist/pages/plugins.html +1 -1
  66. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  67. package/dist/pages/rdfrank.html +2 -2
  68. package/dist/pages/repositories.html +1 -1
  69. package/dist/pages/repository.html +1 -1
  70. package/dist/pages/similarity-indexes.html +1 -1
  71. package/dist/pages/sparql-editor.html +1 -1
  72. package/dist/pages/sparql-template-create.html +1 -1
  73. package/dist/pages/sparql-templates.html +1 -1
  74. package/dist/pages/ux-test1.html +2 -2
  75. package/dist/pages/webapi.html +2 -2
  76. package/dist/res/swagger5/index.html +11 -11
  77. package/package.json +1 -1
  78. package/dist/65677.00d7db5623c3e7aa2e9e.bundle.js +0 -2
  79. package/dist/65677.00d7db5623c3e7aa2e9e.bundle.js.map +0 -1
  80. package/dist/80933.f17a753b480aaa4588e5.bundle.js +0 -2
  81. package/dist/80933.f17a753b480aaa4588e5.bundle.js.map +0 -1
  82. package/dist/82917.1c1bc92bab409c22887a.bundle.js +0 -2
  83. package/dist/86099.1a5ab5d8cb30b370eb32.bundle.js +0 -2
  84. package/dist/86099.1a5ab5d8cb30b370eb32.bundle.js.map +0 -1
  85. package/dist/legacyWorkbench.e2c9ec59ef3468820028.js +0 -3
  86. /package/dist/{legacyWorkbench.e2c9ec59ef3468820028.js.LICENSE.txt → legacyWorkbench.ddf95cc289ced708ce9d.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=80933;export const __webpack_esm_ids__=[28662,64709,78469,80933,83847];export const __webpack_esm_modules__={80933(e,r,o){o(22742),o(33136),o(41559),o(83847),o(64709),o(72953),o(75752),o(21146),o(63030),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"])},78469(e,r,o){var t=o(71315);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,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)})}}},64709(){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.4.3-RC">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},60016(e,r,o){o(78469);var t=o(2998),s=o(35195);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(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",i),i.$inject=["$uibModal"]},28662(){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"]},72953(e,r,o){var t=o(2998),s=(o(60016),o(28662),o(66256)),i=o(71609),c=o(59601),a=o(33757),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(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,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,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),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.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(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),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},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=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),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=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=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),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",u),u.$inject=["$timeout","ImportContextService"]},83847(){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"]}};
2
- //# sourceMappingURL=80933.f17a753b480aaa4588e5.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"80933.f17a753b480aaa4588e5.bundle.js","mappings":"2OAsBAA,QAAQC,OAAO,iCAZC,CACZ,SACA,UACA,eACA,eACA,6CACA,+CACA,mDACA,gEACA,4D,8BCjBJD,QACKC,OAAO,4EAA6E,IACpFC,WAAW,wCAAyCC,GAEzDA,EAAsCC,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMC,EAASC,EAAAA,EAAeD,OAE9B,SAASF,EAAsCI,EAAQC,EAAmBC,EAAYC,EAAQC,GAC1FJ,EAAOI,QAAUA,EAGjBJ,EAAOK,MAAQ,KACXJ,EAAkBK,WAGtBN,EAAOO,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUV,EAAOI,SAChCO,KAAK,KACFR,EAAOS,QAAQV,EAAWW,QAAQ,6CAClCb,EAAOK,SACPS,IACAhB,EAAOiB,MAAM,wBAAyBD,KAGtD,C,UClBA,SAASE,IACL,MAAO,CACHC,KAAM,SAAUC,EAAOC,EAASC,GAC5BF,EAAMG,OAAO,cAAe,WACE,cAAtBH,EAAMI,KAAKC,QAAgD,cAAtBL,EAAMI,KAAKC,SAC3CC,EAAEL,GAASM,IAAI,UAAUC,OAAS,GACnCF,EAAEL,GAASQ,OAAO,kBAAoBP,EAAKQ,KAAO,aAAeR,EAAKQ,KAAO,4GAGzF,EACJ,EAER,CAnBAnC,QACKC,OAAO,gEAHI,IAIXmC,UAAU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,EACJ,EAER,CAzBAjO,QACKC,OAAO,mDAHI,IAIXmC,UAAU,cAAeuL,GAE9BA,EAAYvN,QAAU,CAAC,W","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.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-message.directive.js","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-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js"],"sourcesContent":["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","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","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.4.3-RC\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\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","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 {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 {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\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 // 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 = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.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","/**\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"],"names":["angular","module","controller","ImportResourceMessageDialogController","$inject","logger","LoggerProvider","$scope","$uibModalInstance","$translate","toastr","message","close","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error","ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","directive","importResourceMessageDirective","$uibModal","restrict","templateUrl","resource","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","open","windowClass","backdrop","resolve","importResource","importResourceStatusInfoDirective","$rootScope","$document","subscribers","popoverTemplate","popoverIsOpen","context","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","closeAllDialogs","$broadcast","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","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","ByteUtils","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","validateUri","UriUtils","require","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=82917;export const __webpack_esm_ids__=[22370,23359,34064,35195,37709,65875,82917,83196,95416];export const __webpack_esm_modules__={95416(e,t,n){function r(e,t){return{templateUrl:"js/angular/core/templates/markdown-content/markdown-content.html",restrict:"E",scope:{content:"@",options:"=",trusted:"@"},link:function(n,r){n.markdownContent=void 0;const i=()=>{n.content?"true"===n.trusted?(n.markdownContent=t.renderMarkdown(n.content,n.options),o()):n.markdownContent=t.renderMarkdown(n.content,n.options,!1):n.markdownContent=void 0},o=()=>{n.$evalAsync(()=>{const t=r.find(".markdown-content");e(angular.element(t).contents())(n)})};n.$watch("content",(e,t)=>{e!==t&&i()}),i()}}}n(23359),angular.module("graphdb.framework.core.directives.markdown-content",["graphdb.framework.core.services.markdown-service"]).directive("markdownContent",r),r.$inject=["$compile","MarkdownService"]},23359(e,t,n){var r=n(88480),i=n(65875),o=n(34064),s=n(71315);const a={buttonStyle:"position: absolute; top: 0; right: 0; margin-right: 24px"},c=s.I.logger;function l(e,t){const n=(0,r.A)().use(i.f).use(o.A,a);return{renderMarkdown:(s,l,d=!0)=>{try{const c=(e=>e?(0,r.A)().use(i.f,e).use(o.A,_.merge({},a,e)):n)(l).render(s);return d?e.trustAsHtml(c):e.trustAsHtml(t(c))}catch(n){return c.error("Error rendering markdown:",n),e.trustAsHtml(d?s:t(s))}}}}angular.module("graphdb.framework.core.services.markdown-service",["ngSanitize"]).service("MarkdownService",l),l.$inject=["$sce","$sanitize"]},65875(e,t,n){n.d(t,{f:()=>o});const r={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(e,t){return t=_.merge({},r,t),(...n)=>{const[r,i]=n,o=r[i],s=r[i].content.replaceAll('"',"&quot;").replaceAll("'","&apos;"),a=e(...n);return"fence"===o.type&&a.trim()?`<div style="position: relative">\n ${a}\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="${s}">\n </copy-to-clipboard>\n </div>`:a}}const o=(e,t)=>{e.renderer.rules.code_block=i(e.renderer.rules.code_block,t),e.renderer.rules.fence=i(e.renderer.rules.fence,t)}},34064(e,t,n){n.d(t,{A:()=>o});const r={buttonStyle:"position: absolute; top: 0; right: 0;",buttonClass:""};function i(e,t){return t=_.merge({},r,t),(...n)=>{const[r,i]=n,o=r[i],s=r[i].content.replaceAll('"',"&quot;").replaceAll("'","&apos;"),a=e(...n);return"fence"===o.type&&"sparql"===o.info&&a.trim()?`<div style="position: relative">\n ${a}\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="${s}">\n </open-in-sparql-editor>\n </div>`:a}}const o=(e,t)=>{e.renderer.rules.code_block=i(e.renderer.rules.code_block,t),e.renderer.rules.fence=i(e.renderer.rules.fence,t)}},37709(e,t,n){n.d(t,{R:()=>r,e:()=>i});const r={EXTERNAL_CLICK_HANDLER:"externalClickHandler"},i={NODE_CLICK:"visgraph.click.node",EDGE_CLICK:"visgraph.click.edge"}},82917(e,t,n){n(22742),n(46547),n(15749),n(95416);var r=n(9508),i=n(82667),o=n(44482),s=(n(38473),n(83196)),a=n(35195),c=n(63581),l=n(49628),d=n(57154),p=n(37709);angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories","graphdb.framework.core.directives.markdown-content"]).controller("GraphsVisualizationsCtrl",f).controller("SaveGraphModalCtrl",h).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),f.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","ClassInstanceDetailsService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","GraphDataRestService","$translate","WorkbenchContextService","RDF4JRepositoriesService"];const u=1e3;function f(e,t,n,f,h,g,m,y,v,x,w,k,S,I,b,L,C,T,P,A,N){const M=(0,d.service)(d.SecurityContextService),R=(0,d.service)(d.RepositoryContextService),E=(0,d.service)(d.ParentWindowMessageService),O="var(--gw-focus-ring-color)",G=(0,d.service)(d.GuidesService),z=(0,d.service)(d.OntoToastrService),j=(0,d.service)(d.RuntimeConfigurationContextService);let D;const F=new Set(["lt:http://www.ontotext.com/proton/protonsys#Markdown","lt:http://ns.ontowiki.net/SysOnt/Markdown","lt:https://www.w3.org/ns/iana/media-types/text/markdown#Resource","lt:http://www.w3.org/ns/iana/media-types/text/markdown#Resource"]);e.languageChanged=!1,e.propertiesObj={},e.propertiesObj.items=[],e.propertiesQueryObj={},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=P.instant("visual.search.instance.placeholder"),e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=y.search().embedded,e.visgraphOperation=y.search().visgraphOperation,e.openedNodeInfoPanel=void 0,e.linksLimit={value:100,min:1,max:u,decreaseDisabled:!1,increaseDisabled:!1,showingLimit:!1},e.invalidLimit=!1;let B=null;e.datasource=void 0,e.adapterContainer={adapter:{remain:!0}},e.hasInitedRepository=!1,e.defaultSettings={includeInferred:!0,sameAsState:!0,truncateNodeLabels:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=_.cloneDeep(e.defaultSettings),e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},t.key="",e.predicateFilter={text:""},e.allPredicates=[],e.allReversePredicates=[],e.isMarkdownLiteral=function(e){return F.has(e)},e.onopen=e.onclose=()=>angular.noop(),e.goToHome=()=>{J();const{config:e,...t}=y.search();y.path("/graphs-visualizations").search(t)},e.filterPredicates=()=>{const t=(e.predicateFilter.text||"").toLowerCase();t?(e.predicates=(e.allPredicates||[]).filter(n=>e.splitPredicate(n.value).toLowerCase().includes(t)),e.reversePredicates=(e.allReversePredicates||[]).filter(n=>e.splitPredicate(n.value).toLowerCase().includes(t))):(e.predicates=e.allPredicates,e.reversePredicates=e.allReversePredicates)},e.shouldShowSettings=()=>e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id,e.shouldDisableSameAs=()=>{const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.propertiesFilterFunc=t=>t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0,e.toggleMoreInfo=e=>{angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("ri-arrow-down-s-line").toggleClass("ri-arrow-up-s-line")},e.copyToClipboard=e=>{w.openCopyToClipboardModal(e)},e.resetSettings=()=>{e.settings=_.cloneDeep(e.defaultSettings),ne()};const q=t=>{void 0!==t&&(e.linksLimit.value=t),e.linksLimit.decreaseDisabled=e.linksLimit.value<=1,e.linksLimit.increaseDisabled=e.linksLimit.value>=u};e.changeLimit=t=>{let n=e.linksLimit.value+t;n<1&&(n=1),n>u&&(n=u),q(n),e.updateLinksLimit()},e.updateLinksLimit=()=>{e.invalidLimit=!s.nj.test(e.linksLimit.value),q(),W()};const W=()=>{B&&h.cancel(B),B=h(()=>{e.invalidLimit||(y.search("linksLimit",e.linksLimit.value),y.state({skipOnPopState:!0}),U())},500)};function U(){e.rootNodeIri?re(e.rootNodeIri):e.queryResultsMode&&y.search().query?oe(y.search().query,y.search().sameAs,y.search().inference):"query"===e.configLoaded.startMode&&fe(e.configLoaded)}e.showSettings=()=>{e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.reversePredicates=[],e.saveSettings?e.settings=_.cloneDeep(e.saveSettings):e.settings=_.cloneDeep(e.defaultSettings),ne()},e.updateSettings=()=>{e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,function(e){return e.text}),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,function(e){return e.text}),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,function(e){return e.text}),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,function(e){return e.text}),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,function(e){return e.text}),U(),ee(),e.showInfoPanel=!1,e.showFilter=!1,I.set(b.GRAPHS_VIZ,e.saveSettings)},e.getGraphConfigs=t=>{C.getGraphConfigs().success(function(n){e.graphConfigs=n,t&&t()}).error(function(e){f.error(getError(e),P.instant("graphexplore.error.graph.configs.short.msg"))})},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,function(e){return e.id===t})[0]},e.easyGraphSearch=t=>{e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.deleteConfig=t=>{w.openSimpleModal({title:P.instant("common.confirm"),message:P.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then(function(){C.deleteGraphConfig(t).success(function(){e.getGraphConfigs(),e.refreshSavedGraphs()}).error(function(e){f.error(getError(e),P.instant("graphexplore.error.cannot.delete.config"))})})},e.goToGraphConfig=e=>{const t={config:e.id,[d.REPOSITORY_ID_PARAM]:R.getSelectedRepository().id};X(t,{config:e}),J(),fe(e)},e.replaceIRIWithPrefix=t=>{const n=e.namespaces,r=_.findLast(n,function(e){return 0===t.indexOf(e.uri)});return r?r.prefix+":"+t.substring(r.uri.length):t};const H=[];H.push(t.$on("$translateChangeSuccess",function(){e.propertiesSearchPlaceholder=P.instant("visual.search.instance.placeholder")})),H.push(j.onThemeModeChanged(e=>{e&&($e(),Ke())},!0)),H.push(A.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),H.push(R.onSelectedRepositoryChanged(t=>{t?N.getNamespaces(t.id).then(t=>{e.repositoryNamespaces=t,e.namespaces=t.namespaces}).catch(e=>{const t=getError(e);f.error(t,P.instant("error.getting.namespaces.for.repo"))}):e.repositoryNamespaces=new c.u})),H.push(e.$on("repositoryIsSet",function(t,n){const r=n||{newRepo:!1};r.newRepo&&(e.hasInitedRepository=!1),Pe(!!r.newRepo),r.newRepo&&(J(),$(".graph-visualization svg").empty(),y.search().query&&(e.goToHome(),ie()))})),H.push(t.$watch(()=>t.key,()=>{ge=0,_.each(e.propertiesObj.items,function(e){t.key>e&&ge++}),me++}));let K=!1,V=0;function Z(e){K&&e.stopPropagation()}document.addEventListener("keydown",Z,!0),e.$on("$destroy",()=>{H.forEach(e=>e()),document.removeEventListener("keydown",Z,!0),window.onpopstate=null});const Q=()=>document.querySelector(".graph-visualization"),X=(t,n)=>{e.embedded&&(t.embedded=!0),e.visgraphOperation&&(t.visgraphOperation=e.visgraphOperation),t.linksLimit=e.linksLimit.value,y.search(t),n.skipOnPopState=!0,y.state(n)},J=()=>{e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,ye={},ve=0},Y=()=>G.isActive()?e.defaultSettings:e.saveSettings,ee=()=>{Y().showLinksText?o.selectAll("svg .link-wrapper text").style("display","block"):o.selectAll("svg .link-wrapper text").style("display","none")},te=t=>{t.each(function(e){e.fontSize=r.A.Text.calcFontSizeRaw(e.labels[0].label,e.size,xe,!0)}).attr("height",function(e){return 4.2*e.fontSize}).append("xhtml:div").attr("class","node-label-body").classed("truncated-label",e.saveSettings.truncateNodeLabels).style("font-size",function(e){return e.fontSize+"px"}).append("xhtml:div").html(function(e){return l.U.getText(e.labels[0].label).replaceAll("\n","<br>")})},ne=()=>{e.settings.languagesMap=_.map(e.settings.languages,function(e){return{text:e}}),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,function(e){return{text:e}}),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,function(e){return{text:e}}),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,function(e){return{text:e}}),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,function(e){return{text:e}})},re=()=>{e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)},ie=()=>{y.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,oe(y.search().query,y.search().sameAs,y.search().inference)):e.$on("onRootNodeChange",function(t,n){e.loading=!0;const r=Y();angular.isDefined(n)&&(e.rootNodeIri=n,T.getInstanceNode({iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}).then(function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Te=new _e;const n=Te.addNode(t.data,be/2,Le/2);Ie=Se,et(n,!0)}).catch(function(t){e.loading=!1,f.error(getError(t),P.instant("graphexplore.error.could.not.load.graph"))}))}),y.search().uri&&e.openUri(y.search().uri,!0),y.search().saved&&L.getSavedGraph(y.search().saved).success(function(t){e.loadSavedGraph(t)}).error(function(e){const t=getError(e);f.error(t,P.instant("graphexplore.error.could.not.open"))})},oe=(t,n,r)=>{const i=Y(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,T.updateGraph({query:t,linksLimit:e.linksLimit.value,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}).then(function(e){Je(e)},function(t){e.loading=!1,f.error(getError(t.data),P.instant("graphexplore.error.cannot.load.graph"))})},se=(e,t)=>{const n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")},ae=e=>[e.source.iri,e.target.iri].join(">"),ce=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(se(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x},le=e=>{if(e.isTriple){const t=document.getElementById((0,a.hK)(se(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y},de=e=>{const t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`},pe=e=>{const t=e.source.isTriple?se(e.source.iri,!0):e.source.iri,n=e.target.isTriple?se(e.target.iri,!0):e.target.iri;return(0,a.hK)(`${t}>${n}>marker`)},ue=(e,t)=>{const n=t.map(t=>t[e]);return t.filter((t,r)=>n.indexOf(t[e])===r)},fe=t=>{e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?h(function(){e.openUri(t.startIRI,!0)},0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,C.loadGraphForConfig(t,t.startQueryIncludeInferred,e.linksLimit.value,t.startQuerySameAs).then(function(e){Je(e)},function(t){e.loading=!1,f.error(getError(t),P.instant("graphexplore.error.graph.load"))}))},he=function(){var t,n;y.search().config?(t=y.search().config,n=ie,t===e.defaultGraphConfig.id?fe(e.defaultGraphConfig):C.getConfig(t).then(e=>{fe(e),n()}).catch(e=>{f.error(getError(e),P.instant("graphexplore.error.could.not.load.config",{configId:t}))})):y.search().query||y.search().uri?(fe(e.defaultGraphConfig),ie()):ie()};S.onpopstate=function(t){t.state&&t.state.skipOnPopState||(J(),t.state&&(t.state.config?(fe(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0)))},e.embedded&&(y.search().query||y.search().uri||y.search().config||y.search().saved)&&(e.noGoHome=!0);let ge=0,me=0,ye={},ve=0;const xe=16,we=o.zoom().scaleExtent([.1,10]);let ke;const Se=o.zoomIdentity.translate(100,50).scale(1);we.on("zoom",function(e){G.isScrollingAllowed()&&(Ie=e.transform,ke.attr("transform",Ie))});let Ie=Se;const be=1e3,Le=1e3;let Ce;function _e(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)}),_.each(this.links,function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0})},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,function(e){let n,r;n=e.isTripleSource?ct(e.source):_.find(t,function(t){return t.iri===e.source}),r=e.isTripleTarget?ct(e.target):_.find(t,function(t){return t.iri===e.target});const i={source:n,target:r,predicates:e.predicates,rawPredicates:e.rawPredicates};if(e.isTripleSource||e.isTripleTarget){const e=`${i.source.isTriple?se(i.source.iri):i.source.iri}>${i.target.isTriple?se(i.target.iri):i.target.iri}`;if(Te.tripleLinksCopy.has(e)){const t=Te.tripleLinksCopy.get(e),n=t[0].predicates.length;t[0].predicates.push(...i.predicates),t[0].rawPredicates||(t[0].rawPredicates=new Array(n).fill(null));const r=i.rawPredicates||new Array(i.predicates.length).fill(null);return t[0].rawPredicates.push(...r),t.push(i),Te.tripleLinksCopy.set(e,t),null}Te.tripleLinksCopy.set(e,[i])}return i})}(e,t));for(const e of Te.tripleLinksCopy.keys())1===Te.tripleLinksCopy.get(e).length&&Te.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,function(t){return t.source.iri===e.iri||t.target.iri===e.iri})}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,function(t){return t.source.iri===e.iri?t.target.types:t.source.types});return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,function(e){return e.predicates});return _.uniq(_.flatten(i))},this.removeTriples=function(e){const t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,function(n){const r=e.split(">"),i=se(n.source.iri),o=se(n.target.iri);if(i===e&&Te.tripleNodes.delete(o)){const e=o.split(">");t.push({source:e[0],target:e[1]})}const s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(Te.tripleLinksCopy.delete(`${i}>${o}`),Te.tripleLinksCopy.delete(`${o}>${i}`)),s}))}),t.forEach(e=>{this.links=_.reject(this.links,function(t){return t.source.iri===e.source&&t.target.iri===e.target})})},this.removeNode=function(n){const r=[];this.links=_.reject(this.links,function(e){const t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(se(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t}),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,function(e){return 0===t(e,i)}),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){const r=[];let i=this.links;this.links=_.reject(this.links,function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(se(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s}),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,function(n){return 0===t(n,i)&&n.iri!==e.iri}),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;const r=se(e.iri);if(this.tripleNodes.has(r)){const t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:_.cloneDeep(e.labels),types:_.cloneDeep(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}}),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates,rawPredicates:e.rawPredicates}}),tripleNodes:t,tripleLinksCopy:n,colorIndex:ve,type2color:ye,transform:Ie}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=_.cloneDeep(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,function(t){t.fixed&&e.numberOfPinnedNodes++}),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(ve=t.colorIndex,ye=_.cloneDeep(t.type2color)),angular.isDefined(t.transform)&&(Ie=o.zoomIdentity.translate(t.transform.x,t.transform.y).scale(t.transform.k)),Ke()}}e.datasource={get:function(t,n,r){return x.initLazyList(t,n,r,ge,e.propertiesObj.items)},revision:function(){return me}},e.showInfoPanel=!1;let Te=new _e;function Pe(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(he))}e.addedTag=function(t){return t.text.indexOf(":")<0?(f.warning(P.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=g.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?f.warning(P.instant("graphexplore.absolute.prefixed.iri.option"),t):f.warning(P.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return f.warning(P.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return f.warning(P.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return(0,d.service)(d.LicenseContextService).getLicenseSnapshot().valid};const Ae=500,Ne=1.75,Me=getComputedStyle(document.documentElement),Re=e=>Me.getPropertyValue(e).trim();let Ee,Oe,Ge,ze;const $e=()=>{Ee=["--gw-vizgraph-node-color1-1","--gw-vizgraph-node-color2-1","--gw-vizgraph-node-color3-1"].map(Re),Oe=["--gw-vizgraph-node-color1-2","--gw-vizgraph-node-color2-2","--gw-vizgraph-node-color3-2"].map(Re),ye={},ve=0,Ge=o.interpolateRgbBasis(Ee),ze=o.interpolateRgbBasis(Oe)},je=e=>(e+e/2.6)%1;e.getColor=function(e){angular.isUndefined(ye[e])&&(ye[e]=ve,ve++);const t=ye[e];return t>39?Re("--gw-vizgraph-node-color4"):t%2==0?Ge(je(t)):ze(je(t))};const De=o.forceX(be/2).strength(.03),Fe=o.forceY(Le/2).strength(.03),Be=o.forceSimulation().velocityDecay(.6).force("x",De).force("y",Fe),qe=o.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 "+be+" "+Le).attr("preserveAspectRatio","xMidYMid meet");let We=0,Ue=0;const He=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){o.select(t).append("circle").attr("cx",function(){return e.x}).attr("cy",function(){return e.y}).attr("class","loader-container").attr("r",function(){return e.size}).style("fill","fff").style("opacity","0.7"),o.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=3.4.3-RC").attr("x",function(){return e.x-e.size+5}).attr("y",function(){return e.y-e.size}).attr("width",function(){return 2*e.size}).attr("height",function(){return 2*e.size}).attr("class","node-loader")}};function Ke(t){o.selectAll("svg g").remove(),o.selectAll(".d3-tip").remove(),o.selectAll(".menu-events").remove(),ke=qe.append("g").attr("class","nodes-container").attr("transform",function(){return angular.isDefined(Ie)&&!t?Ie:""});const n=(0,i.A)().attr("class","d3-tip").customPosition(function(){const e=Ce.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}}).html(function(t){let n="";return t.fixed&&(n+='<i class="ri-pushpin-line"></i>&nbsp;&nbsp;'),t.types.length>0?n+=t.types.map(t=>`<div> · ${e.replaceIRIWithPrefix(t)}</div>`).join(""):n+=`<i>${P.instant("visual.node.tooltip.no_types")}</i>`,n});let r;const s=function(){h.cancel(r),h.cancel(We),Ce=null,n.hide(),Ue=h(function(){tt()},500)};qe.call(n);let c=qe.selectAll(".link"),l=qe.selectAll(".node");const u=o.forceCollide(e=>e.size+5).strength(.5),g=o.forceManyBody().strength(-300);Be.nodes(Te.nodes).force("charge",g).force("collide",u).force("link",o.forceLink(Te.links).distance(function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),ke.append("defs").selectAll("marker").data(Te.links).enter().append("marker").attr("class","arrow-marker").attr("id",function(e){return pe(e)}).attr("viewBox","0 -5 10 10").attr("refX",function(e){return e.target.isTriple?11:e.target.size+11}).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),c=ke.selectAll(".link").data(Te.links).enter().append("g").attr("class","link-wrapper").attr("id",function(e){return(0,a.hK)(ae(e))}).append("line").attr("class","link").style("fill","transparent").style("marker-end",function(e){return`url(#${pe(e)})`});const m=ke.selectAll(".link-wrapper").append("text").each(function(e){e.predicateLabel=dt(e)}).text(function(e){return dt(e)}).attr("class",function(e){return e.predicates.length>1||Te.tripleNodes.has(ae(e))?"predicates":"predicate"}).attr("dy","-0.5em").style("text-anchor","middle").style("display",Y().showLinksText?"":"none").on("click",function(t,n){t.stopPropagation(),function(t,n){if(e.embedded&&e.visgraphOperation===p.R.EXTERNAL_CLICK_HANDLER)return void E.postMessage({type:p.e.EDGE_CLICK,predicates:n.predicates,source:n.source,target:n.target},d.WindowService.getReferer());at();const r=ae(n);if(1===n.predicates.length&&Te.tripleNodes.has(r)){D=null;const e=Te.tripleNodes.get(r)[0];if(Qe(e,t.currentTarget,t.button)){const t={};t.iri=e.iri,t.pred=pt(e.iri.split(" ")[1]),rt(t)}return}(function(t){e.showNodeInfo=!1,e.showFilter=!1,e.showInfoPanel=!1,e.openedNodeInfoPanel=void 0;const n=Te.links.find(function(e){return e.source.iri===t.target.iri&&e.target.iri===t.source.iri});if(e.showPredicates=t.predicates.length>=1||!!n&&n.predicates.length>0,D===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,D=null,void(e.predicateFilter.text="");if(D=t,e.showPredicates){const r=new Map;t.rawPredicates&&t.rawPredicates.forEach(function(e){const t=e.split(/[/#]/).pop();r.has(t)||r.set(t,e)}),e.predicates=_.map(t.predicates,function(e){const n=lt(e,t),i=n>-1,o=e.split(/[/#]/).pop();return{value:pt(e),rawIri:r.get(o)||e,partOfTriple:i,linkId:i?ae(t):"",nodeIndex:n}}),e.allPredicates=e.predicates;const i=document.querySelector(".predicates-panel .predicates");if(i&&(i.scrollTop=0),n){const t=new Map;n.rawPredicates&&n.rawPredicates.forEach(function(e){const n=e.split(/[/#]/).pop();t.has(n)||t.set(n,e)}),e.reversePredicates=_.map(n.predicates,function(e){const r=lt(e,n),i=r>-1,o=e.split(/[/#]/).pop();return{value:pt(e),rawIri:t.get(o)||e,partOfTriple:i,linkId:i?ae(n):"",nodeIndex:r}}),e.allReversePredicates=e.reversePredicates}else e.reversePredicates=[],e.allReversePredicates=[];e.filterPredicates();const o=t=>t.labels?.length&&t.labels[0].label?t.labels[0].label:e.replaceIRIWithPrefix(t.iri);e.predicatesSource={label:o(t.source),iri:t.source.iri},e.predicatesTarget={label:o(t.target),iri:t.target.iri},e.showInfoPanel=!0,function(e){[e.source,e.target].forEach(function(e){const t=document.getElementById(e.iri)?.querySelector(".node");t&&(t.style.stroke=O,t.style.strokeWidth="3px")});const t=(0,a.hK)(ae(e)),n=document.getElementById(t);if(n){const e=n.querySelector(".link");e&&(e.style.stroke=O,e.style.strokeWidth="2.5");const t=n.querySelector(".predicate, .predicates");t&&(t.style.fill=O)}const r=document.getElementById(pe(e));r&&(r.style.stroke=O)}(t)}})(n),e.$applyAsync()}(t,n)});let y,v=0,x=null,w=null;const k=function(t,n,r){const i=Array.isArray(r)?r[n]:r;Te.countLinks(t,Te.links)<=e.linksLimit.value?et(t,!1,i):f.info(P.instant("graphexplore.increase.limit"),P.instant("graphexplore.node.at.max")),e.closeInfoPanel()};function S(e,t){let n,r,i,o,s=!0;if("down"===t)n=2*e.size,r=e.size/3,i=.8,o=.3;else if("down-fixed"===t)n=2*e.size,r=e.size,i=.8,o=.66;else if("up"===t)n=e.size/3,r=2*e.size,i=.3,o=.8;else{if("fixed"!==t)return;n=e.size,i=.66,s=!1}let a=ke.selectAll(".node-wrapper").filter(function(t){return t===e}).append("text").text("").classed("icon-any pinned",!0).style("font-size",n+"px").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}).attr("opacity",i);"fixed"!==t&&"down-fixed"!==t||(e.pin=a),s&&(a=a.transition().duration(1e3).style("font-size",function(){return r+"px"}).attr("opacity",o),"down-fixed"!==t&&a.remove())}const I=o.drag().subject(function(e){return e}).on("start",function(e,t){G.isActive()||0===e.sourceEvent.button&&(t.fixedBeforeDrag=t.fixed,t.isBeingDragged=!0,t.beginDragging=!0,tt(),o.select(e.currentTarget).classed("dragging",!0),Be.alphaTarget(.3).restart())}).on("drag",function(t,n){n.isBeingDragged&&(n.fx=t.x,n.fy=t.y,n.fixed?n.beginDragging&&S(n,"fixed"):(e.numberOfPinnedNodes++,n.fixed=!0,S(n,"down-fixed")),n.pinWasFixed=!0,n.beginDragging=null)}).on("end",function(e,t){t.isBeingDragged&&(t.pinWasFixed&&(t.pinWasFixed=null,o.select(".pinned").remove()),t.isBeingDragged=!1,o.select(e.currentTarget).classed("dragging",!1)),Be.alphaTarget(0)});l=ke.selectAll(".node").data(Te.nodes).enter().append("g").attr("class","node-wrapper").attr("id",function(e){return e.iri}).append("circle").attr("class","node").attr("r",function(e){return e.size}).style("fill",function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])}).on("mouseover",function(t,i){if(!i.isBeingDragged){h.cancel(Ue);const o=t.currentTarget;We=h(()=>{(function(t,n){return!e.showInfoPanel&&((Ze.closeIcon||Ze.expandIcon||Ze.focusIcon||Ze.copyURIIcon)&&Ze.removeIcons(),Be.alpha()<.1&&(Ze.initIcons(t,n.parentNode),Be.stop(),Ve(),!0))})(i,o)&&function(e,t){h.cancel(r);const i=Ce=t.target;h(function(){Ce===i&&n.show(e,Ce)},300)}(i,t)},400)}}).on("mouseout",s).on("click",function(t,n){if(t.button&&0!==t.button)return;const r=t.currentTarget;if(x&&w===r)return h.cancel(x),x=null,void k(n,0,r.parentNode);w=r,s(),e.showPredicates=!1,G.isActive()||(h.cancel(x),x=h(function(){Qe(n,0,t),x=null},40+Ae))}).on("touchstart",(e,t)=>function(e){v=0,y=h(function(){v<5&&Xe(e),y=null},1e3)}(t)).on("touchmove",function(){v++}).on("touchend",function(){h.cancel(y),y=null}).on("contextmenu",function(t,r){t.shiftKey||(t.preventDefault(),tt(),e.closeInfoPanel(),r.fixed?(e.numberOfPinnedNodes--,r.fixed=!1,r.fx=null,r.fy=null,S(r,"up"),Be.alpha(1).restart()):(e.numberOfPinnedNodes++,r.fixed=!0,S(r,"down")),function(e){Ce&&n.show(e,Ce)}(r))}).on("gdb-expand-node",(e,t)=>k(t,0,e.srcElement.parentNode)).on("gdb-show-node-info",(e,t)=>nt(t)).call(I);const b=e.saveSettings.truncateNodeLabels?"hidden":"visible",L=ke.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").style("overflow",b).attr("width",function(e){return 2*e.size*Ne});ke.insert("g").attr("class","menu-events"),te(L),Be.on("tick",function(){c.attr("x1",function(e){return ce(e.source)}).attr("y1",function(e){return le(e.source)}).attr("x2",function(e){return ce(e.target)}).attr("y2",function(e){return le(e.target)}),m.each(function(e){const t=ce(e.source),n=le(e.source),r=ce(e.target),i=le(e.target);e.x=.5*(t+r),e.y=.5*(n+i);const o=180*Math.atan2(i-n,r-t)/Math.PI;e._rawAngle=o,e._normAngle=o<=90&&o>=-90?o:(o>0?-1:1)*(180-Math.abs(o))}),m.attr("x",function(e){return e.x}).attr("y",function(e){return e.y}).attr("dy",function(e){return"double"!==e.direction?"-0.5em":e._rawAngle>90||e._rawAngle<-90?"1.5em":"-0.5em"}).attr("transform",function(e){return`rotate(${e._normAngle}, ${e.x}, ${e.y})`}),m.filter(function(e){return"double"===e.direction}).text(function(e){return ot(e)}),l.attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),ke.select(".node-loader").attr("x",function(e){return e.x-e.size+3}).attr("y",function(e){return e.y-e.size}),ke.select(".loader-container").attr("cx",function(e){return e.x}).attr("cy",function(e){return e.y}),L.attr("x",function(e){return e.x-e.size*Ne}).attr("y",function(e){return e.y-4.2*e.fontSize/2}),o.select(".pinned").attr("x",function(e){return e.x}).attr("y",function(e){return e.y}),Ve()}),angular.isDefined(He)&&He.setLoadingState(!1),e.loading&&(e.loading=!1),o.selectAll(".link-wrapper").each(function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];o.selectAll(".link").each(function(n){const r=(0,a.hK)(n.source.iri),i=(0,a.hK)(n.target.iri);r===t&&i===e&&(n.direction="double")})}),o.selectAll(".d3-actions-tip").remove(),Be.alpha(.3).restart()}function Ve(){t.d3alpha=Be.alpha()}const Ze=new function(){function n(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(r,s){const a=(0,i.A)().attr("class","d3-tip d3-actions-tip").customPosition(function(e,t){const n=t.target.getBoundingClientRect();return{top:n.top-20+"px",left:n.right+10+"px"}}).html(function(e){return e});qe.call(a),r.isExpanded?(this.collapseIcon=o.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",function(){return n(20,r)}),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--gw-primary-base)"),this.collapseIcon.on("click",function(){var e;(e=r).isExpanded=!1,Te.removeNodeLeafLinks(e),Ke()}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),h.cancel(We),h.cancel(Ue)}).on("mouseout",function(){a.hide(),Ue=h(function(){tt()},500)})):(this.expandIcon=o.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",function(){return n(20,r)}),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--gw-primary-base)"),this.expandIcon.on("click",function(){et(r,!1,s)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),h.cancel(Ue),h.cancel(We)}).on("mouseout",function(){a.hide(),Ue=h(function(){tt()},500)})),this.focusIcon=o.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",function(){return n(20,r)}),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--gw-primary-base)"),this.focusIcon.on("click",function(){t.$broadcast("onRootNodeChange",r.iri)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),h.cancel(Ue),h.cancel(We)}).on("mouseout",function(){a.hide(),Ue=h(function(){tt()},500)}),this.copyURIIcon=o.select(".menu-events").append("g").attr("class","ri-links-line").attr("name","link").attr("transform",function(){return n(20,r)}),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--gw-primary-base)"),this.copyURIIcon.on("click",function(){e.copyToClipboard(r.iri),tt(),a.hide()}).on("mouseover",function(e){a.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+r.iri+"</div>",e),h.cancel(Ue),h.cancel(We)}).on("mouseout",function(){a.hide(),Ue=h(function(){tt()},500)}),this.closeIcon=o.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",function(){return n(20,r)}),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--gw-primary-base)"),this.closeIcon.on("click",function(){Xe(r)}).on("mouseover",function(e){a.show(e.currentTarget.getAttribute("name"),e),h.cancel(Ue),h.cancel(We)}).on("mouseout",function(){a.hide(),Ue=h(function(){tt()},500)}),this.animateMenu(r)},this.animateMenu=function(e){const t=100,r=o.easeSin;let i=0,s=20;this.expandIcon&&this.expandIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.collapseIcon&&this.collapseIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return n(s,e)}).delay(i+=35),this.copyURIIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.focusIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.closeIcon.transition().duration(t).style("opacity",1).ease(r).attr("transform",function(){return s+=30,n(s,e)}).delay(i+=35),this.expandedState=!0}};function Qe(n,r,i){return at(),e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(Xe(n),!1):e.embedded&&e.visgraphOperation===p.R.EXTERNAL_CLICK_HANDLER?(E.postMessage({type:p.e.NODE_CLICK,iri:n.iri,labels:n.labels,types:n.types,rdfRank:n.rdfRank,comment:n.comment},d.WindowService.getReferer()),!0):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.closeInfoPanel(),!1):(nt(n),!0)}function Xe(e){Te.removeNode(e),Ke()}function Je(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Te=new _e,Ie=Se}(t),Ye(t)}function Ye(t,n,r){let i=t.data;i=_.filter(i,function(e){return-1===_.findIndex(Te.links,function(t){return e.source===t.source.iri&&e.target===t.target.iri})});const o=[],s=Te.tripleLinksCopy.values();for(let e=0;e<Te.tripleLinksCopy.size;e++)s.next().value.forEach(e=>{o.push(e)});i=_.filter(i,function(e){return-1===_.findIndex(o,function(t){return e.source===t.source.iri&&e.target===t.target.iri})}),i=_.filter(i,function(e){return e.source!==e.target});const a=ue("iri",_.union(_.flatten(_.map(t.data,function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]})))),c=_.map(Te.nodes,function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}}),l=Te.tripleNodes.values();for(let e=0;e<Te.tripleNodes.size;e++)l.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})});const d=_.reject(a,function(e){return _.some(c,e)});if(e.linksLimit.showingLimit=d.length===e.linksLimit.value,0===d.length){const e=a.length>0?a.length-1:0;(r||0===i.length)&&f.info(P.instant("graphexplore.error.node.connections",{count:e})),Te.addAndMatchLinks(i),Ke()}else{const t=[],r=[],o=Y();_.forEach(d,function(n,i){t.push(T.getInstanceNode({iri:n.isTriple?de(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}).then(function(e){r[i]=e.data}))}),m.all(t).then(function(){_.forEach(r,function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+Math.cos(i)*Le/3,s=(n?n.y:0)+Math.sin(i)*Le/3;e.isTriple?Te.addTriple(e,o,s):Te.addNode(e,o,s)}),Te.addAndMatchLinks(i),n&&(n.isExpanded=!0),Ke()})}}function et(t,n,r){if(He.getLoadingState())return;He.init(t,r);const i=Y(),o=t.iri;T.getInstanceNodeLinks({iri:o,linksLimit:e.linksLimit.value,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}).then(function(e){Ye(e,t,n)},function(t){const n=getError(t.data);f.error(n,P.instant("graphexplore.error.exploring.node")),e.loading=!1,He.setLoadingState(!1)})}function tt(){angular.isDefined(Ze)&&Ze.expandedState&&Ze.removeIcons()}function nt(t){Be.stop();const n=e.showInfoPanel;D=null,e.openedNodeInfoPanel=t,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(de(t.iri)):encodeURIComponent(t.iri),function(e){const t=document.getElementById(e.iri),n=t?.querySelector(".node");n&&(n.style.stroke=O,n.style.strokeWidth="3px")}(t),e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const r=Y();T.getProperties({iri:t.isTriple?de(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState,rejectedPredicates:e.shouldShowSettings()?r.rejectedPredicates:[]}).then(function(t){e.data=_.mapKeys(t.data,function(t,n){return e.replaceIRIWithPrefix(n)});const r=[];_.forEach(e.data,function(e,t){r.push({key:t,value:e})}),e.nodeImage=void 0,e.propertiesNotFiltered=r;const i=_.find(r,function(e){return"image"===e.key});i&&(e.nodeImage=i.value[0].v),e.propertiesObj.items=_.reject(r,function(e){return"image"===e.key}),e.propertiesNotFiltered=e.propertiesObj.items,e.showInfoPanel=!0,e.showNodeInfo=!0,n&&h(()=>e.adapterContainer.adapter.reload(),500)},function(e){f.warning(getError(e.data),"Error")})}function rt(e){const t=Q();st("predicate","var(--gw-primary-dark)",e),st("predicates","var(--gw-primary-dark)",e);const n=t?.getElementsByClassName("link");n&&_.each(n,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.style.strokeWidth=4)});const r=t?.getElementsByClassName("arrow-marker");r&&_.each(r,function(t){const n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--gw-primary-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))})}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){at(),e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],e.reversePredicates=[],D=null,e.predicateFilter.text="",e.allPredicates=[],e.allReversePredicates=[],h(function(){e.showInfoPanel=!1})},e.clickLink=function(t){if(Te.tripleNodes.has(t.linkId)){at();const n=Te.tripleNodes.get(t.linkId)[t.nodeIndex];nt(n),e.showPredicates=!0;const r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");const i={},o=Te.tripleLinksCopy.values();for(let e=0;e<Te.tripleLinksCopy.size;e++){const e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=se(t.target.iri),i.oppTriplePred=pt(t.target.iri.split(" ")[1])),i.pred=pt(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=se(t.source.iri),i.oppTriplePred=pt(t.source.iri.split(" ")[1])),i.pred=pt(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=pt(n.iri.split(" ")[1])),rt(i)}};const it=()=>{z.success(P.instant("common.messages.copied_to_clipboard"))};function ot(e){const t=e.predicateLabel||dt(e);return"double"!==e.direction?t:function(e){const t=void 0===e._rawAngle?180*Math.atan2(le(e.target)-le(e.source),ce(e.target)-ce(e.source))/Math.PI:e._rawAngle;return t>90||t<-90}(e)?"⟵ "+t:t+" ⟶"}function st(e,t,n){const r=Q(),i=r?.getElementsByClassName(e);i&&_.each(i,function(e){const r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),se(n.iri)===ae(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===ae(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=ot(r))})}function at(){const t=Q();_.each(e.predicates,function(e){const t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")});const n=t?.getElementsByClassName("link");n&&_.each(n,function(e){e.style.stroke="",e.style.strokeWidth=""}),st("predicate",""),st("predicates","");const r=t?.getElementsByClassName("arrow-marker");r&&_.each(r,function(e){e.style.stroke="",e.__data__.target.isTriple||e.setAttribute("refX","59")});const i=t?.getElementsByClassName("node");i&&_.each(i,function(e){e.style.stroke="",e.style.strokeWidth=""})}function ct(e){const t=se(e);if(Te.tripleNodes.has(t))return Te.tripleNodes.get(t).find(t=>t.iri===e)}function lt(e,t){const n=ae(t);return Te.tripleNodes.has(n)?Te.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}function dt(e){return e.predicates.length>1?e.predicates.length+" predicates":pt(e.predicates[0])}function pt(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.copyPredicateIri=function(e,t){e.stopPropagation();const n=function(){const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(e){console.warn("Copy to clipboard failed.",e)}e.remove(),it()};navigator.clipboard?navigator.clipboard.writeText(t).then(it).catch(n):n()},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){tt();const t=10*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t),i=be/2,s=Le/2;o.selectAll(".node-wrapper").each(function(e){e.x=i+(n*(e.x-i)+r*(e.y-s)),e.y=s+(-r*(e.x-i)+n*(e.y-s)),e.fixed&&(e.fx=e.x,e.fy=e.y)}),Be.alpha(1).restart()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,n[d.REPOSITORY_ID_PARAM]=R.getSelectedRepository().id,X(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(Te.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};e.saveGraphModal=function(t,n,r){const i=k.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}});V++,K=!0,i.result.then(function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),L.addNewSavedGraph(t).success(function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),f.success(P.instant("graphexplore.saved.graph",{name:t.name}))}).error(function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);f.error(e,P.instant("graphexplore.error.cannot.create.graph"))}})}(t.graph);break;case"update":case"rename":n=t.graph,L.editSavedGraph(n).success(function(){e.lastSavedGraphName=n.name,e.shared=n.shared,e.refreshSavedGraphs(),f.success(P.instant("graphexplore.saved.graph.was.edited",{name:n.name}))}).error(function(e){const t=getError(e);f.error(t,P.instant("graphexplore.error.cannot.edit"))})}var n}).finally(()=>{V--,V<=0&&(K=!1,V=0)})},e.refreshSavedGraphs=function(){L.getSavedGraphs().success(function(t){e.savedGraphs=t}).error(function(e){const t=getError(e);f.error(t,P.instant("graphexplore.error.getting.saved.graphs"))})},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig);const r={...y.search(),saved:t.id};y.search("saved",t.id),Te.restoreState(JSON.parse(t.data)),n||X(r,{savedGraph:t})},e.copyToClipboardSavedGraph=function(t){const n=[location.protocol,"//",location.host,location.pathname,"?saved=",t.id].join("");e.copyToClipboard(n)},e.deleteSavedGraph=function(t){w.openSimpleModal({title:P.instant("common.confirm"),message:P.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then(function(){!function(t){L.deleteSavedGraph(t).success(function(){e.refreshSavedGraphs(),f.success(P.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))}).error(function(e){const t=getError(e);f.error(t,P.instant("graphexplore.error.cannot.delete"))})}(t)})},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){tt();const t=angular.isUndefined(e.numberOfPinnedNodes)||e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,o.selectAll(".node").each(function(n){n.fixed=t,t?(e.numberOfPinnedNodes++,n.fx=n.x,n.fy=n.y):(n.fx=null,n.fy=null)}),Be.alpha(1).restart()},$("body").on("keydown",function(t){!G.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))}),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)};let ut=!1;(()=>{if(!ut){qe.append("rect").attr("width",10*be).attr("height",10*Le).attr("x",-(10*be-be)/2).attr("y",-(10*Le-Le)/2).style("fill","none").style("pointer-events","all").call(we).on("click",function(e){e.stopPropagation(),tt(),Be.stop()});const e=e=>{e.preventDefault()};qe.node().addEventListener("wheel",e,{passive:!1}),H.push(()=>qe.node().removeEventListener("wheel",e)),ut=!0}(t=>{const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=I.get(b.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch{e.saveSettings=_.cloneDeep(e.defaultSettings),I.set(b.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=_.cloneDeep(e.defaultSettings)})(M.getAuthenticatedUser()),function(){const t=y.search().linksLimit;if(!t)return y.replace(),y.search("linksLimit",e.linksLimit.value),void y.state({skipOnPopState:!0});const n=Number.parseInt(t,10);if(Number.isNaN(n)||n<1||n>u)return f.error(P.instant("visual.links.invalid.limit.tooltip",{MIN_LINKS_LIMIT:1,MAX_LINKS_LIMIT:u}),P.instant("visual.links.invalid.limit.title")),y.search("linksLimit",e.linksLimit.value),void y.state({skipOnPopState:!0});q(n)}(),Pe(),$e()})()}function h(e,t,n,r){switch(e.mode=n.mode,e.graph=_.cloneDeep(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&(e.graph.name=i(e.graph.name),t.close({graph:e.graph,mode:e.mode}))},e.saveNew=function(){e.graph.name=i(e.graph.name)+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")};const i=e=>e.replace(/\s+/g," ").trim()}h.$inject=["$scope","$uibModalInstance","data","$translate"]},83196(e,t,n){n.d(t,{Ds:()=>r,VH:()=>i,nj:()=>s,vH:()=>o});const r=[{id:"empty",name:"No inference"},{id:"rdfs-optimized",name:"RDFS (Optimized)"},{id:"rdfs",name:"RDFS"},{id:"rdfsplus-optimized",name:"RDFS-Plus (Optimized)"},{id:"owl-horst-optimized",name:"OWL-Horst (Optimized)"},{id:"owl-horst",name:"OWL-Horst"},{id:"owl2-ql-optimized",name:"OWL2-QL (Optimized)"},{id:"owl2-ql",name:"OWL2-QL"},{id:"owl-max-optimized",name:"OWL-Max (Optimized)"},{id:"owl-max",name:"OWL-Max"},{id:"owl2-rl-optimized",name:"OWL2-RL (Optimized)"},{id:"owl2-rl",name:"OWL2-RL"}],i={graphdbRepo:"graphdb",free:"free",eeWorker:"worker",eeMaster:"master",ontop:"ontop",se:"se",fedx:"fedx"},o=new RegExp("^[a-zA-Z0-9-_]+$"),s=new RegExp("^[0-9]+$")},35195(e,t,n){n.d(t,{G4:()=>o,Sn:()=>s,hK:()=>i});var r=n(22723);const i=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e},9508(e,t,n){n.d(t,{A:()=>s}),n(11014);var r=n(44482);const i={dispatch:r.dispatch,pointer:r.pointer};var o=o||{};o.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),o.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},o.Click=function(){function e(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}return{delayDblClick:function(){var t=i.dispatch("click","dblclick");return function(t,n){let r,i=1,o=arguments.length;for(;++i<o;)r=arguments[i],t[r]=e(t,n,n[r]);return t}(function(e){var n,r=null;e.on("mousedown",function(){n=i.pointer(document.body),new Date}),e.on("mouseup",function(e,o){var s,a,c;a=n,c=i.pointer(document.body),Math.sqrt(Math.pow(a[0]-c[0],2),Math.pow(a[1]-c[1],2))>5||(r?(window.clearTimeout(r),r=null,t.call("dblclick",e,e,o)):r=window.setTimeout((s=e,function(){t.call("click",s,s,o),r=null}),250))})},t,"on")}}}();const s=o},82667(e,t,n){n.d(t,{A:()=>o});var r=n(44482);const i={select:r.select,selection:r.selection},o=function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=u(),o=null,s=null,a=null,c=null;function l(e){var t;o="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,s=o.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(a=r.pop());var i,o=n.apply(this,r),s=t.apply(this,r),u=e.apply(this,r),h=f(),g=p.length,m=document.documentElement.scrollTop||document.body.scrollTop,y=document.documentElement.scrollLeft||document.body.scrollLeft,v=c.apply(this,r);for(h.html(o).style("opacity",1).style("pointer-events","all");g--;)h.classed(p[g],!1);const x=r.filter(e=>e instanceof Event);return i=d.get(u).apply(this,x),v?Object.keys(v).forEach(function(e){h.style(e,v[e])}):h.classed(u,!0).style("top",i.top+s[0]+m+"px").style("left",i.left+s[1]+y+"px"),l},l.hide=function(){return f().style("opacity",0).style("pointer-events","none"),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().attr(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.attr.apply(f(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return f().style(e);var n=Array.prototype.slice.call(arguments);return i.selection.prototype.style.apply(f(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:g(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:g(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:g(e),l):n},l.customPosition=function(e){return arguments.length?(c=null==e?e:g(e),l):c},l.destroy=function(){return r&&(f().remove(),r=null),l};var d=new Map(Object.entries({n:function(e){var t=h(e);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}},s:function(e){var t=h(e);return{top:t.s.y,left:t.s.x-r.offsetWidth/2}},e:function(e){var t=h(e);return{top:t.e.y-r.offsetHeight/2,left:t.e.x}},w:function(e){var t=h(e);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth}},nw:function(e){var t=h(e);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}},ne:function(e){var t=h(e);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}},sw:function(e){var t=h(e);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}},se:function(e){var t=h(e);return{top:t.se.y,left:t.e.x}}})),p=d.keys();function u(){var e=i.select(document.createElement("div"));return e.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}function f(){return null===r&&(r=u(),document.body.appendChild(r)),i.select(r)}function h(e){for(var t=a||e.target;void 0===t.getScreenCTM&&"undefined"===t.parentNode;)t=t.parentNode;var n={},r=t.getScreenCTM(),i=t.getBBox(),o=i.width,c=i.height,l=i.x,d=i.y;return s.x=l,s.y=d,n.nw=s.matrixTransform(r),s.x+=o,n.ne=s.matrixTransform(r),s.y+=c,n.se=s.matrixTransform(r),s.x-=o,n.sw=s.matrixTransform(r),s.y-=c/2,n.w=s.matrixTransform(r),s.x+=o,n.e=s.matrixTransform(r),s.x-=o/2,s.y-=c/2,n.n=s.matrixTransform(r),s.y+=c,n.s=s.matrixTransform(r),n}function g(e){return"function"==typeof e?e:function(){return e}}return l}},11014(e,t,n){var r,i;r=[n(44482)],i=function(e){function t(e,t){return e.each(function(){var e=t.apply(this,arguments),n=select(this);for(var r in e)n.attr(r,e[r])})}function r(e,t){for(var n in t)e.attr(n,t[n]);return e}return void 0===e&&(e=n(44482)),e.selection.prototype.attrs=function(e){return("function"==typeof e?t:r)(this,e)},e.selection.prototype.moveToFront=function(){return this.each(function(){e.select(this.parentNode.appendChild(this))})},e.selection.prototype.moveToBack=function(){return this.each(function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)})},e}.apply(t,r),void 0===i||(e.exports=i)}};
2
- //# sourceMappingURL=82917.1c1bc92bab409c22887a.bundle.js.map
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=86099;export const __webpack_esm_ids__=[86099];export const __webpack_esm_modules__={86099(e,t,n){var a=n(82667),r=n(89687),i=n(9508),s=n(44482),c=n(66886),o=(n(38473),n(57154));function l(e,t,n,l,d,h,u,f,p,g,x,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(y,A,v){!function(y){let A=!1;let v,S;const C=s.pack().size([780,780]),R=s.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(s.interpolateHcl),E=s.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function P(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function w(){return"true"===g.get(x.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){const e=c.A.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.4.3-RC");s.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),s.selectAll("g").style("opacity",1);const t=c.A.Export.generateBase64ImageSource("#classChart svg");s.select(this).attrs({href:t,download:"class-hierarchy-"+h.getActiveRepository()+".svg"})}y.hidePrefixes=w();let I=P();const T=!!y.classHierarchyData?.classCount,L=h.getActiveRepository()&&!h.isSystemRepository();let D,k,N,b,F;(0,o.service)(o.LicenseContextService).onLicenseChanged(t=>{t?.valid&&!T&&L&&function(){e.loader=!0,e.hierarchyError=!1;const t=g.get(`classHierarchy-selectedGraph-${h.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success(function(t,n){e.loader=!1,207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),y.classHierarchyData=t,s.select("#download-svg").on("mouseover",H)}).error(function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))})}()});const z={};function O(n,c,o,h){b&&b(),F&&F(),s.selectAll("#main-group").remove(),I=P(),r.A.SingleChild.addPlaceholders(n,!0),S=s.hierarchy(n),S.sum(function(e){return e.size}),N=o||S,C(S);const u=S.descendants();let g;N.isInFocusTransitive=!0,r.A.SingleChild.removePlaceholders(u),r.A.SingleChild.centerNodes(u),r.A.SingleChild.makePositionsRelativeToZero(u),v||(v=(0,a.A)().attr("class","d3-tip").customPosition(function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}}).html(function(e){return e.data.name}),E.call(v));const x=I.selectAll("circle").data(u).enter().append("g");c.doFade&&x.each(function(e){i.A.Transition.fadeIn(s.select(this),550)});let m=[];const w=x.append("circle").attr("class",function(e){return e.data.role}).attr("data-test",function(e){return"class-"+e.data.name}).attr("guide-selector",function(e){return"class-"+e.data.name}).style("fill",function(e){return e.children?R(e.depth):"#E0D0D0"}).each(function(e){if(e.circle=s.select(this),e.data.name!==p){const t=e.data.name;m.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",function(t){c.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)}),e.circle.on("mouseout",v.hide)}}).on("gdb-focus",(e,t)=>k(t)).on("gdb-zoom",(e,t)=>Z(t));let H;function T(e){s.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),H=e}function L(){y.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),y.flattenedClassNames=m);const $=i.A.Click.delayDblClick();s.selectAll(".parent, .topLevelParent, .child, .root").call($),k=function(e){Z(e),e.data.name===p?(L(),s.selectAll(".selected").classed("selected",!1)):(T(e),A||(y.selectedClass=H,y.showClassInfoPanel=!0),y.$on("sidePanelClosed",function(t){s.selectAll(".selected").classed("selected",e.selected=!1)}))},$.on("click",function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),k(t)}),$.on("dblclick",function(t,a){a!==n&&(v.hide(),T(a),e.$broadcast("goToDomainRangeGraphView",H,N),t.stopPropagation())});let O=0;E.on("wheel",function(e){v.hide(),e.preventDefault(),e.stopPropagation();const t=Date.now();if(!(t-O>100))return;O=t;let n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");let a=e.target.__data__;if(a||(a=N),"in"===n){if(a!==N){for(;a.parent&&!a.parent.isInFocusTransitive;)a=a.parent;a.depth<N.depth&&(a=N)}if(a===N&&a.children){let e=a.children[0];for(let t=1;t<a.children.length;t++)a.children[t].sortingRank>e.sortingRank&&(e=a.children[t]);e.children&&(a=e)}else a.children||(a=a.parent);Z(a,!0)}else"out"===n&&(a=N.parent,a&&Z(a,!0));N.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()});const Y=I.selectAll("text").data(u).enter().append("text").attr("class",function(e){return e.children&&e.children.length?"label":"label child-label"}).each(function(e){e.textSel=s.select(this)});c.noPrefixes?(Y.each(function(e){const t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))}),Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.noPrefixName,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)})):Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.data.name,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)}),Y.style("display",function(e){return e.parent&&e.parent.data===N.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")}),c.doFade&&!c.keepPrevState&&Y.each(function(e){i.A.Transition.fadeIn(s.select(this),550)}),D=function(){function e(e){e&&w.each(function(t){+e===t.data.id&&k(t)})}const n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};const B=I.selectAll("circle, text");function V(e,t){const n=800/e[2];g=e,B.attr("transform",function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"}),w.attr("r",function(e){return e.r*n}),t&&Y.each(function(e){e.data.fullName!==N.data.topLevelParentUri&&N.data.topLevelParentUri!==p||(e.textSel.style("display","none"),N.children&&N.children.length?_.each(N.children,function(e){e.textSel.style("display","inline")}):N.textSel.style("display","inline"),N.parent&&_.each(N.parent.children,function(e){e.data.name!==N.data.name&&e.textSel.style("display","inline")}))}),Y.style("font-size",function(e){return c.noPrefixes?i.A.Text.calcFontSize(e.noPrefixName,e.r*n):i.A.Text.calcFontSize(e.data.name,e.r*n)}).text(function(e){return c.noPrefixes?i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)})}function M(e){let t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function Z(e,t){if(d(function(){y.showExternalElements=e.data.name===p}),N===e)return;if(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),!e.children&&(e=e.parent,N===e))return;if(t&&(L(),s.selectAll(".selected").classed("selected",!1)),N.parent){let e=N;for(;e;)e.isInFocusTransitive=!1,e=e.parent}let n=e;for(;n;)n.isInFocusTransitive=!!n.children,n=n.parent;N=e,2*N.r/(2*N.r+20)<.3||y.currentSliderValue>y.currentBrowserLimit?(V([N.x,N.y,M(N.r)]),Y.each(function(e){W.call(this,e)})):s.transition().duration(f).tween("zoom",function(e){const t=s.interpolateZoom(g,[N.x,N.y,M(N.r)]);return function(e){V(t(e))}}).selectAll("text").each(W)}V([N.x,N.y,M(N.r)],h),b=y.$on("rootFocus",function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),k(S)}),F=y.$on("classSearch",function(e){k(e)})}function U(){const t=y.classHierarchyData.classCount;let n=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}let Y,B,V,M;window.addEventListener("resize",U),window.addEventListener("beforeunload",function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)}),y.$watch("classHierarchyData",function(){Y&&Y(),B&&B(),V&&V(),M&&M();let e=w();if(y.classHierarchyData.classCount){U();const t=structuredClone(y.classHierarchyData);const n=s.hierarchy(t).descendants().sort(function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0});let a,r;function i(e,t){const n={keepPrevState:!0,noPrefixes:w()};r=n.noPrefixes,O(a||e,n,N,!0),d(()=>{g.set(x.CLASS_HIERARCHY_SWITCH_PREFIXES,t),D(),A=!1},70)}function c(e,n,s){if(!e)return;g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),a={name:p,children:[]};const c=new Set;for(let t=1;t<=e;t++)c.add(n[t].data.id),n[t].parent===n[0]&&a.children.push(n[t].data);(function e(t){if(!t.children)return;const n=[];for(const e of t.children)c.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)})(a),s?(r=angular.isUndefined(r)?w():r,O(a,{noPrefixes:r})):i(t)}const o=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(o)c(o,n);else{const h={doFade:!0,keepPrevState:!0,noPrefixes:w()};O(t,h),D()}let l;Y=y.$watch("hidePrefixes",function(n){angular.isUndefined(n)||e?e=void 0:d(function(){A=!0,function(e){angular.isUndefined(e)||g.set(x.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)},50)},!0),B=y.$watch("currentSliderValue",function(e){c(e,n,!0)},!0),M=y.$on("onEnterKeypressSearchAction",function(e){l&&k(l)}),V=y.$on("searchedClass",function(e,t){l=z[t.name],l&&k(l)})}},!0)}(y)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},89687(e,t,n){n.d(t,{A:()=>r});var a=a||{};a.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var a=0;a<t.children.length;a++)e(t.children[a]);if(1===t.children.length){var r=1.2*t.size;n&&(r=.1*t.children[0].size),t.children.push({name:"placeholder",size:r})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var a=t[n];"placeholder"===a.data.name?t.splice(n,1):a.children&&e(a.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var a=n.x-n.children[0].x;n.children[0].x+=a,r(n.children[0],a)}}function r(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,r(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,a=0;a<e.length;a++){var r=e[a];r.x-=t,r.y-=n}}};const r=a},66886(e,t,n){n.d(t,{A:()=>i}),n(11014);const a={selectAll:n(44482).selectAll};var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,function(e){n+=e.cssText}),n},generateBase64ImageSource:function(e){e||(e="svg");const t=a.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}};const i=r}};
2
- //# sourceMappingURL=86099.1a5ab5d8cb30b370eb32.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"86099.1a5ab5d8cb30b370eb32.bundle.js","mappings":"kNAoBA,SAASA,EAAwBC,EAAYC,EAAWC,EAAsBC,EAASC,EAAUC,EAAeC,EAAQC,EAAeC,EAAeC,EAAqBC,EAAQC,GAC/K,MAAO,CACHC,SAAU,KACVC,SAAU,8BACVC,MAAO,CACHC,mBAAoB,IACpBC,oBAAqB,IACrBC,cAAe,IACfC,mBAAoB,IACpBC,mBAAoB,IACpBC,qBAAsB,IACtBC,aAAc,IACdC,oBAAqB,KAEzBC,KAGJ,SAAkBT,EAAOU,EAASC,IAIlC,SAA6BX,GAKzB,IAAIY,GAAoB,EAMxB,IAAIC,EACAC,EAEJ,MAAMC,EAAaC,EAAAA,OACdC,KAAK,CAACC,IAAmBA,MAExBC,EAAQH,EAAAA,cACTI,OAAO,CAAC,EAAG,IACXC,MAAM,CAAC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MAAMrN,EAAWI,EAAE,cAAgBiN,EAAoB,MAAM,GAAGC,MAAMC,MACtE,IAAIC,EAAS,GAIb,OAHAtH,EAAEpB,KAAK9E,EAAU,SAAUyN,GACvBD,GAAUC,EAAMC,OACpB,GACOF,CACX,EAkBIjN,0BAhBJ,SAAmCoN,GAC1BA,IACDA,EAAmB,OAGvB,MAAMC,EAAY/O,EAAG8F,UAAUgJ,GAC1BrO,KAAK,UAAW,OAChBA,KAAK,QAAS,8BACdsJ,OAAOiF,WAAWC,UAGvB,MAAO,2CAA6CC,KAAKC,SAASC,mBAAmBL,IACzF,GAQJ,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/circle-packing.js","webpack://root-config/./packages/legacy-workbench/src/js/lib/common/svg-export.js"],"sourcesContent":["/* eslint-disable no-invalid-this */\nimport d3tip from 'lib/d3-tip/d3-tip-patch';\nimport CirclePacking from 'lib/common/circle-packing';\nimport D3 from 'lib/common/d3-utils';\nimport * as d3 from 'd3';\nimport SVG from 'lib/common/svg-export';\nimport 'angular/utils/local-storage-adapter';\nimport {service, LicenseContextService} from '@ontotext/workbench-api';\n\nangular\n .module('graphdb.framework.graphexplore.directives.class', [\n 'graphdb.framework.graphexplore.controllers.class',\n 'graphdb.framework.utils.localstorageadapter',\n ])\n .constant(\"ZOOM_DURATION\", 500)\n .constant(\"ROOT_OBJ_NAME\", \"RDF Class Hierarchy\")\n .directive('rdfClassHierarchy', classHierarchyDirective);\n\nclassHierarchyDirective.$inject = ['$rootScope', '$location', 'GraphDataRestService', '$window', '$timeout', '$repositories', 'toastr', 'ZOOM_DURATION', 'ROOT_OBJ_NAME', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction classHierarchyDirective($rootScope, $location, GraphDataRestService, $window, $timeout, $repositories, toastr, ZOOM_DURATION, ROOT_OBJ_NAME, LocalStorageAdapter, LSKeys, $translate) {\n return {\n restrict: 'AE',\n template: '<div id=\"classChart\"></div>',\n scope: {\n classHierarchyData: '=',\n flattenedClassNames: '=',\n selectedClass: '=',\n currentSliderValue: '=',\n showClassInfoPanel: '=',\n showExternalElements: '=',\n hidePrefixes: '=',\n currentBrowserLimit: '=',\n },\n link: linkFunc,\n };\n\n function linkFunc(scope, element, attrs) {\n renderCirclePacking(scope, element);\n }\n\n function renderCirclePacking(scope, element) {\n /**\n * A boolean flag that determines whether the opening of the side info panel\n * should be suppressed when focusing on the chart while a class is selected.\n */\n let suppressPanelOpen = false;\n\n const width = 800;\n const height = 800;\n const diameter = height;\n const margin = 20;\n let tip;\n let rootHierarchy;\n\n const packLayout = d3.pack()\n .size([diameter - margin, diameter - margin]);\n\n const color = d3.scaleLinear()\n .domain([0, 4])\n .range([\"hsl(19, 70%, 90%)\", \"hsl(19, 70%, 50%)\"])\n .interpolate(d3.interpolateHcl);\n\n const svg = d3.select(\"#classChart\")\n .insert(\"svg:svg\", \"h2\")\n .attr(\"viewBox\", \"0 0 \" + width + \" \" + height)\n .attr(\"preserveAspectRatio\", \"xMidYMid meet\")\n .on(\"dblclick.zoom\", null);\n\n function appendMainGroup() {\n return svg.append(\"svg:g\")\n .attrs({\n id: \"main-group\",\n transform: \"translate(\" + width / 2 + \",\" + height / 2 + \")\",\n });\n }\n\n function savePrefixesState(hidePrefixes) {\n if (!angular.isUndefined(hidePrefixes)) {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES, hidePrefixes);\n }\n }\n\n function getPrefixesState() {\n return LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_HIDE_PREFIXES) === \"true\";\n }\n\n /*\n * Prepares SVG document image export by adding xml namespaces and\n * additional style information\n */\n function prepareForSVGImageExport() {\n // get css rules for the diagram\n const cssRules = SVG.Export.getCSSRules(\"css/rdf-class-hierarchy-labels.css?v=3.4.3-RC\");\n // inline css rules in a defs tag\n d3.selectAll(\"#main-group\")\n .append(\"defs\");\n $(\"defs\").append('<style type=\"text/css\"><![CDATA[' + cssRules + ']]></style>');\n\n // switch opacity to visible\n d3.selectAll(\"g\")\n .style(\"opacity\", 1);\n\n // convert selected html to base64\n const imgSrc = SVG.Export.generateBase64ImageSource(\"#classChart svg\");\n\n // set the binary image and a name for the downloadable file on the export button\n d3.select(this).attrs({\n href: imgSrc,\n download: \"class-hierarchy-\" + $repositories.getActiveRepository() + \".svg\",\n });\n }\n\n scope.hidePrefixes = getPrefixesState();\n\n let g = appendMainGroup();\n\n function fetchClassHierarchy() {\n $rootScope.loader = true;\n $rootScope.hierarchyError = false;\n const selGraphFromCache = LocalStorageAdapter.get(`classHierarchy-selectedGraph-${$repositories.getActiveRepository()}`);\n GraphDataRestService.getClassHierarchyData(selGraphFromCache !== null ? selGraphFromCache.contextID.uri : \"\")\n .success(function(response, status) {\n $rootScope.loader = false;\n if (status === 207) {\n toastr.warning(\n $translate.instant('graphexplore.update.diagram'),\n $translate.instant('graphexplore.repository.data.changed'),\n );\n }\n scope.classHierarchyData = response;\n d3.select(\"#download-svg\").on(\"mouseover\", prepareForSVGImageExport);\n })\n .error(function(response) {\n $rootScope.loader = false;\n $rootScope.hierarchyError = getError(response);\n toastr.error(\n $translate.instant('graphexplore.error.request.failed', {\n name: ROOT_OBJ_NAME,\n error: getError(response),\n }),\n );\n });\n }\n\n const hasData = !!scope.classHierarchyData?.classCount;\n const canUseRepo = $repositories.getActiveRepository() && !$repositories.isSystemRepository();\n\n service(LicenseContextService).onLicenseChanged((license) => {\n if (license?.valid && !hasData && canUseRepo) {\n fetchClassHierarchy();\n }\n });\n\n let autoZoomToPreviousState;\n let doFocus;\n\n let focus;\n let rootFocusEvent;\n let classSearchEvent;\n const flattenedClassData = {};\n\n function drawDiagram(root, config, newFocus, switchPrefixes) {\n if (rootFocusEvent) rootFocusEvent();\n if (classSearchEvent) classSearchEvent();\n // remove old group tag containing the diagram\n d3.selectAll(\"#main-group\").remove();\n\n // append new empty group tag in order to rerender new diagram\n g = appendMainGroup();\n\n // fix for single child classes\n CirclePacking.SingleChild.addPlaceholders(root, true);\n\n rootHierarchy = d3.hierarchy(root);\n rootHierarchy.sum(function(d) {\n return d.size;\n });\n focus = newFocus ? newFocus : rootHierarchy;\n\n packLayout(rootHierarchy);\n\n const nodes = rootHierarchy.descendants();\n let view;\n\n focus.isInFocusTransitive = true;\n\n // fixes for single child classes\n CirclePacking.SingleChild.removePlaceholders(nodes);\n CirclePacking.SingleChild.centerNodes(nodes);\n CirclePacking.SingleChild.makePositionsRelativeToZero(nodes);\n\n if (!tip) {\n tip = d3tip()\n .attr('class', 'd3-tip')\n .customPosition(function(d, event) {\n return {\n top: 'inherit',\n bottom: ($window.innerHeight - event.clientY) + 'px',\n right: ($window.innerWidth - event.clientX) + 'px',\n };\n })\n .html(function(d) {\n return d.data.name;\n });\n svg.call(tip);\n }\n\n const circleGroup = g.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"g\");\n\n if (config.doFade) {\n circleGroup.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n let flattenedClassNames = [];\n\n const circle = circleGroup\n .append(\"circle\")\n .attr(\"class\", function(d) {\n return d.data.role;\n })\n .attr(\"data-test\", function(d) {\n return \"class-\" + d.data.name;\n })\n .attr(\"guide-selector\", function(d) {\n return \"class-\" + d.data.name;\n })\n .style(\"fill\", function(d) {\n //return colors[d.depth % 6];\n return d.children ? color(d.depth) : \"#E0D0D0\";\n })\n .each(function(d) {\n d.circle = d3.select(this);\n if (d.data.name !== ROOT_OBJ_NAME) {\n const key = d.data.name;\n flattenedClassNames.push({name: key});\n flattenedClassData[[key]] = d;\n\n d.circle.classed(\"rdf-class\", true);\n d.circle.on('mouseover', function(event) {\n if (config.noPrefixes) {\n tip.show(d, event);\n } else if (!d.textHidden) {\n tip.hide(d);\n } else {\n tip.show(d, event);\n }\n });\n d.circle.on('mouseout', tip.hide);\n }\n })\n // custom event used when user is following a guide\n .on(\"gdb-focus\", (event, d) => doFocus(d))\n .on(\"gdb-zoom\", (event, d) => zoom(d));\n\n\n if (flattenedClassNames) {\n flattenedClassNames = _.uniqBy(flattenedClassNames, 'name');\n scope.flattenedClassNames = flattenedClassNames;\n }\n\n let selectedClass;\n\n function getCurrentClassDataAndMarkSelected(obj) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n obj.circle.classed(\"selected\", obj.selected = true);\n selectedClass = obj;\n }\n\n function showClassInfoPanel() {\n scope.selectedClass = selectedClass;\n scope.showClassInfoPanel = true;\n }\n\n function closeClassInfoPanel() {\n scope.showClassInfoPanel = false;\n }\n\n function goToDomainRangeGraphView() {\n $rootScope.$broadcast('goToDomainRangeGraphView', selectedClass, focus);\n }\n\n const clickCancel = D3.Click.delayDblClick();\n d3.selectAll(\".parent, .topLevelParent, .child, .root\")\n .call(clickCancel);\n\n doFocus = function(obj) {\n zoom(obj);\n\n if (obj.data.name === ROOT_OBJ_NAME) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n } else {\n getCurrentClassDataAndMarkSelected(obj);\n if (!suppressPanelOpen) {\n showClassInfoPanel();\n }\n\n // FIXME: is it ok to bind this event handler every time and not just once?\n scope.$on('sidePanelClosed', function(event) {\n d3.selectAll(\".selected\").classed(\"selected\", obj.selected = false);\n });\n }\n\n\n //do not stop event propagation here\n };\n\n clickCancel.on(\"click\", function(event, obj) {\n // add clicked class to browser history\n if (obj.data.id) {\n $window.history.pushState({id: obj.data.id}, \"classHierarchyPage\" + obj.data.id, \"hierarchy#\" + obj.data.id);\n }\n\n //hide current d3-tip tooltip\n tip.hide();\n\n doFocus(obj);\n });\n\n clickCancel.on(\"dblclick\", function(event, obj) {\n if (obj === root) {\n return;\n }\n // hide current d3-tip tooltip in order not to appear in the next view\n tip.hide();\n getCurrentClassDataAndMarkSelected(obj);\n goToDomainRangeGraphView();\n\n event.stopPropagation();\n });\n\n let lastTimeWheel = 0;\n svg.on('wheel', function(event) {\n // hide current d3-tip tooltip\n tip.hide();\n\n event.preventDefault();\n event.stopPropagation();\n\n // at least 100ms must have passed since last time we updated\n const now = Date.now();\n if (now - lastTimeWheel > 100) {\n lastTimeWheel = now;\n } else {\n return;\n }\n\n let direction = '';\n if (event.deltaY <= -1) {\n direction = 'in';\n } else if (event.deltaY >= 1) {\n direction = 'out';\n }\n\n let obj = event.target.__data__;\n\n if (!obj) {\n // scroll outside the big circle\n obj = focus;\n }\n\n if (direction === 'in') {\n // determine object to zoom to\n\n if (obj !== focus) {\n // consider the object on which the scroll event occurred\n // and find the furthest parent that has no focused children\n while (obj.parent && !obj.parent.isInFocusTransitive) {\n obj = obj.parent;\n }\n if (obj.depth < focus.depth) {\n // however if that parent is of lower depth than the focus we ignore it\n obj = focus;\n }\n }\n\n if (obj === focus && obj.children) {\n // if object is in focus and it has children we zoom to its biggest child\n // TODO: sort children on backend\n let newobj = obj.children[0];\n for (let i = 1; i < obj.children.length; i++) {\n if (obj.children[i].sortingRank > newobj.sortingRank) {\n newobj = obj.children[i];\n }\n }\n if (newobj.children) {\n // Use the child only if it has children\n obj = newobj;\n }\n } else if (!obj.children) {\n // If node has no children use its parent instead\n obj = obj.parent;\n }\n\n zoom(obj, true);\n } else if (direction === 'out') {\n // zooming out simply goes one parent up\n obj = focus.parent;\n if (obj) {\n zoom(obj, true);\n }\n }\n\n if (focus.data.name === ROOT_OBJ_NAME) {\n $window.history.replaceState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n }\n\n // redraw slider on zoom out\n sendSliderData();\n });\n\n const text = g.selectAll(\"text\")\n .data(nodes)\n .enter().append(\"text\")\n .attr(\"class\", function(d) {\n return d.children && d.children.length ? \"label\" : \"label child-label\";\n })\n .each(function(d) {\n d.textSel = d3.select(this);\n });\n\n function trimPrefixes(d) {\n const idx = d.data.name.indexOf(\":\");\n const absUriIdx = d.data.name.indexOf(\"http://\");\n if (absUriIdx > -1) {\n // if we have no prefix available ignore\n d.noPrefixName = d.data.name;\n } else if (idx > -1) {\n d.noPrefixName = d.data.name.substring(idx + 1);\n }\n }\n\n if (config.noPrefixes) {\n text.each(trimPrefixes);\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r / 3);\n });\n } else {\n text\n .style(\"font-size\", function(d) {\n return D3.Text.calcFontSize(d.data.name, d.r);\n })\n .text(function(d) {\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r / 3);\n });\n }\n\n // TODO: make this use the full version (same as zoom)\n text.style(\"display\", function(d) {\n if (d.parent && d.parent.data === focus.data) {\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n return null;\n } else {\n d.textHidden = true;\n return \"none\";\n }\n });\n\n if (config.doFade && !config.keepPrevState) {\n text.each(function(d) {\n D3.Transition.fadeIn(d3.select(this), 550);\n });\n }\n\n autoZoomToPreviousState = function() {\n function focusOnCurrentClass(focusHistoryId) {\n if (focusHistoryId) {\n circle.each(function(d) {\n if (+focusHistoryId === d.data.id) {\n doFocus(d);\n }\n });\n }\n }\n\n const focusHistoryId = $location.hash();\n\n $window.onpopstate = function(event) {\n if (event.state) {\n const focusHistoryId = event.state.id;\n focusOnCurrentClass(focusHistoryId);\n }\n };\n\n focusOnCurrentClass(focusHistoryId);\n };\n\n const node = g.selectAll(\"circle, text\");\n\n function zoomTo(v, switchPrefixes) {\n const k = diameter / v[2];\n view = v;\n\n node.attr(\"transform\", function(d) {\n return \"translate(\" + (d.x - v[0]) * k + \",\" + (d.y - v[1]) * k + \")\";\n });\n\n circle.attr(\"r\", function(d) {\n return d.r * k;\n });\n\n function switchPrefixesInPlace(d) {\n // if uris match with the topLevelParentUri of the focused element\n // or your focus is a top level parent hide its label and if it is not\n // a child element show all of its child labels. If it is a child element\n // only show its label.\n if (d.data.fullName === focus.data.topLevelParentUri || focus.data.topLevelParentUri === ROOT_OBJ_NAME) {\n d.textSel.style(\"display\", \"none\");\n if (focus.children && focus.children.length) {\n _.each(focus.children, function(c) {\n c.textSel.style(\"display\", \"inline\");\n });\n } else {\n focus.textSel.style(\"display\", \"inline\");\n }\n\n // in order to show prefixes of siblings check if the focused\n // element has a parent and show all of its children except\n // for the name of the focused element because you need to see\n // its children\n if (focus.parent) {\n _.each(focus.parent.children, function(c) {\n if (c.data.name !== focus.data.name) {\n c.textSel.style(\"display\", \"inline\");\n }\n });\n }\n }\n }\n\n if (switchPrefixes) {\n text.each(switchPrefixesInPlace);\n }\n\n text\n .style(\"font-size\", function(d) {\n if (config.noPrefixes) {\n return D3.Text.calcFontSize(d.noPrefixName, d.r * k);\n }\n return D3.Text.calcFontSize(d.data.name, d.r * k);\n })\n .text(function(d) {\n if (config.noPrefixes) {\n return D3.Text.getTextWithElipsisIfNeeded(d.noPrefixName, d.r * k / 3);\n }\n return D3.Text.getTextWithElipsisIfNeeded(d.data.name, d.r * k / 3);\n });\n }\n\n\n function adjustRadius(r) {\n let newr = r * 2 + margin;\n if (r * 2 / newr < 0.3) {\n // for very small circles we need to adjust\n newr = r * 2 + 2;\n }\n return newr;\n }\n\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)], switchPrefixes);\n\n function textUpdate(d) {\n if (d.isInFocusTransitive || !(d.parent && d.parent.isInFocusTransitive)) {\n // hide labels of classes that are in focus (including children) OR whose parents aren't in focus\n d.textHidden = true;\n this.style.display = \"none\";\n } else {\n // show all other labels\n d.textHidden = this.textContent.indexOf(\"...\") + 3 === this.textContent.length;\n this.style.display = \"\";\n }\n }\n\n function zoom(d, shouldClosePanel) {\n // use empty timeout to force the following code to be executed on the next $digest cycle\n // in order to avoid '$digest in progress' error\n $timeout(function() {\n scope.showExternalElements = (d.data.name === ROOT_OBJ_NAME);\n });\n\n if (focus === d) {\n // Node is already zoomed to\n // Important to return before we modify the history, otherwise we choke the browser\n return;\n }\n\n if (d.data.id) {\n $window.history.replaceState({id: d.data.id}, \"classHierarchyPage\" + d.data.id, \"hierarchy#\" + d.data.id);\n }\n\n if (!d.children) {\n // No children - zoom to parent instead\n d = d.parent;\n if (focus === d) {\n // Parent is already zoomed to\n return;\n }\n }\n\n if (shouldClosePanel) {\n closeClassInfoPanel();\n d3.selectAll(\".selected\").classed(\"selected\", false);\n }\n\n if (focus.parent) {\n let p = focus;\n while (p) {\n p.isInFocusTransitive = false;\n p = p.parent;\n }\n }\n\n let p = d;\n while (p) {\n p.isInFocusTransitive = !!p.children;\n p = p.parent;\n }\n\n focus = d;\n\n const isVerySmallCircle = focus.r * 2 / (focus.r * 2 + margin) < 0.3;\n\n if (isVerySmallCircle || scope.currentSliderValue > scope.currentBrowserLimit) {\n // no fancy animation for slower browsers if above the limit or if zooming to a very small circle\n zoomTo([focus.x, focus.y, adjustRadius(focus.r)]);\n\n text.each(function(d) {\n textUpdate.call(this, d);\n });\n } else {\n // the fancy version for faster browsers\n const transition = d3.transition()\n .duration(ZOOM_DURATION)\n .tween(\"zoom\", function(d) {\n const i = d3.interpolateZoom(view, [focus.x, focus.y, adjustRadius(focus.r)]);\n return function(t) {\n zoomTo(i(t));\n };\n });\n\n transition.selectAll(\"text\")\n // Experimental: hide texts to be hidden on \"start\", show texts to be shown on \"end\"\n .each(textUpdate);\n }\n }\n\n rootFocusEvent = scope.$on('rootFocus', function() {\n $window.history.pushState({id: 1}, \"classHierarchyPage1\", \"hierarchy#1\");\n doFocus(rootHierarchy);\n });\n\n classSearchEvent = scope.$on('classSearch', function(selectedClass) {\n doFocus(selectedClass);\n });\n }\n\n function sendSliderData() {\n const currentClassCount = scope.classHierarchyData.classCount;\n let currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n\n if (!currentSliderValue || currentSliderValue > currentClassCount) {\n currentSliderValue = currentClassCount;\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n }\n\n $rootScope.$broadcast(\"classCount\", currentClassCount, currentSliderValue);\n }\n\n window.addEventListener('resize', sendSliderData);\n\n window.addEventListener('beforeunload', removeResizeListener);\n\n function removeResizeListener() {\n window.removeEventListener('resize', sendSliderData);\n window.removeEventListener('beforeunload', removeResizeListener);\n }\n\n let prefixesWatch;\n let currentClassCountWatch;\n let searchedClassBroadcast;\n let onEnterClassSearchBroadcast;\n\n scope.$watch('classHierarchyData', function() {\n // when data changes unregister watchers by calling them\n if (prefixesWatch) prefixesWatch();\n if (currentClassCountWatch) currentClassCountWatch();\n if (searchedClassBroadcast) searchedClassBroadcast();\n if (onEnterClassSearchBroadcast) onEnterClassSearchBroadcast();\n\n // get initial state of prefixes (hidden or not) when changing repositories\n // in order to avoid triggering an unwanted prefixes watch\n let initialPrefixesState = getPrefixesState();\n\n if (scope.classHierarchyData.classCount) {\n sendSliderData();\n\n const rootData = structuredClone(scope.classHierarchyData);\n\n const root = d3.hierarchy(rootData);\n\n function sortRoot(root) {\n // add all classes to a flat array, add parent information\n // and sort according to instancesCount DESC, depth ASC\n\n return root.descendants()\n .sort(function(a, b) {\n if (a.data.sortingRank > b.data.sortingRank) {\n return -1;\n } else if (a.data.sortingRank < b.data.sortingRank) {\n return 1;\n } else if (a.data.depth > b.data.depth) {\n return 1;\n } else if (a.data.depth < b.data.depth) {\n return -1;\n } else {\n return 0;\n }\n });\n }\n\n const sortedChildren = sortRoot(root);\n\n // we start with an empty new rootData\n let filteredRootData;\n let noPrefixesGlobal;\n\n\n function restoreDiagramState(currentRootData, switchPrefixes) {\n const prefixesConfig = {\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n\n // get noPrefixes flag from drawDiagram configuration params\n noPrefixesGlobal = prefixesConfig.noPrefixes;\n\n if (filteredRootData) {\n drawDiagram(filteredRootData, prefixesConfig, focus, true);\n } else {\n drawDiagram(currentRootData, prefixesConfig, focus, true);\n }\n\n $timeout(() => {\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_SWITCH_PREFIXES, switchPrefixes);\n autoZoomToPreviousState();\n // Need to set this to false to enable the info panel to work when selecting a class.\n // The panel opening will be suppressed only when the prefixes are toggled.\n suppressPanelOpen = false;\n }, 70);\n }\n\n function redrawFilteredDiagram(currentSliderValue, sortedChildrenArray, useSlider) {\n if (!currentSliderValue) {\n return;\n }\n\n LocalStorageAdapter.set(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE, currentSliderValue);\n\n filteredRootData = {\n name: ROOT_OBJ_NAME,\n children: [],\n };\n\n // walk through the given count of (sortedChildrenArray) classes\n // - record the id of each class we've seen\n // - add the rootData level classes to the new rootData\n const addedIds = new Set();\n for (let k = 1; k <= currentSliderValue; k++) {\n addedIds.add(sortedChildrenArray[k].data.id);\n if (sortedChildrenArray[k].parent === sortedChildrenArray[0]) { // i.e. the parent is the \"class hierarchy\"\n filteredRootData.children.push(sortedChildrenArray[k].data);\n }\n }\n\n // walk through all the classes in the new rootData and only keep those that have an \"added id\"\n // we create separate copies of the arrays in order not to contaminate the original data\n // we also copy each class's object ($.extend ...) for the same reason\n function fixChildren(node) {\n if (!node.children) {\n return;\n }\n const newChildren = [];\n for (const child of node.children) {\n if (addedIds.has(child.id)) {\n newChildren.push($.extend({}, child));\n }\n }\n node.children = newChildren;\n for (const child of node.children) {\n fixChildren(child);\n }\n }\n\n fixChildren(filteredRootData);\n\n if (useSlider) {\n // redraw diagram when slider value changes and persist current state\n // in local storage\n noPrefixesGlobal = angular.isUndefined(noPrefixesGlobal) ? getPrefixesState() : noPrefixesGlobal;\n const redrawConfig = {\n noPrefixes: noPrefixesGlobal,\n };\n drawDiagram(filteredRootData, redrawConfig);\n } else {\n // if the user returns to the diagram with back browser button\n // read the saved state (show/hide prefixes, current slider value)\n // from local storage and render the diagram according to the saved metrics\n restoreDiagramState(rootData);\n }\n }\n\n const currentSliderValue = LocalStorageAdapter.get(LSKeys.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);\n if (currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren);\n } else {\n const basicConfig = {\n doFade: true,\n keepPrevState: true,\n noPrefixes: getPrefixesState(),\n };\n drawDiagram(rootData, basicConfig);\n autoZoomToPreviousState();\n }\n\n prefixesWatch = scope.$watch('hidePrefixes', function(hidePrefixes) {\n if (angular.isUndefined(hidePrefixes) || initialPrefixesState) {\n initialPrefixesState = undefined;\n return;\n }\n // if digest overflows a possible fix might be wrapping this in $timeout\n $timeout(function() {\n suppressPanelOpen = true;\n savePrefixesState(hidePrefixes);\n restoreDiagramState(rootData, true);\n }, 50);\n }, true);\n\n currentClassCountWatch = scope.$watch('currentSliderValue', function(currentSliderValue) {\n redrawFilteredDiagram(currentSliderValue, sortedChildren, true);\n }, true);\n\n // we handle this event for the cases where we already have searched for a given class and\n // hit enter again on the already selected class in order again react and zoom to it again\n // if we are not at the moment\n let currentSearchedClass;\n onEnterClassSearchBroadcast = scope.$on('onEnterKeypressSearchAction', function(event) {\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n\n searchedClassBroadcast = scope.$on('searchedClass', function(event, searchedClass) {\n currentSearchedClass = flattenedClassData[searchedClass.name];\n if (currentSearchedClass) {\n doFocus(currentSearchedClass);\n }\n });\n }\n }, true);\n }\n}\n","var CirclePacking = CirclePacking || {};\n\nCirclePacking.SingleChild = function () {\n /*\n Functions that enable single child circles to display properly, see\n http://stackoverflow.com/questions/22307486/d3-js-packed-circle-layout-how-to-adjust-child-radius\n */\n function addPlaceholders(node, first) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n var child = node.children[i];\n addPlaceholders(child);\n }\n\n if (node.children.length === 1) {\n var placeholderSize = node.size * 1.2;\n if (first) {\n placeholderSize = node.children[0].size * 0.1;\n }\n node.children.push({\n name: 'placeholder', size: placeholderSize,\n // children: []\n });\n }\n }\n }\n\n function removePlaceholders(nodes) {\n for (var i = nodes.length - 1; i >= 0; i--) {\n var node = nodes[i];\n\n if (node.data.name === 'placeholder') {\n nodes.splice(i, 1);\n } else {\n if (node.children) {\n removePlaceholders(node.children);\n }\n }\n }\n }\n\n function centerNodes(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (node.children) {\n if (node.children.length === 1) {\n var offset = node.x - node.children[0].x;\n node.children[0].x += offset;\n reposition(node.children[0], offset);\n }\n }\n }\n\n function reposition(node, offset) {\n if (node.children) {\n for (var i = 0; i < node.children.length; i++) {\n node.children[i].x += offset;\n reposition(node.children[i], offset);\n }\n }\n }\n }\n\n function makePositionsRelativeToZero(nodes) {\n //use this to have vis centered at 0,0,0 (easier for positioning)\n var offsetX = nodes[0].x;\n var offsetY = nodes[0].y;\n\n for (var i = 0; i < nodes.length; i++) {\n\n var node = nodes[i];\n\n node.x -= offsetX;\n node.y -= offsetY;\n }\n }\n\n return {\n addPlaceholders: addPlaceholders,\n removePlaceholders: removePlaceholders,\n centerNodes: centerNodes,\n makePositionsRelativeToZero: makePositionsRelativeToZero\n }\n}();\n\nexport default CirclePacking;\n","import 'lib/d3.patch.js'\nimport {selectAll} from 'd3';\n\nconst d3 = {selectAll};\nvar SVG = SVG || {};\n\nSVG.Export = function () {\n function getCSSRules(cssSourceFilePath) {\n const cssRules = $('link[href=\"' + cssSourceFilePath + '\"]')[0].sheet.rules;\n let cssStr = \"\";\n _.each(cssRules, function (value) {\n cssStr += value.cssText;\n });\n return cssStr;\n }\n\n function generateBase64ImageSource(svgSelectorClass) {\n if (!svgSelectorClass) {\n svgSelectorClass = \"svg\";\n }\n // add needed xml namespace\n const exportSvg = d3.selectAll(svgSelectorClass)\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .node().parentNode.innerHTML;\n\n // convert selected html to base64\n return \"data:image/svg+xml;charset=utf-8;base64,\" + btoa(unescape(encodeURIComponent(exportSvg)));\n }\n\n return {\n getCSSRules: getCSSRules,\n generateBase64ImageSource: generateBase64ImageSource\n };\n}();\n\nexport default SVG;\n"],"names":["classHierarchyDirective","$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate","restrict","template","scope","classHierarchyData","flattenedClassNames","selectedClass","currentSliderValue","showClassInfoPanel","showExternalElements","hidePrefixes","currentBrowserLimit","link","element","attrs","suppressPanelOpen","tip","rootHierarchy","packLayout","d3","size","diameter","color","domain","range","interpolate","svg","insert","attr","on","appendMainGroup","append","id","transform","getPrefixesState","get","CLASS_HIERARCHY_HIDE_PREFIXES","prepareForSVGImageExport","cssRules","SVG","Export","getCSSRules","$","style","imgSrc","generateBase64ImageSource","this","href","download","getActiveRepository","g","hasData","classCount","canUseRepo","isSystemRepository","autoZoomToPreviousState","doFocus","focus","rootFocusEvent","classSearchEvent","service","LicenseContextService","onLicenseChanged","license","valid","loader","hierarchyError","selGraphFromCache","getClassHierarchyData","contextID","uri","success","response","status","warning","instant","error","getError","name","fetchClassHierarchy","flattenedClassData","drawDiagram","root","config","newFocus","switchPrefixes","remove","CirclePacking","SingleChild","addPlaceholders","sum","d","nodes","descendants","view","isInFocusTransitive","removePlaceholders","centerNodes","makePositionsRelativeToZero","d3tip","customPosition","event","top","bottom","innerHeight","clientY","right","innerWidth","clientX","html","data","call","circleGroup","selectAll","enter","doFade","each","D3","Transition","fadeIn","circle","role","children","depth","key","push","classed","noPrefixes","textHidden","show","hide","zoom","getCurrentClassDataAndMarkSelected","obj","selected","closeClassInfoPanel","_","uniqBy","clickCancel","Click","delayDblClick","$on","history","pushState","$broadcast","stopPropagation","lastTimeWheel","preventDefault","now","Date","direction","deltaY","target","__data__","parent","newobj","i","length","sortingRank","replaceState","sendSliderData","text","textSel","idx","indexOf","noPrefixName","substring","Text","calcFontSize","r","getTextWithElipsisIfNeeded","textContent","keepPrevState","focusOnCurrentClass","focusHistoryId","hash","onpopstate","state","node","zoomTo","v","k","x","y","fullName","topLevelParentUri","c","adjustRadius","newr","textUpdate","display","shouldClosePanel","p","duration","tween","t","currentClassCount","CLASS_HIERARCHY_CURRENT_SLIDER_VALUE","set","prefixesWatch","currentClassCountWatch","searchedClassBroadcast","onEnterClassSearchBroadcast","window","addEventListener","removeResizeListener","removeEventListener","$watch","initialPrefixesState","rootData","structuredClone","sortedChildren","sort","a","b","filteredRootData","noPrefixesGlobal","restoreDiagramState","currentRootData","prefixesConfig","CLASS_HIERARCHY_SWITCH_PREFIXES","redrawFilteredDiagram","sortedChildrenArray","useSlider","addedIds","Set","add","fixChildren","newChildren","child","has","extend","angular","isUndefined","basicConfig","currentSearchedClass","undefined","savePrefixesState","searchedClass","renderCirclePacking","module","constant","directive","$inject","first","placeholderSize","splice","offset","reposition","offsetX","offsetY","cssSourceFilePath","sheet","rules","cssStr","value","cssText","svgSelectorClass","exportSvg","parentNode","innerHTML","btoa","unescape","encodeURIComponent"],"sourceRoot":""}