1document.addEventListener("DOMContentLoaded",function(){let x=document.querySelector(".portal-membership-directory-wrap");if(x){let d=x.querySelector(".membership-search-input"),p=x.querySelector(".portal-membership-directory-list"),u=x.querySelector(".portal-membership-directory-load-more"),m=x.querySelectorAll(".member-count-number"),y=x.querySelectorAll(".member-count-label"),t=x.querySelector(".sort-pill"),r=x.querySelector(".sort-pill-trigger"),o=x.querySelector(".sort-pill-direction"),n=x.querySelector(".sort-pill-label-value"),f=1,s=null,g=!1,h="true"===x.dataset.hasMore,b=parseInt(x.dataset.totalMembers,10)||0,v="name",L="asc",S=window.membershipDirectoryData||{restUrl:"/wp-json/suredash/v1/membership-directory",nonce:"",perPage:20,icons:{users:""},i18n:{loading:"Loading...",loadingMore:"Loading more...",noResults:"No members found.",members:"members",results:"Results",sortAscending:"Sort ascending",sortDescending:"Sort descending"}},e=null,a=d?d.value.trim():"";var i,l;function c(){t&&t.classList.remove("is-open"),r&&r.setAttribute("aria-expanded","false")}function E(){f=1,h=!0,p&&(p.innerHTML="");var e=x.querySelector(".portal-membership-directory-empty");e&&e.remove(),u&&(u.style.display="flex"),q(!0)}async function q(t=!1){if(!g){var e,r,o,n;e=t,g=!0,u&&(u.classList.add("loading"),u.style.display="flex",r=u.querySelector(".portal-membership-directory-loading-label"))&&(r.textContent=e?S.i18n.loading:S.i18n.loadingMore);try{o=t,(n=new URLSearchParams).append("page",f),n.append("per_page",S.perPage),!o&&0<b&&n.append("total",b),(o=d?d.value.trim():"")&&n.append("search",o),v&&n.append("orderby",v),L&&n.append("order",L);var s=n,a=await fetch(S.restUrl+"?"+s.toString(),{method:"GET",headers:{"X-WP-Nonce":S.nonce}});if(!a.ok)throw new Error("Network response was not ok");var i=await a.json();if(i.success&&i.data){var l=i.data.html;b=i.data.total,h=i.data.hasMore;{var c=b;let t=c.toLocaleString(),e=(m.forEach(e=>{e.textContent=t}),d&&0<d.value.trim().length),r=e?S.i18n.results:S.i18n.members;y.forEach(e=>{e.textContent=r})}x.dataset.hasMore=h?"true":"false",p&&(t?(p.innerHTML="",l&&l.trim()?p.innerHTML=l:w()):p.insertAdjacentHTML("beforeend",l)),h&&0!==b||!u?h&&u&&(u.style.display="flex"):u.style.display="none"}}catch(e){console.error("Error fetching members:",e),t&&w()}finally{g=!1,u&&u.classList.remove("loading")}}}function w(){p&&(p.innerHTML=` 2 <div class="portal-membership-directory-empty sd-flex sd-flex-col sd-items-center sd-justify-center sd-p-24 sd-color-text-tertiary sd-text-center"> 3 ${S.icons.users} 4 <h3 class="sd-m-0 sd-mb-8 sd-font-18 sd-font-semibold">${S.i18n.noResults}</h3> 5 <p class="sd-m-0 sd-font-14">Try adjusting your search or filter criteria.</p> 6 </div> 7 `,u)&&(u.style.display="none")}d&&d.addEventListener("input",(i=function(){var e=d?d.value.trim():"";e!==a&&(a=e,E())},l=300,function(...e){clearTimeout(s),s=setTimeout(()=>i.apply(this,e),l)})),r&&r.addEventListener("click",function(e){e.stopPropagation(),t&&(e=!t.classList.contains("is-open"),t.classList.toggle("is-open"),r)&&r.setAttribute("aria-expanded",e?"true":"false")}),o&&o.addEventListener("click",function(e){e.stopPropagation(),L="asc"===L?"desc":"asc",t&&(t.dataset.direction=L),o&&o.setAttribute("aria-label","asc"===L?S.i18n.sortAscending||"Sort ascending":S.i18n.sortDescending||"Sort descending"),E()}),t&&t.querySelectorAll(".sort-pill-option").forEach(e=>{e.addEventListener("click",function(e){var r;e.stopPropagation(),e=(r=this).dataset.sort,c(),e!==v&&(v=e,t&&t.querySelectorAll(".sort-pill-option").forEach(e=>{var t=e===r;e.classList.toggle("active",t),e.setAttribute("aria-selected",t?"true":"false")}),n&&((e=r.dataset.shortLabel)?n.textContent=e:(e=r.querySelector(".sort-pill-option-label"),n.textContent=(e||r).textContent.trim())),E())})}),document.addEventListener("click",function(e){e.target.closest(".sort-pill")||c()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&c()}),u&&"IntersectionObserver"in window&&(e=new IntersectionObserver(e=>{e.forEach(e=>
7{e.isIntersecting&&h&&!g&&h&&!g&&(f++,q(!1))})},{root:null,rootMargin:"200px",threshold:0})).observe(u)}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.