var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Fragment, h } from '@stencil/core';
import { MapToComponentField, MapToComponentMethod, VegaSlimmer } from 'vega-slimmer/core';
import { VegaLeftNavSeparator } from '../../internal/vega-left-nav-separator';
import { Icons } from '../../assets/icons';
import { VegaInternalIconManager } from '../../../../../helpers/icon/internal-icon-manager';
export class VegaLeftNavHeaderRenderer extends VegaSlimmer {
  componentWillLoad() {
    this.hasHeaderSlot = !!this.host.querySelector('[slot="header-slot"]');
  }
  render() {
    return this.renderHeader();
  }
  renderHeader() {
    const { title, subtitle } = this.headerConfig;
    return (h(Fragment, null,
      h("div", { class: "header-container" },
        this.hasHeaderSlot ? (h("slot", { name: "header-slot" })) : title ? (h("div", { class: "header-title" }, title)) : (this.renderHeaderLogo()),
        subtitle && h("div", { class: "header-subtitle" }, subtitle)),
      h(VegaLeftNavSeparator, null)));
  }
  renderHeaderLogo() {
    if (this.currentBranding === 'gp') {
      return h("vega-brand-logo", { name: "global-payments", size: "small" });
    }
    if (this.currentBranding === 'genius') {
      return h("vega-brand-logo", { name: "genius", size: "small" });
    }
    return h("vega-icon", { icon: VegaInternalIconManager.getIconKey('heartland-logo') });
  }
}
(() => {
  VegaInternalIconManager.register(Icons);
})();
__decorate([
  MapToComponentField()
], VegaLeftNavHeaderRenderer.prototype, "host", void 0);
__decorate([
  MapToComponentField()
], VegaLeftNavHeaderRenderer.prototype, "headerConfig", void 0);
__decorate([
  MapToComponentField()
], VegaLeftNavHeaderRenderer.prototype, "currentBranding", void 0);
__decorate([
  MapToComponentMethod('componentWillLoad')
], VegaLeftNavHeaderRenderer.prototype, "componentWillLoad", null);
