{"version":3,"sources":["jurisdictions.js"],"names":["jurisdictions","document","querySelectorAll","filter","section","alphaNavs","ShowByJurisdiction","getElementById","ShowByMap","container","querySelector","forEach","el","addEventListener","e","console","log","dataFilter","this","getAttribute","preventDefault","classList","remove","add","scrollIntoView","behavior","scrollToAnchorIDVanilla"],"mappings":"AAAA,SAASA,gBAEeC,SAASC,iBAAiB,yBAA9C,IACIC,EAASF,SAASC,iBAAiB,iCACnCE,EAAUH,SAASC,iBAAiB,8CACpCG,EAAYJ,SAASC,iBAAiB,kCACtCI,EAAqBL,SAASM,eAAe,4BAC7CC,EAAYP,SAASM,eAAe,mBACpCE,EAAYR,SAASS,cAAc,uBAGvCP,EAAOQ,SAAQ,SAAUC,GACrBA,EAAGC,iBAAiB,SAAS,SAAUC,GACnCC,QAAQC,IAAI,sBAEZ,IAAIC,EAAaC,KAAKC,aAAa,eACnCL,EAAEM,iBAGFf,EAAUM,SAAQ,SAAUG,GACxBA,EAAEJ,cAAc,aAAaW,UAAUC,OAAO,YAC9CR,EAAEJ,cAAc,gBAAkBO,EAAa,KAAKI,UAAUE,IAAI,eAGtEnB,EAAQO,SAAQ,SAAUG,GACtBA,EAAEO,UAAUC,OAAO,oCAGvBb,EAAUC,cAAc,iBAAmBO,EAAa,KAAKI,UAAUE,IAAI,iCAG9DtB,SAASM,eAAe,oBAC9BiB,eAAe,CAAEC,SAAU,iBAatCjB,GACAA,EAAUK,iBAAiB,SAAS,SAAUC,GAC1CA,EAAEM,iBACFnB,SAASM,eAAe,oBAAoBc,UAAUE,IAAI,UAC1DtB,SAASM,eAAe,WAAWc,UAAUC,OAAO,UAEpDI,wBAAwB,oBAG5BpB,GACAA,EAAmBO,iBAAiB,SAAS,SAAUC,GACnDA,EAAEM,iBACFnB,SAASM,eAAe,oBAAoBc,UAAUC,OAAO,UAC7DrB,SAASM,eAAe,WAAWc,UAAUE,IAAI,UAEjDG,wBAAwB","file":"../jurisdictions.js","sourcesContent":["function jurisdictions() {\r\n\r\n var countryHeader = document.querySelectorAll('.country-card__header');\r\n var filter = document.querySelectorAll('.alpha-nav__link.jurisdiction');\r\n var section = document.querySelectorAll('.JurisdictionAZList .country-card__section');\r\n var alphaNavs = document.querySelectorAll(\".JurisdictionAZList .alpha-nav\");\r\n var ShowByJurisdiction = document.getElementById(\"switchToJurisdictionView\");\r\n var ShowByMap = document.getElementById(\"switchToMapView\");\r\n var container = document.querySelector(\".JurisdictionAZList\");\r\n\r\n // Desktop filter\r\n filter.forEach(function (el) {\r\n el.addEventListener('click', function (e) {\r\n console.log('jurisdiction alpha');\r\n\r\n var dataFilter = this.getAttribute('data-filter');\r\n e.preventDefault();\r\n\r\n // Foreach top / bottom letter nav\r\n alphaNavs.forEach(function (e) {\r\n e.querySelector(\".bg--main\").classList.remove('bg--main');\r\n e.querySelector(\"[data-filter=\" + dataFilter + \"]\").classList.add('bg--main');\r\n });\r\n\r\n section.forEach(function (e) {\r\n e.classList.remove('country-card__section--active');\r\n });\r\n\r\n container.querySelector(\"[data-section=\" + dataFilter + \"]\").classList.add('country-card__section--active');\r\n\r\n // Can't work this out so setting a static value\r\n var anchor = document.getElementById('jurisdictionList');\r\n anchor.scrollIntoView({ behavior: \"smooth\" });\r\n })\r\n });\r\n\r\n // Mobile accordion\r\n // countryHeader.forEach(function (el) {\r\n // el.addEventListener('click', function (e) {\r\n // var parent = e.target.parentNode;\r\n // parent.classList.toggle('country-card__section--active');\r\n // })\r\n // });\r\n\r\n // Can now be on multiple pages so make sure this element exists\r\n if (ShowByMap) {\r\n ShowByMap.addEventListener('click', function (e) {\r\n e.preventDefault();\r\n document.getElementById(\"jurisdictionView\").classList.add(\"hidden\");\r\n document.getElementById(\"mapView\").classList.remove(\"hidden\");\r\n\r\n scrollToAnchorIDVanilla(\"mapViewAnchor\");\r\n });\r\n }\r\n if (ShowByJurisdiction) {\r\n ShowByJurisdiction.addEventListener('click', function (e) {\r\n e.preventDefault();\r\n document.getElementById(\"jurisdictionView\").classList.remove(\"hidden\");\r\n document.getElementById(\"mapView\").classList.add(\"hidden\");\r\n\r\n scrollToAnchorIDVanilla(\"jurisdictionViewAnchor\");\r\n });\r\n }\r\n} \r\n"]}