js-dos 8.4.0 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.deployment.md +29 -14
- package/README.md +38 -25
- package/dist/emulators/emulators.js +1 -1
- package/dist/emulators/emulators.js.map +1 -1
- package/dist/emulators/sockdrive.js.map +1 -1
- package/dist/emulators/types/dos/dosbox/ts/audio-worklet.d.ts +1 -0
- package/dist/emulators/types/dos/dosbox/ts/direct.d.ts +1 -0
- package/dist/emulators/types/emulators.d.ts +4 -0
- package/dist/emulators/types/impl/emulators-impl.d.ts +3 -0
- package/dist/emulators/types/impl/modules.d.ts +5 -1
- package/dist/emulators/types/protocol/mini-lz4.d.ts +3 -0
- package/dist/emulators/types/sockdrive/sockdrive-store.d.ts +36 -0
- package/dist/emulators/types/sockdrive/sockdrive.d.ts +29 -0
- package/dist/emulators/wdosbox-x-dbg.js +49 -0
- package/dist/emulators/wdosbox-x-dbg.wasm +0 -0
- package/dist/emulators/wdosbox-x-jspi.js +2 -2
- package/dist/emulators/wdosbox-x-jspi.js.symbols +10252 -9988
- package/dist/emulators/wdosbox-x-jspi.wasm +0 -0
- package/dist/emulators/wdosbox-x.js +2 -2
- package/dist/emulators/wdosbox-x.js.symbols +10317 -10053
- package/dist/emulators/wdosbox-x.wasm +0 -0
- package/dist/emulators/wdosbox.js +1 -1
- package/dist/emulators/wdosbox.js.symbols +1616 -1617
- package/dist/emulators/wdosbox.wasm +0 -0
- package/dist/js-dos.js +2 -2
- package/dist/js-dos.js.map +1 -1
- package/package.json +2 -2
- package/release.zip +0 -0
- package/scripts/deploy-dz-nightly.sh +14 -0
- package/scripts/deploy-dz.sh +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ Note that version numbers do not necessarily reflect the amount of changes betwe
|
|
|
4
4
|
|
|
5
5
|
Not all changes are documented here. To examine the full set of changes between versions, you can use git to browse the changes between the tags.
|
|
6
6
|
|
|
7
|
+
8.4.1 - 13.07.2026
|
|
8
|
+
------------------
|
|
9
|
+
|
|
10
|
+
* Improve sockdrive in direct mode
|
|
11
|
+
* Fix for #303
|
|
12
|
+
* Fix for #310
|
|
13
|
+
* Fix for #426
|
|
14
|
+
|
|
15
|
+
|
|
7
16
|
8.4.0 - 19.06.2026
|
|
8
17
|
------------------
|
|
9
18
|
|
package/README.deployment.md
CHANGED
|
@@ -39,31 +39,46 @@ rm -rf /tmp/$VERSION
|
|
|
39
39
|
|
|
40
40
|
### Deploy new one
|
|
41
41
|
```
|
|
42
|
-
|
|
43
|
-
yarn run vite build --base /js-dos/latest --sourcemap true --minify terser && \
|
|
44
|
-
rm dist/emulators/sockdrive* && \
|
|
45
|
-
python scripts/brotli-dist.py && \
|
|
46
|
-
aws s3 --endpoint-url=https://storage.yandexcloud.net sync --acl public-read \
|
|
47
|
-
dist s3://br-bundles/js-dos/latest
|
|
42
|
+
./scripts/deploy-dz.sh
|
|
48
43
|
```
|
|
49
44
|
|
|
50
45
|
Clear the CDN cache (br.cdn.js-dos.com) in dashboard, pattern:
|
|
51
46
|
```
|
|
52
|
-
/js-dos/latest
|
|
47
|
+
/js-dos/latest/js-dos.js.ea
|
|
48
|
+
/js-dos/latest/js-dos.js.map
|
|
49
|
+
/js-dos/latest/js-dos.css
|
|
50
|
+
/js-dos/latest/emulators/emulators.js.ea
|
|
51
|
+
/js-dos/latest/emulators/emulators.js.map
|
|
52
|
+
/js-dos/latest/emulators/file-explorer.css.ea
|
|
53
|
+
/js-dos/latest/emulators/file-explorer.js.ea
|
|
54
|
+
/js-dos/latest/emulators/fileexplorer_actions.woff
|
|
55
|
+
/js-dos/latest/emulators/fileexplorer_sprites.png
|
|
56
|
+
/js-dos/latest/emulators/wdosbox-x-jspi.js.ea
|
|
57
|
+
/js-dos/latest/emulators/wdosbox-x-jspi.js.symbols
|
|
58
|
+
/js-dos/latest/emulators/wdosbox-x-jspi.wasm.ea
|
|
59
|
+
/js-dos/latest/emulators/wdosbox-x-dbg.js.ea
|
|
60
|
+
/js-dos/latest/emulators/wdosbox-x-dbg.js.symbols
|
|
61
|
+
/js-dos/latest/emulators/wdosbox-x-dbg.wasm.ea
|
|
62
|
+
/js-dos/latest/emulators/wdosbox-x.js.ea
|
|
63
|
+
/js-dos/latest/emulators/wdosbox-x.js.symbols
|
|
64
|
+
/js-dos/latest/emulators/wdosbox-x.wasm.ea
|
|
65
|
+
/js-dos/latest/emulators/wdosbox.js.ea
|
|
66
|
+
/js-dos/latest/emulators/wdosbox.js.symbols
|
|
67
|
+
/js-dos/latest/emulators/wdosbox.wasm.ea
|
|
68
|
+
/js-dos/latest/emulators/webrtcnet.mjs.ea
|
|
69
|
+
/js-dos/latest/emulators/webrtcnet.wasm.ea
|
|
70
|
+
/js-dos/latest/emulators/wlibzip.js.ea
|
|
71
|
+
/js-dos/latest/emulators/wlibzip.js.symbols
|
|
72
|
+
/js-dos/latest/emulators/wlibzip.wasm.ea
|
|
53
73
|
```
|
|
54
74
|
|
|
55
75
|
### Deploy nigthly
|
|
56
76
|
|
|
57
77
|
```
|
|
58
|
-
|
|
59
|
-
yarn run vite build --base /js-dos/nightly --sourcemap true --minify terser && \
|
|
60
|
-
rm dist/emulators/sockdrive* && \
|
|
61
|
-
python scripts/brotli-dist.py && \
|
|
62
|
-
aws s3 --endpoint-url=https://storage.yandexcloud.net sync --acl public-read \
|
|
63
|
-
dist s3://br-bundles/js-dos/nightly --delete
|
|
78
|
+
./scripts/deploy-dz-nightly.sh
|
|
64
79
|
```
|
|
65
80
|
|
|
66
81
|
Clear the CDN cache (br.cdn.js-dos.com) in dashboard, pattern:
|
|
67
82
|
```
|
|
68
83
|
/js-dos/nightly,/js-dos/nightly/*
|
|
69
|
-
```
|
|
84
|
+
```
|
package/README.md
CHANGED
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
# js-dos
|
|
1
|
+
# js-dos
|
|
2
2
|
[](https://github.com/caiiiycuk/js-dos/actions/workflows/build.yml)
|
|
3
3
|
|
|
4
|
-
The simplest API to run **DOS/Win
|
|
5
|
-
|
|
4
|
+
The simplest API to run **DOS/Win 9x** programs in browser or node.
|
|
5
|
+
|
|
6
|
+
js-dos is a frontend for [emulators](https://github.com/caiiiycuk/emulators) that provides nice UI and infrastructure
|
|
7
|
+
to run DOS or Windows programs in browser.
|
|
8
|
+
|
|
9
|
+
It provides full-featured **DOS player** that can be easily installed and used to get your DOS program up and running in
|
|
10
|
+
browser quickly. js-dos provides many advanced features like multiplayer, save/load, and large disk streaming.
|
|
11
|
+
All available features are enabled for any integration and free.
|
|
12
|
+
|
|
13
|
+
The unique capabilities:
|
|
14
|
+
* The only browser solution with accelerated [**3Dfx**](https://js-dos.com/3dfx.html) rendering through a WebGL-backed renderer
|
|
15
|
+
* Full [**IPX** networking](https://js-dos.com/networking.html) stack in browser, powered by WebRTC-NET, with IPX server creation, direct
|
|
16
|
+
peer/alias connections, and shared network instances
|
|
17
|
+
* **Windows 9x** support through DOSBox-X, including prebuilt Windows 95/98 system images and support for Windows games
|
|
18
|
+
with DirectX and 3Dfx drivers
|
|
19
|
+
* **Sockdrive V2** for large disk images: backendless streaming drives, preload modes, and improved persistence handling
|
|
20
|
+
* Modern local persistence based on **OPFS**, with local filesystem changes, storage usage information, and `fsChanges`
|
|
21
|
+
hooks for custom save storage
|
|
6
22
|
|
|
7
23
|
The key features:
|
|
8
24
|
* Works in **worker** or render thread
|
|
9
25
|
* Support execution in Node and Browsers
|
|
10
26
|
* Multiple backends: DOSBox, DOSBox-X
|
|
11
27
|
* Mobile support (v8 - WIP, v7 - production)
|
|
12
|
-
* Able to run
|
|
28
|
+
* Able to run huge games (like Diablo, etc.)
|
|
13
29
|
* Multiplayer support
|
|
14
|
-
*
|
|
30
|
+
* Save/load support with local persistence and custom storage integrations
|
|
15
31
|
* WebAssembly and pure JS versions
|
|
16
|
-
|
|
32
|
+
* AudioWorklet mode and experimental JSPI backend support
|
|
33
|
+
* [Turbo controls](https://js-dos.com/turbo.html) with CPU metrics, speed, cycles, fast forward, and frame skip controls
|
|
34
|
+
|
|
35
|
+
> If you want to build custom DOS player, then please use [emulators](https://js-dos.com/threejs.html) packages instead.
|
|
36
|
+
|
|
17
37
|
## Demo
|
|
18
38
|
|
|
19
|
-
* [Win 95](https://v8.js-dos.com) - plain Windows 95 with D3D & 3Dfx
|
|
20
39
|
* [DOS.Zone](https://dos.zone) - community portal with 1900+ dos games
|
|
21
|
-
* [
|
|
22
|
-
* [
|
|
23
|
-
* [
|
|
24
|
-
|
|
25
|
-
[](https://youtu.be/lhFrAe5YrJE)
|
|
40
|
+
* [3Dfx](https://dos.zone/3dfx/)
|
|
41
|
+
* [Multiplayer](https://dos.zone/mp)
|
|
42
|
+
* [NFS](https://dos.zone/the-need-for-speed-sep-1995/)
|
|
43
|
+
* [Age Of Empries II](https://dos.zone/age-of-empires2/)
|
|
26
44
|
|
|
27
45
|
## Documentation
|
|
28
46
|
|
|
@@ -33,20 +51,15 @@ The key features:
|
|
|
33
51
|
|
|
34
52
|
## Support
|
|
35
53
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Alternatively you can do one time donation:
|
|
41
|
-
|
|
42
|
-
| [Visa / MasterCard / МИР](https://pay.cloudtips.ru/p/894f907b) | [Buy Me A Coffee!](https://buymeacoffee.com/caiiiycuk) |
|
|
43
|
-
|-----------------------------------------------------------------|--------------------------------------------------------|
|
|
44
|
-
|  |  |
|
|
45
|
-
|
|
54
|
+
| [Subscription / Подписка](https://cloudsdk.dev/) | [Visa / MasterCard / МИР](https://pay.cloudtips.ru/p/894f907b) | [Buy Me A Coffee!](https://buymeacoffee.com/caiiiycuk) |
|
|
55
|
+
|------------------------------------------------------------------------------------|-----------------------------------------------------------------|--------------------------------------------------------|
|
|
56
|
+
| <img src="https://dos.zone/assets/qr-jsdos.png" alt="js-dos qr code" width="128" /> | <img src="https://cdn.dos.zone/custom/qr/cloud_tips_256.png" alt="cloud tips qr code" width="128" /> | <img src="https://cdn.dos.zone/custom/qr/bmc_qr_256.png" alt="bmc qr code" width="128" /> |
|
|
57
|
+
| js-dos | Cloud Tips | @caiiiycuk |
|
|
46
58
|
|
|
47
|
-
| BTC
|
|
48
|
-
|
|
49
|
-
|
|
|
59
|
+
| BTC | ETH |
|
|
60
|
+
|-----|-----|
|
|
61
|
+
| <img src="https://cdn.dos.zone/custom/qr/btc_pub_256.png" alt="btc qr code" width="128" /> | <img src="https://cdn.dos.zone/custom/qr/eth-qr_256.png" alt="eth qr code" width="128" /> |
|
|
62
|
+
| 1EngssY81sziuQyb9JGXURG3WDajyC8kW6 | 0x54FEBE29Cd700f88468032b33c33CdcD7c7cCa53 |
|
|
50
63
|
|
|
51
64
|
|
|
52
65
|
## Development
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function e(t,n,s){function r(i,a){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!a&&l)return l(i,!0);if(o)return o(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[i]={exports:{}};t[i][0].call(c.exports,(function(e){return r(t[i][1][e]||e)}),c,c.exports,e,t,n,s)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<s.length;i++)r(s[i]);return r}({1:[function(e,t,n){var s=e("../internals/is-callable"),r=e("../internals/try-to-string"),o=TypeError;t.exports=function(e){if(s(e))return e;throw o(r(e)+" is not a function")}},{"../internals/is-callable":33,"../internals/try-to-string":59}],2:[function(e,t,n){var s=e("../internals/is-callable"),r=String,o=TypeError;t.exports=function(e){if("object"==typeof e||s(e))return e;throw o("Can't set "+r(e)+" as a prototype")}},{"../internals/is-callable":33}],3:[function(e,t,n){var s=e("../internals/is-object"),r=String,o=TypeError;t.exports=function(e){if(s(e))return e;throw o(r(e)+" is not an object")}},{"../internals/is-object":35}],4:[function(e,t,n){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],5:[function(e,t,n){"use strict";var s,r,o,i=e("../internals/array-buffer-basic-detection"),a=e("../internals/descriptors"),l=e("../internals/global"),u=e("../internals/is-callable"),c=e("../internals/is-object"),d=e("../internals/has-own-property"),h=e("../internals/classof"),f=e("../internals/try-to-string"),p=e("../internals/create-non-enumerable-property"),m=e("../internals/define-built-in"),b=e("../internals/define-built-in-accessor"),y=e("../internals/object-is-prototype-of"),g=e("../internals/object-get-prototype-of"),w=e("../internals/object-set-prototype-of"),v=e("../internals/well-known-symbol"),x=e("../internals/uid"),P=e("../internals/internal-state"),k=P.enforce,S=P.get,_=l.Int8Array,j=_&&_.prototype,M=l.Uint8ClampedArray,C=M&&M.prototype,R=_&&g(_),T=j&&g(j),A=Object.prototype,F=l.TypeError,I=v("toStringTag"),E=x("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",z=i&&!!w&&"Opera"!==h(l.opera),D=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},W={BigInt64Array:8,BigUint64Array:8},L=function(e){var t=g(e);if(c(t)){var n=S(t);return n&&d(n,O)?n.TypedArrayConstructor:L(t)}},q=function(e){if(!c(e))return!1;var t=h(e);return d(U,t)||d(W,t)};for(s in U)(o=(r=l[s])&&r.prototype)?k(o).TypedArrayConstructor=r:z=!1;for(s in W)(o=(r=l[s])&&r.prototype)&&(k(o).TypedArrayConstructor=r);if((!z||!u(R)||R===Function.prototype)&&(R=function(){throw F("Incorrect invocation")},z))for(s in U)l[s]&&w(l[s],R);if((!z||!T||T===A)&&(T=R.prototype,z))for(s in U)l[s]&&w(l[s].prototype,T);if(z&&g(C)!==T&&w(C,T),a&&!d(T,I))for(s in D=!0,b(T,I,{configurable:!0,get:function(){return c(this)?this[E]:void 0}}),U)l[s]&&p(l[s],E,s);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:z,TYPED_ARRAY_TAG:D&&E,aTypedArray:function(e){if(q(e))return e;throw F("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!w||y(R,e)))return e;throw F(f(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,s){if(a){if(n)for(var r in U){var o=l[r];if(o&&d(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}T[e]&&!n||m(T,e,n?t:z&&j[e]||t,s)}},exportTypedArrayStaticMethod:function(e,t,n){var s,r;if(a){if(w){if(n)for(s in U)if((r=l[s])&&d(r,e))try{delete r[e]}catch(e){}if(R[e]&&!n)return;try{return m(R,e,n?t:z&&R[e]||t)}catch(e){}}for(s in U)!(r=l[s])||r[e]&&!n||m(r,e,t)}},getTypedArrayConstructor:L,isView:function(e){if(!c(e))return!1;var t=h(e);return"DataView"===t||d(U,t)||d(W,t)},isTypedArray:q,TypedArray:R,TypedArrayPrototype:T}},{"../internals/array-buffer-basic-detection":4,"../internals/classof":7,"../internals/create-non-enumerable-property":9,"../internals/define-built-in":12,"../internals/define-built-in-accessor":11,"../internals/descriptors":14,"../internals/global":27,"../internals/has-own-property":28,"../internals/internal-state":32,"../internals/is-callable":33,"../internals/is-object":35,"../internals/object-get-prototype-of":42,"../internals/object-is-prototype-of":43,"../internals/object-set-prototype-of":44,"../internals/try-to-string":59,"../internals/uid":60,"../internals/well-known-symbol":64}],6:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=s({}.toString),o=s("".slice);t.exports=function(e){return o(r(e),8,-1)}},{"../internals/function-uncurry-this":24}],7:[function(e,t,n){var s=e("../internals/to-string-tag-support"),r=e("../internals/is-callable"),o=e("../internals/classof-raw"),i=e("../internals/well-known-symbol")("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}());t.exports=s?o:function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=a(e),i))?n:l?o(t):"Object"==(s=o(t))&&r(t.callee)?"Arguments":s}},{"../internals/classof-raw":6,"../internals/is-callable":33,"../internals/to-string-tag-support":58,"../internals/well-known-symbol":64}],8:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":19}],9:[function(e,t,n){var s=e("../internals/descriptors"),r=e("../internals/object-define-property"),o=e("../internals/create-property-descriptor");t.exports=s?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},{"../internals/create-property-descriptor":10,"../internals/descriptors":14,"../internals/object-define-property":41}],10:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],11:[function(e,t,n){var s=e("../internals/make-built-in"),r=e("../internals/object-define-property");t.exports=function(e,t,n){return n.get&&s(n.get,t,{getter:!0}),n.set&&s(n.set,t,{setter:!0}),r.f(e,t,n)}},{"../internals/make-built-in":39,"../internals/object-define-property":41}],12:[function(e,t,n){var s=e("../internals/is-callable"),r=e("../internals/object-define-property"),o=e("../internals/make-built-in"),i=e("../internals/define-global-property");t.exports=function(e,t,n,a){a||(a={});var l=a.enumerable,u=void 0!==a.name?a.name:t;if(s(n)&&o(n,u,a),a.global)l?e[t]=n:i(t,n);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:r.f(e,t,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},{"../internals/define-global-property":13,"../internals/is-callable":33,"../internals/make-built-in":39,"../internals/object-define-property":41}],13:[function(e,t,n){var s=e("../internals/global"),r=Object.defineProperty;t.exports=function(e,t){try{r(s,e,{value:t,configurable:!0,writable:!0})}catch(n){s[e]=t}return t}},{"../internals/global":27}],14:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":19}],15:[function(e,t,n){var s="object"==typeof document&&document.all,r=void 0===s&&void 0!==s;t.exports={all:s,IS_HTMLDDA:r}},{}],16:[function(e,t,n){var s=e("../internals/global"),r=e("../internals/is-object"),o=s.document,i=r(o)&&r(o.createElement);t.exports=function(e){return i?o.createElement(e):{}}},{"../internals/global":27,"../internals/is-object":35}],17:[function(e,t,n){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},{}],18:[function(e,t,n){var s,r,o=e("../internals/global"),i=e("../internals/engine-user-agent"),a=o.process,l=o.Deno,u=a&&a.versions||l&&l.version,c=u&&u.v8;c&&(r=(s=c.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!r&&i&&(!(s=i.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=i.match(/Chrome\/(\d+)/))&&(r=+s[1]),t.exports=r},{"../internals/engine-user-agent":17,"../internals/global":27}],19:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],20:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},{"../internals/fails":19}],21:[function(e,t,n){var s=e("../internals/function-bind-native"),r=Function.prototype.call;t.exports=s?r.bind(r):function(){return r.apply(r,arguments)}},{"../internals/function-bind-native":20}],22:[function(e,t,n){var s=e("../internals/descriptors"),r=e("../internals/has-own-property"),o=Function.prototype,i=s&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,u=a&&(!s||s&&i(o,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:u}},{"../internals/descriptors":14,"../internals/has-own-property":28}],23:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=e("../internals/a-callable");t.exports=function(e,t,n){try{return s(r(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},{"../internals/a-callable":1,"../internals/function-uncurry-this":24}],24:[function(e,t,n){var s=e("../internals/function-bind-native"),r=Function.prototype,o=r.call,i=s&&r.bind.bind(o,o);t.exports=s?i:function(e){return function(){return o.apply(e,arguments)}}},{"../internals/function-bind-native":20}],25:[function(e,t,n){var s=e("../internals/global"),r=e("../internals/is-callable"),o=function(e){return r(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?o(s[e]):s[e]&&s[e][t]}},{"../internals/global":27,"../internals/is-callable":33}],26:[function(e,t,n){var s=e("../internals/a-callable"),r=e("../internals/is-null-or-undefined");t.exports=function(e,t){var n=e[t];return r(n)?void 0:s(n)}},{"../internals/a-callable":1,"../internals/is-null-or-undefined":34}],27:[function(e,t,n){(function(e){(function(){var n=function(e){return e&&e.Math==Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=e("../internals/to-object"),o=s({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},{"../internals/function-uncurry-this":24,"../internals/to-object":53}],29:[function(e,t,n){t.exports={}},{}],30:[function(e,t,n){var s=e("../internals/descriptors"),r=e("../internals/fails"),o=e("../internals/document-create-element");t.exports=!s&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":14,"../internals/document-create-element":16,"../internals/fails":19}],31:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=e("../internals/is-callable"),o=e("../internals/shared-store"),i=s(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),t.exports=o.inspectSource},{"../internals/function-uncurry-this":24,"../internals/is-callable":33,"../internals/shared-store":48}],32:[function(e,t,n){var s,r,o,i=e("../internals/weak-map-basic-detection"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/create-non-enumerable-property"),c=e("../internals/has-own-property"),d=e("../internals/shared-store"),h=e("../internals/shared-key"),f=e("../internals/hidden-keys"),p="Object already initialized",m=a.TypeError,b=a.WeakMap;if(i||d.state){var y=d.state||(d.state=new b);y.get=y.get,y.has=y.has,y.set=y.set,s=function(e,t){if(y.has(e))throw m(p);return t.facade=e,y.set(e,t),t},r=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var g=h("state");f[g]=!0,s=function(e,t){if(c(e,g))throw m(p);return t.facade=e,u(e,g,t),t},r=function(e){return c(e,g)?e[g]:{}},o=function(e){return c(e,g)}}t.exports={set:s,get:r,has:o,enforce:function(e){return o(e)?r(e):s(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return n}}}},{"../internals/create-non-enumerable-property":9,"../internals/global":27,"../internals/has-own-property":28,"../internals/hidden-keys":29,"../internals/is-object":35,"../internals/shared-key":47,"../internals/shared-store":48,"../internals/weak-map-basic-detection":63}],33:[function(e,t,n){var s=e("../internals/document-all"),r=s.all;t.exports=s.IS_HTMLDDA?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}},{"../internals/document-all":15}],34:[function(e,t,n){t.exports=function(e){return null==e}},{}],35:[function(e,t,n){var s=e("../internals/is-callable"),r=e("../internals/document-all"),o=r.all;t.exports=r.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:s(e)||e===o}:function(e){return"object"==typeof e?null!==e:s(e)}},{"../internals/document-all":15,"../internals/is-callable":33}],36:[function(e,t,n){t.exports=!1},{}],37:[function(e,t,n){var s=e("../internals/get-built-in"),r=e("../internals/is-callable"),o=e("../internals/object-is-prototype-of"),i=e("../internals/use-symbol-as-uid"),a=Object;t.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=s("Symbol");return r(t)&&o(t.prototype,a(e))}},{"../internals/get-built-in":25,"../internals/is-callable":33,"../internals/object-is-prototype-of":43,"../internals/use-symbol-as-uid":61}],38:[function(e,t,n){var s=e("../internals/to-length");t.exports=function(e){return s(e.length)}},{"../internals/to-length":52}],39:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=e("../internals/fails"),o=e("../internals/is-callable"),i=e("../internals/has-own-property"),a=e("../internals/descriptors"),l=e("../internals/function-name").CONFIGURABLE,u=e("../internals/inspect-source"),c=e("../internals/internal-state"),d=c.enforce,h=c.get,f=String,p=Object.defineProperty,m=s("".slice),b=s("".replace),y=s([].join),g=a&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),w=String(String).split("String"),v=t.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+b(f(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||l&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&i(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=d(e);return i(s,"source")||(s.source=y(w,"string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&h(this).source||u(this)}),"toString")},{"../internals/descriptors":14,"../internals/fails":19,"../internals/function-name":22,"../internals/function-uncurry-this":24,"../internals/has-own-property":28,"../internals/inspect-source":31,"../internals/internal-state":32,"../internals/is-callable":33}],40:[function(e,t,n){var s=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r:s)(t)}},{}],41:[function(e,t,n){var s=e("../internals/descriptors"),r=e("../internals/ie8-dom-define"),o=e("../internals/v8-prototype-define-bug"),i=e("../internals/an-object"),a=e("../internals/to-property-key"),l=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",f="writable";n.f=s?o?function(e,t,n){if(i(e),t=a(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n.writable){var s=c(e,t);s&&s.writable&&(e[t]=n.value,n={configurable:h in n?n.configurable:s.configurable,enumerable:d in n?n.enumerable:s.enumerable,writable:!1})}return u(e,t,n)}:u:function(e,t,n){if(i(e),t=a(t),i(n),r)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},{"../internals/an-object":3,"../internals/descriptors":14,"../internals/ie8-dom-define":30,"../internals/to-property-key":57,"../internals/v8-prototype-define-bug":62}],42:[function(e,t,n){var s=e("../internals/has-own-property"),r=e("../internals/is-callable"),o=e("../internals/to-object"),i=e("../internals/shared-key"),a=e("../internals/correct-prototype-getter"),l=i("IE_PROTO"),u=Object,c=u.prototype;t.exports=a?u.getPrototypeOf:function(e){var t=o(e);if(s(t,l))return t[l];var n=t.constructor;return r(n)&&t instanceof n?n.prototype:t instanceof u?c:null}},{"../internals/correct-prototype-getter":8,"../internals/has-own-property":28,"../internals/is-callable":33,"../internals/shared-key":47,"../internals/to-object":53}],43:[function(e,t,n){var s=e("../internals/function-uncurry-this");t.exports=s({}.isPrototypeOf)},{"../internals/function-uncurry-this":24}],44:[function(e,t,n){var s=e("../internals/function-uncurry-this-accessor"),r=e("../internals/an-object"),o=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=s(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,s){return r(n),o(s),t?e(n,s):n.__proto__=s,n}}():void 0)},{"../internals/a-possible-prototype":2,"../internals/an-object":3,"../internals/function-uncurry-this-accessor":23}],45:[function(e,t,n){var s=e("../internals/function-call"),r=e("../internals/is-callable"),o=e("../internals/is-object"),i=TypeError;t.exports=function(e,t){var n,a;if("string"===t&&r(n=e.toString)&&!o(a=s(n,e)))return a;if(r(n=e.valueOf)&&!o(a=s(n,e)))return a;if("string"!==t&&r(n=e.toString)&&!o(a=s(n,e)))return a;throw i("Can't convert object to primitive value")}},{"../internals/function-call":21,"../internals/is-callable":33,"../internals/is-object":35}],46:[function(e,t,n){var s=e("../internals/is-null-or-undefined"),r=TypeError;t.exports=function(e){if(s(e))throw r("Can't call method on "+e);return e}},{"../internals/is-null-or-undefined":34}],47:[function(e,t,n){var s=e("../internals/shared"),r=e("../internals/uid"),o=s("keys");t.exports=function(e){return o[e]||(o[e]=r(e))}},{"../internals/shared":49,"../internals/uid":60}],48:[function(e,t,n){var s=e("../internals/global"),r=e("../internals/define-global-property"),o="__core-js_shared__",i=s[o]||r(o,{});t.exports=i},{"../internals/define-global-property":13,"../internals/global":27}],49:[function(e,t,n){var s=e("../internals/is-pure"),r=e("../internals/shared-store");(t.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.0",mode:s?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":36,"../internals/shared-store":48}],50:[function(e,t,n){var s=e("../internals/engine-v8-version"),r=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},{"../internals/engine-v8-version":18,"../internals/fails":19}],51:[function(e,t,n){var s=e("../internals/math-trunc");t.exports=function(e){var t=+e;return t!=t||0===t?0:s(t)}},{"../internals/math-trunc":40}],52:[function(e,t,n){var s=e("../internals/to-integer-or-infinity"),r=Math.min;t.exports=function(e){return e>0?r(s(e),9007199254740991):0}},{"../internals/to-integer-or-infinity":51}],53:[function(e,t,n){var s=e("../internals/require-object-coercible"),r=Object;t.exports=function(e){return r(s(e))}},{"../internals/require-object-coercible":46}],54:[function(e,t,n){var s=e("../internals/to-positive-integer"),r=RangeError;t.exports=function(e,t){var n=s(e);if(n%t)throw r("Wrong offset");return n}},{"../internals/to-positive-integer":55}],55:[function(e,t,n){var s=e("../internals/to-integer-or-infinity"),r=RangeError;t.exports=function(e){var t=s(e);if(t<0)throw r("The argument can't be less than 0");return t}},{"../internals/to-integer-or-infinity":51}],56:[function(e,t,n){var s=e("../internals/function-call"),r=e("../internals/is-object"),o=e("../internals/is-symbol"),i=e("../internals/get-method"),a=e("../internals/ordinary-to-primitive"),l=e("../internals/well-known-symbol"),u=TypeError,c=l("toPrimitive");t.exports=function(e,t){if(!r(e)||o(e))return e;var n,l=i(e,c);if(l){if(void 0===t&&(t="default"),n=s(l,e,t),!r(n)||o(n))return n;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},{"../internals/function-call":21,"../internals/get-method":26,"../internals/is-object":35,"../internals/is-symbol":37,"../internals/ordinary-to-primitive":45,"../internals/well-known-symbol":64}],57:[function(e,t,n){var s=e("../internals/to-primitive"),r=e("../internals/is-symbol");t.exports=function(e){var t=s(e,"string");return r(t)?t:t+""}},{"../internals/is-symbol":37,"../internals/to-primitive":56}],58:[function(e,t,n){var s={};s[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(s)},{"../internals/well-known-symbol":64}],59:[function(e,t,n){var s=String;t.exports=function(e){try{return s(e)}catch(e){return"Object"}}},{}],60:[function(e,t,n){var s=e("../internals/function-uncurry-this"),r=0,o=Math.random(),i=s(1..toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++r+o,36)}},{"../internals/function-uncurry-this":24}],61:[function(e,t,n){var s=e("../internals/symbol-constructor-detection");t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":50}],62:[function(e,t,n){var s=e("../internals/descriptors"),r=e("../internals/fails");t.exports=s&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},{"../internals/descriptors":14,"../internals/fails":19}],63:[function(e,t,n){var s=e("../internals/global"),r=e("../internals/is-callable"),o=s.WeakMap;t.exports=r(o)&&/native code/.test(String(o))},{"../internals/global":27,"../internals/is-callable":33}],64:[function(e,t,n){var s=e("../internals/global"),r=e("../internals/shared"),o=e("../internals/has-own-property"),i=e("../internals/uid"),a=e("../internals/symbol-constructor-detection"),l=e("../internals/use-symbol-as-uid"),u=s.Symbol,c=r("wks"),d=l?u.for||u:u&&u.withoutSetter||i;t.exports=function(e){return o(c,e)||(c[e]=a&&o(u,e)?u[e]:d("Symbol."+e)),c[e]}},{"../internals/global":27,"../internals/has-own-property":28,"../internals/shared":49,"../internals/symbol-constructor-detection":50,"../internals/uid":60,"../internals/use-symbol-as-uid":61}],65:[function(e,t,n){"use strict";var s=e("../internals/global"),r=e("../internals/function-call"),o=e("../internals/array-buffer-view-core"),i=e("../internals/length-of-array-like"),a=e("../internals/to-offset"),l=e("../internals/to-object"),u=e("../internals/fails"),c=s.RangeError,d=s.Int8Array,h=d&&d.prototype,f=h&&h.set,p=o.aTypedArray,m=o.exportTypedArrayMethod,b=!u((function(){var e=new Uint8ClampedArray(2);return r(f,e,{length:1,0:3},1),3!==e[1]})),y=b&&o.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){p(this);var t=a(arguments.length>1?arguments[1]:void 0,1),n=l(e);if(b)return r(f,this,n,t);var s=this.length,o=i(n),u=0;if(o+t>s)throw c("Wrong length");for(;u<o;)this[t+u]=n[u++]}),!b||y)},{"../internals/array-buffer-view-core":5,"../internals/fails":19,"../internals/function-call":21,"../internals/global":27,"../internals/length-of-array-like":38,"../internals/to-object":53,"../internals/to-offset":54}],66:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Build=void 0,n.Build={version:"8.4.0 (4acb79b41c497c20364b3f5efa11d44f)",buildSeed:1781869144337,"wdosbox-x-jspi.wasm":{size:7716284,gzSize:2703373},"wdosbox-x-jspi.js":{size:230214,gzSize:54298},"wdosbox-x.wasm":{size:7857437,gzSize:2753426},"wdosbox-x.js":{size:229414,gzSize:55196},"wdosbox.wasm":{size:1459705,gzSize:501642},"wdosbox.js":{size:110662,gzSize:29302},"wlibzip.wasm":{size:112483,gzSize:52219},"wlibzip.js":{size:72957,gzSize:19326}}},{}],67:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js");var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultConfig=void 0;const r=s(e("../../libzip/libzip")),o=e("../../http"),i=e("../../build");n.default=class{dosboxConf=n.defaultConfig;jsdosConf={version:i.Build.version};sources;libzipWasm;constructor(e){this.sources=[],this.libzipWasm=e}autoexec(){const e=this.dosboxConf.indexOf("[autoexec]");for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return this.dosboxConf=this.dosboxConf.substring(0,e)+"[autoexec]\nmount c .\nc:\n"+n.join("\n"),this}extract(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zip";return this.extractAll([{url:e,path:t,type:n}])}extractAll(e){return this.sources.push(...e),this}async toUint8Array(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t={};await this.libzipWasm.instantiate(t);const n=new r.default(t),s=[];for(const e of this.sources){if("zip"!==e.type)throw new Error("Only Zip is supported");const t=(0,o.httpRequest)(e.url,{responseType:"arraybuffer"}).then((t=>({source:e,data:new Uint8Array(t)})));s.push(t)}e||(await n.writeFile(".jsdos/dosbox.conf",this.dosboxConf),await n.writeFile(".jsdos/readme.txt",a),await n.writeFile(".jsdos/jsdos.json",JSON.stringify(this.jsdosConf,null,2)));const i=await Promise.all(s);for(const e of i)n.zipToFs(e.data,e.source.path);e&&(await n.writeFile(".jsdos/dosbox.conf",this.dosboxConf),await n.writeFile(".jsdos/readme.txt",a),await n.writeFile(".jsdos/jsdos.json",JSON.stringify(this.jsdosConf,null,2)));const l=await n.zipFromFs();return n.destroy(),l}};const a="\nPlease visit our website:\n\n _ __\n (_)____ ____/ /___ _____ _________ ____ ___\n / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\n / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\n __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\n /___/\n".replace(/\n/g,"\r\n");n.defaultConfig="[sdl]\nautolock=false\n\nfullscreen=false\nfulldouble=false\nfullresolution=original\nwindowresolution=original\noutput=surface\nsensitivity=100\nwaitonerror=true\npriority=higher,normal\nmapperfile=mapper-jsdos.map\nusescancodes=true\nvsync=false\n[dosbox]\nmachine=svga_s3\n\nlanguage=\ncaptures=capture\nmemsize=16\n[cpu]\ncore=auto\ncputype=auto\ncycles=auto\n\ncycleup=10\ncycledown=20\n[mixer]\nnosound=false\nrate=44100\n\nblocksize=1024\nprebuffer=20\n\n[render]\n# frameskip: How many frames DOSBox skips before drawing one.\n# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n# scaler: Scaler used to enlarge/enhance low resolution modes.\n# If 'forced' is appended, then the scaler will be used even if the result might not be desired.\n# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x.\n\nframeskip=0\naspect=false\nscaler=none\n\n[midi]\n# mpu401: Type of MPU-401 to emulate.\n# Possible values: intelligent, uart, none.\n# mididevice: Device that will receive the MIDI data from MPU-401.\n# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.\n# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.\n# See the README/Manual for more details.\n\nmpu401=intelligent\nmididevice=default\nmidiconfig=\n\n[sblaster]\n# sbtype: Type of Soundblaster to emulate. gb is Gameblaster.\n# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.\n# sbbase: The IO address of the soundblaster.\n# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.\n# irq: The IRQ number of the soundblaster.\n# Possible values: 7, 5, 3, 9, 10, 11, 12.\n# dma: The DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# hdma: The High DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.\n# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.\n# Possible values: auto, cms, opl2, dualopl2, opl3, none.\n# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).\n# Possible values: default, compat, fast.\n# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).\n# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.\n\nsbtype=sb16\nsbbase=220\nirq=7\ndma=1\nhdma=5\nsbmixer=true\noplmode=auto\noplemu=default\noplrate=44100\n\n[gus]\n# gus: Enable the Gravis Ultrasound emulation.\n# gusrate: Sample rate of Ultrasound emulation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# gusbase: The IO base address of the Gravis Ultrasound.\n# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.\n# gusirq: The IRQ number of the Gravis Ultrasound.\n# Possible values: 5, 3, 7, 9, 10, 11, 12.\n# gusdma: The DMA channel of the Gravis Ultrasound.\n# Possible values: 3, 0, 1, 5, 6, 7.\n# ultradir: Path to Ultrasound directory. In this directory\n# there should be a MIDI directory that contains\n# the patch files for GUS playback. Patch sets used\n# with Timidity should work fine.\n\ngus=false\ngusrate=44100\ngusbase=240\ngusirq=5\ngusdma=3\nultradir=C:\\ULTRASND\n\n[speaker]\n# pcspeaker: Enable PC-Speaker emulation.\n# pcrate: Sample rate of the PC-Speaker sound generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.\n# Possible values: auto, on, off.\n# tandyrate: Sample rate of the Tandy 3-Voice generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).\n\npcspeaker=true\npcrate=44100\ntandy=auto\ntandyrate=44100\ndisney=true\n\n[joystick]\n# joysticktype: Type of joystick to emulate: auto (default), none,\n# 2axis (supports two joysticks),\n# 4axis (supports one joystick, first joystick used),\n# 4axis_2 (supports one joystick, second joystick used),\n# fcs (Thrustmaster), ch (CH Flightstick).\n# none disables joystick emulation.\n# auto chooses emulation depending on real joystick(s).\n# (Remember to reset dosbox's mapperfile if you saved it earlier)\n# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.\n# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).\n# autofire: continuously fires as long as you keep the button pressed.\n# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.\n# buttonwrap: enable button wrapping at the number of emulated buttons.\n\njoysticktype=auto\ntimed=true\nautofire=false\nswap34=false\nbuttonwrap=false\n\n[serial]\n# serial1: set type of device connected to com port.\n# Can be disabled, dummy, modem, nullmodem, directserial.\n# Additional parameters must be in the same line in the form of\n# parameter:value. Parameter for all types is irq (optional).\n# for directserial: realport (required), rxdelay (optional).\n# (realport:COM1 realport:ttyS0).\n# for modem: listenport (optional).\n# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n# transparent, port, inhsocket (all optional).\n# Example: serial1=modem listenport:5000\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial2: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial3: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial4: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n\nserial1=dummy\nserial2=dummy\nserial3=disabled\nserial4=disabled\n\n[dos]\n# xms: Enable XMS support.\n# ems: Enable EMS support.\n# umb: Enable UMB support.\n# keyboardlayout: Language code of the keyboard layout (or none).\n\nxms=true\nems=true\numb=true\nkeyboardlayout=auto\n\n[ipx]\n# ipx: Enable ipx over UDP/IP emulation.\n\nipx=true\n[autoexec]\necho off\nmount c .\nc:\n\ntype jsdos~1/readme.txt\necho on\n\n# Generated using https://js-dos.com\n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n".replace(/\n/g,"\r\n")},{"../../build":66,"../../http":72,"../../libzip/libzip":76,"core-js/modules/es.typed-array.set.js":65}],68:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createAudioPort=void 0,n.createAudioPort=async function(){try{const e=new Blob([s],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new AudioContext({sampleRate:44100,latencyHint:"interactive"});if(44100!==n.sampleRate)return void console.error("sample rate is",n.sampleRate,"expected 44100, can't create worklet");await n.audioWorklet.addModule(t);const r=new AudioWorkletNode(n,"jsdos-audio",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[1]});r.connect(n.destination);const o=()=>{null!==n&&"suspended"===n.state&&n.resume().catch(console.error)};return document.addEventListener("pointerdown",o,{once:!0,capture:!0}),document.addEventListener("keydown",o,{once:!0,capture:!0}),r.port}catch(e){return void console.error("error creating audio port",e)}};const s=" \nclass SamplesQueue {\n constructor() {\n this.samplesQueue = [];\n this.started = false;\n }\n\n push(samples) {\n if (this.started) {\n this.samplesQueue.push(samples);\n }\n if (this.length() > 8192) {\n console.error(\"samples queue is too long, dropping samples\");\n this.samplesQueue = [samples];\n }\n }\n\n length() {\n let total = 0;\n for (const next of this.samplesQueue) {\n total += next.length;\n }\n return total;\n }\n\n writeTo(dst, bufferSize) {\n this.started = true;\n let writeIt = 0;\n while (this.samplesQueue.length > 0) {\n const src = this.samplesQueue[0];\n const toRead = Math.min(bufferSize - writeIt, src.length);\n if (toRead === src.length) {\n dst.set(src, writeIt);\n this.samplesQueue.shift();\n } else {\n dst.set(src.slice(0, toRead), writeIt);\n this.samplesQueue[0] = src.slice(toRead);\n }\n\n writeIt += toRead;\n\n if (writeIt === bufferSize) {\n break;\n }\n }\n\n if (writeIt < bufferSize) {\n dst.fill(0, writeIt);\n }\n }\n}\n\nclass Processor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.queue = new SamplesQueue();\n \n this.port.onmessage = (e) => {\n const chunk = e.data;\n if (chunk instanceof Float32Array) {\n this.queue.push(chunk);\n }\n };\n }\n \n process(inputs, outputs) {\n const output = outputs[0][0];\n this.queue.writeTo(output, output.length);\n return true;\n }\n}\n \nregisterProcessor('jsdos-audio', Processor);\n"},{}],69:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.dosDirect=void 0;const s=e("../../../protocol/messages-queue"),r=e("./audio-worklet");n.dosDirect=async function(e,t,n,o,i){const a=new s.MessagesQueue;let l=a.handler.bind(a);const u={postMessage:(e,t)=>{l(e,t)}},c=e=>{const n=e.data;"ws-sync-sleep"===n?.name&&n.props.sessionId===t&&postMessage({name:"wc-sync-sleep",props:n.props},"*")},d={sessionId:t,sendMessageToServer:(e,t)=>{u.messageHandler({data:{name:e,props:t}})},initMessageHandler:e=>{l=e,a.sendTo(l)},exit:()=>{"undefined"!=typeof window&&window.removeEventListener("message",c)},net:i??null};return d.module=u,"undefined"!=typeof window&&window.addEventListener("message",c,{passive:!0}),u.canvas=n,o&&(u.audioPort=await(0,r.createAudioPort)()),await e.instantiate(u),u.callMain([t]),d}},{"../../../protocol/messages-queue":77,"./audio-worklet":68}],70:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.dosWorker=void 0;const s=e("../../../protocol/messages-queue"),r=e("./audio-worklet");n.dosWorker=async function(e,t,n,o,i,a){const l=new s.MessagesQueue;let u=l.handler.bind(l);const c=await fetch(e);if(200!==c.status)throw new Error("Unable to download '"+e+"' ("+c.status+"): "+c.statusText);const d=URL.createObjectURL(await c.blob()),h=new Worker(d);h.onerror=e=>{u("ws-err",{type:e.type,filename:e.filename,message:e.message})},h.onmessage=e=>{const t=e.data;void 0!==t?.name&&u(t.name,t.props)};const f={sessionId:n,sendMessageToServer:(e,t,n)=>{n?h.postMessage({name:e,props:t},n):h.postMessage({name:e,props:t})},initMessageHandler:e=>{u=e,l.sendTo(u)},exit:()=>{URL.revokeObjectURL(d),h.terminate()},net:a??null},p=o?[o]:[];let m;i&&(m=await(0,r.createAudioPort)(),m&&p.push(m));try{f.sendMessageToServer("wc-install",{module:t.wasmModule,sessionId:n,canvas:o,audioPort:m},p)}catch(e){f.sendMessageToServer("wc-install",{sessionId:n,canvas:o,audioPort:m},p)}return f}},{"../../../protocol/messages-queue":77,"./audio-worklet":68}],71:[function(e,t,n){(function(t){(function(){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.NetworkType=void 0;const r=s(e("./impl/emulators-impl"));!function(e){e[e.NETWORK_DOSBOX_IPX=0]="NETWORK_DOSBOX_IPX"}(n.NetworkType||(n.NetworkType={})),"undefined"!=typeof window&&(window.emulators=r.default),void 0!==t&&(t.emulators=r.default)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./impl/emulators-impl":74}],72:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.httpRequest=void 0,n.httpRequest=function(e,t){return new Promise(((n,r)=>{new s(e,{...t,success:n,fail:e=>{r(new Error(e))}})}))};class s{resource;options;xhr=null;total=0;loaded=0;constructor(e,t){if(this.resource=e,this.options=t,this.options.method=t.method||"GET","GET"!==this.options.method)throw new Error("Method "+this.options.method+" is not supported");this.makeHttpRequest()}makeHttpRequest(){let e,t;this.xhr=new XMLHttpRequest,this.xhr.open(this.options.method||"GET",this.resource,!0),"POST"===this.options.method&&this.xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.xhr.overrideMimeType("text/plain; charset=x-user-defined"),"function"==typeof(e=this.xhr).addEventListener&&e.addEventListener("progress",(e=>{if(this.total=e.total,this.loaded=e.loaded,this.options.progress)return this.options.progress(e.total,e.loaded)})),"function"==typeof(t=this.xhr).addEventListener&&t.addEventListener("error",(()=>{if(this.options.fail)return this.options.fail("Unalbe to download '"+this.resource+"', code: "+this.xhr.status),delete this.options.fail})),this.xhr.onreadystatechange=()=>this.onReadyStateChange(),this.options.responseType&&(this.xhr.responseType=this.options.responseType),this.xhr.send(this.options.data)}onReadyStateChange(){const e=this.xhr;if(4===e.readyState)if(200===e.status){if(this.options.success){const t=Math.max(this.total,this.loaded);return void 0!==this.options.progress&&this.options.progress(t,t),this.options.success(e.response)}}else if(this.options.fail)return this.options.fail("Unable to download '"+this.resource+"', code: "+e.status),delete this.options.fail}}},{}],73:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CommandInterfaceEventsImpl=void 0;n.CommandInterfaceEventsImpl=class{onStdoutConsumers=[];delayedStdout=[];onFrameSizeConsumers=[];onFrameConsumers=[];onSoundPushConsumers=[];onExitConsumers=[];onMessageConsumers=[];delayedMessages=[];onNetworkConnectedConsumers=[];onNetworkDisconnectedConsumers=[];onUnloadConsumers=[];onStdout=e=>{if(this.onStdoutConsumers.push(e),1===this.onStdoutConsumers.length){for(const e of this.delayedStdout)this.fireStdout(e);this.delayedStdout=[]}};onFrameSize=e=>{this.onFrameSizeConsumers.push(e)};onFrame=e=>{this.onFrameConsumers.push(e)};onSoundPush=e=>{this.onSoundPushConsumers.push(e)};onExit=e=>{this.onExitConsumers.push(e)};onMessage=e=>{if(this.onMessageConsumers.push(e),1===this.onMessageConsumers.length){for(const t of this.delayedMessages)e(t.msgType,...t.args);this.delayedMessages=[]}};onNetworkConnected(e){this.onNetworkConnectedConsumers.push(e)}onNetworkDisconnected(e){this.onNetworkDisconnectedConsumers.push(e)}onUnload=e=>{this.onUnloadConsumers.push(e)};fireStdout=e=>{if(0!==this.onStdoutConsumers.length)for(const t of this.onStdoutConsumers)t(e);else this.delayedStdout.push(e)};fireFrameSize=(e,t)=>{for(const n of this.onFrameSizeConsumers)n(e,t)};fireFrame=(e,t)=>{for(const n of this.onFrameConsumers)n(e,t)};fireSoundPush=e=>{for(const t of this.onSoundPushConsumers)t(e)};fireExit=()=>{for(const e of this.onExitConsumers)e();this.onStdoutConsumers=[],this.onFrameSizeConsumers=[],this.onFrameConsumers=[],this.onSoundPushConsumers=[],this.onExitConsumers=[],this.onMessageConsumers=[]};fireMessage=(()=>{var e=this;return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];if(0!==e.onMessageConsumers.length)for(const n of e.onMessageConsumers)n(t,...s);else e.delayedMessages.push({msgType:t,args:s})}})();fireNetworkConnected=(e,t)=>{for(const n of this.onNetworkConnectedConsumers)n(e,t)};fireNetworkDisconnected=e=>{for(const t of this.onNetworkDisconnectedConsumers)t(e)};fireUnload=async()=>{const e=[];for(const t of this.onUnloadConsumers)e.push(t());await Promise.all(e)}}},{}],74:[function(e,t,n){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});const r=e("../build"),o=e("./modules"),i=s(e("../dos/bundle/dos-bundle")),a=e("../dos/dosbox/ts/direct"),l=e("../dos/dosbox/ts/worker"),u=e("../protocol/protocol"),c=s(e("../libzip/libzip"));const d=new class{pathPrefix="";pathSuffix="";version=r.Build.version;wdosboxJs="wdosbox.js";wdosboxxJs="wdosbox-x.js";wdosboxxJsJspi="wdosbox-x-jspi.js";wasmModulesPromise;async bundle(){const e=await this.wasmModules(),t=await e.libzip();return new i.default(t)}async bundleConfig(e){const t=await this.wasmModules(),n=await t.libzip(),s={};await n.instantiate(s);const o=new c.default(s);try{o.zipToFs(e,"/",".jsdos/");try{const e=await o.readFile(".jsdos/dosbox.conf");try{const t=await o.readFile(".jsdos/jsdos.json");return{dosboxConf:e,jsdosConf:JSON.parse(t)}}catch(e){}return{dosboxConf:e,jsdosConf:{version:r.Build.version}}}catch(e){}return null}finally{o.destroy()}}async bundleUpdateConfig(e,t){const n=await this.wasmModules(),s=await n.libzip(),r={};await s.instantiate(r);const o=new c.default(r);try{return await o.writeFile("bundle.zip",e),await o.writeFile(".jsdos/dosbox.conf",t.dosboxConf),await o.writeFile(".jsdos/jsdos.json",JSON.stringify(t.jsdosConf)),await o.zipAddFile("bundle.zip",".jsdos/jsdos.json"),await o.zipAddFile("bundle.zip",".jsdos/dosbox.conf"),await o.readFile("bundle.zip","binary")}finally{o.destroy()}}async dosboxNode(e,t){return this.dosboxDirect(e,t)}async dosboxDirect(e,t){const n=await this.wasmModules(),s=await n.dosbox(),r=await(0,a.dosDirect)(s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,r,t)}async dosboxWorker(e,t){const n=await this.wasmModules(),s=await n.dosbox(),r=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxJs+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,r,t)}async dosboxXNode(e,t){return this.dosboxXDirect(e,t)}async dosboxXDirect(e,t){const n=await this.wasmModules(),s=await n.dosboxx(),r=await(0,a.dosDirect)(s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,r,t)}async dosboxXWorker(e,t){const n=await this.wasmModules(),s=await n.dosboxx(),r=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxxJs+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,r,t)}async dosboxXJspiWorker(e,t){const n=await this.wasmModules(),s=await n.dosboxxJspi(),r=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxxJsJspi+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,r,t)}async backend(e,t,n){return new Promise(((s,r)=>{const o=new u.CommandInterfaceOverTransportLayer(Array.isArray(e)?e:[e],t,(e=>{null!==e?r(e):setTimeout((()=>s(o)),4)}),n||{})}))}wasmModules(){if(void 0!==this.wasmModulesPromise)return this.wasmModulesPromise;return this.wasmModulesPromise=(async()=>new o.WasmModulesImpl(this.pathPrefix,this.pathSuffix,this.wdosboxJs,this.wdosboxxJs,this.wdosboxxJsJspi))(),this.wasmModulesPromise}async dosDirect(e){return this.dosboxDirect(e)}async dosWorker(e){return this.dosboxWorker(e)}};n.default=d},{"../build":66,"../dos/bundle/dos-bundle":67,"../dos/dosbox/ts/direct":69,"../dos/dosbox/ts/worker":70,"../libzip/libzip":76,"../protocol/protocol":78,"./modules":75}],75:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.loadWasmModule=n.WasmModulesImpl=n.host=void 0;const s=e("../http");n.host=new class{wasmSupported=!1;globals;constructor(){if(this.globals="undefined"==typeof window?{}:window,this.globals.module||(this.globals.module={}),this.globals.exports||(this.globals.exports={}),this.globals.compiled||(this.globals.compiled={}),"object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate&&"function"==typeof WebAssembly.compile){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));e instanceof WebAssembly.Module&&(this.wasmSupported=new WebAssembly.Instance(e)instanceof WebAssembly.Instance)}Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){const n=65535&e,s=65535&t;return n*s+((e>>>16)*s+n*(t>>>16)<<16)|0}),Math.imul=Math.imul,Math.fround||(Math.fround=function(e){return e}),Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(let t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc}};function r(t,r,a){return"undefined"==typeof XMLHttpRequest?function(t,s,r){if(void 0!==n.host.globals.compiled[s])return n.host.globals.compiled[s];const i=e(t),a=Promise.resolve(new o(i));s&&(n.host.globals.compiled[s]=a);return a}(t,r):function(e,t,r){if(void 0!==n.host.globals.compiled[t])return n.host.globals.compiled[t];async function o(){const o=e.lastIndexOf("/"),a=e.indexOf("w",o),l=a===o+1&&a>=0;if(!n.host.wasmSupported||!l)throw new Error("Starting from js-dos 6.22.60 js environment is not supported");const u=e.lastIndexOf(".js"),c=e.substring(0,u)+".wasm"+e.substring(u+3),d=(0,s.httpRequest)(c,{responseType:"arraybuffer",progress:(t,n)=>{r("Resolving DosBox ("+e+")",t,n)}}),h=(0,s.httpRequest)(e,{progress:(e,t)=>{r("Resolving DosBox",e,t)}}),[f,p]=await Promise.all([d,h]),m=await WebAssembly.compile(f),b=(e,t)=>(e.env=e.env||{},WebAssembly.instantiate(m,e).then((e=>t(e,m))));return eval.call(window,p),n.host.globals.exports[t]=n.host.globals.module.exports,new i(m,n.host.globals.exports[t],b)}const a=o();t&&(n.host.globals.compiled[t]=a);return a}(t,r,a)}n.WasmModulesImpl=class{pathPrefix;pathSuffix;wdosboxJs;wdosboxxJs;wdosboxxJsJspi;libzipPromise;dosboxPromise;dosboxxPromise;dosboxxJspiPromise;wasmSupported=!1;constructor(e,t,n,s,r){e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.pathPrefix=e,this.pathSuffix=t,this.wdosboxJs=n,this.wdosboxxJs=s,this.wdosboxxJsJspi=r}libzip(){return void 0!==this.libzipPromise||(this.libzipPromise=this.loadModule(this.pathPrefix+"wlibzip.js"+this.pathSuffix,"WLIBZIP")),this.libzipPromise}dosbox(){return void 0!==this.dosboxPromise||(this.dosboxPromise=this.loadModule(this.pathPrefix+this.wdosboxJs+this.pathSuffix,"WDOSBOX")),this.dosboxPromise}dosboxx(){return void 0!==this.dosboxxPromise||(this.dosboxxPromise=this.loadModule(this.pathPrefix+this.wdosboxxJs+this.pathSuffix,"WDOSBOXX")),this.dosboxxPromise}dosboxxJspi(){return void 0!==this.dosboxxJspiPromise||(this.dosboxxJspiPromise=this.loadModule(this.pathPrefix+this.wdosboxxJsJspi+this.pathSuffix,"WDOSBOXXJSPI")),this.dosboxxJspiPromise}loadModule(e,t){return r(e,t,(()=>{}))}},n.loadWasmModule=r;class o{emModule;constructor(e){this.emModule=e}async instantiate(e){await this.emModule(e)}}class i{wasmModule;module;instantiateWasm;constructor(e,t,n){this.wasmModule=e,this.module=t,this.instantiateWasm=n}async instantiate(e){e.instantiateWasm=this.instantiateWasm,await this.module(e)}}},{"../http":72,"core-js/modules/es.typed-array.set.js":65}],76:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0});n.default=class{module;home;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/home/web_user";this.module=e,this.home=t,this.module.callMain([]),this.module.FS.ignorePermissions=!0,this.chdirToHome()}zipFromFs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.chdirToHome();const t=this.module._zip_from_fs(e);if(0===t)return Promise.reject(new Error("Can't create zip, see more info in logs"));const n=this.module.HEAPU32[t/4],s=this.module.HEAPU8.slice(t+4,t+4+n);return this.module._free(t),Promise.resolve(s)}zipToFs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2?arguments[2]:void 0;const s=this.module;t=this.normalizeFilename(t);const r=this.normalizeFilename(t).split("/");this.createPath(r,0,r.length),this.chdir(t);const o=void 0!==n&&n.length>0;let i=0;if(o){const e=s.lengthBytesUTF8(n)+1;i=s._malloc(e),s.stringToUTF8(n,i,e)}const a=new Uint8Array(e),l=s._malloc(a.length);s.HEAPU8.set(a,l);const u=s._zip_to_fs(l,a.length,i);return s._free(l),this.chdirToHome(),o&&s._free(i),0===u?Promise.resolve():Promise.reject(new Error("Can't extract zip, retcode "+u+", see more info in logs"))}writeFile(e,t){e=this.normalizeFilename(e),t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=e.split("/");if(0===n.length)throw new Error("Can't create file '"+e+"', because it's not valid file path");const s=n[n.length-1].trim();if(0===s.length)throw new Error("Can't create file '"+e+"', because file name is empty");const r=this.createPath(n,0,n.length-1);this.module.FS.writeFile(r+"/"+s,t)}async readFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";return e=this.normalizeFilename(e),this.module.FS.readFile(e,{encoding:t})}exists(e){e=this.normalizeFilename(e);try{return this.module.FS.lookupPath(e),!0}catch(e){return!1}}destroy(){try{this.module._libzip_destroy()}catch(e){return e}}normalizeFilename(e){for(e=e.replace(new RegExp("^[a-zA-z]+:"),"").replace(new RegExp("\\\\","g"),"/");"/"===e[0];)e=e.substr(1);return e}createPath(e,t,n){let s=".";for(let r=t;r<n;++r){const t=e[r].trim();0!==t.length&&(this.module.FS.createPath(s,t,!0,!0),s=s+"/"+t)}return s}chdirToHome(){this.module.FS.chdir(this.home)}chdir(e){this.module.FS.chdir(this.home+"/"+e)}async zipAddFile(e,t){const n=this.module,s=n.lengthBytesUTF8(e)+1,r=n._malloc(s);n.stringToUTF8(e,r,s);const o=n.lengthBytesUTF8(t)+1,i=n._malloc(o);n.stringToUTF8(t,i,o);const a=this.module._zipfile_add(r,i,i);if(n._free(r),n._free(i),0!==a)throw new Error("Unable to add "+t+" into "+e)}}},{"core-js/modules/es.typed-array.set.js":65}],77:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MessagesQueue=void 0;n.MessagesQueue=class{messages=[];handler(e,t){this.messages.push({name:e,props:t})}sendTo(e){for(const t of this.messages)e(t.name,t.props);this.messages=[]}}},{}],78:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.CommandInterfaceOverTransportLayer=void 0;const s=e("../impl/ci-impl"),r=4194304;n.CommandInterfaceOverTransportLayer=class{startedAt=Date.now();exited=!1;frameWidth=0;frameHeight=0;rgb=null;rgba=null;freq=0;utf8Decoder=new TextDecoder;init;transport;ready;persistPromise;persistResolve;exitPromise;exitResolve;eventsImpl=new s.CommandInterfaceEventsImpl;keyMatrix={};configPromise;configResolve=()=>{};panicMessages=[];connectPromise=null;connectResolve=()=>{};connectReject=()=>{};disconnectPromise=null;disconnectResolve=()=>{};asyncifyStatsPromise=null;asyncifyStatsResolve=()=>{};fsTreePromise=null;fsTreeResolve=()=>{};fsGetFilePromise={};fsGetFileResolve={};fsGetFileParts={};fsDeleteFilePromise=null;fsDeleteFileResolve=()=>{};getRunningProgramPromise=null;getRunningProgramResolve=()=>{};dataChunkPromise={};dataChunkResolve={};persistSockdrivesPromise=null;persistSockdrivesResolve=()=>{};myPeerId=0;netSent=0;netRecv=0;netPollInterval=null;options;constructor(e,t,n,s){this.options=s,this.init=e,this.transport=t,this.ready=n,this.configPromise=new Promise((e=>this.configResolve=e)),this.transport.initMessageHandler(this.onServerMessage.bind(this)),this.transport.net=this.transport.net??null,this.transport.net&&(this.myPeerId=this.transport.net.peerId,this.netPollInterval=setInterval((()=>{this.transport.net.wait(0);let e=this.transport.net.recvBinary();for(;null!=e;)this.netRecv+=e.data.length,this.sendClientMessage("wc-net-received",{peerId:e.peerId,data:e.data.buffer},[e.data.buffer]),e=this.transport.net.recvBinary()}),16))}sendClientMessage(e,t,n){(t=t||{}).sessionId=t.sessionId||this.transport.sessionId,this.transport.sendMessageToServer(e,t,n)}onServerMessage(e,t){if(!(void 0===e||e.length<3||"w"!==e[0]||"s"!==e[1]||"-"!==e[2])&&void 0!==t&&t.sessionId===this.transport.sessionId)switch(e){case"ws-ready":{const e=async()=>{if(!this.init||0===this.init.length)return;const e=new TextEncoder,t=async(e,t,n)=>{await this.sendDataChunk({type:e,name:t,data:n.buffer}),await this.sendDataChunk({type:e,name:t,data:null})};let n=0;for(const s of this.init)if(ArrayBuffer.isView(s))await t("bundle",n+"",s),n++;else if("string"==typeof s)await t("file",".jsdos/dosbox.conf",e.encode(s));else{const n=s,r=s;void 0!==r.jsdosConf?.version?(await t("file",".jsdos/dosbox.conf",e.encode(r.dosboxConf)),await t("file",".jsdos/jsdos.json",e.encode(JSON.stringify(r.jsdosConf,null,2)))):void 0!==n.path?await t("file",n.path,n.contents):console.error("Unknown init part",s)}};e().then((()=>{this.sendClientMessage("wc-run",{token:this.options.token,myPeerId:this.myPeerId,sockdrivePreload:this.options.sockdrivePreload})})).catch((e=>{this.onErr("panic","Can't send bundles to backend: "+e.message),console.error(e)})).finally((()=>{delete this.init}))}break;case"ws-server-ready":this.panicMessages.length>0?(void 0!==this.transport.exit&&this.transport.exit(),this.ready(new Error(JSON.stringify(this.panicMessages)))):this.ready(null),delete this.ready;break;case"ws-frame-set-size":this.onFrameSize(t.width,t.height);break;case"ws-update-lines":this.onFrameLines(t.lines,t.rgba);break;case"ws-exit":this.onExit();break;case"ws-log":this.onLog(t.tag,t.message);break;case"ws-warn":this.onWarn(t.tag,t.message);break;case"ws-err":this.onErr(t.tag,t.message);break;case"ws-stdout":this.onStdout(t.message);break;case"ws-persist":this.onPersist(t.bundle??t.sockdrives??null);break;case"ws-sound-init":this.onSoundInit(t.freq);break;case"ws-sound-push":this.onSoundPush(t.samples);break;case"ws-config":this.onConfig({dosboxConf:this.utf8Decoder.decode(t.dosboxConf),jsdosConf:JSON.parse(t.jsdosConf)});break;case"ws-sync-sleep":this.sendClientMessage("wc-sync-sleep",t);break;case"ws-connected":this.connectResolve(),this.connectPromise=null,this.connectResolve=()=>{},this.connectReject=()=>{},this.eventsImpl.fireNetworkConnected(t.networkType,t.address);break;case"ws-disconnected":null!==this.connectPromise?(this.connectReject(),this.connectPromise=null,this.connectResolve=()=>{},this.connectReject=()=>{}):(this.disconnectResolve(),this.disconnectPromise=null,this.disconnectResolve=()=>{}),this.eventsImpl.fireNetworkDisconnected(t.networkType);break;case"ws-extract-progress":this.options.onExtractProgress&&this.options.onExtractProgress(t.index,t.file,t.extracted,t.count);break;case"ws-asyncify-stats":if(t.netSent=this.netSent,t.netRecv=this.netRecv,t.cpuMetrics&&t.cpuMetrics.length>0){const e=t.cpuMetrics.split(" "),n=e[0].split("|"),s={cpuMax:parseInt(n[0]),emulatorSpeed:parseInt(n[1])/100,cpuUsed:parseInt(n[2])/100,frameSkip:parseInt(n[3]),fastForward:"1"===n[4][0],cpuSockdrive:"1"===n[4][1],cpuAuto:"1"===n[4][2],cpuSkip:"1"===n[4][3],sleepPattern:"",ratio:[],newCmax:[],ticksDone:[],ticksScheduled:[]};for(let t=1;t<e.length;t++)if("r"===e[t][0]){const n=e[t].split("|");s.ratio.push(parseInt(n[0].substring(1))/1024),s.newCmax.push(parseInt(n[1])),s.ticksDone.push(parseInt(n[2])),s.ticksScheduled.push(parseInt(n[3]))}else s.sleepPattern+=e[t]+" ";t.cpuMetrics=s}else t.cpuMetrics=null;this.asyncifyStatsResolve(t),this.asyncifyStatsResolve=()=>{},this.asyncifyStatsPromise=null;break;case"ws-fs-tree":this.fsTreeResolve(t.fsTree),this.fsTreeResolve=()=>{},this.fsTreePromise=null;break;case"ws-fs-delete-file":this.fsDeleteFileResolve(t.deleted),this.fsDeleteFileResolve=()=>{},this.fsDeleteFilePromise=null;break;case"ws-send-data-chunk":{const e=t.chunk,n=this.dataChunkKey(e);if("ok"===e.type)void 0!==this.dataChunkPromise[n]&&(this.dataChunkResolve[n](),delete this.dataChunkPromise[n],delete this.dataChunkResolve[n]);else if("file"===e.type)if(null===e.data){const t=this.mergeChunks(this.fsGetFileParts[e.name]);this.fsGetFileResolve[e.name](t),delete this.fsGetFilePromise[e.name],delete this.fsGetFileResolve[e.name]}else this.fsGetFileParts[e.name].push(new Uint8Array(e.data));else console.log("Unknown chunk type:",e.type)}break;case"ws-net-send":{this.netSent+=t.data.length;const e=this.transport.net?.sendBinary(new Uint8Array(t.data),t.peerId);if(0===e){const e=()=>{0===this.transport.net?.sendBinary(new Uint8Array(t.data),t.peerId)&&setTimeout(e,100)};setTimeout(e,100)}}break;case"ws-net-disconnect":this.transport.net?.disconnect(t.peerId);break;case"ws-unload":this.eventsImpl.fireUnload().finally((()=>{this.sendClientMessage("wc-unload")}));break;case"ws-persist-sockdrives":null===t.drives?this.persistSockdrivesResolve(null):this.persistSockdrivesResolve(function(e){function t(e,t,n){return e[n]=255&t,e[n+1]=(65280&t)>>8,e[n+2]=(16711680&t)>>16,e[n+3]=(4278190080&t)>>24,n+4}const n=new TextEncoder,s=[];let r=0;for(const{url:t,persist:o}of e)s.push(n.encode(t)),r+=o.length+s[s.length-1].length+8;const o=new Uint8Array(r);let i=0;for(let n=0;n<e.length;n++){const r=s[n],a=e[n].persist;i=t(o,r.length,i),o.set(r,i),i+=r.length,i=t(o,a.length,i),o.set(a,i),i+=a.length}return o}(t.drives)),this.persistSockdrivesResolve=()=>{},this.persistSockdrivesPromise=null;break;case"ws-get-running-program":null!==this.getRunningProgramPromise&&(this.getRunningProgramResolve(t.program),this.getRunningProgramResolve=()=>{},this.getRunningProgramPromise=null);break;default:console.log("Unknown server message (ws):",e)}}onConfig(e){this.configResolve(e)}onFrameSize(e,t){this.frameWidth===e&&this.frameHeight===t||(this.frameWidth=e,this.frameHeight=t,this.rgb=new Uint8Array(e*t*3),this.eventsImpl.fireFrameSize(e,t))}onFrameLines(e,t){for(const t of e)this.rgb.set(t.heapu8,t.start*this.frameWidth*3);this.eventsImpl.fireFrame(this.rgb,this.rgba)}onSoundInit(e){this.freq=e}onSoundPush(e){this.eventsImpl.fireSoundPush(e)}onLog(e,t){this.eventsImpl.fireMessage("log","["+e+"]"+t)}onWarn(e,t){this.eventsImpl.fireMessage("warn","["+e+"]"+t)}onErr(e,t){"panic"===e&&(this.panicMessages.push(t),console.error("["+e+"]"+t)),this.eventsImpl.fireMessage("error","["+e+"]"+t)}onStdout(e){this.eventsImpl.fireStdout(e)}config(){return this.configPromise}width(){return this.frameWidth}height(){return this.frameHeight}soundFrequency(){return this.freq}screenshot(){if(null!==this.rgb||null!==this.rgba){const e=new Uint8ClampedArray(this.frameWidth*this.frameHeight*4),t=null!==this.rgb?this.rgb:this.rgba;let n=0,s=0;for(;s<e.length;)e[s++]=t[n++],e[s++]=t[n++],e[s++]=t[n++],e[s++]=255,t.length===e.length&&n++;return Promise.resolve(new ImageData(e,this.frameWidth,this.frameHeight))}return Promise.reject(new Error("No frame received"))}simulateKeyPress(){const e=Date.now()-this.startedAt;for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];n.forEach((t=>this.addKey(t,!0,e))),n.forEach((t=>this.addKey(t,!1,e+16)))}sendKeyEvent(e,t){this.addKey(e,t,Date.now()-this.startedAt)}addKey(e,t,n){!0===this.keyMatrix[e]!==t&&(this.keyMatrix[e]=t,this.sendClientMessage("wc-add-key",{key:e,pressed:t,timeMs:n}))}sendMouseMotion(e,t){this.sendClientMessage("wc-mouse-move",{x:e,y:t,relative:!1,timeMs:Date.now()-this.startedAt})}sendMouseRelativeMotion(e,t){this.sendClientMessage("wc-mouse-move",{x:e,y:t,relative:!0,timeMs:Date.now()-this.startedAt})}sendMouseButton(e,t){this.sendClientMessage("wc-mouse-button",{button:e,pressed:t,timeMs:Date.now()-this.startedAt})}sendMouseSync(){this.sendClientMessage("wc-mouse-sync",{timeMs:Date.now()-this.startedAt})}sendBackendEvent(e){this.sendClientMessage("wc-backend-event",{json:JSON.stringify(e)})}async persist(e){const t=e??!0;if(void 0!==this.persistPromise)return this.persistPromise;const n=await this.persistSockdrives();if(null!==n&&t)return Promise.resolve(n);const s=new Promise((e=>{this.persistResolve=e}));return this.persistPromise=s,this.sendClientMessage("wc-pack-fs-to-bundle",{onlyChanges:t}),s}onPersist(e){this.persistResolve&&(this.persistResolve(e),delete this.persistPromise,delete this.persistResolve)}pause(){this.sendClientMessage("wc-pause")}resume(){this.sendClientMessage("wc-resume")}mute(){this.sendClientMessage("wc-mute")}unmute(){this.sendClientMessage("wc-unmute")}exit(){if(this.exited)return Promise.resolve();if(void 0!==this.exitPromise)return this.exitPromise;this.exitPromise=new Promise((e=>this.exitResolve=e)),this.exitPromise.then((()=>{this.events().fireExit()})),this.resume();for(const e of this.transport.net?.connected??[])this.transport.net?.disconnect(e);return this.sendClientMessage("wc-exit"),this.exitPromise}onExit(){this.exited||(this.exited=!0,null!==this.netPollInterval&&(clearInterval(this.netPollInterval),this.netPollInterval=null),void 0!==this.transport.exit&&this.transport.exit(),this.exitResolve&&(this.exitResolve(),delete this.exitPromise,delete this.exitResolve))}events(){return this.eventsImpl}networkConnect(e,t){return null!==this.connectPromise||null!==this.disconnectPromise?Promise.reject(new Error("Already prefoming connection or disconnection...")):(this.connectPromise=new Promise(((n,s)=>{this.connectResolve=n,this.connectReject=s,this.sendClientMessage("wc-connect",{networkType:e,address:t})})),this.connectPromise)}networkDisconnect(e){return null!==this.connectPromise||null!==this.disconnectPromise?Promise.reject(new Error("Already prefoming connection or disconnection...")):(this.disconnectPromise=new Promise((t=>{this.disconnectResolve=t,this.sendClientMessage("wc-disconnect",{networkType:e})})),this.disconnectPromise)}asyncifyStats(){if(null!==this.asyncifyStatsPromise)return this.asyncifyStatsPromise;const e=new Promise((e=>{this.asyncifyStatsResolve=e}));return this.asyncifyStatsPromise=e,this.sendClientMessage("wc-asyncify-stats",{}),e}fsTree(){if(null!==this.fsTreePromise)return this.fsTreePromise;const e=new Promise((e=>{this.fsTreeResolve=e}));return this.fsTreePromise=e,this.sendClientMessage("wc-fs-tree"),e}async fsReadFile(e){if(void 0!==this.fsGetFilePromise[e])throw new Error("fsGetFile should not be called twice for same file");const t=new Promise((t=>{this.fsGetFileResolve[e]=t}));return this.fsGetFilePromise[e]=t,this.fsGetFileParts[e]=[],this.sendClientMessage("wc-fs-get-file",{file:e}),t}async fsWriteFile(e,t){if(ArrayBuffer.isView(t))await this.sendDataChunk({type:"file",name:e,data:t.buffer});else{const n=t.getReader();for(;;){const t=await n.read();if(void 0!==t.value&&await this.sendDataChunk({type:"file",name:e,data:t.value.buffer}),t.done)break}}await this.sendDataChunk({type:"file",name:e,data:null})}async fsDeleteFile(e){if(null!==this.fsDeleteFilePromise)throw new Error("fsDeleteFile should not be called while previous one is not resolved");const t=new Promise((e=>{this.fsDeleteFileResolve=e}));return this.fsDeleteFilePromise=t,this.sendClientMessage("wc-fs-delete-file",{file:e}),t}async persistSockdrives(){return null===this.persistSockdrivesPromise&&(this.persistSockdrivesPromise=new Promise((e=>{this.persistSockdrivesResolve=e})),this.sendClientMessage("wc-persist-sockdrives")),this.persistSockdrivesPromise}async sendDataChunk(e){if(null===e.data||e.data.byteLength<=r)return this.sendFullDataChunk(e);{let t=0;for(;t<e.data.byteLength;)await this.sendFullDataChunk({type:e.type,name:e.name,data:e.data.slice(t,Math.min(e.data.byteLength,t+r))}),t+=r}}async sendFullDataChunk(e){const t=this.dataChunkKey(e);if(void 0!==this.dataChunkPromise[t])throw new Error("sendDataChunk should be accepted before sending new one");const n=new Promise((e=>{this.dataChunkResolve[t]=e}));return this.dataChunkPromise[t]=n,this.sendClientMessage("wc-send-data-chunk",{chunk:e},null===e.data?void 0:[e.data]),n}dataChunkKey(e){return e.name}mergeChunks(e){if(1===e.length)return e[0];let t=0;for(const n of e)t+=n.byteLength;const n=new Uint8Array(t);t=0;for(const s of e)n.set(s,t),t+=s.byteLength;return n}net(){return this.transport.net??null}getRunningProgram(){return null!==this.getRunningProgramPromise||(this.getRunningProgramPromise=new Promise((e=>{this.getRunningProgramResolve=e})),this.sendClientMessage("wc-get-running-program")),this.getRunningProgramPromise}}},{"../impl/ci-impl":73,"core-js/modules/es.typed-array.set.js":65}]},{},[71]);
|
|
1
|
+
!function e(t,n,s){function i(r,a){if(!n[r]){if(!t[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(o)return o(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[r]={exports:{}};t[r][0].call(u.exports,(function(e){return i(t[r][1][e]||e)}),u,u.exports,e,t,n,s)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<s.length;r++)i(s[r]);return i}({1:[function(e,t,n){var s=e("../internals/is-callable"),i=e("../internals/try-to-string"),o=TypeError;t.exports=function(e){if(s(e))return e;throw o(i(e)+" is not a function")}},{"../internals/is-callable":33,"../internals/try-to-string":59}],2:[function(e,t,n){var s=e("../internals/is-callable"),i=String,o=TypeError;t.exports=function(e){if("object"==typeof e||s(e))return e;throw o("Can't set "+i(e)+" as a prototype")}},{"../internals/is-callable":33}],3:[function(e,t,n){var s=e("../internals/is-object"),i=String,o=TypeError;t.exports=function(e){if(s(e))return e;throw o(i(e)+" is not an object")}},{"../internals/is-object":35}],4:[function(e,t,n){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],5:[function(e,t,n){"use strict";var s,i,o,r=e("../internals/array-buffer-basic-detection"),a=e("../internals/descriptors"),l=e("../internals/global"),c=e("../internals/is-callable"),u=e("../internals/is-object"),d=e("../internals/has-own-property"),h=e("../internals/classof"),f=e("../internals/try-to-string"),p=e("../internals/create-non-enumerable-property"),m=e("../internals/define-built-in"),y=e("../internals/define-built-in-accessor"),b=e("../internals/object-is-prototype-of"),g=e("../internals/object-get-prototype-of"),w=e("../internals/object-set-prototype-of"),v=e("../internals/well-known-symbol"),x=e("../internals/uid"),P=e("../internals/internal-state"),k=P.enforce,S=P.get,_=l.Int8Array,M=_&&_.prototype,j=l.Uint8ClampedArray,C=j&&j.prototype,z=_&&g(_),T=M&&g(M),R=Object.prototype,A=l.TypeError,F=v("toStringTag"),O=x("TYPED_ARRAY_TAG"),D="TypedArrayConstructor",E=r&&!!w&&"Opera"!==h(l.opera),I=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},W=function(e){var t=g(e);if(u(t)){var n=S(t);return n&&d(n,D)?n.TypedArrayConstructor:W(t)}},H=function(e){if(!u(e))return!1;var t=h(e);return d(U,t)||d(L,t)};for(s in U)(o=(i=l[s])&&i.prototype)?k(o).TypedArrayConstructor=i:E=!1;for(s in L)(o=(i=l[s])&&i.prototype)&&(k(o).TypedArrayConstructor=i);if((!E||!c(z)||z===Function.prototype)&&(z=function(){throw A("Incorrect invocation")},E))for(s in U)l[s]&&w(l[s],z);if((!E||!T||T===R)&&(T=z.prototype,E))for(s in U)l[s]&&w(l[s].prototype,T);if(E&&g(C)!==T&&w(C,T),a&&!d(T,F))for(s in I=!0,y(T,F,{configurable:!0,get:function(){return u(this)?this[O]:void 0}}),U)l[s]&&p(l[s],O,s);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:I&&O,aTypedArray:function(e){if(H(e))return e;throw A("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!w||b(z,e)))return e;throw A(f(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,s){if(a){if(n)for(var i in U){var o=l[i];if(o&&d(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}T[e]&&!n||m(T,e,n?t:E&&M[e]||t,s)}},exportTypedArrayStaticMethod:function(e,t,n){var s,i;if(a){if(w){if(n)for(s in U)if((i=l[s])&&d(i,e))try{delete i[e]}catch(e){}if(z[e]&&!n)return;try{return m(z,e,n?t:E&&z[e]||t)}catch(e){}}for(s in U)!(i=l[s])||i[e]&&!n||m(i,e,t)}},getTypedArrayConstructor:W,isView:function(e){if(!u(e))return!1;var t=h(e);return"DataView"===t||d(U,t)||d(L,t)},isTypedArray:H,TypedArray:z,TypedArrayPrototype:T}},{"../internals/array-buffer-basic-detection":4,"../internals/classof":7,"../internals/create-non-enumerable-property":9,"../internals/define-built-in":12,"../internals/define-built-in-accessor":11,"../internals/descriptors":14,"../internals/global":27,"../internals/has-own-property":28,"../internals/internal-state":32,"../internals/is-callable":33,"../internals/is-object":35,"../internals/object-get-prototype-of":42,"../internals/object-is-prototype-of":43,"../internals/object-set-prototype-of":44,"../internals/try-to-string":59,"../internals/uid":60,"../internals/well-known-symbol":64}],6:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=s({}.toString),o=s("".slice);t.exports=function(e){return o(i(e),8,-1)}},{"../internals/function-uncurry-this":24}],7:[function(e,t,n){var s=e("../internals/to-string-tag-support"),i=e("../internals/is-callable"),o=e("../internals/classof-raw"),r=e("../internals/well-known-symbol")("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}());t.exports=s?o:function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=a(e),r))?n:l?o(t):"Object"==(s=o(t))&&i(t.callee)?"Arguments":s}},{"../internals/classof-raw":6,"../internals/is-callable":33,"../internals/to-string-tag-support":58,"../internals/well-known-symbol":64}],8:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":19}],9:[function(e,t,n){var s=e("../internals/descriptors"),i=e("../internals/object-define-property"),o=e("../internals/create-property-descriptor");t.exports=s?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},{"../internals/create-property-descriptor":10,"../internals/descriptors":14,"../internals/object-define-property":41}],10:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],11:[function(e,t,n){var s=e("../internals/make-built-in"),i=e("../internals/object-define-property");t.exports=function(e,t,n){return n.get&&s(n.get,t,{getter:!0}),n.set&&s(n.set,t,{setter:!0}),i.f(e,t,n)}},{"../internals/make-built-in":39,"../internals/object-define-property":41}],12:[function(e,t,n){var s=e("../internals/is-callable"),i=e("../internals/object-define-property"),o=e("../internals/make-built-in"),r=e("../internals/define-global-property");t.exports=function(e,t,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(s(n)&&o(n,c,a),a.global)l?e[t]=n:r(t,n);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},{"../internals/define-global-property":13,"../internals/is-callable":33,"../internals/make-built-in":39,"../internals/object-define-property":41}],13:[function(e,t,n){var s=e("../internals/global"),i=Object.defineProperty;t.exports=function(e,t){try{i(s,e,{value:t,configurable:!0,writable:!0})}catch(n){s[e]=t}return t}},{"../internals/global":27}],14:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":19}],15:[function(e,t,n){var s="object"==typeof document&&document.all,i=void 0===s&&void 0!==s;t.exports={all:s,IS_HTMLDDA:i}},{}],16:[function(e,t,n){var s=e("../internals/global"),i=e("../internals/is-object"),o=s.document,r=i(o)&&i(o.createElement);t.exports=function(e){return r?o.createElement(e):{}}},{"../internals/global":27,"../internals/is-object":35}],17:[function(e,t,n){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},{}],18:[function(e,t,n){var s,i,o=e("../internals/global"),r=e("../internals/engine-user-agent"),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(s=u.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!i&&r&&(!(s=r.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=r.match(/Chrome\/(\d+)/))&&(i=+s[1]),t.exports=i},{"../internals/engine-user-agent":17,"../internals/global":27}],19:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],20:[function(e,t,n){var s=e("../internals/fails");t.exports=!s((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},{"../internals/fails":19}],21:[function(e,t,n){var s=e("../internals/function-bind-native"),i=Function.prototype.call;t.exports=s?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":20}],22:[function(e,t,n){var s=e("../internals/descriptors"),i=e("../internals/has-own-property"),o=Function.prototype,r=s&&Object.getOwnPropertyDescriptor,a=i(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!s||s&&r(o,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},{"../internals/descriptors":14,"../internals/has-own-property":28}],23:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=e("../internals/a-callable");t.exports=function(e,t,n){try{return s(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},{"../internals/a-callable":1,"../internals/function-uncurry-this":24}],24:[function(e,t,n){var s=e("../internals/function-bind-native"),i=Function.prototype,o=i.call,r=s&&i.bind.bind(o,o);t.exports=s?r:function(e){return function(){return o.apply(e,arguments)}}},{"../internals/function-bind-native":20}],25:[function(e,t,n){var s=e("../internals/global"),i=e("../internals/is-callable"),o=function(e){return i(e)?e:void 0};t.exports=function(e,t){return arguments.length<2?o(s[e]):s[e]&&s[e][t]}},{"../internals/global":27,"../internals/is-callable":33}],26:[function(e,t,n){var s=e("../internals/a-callable"),i=e("../internals/is-null-or-undefined");t.exports=function(e,t){var n=e[t];return i(n)?void 0:s(n)}},{"../internals/a-callable":1,"../internals/is-null-or-undefined":34}],27:[function(e,t,n){(function(e){(function(){var n=function(e){return e&&e.Math==Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=e("../internals/to-object"),o=s({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},{"../internals/function-uncurry-this":24,"../internals/to-object":53}],29:[function(e,t,n){t.exports={}},{}],30:[function(e,t,n){var s=e("../internals/descriptors"),i=e("../internals/fails"),o=e("../internals/document-create-element");t.exports=!s&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":14,"../internals/document-create-element":16,"../internals/fails":19}],31:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=e("../internals/is-callable"),o=e("../internals/shared-store"),r=s(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return r(e)}),t.exports=o.inspectSource},{"../internals/function-uncurry-this":24,"../internals/is-callable":33,"../internals/shared-store":48}],32:[function(e,t,n){var s,i,o,r=e("../internals/weak-map-basic-detection"),a=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/has-own-property"),d=e("../internals/shared-store"),h=e("../internals/shared-key"),f=e("../internals/hidden-keys"),p="Object already initialized",m=a.TypeError,y=a.WeakMap;if(r||d.state){var b=d.state||(d.state=new y);b.get=b.get,b.has=b.has,b.set=b.set,s=function(e,t){if(b.has(e))throw m(p);return t.facade=e,b.set(e,t),t},i=function(e){return b.get(e)||{}},o=function(e){return b.has(e)}}else{var g=h("state");f[g]=!0,s=function(e,t){if(u(e,g))throw m(p);return t.facade=e,c(e,g,t),t},i=function(e){return u(e,g)?e[g]:{}},o=function(e){return u(e,g)}}t.exports={set:s,get:i,has:o,enforce:function(e){return o(e)?i(e):s(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return n}}}},{"../internals/create-non-enumerable-property":9,"../internals/global":27,"../internals/has-own-property":28,"../internals/hidden-keys":29,"../internals/is-object":35,"../internals/shared-key":47,"../internals/shared-store":48,"../internals/weak-map-basic-detection":63}],33:[function(e,t,n){var s=e("../internals/document-all"),i=s.all;t.exports=s.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},{"../internals/document-all":15}],34:[function(e,t,n){t.exports=function(e){return null==e}},{}],35:[function(e,t,n){var s=e("../internals/is-callable"),i=e("../internals/document-all"),o=i.all;t.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:s(e)||e===o}:function(e){return"object"==typeof e?null!==e:s(e)}},{"../internals/document-all":15,"../internals/is-callable":33}],36:[function(e,t,n){t.exports=!1},{}],37:[function(e,t,n){var s=e("../internals/get-built-in"),i=e("../internals/is-callable"),o=e("../internals/object-is-prototype-of"),r=e("../internals/use-symbol-as-uid"),a=Object;t.exports=r?function(e){return"symbol"==typeof e}:function(e){var t=s("Symbol");return i(t)&&o(t.prototype,a(e))}},{"../internals/get-built-in":25,"../internals/is-callable":33,"../internals/object-is-prototype-of":43,"../internals/use-symbol-as-uid":61}],38:[function(e,t,n){var s=e("../internals/to-length");t.exports=function(e){return s(e.length)}},{"../internals/to-length":52}],39:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=e("../internals/fails"),o=e("../internals/is-callable"),r=e("../internals/has-own-property"),a=e("../internals/descriptors"),l=e("../internals/function-name").CONFIGURABLE,c=e("../internals/inspect-source"),u=e("../internals/internal-state"),d=u.enforce,h=u.get,f=String,p=Object.defineProperty,m=s("".slice),y=s("".replace),b=s([].join),g=a&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),w=String(String).split("String"),v=t.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+y(f(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||l&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&r(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=d(e);return r(s,"source")||(s.source=b(w,"string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&h(this).source||c(this)}),"toString")},{"../internals/descriptors":14,"../internals/fails":19,"../internals/function-name":22,"../internals/function-uncurry-this":24,"../internals/has-own-property":28,"../internals/inspect-source":31,"../internals/internal-state":32,"../internals/is-callable":33}],40:[function(e,t,n){var s=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:s)(t)}},{}],41:[function(e,t,n){var s=e("../internals/descriptors"),i=e("../internals/ie8-dom-define"),o=e("../internals/v8-prototype-define-bug"),r=e("../internals/an-object"),a=e("../internals/to-property-key"),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",f="writable";n.f=s?o?function(e,t,n){if(r(e),t=a(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n.writable){var s=u(e,t);s&&s.writable&&(e[t]=n.value,n={configurable:h in n?n.configurable:s.configurable,enumerable:d in n?n.enumerable:s.enumerable,writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(r(e),t=a(t),r(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},{"../internals/an-object":3,"../internals/descriptors":14,"../internals/ie8-dom-define":30,"../internals/to-property-key":57,"../internals/v8-prototype-define-bug":62}],42:[function(e,t,n){var s=e("../internals/has-own-property"),i=e("../internals/is-callable"),o=e("../internals/to-object"),r=e("../internals/shared-key"),a=e("../internals/correct-prototype-getter"),l=r("IE_PROTO"),c=Object,u=c.prototype;t.exports=a?c.getPrototypeOf:function(e){var t=o(e);if(s(t,l))return t[l];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?u:null}},{"../internals/correct-prototype-getter":8,"../internals/has-own-property":28,"../internals/is-callable":33,"../internals/shared-key":47,"../internals/to-object":53}],43:[function(e,t,n){var s=e("../internals/function-uncurry-this");t.exports=s({}.isPrototypeOf)},{"../internals/function-uncurry-this":24}],44:[function(e,t,n){var s=e("../internals/function-uncurry-this-accessor"),i=e("../internals/an-object"),o=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=s(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,s){return i(n),o(s),t?e(n,s):n.__proto__=s,n}}():void 0)},{"../internals/a-possible-prototype":2,"../internals/an-object":3,"../internals/function-uncurry-this-accessor":23}],45:[function(e,t,n){var s=e("../internals/function-call"),i=e("../internals/is-callable"),o=e("../internals/is-object"),r=TypeError;t.exports=function(e,t){var n,a;if("string"===t&&i(n=e.toString)&&!o(a=s(n,e)))return a;if(i(n=e.valueOf)&&!o(a=s(n,e)))return a;if("string"!==t&&i(n=e.toString)&&!o(a=s(n,e)))return a;throw r("Can't convert object to primitive value")}},{"../internals/function-call":21,"../internals/is-callable":33,"../internals/is-object":35}],46:[function(e,t,n){var s=e("../internals/is-null-or-undefined"),i=TypeError;t.exports=function(e){if(s(e))throw i("Can't call method on "+e);return e}},{"../internals/is-null-or-undefined":34}],47:[function(e,t,n){var s=e("../internals/shared"),i=e("../internals/uid"),o=s("keys");t.exports=function(e){return o[e]||(o[e]=i(e))}},{"../internals/shared":49,"../internals/uid":60}],48:[function(e,t,n){var s=e("../internals/global"),i=e("../internals/define-global-property"),o="__core-js_shared__",r=s[o]||i(o,{});t.exports=r},{"../internals/define-global-property":13,"../internals/global":27}],49:[function(e,t,n){var s=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.0",mode:s?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":36,"../internals/shared-store":48}],50:[function(e,t,n){var s=e("../internals/engine-v8-version"),i=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},{"../internals/engine-v8-version":18,"../internals/fails":19}],51:[function(e,t,n){var s=e("../internals/math-trunc");t.exports=function(e){var t=+e;return t!=t||0===t?0:s(t)}},{"../internals/math-trunc":40}],52:[function(e,t,n){var s=e("../internals/to-integer-or-infinity"),i=Math.min;t.exports=function(e){return e>0?i(s(e),9007199254740991):0}},{"../internals/to-integer-or-infinity":51}],53:[function(e,t,n){var s=e("../internals/require-object-coercible"),i=Object;t.exports=function(e){return i(s(e))}},{"../internals/require-object-coercible":46}],54:[function(e,t,n){var s=e("../internals/to-positive-integer"),i=RangeError;t.exports=function(e,t){var n=s(e);if(n%t)throw i("Wrong offset");return n}},{"../internals/to-positive-integer":55}],55:[function(e,t,n){var s=e("../internals/to-integer-or-infinity"),i=RangeError;t.exports=function(e){var t=s(e);if(t<0)throw i("The argument can't be less than 0");return t}},{"../internals/to-integer-or-infinity":51}],56:[function(e,t,n){var s=e("../internals/function-call"),i=e("../internals/is-object"),o=e("../internals/is-symbol"),r=e("../internals/get-method"),a=e("../internals/ordinary-to-primitive"),l=e("../internals/well-known-symbol"),c=TypeError,u=l("toPrimitive");t.exports=function(e,t){if(!i(e)||o(e))return e;var n,l=r(e,u);if(l){if(void 0===t&&(t="default"),n=s(l,e,t),!i(n)||o(n))return n;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},{"../internals/function-call":21,"../internals/get-method":26,"../internals/is-object":35,"../internals/is-symbol":37,"../internals/ordinary-to-primitive":45,"../internals/well-known-symbol":64}],57:[function(e,t,n){var s=e("../internals/to-primitive"),i=e("../internals/is-symbol");t.exports=function(e){var t=s(e,"string");return i(t)?t:t+""}},{"../internals/is-symbol":37,"../internals/to-primitive":56}],58:[function(e,t,n){var s={};s[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(s)},{"../internals/well-known-symbol":64}],59:[function(e,t,n){var s=String;t.exports=function(e){try{return s(e)}catch(e){return"Object"}}},{}],60:[function(e,t,n){var s=e("../internals/function-uncurry-this"),i=0,o=Math.random(),r=s(1..toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++i+o,36)}},{"../internals/function-uncurry-this":24}],61:[function(e,t,n){var s=e("../internals/symbol-constructor-detection");t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":50}],62:[function(e,t,n){var s=e("../internals/descriptors"),i=e("../internals/fails");t.exports=s&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},{"../internals/descriptors":14,"../internals/fails":19}],63:[function(e,t,n){var s=e("../internals/global"),i=e("../internals/is-callable"),o=s.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},{"../internals/global":27,"../internals/is-callable":33}],64:[function(e,t,n){var s=e("../internals/global"),i=e("../internals/shared"),o=e("../internals/has-own-property"),r=e("../internals/uid"),a=e("../internals/symbol-constructor-detection"),l=e("../internals/use-symbol-as-uid"),c=s.Symbol,u=i("wks"),d=l?c.for||c:c&&c.withoutSetter||r;t.exports=function(e){return o(u,e)||(u[e]=a&&o(c,e)?c[e]:d("Symbol."+e)),u[e]}},{"../internals/global":27,"../internals/has-own-property":28,"../internals/shared":49,"../internals/symbol-constructor-detection":50,"../internals/uid":60,"../internals/use-symbol-as-uid":61}],65:[function(e,t,n){"use strict";var s=e("../internals/global"),i=e("../internals/function-call"),o=e("../internals/array-buffer-view-core"),r=e("../internals/length-of-array-like"),a=e("../internals/to-offset"),l=e("../internals/to-object"),c=e("../internals/fails"),u=s.RangeError,d=s.Int8Array,h=d&&d.prototype,f=h&&h.set,p=o.aTypedArray,m=o.exportTypedArrayMethod,y=!c((function(){var e=new Uint8ClampedArray(2);return i(f,e,{length:1,0:3},1),3!==e[1]})),b=y&&o.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){p(this);var t=a(arguments.length>1?arguments[1]:void 0,1),n=l(e);if(y)return i(f,this,n,t);var s=this.length,o=r(n),c=0;if(o+t>s)throw u("Wrong length");for(;c<o;)this[t+c]=n[c++]}),!y||b)},{"../internals/array-buffer-view-core":5,"../internals/fails":19,"../internals/function-call":21,"../internals/global":27,"../internals/length-of-array-like":38,"../internals/to-object":53,"../internals/to-offset":54}],66:[function(e,t,n){var s,i,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}!function(){try{s="function"==typeof setTimeout?setTimeout:r}catch(e){s=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,u=[],d=!1,h=-1;function f(){d&&c&&(d=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!d){var e=l(f);d=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length}c=null,d=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||d||l(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],67:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Build=void 0,n.Build={version:"8.5.0 (8f6756aabf506dc19fc6d5ae691e6685)",buildSeed:1790599325471,"wdosbox-x-jspi.wasm":{size:7894737,gzSize:2745290},"wdosbox-x-jspi.js":{size:249370,gzSize:59349},"wdosbox-x.wasm":{size:8047520,gzSize:2798215},"wdosbox-x.js":{size:248464,gzSize:60249},"wdosbox.wasm":{size:1459535,gzSize:501358},"wdosbox.js":{size:113486,gzSize:30075},"wlibzip.wasm":{size:112483,gzSize:52219},"wlibzip.js":{size:72957,gzSize:19326}}},{}],68:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js");var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultConfig=void 0;const i=s(e("../../libzip/libzip")),o=e("../../http"),r=e("../../build");n.default=class{dosboxConf=n.defaultConfig;jsdosConf={version:r.Build.version};sources;libzipWasm;constructor(e){this.sources=[],this.libzipWasm=e}autoexec(){const e=this.dosboxConf.indexOf("[autoexec]");for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return this.dosboxConf=this.dosboxConf.substring(0,e)+"[autoexec]\nmount c .\nc:\n"+n.join("\n"),this}extract(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zip";return this.extractAll([{url:e,path:t,type:n}])}extractAll(e){return this.sources.push(...e),this}async toUint8Array(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t={};await this.libzipWasm.instantiate(t);const n=new i.default(t),s=[];for(const e of this.sources){if("zip"!==e.type)throw new Error("Only Zip is supported");const t=(0,o.httpRequest)(e.url,{responseType:"arraybuffer"}).then((t=>({source:e,data:new Uint8Array(t)})));s.push(t)}e||(await n.writeFile(".jsdos/dosbox.conf",this.dosboxConf),await n.writeFile(".jsdos/readme.txt",a),await n.writeFile(".jsdos/jsdos.json",JSON.stringify(this.jsdosConf,null,2)));const r=await Promise.all(s);for(const e of r)n.zipToFs(e.data,e.source.path);e&&(await n.writeFile(".jsdos/dosbox.conf",this.dosboxConf),await n.writeFile(".jsdos/readme.txt",a),await n.writeFile(".jsdos/jsdos.json",JSON.stringify(this.jsdosConf,null,2)));const l=await n.zipFromFs();return n.destroy(),l}};const a="\nPlease visit our website:\n\n _ __\n (_)____ ____/ /___ _____ _________ ____ ___\n / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\n / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\n __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\n /___/\n".replace(/\n/g,"\r\n");n.defaultConfig="[sdl]\nautolock=false\n\nfullscreen=false\nfulldouble=false\nfullresolution=original\nwindowresolution=original\noutput=surface\nsensitivity=100\nwaitonerror=true\npriority=higher,normal\nmapperfile=mapper-jsdos.map\nusescancodes=true\nvsync=false\n[dosbox]\nmachine=svga_s3\n\nlanguage=\ncaptures=capture\nmemsize=16\n[cpu]\ncore=auto\ncputype=auto\ncycles=auto\n\ncycleup=10\ncycledown=20\n[mixer]\nnosound=false\nrate=44100\n\nblocksize=1024\nprebuffer=20\n\n[render]\n# frameskip: How many frames DOSBox skips before drawing one.\n# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n# scaler: Scaler used to enlarge/enhance low resolution modes.\n# If 'forced' is appended, then the scaler will be used even if the result might not be desired.\n# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x.\n\nframeskip=0\naspect=false\nscaler=none\n\n[midi]\n# mpu401: Type of MPU-401 to emulate.\n# Possible values: intelligent, uart, none.\n# mididevice: Device that will receive the MIDI data from MPU-401.\n# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.\n# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.\n# See the README/Manual for more details.\n\nmpu401=intelligent\nmididevice=default\nmidiconfig=\n\n[sblaster]\n# sbtype: Type of Soundblaster to emulate. gb is Gameblaster.\n# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.\n# sbbase: The IO address of the soundblaster.\n# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.\n# irq: The IRQ number of the soundblaster.\n# Possible values: 7, 5, 3, 9, 10, 11, 12.\n# dma: The DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# hdma: The High DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.\n# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.\n# Possible values: auto, cms, opl2, dualopl2, opl3, none.\n# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).\n# Possible values: default, compat, fast.\n# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).\n# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.\n\nsbtype=sb16\nsbbase=220\nirq=7\ndma=1\nhdma=5\nsbmixer=true\noplmode=auto\noplemu=default\noplrate=44100\n\n[gus]\n# gus: Enable the Gravis Ultrasound emulation.\n# gusrate: Sample rate of Ultrasound emulation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# gusbase: The IO base address of the Gravis Ultrasound.\n# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.\n# gusirq: The IRQ number of the Gravis Ultrasound.\n# Possible values: 5, 3, 7, 9, 10, 11, 12.\n# gusdma: The DMA channel of the Gravis Ultrasound.\n# Possible values: 3, 0, 1, 5, 6, 7.\n# ultradir: Path to Ultrasound directory. In this directory\n# there should be a MIDI directory that contains\n# the patch files for GUS playback. Patch sets used\n# with Timidity should work fine.\n\ngus=false\ngusrate=44100\ngusbase=240\ngusirq=5\ngusdma=3\nultradir=C:\\ULTRASND\n\n[speaker]\n# pcspeaker: Enable PC-Speaker emulation.\n# pcrate: Sample rate of the PC-Speaker sound generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.\n# Possible values: auto, on, off.\n# tandyrate: Sample rate of the Tandy 3-Voice generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).\n\npcspeaker=true\npcrate=44100\ntandy=auto\ntandyrate=44100\ndisney=true\n\n[joystick]\n# joysticktype: Type of joystick to emulate: auto (default), none,\n# 2axis (supports two joysticks),\n# 4axis (supports one joystick, first joystick used),\n# 4axis_2 (supports one joystick, second joystick used),\n# fcs (Thrustmaster), ch (CH Flightstick).\n# none disables joystick emulation.\n# auto chooses emulation depending on real joystick(s).\n# (Remember to reset dosbox's mapperfile if you saved it earlier)\n# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.\n# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).\n# autofire: continuously fires as long as you keep the button pressed.\n# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.\n# buttonwrap: enable button wrapping at the number of emulated buttons.\n\njoysticktype=auto\ntimed=true\nautofire=false\nswap34=false\nbuttonwrap=false\n\n[serial]\n# serial1: set type of device connected to com port.\n# Can be disabled, dummy, modem, nullmodem, directserial.\n# Additional parameters must be in the same line in the form of\n# parameter:value. Parameter for all types is irq (optional).\n# for directserial: realport (required), rxdelay (optional).\n# (realport:COM1 realport:ttyS0).\n# for modem: listenport (optional).\n# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n# transparent, port, inhsocket (all optional).\n# Example: serial1=modem listenport:5000\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial2: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial3: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial4: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n\nserial1=dummy\nserial2=dummy\nserial3=disabled\nserial4=disabled\n\n[dos]\n# xms: Enable XMS support.\n# ems: Enable EMS support.\n# umb: Enable UMB support.\n# keyboardlayout: Language code of the keyboard layout (or none).\n\nxms=true\nems=true\numb=true\nkeyboardlayout=auto\n\n[ipx]\n# ipx: Enable ipx over UDP/IP emulation.\n\nipx=true\n[autoexec]\necho off\nmount c .\nc:\n\ntype jsdos~1/readme.txt\necho on\n\n# Generated using https://js-dos.com\n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n".replace(/\n/g,"\r\n")},{"../../build":67,"../../http":73,"../../libzip/libzip":77,"core-js/modules/es.typed-array.set.js":65}],69:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.audioWorkletCode=n.createAudioPort=void 0,n.createAudioPort=async function(){let e;try{const t=new Blob([n.audioWorkletCode],{type:"application/javascript"});e=URL.createObjectURL(t);const s=new AudioContext({latencyHint:"interactive"});await s.audioWorklet.addModule(e);const i=new AudioWorkletNode(s,"jsdos-audio",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[1]});i.connect(s.destination);const o=()=>{"suspended"===s.state&&s.resume().catch(console.error)};return document.addEventListener("pointerdown",o,{once:!0,capture:!0}),document.addEventListener("keydown",o,{once:!0,capture:!0}),i.port}catch(e){return void console.error("error creating audio port",e)}finally{void 0!==e&&URL.revokeObjectURL(e)}},n.audioWorkletCode='\nclass SampleRing {\n constructor(capacity) {\n this.samples = new Float32Array(capacity);\n this.readPosition = 0;\n this.writePosition = 0;\n this.samplesCount = 0;\n }\n\n clear() {\n this.readPosition = 0;\n this.writePosition = 0;\n this.samplesCount = 0;\n }\n\n length() {\n return this.samplesCount;\n }\n\n push(sample) {\n if (this.samplesCount === this.samples.length) {\n this.discard(1);\n }\n this.samples[this.writePosition] = sample;\n this.writePosition = (this.writePosition + 1) % this.samples.length;\n this.samplesCount++;\n }\n\n pushArray(samples) {\n for (let i = 0; i < samples.length; ++i) {\n this.push(samples[i]);\n }\n }\n\n peek(offset) {\n return this.samples[(this.readPosition + offset) % this.samples.length];\n }\n\n shift() {\n const sample = this.peek(0);\n this.discard(1);\n return sample;\n }\n\n discard(count) {\n count = Math.min(count, this.samplesCount);\n this.readPosition = (this.readPosition + count) % this.samples.length;\n this.samplesCount -= count;\n }\n}\n\nclass Processor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.outputRate = sampleRate;\n this.sourceRate = sampleRate;\n this.targetFrames = Math.max(1024, Math.round(this.outputRate * 2048 / 44100));\n this.maxFrames = this.targetFrames * 4;\n this.frameSize = 512;\n this.hopSize = this.frameSize / 2;\n this.searchSize = 64;\n this.sourceQueue = new SampleRing(this.maxFrames * 4);\n this.queue = new SampleRing(this.maxFrames);\n this.outputQueue = new SampleRing(this.frameSize * 4);\n this.tail = new Float32Array(this.hopSize);\n this.sourcePosition = 0;\n this.tempo = 1;\n this.analysisDebt = 0;\n this.started = false;\n this.haveTail = false;\n this.lastOutput = 0;\n\n this.port.onmessage = (event) => {\n const message = event.data;\n if (message instanceof Float32Array) {\n this.sourceQueue.pushArray(message);\n this.resampleInput();\n } else if (message && message.type === "init") {\n this.initialize(message.sourceRate);\n }\n };\n }\n\n initialize(sourceRate) {\n this.sourceRate = sourceRate > 0 ? sourceRate : this.outputRate;\n this.sourceQueue.clear();\n this.queue.clear();\n this.outputQueue.clear();\n this.sourcePosition = 0;\n this.tempo = 1;\n this.analysisDebt = 0;\n this.started = false;\n this.haveTail = false;\n this.lastOutput = 0;\n }\n\n resampleInput() {\n const step = this.sourceRate / this.outputRate;\n while (this.sourcePosition + 1 < this.sourceQueue.length()) {\n const index = Math.floor(this.sourcePosition);\n const fraction = this.sourcePosition - index;\n const first = this.sourceQueue.peek(index);\n const second = this.sourceQueue.peek(index + 1);\n this.queue.push(first + (second - first) * fraction);\n this.sourcePosition += step;\n }\n\n const consumed = Math.floor(this.sourcePosition);\n if (consumed > 0) {\n this.sourceQueue.discard(consumed);\n this.sourcePosition -= consumed;\n }\n }\n\n prepareFirstFrame() {\n if (this.queue.length() < this.frameSize) {\n return false;\n }\n for (let i = 0; i < this.hopSize; ++i) {\n this.outputQueue.push(this.queue.peek(i) * (i + 1) / this.hopSize);\n this.tail[i] = this.queue.peek(this.hopSize + i);\n }\n this.haveTail = true;\n return true;\n }\n\n updateTempo() {\n const error = (this.queue.length() - this.targetFrames) / this.targetFrames;\n const desired = Math.max(0.95, Math.min(1.05, 1 + error * 0.1));\n const change = Math.max(-0.002, Math.min(0.002, desired - this.tempo));\n this.tempo += change;\n }\n\n findBestFrame(expected) {\n const minimum = Math.max(1, expected - this.searchSize);\n const maximum = Math.min(\n expected + this.searchSize,\n this.queue.length() - this.frameSize,\n );\n if (maximum < minimum) {\n return -1;\n }\n\n let bestPosition = Math.min(expected, maximum);\n let bestScore = Number.POSITIVE_INFINITY;\n for (let position = minimum; position <= maximum; ++position) {\n let difference = 0;\n for (let i = 0; i < this.hopSize; i += 4) {\n const delta = this.tail[i] - this.queue.peek(position + i);\n difference += delta * delta;\n }\n const distancePenalty = Math.abs(position - expected) * 0.002;\n const score = difference + distancePenalty;\n if (score < bestScore) {\n bestScore = score;\n bestPosition = position;\n }\n }\n return bestPosition;\n }\n\n generateFrame() {\n if (!this.haveTail) {\n return this.prepareFirstFrame();\n }\n\n this.updateTempo();\n const idealAdvance = this.hopSize * this.tempo;\n const expected = Math.max(1, Math.round(idealAdvance + this.analysisDebt));\n const position = this.findBestFrame(expected);\n if (position < 0) {\n return false;\n }\n this.analysisDebt += idealAdvance - position;\n this.analysisDebt = Math.max(-this.searchSize, Math.min(this.searchSize, this.analysisDebt));\n\n this.queue.discard(position);\n for (let i = 0; i < this.hopSize; ++i) {\n const mix = i / this.hopSize;\n const sample = this.tail[i] * (1 - mix) + this.queue.peek(i) * mix;\n this.outputQueue.push(sample);\n this.tail[i] = this.queue.peek(this.hopSize + i);\n }\n return true;\n }\n\n stopForUnderflow() {\n if (this.haveTail) {\n this.queue.discard(this.hopSize);\n }\n this.started = false;\n this.haveTail = false;\n this.outputQueue.clear();\n this.tempo = 1;\n this.analysisDebt = 0;\n }\n\n writeTo(output) {\n if (!this.started && this.queue.length() >= this.targetFrames) {\n this.started = true;\n }\n\n while (this.started && this.outputQueue.length() < output.length) {\n if (!this.generateFrame()) {\n break;\n }\n }\n\n let written = 0;\n while (written < output.length && this.outputQueue.length() > 0) {\n this.lastOutput = this.outputQueue.shift();\n output[written++] = this.lastOutput;\n }\n\n if (written < output.length) {\n const missing = output.length - written;\n for (let i = 0; i < missing; ++i) {\n output[written + i] = this.lastOutput * (1 - (i + 1) / missing);\n }\n this.lastOutput = 0;\n if (this.started) {\n this.stopForUnderflow();\n }\n }\n }\n\n bufferedFrames() {\n return this.queue.length() + this.outputQueue.length();\n }\n\n process(inputs, outputs) {\n const channels = outputs[0];\n this.writeTo(channels[0]);\n for (let channel = 1; channel < channels.length; ++channel) {\n channels[channel].set(channels[0]);\n }\n return true;\n }\n}\n\nregisterProcessor("jsdos-audio", Processor);\n'},{}],70:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.dosDirect=void 0;const s=e("../../../protocol/messages-queue"),i=e("./audio-worklet");e("../../../sockdrive/sockdrive"),n.dosDirect=async function(e,t,n,o,r){const a=new s.MessagesQueue;let l=a.handler.bind(a);const c={postMessage:(e,t)=>{l(e,t)}},u=e=>{const n=e.data;"ws-sync-sleep"===n?.name&&n.props.sessionId===t&&postMessage({name:"wc-sync-sleep",props:n.props},"*")},d={sessionId:t,sendMessageToServer:(e,t)=>{c.messageHandler({data:{name:e,props:t}})},initMessageHandler:e=>{l=e,a.sendTo(l)},exit:()=>{"undefined"!=typeof window&&window.removeEventListener("message",u)},net:r??null};return d.module=c,"undefined"!=typeof window&&window.addEventListener("message",u,{passive:!0}),c.canvas=n,o&&(c.audioPort=await(0,i.createAudioPort)()),await e.instantiate(c),c.callMain([t]),d}},{"../../../protocol/messages-queue":78,"../../../sockdrive/sockdrive":82,"./audio-worklet":69}],71:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.dosWorker=void 0;const s=e("../../../protocol/messages-queue"),i=e("./audio-worklet");n.dosWorker=async function(e,t,n,o,r,a){const l=new s.MessagesQueue;let c=l.handler.bind(l);const u=await fetch(e);if(200!==u.status)throw new Error("Unable to download '"+e+"' ("+u.status+"): "+u.statusText);const d=URL.createObjectURL(await u.blob()),h=new Worker(d);h.onerror=e=>{c("ws-err",{type:e.type,filename:e.filename,message:e.message})},h.onmessage=e=>{const t=e.data;void 0!==t?.name&&c(t.name,t.props)};const f={sessionId:n,sendMessageToServer:(e,t,n)=>{n?h.postMessage({name:e,props:t},n):h.postMessage({name:e,props:t})},initMessageHandler:e=>{c=e,l.sendTo(c)},exit:()=>{URL.revokeObjectURL(d),h.terminate()},net:a??null},p=o?[o]:[];let m;r&&(m=await(0,i.createAudioPort)(),m&&p.push(m));try{f.sendMessageToServer("wc-install",{module:t.wasmModule,sessionId:n,canvas:o,audioPort:m},p)}catch(e){f.sendMessageToServer("wc-install",{sessionId:n,canvas:o,audioPort:m},p)}return f}},{"../../../protocol/messages-queue":78,"./audio-worklet":69}],72:[function(e,t,n){(function(t){(function(){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.NetworkType=void 0;const i=s(e("./impl/emulators-impl"));!function(e){e[e.NETWORK_DOSBOX_IPX=0]="NETWORK_DOSBOX_IPX"}(n.NetworkType||(n.NetworkType={})),"undefined"!=typeof window&&(window.emulators=i.default),void 0!==t&&(t.emulators=i.default)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./impl/emulators-impl":75}],73:[function(e,t,n){(function(e){(function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.httpRequest=void 0,n.httpRequest=function(e,t){return new Promise(((n,i)=>{new s(e,{...t,success:n,fail:e=>{i(new Error(e))}})}))};class s{resource;options;xhr=null;total=0;loaded=0;constructor(e,t){if(this.resource=e,this.options=t,this.options.method=t.method||"GET","GET"!==this.options.method)throw new Error("Method "+this.options.method+" is not supported");"undefined"==typeof XMLHttpRequest?this.makeNodeRequest():this.makeHttpRequest()}makeNodeRequest(){const n=t.require.bind(t),s=n("fs"),i=n("path"),o=n("url");let r=this.resource;if(r.startsWith("http://")||r.startsWith("https://"))this.makeNodeHttpRequest(r,n);else{if(r.startsWith("file://"))r=o.fileURLToPath(r);else if(r.startsWith("/")){const t=r,n=i.resolve(e.cwd(),"."+r);r=s.existsSync(t)?t:n}else r=i.resolve(e.cwd(),r);s.readFile(r,((e,t)=>{if(null===e){if(this.options.progress&&this.options.progress(t.byteLength,t.byteLength),this.options.success)if("arraybuffer"===this.options.responseType){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);this.options.success(e)}else this.options.success(t.toString("utf8"))}else this.options.fail&&(this.options.fail("Unable to download '"+this.resource+"', code: 404"),delete this.options.fail)}))}}makeNodeHttpRequest(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=t("url"),i=new s.URL(e);t("https:"===i.protocol?"https":"http").get(i,(e=>{const o=e.statusCode||0,r=e.headers.location;if(o>=300&&o<400&&void 0!==r)return e.resume(),n>=5?void(this.options.fail&&(this.options.fail("Unable to download '"+this.resource+"', code: "+o),delete this.options.fail)):void this.makeNodeHttpRequest(new s.URL(r,i).toString(),t,n+1);if(o<200||o>=300)return e.resume(),void(this.options.fail&&(this.options.fail("Unable to download '"+this.resource+"', code: "+o),delete this.options.fail));const a=[],l=Number.parseInt(e.headers["content-length"]||"0",10);let c=0;e.on("data",(e=>{a.push(e),c+=e.byteLength,this.options.progress&&this.options.progress(l,c)})),e.on("end",(()=>{const e=t("buffer").Buffer.concat(a);if(this.options.progress&&this.options.progress(l||e.byteLength,e.byteLength),this.options.success)if("arraybuffer"===this.options.responseType){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);this.options.success(t)}else this.options.success(e.toString("utf8"))}))})).on("error",(e=>{this.options.fail&&(this.options.fail("Unable to download '"+this.resource+"', code: "+e.message),delete this.options.fail)}))}makeHttpRequest(){let e,t;this.xhr=new XMLHttpRequest,this.xhr.open(this.options.method||"GET",this.resource,!0),"POST"===this.options.method&&this.xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"),this.xhr.overrideMimeType("text/plain; charset=x-user-defined"),"function"==typeof(e=this.xhr).addEventListener&&e.addEventListener("progress",(e=>{if(this.total=e.total,this.loaded=e.loaded,this.options.progress)return this.options.progress(e.total,e.loaded)})),"function"==typeof(t=this.xhr).addEventListener&&t.addEventListener("error",(()=>{if(this.options.fail)return this.options.fail("Unalbe to download '"+this.resource+"', code: "+this.xhr.status),delete this.options.fail})),this.xhr.onreadystatechange=()=>this.onReadyStateChange(),this.options.responseType&&(this.xhr.responseType=this.options.responseType),this.xhr.send(this.options.data)}onReadyStateChange(){const e=this.xhr;if(4===e.readyState)if(200===e.status){if(this.options.success){const t=Math.max(this.total,this.loaded);return void 0!==this.options.progress&&this.options.progress(t,t),this.options.success(e.response)}}else if(this.options.fail)return this.options.fail("Unable to download '"+this.resource+"', code: "+e.status),delete this.options.fail}}}).call(this)}).call(this,e("_process"))},{_process:66}],74:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CommandInterfaceEventsImpl=void 0;n.CommandInterfaceEventsImpl=class{onStdoutConsumers=[];delayedStdout=[];onFrameSizeConsumers=[];onFrameConsumers=[];onSoundPushConsumers=[];onExitConsumers=[];onMessageConsumers=[];delayedMessages=[];onNetworkConnectedConsumers=[];onNetworkDisconnectedConsumers=[];onUnloadConsumers=[];onStdout=e=>{if(this.onStdoutConsumers.push(e),1===this.onStdoutConsumers.length){for(const e of this.delayedStdout)this.fireStdout(e);this.delayedStdout=[]}};onFrameSize=e=>{this.onFrameSizeConsumers.push(e)};onFrame=e=>{this.onFrameConsumers.push(e)};onSoundPush=e=>{this.onSoundPushConsumers.push(e)};onExit=e=>{this.onExitConsumers.push(e)};onMessage=e=>{if(this.onMessageConsumers.push(e),1===this.onMessageConsumers.length){for(const t of this.delayedMessages)e(t.msgType,...t.args);this.delayedMessages=[]}};onNetworkConnected(e){this.onNetworkConnectedConsumers.push(e)}onNetworkDisconnected(e){this.onNetworkDisconnectedConsumers.push(e)}onUnload=e=>{this.onUnloadConsumers.push(e)};fireStdout=e=>{if(0!==this.onStdoutConsumers.length)for(const t of this.onStdoutConsumers)t(e);else this.delayedStdout.push(e)};fireFrameSize=(e,t)=>{for(const n of this.onFrameSizeConsumers)n(e,t)};fireFrame=(e,t)=>{for(const n of this.onFrameConsumers)n(e,t)};fireSoundPush=e=>{for(const t of this.onSoundPushConsumers)t(e)};fireExit=()=>{for(const e of this.onExitConsumers)e();this.onStdoutConsumers=[],this.onFrameSizeConsumers=[],this.onFrameConsumers=[],this.onSoundPushConsumers=[],this.onExitConsumers=[],this.onMessageConsumers=[]};fireMessage=(()=>{var e=this;return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];if(0!==e.onMessageConsumers.length)for(const n of e.onMessageConsumers)n(t,...s);else e.delayedMessages.push({msgType:t,args:s})}})();fireNetworkConnected=(e,t)=>{for(const n of this.onNetworkConnectedConsumers)n(e,t)};fireNetworkDisconnected=e=>{for(const t of this.onNetworkDisconnectedConsumers)t(e)};fireUnload=async()=>{const e=[];for(const t of this.onUnloadConsumers)e.push(t());await Promise.all(e)}}},{}],75:[function(e,t,n){"use strict";var s=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0});const i=e("../build"),o=e("./modules"),r=s(e("../dos/bundle/dos-bundle")),a=e("../dos/dosbox/ts/direct"),l=e("../dos/dosbox/ts/worker"),c=e("../protocol/protocol"),u=s(e("../libzip/libzip"));const d=new class{pathPrefix="";pathSuffix="";version=i.Build.version;wdosboxJs="wdosbox.js";wdosboxxJs="wdosbox-x.js";wdosboxxJsJspi="wdosbox-x-jspi.js";wdosboxxJsDebug="wdosbox-x-dbg.js";wasmModulesPromise;async bundle(){const e=await this.wasmModules(),t=await e.libzip();return new r.default(t)}async bundleConfig(e){const t=await this.wasmModules(),n=await t.libzip(),s={};await n.instantiate(s);const o=new u.default(s);try{o.zipToFs(e,"/",".jsdos/");try{const e=await o.readFile(".jsdos/dosbox.conf");try{const t=await o.readFile(".jsdos/jsdos.json");return{dosboxConf:e,jsdosConf:JSON.parse(t)}}catch(e){}return{dosboxConf:e,jsdosConf:{version:i.Build.version}}}catch(e){}return null}finally{o.destroy()}}async bundleUpdateConfig(e,t){const n=await this.wasmModules(),s=await n.libzip(),i={};await s.instantiate(i);const o=new u.default(i);try{return await o.writeFile("bundle.zip",e),await o.writeFile(".jsdos/dosbox.conf",t.dosboxConf),await o.writeFile(".jsdos/jsdos.json",JSON.stringify(t.jsdosConf)),await o.zipAddFile("bundle.zip",".jsdos/jsdos.json"),await o.zipAddFile("bundle.zip",".jsdos/dosbox.conf"),await o.readFile("bundle.zip","binary")}finally{o.destroy()}}async dosboxNode(e,t){return this.dosboxDirect(e,t)}async dosboxDirect(e,t){const n=await this.wasmModules(),s=await n.dosbox(),i=await(0,a.dosDirect)(s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxWorker(e,t){const n=await this.wasmModules(),s=await n.dosbox(),i=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxJs+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxXNode(e,t){return this.dosboxXDirect(e,t)}async dosboxXDirect(e,t){const n=await this.wasmModules(),s=await n.dosboxx(),i=await(0,a.dosDirect)(s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxXJspiDirect(e,t){const n=await this.wasmModules(),s=await n.dosboxxJspi(),i=await(0,a.dosDirect)(s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxXWorker(e,t){const n=await this.wasmModules(),s=await n.dosboxx(),i=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxxJs+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxXJspiWorker(e,t){const n=await this.wasmModules(),s=await n.dosboxxJspi(),i=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxxJsJspi+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async dosboxXDebugWorker(e,t){const n=await this.wasmModules(),s=await n.dosboxxDebug(),i=await(0,l.dosWorker)(this.pathPrefix+this.wdosboxxJsDebug+this.pathSuffix,s,"session-"+Date.now(),t?.canvas,t?.audioWorklet,t?.net);return this.backend(e,i,t)}async backend(e,t,n){return new Promise(((s,i)=>{const o=new c.CommandInterfaceOverTransportLayer(Array.isArray(e)?e:[e],t,(e=>{null!==e?i(e):setTimeout((()=>s(o)),4)}),n||{})}))}wasmModules(){if(void 0!==this.wasmModulesPromise)return this.wasmModulesPromise;return this.wasmModulesPromise=(async()=>new o.WasmModulesImpl(this.pathPrefix,this.pathSuffix,this.wdosboxJs,this.wdosboxxJs,this.wdosboxxJsJspi,this.wdosboxxJsDebug))(),this.wasmModulesPromise}async dosDirect(e){return this.dosboxDirect(e)}async dosWorker(e){return this.dosboxWorker(e)}};n.default=d},{"../build":67,"../dos/bundle/dos-bundle":68,"../dos/dosbox/ts/direct":70,"../dos/dosbox/ts/worker":71,"../libzip/libzip":77,"../protocol/protocol":80,"./modules":76}],76:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.loadWasmModule=n.WasmModulesImpl=n.host=void 0;const s=e("../http");n.host=new class{wasmSupported=!1;globals;constructor(){if(this.globals="undefined"==typeof window?{}:window,this.globals.module||(this.globals.module={}),this.globals.exports||(this.globals.exports={}),this.globals.compiled||(this.globals.compiled={}),"object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate&&"function"==typeof WebAssembly.compile){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));e instanceof WebAssembly.Module&&(this.wasmSupported=new WebAssembly.Instance(e)instanceof WebAssembly.Instance)}Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){const n=65535&e,s=65535&t;return n*s+((e>>>16)*s+n*(t>>>16)<<16)|0}),Math.imul=Math.imul,Math.fround||(Math.fround=function(e){return e}),Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(let t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc}};function i(t,i,a){return"undefined"==typeof XMLHttpRequest?function(t,s,i){if(void 0!==n.host.globals.compiled[s])return n.host.globals.compiled[s];const r=e(t),a=Promise.resolve(new o(r));s&&(n.host.globals.compiled[s]=a);return a}(t,i):function(e,t,i){if(void 0!==n.host.globals.compiled[t])return n.host.globals.compiled[t];async function o(){const o=e.lastIndexOf("/"),a=e.indexOf("w",o),l=a===o+1&&a>=0;if(!n.host.wasmSupported||!l)throw new Error("Starting from js-dos 6.22.60 js environment is not supported");const c=e.lastIndexOf(".js"),u=e.substring(0,c)+".wasm"+e.substring(c+3),d=(0,s.httpRequest)(u,{responseType:"arraybuffer",progress:(t,n)=>{i("Resolving DosBox ("+e+")",t,n)}}),h=(0,s.httpRequest)(e,{progress:(e,t)=>{i("Resolving DosBox",e,t)}}),[f,p]=await Promise.all([d,h]),m=await WebAssembly.compile(f),y=(e,t)=>(e.env=e.env||{},WebAssembly.instantiate(m,e).then((e=>t(e,m))));return eval.call(window,p),n.host.globals.exports[t]=n.host.globals.module.exports,new r(m,n.host.globals.exports[t],y)}const a=o();t&&(n.host.globals.compiled[t]=a);return a}(t,i,a)}n.WasmModulesImpl=class{pathPrefix;pathSuffix;wdosboxJs;wdosboxxJs;wdosboxxJsJspi;wdosboxxJsDebug;libzipPromise;dosboxPromise;dosboxxPromise;dosboxxJspiPromise;dosboxxDebugPromise;wasmSupported=!1;constructor(e,t,n,s,i,o){e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.pathPrefix=e,this.pathSuffix=t,this.wdosboxJs=n,this.wdosboxxJs=s,this.wdosboxxJsJspi=i,this.wdosboxxJsDebug=o}libzip(){return void 0!==this.libzipPromise||(this.libzipPromise=this.loadModule(this.pathPrefix+"wlibzip.js"+this.pathSuffix,"WLIBZIP")),this.libzipPromise}dosbox(){return void 0!==this.dosboxPromise||(this.dosboxPromise=this.loadModule(this.pathPrefix+this.wdosboxJs+this.pathSuffix,"WDOSBOX")),this.dosboxPromise}dosboxx(){return void 0!==this.dosboxxPromise||(this.dosboxxPromise=this.loadModule(this.pathPrefix+this.wdosboxxJs+this.pathSuffix,"WDOSBOXX")),this.dosboxxPromise}dosboxxJspi(){return void 0!==this.dosboxxJspiPromise||(this.dosboxxJspiPromise=this.loadModule(this.pathPrefix+this.wdosboxxJsJspi+this.pathSuffix,"WDOSBOXXJSPI")),this.dosboxxJspiPromise}dosboxxDebug(){return void 0!==this.dosboxxDebugPromise||(this.dosboxxDebugPromise=this.loadModule(this.pathPrefix+this.wdosboxxJsDebug+this.pathSuffix,"WDOSBOXX")),this.dosboxxDebugPromise}loadModule(e,t){return i(e,t,(()=>{}))}},n.loadWasmModule=i;class o{emModule;constructor(e){this.emModule=e}async instantiate(e){await this.emModule(e)}}class r{wasmModule;module;instantiateWasm;constructor(e,t,n){this.wasmModule=e,this.module=t,this.instantiateWasm=n}async instantiate(e){e.instantiateWasm=this.instantiateWasm,await this.module(e)}}},{"../http":73,"core-js/modules/es.typed-array.set.js":65}],77:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0});n.default=class{module;home;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/home/web_user";this.module=e,this.home=t,this.module.callMain([]),this.module.FS.ignorePermissions=!0,this.chdirToHome()}zipFromFs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.chdirToHome();const t=this.module._zip_from_fs(e);if(0===t)return Promise.reject(new Error("Can't create zip, see more info in logs"));const n=this.module.HEAPU32[t/4],s=this.module.HEAPU8.slice(t+4,t+4+n);return this.module._free(t),Promise.resolve(s)}zipToFs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2?arguments[2]:void 0;const s=this.module;t=this.normalizeFilename(t);const i=this.normalizeFilename(t).split("/");this.createPath(i,0,i.length),this.chdir(t);const o=void 0!==n&&n.length>0;let r=0;if(o){const e=s.lengthBytesUTF8(n)+1;r=s._malloc(e),s.stringToUTF8(n,r,e)}const a=new Uint8Array(e),l=s._malloc(a.length);s.HEAPU8.set(a,l);const c=s._zip_to_fs(l,a.length,r);return s._free(l),this.chdirToHome(),o&&s._free(r),0===c?Promise.resolve():Promise.reject(new Error("Can't extract zip, retcode "+c+", see more info in logs"))}writeFile(e,t){e=this.normalizeFilename(e),t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=e.split("/");if(0===n.length)throw new Error("Can't create file '"+e+"', because it's not valid file path");const s=n[n.length-1].trim();if(0===s.length)throw new Error("Can't create file '"+e+"', because file name is empty");const i=this.createPath(n,0,n.length-1);this.module.FS.writeFile(i+"/"+s,t)}async readFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";return e=this.normalizeFilename(e),this.module.FS.readFile(e,{encoding:t})}exists(e){e=this.normalizeFilename(e);try{return this.module.FS.lookupPath(e),!0}catch(e){return!1}}destroy(){try{this.module._libzip_destroy()}catch(e){return e}}normalizeFilename(e){for(e=e.replace(new RegExp("^[a-zA-z]+:"),"").replace(new RegExp("\\\\","g"),"/");"/"===e[0];)e=e.substr(1);return e}createPath(e,t,n){let s=".";for(let i=t;i<n;++i){const t=e[i].trim();0!==t.length&&(this.module.FS.createPath(s,t,!0,!0),s=s+"/"+t)}return s}chdirToHome(){this.module.FS.chdir(this.home)}chdir(e){this.module.FS.chdir(this.home+"/"+e)}async zipAddFile(e,t){const n=this.module,s=n.lengthBytesUTF8(e)+1,i=n._malloc(s);n.stringToUTF8(e,i,s);const o=n.lengthBytesUTF8(t)+1,r=n._malloc(o);n.stringToUTF8(t,r,o);const a=this.module._zipfile_add(i,r,r);if(n._free(i),n._free(r),0!==a)throw new Error("Unable to add "+t+" into "+e)}}},{"core-js/modules/es.typed-array.set.js":65}],78:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MessagesQueue=void 0;n.MessagesQueue=class{messages=[];handler(e,t){this.messages.push({name:e,props:t})}sendTo(e){for(const t of this.messages)e(t.name,t.props);this.messages=[]}}},{}],79:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.uncompress=n.compress=n.compressBound=void 0;const s={uncompress:function(e,t,n,s){for(var i=n=n||0,o=s=s||e.length-n,r=0;i<o;){var a=e[i++],l=a>>4;if(l>0){for(var c=l+240;255===c;)l+=c=e[i++];for(var u=i+l;i<u;)t[r++]=e[i++];if(i===o)return r}var d=e[i++]|e[i++]<<8;if(0===d)return r;if(d>r)return-(i-2);var h=15&a;for(c=h+240;255===c;)h+=c=e[i++];var f=r-d;for(u=r+h+4;r<u;)t[r++]=t[f++]}return r}};var i=2113929216,o=15,r=15,a=2654435761;!function(e,t){if(!e)throw new Error(t||"Assertion failed")}(!0);var l=new Int16Array(65536),c=new Int16Array(l.length);s.compressBound=function(e){return e>i?0:e+e/255+16|0},s.compress=function(e,t,n,u){return l.set(c),function(e,t,n,c,u){var d=c,h=u-c,f=0;if(e.length>=i)throw new Error("input too large");if(e.length>12){var p=s.compressBound(e.length);if(h<p)throw Error("output too small: "+h+" < "+p);for(var m=67,y=e.length-12;n+4<y;){var b=e[n+1]<<8|e[n],g=e[n+3]<<8|e[n+2],w=Math.imul(b|g<<16,a)>>>16,v=l[w]-1;if(l[w]=n+1,v<0||n-v>>>16>0||(e[v+3]<<8|e[v+2])!=g||(e[v+1]<<8|e[v])!=b)n+=m++>>6;else{m=67;var x=n-f,P=n-v;v+=4;for(var k=n+=4;n<y&&e[n]==e[v];)n++,v++;var S=(k=n-k)<o?k:o;if(x>=r){t[d++]=240+S;for(var _=x-r;_>254;_-=255)t[d++]=255;t[d++]=_}else t[d++]=(x<<4)+S;for(var M=0;M<x;M++)t[d++]=e[f+M];if(t[d++]=P,t[d++]=P>>8,k>=o){for(k-=o;k>=255;)k-=255,t[d++]=255;t[d++]=k}f=n}}}if(0==f)return 0;if((x=e.length-f)>=r){t[d++]=240;for(var j=x-r;j>254;j-=255)t[d++]=255;t[d++]=j}else t[d++]=x<<4;n=f;for(;n<e.length;)t[d++]=e[n++];return d}(e,t,0,n||0,u||t.length)},s.CHUNK_SIZE=2048,n.compressBound=s.compressBound,n.compress=s.compress,n.uncompress=s.uncompress},{"core-js/modules/es.typed-array.set.js":65}],80:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.CommandInterfaceOverTransportLayer=void 0;const s=e("../impl/ci-impl"),i=4194304;n.CommandInterfaceOverTransportLayer=class{startedAt=Date.now();exited=!1;frameWidth=0;frameHeight=0;rgb=null;rgba=null;freq=0;utf8Decoder=new TextDecoder;init;transport;ready;persistPromise;persistResolve;exitPromise;exitResolve;eventsImpl=new s.CommandInterfaceEventsImpl;keyMatrix={};configPromise;configResolve=()=>{};panicMessages=[];connectPromise=null;connectResolve=()=>{};connectReject=()=>{};disconnectPromise=null;disconnectResolve=()=>{};asyncifyStatsPromise=null;asyncifyStatsResolve=()=>{};fsTreePromise=null;fsTreeResolve=()=>{};fsGetFilePromise={};fsGetFileResolve={};fsGetFileParts={};fsDeleteFilePromise=null;fsDeleteFileResolve=()=>{};getRunningProgramPromise=null;getRunningProgramResolve=()=>{};dataChunkPromise={};dataChunkResolve={};persistSockdrivesPromise=null;persistSockdrivesResolve=()=>{};myPeerId=0;netSent=0;netRecv=0;netPollInterval=null;options;constructor(e,t,n,s){this.options=s,this.init=e,this.transport=t,this.ready=n,this.configPromise=new Promise((e=>this.configResolve=e)),this.transport.initMessageHandler(this.onServerMessage.bind(this)),this.transport.net=this.transport.net??null,this.transport.net&&(this.myPeerId=this.transport.net.peerId,this.netPollInterval=setInterval((()=>{this.transport.net.wait(0);let e=this.transport.net.recvBinary();for(;null!=e;)this.netRecv+=e.data.length,this.sendClientMessage("wc-net-received",{peerId:e.peerId,data:e.data.buffer},[e.data.buffer]),e=this.transport.net.recvBinary()}),16))}sendClientMessage(e,t,n){(t=t||{}).sessionId=t.sessionId||this.transport.sessionId,this.transport.sendMessageToServer(e,t,n)}onServerMessage(e,t){if(!(void 0===e||e.length<3||"w"!==e[0]||"s"!==e[1]||"-"!==e[2])&&void 0!==t&&t.sessionId===this.transport.sessionId)switch(e){case"ws-ready":{const e=async()=>{if(!this.init||0===this.init.length)return;const e=new TextEncoder,t=async(e,t,n)=>{await this.sendDataChunk({type:e,name:t,data:n.buffer}),await this.sendDataChunk({type:e,name:t,data:null})};let n=0;for(const s of this.init)if(ArrayBuffer.isView(s))await t("bundle",n+"",s),n++;else if("string"==typeof s)await t("file",".jsdos/dosbox.conf",e.encode(s));else{const n=s,i=s;void 0!==i.jsdosConf?.version?(await t("file",".jsdos/dosbox.conf",e.encode(i.dosboxConf)),await t("file",".jsdos/jsdos.json",e.encode(JSON.stringify(i.jsdosConf,null,2)))):void 0!==n.path?await t("file",n.path,n.contents):console.error("Unknown init part",s)}};e().then((()=>{this.sendClientMessage("wc-run",{token:this.options.token,myPeerId:this.myPeerId,sockdrivePreload:this.options.sockdrivePreload,sockdriveOpfsRoot:this.options.sockdriveOpfsRoot,mcpServerPort:this.options.mcpServerPort})})).catch((e=>{this.onErr("panic","Can't send bundles to backend: "+e.message),console.error(e)})).finally((()=>{delete this.init}))}break;case"ws-server-ready":this.panicMessages.length>0?(void 0!==this.transport.exit&&this.transport.exit(),this.ready(new Error(JSON.stringify(this.panicMessages)))):this.ready(null),delete this.ready;break;case"ws-frame-set-size":this.onFrameSize(t.width,t.height);break;case"ws-update-lines":this.onFrameLines(t.lines,t.rgba,t.width,t.height);break;case"ws-exit":this.onExit();break;case"ws-log":this.onLog(t.tag,t.message);break;case"ws-warn":this.onWarn(t.tag,t.message);break;case"ws-err":this.onErr(t.tag,t.message);break;case"ws-stdout":this.onStdout(t.message);break;case"ws-persist":this.onPersist(t.bundle??t.sockdrives??null);break;case"ws-sound-init":this.onSoundInit(t.freq);break;case"ws-sound-push":this.onSoundPush(t.samples);break;case"ws-config":this.onConfig({dosboxConf:this.utf8Decoder.decode(t.dosboxConf),jsdosConf:JSON.parse(t.jsdosConf)});break;case"ws-sync-sleep":this.sendClientMessage("wc-sync-sleep",t);break;case"ws-connected":this.connectResolve(),this.connectPromise=null,this.connectResolve=()=>{},this.connectReject=()=>{},this.eventsImpl.fireNetworkConnected(t.networkType,t.address);break;case"ws-disconnected":null!==this.connectPromise?(this.connectReject(),this.connectPromise=null,this.connectResolve=()=>{},this.connectReject=()=>{}):(this.disconnectResolve(),this.disconnectPromise=null,this.disconnectResolve=()=>{}),this.eventsImpl.fireNetworkDisconnected(t.networkType);break;case"ws-extract-progress":this.options.onExtractProgress&&this.options.onExtractProgress(t.index,t.file,t.extracted,t.count);break;case"ws-asyncify-stats":if(t.netSent=this.netSent,t.netRecv=this.netRecv,t.cpuMetrics&&t.cpuMetrics.length>0){const e=t.cpuMetrics.split(" "),n=e[0].split("|"),s={cpuMax:parseInt(n[0]),emulatorSpeed:parseInt(n[1])/100,cpuUsed:parseInt(n[2])/100,frameSkip:parseInt(n[3]),fastForward:"1"===n[4][0],cpuSockdrive:"1"===n[4][1],cpuAuto:"1"===n[4][2],cpuSkip:"1"===n[4][3],sleepPattern:"",ratio:[],newCmax:[],ticksDone:[],ticksScheduled:[]};for(let t=1;t<e.length;t++)if("r"===e[t][0]){const n=e[t].split("|");s.ratio.push(parseInt(n[0].substring(1))/1024),s.newCmax.push(parseInt(n[1])),s.ticksDone.push(parseInt(n[2])),s.ticksScheduled.push(parseInt(n[3]))}else s.sleepPattern+=e[t]+" ";t.cpuMetrics=s}else t.cpuMetrics=null;this.asyncifyStatsResolve(t),this.asyncifyStatsResolve=()=>{},this.asyncifyStatsPromise=null;break;case"ws-fs-tree":this.fsTreeResolve(t.fsTree),this.fsTreeResolve=()=>{},this.fsTreePromise=null;break;case"ws-fs-delete-file":this.fsDeleteFileResolve(t.deleted),this.fsDeleteFileResolve=()=>{},this.fsDeleteFilePromise=null;break;case"ws-send-data-chunk":{const e=t.chunk,n=this.dataChunkKey(e);if("ok"===e.type)void 0!==this.dataChunkPromise[n]&&(this.dataChunkResolve[n](),delete this.dataChunkPromise[n],delete this.dataChunkResolve[n]);else if("file"===e.type)if(null===e.data){const t=this.mergeChunks(this.fsGetFileParts[e.name]);this.fsGetFileResolve[e.name](t),delete this.fsGetFilePromise[e.name],delete this.fsGetFileResolve[e.name]}else this.fsGetFileParts[e.name].push(new Uint8Array(e.data));else console.log("Unknown chunk type:",e.type)}break;case"ws-net-send":{this.netSent+=t.data.length;const e=this.transport.net?.sendBinary(new Uint8Array(t.data),t.peerId);if(0===e){const e=()=>{0===this.transport.net?.sendBinary(new Uint8Array(t.data),t.peerId)&&setTimeout(e,100)};setTimeout(e,100)}}break;case"ws-net-disconnect":this.transport.net?.disconnect(t.peerId);break;case"ws-unload":this.eventsImpl.fireUnload().finally((()=>{this.sendClientMessage("wc-unload")}));break;case"ws-persist-sockdrives":null===t.drives?this.persistSockdrivesResolve(null):this.persistSockdrivesResolve(function(e){function t(e,t,n){return e[n]=255&t,e[n+1]=(65280&t)>>8,e[n+2]=(16711680&t)>>16,e[n+3]=(4278190080&t)>>24,n+4}const n=new TextEncoder,s=[];let i=0;for(const{url:t,persist:o}of e)s.push(n.encode(t)),i+=o.length+s[s.length-1].length+8;const o=new Uint8Array(i);let r=0;for(let n=0;n<e.length;n++){const i=s[n],a=e[n].persist;r=t(o,i.length,r),o.set(i,r),r+=i.length,r=t(o,a.length,r),o.set(a,r),r+=a.length}return o}(t.drives)),this.persistSockdrivesResolve=()=>{},this.persistSockdrivesPromise=null;break;case"ws-get-running-program":null!==this.getRunningProgramPromise&&(this.getRunningProgramResolve(t.program),this.getRunningProgramResolve=()=>{},this.getRunningProgramPromise=null);break;default:console.log("Unknown server message (ws):",e)}}onConfig(e){this.configResolve(e)}onFrameSize(e,t){this.frameWidth===e&&this.frameHeight===t||(this.frameWidth=e,this.frameHeight=t,this.rgb=new Uint8Array(e*t*3),this.eventsImpl.fireFrameSize(e,t))}onFrameLines(e,t,n,s){if(null!==this.rgb&&Array.isArray(e)&&(void 0===n&&void 0===s||n===this.frameWidth&&s===this.frameHeight)){for(const t of e)this.rgb.set(t.heapu8,t.start*this.frameWidth*3);this.eventsImpl.fireFrame(this.rgb,this.rgba)}}onSoundInit(e){this.freq=e}onSoundPush(e){this.eventsImpl.fireSoundPush(e)}onLog(e,t){this.eventsImpl.fireMessage("log","["+e+"]"+t)}onWarn(e,t){this.eventsImpl.fireMessage("warn","["+e+"]"+t)}onErr(e,t){"panic"===e&&(this.panicMessages.push(t),console.error("["+e+"]"+t)),this.eventsImpl.fireMessage("error","["+e+"]"+t)}onStdout(e){this.eventsImpl.fireStdout(e)}config(){return this.configPromise}width(){return this.frameWidth}height(){return this.frameHeight}soundFrequency(){return this.freq}screenshot(){if(null!==this.rgb||null!==this.rgba){const e=new Uint8ClampedArray(this.frameWidth*this.frameHeight*4),t=null!==this.rgb?this.rgb:this.rgba;let n=0,s=0;for(;s<e.length;)e[s++]=t[n++],e[s++]=t[n++],e[s++]=t[n++],e[s++]=255,t.length===e.length&&n++;return Promise.resolve(new ImageData(e,this.frameWidth,this.frameHeight))}return Promise.reject(new Error("No frame received"))}simulateKeyPress(){const e=Date.now()-this.startedAt;for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];n.forEach((t=>this.addKey(t,!0,e))),n.forEach((t=>this.addKey(t,!1,e+16)))}sendKeyEvent(e,t){this.addKey(e,t,Date.now()-this.startedAt)}addKey(e,t,n){!0===this.keyMatrix[e]!==t&&(this.keyMatrix[e]=t,this.sendClientMessage("wc-add-key",{key:e,pressed:t,timeMs:n}))}sendMouseMotion(e,t){this.sendClientMessage("wc-mouse-move",{x:e,y:t,relative:!1,timeMs:Date.now()-this.startedAt})}sendMouseRelativeMotion(e,t){this.sendClientMessage("wc-mouse-move",{x:e,y:t,relative:!0,timeMs:Date.now()-this.startedAt})}sendMouseButton(e,t){this.sendClientMessage("wc-mouse-button",{button:e,pressed:t,timeMs:Date.now()-this.startedAt})}sendMouseSync(){this.sendClientMessage("wc-mouse-sync",{timeMs:Date.now()-this.startedAt})}sendBackendEvent(e){this.sendClientMessage("wc-backend-event",{json:JSON.stringify(e)})}async persist(e){const t=e??!0;if(void 0!==this.persistPromise)return this.persistPromise;const n=await this.persistSockdrives();if(null!==n&&t)return Promise.resolve(n);const s=new Promise((e=>{this.persistResolve=e}));return this.persistPromise=s,this.sendClientMessage("wc-pack-fs-to-bundle",{onlyChanges:t}),s}onPersist(e){this.persistResolve&&(this.persistResolve(e),delete this.persistPromise,delete this.persistResolve)}pause(){this.sendClientMessage("wc-pause")}resume(){this.sendClientMessage("wc-resume")}mute(){this.sendClientMessage("wc-mute")}unmute(){this.sendClientMessage("wc-unmute")}exit(){if(this.exited)return Promise.resolve();if(void 0!==this.exitPromise)return this.exitPromise;this.exitPromise=new Promise((e=>this.exitResolve=e)),this.exitPromise.then((()=>{this.events().fireExit()})),this.resume();for(const e of this.transport.net?.connected??[])this.transport.net?.disconnect(e);return this.sendClientMessage("wc-exit"),this.exitPromise}onExit(){this.exited||(this.exited=!0,null!==this.netPollInterval&&(clearInterval(this.netPollInterval),this.netPollInterval=null),void 0!==this.transport.exit&&this.transport.exit(),this.exitResolve&&(this.exitResolve(),delete this.exitPromise,delete this.exitResolve))}events(){return this.eventsImpl}networkConnect(e,t){return null!==this.connectPromise||null!==this.disconnectPromise?Promise.reject(new Error("Already prefoming connection or disconnection...")):(this.connectPromise=new Promise(((n,s)=>{this.connectResolve=n,this.connectReject=s,this.sendClientMessage("wc-connect",{networkType:e,address:t})})),this.connectPromise)}networkDisconnect(e){return null!==this.connectPromise||null!==this.disconnectPromise?Promise.reject(new Error("Already prefoming connection or disconnection...")):(this.disconnectPromise=new Promise((t=>{this.disconnectResolve=t,this.sendClientMessage("wc-disconnect",{networkType:e})})),this.disconnectPromise)}asyncifyStats(){if(null!==this.asyncifyStatsPromise)return this.asyncifyStatsPromise;const e=new Promise((e=>{this.asyncifyStatsResolve=e}));return this.asyncifyStatsPromise=e,this.sendClientMessage("wc-asyncify-stats",{}),e}fsTree(){if(null!==this.fsTreePromise)return this.fsTreePromise;const e=new Promise((e=>{this.fsTreeResolve=e}));return this.fsTreePromise=e,this.sendClientMessage("wc-fs-tree"),e}async fsReadFile(e){if(void 0!==this.fsGetFilePromise[e])throw new Error("fsGetFile should not be called twice for same file");const t=new Promise((t=>{this.fsGetFileResolve[e]=t}));return this.fsGetFilePromise[e]=t,this.fsGetFileParts[e]=[],this.sendClientMessage("wc-fs-get-file",{file:e}),t}async fsWriteFile(e,t){if(ArrayBuffer.isView(t))await this.sendDataChunk({type:"file",name:e,data:t.buffer});else{const n=t.getReader();for(;;){const t=await n.read();if(void 0!==t.value&&await this.sendDataChunk({type:"file",name:e,data:t.value.buffer}),t.done)break}}await this.sendDataChunk({type:"file",name:e,data:null})}async fsDeleteFile(e){if(null!==this.fsDeleteFilePromise)throw new Error("fsDeleteFile should not be called while previous one is not resolved");const t=new Promise((e=>{this.fsDeleteFileResolve=e}));return this.fsDeleteFilePromise=t,this.sendClientMessage("wc-fs-delete-file",{file:e}),t}async persistSockdrives(){return null===this.persistSockdrivesPromise&&(this.persistSockdrivesPromise=new Promise((e=>{this.persistSockdrivesResolve=e})),this.sendClientMessage("wc-persist-sockdrives")),this.persistSockdrivesPromise}async sendDataChunk(e){if(null===e.data||e.data.byteLength<=i)return this.sendFullDataChunk(e);{let t=0;for(;t<e.data.byteLength;)await this.sendFullDataChunk({type:e.type,name:e.name,data:e.data.slice(t,Math.min(e.data.byteLength,t+i))}),t+=i}}async sendFullDataChunk(e){const t=this.dataChunkKey(e);if(void 0!==this.dataChunkPromise[t])throw new Error("sendDataChunk should be accepted before sending new one");const n=new Promise((e=>{this.dataChunkResolve[t]=e}));return this.dataChunkPromise[t]=n,this.sendClientMessage("wc-send-data-chunk",{chunk:e},null===e.data?void 0:[e.data]),n}dataChunkKey(e){return e.name}mergeChunks(e){if(1===e.length)return e[0];let t=0;for(const n of e)t+=n.byteLength;const n=new Uint8Array(t);t=0;for(const s of e)n.set(s,t),t+=s.byteLength;return n}net(){return this.transport.net??null}getRunningProgram(){return null!==this.getRunningProgramPromise||(this.getRunningProgramPromise=new Promise((e=>{this.getRunningProgramResolve=e})),this.sendClientMessage("wc-get-running-program")),this.getRunningProgramPromise}}},{"../impl/ci-impl":74,"core-js/modules/es.typed-array.set.js":65}],81:[function(e,t,n){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.writeUint32=n.readUint32=n.getStore=n.OpfsStore=n.NoStore=void 0;class s{store=new Map;put(e,t){return this.store.set(e,t),Promise.resolve()}getSync(e){return this.store.get(e)??null}getAsync(e){return Promise.resolve(null)}keys(){return Promise.resolve(Array.from(this.store.keys()))}}n.NoStore=s;class i{dir;index=new Map;syncMode=!1;blockHandle=null;metaHandle=null;blockSize=0;metaSize=0;blockLength;metaEntry=new Uint8Array(8);asyncOpPromise=null;constructor(e,t){this.dir=e,this.blockLength=t}static async create(e,t,n){const s=await navigator.storage.getDirectory(),o=await s.getDirectoryHandle(n,{create:!0}),r=await o.getDirectoryHandle("caches",{create:!0}),a=await r.getDirectoryHandle("sockdrive",{create:!0}),l=await a.getDirectoryHandle((c=e,c.replace(/^https?:\/\//,"").replace(/[^a-zA-Z0-9._-]/g,"_").substring(0,200)),{create:!0});var c;const u=new i(l,t);return await u.init(),u}async init(){const e=await this.dir.getFileHandle("_block",{create:!0}),t=await this.dir.getFileHandle("_meta",{create:!0});try{const n=await e.createSyncAccessHandle();this.blockHandle=n;const s=await t.createSyncAccessHandle();this.metaHandle=s,this.blockSize=n.getSize(),this.metaSize=s.getSize(),this.syncMode=!0}catch(n){try{this.blockHandle?.close()}catch{}try{this.metaHandle?.close()}catch{}this.blockHandle=null,this.metaHandle=null,console.warn("OPFS sync mode unavailable, using async fallback",n),this.blockHandle=e,this.metaHandle=t;const s=await this.blockHandle.getFile();this.blockSize=s.size}let n=null;try{const e=await(await this.dir.getFileHandle("_meta")).getFile();e.size>=8&&(n=new Uint8Array(await e.arrayBuffer()))}catch{}if(n&&this.blockSize>this.blockLength)[this.metaSize,this.blockSize]=this.loadIndex(n,this.blockSize);else if(this.index.clear(),this.metaSize=0,this.blockSize=0,this.syncMode)this.blockHandle.truncate(0),this.metaHandle.truncate(0);else{const e=await this.blockHandle.createWritable();await e.close();const t=await this.metaHandle.createWritable();await t.close()}}loadIndex(e,t){const n=Math.floor(e.length/8)*this.blockLength;let s=0,i=0;for(;s+8<=e.byteLength&&i+this.blockLength<=t;){const t=o(e,s),n=o(e,s+4);this.index.set(t,n),s+=8,i+=this.blockLength}return s!==e.byteLength&&console.warn("OPFS _meta file corrupted: expected",s,"bytes, got",e.byteLength),(i!==t||t<n)&&console.warn("OPFS _block file corrupted: expected",i/this.blockLength,"bytes, got",t/this.blockLength," meta expects",n/this.blockLength),[8*this.index.size,this.index.size*this.blockLength]}async keys(){return Array.from(this.index.keys())}async put(e,t){for(;null!==this.asyncOpPromise;)await this.asyncOpPromise;const n=this.blockSize;if(r(this.metaEntry,e,0),r(this.metaEntry,n,4),this.syncMode){const e=this.blockHandle,s=this.metaHandle;e.write(t,{at:n}),s.write(this.metaEntry,{at:this.metaSize}),e.flush(),s.flush()}else{const e=async function(t,n,s,i){let o;try{o=await t.createWritable({keepExistingData:!0})}catch(o){return console.warn("Can't create wirtable for '"+i+"', cause: '"+(o.message??"???")+"', retrying..."),await new Promise((e=>setTimeout(e,16))),e(t,n,s,i)}await o.seek(n),await o.write(s),await o.close()};this.asyncOpPromise=(async()=>{const s=e(this.blockHandle,n,t,"_block"),i=e(this.metaHandle,this.metaSize,this.metaEntry,"_meta");try{await s}catch(e){console.error("Can't write _block file "+e.message??"???")}try{await i}catch(e){console.error("Can't write _meta file "+e.message??"???")}this.asyncOpPromise=null})()}return this.blockSize+=this.blockLength,this.metaSize+=8,this.index.set(e,n),this.asyncOpPromise??Promise.resolve()}getSync(e){if(!this.syncMode)return null;const t=this.index.get(e);if(void 0===t)return null;const n=new Uint8Array(this.blockLength);return this.blockHandle.read(n,{at:t}),n}async getAsync(e){if(this.syncMode)return null;for(;null!==this.asyncOpPromise;)await this.asyncOpPromise;const t=this.index.get(e);if(void 0===t)return null;const n=await this.blockHandle.getFile();return new Uint8Array(await n.slice(t,t+this.blockLength).arrayBuffer())}}function o(e,t){return(255&e[t]|e[t+1]<<8&65280|e[t+2]<<16&16711680|e[t+3]<<24&4278190080)>>>0}function r(e,t,n){return e[n]=255&t,e[n+1]=(65280&t)>>8,e[n+2]=(16711680&t)>>16,e[n+3]=(4278190080&t)>>24,n+4}n.OpfsStore=i,n.getStore=async function(e,t,n){try{if("undefined"!=typeof navigator&&navigator.storage&&"function"==typeof navigator.storage.getDirectory)return await i.create(e,t,n)}catch(e){console.warn("OPFS not available, falling back to in-memory store",e)}return new s},n.readUint32=o,n.writeUint32=r},{"core-js/modules/es.typed-array.set.js":65}],82:[function(e,t,n){(function(t){(function(){"use strict";e("core-js/modules/es.typed-array.set.js"),Object.defineProperty(n,"__esModule",{value:!0}),n.traverseSockdriveChanges=n.sockdrive=void 0;const s=e("./sockdrive-store"),i=e("../protocol/mini-lz4"),o="undefined"!=typeof window?window:"undefined"!=typeof self?self:t;async function r(e,t,n,r,a){const l=await fetch(e+"/sockdrive.metaj"),c=await l.json(),u=await(0,s.getStore)(e,c.ahead_read,a);try{c.preload_ranges=await(await fetch(e+"/preload_ranges.metaj")).json()}catch(e){}c.url=e,c.readInBytes=0,c.writeInBytes=0;const d=new Set;void 0===c.small_ranges&&(c.small_ranges=[]);let h=new Map;t&&(c.writeInBytes=t.length,h=_(t));const f=new Set;for(const e of await u.keys())f.add(e);if(void 0!==c.small_ranges.find((e=>!f.has(e)))){const t=new Uint8Array(await(await fetch(e+"/preload.raw")).arrayBuffer());for(let e=0;e<c.small_ranges.length;e++){const n=c.small_ranges[e];f.add(n),u.put(n,t.slice(e*c.ahead_read,(e+1)*c.ahead_read)).catch(console.error)}}const p=new Set,m=c.dropped_ranges,y=new Set;c.dropped_ranges=[];for(const e of m)y.add(e),h.has(e)||(p.add(e),c.dropped_ranges.push(e));const b=[],g=new Set;if("none"===n)console.warn("Preload mode is disabled");else if("_"!==c.preload_ranges&&"all"!==n)for(const e of c.preload_ranges)p.has(e)||(b.push(e),g.add(e));else for(let e=0;e<c.range_count;e++)p.has(e)||b.push(e);{const e=[];for(const t of b)(t<0||t>=c.range_count)&&e.push(t);if(e.length>0){console.error("sockdrive-error: invalid ranges",e);for(const t of e)b.splice(b.indexOf(t),1)}}b.reverse();let w=b.length;for(let e=0;e<c.range_count;e++)p.has(e)||g.has(e)||w++;function v(e){return Math.floor(e*c.sector_size/c.ahead_read)}function x(e,t){r(e,function(e,t){if(h.has(e))for(const[n,s]of h.get(e).entries())t.set(s,n*c.sector_size);return t}(e,t))}async function P(t){try{if(y.has(t))return void x(t,new Uint8Array(c.ahead_read));if(f.has(t)){let e=u.getSync(t);if(null===e&&(e=await u.getAsync(t)),e)return void x(t,e)}let n=3;for(;n>0;){let s;try{s=await fetch(e+"/"+t+".raw")}catch(e){}if(!s||!s.ok){if(n--,n>0){console.warn("Can't read range "+t+", network response code is "+s?.status+", retrying...");continue}throw new Error("Can't read range "+t+", network response code is "+s?.status)}const i=new Uint8Array(await s.arrayBuffer());u.put(t,i).catch(console.error),x(t,i);break}}catch(e){console.error("Can't read range",t,e)}finally{c.readInBytes+=c.ahead_read}}async function k(){const e=[];for(;b.length>0&&e.length<4;){const t=b.pop();p.has(t)||(p.add(t),e.push(P(t)))}await Promise.all(e),b.length>0&&k().catch(console.error)}function S(e){const t=new Map;for(const[n,s]of e.entries())s.forEach(((e,s)=>{t.set(s+n*c.ahead_read/c.sector_size,e)}));const n=c.sector_size+4,s=(0,i.compressBound)(n),o=new Uint8Array(n),r=new Uint32Array(o.buffer),a=new Uint8Array(s),l=[];let u=0;t.forEach(((e,t)=>{r[0]=t,o.set(e,4);const s=(0,i.compress)(o,a,0,a.length);s<=0||s>=o.length?(l.push(o.slice(0)),u+=n):(l.push(a.slice(0,s)),u+=s)}));const d=new Uint8Array(u+4*t.size+4);d[0]=t.size,d[1]=(65280&t.size)>>8,d[2]=(16711680&t.size)>>16,d[3]=(4278190080&t.size)>>24;let h=4;for(const e of l)d[h]=e.length,d[h+1]=(65280&e.length)>>8,d[h+2]=(16711680&e.length)>>16,d[h+3]=(4278190080&e.length)>>24,h+=4,d.set(e,h),h+=e.length;return d}function _(e){const t=new Map,n=255&e[0]|e[1]<<8&65280|e[2]<<16&16711680|e[3]<<24&4278190080,s=c.sector_size+4,o=new Uint8Array(s),r=new Uint32Array(o.buffer);let a=4;for(let l=0;l<n;l++){const n=255&e[a]|e[a+1]<<8&65280|e[a+2]<<16&16711680|e[a+3]<<24&4278190080;a+=4;const u=e.slice(a,a+n);let d,h;if(a+=n,n===s)d=new Uint32Array(u.buffer)[0],h=u.slice(4);else{const e=(0,i.uncompress)(u,o,0,0);if(e!==s)return console.error("Can't uncompress sectors data, size mismatch",e,"!==",s,"chunk",l,"offset",a),new Map;d=r[0],h=o.slice(4)}const f=v(d);t.has(f)||t.set(f,new Map),t.get(f).set(d-f*c.ahead_read/c.sector_size,h)}return t}return c.preloadSizeInBytes=b.length*c.ahead_read,c.sizeInBytes=w*c.ahead_read,o.loadedRanges=()=>{console.log("Loaded ranges ("+d.size+"):",JSON.stringify(Array.from(d).sort(((e,t)=>e-t))))},o.brotliRanges=()=>{console.log("Loaded ranges ("+d.size+"):","echo '"+JSON.stringify(Array.from(d).sort(((e,t)=>e-t)))+"' | brotli > /tmp/preload_ranges.metaj")},o.verifySectors=()=>{if(0===h.size)return;const e=S(h),t=new Blob([e],{type:"application/octet-stream"}),n=URL.createObjectURL(t);console.log("Download serialized sectors:",n);const s=_(e);console.log("Comparing sectors and deserialized:"),console.log("Original sectors size:",h.size),console.log("Deserialized sectors size:",s.size),h.forEach(((e,t)=>{const n=s.get(t);n?e.forEach(((e,s)=>{const i=n.get(s);if(!i)return void console.error(`Sector ${s} missing in range ${t}`);e.length===i.length&&e.every(((e,t)=>e===i[t]))||(console.error(`Data mismatch in range ${t}, sector ${s}`),console.log("Original:",e),console.log("Deserialized:",i))})):console.error(`Range ${t} missing in deserialized data`)}))},{info:c,range:v,readRangeAsync:async e=>{d.add(e),p.has(e)||(p.add(e),P(e))},ready:()=>{k().catch(console.error)},write:(e,t)=>{const n=v(e);h.has(n)||h.set(n,new Map),h.get(n).set(e-n*c.ahead_read/c.sector_size,t)},persist:async()=>{const e=S(h);return e.byteLength>4?e:null}}}function a(e,t){const n=new TextDecoder;let i=0;for(;i<e.length;){const o=(0,s.readUint32)(e,i);if(i+=4,o>4096)return!1;const r=n.decode(e.slice(i,i+o));if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;i+=o;const a=(0,s.readUint32)(e,i);i+=4;const l=e.slice(i,i+a);i+=a,t(r,l)}return!0}n.sockdrive=r,n.traverseSockdriveChanges=a,o.sockdrive=r,o.traverseSockdriveChanges=a}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../protocol/mini-lz4":79,"./sockdrive-store":81,"core-js/modules/es.typed-array.set.js":65}]},{},[72]);
|
|
2
2
|
//# sourceMappingURL=emulators.js.map
|