New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@threespot/expand-toggle

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@threespot/expand-toggle - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

2

dist/compressed/expand-toggle.amd.min.js

@@ -1,1 +0,1 @@

define("expand-toggleLink",[],function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=13)}([function(t,e,i){var n=i(1).Symbol;t.exports=n},function(t,e,i){var n=i(10),r="object"==typeof self&&self&&self.Object===Object&&self,a=n||r||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var n=i(0),r=Object.prototype,a=r.hasOwnProperty,s=r.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(t){}var r=s.call(t);return n&&(e?t[o]=i:delete t[o]),r}},function(t,e,i){var n=i(0),r=i(5),a=i(4),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?r(t):a(t)}},function(t,e,i){var n=i(6),r=i(3);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}},function(t,e,i){var n=i(2),r=i(7),a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var i=o.test(t);return i||l.test(t)?u(t.slice(2),i?2:8):s.test(t)?NaN:+t}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i(9))},function(t,e,i){var n=i(1);t.exports=function(){return n.Date.now()}},function(t,e,i){var n=i(2),r=i(11),a=i(8),s=Math.max,o=Math.min;t.exports=function(t,e,i){var l,u,h,d,c,p,f=0,g=!1,v=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var i=l,n=u;return l=u=void 0,f=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||v&&t-f>=h}function m(){var t=r();if(b(t))return E(t);c=setTimeout(m,function(t){var i=e-(t-p);return v?o(i,h-(t-f)):i}(t))}function E(t){return c=void 0,x&&l?y(t):(l=u=void 0,d)}function T(){var t=r(),i=b(t);if(l=arguments,u=this,p=t,i){if(void 0===c)return function(t){return f=t,c=setTimeout(m,e),g?y(t):d}(p);if(v)return c=setTimeout(m,e),y(p)}return void 0===c&&(c=setTimeout(m,e)),d}return e=a(e)||0,n(i)&&(g=!!i.leading,h=(v="maxWait"in i)?s(a(i.maxWait)||0,e):h,x="trailing"in i?!!i.trailing:x),T.cancel=function(){void 0!==c&&clearTimeout(c),f=0,l=p=u=c=void 0},T.flush=function(){return void 0===c?d:E(r())},T}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=(n=i(12))&&n.__esModule?n:{default:n};function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var o=function(){function t(e,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.targetId=this.el.getAttribute("data-expands"),this.targetEl=document.getElementById(this.targetId),!this.targetEl)return console.warn("Can’t find expandable target with id “"+this.targetId+"”"),!1;this.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:""},i),this.expandedClasses=this.el.getAttribute("data-expands-class")||this.options.expandedClasses,this.expandedClasses.length&&(this.expandedClasses.indexOf(" ")>-1?this.expandedClasses=this.expandedClasses.split(" ").filter(function(t){return t.length}):this.expandedClasses=[this.expandedClasses]),this.shouldToggleHeight=this.el.hasAttribute("data-expands-height")||this.options.shouldToggleHeight,this.hasActiveText=!1,this.textEl=this.el.querySelector("[data-expands-text]"),this.textEl&&(this.defaultToggleText=this.textEl.textContent,this.activeToggleText=this.textEl.getAttribute("data-expands-text")||this.options.activeToggleText,this.hasActiveText=!!this.activeToggleText.length),this.init()}return r(t,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler)}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,a.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var i=this.targetParentEl.insertBefore(e,this.targetEl),n=Math.round(parseFloat(i.offsetHeight));this.targetParentEl.removeChild(i),this.targetEl.style.maxHeight=n+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1)}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0)}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler)}}]),t}();e.default=o}])});
define("expand-toggleLink",[],function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=14)}([function(t,e,n){var i=n(1).Symbol;t.exports=i},function(t,e,n){var i=n(11),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(t,o),delete i[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})?i.call(e,n,e,t):i)||(t.exports=r)},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var i=n(0),r=Object.prototype,o=r.hasOwnProperty,a=r.toString,s=i?i.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var i=!0}catch(t){}var r=a.call(t);return i&&(e?t[s]=n:delete t[s]),r}},function(t,e,n){var i=n(0),r=n(6),o=n(5),a=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?r(t):o(t)}},function(t,e,n){var i=n(7),r=n(4);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==i(t)}},function(t,e,n){var i=n(2),r=n(8),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||l.test(t)?u(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(10))},function(t,e,n){var i=n(1);t.exports=function(){return i.Date.now()}},function(t,e,n){var i=n(2),r=n(12),o=n(9),a=Math.max,s=Math.min;t.exports=function(t,e,n){var l,u,d,c,h,f,p=0,v=!1,g=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=l,i=u;return l=u=void 0,p=e,c=t.apply(i,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||g&&t-p>=d}function m(){var t=r();if(b(t))return E(t);h=setTimeout(m,function(t){var n=e-(t-f);return g?s(n,d-(t-p)):n}(t))}function E(t){return h=void 0,x&&l?y(t):(l=u=void 0,c)}function T(){var t=r(),n=b(t);if(l=arguments,u=this,f=t,n){if(void 0===h)return function(t){return p=t,h=setTimeout(m,e),v?y(t):c}(f);if(g)return h=setTimeout(m,e),y(f)}return void 0===h&&(h=setTimeout(m,e)),c}return e=o(e)||0,i(n)&&(v=!!n.leading,d=(g="maxWait"in n)?a(o(n.maxWait)||0,e):d,x="trailing"in n?!!n.trailing:x),T.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},T.flush=function(){return void 0===h?c:E(r())},T}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(13)),o=a(n(3));function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.el=t,i.targetId=i.el.getAttribute("data-expands"),i.targetEl=document.getElementById(i.targetId),i.targetEl?(i.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:"",onReady:null},n),i.expandedClasses=i.el.getAttribute("data-expands-class")||i.options.expandedClasses,i.expandedClasses.length&&(i.expandedClasses.indexOf(" ")>-1?i.expandedClasses=i.expandedClasses.split(" ").filter(function(t){return t.length}):i.expandedClasses=[i.expandedClasses]),i.shouldToggleHeight=i.el.hasAttribute("data-expands-height")||i.options.shouldToggleHeight,i.hasActiveText=!1,i.textEl=i.el.querySelector("[data-expands-text]"),i.textEl&&(i.defaultToggleText=i.textEl.textContent,i.activeToggleText=i.textEl.getAttribute("data-expands-text")||i.options.activeToggleText,i.hasActiveText=!!i.activeToggleText.length),i.init(),i):(console.warn("Can’t find expandable target with id “"+i.targetId+"”"),l(i,!1))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler),"function"==typeof this.options.onReady&&this.options.onReady()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler),this.emitEvent("destroy")}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,r.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var n=this.targetParentEl.insertBefore(e,this.targetEl),i=Math.round(parseFloat(n.offsetHeight));this.targetParentEl.removeChild(n),this.targetEl.style.maxHeight=i+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1),this.emitEvent("expand")}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),this.emitEvent("collapse")}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}}]),e}();e.default=u}])});

