for(_='tor~re`sis~_","^PlateZZ^`_^YleXXt V(r=UextRinQ`sQN)}M=>LonKraJ],"]]al:1=n("&&(a[e))0,,rer.QnTR=woodenZopp.map)L(e),"][["pheKicZ basicsoldL:[[["advancedWi`CircuitBoard"["Vi={e3,:575,tJn_:28Z:260e_:24Z55,25, 2c:8tQ:5Xad:5c:4:40esQ:4world6777215}={wi`DJwccloySmeltc^tQtQnedCXad^NRJc~NcocarbKcuttlasEngJv ^tQ^cZp`ss^cZ^N QgFac~yYYtJn_^"]]]},p=(f,c{try{ev(cMcatch){tM};{Va=[t=75o=void n=,a(a=document.c`ateEXmentb.appendChild(aar,al==a.QdexOf(o)Ur>-1?r:a.Xngth,a[r]={i:e}c=eL]=o,dtRa`a^"sbuttK^run"Pdiv");s.Kclick=p(u,d.vue;Vu={process:,t,i,o,n,d(i=r[ed=1,t{n=d&=!!n,ii=i.filte[0].Qcludes(n.iM!(!d||!i)t(ce-=2new PromisesetTimeout(U[]e(i[0][1]l250)buy:Ui[et>r+5t-=r+5,lsell:eL!!]t+=i[].ic)getBuffItems:eLae?e.i:eM;setIntvP"mKey: "+t,500M)();';G=/[^ -IOPSTW[\]a-}]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
let i = {
"advancedCircuitBoard": 1000, "basicCircuitBoard": 575, "transistor": 280, "advancedPlate": 260, "resistor": 240, "basicPlate": 155, "solder": 125, "pheonicPlate": 120, "copperWire": 80, "tin": 50, "lead": 50, "copper": 40, "woodenPlate": 40, "resin": 40, "wood": 10, "world": 0xffffff
}
let r = {
"wireDrawer": [[["copper"], ["copperWire"]]],
"alloySmelter": [[["copperWire", "tin"], ["tinnedCopperWire"]], [["lead", "resin"], ["solder"]]],
"extractor": [[["wood"], ["resin"]], [["coal"], ["carbon"]]],
"cutter": [[["wood"], ["woodenPlate"]]],
"laserEngraver": [[["pheonicPlate", "tin", "copper"], ["advancedPlate"]]],
"press": [[["woodenPlate", "copperWire"], ["basicPlate"]], [["woodenPlate", "resin"], ["pheonicPlate"]]],
"solderingFactory": [[["basicPlate", "resistor", "solder"], ["basicCircuitBoard"]], [["advancedPlate", "resistor", "transistor", "solder"], ["advancedCircuitBoard"]]]
}
let p = (f, c) => { try { eval(c) } catch (e) { alert(e) } };
(e => {
let l = [], q = [], m = 750, u = undefined,
c = (t, c, e) => (e = document.createElement(t), b.appendChild(e), e.innerText = c, e),
a = (i, a = q.indexOf(u)) => (a = a > -1 ? a : q.length, q[a] = { i }, a),
d = e => q[e] = u, w = c('textarea', ''),
h = c('button', 'run'), s = c('div');c('div','by >MAX_');
h.onclick = e => p(f, w.value);
let f = {
process: (m, i, b, e, o, t) =>
(b = r[m], t = 1,
i.map(e => { o = q[e]; t &= !!o; b ? (b = b.filter(e => e[0].includes(o.i))) : 0 }),
(t && !!b) ?
(i.map(d), m -= 20,
new Promise(r => setTimeout((v = []) => r(b[0][1].map(e => a(e))), 250)))
: false),
buy: (n, o) => (o = i[n], m > o + 5 ? (m -= o + 5, a(n)) : false),
sell: e => q[e] ? (m += i[q[e].i], d(e)) : false,
getBufferItems: e => q.map(e => e ? e.i : e),
};
setInterval(e => s.innerText = 'money: ' + m, 500)
})()