{"version":3,"sources":["productconfigurator.js"],"names":["action","blockId","code","productConfigurator","document","getElementById","language","documentElement","lang","initProductConfigurator","select","querySelectorAll","i","length","addEventListener","selectOptionsDdl","BindResult","html","outerHTML","initCartService","initKeepMePosted","selectedFootCross","footCrossDdl","footCrossIdx","selectedIndex","options","value","selectedColorLegs","colorLegsDdl","colorLegsIdx","selectedPaintColor","paintColorDdl","paintColorIdx","selectedTableTopColor","tableTopColorDdl","tableTopColorIdx","selectedBackrest","backrestDdl","backrestIdx","selectedColorBackrest","colorBackrestDdl","colorBackrestIdx","selectedColorArmrest","colorArmrestDdl","colorArmrestIdx","selectedColorSeating","colorSeatingDdl","colorSeatingIdx","selectedArmrest","armrestDdl","armrestIdx","selectedStackable","stackableDdl","stackableIdx","selectedModel","modelDdl","modelIdx","selectedDeskHeight","deskHeightDdl","deskHeightIdx","selectedExtraProduct","extraProductDdl","extraProductIdx","selectedDimensions","dimensionsDdl","dimensionsIdx","selectedTime","rentTimeDdl","timeIdx","fetch","method","headers","Accept","Content-Type","body","JSON","stringify","selectedBackrestType","then","res","text","err","console","log","getAttribute"],"mappings":"AAAA,aAEA,IACIA,OACAC,QACAC,KAHAC,oBAAsBC,SAASC,eAAe,gBAI9CC,SAAWF,SAASG,gBAAgBC,KAMxC,SAASC,0BACP,IAAIC,EAASN,SAASO,iBAAiB,cACvC,GAAe,OAAXD,EACF,IAAK,IAAIE,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,IACjCF,EAAOE,GAAGE,iBAAiB,SAAU,WACnCC,qBAKR,SAASC,WAAWC,GACCb,SAASC,eAAe,gBAC9Ba,UAAYD,EACzBE,kBACAV,0BACAW,mBAEF,SAASL,mBACP,IACIM,EADAC,EAAelB,SAASC,eAAe,2BAE3C,GAAqB,OAAjBiB,EAAuB,CAEzB,IAAIC,EAAeD,EAAaE,cAEhCH,EAAoBC,EAAaG,QAAQF,GAAcG,MAEzD,IACIC,EADAC,EAAexB,SAASC,eAAe,2BAE3C,GAAqB,OA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E,GACpBC,QAAQC,IAAIF,KA9KZ9E,MAAAA,sBACFH,OAASG,oBAAoBiF,aAAa,eAC1CnF,QAAUE,oBAAoBiF,aAAa,gBAC3ClF,KAAOC,oBAAoBiF,aAAa,qBA8K1C3E","sourcesContent":["var productConfigurator = document.getElementById(\"configurator\");\r\nvar action;\r\nvar blockId;\r\nvar code;\r\nvar language = document.documentElement.lang;\r\n\r\nif (productConfigurator !== null && productConfigurator !== undefined) {\r\n action = productConfigurator.getAttribute('data-action');\r\n blockId = productConfigurator.getAttribute('data-blockid');\r\n code = productConfigurator.getAttribute('data-productcode');\r\n}\r\n\r\nfunction initProductConfigurator() {\r\n var select = document.querySelectorAll(\".js-select\");\r\n if (select !== null) {\r\n for (var i = 0; i < select.length; i++) {\r\n select[i].addEventListener(\"change\", function () {\r\n selectOptionsDdl();\r\n });\r\n }\r\n }\r\n}\r\n\r\nfunction BindResult(html) {\r\n var configurator = document.getElementById(\"configurator\");\r\n\r\n configurator.outerHTML = html;\r\n\r\n initCartService();\r\n initProductConfigurator();\r\n initKeepMePosted();\r\n}\r\n\r\nfunction selectOptionsDdl() {\r\n\r\n var footCrossDdl = document.getElementById('selectedFootCrossOption');\r\n var selectedFootCross;\r\n\r\n if (footCrossDdl !== null) {\r\n // get the index of the selected option \r\n var footCrossIdx = footCrossDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedFootCross = footCrossDdl.options[footCrossIdx].value;\r\n }\r\n\r\n var colorLegsDdl = document.getElementById('selectedColorLegsOption');\r\n var selectedColorLegs;\r\n\r\n if (colorLegsDdl !== null) {\r\n // get the index of the selected option \r\n var colorLegsIdx = colorLegsDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedColorLegs = colorLegsDdl.options[colorLegsIdx].value;\r\n }\r\n\r\n var paintColorDdl = document.getElementById('selectedPaintColorOption');\r\n var selectedPaintColor;\r\n\r\n if (paintColorDdl !== null) {\r\n // get the index of the selected option \r\n var paintColorIdx = paintColorDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedPaintColor = paintColorDdl.options[paintColorIdx].value;\r\n }\r\n\r\n var tableTopColorDdl = document.getElementById('selectedTableTopColorOption');\r\n var selectedTableTopColor;\r\n\r\n if (tableTopColorDdl !== null) {\r\n // get the index of the selected option \r\n var tableTopColorIdx = tableTopColorDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedTableTopColor = tableTopColorDdl.options[tableTopColorIdx].value;\r\n }\r\n\r\n var backrestDdl = document.getElementById('selectedBackrestTypeOption');\r\n var selectedBackrest;\r\n\r\n if (backrestDdl !== null) {\r\n // get the index of the selected option \r\n var backrestIdx = backrestDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedBackrest = backrestDdl.options[backrestIdx].value;\r\n }\r\n\r\n var colorBackrestDdl = document.getElementById('selectedColorBackrestOption');\r\n var selectedColorBackrest;\r\n\r\n if (colorBackrestDdl !== null) {\r\n // get the index of the selected option \r\n var colorBackrestIdx = colorBackrestDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedColorBackrest = colorBackrestDdl.options[colorBackrestIdx].value;\r\n }\r\n\r\n var colorArmrestDdl = document.getElementById('selectedColorArmrestOption');\r\n var selectedColorArmrest;\r\n\r\n if (colorArmrestDdl !== null) {\r\n // get the index of the selected option \r\n var colorArmrestIdx = colorArmrestDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedColorArmrest = colorArmrestDdl.options[colorArmrestIdx].value;\r\n }\r\n\r\n var colorSeatingDdl = document.getElementById('selectedColorSeatingOption');\r\n var selectedColorSeating;\r\n\r\n if (colorSeatingDdl !== null) {\r\n // get the index of the selected option \r\n var colorSeatingIdx = colorSeatingDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedColorSeating = colorSeatingDdl.options[colorSeatingIdx].value;\r\n }\r\n\r\n var armrestDdl = document.getElementById('selectedArmrestOption');\r\n var selectedArmrest;\r\n\r\n if (armrestDdl !== null) {\r\n // get the index of the selected option \r\n var armrestIdx = armrestDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedArmrest = armrestDdl.options[armrestIdx].value;\r\n }\r\n\r\n var stackableDdl = document.getElementById('selectedStackableOption');\r\n var selectedStackable;\r\n\r\n if (stackableDdl !== null) {\r\n // get the index of the selected option \r\n var stackableIdx = stackableDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedStackable = stackableDdl.options[stackableIdx].value;\r\n }\r\n\r\n var modelDdl = document.getElementById('selectedModelOption');\r\n var selectedModel;\r\n\r\n if (modelDdl !== null) {\r\n // get the index of the selected option \r\n var modelIdx = modelDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedModel = modelDdl.options[modelIdx].value;\r\n }\r\n\r\n var deskHeightDdl = document.getElementById('selectedDeskHeightOption');\r\n var selectedDeskHeight;\r\n\r\n if (deskHeightDdl !== null) {\r\n // get the index of the selected option \r\n var deskHeightIdx = deskHeightDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedDeskHeight = deskHeightDdl.options[deskHeightIdx].value;\r\n }\r\n\r\n var extraProductDdl = document.getElementById('selectedExtraProductOption');\r\n var selectedExtraProduct;\r\n\r\n if (extraProductDdl !== null) {\r\n // get the index of the selected option \r\n var extraProductIdx = extraProductDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedExtraProduct = extraProductDdl.options[extraProductIdx].value;\r\n }\r\n\r\n var dimensionsDdl = document.getElementById('selectedDimensionsOption');\r\n var selectedDimensions;\r\n\r\n if (dimensionsDdl !== null) {\r\n // get the index of the selected option \r\n var dimensionsIdx = dimensionsDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedDimensions = dimensionsDdl.options[dimensionsIdx].value;\r\n }\r\n\r\n var rentTimeDdl = document.getElementById('selectedRentPeriodInMinutesOption');\r\n var selectedTime;\r\n\r\n if (rentTimeDdl !== null) {\r\n // get the index of the selected option\r\n var timeIdx = rentTimeDdl.selectedIndex;\r\n // get the value of the selected option \r\n selectedTime = rentTimeDdl.options[timeIdx].value;\r\n }\r\n\r\n fetch(action, {\r\n method: 'POST',\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({\r\n blockId,\r\n code,\r\n language,\r\n selectedFootCross,\r\n selectedPaintColor,\r\n selectedColorLegs,\r\n selectedTableTopColor,\r\n selectedBackrestType: selectedBackrest,\r\n selectedDimensions,\r\n selectedColorBackrest,\r\n selectedColorArmrest,\r\n selectedColorSeating,\r\n selectedArmrest,\r\n selectedStackable,\r\n selectedModel,\r\n selectedDeskHeight,\r\n selectedExtraProduct,\r\n selectedTime\r\n })\r\n })\r\n .then(function (res) {\r\n return res.text();\r\n })\r\n .then(function (html) {\r\n BindResult(html);\r\n })\r\n .catch(function (err) {\r\n console.log(err);\r\n });\r\n}\r\n\r\ninitProductConfigurator();"],"file":"productconfigurator.js"}