@@ -1,1 +0,1 @@

module.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=13)}([function(t,e,i){var n=i(1).Symbol;t.exports=n},function(t,e,i){var n=i(10),r="object"==typeof self&&self&&self.Object===Object&&self,a=n||r||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var n=i(0),r=Object.prototype,a=r.hasOwnProperty,s=r.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(t){}var r=s.call(t);return n&&(e?t[o]=i:delete t[o]),r}},function(t,e,i){var n=i(0),r=i(5),a=i(4),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?r(t):a(t)}},function(t,e,i){var n=i(6),r=i(3);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}},function(t,e,i){var n=i(2),r=i(7),a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var i=o.test(t);return i||l.test(t)?u(t.slice(2),i?2:8):s.test(t)?NaN:+t}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i(9))},function(t,e,i){var n=i(1);t.exports=function(){return n.Date.now()}},function(t,e,i){var n=i(2),r=i(11),a=i(8),s=Math.max,o=Math.min;t.exports=function(t,e,i){var l,u,h,d,c,p,f=0,g=!1,v=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var i=l,n=u;return l=u=void 0,f=e,d=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||v&&t-f>=h}function m(){var t=r();if(b(t))return E(t);c=setTimeout(m,function(t){var i=e-(t-p);return v?o(i,h-(t-f)):i}(t))}function E(t){return c=void 0,x&&l?y(t):(l=u=void 0,d)}function T(){var t=r(),i=b(t);if(l=arguments,u=this,p=t,i){if(void 0===c)return function(t){return f=t,c=setTimeout(m,e),g?y(t):d}(p);if(v)return c=setTimeout(m,e),y(p)}return void 0===c&&(c=setTimeout(m,e)),d}return e=a(e)||0,n(i)&&(g=!!i.leading,h=(v="maxWait"in i)?s(a(i.maxWait)||0,e):h,x="trailing"in i?!!i.trailing:x),T.cancel=function(){void 0!==c&&clearTimeout(c),f=0,l=p=u=c=void 0},T.flush=function(){return void 0===c?d:E(r())},T}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=(n=i(12))&&n.__esModule?n:{default:n};function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var o=function(){function t(e,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.targetId=this.el.getAttribute("data-expands"),this.targetEl=document.getElementById(this.targetId),!this.targetEl)return console.warn("Can’t find expandable target with id “"+this.targetId+"”"),!1;this.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:""},i),this.expandedClasses=this.el.getAttribute("data-expands-class")||this.options.expandedClasses,this.expandedClasses.length&&(this.expandedClasses.indexOf(" ")>-1?this.expandedClasses=this.expandedClasses.split(" ").filter(function(t){return t.length}):this.expandedClasses=[this.expandedClasses]),this.shouldToggleHeight=this.el.hasAttribute("data-expands-height")||this.options.shouldToggleHeight,this.hasActiveText=!1,this.textEl=this.el.querySelector("[data-expands-text]"),this.textEl&&(this.defaultToggleText=this.textEl.textContent,this.activeToggleText=this.textEl.getAttribute("data-expands-text")||this.options.activeToggleText,this.hasActiveText=!!this.activeToggleText.length),this.init()}return r(t,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler)}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,a.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var i=this.targetParentEl.insertBefore(e,this.targetEl),n=Math.round(parseFloat(i.offsetHeight));this.targetParentEl.removeChild(i),this.targetEl.style.maxHeight=n+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1)}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0)}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler)}}]),t}();e.default=o}]);
module.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=14)}([function(t,e,n){var i=n(1).Symbol;t.exports=i},function(t,e,n){var i=n(11),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(t,o),delete i[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})?i.call(e,n,e,t):i)||(t.exports=r)},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var i=n(0),r=Object.prototype,o=r.hasOwnProperty,a=r.toString,s=i?i.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var i=!0}catch(t){}var r=a.call(t);return i&&(e?t[s]=n:delete t[s]),r}},function(t,e,n){var i=n(0),r=n(6),o=n(5),a=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?r(t):o(t)}},function(t,e,n){var i=n(7),r=n(4);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==i(t)}},function(t,e,n){var i=n(2),r=n(8),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||l.test(t)?u(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(10))},function(t,e,n){var i=n(1);t.exports=function(){return i.Date.now()}},function(t,e,n){var i=n(2),r=n(12),o=n(9),a=Math.max,s=Math.min;t.exports=function(t,e,n){var l,u,d,c,h,f,p=0,v=!1,g=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=l,i=u;return l=u=void 0,p=e,c=t.apply(i,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||g&&t-p>=d}function m(){var t=r();if(b(t))return E(t);h=setTimeout(m,function(t){var n=e-(t-f);return g?s(n,d-(t-p)):n}(t))}function E(t){return h=void 0,x&&l?y(t):(l=u=void 0,c)}function T(){var t=r(),n=b(t);if(l=arguments,u=this,f=t,n){if(void 0===h)return function(t){return p=t,h=setTimeout(m,e),v?y(t):c}(f);if(g)return h=setTimeout(m,e),y(f)}return void 0===h&&(h=setTimeout(m,e)),c}return e=o(e)||0,i(n)&&(v=!!n.leading,d=(g="maxWait"in n)?a(o(n.maxWait)||0,e):d,x="trailing"in n?!!n.trailing:x),T.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},T.flush=function(){return void 0===h?c:E(r())},T}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(13)),o=a(n(3));function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.el=t,i.targetId=i.el.getAttribute("data-expands"),i.targetEl=document.getElementById(i.targetId),i.targetEl?(i.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:"",onReady:null},n),i.expandedClasses=i.el.getAttribute("data-expands-class")||i.options.expandedClasses,i.expandedClasses.length&&(i.expandedClasses.indexOf(" ")>-1?i.expandedClasses=i.expandedClasses.split(" ").filter(function(t){return t.length}):i.expandedClasses=[i.expandedClasses]),i.shouldToggleHeight=i.el.hasAttribute("data-expands-height")||i.options.shouldToggleHeight,i.hasActiveText=!1,i.textEl=i.el.querySelector("[data-expands-text]"),i.textEl&&(i.defaultToggleText=i.textEl.textContent,i.activeToggleText=i.textEl.getAttribute("data-expands-text")||i.options.activeToggleText,i.hasActiveText=!!i.activeToggleText.length),i.init(),i):(console.warn("Can’t find expandable target with id “"+i.targetId+"”"),l(i,!1))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler),"function"==typeof this.options.onReady&&this.options.onReady()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler),this.emitEvent("destroy")}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,r.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var n=this.targetParentEl.insertBefore(e,this.targetEl),i=Math.round(parseFloat(n.offsetHeight));this.targetParentEl.removeChild(n),this.targetEl.style.maxHeight=i+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1),this.emitEvent("expand")}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),this.emitEvent("collapse")}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}}]),e}();e.default=u}]);

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["expand-toggleLink"]=e():t["expand-toggleLink"]=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=13)}([function(t,e,i){var n=i(1).Symbol;t.exports=n},function(t,e,i){var n=i(10),r="object"==typeof self&&self&&self.Object===Object&&self,a=n||r||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var n=i(0),r=Object.prototype,a=r.hasOwnProperty,s=r.toString,o=n?n.toStringTag:void 0;t.exports=function(t){var e=a.call(t,o),i=t[o];try{t[o]=void 0;var n=!0}catch(t){}var r=s.call(t);return n&&(e?t[o]=i:delete t[o]),r}},function(t,e,i){var n=i(0),r=i(5),a=i(4),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?r(t):a(t)}},function(t,e,i){var n=i(6),r=i(3);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}},function(t,e,i){var n=i(2),r=i(7),a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(n(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=n(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var i=o.test(t);return i||l.test(t)?u(t.slice(2),i?2:8):s.test(t)?NaN:+t}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i(9))},function(t,e,i){var n=i(1);t.exports=function(){return n.Date.now()}},function(t,e,i){var n=i(2),r=i(11),a=i(8),s=Math.max,o=Math.min;t.exports=function(t,e,i){var l,u,d,h,c,p,f=0,g=!1,x=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var i=l,n=u;return l=u=void 0,f=e,h=t.apply(n,i)}function b(t){var i=t-p;return void 0===p||i>=e||i<0||x&&t-f>=d}function m(){var t=r();if(b(t))return E(t);c=setTimeout(m,function(t){var i=e-(t-p);return x?o(i,d-(t-f)):i}(t))}function E(t){return c=void 0,v&&l?y(t):(l=u=void 0,h)}function T(){var t=r(),i=b(t);if(l=arguments,u=this,p=t,i){if(void 0===c)return function(t){return f=t,c=setTimeout(m,e),g?y(t):h}(p);if(x)return c=setTimeout(m,e),y(p)}return void 0===c&&(c=setTimeout(m,e)),h}return e=a(e)||0,n(i)&&(g=!!i.leading,d=(x="maxWait"in i)?s(a(i.maxWait)||0,e):d,v="trailing"in i?!!i.trailing:v),T.cancel=function(){void 0!==c&&clearTimeout(c),f=0,l=p=u=c=void 0},T.flush=function(){return void 0===c?h:E(r())},T}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),a=(n=i(12))&&n.__esModule?n:{default:n};function s(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}var o=function(){function t(e,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.targetId=this.el.getAttribute("data-expands"),this.targetEl=document.getElementById(this.targetId),!this.targetEl)return console.warn("Can’t find expandable target with id “"+this.targetId+"”"),!1;this.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:""},i),this.expandedClasses=this.el.getAttribute("data-expands-class")||this.options.expandedClasses,this.expandedClasses.length&&(this.expandedClasses.indexOf(" ")>-1?this.expandedClasses=this.expandedClasses.split(" ").filter(function(t){return t.length}):this.expandedClasses=[this.expandedClasses]),this.shouldToggleHeight=this.el.hasAttribute("data-expands-height")||this.options.shouldToggleHeight,this.hasActiveText=!1,this.textEl=this.el.querySelector("[data-expands-text]"),this.textEl&&(this.defaultToggleText=this.textEl.textContent,this.activeToggleText=this.textEl.getAttribute("data-expands-text")||this.options.activeToggleText,this.hasActiveText=!!this.activeToggleText.length),this.init()}return r(t,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler)}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,a.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var i=this.targetParentEl.insertBefore(e,this.targetEl),n=Math.round(parseFloat(i.offsetHeight));this.targetParentEl.removeChild(i),this.targetEl.style.maxHeight=n+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1)}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0)}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler)}}]),t}();e.default=o}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["expand-toggleLink"]=e():t["expand-toggleLink"]=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=14)}([function(t,e,n){var i=n(1).Symbol;t.exports=i},function(t,e,n){var i=n(11),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(t,o),delete i[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})?i.call(e,n,e,t):i)||(t.exports=r)},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var i=n(0),r=Object.prototype,o=r.hasOwnProperty,a=r.toString,s=i?i.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var i=!0}catch(t){}var r=a.call(t);return i&&(e?t[s]=n:delete t[s]),r}},function(t,e,n){var i=n(0),r=n(6),o=n(5),a=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?r(t):o(t)}},function(t,e,n){var i=n(7),r=n(4);t.exports=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==i(t)}},function(t,e,n){var i=n(2),r=n(8),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||l.test(t)?u(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(10))},function(t,e,n){var i=n(1);t.exports=function(){return i.Date.now()}},function(t,e,n){var i=n(2),r=n(12),o=n(9),a=Math.max,s=Math.min;t.exports=function(t,e,n){var l,u,d,c,f,h,p=0,v=!1,g=!1,x=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=l,i=u;return l=u=void 0,p=e,c=t.apply(i,n)}function b(t){var n=t-h;return void 0===h||n>=e||n<0||g&&t-p>=d}function m(){var t=r();if(b(t))return E(t);f=setTimeout(m,function(t){var n=e-(t-h);return g?s(n,d-(t-p)):n}(t))}function E(t){return f=void 0,x&&l?y(t):(l=u=void 0,c)}function T(){var t=r(),n=b(t);if(l=arguments,u=this,h=t,n){if(void 0===f)return function(t){return p=t,f=setTimeout(m,e),v?y(t):c}(h);if(g)return f=setTimeout(m,e),y(h)}return void 0===f&&(f=setTimeout(m,e)),c}return e=o(e)||0,i(n)&&(v=!!n.leading,d=(g="maxWait"in n)?a(o(n.maxWait)||0,e):d,x="trailing"in n?!!n.trailing:x),T.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=h=u=f=void 0},T.flush=function(){return void 0===f?c:E(r())},T}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(13)),o=a(n(3));function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=l(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.el=t,i.targetId=i.el.getAttribute("data-expands"),i.targetEl=document.getElementById(i.targetId),i.targetEl?(i.options=Object.assign({},{expandedClasses:"",shouldToggleHeight:!1,activeToggleText:"",onReady:null},n),i.expandedClasses=i.el.getAttribute("data-expands-class")||i.options.expandedClasses,i.expandedClasses.length&&(i.expandedClasses.indexOf(" ")>-1?i.expandedClasses=i.expandedClasses.split(" ").filter(function(t){return t.length}):i.expandedClasses=[i.expandedClasses]),i.shouldToggleHeight=i.el.hasAttribute("data-expands-height")||i.options.shouldToggleHeight,i.hasActiveText=!1,i.textEl=i.el.querySelector("[data-expands-text]"),i.textEl&&(i.defaultToggleText=i.textEl.textContent,i.activeToggleText=i.textEl.getAttribute("data-expands-text")||i.options.activeToggleText,i.hasActiveText=!!i.activeToggleText.length),i.init(),i):(console.warn("Can’t find expandable target with id “"+i.targetId+"”"),l(i,!1))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),i(e,[{key:"init",value:function(){this.el.setAttribute("aria-haspopup",!0),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),"a"===this.el.tagName.toLowerCase()&&this.el.setAttribute("role","button"),this.shouldToggleHeight&&this.heightToggleSetup(),this.clickHandler=this.toggle.bind(this),this.el.addEventListener("click",this.clickHandler),this.keydownHandler=this.keyboardEvents.bind(this),this.el.addEventListener("keydown",this.keydownHandler),"function"==typeof this.options.onReady&&this.options.onReady()}},{key:"destroy",value:function(){var t,e;this.el.removeAttribute("aria-haspopup"),this.el.removeAttribute("aria-expanded"),this.targetEl.removeAttribute("aria-hidden"),this.targetEl.style.removeProperty("max-height"),"a"===this.el.tagName.toLowerCase()&&this.el.removeAttribute("role"),this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.removeEventListener("click",this.clickHandler),this.el.removeEventListener("keydown",this.keydownHandler),this.emitEvent("destroy")}},{key:"keyboardEvents",value:function(t){40==t.keyCode?this.expand():38!=t.keyCode&&27!=t.keyCode||this.collapse()}},{key:"heightToggleSetup",value:function(){var t=this;this.targetParentEl=this.targetEl.parentNode,this.updateExpandedHeight(),window.addEventListener("resize",(0,r.default)(function(e){t.updateExpandedHeight()},150))}},{key:"updateExpandedHeight",value:function(){var t=Math.round(parseFloat(this.targetEl.offsetWidth)),e=this.targetEl.cloneNode(!0);e.style.cssText="max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: "+t+"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important",e.setAttribute("aria-hidden",!1),e.removeAttribute("id");var n=this.targetParentEl.insertBefore(e,this.targetEl),i=Math.round(parseFloat(n.offsetHeight));this.targetParentEl.removeChild(n),this.targetEl.style.maxHeight=i+"px"}},{key:"expand",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.activeToggleText),this.expandedClasses.length&&((t=this.el.classList).add.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).add.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!0),this.targetEl.setAttribute("aria-hidden",!1),this.emitEvent("expand")}},{key:"collapse",value:function(){var t,e;this.hasActiveText&&(this.textEl.textContent=this.defaultToggleText),this.expandedClasses.length&&((t=this.el.classList).remove.apply(t,s(this.expandedClasses)),(e=this.targetEl.classList).remove.apply(e,s(this.expandedClasses))),this.el.setAttribute("aria-expanded",!1),this.targetEl.setAttribute("aria-hidden",!0),this.emitEvent("collapse")}},{key:"toggle",value:function(t){"true"===this.el.getAttribute("aria-expanded")?this.collapse():this.expand()}}]),e}();e.default=u}])});

