'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-58ea899e.js');
const component = require('./component-1e352960.js');
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-389d1548.js');
const darkModeStyleController = require('./dark-mode-style-controller-bd765afb.js');
const brandSwitchStateControllerSlimmer = require('./brand-switch-state-controller-slimmer-3d41b2a4.js');
require('./static-subject-title-5829a298.js');
require('./change-manager-a297e4d2.js');
require('./observer-f49483e8.js');
require('./tinycolor-polyfill-502efaa8.js');
require('./vega-nonce-manager-df69d3ed.js');
require('./try-get-document-c0ebd39a.js');
require('./index-592b4052.js');

const HEARTLAND_TOS_URL = 'https://www.heartland.us/terms';
const HEARTLAND_PRIVACY_URL = 'https://www.heartland.us/privacy-policy';
const HEARTLAND_GOOGLE_PRIVACY_POLICY_URL = 'https://policies.google.com/privacy';
const HEARTLAND_GOOGLE_TREMS_SERVICE_URL = 'https://policies.google.com/terms';
const HEARTLAND_CONTENT = `© ${new Date().getFullYear()} Heartland Payment Systems, LLC – a Global Payments company. All rights reserved.`;
const GLOBALPAYMENTS_TOS_URL = 'https://www.globalpayments.com/terms-of-use';
const GLOBALPAYMENTS_PRIVACY_URL = 'https://www.globalpayments.com/privacy-statement';
const GLOBALPAYMENTS_CONTENT = `© ${new Date().getFullYear()} Global Payments Inc. All rights reserved.`;

const vegaAppFooterCss = ":host{display:block;padding-left:0px;padding-right:0px}:host .h-separator{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:20px;margin-bottom:20px}:host .v-separator{display:inline-block;width:1px;margin-left:8px;margin-right:8px;background-color:rgba(70, 71, 101, 0.8)}:host>.vega-link{display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap}:host>.vega-link a{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host>.vega-link a{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host>.vega-link a{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host>.vega-link a{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-content{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-content{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-content{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-content{font-family:\"Inter\", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-disclaimer-content{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-disclaimer-content{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-disclaimer-content{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-disclaimer-content{font-family:\"Inter\", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}:host(.v-text-center){text-align:center}:host .vega-link a{color:rgba(var(--v-text-link, 19, 98, 226, 1));border-radius:4px;text-decoration:none}:host .vega-link a:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .vega-link a:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1));text-decoration:underline}:host .vega-link a:focus{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-link a:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1));text-decoration:underline}";

