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AAGhC;IACJ,CAAC;IACD,IAAI,CAACD,IAAI,CAACO,SAAS,CAACM,GAAG,CAAE,IAAI,CAACZ,IAAI,CAAC+B,gBAAiB,CAAC;IACrD,IAAI,CAACC,MAAM,GAAGC,KAAK,CAACC,IAAI,CAAE,IAAI,CAACnC,IAAI,CAACoC,gBAAgB,CAAE,IAAI,CAACnC,IAAI,CAACgC,MAAO,CAAE,CAAC,CAACI,GAAG,CAAIrC,IAAI,IAAM,IAAIF,KAAK,CAAEE,IAAI,EAAE,IAAI,CAACC,IAAK,CAAE,CAAC;EAC3H;AACD;AAEA8B,MAAM,CAACO,SAAS,GAAGJ,KAAK,CAACC,IAAI,CAAEI,QAAQ,CAACH,gBAAgB,CAAE,SAAU,CAAE,CAAC,CAACC,GAAG,CAAIrC,IAAI,IAAM,IAAI+B,MAAM,CAAE/B,IAAK,CAAE,CAAC;;AAE7G;AACAuC,QAAQ,CAACC,IAAI,CAAC9B,gBAAgB,CAAE,mBAAmB,EAAE,MAAM;EAC1D6B,QAAQ,CAACH,gBAAgB,CAAE,kCAAmC,CAAC,CAACK,OAAO,CAAIzC,IAAI,IAAM;IACpF+B,MAAM,CAACO,SAAS,CAACI,IAAI,CAAE,IAAIX,MAAM,CAAE/B,IAAK,CAAE,CAAC;EAC5C,CAAE,CAAC;AACJ,CAAE,CAAC,C","sources":["webpack://wdg/webpack/bootstrap","webpack://wdg/webpack/runtime/define property getters","webpack://wdg/webpack/runtime/hasOwnProperty shorthand","webpack://wdg/webpack/runtime/make namespace object","webpack://wdg/./block-editor/blocks/panels/view-script.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// 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};","export class Panel {\n\tconstructor( node, opts ) {\n\t\tthis.node = node;\n\t\tthis.opts = {\n\t\t\ttitle: '.panels__title',\n\t\t\ttoggle: '.panels__toggle',\n\t\t\tcontent: '.panels__content',\n\t\t\topenedClass: 'panels__panel--opened',\n\t\t\t...opts,\n\t\t};\n\t\tthis.opened = this.node.classList.contains( this.opts.openedClass );\n\t\tthis.title = this.node.querySelector( this.opts.title );\n\t\tthis.toggle = this.node.querySelector( this.opts.toggle );\n\t\tthis.content = this.node.querySelector( this.opts.content );\n\n\t\tif ( this.toggle ) {\n\t\t\tthis.toggle.addEventListener( 'click', () => this.togglePanel() );\n\t\t}\n\t}\n\n\topen() {\n\t\tthis.node.classList.add( this.opts.openedClass );\n\t\tthis.toggle.setAttribute( 'aria-expanded', 'true' );\n\n\t\tthis.content.style.display = 'block';\n\n\t\tlet height = this.content.offsetHeight;\n\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.45, 0, 0.55, 1), 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\tthis.node.classList.remove( this.opts.openedClass );\n\t\tthis.toggle.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.45, 0, 0.55, 1), 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\ttogglePanel() {\n\t\treturn this.opened ? this.close() : this.open();\n\t}\n}\n\nexport class Panels {\n\tconstructor( node, opts ) {\n\t\tthis.node = node;\n\t\tthis.opts = {\n\t\t\tinteractiveClass: 'panels--interactive',\n\t\t\tpanels: '.panels__panel',\n\t\t\t...opts,\n\t\t};\n\t\tthis.node.classList.add( this.opts.interactiveClass );\n\t\tthis.panels = Array.from( this.node.querySelectorAll( this.opts.panels ) ).map( ( node ) => new Panel( node, this.opts ) );\n\t}\n}\n\nPanels.instances = Array.from( document.querySelectorAll( '.panels' ) ).map( ( node ) => new Panels( node ) );\n\n// re initialize ajax loaded panels\ndocument.body.addEventListener( 'wdg:fetch:refresh', () => {\n\tdocument.querySelectorAll( '.panels:not(.panels--interactive' ).forEach( ( node ) => {\n\t\tPanels.instances.push( new Panels( node ) );\n\t} );\n} );\n"],"names":["Panel","constructor","node","opts","title","toggle","content","openedClass","opened","classList","contains","querySelector","addEventListener","togglePanel","open","add","setAttribute","style","display","height","offsetHeight","overflow","transitionend","e","removeAttribute","removeEventListener","transitionProperty","transitionDuration","transitionTimingFunction","requestAnimationFrame","opacity","close","remove","Panels","interactiveClass","panels","Array","from","querySelectorAll","map","instances","document","body","forEach","push"],"sourceRoot":""}