@@ -82,6 +82,17 @@ define("expand-toggleLink", [], function() { return /******/ (function(modules) { // webpackBootstrap

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n */\nvar ExpandToggle = function () {\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var self = this;\n this.el = el;\n this.targetId = this.el.getAttribute(\"data-expands\");\n this.targetEl = document.getElementById(this.targetId);\n\n // Ensure target element exist before initializing\n if (!this.targetEl) {\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + this.targetId + \"\\u201D\");\n return false;\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\" // expanded state toggle button text\n }, opts);\n\n // Check for custom expanded class(es)\n this.expandedClasses = this.el.getAttribute(\"data-expands-class\") || this.options.expandedClasses;\n\n if (this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n this.expandedClasses = this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n this.expandedClasses = [this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n this.shouldToggleHeight = this.el.hasAttribute(\"data-expands-height\") || this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n this.hasActiveText = false;\n this.textEl = this.el.querySelector(\"[data-expands-text]\");\n\n if (this.textEl) {\n this.defaultToggleText = this.textEl.textContent;\n this.activeToggleText = this.textEl.getAttribute(\"data-expands-text\") || this.options.activeToggleText;\n this.hasActiveText = !!this.activeToggleText.length;\n }\n\n this.init();\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).add.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).add.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).remove.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).remove.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n\n // Remove attributes and event listeners\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n }\n }]);\n\n return ExpandToggle;\n}();\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _evEmitter = __webpack_require__(/*! ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\");\n\nvar _evEmitter2 = _interopRequireDefault(_evEmitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n * @param {function} [opts.onReady=\"\"] - Ready callback function\n */\nvar ExpandToggle = function (_EventEmitter) {\n _inherits(ExpandToggle, _EventEmitter);\n\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var _this = _possibleConstructorReturn(this, (ExpandToggle.__proto__ || Object.getPrototypeOf(ExpandToggle)).call(this));\n // Have to call super() first before referencing “this” since we’re extending EventEmitter\n // https://stackoverflow.com/a/43591507/673457\n\n\n _this.el = el;\n _this.targetId = _this.el.getAttribute(\"data-expands\");\n _this.targetEl = document.getElementById(_this.targetId);\n\n // Ensure target element exist before initializing\n if (!_this.targetEl) {\n var _ret;\n\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + _this.targetId + \"\\u201D\");\n return _ret = false, _possibleConstructorReturn(_this, _ret);\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n _this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\", // expanded state toggle button text\n onReady: null // ready callback function\n }, opts);\n\n // Check for custom expanded class(es)\n _this.expandedClasses = _this.el.getAttribute(\"data-expands-class\") || _this.options.expandedClasses;\n\n if (_this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (_this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n _this.expandedClasses = _this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n _this.expandedClasses = [_this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n _this.shouldToggleHeight = _this.el.hasAttribute(\"data-expands-height\") || _this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n _this.hasActiveText = false;\n _this.textEl = _this.el.querySelector(\"[data-expands-text]\");\n\n if (_this.textEl) {\n _this.defaultToggleText = _this.textEl.textContent;\n _this.activeToggleText = _this.textEl.getAttribute(\"data-expands-text\") || _this.options.activeToggleText;\n _this.hasActiveText = !!_this.activeToggleText.length;\n }\n\n _this.init();\n return _this;\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n\n // Check for onReady callback\n if (typeof this.options.onReady === \"function\") {\n this.options.onReady();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // Remove aria attributes\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n // Reset toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove custom classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).remove.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).remove.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Remove event listeners\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n\n this.emitEvent(\"destroy\");\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).add.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).add.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n\n this.emitEvent(\"expand\");\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n this.emitEvent(\"collapse\");\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n }]);\n\n return ExpandToggle;\n}(_evEmitter2.default);\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
/***/ }),
/***/ "./node_modules/ev-emitter/ev-emitter.js":
/*!***********************************************!*\
!*** ./node_modules/ev-emitter/ev-emitter.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( true ) {\n // AMD - RequireJS\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n\n\n//# sourceURL=webpack://%5Bname%5DLink/./node_modules/ev-emitter/ev-emitter.js?");
/***/ }),
/***/ "./node_modules/lodash/_Symbol.js":

@@ -88,0 +99,0 @@ /*!****************************************!*\

@@ -83,6 +83,17 @@ module.exports =

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n */\nvar ExpandToggle = function () {\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var self = this;\n this.el = el;\n this.targetId = this.el.getAttribute(\"data-expands\");\n this.targetEl = document.getElementById(this.targetId);\n\n // Ensure target element exist before initializing\n if (!this.targetEl) {\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + this.targetId + \"\\u201D\");\n return false;\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\" // expanded state toggle button text\n }, opts);\n\n // Check for custom expanded class(es)\n this.expandedClasses = this.el.getAttribute(\"data-expands-class\") || this.options.expandedClasses;\n\n if (this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n this.expandedClasses = this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n this.expandedClasses = [this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n this.shouldToggleHeight = this.el.hasAttribute(\"data-expands-height\") || this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n this.hasActiveText = false;\n this.textEl = this.el.querySelector(\"[data-expands-text]\");\n\n if (this.textEl) {\n this.defaultToggleText = this.textEl.textContent;\n this.activeToggleText = this.textEl.getAttribute(\"data-expands-text\") || this.options.activeToggleText;\n this.hasActiveText = !!this.activeToggleText.length;\n }\n\n this.init();\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).add.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).add.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).remove.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).remove.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n\n // Remove attributes and event listeners\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n }\n }]);\n\n return ExpandToggle;\n}();\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _evEmitter = __webpack_require__(/*! ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\");\n\nvar _evEmitter2 = _interopRequireDefault(_evEmitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n * @param {function} [opts.onReady=\"\"] - Ready callback function\n */\nvar ExpandToggle = function (_EventEmitter) {\n _inherits(ExpandToggle, _EventEmitter);\n\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var _this = _possibleConstructorReturn(this, (ExpandToggle.__proto__ || Object.getPrototypeOf(ExpandToggle)).call(this));\n // Have to call super() first before referencing “this” since we’re extending EventEmitter\n // https://stackoverflow.com/a/43591507/673457\n\n\n _this.el = el;\n _this.targetId = _this.el.getAttribute(\"data-expands\");\n _this.targetEl = document.getElementById(_this.targetId);\n\n // Ensure target element exist before initializing\n if (!_this.targetEl) {\n var _ret;\n\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + _this.targetId + \"\\u201D\");\n return _ret = false, _possibleConstructorReturn(_this, _ret);\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n _this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\", // expanded state toggle button text\n onReady: null // ready callback function\n }, opts);\n\n // Check for custom expanded class(es)\n _this.expandedClasses = _this.el.getAttribute(\"data-expands-class\") || _this.options.expandedClasses;\n\n if (_this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (_this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n _this.expandedClasses = _this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n _this.expandedClasses = [_this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n _this.shouldToggleHeight = _this.el.hasAttribute(\"data-expands-height\") || _this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n _this.hasActiveText = false;\n _this.textEl = _this.el.querySelector(\"[data-expands-text]\");\n\n if (_this.textEl) {\n _this.defaultToggleText = _this.textEl.textContent;\n _this.activeToggleText = _this.textEl.getAttribute(\"data-expands-text\") || _this.options.activeToggleText;\n _this.hasActiveText = !!_this.activeToggleText.length;\n }\n\n _this.init();\n return _this;\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n\n // Check for onReady callback\n if (typeof this.options.onReady === \"function\") {\n this.options.onReady();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // Remove aria attributes\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n // Reset toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove custom classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).remove.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).remove.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Remove event listeners\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n\n this.emitEvent(\"destroy\");\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).add.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).add.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n\n this.emitEvent(\"expand\");\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n this.emitEvent(\"collapse\");\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n }]);\n\n return ExpandToggle;\n}(_evEmitter2.default);\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
/***/ }),
/***/ "./node_modules/ev-emitter/ev-emitter.js":
/*!***********************************************!*\
!*** ./node_modules/ev-emitter/ev-emitter.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( true ) {\n // AMD - RequireJS\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n\n\n//# sourceURL=webpack://%5Bname%5DLink/./node_modules/ev-emitter/ev-emitter.js?");
/***/ }),
/***/ "./node_modules/lodash/_Symbol.js":

