{"version":3,"file":"DoorM-67276965.js","sources":["../../../app/javascript/mixins/WindowM.js","../../../app/javascript/mixins/DoorM.js"],"sourcesContent":["const wNames = ['одностворчатое', 'двустворчатое', 'трехстворчатое', 'четырехстворчатое'];\nconst wNamesTr = ['одностворчатым','двухстворчатым','трехстворчатым', 'четырехстворчатым'];\nconst casement_types_order = ['dead_window','rotary','swing_out'];\n\nimport { railsData } from \"../init_data/rails_data.js\";\nconst casementAreas = railsData.calculator_init_data ? railsData.calculator_init_data.casement_areas : {};\n\nexport default {\n data() {\n return {\n\t\t\tvalidation: {\n\t\t\t\twindow_height: value => (this.window_max_height >= value && value >= this.window_min_height) || \"Неверная высота окна.\",\n\t\t\t\twindow_width: value => (this.window_max_width>= value && value >= this.window_min_width) || \"Неверная ширина окна.\",\n\t\t\t\tcasement_width:(index,slider) => {\n return (value) => {\n value = Number(value);\n\t\t\t\t\t\tlet min = this.getSizeFor('min','width',index + this.index_adder);\n\t\t\t\t\t\tlet max = this.getSizeFor('max','width',index + this.index_adder);\n\t\t\t\t\t\tif (this.casements_without_framuga_count > 1) {\n\t\t\t\t\t\t\tlet whole_width = this.windowWidthInput;\n\t\t\t\t\t\t\tthis.casements_without_framuga.forEach((cas,i) => {\n\t\t\t\t\t\t\t\tlet curr_index = i + this.index_adder;\n\t\t\t\t\t\t\t\tif (index + this.index_adder === curr_index) return;\n\t\t\t\t\t\t\t\tif (!slider && cas.touched) return;\n\t\t\t\t\t\t\t\twhole_width -= this.getSizeFor('min','width',curr_index);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tmax = Math.min(whole_width,max)\n\t\t\t\t\t\t}\n if (slider) {\n return this.getFromRange(min,max,value);\n } else {\n return (max >= value && value >= min) || 'Неверная ширина'\n }\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcasement_height:(index,slider) => {\n return (value) => {\n value = Number(value);\n let min = Math.max(...this.casements_without_framuga.map((el,i) => this.getSizeFor('min','height',i+this.index_adder)));\n let max = Math.min(...this.casements_without_framuga.map((el,i) => this.getSizeFor('max','height',i+this.index_adder)));\n\n\t\t\t\t\t\tif (this.framuga) {\n let min_framuga = this.getSizeFor('min','height',0);\n let max_framuga = this.getSizeFor('max','height',0);\n if (index === 0) {\n min = Math.max(min_framuga,this.window_height - max);\n max = Math.min(max_framuga,this.window_height - min);\n } else {\n min = Math.max(min,this.window_height - max_framuga);\n max = Math.min(max,this.window_height - min_framuga);\n }\n\t\t\t\t\t\t}\n if (slider) {\n return this.getFromRange(min,max,value);\n } else {\n return (max >= value && value >= min) || 'Неверная высота'\n }\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n windowWidthInput: 0,\n windowHeightInput: 0,\n errorWidthCasStyle: [],\n errorHeightCasStyle: [],\n sliderValueWidth: [],\n\t\t\tsliderValueHeight: 0,\n current_min_and_max_sizes: [],\n casement_areas: casementAreas\n }\n },\n\twatch: {\n\t\t// ===> computed window type won't work without it\n \t\twindow_image_code(val) {\n if (val) this.initionWindow();\n\t\t}\n },\n computed: {\n window_name() {\n if (this.window_casements) {\n let name = wNames[this.casements_without_framuga_count - 1];\n if (this.framuga) {\n name += ' с фрамугой'\n }\n return name\n }\n },\n window_name_tr() {\n return wNamesTr[this.casements_without_framuga_count - 1];\n },\n window_casements() {\n return this.$store.state.currentWindowM.window_casements\n },\n framuga() {\n return this.window_casements.find(cas => cas.name === 'Фрамуга')\n },\n casements_without_framuga() {\n return this.window_casements.filter(cas => cas.name !== 'Фрамуга')\n },\n casements_without_framuga_count() {\n return this.casements_without_framuga.length\n },\n index_adder() {\n return Number(!!this.framuga);\n },\n window_width() {\n return this.casements_without_framuga.reduce((width, cas) => width + Number(cas.width), 0)\n },\n window_min_width() {\n return this.casements_without_framuga.reduce((sum,cas,i) => sum + this.getSizeFor('min','width',i + this.index_adder), 0);\n },\n window_max_width() {\n\t\t\tlet max_width = 280;\n\t\t\tif (this.casements_without_framuga_count > 2) {\n\t\t\t\tmax_width += ((this.casements_without_framuga_count - 2) * 150) + 20 ;\n\t\t\t}\n if (this.current_min_and_max_sizes.length) {\n let max_casements_all = this.casements_without_framuga.reduce((sum,cas,i) => sum + this.getSizeFor('max','width',i + this.index_adder), 0);\n if (this.framuga) {\n let framuga_max = this.getSizeFor('max','width',0);\n max_casements_all = Math.min(framuga_max, max_casements_all);\n }\n return Math.min(max_width, max_casements_all);\n }\n return max_width;\n },\n window_height() {\n let window_height = Number(this.casements_without_framuga[0].height);\n if (this.framuga) {\n window_height += Number(this.framuga.height)\n }\n return window_height\n },\n window_min_height() {\n if (this.current_min_and_max_sizes.length) {\n let cases_heights_min = Math.max(...this.casements_without_framuga.map((el,i) => this.getSizeFor('min','height',i+this.index_adder)));\n if (this.framuga) {\n let framuga_min = this.getSizeFor('min','height',0);\n cases_heights_min += framuga_min;\n }\n return cases_heights_min;\n } else {\n return 40*(this.framuga ? 2 : 1);\n }\n\t\t},\n window_max_height() {\n\t\t\tlet cases_heights_max = Math.min(...this.casements_without_framuga.map((el,i) => this.getSizeFor('max','height',i+this.index_adder)));\n\t\t\tif (this.framuga) {\n\t\t\t\tlet framuga_max = this.getSizeFor('max','height',0);\n\t\t\t\tcases_heights_max += framuga_max;\n\t\t\t}\n return Math.min(280,cases_heights_max);\n },\n window_image_code() {\n let image_code = '';\n if (this.window_casements) {\n let type_codes = {\n dead_window: '0',\n rotary: '1',\n swing_out: '2'\n }\n let code = '';\n for (const cas of this.window_casements) {\n let type = cas.type;\n let type_code = type_codes[type];\n code += type_code\n }\n if (this.framuga) {\n code = '1' + code\n } else {\n code = '0' + code\n }\n image_code = 'casements/' + code + '.webp';\n }\n return image_code;\n }\n },\n methods: {\n async get_valid_for_height(index,slider,value) {\n return await this.validation.casement_height(index,slider)(value);\n },\n async get_valid_for_cas_width(index,slider,value) {\n return await this.validation.casement_width(index,slider)(value);\n },\n\t\tinitionWindow(){\n this.changeCurrentMinMaxVals();\n\t\t\tfor (const cas of this.casements_without_framuga) {\n cas.touched = 0;\n\t\t\t}\n\t\t\tif (this.framuga) {\n \t\tthis.sliderValueHeight = this.window_height - this.framuga.height;\n }\n\t\t\tthis.windowWidthInput = this.window_width;\n\t\t\tthis.windowHeightInput = this.window_height;\n\t\t\tthis.setSliderValueFromCurrentCasement();\n\t\t},\n changeCurrentMinMaxVals() {\n this.current_min_and_max_sizes = [];\n let all_widths = Object.values(this.window_casements).map(x => x.width);\n let all_heights = Object.values(this.window_casements).map(x => x.height);\n\n all_widths.forEach((x,i) => {\n let hash = {};\n let sizes = {width: x, height: all_heights[i]};\n let index_of_type = casement_types_order.indexOf(this.window_casements[i].type);\n ['height','width'].forEach(dimension => {\n ['min','max'].forEach(limit => {\n let key = `${limit}_${dimension}`\n let curr_division = sizes[dimension == 'height' ? 'width' : 'height'];\n hash[key] = Math.floor(this.casement_areas[index_of_type][limit] / curr_division);\n\n\t\t\t\t\t\tif (hash[key] < 40) hash[key] = 40;\n if (this.window_casements[i].type !== 'dead_window') {\n if (dimension == 'height' && hash[key] > 260) { hash[key] = 260; return; }\n if (dimension == 'width' && hash[key] > 160) { hash[key] = 160; return; }\n } else if (this.isFramuga(i)) {\n if (dimension == 'width' && hash[key] > this.window_max_width) hash[key] = this.window_max_width;\n } else {\n if (hash[key] > 280) hash[key] = 280;\n }\n })\n })\n this.current_min_and_max_sizes.push(hash)\n })\n },\n async setWidth(function_event, old_value) {\n let new_value = Number(function_event.target.value);\n\t\t\tconst invalid_msgs = await this.$refs.inputWidth.validate();\n\t\t\tif (!invalid_msgs.length) {\n\t\t\t\tthis.changeAllCasementsWidth(new_value);\n\t\t\t\tthis.changeCurrentMinMaxVals();\n\t\t\t\tthis.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n\t\t\t} else {\n\t\t\t\tthis.windowWidthInput = old_value;\n this.showErrorMessage();\n setTimeout(() => this.$refs.inputWidth.resetValidation(), 2000);\n\t\t\t}\n },\n\t\tasync changeAllCasementsWidth(new_window_width) {\n let new_casements_widths = await this.getValidCasementsWidths(new_window_width);\n for (const [key, value] of Object.entries(new_casements_widths)) {\n this.casements_without_framuga[key].width = value;\n this.casements_without_framuga[key].touched = 0;\n }\n\t\t\tif (this.framuga) this.framuga.width = new_window_width;\n this.setSliderValueFromCurrentCasement();\n\t\t},\n\t\tasync SetWidthAndRestartTouchedForRest(cas_i,value) {\n\t\t\tthis.casements_without_framuga.forEach((cas,index) => {\n\t\t\t\tif (index == cas_i) {\n cas.touched = 1;\n cas.width = value;\n\t\t\t\t} else {\n\t\t\t\t\tcas.touched = 0;\n }\n\t\t\t})\n\t\t\tlet available_width = this.windowWidthInput - value;\n\t\t\tlet count = this.casements_without_framuga_count - 1;\n\t\t\tawait this.setCasementWidthNotTouched(available_width, count, cas_i);\n\t\t},\n async getValidCasementsWidths(full,not_touched_count,cas_i) {\n\t\t\tif (!not_touched_count && !cas_i) {\n if (this.framuga) {\n let framuga_valid_val = await this.get_valid_for_cas_width(0,true,full);\n if (framuga_valid_val !== full) { return []; }\n }\n\n\t\t\t\tif (!(this.window_max_width >= full && full >= this.window_min_width)) { return []; }\n\t\t\t}\n\n //глухие створки оставляем напоследок, они могут быть гораздо большего размера, чем остальные виды\n let ordered_by_dead = [];\n\t\t\tthis.casements_without_framuga.forEach((cas, index) => {\n if (cas.type === 'dead_window') {\n ordered_by_dead.push(index);\n } else {\n ordered_by_dead.unshift(index);\n }\n })\n\n\t\t\tlet count = not_touched_count || this.casements_without_framuga_count;\n\t\t\tlet medium = Math.floor(full / count);\n let excessive_width = full - medium * count;\n\t\t\tlet result = {};\n\t\t\tlet curr_val = null;\n\n\t\t\tif (not_touched_count) ordered_by_dead = ordered_by_dead.filter((el) => !this.window_casements[el].touched);\n\t\t\tif (cas_i) ordered_by_dead = ordered_by_dead.filter((el) => el !== cas_i);\n\n for (let i_cas_from_ordered of ordered_by_dead) {\n let curr_val = medium;\n if (excessive_width !== 0) {\n //reduce excessive_width\n let width_adder_for_curr = Math.floor(excessive_width/count);\n curr_val += width_adder_for_curr;\n excessive_width -= width_adder_for_curr;\n }\n let valid_val = await this.get_valid_for_cas_width(i_cas_from_ordered,true,curr_val);\n if (curr_val !== valid_val) {\n excessive_width += (curr_val - valid_val)\n curr_val = valid_val;\n }\n\t\t\t\tresult[i_cas_from_ordered] = curr_val;\n\t\t\t\tcount--;\n }\n return excessive_width ? [] : result;\n\t\t},\n\t\tasync setCasementWidthNotTouched(available_width,count,cas_i) {\n let results = await this.getValidCasementsWidths(available_width,count,cas_i);\n\t\t\tthis.casements_without_framuga.forEach((cas, i) => {\n if (!results[i]) return;\n cas.width = results[i];\n\t\t\t})\n this.changeCurrentMinMaxVals();\n\t\t},\n /**\n * Метод, который отрабатывает при изменение инпута створки\n * @сas_i - идекс створки в массиве створок\n * @new_width - значнение инпута соответственно\n */\n async setCasementWidth(cas_i, function_event, old_width) {\n let new_width = Number(function_event.target.value);\n\t\t\tif (new_width === old_width) return ;\n\n\t\t\tconst invalid_msgs = await this.$refs[`inputCasWidth_${cas_i}`].validate();\n\t\t\tif (invalid_msgs.length) {\n\t\t\t\tthis.setOldWidthAndError(cas_i,old_width);\n setTimeout(() => this.$refs[`inputCasWidth_${cas_i}`].resetValidation(), 2000);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet touched_count = 0;\n\t\t\tlet not_touched_cases_width = this.windowWidthInput;\n this.casements_without_framuga.forEach((cas,index) => {\n\t\t\t\tif (cas.touched === 1) {\n\t\t\t\t\ttouched_count += cas.touched;\n\t\t\t\t\tnot_touched_cases_width -= cas.width;\n\t\t\t\t}\n })\n\t\t\tlet is_touched = this.casements_without_framuga[cas_i].touched;\n\t\t\t// if already touched we make untouched the rest\n\t\t\tif (is_touched) {\n\t\t\t\tawait this.SetWidthAndRestartTouchedForRest(cas_i, new_width);\n this.setSliderValueFromCurrentCasement();\n this.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n return;\n\t\t\t}\n\n\t\t\tlet max_touched_count = this.casements_without_framuga_count - 1;\n\t\t\t// if all are touched and user tries change the only untouched\n\t\t\tif (touched_count >= max_touched_count &&\n\t\t\t\t\tthis.casements_without_framuga_count > 1) {\n\t\t\t\tthis.setOldWidthAndError(cas_i,old_width);\n\t\t\t\treturn;\n }\n\n this.casements_without_framuga[cas_i].width = new_width;\n this.casements_without_framuga[cas_i].touched = 1;\n\n not_touched_cases_width -= new_width;\n touched_count += 1;\n let new_not_touched_count = this.casements_without_framuga_count - touched_count;\n await this.setCasementWidthNotTouched(not_touched_cases_width,new_not_touched_count,cas_i);\n\t\t\tthis.setSliderValueFromCurrentCasement();\n this.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n },\n getFromRange(min,max,value) {\n return Math.min(Math.max(value, min), max);\n },\n getSizeFor(limit,dimension,cas_i) {\n return this.current_min_and_max_sizes[cas_i][`${limit}_${dimension}`];\n },\n async sliderWidth(values) {\n // values может быть числом, если створок две или же массивом (первое значение - ширина первой створки, второе значение - сумма ширин 1-й и 2-й, третье значение - сумма предыдущего значения и ширины 3-й створки и т.д.), если их больше.\n // let get_valid = this.validation.casement_width;\n if (typeof values === 'number'){\n let first_val = await this.get_valid_for_cas_width(0,true,values);\n if (first_val !== values) {\n this.setSliderValue(first_val);\n return\n }\n let second_val = this.windowWidthInput - first_val;\n\n this.casements_without_framuga[0].width = first_val;\n this.casements_without_framuga[1].width = second_val;\n this.changeCurrentMinMaxVals();\n this.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n return;\n }\n\n\t\t\tlet newValues = values.slice();\n let setNewValues = false;\n\n let max = this.casements_without_framuga.reduce((width,el,i) => width + this.getSizeFor('min','width',i + this.index_adder),0);\n max = this.windowWidthInput - max;\n for (let [index, curr_val] of values.entries()) {\n let prev_val = values[index - 1] || 0;\n let curr_cas_val = curr_val - prev_val;\n let valid_curr_cas_val = await this.get_valid_for_cas_width(index,true,curr_cas_val);\n\n if (valid_curr_cas_val !== curr_cas_val) {\n newValues[index] = prev_val + valid_curr_cas_val;\n setNewValues = true;\n break;\n }\n\n let min_curr = this.getSizeFor('min','width',index + this.index_adder);\n max += min_curr;\n if (curr_val > max) {\n newValues[index] = max;\n setNewValues = true;\n break;\n }\n\n let next_val = values[index + 1] || 0;\n if (next_val) {\n let next_cas_val = next_val - curr_val;\n let valid_next_cas_val = await this.get_valid_for_cas_width(index+1,true,next_cas_val);\n if (next_cas_val < valid_next_cas_val) {\n newValues[index] = curr_val - 1;\n newValues[index+1] = next_val + 1;\n setNewValues = true;\n }\n }\n }\n if (setNewValues) {\n this.setSliderValue(newValues);\n return;\n }\n\n this.casements_without_framuga.forEach((cas,i) => {\n\t\t\t\tif (i === 0) {\n cas.width = newValues[0];\n } else if (newValues[i]) {\n cas.width = newValues[i] - newValues[i - 1];\n } else {\n cas.width = this.windowWidthInput - newValues[i - 1];\n }\n })\n this.changeCurrentMinMaxVals();\n this.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n },\n /**\n * Заполнить значние слайдера исходя из значения створки\n */\n setSliderValueFromCurrentCasement() {\n\t\t\tlet points = [];\n\t\t\tlet prev_width = 0;\n this.casements_without_framuga.forEach((cas,i) => {\n\t\t\t\tif (i === this.casements_without_framuga_count - 1) return;\n\t\t\t\tprev_width += cas.width;\n\t\t\t\tpoints.push(prev_width);\n })\n\n this.sliderValueWidth = points;\n },\n setSliderValue(value) {\n this.sliderValueWidth = value;\n this.$refs.slider.setValue(value);\n },\n // HEIGHT ===============================================================+++++++++++++++++++++++++++++++\n\t\tasync setHeight(function_event,old_value) {\n let new_value = Number(function_event.target.value);\n\t\t\tconst invalid_msgs = await this.$refs.inputHeight.validate();\n\t\t\tif (!invalid_msgs.length) {\n if (this.framuga) {\n let valid_for_framuga = await this.get_valid_for_height(0,true,Math.floor(this.windowHeightInput/2));\n let valid_for_casements = this.windowHeightInput - valid_for_framuga;\n this.setFramugaHeightValue(valid_for_framuga);\n this.setCasementsHeightValue(valid_for_casements);\n this.setSliderValueHeightFromCurrentCasement();\n } else {\n this.setCasementsHeightValue(this.windowHeightInput);\n }\n\t\t\t\tthis.changeCurrentMinMaxVals();\n\t\t\t\tthis.$store.dispatch(\"getTimeoutFiltersOffers\",2000);\n\t\t\t} else {\n\t\t\t\tthis.windowHeightInput = old_value;\n setTimeout(() => this.$refs.inputHeight.resetValidation(), 2000);\n this.showErrorMessage();\n\t\t\t}\n },\n setSliderValueHeightFromCurrentCasement() {\n this.sliderValueHeight = this.windowHeightInput - this.framuga.height;\n },\n\t\tsetCasementsHeightValue(value) {\n for (const cas of this.casements_without_framuga) {\n cas.height = value\n }\n this.changeCurrentMinMaxVals();\n\t\t},\n\t\tsetFramugaHeightValue(value){\n\t\t\tthis.framuga.height = value;\n this.changeCurrentMinMaxVals();\n\t\t},\n async setCasementHeight(cas_i, function_event, old_value) {\n let value = Number(function_event.target.value);\n\t\t\tif (value === old_value) return ;\n\n\t\t\tconst invalid_msgs = await this.get_valid_for_height(cas_i,false,value);\n\t\t\tif (invalid_msgs.length) {\n this.setOldHeightAndError(cas_i,old_value);\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet is_framuga = this.isFramuga(cas_i);\n if (!is_framuga) {\n value = this.windowHeightInput - value;\n }\n this.setFramugaHeightValue(value);\n this.setCasementsHeightValue(this.windowHeightInput - value);\n\n\t\t\tthis.setSliderValueHeightFromCurrentCasement();\n this.changeCurrentMinMaxVals();\n this.$store.dispatch(\"getTimeoutFiltersOffers\", 2000);\n },\n async sliderHeight(value) {\n //value is height of not framuga casement\n let cas_val = value;\n if (cas_val === this.casements_without_framuga[0].height) return;\n let cas_valid_val = await this.get_valid_for_height(1,true,cas_val);\n if (cas_val !== cas_valid_val) {\n this.sliderHeight(cas_valid_val);\n this.setSliderHeightValue(cas_valid_val);\n return;\n }\n\n this.setFramugaHeightValue(this.window_height - cas_valid_val);\n this.setCasementsHeightValue(cas_valid_val);\n\t\t\tthis.$store.dispatch(\"setCasements\", this.current_casements);\n this.$store.dispatch(\"getTimeoutFiltersOffers\");\n },\n setSliderHeightValue(value) {\n this.$refs.sliderHeight.setValue(value);\n },\n casement_load() {\n\t\t\tthis.load_img = true;\n\t\t\tthis.$nextTick( function () {\n\t\t\t\tthis.$store.commit('SET_CASEMENT_LOAD');\n\t\t\t})\n },\n isFramuga(cas_i) {\n return this.window_casements.indexOf(this.framuga) === cas_i;\n },\n changeBeforeCasementNew(cas_i,diff,curr_val,new_casement_type) {\n this.windowHeightInput = this.window_height - diff;\n if (this.framuga) {\n let is_framuga = this.isFramuga(cas_i);\n let framuga_height = is_framuga ? curr_val : this.windowHeightInput - curr_val;\n this.setFramugaHeightValue(framuga_height);\n this.setCasementsHeightValue(this.windowHeightInput - framuga_height);\n this.setSliderValueHeightFromCurrentCasement();\n } else {\n this.setCasementsHeightValue(curr_val);\n }\n },\n checkBeforeCasementNewType(index,new_casement_type) {\n\t\t\t// check for current sizes to apply to new casement type\n let curr_width = this.window_casements[index].width\n let curr_height = this.window_casements[index].height\n\t\t\tlet area_curr = curr_width * curr_height;\n\n let index_of_type = casement_types_order.indexOf(new_casement_type);\n\n let min_area_next = casementAreas[index_of_type]['min']\n let max_area_next = casementAreas[index_of_type]['max']\n\n\t\t\tif (!(max_area_next >= area_curr && area_curr >= min_area_next)) {\n\t\t\t\tlet area_new = this.getFromRange(min_area_next,max_area_next,area_curr);\n let new_height = Math.floor(area_new / curr_width);\n let diff = curr_height - new_height;\n\n this.changeBeforeCasementNew(index,diff,new_height,new_casement_type);\n this.showErrorMessage();\n\t\t\t}\n },\n setOldHeightAndError(cas_i, old_value) {\n this.showErrorMessage();\n const input = this.$refs[`inputCasHeight_${cas_i}`].$el.querySelector(\"input\");\n input.value = old_value;\n input.dispatchEvent(new Event('input', {bubbles:true}));\n\n\t\t\tlet is_framuga = this.isFramuga(cas_i);\n this.errorHeightCasStyle[Number(!is_framuga)] = true;\n setTimeout(() => {\n this.errorHeightCasStyle[Number(!is_framuga)] = false;\n }, 2000);\n\t\t\t// this.setSliderValueFromCurrentCasement();\n },\n\t\tsetOldWidthAndError(cas_i ,old_value) {\n this.showErrorMessage();\n const input = this.$refs[`inputCasWidth_${cas_i}`].$el.querySelector(\"input\");\n input.value = old_value;\n input.dispatchEvent(new Event('input', {bubbles:true}));\n this.errorWidthCasStyle[cas_i] = true;\n setTimeout(() => {\n this.errorWidthCasStyle[cas_i] = false;\n\t\t\t}, 2000);\n\t\t\tthis.setSliderValueFromCurrentCasement();\n\t\t},\n }\n}\n","import { mapState } from 'vuex'\n\nexport default { \n data() {\n return {\n\t\t\tmaxDoorWidth: 280,\n\t\t\tmaxDoorHeigth: 280,\n doorInputWidth: 0,\n doorInputHeight: 0,\n errorDoorWidthStyle: false,\n errorDoorHeightStyle: false,\n maxMeasure: 24200,\n minMeasure: 2000\n }\n },\n computed: { \n door_height: { \n get() { \n return this.$store.state.currentWindowM.door_casement.height\n },\n set(value) { \n this.door_casement.height = value;\n }\n },\n door_width: { \n get() { \n return this.$store.state.currentWindowM.door_casement.width\n },\n set(value) { \n this.door_casement.width = value;\n }\n },\n door_name() { \n if (this.door_casement) return this.door_casement.name\n },\n door_casement() { \n return this.$store.state.currentWindowM.door_casement\n },\n door_side() { \n return this.$store.state.currentWindowM.door_casement.side\n },\n door_type() { \n return this.$store.state.currentWindowM.door_casement.type\n },\n door_image_code() { \n let door_image_code = 'doors/' + this.door_side + '/';\n if (this.door_casement.glass_type === 'half_sandwich') door_image_code += 'half_sandwich/'\n if (this.door_casement.type === 'swing_out') door_image_code += '2.webp'\n if (this.door_casement.type === 'rotary') door_image_code += '1.webp'\n return door_image_code\n },\n },\n methods: {\n setDoorWidth(function_event) {\n let value = Number(function_event.target.value);\n let measure = value * this.door_height;\n\t\t\tlet valid = measure >= this.minMeasure && measure <= this.maxMeasure && value <= this.maxDoorWidth;\n if (!valid) {\n this.showErrorMessage();\n this.errorDoorWidthStyle = true;\n setTimeout(() => this.errorDoorWidthStyle = false, 2000);\n this.doorInputWidth = this.door_width\n } else { \n this.door_width = value;\n this.$store.dispatch(\"getTimeoutFiltersOffers\", 2000);\n }\n },\n setDoorHeight(function_event) {\n let value = Number(function_event.target.value);\n let measure = value * this.door_width;\n\t\t\tlet valid = measure >= this.minMeasure && measure <= this.maxMeasure && value <= this.maxDoorHeigth;\n if (!valid) {\n this.showErrorMessage();\n this.errorDoorHeightStyle = true;\n setTimeout(() => this.errorDoorHeightStyle = false, 2000);\n this.doorInputHeight = this.door_height\n } else { \n this.door_height = value;\n this.$store.dispatch(\"getTimeoutFiltersOffers\", 2000);\n }\n },\n initDoor() { \n this.doorInputWidth = this.door_width;\n this.doorInputHeight = this.door_height;\n }\n },\n}\n"],"names":["wNames","wNamesTr","casement_types_order","casementAreas","railsData","WindowM","value","index","slider","min","max","whole_width","cas","i","curr_index","el","min_framuga","max_framuga","val","name","width","sum","max_width","max_casements_all","framuga_max","window_height","cases_heights_min","framuga_min","cases_heights_max","image_code","type_codes","code","type","type_code","all_widths","x","all_heights","hash","sizes","index_of_type","dimension","limit","key","curr_division","function_event","old_value","new_value","new_window_width","new_casements_widths","cas_i","available_width","count","full","not_touched_count","ordered_by_dead","medium","excessive_width","result","i_cas_from_ordered","curr_val","width_adder_for_curr","valid_val","results","old_width","new_width","touched_count","not_touched_cases_width","max_touched_count","new_not_touched_count","values","first_val","second_val","newValues","setNewValues","prev_val","curr_cas_val","valid_curr_cas_val","min_curr","next_val","next_cas_val","valid_next_cas_val","points","prev_width","valid_for_framuga","valid_for_casements","cas_val","cas_valid_val","diff","new_casement_type","framuga_height","curr_width","curr_height","area_curr","min_area_next","max_area_next","area_new","new_height","input","is_framuga","DoorM","door_image_code","measure"],"mappings":"6CAAA,MAAMA,EAAS,CAAC,iBAAkB,gBAAiB,iBAAkB,mBAAmB,EAClFC,EAAW,CAAC,iBAAiB,iBAAiB,iBAAkB,mBAAmB,EACnFC,EAAuB,CAAC,cAAc,SAAS,WAAW,EAG1DC,EAAgBC,EAAU,qBAAuBA,EAAU,qBAAqB,eAAiB,GAExFC,EAAA,CACb,MAAO,CACL,MAAO,CACR,WAAY,CACX,cAAeC,GAAU,KAAK,mBAAqBA,GAASA,GAAS,KAAK,mBAAsB,wBACh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