临时
-页面将会在几秒内自动跳转。
-diff --git a/README.md b/README.md index 16417f4b..0c6b6cbf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# 568tools -Online Tools +# 568Tools 在线工具箱 + +568Tools 在线工具箱是在线工具的集合。使用大部分工具无需注册、下载或上传到服务器。 + +服务涵盖:文件转换、加密解密、站长工具、代码开发、生活相关等。 \ No newline at end of file diff --git a/data.json b/data.json new file mode 100644 index 00000000..229dc9df --- /dev/null +++ b/data.json @@ -0,0 +1,27 @@ +[ + { + "name":"PJ568的博客", + "url":"https://PJ568.eu.org/", + "type":"568服务" + }, + { + "name":"568Tools 在线工具箱", + "url":"https://Tools.PJ568.eu.org/", + "type":"568服务" + }, + { + "name":"转转雀 - Github 文件加速", + "url":"https://proxy.PJ568.eu.org/", + "type":"568服务" + }, + { + "name":"Chat.pj568.eu.org", + "url":"https://Chat.pj568.eu.org/", + "type":"568服务" + }, + { + "name":"32 位 x86 虚拟机", + "url":"/tool/v86/", + "type":"软件模拟" + } +] \ No newline at end of file diff --git a/index.html b/index.html index c931b2d1..2e2f4020 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,43 @@ - -
- -页面将会在几秒内自动跳转。
-致力于创造并维护无需注册、下载和上传即可免费使用的静态在线工具环境。部分项目来源于开源项目,浅蓝色标记为热门工具。点击查看 json 数据。
如果您有问题或建议,请不要吝啬您的留言反馈,感谢使用及分享!本站欢迎提交您的页面,本站将持续更新。
下载 [568Tools 工具箱] 浏览器扩展插件或应用程序以供离线使用:谷歌 Chrome、火狐 Firefox、微软 Edge、crx文件下载。
>>0,8)+" | "+u);for(var z=0;z>>0,8)+" -> "+h(D.address,8)+" | "+u+" (at "+h(C,8)+")"))}}}}var e=this,g={};this.debug=g;g.init=function(){function l(p){10===p?(dbg_log(n,LOG_BIOS),n=""):n+=String.fromCharCode(p)}if(DEBUG&&e.io){var n="";e.io.register_write(1026,this,l);e.io.register_write(1280,this,l)}};g.get_regs_short=b;g.dump_regs=function(){if(DEBUG){var l=b();dbg_log(l[0], +LOG_CPU);dbg_log(l[1],LOG_CPU)}};g.get_state=a;g.dump_state=function(l){DEBUG&&dbg_log(a(l),LOG_CPU)};g.dump_stack=function(l,n){if(DEBUG){var p=e.reg32[REG_ESP];dbg_log("========= STACK ==========");if(n>=l||void 0===n)l=5,n=-5;for(;l>n;l--){var t=" ";l||(t="=> ");t+=h(l,2)+" | ";dbg_log(t+h(p+4*l,8)+" | "+h(e.read32s(p+4*l)>>>0))}}};g.dump_page_structures=function(){if(e.cr[4]&CR4_PAE){dbg_log("PAE enabled");for(var l=0;4>l;l++){var n=e.read32s(e.cr[3]+8*l);n&1&&d(n&4294963200,!0,l<<30)}}else dbg_log("PAE disabled"), +d(e.cr[3],!1,0)};g.dump_gdt_ldt=function(){function l(n,p){for(var t=0;t >4,x="",z=v>>5&3;x=v&128?x+" P ":x+"NP ";v&16?(x=u&4?x+"32b ":x+"16b ",v&8?(x+="X ",v&4&&(x+="C ")):x+="R ",x+="RW "):x+="sys: "+h(v&15);u&8&&(q=q<<12|4095);dbg_log(h(t&-8,4)+" "+h(r>>>0,8)+" ("+h(q>>>0,8)+" bytes) "+x+"; dpl = "+z+", a = "+v.toString(2)+", f = "+u.toString(2))}}DEBUG&&(dbg_log("gdt: (len = "+ +h(e.gdtr_size[0])+")"),l(e.translate_address_system_read(e.gdtr_offset[0]),e.gdtr_size[0]),dbg_log("\nldt: (len = "+h(e.segment_limits[REG_LDTR])+")"),l(e.translate_address_system_read(e.segment_offsets[REG_LDTR]),e.segment_limits[REG_LDTR]))};g.dump_idt=function(){if(DEBUG)for(var l=0;l
>5&3;var q=5===(n&31)?"task gate ":14===(n&31)?"intr gate ":15=== +(n&31)?"trap gate ":"invalid ";q=n&128?q+" P":q+"NP";dbg_log(h(l>>3,4)+" "+h(p>>>0,8)+", "+h(t,4)+"; "+q+"; dpl = "+r+", t = "+n.toString(2))}};g.get_memory_dump=function(l,n){if(DEBUG)return void 0===l?(l=0,n=e.memory_size[0]):void 0===n&&(n=l,l=0),e.mem8.slice(l,l+n).buffer};g.memory_hex_dump=function(l,n){if(DEBUG){n=n||64;for(var p,t,r=0;r >4;r++){p=h(l+(r<<4),5)+" ";for(var q=0;16>q;q++)t=e.read8(l+(r<<4)+q),p+=h(t,2)+" ";p+=" ";for(q=0;16>q;q++)t=e.read8(l+(r<<4)+q),p+=33>t||126 p;p++){n=h(128*p*l,8)+" | ";for(var t=0;128>t;t++)n+=0 >>0)+": "+v86util.pads(t.bytes.map(r=>h(r,2).slice(-2)).join(" "),20)+" "+t.mnemonic+" "+t.op_str)}),dbg_log("")}catch(t){dbg_log("Could not disassemble: "+Array.from(n).map(r=>h(r,2)).join(" "))}};let m;g.dump_wasm=function(l){if(void 0===m&&(m="function"===typeof require?require("./libwabt.js"):new window.WabtModule,void 0===m)){dbg_log("Warning: Missing libwabt, wasm dump not available"); +return}l=l.slice();try{var n=m.readWasm(l,{readDebugNames:!1});n.generateNames();n.applyNames();const r=n.toText({foldExprs:!0,inlineExport:!0});dbg_log(r)}catch(r){var p=new Blob([l]),t=document.createElement("a");t.download="failed.wasm";t.href=window.URL.createObjectURL(p);t.dataset.downloadurl=["application/octet-stream",t.download,t.href].join(":");t.click();window.URL.revokeObjectURL(t.src);console.log(r.toString())}finally{n&&n.destroy()}}};const ELF_MAGIC=1179403647; +let types=DataView.prototype,U8={size:1,get:types.getUint8,set:types.setUint8},U16={size:2,get:types.getUint16,set:types.setUint16},U32={size:4,get:types.getUint32,set:types.setUint32},pad=function(a){return{size:a,get:b=>-1}},Header=create_struct([{magic:U32},{class:U8},{data:U8},{version0:U8},{osabi:U8},{abiversion:U8},{pad0:pad(7)},{type:U16},{machine:U16},{version1:U32},{entry:U32},{phoff:U32},{shoff:U32},{flags:U32},{ehsize:U16},{phentsize:U16},{phnum:U16},{shentsize:U16},{shnum:U16},{shstrndx:U16}]); +console.assert(52===Header.reduce((a,b)=>a+b.size,0));let ProgramHeader=create_struct([{type:U32},{offset:U32},{vaddr:U32},{paddr:U32},{filesz:U32},{memsz:U32},{flags:U32},{align:U32}]);console.assert(32===ProgramHeader.reduce((a,b)=>a+b.size,0));let SectionHeader=create_struct([{name:U32},{type:U32},{flags:U32},{addr:U32},{offset:U32},{size:U32},{link:U32},{info:U32},{addralign:U32},{entsize:U32}]);console.assert(40===SectionHeader.reduce((a,b)=>a+b.size,0)); +function create_struct(a){return a.map(function(b){var c=Object.keys(b);console.assert(1===c.length);c=c[0];b=b[c];console.assert(0 >1];if(m!==LINUX_BOOT_HDR_CHECKSUM1)dbg_log("Bad checksum1: "+h(m));else if(m=g[LINUX_BOOT_HDR_HEADER>>1]|g[LINUX_BOOT_HDR_HEADER+2>>1]<<16,m!==LINUX_BOOT_HDR_CHECKSUM2)dbg_log("Bad checksum2: "+h(m));else{m=g[LINUX_BOOT_HDR_VERSION>>1];dbg_assert(514<=m);var l=e[LINUX_BOOT_HDR_LOADFLAGS];dbg_assert(l& +LINUX_BOOT_HDR_LOADFLAGS_LOADED_HIGH);var n=g[LINUX_BOOT_HDR_XLOADFLAGS>>1],p=f[LINUX_BOOT_HDR_INITRD_ADDR_MAX>>2],t=f[LINUX_BOOT_HDR_KERNEL_ALIGNMENT>>2],r=e[LINUX_BOOT_HDR_RELOCATABLE_KERNEL],q=e[LINUX_BOOT_HDR_MIN_ALIGNMENT],v=f[LINUX_BOOT_HDR_CMDLINE_SIZE>>2],u=f[LINUX_BOOT_HDR_PAYLOAD_OFFSET>>2],x=f[LINUX_BOOT_HDR_PAYLOAD_LENGTH>>2],z=f[LINUX_BOOT_HDR_PREF_ADDRESS>>2],C=f[LINUX_BOOT_HDR_PREF_ADDRESS+4>>2],D=f[LINUX_BOOT_HDR_INIT_SIZE>>2];dbg_log("kernel boot protocol version: "+h(m));dbg_log("flags="+ +h(l)+" xflags="+h(n));dbg_log("code32_start="+h(f[LINUX_BOOT_HDR_CODE32_START>>2]));dbg_log("initrd_addr_max="+h(p));dbg_log("kernel_alignment="+h(t));dbg_log("relocatable="+r);dbg_log("min_alignment="+h(q));dbg_log("cmdline max="+h(v));dbg_log("payload offset="+h(u)+" size="+h(x));dbg_log("pref_address="+h(C)+":"+h(z));dbg_log("init_size="+h(D));e[LINUX_BOOT_HDR_TYPE_OF_LOADER]=LINUX_BOOT_HDR_TYPE_OF_LOADER_NOT_ASSIGNED;e[LINUX_BOOT_HDR_LOADFLAGS]=l&~LINUX_BOOT_HDR_LOADFLAGS_QUIET_FLAG&~LINUX_BOOT_HDR_LOADFLAGS_KEEP_SEGMENTS| +LINUX_BOOT_HDR_LOADFLAGS_CAN_USE_HEAPS;g[LINUX_BOOT_HDR_HEAP_END_PTR>>1]=56832;g[LINUX_BOOT_HDR_VIDMODE>>1]=65535;dbg_log("heap_end_ptr="+h(56832));d+="\x00";dbg_assert(d.length >2]=581632;for(e=0;e >2]=k;f[LINUX_BOOT_HDR_RAMDISK_SIZE>>2]=e;dbg_assert(655360>524288+d.length);a.set(d,524288);a.set(b,1048576);return{option_rom:{name:"genroms/kernel.bin",data:make_linux_boot_rom(32768,57344)}}}} +function make_linux_boot_rom(a,b){const c=new Uint8Array(256);(new Uint16Array(c.buffer))[0]=43605;c[2]=1;var d=3;c[d++]=250;c[d++]=184;c[d++]=a>>0;c[d++]=a>>8;c[d++]=142;c[d++]=192;c[d++]=142;c[d++]=216;c[d++]=142;c[d++]=224;c[d++]=142;c[d++]=232;c[d++]=142;c[d++]=208;c[d++]=188;c[d++]=b>>0;c[d++]=b>>8;c[d++]=234;c[d++]=0;c[d++]=0;c[d++]=a+32>>0;c[d++]=a+32>>8;dbg_assert(512>d);a=d;b=c[a]=0;for(d=0;d keyCode not found: ",q,r)}};function MouseAdapter(a,b){function c(u){if(!v.enabled||!v.emu_enabled)return!1;var x=b||document.body,z;if(!(z=document.pointerLockElement))a:{for(u=u.target;u.parentNode;){if(u===x){z=!0;break a}u=u.parentNode}z=!1}return z}function d(u){c(u)&&(u=u.changedTouches)&&u.length&&(u=u[u.length-1],r=u.clientX,q=u.clientY)}function e(u){if(n||t||p)v.bus.send("mouse-click",[!1,!1,!1]),n=t=p=!1}function g(u){if(v.bus&&c(u)&&v.is_running){var x=0,z=0,C=u.changedTouches;C?C.length&&(C=C[C.length-1],x=C.clientX- +r,z=C.clientY-q,r=C.clientX,q=C.clientY,u.preventDefault()):"number"===typeof u.movementX?(x=u.movementX,z=u.movementY):"number"===typeof u.webkitMovementX?(x=u.webkitMovementX,z=u.webkitMovementY):"number"===typeof u.mozMovementX?(x=u.mozMovementX,z=u.mozMovementY):(x=u.clientX-r,z=u.clientY-q,r=u.clientX,q=u.clientY);v.bus.send("mouse-delta",[.15*x,-(.15*z)]);b&&v.bus.send("mouse-absolute",[u.pageX-b.offsetLeft,u.pageY-b.offsetTop,b.offsetWidth,b.offsetHeight])}}function f(u){c(u)&&m(u,!0)}function k(u){c(u)&& +m(u,!1)}function m(u,x){v.bus&&(1===u.which?n=x:2===u.which?t=x:3===u.which?p=x:dbg_log("Unknown event.which: "+u.which),v.bus.send("mouse-click",[n,t,p]),u.preventDefault())}function l(u){if(c(u)){var x=u.wheelDelta||-u.detail;0>x?x=-1:0 {switch(n.data.type){case "queue":l.queue_push(n.data.value);break;case "sampling-rate":l.source_samples_per_destination=n.data.value/sampleRate}};return l}var m=[new Float32Array(256),new Float32Array(256)];Reflect.setPrototypeOf(k.prototype,AudioWorkletProcessor.prototype);Reflect.setPrototypeOf(k,AudioWorkletProcessor);k.prototype.process=k.prototype.process=function(l,n,p){for(l=0;l l?(l+=this.source_buffer_previous[0].length,this.source_buffer_previous[n][l]):this.source_buffer_current[n][l]};k.prototype.ensure_enough_data=function(l){var n=this.source_buffer_current[0].length;n-this.source_block_start this.queued_samples&&this.queue_length&&this.dbg_log("Not enough samples - should not happen during midway of playback");this.source_buffer_previous=this.source_buffer_current;this.source_buffer_current=this.queue_shift();var l=this.source_buffer_current[0].length;if(256>l){for(var n=this.queue_start,p=0;256>l&&p this.queued_samples/this.source_samples_per_destination&&this.port.postMessage({type:"pump"})};k.prototype.queue_push=function(l){this.queue_length {URL.revokeObjectURL(g);this.node_processor=new AudioWorkletNode(this.audio_context,"dac-processor",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[2],parameterData:{},processorOptions:{}});this.node_processor.port.postMessage({type:"sampling-rate",value:this.sampling_rate}); +this.node_processor.port.onmessage=f=>{switch(f.data.type){case "pump":this.pump();break;case "debug-log":dbg_log("SpeakerWorkletDAC - Worklet: "+f.data.value)}};this.node_processor.connect(this.node_output)});this.mixer_connection=c.add_source(this.node_output,MIXER_SRC_DAC);this.mixer_connection.set_gain_hidden(3);a.register("dac-send-data",function(f){this.queue(f)},this);a.register("dac-enable",function(f){this.enabled=!0},this);a.register("dac-disable",function(){this.enabled=!1},this);a.register("dac-tell-sampling-rate", +function(f){dbg_assert(0 this.pump(),1E3*b);a.start(this.buffered_time);this.buffered_time+= +c;setTimeout(()=>this.pump(),0)};SpeakerBufferSourceDAC.prototype.pump=function(){this.enabled&&(this.buffered_time-this.audio_context.currentTime>DAC_QUEUE_RESERVE||this.bus.send("dac-request-data"))}; +function SpeakerDACDebugger(a,b){this.audio_context=a;this.node_source=b;this.node_processor=null;this.node_gain=this.audio_context.createGain();this.node_gain.gain.setValueAtTime(0,this.audio_context.currentTime);this.node_gain.connect(this.audio_context.destination);this.is_active=!1;this.queued_history=[];this.output_history=[];this.queued=[[],[]];this.output=[[],[]]} +SpeakerDACDebugger.prototype.start=function(a){this.is_active=!0;this.queued=[[],[]];this.output=[[],[]];this.queued_history.push(this.queued);this.output_history.push(this.output);this.node_processor=this.audio_context.createScriptProcessor(1024,2,2);this.node_processor.onaudioprocess=b=>{this.output[0].push(b.inputBuffer.getChannelData(0).slice());this.output[1].push(b.inputBuffer.getChannelData(1).slice())};this.node_source.connect(this.node_processor);this.node_processor.connect(this.node_gain); +setTimeout(()=>{this.stop()},a)};SpeakerDACDebugger.prototype.stop=function(){this.is_active=!1;this.node_source.disconnect(this.node_processor);this.node_processor.disconnect();this.node_processor=null};SpeakerDACDebugger.prototype.push_queued_data=function(a){this.is_active&&(this.queued[0].push(a[0].slice()),this.queued[1].push(a[1].slice()))};SpeakerDACDebugger.prototype.download_txt=function(a,b){a=this.output_history[a][b].map(c=>c.join(" ")).join(" ");dump_file(a,"dacdata.txt")}; +SpeakerDACDebugger.prototype.download_csv=function(a){a=this.output_history[a];for(var b=[],c=0;cm?void 0===this.update_timer&&(this.update_timer=setTimeout(()=>{this.update_timer=void 0;var l=Date.now();dbg_assert(15<=l-this.last_update);this.last_update=l;this.render()},16-m)):(void 0!==this.update_timer&&(clearTimeout(this.update_timer),this.update_timer=void 0),this.last_update=k,this.render())};this.render=function(){a.value=this.text; +this.text_new_line&&(this.text_new_line=!1,a.scrollTop=1E9)};this.send_char=function(k){f.bus&&f.bus.send("serial0-input",k)}}function SerialRecordingAdapter(a){this.text="";a.register("serial0-output-char",function(b){this.text+=b},this)} +function SerialAdapterXtermJS(a,b){this.element=a;if(window.Terminal){var c=this.term=new window.Terminal;c.setOption("logLevel","off");c.write("This is the serial console. Whatever you type or paste here will be sent to COM1");var d=c.onData(function(e){for(let g=0;g a||(this.last_connect_attempt=Date.now(),this.socket=new WebSocket(this.url),this.socket.binaryType="arraybuffer",this.socket.onopen=this.handle_open.bind(this),this.socket.onmessage=this.handle_message.bind(this),this.socket.onclose=this.handle_close.bind(this),this.socket.onerror=this.handle_error.bind(this))}}; +NetworkAdapter.prototype.send=function(a){this.socket&&1===this.socket.readyState?this.socket.send(a):(this.send_queue.push(a),this.send_queue.length>2*this.send_queue_limit&&(this.send_queue=this.send_queue.slice(-this.send_queue_limit)),this.connect())};NetworkAdapter.prototype.change_proxy=function(a){this.url=a;this.socket&&(this.socket.onclose=function(){},this.socket.onerror=function(){},this.socket.close(),this.socket=void 0)};function V86Starter(a){this.cpu_is_running=!1;var b=Bus.create();this.bus=b[0];this.emulator_bus=b[1];var c,d;const e=new WebAssembly.Table({element:"anyfunc",initial:WASM_TABLE_SIZE+WASM_TABLE_OFFSET});b={cpu_exception_hook:f=>this.cpu_exception_hook&&this.cpu_exception_hook(f),hlt_op:function(){return c.hlt_op()},abort:function(){dbg_assert(!1)},microtick:v86.microtick,get_rand_int:function(){return v86util.get_rand_int()},pic_acknowledge:function(){c.pic_acknowledge()},io_port_read8:function(f){return c.io.port_read8(f)}, +io_port_read16:function(f){return c.io.port_read16(f)},io_port_read32:function(f){return c.io.port_read32(f)},io_port_write8:function(f,k){c.io.port_write8(f,k)},io_port_write16:function(f,k){c.io.port_write16(f,k)},io_port_write32:function(f,k){c.io.port_write32(f,k)},mmap_read8:function(f){return c.mmap_read8(f)},mmap_read16:function(f){return c.mmap_read16(f)},mmap_read32:function(f){return c.mmap_read32(f)},mmap_write8:function(f,k){c.mmap_write8(f,k)},mmap_write16:function(f,k){c.mmap_write16(f, +k)},mmap_write32:function(f,k){c.mmap_write32(f,k)},mmap_write64:function(f,k,m){c.mmap_write64(f,k,m)},mmap_write128:function(f,k,m,l,n){c.mmap_write128(f,k,m,l,n)},log_from_wasm:function(f,k){f=v86util.read_sized_string_from_mem(d,f,k);dbg_log(f,LOG_CPU)},console_log_from_wasm:function(f,k){f=v86util.read_sized_string_from_mem(d,f,k);console.error(f)},dbg_trace_from_wasm:function(){dbg_trace(LOG_CPU)},codegen_finalize:(f,k,m,l,n)=>{c.codegen_finalize(f,k,m,l,n)},jit_clear_func:f=>c.jit_clear_func(f), +jit_clear_all_funcs:()=>c.jit_clear_all_funcs(),__indirect_function_table:e};let g=a.wasm_fn;g||(g=f=>new Promise(k=>{let m=DEBUG?"v86-debug.wasm":"v86.wasm",l="v86-fallback.wasm";if(a.wasm_path){m=a.wasm_path;const n=m.lastIndexOf("/");l=(-1===n?"":m.substr(0,n))+"/"+l}else"undefined"===typeof window&&"string"===typeof __dirname?(m=__dirname+"/"+m,l=__dirname+"/"+l):(m="build/"+m,l="build/"+l);v86util.load_file(m,{done:async n=>{try{const {instance:p}=await WebAssembly.instantiate(n,f);k(p.exports)}catch(p){v86util.load_file(l, +{done:async t=>{({instance:t}=await WebAssembly.instantiate(t,f));k(t.exports)}})}},progress:n=>{this.emulator_bus.send("download-progress",{file_index:0,file_count:1,file_name:m,lengthComputable:n.lengthComputable,total:n.total,loaded:n.loaded})}})}));g({env:b}).then(f=>{d=f.memory;f.rust_init();f=this.v86=new v86(this.emulator_bus,{exports:f,wasm_table:e});c=f.cpu;this.continue_init(f,a)})} +V86Starter.prototype.continue_init=async function(a,b){function c(r,q){switch(r){case "hda":g.hda=this.disk_images.hda=q;break;case "hdb":g.hdb=this.disk_images.hdb=q;break;case "cdrom":g.cdrom=this.disk_images.cdrom=q;break;case "fda":g.fda=this.disk_images.fda=q;break;case "fdb":g.fdb=this.disk_images.fdb=q;break;case "multiboot":g.multiboot=this.disk_images.multiboot=q.buffer;break;case "bzimage":g.bzimage=this.disk_images.bzimage=q.buffer;break;case "initrd":g.initrd=this.disk_images.initrd=q.buffer; +break;case "bios":g.bios=q.buffer;break;case "vga_bios":g.vga_bios=q.buffer;break;case "initial_state":g.initial_state=q.buffer;break;case "fs9p_json":g.fs9p_json=q;break;default:dbg_assert(!1,r)}}function d(r,q){if(q)if(q.get&&q.set&&q.load)f.push({name:r,loadable:q});else{if("bios"===r||"vga_bios"===r||"initial_state"===r||"multiboot"===r||"bzimage"===r||"initrd"===r)q.async=!1;q.buffer instanceof ArrayBuffer?(q=new v86util.SyncBuffer(q.buffer),f.push({name:r,loadable:q})):"undefined"!==typeof File&& +q.buffer instanceof File?(void 0===q.async&&(q.async=268435456<=q.buffer.size),q=q.async?new v86util.AsyncFileBuffer(q.buffer):new v86util.SyncFileBuffer(q.buffer),f.push({name:r,loadable:q})):q.url?q.async?(q=q.use_parts?new v86util.AsyncXHRPartfileBuffer(q.url,q.size,q.fixed_chunk_size):new v86util.AsyncXHRBuffer(q.url,q.size,q.fixed_chunk_size),f.push({name:r,loadable:q})):f.push({name:r,url:q.url,size:q.size}):dbg_log("Ignored file: url="+q.url+" buffer="+q.buffer)}}async function e(){if(g.fs9p&& +g.fs9p_json){if(g.initial_state?dbg_log("Filesystem basefs ignored: Overridden by state image"):g.fs9p.load_from_json(g.fs9p_json),b.bzimage_initrd_from_filesystem){const {bzimage_path:r,initrd_path:q}=this.get_bzimage_initrd_from_filesystem(g.fs9p);dbg_log("Found bzimage: "+r+" and initrd: "+q);const [v,u]=await Promise.all([g.fs9p.read_file(q),g.fs9p.read_file(r)]);c.call(this,"initrd",new v86util.SyncBuffer(v.buffer));c.call(this,"bzimage",new v86util.SyncBuffer(u.buffer))}}else dbg_assert(!b.bzimage_initrd_from_filesystem, +"bzimage_initrd_from_filesystem: Requires a filesystem");this.serial_adapter&&this.serial_adapter.show&&this.serial_adapter.show();this.bus.send("cpu-init",g);g.initial_state&&(a.restore_state(g.initial_state),g.initial_state=void 0);b.autostart&&this.bus.send("cpu-run");this.emulator_bus.send("emulator-loaded")}this.bus.register("emulator-stopped",function(){this.cpu_is_running=!1},this);this.bus.register("emulator-started",function(){this.cpu_is_running=!0},this);var g={};this.disk_images={fda:void 0, +fdb:void 0,hda:void 0,hdb:void 0,cdrom:void 0};g.acpi=b.acpi;g.load_devices=!0;g.log_level=b.log_level;g.memory_size=b.memory_size||67108864;g.vga_memory_size=b.vga_memory_size||8388608;g.boot_order=b.boot_order||531;g.fastboot=b.fastboot||!1;g.fda=void 0;g.fdb=void 0;g.uart1=b.uart1;g.uart2=b.uart2;g.uart3=b.uart3;g.cmdline=b.cmdline;g.preserve_mac_from_state_image=b.preserve_mac_from_state_image;g.mac_address_translation=b.mac_address_translation;g.cpuid_level=b.cpuid_level;b.network_adapter?this.network_adapter= +b.network_adapter(this.bus):b.network_relay_url&&(this.network_adapter=new NetworkAdapter(b.network_relay_url,this.bus));g.enable_ne2k=!0;b.disable_keyboard||(this.keyboard_adapter=new KeyboardAdapter(this.bus));b.disable_mouse||(this.mouse_adapter=new MouseAdapter(this.bus,b.screen_container));b.screen_container?this.screen_adapter=new ScreenAdapter(b.screen_container,this.bus):b.screen_dummy&&(this.screen_adapter=new DummyScreenAdapter(this.bus));b.serial_container&&(this.serial_adapter=new SerialAdapter(b.serial_container, +this.bus));b.serial_container_xtermjs&&(this.serial_adapter=new SerialAdapterXtermJS(b.serial_container_xtermjs,this.bus));b.disable_speaker||(this.speaker_adapter=new SpeakerAdapter(this.bus));var f=[];b.state&&console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");for(var k="bios vga_bios cdrom hda hdb fda fdb initial_state multiboot bzimage initrd".split(" "),m=0;m "/"+e);a=(a.read_dir("/boot/")||[]).map(e=>"/boot/"+e);let c,d;for(let e of[].concat(b,a)){const g=/old/i.test(e)||/fallback/i.test(e),f=/vmlinuz/i.test(e)||/bzimage/i.test(e),k=/initrd/i.test(e)||/initramfs/i.test(e);!f||d&&g||(d=e);!k||c&&g||(c=e)}c&&d||(console.log("Failed to find bzimage or initrd in filesystem. Files:"),console.log(b.join(" ")),console.log(a.join(" ")));return{initrd_path:c, +bzimage_path:d}};V86Starter.prototype.run=async function(){this.bus.send("cpu-run")};goog.exportProperty(V86Starter.prototype,"run",V86Starter.prototype.run);V86Starter.prototype.stop=async function(){this.cpu_is_running&&await new Promise(a=>{const b=()=>{this.remove_listener("emulator-stopped",b);a()};this.add_listener("emulator-stopped",b);this.bus.send("cpu-stop")})};goog.exportProperty(V86Starter.prototype,"stop",V86Starter.prototype.stop); +V86Starter.prototype.destroy=async function(){await this.stop();this.v86.destroy();this.keyboard_adapter&&this.keyboard_adapter.destroy();this.network_adapter&&this.network_adapter.destroy();this.mouse_adapter&&this.mouse_adapter.destroy();this.screen_adapter&&this.screen_adapter.destroy();this.serial_adapter&&this.serial_adapter.destroy();this.speaker_adapter&&this.speaker_adapter.destroy()};goog.exportProperty(V86Starter.prototype,"destroy",V86Starter.prototype.destroy); +V86Starter.prototype.restart=function(){this.bus.send("cpu-restart")};goog.exportProperty(V86Starter.prototype,"restart",V86Starter.prototype.restart);V86Starter.prototype.add_listener=function(a,b){this.bus.register(a,b,this)};goog.exportProperty(V86Starter.prototype,"add_listener",V86Starter.prototype.add_listener);V86Starter.prototype.remove_listener=function(a,b){this.bus.unregister(a,b)};goog.exportProperty(V86Starter.prototype,"remove_listener",V86Starter.prototype.remove_listener); +V86Starter.prototype.restore_state=async function(a){dbg_assert(1===arguments.length);this.v86.restore_state(a)};goog.exportProperty(V86Starter.prototype,"restore_state",V86Starter.prototype.restore_state);V86Starter.prototype.save_state=async function(){dbg_assert(0===arguments.length);return this.v86.save_state()};goog.exportProperty(V86Starter.prototype,"save_state",V86Starter.prototype.save_state); +V86Starter.prototype.get_statistics=function(){console.warn("V86Starter.prototype.get_statistics is deprecated. Use events instead.");var a={cpu:{instruction_counter:this.get_instruction_counter()}};if(!this.v86)return a;var b=this.v86.cpu.devices;b.hda&&(a.hda=b.hda.stats);b.cdrom&&(a.cdrom=b.cdrom.stats);b.ps2&&(a.mouse={enabled:b.ps2.use_mouse});b.vga&&(a.vga={is_graphical:b.vga.stats.is_graphical});return a};goog.exportProperty(V86Starter.prototype,"get_statistics",V86Starter.prototype.get_statistics); +V86Starter.prototype.get_instruction_counter=function(){return this.v86?this.v86.cpu.instruction_counter[0]>>>0:0};goog.exportProperty(V86Starter.prototype,"get_instruction_counter",V86Starter.prototype.get_instruction_counter);V86Starter.prototype.is_running=function(){return this.cpu_is_running};goog.exportProperty(V86Starter.prototype,"is_running",V86Starter.prototype.is_running);V86Starter.prototype.keyboard_send_scancodes=function(a){for(var b=0;b {const k=this.fs9p.Mount(a,g);d&&(k===-ENOENT?d(new FileNotFoundError):k===-EEXIST?d(new FileExistsError):0>k?(dbg_assert(!1,"Unexpected error code: "+-k),d(Error("Failed to mount. Error number: "+-k))):d(null))};b?(dbg_assert("object"===typeof c,"Filesystem: basefs must be a JSON object"),g.load_from_json(c,()=>f())):f()}; +goog.exportProperty(V86Starter.prototype,"mount_fs",V86Starter.prototype.mount_fs);V86Starter.prototype.create_file=async function(a,b){dbg_assert(2===arguments.length);var c=this.fs9p;if(c){var d=a.split("/");d=d[d.length-1];var e=c.SearchPath(a).parentid;if(""!==d&&-1!==e)await c.CreateBinaryFile(d,e,b);else return Promise.reject(new FileNotFoundError)}};goog.exportProperty(V86Starter.prototype,"create_file",V86Starter.prototype.create_file); +V86Starter.prototype.read_file=async function(a){dbg_assert(1===arguments.length);var b=this.fs9p;if(b)return(b=await b.read_file(a))?b:Promise.reject(new FileNotFoundError)};goog.exportProperty(V86Starter.prototype,"read_file",V86Starter.prototype.read_file); +V86Starter.prototype.automatically=function(a){const b=c=>{const d=c[0];if(d){var e=c.slice(1);if(d.sleep)setTimeout(()=>b(e),1E3*d.sleep);else if(d.vga_text){const g=this.screen_adapter.get_text_screen();for(let f of g)if(f.includes(d.vga_text)){b(e);return}setTimeout(()=>b(c),1E3)}else d.keyboard_send?(d.keyboard_send instanceof Array?this.keyboard_send_scancodes(d.keyboard_send):(dbg_assert("string"===typeof d.keyboard_send),this.keyboard_send_text(d.keyboard_send)),b(e)):d.call?(d.call(),b(e)): +dbg_assert(!1,d)}};b(a)};V86Starter.prototype.read_memory=function(a,b){return this.v86.cpu.read_blob(a,b)};V86Starter.prototype.write_memory=function(a,b){this.v86.cpu.write_blob(a,b)};function FileExistsError(a){this.message=a||"File already exists"}FileExistsError.prototype=Error.prototype;function FileNotFoundError(a){this.message=a||"File not found"}FileNotFoundError.prototype=Error.prototype; +"undefined"!==typeof window?(window.V86Starter=V86Starter,window.V86=V86Starter):"undefined"!==typeof module&&"undefined"!==typeof module.exports?(module.exports.V86Starter=V86Starter,module.exports.V86=V86Starter):"function"===typeof importScripts&&(self.V86Starter=V86Starter,self.V86=V86Starter);var WorkerBus={Connector:function(a){this.listeners={};this.pair=a;a.addEventListener("message",function(b){b=b.data;for(var c=this.listeners[b[0]],d=0;d >20)+"m\n";b=b+"Config:\nMAX_PAGES="+(a.wm.exports.get_config(0)+"\n");b+="JIT_USE_LOOP_SAFETY="+a.wm.exports.get_config(1)+"\n";return b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_config(2)+"\n"},print_instruction_counts:function(a){return[print_stats.print_instruction_counts_offset(a, +!1,!1,!1,!1),print_stats.print_instruction_counts_offset(a,!0,!1,!1,!1),print_stats.print_instruction_counts_offset(a,!1,!0,!1,!1),print_stats.print_instruction_counts_offset(a,!1,!1,!0,!1),print_stats.print_instruction_counts_offset(a,!1,!1,!1,!0)].join("\n\n")},print_instruction_counts_offset:function(a,b,c,d,e){let g="";var f=[],k=b?"compiled":c?"jit exit":d?"unguarded register":e?"wasm size":"executed";for(let n=0;256>n;n++)for(let p=0;8>p;p++)for(let t of[!1,!0]){var m=a.wm.exports.get_opstats_buffer(b, +c,d,e,n,!1,t,p);f.push({opcode:n,count:m,is_mem:t,fixed_g:p});m=a.wm.exports.get_opstats_buffer(b,c,d,e,n,!0,t,p);f.push({opcode:3840|n,count:m,is_mem:t,fixed_g:p})}a=0;b=new Set([38,46,54,62,100,101,102,103,240,242,243]);for(let {count:n,opcode:p}of f)b.has(p)||(a+=n);if(0===a)return"";c=new Uint32Array(256);b=new Uint32Array(256);for(let {opcode:n,count:p}of f)3840==(n&65280)?b[n&255]+=p:c[n&255]+=p;g=g+"------------------\nTotal: "+(a+"\n");const l=1E7 +Math.round(n/l)));d=String(d).length;g+=`Instruction counts ${k} (in ${l}):\n`;for(e=0;256>e;e++)g+=e.toString(16).padStart(2,"0")+":"+v86util.pads(Math.round(c[e]/l),d),g=15==e%16?g+"\n":g+" ";g=g+"\n"+`Instruction counts ${k} (0f, in ${l}):\n`;for(k=0;256>k;k++)g+=(k&255).toString(16).padStart(2,"0")+":"+v86util.pads(Math.round(b[k]/l),d),g=15==k%16?g+"\n":g+" ";g+="\n";f=f.filter(({count:n})=>n).sort(({count:n},{count:p})=>p-n);for(let {opcode:n,is_mem:p,fixed_g:t,count:r}of f.slice(0,200))f=n.toString(16)+ +"_"+t+(p?"_m":"_r"),g+=f+":"+(r/a*100).toFixed(2)+" ";return g+"\n"}};"undefined"!==typeof module&&"undefined"!==typeof module.exports&&(module.exports.print_stats=print_stats);function FileStorageInterface(){}FileStorageInterface.prototype.read=function(a,b,c){};FileStorageInterface.prototype.cache=function(a,b){};FileStorageInterface.prototype.uncache=function(a){};function MemoryFileStorage(){this.filedata=new Map}MemoryFileStorage.prototype.read=async function(a,b,c){dbg_assert(a,"MemoryFileStorage read: sha256sum should be a non-empty string");return(a=this.filedata.get(a))?a.subarray(b,b+c):null}; +MemoryFileStorage.prototype.cache=async function(a,b){dbg_assert(a,"MemoryFileStorage cache: sha256sum should be a non-empty string");this.filedata.set(a,b)};MemoryFileStorage.prototype.uncache=function(a){this.filedata.delete(a)};function ServerFileStorageWrapper(a,b){dbg_assert(b,"ServerMemoryFileStorage: baseurl should not be empty");this.storage=a;this.baseurl=b} +ServerFileStorageWrapper.prototype.load_from_server=function(a){return new Promise((b,c)=>{v86util.load_file(this.baseurl+a,{done:async d=>{d=new Uint8Array(d);await this.cache(a,d);b(d)}})})};ServerFileStorageWrapper.prototype.read=async function(a,b,c){const d=await this.storage.read(a,b,c);return d?d:(await this.load_from_server(a)).subarray(b,b+c)};ServerFileStorageWrapper.prototype.cache=async function(a,b){return await this.storage.cache(a,b)};ServerFileStorageWrapper.prototype.uncache=function(a){this.storage.uncache(a)}; +"undefined"!==typeof window?(window.MemoryFileStorage=MemoryFileStorage,window.ServerFileStorageWrapper=ServerFileStorageWrapper):"undefined"!==typeof module&&"undefined"!==typeof module.exports?(module.exports.MemoryFileStorage=MemoryFileStorage,module.exports.ServerFileStorageWrapper=ServerFileStorageWrapper):"function"===typeof importScripts&&(self.MemoryFileStorage=MemoryFileStorage,self.ServerFileStorageWrapper=ServerFileStorageWrapper);var S_IRWXUGO=511,S_IFMT=61440,S_IFSOCK=49152,S_IFLNK=40960,S_IFREG=32768,S_IFBLK=24576,S_IFDIR=16384,S_IFCHR=8192,O_RDONLY=0,O_WRONLY=1,O_RDWR=2,O_ACCMODE=3,STATUS_INVALID=-1,STATUS_OK=0,STATUS_ON_STORAGE=2,STATUS_UNLINKED=4,STATUS_FORWARDING=5,JSONFS_VERSION=3,JSONFS_IDX_NAME=0,JSONFS_IDX_SIZE=1,JSONFS_IDX_MTIME=2,JSONFS_IDX_MODE=3,JSONFS_IDX_UID=4,JSONFS_IDX_GID=5,JSONFS_IDX_TARGET=6,JSONFS_IDX_SHA256=6; +function FS(a,b){this.inodes=[];this.events=[];this.storage=a;this.qidcounter=b||{last_qidnumber:0};this.inodedata={};this.total_size=274877906944;this.used_size=0;this.mounts=[];this.CreateDirectory("",-1)}FS.prototype.get_state=function(){let a=[];a[0]=this.inodes;a[1]=this.qidcounter.last_qidnumber;a[2]=[];for(const [b,c]of Object.entries(this.inodedata))0===(this.inodes[b].mode&S_IFDIR)&&a[2].push([b,c]);a[3]=this.total_size;a[4]=this.used_size;return a=a.concat(this.mounts)}; +FS.prototype.set_state=function(a){this.inodes=a[0].map(b=>{const c=new Inode(0);c.set_state(b);return c});this.qidcounter.last_qidnumber=a[1];this.inodedata={};for(let [b,c]of a[2])c.buffer.byteLength!==c.byteLength&&(c=c.slice()),this.inodedata[b]=c;this.total_size=a[3];this.used_size=a[4];this.mounts=a.slice(5)}; +FS.prototype.AddEvent=function(a,b){var c=this.inodes[a];c.status==STATUS_OK||c.status==STATUS_ON_STORAGE?b():this.is_forwarder(c)?this.follow_fs(c).AddEvent(c.foreign_id,b):this.events.push({id:a,OnEvent:b})};FS.prototype.HandleEvent=function(a){var b=this.inodes[a];this.is_forwarder(b)&&this.follow_fs(b).HandleEvent(b.foreign_id);b=[];for(var c=0;c >8;this.qid.version=a[11];this.qid.path=a[12];this.nlinks=a[13]}; +FS.prototype.divert=function(a,b){const c=this.Search(a,b),d=this.inodes[c],e=new Inode(-1);dbg_assert(d,"Filesystem divert: name ("+b+") not found");dbg_assert(this.IsDirectory(c)||1>=d.nlinks,"Filesystem: can't divert hardlinked file '"+b+"' with nlinks="+d.nlinks);Object.assign(e,d);const g=this.inodes.length;this.inodes.push(e);e.fid=g;this.is_forwarder(d)&&this.mounts[d.mount_id].backtrack.set(d.foreign_id,g);this.should_be_linked(d)&&(this.unlink_from_dir(a,b),this.link_under_dir(a,g,b));if(this.IsDirectory(c)&& +!this.is_forwarder(d))for(const [f,k]of e.direntries)"."!==f&&".."!==f&&this.IsDirectory(k)&&this.inodes[k].direntries.set("..",g);this.inodedata[g]=this.inodedata[c];delete this.inodedata[c];d.direntries=new Map;d.nlinks=0;return g};FS.prototype.copy_inode=function(a,b){Object.assign(b,a,{fid:b.fid,direntries:b.direntries,nlinks:b.nlinks})};FS.prototype.CreateInode=function(){const a=Math.round(Date.now()/1E3),b=new Inode(++this.qidcounter.last_qidnumber);b.atime=b.ctime=b.mtime=a;return b}; +FS.prototype.CreateDirectory=function(a,b){var c=this.inodes[b];if(0<=b&&this.is_forwarder(c))return b=c.foreign_id,a=this.follow_fs(c).CreateDirectory(a,b),this.create_forwarder(c.mount_id,a);c=this.CreateInode();c.mode=511|S_IFDIR;0<=b&&(c.uid=this.inodes[b].uid,c.gid=this.inodes[b].gid,c.mode=this.inodes[b].mode&511|S_IFDIR);c.qid.type=S_IFDIR>>8;this.PushInode(c,b,a);this.NotifyListeners(this.inodes.length-1,"newdir");return this.inodes.length-1}; +FS.prototype.CreateFile=function(a,b){var c=this.inodes[b];if(this.is_forwarder(c))return b=c.foreign_id,a=this.follow_fs(c).CreateFile(a,b),this.create_forwarder(c.mount_id,a);c=this.CreateInode();c.uid=this.inodes[b].uid;c.gid=this.inodes[b].gid;c.qid.type=S_IFREG>>8;c.mode=this.inodes[b].mode&438|S_IFREG;this.PushInode(c,b,a);this.NotifyListeners(this.inodes.length-1,"newfile");return this.inodes.length-1}; +FS.prototype.CreateNode=function(a,b,c,d){var e=this.inodes[b];if(this.is_forwarder(e))return b=e.foreign_id,a=this.follow_fs(e).CreateNode(a,b,c,d),this.create_forwarder(e.mount_id,a);e=this.CreateInode();e.major=c;e.minor=d;e.uid=this.inodes[b].uid;e.gid=this.inodes[b].gid;e.qid.type=S_IFSOCK>>8;e.mode=this.inodes[b].mode&438;this.PushInode(e,b,a);return this.inodes.length-1}; +FS.prototype.CreateSymlink=function(a,b,c){var d=this.inodes[b];if(this.is_forwarder(d))return b=d.foreign_id,a=this.follow_fs(d).CreateSymlink(a,b,c),this.create_forwarder(d.mount_id,a);d=this.CreateInode();d.uid=this.inodes[b].uid;d.gid=this.inodes[b].gid;d.qid.type=S_IFLNK>>8;d.symlink=c;d.mode=S_IFLNK;this.PushInode(d,b,a);return this.inodes.length-1}; +FS.prototype.CreateTextFile=async function(a,b,c){var d=this.inodes[b];if(this.is_forwarder(d))return b=d.foreign_id,c=await this.follow_fs(d).CreateTextFile(a,b,c),this.create_forwarder(d.mount_id,c);d=this.CreateFile(a,b);b=this.inodes[d];a=new Uint8Array(c.length);b.size=c.length;for(b=0;b f)return f}var k=this.inodes[e],m=this.inodes[a];f=this.inodes[c];if(this.is_forwarder(m)||this.is_forwarder(f))if(this.is_forwarder(m)&&m.mount_id===f.mount_id){if(a=await this.follow_fs(m).Rename(m.foreign_id,b,f.foreign_id,d),0>a)return a}else{if(this.is_a_root(e))return dbg_log("XXX: Attempted to move mountpoint ("+ +b+") - skipped",LOG_9P),-EPERM;if(!this.IsDirectory(e)&&1 f)return f;await this.DeleteData(m);a=this.Unlink(a,b);if(0>a)return a}else this.unlink_from_dir(a,b),this.link_under_dir(c,e,d),k.qid.version++;this.NotifyListeners(e,"rename",{oldpath:g});return 0}; +FS.prototype.Write=async function(a,b,c,d){this.NotifyListeners(a,"write");var e=this.inodes[a];if(this.is_forwarder(e))a=e.foreign_id,await this.follow_fs(e).Write(a,b,c,d);else{var g=await this.get_buffer(a);!g||g.lengthb.nlinks&&message.Debug("Error in filesystem: negative nlinks="+b.nlinks+" at id ="+a);if(this.IsDirectory(a)){b=this.GetInode(a);this.IsDirectory(a)&&0>this.GetParent(a)&&message.Debug("Error in filesystem: negative parent id "+a);for(const [c,d]of b.direntries){0===c.length&&message.Debug("Error in filesystem: inode with no name and id "+d);for(const e of c)32>e&& +message.Debug("Error in filesystem: Unallowed char in filename")}}}};FS.prototype.FillDirectory=function(a){var b=this.inodes[a];if(this.is_forwarder(b))this.follow_fs(b).FillDirectory(b.foreign_id);else{var c=0;for(const d of b.direntries.keys())c+=24+UTF8.UTF8Length(d);a=this.inodedata[a]=new Uint8Array(c);b.size=c;c=0;for(const [d,e]of b.direntries)b=this.GetInode(e),c+=marshall.Marshall(["Q","d","b","s"],[b.qid,c+13+8+1+2+UTF8.UTF8Length(d),b.mode>>12,d],a,c)}}; +FS.prototype.RoundToDirentry=function(a,b){const c=this.inodedata[a];dbg_assert(c,`FS directory data for dirid=${a} should be generated`);dbg_assert(c.length,"FS directory should have at least an entry");if(b>=c.length)return c.length;for(a=0;;){const d=marshall.Unmarshall(["Q","d"],c,{offset:a})[1];if(d>b)break;a=d}return a};FS.prototype.IsDirectory=function(a){a=this.inodes[a];return this.is_forwarder(a)?this.follow_fs(a).IsDirectory(a.foreign_id):(a.mode&S_IFMT)===S_IFDIR}; +FS.prototype.IsEmpty=function(a){a=this.inodes[a];if(this.is_forwarder(a))return this.follow_fs(a).IsDirectory(a.foreign_id);for(const b of a.direntries.keys())if("."!==b&&".."!==b)return!1;return!0};FS.prototype.GetChildren=function(a){dbg_assert(this.IsDirectory(a),"Filesystem: cannot get children of non-directory inode");a=this.inodes[a];if(this.is_forwarder(a))return this.follow_fs(a).GetChildren(a.foreign_id);const b=[];for(const c of a.direntries.keys())"."!==c&&".."!==c&&b.push(c);return b}; +FS.prototype.GetParent=function(a){dbg_assert(this.IsDirectory(a),"Filesystem: cannot get parent of non-directory inode");a=this.inodes[a];if(this.should_be_linked(a))return a.direntries.get("..");const b=this.follow_fs(a).GetParent(a.foreign_id);dbg_assert(-1!==b,"Filesystem: should not have invalid parent ids");return this.get_forwarder(a.mount_id,b)}; +FS.prototype.PrepareCAPs=function(a){a=this.GetInode(a);if(a.caps)return a.caps.length;a.caps=new Uint8Array(20);a.caps[0]=0;a.caps[1]=0;a.caps[2]=0;a.caps[3]=2;a.caps[4]=255;a.caps[5]=255;a.caps[6]=255;a.caps[7]=255;a.caps[8]=255;a.caps[9]=255;a.caps[10]=255;a.caps[11]=255;a.caps[12]=63;a.caps[13]=0;a.caps[14]=0;a.caps[15]=0;a.caps[16]=63;a.caps[17]=0;a.caps[18]=0;a.caps[19]=0;return a.caps.length};function FSMountInfo(a){this.fs=a;this.backtrack=new Map} +FSMountInfo.prototype.get_state=function(){const a=[];a[0]=this.fs;a[1]=[...this.backtrack];return a};FSMountInfo.prototype.set_state=function(a){this.fs=a[0];this.backtrack=new Map(a[1])}; +FS.prototype.set_forwarder=function(a,b,c){const d=this.inodes[a];dbg_assert(0===d.nlinks,"Filesystem: attempted to convert an inode into forwarder before unlinking the inode");this.is_forwarder(d)&&this.mounts[d.mount_id].backtrack.delete(d.foreign_id);d.status=STATUS_FORWARDING;d.mount_id=b;d.foreign_id=c;this.mounts[b].backtrack.set(c,a)};FS.prototype.create_forwarder=function(a,b){const c=this.CreateInode(),d=this.inodes.length;this.inodes.push(c);c.fid=d;this.set_forwarder(d,a,b);return d}; +FS.prototype.is_forwarder=function(a){return a.status===STATUS_FORWARDING};FS.prototype.is_a_root=function(a){return 0===this.GetInode(a).fid};FS.prototype.get_forwarder=function(a,b){var c=this.mounts[a];dbg_assert(0<=b,"Filesystem get_forwarder: invalid foreign_id: "+b);dbg_assert(c,"Filesystem get_forwarder: invalid mount number: "+a);c=c.backtrack.get(b);return void 0===c?this.create_forwarder(a,b):c}; +FS.prototype.delete_forwarder=function(a){dbg_assert(this.is_forwarder(a),"Filesystem delete_forwarder: expected forwarder");a.status=STATUS_INVALID;this.mounts[a.mount_id].backtrack.delete(a.foreign_id)};FS.prototype.follow_fs=function(a){const b=this.mounts[a.mount_id];dbg_assert(this.is_forwarder(a),"Filesystem follow_fs: inode should be a forwarding inode");dbg_assert(b,"Filesystem follow_fs: inode should point to valid mounted FS");return b.fs}; +FS.prototype.Mount=function(a,b){dbg_assert(b.qidcounter===this.qidcounter,"Cannot mount filesystem whose qid numbers aren't synchronised with current filesystem.");var c=this.SearchPath(a);if(-1===c.parentid)return dbg_log("Mount failed: parent for path not found: "+a,LOG_9P),-ENOENT;if(-1!==c.id)return dbg_log("Mount failed: file already exists at path: "+a,LOG_9P),-EEXIST;if(c.forward_path)return a=this.inodes[c.parentid],c=this.follow_fs(a).Mount(c.forward_path,b),0>c?c:this.get_forwarder(a.mount_id, +c);a=this.mounts.length;this.mounts.push(new FSMountInfo(b));b=this.create_forwarder(a,0);this.link_under_dir(c.parentid,b,c.name);return b};function FSLockRegion(){this.type=P9_LOCK_TYPE_UNLCK;this.start=0;this.length=Infinity;this.proc_id=-1;this.client_id=""}FSLockRegion.prototype.get_state=function(){const a=[];a[0]=this.type;a[1]=this.start;a[2]=Infinity===this.length?0:this.length;a[3]=this.proc_id;a[4]=this.client_id;return a}; +FSLockRegion.prototype.set_state=function(a){this.type=a[0];this.start=a[1];this.length=0===a[2]?Infinity:a[2];this.proc_id=a[3];this.client_id=a[4]};FSLockRegion.prototype.clone=function(){const a=new FSLockRegion;a.set_state(this.get_state());return a}; +FSLockRegion.prototype.conflicts_with=function(a){return this.proc_id===a.proc_id&&this.client_id===a.client_id||this.type===P9_LOCK_TYPE_UNLCK||a.type===P9_LOCK_TYPE_UNLCK||this.type!==P9_LOCK_TYPE_WRLCK&&a.type!==P9_LOCK_TYPE_WRLCK||this.start+this.length<=a.start||a.start+a.length<=this.start?!1:!0};FSLockRegion.prototype.is_alike=function(a){return a.proc_id===this.proc_id&&a.client_id===this.client_id&&a.type===this.type}; +FSLockRegion.prototype.may_merge_after=function(a){return this.is_alike(a)&&a.start+a.length===this.start};FS.prototype.DescribeLock=function(a,b,c,d,e){dbg_assert(a===P9_LOCK_TYPE_RDLCK||a===P9_LOCK_TYPE_WRLCK||a===P9_LOCK_TYPE_UNLCK,"Filesystem: Invalid lock type: "+a);dbg_assert(0<=b,"Filesystem: Invalid negative lock starting offset: "+b);dbg_assert(0 =g&&0 =g&&(d.locks.splice(c,1),c--)}if(b.type!==P9_LOCK_TYPE_UNLCK){c=b;a=!1;for(e=0;e "."!==b&&".."!==b)};FS.prototype.read_file=function(a){a=this.SearchPath(a);if(-1===a.id)return Promise.resolve(null);const b=this.GetInode(a.id);return this.Read(a.id,0,b.size)};var VIRTIO_MAGIC_REG=0,VIRTIO_VERSION_REG=4,VIRTIO_DEVICE_REG=8,VIRTIO_VENDOR_REG=12,VIRTIO_HOSTFEATURES_REG=16,VIRTIO_HOSTFEATURESSEL_REG=20,VIRTIO_GUESTFEATURES_REG=32,VIRTIO_GUESTFEATURESSEL_REG=36,VIRTIO_GUEST_PAGE_SIZE_REG=40,VIRTIO_QUEUESEL_REG=48,VIRTIO_QUEUENUMMAX_REG=52,VIRTIO_QUEUENUM_REG=56,VIRTIO_QUEUEALIGN_REG=60,VIRTIO_QUEUEPFN_REG=64,VIRTIO_QUEUENOTIFY_REG=80,VIRTIO_INTERRUPTSTATUS_REG=96,VIRTIO_INTERRUPTACK_REG=100,VIRTIO_STATUS_REG=112,VRING_DESC_F_NEXT=1,VRING_DESC_F_WRITE=2,VRING_DESC_F_INDIRECT= +4;function hex8(a){return h(a)}var message={Debug:function(a){dbg_log([].slice.apply(arguments).join(" "),LOG_9P)},Abort:function(){if(DEBUG)throw Error("message.Abort()");}},LoadBinaryResource; +LoadBinaryResource="undefined"!==typeof XMLHttpRequest?function(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onreadystatechange=function(){if(4==d.readyState)if(200!=d.status&&0!=d.status)c("Error: Could not load file "+a);else{var e=d.response;e?b(e):c("Error: No data received from: "+a)}};d.send(null)}:function(a,b,c){require("fs").readFile(a,function(d,e){d?c(d):b(e.buffer)})};var marshall={Marshall:function(a,b,c,d){for(var e,g=0,f=0;f >8&255;c[d++]=e>>16&255;c[d++]=e>>24&255;g+=4;break;case "d":c[d++]=e&255;c[d++]=e>>8&255;c[d++]=e>>16&255;c[d++]=e>>24&255;c[d++]=0;c[d++]=0;c[d++]=0;c[d++]=0;g+=8;break;case "h":c[d++]=e&255;c[d++]=e>>8;g+=2;break;case "b":c[d++]=e;g+=1;break;case "s":var k=d,m=0;c[d++]=0;c[d++]=0;g+=2;for(var l of e)UnicodeToUTF8Stream(l.charCodeAt(0)).forEach(function(n){c[d++]=n;g+=1;m++}); +c[k+0]=m&255;c[k+1]=m>>8&255;break;case "Q":marshall.Marshall(["b","w","d"],[e.type,e.version,e.path],c,d);d+=13;g+=13;break;default:message.Debug("Marshall: Unknown type="+a[f])}return g},Unmarshall:function(a,b,c){let d=c.offset;for(var e=[],g=0;g >>0;e.push(f);break;case "d":f=b[d++];f+=b[d++]<<8;f+=b[d++]<<16;f+=b[d++]<<24>>>0;d+=4;e.push(f);break;case "h":f=b[d++];e.push(f+(b[d++]<<8));break;case "b":e.push(b[d++]); +break;case "s":f=b[d++];f+=b[d++]<<8;for(var k="",m=new UTF8StreamToUnicode,l=0;l {}},notification:{Vc:43264,Kj:!1,Oh:[d=>{if(0===d){for(;la(this.l);){d=this.l;la(d);var e=d.s.Oa(d.h+4+2*d.j);e=new ma(d,e);d.j=d.j+1&d.o;na(this,e)}d=this.l;e=d.s.Oa(d.h+2)+0&65535;d.s.Ae(d.g+4+8*d.size,e)}}]}, +hc:{Vc:42752},Vf:{Vc:42496,td:[{bytes:2,name:"mount tag length",read:()=>this.F,write:()=>{}}].concat(Array.from(Array(254).keys()).map(d=>({bytes:1,name:"mount tag name "+d,read:()=>this.B[d]||0,write:()=>{}})))}});this.l=this.ab.Xa[0]}fa.prototype.$=function(){var a=[];a[0]=this.B;a[1]=this.F;a[2]=this.ab;a[3]=this.D;a[4]=this.o;a[5]=this.j;a[6]=this.i;a[7]=this.C;a[8]=this.g.map(function(b){return[b.Z,b.type,b.uid,b.$b]});a[9]=this.h;return a}; +fa.prototype.H=function(a){this.B=a[0];this.F=a[1];this.ab.H(a[2]);this.l=this.ab.Xa[0];this.D=a[3];this.o=a[4];this.j=a[5];this.i=a[6];this.C=a[7];this.g=a[8].map(function(b){return{Z:b[0],type:b[1],uid:b[2],$b:b[3]}});this.h.H(a[9])};function u(a,b,c,d){v(["w","b","h"],[d+7,b+1,c],a.i,0);a.C=d+7}function qa(a,b,c){c=v(["w"],[c],a.i,7);u(a,6,b,c)} +function D(a,b){for(var c=a.i.subarray(0,a.C),d=0,e=c.length;e&&b.Nf!==b.Of.length;){var g=b.Of[b.Nf];const f=g.ef+b.Be;g=g.Ne-b.Be;g>e?(g=e,b.Be+=e):(b.Nf++,b.Be=0);ra(b.s,c.subarray(d,d+g),f);d+=g;e-=g}b.qf+=d;c=a.l;d=c.s.Oa(c.g+2)+c.i&c.o;e=b.qf;c.s.Lc(c.g+4+8*d,b.Ph);c.s.Lc(c.g+8+8*d,e);c.i++;a=a.l;0!==a.i&&(b=a.s.Oa(a.g+2)+a.i&65535,a.s.Ae(a.g+2,b),a.i=0,0<(a.ab.h[0]&536870912)?(a.s.Oa(a.h+4+2*a.size),a.ab.Aa(1)):~a.s.Oa(a.h)&1&&a.ab.Aa(1))} +async function na(a,b){var c=new Uint8Array(b.pf);ua(b,c);var d={offset:0},e=E(["w","b","h"],c,d),g=e[0],f=e[1],h=e[2];switch(f){case 8:g=va(a.h);var k=wa(a.h);e=[16914839];e[1]=a.o;e[2]=Math.floor(k/e[1]);e[3]=e[2]-Math.floor(g/e[1]);e[4]=e[2]-Math.floor(g/e[1]);e[5]=xa(a.h);e[6]=za(a.h);e[7]=0;e[8]=256;g=v("wwddddddw".split(""),e,a.i,7);u(a,f,h,g);D(a,b);break;case 112:case 12:e=E(["w","w"],c,d);g=e[0];d=e[1];c=a.g[g].Z;var l=H(a.h,c);k=Aa(a.h,c,d);Ba(a.h,a.g[g].Z,function(){var m=[];m[0]=l.za; +m[1]=this.j-24;v(["Q","w"],m,this.i,7);u(this,f,h,17);D(this,b)}.bind(a));break;case 70:e=E(["w","w","s"],c,d);c=e[0];g=e[1];k=e[2];k=Ca(a.h,a.g[c].Z,a.g[g].Z,k);if(0>k){qa(a,h,-k);D(a,b);break}u(a,f,h,0);D(a,b);break;case 16:e=E(["w","s","s","w"],c,d);g=e[0];k=e[1];var q=e[3];c=Da(a.h,k,a.g[g].Z,e[2]);l=H(a.h,c);l.uid=a.g[g].uid;l.Ga=q;v(["Q"],[l.za],a.i,7);u(a,f,h,13);D(a,b);break;case 18:e=E("wswwww".split(""),c,d);g=e[0];k=e[1];d=e[2];c=e[3];var n=e[4];q=e[5];c=Ea(a.h,k,a.g[g].Z,c,n);l=H(a.h, +c);l.mode=d;l.uid=a.g[g].uid;l.Ga=q;v(["Q"],[l.za],a.i,7);u(a,f,h,13);D(a,b);break;case 22:e=E(["w"],c,d);g=e[0];l=H(a.h,a.g[g].Z);g=v(["s"],[l.te],a.i,7);u(a,f,h,g);D(a,b);break;case 72:e=E(["w","s","w","w"],c,d);g=e[0];k=e[1];d=e[2];q=e[3];c=Fa(a.h,k,a.g[g].Z);l=H(a.h,c);l.mode=d|Ga;l.uid=a.g[g].uid;l.Ga=q;v(["Q"],[l.za],a.i,7);u(a,f,h,13);D(a,b);break;case 14:e=E(["w","s","w","w","w"],c,d);g=e[0];k=e[1];c=e[2];d=e[3];q=e[4];a.v.send("9p-create",[k,a.g[g].Z]);c=Ha(a.h,k,a.g[g].Z);a.g[g].Z=c;a.g[g].type= +1;a.g[g].$b=k;l=H(a.h,c);l.uid=a.g[g].uid;l.Ga=q;l.mode=d;v(["Q","w"],[l.za,a.j-24],a.i,7);u(a,f,h,17);D(a,b);break;case 52:e=E("wbwddws".split(""),c,d);g=e[0];c=e[2];k=0===e[4]?Infinity:e[4];e=Ia(e[1],e[3],k,e[5],e[6]);k=Ja(a.h,a.g[g].Z,e,c);v(["b"],[k],a.i,7);u(a,f,h,1);D(a,b);break;case 54:e=E("wbddws".split(""),c,d);g=e[0];k=0===e[3]?Infinity:e[3];e=Ia(e[1],e[2],k,e[4],e[5]);k=Ka(a.h,a.g[g].Z,e);k||(k=e,k.type=2);g=v(["b","d","d","w","s"],[k.type,k.start,Infinity===k.length?0:k.length,k.h,k.g], +a.i,7);u(a,f,h,g);D(a,b);break;case 24:e=E(["w","d"],c,d);g=e[0];l=H(a.h,a.g[g].Z);if(!l||l.status===La){qa(a,h,2);D(a,b);break}e[0]|=4096;e[0]=e[1];e[1]=l.za;e[2]=l.mode;e[3]=l.uid;e[4]=l.Ga;e[5]=l.Ua;e[6]=l.Oe<<8|l.Pe;e[7]=l.size;e[8]=a.o;e[9]=Math.floor(l.size/512+1);e[10]=l.Oc;e[11]=0;e[12]=l.ic;e[13]=0;e[14]=l.Ed;e[15]=0;e[16]=0;e[17]=0;e[18]=0;e[19]=0;v("dQwwwddddddddddddddd".split(""),e,a.i,7);u(a,f,h,153);D(a,b);break;case 26:e=E("wwwwwddddd".split(""),c,d);g=e[0];l=H(a.h,a.g[g].Z);e[1]&1&& +(l.mode=e[2]);e[1]&2&&(l.uid=e[3]);e[1]&4&&(l.Ga=e[4]);e[1]&16&&(l.Oc=Math.floor((new Date).getTime()/1E3));e[1]&32&&(l.ic=Math.floor((new Date).getTime()/1E3));e[1]&64&&(l.Ed=Math.floor((new Date).getTime()/1E3));e[1]&128&&(l.Oc=e[6]);e[1]&256&&(l.ic=e[8]);e[1]&8&&await Ma(a.h,a.g[g].Z,e[5]);u(a,f,h,0);D(a,b);break;case 50:e=E(["w","d"],c,d);g=e[0];u(a,f,h,0);D(a,b);break;case 40:case 116:e=E(["w","d","w"],c,d);g=e[0];k=e[1];q=e[2];l=H(a.h,a.g[g].Z);if(!l||l.status===La){qa(a,h,2);D(a,b);break}if(2== +a.g[g].type){(void 0).length l.size&&(q=0),a.v.send("9p-read-start",[a.g[g].$b]),e=await Oa(a.h,e,k,q),a.v.send("9p-read-end",[a.g[g].$b,q]),e&&a.i.set(e,11),v(["w"],[q],a.i,7),u(a,f,h,4+q);D(a,b);break;case 118:e=E(["w","d","w"],c,d);g=e[0];k=e[1];q=e[2];e=a.g[g].$b;if(2===a.g[g].type){qa(a, +h,95);D(a,b);break}else await Pa(a.h,a.g[g].Z,k,q,c.subarray(d.offset));a.v.send("9p-write-end",[e,q]);v(["w"],[q],a.i,7);u(a,f,h,4);D(a,b);break;case 74:e=E(["w","s","w","s"],c,d);k=await Ra(a.h,a.g[e[0]].Z,e[1],a.g[e[2]].Z,e[3]);if(0>k){qa(a,h,-k);D(a,b);break}u(a,f,h,0);D(a,b);break;case 76:e=E(["w","s","w"],c,d);d=e[0];k=e[1];c=e[2];g=Sa(a.h,a.g[d].Z,k);if(-1==g){qa(a,h,2);D(a,b);break}k=Ta(a.h,a.g[d].Z,k);if(0>k){qa(a,h,-k);D(a,b);break}u(a,f,h,0);D(a,b);break;case 100:g=E(["w","s"],c,d);a.j= +g[0];g=v(["w","s"],[a.j,a.D],a.i,7);u(a,f,h,g);D(a,b);break;case 104:e=E(["w","w","s","s","w"],c,d);g=e[0];a.g[g]={Z:0,type:1,uid:e[4],$b:""};l=H(a.h,a.g[g].Z);v(["Q"],[l.za],a.i,7);u(a,f,h,13);D(a,b);a.v.send("9p-attach");break;case 108:e=E(["h"],c,d);u(a,f,h,0);D(a,b);break;case 110:e=E(["w","w","h"],c,d);g=e[0];q=e[1];n=e[2];if(0==n){a.g[q]={Z:a.g[g].Z,type:1,uid:a.g[g].uid,$b:a.g[g].$b};v(["h"],[0],a.i,7);u(a,f,h,2);D(a,b);break}k=[];for(e=0;e G;G++)M=127 G?C[G]:G,F[G]=String.fromCharCode(M);g.imageSmoothingEnabled=!1;h.style.position="absolute";h.style.backgroundColor="#ccc";h.style.width="7px";h.style.display="inline-block";f.style.display="block";e.style.display="none";this.v=b;b.register("screen-set-mode",function(y){this.Df(y)},this);b.register("screen-fill-buffer-end",function(y){this.Kf(y)}, +this);b.register("screen-put-char",function(y){this.xf(y[0],y[1],y[2],y[3],y[4])},this);b.register("screen-update-cursor",function(y){this.wd(y[0],y[1])},this);b.register("screen-update-cursor-scanline",function(y){this.xd(y[0],y[1])},this);b.register("screen-clear",function(){this.Sf()},this);b.register("screen-set-size-text",function(y){this.rd(y[0],y[1])},this);b.register("screen-set-size-graphical",function(y){this.qd(y[0],y[1],y[2],y[3])},this);this.hb=function(){this.rd(80,25);this.sb()};this.Xh= +function(){const y=new Image;if(r)y.src=e.toDataURL("image/png");else{const B=[9,16],V=document.createElement("canvas");V.width=w*B[0];V.height=A*B[1];const R=V.getContext("2d");R.imageSmoothingEnabled=!1;R.font=window.getComputedStyle(f).font;R.textBaseline="top";for(let aa=0;aa B;)f.removeChild(f.firstChild);for(;f.childNodes.length=y&&2*y {g.putImageData(B.Fb,B.Bf-B.De,B.Cf-B.Ee,B.De,B.Ee,B.gf,B.ff)})};this.hb()};(function(){function a(){for(var n=location.search.substr(1).split("&"),t={},m=0;m F.json()).then(F=>{function M(G){return G&&{url:C+"/"+G.url,async:G.async,size:G.size}}n({id:F.id,name:F.name,G:F.memory_size,ha:F.vga_memory_size, +ya:F.acpi,oc:F.boot_order,M:M(F.hda),ga:M(F.cdrom),ma:M(F.fda),ed:M(F.multiboot),vb:M(F.bzimage),Xc:M(F.initrd)})}).catch(()=>alert("Profile not found: "+w))}}else alert("Your browser is not supported because it doesn't support WebAssembly")}function e(n,t){var m=n.G;m||(m=1048576*parseInt(c("memory_size").value,10),m||(alert("Invalid memory size - reset to 128MB"),m=134217728));var r=n.ha;r||(r=1048576*parseInt(c("video_memory_size").value,10),r||(alert("Invalid video memory size - reset to 8MB"), +r=8388608));if(!n.ma){var x=c("floppy_image").files[0];x&&(n.ma={buffer:x})}!n.vb&&(x=c("bzimage").files[0])&&(n.vb={buffer:x});!n.Xc&&(x=c("initrd").files[0])&&(n.Xc={buffer:x});x=void 0===n.mg?c("networking_proxy").value:n.mg;const w=void 0===n.audio?c("disable_audio").checked:!n.audio,A=void 0===n.ya?c("enable_acpi").checked:n.ya;if(n.Oj)var I="bochs-bios.bin",O="bochs-vgabios.bin";else I="seabios.bin",O="vgabios.bin";if(!n.Wc){var C={url:"bios/"+I};var F={url:"bios/"+O}}var M=new Xa({memory_size:m, +vga_memory_size:r,screen_container:c("screen_container"),serial_container_xtermjs:c("terminal"),boot_order:n.oc||parseInt(c("boot_order").value,16)||0,network_relay_url:l?"ws://localhost:8080/":x,bios:C,vga_bios:F,fda:n.ma,hda:n.M,hdb:n.Ke,cdrom:n.ga,multiboot:n.ed,bzimage:n.vb,initrd:n.Xc,cmdline:n.Pc,bzimage_initrd_from_filesystem:n.hf,acpi:A,initial_state:n.Wc,filesystem:n.filesystem||{},disable_speaker:w,mac_address_translation:n.Gb,cpuid_level:n.Dd,autostart:!0});J(M,"emulator-ready",function(){if(M.g.s.xa.exports.profiler_is_enabled()){var G= +document.createElement("pre");document.body.appendChild(G);setInterval(function(){if(M.Zc()){var ja=Ya.Lj(M.g.s);G.textContent=ja}},1E3)}"dsl"===n.id||"helenos"===n.id?setTimeout(()=>{Wa(M,"\n")},3E3):("android"===n.id||"android4"===n.id)&&setTimeout(()=>{Za(M,[57424,57552]);Wa(M,"\n")},3E3);g(n,M);t&&t(M)});J(M,"download-progress",function(G){var ja=c("loading");ja.style.display="block";if(G.he.endsWith(".wasm")){var X=G.he.split("/");ja.textContent="Fetching "+X[X.length-1]+" ..."}else if(G.ge=== +G.fe-1&&G.loaded>=G.total-2048)ja.textContent="Done downloading. Starting now ...";else{X="Downloading images ";"number"===typeof G.ge&&G.fe&&(X+="["+(G.ge+1)+"/"+G.fe+"] ");if(G.total&&"number"===typeof G.loaded){G=Math.floor(G.loaded/G.total*100);G=Math.min(100,Math.max(0,G));var y=Math.floor(G/2);X=X+(G+"% [")+"#".repeat(y);X+=" ".repeat(50-y)+"]"}else X+=".".repeat(q++%50);ja.textContent=X}});J(M,"download-error",function(G){var ja=c("loading");ja.style.display="block";ja.textContent="Loading "+ +G.he+" failed. Check your connection and reload the page to try again."})}function g(n,t){function m(){var z=Date.now(),N=t.g?t.g.s.Th[0]>>>0:0;N P?P+"s":3600>P?(P/60|0)+"m "+$a(P%60,2)+"s":(P/3600|0)+"h "+$a((P/60|0)%60,2)+"m "+$a(P%60,2)+"s"}function r(z,N){var P=c("get_"+N+"_image");!z||104857600 P!==N);X[0]?c("info_filesystem_last_file").textContent=X[0]:c("info_filesystem_status").textContent="Idle"});J(t,"9p-write-end",function(z){ja+=z[1];c("info_filesystem_bytes_written").textContent=ja;X[0]||(c("info_filesystem_last_file").textContent=z[0])});var y=0,B=0,V=0,R=0;J(t,"ide-read-start",function(){c("info_storage").style.display="block";c("info_storage_status").textContent="Loading ..."});J(t,"ide-read-end",function(z){y+=z[1];B+=z[2];c("info_storage_status").textContent= +"Idle";c("info_storage_bytes_read").textContent=y;c("info_storage_sectors_read").textContent=B});J(t,"ide-write-end",function(z){V+=z[1];R+=z[2];c("info_storage_bytes_written").textContent=V;c("info_storage_sectors_written").textContent=R});var aa=0,ha=0;J(t,"eth-receive-end",function(z){ha+=z[0];c("info_network").style.display="block";c("info_network_bytes_received").textContent=ha});J(t,"eth-transmit-end",function(z){aa+=z[0];c("info_network").style.display="block";c("info_network_bytes_transmitted").textContent= +aa});J(t,"mouse-enable",function(z){F=z;c("info_mouse_enabled").textContent=z?"Yes":"No"});J(t,"screen-set-mode",function(z){z?c("info_vga_mode").textContent="Graphical":(c("info_vga_mode").textContent="Text",c("info_res").textContent="-",c("info_bpp").textContent="-")});J(t,"screen-set-size-graphical",function(z){c("info_res").textContent=z[0]+"x"+z[1];c("info_bpp").textContent=z[4]});c("reset").onclick=function(){t.zf();c("reset").blur()};r(n.M,"hda");r(n.Ke,"hdb");r(n.ma,"fda");r(n.Zf,"fdb");r(n.ga, +"cdrom");c("memory_dump").onclick=function(){const z=t.g.s.Na;bb(new Uint8Array(z.buffer,z.byteOffset,z.length),"v86memory.bin");c("memory_dump").blur()};c("capture_network_traffic").onclick=function(){function z(P,Y){var oa=N,Qa=oa.push,Le=performance.now()/1E3;const fc=[];let pa=0;for(;pa+15 ta;ta++)sa+=$a(Y[pa+ta].toString(16).toUpperCase(),2)+" ";sa+=" ";for(ta=0;16>ta;ta++){var ya=Y[pa+ta];sa+=33<=ya&&34!==ya&& +92!==ya&&126>=ya?String.fromCharCode(ya):"."}fc.push(sa)}for(sa=$a(pa.toString(16).toUpperCase(),5)+" ";pa =fb?String.fromCharCode(fb):"."}fc.push(sa);Qa.call(oa,{direction:P,time:Le,Rh:"\n"+fc.join("\n")+"\n"});c("capture_network_traffic").value=N.length+" packets"}this.value="0 packets";let N=[];t.Gd.register("net0-receive", +z.bind(this,"I"));J(t,"net0-send",z.bind(this,"O"));this.onclick=function(){const P=N.map(({direction:Y,time:oa,Rh:Qa})=>Y+" "+oa.toFixed(6)+Qa+"\n").join("");bb(P,"traffic.hex");N=[];this.value="0 packets"}};c("save_state").onclick=async function(){const z=await t.se();bb(z,"v86state.bin");c("save_state").blur()};c("load_state").onclick=function(){c("load_state_input").click();c("load_state").blur()};c("load_state_input").onchange=async function(){var z=this.files[0];if(z){var N=t.Zc();N&&await t.stop(); +var P=new FileReader;P.onload=async function(Y){try{await t.Nd(Y.target.result)}catch(oa){throw alert("Something bad happened while restoring the state:\n"+oa+"\n\nNote that the current configuration must be the same as the original"),oa;}N&&t.Ze()};P.readAsArrayBuffer(z);this.value=""}};c("ctrlaltdel").onclick=function(){Za(t,[29,56,83,157,184,211]);c("ctrlaltdel").blur()};c("alttab").onclick=function(){Za(t,[56,15]);setTimeout(function(){Za(t,[184,143])},100);c("alttab").blur()};c("scale").onchange= +function(){var z=parseFloat(this.value);(z||0 {ia.focus()},!1);c("take_screenshot").onclick=function(){t.h&&t.h.Xh();c("take_screenshot").blur()}; +if(t.j){let z=!1;c("mute").onclick=function(){z?(t.j.Qe.af(1,void 0),z=!1,c("mute").value="Mute"):(t.j.Qe.af(0,void 0),z=!0,c("mute").value="Unmute");c("mute").blur()}}else c("mute").remove();window.addEventListener("keydown",x,!1);window.addEventListener("keyup",x,!1);window.addEventListener("blur",x,!1)}function f(n){c("filesystem_panel").style.display="block";c("filesystem_send_file").onchange=function(){Array.prototype.forEach.call(this.files,function(t){var m=new db(t);m.onload=function(){m.pb(async function(r){await n.qh("/"+ +t.name,new Uint8Array(r))})};m.load()},this);this.value="";this.blur()};c("filesystem_get_file").onkeypress=async function(t){if(13===t.which){this.disabled=!0;try{var m=await n.re(this.value)}catch(r){console.log(r)}this.disabled=!1;m?(t=this.value.replace(/\/$/,"").split("/"),t=t[t.length-1]||"root",bb(m,t),this.value=""):alert("Can't read file")}}}function h(){location.reload()}function k(n){window.history.pushState&&window.history.pushState({profile:n},"","?profile="+n)}var l=!location.hostname.endsWith("copy.sh"), +q=0;window.addEventListener("load",d,!1);window.addEventListener("load",function(){setTimeout(function(){window.addEventListener("popstate",h)},0)});"complete"===document.readyState&&d()})();function eb(a){this.ports=[];this.s=a;for(var b=0;65536>b;b++)this.ports[b]=gb(this);var c=a.G[0];for(b=0;b<<17 >8&255)}function h(l){e.call(this,l&255);g.call(this,l>>8&255)}function k(l){c.call(this,l&255);d.call(this,l>>8&255);e.call(this,l>>16&255);g.call(this,l>>>24)}e&&g?(L(this,a,b,c,f,k),L(this,a+1,b,d),L(this,a+2,b,e,h),L(this,a+3,b,g)):(L(this,a,b,c,f),L(this,a+1,b,d))};p.Zh=function(a){var b=this.s.i[a>>>17];return b(a)|b(a+1)<<8|b(a+2)<<16|b(a+3)<<24}; +p.$h=function(a,b){var c=this.s.l[a>>>17];c(a,b&255);c(a+1,b>>8&255);c(a+2,b>>16&255);c(a+3,b>>>24)};function hb(a,b,c,d,e,g,f){g||(g=a.Zh.bind(a));f||(f=a.$h.bind(a));for(b>>>=17;0 {this.C&&kb(this,0)});this.v=a;a.register("cpu-init",this.hb,this);a.register("cpu-run",this.Ze,this);a.register("cpu-stop",this.stop,this);a.register("cpu-restart",this.zf,this);this.l()}p=ib.prototype;p.Ze=function(){this.i=!1;this.g||(this.g=!0,this.v.send("emulator-started"));kb(this,0)}; +function lb(a){if(a.i||!a.g)a.i=a.g=!1,a.v.send("emulator-stopped");else{a.C=!1;a:{var b=a.s;if(b.h[0]){var c=mb(b);if(b.h[0]){b=c;break a}}let d=c=nb();for(;1>d-c;){b.Tj();d=nb();const e=ob(b,d);pb(b);if(b.h[0]){b=e;break a}}b=0}kb(a,b)}}function kb(a,b){const c=++a.j;a.C=!0;a.B(b,c)}p.stop=function(){this.g&&(this.i=!0)};p.va=function(){this.o()};p.zf=function(){this.s.Ra();qb(this.s)};p.hb=function(a){this.s.hb(a,this.v);this.v.send("emulator-ready")}; +if("undefined"!==typeof process)ib.prototype.B=function(a,b){1>a?global.setImmediate(c=>{c===this.j&&lb(this)},b):setTimeout(c=>{c===this.j&&lb(this)},a,b)},ib.prototype.l=function(){},ib.prototype.o=function(){};else if("undefined"!==typeof Worker){function a(){globalThis.onmessage=function(b){const c=b.data.t;1>c?postMessage(b.data.Sg):setTimeout(()=>postMessage(b.data.Sg),c)}}ib.prototype.l=function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.h= +new Worker(b);this.h.onmessage=c=>{c.data===this.j&&lb(this)};URL.revokeObjectURL(b)};ib.prototype.B=function(b,c){this.h.postMessage({t:b,Sg:c})};ib.prototype.o=function(){this.h.terminate();this.h=null}}else ib.prototype.B=function(a){setTimeout(()=>{lb(this)},a)},ib.prototype.l=function(){},ib.prototype.o=function(){};ib.prototype.se=function(){return this.s.se()};ib.prototype.Nd=function(a){return this.s.Nd(a)}; +if("object"===typeof performance&&performance.now)var nb=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");nb=a.now.bind(a)}else"object"===typeof process&&process.hrtime?nb=function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:nb=Date.now;var db,rb,sb,tb,ub,vb,wb;function xb(a,b){return(a||0===a?a+"":"").padEnd(b," ")}function $a(a,b){return(a||0===a?a+"":"").padStart(b,"0")}function Q(a,b,c,d){return new Proxy({},{get:function(e,g){e=new a(b.buffer,c,d);g=e[g];return"function"===typeof g?g.bind(e):g},set:function(e,g,f){(new a(b.buffer,c,d))[g]=f;return!0}})}function yb(a,b){return"0x"+$a((a?a.toString(16):"").toUpperCase(),b||1)} +if("undefined"!==typeof crypto&&crypto.getRandomValues){let a=new Int32Array(1);var zb=function(){crypto.getRandomValues(a);return a[0]}}else if("undefined"!==typeof require){const a=require("crypto");zb=function(){return a.Ck(4).readInt32LE(0)}} +(function(){if("function"===typeof Math.clz32)rb=function(d){return 31-Math.clz32(d)},sb=function(d){return 31-Math.clz32(d)};else{for(var a=new Int8Array(256),b=0,c=-2;256>b;b++)b&b-1||c++,a[b]=c;rb=function(d){return a[d]};sb=function(d){d>>>=0;var e=d>>>16;if(e){var g=e>>>8;return g?24+a[g]:16+a[e]}return(g=d>>>8)?8+a[g]:a[d]}}})(); +function Ab(a){var b=new Uint8Array(a),c,d;this.length=0;this.push=function(e){this.length!==a&&this.length++;b[d]=e;d=d+1&a-1};this.shift=function(){if(this.length){var e=b[c];c=c+1&a-1;this.length--;return e}return-1};this.clear=function(){this.length=d=c=0};this.clear()}function Bb(){this.size=65536;this.data=new Float32Array(65536);this.length=this.end=this.start=0} +Bb.prototype.push=function(a){this.length===this.size?this.start=this.start+1&this.size-1:this.length++;this.data[this.end]=a;this.end=this.end+1&this.size-1};Bb.prototype.shift=function(){if(this.length){var a=this.data[this.start];this.start=this.start+1&this.size-1;this.length--;return a}}; +function Cb(a,b){var c=new Float32Array(b);b>a.length&&(b=a.length);var d=a.start+b,e=a.data.subarray(a.start,d);c.set(e);d>=a.size&&(d-=a.size,c.set(a.data.subarray(0,d),e.length));a.start=d;a.length-=b;return c}Bb.prototype.clear=function(){this.length=this.end=this.start=0};function bb(a,b){a instanceof Array||(a=[a]);ab(new Blob(a),b)} +function ab(a,b){var c=document.createElement("a");c.download=b;c.href=window.URL.createObjectURL(a);c.dataset.downloadurl=["application/octet-stream",c.download,c.href].join(":");document.createEvent?(a=document.createEvent("MouseEvent"),a.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(a)):c.click();window.URL.revokeObjectURL(c.href)}function Db(a){"number"===typeof a?this.view=new Uint8Array(a+7>>3):a instanceof ArrayBuffer&&(this.view=new Uint8Array(a))} +Db.prototype.set=function(a,b){const c=a>>3;a=1<<(a&7);this.view[c]=b?this.view[c]|a:this.view[c]&~a};Db.prototype.get=function(a){return this.view[a>>3]>>(a&7)&1};Db.prototype.pb=function(){return this.view.buffer};var Gb="undefined"===typeof XMLHttpRequest?Eb:Fb; +function Fb(a,b,c){function d(){const k=c||0;setTimeout(()=>{Fb(a,b,k+1)},1E3*([1,1,2,3,5,8,13,21][k]||34))}var e=new XMLHttpRequest;e.open(b.method||"get",a,!0);e.responseType=b.zd?"json":"arraybuffer";if(b.headers)for(var g=Object.keys(b.headers),f=0;f e.status&&d()):e.response&&b.done&&b.done(e.response,e))};e.onerror=function(k){console.error("Loading the image "+a+" failed",k);d()};b.progress&&(e.onprogress=function(k){b.progress(k)});e.send(null)} +function Eb(a,b){let c=require("fs");b.Ld?c.open(a,"r",(d,e)=>{if(d)throw d;d=b.Ld.length;var g=Buffer.allocUnsafe(d);c.read(e,g,0,d,b.Ld.start,f=>{if(f)throw f;b.done&&b.done(new Uint8Array(g));c.close(e,h=>{if(h)throw h;})})}):c.readFile(a,{encoding:b.zd?"utf-8":null},function(d,e){d?console.log("Could not read file:",a,d):(d=e,b.zd?d=JSON.parse(d):d=(new Uint8Array(d)).buffer,b.done(d))})};(function(){function a(f){this.buffer=f;this.byteLength=f.byteLength;this.onload=void 0}function b(f,h,k){this.filename=f;this.byteLength=h;this.g=new Map;this.i=new Set;this.I=k;this.B=!!k;this.onload=void 0}function c(f,h,k,l,q){const n=f.match(/\.[^\.]+(\.zst)?$/);this.j=n?n[0]:"";this.h=f.substring(0,f.length-this.j.length);this.D=this.j.endsWith(".zst");this.h.endsWith("/")||(this.h+="-");this.g=new Map;this.i=new Set;this.byteLength=h;this.I=k;this.F=!!l;this.C=q;this.B=!!k;this.onload=void 0} +function d(f){this.file=f;this.byteLength=f.size;1073741824 >20)+" MB ...");this.buffer=new ArrayBuffer(f.size);this.onload=void 0}function e(f){this.file=f;this.byteLength=f.size;this.g=new Map;this.i=new Set;this.onload=void 0}tb=a;ub=b;vb=c;wb=e;db=d;a.prototype.load=function(){this.onload&&this.onload({buffer:this.buffer})};a.prototype.get=function(f,h,k){k(new Uint8Array(this.buffer,f,h))};a.prototype.set=function(f,h,k){(new Uint8Array(this.buffer, +f,h.byteLength)).set(h);k()};a.prototype.pb=function(f){f(this.buffer)};a.prototype.$=function(){const f=[];f[0]=this.byteLength;f[1]=new Uint8Array(this.buffer);return f};a.prototype.H=function(f){this.byteLength=f[0];this.buffer=f[1].slice().buffer};b.prototype.load=function(){void 0!==this.byteLength?this.onload&&this.onload(Object.create(null)):g(this.filename,(f,h)=>{if(f)throw Error("Cannot use: "+this.filename+". "+f);this.byteLength=h;this.onload&&this.onload(Object.create(null))})};b.prototype.h= +function(f,h){var k=h/256;f/=256;for(var l=0;l {k?h(k):h(null,l.size)})}:function(f,h){Gb(f,{done:(k,l)=>{k=l.getResponseHeader("Content-Range")||"";(l=k.match(/\/(\d+)\s*$/))?h(null,+l[1]):h("`Range: bytes=...` header not supported (Got `"+k+"`)")},headers:{Range:"bytes=0-0"}})}})();function Hb(a,b,c,d,e,g){this.ka=new Ib(this,a,b,d,e,g);this.la=new Ib(this,a,c,!1,e,g);this.ta=this.ka;this.s=a;0===e?(this.g=496,this.ca=14,this.Ia=240):1===e&&(this.g=368,this.ca=15,this.Ia=248);this.i=this.g|516;this.h=46080;this.K=[134,128,16,112,5,0,160,2,0,128,1,1,0,0,0,0,this.g&255|1,this.g>>8,0,0,this.i&255|1,this.i>>8,0,0,0,0,0,0,0,0,0,0,this.h&255|1,this.h>>8,0,0,0,0,0,0,0,0,0,0,67,16,212,130,0,0,0,0,0,0,0,0,0,0,0,0,this.ca,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ib=[{size:8},{size:4},void 0,void 0,{size:16}];this.name="ide"+e;this.l=2;K(a.A,this.g|7,this,function(){Jb(this.s,this.ca);return this.Lg()});K(a.A,this.i|2,this,this.Lg);L(a.A,this.i|2,this,this.Uj);K(a.A,this.g|0,this,function(){return Kb(this.ta,1)},function(){return Kb(this.ta,2)},function(){return Kb(this.ta,4)});K(a.A,this.g|1,this,function(){return this.ta.error& +255});K(a.A,this.g|2,this,function(){return this.ta.ea&255});K(a.A,this.g|3,this,function(){return this.ta.wa&255});K(a.A,this.g|4,this,function(){return this.ta.na&255});K(a.A,this.g|5,this,function(){return this.ta.qa&255});K(a.A,this.g|6,this,function(){return this.ta.rc&255});L(a.A,this.g|0,this,function(f){Lb(this.ta,f,1)},function(f){Lb(this.ta,f,2)},function(f){Lb(this.ta,f,4)});L(a.A,this.g|1,this,function(f){this.ka.ad=(this.ka.ad<<8|f)&65535;this.la.ad=(this.la.ad<<8|f)&65535});L(a.A,this.g| +2,this,function(f){this.ka.ea=(this.ka.ea<<8|f)&65535;this.la.ea=(this.la.ea<<8|f)&65535});L(a.A,this.g|3,this,function(f){this.ka.wa=(this.ka.wa<<8|f)&65535;this.la.wa=(this.la.wa<<8|f)&65535});L(a.A,this.g|4,this,function(f){this.ka.na=(this.ka.na<<8|f)&65535;this.la.na=(this.la.na<<8|f)&65535});L(a.A,this.g|5,this,function(f){this.ka.qa=(this.ka.qa<<8|f)&65535;this.la.qa=(this.la.qa<<8|f)&65535});L(a.A,this.g|6,this,function(f){this.ta=f&16?this.la:this.ka;this.ka.rc=f;this.la.rc=f;this.ka.Hd= +this.la.Hd=f>>6&1;this.ka.head=this.la.head=f&15});this.j=this.ra=this.nd=0;L(a.A,this.g|7,this,function(f){Jb(this.s,this.ca);var h=this.ta;if(h.buffer)switch(h.o=f,h.error=0,f){case 8:h.i=0;h.g=0;h.h=0;Mb(h);h.S();break;case 16:h.status=80;h.na=0;h.S();break;case 248:h.status=80;var k=h.j-1;h.wa=k&255;h.na=k>>8&255;h.qa=k>>16&255;h.rc=h.rc&240|k>>24&15;h.S();break;case 39:h.status=80;k=h.j-1;h.wa=k&255;h.na=k>>8&255;h.qa=k>>16&255;h.wa|=k>>24<<8&65280;h.S();break;case 32:case 36:case 41:case 196:Nb(h, +f);break;case 48:case 52:case 57:case 197:var l=52===f||57===f;k=Ob(h,l);l=Pb(h,l);f=48===f||52===f;k*=h.l;l*=h.l;l+k>h.buffer.byteLength?(h.status=255,h.S()):(h.status=88,Qb(h,k),h.g=f?512:Math.min(k,512*h.L),h.X=l);break;case 144:h.S();h.error=257;h.status=80;break;case 145:h.status=80;h.S();break;case 160:h.J&&(h.status=88,Rb(h,12),h.g=12,h.ea=1,h.S());break;case 161:h.J?(Sb(h),h.status=88,h.na=20,h.qa=235):h.status=65;h.S();break;case 198:h.L=h.ea&255;h.status=80;h.S();break;case 37:case 200:k= +37===f;l=Ob(h,k);Pb(h,k)*h.l+l*h.l>h.buffer.byteLength?(h.status=255,h.S()):(h.status=88,h.oa.ra|=1);break;case 53:case 202:k=53===f;l=Ob(h,k);Pb(h,k)*h.l+l*h.l>h.buffer.byteLength?(h.status=255,h.S()):(h.status=88,h.oa.ra|=1);break;case 64:h.status=80;h.S();break;case 218:h.status=65;h.error=4;h.S();break;case 224:h.status=80;h.S();break;case 225:h.status=80;h.S();break;case 231:h.status=80;h.S();break;case 236:if(h.J){h.status=65;h.error=4;h.S();break}Sb(h);h.status=88;h.S();break;case 234:h.status= +80;h.S();break;case 239:h.status=80;h.S();break;case 222:h.status=80;h.S();break;case 245:h.status=80;h.S();break;case 249:h.status=65;h.error=4;break;default:h.status=65,h.error=4}else h.error=4,h.status=65,h.S()});K(a.A,this.h|4,this,void 0,void 0,this.vh);L(a.A,this.h|4,this,void 0,void 0,this.zh);K(a.A,this.h,this,this.xh,void 0,this.wh);L(a.A,this.h,this,this.Wf,void 0,this.Ah);K(a.A,this.h|2,this,this.yh);L(a.A,this.h|2,this,this.Xf);K(a.A,this.h|8,this,function(){return 0});K(a.A,this.h|10, +this,function(){return 0});Tb(a.u.Ha,this)}p=Hb.prototype;p.Lg=function(){return this.ta.buffer?this.ta.status:0};p.Uj=function(a){a&4&&(Jb(this.s,this.ca),Mb(this.ka),Mb(this.la));this.l=a};p.vh=function(){return this.nd};p.zh=function(a){this.nd=a};p.yh=function(){return this.ra};p.Xf=function(a){this.ra&=~(a&6)};p.wh=function(){return this.j|this.ra<<16};p.xh=function(){return this.j};p.Ah=function(a){this.Wf(a&255);this.Xf(a>>16&255)}; +p.Wf=function(a){let b=this.j;this.j=a&9;if((b&1)!==(a&1))if(0===(a&1))this.ra&=-2;else switch(this.ra|=1,this.ta.o){case 37:case 200:Ub(this.ta);break;case 202:case 53:Vb(this.ta);break;case 160:Wb(this.ta)}};p.S=function(){0===(this.l&2)&&(this.ra|=4,this.s.Ka(this.ca))};p.$=function(){var a=[];a[0]=this.ka;a[1]=this.la;a[2]=this.g;a[3]=this.ca;a[4]=this.Ia;a[5]=this.i;a[6]=this.h;a[7]=this.name;a[8]=this.l;a[9]=this.nd;a[10]=this.ra;a[11]=this.ta===this.ka;a[12]=this.j;return a}; +p.H=function(a){this.ka.H(a[0]);this.la.H(a[1]);this.g=a[2];this.ca=a[3];this.Ia=a[4];this.i=a[5];this.h=a[6];this.name=a[7];this.l=a[8];this.nd=a[9];this.ra=a[10];this.ta=a[11]?this.ka:this.la;this.j=a[12]}; +function Ib(a,b,c,d,e,g){this.oa=a;this.v=g;this.Y=e;this.s=b;this.buffer=c;this.l=d?2048:512;this.J=d;this.F=this.C=this.D=this.j=0;this.buffer&&(this.j=this.buffer.byteLength/this.l,this.j!==(this.j|0)&&(this.j=Math.ceil(this.j)),d?(this.D=1,this.C=0):(this.D=16,this.C=63),this.F=this.j/this.D/this.C,this.F!==(this.F|0)&&(this.F=Math.floor(this.F)),a=b.u.Ic,a.W[57]|=1<<4*this.Y,a.W[18]=a.W[18]&15|240,a.W[27]=this.F&255,a.W[28]=this.F>>8&255,a.W[29]=this.D&255,a.W[30]=255,a.W[31]=255,a.W[32]=200, +a.W[33]=this.F&255,a.W[34]=this.F>>8&255,a.W[35]=this.C&255);this.B={Ng:0,Og:0,Qf:0,Rf:0,jg:!1};this.buffer=c;this.rc=this.head=this.qa=this.na=this.ad=this.wa=this.ea=this.Hd=0;this.status=80;this.L=128;this.i=this.error=0;this.data=new Uint8Array(65536);this.V=new Uint16Array(this.data.buffer);this.O=new Int32Array(this.data.buffer);this.g=this.h=0;this.T=this.o=-1;this.pa=this.X=0;this.P=new Set;this.ba=new Set;Object.seal(this)} +function Mb(a){a.J?(a.status=0,a.ea=1,a.error=1,a.wa=1,a.na=20,a.qa=235):(a.status=81,a.ea=1,a.error=1,a.wa=1,a.na=0,a.qa=0);for(const b of a.P)a.ba.add(b);a.P.clear()}p=Ib.prototype;p.S=function(){this.oa.S()};p.be=function(){this.status=80;var a=this.data.subarray(0,this.h);Xb(this,this.o,this.h/512);this.S();this.buffer.set(this.X,a,function(){});Yb(this,this.h)}; +function Zb(a,b){var c=(b[7]<<8|b[8])*a.l;b=(b[2]<<24|b[3]<<16|b[4]<<8|b[5])*a.l;a.h=0;var d=a.qa<<8&65280|a.na&255;a.na=a.qa=0;65535===d&&d--;d>c&&(d=c);b>=a.buffer.byteLength?(a.status=255,a.S()):0===c?(a.status=80,a.i=0):(c=Math.min(c,a.buffer.byteLength-b),a.status=208,$b(a),a.fa(b,c,e=>{ac(a,e);a.status=88;a.ea=a.ea&-8|2;a.S();d&=-4;a.g=d;a.g>a.h&&(a.g=a.h);a.na=a.g&255;a.qa=a.g>>8&255;bc(a,c)}))} +function cc(a,b){var c=(b[7]<<8|b[8])*a.l;b=(b[2]<<24|b[3]<<16|b[4]<<8|b[5])*a.l;b>=a.buffer.byteLength?(a.status=255,a.S()):(a.status=208,$b(a),a.fa(b,c,d=>{bc(a,c);a.status=88;a.ea=a.ea&-8|2;ac(a,d);Wb(a)}))}function Wb(a){if(0!==(a.oa.ra&1)&&0!==(a.status&8)){var b=a.oa.nd,c=0,d=a.data;do{var e=a.s.g(b),g=a.s.Oa(b+4),f=a.s.od(b+7)&128;g||(g=65536);ra(a.s,d.subarray(c,Math.min(c+g,a.h)),e);c+=g;b+=8;if(c>=a.h&&!f)break}while(!f);a.status=80;a.oa.ra&=-2;a.ea=a.ea&-8|3;a.S()}} +function Kb(a,b){if(a.i >>1]:a.O[a.i>>>2];a.i+=b;a.i>=a.g&&(160===a.o?a.g===a.h?(a.status=80,a.ea=a.ea&-8|3,a.S()):(a.status=88,a.ea=a.ea&-8|2,a.S(),b=a.qa<<8&65280|a.na&255,a.g+b>a.h?(a.na=a.h-a.g&255,a.qa=a.h-a.g>>8&255,a.g=a.h):a.g+=b):(a.error=0,a.i>=a.h?a.status=80:(b=196===a.o||41===a.o?Math.min(a.L,(a.h-a.g)/512):1,Xb(a,a.o,b),a.g+=512*b,a.status=88),a.S()));return c}a.i+=b;return 0} +function Lb(a,b,c){if(!(a.i>=a.g)&&(1===c?a.data[a.i++]=b:2===c?(a.V[a.i>>>1]=b,a.i+=2):(a.O[a.i>>>2]=b,a.i+=4),a.i===a.g))if(160===a.o){a.i=0;a.T=a.data[0];switch(a.T){case 0:Rb(a,0);a.g=a.h;a.status=80;break;case 3:Rb(a,a.data[4]);a.g=a.h;a.status=88;a.data[0]=240;a.data[2]=5;a.data[7]=8;break;case 18:b=a.data[4];a.status=88;a.data.set([5,128,1,49,31,0,0,0,83,79,78,89,32,32,32,32,67,68,45,82,79,77,32,67,68,85,45,49,48,48,48,32,49,46,49,97]);a.g=a.h=Math.min(36,b);break;case 26:Rb(a,a.data[4]);a.g= +a.h;a.status=88;break;case 30:Rb(a,0);a.g=a.h;a.status=80;break;case 37:b=a.j-1;ac(a,new Uint8Array([b>>24&255,b>>16&255,b>>8&255,b&255,0,0,a.l>>8&255,a.l&255]));a.g=a.h;a.status=88;break;case 40:a.ad&1?cc(a,a.data):Zb(a,a.data);break;case 66:b=a.data[8];Rb(a,Math.min(8,b));a.g=a.h;a.status=88;break;case 67:b=a.data[8]|a.data[7]<<8;c=a.data[9]>>6;Rb(a,b);a.g=a.h;0===c?(b=a.j,a.data.set(new Uint8Array([0,18,1,1,0,20,1,0,0,0,0,0,0,22,170,0,b>>24,b>>16&255,b>>8&255,b&255]))):1===c&&a.data.set(new Uint8Array([0, +10,1,1,0,0,0,0,0,0,0,0]));a.status=88;break;case 70:b=a.data[8]|a.data[7]<<8;b=Math.min(b,32);Rb(a,b);a.g=a.h;a.data[0]=b-4>>24&255;a.data[1]=b-4>>16&255;a.data[2]=b-4>>8&255;a.data[3]=b-4&255;a.data[6]=8;a.data[10]=3;a.status=88;break;case 81:Rb(a,0);a.g=a.h;a.status=80;break;case 82:a.status=81;a.h=0;a.error=80;break;case 90:b=a.data[8]|a.data[7]<<8;42===a.data[2]&&Rb(a,Math.min(30,b));a.g=a.h;a.status=88;break;case 189:Rb(a,a.data[9]|a.data[8]<<8);a.g=a.h;a.data[5]=1;a.status=88;break;case 74:a.status= +81;a.h=0;a.error=80;break;case 190:Rb(a,0);a.g=a.h;a.status=80;break;default:a.status=81,a.h=0,a.error=80}a.ea=a.ea&-8|2;0===(a.status&128)&&a.S();0===(a.status&128)&&0===a.h&&(a.ea|=1,a.status&=-9)}else a.i>=a.h?a.be():(a.status=88,a.g+=512,a.S())} +function Xb(a,b,c){a.ea-=c;36===b||41===b||52===b||57===b||37===b||53===b?(b=c+dc(a),a.wa=b&255|b>>16&65280,a.na=b>>8&255,a.qa=b>>16&255):a.Hd?(b=c+ec(a),a.wa=b&255,a.na=b>>8&255,a.qa=b>>16&255,a.head=a.head&-16|b&15):(b=c+gc(a),c=b/(a.D*a.C)|0,a.na=c&255,a.qa=c>>8&255,a.head=(b/a.C|0)%a.D&15,a.wa=b%a.C+1&255,gc(a))} +function Nb(a,b){var c=36===b||41===b,d=Ob(a,c);c=Pb(a,c);var e=32===b||36===b,g=d*a.l;c*=a.l;c+g>a.buffer.byteLength?(a.status=255,a.S()):(a.status=192,$b(a),a.fa(c,g,f=>{ac(a,f);a.status=88;a.g=e?512:Math.min(g,512*a.L);Xb(a,b,e?1:Math.min(d,a.C));a.S();bc(a,g)}))} +function Ub(a){var b=37===a.o,c=Ob(a,b);b=Pb(a,b);var d=c*a.l;b*=a.l;$b(a);a.fa(b,d,e=>{var g=a.oa.nd,f=0;do{var h=a.s.g(g),k=a.s.Oa(g+4),l=a.s.od(g+7)&128;k||(k=65536);ra(a.s,e.subarray(f,f+k),h);f+=k;g+=8}while(!l);Xb(a,a.o,c);a.status=80;a.oa.ra&=-2;a.o=-1;a.S();bc(a,d)})} +function Vb(a){var b=53===a.o,c=Ob(a,b),d=Pb(a,b);b=c*a.l;d*=a.l;var e=a.oa.nd,g=0;const f=new Uint8Array(b);do{var h=a.s.g(e),k=a.s.Oa(e+4),l=a.s.od(e+7)&128;k||(k=65536);f.set(a.s.Na.subarray(h,h+k),g);g+=k;e+=8}while(!l);a.buffer.set(d,f,()=>{Xb(a,a.o,c);a.status=80;a.S();a.oa.ra&=-2;a.o=-1});Yb(a,b)}function gc(a){return((a.na&255|a.qa<<8&65280)*a.D+a.head)*a.C+(a.wa&255)-1}function ec(a){return a.wa&255|a.na<<8&65280|a.qa<<16&16711680|(a.head&15)<<24} +function dc(a){return(a.wa&255|a.na<<8&65280|a.qa<<16&16711680|a.wa>>8<<24&4278190080)>>>0}function Pb(a,b){return b?dc(a):a.Hd?ec(a):gc(a)}function Ob(a,b){b?(a=a.ea,0===a&&(a=65536)):(a=a.ea&255,0===a&&(a=256));return a} +function Sb(a){if(a.rc&16)Rb(a,0);else{for(var b=0;512>b;b++)a.data[b]=0;b=Math.min(16383,a.F);ac(a,[64,a.J?133:0,b,b>>8,0,0,a.D,a.D>>8,a.C/512,a.C/512>>8,0,2,a.C,a.C>>8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,4,0,0,0,0,0,0,0,0,0,56,118,32,54,68,72,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,128,0,1,0,0,2,0,0,0,2,0,2,7,0,b,b>>8,a.D,a.D>>8,a.C,0,a.j&255,a.j>>8&255,a.j>>16&255,a.j>>24&255,0,0,a.j&255,a.j>>8&255,a.j>>16&255, +a.j>>24&255,0,0,160===a.o?0:7,160===a.o?0:4,0,0,30,0,30,0,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,0,0,0,0,0,0,116,0,64,0,64,0,116,0,64,0,0,0,0,0,0,0,0,0,0,1,96,0,0,0,0,0,0,0,0,0,0,0,0,a.j&255,a.j>>8&255,a.j>>16&255,a.j>>24&255]);a.h=512;a.g=512}}function Rb(a,b){Qb(a,b);for(var c=0;c>2;c++)a.O[c]=0}function Qb(a,b){a.data.length{this.ba.delete(d)?this.P.has(d):(this.P.delete(d),c(e))})}; +p.$=function(){var a=[];a[0]=this.ea;a[1]=this.F;a[2]=this.qa;a[3]=this.na;a[4]=this.i;a[5]=0;a[6]=0;a[7]=0;a[8]=0;a[9]=this.rc;a[10]=this.error;a[11]=this.head;a[12]=this.D;a[13]=this.J;a[14]=this.Hd;a[15]=this.ad;a[16]=this.data;a[17]=this.h;a[18]=this.wa;a[19]=this.j;a[20]=this.l;a[21]=this.L;a[22]=this.C;a[23]=this.status;a[24]=this.X;a[25]=this.o;a[26]=this.g;a[27]=this.T;a[28]=this.buffer;return a}; +p.H=function(a){this.ea=a[0];this.F=a[1];this.qa=a[2];this.na=a[3];this.i=a[4];this.rc=a[9];this.error=a[10];this.head=a[11];this.D=a[12];this.J=a[13];this.Hd=a[14];this.ad=a[15];this.data=a[16];this.h=a[17];this.wa=a[18];this.j=a[19];this.l=a[20];this.L=a[21];this.C=a[22];this.status=a[23];this.X=a[24];this.o=a[25];this.g=a[26];this.T=a[27];this.V=new Uint16Array(this.data.buffer);this.O=new Int32Array(this.data.buffer);this.buffer&&this.buffer.H(a[28])};function hc(a){this.qb=new Uint8Array(4);this.g=new Uint8Array(4);this.hd=new Uint8Array(4);this.jd=new Uint8Array(4);this.gd=new Int32Array(this.qb.buffer);new Int32Array(this.g.buffer);this.rg=new Int32Array(this.hd.buffer);this.tg=new Int32Array(this.jd.buffer);this.yb=[];this.u=[];this.s=a;for(var b=0;256>b;b++)this.yb[b]=void 0,this.u[b]=void 0;this.A=a.A;L(a.A,3324,this,function(c){ic(this,this.gd[0],c)},function(c){jc(this,this.gd[0],c)},function(c){var d=this.gd[0],e=d>>8&65535,g=d&255;d= +this.yb[e];e=this.u[e];if(d)if(16<=g&&40>g)if(e=e.ib[g-16>>2]){g>>=2;var f=d[g]&1;-1===(c|3|e.size-1)?(c=~(e.size-1)|f,0===f&&(d[g]=c)):0===f&&(d[g]=e.og);1===f&&(kc(this,e,d[g]&65534,c&65534),d[g]=c|1)}else d[g>>2]=0;else 48===g?d[g>>2]=e.sg?-1===(c|2047)?-e.sg|0:e.ci|0:0:4!==g&&(d[g>>>2]=c)});L(a.A,3325,this,function(c){ic(this,this.gd[0]+1|0,c)});L(a.A,3326,this,function(c){ic(this,this.gd[0]+2|0,c)},function(c){jc(this,this.gd[0]+2|0,c)});L(a.A,3327,this,function(c){ic(this,this.gd[0]+3|0,c)}); +a.A.pd(3324,this,function(){return this.hd[0]},function(){return this.hd[1]},function(){return this.hd[2]},function(){return this.hd[3]});a.A.pd(3320,this,function(){return this.jd[0]},function(){return this.jd[1]},function(){return this.jd[2]},function(){return this.jd[3]});a.A.Lb(3320,this,function(c){this.qb[0]=c&252},function(c){2===(this.qb[1]&6)&&6===(c&6)?lc(a):this.qb[1]=c},function(c){this.qb[2]=c},function(c){this.qb[3]=c;c=this.qb[0]&252;var d=this.yb[this.qb[2]<<8|this.qb[1]];void 0!== +d?(this.tg[0]=-2147483648,this.rg[0]=c >2]:0):(this.rg[0]=-1,this.tg[0]=0)});Tb(this,{Ia:0,K:[134,128,55,18,0,0,0,0,2,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0],ib:[],name:"82441FX PMC"});this.i={Ia:8,K:[134,128,0,112,7,0,0,2,0,0,1,6,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ib:[],name:"82371SB PIIX3 ISA"}; +this.j=Tb(this,this.i);this.h=new Uint8Array(this.j.buffer)}hc.prototype.$=function(){for(var a=[],b=0;256>b;b++)a[b]=this.yb[b];a[256]=this.qb;a[257]=this.g;a[258]=this.hd;a[259]=this.jd;return a};hc.prototype.H=function(a){for(var b=0;256>b;b++){var c=this.u[b],d=a[b];if(c&&d){for(var e=0;e >8&65535].buffer))[d]=c}function jc(a,b,c){var d=b&255;a=new Uint16Array(a.yb[b>>8&65535].buffer);!a||16<=d&&44>d||(a[d>>>1]=c)}function Tb(a,b){var c=b.Ia,d=new Int32Array(64);d.set(new Int32Array((new Uint8Array(b.K)).buffer));a.yb[c]=d;a.u[c]=b;c=d.slice(4,10);for(var e=0;e >8&255)-1+((a>>3)-1&255)&3)])};function mc(a,b){Jb(a.s,a.h[96+((a.yb[b][15]>>8&255)+(b>>3&255)-2&3)])};function nc(a,b){this.A=a.A;this.s=a;this.eb=a.u.eb;this.h=0;this.L=new Uint8Array(10);this.O=0;this.j=null;this.g=new Uint8Array(10);this.l=this.i=0;this.F=b;this.J=this.C=this.V=this.ba=this.Y=this.X=0;this.P=1;this.o=0;if(b){var c={[163840]:{type:1,kb:40,jb:8,gb:1},[184320]:{type:1,kb:40,jb:9,gb:1},[204800]:{type:1,kb:40,jb:10,gb:1},[327680]:{type:1,kb:40,jb:8,gb:2},[368640]:{type:1,kb:40,jb:9,gb:2},[409600]:{type:1,kb:40,jb:10,gb:2},[737280]:{type:3,kb:80,jb:9,gb:2},[1228800]:{type:2,kb:80,jb:15, +gb:2},[1474560]:{type:4,kb:80,jb:18,gb:2},[1763328]:{type:5,kb:82,jb:21,gb:2},[2949120]:{type:5,kb:80,jb:36,gb:2},512:{type:1,kb:1,jb:1,gb:1}},d=b.byteLength;d=c[d];d||(d=1474560 >2&1;this.Aa()};p.lh=function(){this.Aa()};function oc(a,b,c){var d=c[2],e=c[1],g=c[3],f=128< this.B&&(d=1,c++,c>=this.D&&(c=0,b++)),this.C=b,this.J=c,this.P=d,this.i=0,this.l=7,this.g[0]=c<<2|32,this.g[1]=0,this.g[2]=0,this.g[3]=b,this.g[4]=c,this.g[5]=d,this.g[6]=a[4],this.Aa())};p.Ih=function(){};p.Ej=function(){this.i=0;this.l=7;this.g[0]=0;this.g[1]=0;this.g[2]=0;this.g[3]=0;this.g[4]=0;this.g[5]=0;this.g[6]=0;this.Aa()};p.Aa=function(){this.o&8&&this.s.Ka(6)};function ra(a,b,c){b.length&&(a.Me(c),a.Me(c+b.length-1),a.Uh(c,c+b.length),a.Na.set(b,c))};function qc(a){this.s=a;this.o=new Uint8Array(8);this.B=new Uint8Array(8);this.g=new Uint16Array(8);this.j=new Uint16Array(8);this.h=new Uint16Array(8);this.l=new Uint16Array(8);this.Yb=new Uint8Array(8);this.C=new Uint8Array(8);this.cf=[];this.i=0;a=a.A;L(a,0,this,this.Dc.bind(this,0));L(a,2,this,this.Dc.bind(this,1));L(a,4,this,this.Dc.bind(this,2));L(a,6,this,this.Dc.bind(this,3));L(a,1,this,this.Fc.bind(this,0));L(a,3,this,this.Fc.bind(this,1));L(a,5,this,this.Fc.bind(this,2));L(a,7,this,this.Fc.bind(this, +3));K(a,0,this,this.Cc.bind(this,0));K(a,2,this,this.Cc.bind(this,1));K(a,4,this,this.Cc.bind(this,2));K(a,6,this,this.Cc.bind(this,3));K(a,1,this,this.Ec.bind(this,0));K(a,3,this,this.Ec.bind(this,1));K(a,5,this,this.Ec.bind(this,2));K(a,7,this,this.Ec.bind(this,3));L(a,192,this,this.Dc.bind(this,4));L(a,196,this,this.Dc.bind(this,5));L(a,200,this,this.Dc.bind(this,6));L(a,204,this,this.Dc.bind(this,7));L(a,194,this,this.Fc.bind(this,4));L(a,198,this,this.Fc.bind(this,5));L(a,202,this,this.Fc.bind(this, +6));L(a,206,this,this.Fc.bind(this,7));K(a,192,this,this.Cc.bind(this,4));K(a,196,this,this.Cc.bind(this,5));K(a,200,this,this.Cc.bind(this,6));K(a,204,this,this.Cc.bind(this,7));K(a,194,this,this.Ec.bind(this,4));K(a,198,this,this.Ec.bind(this,5));K(a,202,this,this.Ec.bind(this,6));K(a,206,this,this.Ec.bind(this,7));L(a,135,this,this.Hc.bind(this,0));L(a,131,this,this.Hc.bind(this,1));L(a,129,this,this.Hc.bind(this,2));L(a,130,this,this.Hc.bind(this,3));L(a,143,this,this.Hc.bind(this,4));L(a,139, +this,this.Hc.bind(this,5));L(a,137,this,this.Hc.bind(this,6));L(a,138,this,this.Hc.bind(this,7));K(a,135,this,this.Gc.bind(this,0));K(a,131,this,this.Gc.bind(this,1));K(a,129,this,this.Gc.bind(this,2));K(a,130,this,this.Gc.bind(this,3));K(a,143,this,this.Gc.bind(this,4));K(a,139,this,this.Gc.bind(this,5));K(a,137,this,this.Gc.bind(this,6));K(a,138,this,this.Gc.bind(this,7));L(a,1159,this,this.md.bind(this,0));L(a,1155,this,this.md.bind(this,1));L(a,1153,this,this.md.bind(this,2));L(a,1154,this,this.md.bind(this, +3));L(a,1163,this,this.md.bind(this,5));L(a,1161,this,this.md.bind(this,6));L(a,1162,this,this.md.bind(this,7));K(a,1159,this,this.ld.bind(this,0));K(a,1155,this,this.ld.bind(this,1));K(a,1153,this,this.ld.bind(this,2));K(a,1154,this,this.ld.bind(this,3));K(a,1163,this,this.ld.bind(this,5));K(a,1161,this,this.ld.bind(this,6));K(a,1162,this,this.ld.bind(this,7));L(a,10,this,this.Ig.bind(this,0));L(a,212,this,this.Ig.bind(this,4));L(a,15,this,this.Hg.bind(this,0));L(a,222,this,this.Hg.bind(this,4)); +K(a,15,this,this.Gg.bind(this,0));K(a,222,this,this.Gg.bind(this,4));L(a,11,this,this.Fg.bind(this,0));L(a,214,this,this.Fg.bind(this,4));L(a,12,this,this.Eg);L(a,216,this,this.Eg)}p=qc.prototype;p.$=function(){return[this.o,this.B,this.g,this.j,this.h,this.l,this.Yb,this.C,this.i]};p.H=function(a){this.o=a[0];this.B=a[1];this.g=a[2];this.j=a[3];this.h=a[4];this.l=a[5];this.Yb=a[6];this.C=a[7];this.i=a[8]};p.Fc=function(a,b){this.h[a]=rc(this,this.h[a],b,!1);this.l[a]=rc(this,this.l[a],b,!0)}; +p.Ec=function(a){return sc(this,this.h[a])};p.Dc=function(a,b){this.g[a]=rc(this,this.g[a],b,!1);this.j[a]=rc(this,this.j[a],b,!0)};p.Cc=function(a){return sc(this,this.g[a])};p.md=function(a,b){this.B[a]=b};p.ld=function(a){return this.B[a]};p.Hc=function(a,b){this.o[a]=b};p.Gc=function(a){return this.o[a]};p.Ig=function(a,b){tc(this,(b&3)+a,b&4?1:0)};p.Hg=function(a,b){for(var c=0;4>c;c++)tc(this,a+c,b&1< b.byteLength)d(!0);else{var f=a.s;a.g[2]+=e;b.get(c,e,function(h){ra(f,h,g);d(!1)})}} +p.be=function(a,b,c,d,e){var g=this.h[d]+1&65535,f=5<=d?2:1,h=g*f,k=uc(this,d),l=!1,q=!1,n=this.C[d]&16;c h&&(q=!0);b+h>a.byteLength?e(!0):(this.g[d]+=g,this.h[d]-=g,!l&&n&&(this.g[d]=this.j[d],this.h[d]=this.l[d]),a.set(b,this.s.Na.subarray(k,k+h),()=>{q&&n?this.be(a,b+h,c-h,d,e):e(!1)}))};function uc(a,b){var c=a.g[b];5<=b&&(c<<=1);c=c&65535|a.o[b]<<16;return c|=a.B[b]<<24}function rc(a,b,c,d){d||(a.i^=1);return a.i?b&-256|c:b&-65281|c<<8} +function sc(a,b){a.i^=1;return a.i?b&255:b>>8&255};function vc(a,b){this.s=a;this.v=b;this.i=new Float64Array(3);this.j=new Uint16Array(3);this.g=new Uint8Array(4);this.h=new Uint8Array(4);this.Sc=new Uint8Array(4);this.B=new Uint8Array(4);this.l=new Uint8Array(4);this.o=new Uint16Array(3);this.mb=new Uint16Array(3);K(a.A,97,this,function(){var c=nb(),d=66.66666666666667*c&1;c=wc(this,2,c);return d<<4|c<<5});L(a.A,97,this,function(c){c&1?this.v.send("pcspeaker-enable"):this.v.send("pcspeaker-disable")});K(a.A,64,this,function(){return xc(this,0)}); +K(a.A,65,this,function(){return xc(this,1)});K(a.A,66,this,function(){return xc(this,2)});L(a.A,64,this,function(c){yc(this,0,c)});L(a.A,65,this,function(c){yc(this,1,c)});L(a.A,66,this,function(c){yc(this,2,c);this.v.send("pcspeaker-update",[this.Sc[2],this.mb[2]])});L(a.A,67,this,this.C)}vc.prototype.$=function(){var a=[];a[0]=this.g;a[1]=this.h;a[2]=this.Sc;a[3]=this.B;a[4]=this.l;a[5]=this.o;a[6]=this.mb;a[7]=this.i;a[8]=this.j;return a}; +vc.prototype.H=function(a){this.g=a[0];this.h=a[1];this.Sc=a[2];this.B=a[3];this.l=a[4];this.o=a[5];this.mb=a[6];this.i=a[7];this.j=a[8]};vc.prototype.sb=function(a,b){var c=100;b||(this.h[0]&&wc(this,0,a)?(this.j[0]=zc(this,0,a),this.i[0]=a,Jb(this.s,0),this.s.Ka(0),0===this.Sc[0]&&(this.h[0]=0)):Jb(this.s,0),this.h[0]&&(c=(this.j[0]-Math.floor(1193.1816666*(a-this.i[0])))/1193.1816666));return c}; +function zc(a,b,c){if(!a.h[b])return 0;c=a.j[b]-Math.floor(1193.1816666*(c-a.i[b]));a=a.mb[b];c>=a?c%=a:0>c&&(c=c%a+a);return c}function wc(a,b,c){c-=a.i[b];return 0>c?!0:a.j[b] >8;c=a.g[b];3===a.Sc[b]&&(a.g[b]^=1);a=zc(a,b,nb());return c?a&255:a>>8} +function yc(a,b,c){a.mb[b]=a.g[b]?a.mb[b]&-256|c:a.mb[b]&255|c<<8;3===a.B[b]&&a.g[b]||(a.mb[b]||(a.mb[b]=65535),a.j[b]=a.mb[b],a.h[b]=!0,a.i[b]=nb());3===a.B[b]&&(a.g[b]^=1)}vc.prototype.C=function(a){var b=a>>1&7,c=a>>6&3;a=a>>4&3;3!==c&&(0===a?(this.l[c]=2,b=zc(this,c,nb()),this.o[c]=b?b-1:0):(6<=b&&(b&=-5),this.g[c]=1===a?0:1,0===c&&Jb(this.s,0),this.Sc[c]=b,this.B[c]=a,2===c&&this.v.send("pcspeaker-update",[this.Sc[2],this.mb[2]])))};var Ac=Uint32Array.from([655360,655360,720896,753664]),Bc=Uint32Array.from([131072,65536,32768,32768]); +function Cc(a,b,c){this.s=a;this.v=b;this.ha=c;this.D=0;this.sc=14;this.qc=15;this.L=80;this.Tb=25;this.ze=this.Ea=this.Pd=this.mc=0;this.Id=[];this.Ac=this.Ba=0;this.cb=new Uint8Array(25);this.C=this.O=this.zc=this.P=this.g=this.i=this.Qb=this.Rb=this.Fa=0;this.uc=!0;this.Da=!1;setTimeout(()=>{b.send("screen-set-mode",this.Da)},0);this.$a=new Int32Array(256);this.h=0;this.ke=45253;this.Za=this.Pa=0;this.La=!1;this.Mb=32;this.ud=this.Sa=0;this.K=[52,18,17,17,3,1,0,0,0,0,0,3,0,0,0,0,8,14680064,57344, +224,0,0,0,0,0,0,191,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,26,0,17,0,0,190,254,0,0,0,0,0,0,0,0,0,0,0,0];this.Ia=144;this.ib=[{size:c}];this.sg=65536;this.ci=4272947200;this.name="vga";this.B={hg:!1,Fj:0,Gj:0,Pf:0};this.pa=this.tb=this.ba=this.F=0;this.X=255;this.Zb=new Uint8Array(16);this.l=-1;this.Ub=32;this.Rc=this.Sb=this.Cd=this.Ta=0;this.Wb=-1;this.Vb=15;this.bb=this.Xb=0;this.Pb=-1;this.Ra=this.kc=this.xc=0;this.vc=255;this.Y=this.V=this.T=this.Qa=this.wc=this.Ob=0;this.j=this.$c=255;c=a.A; +L(c,960,this,this.Pi);K(c,960,this,this.Ag,this.Oi);K(c,961,this,this.Bg);L(c,962,this,this.Qi);c.Lb(964,this,this.Si,this.Ui);K(c,964,this,this.Ri);K(c,965,this,this.Ti);c.Lb(974,this,this.ej,this.gj);K(c,974,this,this.dj);K(c,975,this,this.fj);K(c,966,this,this.Vi);L(c,966,this,this.Wi);L(c,967,this,this.Yi);K(c,967,this,this.Xi);L(c,968,this,this.$i);K(c,968,this,this.Zi);L(c,969,this,this.bj);K(c,969,this,this.aj);K(c,972,this,this.cj);c.Lb(980,this,this.ij,this.jj);K(c,980,this,this.hj);K(c, +981,this,this.Cg,()=>this.Cg());K(c,970,this,function(){return 0});K(c,986,this,this.Dg);K(c,954,this,this.Dg);this.ub=-1;this.J=0;L(c,462,this,void 0,this.ei);L(c,463,this,void 0,this.gi);K(c,463,this,void 0,this.fi);void 0===this.ha||262144>this.ha?this.ha=262144:this.ha&65535&&(this.ha|=65535,this.ha++);const d=a.ah(this.ha);this.Ff=Q(Uint8Array,a.Ja,d,this.ha);this.Zd=this.ha;this.Yd=0;this.ae=this.ha;this.$d=0;this.Fb=null;b.register("screen-fill-buffer",function(){if(this.Da){if(0===this.Fb.data.byteLength){var g= +new Uint8ClampedArray(this.s.Ja.buffer,this.jf,4*this.Ea*this.ze);this.Fb=new ImageData(g,this.Ea,this.ze);Dc(this)}if(this.La){g=0;var f=this.Za;if(8===this.Mb)for(var h=new Int32Array(this.s.Ja.buffer,this.jf,this.mc*this.Pd),k=new Uint8Array(this.s.Ja.buffer,this.Ff.byteOffset,this.ha),l=0;l >16|4278190080}else this.s.eh(this.Mb,this.ud),l=15===this.Mb?2:this.Mb/8,g=((this.s.dh[0]/l|0)-this.ud)/this.Pa|0,f=(((this.s.bh[0]/l|0)-this.ud)/this.Pa| +0)+1;g >>l;if(q){var t=k/this.Ea|0,m=k-this.Ea*t;switch(q){case 1:n=(t&1)<<13;t>>>=1;break;case 2:n=(t&1)<<14;t>>>=1;break;case 3:n=(t&3)<<13,t>>>=2}n|=(t*this.Ea+m>>>l)+this.Ba}t=this.Ve[n];m=this.We[n];var r=this.Xe[n],x=this.Ye[n];n=new Uint8Array(8); +switch(f){case 0:t<<=0;m<<=1;r<<=2;x<<=3;for(var w=7;0<=w;w--)n[7-w]=t>>w&1|m>>w&2|r>>w&4|x>>w&8;break;case 32:n[0]=t>>6&3|r>>4&12;n[1]=t>>4&3|r>>2&12;n[2]=t>>2&3|r>>0&12;n[3]=t>>0&3|r<<2&12;n[4]=m>>6&3|x>>4&12;n[5]=m>>4&3|x>>2&12;n[6]=m>>2&3|x>>0&12;n[7]=m>>0&3|x<<2&12;break;case 64:case 96:n[0]=t>>4&15,n[1]=t>>0&15,n[2]=m>>4&15,n[3]=m>>0&15,n[4]=r>>4&15,n[5]=r>>0&15,n[6]=x>>4&15,n[7]=x>>0&15}if(h)for(t=w=0;4>w;w++,k++,t+=2)this.Kd[k]=n[t]<<4|n[t+1];else for(w=0;8>w;w++,k++)this.Kd[k]=n[w]}h=this.Zd; +g=Math.min(this.Yd,524287);f=new Int32Array(this.s.Ja.buffer,this.jf,this.Ea*this.ze);l=255;q=0;this.Ta&128&&(l&=207,q|=this.Rc<<4&48);if(this.Ta&64)for(;h<=g;h++)k=this.Kd[h]&l|q,k=this.$a[k],f[h]=k&65280|k<<16|k>>16|4278190080;else for(l&=63,q|=this.Rc<<4&192;h<=g;h++)k=this.Zb[this.Kd[h]&this.Cd]&l|q,k=this.$a[k],f[h]=k&65280|k<<16|k>>16|4278190080;this.v.send("screen-fill-buffer-end",this.Id)}this.Zd=this.ha;this.Yd=0;this.ae=this.ha;this.$d=0}Fc(this)},this);this.o=new Uint8Array(262144);this.Ve= +new Uint8Array(this.o.buffer,0,65536);this.We=new Uint8Array(this.o.buffer,65536,65536);this.Xe=new Uint8Array(this.o.buffer,131072,65536);this.Ye=new Uint8Array(this.o.buffer,196608,65536);this.Kd=new Uint8Array(524288);var e=this;hb(c,655360,131072,function(g){return Gc(e,g)},function(g,f){if(e.La&&e.Da&&e.uc)e.s.df((g-655360|e.Sa)+3758096384|0,f);else{var h=e.Qa>>2&3;g-=Ac[h];if(!(0>g||g>=Bc[h]))if(e.Da){var k=f;f=Hc(e.vc);var l=Ic(e.Ob);h=Ic(e.wc);switch(e.kc&3){case 0:k=(k|k<<8)>>>(e.Ra&7)&255; +var q=Hc(k);k=Ic(e.Ob);q=Jc(e,(q|h&k)&(~h|k),e.h);q=f&q|~f&e.h;break;case 1:q=e.h;break;case 2:q=Ic(k);q=Jc(e,q,e.h);q=f&q|~f&e.h;break;case 3:k=(k|k<<8)>>>(e.Ra&7)&255,f&=Hc(k),q=f&l|~f&e.h}f=15;switch(e.Xb&12){case 0:f=5<<(g&1);g&=-2;break;case 8:case 12:f=1<<(g&3),g&=-4}f&=e.Vb;f&1&&(e.Ve[g]=q>>0&255);f&2&&(e.We[g]=q>>8&255);f&4&&(e.Xe[g]=q>>16&255);f&8&&(e.Ye[g]=q>>24&255);f=Kc(e,g);q=f+7;f e.$d&&(e.$d=q);f e.Yd&&(e.Yd=q)}else e.Vb&3&&(q=g,h=(q>>1)-e.Ba,g=h/e.L| +0,h%=e.L,q&1?(l=f,k=e.o[q&-2]):(k=f,l=e.o[q|1]),e.v.send("screen-put-char",[g,h,k,e.$a[e.X&e.Zb[l>>4&15]],e.$a[e.X&e.Zb[l&15]]]),e.o[q]=f)}});Tb(a.u.Ha,this)}p=Cc.prototype; +p.$=function(){var a=[];a[0]=this.ha;a[1]=this.D;a[2]=this.sc;a[3]=this.qc;a[4]=this.L;a[5]=this.Tb;a[6]=this.o;a[7]=this.pa;a[8]=this.Ba;a[9]=this.Da;a[10]=this.$a;a[11]=this.h;a[12]=this.T;a[13]=this.V;a[14]=this.Qa;a[15]=this.Pa;a[16]=this.Za;a[17]=this.Fa;a[18]=this.La;a[19]=this.Mb;a[20]=this.Sa;a[21]=this.ud;a[22]=this.F;a[23]=this.ba;a[24]=this.tb;a[25]=this.Zb;a[26]=this.Wb;a[27]=this.Vb;a[28]=this.Xb;a[29]=this.Pb;a[30]=this.xc;a[31]=this.kc;a[32]=this.Ra;a[33]=this.vc;a[34]=this.Y;a[35]= +this.$c;a[36]=this.j;a[37]=this.ub;a[38]=this.J;a[39]=this.Ff;a[40]=this.uc;a[41]=this.l;a[42]=this.O;a[43]=this.Ob;a[44]=this.wc;a[45]=this.Ac;a[46]=this.cb;a[47]=this.Rb;a[48]=this.Qb;a[49]=this.i;a[50]=this.g;a[51]=this.P;a[52]=this.zc;a[53]=this.O;a[54]=this.Ub;a[55]=this.Ta;a[56]=this.Cd;a[57]=this.Sb;a[58]=this.Rc;a[59]=this.bb;a[60]=this.C;a[61]=this.Kd;a[62]=this.X;return a}; +p.H=function(a){this.ha=a[0];this.D=a[1];this.sc=a[2];this.qc=a[3];this.L=a[4];this.Tb=a[5];a[6]&&this.o.set(a[6]);this.pa=a[7];this.Ba=a[8];this.Da=a[9];this.$a=a[10];this.h=a[11];this.T=a[12];this.V=a[13];this.Qa=a[14];this.Pa=a[15];this.Za=a[16];this.Fa=a[17];this.La=a[18];this.Mb=a[19];this.Sa=a[20];this.ud=a[21];this.F=a[22];this.ba=a[23];this.tb=a[24];this.Zb=a[25];this.Wb=a[26];this.Vb=a[27];this.Xb=a[28];this.Pb=a[29];this.xc=a[30];this.kc=a[31];this.Ra=a[32];this.vc=a[33];this.Y=a[34];this.$c= +a[35];this.j=a[36];this.ub=a[37];this.J=a[38];this.Ff.set(a[39]);this.uc=a[40];this.l=a[41];this.O=a[42];this.Ob=a[43];this.wc=a[44];this.Ac=a[45];this.cb.set(a[46]);this.Rb=a[47];this.Qb=a[48];this.i=a[49];this.g=a[50];this.P=a[51];this.zc=a[52];this.O=a[53];this.Ub=a[54];this.Ta=a[55];this.Cd=a[56];this.Sb=a[57];this.Rc=a[58];this.bb=a[59];this.C=a[60];a[61]&&this.Kd.set(a[61]);this.X=void 0===a[62]?255:a[62];this.v.send("screen-set-mode",this.Da);this.Da?(this.Pd=this.mc=0,this.La?(this.qd(this.Pa, +this.Za,this.Mb,this.Pa,this.Za),Dc(this)):(Lc(this),Dc(this),Mc(this))):(this.rd(this.L,this.Tb),this.xd(),this.wd());Nc(this)}; +function Gc(a,b){if(a.La&&a.uc)return a.s.od((b-655360|a.Sa)+3758096384|0);var c=a.Qa>>2&3;b-=Ac[c];if(0>b||b>=Bc[c])return 0;a.h=a.Ve[b];a.h|=a.We[b]<<8;a.h|=a.Xe[b]<<16;a.h|=a.Ye[b]<<24;if(a.kc&8)return c=255,a.V&1&&(c&=a.Ve[b]^~(a.T&1?255:0)),a.V&2&&(c&=a.We[b]^~(a.T&2?255:0)),a.V&4&&(c&=a.Xe[b]^~(a.T&4?255:0)),a.V&8&&(c&=a.Ye[b]^~(a.T&8?255:0)),c;c=a.xc;a.Da?a.Xb&8?(c=b&3,b&=-4):a.kc&16&&(c=b&1,b&=-2):c=0;return a.o[c<<16|b]}function Hc(a){return a|a<<8|a<<16|a<<24} +function Ic(a){return(a&1?255:0)|(a&2?255:0)<<8|(a&4?255:0)<<16|(a&8?255:0)<<24}function Jc(a,b,c){switch(a.Ra&24){case 8:return b&c;case 16:return b|c;case 24:return b^c}return b}function Oc(a){for(var b=a.Ba<<1,c,d,e=0;e >4&15]],a.$a[a.X&a.Zb[d&15]]]),b+=2}p.wd=function(){var a=(this.D-this.Ba)/this.L|0,b=(this.D-this.Ba)%this.L;a=Math.min(this.Tb-1,a);this.v.send("screen-update-cursor",[a,b])}; +function Nc(a){a.Da?a.La?a.s.lg():(a.Zd=0,a.Yd=524288):Oc(a)}function Mc(a){a.Da&&!a.La&&(a.ae=0,a.$d=524288,Nc(a))}p.va=function(){};function Ec(a){var b=128+(~a.P&a.Fa&64);b-=a.P&64;b-=a.Ta&64;return b>>>6}function Kc(a,b){var c=Ec(a);if(~a.Fa&3){var d=b-a.Ba;d&=a.Fa<<13|-24577;d<<=c;var e=d/a.Ea|0;d%=a.Ea;switch(a.Fa&3){case 2:e=e<<1|b>>13&1;break;case 1:e=e<<1|b>>14&1;break;case 0:e=e<<2|b>>13&3}return e*a.Ea+d+(a.Ba< >>=1);b=Math.ceil(b/(1+(a.Y&31)));a.Fa&1||(b<<=1);a.Fa&2||(b<<=1);return b}p.rd=function(a,b){this.L=a;this.Tb=b;this.v.send("screen-set-size-text",[a,b])}; +p.qd=function(a,b,c,d,e){if(!this.B.hg||this.B.Pf!==c||this.mc!==a||this.Pd!==b||this.Ea!==d||this.ze!==e){this.mc=a;this.Pd=b;this.Ea=d;this.ze=e;this.B.Pf=c;this.B.hg=!0;this.B.Fj=a;this.B.Gj=b;if("undefined"!==typeof ImageData){const g=d*e,f=this.s.$g(g)>>>0;this.jf=f;this.Fb=new ImageData(new Uint8ClampedArray(this.s.Ja.buffer,f,4*g),d,e);this.s.lg()}this.v.send("screen-set-size-graphical",[a,b,d,e,c])}}; +function Lc(a){if(!a.La){var b=Math.min(1+a.Rb,a.Qb),c=Math.min(1+a.i,a.g);if(b&&c)if(a.Da){b<<=3;var d=a.O<<4;a.Ta&64&&(b>>>=1,d>>>=1);var e=a.O<<2;a.P&64?e<<=1:a.Fa&64&&(e>>>=1);a.qd(b,Pc(a,c),8,d,Math.ceil(Bc[0]/e));Fc(a);Dc(a)}else a.Y&128&&(c>>>=1),c=c/(1+(a.Y&31))|0,b&&c&&a.rd(b,c)}} +function Dc(a){a.Da||Oc(a);if(a.La)a.Id=[];else if(a.Ea&&a.mc)if(!a.Ub||a.bb&32)a.Id=[],a.v.send("screen-clear");else{var b=a.Ac,c=a.Sb;a.Ta&64&&(c>>>=1);var d=a.zc>>5&3,e=Kc(a,b+d);b=e/a.Ea|0;var g=e%a.Ea+c;e=Pc(a,1+a.C);e=Math.min(e,a.Pd);var f=a.Pd-e;a.Id=[];g=-g;for(var h=0;g this.l)this.Zb[this.l]=a,this.Ta&64||Nc(this);else switch(this.l){case 16:if(this.Ta!==a){var b=this.Ta;this.Ta=a;var c=0<(a&1);this.La||this.Da===c||(this.Da=c,this.v.send("screen-set-mode",this.Da));(b^a)&64&&Mc(this);Lc(this);Nc(this)}break;case 18:this.Cd!==a&&(this.Cd=a,Nc(this));break;case 19:this.Sb!==a&&(this.Sb=a&15,Dc(this));break;case 20:this.Rc!==a&&(this.Rc=a,Nc(this))}this.l=-1}}; +p.Ag=function(){return this.l|this.Ub};p.Oi=function(){return this.Ag()&255|this.Bg()<<8&65280};p.Bg=function(){if(16>this.l)return this.Zb[this.l]&255;switch(this.l){case 16:return this.Ta;case 18:return this.Cd;case 19:return this.Sb;case 20:return this.Rc}return 255};p.Qi=function(a){this.$c=a};p.Si=function(a){this.Wb=a};p.Ri=function(){return this.Wb};p.Ui=function(a){switch(this.Wb){case 1:var b=this.bb;this.bb=a;(b^a)&32&&Dc(this);break;case 2:this.Vb=a;break;case 4:this.Xb=a}}; +p.Ti=function(){switch(this.Wb){case 1:return this.bb;case 2:return this.Vb;case 4:return this.Xb;case 6:return 18}return 0};p.Wi=function(a){this.X=a};p.Vi=function(){return this.X};p.Yi=function(a){this.tb=3*a;this.pa&=0};p.Xi=function(){return this.pa};p.$i=function(a){this.ba=3*a;this.pa|=3};p.Zi=function(){return this.ba/3&255}; +p.bj=function(a){var b=this.ba/3|0,c=this.ba%3,d=this.$a[b];if(0===(this.J&32)){a&=63;const e=a&1;a=a<<2|e<<1|e}d=0===c?d&-16711681|a<<16:1===c?d&-65281|a<<8:d&-256|a;this.$a[b]!==d&&(this.$a[b]=d,Nc(this));this.ba++};p.aj=function(){var a=this.$a[this.tb/3|0]>>8*(2-this.tb%3)&255;this.tb++;return this.J&32?a:a>>2};p.cj=function(){return this.$c};p.ej=function(a){this.Pb=a};p.dj=function(){return this.Pb}; +p.gj=function(a){switch(this.Pb){case 0:this.Ob=a;break;case 1:this.wc=a;break;case 2:this.T=a;break;case 3:this.Ra=a;break;case 4:this.xc=a;break;case 5:var b=this.kc;this.kc=a;(b^a)&96&&Mc(this);break;case 6:this.Qa!==a&&(this.Qa=a,Lc(this));break;case 7:this.V=a;break;case 8:this.vc=a}};p.fj=function(){switch(this.Pb){case 0:return this.Ob;case 1:return this.wc;case 2:return this.T;case 3:return this.Ra;case 4:return this.xc;case 5:return this.kc;case 6:return this.Qa;case 7:return this.V;case 8:return this.vc}return 0}; +p.ij=function(a){this.F=a};p.hj=function(){return this.F}; +p.jj=function(a){switch(this.F){case 1:this.Rb!==a&&(this.Rb=a,Lc(this));break;case 2:this.Qb!==a&&(this.Qb=a,Lc(this));break;case 7:var b=this.i;this.i&=255;this.i=this.i|a<<3&512|a<<7&256;b!=this.i&&Lc(this);this.C=this.C&767|a<<4&256;b=this.g;this.g=this.g&767|a<<5&256;b!==this.g&&Lc(this);Dc(this);break;case 8:this.zc=a;Dc(this);break;case 9:this.Y=a;this.C=this.C&511|a<<3&512;b=this.g;this.g=this.g&511|a<<4&512;b!==this.g&&Lc(this);Dc(this);break;case 10:this.sc=a;this.xd();break;case 11:this.qc= +a;this.xd();break;case 12:(this.Ba>>8&255)!==a&&(this.Ba=this.Ba&255|a<<8,Dc(this),~this.Fa&3&&Mc(this));break;case 13:(this.Ba&255)!==a&&(this.Ba=this.Ba&65280|a,Dc(this),~this.Fa&3&&Mc(this));break;case 14:this.D=this.D&255|a<<8;this.wd();break;case 15:this.D=this.D&65280|a;this.wd();break;case 18:(this.i&255)!==a&&(this.i=this.i&768|a,Lc(this));break;case 19:this.O!==a&&(this.O=a,Lc(this),~this.Fa&3&&Mc(this));break;case 20:this.P!==a&&(b=this.P,this.P=a,Lc(this),(b^a)&64&&Mc(this));break;case 21:(this.g& +255)!==a&&(this.g=this.g&768|a,Lc(this));break;case 23:this.Fa!==a&&(b=this.Fa,this.Fa=a,Lc(this),(b^a)&67&&Mc(this));break;case 24:this.C=this.C&768|a;Dc(this);break;default:this.F >7&2|this.g>>5&8|this.C>>4&16|this.i>>3&64;case 8:return this.zc;case 9:return this.Y;case 10:return this.sc;case 11:return this.qc;case 12:return this.Ba&255;case 13:return this.Ba>>8;case 14:return this.D>>8;case 15:return this.D&255;case 18:return this.i&255;case 19:return this.O;case 20:return this.P;case 21:return this.g&255;case 23:return this.Fa;case 24:return this.C&255}return this.F =a&&(this.ke=a);break;case 1:this.Pa=a;2560 >>16;case 6:return a.mc?a.mc:1;case 8:return 0;case 10:return a.ha/65536|0}return 255};function Rc(a,b){this.s=a;this.v=b;this.yd=this.tc=!1;this.ie=!0;this.dd=this.Ib=this.Hb=0;this.pa=!0;this.P=this.O=this.F=this.L=this.T=this.J=this.ce=!1;this.ja=new Ab(1024);this.l=0;this.Jc=100;this.j=this.i=0;this.C=!1;this.Nb=0;this.Md=4;this.B=!1;this.g=new Ab(1024);this.D=this.o=!1;this.v.register("keyboard-code",function(c){this.ce&&(this.ja.push(c),this.Aa())},this);this.v.register("mouse-click",function(c){this.ie&&this.yd&&(this.dd=c[0]|c[2]<<1|c[1]<<2,this.tc&&Sc(this,0,0))},this);this.v.register("mouse-delta", +function(c){var d=c[1];if(this.ie&&this.yd){var e=this.Md*this.Jc/80;this.Hb+=c[0]*e;this.Ib+=d*e;this.tc&&(c=this.Hb|0,d=this.Ib|0,c||d)&&(this.Hb-=c,this.Ib-=d,Sc(this,c,d))}},this);this.v.register("mouse-wheel",function(c){this.Nb-=c[0];this.Nb-=2*c[1];this.Nb=Math.min(7,Math.max(-8,this.Nb));Sc(this,0,0)},this);this.h=5;this.ba=0;this.X=this.V=this.Y=!1;K(a.A,96,this,this.xj);K(a.A,100,this,this.zj);L(a.A,96,this,this.yj);L(a.A,100,this,this.Aj)}p=Rc.prototype; +p.$=function(){var a=[];a[0]=this.tc;a[1]=this.yd;a[2]=this.ie;a[3]=this.Hb;a[4]=this.Ib;a[5]=this.dd;a[6]=this.pa;a[7]=this.ce;a[8]=this.J;a[9]=this.T;a[10]=this.L;a[11]=this.F;a[12]=this.O;a[13]=this.P;a[15]=this.l;a[16]=this.Jc;a[17]=this.Md;a[18]=this.B;a[20]=this.h;a[21]=this.Y;a[22]=this.V;a[23]=this.ba;a[24]=this.X;a[25]=this.j;a[26]=this.i;a[27]=this.C;return a}; +p.H=function(a){this.tc=a[0];this.yd=a[1];this.ie=a[2];this.Hb=a[3];this.Ib=a[4];this.dd=a[5];this.pa=a[6];this.ce=a[7];this.J=a[8];this.T=a[9];this.L=a[10];this.F=a[11];this.O=a[12];this.P=a[13];this.l=a[15];this.Jc=a[16];this.Md=a[17];this.B=a[18];this.h=a[20];this.Y=a[21];this.V=a[22];this.ba=a[23];this.X=a[24];this.j=a[25]||0;this.i=a[26]||0;this.C=a[27]||!1;this.D=this.o=!1;this.ja.clear();this.g.clear();this.v.send("mouse-enable",this.yd)}; +p.Aa=function(){this.o||(this.ja.length?Tc(this):this.g.length&&Uc(this))};function Uc(a){a.o=!0;a.D=!0;a.h&2&&(Jb(a.s,12),a.s.Ka(12))}function Tc(a){a.o=!0;a.D=!1;a.h&1&&(Jb(a.s,1),a.s.Ka(1))}function Sc(a,b,c){a.g.push((0>c)<<5|(0>b)<<4|8|a.dd);a.g.push(b);a.g.push(c);4===a.j?(a.g.push(0|a.Nb&15),a.Nb=0):3===a.j&&(a.g.push(a.Nb&255),a.Nb=0);a.Aa()} +p.xj=function(){this.o=!1;if(!this.ja.length&&!this.g.length)return this.l;this.D?(Jb(this.s,12),this.l=this.g.shift()):(Jb(this.s,1),this.l=this.ja.shift());(this.ja.length||this.g.length)&&this.Aa();return this.l};p.zj=function(){var a=16;this.o&&(a|=1);this.D&&(a|=32);return a}; +p.yj=function(a){if(this.V)this.h=a,this.V=!1;else if(this.Y)this.Y=!1,this.g.clear(),this.g.push(a),Uc(this);else if(this.T){this.T=!1;this.g.clear();this.g.push(250);this.Jc=a;switch(this.i){case -1:60===a?(this.C=!0,this.i=0):(this.C=!1,this.i=200===a?1:0);break;case 0:200===a&&(this.i=1);break;case 1:this.i=100===a?2:200===a?3:0;break;case 2:80===a&&(this.j=3);this.i=-1;break;case 3:80===a&&(this.j=4),this.i=-1}this.Jc||(this.Jc=100);Uc(this)}else if(this.P)this.P=!1,this.g.clear(),this.g.push(250), +this.Md=3>5;1===b?this.R&=this.R-1:3===b?this.R&=~(1<<(a&7)):192!==(a&200)&&(this.R&=this.R-1);this.j()}};p.hi=function(){return this.J?this.R:this.g};p.ki=function(a){0===this.state?this.F?(this.F=!1,this.o=a&2):(this.l=~a,this.j()):1===this.state?(this.C=a,this.state++):2===this.state&&(this.state=0)};p.ji=function(){return~this.l&255}; +p.vj=function(){return this.B};p.wj=function(a){this.B=a};function Wc(a){this.s=a;this.Qc=0;this.W=new Uint8Array(128);this.D=this.g=Date.now();this.l=this.j=0;this.B=!1;this.C=.9765625;this.o=38;this.h=2;this.tf=this.i=0;L(a.A,112,this,function(b){this.Qc=b&127;this.tf=b>>7});L(a.A,113,this,this.ph);K(a.A,113,this,this.oh)}p=Wc.prototype;p.$=function(){var a=[];a[0]=this.Qc;a[1]=this.W;a[2]=this.g;a[3]=this.D;a[4]=this.j;a[5]=this.l;a[6]=this.B;a[7]=this.C;a[8]=this.o;a[9]=this.h;a[10]=this.i;a[11]=this.tf;return a}; +p.H=function(a){this.Qc=a[0];this.W=a[1];this.g=a[2];this.D=a[3];this.j=a[4];this.l=a[5];this.B=a[6];this.C=a[7];this.o=a[8];this.h=a[9];this.i=a[10];this.tf=a[11]};p.sb=function(a){a=Date.now();this.g+=a-this.D;this.D=a;this.B&&this.j>4&15);return c} +p.oh=function(){switch(this.Qc){case 0:return Xc(this,(new Date(this.g)).getUTCSeconds());case 2:return Xc(this,(new Date(this.g)).getUTCMinutes());case 4:return Xc(this,(new Date(this.g)).getUTCHours());case 7:return Xc(this,(new Date(this.g)).getUTCDate());case 8:return Xc(this,(new Date(this.g)).getUTCMonth()+1);case 9:return Xc(this,(new Date(this.g)).getUTCFullYear()%100);case 10:return 999<=nb()%1E3?this.o|128:this.o;case 11:return this.h;case 12:Jb(this.s,8);var a=this.i;this.i&=-241;return a; +case 13:return 0;case 50:return Xc(this,(new Date(this.g)).getUTCFullYear()/100|0);default:return this.W[this.Qc]}}; +p.ph=function(a){switch(this.Qc){case 10:this.o=a&127;this.C=1E3/(32768>>(this.o&15)-1);break;case 11:this.h=a;this.h&64&&(this.j=Date.now());if(this.h&32){a=new Date;const b=Yc(this,this.W[1]),c=Yc(this,this.W[3]),d=Yc(this,this.W[5]);this.l=+new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),d,c,b))}break;case 1:case 3:case 5:this.W[this.Qc]=a}this.B=64===(this.h&64)&&0<(this.o&15)};function Zc(a,b,c){this.v=c;this.s=a;this.g=4;this.Bc=this.nc=0;this.cd=96;this.ec=this.ee=0;this.fc=1;this.ca=this.$e=this.rf=this.Re=0;this.input=new Ab(4096);switch(b){case 1016:this.h=0;this.ca=4;break;case 760:this.h=1;this.ca=3;break;case 1E3:this.h=2;this.ca=4;break;case 744:this.ca=this.h=3;break;default:this.h=0,this.ca=4}this.v.register("serial"+this.h+"-input",function(d){this.input.push(d);this.cd|=1;this.ee&1?$c(this,12):$c(this,4)},this);a=a.A;L(a,b,this,function(d){ad(this,d)},function(d){ad(this, +d&255);ad(this,d>>8)});L(a,b|1,this,function(d){this.Bc&128?this.nc=this.nc&255|d<<8:(0===(this.ec&2)&&d&2&&$c(this,2),this.ec=d&15,bd(this))});K(a,b,this,function(){if(this.Bc&128)return this.nc&255;var d=this.input.shift();0===this.input.length&&(this.cd&=-2,cd(this,12),cd(this,4));return d});K(a,b|1,this,function(){return this.Bc&128?this.nc>>8:this.ec&15});K(a,b|2,this,function(){var d=this.fc&15;2==this.fc&&cd(this,2);this.ee&1&&(d|=192);return d});L(a,b|2,this,function(d){this.ee=d});K(a,b| +3,this,function(){return this.Bc});L(a,b|3,this,function(d){this.Bc=d});K(a,b|4,this,function(){return this.Re});L(a,b|4,this,function(d){this.Re=d});K(a,b|5,this,function(){return this.cd});L(a,b|5,this,function(){});K(a,b|6,this,function(){return this.rf});L(a,b|6,this,function(){});K(a,b|7,this,function(){return this.$e});L(a,b|7,this,function(d){this.$e=d})} +Zc.prototype.$=function(){var a=[];a[0]=this.g;a[1]=this.nc;a[2]=this.Bc;a[3]=this.cd;a[4]=this.ee;a[5]=this.ec;a[6]=this.fc;a[7]=this.Re;a[8]=this.rf;a[9]=this.$e;a[10]=this.ca;return a};Zc.prototype.H=function(a){this.g=a[0];this.nc=a[1];this.Bc=a[2];this.cd=a[3];this.ee=a[4];this.ec=a[5];this.fc=a[6];this.Re=a[7];this.rf=a[8];this.$e=a[9];this.ca=a[10]}; +function bd(a){a.g&4096&&a.ec&1?(a.fc=12,a.s.Ka(a.ca)):a.g&16&&a.ec&1?(a.fc=4,a.s.Ka(a.ca)):a.g&4&&a.ec&2?(a.fc=2,a.s.Ka(a.ca)):a.g&1&&a.ec&8?(a.fc=0,a.s.Ka(a.ca)):(a.fc=1,Jb(a.s,a.ca))}function $c(a,b){a.g|=1<a.g&&a.g++:a.h+a.g<=b&&(a.g=0,a.h=b);return a.h+a.g}dd.prototype.$=function(){var a=[];a[0]=this.status;a[1]=this.kd;a[2]=this.ne;a[3]=this.Eb;return a};dd.prototype.H=function(a){this.status=a[0];this.kd=a[1];this.ne=a[2];this.Eb=a[3]};function fd(a){this.s=a;this.Y=this.pa=0;this.ba=1;this.g=this.l=0;this.j=nb();this.L=this.P=this.O=this.T=this.h=65536;this.F=this.D=this.B=0;this.i=new Int32Array(8);this.R=new Int32Array(8);this.o=new Int32Array(8);this.X=254;this.C=-1;this.V=this.error=this.J=0;hb(a.A,4276092928,1048576,b=>{var c=b&3;return this.qe(b&-4)>>8*c&255},()=>{},b=>this.qe(b),(b,c)=>this.Lc(b,c))}p=fd.prototype; +p.qe=function(a){a=a-4276092928|0;switch(a){case 32:return this.pa;case 48:return 327700;case 128:return this.B;case 208:return this.J;case 224:return this.C;case 240:return this.X;case 256:case 272:case 288:case 304:case 320:case 336:case 352:case 368:return this.R[a-256>>4];case 384:case 400:case 416:case 432:case 448:case 464:case 480:case 496:return this.o[a-384>>4];case 512:case 528:case 544:case 560:case 576:case 592:case 608:case 624:return this.i[a-512>>4];case 640:return this.V;case 768:return this.D; +case 784:return this.F;case 800:return this.h;case 832:return this.T;case 848:return this.O;case 864:return this.P;case 880:return this.L;case 992:return this.Y;case 896:return this.l;case 912:return this.g;default:return 0}}; +p.Lc=function(a,b){switch(a-4276092928|0){case 128:this.B=b&255;gd(this);break;case 176:b=hd(this.R);if(-1!==b){id(this.R,b);if(this.o[b>>5]>>(b&31)&1){a=this.s.u.yc;for(var c=0;24>c;c++){var d=a.g[c];(d&255)===b&&d&16384&&(a.g[c]&=-16385,jd(a,c))}}gd(this)}break;case 208:this.J=b&4278190080;break;case 224:this.C=b|16777215;break;case 240:this.X=b;break;case 640:this.V=this.error;this.error=0;break;case 768:a=b&255;c=b>>8&7;d=b>>15&1;var e=b>>18&3;this.D=b&-4097;0===e?kd(this,a,c,d):1===e?kd(this, +a,0,d):2===e&&kd(this,a,c,d);break;case 784:this.F=b;break;case 800:this.h=b;break;case 832:this.T=b;break;case 848:this.O=b;break;case 864:this.P=b;break;case 880:this.L=b;break;case 992:this.Y=b;b=b&3|(b&8)>>1;this.ba=7===b?0:b+1;break;case 896:this.l=b>>>0,this.g=b>>>0,this.j=nb()}}; +p.sb=function(a){if(0===this.g)return 100;const b=1E6/(1< >>0;this.j+=a/b;this.g-=a;0>=this.g&&(a=this.h&393216,131072===a?(this.g%=this.l,0>=this.g&&(this.g+=this.l),0===(this.h&65536)&&kd(this,this.h&255,0,!1)):0===a&&(this.g=0,0===(this.h&65536)&&kd(this,this.h&255,0,!1)));return Math.max(0,this.g/b)};function kd(a,b,c,d){5===c||4===c||a.i[b>>5]>>(b&31)&1||(ld(a.i,b),d?ld(a.o,b):id(a.o,b),gd(a))} +function gd(a){var b=hd(a.i);-1!==b&&(hd(a.R)>=b||(b&240)<=(a.B&240)||pb(a.s))}p.Vd=function(){var a=hd(this.i);-1===a||hd(this.R)>=a||(a&240)<=(this.B&240)||(id(this.i,a),ld(this.R,a),this.s.C(a),gd(this))}; +p.$=function(){var a=[];a[0]=this.pa;a[1]=this.Y;a[2]=this.ba;a[3]=this.l;a[4]=this.g;a[5]=this.j;a[6]=this.h;a[7]=this.T;a[8]=this.O;a[9]=this.P;a[10]=this.L;a[11]=this.B;a[12]=this.D;a[13]=this.F;a[14]=this.i;a[15]=this.R;a[16]=this.o;a[17]=this.X;a[18]=this.C;a[19]=this.J;a[20]=this.error;a[21]=this.V;return a}; +p.H=function(a){this.pa=a[0];this.Y=a[1];this.ba=a[2];this.l=a[3];this.g=a[4];this.j=a[5];this.h=a[6];this.T=a[7];this.O=a[8];this.P=a[9];this.L=a[10];this.B=a[11];this.D=a[12];this.F=a[13];this.i=a[14];this.R=a[15];this.o=a[16];this.X=a[17];this.C=a[18];this.J=a[19];this.error=a[20];this.V=a[21]};function ld(a,b){a[b>>5]|=1<<(b&31)}function id(a,b){a[b>>5]&=~(1<<(b&31))}function hd(a){for(var b=7;0<=b;b--){var c=a[b];if(c)return sb(c>>>0)|b<<5}return-1};function md(a){this.s=a;this.g=new Int32Array(24);this.o=new Int32Array(24);for(var b=0;b {c=c-4273995776|0;return 16<=c&&20>c?(c-=16,this.read(this.j)>>8*c&255):0},()=>{},c=>{c=c-4273995776|0;return 0===c?this.j:16===c?this.read(this.j):0},(c,d)=>{c=c-4273995776|0;0===c?this.j=d:16===c&&this.write(this.j,d)})} +function jd(a,b){var c=1<>8&7;if(0===(d&32768))a.h&=~c;else if(a.g[b]|=16384,d&16384)return;0!==e&&1!==e||kd(a.s.u.Mc,d&255,e,32768===(d&32768));a.g[b]&=-4097}}}p=md.prototype;p.Rd=function(a){if(!(24<=a)){var b=1<a){var b=a-16>>1;return a&1?this.o[b]:this.g[b]}return 0};p.write=function(a,b){if(0===a)this.l=b>>>24&15;else if(1!==a&&2!==a&&16<=a&&64>a){var c=a-16>>1;a&1?this.o[c]=b&4278190080:(this.g[c]=b&110591|this.g[c]&-110592,jd(this,c))}};p.$=function(){var a=[];a[0]=this.g;a[1]=this.o;a[2]=this.j;a[3]=this.l;a[4]=this.h;a[5]=this.i;return a}; +p.H=function(a){this.g=a[0];this.o=a[1];this.j=a[2];this.l=a[3];this.h=a[4];this.i=a[5]};function nd(a){this.message=a}nd.prototype=Error();const od={Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,Float32Array,Float64Array}; +function pd(a,b){if("object"!==typeof a||null===a)return a;if(a instanceof Array)return a.map(e=>pd(e,b));a.constructor===Object&&console.log(a);if(a.BYTES_PER_ELEMENT){var c=new Uint8Array(a.buffer,a.byteOffset,a.length*a.BYTES_PER_ELEMENT);return{__state_type__:a.constructor.name.replace("bound ",""),buffer_id:b.push(c)-1}}a=a.$();c=[];for(var d=0;d m)throw new nd("Invalid length: "+m);n=new Int32Array(n.buffer,n.byteOffset,4);if(-2039052682!==n[0])throw new nd("Invalid header: "+yb(n[0]>>>0));if(6!==n[1])throw new nd("Version mismatch: dump="+n[1]+" we=6");if(t&&n[2]!==m)throw new nd("Length doesn't match header: real="+m+" header="+n[2]);return n[3]}function c(n){n=(new TextDecoder).decode(n);return JSON.parse(n)}a=new Uint8Array(a);if(4247762216===(new Uint32Array(a.buffer, +0,1))[0]){var d=this.Tg(a.length);(new Uint8Array(this.Ja.buffer,this.Vg(d),a.length)).set(a);var e=this.Td(d,16),g=new Uint8Array(this.Ja.buffer,e,16),f=b(g,!1);this.Ud(e,16);e=this.Td(d,f);g=new Uint8Array(this.Ja.buffer,e,f);g=c(g);this.Ud(e,f);e=g.state;var h=g.buffer_infos;g=[];f=16+f;for(var k of h){h=(f+3&-4)-f;if(1048576 k||k+12>=a.length)throw new nd("Invalid info block length: "+k);e=c(a.subarray(16,16+k));d=e.state;e=e.buffer_infos;let n=16+k;n=n+3&-4;k=e.map(t=>{const m=n+t.offset;return a.buffer.slice(m,m+t.length)});d=qd(d,k);this.H(d)}};function rd(a,b,c){a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&(a[0]=c[0],a[1]=c[1],a[2]=c[2],a[3]=c[3],a[4]=c[4],a[5]=c[5]);a[6]===b[0]&&a[7]===b[1]&&a[8]===b[2]&&a[9]===b[3]&&a[10]===b[4]&&a[11]===b[5]&&(a[6]=c[0],a[7]=c[1],a[8]=c[2],a[9]=c[3],a[10]=c[4],a[11]=c[5]);var d=a[12]<<8|a[13];if(2048===d){if(a=a.subarray(14),4===a[0]>>4&&17===a[9]&&(a=a.subarray(20),d=a[2]<<8|a[3],67===(a[0]<<8|a[1])||67===d)){const e=a.subarray(8);if(1669485411===(e[236]<<24|e[237]<< +16|e[238]<<8|e[239]))for(e[28]===b[0]&&e[29]===b[1]&&e[30]===b[2]&&e[31]===b[3]&&e[32]===b[4]&&e[33]===b[5]&&(e[28]=c[0],e[29]=c[1],e[30]=c[2],e[31]=c[3],e[32]=c[4],e[33]=c[5],a[6]=a[7]=0),d=240;d >8);if(!((this.pc>this.wb?this.pc-this.wb:this.Va-this.wb+this.pc-this.Kb)<1+(f>>8)&&0!==this.pc)){if(g+f>this.Va<<8){var l=(this.Va<<8)-h;this.memory.set(e.subarray(0,l),h);this.memory.set(e.subarray(l),this.Kb<<8)}else this.memory.set(e,h),60>e.length&&this.memory.fill(0,h+e.length,h+60);k>=this.Va&&(k+=this.Kb-this.Va);this.memory[g]=1;this.memory[g+1]=k;this.memory[g+2]=f;this.memory[g+3]=f>>8;this.wb=k;td(this,1)}}},this);this.port=768;this.name="ne2k";this.K=[236,16,41, +128,3,1,0,0,0,0,0,2,0,0,0,0,this.port&255|1,this.port>>8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,26,0,17,0,0,184,254,0,0,0,0,0,0,0,0,0,1,0,0];this.Ia=40;this.ib=[{size:32}];this.Le=this.R=0;this.Ma=1;this.bf=this.vd=this.rb=this.Xd=0;this.memory=new Uint8Array(32768);this.If=this.Od=0;this.Hf=1;this.sa=new Uint8Array([0,34,21,255*Math.random()|0,255*Math.random()|0,255*Math.random()|0]);this.le=null;for(b=0;6>b;b++)this.memory[b<<1]=this.memory[b<<1|1]=this.sa[b];this.memory[28]=this.memory[29]= +87;this.memory[30]=this.memory[31]=87;this.ua=0;this.Kb=64;this.Va=128;this.pc=this.wb=76;b=a.A;K(b,this.port|0,this,function(){return this.Ma});L(b,this.port|0,this,function(e){this.Ma=e;this.Ma&1||(e&24&&0===this.rb&&td(this,64),e&4&&(e=this.bf<<8,e=this.memory.subarray(e,e+this.vd),this.le&&(e=new Uint8Array(e),rd(e,this.le,this.sa)),this.v.send("net0-send",e),this.v.send("eth-transmit-end",[e.length]),this.Ma&=-5,td(this,2)))});K(b,this.port|13,this,function(){return 0});K(b,this.port|14,this, +function(){return 0},function(){return 0});K(b,this.port|15,this,function(){return 0});K(b,this.port|31,this,function(){td(this,128);return 0});L(b,this.port|31,this,function(){});K(b,this.port|1,this,function(){var e=S(this);return 0===e?this.Kb:1===e?this.sa[0]:2===e?this.Kb:0});L(b,this.port|1,this,function(e){var g=S(this);0===g?this.Kb=e:1===g&&(this.sa[0]=e)});K(b,this.port|2,this,function(){var e=S(this);return 0===e?this.Va:1===e?this.sa[1]:2===e?this.Va:0});L(b,this.port|2,this,function(e){var g= +S(this);0===g?(e>this.memory.length>>8&&(e=this.memory.length>>8),this.Va=e):1===g&&(this.sa[1]=e)});K(b,this.port|7,this,function(){var e=S(this);if(0===e)return this.R;if(1===e)return this.wb});L(b,this.port|7,this,function(e){var g=S(this);0===g?(this.R&=~e,ud(this)):1===g&&(this.wb=e)});L(b,this.port|13,this,function(e){0===S(this)&&(this.If=e)});L(b,this.port|14,this,function(e){0===S(this)&&(this.Xd=e)});K(b,this.port|10,this,function(){return 0===S(this)?80:0});L(b,this.port|10,this,function(e){0=== +S(this)&&(this.rb=this.rb&65280|e&255)});K(b,this.port|11,this,function(){return 0===S(this)?67:0});L(b,this.port|11,this,function(e){0===S(this)&&(this.rb=this.rb&255|e<<8&65280)});K(b,this.port|8,this,function(){if(0===S(this))return this.ua&255});L(b,this.port|8,this,function(e){0===S(this)&&(this.ua=this.ua&65280|e&255)});K(b,this.port|9,this,function(){if(0===S(this))return this.ua>>8&255});L(b,this.port|9,this,function(e){0===S(this)&&(this.ua=this.ua&255|e<<8&65280)});L(b,this.port|15,this, +function(e){0===S(this)&&(this.Le=e,ud(this))});K(b,this.port|3,this,function(){var e=S(this);return 0===e?this.pc:1===e?this.sa[2]:0});L(b,this.port|3,this,function(e){var g=S(this);0===g?this.pc=e:1===g&&(this.sa[2]=e)});K(b,this.port|4,this,function(){var e=S(this);return 0===e?this.Hf:1===e?this.sa[3]:0});L(b,this.port|4,this,function(e){var g=S(this);0===g?this.bf=e:1===g&&(this.sa[3]=e)});K(b,this.port|5,this,function(){var e=S(this);return 0===e?0:1===e?this.sa[4]:0});L(b,this.port|5,this, +function(e){var g=S(this);0===g?this.vd=this.vd&-256|e:1===g&&(this.sa[4]=e)});K(b,this.port|6,this,function(){var e=S(this);return 0===e?0:1===e?this.sa[5]:0});L(b,this.port|6,this,function(e){var g=S(this);0===g?this.vd=this.vd&255|e<<8:1===g&&(this.sa[5]=e)});K(b,this.port|12,this,function(){return 0===S(this)?9:0});L(b,this.port|12,this,function(e){0===S(this)&&(this.Od=e)});K(b,this.port|16,this,this.sh,this.Tf,this.rh);L(b,this.port|16,this,this.Uf,this.Uf,this.th);Tb(a.u.Ha,this)}p=sd.prototype; +p.$=function(){var a=[];a[0]=this.R;a[1]=this.Le;a[2]=this.Ma;a[3]=this.Xd;a[4]=this.rb;a[5]=this.vd;a[6]=this.bf;a[7]=this.ua;a[8]=this.Kb;a[9]=this.wb;a[10]=this.pc;a[11]=this.Va;a[12]=this.Od;a[13]=this.If;a[14]=this.Hf;a[15]=this.sa;a[16]=this.memory;return a}; +p.H=function(a){this.R=a[0];this.Le=a[1];this.Ma=a[2];this.Xd=a[3];this.rb=a[4];this.vd=a[5];this.bf=a[6];this.ua=a[7];this.Kb=a[8];this.wb=a[9];this.pc=a[10];this.Va=a[11];this.Od=a[12];this.If=a[13];this.Hf=a[14];this.vf?(this.sa=a[15],this.memory=a[16]):this.Gb&&(this.le=a[15],this.memory=a[16])};function td(a,b){a.R|=b;ud(a)}function ud(a){a.Le&a.R?a.Ha.Aa(a.Ia):mc(a.Ha,a.Ia)} +function vd(a,b){if(16>=a.ua||16384<=a.ua&&32768>a.ua)a.memory[a.ua]=b;a.ua++;a.rb--;a.ua>=a.Va<<8&&(a.ua+=a.Kb-a.Va<<8);0===a.rb&&td(a,64)}p.Uf=function(a){vd(this,a);this.Xd&1&&vd(this,a>>8)};p.th=function(a){vd(this,a);vd(this,a>>8);vd(this,a>>16);vd(this,a>>24)};function wd(a){let b=0;32768>a.ua&&(b=a.memory[a.ua]);a.ua++;a.rb--;a.ua>=a.Va<<8&&(a.ua+=a.Kb-a.Va<<8);0===a.rb&&td(a,64);return b}p.sh=function(){return this.Tf()&255};p.Tf=function(){return this.Xd&1?wd(this)|wd(this)<<8:wd(this)}; +p.rh=function(){return wd(this)|wd(this)<<8|wd(this)<<16|wd(this)<<24};function S(a){return a.Ma>>6&3};var xd=new Uint8Array(256),yd=[],zd=[],Ad=[],Bd=new Uint8Array(256),Cd=[]; +function Dd(a,b){this.s=a;this.v=b;this.Ca=new Ab(64);this.fa=new Ab(64);this.i=this.o=this.lb=this.J=0;this.N=new Uint8Array(256);Ed(this);this.Fd=!1;this.ue=0;this.ob=this.nb=this.Uc=this.cc=!1;this.xb=[new Bb,new Bb];this.eb=a.u.eb;this.fb=this.bc=this.j=this.Ab=this.l=this.D=0;this.Bb=1;this.Tc=5;this.zb=!1;this.g=new ArrayBuffer(65536);this.Y=new Int8Array(this.g);this.C=new Uint8Array(this.g);this.X=new Int16Array(this.g);this.ba=new Uint16Array(this.g);this.Qa=new tb(this.g);this.Cb=this.B= +!1;this.Ya=22050;b.send("dac-tell-sampling-rate",this.Ya);this.h=1;this.O=170;this.L=0;this.Nc=new Uint8Array(256);this.F=new Ab(64);this.T=this.P=this.Sa=0;this.Jh=!1;this.ca=5;this.Yc=new Uint8Array(16);a.A.pd(544,this,this.wg,this.yg,this.li,this.ni);a.A.pd(904,this,this.wg,this.yg);a.A.pd(548,this,this.pi,this.si);K(a.A,550,this,this.ui);K(a.A,551,this,this.wi);K(a.A,552,this,this.yi);K(a.A,553,this,this.Ai);K(a.A,554,this,this.Ci);K(a.A,555,this,this.Ei);K(a.A,556,this,this.Gi);K(a.A,557,this, +this.Ii);a.A.pd(558,this,this.Ki,this.Mi);a.A.Lb(544,this,this.xg,this.zg,this.mi,this.oi);a.A.Lb(904,this,this.xg,this.zg);a.A.Lb(548,this,this.ri,this.ti);L(a.A,550,this,this.vi);L(a.A,551,this,this.xi);a.A.Lb(552,this,this.zi,this.Bi);L(a.A,554,this,this.Di);L(a.A,555,this,this.Fi);L(a.A,556,this,this.Hi);L(a.A,557,this,this.Ji);L(a.A,558,this,this.Li);L(a.A,559,this,this.Ni);a.A.pd(816,this,this.rj,this.tj);a.A.Lb(816,this,this.sj,this.uj);this.eb.cf.push({Je:this.pa,Gf:this});b.register("dac-request-data", +function(){!this.Ab||this.Cb?Fd(this):Gd(this)},this);b.register("speaker-has-initialized",function(){Ed(this)},this);b.send("speaker-confirm-initialized");Hd(this)}function Hd(a){a.Ca.clear();a.fa.clear();a.lb=0;a.o=0;a.Fd=!1;a.ue=0;a.cc=!1;a.Uc=!1;a.nb=!1;a.ob=!1;a.xb[0].clear();a.xb[1].clear();a.D=0;a.l=0;a.Ab=0;a.j=0;a.bc=0;a.fb=0;a.zb=!1;a.C.fill(0);a.B=!1;a.Cb=!1;a.O=170;a.L=0;a.Ya=22050;a.h=1;Id(a,1);a.Yc.fill(0);a.Nc.fill(0);a.Nc[5]=1;a.Nc[9]=248}p=Dd.prototype; +p.$=function(){var a=[];a[2]=this.J;a[3]=this.lb;a[4]=this.o;a[5]=this.i;a[6]=this.N;a[7]=this.Fd;a[8]=this.ue;a[9]=this.cc;a[10]=this.Uc;a[11]=this.nb;a[12]=this.ob;a[15]=this.D;a[16]=this.l;a[17]=this.Ab;a[18]=this.j;a[19]=this.bc;a[20]=this.fb;a[21]=this.Bb;a[22]=this.Tc;a[23]=this.zb;a[24]=this.C;a[25]=this.B;a[26]=this.Cb;a[27]=this.Ya;a[28]=this.h;a[29]=this.O;a[30]=this.L;a[31]=this.Nc;a[33]=this.cb;a[34]=this.ca;a[35]=this.Yc;return a}; +p.H=function(a){this.J=a[2];this.lb=a[3];this.o=a[4];this.i=a[5];this.N=a[6];Jd(this);this.Fd=a[7];this.ue=a[8];this.cc=a[9];this.Uc=a[10];this.nb=a[11];this.ob=a[12];this.D=a[15];this.l=a[16];this.Ab=a[17];this.j=a[18];this.bc=a[19];this.fb=a[20];this.Bb=a[21];this.Tc=a[22];this.zb=a[23];this.C=a[24];this.B=a[25];this.Cb=a[26];this.Ya=a[27];this.h=a[28];this.O=a[29];this.L=a[30];this.Nc=a[31];this.cb=a[33];this.ca=a[34];this.Yc=a[35];this.g=this.C.buffer;this.Y=new Int8Array(this.g);this.X=new Int16Array(this.g); +this.ba=new Uint16Array(this.g);this.Qa=new tb(this.g);this.Cb?this.v.send("dac-disable"):this.v.send("dac-enable")};p.wg=function(){return 255};p.yg=function(){return 255};p.li=function(){return 255};p.ni=function(){return 255};p.pi=function(){return this.i};p.si=function(){var a=this.i,b=zd[a];return b?b.call(this):this.N[a]};p.ui=function(){return 255};p.wi=function(){return 255};p.yi=function(){return 255};p.Ai=function(){return 255};p.Ci=function(){this.fa.length&&(this.J=this.fa.shift());return this.J}; +p.Ei=function(){return 255};p.Gi=function(){return 127};p.Ii=function(){return 255};p.Ki=function(){this.Yc[1]&&Id(this,1);return(this.fa.length&&!this.cc)<<7|127};p.Mi=function(){Id(this,2);return 0};p.xg=function(){this.P=0};p.zg=function(a){var b=Cd[this.P];b||(b=this.V);b.call(this,a,0,this.P)};p.mi=function(){this.T=0};p.oi=function(a){var b=Cd[this.T];b||(b=this.V);b.call(this,a,1,this.T)};p.ri=function(a){this.i=a};p.ti=function(a){Kd(this,this.i,a)}; +p.vi=function(a){this.cc?this.cc=!1:a&&Hd(this);this.fa.clear();this.fa.push(170)};p.xi=function(){};p.zi=function(){};p.Bi=function(){};p.Di=function(){};p.Fi=function(){};p.Hi=function(a){0===this.lb?(this.lb=a,this.Ca.clear(),this.o=xd[a]):this.Ca.push(a);this.Ca.length>=this.o&&(a=yd[this.lb],a||(a=this.Yf),a.call(this),this.o=this.lb=0,this.Ca.clear())};p.Ji=function(){};p.Li=function(){};p.Ni=function(){};p.rj=function(){this.F.length&&(this.Sa=this.F.shift());return this.Sa};p.sj=function(){}; +p.tj=function(){return 0|128*!this.F.length};p.uj=function(a){255==a&&(this.F.clear(),this.F.push(254))};p.Yf=function(){};function T(a,b,c){c||(c=Dd.prototype.Yf);for(var d=0;d c;c++)b.push(a+c);return b}T([14],2,function(){this.Nc[this.Ca.shift()]=this.Ca.shift()});T([15],1,function(){this.fa.clear();this.fa.push(this.Nc[this.Ca.shift()])}); +T([16],1,function(){var a=this.Ca.shift();a=Md(a/127.5+-1);this.xb[0].push(a);this.xb[1].push(a);this.v.send("dac-enable")});T([20,21],2,function(){this.bc=1;this.fb=this.Bb;this.cc=this.nb=this.ob=this.zb=!1;Nd(this);Od(this)});T([22],2);T([23],2);T([28],0,function(){this.bc=1;this.fb=this.Bb;this.zb=!0;this.cc=this.nb=this.ob=!1;Od(this)});T([31],0);T([32],0,function(){this.fa.clear();this.fa.push(127)});T([36],2);T([44],0);T([48],0);T([49],0);T([52],0);T([53],0);T([54],0);T([55],0);T([56],0); +T([64],1,function(){Pd(this,1E6/(256-this.Ca.shift())/(this.Uc?2:1))});T([65,66],2,function(){Pd(this,this.Ca.shift()<<8|this.Ca.shift())});T([72],2,function(){Nd(this)});T([116],2);T([117],2);T([118],2);T([119],2);T([125],0);T([127],0);T([128],2);T([144],0,function(){this.bc=1;this.fb=this.Bb;this.zb=!0;this.ob=!1;this.cc=!0;this.nb=!1;Od(this)});T([145],0);T([152],0);T([153],0);T([160],0);T([168],0); +T(Ld(176),3,function(){if(!(this.lb&8)){var a=this.Ca.shift();this.bc=2;this.fb=this.Tc;this.zb=!!(this.lb&4);this.ob=!!(a&16);this.Uc=!!(a&32);this.nb=!0;Nd(this);Od(this)}});T(Ld(192),3,function(){if(!(this.lb&8)){var a=this.Ca.shift();this.bc=1;this.fb=this.Bb;this.zb=!!(this.lb&4);this.ob=!!(a&16);this.Uc=!!(a&32);this.nb=!1;Nd(this);Od(this)}});T([208],0,function(){this.Cb=!0;this.v.send("dac-disable")});T([209],0,function(){this.Fd=!0});T([211],0,function(){this.Fd=!1}); +T([212],0,function(){this.Cb=!1;this.v.send("dac-enable")});T([213],0,function(){this.Cb=!0;this.v.send("dac-disable")});T([214],0,function(){this.Cb=!1;this.v.send("dac-enable")});T([216],0,function(){this.fa.clear();this.fa.push(255*this.Fd)});T([217,218],0,function(){this.zb=!1});T([224],1,function(){this.fa.clear();this.fa.push(~this.Ca.shift())});T([225],0,function(){this.fa.clear();this.fa.push(4);this.fa.push(5)});T([226],1); +T([227],0,function(){this.fa.clear();for(var a=0;44>a;a++)this.fa.push("COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.".charCodeAt(a));this.fa.push(0)});T([228],1,function(){this.ue=this.Ca.shift()});T([232],0,function(){this.fa.clear();this.fa.push(this.ue)});T([242,243],0,function(){this.Aa()});var Qd=new Uint8Array(256);Qd[14]=255;Qd[15]=7;Qd[55]=56;T([249],1,function(){var a=this.Ca.shift();this.fa.clear();this.fa.push(Qd[a])});function Kd(a,b,c){(b=Ad[b])&&b.call(a,c)}Dd.prototype.Ra=function(){return this.N[this.i]}; +Dd.prototype.bb=function(a){this.N[this.i]=a};function Ed(a){a.N[4]=204;a.N[34]=204;a.N[38]=204;a.N[40]=0;a.N[46]=0;a.N[10]=0;a.N[48]=192;a.N[49]=192;a.N[50]=192;a.N[51]=192;a.N[52]=192;a.N[53]=192;a.N[54]=0;a.N[55]=0;a.N[56]=0;a.N[57]=0;a.N[59]=0;a.N[60]=31;a.N[61]=21;a.N[62]=11;a.N[63]=0;a.N[64]=0;a.N[65]=0;a.N[66]=0;a.N[67]=0;a.N[68]=128;a.N[69]=128;a.N[70]=128;a.N[71]=128;Jd(a)}function Jd(a){for(var b=1;b >>4};Ad[a]=function(d){this.N[a]=d;var e=d<<4&240|this.N[c]&15;Kd(this,b,d&240|this.N[b]&15);Kd(this,c,e)}}function Ud(a,b,c){zd[a]=Dd.prototype.Ra;Ad[a]=function(d){this.N[a]=d;this.v.send("mixer-volume",[b,c,(d>>>2)-62])}}Rd(0,function(){Ed(this);return 0});Sd(0);Td(4,50,51);Td(34,48,49);Td(38,52,53);Td(40,54,55);Td(46,56,57);Ud(48,0,0);Ud(49,0,1);Ud(50,2,0);Ud(51,2,1);Rd(59); +Sd(59,function(a){this.N[59]=a;this.v.send("mixer-volume",[1,2,6*(a>>>6)-18])});Rd(65);Sd(65,function(a){this.N[65]=a;this.v.send("mixer-gain-left",6*(a>>>6))});Rd(66);Sd(66,function(a){this.N[66]=a;this.v.send("mixer-gain-right",6*(a>>>6))});Rd(68);Sd(68,function(a){this.N[68]=a;a>>>=3;this.v.send("mixer-treble-left",a-(16>a?14:16))});Rd(69);Sd(69,function(a){this.N[69]=a;a>>>=3;this.v.send("mixer-treble-right",a-(16>a?14:16))});Rd(70); +Sd(70,function(a){this.N[70]=a;a>>>=3;this.v.send("mixer-bass-right",a-(16>a?14:16))});Rd(71);Sd(71,function(a){this.N[71]=a;a>>>=3;this.v.send("mixer-bass-right",a-(16>a?14:16))});Rd(128,function(){switch(this.ca){case 2:return 1;case 5:return 2;case 7:return 4;case 10:return 8;default:return 0}});Sd(128,function(a){a&1&&(this.ca=2);a&2&&(this.ca=5);a&4&&(this.ca=7);a&8&&(this.ca=10)}); +Rd(129,function(){var a=0;switch(this.Bb){case 0:a|=1;break;case 1:a|=2;break;case 3:a|=8}switch(this.Tc){case 5:a|=32;break;case 6:a|=64;break;case 7:a|=128}return a});Sd(129,function(a){a&1&&(this.Bb=0);a&2&&(this.Bb=1);a&8&&(this.Bb=3);a&32&&(this.Tc=5);a&64&&(this.Tc=6);a&128&&(this.Tc=7)});Rd(130,function(){for(var a=32,b=0;16>b;b++)a|=b*this.Yc[b];return a});Dd.prototype.V=function(){};function Vd(a,b){b||(b=Dd.prototype.V);for(var c=0;c >2&-4,32),a.j);a.B=!0;a.eb.Yb[a.fb]||a.pa(a.fb)}Dd.prototype.pa=function(a){a===this.fb&&this.B&&(this.B=!1,this.Ab=this.l,this.Cb=!1,this.v.send("dac-enable"))}; +function Gd(a){var b=Math.min(a.Ab,a.j),c=Math.floor(b/a.h);a.eb.be(a.Qa,0,b,a.fb,d=>{if(!d){d=a.nb?32767.5:127.5;var e=a.ob?0:-1,g=a.Uc?1:2,f;a.nb?f=a.ob?a.X:a.ba:f=a.ob?a.Y:a.C;for(var h=0,k=0;k a)+1*(1=a)*a};function ka(a,b){this.s=a;this.Ha=a.u.Ha;this.He=b.He;this.K=[244,26,b.He&255,b.He>>8,7,5,16,0,1,0,2,0,0,0,0,0,1,168,0,0,0,16,191,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,26,b.Rg&255,b.Rg>>8,0,0,0,0,64,0,0,0,0,0,0,0,0,1,0,0];this.K=this.K.concat(Array(256-this.K.length).fill(0));this.Ia=b.Ia;this.ib=[];this.name=b.name;this.i=this.B=0;this.l=new Uint32Array(4);this.h=new Uint32Array(4);for(var c of b.Fe.features)this.l[c>>>5]|=1<<(c&31),this.h[c>>>5]|=1<<(c&31);b.Fe.features.includes(32);this.C= +!0;this.j=0;this.F=!1;this.D=0;this.Xa=[];for(var d of b.Fe.Xa)this.Xa.push(new Xd(a,this,d));this.o=0;this.g=this.Xa[0];this.hc=0;c=[];c.push(Yd(this,b.Fe));c.push(Zd(b.notification));c.push($d(this,b.hc));b.Vf&&(d=c.push,b=b.Vf,b={type:4,Ad:3,port:b.Vc,ye:!1,offset:0,de:new Uint8Array(0),td:b.td},d.call(c,b));ae(this,c);Tb(a.u.Ha,this);this.reset()} +function Yd(a,b){return{type:1,Ad:0,port:b.Vc,ye:!1,offset:0,de:new Uint8Array(0),td:[{bytes:4,name:"device_feature_select",read:()=>a.B,write:c=>{a.B=c}},{bytes:4,name:"device_feature",read:()=>a.l[a.B]||0,write:()=>{}},{bytes:4,name:"driver_feature_select",read:()=>a.i,write:c=>{a.i=c}},{bytes:4,name:"driver_feature",read:()=>a.h[a.i]||0,write:c=>{const d=a.l[a.i];a.i 65535,write:()=>{}},{bytes:2,name:"num_queues", +read:()=>a.Xa.length,write:()=>{}},{bytes:1,name:"device_status",read:()=>a.j,write:c=>{0===c&&a.reset();c&~a.j&4&&a.j&64&&(a.F=!0,a.j&4&&a.Aa(2));a.C||(c&=-9);a.j=c}},{bytes:1,name:"config_generation",read:()=>a.D,write:()=>{}},{bytes:2,name:"queue_select",read:()=>a.o,write:c=>{a.o=c;a.o a.g?a.g.size:0,write:c=>{if(a.g){c&c-1&&(c=1< a.g.Kc&&(c=a.g.Kc);var d=a.g;d.size=c;d.o=c-1}}},{bytes:2,name:"queue_msix_vector",read:()=> +65535,write:()=>{}},{bytes:2,name:"queue_enable",read:()=>a.g?a.g.enabled|0:0,write:c=>{a.g&&1===c&&(c=a.g,c.l&&c.h&&c.g&&(a.g.enabled=!0))}},{bytes:2,name:"queue_notify_off",read:()=>a.g?a.g.me:0,write:()=>{}},{bytes:4,name:"queue_desc (low dword)",read:()=>a.g?a.g.l:0,write:c=>{a.g&&(a.g.l=c)}},{bytes:4,name:"queue_desc (high dword)",read:()=>0,write:()=>{}},{bytes:4,name:"queue_avail (low dword)",read:()=>a.g?a.g.h:0,write:c=>{a.g&&(a.g.h=c)}},{bytes:4,name:"queue_avail (high dword)",read:()=> +0,write:()=>{}},{bytes:4,name:"queue_used (low dword)",read:()=>a.g?a.g.g:0,write:c=>{a.g&&(a.g.g=c)}},{bytes:4,name:"queue_used (high dword)",read:()=>0,write:()=>{}}]}}function Zd(a){const b=[];let c;c=a.Kj?0:2;for(const [d,e]of a.Oh.entries())b.push({bytes:2,name:"notify"+d,read:()=>65535,write:e||(()=>{})});return{type:2,Ad:1,port:a.Vc,ye:!1,offset:0,de:new Uint8Array([c&255,c>>8&255,c>>16&255,c>>24]),td:b}} +function $d(a,b){return{type:3,Ad:2,port:b.Vc,ye:!1,offset:0,de:new Uint8Array(0),td:[{bytes:1,name:"isr_status",read:()=>{const c=a.hc;a.hc=0;mc(a.Ha,a.Ia);return c},write:()=>{}}]}} +function ae(a,b){let c=a.K[52]=64;var d=c;for(const g of b){b=16+g.de.length;d=c;c=d+b;var e=g.td.reduce((f,h)=>f+h.bytes,0);e+=g.offset;e=16>e?16:1< >>8&255;a.K[d+10]=g.offset>>>16&255;a.K[d+11]=g.offset>>>24;a.K[d+12]=e&255;a.K[d+13]=e>>>8&255;a.K[d+14]=e>>>16&255;a.K[d+15]=e>>>24;for(const [f,h]of g.de.entries())a.K[d+16+f]=h;d=16+4* +g.Ad;a.K[d]=g.port&254|!g.ye;a.K[d+1]=g.port>>>8&255;a.K[d+2]=g.port>>>16&255;a.K[d+3]=g.port>>>24&255;d=g.port+g.offset;for(const f of g.td){let h=f.read;b=f.write;if(!g.ye){e=function(l){return h(l&-2)>>((l&1)<<3)&255};const k=function(l){return h(l&-4)>>((l&3)<<3)&255};switch(f.bytes){case 4:K(a.s.A,d,a,k,void 0,h);L(a.s.A,d,a,void 0,void 0,b);break;case 2:K(a.s.A,d,a,e,h);L(a.s.A,d,a,void 0,b);break;case 1:K(a.s.A,d,a,h),L(a.s.A,d,a,b)}}d+=f.bytes}}a.K[c]=9;a.K[c+1]=0;a.K[c+2]=20;a.K[c+3]=5;a.K[c+ +4]=0;a.K[c+5]=0;a.K[c+6]=0;a.K[c+7]=0;a.K[c+8]=0;a.K[c+9]=0;a.K[c+10]=0;a.K[c+11]=0;a.K[c+12]=0;a.K[c+13]=0;a.K[c+14]=0;a.K[c+15]=0;a.K[c+16]=0;a.K[c+17]=0;a.K[c+18]=0;a.K[c+19]=0}ka.prototype.$=function(){let a=[];a[0]=this.B;a[1]=this.i;a[2]=this.l;a[3]=this.h;a[4]=this.C;a[5]=this.j;a[6]=this.F;a[7]=this.D;a[8]=this.hc;a[9]=this.o;return a=a.concat(this.Xa)}; +ka.prototype.H=function(a){this.B=a[0];this.i=a[1];this.l=a[2];this.h=a[3];this.C=a[4];this.j=a[5];this.F=a[6];this.D=a[7];this.hc=a[8];this.o=a[9];let b=0;for(let c of a.slice(10))this.Xa[b].H(c),b++;this.g=this.Xa[this.o]||null};ka.prototype.reset=function(){this.i=this.B=0;this.h.set(this.l);this.C=!0;this.o=this.j=0;this.g=this.Xa[0];for(const a of this.Xa)a.reset();this.F=!1;this.hc=this.D=0;mc(this.Ha,this.Ia)};ka.prototype.Aa=function(a){this.hc|=a;this.Ha.Aa(this.Ia)}; +function Xd(a,b,c){this.s=a;this.ab=b;this.Kc=this.size=c.Kc;this.o=this.size-1;this.enabled=!1;this.me=c.me;this.i=this.g=this.j=this.h=this.l=0;this.reset()}Xd.prototype.$=function(){const a=[];a[0]=this.size;a[1]=this.Kc;a[2]=this.enabled;a[3]=this.me;a[4]=this.l;a[5]=this.h;a[6]=this.j;a[7]=this.g;a[8]=this.i;return a};Xd.prototype.H=function(a){this.size=a[0];this.Kc=a[1];this.enabled=a[2];this.me=a[3];this.l=a[4];this.h=a[5];this.j=a[6];this.g=a[7];this.i=a[8];this.o=this.size-1}; +Xd.prototype.reset=function(){this.enabled=!1;this.i=this.g=this.j=this.h=this.l=0;var a=this.Kc;this.size=a;this.o=a-1};function la(a){return(a.s.Oa(a.h+2)&a.o)!==a.j} +function ma(a,b){this.s=a.s;this.ab=a.ab;this.Ph=b;this.i=[];this.pf=this.g=this.h=0;this.Of=[];this.qf=this.Be=this.Nf=0;let c=a.l;var d=b;b=0;let e=a.size,g=!1;const f=0<(this.ab.h[0]&268435456);do{var h=a,k=c;h={ef:h.s.g(k+16*d),bk:h.s.g(k+16*d+4),Ne:h.s.g(k+16*d+8),flags:h.s.Oa(k+16*d+12),next:h.s.Oa(k+16*d+14)};if(f&&h.flags&4)c=h.ef,b=d=0,e=h.Ne/16;else{if(h.flags&2)g=!0,this.Of.push(h);else{if(g)break;this.i.push(h);this.pf+=h.Ne}b++;if(b>e)break;if(h.flags&1)d=h.next;else break}}while(1)} +function ua(a,b){let c=0,d=b.length;for(;d&&a.h!==a.i.length;){var e=a.i[a.h],g=e.ef+a.g;let l=e.Ne-a.g;l>d?(l=d,a.g+=d):(a.h++,a.g=0);e=b;var f=e.set,h=a.s,k=l;k&&(h.Me(g),h.Me(g+k-1));f.call(e,h.Na.subarray(g,g+k),c);c+=l;d-=l}};function be(){this.je={};this.g=void 0}be.prototype.register=function(a,b,c){var d=this.je[a];void 0===d&&(d=this.je[a]=[]);d.push({Je:b,Gf:c})};be.prototype.unregister=function(a,b){var c=this.je[a];void 0!==c&&(this.je[a]=c.filter(function(d){return d.Je!==b}))};be.prototype.send=function(a,b){if(this.g&&(a=this.g.je[a],void 0!==a))for(var c=0;c {const d=a.xa.exports[c];console.assert(d,"Missing import: "+c);return d};a.Ra=b("reset_cpu");b("getiopl");b("get_eflags");a.o=b("get_eflags_no_arith");a.C=b("pic_call_irq");a.Tj=b("do_many_cycles_native");b("cycle_internal");a.od=b("read8");a.Oa=b("read16");a.g=b("read32s");a.df=b("write8");a.Ae=b("write16");a.Lc=b("write32");a.Me=b("in_mapped_range");b("fpu_load_tag_word");b("fpu_load_status_word");b("fpu_get_sti_f64");b("translate_address_system_read_js");a.Vb=b("get_seg_cs"); +b("get_real_eip");b("clear_tlb");a.Wj=b("full_clear_tlb");a.Mg=b("update_state_flags");a.ke=b("set_tsc");a.Zg=b("store_current_tsc");a.Yg=b("set_cpuid_level");a.Xj=b("jit_clear_cache_js");a.Uh=b("jit_dirty_cache");a.Nj=b("codegen_finalize_finished");a.Mj=b("allocate_memory");a.hh=b("zero_memory");a.ah=b("svga_allocate_memory");a.$g=b("svga_allocate_dest_buffer");a.eh=b("svga_fill_pixel_buffer");a.lg=b("svga_mark_dirty");a.Tg=b("zstd_create_ctx");a.Vg=b("zstd_get_src_ptr");a.Ug=b("zstd_free_ctx"); +a.Td=b("zstd_read");a.Ud=b("zstd_read_free")} +jb.prototype.$=function(){var a=[];a[0]=this.G[0];a[1]=this.Sa;a[2]=this.cb;a[3]=this.bb;a[4]=this.Qa[0];a[5]=this.Wb[0];a[6]=this.Xb[0];a[7]=this.Ub[0];a[8]=this.Ob[0];a[9]=this.wc[0];a[10]=this.Ma;a[11]=this.Pb[0];a[13]=this.ba[0];a[16]=this.ub[0];a[17]=this.h[0];a[18]=this.uc[0];a[19]=this.Rb[0];a[22]=this.ng[0];a[23]=this.pg[0];a[24]=this.Jg[0];a[25]=this.xc[0];a[26]=this.flags[0];a[27]=this.Sb[0];a[28]=this.qc[0];a[30]=this.sc[0];a[37]=this.B[0];a[38]=this.zc[0];a[39]=this.D;a[40]=this.tb;a[41]= +this.Qb;a[42]=this.Ac;this.Zg();a[43]=this.Pj;a[45]=this.u.Lf;a[46]=this.u.Mc;a[47]=this.u.Ic;a[48]=this.u.Ha;a[49]=this.u.eb;a[50]=this.u.ya;a[51]=this.u.gg;a[52]=this.u.Sd;a[53]=this.u.wf;a[54]=this.u.Jf;a[55]=this.u.lf;a[56]=this.u.ga;a[57]=this.u.M;a[58]=this.u.Ue;a[59]=this.u.sf;a[60]=this.u.jc;a[61]=this.u.Af;a[62]=this.Wa;a[63]=this.u.yc;a[64]=this.Kg[0];a[66]=this.$c;a[67]=this.Tb;a[68]=this.X[0];a[69]=this.Y[0];a[70]=this.J[0];a[71]=this.P[0];a[72]=this.T[0];a[73]=this.L[0];a[74]=this.O[0]; +a[75]=this.V[0];var b=this.Na.length>>12,c=[];for(var d=0;d>2,e+4096>>2);let h=!0;for(let k=0;k >2)} +jb.prototype.hb=function(a,b){ge(this,"number"===typeof a.G?a.G:67108864);a.Dd&&this.Yg(a.Dd);this.F[0]=+a.ya;this.Ra();var c=new eb(this);this.A=c;this.Bd.kg=a.Bd;this.Bd.Sd=a.Sj;qb(this);if(a.vb){const {ai:e}=he(this.Na,a.vb,a.Xc,a.Pc||"");e&&this.fd.push(e)}K(c,179,this,function(){return 0});var d=0;K(c,146,this,function(){return d});L(c,146,this,function(e){d=e});K(c,1297,this,function(){return this.mf >8|k<<8&65280}function h(k){return k<<24|k<<8&16711680|k>>8&65280|k>>>24}this.mf=0;if(0===e)this.Wa=g(1431127377);else if(1===e)this.Wa=g(0);else if(3===e)this.Wa=g(this.G[0]);else if(5===e)this.Wa=g(1);else if(15===e)this.Wa=g(1);else if(13===e)this.Wa=new Uint8Array(16);else if(25===e){e=new Int32Array(4+64*this.fd.length);const k=new Uint8Array(e.buffer);e[0]=h(this.fd.length);for(let l=0;l >2]=h(n.length); +e[t+4>>2]=f(49152+l);for(let m=0;m e?g(0):49152<=e&&e-49152 b.byteLength){var c=new Int32Array(2048);(new Uint8Array(c.buffer)).set(new Uint8Array(b))}else c=new Int32Array(b,0,2048);for(var d=0;8192>d;d+=4)if(464367618===c[d>>2]){var e=c[d+4>>2];if(!(464367618+e+c[d+8>>2]|0)){a.D[0]=732803074;a.D[3]=31744;a.Lc(31744,0);a.Ma[0]=1;a.Qa[0]=1;a.flags[0]=2;a.ba[0]=1;a.ub[0]=1;for(var g=0;6>g;g++)a.Sa[g]=0,a.cb[g]=0,a.bb[g]=4294967295,a.tb[g]=45058;if(e&65536){var f=c[d+16>>2];g=c[d+20>>2];e=c[d+28>>2];b=new Uint8Array(b,d-(c[d+12>>2]- +f),0===g?void 0:g-f);ra(a,b,f);a.B[0]=a.Vb()+e|0}else if(1179403647===c[0]){c=ke(b);a.B[0]=a.Vb()+c.Qh.Gh|0;for(f of c.Dj)0!==f.type&&1===f.type&&f.qg+f.Yh =h;h++){function k(l){l?this.Ka(h):Jb(this,h)}L(a.A,8192+h,a,k,k,k)}a.Mg();break}}} +function ie(a,b,c){var d=c.oc||531;b.W[56]=1|d>>4&240;b.W[61]=d&255;b.W[21]=128;b.W[22]=2;d=0;1048576<=a.G[0]&&(d=a.G[0]-1048576>>10,d=Math.min(d,65535));b.W[23]=d&255;b.W[24]=d>>8&255;b.W[48]=d&255;b.W[49]=d>>8&255;d=0;16777216<=a.G[0]&&(d=a.G[0]-16777216>>16,d=Math.min(d,65535));b.W[52]=d&255;b.W[53]=d>>8&255;b.W[91]=0;b.W[92]=0;b.W[93]=0;b.W[20]=47;b.W[95]=0;c.Hh&&(b.W[63]=1)} +function qb(a){var b=a.Bd.kg,c=a.Bd.Sd;if(b){var d=new Uint8Array(b);ra(a,d,1048576-b.byteLength);if(c){var e=new Uint8Array(c);ra(a,e,786432);hb(a.A,4272947200,1048576,function(g){g=g-4272947200|0;return g >>0,g>>>0);WebAssembly.instantiate(f,{e:a.Wg}).then(h=>{a.xa.Mf.set(b+1024,h.instance.exports.f);a.Nj(b,c,d);a.gh&&a.gh(f)})}function mb(a){if(a.o()&512){const b=ob(a,nb());pb(a);return b}return 100}function ob(a,b){var c=a.u.Ue.sb(b,!1);var d=a.u.Ic.sb(b,!1);let e=100,g=100;a.F[0]&&(e=a.u.ya.sb(b),g=a.u.Mc.sb(b));return Math.min(c,d,100,e,g)}function pb(a){a.o()&512&&(me(a),a.Xg())} +function me(a){a.o();a.u.jc&&a.u.jc.Vd();a.u.Mc&&a.u.Mc.Vd()}jb.prototype.Ka=function(a){this.u.jc&&this.u.jc.Rd(a);this.u.yc&&this.u.yc.Rd(a)};function Jb(a,b){a.u.jc&&a.u.jc.Wd(b);a.u.yc&&a.u.yc.Wd(b)}"undefined"!==typeof window?window.CPU=jb:"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.CPU=jb:"function"===typeof importScripts&&(self.CPU=jb);function fe(a){var b={};a.debug=b;b.hb=function(){};b.tk=function(){};b.lk=function(){};b.$=function(){};b.nk=function(){};b.mk=function(){};b.kk=function(){if(a.Ma[4]&32)for(var g=0;4>g;g++)a.g(a.Ma[3]+8*g)};b.ik=function(){};b.jk=function(){};b.sk=function(){};b.yk=function(){};b.Gk=function(){};b.ek=function(){};let c,d;b.hk=function(g,f,h){if(!d){if(void 0===c&&(c="function"===typeof require?require("./capstone-x86.min.js"):window.cs,void 0===c))return;d=[new c.Capstone(c.ARCH_X86,c.MODE_16), +new c.Capstone(c.ARCH_X86,c.MODE_32)]}try{d[g].disasm(f,h).forEach(function(k){de(yb(k.dk>>>0)+": "+xb(k.bytes.map(l=>yb(l,2).slice(-2)).join(" "),20)+" "+k.mnemonic+" "+k.op_str)})}catch(k){de("Could not disassemble: "+Array.from(f).map(l=>yb(l,2)).join(" "))}};let e;b.pk=function(g){if(void 0===e&&(e="function"===typeof require?require("./libwabt.js"):new window.WabtModule,void 0===e))return;g=g.slice();try{var f=e.readWasm(g,{Dk:!1});f.generateNames();f.applyNames();f.toText({rk:!0,vk:!0})}catch(l){var h= +new Blob([g]),k=document.createElement("a");k.download="failed.wasm";k.href=window.URL.createObjectURL(h);k.dataset.downloadurl=["application/octet-stream",k.download,k.href].join(":");k.click();window.URL.revokeObjectURL(k.src);console.log(l.toString())}finally{f&&f.va()}}};let ne=DataView.prototype,oe={size:1,get:ne.getUint8,set:ne.setUint8},pe={size:2,get:ne.getUint16,set:ne.setUint16},W={size:4,get:ne.getUint32,set:ne.setUint32},re=qe([{Wh:W},{nh:oe},{data:oe},{Qj:oe},{Ak:oe},{$j:oe},{Bk:function(a){return{size:a,get:()=>-1}}(7)},{type:pe},{xk:pe},{Rj:W},{Gh:W},{di:W},{Hj:W},{flags:W},{Bh:pe},{ug:pe},{vg:pe},{Pg:pe},{Qg:pe},{Fk:pe}]);console.assert(52===re.reduce((a,b)=>a+b.size,0));let se=qe([{type:W},{offset:W},{Hk:W},{qg:W},{$f:W},{Yh:W},{flags:W},{align:W}]); +console.assert(32===se.reduce((a,b)=>a+b.size,0));let te=qe([{name:W},{type:W},{flags:W},{ak:W},{offset:W},{size:W},{link:W},{info:W},{ck:W},{qk:W}]);console.assert(40===te.reduce((a,b)=>a+b.size,0));function qe(a){return a.map(function(b){var c=Object.keys(b);console.assert(1===c.length);c=c[0];b=b[c];console.assert(0 {const c=new xe(0);c.H(b);return c});this.B.nf=a[1];this.h={};for(let [b,c]of a[2])c.buffer.byteLength!==c.byteLength&&(c=c.slice()),this.h[b]=c;this.l=a[3];this.o=a[4];this.i=a.slice(5)};function Ba(a,b,c){var d=a.g[b];0==d.status||2==d.status?c():5===d.status?Ba(Z(a,d),d.g,c):a.C.push({id:b,Zj:c})} +function ye(a,b,c){var d=ze(a);const e=b[0];d.size=b[1];d.ic=b[2];d.Ed=d.ic;d.Oc=d.ic;d.mode=b[3];d.uid=b[4];d.Ga=b[5];var g=d.mode&61440;if(g===Ga)for(Ae(a,d,c,e),c=a.g.length-1,b=b[6],d=0;d >8;this.za.version=a[11];this.za.path= +a[12];this.Ua=a[13]};function Fe(a,b){Object.assign(b,a,{dc:b.dc,ia:b.ia,Ua:b.Ua})}function ze(a){const b=Math.round(Date.now()/1E3);a=new xe(++a.B.nf);a.Oc=a.Ed=a.ic=b;return a}function Fa(a,b,c){var d=a.g[c];if(0<=c&&5===d.status)return c=d.g,b=Fa(Z(a,d),b,c),Ge(a,d.i,b);d=ze(a);d.mode=511|Ga;0<=c&&(d.uid=a.g[c].uid,d.Ga=a.g[c].Ga,d.mode=a.g[c].mode&511|Ga);d.za.type=Ga>>8;Ae(a,d,c,b);return a.g.length-1} +function Ha(a,b,c){var d=a.g[c];if(5===d.status)return c=d.g,b=Ha(Z(a,d),b,c),Ge(a,d.i,b);d=ze(a);d.uid=a.g[c].uid;d.Ga=a.g[c].Ga;d.za.type=128;d.mode=a.g[c].mode&438|32768;Ae(a,d,c,b);return a.g.length-1}function Ea(a,b,c,d,e){var g=a.g[c];if(5===g.status)return c=g.g,b=Ea(Z(a,g),b,c,d,e),Ge(a,g.i,b);g=ze(a);g.Oe=d;g.Pe=e;g.uid=a.g[c].uid;g.Ga=a.g[c].Ga;g.za.type=192;g.mode=a.g[c].mode&438;Ae(a,g,c,b);return a.g.length-1} +function Da(a,b,c,d){var e=a.g[c];if(5===e.status)return c=e.g,b=Da(Z(a,e),b,c,d),Ge(a,e.i,b);e=ze(a);e.uid=a.g[c].uid;e.Ga=a.g[c].Ga;e.za.type=160;e.te=d;e.mode=40960;Ae(a,e,c,b);return a.g.length-1}async function He(a,b,c,d){var e=a.g[c];if(5===e.status)return c=e.g,d=await He(Z(a,e),b,c,d),Ge(a,e.i,d);e=Ha(a,b,c);b=a.g[e];c=new Uint8Array(d.length);c.set(d);await Ie(a,e,c);b.size=d.length;return e} +function Aa(a,b,c){var d=a.g[b];if(5===d.status)return Aa(Z(a,d),d.g,c);(d.mode&61440)==Ga&&Je(a,b);return!0}async function Ua(a,b){var c=a.g[b];if(5===c.status)return await Ua(Z(a,c),c.g);2===c.status&&a.j.g(c.sd);c.status==La&&(c.status=-1,await Ke(a,b))} +async function Ra(a,b,c,d,e){if(b==d&&c==e)return 0;var g=Sa(a,b,c);if(-1===g)return-2;var f=b;Ce(a,f);for(var h="";0!=f;)h="/"+Me(a,f)+h,f=Ne(a,f);if(-1!=Sa(a,d,e)&&(f=Ta(a,d,e),0>f))return f;h=a.g[g];var k=a.g[b];f=a.g[d];if(5===k.status||5===f.status)if(5===k.status&&k.i===f.i){if(a=await Ra(Z(a,k),k.g,c,f.g,e),0>a)return a}else{if(0===H(a,g).dc||!Ce(a,g)&&1 +e)return e;await Ke(a,k);a=Ta(a,b,c);if(0>a)return a}else De(a,b,c),Be(a,d,g,e),h.za.version++;return 0}async function Pa(a,b,c,d,e){var g=a.g[b];if(5===g.status)b=g.g,await Pa(Z(a,g),b,c,d,e);else{var f=await a.pb(b);!f||f.length >12,e],b,d)}}function Na(a,b,c){a=a.h[b];if(c>=a.length)return a.length;for(b=0;;){const d=E(["Q","d"],a,{offset:b})[1];if(d>c)break;b=d}return b}function Ce(a,b){b=a.g[b];return 5===b.status?Ce(Z(a,b),b.g):(b.mode&61440)===Ga} +function Pe(a,b){Ce(a,b);b=a.g[b];if(5===b.status)return Pe(Z(a,b),b.g);a=[];for(const c of b.ia.keys())"."!==c&&".."!==c&&a.push(c);return a}function Ne(a,b){Ce(a,b);b=a.g[b];if(5!==b.status||0===b.g)return b.ia.get("..");const c=Ne(Z(a,b),b.g);return Re(a,b.i,c)}function Oe(a,b,c,d){const e=a.g[b];5===e.status&&a.i[e.i].g.delete(e.g);e.status=5;e.i=c;e.g=d;a.i[c].g.set(d,b)}function Ge(a,b,c){const d=ze(a),e=a.g.length;a.g.push(d);d.dc=e;Oe(a,e,b,c);return e} +function Re(a,b,c){const d=a.i[b].g.get(c);return void 0===d?Ge(a,b,c):d}function Z(a,b){return a.i[b.i].h}function Ee(){this.type=2;this.start=0;this.length=Infinity;this.h=-1;this.g=""}Ee.prototype.$=function(){const a=[];a[0]=this.type;a[1]=this.start;a[2]=Infinity===this.length?0:this.length;a[3]=this.h;a[4]=this.g;return a};Ee.prototype.H=function(a){this.type=a[0];this.start=a[1];this.length=0===a[2]?Infinity:a[2];this.h=a[3];this.g=a[4]};function Ue(a){const b=new Ee;b.H(a.$());return b} +function Ve(a,b){return b.h===a.h&&b.g===a.g&&b.type===a.type}function We(a,b){return Ve(a,b)&&b.start+b.length===a.start}function Ia(a,b,c,d,e){const g=new Ee;g.type=a;g.start=b;g.length=c;g.h=d;g.g=e;return g}function Ka(a,b,c){b=a.g[b];if(5===b.status){var d=b.g;return Ka(Z(a,b),d,c)}for(d of b.h)if(!(c.h===d.h&&c.g===d.g||2===c.type||2===d.type||1!==c.type&&1!==d.type||c.start+c.length<=d.start||d.start+d.length<=c.start))return Ue(d);return null} +function Ja(a,b,c,d){const e=a.g[b];if(5===e.status)return b=e.g,Ja(Z(a,e),b,c,d);c=Ue(c);if(2!==c.type&&Ka(a,b,c))return 1;for(a=0;a =g&&0 =g&&(e.h.splice(a,1),a--)}if(2!==c.type){a=c;d=!1;for(b=0;b "."!==c&&".."!==c)} +we.prototype.re=function(a){a=Se(this,a);if(-1===a.id)return Promise.resolve(null);const b=H(this,a.id);return Oa(this,a.id,0,b.size)};function v(a,b,c,d){for(var e,g=0,f=0;f >8&255;c[d++]=e>>16&255;c[d++]=e>>24&255;g+=4;break;case "d":c[d++]=e&255;c[d++]=e>>8&255;c[d++]=e>>16&255;c[d++]=e>>24&255;c[d++]=0;c[d++]=0;c[d++]=0;c[d++]=0;g+=8;break;case "h":c[d++]=e&255;c[d++]=e>>8;g+=2;break;case "b":c[d++]=e;g+=1;break;case "s":var h=d,k=0;c[d++]=0;c[d++]=0;g+=2;for(var l of e)Ye(l.charCodeAt(0)).forEach(function(q){c[d++]=q;g+=1;k++});c[h+0]=k&255;c[h+1]=k>>8&255;break; +case "Q":v(["b","w","d"],[e.type,e.version,e.path],c,d),d+=13,g+=13}return g} +function E(a,b,c){let d=c.offset;for(var e=[],g=0;g >>0;e.push(f);break;case "d":f=b[d++];f+=b[d++]<<8;f+=b[d++]<<16;f+=b[d++]<<24>>>0;d+=4;e.push(f);break;case "h":f=b[d++];e.push(f+(b[d++]<<8));break;case "b":e.push(b[d++]);break;case "s":f=b[d++];f+=b[d++]<<8;for(var h="",k=new Ze,l=0;l this.g[0])return this.h=0,this.g[0];break;case 2:if(192==(this.g[0]&224)&&128==(this.g[1]&192))return this.h=0,(this.g[0]&31)<<6|this.g[1]&63}return-1}}function Ye(a){if(128>a)return[a];if(2048>a)return[192|a>>6&31,128|a&63]}function Te(a){for(var b=0,c=0;c a.charCodeAt(c)?1:2;return b};function $e(a){function b(m){!m.altKey&&h[56]&&g(56,!1);return e(m,!1)}function c(m){!m.altKey&&h[56]&&g(56,!1);return e(m,!0)}function d(){for(var m=Object.keys(h),r,x=0;x keyCode not found: ",r,m)}};function af(a,b){function c(w){if(!x.enabled||!x.Ie)return!1;var A=b||document.body,I;if(!(I=document.pointerLockElement))a:{for(w=w.target;w.parentNode;){if(w===A){I=!0;break a}w=w.parentNode}I=!1}return I}function d(w){c(w)&&(w=w.changedTouches)&&w.length&&(w=w[w.length-1],m=w.clientX,r=w.clientY)}function e(){if(q||t||n)x.v.send("mouse-click",[!1,!1,!1]),q=t=n=!1}function g(w){if(x.v&&c(w)&&x.Zc){var A=0,I=0,O=w.changedTouches;O?O.length&&(O=O[O.length-1],A=O.clientX-m,I=O.clientY-r,m=O.clientX, +r=O.clientY,w.preventDefault()):"number"===typeof w.movementX?(A=w.movementX,I=w.movementY):"number"===typeof w.webkitMovementX?(A=w.webkitMovementX,I=w.webkitMovementY):"number"===typeof w.mozMovementX?(A=w.mozMovementX,I=w.mozMovementY):(A=w.clientX-m,I=w.clientY-r,m=w.clientX,r=w.clientY);x.v.send("mouse-delta",[.15*A,-(.15*I)]);b&&x.v.send("mouse-absolute",[w.pageX-b.offsetLeft,w.pageY-b.offsetTop,b.offsetWidth,b.offsetHeight])}}function f(w){c(w)&&k(w,!0)}function h(w){c(w)&&k(w,!1)}function k(w, +A){x.v&&(1===w.which?q=A:2===w.which?t=A:3===w.which&&(n=A),x.v.send("mouse-click",[q,t,n]),w.preventDefault())}function l(w){if(c(w)){var A=w.wheelDelta||-w.detail;0>A?A=-1:0{switch(k.data.type){case "queue":h.ba(k.data.value);break;case "sampling-rate":h.O=k.data.value/sampleRate}};return h}var f=[new Float32Array(256),new Float32Array(256)];Reflect.setPrototypeOf(g.prototype, +AudioWorkletProcessor.prototype);Reflect.setPrototypeOf(g,AudioWorkletProcessor);g.prototype.process=g.prototype.process=function(h,k){for(h=0;h h?(h+=this.L[0].length,this.L[k][h]):this.g[k][h]};g.prototype.X=function(h){var k=this.g[0].length;k-this.j h){for(var k=this.B,l=0;256>h&&l this.C/this.O&&this.port.postMessage({type:"pump"})};g.prototype.ba=function(h){this.o {URL.revokeObjectURL(d);this.Jb=new AudioWorkletNode(this.U,"dac-processor",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[2],parameterData:{},processorOptions:{}});this.Jb.port.postMessage({type:"sampling-rate",value:this.Ya});this.Jb.port.onmessage=e=>{switch(e.data.type){case "pump":this.lc()}};this.Jb.connect(this.g)});this.h=gf(c,this.g,2);this.h.g= +3;a.register("dac-send-data",function(e){this.yf(e)},this);a.register("dac-enable",function(){this.enabled=!0},this);a.register("dac-disable",function(){this.enabled=!1},this);a.register("dac-tell-sampling-rate",function(e){this.Ya=e;this.Jb&&this.Jb.port.postMessage({type:"sampling-rate",value:e})},this)}cf.prototype.yf=function(a){this.Jb&&this.Jb.port.postMessage({type:"queue",value:a},[a[0].buffer,a[1].buffer])};cf.prototype.lc=function(){this.enabled&&this.v.send("dac-request-data")}; +function df(a,b,c){this.v=a;this.U=b;this.enabled=!1;this.Ya=22050;this.g=0;this.pe=1;this.Se=this.U.createBiquadFilter();this.Se.type="lowpass";this.i=this.Se;this.h=gf(c,this.i,2);this.h.g=3;a.register("dac-send-data",function(d){this.yf(d)},this);a.register("dac-enable",function(){this.enabled=!0;this.lc()},this);a.register("dac-disable",function(){this.enabled=!1},this);a.register("dac-tell-sampling-rate",function(d){this.Ya=d;this.pe=Math.ceil(8E3/d);this.Se.frequency.setValueAtTime(d/2,this.U.currentTime)}, +this)} +df.prototype.yf=function(a){var b=a[0].length,c=b/this.Ya;if(1 this.lc(),1E3*b);a.start(this.g);this.g+=c;setTimeout(()=>this.lc(),0)};df.prototype.lc=function(){this.enabled&&(.2 k?void 0===this.g&&(this.g=setTimeout(()=>{this.g=void 0;this.i=Date.now();this.l()},16-k)):(void 0!==this.g&&(clearTimeout(this.g),this.g=void 0),this.i=h,this.l())};this.l=function(){a.value=this.text;this.j&&(this.j=!1,a.scrollTop=1E9)};this.h=function(h){f.v&&f.v.send("serial0-input",h)}} +function kf(a,b){this.element=a;if(window.Terminal){var c=this.g=new window.Terminal;c.setOption("logLevel","off");c.write("This is the serial console. Whatever you type or paste here will be sent to COM1");var d=c.onData(function(e){for(let g=0;g Date.now()||(this.i=Date.now(),this.g=new WebSocket(this.url),this.g.binaryType="arraybuffer",this.g.onopen=this.Nh.bind(this),this.g.onmessage=this.Mh.bind(this),this.g.onclose=this.Kh.bind(this),this.g.onerror=this.Lh.bind(this))}};p.send=function(a){this.g&&1===this.g.readyState?this.g.send(a):(this.h.push(a),128 this.cpu_exception_hook&&this.cpu_exception_hook(f),hlt_op:function(){var f=c;0===(f.o()&512)&&f.v.send("cpu-event-halt");f.h[0]=1;mb(f)},abort:function(){},microtick:nb,get_rand_int:function(){return zb()},pic_acknowledge:function(){me(c)},io_port_read8:function(f){f=c.A.ports[f];return f.od.call(f.oa)},io_port_read16:function(f){f=c.A.ports[f]; +return f.Oa.call(f.oa)},io_port_read32:function(f){f=c.A.ports[f];return f.qe.call(f.oa)},io_port_write8:function(f,h){f=c.A.ports[f];f.df.call(f.oa,h)},io_port_write16:function(f,h){f=c.A.ports[f];f.Ae.call(f.oa,h)},io_port_write32:function(f,h){f=c.A.ports[f];f.Lc.call(f.oa,h)},mmap_read8:function(f){return c.i[f>>>17](f)},mmap_read16:function(f){var h=c.i[f>>>17];return h(f)|h(f+1|0)<<8},mmap_read32:function(f){return c.pa[f>>>17](f)},mmap_write8:function(f,h){c.l[f>>>17](f,h)},mmap_write16:function(f, +h){var k=c.l[f>>>17];k(f,h&255);k(f+1|0,h>>8)},mmap_write32:function(f,h){c.j[f>>>17](f,h)},mmap_write64:function(f,h,k){var l=c.j[f>>>17];l(f,h);l(f+4,k)},mmap_write128:function(f,h,k,l,q){var n=c.j[f>>>17];n(f,h);n(f+4,k);n(f+8,l);n(f+12,q)},log_from_wasm:function(f,h){[...(new Uint8Array(d.buffer,f>>>0,h>>>0))]},console_log_from_wasm:function(f,h){f=String.fromCharCode(...(new Uint8Array(d.buffer,f>>>0,h>>>0)));console.error(f)},dbg_trace_from_wasm:function(){},codegen_finalize:(f,h,k,l,q)=>{le(c, +f,h,k,l,q)},jit_clear_func:f=>{c.xa.Mf.set(f+1024,null)},jit_clear_all_funcs:()=>{const f=c.xa.Mf;for(let h=0;900>h;h++)f.set(1024+h,null)},__indirect_function_table:e};let g=a.wasm_fn;g||(g=f=>new Promise(h=>{let k="v86.wasm",l="v86-fallback.wasm";if(a.wasm_path){k=a.wasm_path;const q=k.lastIndexOf("/");l=(-1===q?"":k.substr(0,q))+"/"+l}else"undefined"===typeof window&&"string"===typeof __dirname?(k=__dirname+"/"+k,l=__dirname+"/"+l):(k="build/"+k,l="build/"+l);Gb(k,{done:async q=>{try{const {instance:n}= +await WebAssembly.instantiate(q,f);this.D=q;h(n.exports)}catch(n){Gb(l,{done:async t=>{const {instance:m}=await WebAssembly.instantiate(t,f);this.D=t;h(m.exports)}})}},progress:q=>{this.Gd.send("download-progress",{ge:0,fe:1,he:k,lengthComputable:q.lengthComputable,total:q.total,loaded:q.loaded})}})}));g({env:b}).then(f=>{d=f.memory;f.rust_init();f=this.g=new ib(this.Gd,{exports:f,Mf:e});c=f.s;mf(this,f,a)});this.i=null;this.F=0} +async function mf(a,b,c){function d(m,r){switch(m){case "hda":g.M=this.ac.hda=r;break;case "hdb":g.Ke=this.ac.hdb=r;break;case "cdrom":g.ga=this.ac.cdrom=r;break;case "fda":g.ma=this.ac.fda=r;break;case "fdb":g.Zf=this.ac.fdb=r;break;case "multiboot":g.ed=this.ac.multiboot=r.buffer;break;case "bzimage":g.vb=this.ac.bzimage=r.buffer;break;case "initrd":g.Xc=this.ac.initrd=r.buffer;break;case "bios":g.Bd=r.buffer;break;case "vga_bios":g.Sj=r.buffer;break;case "initial_state":g.Wc=r.buffer;break;case "fs9p_json":g.cg= +r}}async function e(){if(g.Db&&g.cg){if(!g.Wc){var m=g.Db,r=g.cg;if(3!==r.version)throw"The filesystem JSON format has changed. Please update your fs2json (https://github.com/copy/fs2json) and recreate the filesystem JSON.";var x=r.fsroot;m.o=r.size;for(r=0;r {if(r)if(r.get&&r.set&&r.load)f.push({name:m,bd:r});else{if("bios"===m||"vga_bios"===m||"initial_state"===m||"multiboot"===m||"bzimage"===m||"initrd"===m)r.async=!1;r.buffer instanceof ArrayBuffer?(r=new tb(r.buffer),f.push({name:m,bd:r})):"undefined"!==typeof File&&r.buffer instanceof File?(void 0===r.async&&(r.async=268435456<=r.buffer.size),r=r.async?new wb(r.buffer):new db(r.buffer),f.push({name:m, +bd:r})):r.url&&(r.async?(r=r.aa?new vb(r.url,r.size,r.I,!1,a.Yj.bind(a)):new ub(r.url,r.size,r.I),f.push({name:m,bd:r})):f.push({name:m,url:r.url,size:r.size}))}};c.state&&console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");for(var k="bios vga_bios cdrom hda hdb fda fdb initial_state multiboot bzimage initrd".split(" "),l=0;l +[q,()=>console.error("zstd worker unexpectedly called "+q)])),f.__indirect_function_table=new WebAssembly.Table({element:"anyfunc",initial:1024}),f.abort=()=>{throw Error("zstd worker aborted");},f.log_from_wasm=f.console_log_from_wasm=(q,n)=>{console.log(String.fromCharCode(...(new Uint8Array(d.exports.memory.buffer,q,n))))},f.dbg_trace_from_wasm=()=>console.trace(),d=new WebAssembly.Instance(new WebAssembly.Module(e.data),{env:f})}}.toString()+")()"],{type:"text/javascript"}));this.i=new Worker(c); +URL.revokeObjectURL(c);this.i.postMessage(this.D,[this.D])}return new Promise(c=>{const d=this.F++,e=async g=>{g.data.id===d&&(this.i.removeEventListener("message",e),c(g.data.result))};this.i.addEventListener("message",e);this.i.postMessage({src:b,uh:a,id:d},[b.buffer])})}; +function nf(a){const b=(Xe(a,"/")||[]).map(e=>"/"+e);a=(Xe(a,"/boot/")||[]).map(e=>"/boot/"+e);let c,d;for(let e of[].concat(b,a)){const g=/old/i.test(e)||/fallback/i.test(e),f=/initrd/i.test(e)||/initramfs/i.test(e);!/vmlinuz/i.test(e)&&!/bzimage/i.test(e)||d&&g||(d=e);!f||c&&g||(c=e)}c&&d||(console.log("Failed to find bzimage or initrd in filesystem. Files:"),console.log(b.join(" ")),console.log(a.join(" ")));return{Sh:c,kh:d}}p.Ze=async function(){this.v.send("cpu-run")}; +p.stop=async function(){this.Ge&&await new Promise(a=>{const b=()=>{this.v.unregister("emulator-stopped",b);a()};J(this,"emulator-stopped",b);this.v.send("cpu-stop")})};p.va=async function(){await this.stop();this.g.va();this.B&&this.B.va();this.C&&this.C.va();this.l&&this.l.va();this.h&&this.h.va();this.Qd&&this.Qd.va();this.j&&this.j.va()};p.zf=function(){this.v.send("cpu-restart")};function J(a,b,c){a.v.register(b,c,a)}p.Nd=async function(a){this.g.Nd(a)};p.se=async function(){return this.g.se()}; +p.Zc=function(){return this.Ge};function Za(a,b){for(var c=0;c >20)+"m\n";b=b+"Config:\nMAX_PAGES="+(a.xa.exports.get_jit_config(0)+"\n");b+="JIT_USE_LOOP_SAFETY="+!!a.xa.exports.get_jit_config(1)+"\n";return b+="MAX_EXTRA_BASIC_BLOCKS="+a.xa.exports.get_jit_config(2)+"\n"},Bj:function(a){return[Ya.oe(a,!1,!1,!1,!1),Ya.oe(a,!0,!1,!1,!1),Ya.oe(a,!1, +!0,!1,!1),Ya.oe(a,!1,!1,!0,!1),Ya.oe(a,!1,!1,!1,!0)].join("\n\n")},oe:function(a,b,c,d,e){let g="";var f=[],h=b?"compiled":c?"jit exit":d?"unguarded register":e?"wasm size":"executed";for(let q=0;256>q;q++)for(let n=0;8>n;n++)for(let t of[!1,!0]){var k=a.xa.exports.get_opstats_buffer(b,c,d,e,q,!1,t,n);f.push({Te:q,count:k,ig:t,ag:n});k=a.xa.exports.get_opstats_buffer(b,c,d,e,q,!0,t,n);f.push({Te:3840|q,count:k,ig:t,ag:n})}a=0;b=new Set([38,46,54,62,100,101,102,103,240,242,243]);for(let {count:q,Te:n}of f)b.has(n)|| +(a+=q);if(0===a)return"";c=new Uint32Array(256);b=new Uint32Array(256);for(let {Te:q,count:n}of f)3840==(q&65280)?b[q&255]+=n:c[q&255]+=n;g=g+"------------------\nTotal: "+(a+"\n");const l=1E7Math.round(q/l)));d=String(d).length;g+=`Instruction counts ${h} (in ${l}):\n`;for(e=0;256>e;e++)g+=e.toString(16).padStart(2,"0")+":"+xb(Math.round(c[e]/l),d),g=15==e%16?g+"\n":g+" ";g=g+"\n"+`Instruction counts ${h} (0f, in ${l}):\n`;for(h=0;256>h;h++)g+=(h& +255).toString(16).padStart(2,"0")+":"+xb(Math.round(b[h]/l),d),g=15==h%16?g+"\n":g+" ";g+="\n";f=f.filter(({count:q})=>q).sort(({count:q},{count:n})=>n-q);for(let {Te:q,ig:n,ag:t,count:m}of f.slice(0,200))g+=q.toString(16)+"_"+t+(n?"_m":"_r")+":"+(m/a*100).toFixed(2)+" ";return g+"\n"}};"undefined"!==typeof module&&"undefined"!==typeof module.exports&&(module.exports.print_stats=Ya);function pf(){this.h=new Map}pf.prototype.read=async function(a,b,c){return(a=this.h.get(a))?a.subarray(b,b+c):null};pf.prototype.cache=async function(a,b){this.h.set(a,b)};pf.prototype.g=function(a){this.h.delete(a)};function qf(a,b){this.h=a;this.Ce=b}function sf(a,b){return new Promise(c=>{Gb(a.Ce+b,{done:async d=>{d=new Uint8Array(d);await a.cache(b,d);c(d)}})})}qf.prototype.read=async function(a,b,c){const d=await this.h.read(a,b,c);return d?d:(await sf(this,a)).subarray(b,b+c)}; +qf.prototype.cache=async function(a,b){return await this.h.cache(a,b)};qf.prototype.g=function(a){this.h.g(a)};"undefined"!==typeof window?(window.MemoryFileStorage=pf,window.ServerFileStorageWrapper=qf):"undefined"!==typeof module&&"undefined"!==typeof module.exports?(module.exports.MemoryFileStorage=pf,module.exports.ServerFileStorageWrapper=qf):"function"===typeof importScripts&&(self.MemoryFileStorage=pf,self.ServerFileStorageWrapper=qf); diff --git a/tools/v86/images/e b/tools/v86/images/e new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tools/v86/images/e @@ -0,0 +1 @@ + diff --git a/tools/v86/images/linux4.iso b/tools/v86/images/linux4.iso new file mode 100644 index 00000000..db2ba837 Binary files /dev/null and b/tools/v86/images/linux4.iso differ diff --git a/tools/v86/index.html b/tools/v86/index.html new file mode 100644 index 00000000..53b5b019 --- /dev/null +++ b/tools/v86/index.html @@ -0,0 +1,229 @@ + + + + Virtual x86 + + + + + + +++ + + + + + + + +++ + + +Setup
++
+ ++ + ++ + + ++ + ++ + + ++ + + ++ + + ++ + + + + ++ + + + +Disk images are not uploaded to the server ++ + ++ + MB +
++ + ++ + MB +
++ + ++ + + ++ + ++ + + ++ + +
++ + ++ + +
++ + ++ + ++ + + +
+ +
+ + + +
+Version: 98e7110c2 (Feb 16, 2021 12:02)
+ +
+Enable debug +— +Readme +— +Project on Github +— +Compatibility diff --git a/tools/v86/v86.css b/tools/v86/v86.css new file mode 100644 index 00000000..bac71441 --- /dev/null +++ b/tools/v86/v86.css @@ -0,0 +1,259 @@ +#log, #runtime_infos, #serial, #filesystem_panel, #debug_panel { + font-family: DejaVu Sans Mono, monospace; + font-size: 13px; + border: 1px solid #333; + background-color: #000; + padding: 4px; + color: #fff; +} +#runtime_infos, #filesystem_panel { + float: left; + width: 250px; + margin-bottom: 7px; + margin-right: 7px; + padding-bottom: 7px; +} +#log { + height: 100px; + width: 550px; +} +#debug_panel { + white-space: pre; + float: left; +} +#serial { + margin: 0; +} +#serial:focus { + outline: 1px solid rgb(229, 151, 0); +} +#screen { + white-space: pre; + position: relative; + font-family: Liberation Mono, DejaVu Sans Mono, Courier New, monospace; + font-weight: bold; + font-size: 15px; + line-height: normal; +} +#screen, #vga { + -webkit-transform-origin: top left; + -moz-transform-origin: top left; + transform-origin: top left; +} +#vga { + background-color: #000; +} +body { + background-color: #111; + color: #fff; + line-height: 1.5; + padding: 10px; + font-family: sans-serif; +} +a { + color: wheat; + text-decoration: none; +} +.phone_keyboard { + width: 0; + height: 0; + resize: none; + position: absolute; + opacity: 0; + left: -9999em; + top: 0; + z-index: -10; + white-space: nowrap; + overflow: hidden; +} +h4 { + margin: 0 0 9px 0; +} +#start_emulation { + padding: 6px 18px; + font-size: 16px; + font-weight: bold; +} +#setup_error { + color: red; + font-weight: bold; + background-color: #222; + padding: 8px 18px; +} +#config_link { + font-weight: bold; + background-color: #222; + padding: 8px 18px; +} +#screen_container { + float: left; + margin-right: 10px; + margin-bottom: 10px; + outline: 1px solid #555; +} +#boot_options a { + text-decoration: none; + font-weight: bold; + font-size: 16px; +} +#boot_options td { + padding: 1px 7px; +} +#oses small { + font-size: 80%; + color: #ccc; + padding-left: 5px; +} +#oses tr { + cursor: pointer; +} +#oses { + border-spacing: 0; +} +#oses tr:hover { + background-color: #311; +} +#oses td:nth-child(1) { + white-space: pre; + vertical-align: top; +} +#terminal { + max-width: 1024px; +} + +/* the code below was copied from xterm.css */ + +.xterm { + font-feature-settings: "liga" 0; + position: relative; + user-select: none; + -ms-user-select: none; + -webkit-user-select: none; +} + +.xterm.focus, +.xterm:focus { + outline: none; +} + +.xterm .xterm-helpers { + position: absolute; + top: 0; + /** + * The z-index of the helpers must be higher than the canvases in order for + * IMEs to appear on top. + */ + z-index: 5; +} + +.xterm .xterm-helper-textarea { + padding: 0; + border: 0; + margin: 0; + /* Move textarea out of the screen to the far left, so that the cursor is not visible */ + position: absolute; + opacity: 0; + left: -9999em; + top: 0; + width: 0; + height: 0; + z-index: -5; + /** Prevent wrapping so the IME appears against the textarea at the correct position */ + white-space: nowrap; + overflow: hidden; + resize: none; +} + +.xterm .composition-view { + /* TODO: Composition position got messed up somewhere */ + background: #000; + color: #FFF; + display: none; + position: absolute; + white-space: nowrap; + z-index: 1; +} + +.xterm .composition-view.active { + display: block; +} + +.xterm .xterm-viewport { + /* On OS X this is required in order for the scroll bar to appear fully opaque */ + background-color: #000; + overflow-y: scroll; + cursor: default; + position: absolute; + right: 0; + left: 0; + top: 0; + bottom: 0; +} + +.xterm .xterm-screen { + position: relative; +} + +.xterm .xterm-screen canvas { + position: absolute; + left: 0; + top: 0; +} + +.xterm .xterm-scroll-area { + visibility: hidden; +} + +.xterm-char-measure-element { + display: inline-block; + visibility: hidden; + position: absolute; + top: 0; + left: -9999em; + line-height: normal; +} + +.xterm { + cursor: text; +} + +.xterm.enable-mouse-events { + /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ + cursor: default; +} + +.xterm.xterm-cursor-pointer { + cursor: pointer; +} + +.xterm.column-select.focus { + /* Column selection mode */ + cursor: crosshair; +} + +.xterm .xterm-accessibility, +.xterm .xterm-message { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + z-index: 10; + color: transparent; +} + +.xterm .live-region { + position: absolute; + left: -9999px; + width: 1px; + height: 1px; + overflow: hidden; +} + +.xterm-dim { + opacity: 0.5; +} + +.xterm-underline { + text-decoration: underline; +}