\n\n\n
${t.right.name.toUpperCase()}
\n${t.right.description}\n
`;const p=`\n${l.title}
\n${l.version}
\n\n
\n\n${b}\n
\n
\n\n
\nWhat is ${l.title}?
\n${l.description}
\n\n${l.valDescription}
\n\n${v}\n
\n
\n
`,$=`${l.title}
\n${l.version}
\n\n
\nInstructions
\n\n\tYou will be presented with ${a.length} statements. For each one, click the\n\tbutton with your opinion on it.\n
\n\n
\n\n
\n\n
`;var x="";for(const t of s)x+=`
`;const w=`${l.title}
\n${l.version}
\n\n
\nLoading...
\n\n${x}\n`;var k,y,C=0,T=[];function B(t=!1,e=!1){var n=t?a.sort((()=>.5-Math.random())):a;function i(){k.innerText=`Question ${C+1} of ${n.length}`,y.innerText=n[C].question}function o(t){T[C]={};for(const e of r)T[C][e.id]=n[C].effect[e.id]*s[t].modifier;C++,i()}function l(t=!1){var e=T[0];for(const t of r)e[t.id]=T.map((e=>e[t.id])).reduce(((t,e)=>t+e),0);var n=e;const i=t?m:g;for(const t in e)n[t]=(e[t]+i[t])/(.01*(i[t]+i[t]));location.search="?"+Object.values(n).map((t=>t.toFixed(1))).join(",")}document.body.innerHTML=w+d;let c=document.getElementsByClassName("button");for(let t=0;t{if(C+1{C>0?(C--,i()):_(F.index)})),k=document.getElementById("questionNumber"),y=document.getElementById("questionText"),i()}function L(t){const e=["Neutral","Moderate","Strong","Extreme","Fanatic"];for(let n=0;n50?e.left.name:e.right.name:"")}function q(){const t=Object.fromEntries(location.href.split("?")[1].split(",").map(((t,e)=>[r[e].id,parseFloat(t)]))),e=function(t){var e=[];for(let s=0;s50){if(100-t[r[s].id]<=o[n]||n===o.length-1){e[s]=r[s].tiers[n];break}}else if(t[r[s].id]<=o[n]||n===o.length-1){e[s]=r[s].tiers[r[s].tiers.length-n-1];break}}else e[s]=!1;return e}(t);document.body.innerHTML=function(t,e){var n="";for(let i=0;i${e[i]?`${s.name} Axis: ${e[i]}`:`${E(t[s.id],s)}`}${t[s.id]>a?t[s.id].toFixed(1)+"%":""}
${100-t[s.id]>a?(100-t[s.id]).toFixed(1)+"%":""}
`}return`${l.title}
\n\t${l.version}
\n\n
\nResults
\n${n}\n
\n\n\n\n
`}(t,e)+d,document.getElementById("backButton").addEventListener("click",(()=>{location.search=""})),document.getElementById("downloadButton").addEventListener("click",(()=>{var t=document.createElement("a");t.download="result.png",t.href=document.getElementById("banner").toDataURL(),t.click()})),window.onload=()=>{!function(t,e){const n=-24;var i=document.getElementById("banner").getContext("2d"),s=i.createLinearGradient(0,0,0,170+120*r.length+n);s.addColorStop(0,"#D0F0FF"),s.addColorStop(.5,"#FFFFFF"),s.addColorStop(1,"#FFE0F6"),i.fillStyle=s,i.fillRect(0,0,800,170+120*r.length+n),i.fillStyle=c.fgColor,i.font="700 "+4e3/i.measureText(l.title).width+"px "+l.mainFont,i.textAlign="left",i.fillText(l.title,20,96),i.font="50px "+l.mainFont,i.textAlign="right",i.font="300 "+12e3/i.measureText(l.link).width+"px "+l.mainFont,i.fillText(l.link,780,42),i.fillText(l.version,780,72),r.forEach(((r,s)=>{const a=72,d=120*s+n,u=170+d,h=180+d-((c.barThickness??a)+2*(c.outlineThickness??4)-80)/2,f=184+d-((c.barThickness??a)-a)/2,g=237.5+d+((c.barThickness??a)-a)/4,m=175+d-((c.barThickness??a)+2*(c.outlineThickness??4)-80)/2;var b=new Image(200,200);b.onload=()=>{i.drawImage(b,20,u,100,100)},b.src=o(r,!1);var v=new Image(200,200);v.onload=()=>{i.drawImage(v,680,u,100,100)},v.src=o(r,!0),i.fillStyle=c.valColor??c.fgColor,i.fillRect(120,h,560,(c.barThickness??a)+2*(c.outlineThickness??4)),i.fillStyle=r.left.color,i.fillRect(120,f,5.6*t[r.id]-(c.outlineThickness??4)/2,c.barThickness??a),i.fillStyle=r.right.color,i.fillRect(120+5.6*t[r.id]+(c.outlineThickness??4)/2,f,5.6*(100-t[r.id])-(c.outlineThickness??4)/2,c.barThickness??a),i.fillStyle=c.valColor??c.fgColor,i.font=.625*(c.barThickness??a)+"px "+l.mainFont,i.textAlign="left",t[r.id]>(c.limit??30)&&i.fillText(t[r.id].toFixed(1)+"%",130,g),i.textAlign="right",100-t[r.id]>(c.limit??30)&&i.fillText((100-t[r.id]).toFixed(1)+"%",670,g),i.fillStyle=c.fgColor,i.font="300 24px "+l.mainFont,i.textAlign="center",i.fillText(e[s]?`${r.name} Axis: ${e[s]}`:`${E(t[r.id],r)}`,400,m-5)}))}(t,e)}}var F;function _(t){switch(t){case F.index:document.body.innerHTML=p+d,document.getElementById("instructionButton").addEventListener("click",(()=>{_(F.instructions)}));break;case F.instructions:document.body.innerHTML=$+d,document.getElementById("quizButton").addEventListener("click",(()=>{_(F.quiz)})),document.getElementById("backButton").addEventListener("click",(()=>{_(F.index)})),document.getElementById("shuffleButton").addEventListener("click",(()=>{B(!0)}));break;case F.quiz:B();break;case F.results:q()}}!function(t){t[t.index=0]="index",t[t.instructions=1]="instructions",t[t.quiz=2]="quiz",t[t.results=3]="results"}(F||(F={})),document.title=l.title,location.search?_(F.results):_(F.index)})();