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C,SAAS,CAACU,QAAQ,CAAC,QAAQ,CAAC,EAAC;UACzEF,CAAC,CAACG,cAAc,EAAE;UAClBH,CAAC,CAACI,eAAe,EAAE;QACrB,CAAC,MAAM;UACLjB,WAAW,CAACC,GAAG,CAAC;QAClB;MACF,CAAC,CAAC;IACJ,CAAC,CAAC;EAIJ;EAIA,MAAMiB,UAAU,GAAGC,QAAQ,CAACrB,gBAAgB,CAAC,oBAAoB,CAAC;EAClE,IAAGoB,UAAU,CAACE,MAAM,GAAG,CAAC,EAAC;IACvBF,UAAU,CAAChB,OAAO,CAACmB,IAAI,IAAI;MACzB1B,gBAAgB,CAAC0B,IAAI,CAAC;IACxB,CAAC,CAAC;EACJ;AACF,CAAC,CAAC,C","sources":["webpack://wp-scripts-starter-theme/./blocks/accordion/index.scss?73c1","webpack://wp-scripts-starter-theme/webpack/bootstrap","webpack://wp-scripts-starter-theme/webpack/runtime/make namespace object","webpack://wp-scripts-starter-theme/./blocks/accordion/index.js"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import './index.scss';\n\n\n\nwindow.addEventListener(\"DOMContentLoaded\", function(){\n\n function slantedAccordion(accordionBlock){\n\n const buttons = accordionBlock.querySelectorAll('button')\n const sections = accordionBlock.querySelectorAll('.slanted-content')\n \n const handleClick = (btn) => {\n buttons.forEach(button => {\n button.closest('.slanted-button').classList.remove('active')\n })\n btn.closest('.slanted-button').classList.add('active')\n\n\n const currentSection = accordionBlock.querySelector('.slanted-content.active')\n const targetSection = accordionBlock.querySelector(`#${btn.dataset.target}`)\n \n targetSection.classList.add('active')\n currentSection.classList.remove('active')\n\n }\n \n buttons.forEach(btn => {\n btn.addEventListener(\"click\", (e) => {\n if(e.currentTarget.closest('.slanted-button').classList.contains('active')){\n e.preventDefault()\n e.stopPropagation()\n } else {\n handleClick(btn)\n }\n })\n })\n\n\n\n }\n \n \n \n const accordions = document.querySelectorAll('.slanted-accordion')\n if(accordions.length > 0){\n accordions.forEach(elem => {\n slantedAccordion(elem)\n })\n }\n})"],"names":["window","addEventListener","slantedAccordion","accordionBlock","buttons","querySelectorAll","sections","handleClick","btn","forEach","button","closest","classList","remove","add","currentSection","querySelector","targetSection","dataset","target","e","currentTarget","contains","preventDefault","stopPropagation","accordions","document","length","elem"],"sourceRoot":""}