/* bt-player-list-shim v2 (Oct 17, 2026): answers the "all #player posts" paging requests from the player index file (one small file) instead of ~24 sequential Content API pages. If feature_image is asked for, makes ONE limit=all request for slug/url/feature_image and fills the rest from the index. Anything else passes through. */ (function(){if(!window.fetch||window.__btPLS)return;window.__btPLS=2;var of=window.fetch.bind(window),P=null; function idx(){if(!P){var u=window.BT_PIDX_URL;P=u?of(u).then(function(r){if(!r.ok)throw 0;return r.json()}).then(function(x){if(!x||!x.d)throw 0;return x.d}):Promise.reject(0)}return P} function esc(s){return String(s).replace(/&/g,"&").replace(/"/g,""").replace(/-1){var U=new URL(url,location.href),q=U.searchParams,f=q.get("filter")||"",fl=(q.get("fields")||"").split(","); if((f==="tag:hash-player"||f==="tag:#player")&&q.get("fields")&&fl.every(function(k){return OK[k]})){var pg=+(q.get("page")||1),fi=fl.indexOf("feature_image")>-1; var resp=function(posts){return new Response(JSON.stringify({posts:posts,meta:{pagination:{page:pg,limit:"all",pages:1,total:posts.length,next:null,prev:null}}}),{status:200,headers:{"Content-Type":"application/json"}})}; if(pg>1)return Promise.resolve(resp([])); var img=fi?(function(){var V=new URL(U.href);V.searchParams.set("fields","slug,feature_image");V.searchParams.set("limit","all");V.searchParams.delete("page");return of(V.href).then(function(r){return r.json()}).then(function(j){var m={};(j.posts||[]).forEach(function(p){m[p.slug]=p.feature_image||null});return m})})():Promise.resolve({}); return Promise.all([idx(),img]).then(function(a){var d=a[0],m=a[1];return resp(d.map(function(x){var o={};fl.forEach(function(k){o[k]=k==="title"?x[2]:k==="url"?location.origin+"/players/"+x[1]+"/":k==="slug"?x[1]:k==="id"?String(x[0]):k==="feature_image"?(m[x[1]]||null):'
'});return o}))}).catch(function(){return of(input,init)})}}}catch(e){}return of(input,init)}})();