@@ -89,0 +100,0 @@ /*!****************************************!*\

@@ -92,6 +92,17 @@ (function webpackUniversalModuleDefinition(root, factory) {

"use strict";
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n */\nvar ExpandToggle = function () {\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var self = this;\n this.el = el;\n this.targetId = this.el.getAttribute(\"data-expands\");\n this.targetEl = document.getElementById(this.targetId);\n\n // Ensure target element exist before initializing\n if (!this.targetEl) {\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + this.targetId + \"\\u201D\");\n return false;\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\" // expanded state toggle button text\n }, opts);\n\n // Check for custom expanded class(es)\n this.expandedClasses = this.el.getAttribute(\"data-expands-class\") || this.options.expandedClasses;\n\n if (this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n this.expandedClasses = this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n this.expandedClasses = [this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n this.shouldToggleHeight = this.el.hasAttribute(\"data-expands-height\") || this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n this.hasActiveText = false;\n this.textEl = this.el.querySelector(\"[data-expands-text]\");\n\n if (this.textEl) {\n this.defaultToggleText = this.textEl.textContent;\n this.activeToggleText = this.textEl.getAttribute(\"data-expands-text\") || this.options.activeToggleText;\n this.hasActiveText = !!this.activeToggleText.length;\n }\n\n this.init();\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).add.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).add.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).remove.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).remove.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n\n // Remove attributes and event listeners\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n }\n }]);\n\n return ExpandToggle;\n}();\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _debounce = __webpack_require__(/*! lodash/debounce */ \"./node_modules/lodash/debounce.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _evEmitter = __webpack_require__(/*! ev-emitter */ \"./node_modules/ev-emitter/ev-emitter.js\");\n\nvar _evEmitter2 = _interopRequireDefault(_evEmitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Wrap the last X words in an HTML tag to prevent them from wrapping (i.e. orphans)\n * @param {HTMLElement} el - Toggle button DOM node\n * @param {Object} opts - Options\n * @param {string} [opts.expandedClasses=\"\"] - Class(es) to apply when expanded\n * @param {boolean} [opts.shouldToggleHeight=false] - Whether or not to animate height\n * @param {string} [opts.defaultToggleText=\"\"] - Expanded state toggle button text\n * @param {function} [opts.onReady=\"\"] - Ready callback function\n */\nvar ExpandToggle = function (_EventEmitter) {\n _inherits(ExpandToggle, _EventEmitter);\n\n function ExpandToggle(el, opts) {\n _classCallCheck(this, ExpandToggle);\n\n var _this = _possibleConstructorReturn(this, (ExpandToggle.__proto__ || Object.getPrototypeOf(ExpandToggle)).call(this));\n // Have to call super() first before referencing “this” since we’re extending EventEmitter\n // https://stackoverflow.com/a/43591507/673457\n\n\n _this.el = el;\n _this.targetId = _this.el.getAttribute(\"data-expands\");\n _this.targetEl = document.getElementById(_this.targetId);\n\n // Ensure target element exist before initializing\n if (!_this.targetEl) {\n var _ret;\n\n console.warn(\"Can\\u2019t find expandable target with id \\u201C\" + _this.targetId + \"\\u201D\");\n return _ret = false, _possibleConstructorReturn(_this, _ret);\n }\n\n // Use Object.assign() to merge “opts” object with default values in this.options\n _this.options = Object.assign({}, {\n expandedClasses: \"\", // string, accepts multiple space-separated classes\n shouldToggleHeight: false, // should target element’s height be animated using max-height\n activeToggleText: \"\", // expanded state toggle button text\n onReady: null // ready callback function\n }, opts);\n\n // Check for custom expanded class(es)\n _this.expandedClasses = _this.el.getAttribute(\"data-expands-class\") || _this.options.expandedClasses;\n\n if (_this.expandedClasses.length) {\n // Check if active class string contains multiple classes\n if (_this.expandedClasses.indexOf(\" \") > -1) {\n // Convert to array and remove any empty string values\n // caused by having multiple spaces in a row.\n _this.expandedClasses = _this.expandedClasses.split(\" \").filter(function (n) {\n return n.length;\n });\n } else {\n // We still need to convert a single active class to an array\n // so we can use the spread syntax later in classList.add()\n _this.expandedClasses = [_this.expandedClasses];\n }\n }\n\n // Check if height should be animated\n _this.shouldToggleHeight = _this.el.hasAttribute(\"data-expands-height\") || _this.options.shouldToggleHeight;\n\n // Check for custom toggle button text to use when expanded\n _this.hasActiveText = false;\n _this.textEl = _this.el.querySelector(\"[data-expands-text]\");\n\n if (_this.textEl) {\n _this.defaultToggleText = _this.textEl.textContent;\n _this.activeToggleText = _this.textEl.getAttribute(\"data-expands-text\") || _this.options.activeToggleText;\n _this.hasActiveText = !!_this.activeToggleText.length;\n }\n\n _this.init();\n return _this;\n }\n\n _createClass(ExpandToggle, [{\n key: \"init\",\n value: function init() {\n // Accessibility setup\n this.el.setAttribute(\"aria-haspopup\", true);\n this.el.setAttribute(\"aria-expanded\", false);\n // Omit “aria-controls” for now\n // See https://inclusive-components.design/menus-menu-buttons/#ariacontrols\n // this.el.setAttribute(\"aria-controls\", this.targetId);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.setAttribute(\"role\", \"button\");\n }\n\n if (this.shouldToggleHeight) {\n this.heightToggleSetup();\n }\n\n // Click event listener on toggle button\n // Note: Callback needs to be assigned to a var so we can remove it since we’re using bind()\n // https://stackoverflow.com/a/22870717/673457\n this.clickHandler = this.toggle.bind(this);\n this.el.addEventListener(\"click\", this.clickHandler);\n\n // Keyboard listeners on toggle button\n this.keydownHandler = this.keyboardEvents.bind(this);\n this.el.addEventListener(\"keydown\", this.keydownHandler);\n\n // Check for onReady callback\n if (typeof this.options.onReady === \"function\") {\n this.options.onReady();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // Remove aria attributes\n this.el.removeAttribute(\"aria-haspopup\");\n this.el.removeAttribute(\"aria-expanded\");\n this.targetEl.removeAttribute(\"aria-hidden\");\n this.targetEl.style.removeProperty(\"max-height\");\n\n if (this.el.tagName.toLowerCase() === \"a\") {\n this.el.removeAttribute(\"role\");\n }\n\n // Reset toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove custom classes\n if (this.expandedClasses.length) {\n var _el$classList, _targetEl$classList;\n\n (_el$classList = this.el.classList).remove.apply(_el$classList, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList = this.targetEl.classList).remove.apply(_targetEl$classList, _toConsumableArray(this.expandedClasses));\n }\n\n // Remove event listeners\n this.el.removeEventListener(\"click\", this.clickHandler);\n this.el.removeEventListener(\"keydown\", this.keydownHandler);\n\n this.emitEvent(\"destroy\");\n }\n }, {\n key: \"keyboardEvents\",\n value: function keyboardEvents(evt) {\n // Expand with down arrow\n if (evt.keyCode == 40) {\n this.expand();\n } else if (evt.keyCode == 38 || evt.keyCode == 27) {\n // Close with up arrow or escape key\n this.collapse();\n }\n }\n }, {\n key: \"heightToggleSetup\",\n value: function heightToggleSetup() {\n var self = this;\n this.targetParentEl = this.targetEl.parentNode;\n\n // Set max-height to the expanded height so we can animate it.\n this.updateExpandedHeight();\n\n // Update target element’s max-height on resize\n window.addEventListener(\"resize\", (0, _debounce2.default)(function (event) {\n self.updateExpandedHeight();\n }, 150));\n }\n\n // Set max-height of target element to its expanded height without triggering relayout.\n //\n // This technique works by creating an absolutely-positioned invisible clone of the target\n // element and calculating its height. This avoids any relayout that would otherwise occur\n // if the element was briefly expanded so we could measure it.\n //\n // Note: We’re using CSS to transition max-height instead jQuery’s slideToggle(),\n // or another 3rd-party lib like Velocity.js, to avoid loading a large lib.\n\n }, {\n key: \"updateExpandedHeight\",\n value: function updateExpandedHeight() {\n // Get width of original element so we can apply it to the clone\n var nodeWidth = Math.round(parseFloat(this.targetEl.offsetWidth));\n\n // Create clone of node\n var cloneEl = this.targetEl.cloneNode(true); // 'true' includes child nodes\n\n // Inline styles added to prevent reflow, ensure clone is same size as expanded element\n cloneEl.style.cssText = \"max-height: none !important; position: absolute !important; right: 100% !important; visibility: hidden !important; width: \" + nodeWidth + \"px !important; -webkit-transition: none !important; -moz-transition: none !important; transition: none !important\";\n\n // Update “aria-hidden” attribute\n cloneEl.setAttribute(\"aria-hidden\", false);\n\n // Remove id just to be safe\n cloneEl.removeAttribute(\"id\");\n\n // Append clone to document, save as new var so we can remove it later\n var newEl = this.targetParentEl.insertBefore(cloneEl, this.targetEl);\n\n // Calculate height\n var expandedHeight = Math.round(parseFloat(newEl.offsetHeight));\n\n // Remove cloned node to clean up after ourselves\n this.targetParentEl.removeChild(newEl);\n\n // Apply inline max-height to collapsed element\n // Note: CSS is overriding this when aria-hidden=\"true\"\n this.targetEl.style.maxHeight = expandedHeight + \"px\";\n }\n }, {\n key: \"expand\",\n value: function expand() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.activeToggleText;\n }\n\n // Add classes\n if (this.expandedClasses.length) {\n var _el$classList2, _targetEl$classList2;\n\n (_el$classList2 = this.el.classList).add.apply(_el$classList2, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList2 = this.targetEl.classList).add.apply(_targetEl$classList2, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", true);\n this.targetEl.setAttribute(\"aria-hidden\", false);\n\n this.emitEvent(\"expand\");\n }\n }, {\n key: \"collapse\",\n value: function collapse() {\n // Update toggle text\n if (this.hasActiveText) {\n this.textEl.textContent = this.defaultToggleText;\n }\n\n // Remove classes\n if (this.expandedClasses.length) {\n var _el$classList3, _targetEl$classList3;\n\n (_el$classList3 = this.el.classList).remove.apply(_el$classList3, _toConsumableArray(this.expandedClasses));\n (_targetEl$classList3 = this.targetEl.classList).remove.apply(_targetEl$classList3, _toConsumableArray(this.expandedClasses));\n }\n\n // Update aria attributes\n this.el.setAttribute(\"aria-expanded\", false);\n this.targetEl.setAttribute(\"aria-hidden\", true);\n\n this.emitEvent(\"collapse\");\n }\n }, {\n key: \"toggle\",\n value: function toggle(evt) {\n if (this.el.getAttribute(\"aria-expanded\") === \"true\") {\n this.collapse();\n } else {\n this.expand();\n }\n }\n }]);\n\n return ExpandToggle;\n}(_evEmitter2.default);\n\nexports.default = ExpandToggle;\n\n//# sourceURL=webpack://%5Bname%5DLink/./index.js?");
/***/ }),
/***/ "./node_modules/ev-emitter/ev-emitter.js":
/*!***********************************************!*\
!*** ./node_modules/ev-emitter/ev-emitter.js ***!
\***********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**\n * EvEmitter v1.1.0\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( true ) {\n // AMD - RequireJS\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\"use strict\";\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n // copy over to avoid interference if .off() in listener\n listeners = listeners.slice(0);\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n for ( var i=0; i < listeners.length; i++ ) {\n var listener = listeners[i]\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n }\n\n return this;\n};\n\nproto.allOff = function() {\n delete this._events;\n delete this._onceEvents;\n};\n\nreturn EvEmitter;\n\n}));\n\n\n//# sourceURL=webpack://%5Bname%5DLink/./node_modules/ev-emitter/ev-emitter.js?");
/***/ }),
/***/ "./node_modules/lodash/_Symbol.js":

