{"version":3,"file":"foundation.drilldown.min.js","sources":["foundation.drilldown.min.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"./foundation.core\"), require(\"./foundation.util.box\"), require(\"./foundation.util.keyboard\"), require(\"./foundation.util.nest\"), require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"./foundation.util.box\", \"./foundation.util.keyboard\", \"./foundation.util.nest\", \"jquery\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"foundation.drilldown\"] = factory(require(\"./foundation.core\"), require(\"./foundation.util.box\"), require(\"./foundation.util.keyboard\"), require(\"./foundation.util.nest\"), require(\"jquery\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.drilldown\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.box\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.keyboard\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.nest\"], root[\"jQuery\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE__foundation_util_box__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __WEBPACK_EXTERNAL_MODULE_jquery__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./foundation.core\":\n/*!****************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.core\"],\"amd\":\"./foundation.core\",\"commonjs\":\"./foundation.core\",\"commonjs2\":\"./foundation.core\"} ***!\n \\****************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_core__;\n\n/***/ }),\n\n/***/ \"./foundation.util.box\":\n/*!********************************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.box\"],\"amd\":\"./foundation.util.box\",\"commonjs\":\"./foundation.util.box\",\"commonjs2\":\"./foundation.util.box\"} ***!\n \\********************************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_box__;\n\n/***/ }),\n\n/***/ \"./foundation.util.keyboard\":\n/*!****************************************************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.keyboard\"],\"amd\":\"./foundation.util.keyboard\",\"commonjs\":\"./foundation.util.keyboard\",\"commonjs2\":\"./foundation.util.keyboard\"} ***!\n \\****************************************************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__;\n\n/***/ }),\n\n/***/ \"./foundation.util.nest\":\n/*!************************************************************************************************************************************************************************************!*\\\n !*** external {\"root\":[\"__FOUNDATION_EXTERNAL__\",\"foundation.util.nest\"],\"amd\":\"./foundation.util.nest\",\"commonjs\":\"./foundation.util.nest\",\"commonjs2\":\"./foundation.util.nest\"} ***!\n \\************************************************************************************************************************************************************************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__;\n\n/***/ }),\n\n/***/ \"./js/entries/plugins/foundation.drilldown.js\":\n/*!****************************************************!*\\\n !*** ./js/entries/plugins/foundation.drilldown.js ***!\n \\****************************************************/\n/*! exports provided: Foundation, Drilldown */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./foundation.core */ \"./foundation.core\");\n/* harmony import */ var _foundation_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_foundation_core__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Foundation\", function() { return _foundation_core__WEBPACK_IMPORTED_MODULE_0__[\"Foundation\"]; });\n\n/* harmony import */ var _foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../foundation.drilldown */ \"./js/foundation.drilldown.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Drilldown\", function() { return _foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__[\"Drilldown\"]; });\n\n\n\n_foundation_core__WEBPACK_IMPORTED_MODULE_0__[\"Foundation\"].plugin(_foundation_drilldown__WEBPACK_IMPORTED_MODULE_1__[\"Drilldown\"], 'Drilldown');\n\n\n/***/ }),\n\n/***/ \"./js/foundation.drilldown.js\":\n/*!************************************!*\\\n !*** ./js/foundation.drilldown.js ***!\n \\************************************/\n/*! exports provided: Drilldown */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Drilldown\", function() { return Drilldown; });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ \"./foundation.util.keyboard\");\n/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.nest */ \"./foundation.util.nest\");\n/* harmony import */ var _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.core.utils */ \"./foundation.core\");\n/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.box */ \"./foundation.util.box\");\n/* harmony import */ var _foundation_util_box__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_foundation_util_box__WEBPACK_IMPORTED_MODULE_4__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n/**\n * Drilldown module.\n * @module foundation.drilldown\n * @requires foundation.util.keyboard\n * @requires foundation.util.nest\n * @requires foundation.util.box\n */\n\nvar Drilldown = /*#__PURE__*/function (_Plugin) {\n _inherits(Drilldown, _Plugin);\n\n var _super = _createSuper(Drilldown);\n\n function Drilldown() {\n _classCallCheck(this, Drilldown);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Drilldown, [{\n key: \"_setup\",\n value:\n /**\n * Creates a new instance of a drilldown menu.\n * @class\n * @name Drilldown\n * @param {jQuery} element - jQuery object to make into an accordion menu.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n function _setup(element, options) {\n this.$element = element;\n this.options = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({}, Drilldown.defaults, this.$element.data(), options);\n this.className = 'Drilldown'; // ie9 back compat\n\n this._init();\n\n _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__[\"Keyboard\"].register('Drilldown', {\n 'ENTER': 'open',\n 'SPACE': 'open',\n 'ARROW_RIGHT': 'next',\n 'ARROW_UP': 'up',\n 'ARROW_DOWN': 'down',\n 'ARROW_LEFT': 'previous',\n 'ESCAPE': 'close'\n });\n }\n /**\n * Initializes the drilldown by creating jQuery collections of elements\n * @private\n */\n\n }, {\n key: \"_init\",\n value: function _init() {\n _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__[\"Nest\"].Feather(this.$element, 'drilldown');\n\n if (this.options.autoApplyClass) {\n this.$element.addClass('drilldown');\n }\n\n this.$element.attr({\n 'aria-multiselectable': false\n });\n this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');\n this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');\n this.$menuItems = this.$element.find('li').not('.js-drilldown-back').find('a'); // Set the main menu as current by default (unless a submenu is selected)\n // Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu\n\n this.$currentMenu = this.$element;\n this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"GetYoDigits\"])(6, 'drilldown'));\n\n this._prepareMenu();\n\n this._registerEvents();\n\n this._keyboardEvents();\n }\n /**\n * prepares drilldown menu by setting attributes to links and elements\n * sets a min height to prevent content jumping\n * wraps the element if not already wrapped\n * @private\n * @function\n */\n\n }, {\n key: \"_prepareMenu\",\n value: function _prepareMenu() {\n var _this = this; // if(!this.options.holdOpen){\n // this._menuLinkEvents();\n // }\n\n\n this.$submenuAnchors.each(function () {\n var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n var $sub = $link.parent();\n\n if (_this.options.parentLink) {\n $link.clone().prependTo($sub.children('[data-submenu]')).wrap('
');\n }\n\n $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);\n $link.children('[data-submenu]').attr({\n 'aria-hidden': true,\n 'tabindex': 0,\n 'role': 'group'\n });\n\n _this._events($link);\n });\n this.$submenus.each(function () {\n var $menu = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),\n $back = $menu.find('.js-drilldown-back');\n\n if (!$back.length) {\n switch (_this.options.backButtonPosition) {\n case \"bottom\":\n $menu.append(_this.options.backButton);\n break;\n\n case \"top\":\n $menu.prepend(_this.options.backButton);\n break;\n\n default:\n console.error(\"Unsupported backButtonPosition value '\" + _this.options.backButtonPosition + \"'\");\n }\n }\n\n _this._back($menu);\n });\n this.$submenus.addClass('invisible');\n\n if (!this.options.autoHeight) {\n this.$submenus.addClass('drilldown-submenu-cover-previous');\n } // create a wrapper on element if it doesn't exist.\n\n\n if (!this.$element.parent().hasClass('is-drilldown')) {\n this.$wrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this.options.wrapper).addClass('is-drilldown');\n if (this.options.animateHeight) this.$wrapper.addClass('animate-height');\n this.$element.wrap(this.$wrapper);\n } // set wrapper\n\n\n this.$wrapper = this.$element.parent();\n this.$wrapper.css(this._getMaxDims());\n }\n }, {\n key: \"_resize\",\n value: function _resize() {\n this.$wrapper.css({\n 'max-width': 'none',\n 'min-height': 'none'\n }); // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths\n\n this.$wrapper.css(this._getMaxDims());\n }\n /**\n * Adds event handlers to elements in the menu.\n * @function\n * @private\n * @param {jQuery} $elem - the current menu item to add handlers to.\n */\n\n }, {\n key: \"_events\",\n value: function _events($elem) {\n var _this = this;\n\n $elem.off('click.zf.drilldown').on('click.zf.drilldown', function (e) {\n if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')) {\n e.preventDefault();\n } // if(e.target !== e.currentTarget.firstElementChild){\n // return false;\n // }\n\n\n _this._show($elem.parent('li'));\n\n if (_this.options.closeOnClick) {\n var $body = jquery__WEBPACK_IMPORTED_MODULE_0___default()('body');\n $body.off('.zf.drilldown').on('click.zf.drilldown', function (ev) {\n if (ev.target === _this.$element[0] || jquery__WEBPACK_IMPORTED_MODULE_0___default.a.contains(_this.$element[0], ev.target)) {\n return;\n }\n\n ev.preventDefault();\n\n _this._hideAll();\n\n $body.off('.zf.drilldown');\n });\n }\n });\n }\n /**\n * Adds event handlers to the menu element.\n * @function\n * @private\n */\n\n }, {\n key: \"_registerEvents\",\n value: function _registerEvents() {\n if (this.options.scrollTop) {\n this._bindHandler = this._scrollTop.bind(this);\n this.$element.on('open.zf.drilldown hide.zf.drilldown close.zf.drilldown closed.zf.drilldown', this._bindHandler);\n }\n\n this.$element.on('mutateme.zf.trigger', this._resize.bind(this));\n }\n /**\n * Scroll to Top of Element or data-scroll-top-element\n * @function\n * @fires Drilldown#scrollme\n */\n\n }, {\n key: \"_scrollTop\",\n value: function _scrollTop() {\n var _this = this;\n\n var $scrollTopElement = _this.options.scrollTopElement !== '' ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(_this.options.scrollTopElement) : _this.$element,\n scrollPos = parseInt($scrollTopElement.offset().top + _this.options.scrollTopOffset, 10);\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('html, body').stop(true).animate({\n scrollTop: scrollPos\n }, _this.options.animationDuration, _this.options.animationEasing, function () {\n /**\n * Fires after the menu has scrolled\n * @event Drilldown#scrollme\n */\n if (this === jquery__WEBPACK_IMPORTED_MODULE_0___default()('html')[0]) _this.$element.trigger('scrollme.zf.drilldown');\n });\n }\n /**\n * Adds keydown event listener to `li`'s in the menu.\n * @private\n */\n\n }, {\n key: \"_keyboardEvents\",\n value: function _keyboardEvents() {\n var _this = this;\n\n this.$menuItems.add(this.$element.find('.js-drilldown-back > a, .is-submenu-parent-item > a')).on('keydown.zf.drilldown', function (e) {\n var $element = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),\n $elements = $element.parent('li').parent('ul').children('li').children('a'),\n $prevElement,\n $nextElement;\n $elements.each(function (i) {\n if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).is($element)) {\n $prevElement = $elements.eq(Math.max(0, i - 1));\n $nextElement = $elements.eq(Math.min(i + 1, $elements.length - 1));\n return;\n }\n });\n _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__[\"Keyboard\"].handleKey(e, 'Drilldown', {\n next: function next() {\n if ($element.is(_this.$submenuAnchors)) {\n _this._show($element.parent('li'));\n\n $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($element), function () {\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n previous: function previous() {\n _this._hide($element.parent('li').parent('ul'));\n\n $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($element), function () {\n setTimeout(function () {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n },\n up: function up() {\n $prevElement.focus(); // Don't tap focus on first element in root ul\n\n return !$element.is(_this.$element.find('> li:first-child > a'));\n },\n down: function down() {\n $nextElement.focus(); // Don't tap focus on last element in root ul\n\n return !$element.is(_this.$element.find('> li:last-child > a'));\n },\n close: function close() {\n // Don't close on element in root ul\n if (!$element.is(_this.$element.find('> li > a'))) {\n _this._hide($element.parent().parent());\n\n $element.parent().parent().siblings('a').focus();\n }\n },\n open: function open() {\n if (_this.options.parentLink && $element.attr('href')) {\n // Link with href\n return false;\n } else if (!$element.is(_this.$menuItems)) {\n // not menu item means back button\n _this._hide($element.parent('li').parent('ul'));\n\n $element.parent('li').parent('ul').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($element), function () {\n setTimeout(function () {\n $element.parent('li').parent('ul').parent('li').children('a').first().focus();\n }, 1);\n });\n return true;\n } else if ($element.is(_this.$submenuAnchors)) {\n // Sub menu item\n _this._show($element.parent('li'));\n\n $element.parent('li').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($element), function () {\n $element.parent('li').find('ul li a').not('.js-drilldown-back a').first().focus();\n });\n return true;\n }\n },\n handled: function handled(preventDefault) {\n if (preventDefault) {\n e.preventDefault();\n }\n }\n });\n }); // end keyboardAccess\n }\n /**\n * Closes all open elements, and returns to root menu.\n * @function\n * @fires Drilldown#close\n * @fires Drilldown#closed\n */\n\n }, {\n key: \"_hideAll\",\n value: function _hideAll() {\n var _this2 = this;\n\n var $elem = this.$element.find('.is-drilldown-submenu.is-active');\n $elem.addClass('is-closing');\n $elem.parent().closest('ul').removeClass('invisible');\n\n if (this.options.autoHeight) {\n var calcHeight = $elem.parent().closest('ul').data('calcHeight');\n this.$wrapper.css({\n height: calcHeight\n });\n }\n /**\n * Fires when the menu is closing.\n * @event Drilldown#close\n */\n\n\n this.$element.trigger('close.zf.drilldown');\n $elem.one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($elem), function () {\n $elem.removeClass('is-active is-closing');\n /**\n * Fires when the menu is fully closed.\n * @event Drilldown#closed\n */\n\n _this2.$element.trigger('closed.zf.drilldown');\n });\n }\n /**\n * Adds event listener for each `back` button, and closes open menus.\n * @function\n * @fires Drilldown#back\n * @param {jQuery} $elem - the current sub-menu to add `back` event.\n */\n\n }, {\n key: \"_back\",\n value: function _back($elem) {\n var _this = this;\n\n $elem.off('click.zf.drilldown');\n $elem.children('.js-drilldown-back').on('click.zf.drilldown', function () {\n _this._hide($elem); // If there is a parent submenu, call show\n\n\n var parentSubMenu = $elem.parent('li').parent('ul').parent('li');\n\n if (parentSubMenu.length) {\n _this._show(parentSubMenu);\n } else {\n _this.$currentMenu = _this.$element;\n }\n });\n }\n /**\n * Adds event listener to menu items w/o submenus to close open menus on click.\n * @function\n * @private\n */\n\n }, {\n key: \"_menuLinkEvents\",\n value: function _menuLinkEvents() {\n var _this = this;\n\n this.$menuItems.not('.is-drilldown-submenu-parent').off('click.zf.drilldown').on('click.zf.drilldown', function () {\n setTimeout(function () {\n _this._hideAll();\n }, 0);\n });\n }\n /**\n * Sets the CSS classes for submenu to show it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n\n }, {\n key: \"_setShowSubMenuClasses\",\n value: function _setShowSubMenuClasses($elem, trigger) {\n $elem.addClass('is-active').removeClass('invisible').attr('aria-hidden', false);\n $elem.parent('li').attr('aria-expanded', true);\n\n if (trigger === true) {\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n }\n /**\n * Sets the CSS classes for submenu to hide it.\n * @function\n * @private\n * @param {jQuery} $elem - the target submenu (`ul` tag)\n * @param {boolean} trigger - trigger drilldown event\n */\n\n }, {\n key: \"_setHideSubMenuClasses\",\n value: function _setHideSubMenuClasses($elem, trigger) {\n $elem.removeClass('is-active').addClass('invisible').attr('aria-hidden', true);\n $elem.parent('li').attr('aria-expanded', false);\n\n if (trigger === true) {\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n }\n /**\n * Opens a specific drilldown (sub)menu no matter which (sub)menu in it is currently visible.\n * Compared to _show() this lets you jump into any submenu without clicking through every submenu on the way to it.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the target (sub)menu (`ul` tag)\n * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused\n */\n\n }, {\n key: \"_showMenu\",\n value: function _showMenu($elem, autoFocus) {\n var _this = this; // Reset drilldown\n\n\n var $expandedSubmenus = this.$element.find('li[aria-expanded=\"true\"] > ul[data-submenu]');\n $expandedSubmenus.each(function () {\n _this._setHideSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));\n }); // Save the menu as the currently displayed one.\n\n this.$currentMenu = $elem; // If target menu is root, focus first link & exit\n\n if ($elem.is('[data-drilldown]')) {\n if (autoFocus === true) $elem.find('li > a').first().focus();\n if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));\n return;\n } // Find all submenus on way to root incl. the element itself\n\n\n var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]'); // Open target menu and all submenus on its way to root\n\n $submenus.each(function (index) {\n // Update height of first child (target menu) if autoHeight option true\n if (index === 0 && _this.options.autoHeight) {\n _this.$wrapper.css('height', jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight'));\n }\n\n var isLastChild = index === $submenus.length - 1; // Add transitionsend listener to last child (root due to reverse order) to open target menu's first link\n // Last child makes sure the event gets always triggered even if going through several menus\n\n if (isLastChild === true) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this)), function () {\n if (autoFocus === true) {\n $elem.find('li > a').first().focus();\n }\n });\n }\n\n _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild);\n });\n }\n /**\n * Opens a submenu.\n * @function\n * @fires Drilldown#open\n * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.\n */\n\n }, {\n key: \"_show\",\n value: function _show($elem) {\n var $submenu = $elem.children('[data-submenu]');\n $elem.attr('aria-expanded', true);\n this.$currentMenu = $submenu; //hide drilldown parent menu when submenu is open\n // this removes it from the dom so that the tab key will take the user to the next visible element\n\n $elem.parent().closest('ul').addClass('invisible'); // add visible class to submenu to override invisible class above\n\n $submenu.addClass('is-active visible').removeClass('invisible').attr('aria-hidden', false);\n\n if (this.options.autoHeight) {\n this.$wrapper.css({\n height: $submenu.data('calcHeight')\n });\n }\n /**\n * Fires when the submenu has opened.\n * @event Drilldown#open\n */\n\n\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\n /**\n * Hides a submenu\n * @function\n * @fires Drilldown#hide\n * @param {jQuery} $elem - the current sub-menu to hide, i.e. the `ul` tag.\n */\n\n }, {\n key: \"_hide\",\n value: function _hide($elem) {\n if (this.options.autoHeight) this.$wrapper.css({\n height: $elem.parent().closest('ul').data('calcHeight')\n });\n $elem.parent().closest('ul').removeClass('invisible');\n $elem.parent('li').attr('aria-expanded', false);\n $elem.attr('aria-hidden', true);\n $elem.addClass('is-closing').one(Object(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"transitionend\"])($elem), function () {\n $elem.removeClass('is-active is-closing visible');\n $elem.blur().addClass('invisible');\n });\n /**\n * Fires when the submenu has closed.\n * @event Drilldown#hide\n */\n\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\n /**\n * Iterates through the nested menus to calculate the min-height, and max-width for the menu.\n * Prevents content jumping.\n * @function\n * @private\n */\n\n }, {\n key: \"_getMaxDims\",\n value: function _getMaxDims() {\n var maxHeight = 0,\n result = {},\n _this = this; // Recalculate menu heights and total max height\n\n\n this.$submenus.add(this.$element).each(function () {\n var height = _foundation_util_box__WEBPACK_IMPORTED_MODULE_4__[\"Box\"].GetDimensions(this).height;\n maxHeight = height > maxHeight ? height : maxHeight;\n\n if (_this.options.autoHeight) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('calcHeight', height);\n }\n });\n if (this.options.autoHeight) result.height = this.$currentMenu.data('calcHeight');else result['min-height'] = \"\".concat(maxHeight, \"px\");\n result['max-width'] = \"\".concat(this.$element[0].getBoundingClientRect().width, \"px\");\n return result;\n }\n /**\n * Destroys the Drilldown Menu\n * @function\n */\n\n }, {\n key: \"_destroy\",\n value: function _destroy() {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('body').off('.zf.drilldown');\n if (this.options.scrollTop) this.$element.off('.zf.drilldown', this._bindHandler);\n\n this._hideAll();\n\n this.$element.off('mutateme.zf.trigger');\n _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__[\"Nest\"].Burn(this.$element, 'drilldown');\n this.$element.unwrap().find('.js-drilldown-back, .is-submenu-parent-item').remove().end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu').off('transitionend otransitionend webkitTransitionEnd').end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).off('.zf.drilldown');\n });\n this.$element.find('[data-is-parent-link]').detach();\n this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');\n this.$element.find('a').each(function () {\n var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n $link.removeAttr('tabindex');\n\n if ($link.data('savedHref')) {\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n } else {\n return;\n }\n });\n }\n }]);\n\n return Drilldown;\n}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__[\"Plugin\"]);\n\nDrilldown.defaults = {\n /**\n * Drilldowns depend on styles in order to function properly; in the default build of Foundation these are\n * on the `drilldown` class. This option auto-applies this class to the drilldown upon initialization.\n * @option\n * @type {boolean}\n * @default true\n */\n autoApplyClass: true,\n\n /**\n * Markup used for JS generated back button. Prepended or appended (see backButtonPosition) to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\\`) if copy and pasting.\n * @option\n * @type {string}\n * @default '