(()=>{const e=document.getElementById("fi-ads");if(e){const a=e.dataset.code;if(void 0!==a&&a.length>0){const e=document.getElementById("ads-fi-params"),o=new FormData;if(o.append("token",a),e){var t=1;window.screen.width<960&&(t=2),o.append("tela",e.dataset.page),o.append("clube",e.dataset.clube),o.append("campeonato",e.dataset.campeonato),o.append("display",t)}fetch("https://painel.futebolinterior.com.br/api/fi",{method:"post",body:o}).then((async e=>{const t=await e.json();t.error||(window.onload=()=>{!function(e){const t={5:"script__header-fi-ads",6:"script__header-per-fi-ads",7:"script__aside-fi-ads",8:"script__center-fi-ads",9:"script__center-per-fi-ads",10:"script__foot-fi-ads",11:"script__foot-per-fi-ads",12:"cript__bl-li-aside-fi-ads",13:"script__bl-li-footer-fi-ads",14:"script__temp-menu-center-fi-ads",15:"main"};e.forEach((e=>{if(e.banner_imagem_desk||e.banner_imagem_mobile){let t=e.banner_imagem_desk;document.body.clientWidth<=425&&(t=e.banner_imagem_mobile);const a=e.banner_url||"#",o={1:"post__aside-fi-ads",2:"ads-body-head",3:"ads-body-center",4:"ads-body-foot",5:"ads-footer"}[e.banner_posicao],n=document.getElementById(o);if(n){const o=document.createElement("div");o.classList.add("ads-body___ads_center");const d=document.createElement("a");d.href=a,"#"!==a&&(d.target="_blank");const i=document.createElement("img");i.src=t,i.alt=e.nome,d.appendChild(i),o.appendChild(d),n.appendChild(o)}}if(e.script_codigo&&e.script_codigo.length>0){const a=e.script_codigo,o={1:"head",2:"body",3:"body",4:"footer"},n=document.querySelector(o[e.script_posicao]);if(n){const t=document.createRange().createContextualFragment(a);"2"===e.script_posicao?n.prepend(t):n.append(t)}const d=t[e.script_posicao],i=["15"].includes(e.script_posicao)?document.querySelector(d):document.getElementById(d);if(i){const o=()=>{if(i.getBoundingClientRect().top<50){const n=document.createRange().createContextualFragment(a);["2","15"].includes(e.script_posicao)?i.prepend(n):i.append(n),window.removeEventListener("scroll",o),delete t[e.script_posicao]}};window.addEventListener("scroll",o),o()}}}))}(t.data)})})).catch((e=>{}))}}})();