@@ -98,0 +109,0 @@ /*!****************************************!*\

"use strict";
import debounce from "lodash/debounce";
import EventEmitter from "ev-emitter";

@@ -12,6 +13,10 @@ /**

* @param {string} [opts.defaultToggleText=""] - Expanded state toggle button text
* @param {function} [opts.onReady=""] - Ready callback function
*/
export default class ExpandToggle {
export default class ExpandToggle extends EventEmitter {
constructor(el, opts) {
var self = this;
// Have to call super() first before referencing “this” since we’re extending EventEmitter
// https://stackoverflow.com/a/43591507/673457
super();
this.el = el;

@@ -33,3 +38,4 @@ this.targetId = this.el.getAttribute("data-expands");

shouldToggleHeight: false, // should target element’s height be animated using max-height
activeToggleText: "" // expanded state toggle button text
activeToggleText: "", // expanded state toggle button text
onReady: null // ready callback function
},

@@ -105,4 +111,38 @@ opts

this.el.addEventListener("keydown", this.keydownHandler);
// Check for onReady callback
if (typeof this.options.onReady === "function") {
this.options.onReady();
}
}
destroy() {
// Remove aria attributes
this.el.removeAttribute("aria-haspopup");
this.el.removeAttribute("aria-expanded");
this.targetEl.removeAttribute("aria-hidden");
this.targetEl.style.removeProperty("max-height");
if (this.el.tagName.toLowerCase() === "a") {
this.el.removeAttribute("role");
}
// Reset toggle text
if (this.hasActiveText) {
this.textEl.textContent = this.defaultToggleText;
}
// Remove custom classes
if (this.expandedClasses.length) {
this.el.classList.remove(...this.expandedClasses);
this.targetEl.classList.remove(...this.expandedClasses);
}
// Remove event listeners
this.el.removeEventListener("click", this.clickHandler);
this.el.removeEventListener("keydown", this.keydownHandler);
this.emitEvent("destroy");
}
keyboardEvents(evt) {

@@ -190,2 +230,4 @@ // Expand with down arrow

this.targetEl.setAttribute("aria-hidden", false);
this.emitEvent("expand");
}

@@ -208,2 +250,4 @@

this.targetEl.setAttribute("aria-hidden", true);
this.emitEvent("collapse");
}

