import Component  from '../component.js'

export default class CoEuiNotificationItem extends Component {
  constructor(parent) {
    let selector = 'eui-notification-item';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-notifications/eui-notification-item.component.html?at=support%2F13.x
  }
  get content() {
    let path = '//div[contains(@class,"eui-notification-item-content")]';
    return this.currentPath + path;
  }
  get contentTop() {
    let path = '//div[contains(@class,"eui-notification-item-content-top")]';
    return this.content + path;
  }
  get contentTopDate() {
    let path = '//div[contains(@class,"eui-notification-item-content-top__date")]';
    return this.contentTop + path;
  }
  async hasDate() {
    return await (await $(this.contentTopDate)).isExisting();
  }
  get contentTopDateIcon() {
    let path = '//span[contains(@class,"eui-notification-item-content-top__date-icon")]';
    return this.contentTopDate + path;
  }
  get contentTopDateIconBell() {
    let path = '//span[contains(@class,"eui-icon eui-icon-bell")]';
    return this.contentTopDateIcon + path;
  }
  get contentTopDateIconDot() {
    let path = '//span[contains(@class,"eui-notification-item-content-top__date-dot")]';
    return this.contentTopDateIcon + path;
  }
  async hasNew() {
    return await (await $(this.contentTopDateIconDot)).isExisting();
  }
  get contentTopDateValue() {
    let path = '//span[contains(@class,"eui-u-color-grey-dark")]';
    return this.contentTopDate + path;
  }
  get contentTopImportant() {
    let path = '//div[contains(@class,"eui-u-font-bold")]';
    return this.contentTop + path;
  }
  get contentTopIconExclamation() {
    let path = '//span[contains(@class,"eui-icon-exclamation")]';
    return this.contentTopImportant + path;
  }
  async hasImportant() {
    return await (await $(this.contentTopIconExclamation)).isExisting();
  }
  get contentMiddle() {
    let path = '//span[contains(@class,"eui-notification-item-content-middle")]';
    return this.content + path;
  }
  get contentMiddleUrl() {
    return this.contentMiddle + '//a[@href][not(@target)]';
  }
  async hasUrl() {
    return await (await $(this.contentMiddleUrl)).isExisting();
  }
  get contentMiddleLabel() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__label")]';
    return this.contentMiddleUrl + path;
  }
  get contentMiddleSubLabel() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__sub-label")]';
    return this.contentMiddleUrl + path;
  }
  async hasSubLabel() {
    return await (await $(this.contentMiddleSubLabel)).isExisting();
  }
  get contentMiddleExternalUrl() {
    return this.contentMiddle + '//a[@target]';
  }
  async hasExternalUrl() {
    return await (await $(this.contentMiddleExternalUrl)).isExisting();
  }
  get contentMiddleExternalLabel() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__label")]';
    return this.contentMiddleExternalUrl + path;
  }
  get contentMiddleExternalSubLabel() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__sub-label")]';
    return this.contentMiddleExternalLabel + path;
  }
  async hasExternalSubLabel() {
    return await (await $(this.contentMiddleExternalSubLabel)).isExisting();
  }
  get contentMiddleLabelNoUrl() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__label")][not(ancestor::a)]';
    return this.contentMiddle + path;
  }
  get contentMiddleSubLabelNoUrl() {
    let path = '//div[contains(@class,"eui-notification-item-content-middle__sub-label")]';
    return this.contentMiddleLabelNoUrl + path;
  }
  async hasSubLabelNoUrl() {
    return await (await $(this.contentMiddleSubLabelNoUrl)).isExisting();
  }
  get contentBottom() {
    let path = '//div[contains(@class,"eui-notification-item-content-bottom")]';
    return this.content + path;
  }
  get contentBottomLink() {
    return this.contentBottom + '//a';
  }
  async isShowMarkAsRead() {
    return await (await $(this.contentBottomLink)).isExisting();
  }
}


