Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-95-fiber

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-95-fiber - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

dist/index.js

@@ -1,1 +0,1 @@

import e from"@babel/runtime/helpers/esm/extends";import t,{useContext as n,forwardRef as o,useRef as r,useLayoutEffect as i,createContext as a,useEffect as s,useCallback as l}from"react";import{V86Starter as d}from"v86";import u from"react-reconciler";import{unstable_now as p}from"scheduler";const c=e=>65535&e,m=e=>e>>16&65535,y=e=>255&e,w=e=>e>>8&255,v=8388608,h=12582912,f=1073741824,g=1073741824,C=33554432,I=67108864,_=134217728,x=4194304,W=131072,U=1048576,S=536870912,b=16777216,E=65536,P=536870912,M=131072,R=0,T=2147483648,O=262144,F=524288,L=65536,D=262144,H=0,B=13565952,k=268435456,A=2097152,Q=13565952,N=-2138570752,j=32768,G=6,q=28,z=864,V=895,X=780,Y=75,J=31,K=533,Z=781,$=258,ee=47,te=34,ne=771,oe=16,re=273,ie=68,ae=65,se=57,le=123,de=769,ue=74,pe=1,ce=309,me=310,ye=307,we=308,ve=306,he=311,fe=312,ge=768,Ce=259,Ie=45,_e=2,xe=775,We=537,Ue=27,Se=126,be=776,Ee=43,Pe=563,Me=10,Re=22,Te=289,Oe=529,Fe=561,Le=20,De=530,He=562,Be=29,ke=135,Ae=49,Qe=51,Ne=127,je=36,Ge=13,qe=14,ze=856,Ve=863,Xe=83,Ye=786,Je=276,Ke=782,Ze=39,$e=272,et=278,tt=279,nt=81,ot=80,rt=256,it=257,at=8,st=546,lt=551,dt=544,ut=545,pt=553,ct=552,mt=549,yt=548,wt=564,vt=547,ht=560,ft=550,gt=44,Ct=293,It=290,_t=294,xt=292,Wt=291,Ut=288,St=287,bt=531,Et=3,Pt=534,Mt=134,Rt=131,Tt=129,Ot=130,Ft=132,Lt=163,Dt=161,Ht=162,Bt=169,kt=167,At=168,Qt=160,Nt=133,jt=166,Gt=164,qt=165,zt=40,Vt=78,Xt=85,Yt=0,Jt=15,Kt=777,Zt=38,$t=785,en=784,tn=528,nn=770,on=896,rn=911,an=72,sn=536,ln=791,dn=792,un=55,pn=17,cn=783,mn=19,yn=35,wn=18,vn=774,hn=773,fn=32,gn=7,Cn=48,In=50,_n=128,xn=11,Wn=12,Un=26,Sn=24,bn=5,En=779,Pn=532,Mn=42,Rn=125,Tn=124,On=262,Fn=21,Ln=274,Dn=263,Hn=260,Bn=261,kn=82,An=794,Qn=30,Nn=275,jn=772,Gn=1024,qn=84,zn=46,Vn=277,Xn=778,Yn=71,Jn=70,Kn=26,Zn=256,$n=264,eo=136,to=33,no=512,oo=513,ro=514,io=515,ao=516,so=517,lo=518,uo=519,po=520,co=521,mo=522,yo=512,wo=522,vo=673,ho=675,fo=16,go=262144,Co=512,Io=1024,_o=65536,xo=1,Wo=0,Uo=16384,So=0,bo=64,Eo=4,Po=768,Mo=392,Ro=4096,To=0,Oo=8192,Fo=131072,Lo=128,Do=8,Ho=32,Bo=256,ko=2147483648,Ao=0,Qo=1,No=2,jo=4,Go=8,qo=16,zo=32,Vo=64,Xo=128,Yo=256,Jo=1024,Ko=2048,Zo=4096,$o=8192,er=256,tr=512,nr=768,or=1024,rr=1280,ir=1281,ar=1537,sr=1538,lr=1,dr=2,ur=65535,pr=1,cr=1,mr=2,yr=4,wr=176,vr=177,hr=178,fr=179,gr=180,Cr=181,Ir=182,_r=183,xr=184,Wr=185,Ur=186,Sr=187,br=188,Er=189,Pr=190,Mr=193,Rr=194,Tr=196,Or=197,Fr=198,Lr=199,Dr=200,Hr=201,Br=203,kr=204,Ar=205,Qr=206,Nr=207,jr=208,Gr=209,qr=210,zr=211,Vr=212,Xr=197,Yr=213,Jr=214,Kr=215,Zr=216,$r=217,ei=0,ti=1,ni=2,oi=0,ri=1,ii=2,ai=3,si=4,li=5,di=6,ui=7,pi=8,ci=9,mi=11,yi=32,wi=0,vi=64,hi=128,fi=256,gi=512,Ci=768,Ii=1024,_i=2048,xi=3072,Wi=4096,Ui=8192,Si=16384,bi=32768,Ei=32,Pi=0,Mi=1,Ri=2,Ti=3,Oi=4,Fi=5,Li=2,Di=3,Hi=5,Bi=6,ki=7,Ai=240,Qi=241,Ni=242,ji=243,Gi=244,qi=245,zi=246,Vi=247,Xi=0,Yi=1,Ji=2,Ki=4,Zi=8,$i=0,ea=1,ta=2,na=3,oa=4,ra=5,ia=6,aa=7,sa=8,la=9,da=10,ua=11,pa=12,ca=13,ma=14,ya=15,wa=16,va=17,ha=18,fa=31,ga=128,Ca=256,Ia=512,_a=1024,xa=2048,Wa=4096,Ua=16384,Sa=32768,ba=49152,Ea=49152,Pa=368,Ma=369,Ra=370,Ta=371,Oa=0,Fa=1,La=2,Da=3,Ha=372,Ba=32770,ka=0,Aa=4,Qa=8,Na=-4,ja=-6,Ga=-8,qa=-16,za=-20,Va=-21,Xa=-12;class Ya{constructor(e,t){this.outQueue=[],this.inQueue=[],e.io.register_write(1284,this,(()=>console.warn("Invalid 8 bit write!")),(()=>console.warn("Invalid 16 bit write!")),(e=>{const n=255&e;e>>8>0?this.inQueue.push(n):this.inQueue.length>0&&(t(new Uint8ClampedArray(this.inQueue).buffer),this.inQueue=[])})),e.io.register_read(1280,this,(()=>(console.warn("Invalid 8 bit read!"),0)),(()=>(console.warn("Invalid 16 bit read!"),0)),(()=>{var e;const t=(null==(e=this.outQueue[0])?void 0:e.length)>0&&this.outQueue[0]||this.outQueue.shift();if(!t)return 0;const n=t.shift();return void 0===n?0:n|t.length+1<<8}))}sendData(e){const t=new Uint8ClampedArray(e);this.outQueue.push(Array.from(t))}}new TextEncoder;const Ja=new TextDecoder;let Ka,Za,$a;function es(e,t){const n=t.map((e=>4+(e.type===Za.String?e.value.length+1+4:4))).reduce(((e,t)=>e+t),0),o=new ArrayBuffer(12+n),r=new DataView(o);r.setUint32(0,49325,!0),r.setUint32(4,e,!0),r.setUint32(8,t.length,!0);let i=o.byteLength;for(let e=0;e<t.length;e++){const n=t[e];if(r.setUint32(12+8*e,n.type,!0),n.type===Za.Int)r.setInt32(12+8*e+4,n.value,!0);else if(n.type===Za.UInt)r.setUint32(12+8*e+4,n.value,!0);else if(n.type===Za.Float)r.setFloat32(12+8*e+4,n.value,!0);else if(n.type===Za.String){const t=n.value;i--,r.setUint8(i,0);for(let e=t.length-1;e>=0;e--)i--,r.setUint8(i,t.charCodeAt(e));r.setUint32(12+8*e+4,i,!0)}}return o}function ts(e,t,n,o){void 0===o&&(o={scale:.5,fromState:!1});const r=new d({screen_container:e,wasm_fn:n.v86WASM?(i=n.v86WASM,async e=>(await WebAssembly.instantiate(i,e)).instance.exports):n.v86WASMFn,bios:n.seabios?{buffer:n.seabios}:{url:n.seabiosUrl},vga_bios:n.vgabios?{buffer:n.vgabios}:{url:n.vgabiosUrl},hda:n.osImg?{buffer:n.osImg}:{url:n.osImgUrl},boot_order:306,memory_size:33554432,disable_mouse:!0,autostart:o.fromState||!0});var i;r.add_listener("emulator-started",(()=>{r.v86.cpu.devices.commBus=new Ya(r.v86.cpu,(e=>{const n=function(e){if(e.byteLength<4)return null;const t=new DataView(e),n=t.getUint32(0,!0);return n===$a.Res_WinProc?20!==e.byteLength?null:{type:n,hwnd:t.getUint32(4,!0),message:t.getUint32(8,!0),wParam:t.getUint32(12,!0),lParam:t.getInt32(16,!0)}:n===$a.Res_CmdOutputHandle?12!==e.byteLength?null:{type:n,seq:t.getUint32(4,!0),handle:t.getUint32(8,!0)}:n===$a.Res_CmdOutputLong?e.byteLength!==12+t.getUint32(8,!0)?null:{type:n,seq:t.getUint32(4,!0),length:t.getUint32(8,!0),data:e.slice(12)}:{type:n}}(e);if(n){var o;if(null==t.onEvent||t.onEvent(n),(n.type===$a.Res_CmdOutputHandle||n.type===$a.Res_CmdOutputLong)&&p.has(n.seq))null==(o=p.get(n.seq))||o(n),p.delete(n.seq);a.ready||(null==t.onReady||t.onReady(),a.ready=!0)}}))}));const a={v86Emulator:r,ready:!1};function s(e){const t=r.v86.cpu.devices.commBus;t&&t.sendData(e)}let l=0;function u(){const e=l;return l=l+1&16777215,e}const p=new Map,c=[],m={sendSerial:s,startBridge(){r.keyboard_send_scancodes([29,19]),r.keyboard_send_scancodes([157,147]),r.keyboard_send_text('"c:\\windows\\start menu\\Programs\\StartUp\\bridge.exe"'),r.keyboard_send_scancodes([28]),r.keyboard_send_scancodes([156])},setMousePos(e,t){a.ready&&s(es(Ka.Cmd_SetCursorPos,[{type:Za.Int,value:e},{type:Za.Int,value:t}]))},setWindowPos(e,t,n,o,r){s(es(Ka.Cmd_SetWindowPos,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.Int,value:n},{type:Za.Int,value:o},{type:Za.Int,value:r}]))},createWindow(e){s(es(Ka.Cmd_CreateWindow,[{type:Za.UInt,value:e.id},{type:Za.UInt,value:e.extStyle},{type:Za.String,value:e.type},{type:Za.String,value:e.text},{type:Za.UInt,value:e.params},{type:Za.Int,value:e.x},{type:Za.Int,value:e.y},{type:Za.Int,value:e.w},{type:Za.Int,value:e.h},{type:Za.UInt,value:e.parentId},{type:Za.UInt,value:e.menuId}]))},destroyWindow(e){s(es(Ka.Cmd_DestroyWindow,[{type:Za.UInt,value:e}]))},setWindowText(e,t){s(es(Ka.Cmd_SetWindowText,[{type:Za.UInt,value:e},{type:Za.String,value:t}]))},getWindowText:e=>new Promise((t=>{const n=u();p.set(n,(e=>{e.type===$a.Res_CmdOutputLong&&t(Ja.decode(e.data).split("\0")[0])})),s(es(Ka.Cmd_GetWindowText,[{type:Za.UInt,value:e},{type:Za.UInt,value:n}]))})),extractIcon:(e,t)=>new Promise((n=>{const o=u();p.set(o,(o=>{o.type===$a.Res_CmdOutputHandle&&(console.timeEnd("extractIcon"+e+t),n(o.handle))})),console.time("extractIcon"+e+t),s(es(Ka.Cmd_ExtractIcon,[{type:Za.UInt,value:o},{type:Za.String,value:e},{type:Za.UInt,value:t}]))})),destroyIcon(e){s(es(Ka.Cmd_DestroyIcon,[{type:Za.UInt,value:e}]))},sendMessage:(e,t,n,o)=>new Promise((r=>{const i=u();p.set(i,(e=>{e.type===$a.Res_CmdOutputHandle&&r(e.handle)})),s(es(Ka.Cmd_SendMessage,[{type:Za.UInt,value:e},{type:Za.UInt,value:t},{type:Za.UInt,value:n},{type:Za.Int,value:o},{type:Za.UInt,value:i}]))})),setWindowLong(e,t,n){s(es(Ka.Cmd_SetWindowLong,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.UInt,value:n}]))},getWindowLong:(e,t)=>new Promise((n=>{const o=u();p.set(o,(e=>{e.type===$a.Res_CmdOutputHandle&&n(e.handle)})),s(es(Ka.Cmd_GetWindowLong,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.UInt,value:o}]))})),createFont(e){const t=c.find((t=>t.lfWidth===e.lfWidth&&t.lfHeight===e.lfHeight&&t.lfWeight===e.lfWeight&&t.lfItalic===e.lfItalic&&t.lfUnderline===e.lfUnderline&&t.lfStrikeOut===e.lfStrikeOut&&t.lfFaceName===e.lfFaceName));return t?t.handle:new Promise((t=>{const n=u();p.set(n,(n=>{n.type===$a.Res_CmdOutputHandle&&(c.push({...e,handle:n.handle}),t(n.handle))})),s(es(Ka.Cmd_CreateFont,[{type:Za.UInt,value:n},{type:Za.Int,value:e.lfWidth},{type:Za.Int,value:e.lfHeight},{type:Za.Int,value:e.lfWeight},{type:Za.Int,value:e.lfItalic},{type:Za.Int,value:e.lfUnderline},{type:Za.Int,value:e.lfStrikeOut},...e.lfFaceName?[{type:Za.String,value:e.lfFaceName}]:[]]))}))},deleteObject(e){s(es(Ka.Cmd_DeleteObject,[{type:Za.UInt,value:e}]))},showWindow(e,t){s(es(Ka.Cmd_ShowWindow,[{type:Za.UInt,value:e},{type:Za.Int,value:t}]))},sendMouseEvent(e,t){e?0===t?s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:2}])):2===t&&s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:8}])):0===t?s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:4}])):2===t&&s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:16}]))}};return setInterval((()=>{s(es(Ka.Cmd_Ping,[]))}),2e3),{state:a,api:m}}!function(e){e[e.Cmd_Invalid=0]="Cmd_Invalid",e[e.Cmd_SetCursorPos=1]="Cmd_SetCursorPos",e[e.Cmd_MouseEvent=2]="Cmd_MouseEvent",e[e.Cmd_SetWindowPos=3]="Cmd_SetWindowPos",e[e.Cmd_CreateWindow=4]="Cmd_CreateWindow",e[e.Cmd_DestroyWindow=5]="Cmd_DestroyWindow",e[e.Cmd_SetWindowText=6]="Cmd_SetWindowText",e[e.Cmd_GetWindowText=7]="Cmd_GetWindowText",e[e.Cmd_MessageBoxEx=8]="Cmd_MessageBoxEx",e[e.Cmd_Ping=9]="Cmd_Ping",e[e.Cmd_ExtractIcon=10]="Cmd_ExtractIcon",e[e.Cmd_DestroyIcon=11]="Cmd_DestroyIcon",e[e.Cmd_SendMessage=12]="Cmd_SendMessage",e[e.Cmd_SetWindowLong=13]="Cmd_SetWindowLong",e[e.Cmd_GetWindowLong=14]="Cmd_GetWindowLong",e[e.Cmd_CreateFont=15]="Cmd_CreateFont",e[e.Cmd_DeleteObject=16]="Cmd_DeleteObject",e[e.Cmd_ShowWindow=17]="Cmd_ShowWindow"}(Ka||(Ka={})),function(e){e[e.Null=0]="Null",e[e.Int=1]="Int",e[e.UInt=2]="UInt",e[e.Float=3]="Float",e[e.String=4]="String"}(Za||(Za={})),function(e){e[e.Res_Invalid=0]="Res_Invalid",e[e.Res_Ping=1]="Res_Ping",e[e.Res_WinProc=2]="Res_WinProc",e[e.Res_CmdOutputHandle=3]="Res_CmdOutputHandle",e[e.Res_CmdOutputLong=4]="Res_CmdOutputLong"}($a||($a={}));let ns=3;async function os(e,t){if("w95Window"===t.type){const o=void 0!==t.props.menuId?t.props.menuId:t.id||0;var n;if(t.root.api.createWindow({id:t.id,type:t.props.windowType,text:t.props.text||"",params:t.props.params,x:t.props.x,y:t.props.y,w:t.props.w,h:t.props.h,parentId:"w95Window"===e.type?e.id:0,menuId:o,extStyle:t.props.extStyle||0}),t.props.onEvent)t.root.events.get(o)||t.root.events.set(o,[]),null==(n=t.root.events.get(o))||n.push(t.props.onEvent)}if("w95Font"===t.type&&"w95Window"===e.type){const n=await t.root.api.createFont({lfWidth:t.props.width||0,lfHeight:t.props.height||0,lfWeight:t.props.weight||0,lfItalic:t.props.italic?1:0,lfUnderline:t.props.underline?1:0,lfStrikeOut:t.props.strikeOut?1:0,lfFaceName:t.props.faceName});await t.root.api.sendMessage(e.id,48,n,1)}}function rs(e,t){if("w95Window"===t.type){if(t.props.onEvent){const e=t.root.events.get(t.id);if(e){const n=e.filter((e=>e!==t.props.onEvent));n.length>0?t.root.events.set(t.id,n):t.root.events.delete(t.id)}}t.root.api.destroyWindow(t.id)}}const is=u({getPublicInstance:e=>e,getRootHostContext:()=>({}),getChildHostContext:()=>({}),prepareForCommit:()=>null,resetAfterCommit:()=>({}),scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,now:p,isPrimaryRenderer:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,preparePortalMount:()=>{},hideInstance:()=>{},hideTextInstance:()=>{},unhideInstance:()=>{},unhideTextInstance:()=>{},clearContainer:()=>!1,createInstance(e,t,n){let{type:o,...r}=t;if("w95Window"===e)return{type:e,props:{windowType:o,...r},id:ns++,root:n.root};if("w95Font"===e)return{type:e,props:r,root:n.root};throw new Error("Unknown type!")},createTextInstance:e=>({type:"text",content:e}),appendInitialChild(e,t){"text"===t.type&&"w95Window"===e.type?e.props.text=t.content:(e.children=e.children||[],e.children.push(t))},finalizeInitialChildren:(e,t,n)=>!1,prepareUpdate:(e,t,n,o)=>!0,shouldSetTextContent:(e,t)=>!1,appendChild:os,appendChildToContainer:function e(t,n){var o;os(t,n),null==(o=n.children)||o.forEach((t=>e(n,t)))},commitTextUpdate(e,t,n){},commitMount:e=>console.log("commitMount",e),commitUpdate(e,t,n,o,r,i){"w95Window"===e.type&&("string"==typeof r.children&&r.children!==o.children?e.root.api.setWindowText(e.id,r.children):"string"==typeof r.text&&r.text!==o.text?e.root.api.setWindowText(e.id,r.text):r.x!==o.x||r.y!==o.y||r.w!==o.w||r.h!==o.h?e.root.api.setWindowPos(e.id,r.x,r.y,r.w,r.h):r.params!==o.params?e.root.api.setWindowLong(e.id,-16,r.params):"number"==typeof r.extStyle&&r.extStyle!==o.extStyle&&e.root.api.setWindowLong(e.id,-20,r.extStyle))},insertBefore:e=>console.log("insertBefore",e),insertInContainerBefore:(e,t,n)=>console.log("insertInContainerBefore",{parentInstance:e,child:t,beforeChild:n}),removeChild:rs,removeChildFromContainer:rs,resetTextContent:e=>console.log("resetTextContent",e)}),as=a(null),ss=new Map;function ls(){const e=n(as);if(!e)throw new Error("No context available!");return e}function ds(e,n,o,r){var i;const a=ss.get(n);let s=null==a?void 0:a.root;const l=(null==a?void 0:a.state)||{state:null,api:null,type:"root",root:null,id:0,events:new Map};if(l.root=l,!s){const i=ts(n,{onReady:()=>{null==o.onReady||o.onReady(),is.updateContainer(t.createElement(as.Provider,{value:l},e),s,null,(()=>{}))},onEvent:e=>{if(e.type===$a.Res_WinProc){const t=c(e.wParam),n=l.events.get(t);n&&n.forEach((t=>t(e)))}}},r);Object.assign(l,i),s=is.createContainer(l,1,!1,null)}return ss.set(n,{root:s,state:l}),null!=(i=l.state)&&i.ready&&is.updateContainer(t.createElement(as.Provider,{value:l},e),s,null,(()=>{})),l}function us(e){const t=ss.get(e);if(!t)return;const{root:n}=t;is.updateContainer(null,n,null,(()=>{ss.delete(e)}))}const ps=o((function(n,o){let{children:a,style:s,onReady:l,binaries:d,...u}=n;const p=r(null),c=r(null);return i((()=>{c.current=ds(a,p.current,{onReady:l},d),"function"==typeof o?o(c.current):o&&(o.current=c.current)}),[a,l]),i((()=>{const e=p.current;return()=>us(e)}),[]),t.createElement("div",e({ref:p,onContextMenu:e=>e.preventDefault(),onMouseMove:function(e){if(!c.current||!c.current.api)return;const t=p.current.getBoundingClientRect();c.current.api.setMousePos(e.clientX-t.x,e.clientY-t.y)},onMouseDown:e=>c.current.api.sendMouseEvent(!0,e.button),onMouseUp:e=>c.current.api.sendMouseEvent(!1,e.button)},u),t.createElement("div",{style:{whiteSpace:"pre",font:"14px monospace",lineHeight:"14px",...s||{}}}),t.createElement("canvas",{style:{display:"none"}}))}));var cs=Object.freeze({__proto__:null});function ms(e){let{onClick:n,x:o,y:r,w:i,h:a,children:s}=e;return t.createElement("w95Window",{type:"Button",onEvent:e=>273===e.message&&n&&n(),params:1342177280,x:o,y:r,w:i,h:a},s)}function ys(e){let{title:n,x:o,y:i,w:a,h:d,children:u,params:p,open:c,onClose:m}=e;const y=r(),{api:w}=ls();s((()=>{var e;y.current&&w.showWindow(null==(e=y.current)?void 0:e.id,!1===c?0:1)}),[c]);const v=l((e=>{var t;e.type===$a.Res_WinProc&&16===e.message&&e.hwnd===(null==(t=y.current)?void 0:t.id)&&m&&m()}),[m]);return t.createElement("w95Window",{ref:y,type:"WindowsApp",text:n||"",params:void 0===p?13565952:p,menuId:0,x:void 0===o?2147483648:o,y:void 0===i?2147483648:i,w:a,h:d,onEvent:v},u)}function ws(e){let{onChange:n,x:o,y:i,w:a,h:s,children:d,params:u=0}=e;const p=r(),c=l((async(e,t)=>{if(p.current&&e.type===$a.Res_WinProc&&273===e.message&&768===m(e.wParam)&&n){const e=await t.api.getWindowText(p.current.id);n(e)}}),[n]);return t.createElement("w95Window",{ref:p,type:"Edit",params:1342177280|u,extStyle:512,x:o,y:i,w:a,h:s,onEvent:c},d)}function vs(e){let{x:n,y:o,w:r,h:i,children:a}=e;return t.createElement("w95Window",{type:"Static",params:1342177280,x:n,y:o,w:r,h:i},a)}function hs(e){let{iconId:n,iconFile:o="shell32.dll",x:i,y:a,w:l,h:d}=e;const{api:u}=ls(),p=r();return s((()=>{!async function(){const e=await u.extractIcon(o,n);e&&p.current&&u.sendMessage(p.current.id,368,e,0)}()}),[]),t.createElement("w95Window",{ref:p,type:"Static",params:1342177283,x:i,y:a,w:l,h:d})}function fs(e){let{value:n,onChange:o,x:i,y:a,w:d,h:u,children:p}=e;const{api:c}=ls(),m=r(),y=l((async e=>{if(m.current&&e.type===$a.Res_WinProc&&273===e.message){const e=await c.sendMessage(m.current.id,240,0,0);c.sendMessage(m.current.id,241,e?0:1,0),o&&o(0===e)}}),[o]);return s((()=>{m.current&&c.sendMessage(m.current.id,241,n?1:0,0)}),[n]),t.createElement("w95Window",{ref:m,type:"Button",onEvent:y,params:1342177282,x:i,y:a,w:d,h:u},p)}export{qi as BM_CLICK,Ai as BM_GETCHECK,zi as BM_GETIMAGE,Ni as BM_GETSTATE,Qi as BM_SETCHECK,Vi as BM_SETIMAGE,ji as BM_SETSTATE,Gi as BM_SETSTYLE,Pi as BN_CLICKED,Hi as BN_DBLCLK,Oi as BN_DISABLE,Fi as BN_DOUBLECLICKED,Ri as BN_HILITE,ki as BN_KILLFOCUS,Mi as BN_PAINT,Li as BN_PUSHED,Bi as BN_SETFOCUS,Ti as BN_UNHILITE,Di as BN_UNPUSHED,Yi as BST_CHECKED,Zi as BST_FOCUS,Ji as BST_INDETERMINATE,Ki as BST_PUSHED,Xi as BST_UNCHECKED,li as BS_3STATE,di as BS_AUTO3STATE,ai as BS_AUTOCHECKBOX,ci as BS_AUTORADIOBUTTON,hi as BS_BITMAP,_i as BS_BOTTOM,Ci as BS_CENTER,ii as BS_CHECKBOX,ri as BS_DEFPUSHBUTTON,bi as BS_FLAT,ui as BS_GROUPBOX,vi as BS_ICON,fi as BS_LEFT,yi as BS_LEFTTEXT,Ui as BS_MULTILINE,Si as BS_NOTIFY,mi as BS_OWNERDRAW,oi as BS_PUSHBUTTON,Wi as BS_PUSHLIKE,si as BS_RADIOBUTTON,gi as BS_RIGHT,Ei as BS_RIGHTBUTTON,wi as BS_TEXT,Ii as BS_TOP,pi as BS_USERBUTTON,xi as BS_VCENTER,ms as Button,ko as CW_USEDEFAULT,fs as Checkbox,Ka as CommandType,Aa as DWL_DLGPROC,ka as DWL_MSGRESULT,Qa as DWL_USER,Za as DataType,lr as EC_LEFTMARGIN,dr as EC_RIGHTMARGIN,ur as EC_USEFONTINFO,mr as EIMES_CANCELCOMPSTRINFOCUS,yr as EIMES_COMPLETECOMPSTRKILLFOCUS,cr as EIMES_GETCOMPSTRATONCE,pr as EMSIS_COMPOSITIONSTRING,Fr as EM_CANUNDO,Kr as EM_CHARFROMPOS,Ar as EM_EMPTYUNDOBUFFER,Dr as EM_FMTLINES,Qr as EM_GETFIRSTVISIBLELINE,Er as EM_GETHANDLE,$r as EM_GETIMESTATUS,Yr as EM_GETLIMITTEXT,Tr as EM_GETLINE,Ur as EM_GETLINECOUNT,Vr as EM_GETMARGINS,xr as EM_GETMODIFY,qr as EM_GETPASSWORDCHAR,hr as EM_GETRECT,wr as EM_GETSEL,Pr as EM_GETTHUMB,Gr as EM_GETWORDBREAKPROC,Or as EM_LIMITTEXT,Hr as EM_LINEFROMCHAR,Sr as EM_LINEINDEX,Mr as EM_LINELENGTH,Ir as EM_LINESCROLL,Jr as EM_POSFROMCHAR,Rr as EM_REPLACESEL,Cr as EM_SCROLL,_r as EM_SCROLLCARET,br as EM_SETHANDLE,Zr as EM_SETIMESTATUS,Xr as EM_SETLIMITTEXT,zr as EM_SETMARGINS,Wr as EM_SETMODIFY,kr as EM_SETPASSWORDCHAR,Nr as EM_SETREADONLY,fr as EM_SETRECT,gr as EM_SETRECTNP,vr as EM_SETSEL,Br as EM_SETTABSTOPS,jr as EM_SETWORDBREAKPROC,Lr as EM_UNDO,nr as EN_CHANGE,rr as EN_ERRSPACE,ar as EN_HSCROLL,tr as EN_KILLFOCUS,ir as EN_MAXTEXT,er as EN_SETFOCUS,or as EN_UPDATE,sr as EN_VSCROLL,Xo as ES_AUTOHSCROLL,Vo as ES_AUTOVSCROLL,Qo as ES_CENTER,Ao as ES_LEFT,qo as ES_LOWERCASE,jo as ES_MULTILINE,Yo as ES_NOHIDESEL,$o as ES_NUMBER,Jo as ES_OEMCONVERT,zo as ES_PASSWORD,Ko as ES_READONLY,No as ES_RIGHT,Go as ES_UPPERCASE,Zo as ES_WANTRETURN,ws as Edit,za as GWL_EXSTYLE,ja as GWL_HINSTANCE,Ga as GWL_HWNDPARENT,Xa as GWL_ID,qa as GWL_STYLE,Va as GWL_USERDATA,Na as GWL_WNDPROC,w as HIBYTE,m as HIWORD,hs as Icon,y as LOBYTE,c as LOWORD,vs as Label,cs as React95Fiber,$a as ResponseType,ma as SS_BITMAP,aa as SS_BLACKFRAME,oa as SS_BLACKRECT,ea as SS_CENTER,Ia as SS_CENTERIMAGE,Ea as SS_ELLIPSISMASK,Ua as SS_ENDELLIPSIS,ya as SS_ENHMETAFILE,ha as SS_ETCHEDFRAME,wa as SS_ETCHEDHORZ,va as SS_ETCHEDVERT,sa as SS_GRAYFRAME,ra as SS_GRAYRECT,na as SS_ICON,$i as SS_LEFT,pa as SS_LEFTNOWORDWRAP,ga as SS_NOPREFIX,Ca as SS_NOTIFY,ca as SS_OWNERDRAW,Sa as SS_PATHELLIPSIS,xa as SS_REALSIZEIMAGE,ta as SS_RIGHT,_a as SS_RIGHTJUST,ua as SS_SIMPLE,Wa as SS_SUNKEN,fa as SS_TYPEMASK,da as SS_USERITEM,la as SS_WHITEFRAME,ia as SS_WHITERECT,ba as SS_WORDELLIPSIS,Ma as STM_GETICON,Ta as STM_GETIMAGE,Ha as STM_MSGMAX,Pa as STM_SETICON,Ra as STM_SETIMAGE,Oa as STN_CLICKED,Fa as STN_DBLCLK,Da as STN_DISABLE,La as STN_ENABLE,ni as WB_ISDELIMITER,ei as WB_LEFT,ti as WB_RIGHT,Ba as WC_DIALOG,G as WM_ACTIVATE,q as WM_ACTIVATEAPP,z as WM_AFXFIRST,V as WM_AFXLAST,j as WM_APP,X as WM_ASKCBFORMATNAME,Y as WM_CANCELJOURNAL,J as WM_CANCELMODE,K as WM_CAPTURECHANGED,Z as WM_CHANGECBCHAIN,$ as WM_CHAR,ee as WM_CHARTOITEM,te as WM_CHILDACTIVATE,ne as WM_CLEAR,oe as WM_CLOSE,re as WM_COMMAND,ie as WM_COMMNOTIFY,ae as WM_COMPACTING,se as WM_COMPAREITEM,le as WM_CONTEXTMENU,de as WM_COPY,ue as WM_COPYDATA,pe as WM_CREATE,ce as WM_CTLCOLORBTN,me as WM_CTLCOLORDLG,ye as WM_CTLCOLOREDIT,we as WM_CTLCOLORLISTBOX,ve as WM_CTLCOLORMSGBOX,he as WM_CTLCOLORSCROLLBAR,fe as WM_CTLCOLORSTATIC,ge as WM_CUT,Ce as WM_DEADCHAR,Ie as WM_DELETEITEM,_e as WM_DESTROY,xe as WM_DESTROYCLIPBOARD,We as WM_DEVICECHANGE,Ue as WM_DEVMODECHANGE,Se as WM_DISPLAYCHANGE,be as WM_DRAWCLIPBOARD,Ee as WM_DRAWITEM,Pe as WM_DROPFILES,Me as WM_ENABLE,Re as WM_ENDSESSION,Te as WM_ENTERIDLE,Oe as WM_ENTERMENULOOP,Fe as WM_ENTERSIZEMOVE,Le as WM_ERASEBKGND,De as WM_EXITMENULOOP,He as WM_EXITSIZEMOVE,Be as WM_FONTCHANGE,ke as WM_GETDLGCODE,Ae as WM_GETFONT,Qe as WM_GETHOTKEY,Ne as WM_GETICON,je as WM_GETMINMAXINFO,Ge as WM_GETTEXT,qe as WM_GETTEXTLENGTH,ze as WM_HANDHELDFIRST,Ve as WM_HANDHELDLAST,Xe as WM_HELP,Ye as WM_HOTKEY,Je as WM_HSCROLL,Ke as WM_HSCROLLCLIPBOARD,Ze as WM_ICONERASEBKGND,$e as WM_INITDIALOG,et as WM_INITMENU,tt as WM_INITMENUPOPUP,nt as WM_INPUTLANGCHANGE,ot as WM_INPUTLANGCHANGEREQUEST,rt as WM_KEYDOWN,Zn as WM_KEYFIRST,$n as WM_KEYLAST,it as WM_KEYUP,at as WM_KILLFOCUS,io as WM_LBUTTONDBLCLK,oo as WM_LBUTTONDOWN,ro as WM_LBUTTONUP,co as WM_MBUTTONDBLCLK,uo as WM_MBUTTONDOWN,po as WM_MBUTTONUP,st as WM_MDIACTIVATE,lt as WM_MDICASCADE,dt as WM_MDICREATE,ut as WM_MDIDESTROY,pt as WM_MDIGETACTIVE,ct as WM_MDIICONARRANGE,mt as WM_MDIMAXIMIZE,yt as WM_MDINEXT,wt as WM_MDIREFRESHMENU,vt as WM_MDIRESTORE,ht as WM_MDISETMENU,ft as WM_MDITILE,gt as WM_MEASUREITEM,Ut as WM_MENUCHAR,_t as WM_MENUCOMMAND,Wt as WM_MENUDRAG,xt as WM_MENUGETOBJECT,It as WM_MENURBUTTONUP,St as WM_MENUSELECT,to as WM_MOUSEACTIVATE,yo as WM_MOUSEFIRST,vo as WM_MOUSEHOVER,wo as WM_MOUSELAST,ho as WM_MOUSELEAVE,no as WM_MOUSEMOVE,mo as WM_MOUSEWHEEL,Et as WM_MOVE,Pt as WM_MOVING,Mt as WM_NCACTIVATE,Rt as WM_NCCALCSIZE,Tt as WM_NCCREATE,Ot as WM_NCDESTROY,Ft as WM_NCHITTEST,Lt as WM_NCLBUTTONDBLCLK,Dt as WM_NCLBUTTONDOWN,Ht as WM_NCLBUTTONUP,Bt as WM_NCMBUTTONDBLCLK,kt as WM_NCMBUTTONDOWN,At as WM_NCMBUTTONUP,Qt as WM_NCMOUSEMOVE,Nt as WM_NCPAINT,jt as WM_NCRBUTTONDBLCLK,Gt as WM_NCRBUTTONDOWN,qt as WM_NCRBUTTONUP,zt as WM_NEXTDLGCTL,bt as WM_NEXTMENU,Vt as WM_NOTIFY,Xt as WM_NOTIFYFORMAT,Yt as WM_NULL,Jt as WM_PAINT,Kt as WM_PAINTCLIPBOARD,Zt as WM_PAINTICON,$t as WM_PALETTECHANGED,en as WM_PALETTEISCHANGING,tn as WM_PARENTNOTIFY,nn as WM_PASTE,on as WM_PENWINFIRST,rn as WM_PENWINLAST,an as WM_POWER,sn as WM_POWERBROADCAST,ln as WM_PRINT,dn as WM_PRINTCLIENT,un as WM_QUERYDRAGICON,pn as WM_QUERYENDSESSION,cn as WM_QUERYNEWPALETTE,mn as WM_QUERYOPEN,yn as WM_QUEUESYNC,wn as WM_QUIT,lo as WM_RBUTTONDBLCLK,ao as WM_RBUTTONDOWN,so as WM_RBUTTONUP,vn as WM_RENDERALLFORMATS,hn as WM_RENDERFORMAT,fn as WM_SETCURSOR,gn as WM_SETFOCUS,Cn as WM_SETFONT,In as WM_SETHOTKEY,_n as WM_SETICON,xn as WM_SETREDRAW,Wn as WM_SETTEXT,Un as WM_SETTINGCHANGE,Sn as WM_SHOWWINDOW,bn as WM_SIZE,En as WM_SIZECLIPBOARD,Pn as WM_SIZING,Mn as WM_SPOOLERSTATUS,Rn as WM_STYLECHANGED,Tn as WM_STYLECHANGING,eo as WM_SYNCPAINT,On as WM_SYSCHAR,Fn as WM_SYSCOLORCHANGE,Ln as WM_SYSCOMMAND,Dn as WM_SYSDEADCHAR,Hn as WM_SYSKEYDOWN,Bn as WM_SYSKEYUP,kn as WM_TCARD,An as WM_THEMECHANGED,Qn as WM_TIMECHANGE,Nn as WM_TIMER,jn as WM_UNDO,Ct as WM_UNINITMENUPOPUP,Gn as WM_USER,qn as WM_USERCHANGED,zn as WM_VKEYTOITEM,Vn as WM_VSCROLL,Xn as WM_VSCROLLCLIPBOARD,Yn as WM_WINDOWPOSCHANGED,Jn as WM_WINDOWPOSCHANGING,Kn as WM_WININICHANGE,v as WS_BORDER,h as WS_CAPTION,f as WS_CHILD,g as WS_CHILDWINDOW,C as WS_CLIPCHILDREN,I as WS_CLIPSIBLINGS,_ as WS_DISABLED,x as WS_DLGFRAME,fo as WS_EX_ACCEPTFILES,go as WS_EX_APPWINDOW,Co as WS_EX_CLIENTEDGE,Io as WS_EX_CONTEXTHELP,_o as WS_EX_CONTROLPARENT,xo as WS_EX_DLGMODALFRAME,Wo as WS_EX_LEFT,Uo as WS_EX_LEFTSCROLLBAR,So as WS_EX_LTRREADING,bo as WS_EX_MDICHILD,Eo as WS_EX_NOPARENTNOTIFY,Po as WS_EX_OVERLAPPEDWINDOW,Mo as WS_EX_PALETTEWINDOW,Ro as WS_EX_RIGHT,To as WS_EX_RIGHTSCROLLBAR,Oo as WS_EX_RTLREADING,Fo as WS_EX_STATICEDGE,Lo as WS_EX_TOOLWINDOW,Do as WS_EX_TOPMOST,Ho as WS_EX_TRANSPARENT,Bo as WS_EX_WINDOWEDGE,W as WS_GROUP,U as WS_HSCROLL,S as WS_ICONIC,b as WS_MAXIMIZE,E as WS_MAXIMIZEBOX,P as WS_MINIMIZE,M as WS_MINIMIZEBOX,R as WS_OVERLAPPED,Q as WS_OVERLAPPEDWINDOW,T as WS_POPUP,N as WS_POPUPWINDOW,O as WS_SIZEBOX,F as WS_SYSMENU,L as WS_TABSTOP,D as WS_THICKFRAME,H as WS_TILED,B as WS_TILEDWINDOW,k as WS_VISIBLE,A as WS_VSCROLL,ps as Win95,ys as Window,ts as initEmulator,ds as render,us as unmountComponentAtNode,ls as useWin95};
import e from"@babel/runtime/helpers/esm/extends";import t,{useContext as n,forwardRef as o,useRef as r,useLayoutEffect as i,createContext as a,useEffect as s,useCallback as d}from"react";import{V86Starter as l}from"v86";import u from"react-reconciler";import{unstable_now as p}from"scheduler";const c=e=>65535&e,y=e=>e>>16&65535,m=e=>255&e,w=e=>e>>8&255,v=8388608,h=12582912,f=1073741824,g=1073741824,C=33554432,_=67108864,I=134217728,x=4194304,W=131072,U=1048576,S=536870912,b=16777216,E=65536,P=536870912,M=131072,R=0,T=2147483648,O=262144,F=524288,L=65536,D=262144,H=0,A=13565952,k=268435456,N=2097152,B=13565952,Q=-2138570752,j=32768,G=6,q=28,z=864,V=895,X=780,Y=75,J=31,K=533,Z=781,$=258,ee=47,te=34,ne=771,oe=16,re=273,ie=68,ae=65,se=57,de=123,le=769,ue=74,pe=1,ce=309,ye=310,me=307,we=308,ve=306,he=311,fe=312,ge=768,Ce=259,_e=45,Ie=2,xe=775,We=537,Ue=27,Se=126,be=776,Ee=43,Pe=563,Me=10,Re=22,Te=289,Oe=529,Fe=561,Le=20,De=530,He=562,Ae=29,ke=135,Ne=49,Be=51,Qe=127,je=36,Ge=13,qe=14,ze=856,Ve=863,Xe=83,Ye=786,Je=276,Ke=782,Ze=39,$e=272,et=278,tt=279,nt=81,ot=80,rt=256,it=257,at=8,st=546,dt=551,lt=544,ut=545,pt=553,ct=552,yt=549,mt=548,wt=564,vt=547,ht=560,ft=550,gt=44,Ct=293,_t=290,It=294,xt=292,Wt=291,Ut=288,St=287,bt=531,Et=3,Pt=534,Mt=134,Rt=131,Tt=129,Ot=130,Ft=132,Lt=163,Dt=161,Ht=162,At=169,kt=167,Nt=168,Bt=160,Qt=133,jt=166,Gt=164,qt=165,zt=40,Vt=78,Xt=85,Yt=0,Jt=15,Kt=777,Zt=38,$t=785,en=784,tn=528,nn=770,on=896,rn=911,an=72,sn=536,dn=791,ln=792,un=55,pn=17,cn=783,yn=19,mn=35,wn=18,vn=774,hn=773,fn=32,gn=7,Cn=48,_n=50,In=128,xn=11,Wn=12,Un=26,Sn=24,bn=5,En=779,Pn=532,Mn=42,Rn=125,Tn=124,On=262,Fn=21,Ln=274,Dn=263,Hn=260,An=261,kn=82,Nn=794,Bn=30,Qn=275,jn=772,Gn=1024,qn=84,zn=46,Vn=277,Xn=778,Yn=71,Jn=70,Kn=26,Zn=256,$n=264,eo=136,to=33,no=512,oo=513,ro=514,io=515,ao=516,so=517,lo=518,uo=519,po=520,co=521,yo=522,mo=512,wo=522,vo=673,ho=675,fo=16,go=262144,Co=512,_o=1024,Io=65536,xo=1,Wo=0,Uo=16384,So=0,bo=64,Eo=4,Po=768,Mo=392,Ro=4096,To=0,Oo=8192,Fo=131072,Lo=128,Do=8,Ho=32,Ao=256,ko=2147483648,No=0,Bo=1,Qo=2,jo=4,Go=8,qo=16,zo=32,Vo=64,Xo=128,Yo=256,Jo=1024,Ko=2048,Zo=4096,$o=8192,er=256,tr=512,nr=768,or=1024,rr=1280,ir=1281,ar=1537,sr=1538,dr=1,lr=2,ur=65535,pr=1,cr=1,yr=2,mr=4,wr=176,vr=177,hr=178,fr=179,gr=180,Cr=181,_r=182,Ir=183,xr=184,Wr=185,Ur=186,Sr=187,br=188,Er=189,Pr=190,Mr=193,Rr=194,Tr=196,Or=197,Fr=198,Lr=199,Dr=200,Hr=201,Ar=203,kr=204,Nr=205,Br=206,Qr=207,jr=208,Gr=209,qr=210,zr=211,Vr=212,Xr=197,Yr=213,Jr=214,Kr=215,Zr=216,$r=217,ei=0,ti=1,ni=2,oi=0,ri=1,ii=2,ai=3,si=4,di=5,li=6,ui=7,pi=8,ci=9,yi=11,mi=32,wi=0,vi=64,hi=128,fi=256,gi=512,Ci=768,_i=1024,Ii=2048,xi=3072,Wi=4096,Ui=8192,Si=16384,bi=32768,Ei=32,Pi=0,Mi=1,Ri=2,Ti=3,Oi=4,Fi=5,Li=2,Di=3,Hi=5,Ai=6,ki=7,Ni=240,Bi=241,Qi=242,ji=243,Gi=244,qi=245,zi=246,Vi=247,Xi=0,Yi=1,Ji=2,Ki=4,Zi=8,$i=0,ea=1,ta=2,na=3,oa=4,ra=5,ia=6,aa=7,sa=8,da=9,la=10,ua=11,pa=12,ca=13,ya=14,ma=15,wa=16,va=17,ha=18,fa=31,ga=128,Ca=256,_a=512,Ia=1024,xa=2048,Wa=4096,Ua=16384,Sa=32768,ba=49152,Ea=49152,Pa=368,Ma=369,Ra=370,Ta=371,Oa=0,Fa=1,La=2,Da=3,Ha=372,Aa=32770,ka=0,Na=4,Ba=8,Qa=-4,ja=-6,Ga=-8,qa=-16,za=-20,Va=-21,Xa=-12;class Ya{constructor(e,t){this.outQueue=[],this.inQueue=[],e.io.register_write(1284,this,(()=>console.warn("Invalid 8 bit write!")),(()=>console.warn("Invalid 16 bit write!")),(e=>{const n=255&e;e>>8>0?this.inQueue.push(n):this.inQueue.length>0&&(t(new Uint8ClampedArray(this.inQueue).buffer),this.inQueue=[])})),e.io.register_read(1280,this,(()=>(console.warn("Invalid 8 bit read!"),0)),(()=>(console.warn("Invalid 16 bit read!"),0)),(()=>{var e;const t=(null==(e=this.outQueue[0])?void 0:e.length)>0&&this.outQueue[0]||this.outQueue.shift();if(!t)return 0;const n=t.shift();return void 0===n?0:n|t.length+1<<8}))}sendData(e){const t=new Uint8ClampedArray(e);this.outQueue.push(Array.from(t))}}new TextEncoder;const Ja=new TextDecoder;let Ka,Za,$a;function es(e,t){const n=t.map((e=>4+(e.type===Za.String?e.value.length+1+4:4))).reduce(((e,t)=>e+t),0),o=new ArrayBuffer(12+n),r=new DataView(o);r.setUint32(0,49325,!0),r.setUint32(4,e,!0),r.setUint32(8,t.length,!0);let i=o.byteLength;for(let e=0;e<t.length;e++){const n=t[e];if(r.setUint32(12+8*e,n.type,!0),n.type===Za.Int)r.setInt32(12+8*e+4,n.value,!0);else if(n.type===Za.UInt)r.setUint32(12+8*e+4,n.value,!0);else if(n.type===Za.Float)r.setFloat32(12+8*e+4,n.value,!0);else if(n.type===Za.String){const t=n.value;i--,r.setUint8(i,0);for(let e=t.length-1;e>=0;e--)i--,r.setUint8(i,t.charCodeAt(e));r.setUint32(12+8*e+4,i,!0)}}return o}function ts(e,t,n,o){void 0===o&&(o={scale:.5,fromState:!1});const r=new l({screen_container:e,wasm_fn:n.v86WASM?(i=n.v86WASM,async e=>(await WebAssembly.instantiate(i,e)).instance.exports):n.v86WASMFn,bios:n.seabios?{buffer:n.seabios}:{url:n.seabiosUrl},vga_bios:n.vgabios?{buffer:n.vgabios}:{url:n.vgabiosUrl},hda:n.osImg?{buffer:n.osImg}:{url:n.osImgUrl},boot_order:306,memory_size:33554432,disable_mouse:!0,autostart:o.fromState||!0});var i;window.emulator=r,r.add_listener("emulator-started",(()=>{r.v86.cpu.devices.commBus=new Ya(r.v86.cpu,(e=>{const n=function(e){if(e.byteLength<4)return null;const t=new DataView(e),n=t.getUint32(0,!0);return n===$a.Res_WinProc?20!==e.byteLength?null:{type:n,hwnd:t.getUint32(4,!0),message:t.getUint32(8,!0),wParam:t.getUint32(12,!0),lParam:t.getInt32(16,!0)}:n===$a.Res_CmdOutputHandle?12!==e.byteLength?null:{type:n,seq:t.getUint32(4,!0),handle:t.getUint32(8,!0)}:n===$a.Res_CmdOutputLong?e.byteLength!==12+t.getUint32(8,!0)?null:{type:n,seq:t.getUint32(4,!0),length:t.getUint32(8,!0),data:e.slice(12)}:{type:n}}(e);if(n){var o;if(null==t.onEvent||t.onEvent(n),(n.type===$a.Res_CmdOutputHandle||n.type===$a.Res_CmdOutputLong)&&p.has(n.seq))null==(o=p.get(n.seq))||o(n),p.delete(n.seq);a.ready||(null==t.onReady||t.onReady(),a.ready=!0)}}))}));const a={v86Emulator:r,ready:!1};function s(e){const t=r.v86.cpu.devices.commBus;t&&t.sendData(e)}let d=0;function u(){const e=d;return d=d+1&16777215,e}const p=new Map,c=[],y={sendSerial:s,startBridge(){r.keyboard_send_scancodes([29,19]),r.keyboard_send_scancodes([157,147]),r.keyboard_send_text('"c:\\windows\\start menu\\Programs\\StartUp\\bridge.exe"'),r.keyboard_send_scancodes([28]),r.keyboard_send_scancodes([156])},setMousePos(e,t){a.ready&&s(es(Ka.Cmd_SetCursorPos,[{type:Za.Int,value:e},{type:Za.Int,value:t}]))},setWindowPos(e,t,n,o,r){s(es(Ka.Cmd_SetWindowPos,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.Int,value:n},{type:Za.Int,value:o},{type:Za.Int,value:r}]))},createWindow(e){s(es(Ka.Cmd_CreateWindow,[{type:Za.UInt,value:e.id},{type:Za.UInt,value:e.extStyle},{type:Za.String,value:e.type},{type:Za.String,value:e.text},{type:Za.UInt,value:e.params},{type:Za.Int,value:e.x},{type:Za.Int,value:e.y},{type:Za.Int,value:e.w},{type:Za.Int,value:e.h},{type:Za.UInt,value:e.parentId},{type:Za.UInt,value:e.menuId}]))},destroyWindow(e){s(es(Ka.Cmd_DestroyWindow,[{type:Za.UInt,value:e}]))},setWindowText(e,t){s(es(Ka.Cmd_SetWindowText,[{type:Za.UInt,value:e},{type:Za.String,value:t}]))},getWindowText:e=>new Promise((t=>{const n=u();p.set(n,(e=>{e.type===$a.Res_CmdOutputLong&&t(Ja.decode(e.data).split("\0")[0])})),s(es(Ka.Cmd_GetWindowText,[{type:Za.UInt,value:e},{type:Za.UInt,value:n}]))})),extractIcon:(e,t)=>new Promise((n=>{const o=u();p.set(o,(e=>{e.type===$a.Res_CmdOutputHandle&&n(e.handle)})),s(es(Ka.Cmd_ExtractIcon,[{type:Za.UInt,value:o},{type:Za.String,value:e},{type:Za.UInt,value:t}]))})),destroyIcon(e){s(es(Ka.Cmd_DestroyIcon,[{type:Za.UInt,value:e}]))},sendMessage:(e,t,n,o)=>new Promise((r=>{const i=u();p.set(i,(e=>{e.type===$a.Res_CmdOutputHandle&&r(e.handle)})),s(es(Ka.Cmd_SendMessage,[{type:Za.UInt,value:e},{type:Za.UInt,value:t},{type:Za.UInt,value:n},{type:Za.Int,value:o},{type:Za.UInt,value:i}]))})),setWindowLong(e,t,n){s(es(Ka.Cmd_SetWindowLong,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.UInt,value:n}]))},getWindowLong:(e,t)=>new Promise((n=>{const o=u();p.set(o,(e=>{e.type===$a.Res_CmdOutputHandle&&n(e.handle)})),s(es(Ka.Cmd_GetWindowLong,[{type:Za.UInt,value:e},{type:Za.Int,value:t},{type:Za.UInt,value:o}]))})),createFont(e){const t=c.find((t=>t.lfWidth===e.lfWidth&&t.lfHeight===e.lfHeight&&t.lfWeight===e.lfWeight&&t.lfItalic===e.lfItalic&&t.lfUnderline===e.lfUnderline&&t.lfStrikeOut===e.lfStrikeOut&&t.lfFaceName===e.lfFaceName));return t?t.handle:new Promise((t=>{const n=u();p.set(n,(n=>{n.type===$a.Res_CmdOutputHandle&&(c.push({...e,handle:n.handle}),t(n.handle))})),s(es(Ka.Cmd_CreateFont,[{type:Za.UInt,value:n},{type:Za.Int,value:e.lfWidth},{type:Za.Int,value:e.lfHeight},{type:Za.Int,value:e.lfWeight},{type:Za.Int,value:e.lfItalic},{type:Za.Int,value:e.lfUnderline},{type:Za.Int,value:e.lfStrikeOut},...e.lfFaceName?[{type:Za.String,value:e.lfFaceName}]:[]]))}))},deleteObject(e){s(es(Ka.Cmd_DeleteObject,[{type:Za.UInt,value:e}]))},showWindow(e,t){s(es(Ka.Cmd_ShowWindow,[{type:Za.UInt,value:e},{type:Za.Int,value:t}]))},sendMouseEvent(e,t){e?0===t?s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:2}])):2===t&&s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:8}])):0===t?s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:4}])):2===t&&s(es(Ka.Cmd_MouseEvent,[{type:Za.UInt,value:16}]))}};return setInterval((()=>{s(es(Ka.Cmd_Ping,[]))}),2e3),{state:a,api:y}}!function(e){e[e.Cmd_Invalid=0]="Cmd_Invalid",e[e.Cmd_SetCursorPos=1]="Cmd_SetCursorPos",e[e.Cmd_MouseEvent=2]="Cmd_MouseEvent",e[e.Cmd_SetWindowPos=3]="Cmd_SetWindowPos",e[e.Cmd_CreateWindow=4]="Cmd_CreateWindow",e[e.Cmd_DestroyWindow=5]="Cmd_DestroyWindow",e[e.Cmd_SetWindowText=6]="Cmd_SetWindowText",e[e.Cmd_GetWindowText=7]="Cmd_GetWindowText",e[e.Cmd_MessageBoxEx=8]="Cmd_MessageBoxEx",e[e.Cmd_Ping=9]="Cmd_Ping",e[e.Cmd_ExtractIcon=10]="Cmd_ExtractIcon",e[e.Cmd_DestroyIcon=11]="Cmd_DestroyIcon",e[e.Cmd_SendMessage=12]="Cmd_SendMessage",e[e.Cmd_SetWindowLong=13]="Cmd_SetWindowLong",e[e.Cmd_GetWindowLong=14]="Cmd_GetWindowLong",e[e.Cmd_CreateFont=15]="Cmd_CreateFont",e[e.Cmd_DeleteObject=16]="Cmd_DeleteObject",e[e.Cmd_ShowWindow=17]="Cmd_ShowWindow"}(Ka||(Ka={})),function(e){e[e.Null=0]="Null",e[e.Int=1]="Int",e[e.UInt=2]="UInt",e[e.Float=3]="Float",e[e.String=4]="String"}(Za||(Za={})),function(e){e[e.Res_Invalid=0]="Res_Invalid",e[e.Res_Ping=1]="Res_Ping",e[e.Res_WinProc=2]="Res_WinProc",e[e.Res_CmdOutputHandle=3]="Res_CmdOutputHandle",e[e.Res_CmdOutputLong=4]="Res_CmdOutputLong"}($a||($a={}));let ns=3;async function os(e,t){if("w95Window"===t.type){const o=void 0!==t.props.menuId?t.props.menuId:t.id||0;var n;if(t.root.api.createWindow({id:t.id,type:t.props.windowType,text:t.props.text||"",params:t.props.params,x:t.props.x,y:t.props.y,w:t.props.w,h:t.props.h,parentId:"w95Window"===e.type?e.id:0,menuId:o,extStyle:t.props.extStyle||0}),t.props.onEvent)t.root.events.get(o)||t.root.events.set(o,[]),null==(n=t.root.events.get(o))||n.push(t.props.onEvent)}if("w95Font"===t.type&&"w95Window"===e.type){const n=await t.root.api.createFont({lfWidth:t.props.width||0,lfHeight:t.props.height||0,lfWeight:t.props.weight||0,lfItalic:t.props.italic?1:0,lfUnderline:t.props.underline?1:0,lfStrikeOut:t.props.strikeOut?1:0,lfFaceName:t.props.faceName});await t.root.api.sendMessage(e.id,48,n,1)}}function rs(e,t){if("w95Window"===t.type){if(t.props.onEvent){const e=t.root.events.get(t.id);if(e){const n=e.filter((e=>e!==t.props.onEvent));n.length>0?t.root.events.set(t.id,n):t.root.events.delete(t.id)}}t.root.api.destroyWindow(t.id)}}const is=u({getPublicInstance:e=>e,getRootHostContext:()=>({}),getChildHostContext:()=>({}),prepareForCommit:()=>null,resetAfterCommit:()=>({}),scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,now:p,isPrimaryRenderer:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,preparePortalMount:()=>{},hideInstance:()=>{},hideTextInstance:()=>{},unhideInstance:()=>{},unhideTextInstance:()=>{},clearContainer:()=>!1,createInstance(e,t,n){let{type:o,...r}=t;if("w95Window"===e)return{type:e,props:{windowType:o,...r},id:ns++,root:n.root};if("w95Font"===e)return{type:e,props:r,root:n.root};throw new Error("Unknown type!")},createTextInstance:e=>({type:"text",content:e}),appendInitialChild(e,t){"text"===t.type&&"w95Window"===e.type?e.props.text=t.content:(e.children=e.children||[],e.children.push(t))},finalizeInitialChildren:(e,t,n)=>!1,prepareUpdate:(e,t,n,o)=>!0,shouldSetTextContent:(e,t)=>!1,appendChild:os,appendChildToContainer:function e(t,n){var o;os(t,n),null==(o=n.children)||o.forEach((t=>e(n,t)))},commitTextUpdate(e,t,n){},commitMount:e=>console.log("commitMount",e),commitUpdate(e,t,n,o,r,i){if("w95Window"===e.type){if("string"==typeof r.children&&r.children!==o.children)e.root.api.setWindowText(e.id,r.children);else if(Array.isArray(r.children)){const t=r.children.reduce(((e,t)=>e+("string"==typeof t?t:"")),"");t!==(Array.isArray(o.children)&&o.children.reduce(((e,t)=>e+typeof t=="string"?t:""),""))&&e.root.api.setWindowText(e.id,t)}"string"==typeof r.text&&r.text!==o.text&&e.root.api.setWindowText(e.id,r.text),r.x===o.x&&r.y===o.y&&r.w===o.w&&r.h===o.h||e.root.api.setWindowPos(e.id,r.x,r.y,r.w,r.h),r.params!==o.params&&e.root.api.setWindowLong(e.id,-16,r.params),"number"==typeof r.extStyle&&r.extStyle!==o.extStyle&&e.root.api.setWindowLong(e.id,-20,r.extStyle)}},insertBefore:os,insertInContainerBefore:os,removeChild:rs,removeChildFromContainer:rs,resetTextContent:e=>console.log("resetTextContent",e)});is.injectIntoDevTools({bundleType:"production"===process.env.NODE_ENV?0:1,rendererPackageName:"react-95-fiber",version:"0.0.1"});const as=a(null),ss=new Map;function ds(){const e=n(as);if(!e)throw new Error("No context available!");return e}function ls(e,n,o,r){var i;const a=ss.get(n);let s=null==a?void 0:a.root;const d=(null==a?void 0:a.state)||{state:null,api:null,type:"root",root:null,id:0,events:new Map};if(d.root=d,!s){const i=ts(n,{onReady:()=>{null==o.onReady||o.onReady(),is.updateContainer(t.createElement(as.Provider,{value:d},e),s,null,(()=>{}))},onEvent:e=>{if(e.type===$a.Res_WinProc){const t=c(e.wParam),n=d.events.get(t);n&&n.forEach((t=>t(e)))}}},r);Object.assign(d,i),s=is.createContainer(d,1,!1,null)}return ss.set(n,{root:s,state:d}),null!=(i=d.state)&&i.ready&&is.updateContainer(t.createElement(as.Provider,{value:d},e),s,null,(()=>{})),d}function us(e){const t=ss.get(e);if(!t)return;const{root:n,state:o}=t;o.state.v86Emulator.stop(),o.state.v86Emulator.destroy(),is.updateContainer(null,n,null,(()=>{ss.delete(e)}))}const ps=o((function(n,o){let{children:a,style:s,onReady:d,binaries:l,...u}=n;const p=r(null),c=r(null);return i((()=>{c.current=ls(a,p.current,{onReady:d},l),"function"==typeof o?o(c.current):o&&(o.current=c.current)}),[a,d]),i((()=>{const e=p.current;return()=>us(e)}),[]),t.createElement("div",e({ref:p,onContextMenu:e=>e.preventDefault(),onMouseMove:function(e){if(!c.current||!c.current.api)return;const t=p.current.getBoundingClientRect();c.current.api.setMousePos(e.clientX-t.x,e.clientY-t.y)},onMouseDown:e=>c.current.api.sendMouseEvent(!0,e.button),onMouseUp:e=>c.current.api.sendMouseEvent(!1,e.button)},u),t.createElement("div",{style:{whiteSpace:"pre",font:"14px monospace",lineHeight:"14px",...s||{}}}),t.createElement("canvas",{style:{display:"none"}}))}));var cs=Object.freeze({__proto__:null});function ys(e){let{onClick:n,x:o,y:r,w:i,h:a,children:s}=e;return t.createElement("w95Window",{type:"Button",onEvent:e=>273===e.message&&n&&n(),params:1342177280,x:o,y:r,w:i,h:a},s)}function ms(e){let{title:n,x:o,y:i,w:a,h:l,children:u,params:p,open:c,onClose:y}=e;const m=r(),{api:w}=ds();s((()=>{var e;m.current&&w.showWindow(null==(e=m.current)?void 0:e.id,!1===c?0:1)}),[c]);const v=d((e=>{var t;e.type===$a.Res_WinProc&&16===e.message&&e.hwnd===(null==(t=m.current)?void 0:t.id)&&y&&y()}),[y]);return t.createElement("w95Window",{ref:m,type:"WindowsApp",text:n||"",params:void 0===p?13565952:p,menuId:0,x:void 0===o?2147483648:o,y:void 0===i?2147483648:i,w:a,h:l,onEvent:v},u)}function ws(e){let{onChange:n,x:o,y:i,w:a,h:s,children:l,params:u=0}=e;const p=r(),c=d((async(e,t)=>{if(p.current&&e.type===$a.Res_WinProc&&273===e.message&&768===y(e.wParam)&&n){const e=await t.api.getWindowText(p.current.id);n(e)}}),[n]);return t.createElement("w95Window",{ref:p,type:"Edit",params:1342177280|u,extStyle:512,x:o,y:i,w:a,h:s,onEvent:c},l)}function vs(e){let{x:n,y:o,w:r,h:i,children:a}=e;return t.createElement("w95Window",{type:"Static",params:1342177280,x:n,y:o,w:r,h:i},a)}function hs(e){let{iconId:n,iconFile:o="shell32.dll",x:i,y:a,w:d,h:l}=e;const{api:u}=ds(),p=r();return s((()=>{!async function(){const e=await u.extractIcon(o,n);e&&p.current&&u.sendMessage(p.current.id,368,e,0)}()}),[]),t.createElement("w95Window",{ref:p,type:"Static",params:1342177283,x:i,y:a,w:d,h:l})}function fs(e){let{value:n,onChange:o,x:i,y:a,w:l,h:u,children:p}=e;const{api:c}=ds(),y=r(),m=d((async e=>{if(y.current&&e.type===$a.Res_WinProc&&273===e.message){const e=await c.sendMessage(y.current.id,240,0,0);c.sendMessage(y.current.id,241,e?0:1,0),o&&o(0===e)}}),[o]);return s((()=>{y.current&&c.sendMessage(y.current.id,241,n?1:0,0)}),[n]),t.createElement("w95Window",{ref:y,type:"Button",onEvent:m,params:1342177282,x:i,y:a,w:l,h:u},p)}export{qi as BM_CLICK,Ni as BM_GETCHECK,zi as BM_GETIMAGE,Qi as BM_GETSTATE,Bi as BM_SETCHECK,Vi as BM_SETIMAGE,ji as BM_SETSTATE,Gi as BM_SETSTYLE,Pi as BN_CLICKED,Hi as BN_DBLCLK,Oi as BN_DISABLE,Fi as BN_DOUBLECLICKED,Ri as BN_HILITE,ki as BN_KILLFOCUS,Mi as BN_PAINT,Li as BN_PUSHED,Ai as BN_SETFOCUS,Ti as BN_UNHILITE,Di as BN_UNPUSHED,Yi as BST_CHECKED,Zi as BST_FOCUS,Ji as BST_INDETERMINATE,Ki as BST_PUSHED,Xi as BST_UNCHECKED,di as BS_3STATE,li as BS_AUTO3STATE,ai as BS_AUTOCHECKBOX,ci as BS_AUTORADIOBUTTON,hi as BS_BITMAP,Ii as BS_BOTTOM,Ci as BS_CENTER,ii as BS_CHECKBOX,ri as BS_DEFPUSHBUTTON,bi as BS_FLAT,ui as BS_GROUPBOX,vi as BS_ICON,fi as BS_LEFT,mi as BS_LEFTTEXT,Ui as BS_MULTILINE,Si as BS_NOTIFY,yi as BS_OWNERDRAW,oi as BS_PUSHBUTTON,Wi as BS_PUSHLIKE,si as BS_RADIOBUTTON,gi as BS_RIGHT,Ei as BS_RIGHTBUTTON,wi as BS_TEXT,_i as BS_TOP,pi as BS_USERBUTTON,xi as BS_VCENTER,ys as Button,ko as CW_USEDEFAULT,fs as Checkbox,Ka as CommandType,Na as DWL_DLGPROC,ka as DWL_MSGRESULT,Ba as DWL_USER,Za as DataType,dr as EC_LEFTMARGIN,lr as EC_RIGHTMARGIN,ur as EC_USEFONTINFO,yr as EIMES_CANCELCOMPSTRINFOCUS,mr as EIMES_COMPLETECOMPSTRKILLFOCUS,cr as EIMES_GETCOMPSTRATONCE,pr as EMSIS_COMPOSITIONSTRING,Fr as EM_CANUNDO,Kr as EM_CHARFROMPOS,Nr as EM_EMPTYUNDOBUFFER,Dr as EM_FMTLINES,Br as EM_GETFIRSTVISIBLELINE,Er as EM_GETHANDLE,$r as EM_GETIMESTATUS,Yr as EM_GETLIMITTEXT,Tr as EM_GETLINE,Ur as EM_GETLINECOUNT,Vr as EM_GETMARGINS,xr as EM_GETMODIFY,qr as EM_GETPASSWORDCHAR,hr as EM_GETRECT,wr as EM_GETSEL,Pr as EM_GETTHUMB,Gr as EM_GETWORDBREAKPROC,Or as EM_LIMITTEXT,Hr as EM_LINEFROMCHAR,Sr as EM_LINEINDEX,Mr as EM_LINELENGTH,_r as EM_LINESCROLL,Jr as EM_POSFROMCHAR,Rr as EM_REPLACESEL,Cr as EM_SCROLL,Ir as EM_SCROLLCARET,br as EM_SETHANDLE,Zr as EM_SETIMESTATUS,Xr as EM_SETLIMITTEXT,zr as EM_SETMARGINS,Wr as EM_SETMODIFY,kr as EM_SETPASSWORDCHAR,Qr as EM_SETREADONLY,fr as EM_SETRECT,gr as EM_SETRECTNP,vr as EM_SETSEL,Ar as EM_SETTABSTOPS,jr as EM_SETWORDBREAKPROC,Lr as EM_UNDO,nr as EN_CHANGE,rr as EN_ERRSPACE,ar as EN_HSCROLL,tr as EN_KILLFOCUS,ir as EN_MAXTEXT,er as EN_SETFOCUS,or as EN_UPDATE,sr as EN_VSCROLL,Xo as ES_AUTOHSCROLL,Vo as ES_AUTOVSCROLL,Bo as ES_CENTER,No as ES_LEFT,qo as ES_LOWERCASE,jo as ES_MULTILINE,Yo as ES_NOHIDESEL,$o as ES_NUMBER,Jo as ES_OEMCONVERT,zo as ES_PASSWORD,Ko as ES_READONLY,Qo as ES_RIGHT,Go as ES_UPPERCASE,Zo as ES_WANTRETURN,ws as Edit,za as GWL_EXSTYLE,ja as GWL_HINSTANCE,Ga as GWL_HWNDPARENT,Xa as GWL_ID,qa as GWL_STYLE,Va as GWL_USERDATA,Qa as GWL_WNDPROC,w as HIBYTE,y as HIWORD,hs as Icon,m as LOBYTE,c as LOWORD,vs as Label,cs as React95Fiber,$a as ResponseType,ya as SS_BITMAP,aa as SS_BLACKFRAME,oa as SS_BLACKRECT,ea as SS_CENTER,_a as SS_CENTERIMAGE,Ea as SS_ELLIPSISMASK,Ua as SS_ENDELLIPSIS,ma as SS_ENHMETAFILE,ha as SS_ETCHEDFRAME,wa as SS_ETCHEDHORZ,va as SS_ETCHEDVERT,sa as SS_GRAYFRAME,ra as SS_GRAYRECT,na as SS_ICON,$i as SS_LEFT,pa as SS_LEFTNOWORDWRAP,ga as SS_NOPREFIX,Ca as SS_NOTIFY,ca as SS_OWNERDRAW,Sa as SS_PATHELLIPSIS,xa as SS_REALSIZEIMAGE,ta as SS_RIGHT,Ia as SS_RIGHTJUST,ua as SS_SIMPLE,Wa as SS_SUNKEN,fa as SS_TYPEMASK,la as SS_USERITEM,da as SS_WHITEFRAME,ia as SS_WHITERECT,ba as SS_WORDELLIPSIS,Ma as STM_GETICON,Ta as STM_GETIMAGE,Ha as STM_MSGMAX,Pa as STM_SETICON,Ra as STM_SETIMAGE,Oa as STN_CLICKED,Fa as STN_DBLCLK,Da as STN_DISABLE,La as STN_ENABLE,ni as WB_ISDELIMITER,ei as WB_LEFT,ti as WB_RIGHT,Aa as WC_DIALOG,G as WM_ACTIVATE,q as WM_ACTIVATEAPP,z as WM_AFXFIRST,V as WM_AFXLAST,j as WM_APP,X as WM_ASKCBFORMATNAME,Y as WM_CANCELJOURNAL,J as WM_CANCELMODE,K as WM_CAPTURECHANGED,Z as WM_CHANGECBCHAIN,$ as WM_CHAR,ee as WM_CHARTOITEM,te as WM_CHILDACTIVATE,ne as WM_CLEAR,oe as WM_CLOSE,re as WM_COMMAND,ie as WM_COMMNOTIFY,ae as WM_COMPACTING,se as WM_COMPAREITEM,de as WM_CONTEXTMENU,le as WM_COPY,ue as WM_COPYDATA,pe as WM_CREATE,ce as WM_CTLCOLORBTN,ye as WM_CTLCOLORDLG,me as WM_CTLCOLOREDIT,we as WM_CTLCOLORLISTBOX,ve as WM_CTLCOLORMSGBOX,he as WM_CTLCOLORSCROLLBAR,fe as WM_CTLCOLORSTATIC,ge as WM_CUT,Ce as WM_DEADCHAR,_e as WM_DELETEITEM,Ie as WM_DESTROY,xe as WM_DESTROYCLIPBOARD,We as WM_DEVICECHANGE,Ue as WM_DEVMODECHANGE,Se as WM_DISPLAYCHANGE,be as WM_DRAWCLIPBOARD,Ee as WM_DRAWITEM,Pe as WM_DROPFILES,Me as WM_ENABLE,Re as WM_ENDSESSION,Te as WM_ENTERIDLE,Oe as WM_ENTERMENULOOP,Fe as WM_ENTERSIZEMOVE,Le as WM_ERASEBKGND,De as WM_EXITMENULOOP,He as WM_EXITSIZEMOVE,Ae as WM_FONTCHANGE,ke as WM_GETDLGCODE,Ne as WM_GETFONT,Be as WM_GETHOTKEY,Qe as WM_GETICON,je as WM_GETMINMAXINFO,Ge as WM_GETTEXT,qe as WM_GETTEXTLENGTH,ze as WM_HANDHELDFIRST,Ve as WM_HANDHELDLAST,Xe as WM_HELP,Ye as WM_HOTKEY,Je as WM_HSCROLL,Ke as WM_HSCROLLCLIPBOARD,Ze as WM_ICONERASEBKGND,$e as WM_INITDIALOG,et as WM_INITMENU,tt as WM_INITMENUPOPUP,nt as WM_INPUTLANGCHANGE,ot as WM_INPUTLANGCHANGEREQUEST,rt as WM_KEYDOWN,Zn as WM_KEYFIRST,$n as WM_KEYLAST,it as WM_KEYUP,at as WM_KILLFOCUS,io as WM_LBUTTONDBLCLK,oo as WM_LBUTTONDOWN,ro as WM_LBUTTONUP,co as WM_MBUTTONDBLCLK,uo as WM_MBUTTONDOWN,po as WM_MBUTTONUP,st as WM_MDIACTIVATE,dt as WM_MDICASCADE,lt as WM_MDICREATE,ut as WM_MDIDESTROY,pt as WM_MDIGETACTIVE,ct as WM_MDIICONARRANGE,yt as WM_MDIMAXIMIZE,mt as WM_MDINEXT,wt as WM_MDIREFRESHMENU,vt as WM_MDIRESTORE,ht as WM_MDISETMENU,ft as WM_MDITILE,gt as WM_MEASUREITEM,Ut as WM_MENUCHAR,It as WM_MENUCOMMAND,Wt as WM_MENUDRAG,xt as WM_MENUGETOBJECT,_t as WM_MENURBUTTONUP,St as WM_MENUSELECT,to as WM_MOUSEACTIVATE,mo as WM_MOUSEFIRST,vo as WM_MOUSEHOVER,wo as WM_MOUSELAST,ho as WM_MOUSELEAVE,no as WM_MOUSEMOVE,yo as WM_MOUSEWHEEL,Et as WM_MOVE,Pt as WM_MOVING,Mt as WM_NCACTIVATE,Rt as WM_NCCALCSIZE,Tt as WM_NCCREATE,Ot as WM_NCDESTROY,Ft as WM_NCHITTEST,Lt as WM_NCLBUTTONDBLCLK,Dt as WM_NCLBUTTONDOWN,Ht as WM_NCLBUTTONUP,At as WM_NCMBUTTONDBLCLK,kt as WM_NCMBUTTONDOWN,Nt as WM_NCMBUTTONUP,Bt as WM_NCMOUSEMOVE,Qt as WM_NCPAINT,jt as WM_NCRBUTTONDBLCLK,Gt as WM_NCRBUTTONDOWN,qt as WM_NCRBUTTONUP,zt as WM_NEXTDLGCTL,bt as WM_NEXTMENU,Vt as WM_NOTIFY,Xt as WM_NOTIFYFORMAT,Yt as WM_NULL,Jt as WM_PAINT,Kt as WM_PAINTCLIPBOARD,Zt as WM_PAINTICON,$t as WM_PALETTECHANGED,en as WM_PALETTEISCHANGING,tn as WM_PARENTNOTIFY,nn as WM_PASTE,on as WM_PENWINFIRST,rn as WM_PENWINLAST,an as WM_POWER,sn as WM_POWERBROADCAST,dn as WM_PRINT,ln as WM_PRINTCLIENT,un as WM_QUERYDRAGICON,pn as WM_QUERYENDSESSION,cn as WM_QUERYNEWPALETTE,yn as WM_QUERYOPEN,mn as WM_QUEUESYNC,wn as WM_QUIT,lo as WM_RBUTTONDBLCLK,ao as WM_RBUTTONDOWN,so as WM_RBUTTONUP,vn as WM_RENDERALLFORMATS,hn as WM_RENDERFORMAT,fn as WM_SETCURSOR,gn as WM_SETFOCUS,Cn as WM_SETFONT,_n as WM_SETHOTKEY,In as WM_SETICON,xn as WM_SETREDRAW,Wn as WM_SETTEXT,Un as WM_SETTINGCHANGE,Sn as WM_SHOWWINDOW,bn as WM_SIZE,En as WM_SIZECLIPBOARD,Pn as WM_SIZING,Mn as WM_SPOOLERSTATUS,Rn as WM_STYLECHANGED,Tn as WM_STYLECHANGING,eo as WM_SYNCPAINT,On as WM_SYSCHAR,Fn as WM_SYSCOLORCHANGE,Ln as WM_SYSCOMMAND,Dn as WM_SYSDEADCHAR,Hn as WM_SYSKEYDOWN,An as WM_SYSKEYUP,kn as WM_TCARD,Nn as WM_THEMECHANGED,Bn as WM_TIMECHANGE,Qn as WM_TIMER,jn as WM_UNDO,Ct as WM_UNINITMENUPOPUP,Gn as WM_USER,qn as WM_USERCHANGED,zn as WM_VKEYTOITEM,Vn as WM_VSCROLL,Xn as WM_VSCROLLCLIPBOARD,Yn as WM_WINDOWPOSCHANGED,Jn as WM_WINDOWPOSCHANGING,Kn as WM_WININICHANGE,v as WS_BORDER,h as WS_CAPTION,f as WS_CHILD,g as WS_CHILDWINDOW,C as WS_CLIPCHILDREN,_ as WS_CLIPSIBLINGS,I as WS_DISABLED,x as WS_DLGFRAME,fo as WS_EX_ACCEPTFILES,go as WS_EX_APPWINDOW,Co as WS_EX_CLIENTEDGE,_o as WS_EX_CONTEXTHELP,Io as WS_EX_CONTROLPARENT,xo as WS_EX_DLGMODALFRAME,Wo as WS_EX_LEFT,Uo as WS_EX_LEFTSCROLLBAR,So as WS_EX_LTRREADING,bo as WS_EX_MDICHILD,Eo as WS_EX_NOPARENTNOTIFY,Po as WS_EX_OVERLAPPEDWINDOW,Mo as WS_EX_PALETTEWINDOW,Ro as WS_EX_RIGHT,To as WS_EX_RIGHTSCROLLBAR,Oo as WS_EX_RTLREADING,Fo as WS_EX_STATICEDGE,Lo as WS_EX_TOOLWINDOW,Do as WS_EX_TOPMOST,Ho as WS_EX_TRANSPARENT,Ao as WS_EX_WINDOWEDGE,W as WS_GROUP,U as WS_HSCROLL,S as WS_ICONIC,b as WS_MAXIMIZE,E as WS_MAXIMIZEBOX,P as WS_MINIMIZE,M as WS_MINIMIZEBOX,R as WS_OVERLAPPED,B as WS_OVERLAPPEDWINDOW,T as WS_POPUP,Q as WS_POPUPWINDOW,O as WS_SIZEBOX,F as WS_SYSMENU,L as WS_TABSTOP,D as WS_THICKFRAME,H as WS_TILED,A as WS_TILEDWINDOW,k as WS_VISIBLE,N as WS_VSCROLL,ps as Win95,ms as Window,ts as initEmulator,ls as render,us as unmountComponentAtNode,ds as useWin95};
{
"name": "react-95-fiber",
"version": "0.1.1",
"version": "0.1.2",
"description": "Work in progress!",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -173,2 +173,4 @@ import { V86Starter } from 'v86';

(window as any).emulator = v86Emulator;
v86Emulator.add_listener('emulator-started', () => {

@@ -319,7 +321,5 @@ v86Emulator.v86.cpu.devices.commBus = new CommBus(v86Emulator.v86.cpu, pkg => {

if (e.type === ResponseType.Res_CmdOutputHandle) {
console.timeEnd('extractIcon' + file + id);
resolve(e.handle);
}
});
console.time('extractIcon' + file + id);
sendSerial(

@@ -326,0 +326,0 @@ buildRemoteCommand(CommandType.Cmd_ExtractIcon, [

@@ -142,5 +142,5 @@ import Reconciler from 'react-reconciler';

};
} else {
throw new Error('Unknown type!');
}
throw new Error('Unknown type!');
},

@@ -206,9 +206,17 @@

instance.root.api.setWindowText(instance.id, newProps.children);
} else if (typeof newProps.text === 'string' && newProps.text !== oldProps.text) {
} else if (Array.isArray(newProps.children)) {
const text = newProps.children.reduce((acc: string, child) => acc + (typeof child === 'string' ? child : ''), '');
const oldText = Array.isArray(oldProps.children) && oldProps.children.reduce((acc, child) => (acc + typeof child === 'string' ? child : ''), '');
if (text !== oldText) instance.root.api.setWindowText(instance.id, text);
}
if (typeof newProps.text === 'string' && newProps.text !== oldProps.text) {
instance.root.api.setWindowText(instance.id, newProps.text);
} else if (newProps.x !== oldProps.x || newProps.y !== oldProps.y || newProps.w !== oldProps.w || newProps.h !== oldProps.h) {
}
if (newProps.x !== oldProps.x || newProps.y !== oldProps.y || newProps.w !== oldProps.w || newProps.h !== oldProps.h) {
instance.root.api.setWindowPos(instance.id, newProps.x, newProps.y, newProps.w, newProps.h);
} else if (newProps.params !== oldProps.params) {
}
if (newProps.params !== oldProps.params) {
instance.root.api.setWindowLong(instance.id, GWL_STYLE, newProps.params);
} else if (typeof newProps.extStyle === 'number' && newProps.extStyle !== oldProps.extStyle) {
}
if (typeof newProps.extStyle === 'number' && newProps.extStyle !== oldProps.extStyle) {
instance.root.api.setWindowLong(instance.id, GWL_EXSTYLE, newProps.extStyle);

@@ -219,4 +227,4 @@ }

insertBefore: p => console.log('insertBefore', p),
insertInContainerBefore: (parentInstance, child, beforeChild) => console.log('insertInContainerBefore', { parentInstance, child, beforeChild }),
insertBefore: appendChild,
insertInContainerBefore: appendChild,

@@ -228,1 +236,7 @@ removeChild,

});
reconciler.injectIntoDevTools({
bundleType: process.env.NODE_ENV === 'production' ? 0 : 1,
rendererPackageName: 'react-95-fiber',
version: '0.0.1',
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc