{"version":3,"file":"js/quiz_rules_handler-9904a04503c4feefb0ce.js","mappings":"8EAAAA,SAASC,iBAAiB,oBAAqBC,IAC7C,MAAMC,EAAsBH,SAASI,eAAe,oBAC9CC,EAAkBL,SAASI,eAAe,gBAC1CE,EAAyBN,SAASI,eAAe,uBACjDG,EAAoBP,SAASI,eAAe,cAC5CI,EAA2BR,SAASI,eAAe,qBACnDK,EAAaF,EAAoB,IAAIG,UAAUC,MAAMJ,GAAqB,KAC1EK,EAAoBJ,EAA2B,IAAIE,UAAUC,MAAMH,GAA4B,KAEjGL,GAAuBE,GAAmBC,GAA0BG,GAAcG,IACpFT,EAAoBF,iBAAiB,UAAWY,IAC9CR,EAAgBS,UAAYD,EAAEE,OAAOC,OAAO,IAG9CX,EAAgBJ,iBAAiB,SAAS,KACpCE,EAAoBa,UAEtBP,EAAWQ,OACXR,EAAWS,SAASjB,iBAAiB,mBAAmB,SAASkB,IAC/DP,EAAkBQ,OAClBX,EAAWS,SAASG,oBAAoB,kBAAmBF,EAC7D,IACF,IAGFb,EAAuBL,iBAAiB,SAAS,KAE/C,IAAIqB,EAAgBtB,SAASI,eAAe,iBACxCkB,GACFA,EAAcC,QAChB,IAEJ,G","sources":["webpack://app/./app/javascript/packs/quiz_rules_handler.js"],"sourcesContent":["document.addEventListener('DOMContentLoaded', (event) => {\n const acknowledgeCheckbox = document.getElementById('acknowledgeRules');\n const startQuizButton = document.getElementById('startQuizBtn');\n const confirmStartQuizButton = document.getElementById('confirmStartQuizBtn');\n const rulesModalElement = document.getElementById('rulesModal');\n const confirmationModalElement = document.getElementById('confirmationModal');\n const rulesModal = rulesModalElement ? new bootstrap.Modal(rulesModalElement) : null;\n const confirmationModal = confirmationModalElement ? new bootstrap.Modal(confirmationModalElement) : null;\n\n if (acknowledgeCheckbox && startQuizButton && confirmStartQuizButton && rulesModal && confirmationModal) {\n acknowledgeCheckbox.addEventListener('change', (e) => {\n startQuizButton.disabled = !e.target.checked;\n });\n\n startQuizButton.addEventListener('click', () => {\n if (acknowledgeCheckbox.checked) {\n // Close the rules modal before showing the confirmation modal\n rulesModal.hide();\n rulesModal._element.addEventListener('hidden.bs.modal', function onModalHidden() {\n confirmationModal.show();\n rulesModal._element.removeEventListener('hidden.bs.modal', onModalHidden);\n });\n }\n });\n\n confirmStartQuizButton.addEventListener('click', () => {\n // Assuming your form has the id 'startQuizForm'\n let startQuizForm = document.getElementById('startQuizForm');\n if (startQuizForm) {\n startQuizForm.submit();\n }\n });\n }\n});\n"],"names":["document","addEventListener","event","acknowledgeCheckbox","getElementById","startQuizButton","confirmStartQuizButton","rulesModalElement","confirmationModalElement","rulesModal","bootstrap","Modal","confirmationModal","e","disabled","target","checked","hide","_element","onModalHidden","show","removeEventListener","startQuizForm","submit"],"sourceRoot":""}