{"version":3,"sources":["webpack:///./widgets/shopItemsWidget.js"],"names":["CLS","ShopItemsWidget","element","_classCallCheck","this","$element","$","api","data","$items","find","concat","$dropdowns","$dropdownItems","$menu","$filters","$loadMoreWrap","$loadMoreBtn","$sortDropdown","$clearFilterBtn","sourceId","shopName","windowWidth","window","width","params","pageNumber","urlPattern","initDropdowns","initFilters","initStickyFilter","moveDropdown","updateParam","handleResize","handleClearFilter","initProductItemWidget","key","value","_this","on","event","preventDefault","currentTarget","filterType","parents","attr","$parent","filterValue","removeClass","addClass","updateUrl","_this2","$filterItemHeader","$filterRadio","rotateIcon","item","initialDegree","arguments","length","undefined","degree","animate","children","deg","duration","step","now","css","transform","document","body","trigger","next","slideUp","complete","slideDown","val","_","isNil","prop","$filterToggler","concealFilter","utils","checkBP","hide","show","debounce","_this3","stick_in_parent","parent","offset_top","appendTo","prependTo","_this4","sourceID","lang","documentElement","indexOf","toLowerCase","forEach","filterObj","i","$selectedRadio","radioVal","radioName","$selectedDropdown","closest","_this5","_this6","uri","location","origin","Object","keys","index","updateQueryStringParameter","href"],"mappings":"g4BACA,IACMA,EAAM,kBASCC,EAAe,WAoC1B,O,EAnCD,SAAAA,EAAYC,I,4FAASC,CAAA,KAAAF,GACpBG,KAAKF,QAAUA,EACfE,KAAKC,SAAWC,EAAEJ,GAClBE,KAAKG,IAAMH,KAAKC,SAASG,KAAK,OAC9BJ,KAAKK,OAASL,KAAKC,SAASK,KAAK,IAADC,OAAKX,EAAG,WACxCI,KAAKQ,WAAaR,KAAKC,SAASK,KAAK,IAADC,OAAKX,EAAG,yBAC5CI,KAAKS,eAAiBT,KAAKQ,WAAWF,KAAK,kBAC3CN,KAAKU,MAAQV,KAAKC,SAASK,KAAK,IAADC,OAAKX,EAAG,UACvCI,KAAKW,SAAWX,KAAKC,SAASK,KAAK,IAADC,OAAKX,EAAG,aAC1CI,KAAKY,cAAgBZ,KAAKC,SAASK,KAAK,IAADC,OAAKX,EAAG,kBAC/CI,KAAKa,aAAeb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F,EAAWC,GAC/B/F,EAAE8F,GAAW1F,KAAK,IAADC,OAAKX,EAAG,yCAAwC6C,KAAK,WAAW,MAElF8D,EAAK3E,cACL2E,EAAKzD,iBAEN,CAAAd,IAAA,YAAAC,MAED,WAAY,IAAAuE,EAAA,KAEPC,EAAMxC,SAASyC,SAASC,OAE5BC,OAAOC,KAAK7G,KAAKuB,YAAYwE,SAAQ,SAAC/D,EAAK8E,GAC1CL,GAAO,IAAJlG,OAAQiG,EAAKjF,WAAWS,OAGtB4E,OAAOC,KAAK7G,KAAKqB,QAAQ0E,SAAQ,SAAC/D,EAAK8E,GAChC,eAAR9E,IACHyE,EAAM3B,IAAMiC,2BAA2BN,EAAKzE,EAAKwE,EAAKnF,OAAOW,QAI/Db,OAAOuF,SAASM,KAAOP,IAEvB,CAAAzE,IAAA,wBAAAC,MAED,WAEC6C,IAAM/C,sBAAsB/B,KAAKC,e,0FApRP,I","file":"64.js","sourcesContent":["/* eslint-disable max-len */\nconst NS = 'ShopItemsWidget';\nconst CLS = 'shopItemsWidget';\nconst CLS_IS_SELECTED = 'is-selected';\nconst CLS_HIDE = 'd-none';\nconst CLS_DISABLED = 'disabled';\nconst OFFSET_TOP = 100;\n\nimport utils from '../utils';\nimport _ from 'lodash';\n\nexport class ShopItemsWidget {\n\tconstructor(element) {\n\t\tthis.element = element;\n\t\tthis.$element = $(element);\n\t\tthis.api = this.$element.data('api');\n\t\tthis.$items = this.$element.find(`.${CLS}-items`);\n\t\tthis.$dropdowns = this.$element.find(`.${CLS}-dropdowns .dropdown`);\n\t\tthis.$dropdownItems = this.$dropdowns.find('.dropdown-item');\n\t\tthis.$menu = this.$element.find(`.${CLS}-menu`);\n\t\tthis.$filters = this.$element.find(`.${CLS}-filters`);\n\t\tthis.$loadMoreWrap = this.$element.find(`.${CLS}-loadMoreWrap`);\n\t\tthis.$loadMoreBtn = this.$element.find(`.${CLS}-loadMoreBtn`);\n\t\tthis.$sortDropdown = this.$element.find(`.${CLS}-sortDropdown`);\n\t\tthis.$clearFilterBtn = this.$element.find(`.${CLS}-clearFilterBtn`);\n\n\t\tthis.sourceId = this.$element.data('source-id');\n\t\tthis.shopName = this.$element.data('shop-name');\n\n\t\t// https://stackoverflow.com/questions/8898412/iphone-ipad-triggering-unexpected-resize-events\n\t\t// iOS safari trigeered unexpected resize event. Need to store window width\n\t\tthis.windowWidth = $(window).width();\n\n\t\tthis.params = {\n\t\t\tpageNumber: 1,\n\t\t};\n\n\t\tthis.urlPattern = {};\n\n\t\tthis.initDropdowns();\n\t\tthis.initFilters();\n\t\tthis.initStickyFilter();\n\t\tthis.moveDropdown();\n\t\tthis.updateParam();\n\t\tthis.handleResize();\n\t\tthis.handleClearFilter();\n\t\tthis.initProductItemWidget();\n\t}\n\n\tinitDropdowns() {\n\t\tthis.$dropdownItems.on('click', (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tlet $element = $(event.currentTarget);\n\t\t\tlet filterType = $element.parents(`.dropdown`).attr('data-filter-type');\n\t\t\tlet $parent = $element.parents('.dropdown');\n\t\t\tlet filterValue = $element.attr('data-filter-value') || '';\n\n\t\t\t$parent.find('.dropdown-item').removeClass(CLS_IS_SELECTED);\n\t\t\t$element.addClass(CLS_IS_SELECTED);\n\t\t\tthis.params[filterType] = filterValue;\n\t\t\tthis.params['pageNumber'] = 1;\n\t\t\tthis.updateUrl();\n\t\t});\n\t}\n\n\tinitFilters() {\n\t\tthis.$filterItemHeader = this.$filters.find(`.${CLS}-filter-header`);\n\t\tthis.$filterRadio = this.$filters.find(`.${CLS}-filter-body-item-radio`);\n\t\tlet animationDuration = 400;\n\n\t\t// Util function to rotate the filterHeaderIcon\n\t\tlet rotateIcon = (item, initialDegree = 0, degree = 180, animate = true) => {\n\t\t\tlet $element = item.children(`.${CLS}-filter-header-icon`);\n\n\t\t\tif (animate) {\n\t\t\t\t$({ deg: initialDegree }).animate({ deg: degree }, {\n\t\t\t\t\tduration: animationDuration,\n\t\t\t\t\tstep: (now) => {\n\t\t\t\t\t\t$element.css({\n\t\t\t\t\t\t\ttransform: `rotate(${now}deg)`,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$element.css({\n\t\t\t\t\ttransform: `rotate(${degree}deg)`,\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tthis.$filterItemHeader.on('click', (event) => {\n\t\t\tlet $element = $(event.currentTarget);\n\t\t\t$(document.body).trigger('sticky_kit:recalc');\n\n\t\t\tif ($element.parents(`.${CLS}-filter`).attr('data-active') === 'true') {\n\t\t\t\trotateIcon($element, 180, 0);\n\t\t\t\t$element.next(`.${CLS}-filter-body`).slideUp({\n\t\t\t\t\tduration: animationDuration,\n\t\t\t\t\tcomplete: () => {\n\t\t\t\t\t\t$element.parents(`.${CLS}-filter`).attr('data-active', false);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\trotateIcon($element, 0, 180);\n\t\t\t\t$element.next(`.${CLS}-filter-body`).slideDown({\n\t\t\t\t\tduration: animationDuration,\n\t\t\t\t\tcomplete: () => {\n\t\t\t\t\t\t$element.parents(`.${CLS}-filter`).attr('data-active', true);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tthis.$filterRadio.on('click', (event) => {\n\t\t\tlet $element = $(event.currentTarget);\n\t\t\tlet filterType = $element.parents(`[data-filter-type]`).attr('data-filter-type');\n\t\t\tlet value = $element.val();\n\n\t\t\tif(_.isNil(filterType)) {\n\t\t\t\tconsole.error(`${NS}::Error`, 'Please ensure there is a filterType value in the data-filter-type-attribute');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(this.params[filterType] === value) {\n\t\t\t\t$element.prop('checked', false);\n\t\t\t\tthis.urlPattern[filterType] = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.urlPattern[filterType] = value;\n\t\t\t}\n\n\t\t\tif(_.isNil(this.urlPattern[filterType]) || this.urlPattern[filterType] === '') {\n\t\t\t\tdelete this.urlPattern[filterType];\n\t\t\t}\n\n\t\t\tthis.params['pageNumber'] = 1;\n\t\t\tthis.updateUrl();\n\t\t});\n\n\t\tthis.$filterToggler = this.$element.find(`.${CLS}-filterToggler`);\n\n\t\tthis.$filterToggler.on('click', () => {\n\t\t\tif(this.$filters.attr('data-concealed') === 'true') {\n\t\t\t\tthis.$filters.slideDown({\n\t\t\t\t\tduration: animationDuration,\n\t\t\t\t\tcomplete: () => {\n\t\t\t\t\t\tthis.$filters.attr('data-concealed', false);\n\t\t\t\t\t\tthis.$filterToggler.attr('data-concealed', false);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.$filters.slideUp({\n\t\t\t\t\tduration: animationDuration,\n\t\t\t\t\tcomplete: () => {\n\t\t\t\t\t\tthis.$filters.attr('data-concealed', true);\n\t\t\t\t\t\tthis.$filterToggler.attr('data-concealed', true);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tlet concealFilter = () => {\n\t\t\tif(utils.checkBP('ds')) {\n\t\t\t\tthis.$filters.attr('data-concealed', true);\n\t\t\t\tthis.$filterToggler.attr('data-concealed', true);\n\t\t\t\tthis.$filters.hide();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.$filters.attr('data-concealed', false);\n\t\t\t\tthis.$filterToggler.attr('data-concealed', false);\n\t\t\t\tthis.$filters.show();\n\t\t\t}\n\t\t};\n\n\t\t$(window).on('resize', _.debounce(() => {\n\t\t\tif (this.windowWidth !== $(window).width()) {\n\t\t\t\tthis.windowWidth = $(window).width();\n\t\t\t\tconcealFilter();\n\t\t\t}\n\t\t}, 50));\n\n\t\tconcealFilter();\n\t}\n\n\thandleResize() {\n\t\t$(window).on('resize', _.debounce(() => {\n\t\t\tthis.initStickyFilter();\n\t\t\tthis.moveDropdown();\n\t\t}, 150));\n\t}\n\n\tinitStickyFilter() {\n\t\tif (utils.checkBP('ds', true)) {\n\t\t\tthis.$filters.stick_in_parent({\n\t\t\t\tparent: `.${CLS}`,\n\t\t\t\toffset_top: OFFSET_TOP\n\t\t\t});\n\t\t} else {\n\t\t\tthis.$filters.trigger('sticky_kit:detach');\n\t\t}\n\t}\n\n\tmoveDropdown() {\n\t\tif (utils.checkBP('ds', true)) {\n\t\t\tthis.$sortDropdown.appendTo(this.$menu);\n\t\t} else {\n\t\t\tthis.$sortDropdown.prependTo(this.$filters);\n\t\t}\n\n\t\tthis.$sortDropdown.removeClass(CLS_HIDE);\n\t}\n\n\tupdateParam() {\n\t\tif (this.sourceId) {\n\t\t\tthis.params.sourceID = this.sourceId;\n\t\t}\n\n\t\tlet lang = document.documentElement.lang;\n\t\tlet appendedLangs = ['de', 'zh-hk']; // this language will be appended to vanity url\n\n\t\t// append language if exist on appendedLangs\n\t\tif (lang && appendedLangs.indexOf(lang.toLowerCase()) !== -1) {\n\t\t\tif (lang.toLowerCase() === 'zh-hk') {\n\t\t\t\tlang = 'hk';\n\t\t\t}\n\n\t\t\tthis.urlPattern.lang = lang;\n\t\t}\n\n\t\tif (this.shopName) {\n\t\t\tthis.urlPattern.shopName = this.shopName;\n\t\t}\n\n\t\t// get filters value\n\t\tlet $filters = this.$element.find(`.${CLS}-filter`);\n\t\t_.forEach($filters, (filterObj, i) => {\n\t\t\tlet $selectedRadio = $(filterObj).find(`.${CLS}-filter-body-item-radio[checked]`);\n\t\t\tlet radioVal = $selectedRadio.val();\n\t\t\tlet radioName = $selectedRadio.prop('name');\n\t\t\tif (!_.isNil(radioVal) && radioVal !== '') {\n\t\t\t\tthis.urlPattern[radioName] = radioVal;\n\t\t\t}\n\t\t});\n\n\t\t// get dropdown value\n\t\tlet $selectedDropdown = this.$dropdowns.find(`.dropdown-item.${CLS_IS_SELECTED}`);\n\t\tif ($selectedDropdown.length > 0) {\n\t\t\tlet filterType = $selectedDropdown.closest(`.dropdown`).attr('data-filter-type');\n\t\t\tlet filterValue = $selectedDropdown.data('filter-value');\n\t\t\tthis.params[filterType] = filterValue;\n\t\t}\n\t}\n\n\thandleClearFilter() {\n\t\tthis.$clearFilterBtn.on('click', () => {\n\t\t\tlet $filters = this.$element.find(`.${CLS}-filter`);\n\t\t\t_.forEach($filters, (filterObj, i) => {\n\t\t\t\t$(filterObj).find(`.${CLS}-filter-body-item-radio[value=\"all\"]`).attr('checked', true);\n\t\t\t});\n\t\t\tthis.updateParam();\n\t\t\tthis.updateUrl();\n\t\t});\n\t}\n\n\tupdateUrl() {\n\t\t// pattern: https://www.woolmark.com/{language}/{shop-page-name}/{category}/{designer}/{productType}/{region}/?sourceID={number}&sortType={sortType}\n\t\tlet uri = document.location.origin;\n\n\t\tObject.keys(this.urlPattern).forEach((key, index) => {\n\t\t\turi += `/${this.urlPattern[key]}`;\n });\n\n Object.keys(this.params).forEach((key, index) => {\n\t\t\tif (key !== 'pageNumber') {\n\t\t\t\turi = utils.updateQueryStringParameter(uri, key, this.params[key]);\n\t\t\t}\n });\n\n\t\twindow.location.href = uri;\n\t\t// console.log(NS, uri);\n\t}\n\n\tinitProductItemWidget() {\n\t\t// move it to utils so it can be used globally\n\t\tutils.initProductItemWidget(this.$element);\n\t}\n}\n"],"sourceRoot":""}