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nB,IAAIC,EACAD,IAAQS,IACRT,EAAIF,UAAUC,OAAO,YACiC,QAArDE,EAAKD,EAAIE,cAAc,gCAA6C,IAAPD,GAAyBA,EAAGvD,aAAa,gBAAiB,SAC5H,IAEJF,KAAK+C,qBAAqBhC,SAAS4C,IAC3BA,EAAUD,cAAc,wBAA0BO,GAClDN,EAAUL,UAAUa,IAAI,WACxBR,EAAUL,UAAUC,OAAO,YAG3BI,EAAUL,UAAUC,OAAO,WAC3BI,EAAUL,UAAUa,IAAI,UAC5B,IAEAF,EAAqBX,UAAUS,SAAS,aACxCE,EAAqBX,UAAUC,OAAO,YACiC,QAAtEE,EAAKQ,EAAqBP,cAAc,gCAA6C,IAAPD,GAAyBA,EAAGvD,aAAa,gBAAiB,SACzIgD,EAAWI,UAAUC,OAAO,qBAG5BL,EAAWI,UAAUa,IAAI,mBACzBF,EAAqBX,UAAUa,IAAI,YACoC,QAAtEN,EAAKI,EAAqBP,cAAc,gCAA6C,IAAPG,GAAyBA,EAAG3D,aAAa,gBAAiB,QAEjJ,E","sources":["webpack:///./assets/common/src/scripts/base/baseComponent.ts","webpack:///./assets/common/src/scripts/components/collectionInPageNavigationComponent.ts"],"sourcesContent":["import Bean from 'bean';\nimport deepFreeze from '../utilities/freeze';\nimport CommonInterface from './commonInterface';\nexport default class BaseComponent extends CommonInterface {\n /**\n *\n * constructor\n *\n * @param {Element} element\n */\n constructor(element) {\n super();\n this._componentElement = element;\n this._componentElement.setAttribute('data-component-init', 'true');\n this._checkMessages();\n }\n /**\n * @returns {HTMLElement}\n */\n get $el() {\n return this._componentElement;\n }\n get $options() {\n const compOptions = {};\n const options = Object.assign({}, this.$el.dataset);\n const optionsEntires = Object.keys(options).filter((entry) => entry.includes('option'));\n optionsEntires.forEach((entry) => {\n const cleanEntry = BaseComponent.cleanOptionKey(entry);\n let optionValue;\n if (options[entry].includes('{') && options[entry].includes('}')) {\n optionValue = JSON.parse(options[entry].replace(/'/g, '\"'));\n }\n else {\n optionValue = BaseComponent.convertType(options[entry]);\n }\n compOptions[cleanEntry] = optionValue;\n });\n return deepFreeze(compOptions);\n }\n get COMPONENT_NAME() {\n return this.__proto__.constructor.name;\n }\n static convertType(option) {\n let optionReturn;\n switch (option) {\n case 'false':\n optionReturn = false;\n break;\n case 'true':\n optionReturn = true;\n break;\n case 'null':\n optionReturn = null;\n break;\n default:\n optionReturn = option;\n break;\n }\n return optionReturn;\n }\n static cleanOptionKey(key) {\n const str = key.replace('option', '');\n return `${str.charAt(0).toLocaleLowerCase()}${str.slice(1)}`;\n }\n /**\n *\n * $on\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this.$el]\n * @param {Array|String|Element} [elements = null]\n */\n $on(events, cb, element = this.$el, elements = null) {\n if (!element || !events || !cb)\n return;\n if (!elements) {\n Bean.on(element, events, (e) => {\n if (e)\n e.stopPropagation();\n cb(e);\n });\n }\n else {\n Bean.on(element, events, elements, (e) => {\n if (e)\n e.stopPropagation();\n cb(e);\n });\n }\n }\n /**\n *\n * $one\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this.$el]\n */\n $one(events, cb, element = this.$el) {\n Bean.one(element, events, cb);\n }\n /**\n *\n * $off\n *\n * @param {String} events\n * @param {Element} [element = this.$el]\n */\n $off(events, element = this.$el) {\n Bean.off(element, events);\n }\n /**\n *\n * $fire\n *\n * @param {String} events\n * @param {Element} [element = this.$el]\n */\n $fire(events, element = this.$el) {\n Bean.fire(element, events);\n }\n}\n","import BaseComponent from '../base/baseComponent';\nexport default class collectionIntroTabs extends BaseComponent {\n constructor(element) {\n super(element);\n this.isDesktop = window.isDesktop();\n this.initComponent();\n this.collectionComponents = this.$el.querySelectorAll('.inpage-collection-component');\n }\n initComponent() {\n // const $toggleCollections = this.$el.querySelectorAll('.inpage-collection__toggle-icon');\n const $collectionBoxes = this.$el.querySelectorAll('.inpage-collection');\n const $container = this.$el;\n if (window.innerWidth >= 1200) {\n $collectionBoxes.forEach((el) => {\n this.$on('mouseenter', (e) => this.toggleCollection(e, el), el);\n this.$on('mouseleave', (e) => {\n // if (e.currentTarget !== e.target) return;\n // if (e.target.closest('.inpage-collection')) return;\n $container.classList.remove('collection-open');\n $collectionBoxes.forEach((box) => {\n var _a;\n box.classList.remove('expanded');\n (_a = box.querySelector('button[aria-expanded]')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'false');\n });\n this.collectionComponents.forEach((component) => {\n component.classList.remove('resized');\n component.classList.remove('opened');\n });\n }, el);\n });\n }\n $collectionBoxes.forEach((el) => {\n el.addEventListener('click', (e) => this.toggleCollection(e));\n // this.$on('click', (e) => this.toggleCollection(e, el, this.isDesktop), el);\n });\n // $toggleCollections.forEach((el) => {\n // this.$on('click', (e) => this.toggleCollection(e, el, false), el);\n // });\n }\n toggleCollection(e, el, isDesktop) {\n var _a, _b;\n const target = e.target;\n if (!target.classList.contains('button'))\n e.preventDefault();\n const $container = this.$el;\n // const currentCollectionBox = el.closest('.inpage-collection');\n const currentCollectionBox = e.currentTarget;\n // console.log(e);\n if (currentCollectionBox.classList.contains('expanded') && window.innerWidth >= 1200)\n return;\n const collectionBox = this.$el.querySelectorAll('.inpage-collection');\n collectionBox.forEach((box) => {\n var _a;\n if (box !== currentCollectionBox) {\n box.classList.remove('expanded');\n (_a = box.querySelector('button[aria-expanded]')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'false');\n }\n });\n this.collectionComponents.forEach((component) => {\n if (component.querySelector('.inpage-collection') !== currentCollectionBox) {\n component.classList.add('resized');\n component.classList.remove('opened');\n }\n else {\n component.classList.remove('resized');\n component.classList.add('opened');\n }\n });\n if (currentCollectionBox.classList.contains('expanded')) {\n currentCollectionBox.classList.remove('expanded');\n (_a = currentCollectionBox.querySelector('button[aria-expanded]')) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'false');\n $container.classList.remove('collection-open');\n }\n else {\n $container.classList.add('collection-open');\n currentCollectionBox.classList.add('expanded');\n (_b = currentCollectionBox.querySelector('button[aria-expanded]')) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'true');\n }\n }\n}\n"],"names":["BaseComponent","constructor","element","super","this","_componentElement","setAttribute","_checkMessages","$el","$options","compOptions","options","Object","assign","dataset","keys","filter","entry","includes","forEach","cleanEntry","cleanOptionKey","optionValue","JSON","parse","replace","convertType","COMPONENT_NAME","__proto__","name","static","option","optionReturn","key","str","charAt","toLocaleLowerCase","slice","$on","events","cb","elements","e","stopPropagation","$one","$off","$fire","collectionIntroTabs","isDesktop","window","initComponent","collectionComponents","querySelectorAll","$collectionBoxes","$container","innerWidth","el","toggleCollection","classList","remove","box","_a","querySelector","component","addEventListener","_b","target","contains","preventDefault","currentCollectionBox","currentTarget","add"],"sourceRoot":""}