{"version":3,"file":"js/forms-9998ea9d07fcb715789a.js","mappings":"8FAAAA,SAASC,iBAAiB,oBAAoB,KAC7BD,SAASE,iBAAiB,SAElCC,SAAQC,IACbA,EAAGH,iBAAiB,SAAS,KAC3B,IAAII,EAASD,EAAGE,cAEhB,GAAIF,EAAGG,UAAUC,SAAS,cAM1B,IALEJ,EAAGG,UAAUE,OAAO,cAKfJ,GAAQ,CACb,GAAIA,EAAOE,UAAUC,SAAS,sBAAuB,CACnD,IAAIE,EAAUL,EAAOM,mBAErB,KACED,IAGCA,EAAQH,UAAUC,SAAS,4BAC1BE,EAAQH,UAAUC,SAAS,sBAC7B,CAGA,MAAMI,EAASF,EACfA,EAAUA,EAAQC,mBAGbC,EAAOL,UAAUC,SAAS,4BAC7BI,EAAON,cAAcO,YAAYD,EAErC,CAEAP,EAAOS,WAAWX,SAAQY,IAEtBA,EAAMR,WACNQ,EAAMR,UAAUC,SAAS,qBAEzBH,EAAOQ,YAAYE,EACrB,IAGFV,EAAOE,UAAUE,OAAO,qBAC1B,CAEAJ,EAASA,EAAOC,aAClB,IACA,GACF,G","sources":["webpack://outage_buddy/./app/javascript/packs/forms.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", () => {\n const inputs = document.querySelectorAll(\"input\");\n\n inputs.forEach(el => {\n el.addEventListener(\"input\", () => {\n let parent = el.parentElement;\n\n if (el.classList.contains(\"is-invalid\")) {\n el.classList.remove(\"is-invalid\");\n } else {\n return;\n }\n\n while (parent) {\n if (parent.classList.contains(\"form-group-invalid\")) {\n let sibling = parent.nextElementSibling;\n\n while (\n sibling &&\n // Allow strength meter because that can be between error output and\n // the input\n (sibling.classList.contains(\"password-strength-meter\") ||\n sibling.classList.contains(\"invalid-feedback\"))\n ) {\n // We need to cache the el before we remove it, otherwise we can't\n // get its next sibling\n const thisEl = sibling;\n sibling = sibling.nextElementSibling;\n\n // If the element is the strength meter, we don't want to remove it\n if (!thisEl.classList.contains(\"password-strength-meter\")) {\n thisEl.parentElement.removeChild(thisEl);\n }\n }\n\n parent.childNodes.forEach(child => {\n if (\n child.classList &&\n child.classList.contains(\"invalid-feedback\")\n ) {\n parent.removeChild(child);\n }\n });\n\n parent.classList.remove(\"form-group-invalid\");\n }\n\n parent = parent.parentElement;\n }\n });\n });\n});\n"],"names":["document","addEventListener","querySelectorAll","forEach","el","parent","parentElement","classList","contains","remove","sibling","nextElementSibling","thisEl","removeChild","childNodes","child"],"sourceRoot":""}