graphdb-workbench 3.4.0-RC1 → 3.4.0-RC3

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 (91) hide show
  1. package/dist/43239.b25bff32bd3042d6e4d5.bundle.js +2 -0
  2. package/dist/43239.b25bff32bd3042d6e4d5.bundle.js.map +1 -0
  3. package/dist/{64709.8737bed2e0ae2fd242ad.bundle.js → 64709.5da9892398a666ebeef4.bundle.js} +2 -2
  4. package/dist/{64709.8737bed2e0ae2fd242ad.bundle.js.map → 64709.5da9892398a666ebeef4.bundle.js.map} +1 -1
  5. package/dist/{65677.0dd257bfe7cba81f05ae.bundle.js → 65677.226342f9f9873c738f95.bundle.js} +2 -2
  6. package/dist/{65677.0dd257bfe7cba81f05ae.bundle.js.map → 65677.226342f9f9873c738f95.bundle.js.map} +1 -1
  7. package/dist/{80933.8f219e360fc769d8f417.bundle.js → 80933.a136f3f8519df7c368be.bundle.js} +2 -2
  8. package/dist/{80933.8f219e360fc769d8f417.bundle.js.map → 80933.a136f3f8519df7c368be.bundle.js.map} +1 -1
  9. package/dist/{82917.cdf99b39340c71f2e7ec.bundle.js → 82917.5cfcc35f7ddb50d29064.bundle.js} +2 -2
  10. package/dist/{82917.cdf99b39340c71f2e7ec.bundle.js.map → 82917.5cfcc35f7ddb50d29064.bundle.js.map} +1 -1
  11. package/dist/{86099.59b1698c309dabf9752c.bundle.js → 86099.899557f3b2424ed12d7f.bundle.js} +2 -2
  12. package/dist/{86099.59b1698c309dabf9752c.bundle.js.map → 86099.899557f3b2424ed12d7f.bundle.js.map} +1 -1
  13. package/dist/index.html +9 -9
  14. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  15. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  16. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  17. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  18. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  19. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  20. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  21. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  22. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  23. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  24. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  25. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  26. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  27. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  28. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  29. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  30. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  31. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  32. package/dist/js/angular/security/templates/user.html +2 -2
  33. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  34. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  35. package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
  36. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  37. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  38. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  39. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  40. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  41. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  42. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  43. package/dist/{legacyWorkbench.406725e9d0dcd5dc81f6.js → legacyWorkbench.e5c65a0693d335a3dae5.js} +3 -3
  44. package/dist/{legacyWorkbench.406725e9d0dcd5dc81f6.js.map → legacyWorkbench.e5c65a0693d335a3dae5.js.map} +1 -1
  45. package/dist/{main.ccfe80d73eef58ba6ed7.js → main.3a95f9ea38e16f022c72.js} +3 -3
  46. package/dist/{main.ccfe80d73eef58ba6ed7.js.map → main.3a95f9ea38e16f022c72.js.map} +1 -1
  47. package/dist/pages/aclmanagement.html +1 -1
  48. package/dist/pages/autocomplete.html +1 -1
  49. package/dist/pages/choose-repository-type.html +1 -1
  50. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  51. package/dist/pages/create-index.html +1 -1
  52. package/dist/pages/dependencies.html +1 -1
  53. package/dist/pages/domainRangeInfo.html +2 -2
  54. package/dist/pages/edit.html +1 -1
  55. package/dist/pages/explore.html +1 -1
  56. package/dist/pages/export.html +1 -1
  57. package/dist/pages/find.html +1 -1
  58. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  59. package/dist/pages/graphs-visualizations.html +7 -7
  60. package/dist/pages/guides.html +1 -1
  61. package/dist/pages/home.html +1 -1
  62. package/dist/pages/import.html +2 -2
  63. package/dist/pages/jdbc-create.html +1 -1
  64. package/dist/pages/jdbc.html +1 -1
  65. package/dist/pages/monitor/backup-and-restore.html +1 -1
  66. package/dist/pages/monitor/queries.html +1 -1
  67. package/dist/pages/monitor/resources.html +1 -1
  68. package/dist/pages/namespaces.html +2 -2
  69. package/dist/pages/plugins.html +1 -1
  70. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  71. package/dist/pages/rdfrank.html +2 -2
  72. package/dist/pages/repositories.html +1 -1
  73. package/dist/pages/repository.html +1 -1
  74. package/dist/pages/similarity-indexes.html +1 -1
  75. package/dist/pages/sparql-editor.html +1 -1
  76. package/dist/pages/sparql-template-create.html +1 -1
  77. package/dist/pages/sparql-templates.html +1 -1
  78. package/dist/pages/ux-test1.html +2 -2
  79. package/dist/pages/webapi.html +2 -2
  80. package/dist/res/swagger5/index.html +11 -11
  81. package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
  82. package/dist/shared-components/collection/components/onto-layout/onto-layout.js +1 -1
  83. package/dist/shared-components/esm/onto-layout.entry.js +1 -1
  84. package/dist/shared-components/shared-components/p-676674e7.entry.js +1 -0
  85. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  86. package/package.json +1 -1
  87. package/dist/43239.952f19ca80f5942d17ef.bundle.js +0 -2
  88. package/dist/43239.952f19ca80f5942d17ef.bundle.js.map +0 -1
  89. package/dist/shared-components/shared-components/p-c6618569.entry.js +0 -1
  90. /package/dist/{legacyWorkbench.406725e9d0dcd5dc81f6.js.LICENSE.txt → legacyWorkbench.e5c65a0693d335a3dae5.js.LICENSE.txt} +0 -0
  91. /package/dist/{main.ccfe80d73eef58ba6ed7.js.LICENSE.txt → main.3a95f9ea38e16f022c72.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphdb-workbench",
3
- "version": "3.4.0-RC1",
3
+ "version": "3.4.0-RC3",
4
4
  "description": "The web application for GraphDB APIs",
5
5
  "engines": {
6
6
  "node": ">=22.17"
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=43239;export const __webpack_esm_ids__=[43239];export const __webpack_esm_modules__={29229(e,t,i){function a(e,t=300){let i;return(...a)=>{clearTimeout(i),i=setTimeout(()=>e.apply(this,a),t)}}i.d(t,{d:()=>a})},43239(e,t,i){i.r(t),i.d(t,{onto_layout:()=>o});var a=i(18072),s=i(29229),n=i(57154),r=i(36015);const o=class{constructor(e){(0,a.r)(this,e),this.authenticationService=(0,n.service)(n.AuthenticationService),this.authorizationService=(0,n.service)(n.AuthorizationService),this.navigationContextService=(0,n.service)(n.NavigationContextService),this.authStorageService=(0,n.service)(n.AuthenticationStorageService),this.runtimeConfigurationContextService=(0,n.service)(n.RuntimeConfigurationContextService),this.eventService=(0,n.service)(n.EventService),this.applicationLifecycleContextService=(0,n.service)(n.ApplicationLifecycleContextService),this.fullJwtKey=`${n.StorageKey.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.jwtKey}`,this.fullAuthenticatedKey=`${n.StorageKey.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.authenticatedKey}`,this.authEvents=[this.fullJwtKey,this.fullAuthenticatedKey],this.isLowResolution=!1,this.showHeader=this.isAuthenticatedFully(),this.showNavbar=!1,this.isEmbedded=!1,this.loading=!0,this.subscriptions=new n.SubscriptionList,this.isNavbarCollapsed=!1,this.handleStorageChange=e=>{(0,n.service)(n.LocalStorageSubscriptionHandlerService).handleStorageChange(e),this.handleAuthChange(e.key)},this.windowResizeObserver=(0,s.d)(()=>this.windowResizeHandler(),50),n.WindowService.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscribeToNavigationEnd(),this.subscribeToRuntimeConfigurationChanges(),this.subscribeToApplicationChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return(0,a.h)(a.a,{key:"e804e5e5580a95b69639645bfab907601c058c61",class:{"wb-layout":!0,"is-embedded":this.isEmbedded,"hide-navbar":!this.showNavbar}},(0,a.h)("div",{key:"3c9a99e6e75c49abc8857ca3a4cd1cab647ecf34",class:"default-slot-wrapper"},(0,a.h)("slot",{key:"e17a4cf9e5d9f4964ea4e298ff2f35c10acab3ef",name:"default"})),!this.isEmbedded&&(0,a.h)("header",{key:"969dec650ec39d56bc570f37bcb8e324b94bded5",class:"wb-header"},this.showHeader&&(0,a.h)("onto-header",{key:"431a2437aa740076630e14f3f3548efc9cd3ddb9"})),!this.isEmbedded&&this.showNavbar&&(0,a.h)("nav",{key:"8c901178a258aeb6f06f189fb49124d7b7601d03",class:"wb-navbar"},(0,a.h)("onto-navbar",{key:"ffd590a345d930bb64140426890a7a5f0f52f387",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),(0,a.h)("div",{key:"25b14fd7973ca79d667d0877146bc053d8788263",class:{"main-slot-wrapper":!0,loading:this.loading}},this.loading&&(0,a.h)("div",{key:"bf6cb9e06407ca99fb3ee7cbe096ab0964cf766e",class:"loader-wrapper"},(0,a.h)("onto-loader",{key:"e441c8d8a0a22aaab0028bc081b5df00ffb9d7b0",size:96,messageText:r.T.translate("common.loading")})),(0,a.h)("slot",{key:"6738aeda481d1c26d1777284123ec1e794d81726",name:"main"})),!this.isEmbedded&&(0,a.h)("footer",{key:"1af8f2c5be2af29fa602774e4caeac6ef0354b79",class:"wb-footer"},(0,a.h)("onto-footer",{key:"e93aac557e306d05e6b8e143f6baaee877ab1c33"})),(0,a.h)("onto-tooltip",{key:"80e5775e95c10abca123c4c910e3d810ef53c230"}),(0,a.h)("onto-confirm-cancel-dialog",{key:"e534a95889e7cc7230d973bad6d69acb2945369e"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){var e,t,i,a;this.isLowResolution=n.WindowService.getWindow().innerWidth<=768;const s=document.querySelector(".navbar-component");if(s){const n=document.querySelector(".cookie-consent-banner"),r=document.querySelector(".header-component"),o=null!==(t=null===(e=null==r?void 0:r.getBoundingClientRect())||void 0===e?void 0:e.height)&&void 0!==t?t:0,h=null!==(a=null===(i=null==n?void 0:n.getBoundingClientRect())||void 0===i?void 0:i.height)&&void 0!==a?a:0;s.style.height=`calc(100% - ${o}px - ${h}px)`}this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleAuthChange(e){var t;e&&this.authEvents.includes(e)&&(this.authStorageService.isAuthenticated()?(0,n.navigate)(null!==(t=this.navigationContextService.getPreviousRoute())&&void 0!==t?t:"./"):(0,n.navigate)("login"),n.WindowService.getWindow().location.reload())}subscribeToSecurityChanges(){const e=(0,n.service)(n.SecurityContextService);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(this.eventService.subscribe(n.EventName.LOGIN,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(this.eventService.subscribe(n.EventName.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility(),(0,n.navigate)("login")}))}subscribeToRuntimeConfigurationChanges(){this.subscriptions.add(this.runtimeConfigurationContextService.onRuntimeConfigurationChanged(e=>{var t;this.isEmbedded=null!==(t=null==e?void 0:e.isEmbedded)&&void 0!==t&&t}))}updateVisibility(){this.authenticationService.isSecurityEnabled()?(this.showHeader=this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess(),this.showNavbar=this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess()):(this.showNavbar=!0,this.showHeader=!0)}isAuthenticatedFully(){return!this.authenticationService.isSecurityEnabled()||this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&this.authorizationService.hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef&&(this.navbarRef.menuItems=n.WindowService.getPluginRegistry().get(n.MainMenuExtensionPoint.NAME),this.setNavbarItemVisibility())}}setNavbarItemVisibility(){var e,t,i;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const a=e=>{var t;e.shouldShow=this.shouldShowMenu(e.role),(null===(t=e.children)||void 0===t?void 0:t.length)&&e.children.forEach(a)};null===(i=null===(t=this.navbarRef)||void 0===t?void 0:t.menuItems)||void 0===i||i.forEach(e=>{e.items.forEach(a)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}subscribeToNavigationEnd(){this.subscriptions.add(this.eventService.subscribe(n.EventName.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.loading=!1}))}subscribeToApplicationChange(){this.subscriptions.add(this.applicationLifecycleContextService.onNavigationBeforeMountRouting(e=>{e&&(this.loading=!0)}))}get hostElement(){return(0,a.d)(this)}};o.style=':host{display:block;height:100%}.wb-layout{display:grid;grid-template:"header header" auto "nav main" 1fr "nav footer" auto/15rem minmax(200px, 1fr);min-height:100vh;margin:0;}.wb-layout.expanded{grid-template-columns:4.375rem 1fr}.wb-layout.is-embedded{grid-template-columns:1fr;grid-template-areas:"main";padding-top:1rem}.wb-layout.hide-navbar{grid-template:"header" auto "main" 1fr "footer" auto/1fr;}.wb-layout.hide-navbar.expanded{grid-template-columns:1fr}.wb-layout main .main-container{margin-left:0}.wb-layout .main-slot-wrapper .loader-wrapper{flex-grow:1;display:flex;align-items:center;justify-content:center}.wb-layout .main-slot-wrapper.loading{display:flex;flex-direction:column}.wb-layout .main-slot-wrapper.loading .page-content{visibility:hidden}.wb-layout .default-slot-wrapper{display:none}.wb-layout .wb-header{position:sticky;top:0;z-index:999}.wb-layout nav{grid-area:nav}.wb-layout header{grid-area:header}.wb-layout main{grid-area:main}.wb-layout footer{grid-area:footer}'},36015(e,t,i){i.d(t,{L:()=>s,T:()=>o,s:()=>n});var a=i(57154);class s{static get logger(){return a.Loggers.getLoggerInstance("SharedComponents")}}function n(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}class r{constructor(){this.languageContextService=a.ServiceProvider.get(a.LanguageContextService),this.translationChangedObservers={},this.logger=s.logger,this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,t=[],i=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const a={parameters:t,callback:i};return this.translationChangedObservers[e].push(a),i(this.translate(e,t)),()=>{const t=this.translationChangedObservers[e].indexOf(a);-1!==t&&this.translationChangedObservers[e].splice(t,1)}}translate(e,t){return this.translateInLocale(e,t)}translateInLocale(e,t){let i=this.translateFromBundle(this.currentBundle,e);return i||(i=this.translateFromBundle(this.defaultBundle,e)),i?(i=this.applyParameters(i,t),n(i)):(this.logger.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,t){if(!e)return;let i=e[t];return"string"!=typeof i&&(i=this.translateAsJsonObject(e,t)),i}translateAsJsonObject(e,t){if(!t)return;let i=t.split(".");return this.getTranslation(e,i)}getTranslation(e,t){if(!t||!e)return;const i=e[t.splice(0,1)[0]];return 0===t.length?i:"string"!=typeof i?t.length>0?this.getTranslation(i,t):i:void 0}applyParameters(e,t){return t?t.reduce((e,t)=>r.replaceAll(e,t),e):e}static replaceAll(e,t){return t?e.split(`{{${t.key}}}`).join(t.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(t=>t.callback(this.translate(e,t.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const o=new r}};
2
- //# sourceMappingURL=43239.952f19ca80f5942d17ef.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"43239.952f19ca80f5942d17ef.bundle.js","mappings":"kIAAA,SAASA,EAASC,EAAMC,EAAO,KAC3B,IAAIC,EACJ,MAAO,IAAIC,KACPC,aAAaF,GACbA,EAAQG,WAAW,IAAML,EAAKM,MAAMC,KAAMJ,GAAOF,GAEzD,C,iHCDA,MASMO,EAAa,MAIfC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBJ,KAAMG,GAIvBH,KAAKK,uBAAwBC,EAAAA,EAAAA,SAAQC,EAAAA,uBACrCP,KAAKQ,sBAAuBF,EAAAA,EAAAA,SAAQG,EAAAA,sBACpCT,KAAKU,0BAA2BJ,EAAAA,EAAAA,SAAQK,EAAAA,0BACxCX,KAAKY,oBAAqBN,EAAAA,EAAAA,SAAQO,EAAAA,8BAClCb,KAAKc,oCAAqCR,EAAAA,EAAAA,SAAQS,EAAAA,oCAClDf,KAAKg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GAAYb,GAE/FA,CACX,CACA,iBAAOc,CAAWd,EAAaa,GAC3B,OAAOA,EAAYb,EAAYQ,MAAM,KAAKK,EAAUzI,SAAS2I,KAAKF,EAAUlC,OAASqB,CACzF,CACAgB,yBAAAA,GACIC,OAAOC,KAAKvL,KAAKqJ,6BAA6BvB,QAAS0D,KACjCxL,KAAKqJ,4BAA4BmC,IAAc,IACvD1D,QAAS+B,GAAaA,EAASE,SAAS/J,KAAKkE,UAAUsH,EAAW3B,EAASC,eAE7F,CACAN,uBAAAA,GACIxJ,KAAKyL,2BAA6BzL,KAAKkJ,uBAAuBwC,wBAAyBhB,IAC/EA,IACA1K,KAAKuK,cAAgBG,EACrB1K,KAAKqL,8BAGjB,CACAM,OAAAA,GACQ3L,KAAKyL,4BACLzL,KAAKyL,4BAEb,EAEJ,MAAMxH,EAAqB,IAAIgF,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/function-utils-D1ZpXQQS.js","webpack://root-config/./packages/shared-components/dist/esm/onto-layout.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-FB05Sh97.js"],"sourcesContent":["function debounce(func, wait = 300) {\n let timer;\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => func.apply(this, args), wait);\n };\n}\n\nexport { debounce as d };\n","import { r as registerInstance, h, a as Host, d as getElement } from './index-BntG-4Sv.js';\nimport { d as debounce } from './function-utils-D1ZpXQQS.js';\nimport { service, AuthenticationService, AuthorizationService, NavigationContextService, AuthenticationStorageService, RuntimeConfigurationContextService, EventService, ApplicationLifecycleContextService, StorageKey, SubscriptionList, LocalStorageSubscriptionHandlerService, WindowService, navigate, SecurityContextService, EventName, MainMenuExtensionPoint } from '@ontotext/workbench-api';\nimport { T as TranslationService } from './translation.service-FB05Sh97.js';\n\nconst RESPONSIVE_BREAKPOINTS = {\n MD: 768};\n/**\n * The width of the window in pixels at which the navbar should collapse.\n */\nconst WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR = RESPONSIVE_BREAKPOINTS.MD;\n\nconst ontoLayoutCss = \":host{display:block;height:100%}.wb-layout{display:grid;grid-template:\\\"header header\\\" auto \\\"nav main\\\" 1fr \\\"nav footer\\\" auto/15rem minmax(200px, 1fr);min-height:100vh;margin:0;}.wb-layout.expanded{grid-template-columns:4.375rem 1fr}.wb-layout.is-embedded{grid-template-columns:1fr;grid-template-areas:\\\"main\\\";padding-top:1rem}.wb-layout.hide-navbar{grid-template:\\\"header\\\" auto \\\"main\\\" 1fr \\\"footer\\\" auto/1fr;}.wb-layout.hide-navbar.expanded{grid-template-columns:1fr}.wb-layout main .main-container{margin-left:0}.wb-layout .main-slot-wrapper .loader-wrapper{flex-grow:1;display:flex;align-items:center;justify-content:center}.wb-layout .main-slot-wrapper.loading{display:flex;flex-direction:column}.wb-layout .main-slot-wrapper.loading .page-content{visibility:hidden}.wb-layout .default-slot-wrapper{display:none}.wb-layout .wb-header{position:sticky;top:0;z-index:999}.wb-layout nav{grid-area:nav}.wb-layout header{grid-area:header}.wb-layout main{grid-area:main}.wb-layout footer{grid-area:footer}\";\n\nconst OntoLayout = class {\n // ========================\n // Lifecycle methods\n // ========================\n constructor(hostRef) {\n registerInstance(this, hostRef);\n // ========================\n // Services\n // ========================\n this.authenticationService = service(AuthenticationService);\n this.authorizationService = service(AuthorizationService);\n this.navigationContextService = service(NavigationContextService);\n this.authStorageService = service(AuthenticationStorageService);\n this.runtimeConfigurationContextService = service(RuntimeConfigurationContextService);\n this.eventService = service(EventService);\n this.applicationLifecycleContextService = service(ApplicationLifecycleContextService);\n this.fullJwtKey = `${StorageKey.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.jwtKey}`;\n this.fullAuthenticatedKey = `${StorageKey.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.authenticatedKey}`;\n this.authEvents = [this.fullJwtKey, this.fullAuthenticatedKey];\n this.isLowResolution = false;\n this.showHeader = this.isAuthenticatedFully();\n this.showNavbar = false;\n this.isEmbedded = false;\n this.loading = true;\n // ========================\n // Private\n // ========================\n /**\n * List of subscriptions to manage component lifecycle\n * */\n this.subscriptions = new SubscriptionList();\n this.isNavbarCollapsed = false;\n this.handleStorageChange = (event) => {\n const localStorageSubscriptionHandlerService = service(LocalStorageSubscriptionHandlerService);\n localStorageSubscriptionHandlerService.handleStorageChange(event);\n this.handleAuthChange(event.key);\n };\n this.windowResizeObserver = debounce(() => this.windowResizeHandler(), 50);\n WindowService.getWindow().addEventListener('storage', this.handleStorageChange);\n }\n componentDidLoad() {\n this.windowResizeHandler();\n }\n connectedCallback() {\n this.subscribeToSecurityChanges();\n this.updateVisibility();\n this.subscribeToNavigationEnd();\n this.subscribeToRuntimeConfigurationChanges();\n this.subscribeToApplicationChange();\n }\n /**\n * Lifecycle method called when the component is about to be removed from the DOM.\n * Unsubscribes from all subscriptions to prevent memory leaks.\n */\n disconnectedCallback() {\n this.subscriptions.unsubscribeAll();\n }\n render() {\n return (h(Host, { key: 'e804e5e5580a95b69639645bfab907601c058c61', class: {\n 'wb-layout': true,\n 'is-embedded': this.isEmbedded,\n 'hide-navbar': !this.showNavbar\n } }, h(\"div\", { key: '3c9a99e6e75c49abc8857ca3a4cd1cab647ecf34', class: \"default-slot-wrapper\" }, h(\"slot\", { key: 'e17a4cf9e5d9f4964ea4e298ff2f35c10acab3ef', name: \"default\" })), !this.isEmbedded &&\n h(\"header\", { key: '969dec650ec39d56bc570f37bcb8e324b94bded5', class: \"wb-header\" }, this.showHeader && h(\"onto-header\", { key: '431a2437aa740076630e14f3f3548efc9cd3ddb9' })), !this.isEmbedded && this.showNavbar &&\n h(\"nav\", { key: '8c901178a258aeb6f06f189fb49124d7b7601d03', class: \"wb-navbar\" }, h(\"onto-navbar\", { key: 'ffd590a345d930bb64140426890a7a5f0f52f387', ref: this.assignNavbarRef(), \"navbar-collapsed\": this.isLowResolution })), h(\"div\", { key: '25b14fd7973ca79d667d0877146bc053d8788263', class: { 'main-slot-wrapper': true, 'loading': this.loading } }, this.loading && h(\"div\", { key: 'bf6cb9e06407ca99fb3ee7cbe096ab0964cf766e', class: \"loader-wrapper\" }, h(\"onto-loader\", { key: 'e441c8d8a0a22aaab0028bc081b5df00ffb9d7b0', size: 96, messageText: TranslationService.translate('common.loading') })), h(\"slot\", { key: '6738aeda481d1c26d1777284123ec1e794d81726', name: \"main\" })), !this.isEmbedded &&\n h(\"footer\", { key: '1af8f2c5be2af29fa602774e4caeac6ef0354b79', class: \"wb-footer\" }, h(\"onto-footer\", { key: 'e93aac557e306d05e6b8e143f6baaee877ab1c33' })), h(\"onto-tooltip\", { key: '80e5775e95c10abca123c4c910e3d810ef53c230' }), h(\"onto-confirm-cancel-dialog\", { key: 'e534a95889e7cc7230d973bad6d69acb2945369e' })));\n }\n // ========================\n // Event Listeners\n // ========================\n /**\n * Event listener for the navbar toggled event. The layout needs to respond properly when the navbar is toggled in\n * order to fit the content.\n * @param event\n */\n onNavbarToggled(event) {\n this.isNavbarCollapsed = event.detail.payload;\n if (this.isNavbarCollapsed) {\n this.hostElement.classList.add('expanded');\n }\n else {\n this.hostElement.classList.remove('expanded');\n }\n }\n /**\n * Event listener for window resize event. We need to handle this in order to allow the navbar to collapse when the\n * window is resized.\n */\n onResize() {\n this.windowResizeObserver();\n }\n // ========================\n // Handlers\n // ========================\n windowResizeHandler() {\n var _a, _b, _c, _d;\n this.isLowResolution = WindowService.getWindow().innerWidth <= WINDOW_WIDTH_FOR_COLLAPSED_NAVBAR;\n const navbar = document.querySelector('.navbar-component');\n if (navbar) {\n const cookieBanner = document.querySelector('.cookie-consent-banner');\n const header = document.querySelector('.header-component');\n const headerHeight = (_b = (_a = header === null || header === void 0 ? void 0 : header.getBoundingClientRect()) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 0;\n const bannerHeight = (_d = (_c = cookieBanner === null || cookieBanner === void 0 ? void 0 : cookieBanner.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0;\n navbar.style.height = `calc(100% - ${headerHeight}px - ${bannerHeight}px)`;\n }\n if (!this.isLowResolution && !this.isNavbarCollapsed) {\n this.hostElement.classList.remove('expanded');\n }\n else {\n this.hostElement.classList.add('expanded');\n }\n }\n handleAuthChange(changedKey) {\n var _a;\n if (!changedKey) {\n return;\n }\n if (this.authEvents.includes(changedKey)) {\n const authenticated = this.authStorageService.isAuthenticated();\n if (authenticated) {\n navigate((_a = this.navigationContextService.getPreviousRoute()) !== null && _a !== void 0 ? _a : './');\n }\n else {\n navigate('login');\n }\n WindowService.getWindow().location.reload();\n }\n }\n // ========================\n // Security & Permissions\n // ========================\n subscribeToSecurityChanges() {\n const securityContextService = service(SecurityContextService);\n this.subscriptions.add(securityContextService.onAuthenticatedUserChanged((authenticatedUser) => {\n this.authenticatedUser = authenticatedUser;\n this.updateVisibility();\n }));\n this.subscriptions.add(securityContextService.onSecurityConfigChanged((securityConfig) => {\n this.securityConfig = securityConfig;\n this.updateVisibility();\n }));\n this.subscriptions.add(this.eventService.subscribe(EventName.LOGIN, () => {\n this.setNavbarItemVisibility();\n this.updateVisibility();\n }));\n this.subscriptions.add(this.eventService.subscribe(EventName.LOGOUT, () => {\n this.setNavbarItemVisibility();\n this.updateVisibility();\n navigate('login');\n }));\n }\n subscribeToRuntimeConfigurationChanges() {\n this.subscriptions.add(this.runtimeConfigurationContextService.onRuntimeConfigurationChanged((config) => {\n var _a;\n this.isEmbedded = (_a = config === null || config === void 0 ? void 0 : config.isEmbedded) !== null && _a !== void 0 ? _a : false;\n }));\n }\n updateVisibility() {\n if (!this.authenticationService.isSecurityEnabled()) {\n this.showNavbar = true;\n this.showHeader = true;\n }\n else {\n this.showHeader = this.authenticationService.isAuthenticated() || this.authorizationService.hasFreeAccess();\n this.showNavbar = this.authenticationService.isAuthenticated() || this.authorizationService.hasFreeAccess();\n }\n }\n isAuthenticatedFully() {\n return !this.authenticationService.isSecurityEnabled() || this.authenticationService.isAuthenticated() || this.authorizationService.hasFreeAccess();\n }\n shouldShowMenu(role) {\n return this.isAuthenticatedFully() && this.authorizationService.hasRole(role);\n }\n // ========================\n // Navbar logic\n // ========================\n assignNavbarRef() {\n return (navbar) => {\n this.navbarRef = navbar;\n if (!this.navbarRef) {\n return;\n }\n this.navbarRef.menuItems = WindowService.getPluginRegistry().get(MainMenuExtensionPoint.NAME);\n this.setNavbarItemVisibility();\n };\n }\n setNavbarItemVisibility() {\n var _a, _b, _c;\n if (!((_a = this.navbarRef) === null || _a === void 0 ? void 0 : _a.menuItems)) {\n return;\n }\n // recursively check for children and set their shouldShow property\n const processItem = (item) => {\n var _a;\n item.shouldShow = this.shouldShowMenu(item.role);\n if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {\n item.children.forEach(processItem);\n }\n };\n (_c = (_b = this.navbarRef) === null || _b === void 0 ? void 0 : _b.menuItems) === null || _c === void 0 ? void 0 : _c.forEach(plugin => {\n plugin.items.forEach(processItem);\n });\n // Update the reference to trigger a re-render\n this.navbarRef.menuItems = [...this.navbarRef.menuItems];\n }\n subscribeToNavigationEnd() {\n this.subscriptions.add(this.eventService.subscribe(EventName.NAVIGATION_END, (navigationEndPayload) => {\n this.navigationContextService.updatePreviousRoute(navigationEndPayload.oldUrl);\n this.loading = false;\n }));\n }\n subscribeToApplicationChange() {\n this.subscriptions.add(this.applicationLifecycleContextService.onNavigationBeforeMountRouting((payload) => {\n if (payload) {\n this.loading = true;\n }\n }));\n }\n get hostElement() { return getElement(this); }\n};\nOntoLayout.style = ontoLayoutCss;\n\nexport { OntoLayout as onto_layout };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n if (!key) {\n return;\n }\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["debounce","func","wait","timer","args","clearTimeout","setTimeout","apply","this","OntoLayout","constructor","hostRef","registerInstance","authenticationService","service","AuthenticationService","authorizationService","AuthorizationService","navigationContextService","NavigationContextService","authStorageService","AuthenticationStorageService","runtimeConfigurationContextService","RuntimeConfigurationContextService","eventService","EventService","applicationLifecycleContextService","ApplicationLifecycleContextService","fullJwtKey","StorageKey","GLOBAL_NAMESPACE","NAMESPACE","jwtKey","fullAuthenticatedKey","authenticatedKey","authEvents","isLowResolution","showHeader","isAuthenticatedFully","showNavbar","isEmbedded","loading","subscriptions","SubscriptionList","isNavbarCollapsed","handleStorageChange","event","LocalStorageSubscriptionHandlerService","handleAuthChange","key","windowResizeObserver","windowResizeHandler","WindowService","getWindow","addEventListener","componentDidLoad","connectedCallback","subscribeToSecurityChanges","updateVisibility","subscribeToNavigationEnd","subscribeToRuntimeConfigurationChanges","subscribeToApplicationChange","disconnectedCallback","unsubscribeAll","render","h","Host","class","name","ref","assignNavbarRef","size","messageText","TranslationService","translate","onNavbarToggled","detail","payload","hostElement","classList","add","remove","onResize","_a","_b","_c","_d","innerWidth","navbar","document","querySelector","cookieBanner","header","headerHeight","getBoundingClientRect","height","bannerHeight","style","changedKey","includes","isAuthenticated","navigate","getPreviousRoute","location","reload","securityContextService","SecurityContextService","onAuthenticatedUserChanged","authenticatedUser","onSecurityConfigChanged","securityConfig","subscribe","EventName","LOGIN","setNavbarItemVisibility","LOGOUT","onRuntimeConfigurationChanged","config","isSecurityEnabled","hasFreeAccess","shouldShowMenu","role","hasRole","navbarRef","menuItems","getPluginRegistry","get","MainMenuExtensionPoint","NAME","processItem","item","shouldShow","children","length","forEach","plugin","items","NAVIGATION_END","navigationEndPayload","updatePreviousRoute","oldUrl","onNavigationBeforeMountRouting","getElement","LoggerProvider","logger","Loggers","getLoggerInstance","sanitizeHTML","html","element","createElement","innerHTML","value","TranslationServiceClassDefinition","languageContextService","ServiceProvider","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","onTranslate","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"sourceRoot":""}
@@ -1 +0,0 @@
1
- import{r as t,h as i,a as e,d as a}from"./p-BntG-4Sv.js";import{d as s}from"./p-D1ZpXQQS.js";import{service as o,AuthenticationService as h,AuthorizationService as n,NavigationContextService as d,AuthenticationStorageService as r,RuntimeConfigurationContextService as l,EventService as c,ApplicationLifecycleContextService as b,StorageKey as f,SubscriptionList as u,LocalStorageSubscriptionHandlerService as p,WindowService as m,navigate as v,SecurityContextService as y,EventName as g,MainMenuExtensionPoint as w}from"@ontotext/workbench-api";import{T as k}from"./p-FB05Sh97.js";const x=class{constructor(e){t(this,e),this.authenticationService=o(h),this.authorizationService=o(n),this.navigationContextService=o(d),this.authStorageService=o(r),this.runtimeConfigurationContextService=o(l),this.eventService=o(c),this.applicationLifecycleContextService=o(b),this.fullJwtKey=`${f.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.jwtKey}`,this.fullAuthenticatedKey=`${f.GLOBAL_NAMESPACE}.${this.authStorageService.NAMESPACE}.${this.authStorageService.authenticatedKey}`,this.authEvents=[this.fullJwtKey,this.fullAuthenticatedKey],this.isLowResolution=!1,this.showHeader=this.isAuthenticatedFully(),this.showNavbar=!1,this.isEmbedded=!1,this.loading=!0,this.subscriptions=new u,this.isNavbarCollapsed=!1,this.handleStorageChange=e=>{o(p).handleStorageChange(e),this.handleAuthChange(e.key)},this.windowResizeObserver=s(()=>this.windowResizeHandler(),50),m.getWindow().addEventListener("storage",this.handleStorageChange)}componentDidLoad(){this.windowResizeHandler()}connectedCallback(){this.subscribeToSecurityChanges(),this.updateVisibility(),this.subscribeToNavigationEnd(),this.subscribeToRuntimeConfigurationChanges(),this.subscribeToApplicationChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}render(){return i(e,{key:"e804e5e5580a95b69639645bfab907601c058c61",class:{"wb-layout":!0,"is-embedded":this.isEmbedded,"hide-navbar":!this.showNavbar}},i("div",{key:"3c9a99e6e75c49abc8857ca3a4cd1cab647ecf34",class:"default-slot-wrapper"},i("slot",{key:"e17a4cf9e5d9f4964ea4e298ff2f35c10acab3ef",name:"default"})),!this.isEmbedded&&i("header",{key:"969dec650ec39d56bc570f37bcb8e324b94bded5",class:"wb-header"},this.showHeader&&i("onto-header",{key:"431a2437aa740076630e14f3f3548efc9cd3ddb9"})),!this.isEmbedded&&this.showNavbar&&i("nav",{key:"8c901178a258aeb6f06f189fb49124d7b7601d03",class:"wb-navbar"},i("onto-navbar",{key:"ffd590a345d930bb64140426890a7a5f0f52f387",ref:this.assignNavbarRef(),"navbar-collapsed":this.isLowResolution})),i("div",{key:"25b14fd7973ca79d667d0877146bc053d8788263",class:{"main-slot-wrapper":!0,loading:this.loading}},this.loading&&i("div",{key:"bf6cb9e06407ca99fb3ee7cbe096ab0964cf766e",class:"loader-wrapper"},i("onto-loader",{key:"e441c8d8a0a22aaab0028bc081b5df00ffb9d7b0",size:96,messageText:k.translate("common.loading")})),i("slot",{key:"6738aeda481d1c26d1777284123ec1e794d81726",name:"main"})),!this.isEmbedded&&i("footer",{key:"1af8f2c5be2af29fa602774e4caeac6ef0354b79",class:"wb-footer"},i("onto-footer",{key:"e93aac557e306d05e6b8e143f6baaee877ab1c33"})),i("onto-tooltip",{key:"80e5775e95c10abca123c4c910e3d810ef53c230"}),i("onto-confirm-cancel-dialog",{key:"e534a95889e7cc7230d973bad6d69acb2945369e"}))}onNavbarToggled(e){this.isNavbarCollapsed=e.detail.payload,this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}onResize(){this.windowResizeObserver()}windowResizeHandler(){var e,i,t,a;this.isLowResolution=m.getWindow().innerWidth<=768;const s=document.querySelector(".navbar-component");if(s){const o=document.querySelector(".cookie-consent-banner"),n=document.querySelector(".header-component"),r=null!==(i=null===(e=null==n?void 0:n.getBoundingClientRect())||void 0===e?void 0:e.height)&&void 0!==i?i:0,d=null!==(a=null===(t=null==o?void 0:o.getBoundingClientRect())||void 0===t?void 0:t.height)&&void 0!==a?a:0;s.style.height=`calc(100% - ${r}px - ${d}px)`}this.isLowResolution||this.isNavbarCollapsed?this.hostElement.classList.add("expanded"):this.hostElement.classList.remove("expanded")}handleAuthChange(e){var i;if(e&&this.authEvents.includes(e)){const e=this.authStorageService.isAuthenticated();v(e?null!==(i=this.navigationContextService.getPreviousRoute())&&void 0!==i?i:"./":"login"),m.getWindow().location.reload()}}subscribeToSecurityChanges(){const e=o(y);this.subscriptions.add(e.onAuthenticatedUserChanged(e=>{this.authenticatedUser=e,this.updateVisibility()})),this.subscriptions.add(e.onSecurityConfigChanged(e=>{this.securityConfig=e,this.updateVisibility()})),this.subscriptions.add(this.eventService.subscribe(g.LOGIN,()=>{this.setNavbarItemVisibility(),this.updateVisibility()})),this.subscriptions.add(this.eventService.subscribe(g.LOGOUT,()=>{this.setNavbarItemVisibility(),this.updateVisibility(),v("login")}))}subscribeToRuntimeConfigurationChanges(){this.subscriptions.add(this.runtimeConfigurationContextService.onRuntimeConfigurationChanged(e=>{var i;this.isEmbedded=null!==(i=null==e?void 0:e.isEmbedded)&&void 0!==i&&i}))}updateVisibility(){this.authenticationService.isSecurityEnabled()?(this.showHeader=this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess(),this.showNavbar=this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess()):(this.showNavbar=!0,this.showHeader=!0)}isAuthenticatedFully(){return!this.authenticationService.isSecurityEnabled()||this.authenticationService.isAuthenticated()||this.authorizationService.hasFreeAccess()}shouldShowMenu(e){return this.isAuthenticatedFully()&&this.authorizationService.hasRole(e)}assignNavbarRef(){return e=>{this.navbarRef=e,this.navbarRef&&(this.navbarRef.menuItems=m.getPluginRegistry().get(w.NAME),this.setNavbarItemVisibility())}}setNavbarItemVisibility(){var e,i,t;if(!(null===(e=this.navbarRef)||void 0===e?void 0:e.menuItems))return;const a=e=>{var i;e.shouldShow=this.shouldShowMenu(e.role),(null===(i=e.children)||void 0===i?void 0:i.length)&&e.children.forEach(a)};null===(t=null===(i=this.navbarRef)||void 0===i?void 0:i.menuItems)||void 0===t||t.forEach(e=>{e.items.forEach(a)}),this.navbarRef.menuItems=[...this.navbarRef.menuItems]}subscribeToNavigationEnd(){this.subscriptions.add(this.eventService.subscribe(g.NAVIGATION_END,e=>{this.navigationContextService.updatePreviousRoute(e.oldUrl),this.loading=!1}))}subscribeToApplicationChange(){this.subscriptions.add(this.applicationLifecycleContextService.onNavigationBeforeMountRouting(e=>{e&&(this.loading=!0)}))}get hostElement(){return a(this)}};x.style=':host{display:block;height:100%}.wb-layout{display:grid;grid-template:"header header" auto "nav main" 1fr "nav footer" auto/15rem minmax(200px, 1fr);min-height:100vh;margin:0;}.wb-layout.expanded{grid-template-columns:4.375rem 1fr}.wb-layout.is-embedded{grid-template-columns:1fr;grid-template-areas:"main";padding-top:1rem}.wb-layout.hide-navbar{grid-template:"header" auto "main" 1fr "footer" auto/1fr;}.wb-layout.hide-navbar.expanded{grid-template-columns:1fr}.wb-layout main .main-container{margin-left:0}.wb-layout .main-slot-wrapper .loader-wrapper{flex-grow:1;display:flex;align-items:center;justify-content:center}.wb-layout .main-slot-wrapper.loading{display:flex;flex-direction:column}.wb-layout .main-slot-wrapper.loading .page-content{visibility:hidden}.wb-layout .default-slot-wrapper{display:none}.wb-layout .wb-header{position:sticky;top:0;z-index:999}.wb-layout nav{grid-area:nav}.wb-layout header{grid-area:header}.wb-layout main{grid-area:main}.wb-layout footer{grid-area:footer}';export{x as onto_layout};