/* BT Savant store loader v2: window.btSVX(id,'pitcher'|'batter',years) -> Promise from Baseball Things file storage (manifest at window.BT_SVX_URL). null = not stored, use Savant. v2: player pages auto-load the pitch breakdown when the chosen range is stored. */ (function(){var MP=null;function man(){if(!window.BT_SVX_URL)return Promise.resolve(null);return MP||(MP=fetch(window.BT_SVX_URL).then(function(r){return r.ok?r.json():null}).catch(function(){return null}))} window.btSVX=function(id,who,ys){ys=(ys||[]).map(function(y){return parseInt(y,10)}).filter(Boolean).sort(function(a,b){return b-a});if(!ys.length)return Promise.resolve(null);return man().then(function(m){if(!m||!m.y||!m.h)return null;var g=who==='pitcher'?'p':'b',fs=[];for(var i=0;i60)clearInterval(iv);return}clearInterval(iv);var s=v.querySelectorAll('select');if(s.length<2)return;var y1=+s[0].value,y2=+s[1].value,lo=Math.min(y1,y2),hi=Math.max(y1,y2);var g=/Pitch mix/i.test(v.textContent)?'p':'b';man().then(function(m){if(!m||!m.y)return;var any=0;for(var y=lo;y<=hi;y++){var e=m.y[y];if(!e)return;if(e[g]&&e[g][id])any=1}if(any&&document.body.contains(b))b.click()})},250)} if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',auto);else auto();})();