1import{c as d,g}from"./buildContentUrl-_jBIOcz7.js";const f="gameInfoPopup",b=(n,t)=>`${d}/${t}/${n}.json?${g()}`;let p=null,c=null;const m=(n,t)=>{n.querySelectorAll("[data-key]").forEach(o=>{const r=o.getAttribute("data-key"),y=o.getAttribute("data-view-type"),a=r!==null&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:"",s=a!==null&&a!==""&&a!==void 0&&(Array.isArray(a)?a.length>0:!0);o.classList.toggle("hidden",!s);const u=o.querySelector("[data-value]");if(u)if(y==="progress-bar"){const l=o.querySelector(".progress-bar__value");l&&l.setAttribute("data-value",s?String(a):"");const i=o.querySelector(".progress-bar__label");i&&(i.textContent=s?String(a):"")}else if(r==="themes"){const l=Array.isArray(a)?a:[];u.textContent=s?l.slice(0,3).join(", "):""}else if(r==="features"){const l=Array.isArray(a)?a:[];u.textContent=s?l[0]:""}else u.textContent=s?String(a):""})},A=(n,t)=>{const e=n.querySelector(".popup__header");e&&(e.textContent=t)},h=(n,t)=>{const e=n.querySelector("[data-game-content]");e&&(e.innerHTML=t)},_=(n,t)=>{const e=n.querySelector("[data-game-slug]");e&&(t?e.setAttribute("href",`/slots/${t}`):e.removeAttribute("href"))},w=async(n,t)=>{try{const e=await fetch(b(n,t));return e.ok?await e.json():null}catch{return null}};function S(n){window.GameInfoPopup={show:async t=>{if(!t)return;const e=n?.config?.id;if(!e)return;const o=document.getElementById(f);if(!o)return;let r=null;if(t===p&&c)r=c;else{if(r=await w(t,e),!r)return;p=t,c=r}m(o,r.attributes||{}),A(o,r.name||""),h(o,r.content||""),_(o,r.slug||""),window.Popup?.openById(f)}}}export{S as bootstrapGameInfoPopup};
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.