{"version":3,"sources":["Pages/Search/SearchBox.js"],"names":["SearchBox","form","searchinput","searchButton","formSubmitButton","searchSelect","onlyLessons","onlyAssets","document","getElementById","searchInput","value","onchange","event","options","selectedIndex","style","width","bind","onclick","_submitForm","onkeypress","which","keyCode","checkValidity","toString","trim","click","querySelector","submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAEMA,S;;;;;;;wDAEkBC,I,EAAMC,W,EAAaC,Y,EAAcC,gB,EAAkBC,Y,EAAcC,W,EAAaC,U,EAAY;AAAA;;AAC1G,6BAAKN,IAAL,GAAYO,SAASC,cAAT,CAAwBR,IAAxB,CAAZ;AACA,6BAAKS,WAAL,GAAmBF,SAASC,cAAT,CAAwBP,WAAxB,CAAnB;AACA,6BAAKC,YAAL,GAAoBK,SAASC,cAAT,CAAwBN,YAAxB,CAApB;AACA,6BAAKC,gBAAL,GAAwBI,SAASC,cAAT,CAAwBL,gBAAxB,CAAxB;AACA,6BAAKC,YAAL,GAAoBG,SAASC,cAAT,CAAwBJ,YAAxB,CAApB;AACA,6BAAKE,UAAL,GAAkBC,SAASC,cAAT,CAAwBF,UAAxB,CAAlB;AACA,6BAAKD,WAAL,GAAmBE,SAASC,cAAT,CAAwBH,WAAxB,CAAnB;AACA,6BAAKA,WAAL,CAAiBK,KAAjB,GAAyB,KAAKJ,UAAL,CAAgBI,KAAhB,GAAwB,OAAjD;;AAEA,6BAAKN,YAAL,CAAkBO,QAAlB,GAA8B,UAACC,KAAD,EAAW;;AAErC,gCAAI,MAAKR,YAAL,CAAkBS,OAAlB,CAA0B,MAAKT,YAAL,CAAkBU,aAA5C,EAA2DJ,KAA3D,IAAoE,aAAxE,EAAuF;AACnF,sCAAKL,WAAL,CAAiBK,KAAjB,GAAyB,MAAzB;AACA,sCAAKN,YAAL,CAAkBW,KAAlB,CAAwBC,KAAxB,GAAgC,OAAhC;AACH,6BAHD,MAIK,IAAI,MAAKZ,YAAL,CAAkBS,OAAlB,CAA0B,MAA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E;AACAH,yCAASC,cAAT,CAAwB,YAAxB,EAAsCE,KAAtC,GAA8C,KAAKJ,UAAL,CAAgBI,KAA9D;AACAH,yCAASoB,aAAT,CAAuB,YAAvB,EAAqCjB,KAArC,GAA6C,GAA7C;AACAH,yCAASC,cAAT,CAAwB,YAAxB,EAAsCkB,KAAtC;AACH,6BAND,MAMO;AACH,qCAAK1B,IAAL,CAAU4B,MAAV;AACH;AACJ,yBAlBD;AAmBH;;;;;;iCAGI7B,S","file":"SearchBox.js","sourcesContent":["\r\n\r\nclass SearchBox {\r\n\r\n initializeSearchBox(form, searchinput, searchButton, formSubmitButton, searchSelect, onlyLessons, onlyAssets) {\r\n this.form = document.getElementById(form);\r\n this.searchInput = document.getElementById(searchinput);\r\n this.searchButton = document.getElementById(searchButton);\r\n this.formSubmitButton = document.getElementById(formSubmitButton);\r\n this.searchSelect = document.getElementById(searchSelect);\r\n this.onlyAssets = document.getElementById(onlyAssets);\r\n this.onlyLessons = document.getElementById(onlyLessons);\r\n this.onlyLessons.value = this.onlyAssets.value = \"false\";\r\n\r\n this.searchSelect.onchange = ((event) => {\r\n\r\n if (this.searchSelect.options[this.searchSelect.selectedIndex].value == \"lessonsOnly\") {\r\n this.onlyLessons.value = \"true\";\r\n this.searchSelect.style.width = \"100px\";\r\n }\r\n else if (this.searchSelect.options[this.searchSelect.selectedIndex].value == \"assetsOnly\") {\r\n this.onlyAssets.value = \"true\";\r\n this.searchSelect.style.width = \"115px\";\r\n } else {\r\n this.searchSelect.style.width = \"80px\";\r\n }\r\n }).bind(this);\r\n\r\n this.searchButton.onclick = ((event) => {\r\n this._submitForm();\r\n }).bind(this);\r\n\r\n this.searchInput.onkeypress = ((event) => {\r\n if (event.which == 13 || event.keyCode == 13) {\r\n this._submitForm();\r\n return false;\r\n }\r\n return true;\r\n }).bind(this);\r\n\r\n this._submitForm = function()\r\n {\r\n if (!this.form.checkValidity() || this.searchInput.value.toString().trim() == \"\")\r\n {\r\n this.searchInput.value = '';\r\n this.formSubmitButton.click();\r\n return false;\r\n }\r\n \r\n if (document.querySelector(\".textSearchForm\")) {\r\n document.getElementById(\"resultsTextSearch\").value = this.searchInput.value;\r\n document.getElementById(\"onlyLessons\").value = this.onlyLessons.value;\r\n document.getElementById(\"onlyAssets\").value = this.onlyAssets.value;\r\n document.querySelector('.pageindex').value = \"1\";\r\n document.getElementById(\"formSubmit\").click();\r\n } else {\r\n this.form.submit();\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport { SearchBox };\r\n"]}