{"version":3,"names":["updateURL","state","document","getElementById","value","category","sort_by","url","window","location","origin","pathname","params","URLSearchParams","append","toString","href","replace","resetPagination","addEventListener"],"sources":["news.js"],"sourcesContent":["function resetPagination(url) {\n return url.replace(/\\/page\\/\\d+/, ''); // Remove the pagination from the URL\n}\n\nfunction updateURL() {\n const state = document.getElementById('state-select').value;\n const category = document.getElementById('category-select').value;\n const sort_by = document.getElementById('sort-by-select').value;\n let url = window.location.origin + window.location.pathname;\n \n let params = new URLSearchParams();\n\n if (state != 0) {\n params.append('state_id', state);\n }\n if (category != 0) {\n params.append('cat_id', category);\n }\n if (sort_by) {\n params.append('sort_by', sort_by);\n }\n\n if (params.toString()) {\n url += '?' + params.toString();\n }\n \n //url += '#Posts'; // Append the hash target\n \n window.location.href = resetPagination(url);\n}\n\ndocument.getElementById('state-select').addEventListener('change', updateURL);\ndocument.getElementById('category-select').addEventListener('change', updateURL);\ndocument.getElementById('sort-by-select').addEventListener('change', updateURL);\n"],"mappings":"yBAIA,SAASA,IACL,MAAMC,EAAQC,SAASC,eAAe,gBAAgBC,MAChDC,EAAWH,SAASC,eAAe,mBAAmBC,MACtDE,EAAUJ,SAASC,eAAe,kBAAkBC,MAC1D,IAAIG,EAAMC,OAAOC,SAASC,OAASF,OAAOC,SAASE,SAE/CC,EAAS,IAAIC,gBAEJ,GAATZ,GACAW,EAAOE,OAAO,WAAYb,GAEd,GAAZI,GACAO,EAAOE,OAAO,SAAUT,GAExBC,GACAM,EAAOE,OAAO,UAAWR,GAGzBM,EAAOG,aACPR,GAAO,IAAMK,EAAOG,YAKxBP,OAAOC,SAASO,KA5BpB,SAAyBT,GACrB,OAAOA,EAAIU,QAAQ,cAAe,GACtC,CA0B2BC,CAAgBX,EAC3C,CAEAL,SAASC,eAAe,gBAAgBgB,iBAAiB,SAAUnB,GACnEE,SAASC,eAAe,mBAAmBgB,iBAAiB,SAAUnB,GACtEE,SAASC,eAAe,kBAAkBgB,iBAAiB,SAAUnB,E","ignoreList":[]}