{"version":3,"sources":["theme.js"],"names":["$","document","ready","section","getElementsByTagName","i","length","addEventListener","tabletWidth","window","matchMedia","each","num_choices","key","val","settings","$flyout","$facet","closest","$parent","$collapseElement","$which","show","bsCollapse","bootstrap","Collapse","getOrCreateInstance","toggle","matches","hide","console","warn","error","on","FWP","buildQueryString","querystring","facets","jQuery"],"mappings":"AAAA,CAAA,SAAWA,GACPA,EAAEC,QAAQ,EAAEC,MAAM,WACd,IADFD,IAAQE,EAAQF,SAAAG,qBAAY,SAAA,EAC1BC,EAAA,EAAAA,EAAAF,EAAAG,OAAAD,CAAA,GACuBD,4BAAZD,EAAGF,GAASG,IACbD,EAAUA,GAAAA,aAAgBE,aAAK,OAAA,CAK7C,CAAC,EAACJ,SAAAM,iBAAA,iBAAA,WACF,IAAAC,EAAAC,OAAAC,WAAA,oBAAA,EACAT,EAAQU,KAACJ,IAAAA,SAAiBK,YAAA,SAAkBC,EAAAC,GAClCN,IAAAA,EAAcC,EAAAA,kBAAkBI,CAAA,EAC3BE,EAASH,EAAAA,QAAa,aAAeE,EAClCE,EAAKC,EAAAC,QAAoBL,aAAI,EACnCM,GAAAA,EAAUF,QAAcD,EAACV,OAAc,CAC7BW,EAAOC,EAAQZ,OAAAa,EAAcH,EAMnCI,GALG,IAACd,EAAUU,EAAQV,KAAM,EAAEe,EAAAC,KAAA,EAKXL,EAAOC,QAAQ,WAAW,GADjD,GAAA,EAAAE,EAAAd,OACIc,IACAA,IAAgBG,EAAaC,UAAAC,SAAAC,oBAAAN,EAAA,GAAA,CAAAO,OAAA,CAAA,CAAA,CAAA,EAAGnB,EAAAoB,QAC5BL,EAAAD,KAAA,EACuFC,EAAAM,KAAA,CAGhF,CAFHrB,MAAYoB,GACFE,QAAOC,KAAA,4CAAAC,CAAA,CACd,CAEP,CAMhB,CAAC,CACL,CAAC,EAGDhC,EALQC,QAAA,EAAAgC,GAAA,iBAAA,WAEN,KADIC,IAAAC,iBAAA,EAOEnC,EAAE,cAAc,EAAE6B,KAAK,EAFvBO,EAAAA,cAAkBD,EAAAA,KAAAA,CAO1B,CAAC,EADGnC,EAAAC,QAAA,EAAAgC,GAAA,iBAAA,WACFC,IAAAG,OAAA,OAKkB/B,QAAU,EAH9BN,EAAA,yBAAA,EAAA6B,KAAA,EAEQO,EAAAA,yBAAyB,EAAQd,KAAC,CAM1C,CAAC,CACJ,EAAEgB,MAJM","file":"theme.min.js","sourcesContent":["(function ($) {\r\n $(document).ready(function () {\r\n // fixing accessibility issues with the events calendar plugin\r\n let section = document.getElementsByTagName(\"section\");\r\n for (var i = 0; i < section.length; i++) {\r\n if (section[i].id == \"tribe-events-pg-template\") {\r\n section[i].setAttribute(\"aria-label\", \"event\");\r\n }\r\n }\r\n });\r\n // WP Facets - Hide Wrapper if no filter options exist\r\n document.addEventListener('facetwp-loaded', function () {\r\n const tabletWidth = window.matchMedia(\"(min-width: 768px)\");\r\n $.each(FWP.settings.num_choices, function (key, val) {\r\n var $facet = $('.facetwp-facet-' + key);\r\n var $parent = $facet.closest('.facet-wrap');\r\n var $flyout = $facet.closest('.flyout-row');\r\n if ($parent.length || $flyout.length) {\r\n var $which = $parent.length ? $parent : $flyout;\r\n (0 === val) ? $which.hide() : $which.show();\r\n\r\n // Add check for .collapse element\r\n var $collapseElement = $facet.closest('.collapse');\r\n if ($collapseElement.length > 0) { // Only proceed if element exists\r\n try {\r\n var bsCollapse = bootstrap.Collapse.getOrCreateInstance($collapseElement[0], { toggle: false });\r\n if (tabletWidth.matches) {\r\n bsCollapse.show();\r\n } else {\r\n bsCollapse.hide();\r\n }\r\n } catch (error) {\r\n console.warn('Bootstrap Collapse initialization failed:', error);\r\n }\r\n }\r\n }\r\n });\r\n });\r\n\r\n // WP Facets - Hide Reset Button if no facets are selected\r\n $(document).on('facetwp-loaded', function () {\r\n var querystring = FWP.buildQueryString();\r\n if ('' === querystring) {\r\n $('.facet-reset').hide();\r\n }\r\n else {\r\n $('.facet-reset').show();\r\n }\r\n });\r\n\r\n // WP Facets - Hide Reset for search if empty\r\n $(document).on('facetwp-loaded', function () {\r\n var querystring = FWP.facets['search'];\r\n if (querystring.length <= 0) {\r\n $('.facet-btn-search-reset').hide();\r\n } else {\r\n $('.facet-btn-search-reset').show();\r\n }\r\n });\r\n})(jQuery);\r\n"]}