{"version":3,"sources":["webpack:///./src/ac/js/components/Component.js","webpack:///./src/ac/js/components/ServicesSlider.js"],"names":["domTree","WeakMap","configuration","Component","el","config","arguments","length","undefined","_classCallCheck","this","Error","$el","jQuery","$","set","hasOwnProperty","dom","setupDefaults","addListeners","get","elements","_component","__webpack_require__","ServicesSlider","_this","_possibleConstructorReturn","__proto__","Object","getPrototypeOf","call","initSlick","$slider","find","$prevArrow","$nextArrow","breakpoint","window","matchMedia","addListener","bind","matches","slick","infinite","dots","slidesToShow","slidesToScroll","prevArrow","nextArrow","responsive","settings","hasClass"],"mappings":"ohBAAA,IAAMA,EAAU,IAAIC,QACdC,EAAgB,IAAID,QA4BpBE,aAOJ,SAAAA,EAAYC,GAAgB,IAAZC,EAAYC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAC1B,+FAD0BG,CAAAC,KAAAP,QACR,IAAPC,EACT,MAAM,IAAIO,MAAM,wEASlBD,KAAKE,IAAMR,aAAcS,EAAST,EAAKU,EAAEV,GAEjB,IAApBM,KAAKE,IAAIL,SAEbP,EAAQe,IAAIL,SACZR,EAAca,IAAIL,KAAML,GAEpBK,KAAKL,OAAOW,eAAe,SAC7BN,KAAKO,IAAMP,KAAKL,OAAOY,KAGzBP,KAAKQ,gBACLR,KAAKS,0IAuCL,OAAOjB,EAAckB,IAAIV,gCA6BnBW,GACNA,OACKX,KAAKO,IACLI,GAGLrB,EAAQe,IAAIL,KAAMW,mBAYlB,OAAOrB,EAAQoB,IAAIV,yBAIRP,sWCrJfmB,EAAAC,EAAA,6CAEMC,cACJ,SAAAA,EAAYpB,gGAAIK,CAAAC,KAAAc,GAAA,IAAAC,mKAAAC,CAAAhB,MAAAc,EAAAG,WAAAC,OAAAC,eAAAL,IAAAM,KAAApB,KACRN,IADQ,OAGdqB,EAAKM,YAHSN,2XAOdf,KAAKO,KACHe,QAAStB,KAAKE,IAAIqB,KAAK,yBACvBC,WAAYxB,KAAKE,IAAIqB,KAAK,yBAC1BE,WAAYzB,KAAKE,IAAIqB,KAAK,0BAG5BvB,KAAK0B,WAAaC,OAAOC,WAAW,8DAIpC5B,KAAK0B,WAAWG,YAAc7B,KAAKqB,UAAnCS,KAA8B9B,2CAKzBA,KAAK0B,WAAWK,QAMrB/B,KAAKO,IAAIe,QAAQU,OACfC,UAAU,EACVC,MAAM,EACNC,aAAc,EACdC,eAAgB,EAChBC,UAAWrC,KAAKO,IAAIiB,WACpBc,UAAWtC,KAAKO,IAAIkB,WACpBc,aAEIb,WAAY,IACZc,UACEL,aAAc,EACdC,eAAgB,OAjBlBpC,KAAKO,IAAIe,QAAQmB,SAAS,sBAC5BzC,KAAKO,IAAIe,QAAQU,MAAM,8BAwBhBlB","file":"28.d6c492e28d7466c5e77f.js","sourcesContent":["const domTree = new WeakMap();\nconst configuration = new WeakMap();\n\n/**\n * Component is a class that should be extended for every component that's being made. It\n * is a helper class to keep the code uniform.\n *\n * __PLEASE NOTE__: This is only to be extended, not instantiated.\n *\n * @example\n * import Component from 'component';\n *\n * class Foo extends Component {\n * construction(el){\n * super(el);\n * }\n *\n * setupDefaults(){\n * // ...defaults go here\n * }\n *\n * addListeners(){\n * // ...listeners go here\n * }\n * }\n *\n * // Create a new Foo component\n * new Foo('.foo');\n */\nclass Component {\n /**\n * Component constructor - see {@link config} on how to pass in additional configuration to the constructor\n *\n * @param {string|Object} el - Main DOM element, you can pass a string such as `'.foo'` __or__ a jQuery object such as `$('.foo')`\n * @param {Object} [config={ }] - Additional component configuration; reachable with `this.config`\n */\n constructor(el, config = {}){\n if (typeof el === 'undefined') {\n throw new Error('You must provide an element as a String type or a jQuery object type');\n }\n\n /**\n * Main class element, this will be a jQuery instance\n * This can be reachable at any time in your superclass with `this.$el`\n *\n * @type {Object}\n */\n this.$el = el instanceof jQuery ? el : $(el);\n\n if (this.$el.length === 0) return;\n\n domTree.set(this, {});\n configuration.set(this, config);\n\n if (this.config.hasOwnProperty('dom')) {\n this.dom = this.config.dom;\n }\n\n this.setupDefaults();\n this.addListeners();\n }\n\n /**\n * This method is used for override;\n * It's called directly after the element and configuration have been set up\n * @abstract\n */\n setupDefaults(){}\n\n /**\n * This method is used for override;\n * It's called directly after `setupDefaults()`, so everything is ready and setup at this point.\n * @abstract\n */\n addListeners(){}\n\n /**\n * Get component configuration\n *\n * @example\n * class Foo extends Component {\n * construction(el, config){\n * super(el, config);\n * }\n *\n * setupDefaults(){\n * console.log(this.config.name); // Outputs \"Foo\"\n * }\n * }\n *\n * // Create a new Foo component with some configuration\n * new Foo('.foo', {\n * name: 'Foo'\n * });\n *\n * @type {Object}\n */\n get config(){\n return configuration.get(this);\n }\n\n /**\n * Set DOM object\n *\n * @example\n * class Foo extends Component {\n * construction(el){\n * super(el);\n * }\n *\n * setupDefaults(){\n * this.dom = {\n * $container: this.$el.find('.container')\n * }\n * }\n *\n * addListeners(){\n * //DOM object is available\n * console.log(this.dom.$container);\n * }\n * }\n *\n * // Create a new Foo component\n * new Foo('.foo');\n *\n * @type {Object}\n */\n set dom(elements){\n elements = {\n ...this.dom,\n ...elements\n };\n\n domTree.set(this, elements);\n }\n\n /**\n * Get DOM object\n *\n * @example\n * this.dom\n *\n * @type {Object}\n */\n get dom(){\n return domTree.get(this);\n }\n}\n\nexport default Component;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ac/js/components/Component.js","import Component from 'component';\n\nclass ServicesSlider extends Component {\n constructor(el) {\n super(el);\n\n this.initSlick();\n }\n\n setupDefaults() {\n this.dom = {\n $slider: this.$el.find('.services__items-list'),\n $prevArrow: this.$el.find('.services__items-prev'),\n $nextArrow: this.$el.find('.services__items-next')\n };\n\n this.breakpoint = window.matchMedia('(max-width: 1023px)');\n }\n\n addListeners() {\n this.breakpoint.addListener(::this.initSlick);\n }\n\n initSlick() {\n\n if (!this.breakpoint.matches) {\n if (this.dom.$slider.hasClass('slick-initialized')) {\n this.dom.$slider.slick('unslick');\n }\n return;\n }\n this.dom.$slider.slick({\n infinite: false,\n dots: true,\n slidesToShow: 3,\n slidesToScroll: 3,\n prevArrow: this.dom.$prevArrow,\n nextArrow: this.dom.$nextArrow,\n responsive: [\n {\n breakpoint: 640,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1\n }\n }\n ]\n });\n }\n}\n\nexport default ServicesSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/ac/js/components/ServicesSlider.js"],"sourceRoot":""}