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 CoEuiAppTopMessage from './eui-app-top-message.js'
import CoEuiAppBreadcrumb from './eui-app-breadcrumb.js'
import DivComponent from '../div.js'
import CoEuiAppSidebarMenu from './eui-app-sidebar-menu.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/layout/eui-app/eui-app.component.html
  }
  get euiDimmerCO() {
    return new CoEuiDimmer(this.currentPath);
  }
  get euiAppSidebarCO() {
    return new CoEuiAppSidebar(this.currentPath);
  }
  get euiAppSidebarMenuCO() {
    return new CoEuiAppSidebarMenu(this.euiAppSidebarCO.euiAppSidebarBodyCO);
  }
  get mainCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-app-main');
  }
  get euiAppTopMessageCO() {
    return new CoEuiAppTopMessage(this.mainCO);
  }
  get euiAppHeaderCO() {
    return new CoEuiAppHeader(this.mainCO);
  }
  get euiAppToolbarCO() {
    return new CoEuiAppToolbar(this.mainCO);
  }
  async isMobileToolbar() {
    return await (await this.euiToolbarCO.element()).isExisting();
  }
  get euiToolbarCO() {
    return new CoEuiToolbar(this.euiAppToolbarCO);
  }
  get euiAppBreadcrumbCO() {
    return new CoEuiAppBreadcrumb(this.mainCO);
  }
  get contentCO() {
    return new DivComponent(this.mainCO).addPredicateClassContains('eui-app-main-content');
  }
  get euiAppPageWrapperPlaceholder() {
    return this.contentCO.currentPath + '//eui-app-page-wrapper';
  }
  async hasCustomPageWrapper() {
    return await (await $(this.euiAppPageWrapperPlaceholder)).isExisting();
  }
  get euiAppFooterCO() {
    return new CoEuiAppFooter(this.mainCO);
  }
  get euiGrowlCO() {
    return new CoEuiGrowl(this.currentPath);
  }
  get euiBlockDocumentCO() {
    return new CoEuiBlockDocument(this.currentPath);
  }

}