@@ -218,26 +262,2 @@

}
// Remove attributes and event listeners
destroy() {
this.el.removeAttribute("aria-haspopup");
this.el.removeAttribute("aria-expanded");
this.targetEl.removeAttribute("aria-hidden");
this.targetEl.style.removeProperty("max-height");
if (this.el.tagName.toLowerCase() === "a") {
this.el.removeAttribute("role");
}
if (this.hasActiveText) {
this.textEl.textContent = this.defaultToggleText;
}
if (this.expandedClasses.length) {
this.el.classList.remove(...this.expandedClasses);
this.targetEl.classList.remove(...this.expandedClasses);
}
this.el.removeEventListener("click", this.clickHandler);
this.el.removeEventListener("keydown", this.keydownHandler);
}
}
{
"name": "@threespot/expand-toggle",
"version": "1.2.1",
"version": "1.3.0",
"description": "Simple and accessible expandable functionality, similar to jQuery’s `slideToggle()` method.",
"main": "index.js",
"main": "dist/expand-toggle.m.js",
"homepage": "https://threespot.github.io/expand-toggle/",

@@ -73,2 +73,3 @@ "author": "Threespot <hello@threespot.com>",

"dependencies": {
"ev-emitter": "1.x",
"lodash": "4.x"

@@ -75,0 +76,0 @@ },

@@ -229,3 +229,3 @@ import ExpandToggle from "../index";

test('Destroy button test', () => {
test('Destroy button with events test', () => {
document.body.innerHTML = `

@@ -246,2 +246,9 @@ <div>

var eventLog = {
ready: 0,
expand: 0,
collapse: 0,
destroy: 0
};
var menu = new ExpandToggle(toggle, {

@@ -251,7 +258,26 @@ expandedClasses: "is-expanded",

activeToggleText: "Close",
onReady: function() {
eventLog.ready++;
}
});
menu.on('expand', function() {
eventLog.expand++;
});
menu.on('collapse', function() {
eventLog.collapse++;
});
menu.on('destroy', function() {
eventLog.destroy++;
});
// Expand
toggle.click();
// Collapse
toggle.click();
// Destroy
menu.destroy();

@@ -281,2 +307,8 @@

</div>`));
// Test that events fired
expect(eventLog.ready).toBe(1);
expect(eventLog.expand).toBe(1);
expect(eventLog.collapse).toBe(1);
expect(eventLog.destroy).toBe(1);
});

@@ -283,0 +315,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc