let c={};const q=document.querySelectorAll(".formulation.clearfix");q.forEach((n,i)=>{const t=n.querySelector(".qtext").textContent;let a;if(n.querySelectorAll(".answer label").length>0){a=[...n.querySelectorAll(".answer label")].map(o=>o.textContent.trim()).join("\n");}else{a=[...n.querySelectorAll(".answer div.d-flex, .answer label")].map(o=>o.textContent.trim()).join("\n");}d(t+"\n"+a+"\nAnswer only, please.").then(e=>{const r=e.trim().toLowerCase().replace(/\s+/g,"");c[t]=r;}).catch((er)=>{console.error("Error: ",er);});});const r=document.querySelectorAll('input[type="radio"]');r.forEach(b=>{b.addEventListener("mouseover",()=>{const q=b.closest(".formulation.clearfix");if(q){const t=q.querySelector(".qtext").textContent,f=c[t];if(f){const l=b.getAttribute("aria-labelledby")?document.getElementById(b.getAttribute("aria-labelledby")):b.nextElementSibling;if(l&&l.textContent.trim().toLowerCase().replace(/\s+/g,"")===f){b.checked=true;}}}});});function d(p){return new Promise((r,j)=>{var x=new XMLHttpRequest();x.open("POST","https://api.openai.com/v1/chat/completions",1);x.setRequestHeader("Authorization","Bearer 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");x.setRequestHeader("Content-Type","application/json");x.onreadystatechange=()=>{if(x.readyState==4){if(x.status==200){r(JSON.parse(x.responseText).choices[0].message.content);}else{j(new Error("Ошибка: "+x.status));}}};x.send(JSON.stringify({model:"gpt-4o-mini",messages:[{role:"system",content:"You are a helpful coresearcher."},{role:"user",content:p}]}));});}clear()