{"version":3,"sources":["webpack:///./src/js/modules/accordion-item.js"],"names":["Module","Component","setupDefaults","this","dom","$toggleButton","el","querySelector","$description","$minus","$plus","$faq","$headingContainer","hideClass","addListeners","addEventListener","handleClick","bind","classList","contains","setAttribute","toggle"],"mappings":"2FAAA,kBAEA,MAAMA,UAAeC,YACnBC,gBACEC,KAAKC,IAAM,CACTC,cAAeF,KAAKG,GAAGC,cAAc,2BACrCC,aAAcL,KAAKG,GAAGC,cAAc,gCACpCE,OAAQN,KAAKG,GAAGC,cAAc,iCAC9BG,MAAOP,KAAKG,GAAGC,cAAc,gCAC7BI,KAAMR,KAAKG,GAAGC,cAAc,wBAC5BK,kBAAmBT,KAAKG,GAAGC,cAAc,uCAEvCJ,KAAKC,IAAIO,KACXR,KAAKU,UAAY,wCAEjBV,KAAKU,UAAY,oCAIrBC,eACEX,KAAKC,IAAIQ,kBAAkBG,iBAAiB,QAASZ,KAAKa,YAAYC,KAAKd,OAG7Ea,cACOb,KAAKC,IAAII,aAAaU,UAAUC,SAAShB,KAAKU,WAGjDV,KAAKC,IAAIC,cAAce,aAAa,iBAAiB,GAFrDjB,KAAKC,IAAIC,cAAce,aAAa,iBAAiB,GAIvDjB,KAAKC,IAAII,aAAaU,UAAUG,OAAOlB,KAAKU,YAIjCb","file":"85.bundle.js","sourcesContent":["import { Component } from '@verndale/core'\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n $toggleButton: this.el.querySelector('.accordion-item__button'),\n $description: this.el.querySelector('.accordion-item__description'),\n $minus: this.el.querySelector('.accordion-item__button-minus'),\n $plus: this.el.querySelector('.accordion-item__button-plus'),\n $faq: this.el.querySelector('.accordion-item__faq'),\n $headingContainer: this.el.querySelector('.accordion-item__heading-container')\n }\n if (this.dom.$faq) {\n this.hideClass = 'accordion-item__description--hide-faq'\n } else {\n this.hideClass = 'accordion-item__description--hide'\n }\n }\n\n addListeners() {\n this.dom.$headingContainer.addEventListener('click', this.handleClick.bind(this))\n }\n\n handleClick() {\n if (!this.dom.$description.classList.contains(this.hideClass)) {\n this.dom.$toggleButton.setAttribute('aria-expanded', false)\n } else {\n this.dom.$toggleButton.setAttribute('aria-expanded', true)\n }\n this.dom.$description.classList.toggle(this.hideClass)\n }\n}\n\nexport default Module\n"],"sourceRoot":""}