import Component from '../../component.js'
import CoEuiHeaderAppName from './eui-header-app-name.js'
import CoEuiHeaderAppSubtitle from './eui-header-app-subtitle.js'

export default class CoEuiHeaderApp extends Component {
    constructor(parent) {
      let selector = 'eui-header-app';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components-next/src/lib/layout/eui-header/header-app/header-app.component.html
    }
    get titleFull() {
      let path = '//div[contains(@class,"eui-header-app__title") and contains(@class,"full")]';
      return this.currentPath + path;
    }
    get euiHeaderAppNameCO() {
      return new CoEuiHeaderAppName(this.titleFull);
    }
    async hasCustomAppName() {
      return await (await $(this.euiHeaderAppNameCO.currentPath)).isExisting();
    }
    async hasAppNameFromState() {
      return !(await (await $(await this.hasCustomAppName())).isExisting());
    }
    get titleShort() {
      let path = '//div[contains(@class,"eui-header-app__title short")]';
      return this.currentPath + path;
    }
    get subtitle() {
      let path = '//div[contains(@class,"eui-header-app__sub-title")]';
      return this.currentPath + path;
    }
    async hasCustomAppSubtitle() {
      return await (await $(this.euiHeaderAppSubtitleCO.currentPath)).isExisting();
    }
    get euiHeaderAppSubtitleCO() {
      return new CoEuiHeaderAppSubtitle(this.subtitle);
    }
}


