{"version":3,"file":"script.min.js","sources":["../../../../block-editor/blocks/panels/panels.js","../../../../block-editor/blocks/panels/script.js"],"sourcesContent":["import panelIcon from '../../../assets/svg/double-chevron.svg';\nconst plusIcon = false; // Set to false to use panel icon\nconst titleIcon = plusIcon ? '' : panelIcon;\nconst titleIconClass = plusIcon ? 'panels__plus-icon' : '';\n\nclass Panel {\n\tconstructor(node) {\n\t\tthis.node = node;\n\t\tthis.openedClass = 'panels__panel--opened';\n\t\tthis.opened = this.node.classList.contains(this.openedClass);\n\t\tthis.title = this.node.querySelector('.panels__title');\n\t\tthis.content = this.node.querySelector('.panels__content');\n\n\t\tif (this.title) {\n\t\t\tthis.title.insertAdjacentHTML('beforeend', `${ titleIcon }`);\n\t\t\tthis.title.addEventListener('click', () => this.toggle());\n\t\t}\n\t}\n\n\topen () {\n\t\tthis.node.classList.add(this.openedClass);\n\t\tthis.title.setAttribute('aria-expanded', 'true');\n\n\t\tthis.content.style.display = 'block';\n\t\tthis.content.style.position = 'absolute';\n\n\t\tlet height = this.content.offsetHeight;\n\n\t\tthis.content.style.position = '';\n\t\tthis.content.style.height = '0px';\n\t\tthis.content.style.overflow = 'hidden';\n\n\t\tlet transitionend = (e) => {\n\t\t\tthis.content.removeAttribute('style');\n\t\t\tthis.opened = true;\n\t\t\tthis.content.removeEventListener('transitionend', transitionend);\n\t\t}\n\n\t\tthis.content.addEventListener('transitionend', transitionend);\n\n\t\tthis.content.style.transitionProperty = 'height, opacity';\n\t\tthis.content.style.transitionDuration = '300ms';\n\t\tthis.content.style.transitionTimingFunction = 'cubic-bezier(0.68, -0.55, 0.265, 1.55), linear';\n\n\t\trequestAnimationFrame(() => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tthis.content.style.height = `${ height }px`;\n\t\t\t\tthis.content.style.opacity = 1;\n\t\t\t})\n\t\t});\n\t}\n\n\tclose () {\n\t\t// console.log('close');\n\t\tthis.node.classList.remove(this.openedClass);\n\t\tthis.title.setAttribute('aria-expanded', 'false');\n\t\tthis.content.style.display = 'block';\n\t\tthis.content.style.overflow = 'hidden';\n\t\tthis.content.style.height = `${ this.content.offsetHeight }px`;\n\t\tthis.content.style.transitionProperty = 'height, opacity';\n\t\tthis.content.style.transitionDuration = '300ms';\n\t\tthis.content.style.transitionTimingFunction = 'cubic-bezier(0.68, -0.55, 0.265, 1.55), linear';\n\n\t\tlet transitionend = (e) => {\n\t\t\tthis.content.removeAttribute('style');\n\t\t\tthis.opened = false;\n\t\t\tthis.content.removeEventListener('transitionend', transitionend);\n\t\t}\n\n\t\tthis.content.addEventListener('transitionend', transitionend);\n\n\t\trequestAnimationFrame(() => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tthis.content.style.height = '0';\n\t\t\t\tthis.content.style.opacity = 0;\n\t\t\t})\n\t\t});\n\t}\n\n\ttoggle () {\n\n\t\treturn this.opened ? this.close() : this.open();\n\t}\n}\n\nexport class Panels {\n\tconstructor(node) {\n\t\tthis.node = node;\n\t\tthis.node.classList.add('panels--interactive');\n\t\tthis.panels = Array.from(this.node.querySelectorAll('.panels__panel')).map(node => new Panel(node));\n\t}\n}\n\n","import { Panels } from './panels.js';\n\nexport default Array.from(document.querySelectorAll('.panels')).map(p => new Panels(p));\n\ndocument.addEventListener('facet:refresh', () => {\n\tArray.from(document.querySelectorAll('.panels')).filter(p => !p.dataset.panelsInit).map(p => new Panels(p));\n});\n"],"names":["Panel","constructor","node","this","openedClass","opened","classList","contains","title","querySelector","content","insertAdjacentHTML","addEventListener","toggle","open","add","setAttribute","style","display","position","height","offsetHeight","overflow","transitionend","e","removeAttribute","removeEventListener","transitionProperty","transitionDuration","transitionTimingFunction","requestAnimationFrame","opacity","close","remove","Panels","panels","Array","from","querySelectorAll","map","document","p","filter","dataset","panelsInit"],"mappings":"8DAKA,MAAMA,EACLC,WAAAA,CAAYC,GACXC,KAAKD,KAAOA,EACZC,KAAKC,YAAc,wBACnBD,KAAKE,OAASF,KAAKD,KAAKI,UAAUC,SAASJ,KAAKC,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