import Component from '../../component.js'
import CoEuiAppSidebar from './eui-app-sidebar.js'
import CoEuiAppHeader from './eui-app-header.js'
import CoEuiAppToolbar from './eui-app-toolbar.js'
import CoEuiToolbar from './eui-toolbar.js'
import CoEuiAppFooter from './eui-app-footer.js'
import CoEuiGrowl from './eui-growl.js'
import CoEuiBlockDocument from './eui-block-document.js'
import CoEuiDimmer from './eui-dimmer.js'
import CoEuiBreadcrumbs from './eui-breadcrumbs.js'
import CoEuiAppTopMessage from './eui-app-top-message.js'

export default class CoEuiApp extends Component {
    constructor(parent) {
      let selector = 'eui-app';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components-next/src/lib/layout/eui-app/eui-app.component.html?at=support/10.x
    }
    get euiAppSidebarCO() {
      return new CoEuiAppSidebar(this.currentPath);
    }
    get main() {
      let path = '//div[contains(@class,"eui-app-main")]';
      return this.currentPath + path;
    }
    get euiTopMessageCO(){
      return new CoEuiAppTopMessage(this.main);
    }
    get euiAppHeaderCO() {
      return new CoEuiAppHeader(this.main);
    }
    get euiAppToolbarCO() {
      return new CoEuiAppToolbar(this.main);
    }
    async isMobileToolbar() {
      return await (await $(this.euiToolbarCO.currentPath)).isExisting();
    }
    get euiToolbarCO() {
      return new CoEuiToolbar(this.euiAppToolbarCO.currentPath);
    }
    get breadcrumbsCO(){
      return new CoEuiBreadcrumbs(this.main);
    }
    get content() {
      let path = '//div[contains(@class,"eui-app-main-content")]';
      return this.main + path;
    }
    get euiAppPageWrapperPlaceholder() {
      return this.content + '//eui-app-page-wrapper';
    }
    async hasCustomPageWrapper() {
      return await (await $(this.euiAppPageWrapperPlaceholder)).isExisting();
    }
    get euiAppFooterCO() {
      return new CoEuiAppFooter(this.main);
    }
    get euiGrowlCO() {
      return new CoEuiGrowl(this.currentPath);
    }
    get euiBlockDocumentCO() {
      return new CoEuiBlockDocument(this.currentPath);
    }
    get euiDimmerCO() {
      return new CoEuiDimmer(this.currentPath);
    }
}


