/*! leaders 2017-02-24 */ ! function a(b, c, d) {
  function e(g, h) {
    if (!c[g]) {
      if (!b[g]) {
        var i = "function" == typeof require && require;
        if (!h && i) return i(g, !0);
        if (f) return f(g, !0);
        var j = new Error("Cannot find module '" + g + "'");
        throw j.code = "MODULE_NOT_FOUND", j
      }
      var k = c[g] = {
        exports: {}
      };
      b[g][0].call(k.exports, function(a) {
        var c = b[g][1][a];
        return e(c ? c : a)
      }, k, k.exports, a, b, c, d)
    }
    return c[g].exports
  }
  for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]);
  return e
}({
  1: [function(a, b, c) {
    "use strict";
    var d = a("./modules/Header"),
      e = a("./modules/ScrollNav");
    ! function() {
      var a = document.getElementsByClassName("navbar")[0].parentNode;
      new d("menu"), new d("search"), new e(a, 150)
    }()
  }, {
    "./modules/Header": 3,
    "./modules/ScrollNav": 6
  }],
  2: [function(a, b, c) {
    "use strict";
    var d = a("./modules/ParallaxImage");
    ! function() {
      new d
    }()
  }, {
    "./modules/ParallaxImage": 5
  }],
  3: [function(a, b, c) {
    "use strict";

    function d(a, b) {
      if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function")
    }
    Object.defineProperty(c, "__esModule", {
      value: !0
    });
    var e = function() {
        function a(a, b) {
          for (var c = 0; c < b.length; c++) {
            var d = b[c];
            d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d)
          }
        }
        return function(b, c, d) {
          return c && a(b.prototype, c), d && a(b, d), b
        }
      }(),
      f = a("./Helper"),
      g = function() {
        function a(b) {
          d(this, a), this.section = b, this.sectionBtn = document.getElementsByClassName(b + "-button")[0], this.sectionWin = document.getElementsByClassName(b + "-window")[0], this.headerElem = document.getElementsByTagName("header")[0], this.navbtns = document.getElementsByClassName("nav-button"), this.navwins = document.getElementsByClassName("nav-window"), this.sectionBtn.addEventListener("click", this.toggleNavOption.bind(this), !1);
          var c, e = this.headerElem.querySelectorAll("input[type=checkbox]:checked"),
            f = 0;
          for (c = e.length; c > f; f++) e[f].checked = !1
        }
        return e(a, [{
          key: "toggleNavOption",
          value: function() {
            var a = document.getElementsByTagName("body")[0],
              b = document.getElementsByTagName("html")[0],
              c = 0,
              d = this.sectionBtn.className,
              e = -1 === d.indexOf("close-button");
            for (c = 0; c < this.navbtns.length; c++) f.removeClass(this.navbtns[c], "close-button"), f.removeClass(this.navwins[c], "open-window"), this.navbtns[c].setAttribute("aria-expanded", "false"), f.removeClass(b, "menu-open"), f.removeClass(a, "menu-open");
            e && (f.addClass(this.sectionBtn, "close-button"), f.addClass(this.sectionWin, "open-window"), this.sectionBtn.setAttribute("aria-expanded", "true"), "search" === this.section ? document.getElementById("usagov-search-query").focus() : (f.addClass(b, "menu-open"), f.addClass(a, "menu-open")))
          }
        }]), a
      }();
    c["default"] = g, b.exports = c["default"]
  }, {
    "./Helper": 4
  }],
  4: [function(a, b, c) {
    "use strict";

    function d(a, b) {
      if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function")
    }
    Object.defineProperty(c, "__esModule", {
      value: !0
    });
    var e = function() {
        function a(a, b) {
          for (var c = 0; c < b.length; c++) {
            var d = b[c];
            d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d)
          }
        }
        return function(b, c, d) {
          return c && a(b.prototype, c), d && a(b, d), b
        }
      }(),
      f = function() {
        function a() {
          d(this, a)
        }
        return e(a, null, [{
          key: "hasClass",
          value: function(a, b) {
            return a.classList ? a.classList.contains(b) : !!a.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
          }
        }, {
          key: "addClass",
          value: function(a, b) {
            a.classList ? a.classList.add(b) : this.hasClass(a, b) || (a.className += " " + b)
          }
        }, {
          key: "removeClass",
          value: function(a, b) {
            if (a.classList) a.classList.remove(b);
            else if (this.hasClass(a, b)) {
              var c = new RegExp("(\\s|^)" + b + "(\\s|$)");
              a.className = a.className.replace(c, " ")
            }
          }
        }, {
          key: "toggleClass",
          value: function(a, b) {
            this.hasClass(a, b) ? this.removeClass(a, b) : this.addClass(a, b)
          }
        }]), a
      }();
    c["default"] = f, b.exports = c["default"]
  }, {}],
  5: [function(a, b, c) {
    "use strict";

    function d(a, b) {
      if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function")
    }
    Object.defineProperty(c, "__esModule", {
      value: !0
    });
    var e = function() {
        function a(a, b) {
          for (var c = 0; c < b.length; c++) {
            var d = b[c];
            d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d)
          }
        }
        return function(b, c, d) {
          return c && a(b.prototype, c), d && a(b, d), b
        }
      }(),
      f = a("./Helper"),
      g = function() {
        function a(b, c) {
          d(this, a);
          var e, g = this;
          this.imgCont = b, e = b.getElementsByClassName("full-width-image"), this.img = e.length ? e[0].getElementsByTagName("img") : [], this.topVal = 0, this.longPage = !1, this.isBanner = f.hasClass(b, "page-banner"), this.toTop = f.hasClass(b, "image-to-top"), this.centered = 0, this.img.length && (this.img = this.img[0], this.scrollPos = -1, this.topMargin = c ? c : 0, window.addEventListener("scroll", function() {
            g.runOnScroll()
          }), window.addEventListener("resize", function() {
            g.runOnResize()
          }), this.img.addEventListener("load", function() {
            g.runOnResize()
          }), this.runOnResize())
        }
        return e(a, [{
          key: "runOnResize",
          value: function() {
            var a, b, c, d = document.documentElement;
            this.imgH = this.img.clientHeight, this.contH = this.imgCont.clientHeight, this.centered = Math.round(this.imgH - this.contH) / -2, this.winW = Math.max(d.clientWidth, window.innerWidth || 0), this.winH = Math.max(d.clientHeight, window.innerHeight || 0), (this.toTop || !this.isBanner || this.centered >= 0) && (this.centered = 0), this.winW > 769 && this.contH > 0 ? (a = this.winH - this.contH, b = Math.round((this.topMargin - a) / 2), c = this.contH - this.imgH, this.longPage = c > b, this.runOnScroll()) : this.topVal !== this.centered && this.contH > 0 && (this.img.style.top = this.centered + "px", this.topVal = this.centered)
          }
        }, {
          key: "runOnScroll",
          value: function() {
            var a, b, c, d = this.imgCont.getBoundingClientRect(),
              e = this.topMargin - d.top,
              f = Math.round(e / 2),
              g = this.winH - d.top;
            this.contH - this.imgH;
            this.winW > 769 && g > 0 && e <= this.contH ? (this.longPage && !this.isBanner ? (c = 100 * (d.top - this.topMargin), c /= this.winH - this.contH - this.topMargin, f = c * (this.contH - this.imgH) / 100) : this.isBanner && (a = window.pageYOffset || document.documentElement.scrollTop, b = this.topMargin - (a + d.top), f -= Math.round(b / 2)), f += this.centered, f = f < this.centered && this.isBanner ? this.centered : f, this.img.style.top = f + "px", this.topVal = f) : this.topVal !== this.centered && (this.img.style.top = this.centered + "px", this.topVal = this.centered)
          }
        }, {
          key: "updateParallax",
          value: function() {
            this.runOnResize()
          }
        }]), a
      }(),
      h = function() {
        function a(b) {
          d(this, a);
          var c, e = document.getElementsByClassName("parallax-image");
          for (this.parallaxes = [], c = 0; c < e.length; c++) this.parallaxes.push(new g(e[c], b))
        }
        return e(a, [{
          key: "runUpdate",
          value: function() {
            var a;
            for (a = 0; a < this.parallaxes.length; a++) this.parallaxes[a].updateParallax()
          }
        }]), a
      }();
    c["default"] = h, b.exports = c["default"]
  }, {
    "./Helper": 4
  }],
  6: [function(a, b, c) {
    "use strict";

    function d(a, b) {
      if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function")
    }
    Object.defineProperty(c, "__esModule", {
      value: !0
    });
    var e = function() {
        function a(a, b) {
          for (var c = 0; c < b.length; c++) {
            var d = b[c];
            d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(a, d.key, d)
          }
        }
        return function(b, c, d) {
          return c && a(b.prototype, c), d && a(b, d), b
        }
      }(),
      f = a("./Helper"),
      g = function() {
        function a(b, c) {
          d(this, a), this.navElem = b, this.scrollPos = void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop, this.minTop = c ? c : 0, this.minScroll = 25, window.addEventListener("scroll", this.runOnScroll.bind(this)), this.runOnScroll(this)
        }
        return e(a, [{
          key: "runOnScroll",
          value: function(a) {
            var b = void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop,
              c = document.getElementsByClassName("open-window");
            c.length || (this.scrollPos + this.minScroll <= b && b > this.minTop ? (f.addClass(this.navElem, "scrolled-down"), this.scrollPos = b) : this.scrollPos - this.minScroll >= b && (f.removeClass(this.navElem, "scrolled-down"), this.scrollPos = b))
          }
        }]), a
      }();
    c["default"] = g, b.exports = c["default"]
  }, {
    "./Helper": 4
  }]
}, {}, [1, 2]), require = function b(a, c, d) {
  function e(g, h) {
    if (!c[g]) {
      if (!a[g]) {
        var i = "function" == typeof require && require;
        if (!h && i) return i(g, !0);
        if (f) return f(g, !0);
        var j = new Error("Cannot find module '" + g + "'");
        throw j.code = "MODULE_NOT_FOUND", j
      }
      var k = c[g] = {
        exports: {}
      };
      a[g][0].call(k.exports, function(b) {
        var c = a[g][1][b];
        return e(c ? c : b)
      }, k, k.exports, b, a, c, d)
    }
    return c[g].exports
  }
  for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]);
  return e
}({
  1: [function(a, b, c) {
    "use strict";
    var d = a("AjaxRequest");
    ! function() {
      var a, b = document.getElementsByTagName("body")[0],
        c = b.className,
        e = new d;
      a = Configs.API_DOMAIN + "/api/v1/leader/" + c + "/interests", e.get(a, function(a) {
        var b, c, d = '<ul class="link-column">',
          e = 0,
          f = document.getElementsByClassName("interests")[0],
          g = f.getElementsByClassName("links-list")[0];
        for (b = a.length; b > e; e++) b > 10 && (c = Math.ceil(b / 2)), e === c && "" !== c && (d += '</ul><ul class="link-column">'), d += '<li><a href="' + a[e].link_url + '" title="' + a[e].link_title + '">' + a[e].link_title + "</a></li>";
        g.innerHTML = d + "</ul>"
      })
    }()
  }, {
    AjaxRequest: "AjaxRequest"
  }],
  2: [function(a, b, c) {
    "use strict";
    var d = window.Configs || {};
    d.API_DOMAIN = "https://api.army.mil", window.Configs = d
  }, {}],
  AjaxRequest: [function(a, b, c) {
    "use strict";
    ! function() {
      function a() {}
      a.prototype.get = function(a, b) {
        var c = new XMLHttpRequest;
        return c ? (c.onreadystatechange = function() {
          c.readyState === XMLHttpRequest.DONE && (200 === c.status ? b(JSON.parse(c.responseText)) : window.console.log("there was an error retrieving the requested information"))
        }, c.open("GET", a, !0), void c.send(null)) : !1
      }, b.exports = a
    }()
  }, {}]
}, {}, [2, 1]);
