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uBAAwB,CAAC1C,OAAQkB,EAAI7B,WAAWsC,MAAMgB,oBAAoBzB,EAAIO,GAAG,KAAKP,EAAI0B,GAAI1B,EAA2B,yBAAE,SAAS2B,GAAiB,OAAO1B,EAAG,SAAS,CAACI,MAAM,CAAC,UAAYsB,EAAwB,OAAY,UAAGC,SAAS,CAAC,MAAQD,EAAwB,OAAE,GAAG3B,EAAI7B,WAAW0D,oBAAoB,CAA0B,eAAxB7B,EAAI7B,WAAW0D,KAAuB,CAAC7B,EAAIO,GAAG,aAAaP,EAAIQ,GAAGmB,EAAwB,OAAQ,MAAG,aAAa,CAAC3B,EAAIO,GAAG,aAAaP,EAAIQ,GAAGmB,EAAwB,OAAE3B,EAAI7B,WAAW0D,OAAO,aAAa7B,EAAIO,GAAG,KAAMP,EAAId,qBAAuBc,EAAIhB,oBAAsB2C,EAAwB,OAAwB,qBAAG,CAAC3B,EAAIO,GAAG,aAAaP,EAAIQ,GAAGR,EAAIhB,kBAAoB2C,EAAwB,OAAwB,qBAC/kD,OAAO3B,EAAIhB,kBAAoB2C,EAAwB,OAAwB,sBAAGG,iBAClF,OAAOH,EAAwB,OAAwB,qBAAI3B,EAAIhB,mBAAmB8C,kBAAkB,aAAa9B,EAAI+B,MAAM,EAAE,KAAI,IAC/I,EACIC,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/catalog/product/configurable/type/OptionSelect.vue?63ae","webpack:///./resources/area/web/default/js/components/catalog/product/configurable/type/OptionSelect.vue","webpack:///./resources/area/web/default/js/components/catalog/product/configurable/type/OptionSelect.vue?fadb","webpack:///./resources/area/web/default/js/components/catalog/product/configurable/type/OptionSelect.vue?b4f5"],"sourcesContent":["\nimport {Component, Vue, Prop} from 'vue-property-decorator';\n\n@Component(\n {\n name: 'catalog-product-configurable-select'\n }\n)\n\nexport default class extends Vue {\n @Prop() private readonly optionData: object;\n @Prop() private readonly checkEnabled: boolean;\n @Prop() private readonly step: number;\n\n private selectedValue: number | string = '';\n private attributeOptions: Array = [];\n\n private async updateCurrentStep(e): Promise {\n await this.$store.dispatch('CatalogConfigurableProduct/setSelectedOption', {\n attributeId: this.optionData['id'],\n attributeCode: this.optionData['code'],\n selectedValue: e.target.value\n });\n await this.$store.dispatch('CatalogConfigurableProduct/updateStep', (this.step + 1));\n }\n\n private async getProductOptions(): Promise> {\n return await this.$store.dispatch('CatalogConfigurableProduct/getAttributeOptionsByCode', this.optionData['code']).then(r => this.attributeOptions = r);\n }\n\n private get orderedAttributeOptions(): object[] {\n return this.optionData['options'].map((o: any) => {\n o.option = (this.attributeOptions[o['label']] || [])[0] || null\n return o\n }).filter((o: any) => null !== o['option'])\n }\n\n private get productFinalPrice(): number {\n return this.$store.getters['CatalogProduct/totalPrices']['totalPriceInclTax'];\n }\n\n private get showAdditionalPrice(): boolean {\n return this.$store.getters['CatalogConfigurableProduct/availableAttributes'].length === (this.step + 1);\n }\n\n private async created(): Promise {\n await this.getProductOptions();\n const productOptions = Object.keys(this.attributeOptions).map(o => this.attributeOptions[o][0]);\n if (productOptions.length === 1) {\n this.selectedValue = productOptions[0][`${this.optionData['code']}_option_id`];\n await this.$store.dispatch('CatalogConfigurableProduct/setSelectedOption', {attributeId: this.optionData['id'], attributeCode: this.optionData['code'], selectedValue: productOptions[0][`${this.optionData['code']}_option_id`]});\n await this.$store.dispatch('CatalogConfigurableProduct/updateStep', (this.step + 1));\n }\n this.$store.subscribe((mutation, state) => {\n if (mutation.type === 'CatalogConfigurableProduct/UPDATE_CURRENT_STEP') {\n if (this.step >= state['CatalogConfigurableProduct'].step) {\n this.selectedValue = '';\n this.getProductOptions();\n }\n }\n });\n }\n}\n","import { render, staticRenderFns } from \"./OptionSelect.vue?vue&type=template&id=6fa9b896&\"\nimport script from \"./OptionSelect.vue?vue&type=script&lang=ts&\"\nexport * from \"./OptionSelect.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-6.use[0]!../../../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OptionSelect.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-6.use[0]!../../../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OptionSelect.vue?vue&type=script&lang=ts&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"product__configurable-option__select\"},[_c('label',{attrs:{\"for\":`attribute-${_vm.optionData.id}`}},[_vm._v(_vm._s(_vm.optionData.label)+\":\")]),_vm._v(\" \"),_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selectedValue),expression:\"selectedValue\"}],attrs:{\"name\":`super_attribute[${_vm.optionData.id}]`,\"disabled\":!_vm.checkEnabled},on:{\"change\":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selectedValue=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},function($event){return _vm.updateCurrentStep($event)}]}},[_c('option',{attrs:{\"value\":\"\",\"selected\":\"\",\"disabled\":\"\"}},[_vm._v(_vm._s(_vm.$t('Choose your {option}', {option: _vm.optionData.label.toLowerCase()})))]),_vm._v(\" \"),_vm._l((_vm.orderedAttributeOptions),function(attributeOption){return _c('option',{attrs:{\"disabled\":!attributeOption['option']['in_stock']},domProps:{\"value\":attributeOption['option'][`${_vm.optionData.code}_option_id`]}},[(_vm.optionData.code === 'dimensions')?[_vm._v(\"\\n \"+_vm._s(attributeOption['option']['name'])+\"\\n \")]:[_vm._v(\"\\n \"+_vm._s(attributeOption['option'][_vm.optionData.code])+\"\\n \")],_vm._v(\" \"),(_vm.showAdditionalPrice && _vm.productFinalPrice !== attributeOption['option']['final_price_incl_tax'])?[_vm._v(\"\\n \"+_vm._s(_vm.productFinalPrice > attributeOption['option']['final_price_incl_tax'] ?\n `(- ${(_vm.productFinalPrice - attributeOption['option']['final_price_incl_tax']).priceFormat()})` :\n `(+ ${(attributeOption['option']['final_price_incl_tax'] - _vm.productFinalPrice).priceFormat()})`)+\"\\n \")]:_vm._e()],2)})],2)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["Vue","selectedValue","attributeOptions","updateCurrentStep","e","this","$store","dispatch","attributeId","optionData","attributeCode","target","value","step","getProductOptions","then","r","orderedAttributeOptions","map","o","option","filter","productFinalPrice","getters","showAdditionalPrice","length","created","productOptions","Object","keys","subscribe","mutation","state","type","Prop","Component","name","render","_vm","_c","_self","_setupProxy","staticClass","attrs","id","_v","_s","label","directives","rawName","expression","checkEnabled","on","$event","$$selectedVal","Array","prototype","call","options","selected","_value","multiple","$t","toLowerCase","_l","attributeOption","domProps","code","priceFormat","_e","staticRenderFns"],"sourceRoot":""}