var __decorate = (undefined && undefined.__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;
};
const VegaAppFooter = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.globalSlimmers = {};
    this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.VegaComponentUsageRuntimeMetricsSlimmer();
    this.brandSwitchControllerSlimmer = new brandSwitchStateControllerSlimmer.BrandSwitchControllerSlimmer();
    this.googlePrivacyPolicyUrl = HEARTLAND_GOOGLE_PRIVACY_POLICY_URL;
    this.googleTermsOfServiceUrl = HEARTLAND_GOOGLE_TREMS_SERVICE_URL;
    this.currentBranding = darkModeStyleController.VegaInternalThemeManager.getBranding();
    /**
     * Specifies the content to be displayed in the app footer.
     *
     * By default, it includes Heartland's official copyright message
     *    with a reference to the current year.
     *
     * @vegaVersion 1.15.0
     * @defaultValue © {{currentYear}} Global Payments Inc. All rights reserved.
     */
    this.content = this.getDefaultContent();
    /**
     * Specifies the label or text to be displayed
     *    for the Terms of Use link in the app footer.
     *
     * @vegaVersion 1.15.0
     */
    this.termOfUseLabel = 'Terms of Use';
    /**
     * Specifies the URL or web address that the Terms of Use link
     *    in the app footer should navigate to when clicked.
     *
     * @vegaVersion 1.15.0
     * @defaultValue https://www.globalpayments.com/terms-of-use
     */
    this.termOfUseUrl = this.getDefaultTermsOfUseUrl();
    /**
     * Specifies the target window or browsing context in which
     *    the Terms of Use URL should be opened
     *    when the user clicks on the link.
     *
     * @vegaVersion 1.27.3
     */
    this.termOfUseUrlTarget = '_self';
    /**
     * Specifies the label or text to be displayed
     *    for the Privacy Policy link in the app footer.
     *
     * @vegaVersion 1.15.0
     */
    this.privacyPolicyLabel = 'Privacy Policy';
    /**
     * Specifies the URL or web address that the
     *    Privacy Policy link in the app footer should
     *    navigate to when clicked.
     *
     * @vegaVersion 1.15.0
     * @defaultValue https://www.globalpayments.com/privacy-statement
     */
    this.privacyPolicyUrl = this.getDefaultPrivacyPolicyUrl();
    /**
     * Specifies the target window or browsing context
     *    in which the Privacy Policy URL should be opened
     *    when the user clicks on the link.
     *
     * @vegaVersion 1.27.3
     */
    this.privacyPolicyUrlTarget = '_self';
    /**
     * Specifies whether to hide the default Term of Use
     *    and Privacy Policy links.
     *
     * @vegaVersion 1.35.1
     */
    this.hideDefaultLinks = false;
    /**
     * Specifies additional links that can be included
     *    in the app footer.
     *
     * @vegaVersion 1.15.0
     */
    this.additionalLinks = [];
    /**
     * Specifies whether the app footer should display
     *    a predetermined disclaimer message and link
     *    to indicate that the site uses Google reCAPTCHA.
     *
     * @vegaVersion 1.3.0
     */
    this.showDisclaimer = false;
    /**
     * Specifies the target window or tab when the user clicks
     *    on the Disclaimer link in the app footer.
     *
     * @vegaVersion 1.27.3
     */
    this.disclaimerUrlTarget = '_self';
  }
  render() {
    return component.sanitizeVegaComponent(index.h(index.Host, { class: "v-text-center" }, this.renderContent(), this.renderLinks(), this.renderDisclaimer()), this.host);
  }
  getDefaultContent() {
    return darkModeStyleController.VegaInternalThemeManager.getBranding() === 'heartland'
      ? HEARTLAND_CONTENT
      : GLOBALPAYMENTS_CONTENT;
  }
  getDefaultTermsOfUseUrl() {
    return darkModeStyleController.VegaInternalThemeManager.getBranding() === 'heartland'
      ? HEARTLAND_TOS_URL
      : GLOBALPAYMENTS_TOS_URL;
  }
  getDefaultPrivacyPolicyUrl() {
    return darkModeStyleController.VegaInternalThemeManager.getBranding() === 'heartland'
      ? HEARTLAND_PRIVACY_URL
      : GLOBALPAYMENTS_PRIVACY_URL;
  }
  renderContent() {
    return (index.h("div", { class: "vega-app-footer-content" }, this.content !== GLOBALPAYMENTS_CONTENT && this.content !== HEARTLAND_CONTENT
      ? this.content
      : this.getDefaultContent()));
  }
  renderLinks() {
    return (index.h("div", { class: "vega-link" }, !this.hideDefaultLinks ? this.renderDefaultLinks() : null, this.additionalLinks.length ? this.renderAdditionalLinks() : null));
  }
  renderDefaultLinks() {
    return (index.h(index.Fragment, null, index.h("a", { id: this.termOfUseUrlId, target: this.termOfUseUrlTarget, href: this.getTermsOfUseUrl() }, this.termOfUseLabel), index.h("span", { class: "v-separator" }), index.h("a", { id: this.privacyPolicyUrlId, target: this.privacyPolicyUrlTarget, href: this.getPrivacyPolicyUrl() }, this.privacyPolicyLabel)));
  }
  getTermsOfUseUrl() {
    return this.termOfUseUrl !== HEARTLAND_TOS_URL && this.termOfUseUrl !== GLOBALPAYMENTS_TOS_URL
      ? this.termOfUseUrl
      : this.getDefaultTermsOfUseUrl();
  }
  getPrivacyPolicyUrl() {
    return this.privacyPolicyUrl !== HEARTLAND_PRIVACY_URL &&
      this.privacyPolicyUrl !== GLOBALPAYMENTS_PRIVACY_URL
      ? this.privacyPolicyUrl
      : this.getDefaultPrivacyPolicyUrl();
  }
  renderAdditionalLinks() {
    return (index.h(index.Fragment, null, !this.hideDefaultLinks ? index.h("span", { class: "v-separator" }) : null, this.additionalLinks.map((link, index$1) => {
      return (link.URL &&
        link.label && (index.h(index.Fragment, null, index.h("a", { id: link.id, target: link.target, href: link.URL }, link.label), this.additionalLinks.length === index$1 + 1 ? null : (index.h("span", { class: "v-separator" })))));
    })));
  }
  renderDisclaimer() {
    return (this.showDisclaimer && (index.h("div", { class: "vega-app-footer-disclaimer" }, index.h("div", { class: "h-separator" }), index.h("div", { class: "vega-app-footer-disclaimer-content vega-link" }, "This site is protected by reCAPTCHA and the", ' ', index.h("a", { target: this.disclaimerUrlTarget, href: this.googlePrivacyPolicyUrl }, ' ', "Google Privacy Policy", ' '), ' ', "and", ' ', index.h("a", { target: this.disclaimerUrlTarget, href: this.googleTermsOfServiceUrl }, ' ', "Google Terms of Service", ' '), "apply."))));
  }
  get host() { return index.getElement(this); }
};
__decorate([
  componentUsageRuntimeMetrics.InjectVegaGlobalSlimmer()
], VegaAppFooter.prototype, "globalSlimmers", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaAppFooter.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaAppFooter.prototype, "brandSwitchControllerSlimmer", void 0);
VegaAppFooter.style = vegaAppFooterCss;

exports.vega_app_footer = VegaAppFooter;
