1const l=new Set,m=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e??"");if(!t)return"Invalid date";const n=m[Number(t[2])-1];return n?`${n} ${Number(t[3])}, ${t[1]}`:"Invalid date"}function p(e,t){const n=e.split("").slice(0,t).join("");return n.split("").slice(0,n.lastIndexOf(" ")).join("")+" ..."}function f(e){const t=e.split(" "),n=t.pop()??"";return t.join(" ")+" "+n.charAt(0)+"."}const h='<svg class="icon icon-star star-icon" aria-hidden="true" role="presentation"><use href="/svgs/icons.svg#icon-star"></use></svg>';function v(e,t){const n=document.createElement("div");n.className=t.cardClass;const a=document.createElement("article");a.className="review masonry-content";const r=document.createElement("div");r.className="stars",r.innerHTML=h.repeat(Math.max(0,Math.trunc(e.rating||0)));const c=document.createElement("div");c.className="content";const s=document.createElement("h2");s.className="title",s.innerHTML=p(e.comment??"",75);const o=document.createElement("div");o.className="content-container",o.innerHTML=e.comment??"";const i=document.createElement("div");if(i.className="author",i.innerHTML=f(e.author??""),c.append(s,o,i),t.showDates){const d=document.createElement("div");d.className="date",d.textContent=u(e.api_created_at),c.append(d)}return a.append(r,c),n.append(a),n}function N(e,t){for(const s of l)if(s.element===e)return;const n={nextPageUrl:t?.nextPageUrl??null,showDates:!!t?.showDates,cardClass:t?.cardClass??"card masonry-item bg-white"};let a=n.nextPageUrl;const r=e.parentElement?.querySelector("[data-archive-load-more]")??null,c=s=>{s.preventDefault(),a&&fetch(a,{headers:{Accept:"application/json"}}).then(o=>o.json()).then(o=>{for(const i of o.data??[])e.append(v(i,n));a=o.next_page_url??null,!a&&r&&r.remove()}).catch(()=>{})};r?.addEventListener("click",c),l.add({element:e,loadMore:r,onLoadMore:c})}function M(){for(const e of l)e.loadMore?.removeEventListener("click",e.onLoadMore);l.clear()}export{M as destroy,N as initialize};
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.