{"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(\"jquery\"), require(\"./foundation.util.keyboard\"), require(\"./foundation.util.nest\"), require(\"./foundation.util.box\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"./foundation.core\", \"jquery\", \"./foundation.util.keyboard\", \"./foundation.util.nest\", \"./foundation.util.box\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"__FOUNDATION_EXTERNAL__\"] = factory(require(\"./foundation.core\"), require(\"jquery\"), require(\"./foundation.util.keyboard\"), require(\"./foundation.util.nest\"), require(\"./foundation.util.box\"));\n\telse\n\t\troot[\"__FOUNDATION_EXTERNAL__\"] = root[\"__FOUNDATION_EXTERNAL__\"] || {}, root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.drilldown\"] = factory(root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.core\"], root[\"jQuery\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.keyboard\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.nest\"], root[\"__FOUNDATION_EXTERNAL__\"][\"foundation.util.box\"]);\n})(self, function(__WEBPACK_EXTERNAL_MODULE__foundation_core__, __WEBPACK_EXTERNAL_MODULE_jquery__, __WEBPACK_EXTERNAL_MODULE__foundation_util_keyboard__, __WEBPACK_EXTERNAL_MODULE__foundation_util_nest__, __WEBPACK_EXTERNAL_MODULE__foundation_util_box__) {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \t\"use strict\";\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ \"./js/foundation.drilldown.js\":\n/*!************************************!*\\\n !*** ./js/foundation.drilldown.js ***!\n \\************************************/\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Drilldown: function() { return /* binding */ Drilldown; }\n/* harmony export */ });\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.plugin */ \"./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\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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); }; }\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); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\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; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : 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 */\nvar Drilldown = /*#__PURE__*/function (_Plugin) {\n _inherits(Drilldown, _Plugin);\n var _super = _createSuper(Drilldown);\n function Drilldown() {\n _classCallCheck(this, Drilldown);\n return _super.apply(this, arguments);\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().extend({}, Drilldown.defaults, this.$element.data(), options);\n this.className = 'Drilldown'; // ie9 back compat\n\n this._init();\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 /**\n * Initializes the drilldown by creating jQuery collections of elements\n * @private\n */\n }, {\n key: \"_init\",\n value: function _init() {\n _foundation_util_nest__WEBPACK_IMPORTED_MODULE_2__.Nest.Feather(this.$element, 'drilldown');\n if (this.options.autoApplyClass) {\n this.$element.addClass('drilldown');\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');\n\n // 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 this.$currentMenu = this.$element;\n this.$element.attr('data-mutate', this.$element.attr('data-drilldown') || (0,_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__.GetYoDigits)(6, 'drilldown'));\n this._prepareMenu();\n this._registerEvents();\n this._keyboardEvents();\n }\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 key: \"_prepareMenu\",\n value: function _prepareMenu() {\n var _this = this;\n // if(!this.options.holdOpen){\n // this._menuLinkEvents();\n // }\n this.$submenuAnchors.each(function () {\n var $link = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n var $sub = $link.parent();\n if (_this.options.parentLink) {\n $link.clone().prependTo($sub.children('[data-submenu]')).wrap('
');\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 _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 if (!$back.length) {\n switch (_this.options.backButtonPosition) {\n case \"bottom\":\n $menu.append(_this.options.backButton);\n break;\n case \"top\":\n $menu.prepend(_this.options.backButton);\n break;\n default:\n console.error(\"Unsupported backButtonPosition value '\" + _this.options.backButtonPosition + \"'\");\n }\n }\n _this._back($menu);\n });\n this.$submenus.addClass('invisible');\n if (!this.options.autoHeight) {\n this.$submenus.addClass('drilldown-submenu-cover-previous');\n }\n\n // create a wrapper on element if it doesn't exist.\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 }\n // set wrapper\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 });\n // _getMaxDims has side effects (boo) but calling it should update all other necessary heights & widths\n this.$wrapper.css(this._getMaxDims());\n }\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 key: \"_events\",\n value: function _events($elem) {\n var _this = this;\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 }\n\n // if(e.target !== e.currentTarget.firstElementChild){\n // return false;\n // }\n _this._show($elem.parent('li'));\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().contains(_this.$element[0], ev.target)) {\n return;\n }\n ev.preventDefault();\n _this._hideAll();\n $body.off('.zf.drilldown');\n });\n }\n });\n }\n\n /**\n * Adds event handlers to the menu element.\n * @function\n * @private\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 this.$element.on('mutateme.zf.trigger', this._resize.bind(this));\n }\n\n /**\n * Scroll to Top of Element or data-scroll-top-element\n * @function\n * @fires Drilldown#scrollme\n */\n }, {\n key: \"_scrollTop\",\n value: function _scrollTop() {\n var _this = this;\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 /**\n * Adds keydown event listener to `li`'s in the menu.\n * @private\n */\n }, {\n key: \"_keyboardEvents\",\n value: function _keyboardEvents() {\n var _this = this;\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 $element.parent('li').one((0,_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 $element.parent('li').parent('ul').one((0,_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();\n // Don't tap focus on first element in root ul\n return !$element.is(_this.$element.find('> li:first-child > a'));\n },\n down: function down() {\n $nextElement.focus();\n // Don't tap focus on last element in root ul\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 $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 $element.parent('li').parent('ul').one((0,_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 $element.parent('li').one((0,_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 /**\n * Closes all open elements, and returns to root menu.\n * @function\n * @fires Drilldown#close\n * @fires Drilldown#closed\n */\n }, {\n key: \"_hideAll\",\n value: function _hideAll() {\n var _this2 = this;\n var $elem = this.$element.find('.is-drilldown-submenu.is-active');\n $elem.addClass('is-closing');\n $elem.parent().closest('ul').removeClass('invisible');\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 /**\n * Fires when the menu is closing.\n * @event Drilldown#close\n */\n this.$element.trigger('close.zf.drilldown');\n $elem.one((0,_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__.transitionend)($elem), function () {\n $elem.removeClass('is-active is-closing');\n\n /**\n * Fires when the menu is fully closed.\n * @event Drilldown#closed\n */\n _this2.$element.trigger('closed.zf.drilldown');\n });\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 key: \"_back\",\n value: function _back($elem) {\n var _this = this;\n $elem.off('click.zf.drilldown');\n $elem.children('.js-drilldown-back').on('click.zf.drilldown', function () {\n _this._hide($elem);\n\n // If there is a parent submenu, call show\n var parentSubMenu = $elem.parent('li').parent('ul').parent('li');\n if (parentSubMenu.length) {\n _this._show(parentSubMenu);\n } else {\n _this.$currentMenu = _this.$element;\n }\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 key: \"_menuLinkEvents\",\n value: function _menuLinkEvents() {\n var _this = this;\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 /**\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 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 if (trigger === true) {\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\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 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 if (trigger === true) {\n $elem.trigger('hide.zf.drilldown', [$elem]);\n }\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 key: \"_showMenu\",\n value: function _showMenu($elem, autoFocus) {\n var _this = this;\n\n // Reset drilldown\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 });\n\n // Save the menu as the currently displayed one.\n this.$currentMenu = $elem;\n\n // If target menu is root, focus first link & exit\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 }\n\n // Find all submenus on way to root incl. the element itself\n var $submenus = $elem.children().first().parentsUntil('[data-drilldown]', '[data-submenu]');\n\n // Open target menu and all submenus on its way to root\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 var isLastChild = index === $submenus.length - 1;\n\n // 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 if (isLastChild === true) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).one((0,_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 _this._setShowSubMenuClasses(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this), isLastChild);\n });\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 key: \"_show\",\n value: function _show($elem) {\n var $submenu = $elem.children('[data-submenu]');\n $elem.attr('aria-expanded', true);\n this.$currentMenu = $submenu;\n\n //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 $elem.parent().closest('ul').addClass('invisible');\n\n // add visible class to submenu to override invisible class above\n $submenu.addClass('is-active visible').removeClass('invisible').attr('aria-hidden', false);\n if (this.options.autoHeight) {\n this.$wrapper.css({\n height: $submenu.data('calcHeight')\n });\n }\n\n /**\n * Fires when the submenu has opened.\n * @event Drilldown#open\n */\n this.$element.trigger('open.zf.drilldown', [$elem]);\n }\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 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((0,_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 $elem.trigger('hide.zf.drilldown', [$elem]);\n }\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 key: \"_getMaxDims\",\n value: function _getMaxDims() {\n var maxHeight = 0,\n result = {},\n _this = this;\n\n // Recalculate menu heights and total max height\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 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 /**\n * Destroys the Drilldown Menu\n * @function\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 this._hideAll();\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 if ($link.data('savedHref')) {\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n } else {\n return;\n }\n });\n }\n }]);\n return Drilldown;\n}(_foundation_core_utils__WEBPACK_IMPORTED_MODULE_3__.Plugin);\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 * 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 '