code-playpad 0.8.0 → 0.9.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/README.md +59 -4
- package/dist/COMPILER-LICENSE-AUDIT.md +104 -0
- package/dist/COMPILER-NOTICES.txt +16973 -0
- package/dist/THIRD-PARTY-NOTICES.txt +102 -0
- package/dist/cdn.js +2 -2
- package/dist/compiler-license-manifest.json +198 -0
- package/dist/{config-D9w0xYhX.js → config-cwuPIQ48.js} +1 -1
- package/dist/cpp-D2TrExLz.js +1 -0
- package/dist/cpp-DakNa4ys.js +6 -0
- package/dist/dist-CNOK8CHE.js +6 -0
- package/dist/{element-BTbopmDc.js → element-BQWrbSEp.js} +4 -4
- package/dist/element.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{java-p3d2UdsW.js → java-DeBiVPXO.js} +1 -1
- package/dist/{java-CAuQOfuB.js → java-Xf1xYcVv.js} +1 -1
- package/dist/{javascript-BgIyjzbD.js → javascript-CTY3U1Mc.js} +1 -1
- package/dist/{javascript-BUUMtBcS.js → javascript-DkarEcEB.js} +1 -1
- package/dist/{pyodide-BCtQRDyT.js → pyodide-B1U3JD9Z.js} +1 -1
- package/dist/{pyodide-DKoE92s5.js → pyodide-BGBI232i.js} +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/compiler-assets.d.ts +5 -0
- package/dist/runtime/compiler-cache.d.ts +9 -0
- package/dist/runtime/config.d.ts +11 -0
- package/dist/runtime/cpp/assets.d.ts +6 -0
- package/dist/runtime/cpp/project.d.ts +9 -0
- package/dist/runtime/cpp/worker.d.ts +1 -0
- package/dist/runtime/cpp-worker.generated.d.ts +1 -0
- package/dist/runtime/cpp.d.ts +3 -0
- package/dist/runtime/worker-runtime.d.ts +1 -0
- package/dist/standalone.js +9 -9
- package/dist/types.d.ts +13 -1
- package/dist/{worker-runtime-C2AhIV7u.js → worker-runtime-DfYet3xy.js} +2 -2
- package/dist/{worker-runtime-DJs9O_oY.js → worker-runtime-Dq71SbjR.js} +2 -2
- package/package.json +17 -5
|
@@ -3,6 +3,33 @@ Their licenses and copyright notices are reproduced in full below.
|
|
|
3
3
|
|
|
4
4
|
Pyodide (MPL-2.0) is NOT bundled — it is fetched from a CDN at runtime.
|
|
5
5
|
|
|
6
|
+
==============================================================================
|
|
7
|
+
@bjorn3/browser_wasi_shim 0.4.2 — MIT
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any
|
|
10
|
+
person obtaining a copy of this software and associated
|
|
11
|
+
documentation files (the "Software"), to deal in the
|
|
12
|
+
Software without restriction, including without
|
|
13
|
+
limitation the rights to use, copy, modify, merge,
|
|
14
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
15
|
+
the Software, and to permit persons to whom the Software
|
|
16
|
+
is furnished to do so, subject to the following
|
|
17
|
+
conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice
|
|
20
|
+
shall be included in all copies or substantial portions
|
|
21
|
+
of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
24
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
25
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
26
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
27
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
28
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
29
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
30
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
31
|
+
DEALINGS IN THE SOFTWARE.
|
|
32
|
+
|
|
6
33
|
==============================================================================
|
|
7
34
|
@codemirror/autocomplete 6.20.3 — MIT
|
|
8
35
|
|
|
@@ -53,6 +80,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
53
80
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
54
81
|
THE SOFTWARE.
|
|
55
82
|
|
|
83
|
+
==============================================================================
|
|
84
|
+
@codemirror/lang-cpp 6.0.3 — MIT
|
|
85
|
+
|
|
86
|
+
MIT License
|
|
87
|
+
|
|
88
|
+
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
89
|
+
|
|
90
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
91
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
92
|
+
in the Software without restriction, including without limitation the rights
|
|
93
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
94
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
95
|
+
furnished to do so, subject to the following conditions:
|
|
96
|
+
|
|
97
|
+
The above copyright notice and this permission notice shall be included in
|
|
98
|
+
all copies or substantial portions of the Software.
|
|
99
|
+
|
|
100
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
103
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
104
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
105
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
106
|
+
THE SOFTWARE.
|
|
107
|
+
|
|
56
108
|
==============================================================================
|
|
57
109
|
@codemirror/lang-java 6.0.2 — MIT
|
|
58
110
|
|
|
@@ -370,6 +422,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
370
422
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
371
423
|
THE SOFTWARE.
|
|
372
424
|
|
|
425
|
+
==============================================================================
|
|
426
|
+
@lezer/cpp 1.1.6 — MIT
|
|
427
|
+
|
|
428
|
+
MIT License
|
|
429
|
+
|
|
430
|
+
Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
431
|
+
|
|
432
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
433
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
434
|
+
in the Software without restriction, including without limitation the rights
|
|
435
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
436
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
437
|
+
furnished to do so, subject to the following conditions:
|
|
438
|
+
|
|
439
|
+
The above copyright notice and this permission notice shall be included in
|
|
440
|
+
all copies or substantial portions of the Software.
|
|
441
|
+
|
|
442
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
443
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
444
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
445
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
446
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
447
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
448
|
+
THE SOFTWARE.
|
|
449
|
+
|
|
373
450
|
==============================================================================
|
|
374
451
|
@lezer/highlight 1.2.3 — MIT
|
|
375
452
|
|
|
@@ -868,3 +945,28 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
868
945
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
869
946
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
870
947
|
THE SOFTWARE.
|
|
948
|
+
|
|
949
|
+
==============================================================================
|
|
950
|
+
weblings (worker protocol and sysroot format) d0cd7a9f3af7d8249b3948ac0e19d2afc0d01633 — MIT
|
|
951
|
+
|
|
952
|
+
MIT License
|
|
953
|
+
|
|
954
|
+
Copyright (c) 2026 Forest Anderson
|
|
955
|
+
|
|
956
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
957
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
958
|
+
in the Software without restriction, including without limitation the rights
|
|
959
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
960
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
961
|
+
furnished to do so, subject to the following conditions:
|
|
962
|
+
|
|
963
|
+
The above copyright notice and this permission notice shall be included in all
|
|
964
|
+
copies or substantial portions of the Software.
|
|
965
|
+
|
|
966
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
967
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
968
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
969
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
970
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
971
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
972
|
+
SOFTWARE.
|
package/dist/cdn.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! code-playpad 0.
|
|
2
|
-
export * from "https://cdn.jsdelivr.net/npm/code-playpad@0.
|
|
1
|
+
/*! code-playpad 0.9.0: CDN entry, loads dist/standalone.js of this exact version */
|
|
2
|
+
export * from "https://cdn.jsdelivr.net/npm/code-playpad@0.9.0/dist/standalone.js";
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"auditDate": "2026-10-27",
|
|
3
|
+
"releaseApproved": false,
|
|
4
|
+
"scope": "Verified notice evidence. C/C++ clearance is scoped to the pinned rebuilt artifact set. Historical browsercc binaries are superseded, not retroactively cleared.",
|
|
5
|
+
"blockers": [],
|
|
6
|
+
"sourceRevisions": {
|
|
7
|
+
"browsercc": "86168bacf0fe7c662e3e65a2e3006ceb159cd0dc",
|
|
8
|
+
"llvm20": "58df0ef89dd64126512e4ee27b4ac3fd8ddf6247",
|
|
9
|
+
"wasiSdk25Llvm": "ab4b5a2db582958af1ee308a790cfdb42bd24720",
|
|
10
|
+
"wasiSdk25Libc": "574b88da481569b65a237cb80daf9a2d5aeaf82d",
|
|
11
|
+
"cppEmscripten": "1ddaae4d2d6dfbb678ecc193bc988820d1fc4633",
|
|
12
|
+
"cppEmsdk": "24fc909c0da13ef641d5ae75e89b5a97f25e37aa",
|
|
13
|
+
"cppSdkBuild": "14767574a5c37ff9526a253a65ddbe0811cb3667"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"file": "browsercc-LICENSE",
|
|
18
|
+
"source": "https://registry.npmjs.org/browsercc/-/browsercc-0.1.1.tgz#package/LICENSE",
|
|
19
|
+
"sha256": "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"file": "cpp-rebuild/THIRD-PARTY-NOTICES.txt",
|
|
23
|
+
"source": "Generated from the immutable source URLs recorded in cpp-rebuild/source-notice-inventory.json and toolchains/cpp/inputs.lock.json",
|
|
24
|
+
"sha256": "f66467b0faab2713c92192fd91dcabe3430953fc1f63a18f63d371b722983b49"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"file": "cpp-rebuild/provenance.json",
|
|
28
|
+
"source": "Generated from the immutable source URLs recorded in cpp-rebuild/source-notice-inventory.json and toolchains/cpp/inputs.lock.json",
|
|
29
|
+
"sha256": "c9a6c08e447d8f9793767dd34488edeff2f1e6462882277b37f21be808ea02bc"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"file": "cpp-rebuild/source-notice-inventory.json",
|
|
33
|
+
"source": "Generated from the immutable source URLs recorded in cpp-rebuild/source-notice-inventory.json and toolchains/cpp/inputs.lock.json",
|
|
34
|
+
"sha256": "76995da24bac086bf31825cbbcbdcd4dec39a9db7ebb240240b8fa6a6b1f1df6"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"file": "llvm-20.1.2/clang-LICENSE.TXT",
|
|
38
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/58df0ef89dd64126512e4ee27b4ac3fd8ddf6247/clang/LICENSE.TXT",
|
|
39
|
+
"sha256": "ebcd9bbf783a73d05c53ba4d586b8d5813dcdf3bbec50265860ccc885e606f47"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"file": "llvm-20.1.2/lld-LICENSE.TXT",
|
|
43
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/58df0ef89dd64126512e4ee27b4ac3fd8ddf6247/lld/LICENSE.TXT",
|
|
44
|
+
"sha256": "f7891568956e34643eb6a0db1462db30820d40d7266e2a78063f2fe233ece5a0"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"file": "llvm-20.1.2/llvm-LICENSE.TXT",
|
|
48
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/58df0ef89dd64126512e4ee27b4ac3fd8ddf6247/llvm/LICENSE.TXT",
|
|
49
|
+
"sha256": "8d85c1057d742e597985c7d4e6320b015a9139385cff4cbae06ffc0ebe89afee"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"file": "wasi-sdk-25-llvm/compiler-rt-LICENSE.TXT",
|
|
53
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/ab4b5a2db582958af1ee308a790cfdb42bd24720/compiler-rt/LICENSE.TXT",
|
|
54
|
+
"sha256": "1a8f1058753f1ba890de984e48f0242a3a5c29a6a8f2ed9fd813f36985387e8d"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"file": "wasi-sdk-25-llvm/libcxx-LICENSE.TXT",
|
|
58
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/ab4b5a2db582958af1ee308a790cfdb42bd24720/libcxx/LICENSE.TXT",
|
|
59
|
+
"sha256": "539dd7aed86e8a4f12cbdd0e6c50c189c7d74847e4fecc64ce2c6ee3a01da38b"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"file": "wasi-sdk-25-llvm/libcxxabi-LICENSE.TXT",
|
|
63
|
+
"source": "https://raw.githubusercontent.com/llvm/llvm-project/ab4b5a2db582958af1ee308a790cfdb42bd24720/libcxxabi/LICENSE.TXT",
|
|
64
|
+
"sha256": "e2b35be49f7284a45b7baca8fc7b3ab7440e7902392b2528a457816b5bb2a15c"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"file": "wasi-sdk-25/LICENSE",
|
|
68
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/LICENSE",
|
|
69
|
+
"sha256": "2711a8b5a5cdfef0e639f96c1aca12ae23d7d64a02d0507f1bdf14d2b27bbc3a"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"file": "wasi-sdk-25/LICENSE-APACHE",
|
|
73
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/LICENSE-APACHE",
|
|
74
|
+
"sha256": "a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"file": "wasi-sdk-25/LICENSE-APACHE-LLVM",
|
|
78
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/LICENSE-APACHE-LLVM",
|
|
79
|
+
"sha256": "268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"file": "wasi-sdk-25/LICENSE-MIT",
|
|
83
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/LICENSE-MIT",
|
|
84
|
+
"sha256": "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"file": "wasi-sdk-25/dlmalloc--src--malloc.NOTICE.txt",
|
|
88
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/dlmalloc/src/malloc.c",
|
|
89
|
+
"sha256": "f75194bd249c169a7932268424558483eb1bde1ebab206ce1f23205f303ce2c2",
|
|
90
|
+
"excerpt": "First 7 source lines (dlmalloc) or first 6 lines (emmalloc); attribution/license header only."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"file": "wasi-sdk-25/emmalloc--emmalloc.NOTICE.txt",
|
|
94
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/emmalloc/emmalloc.c",
|
|
95
|
+
"sha256": "37dd8253d6f7051a15a798cdf052d306e1fda986a449b035930607d1569a0373",
|
|
96
|
+
"excerpt": "First 7 source lines (dlmalloc) or first 6 lines (emmalloc); attribution/license header only."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"file": "wasi-sdk-25/fts--musl-fts--COPYING",
|
|
100
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/fts/musl-fts/COPYING",
|
|
101
|
+
"sha256": "55af87e4017668f54467a3380e7ebbac5e672d8c763bfe95e6fc882a6fdc4046"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"file": "wasi-sdk-25/libc-bottom-half--cloudlibc--LICENSE",
|
|
105
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/libc-bottom-half/cloudlibc/LICENSE",
|
|
106
|
+
"sha256": "c8b789cf5a746611e6300a0cc7750dbf92b61912a709d04e639245f7290656d0"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"file": "wasi-sdk-25/libc-top-half--musl--COPYRIGHT",
|
|
110
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/libc-top-half/musl/COPYRIGHT",
|
|
111
|
+
"sha256": "f9bc4423732350eb0b3f7ed7e91d530298476f8fec0c6c427a1c04ade22655af"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"file": "wasi-sdk-25/tools--wasi-headers--LICENSE",
|
|
115
|
+
"source": "https://raw.githubusercontent.com/WebAssembly/wasi-libc/574b88da481569b65a237cb80daf9a2d5aeaf82d/tools/wasi-headers/LICENSE",
|
|
116
|
+
"sha256": "268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"file": "weblings-LICENSE",
|
|
120
|
+
"source": "https://raw.githubusercontent.com/AngelOnFira/weblings/d0cd7a9f3af7d8249b3948ac0e19d2afc0d01633/LICENSE",
|
|
121
|
+
"sha256": "bcba9b4483221536f2217cc584da9a487e396c9e4a33f21ba1e08de6cfa16801"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"artifacts": [
|
|
125
|
+
{
|
|
126
|
+
"file": "cpp/clang.js",
|
|
127
|
+
"bytes": 74300,
|
|
128
|
+
"sha256": "b437a648812aabd1cc87cba4a7268e2f53ab94a9071a854ba983dd62328dc30c"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"file": "cpp/clang.wasm",
|
|
132
|
+
"bytes": 42578038,
|
|
133
|
+
"sha256": "534571fd4f9136c85d3e25a395cc31983ec3cbd41012e3928b45879a518718fa"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"file": "cpp/lld.js",
|
|
137
|
+
"bytes": 71711,
|
|
138
|
+
"sha256": "2da4b0a04b6953bdc4869137631abd11ea7eb5a667fbd19c4ff6d68d56f302bb"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"file": "cpp/lld.wasm",
|
|
142
|
+
"bytes": 23228304,
|
|
143
|
+
"sha256": "55ffbe1366525c1b55b65140630e0ca00ff47eae7acfdee6a15b46e738800ec7"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"file": "cpp/sysroot.tar",
|
|
147
|
+
"bytes": 29009920,
|
|
148
|
+
"sha256": "a0d92a9fc1dccc2c181ae6812b6c169de3dad851ee4d4e796d15940776648ac5"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"cppSysrootFileCount": 1519,
|
|
152
|
+
"cppSysrootStandaloneNotices": [
|
|
153
|
+
"share/licenses/code-playpad-cpp/THIRD-PARTY-NOTICES.txt",
|
|
154
|
+
"share/licenses/code-playpad-cpp/MODIFICATIONS.md",
|
|
155
|
+
"share/licenses/code-playpad-cpp/inputs.lock.json"
|
|
156
|
+
],
|
|
157
|
+
"toolchains": {
|
|
158
|
+
"cpp": {
|
|
159
|
+
"id": "code-playpad-cpp-20.1.2-emscripten-4.0.6-r1",
|
|
160
|
+
"licenseReviewComplete": true,
|
|
161
|
+
"blockers": [],
|
|
162
|
+
"scope": "Only the rebuilt hashes in toolchains/cpp/assets.lock.json, distributed with their notice/provenance companions. Hosting and physical-device gates are separate.",
|
|
163
|
+
"provenance": "third-party/compiler/cpp-rebuild/provenance.json"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"supersededArtifacts": [
|
|
167
|
+
{
|
|
168
|
+
"file": "cpp/clang.js",
|
|
169
|
+
"bytes": 74193,
|
|
170
|
+
"sha256": "27aeadfcdb71f37fdeb6f1ca339de913ef9e2fdd1fd53c238a5decf635d9b129"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"file": "cpp/clang.wasm",
|
|
174
|
+
"bytes": 42553880,
|
|
175
|
+
"sha256": "d574339640a9764544f405d4b5ae79ef7d05e49725b416fba74f5b15c00f8ee5"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"file": "cpp/lld.js",
|
|
179
|
+
"bytes": 71604,
|
|
180
|
+
"sha256": "b5054c24942687c744adbadcd549073ce3ecaf69b9fed5fa85a20c046751c1bf"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"file": "cpp/lld.wasm",
|
|
184
|
+
"bytes": 23202572,
|
|
185
|
+
"sha256": "810bb3be4eec8ad6bae60ceb7355c07bf7de8a54b5c8acb4d7a80613bd43c4bf"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"file": "cpp/sysroot.tar",
|
|
189
|
+
"bytes": 28620800,
|
|
190
|
+
"sha256": "dbed83f93f0fa695f36041b82a95a8cd78f106a3f49d9cd860e57ae1ac823318"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"file": "browsercc-0.1.1.tgz",
|
|
194
|
+
"bytes": 39898121,
|
|
195
|
+
"sha256": "a937c2588bef53124ebcb4909248393fdf4b08c9baec254d071a6bf1d3b57d9a"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Bundles CodeMirror 6 and Lezer (MIT) © Marijn Haverbeke and others.
|
|
4
4
|
* Full third-party licences: THIRD-PARTY-NOTICES.txt in this package.
|
|
5
5
|
*/
|
|
6
|
-
var e=`314.0.5`,t=`https://cdn.jsdelivr.net/pyodide/v${e}/full/`,n=null;function r(e){t=e.indexURL.endsWith(`/`)?e.indexURL:e.indexURL+`/`}function i(e){n=e.sucraseURL}function a(){return t}function o(){return n}function s(){return[{url:t+`pyodide.js`,as:`script`},{url:t+`pyodide.asm.wasm`,as:`fetch`},{url:t+`python_stdlib.zip`,as:`fetch`}]}export{
|
|
6
|
+
var e=`314.0.5`,t=`https://cdn.jsdelivr.net/pyodide/v${e}/full/`,n=null;function r(e){t=e.indexURL.endsWith(`/`)?e.indexURL:e.indexURL+`/`}function i(e){n=e.sucraseURL}function a(){return t}function o(){return n}function s(){return[{url:t+`pyodide.js`,as:`script`},{url:t+`pyodide.asm.wasm`,as:`fetch`},{url:t+`python_stdlib.zip`,as:`fetch`}]}var c={timeoutMs:12e4};function l(e){let t={...c};if(e.indexURL!==void 0){let n=new URL(e.indexURL);if(![`https:`,`http:`].includes(n.protocol))throw Error(`C/C++ asset URL must use HTTP or HTTPS.`);t.indexURL=n.href.endsWith(`/`)?n.href:n.href+`/`}if(e.timeoutMs!==void 0){if(!Number.isFinite(e.timeoutMs)||e.timeoutMs<=0)throw Error(`timeoutMs must be a positive finite number.`);t.timeoutMs=e.timeoutMs}c=t}function u(){return{...c}}export{u as a,s as c,i,l as n,a as o,r,o as s,e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./config-cwuPIQ48.js";import{t}from"./worker-runtime-Dq71SbjR.js";var n=`code-playpad-cpp-20.1.2-emscripten-4.0.6-r1`,r=/* @__PURE__ */ new Map;async function i(e){r.has(e)||r.set(e,(async()=>{try{return await caches.open(e)}catch{return}})()),await r.get(e)}var a='"use strict";(()=>{var it="code-playpad-cpp-20.1.2-emscripten-4.0.6-r1";async function ot(a,e,i,c,E){let t=new URL(a,i).href,r;try{r=await caches.open(c)}catch{}let n;try{n=await r?.match(t)}catch{}let s=async _=>{if(!_.ok)throw new Error(`Toolchain download failed: ${a} (HTTP ${_.status}). Check the asset URL and retry.`);let l=_.body?.getReader();if(!l)return _.arrayBuffer();let u=[],p=0,d=0;for(;;){let S=await l.read();if(S.done)break;if(p+=S.value.length,p>e.bytes)throw await l.cancel(),new Error(`Unexpected toolchain size: ${a}.`);u.push(S.value),performance.now()-d>100&&(E(`${n?"Reading cached":"Downloading"} ${a}: ${(p/1e6).toFixed(1)} / ${(e.bytes/1e6).toFixed(1)} MB (decoded)`),d=performance.now())}let R=new Uint8Array(p),h=0;for(let S of u)R.set(S,h),h+=S.length;return R.buffer},o=async _=>_.byteLength===e.bytes&&[...new Uint8Array(await crypto.subtle.digest("SHA-256",_))].map(l=>l.toString(16).padStart(2,"0")).join("")===e.sha256;if(n){try{let _=await s(n);if(await o(_))return _}catch{}try{await r?.delete(t)}catch{}n=void 0}let f=await s(await fetch(t));if(!await o(f))throw new Error(`Toolchain integrity check failed: ${a}. Use the pinned toolchain assets.`);try{await r?.put(t,new Response(f))}catch{}return f}var C=class a{static read_bytes(e,i){let c=new a;return c.buf=e.getUint32(i,!0),c.buf_len=e.getUint32(i+4,!0),c}static read_bytes_array(e,i,c){let E=[];for(let t=0;t<c;t++)E.push(a.read_bytes(e,i+8*t));return E}},L=class a{static read_bytes(e,i){let c=new a;return c.buf=e.getUint32(i,!0),c.buf_len=e.getUint32(i+4,!0),c}static read_bytes_array(e,i,c){let E=[];for(let t=0;t<c;t++)E.push(a.read_bytes(e,i+8*t));return E}},Q=0,Z=1,V=2;var J=2;var W=4;var q=1;var x=class{write_bytes(e,i){e.setUint8(i,this.fs_filetype),e.setUint16(i+2,this.fs_flags,!0),e.setBigUint64(i+8,this.fs_rights_base,!0),e.setBigUint64(i+16,this.fs_rights_inherited,!0)}constructor(e,i){this.fs_rights_base=0n,this.fs_rights_inherited=0n,this.fs_filetype=e,this.fs_flags=i}};var j=8,A=class{write_bytes(e,i){e.setBigUint64(i,this.dev,!0),e.setBigUint64(i+8,this.ino,!0),e.setUint8(i+16,this.filetype),e.setBigUint64(i+24,this.nlink,!0),e.setBigUint64(i+32,this.size,!0),e.setBigUint64(i+38,this.atim,!0),e.setBigUint64(i+46,this.mtim,!0),e.setBigUint64(i+52,this.ctim,!0)}constructor(e,i,c){this.dev=0n,this.nlink=0n,this.atim=0n,this.mtim=0n,this.ctim=0n,this.ino=e,this.filetype=i,this.size=c}},at=0;var ft=1,k=class a{static read_bytes(e,i){return new a(e.getBigUint64(i,!0),e.getUint8(i+8),e.getUint32(i+16,!0),e.getBigUint64(i+24,!0),e.getUint16(i+36,!0))}constructor(e,i,c,E,t){this.userdata=e,this.eventtype=i,this.clockid=c,this.timeout=E,this.flags=t}},Y=class{write_bytes(e,i){e.setBigUint64(i,this.userdata,!0),e.setUint16(i+8,this.error,!0),e.setUint8(i+10,this.eventtype)}constructor(e,i,c){this.userdata=e,this.error=i,this.eventtype=c}};var wt=class{enable(e){this.log=ht(e===void 0?!0:e,this.prefix)}get enabled(){return this.isEnabled}constructor(e){this.isEnabled=e,this.prefix="wasi:",this.enable(e)}};function ht(a,e){return a?console.log.bind(console,"%c%s","color: #265BA0",e):()=>{}}var y=new wt(!1);var U=class extends Error{constructor(e){super("exit with exit code "+e),this.code=e}},rt=class{start(e){this.inst=e;try{return e.exports._start(),0}catch(i){if(i instanceof U)return i.code;throw i}}initialize(e){this.inst=e,e.exports._initialize&&e.exports._initialize()}constructor(e,i,c,E={}){this.args=[],this.env=[],this.fds=[],y.enable(E.debug),this.args=e,this.env=i,this.fds=c;let t=this;this.wasiImport={args_sizes_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);s.setUint32(r,t.args.length,!0);let o=0;for(let f of t.args)o+=f.length+1;return s.setUint32(n,o,!0),y.log(s.getUint32(r,!0),s.getUint32(n,!0)),0},args_get(r,n){let s=new DataView(t.inst.exports.memory.buffer),o=new Uint8Array(t.inst.exports.memory.buffer),f=n;for(let _=0;_<t.args.length;_++){s.setUint32(r,n,!0),r+=4;let l=new TextEncoder().encode(t.args[_]);o.set(l,n),s.setUint8(n+l.length,0),n+=l.length+1}return y.enabled&&y.log(new TextDecoder("utf-8").decode(o.slice(f,n))),0},environ_sizes_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);s.setUint32(r,t.env.length,!0);let o=0;for(let f of t.env)o+=new TextEncoder().encode(f).length+1;return s.setUint32(n,o,!0),y.log(s.getUint32(r,!0),s.getUint32(n,!0)),0},environ_get(r,n){let s=new DataView(t.inst.exports.memory.buffer),o=new Uint8Array(t.inst.exports.memory.buffer),f=n;for(let _=0;_<t.env.length;_++){s.setUint32(r,n,!0),r+=4;let l=new TextEncoder().encode(t.env[_]);o.set(l,n),s.setUint8(n+l.length,0),n+=l.length+1}return y.enabled&&y.log(new TextDecoder("utf-8").decode(o.slice(f,n))),0},clock_res_get(r,n){let s;switch(r){case 1:{s=5000n;break}case 0:{s=1000000n;break}default:return 52}return new DataView(t.inst.exports.memory.buffer).setBigUint64(n,s,!0),0},clock_time_get(r,n,s){let o=new DataView(t.inst.exports.memory.buffer);if(r===0)o.setBigUint64(s,BigInt(new Date().getTime())*1000000n,!0);else if(r==1){let f;try{f=BigInt(Math.round(performance.now()*1e6))}catch{f=0n}o.setBigUint64(s,f,!0)}else o.setBigUint64(s,0n,!0);return 0},fd_advise(r,n,s,o){return t.fds[r]!=null?0:8},fd_allocate(r,n,s){return t.fds[r]!=null?t.fds[r].fd_allocate(n,s):8},fd_close(r){if(t.fds[r]!=null){let n=t.fds[r].fd_close();return t.fds[r]=void 0,n}else return 8},fd_datasync(r){return t.fds[r]!=null?t.fds[r].fd_sync():8},fd_fdstat_get(r,n){if(t.fds[r]!=null){let{ret:s,fdstat:o}=t.fds[r].fd_fdstat_get();return o?.write_bytes(new DataView(t.inst.exports.memory.buffer),n),s}else return 8},fd_fdstat_set_flags(r,n){return t.fds[r]!=null?t.fds[r].fd_fdstat_set_flags(n):8},fd_fdstat_set_rights(r,n,s){return t.fds[r]!=null?t.fds[r].fd_fdstat_set_rights(n,s):8},fd_filestat_get(r,n){if(t.fds[r]!=null){let{ret:s,filestat:o}=t.fds[r].fd_filestat_get();return o?.write_bytes(new DataView(t.inst.exports.memory.buffer),n),s}else return 8},fd_filestat_set_size(r,n){return t.fds[r]!=null?t.fds[r].fd_filestat_set_size(n):8},fd_filestat_set_times(r,n,s,o){return t.fds[r]!=null?t.fds[r].fd_filestat_set_times(n,s,o):8},fd_pread(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=C.read_bytes_array(_,n,s),p=0;for(let d of u){let{ret:R,data:h}=t.fds[r].fd_pread(d.buf_len,o);if(R!=0)return _.setUint32(f,p,!0),R;if(l.set(h,d.buf),p+=h.length,o+=BigInt(h.length),h.length!=d.buf_len)break}return _.setUint32(f,p,!0),0}else return 8},fd_prestat_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:o,prestat:f}=t.fds[r].fd_prestat_get();return f?.write_bytes(s,n),o}else return 8},fd_prestat_dir_name(r,n,s){if(t.fds[r]!=null){let{ret:o,prestat:f}=t.fds[r].fd_prestat_get();if(f==null)return o;let _=f.inner.pr_name;return new Uint8Array(t.inst.exports.memory.buffer).set(_.slice(0,s),n),_.byteLength>s?37:0}else return 8},fd_pwrite(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=L.read_bytes_array(_,n,s),p=0;for(let d of u){let R=l.slice(d.buf,d.buf+d.buf_len),{ret:h,nwritten:S}=t.fds[r].fd_pwrite(R,o);if(h!=0)return _.setUint32(f,p,!0),h;if(p+=S,o+=BigInt(S),S!=R.byteLength)break}return _.setUint32(f,p,!0),0}else return 8},fd_read(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer),_=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let l=C.read_bytes_array(f,n,s),u=0;for(let p of l){let{ret:d,data:R}=t.fds[r].fd_read(p.buf_len);if(d!=0)return f.setUint32(o,u,!0),d;if(_.set(R,p.buf),u+=R.length,R.length!=p.buf_len)break}return f.setUint32(o,u,!0),0}else return 8},fd_readdir(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=0;for(;;){let{ret:p,dirent:d}=t.fds[r].fd_readdir_single(o);if(p!=0)return _.setUint32(f,u,!0),p;if(d==null)break;if(s-u<d.head_length()){u=s;break}let R=new ArrayBuffer(d.head_length());if(d.write_head_bytes(new DataView(R),0),l.set(new Uint8Array(R).slice(0,Math.min(R.byteLength,s-u)),n),n+=d.head_length(),u+=d.head_length(),s-u<d.name_length()){u=s;break}d.write_name_bytes(l,n,s-u),n+=d.name_length(),u+=d.name_length(),o=d.d_next}return _.setUint32(f,u,!0),0}else return 8},fd_renumber(r,n){if(t.fds[r]!=null&&t.fds[n]!=null){let s=t.fds[n].fd_close();return s!=0?s:(t.fds[n]=t.fds[r],t.fds[r]=void 0,0)}else return 8},fd_seek(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:_,offset:l}=t.fds[r].fd_seek(n,s);return f.setBigInt64(o,l,!0),_}else return 8},fd_sync(r){return t.fds[r]!=null?t.fds[r].fd_sync():8},fd_tell(r,n){let s=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:o,offset:f}=t.fds[r].fd_tell();return s.setBigUint64(n,f,!0),o}else return 8},fd_write(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer),_=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let l=L.read_bytes_array(f,n,s),u=0;for(let p of l){let d=_.slice(p.buf,p.buf+p.buf_len),{ret:R,nwritten:h}=t.fds[r].fd_write(d);if(R!=0)return f.setUint32(o,u,!0),R;if(u+=h,h!=d.byteLength)break}return f.setUint32(o,u,!0),0}else return 8},path_create_directory(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_create_directory(f)}else return 8},path_filestat_get(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=new TextDecoder("utf-8").decode(l.slice(s,s+o)),{ret:p,filestat:d}=t.fds[r].path_filestat_get(n,u);return d?.write_bytes(_,f),p}else return 8},path_filestat_set_times(r,n,s,o,f,_,l){let u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let p=new TextDecoder("utf-8").decode(u.slice(s,s+o));return t.fds[r].path_filestat_set_times(n,p,f,_,l)}else return 8},path_link(r,n,s,o,f,_,l){let u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null&&t.fds[f]!=null){let p=new TextDecoder("utf-8").decode(u.slice(s,s+o)),d=new TextDecoder("utf-8").decode(u.slice(_,_+l)),{ret:R,inode_obj:h}=t.fds[r].path_lookup(p,n);return h==null?R:t.fds[f].path_link(d,h,!1)}else return 8},path_open(r,n,s,o,f,_,l,u,p){let d=new DataView(t.inst.exports.memory.buffer),R=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let h=new TextDecoder("utf-8").decode(R.slice(s,s+o));y.log(h);let{ret:S,fd_obj:X}=t.fds[r].path_open(n,h,f,_,l,u);if(S!=0)return S;t.fds.push(X);let H=t.fds.length-1;return d.setUint32(p,H,!0),0}else return 8},path_readlink(r,n,s,o,f,_){let l=new DataView(t.inst.exports.memory.buffer),u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let p=new TextDecoder("utf-8").decode(u.slice(n,n+s));y.log(p);let{ret:d,data:R}=t.fds[r].path_readlink(p);if(R!=null){let h=new TextEncoder().encode(R);if(h.length>f)return l.setUint32(_,0,!0),8;u.set(h,o),l.setUint32(_,h.length,!0)}return d}else return 8},path_remove_directory(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_remove_directory(f)}else return 8},path_rename(r,n,s,o,f,_){let l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null&&t.fds[o]!=null){let u=new TextDecoder("utf-8").decode(l.slice(n,n+s)),p=new TextDecoder("utf-8").decode(l.slice(f,f+_)),{ret:d,inode_obj:R}=t.fds[r].path_unlink(u);if(R==null)return d;if(d=t.fds[o].path_link(p,R,!0),d!=0&&t.fds[r].path_link(u,R,!0)!=0)throw"path_link should always return success when relinking an inode back to the original place";return d}else return 8},path_symlink(r,n,s,o,f){let _=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[s]!=null){let l=new TextDecoder("utf-8").decode(_.slice(r,r+n)),u=new TextDecoder("utf-8").decode(_.slice(o,o+f));return 58}else return 8},path_unlink_file(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_unlink_file(f)}else return 8},poll_oneoff(r,n,s){if(s===0)return 28;if(s>1)return y.log("poll_oneoff: only a single subscription is supported"),58;let o=new DataView(t.inst.exports.memory.buffer),f=k.read_bytes(o,r),_=f.eventtype,l=f.clockid,u=f.timeout;if(_!==at)return y.log("poll_oneoff: only clock subscriptions are supported"),58;let p;if(l===1)p=()=>BigInt(Math.round(performance.now()*1e6));else if(l===0)p=()=>BigInt(new Date().getTime())*1000000n;else return 28;let d=(f.flags&ft)!==0?u:p()+u;for(;d>p(););return new Y(f.userdata,0,_).write_bytes(o,n),0},proc_exit(r){throw new U(r)},proc_raise(r){throw"raised signal "+r},sched_yield(){},random_get(r,n){let s=new Uint8Array(t.inst.exports.memory.buffer).subarray(r,r+n);if("crypto"in globalThis&&(typeof SharedArrayBuffer>"u"||!(t.inst.exports.memory.buffer instanceof SharedArrayBuffer)))for(let o=0;o<n;o+=65536)crypto.getRandomValues(s.subarray(o,o+65536));else for(let o=0;o<n;o++)s[o]=Math.random()*256|0},sock_recv(r,n,s){throw"sockets not supported"},sock_send(r,n,s){throw"sockets not supported"},sock_shutdown(r,n){throw"sockets not supported"},sock_accept(r,n){throw"sockets not supported"}}}};var g=class{fd_allocate(e,i){return 58}fd_close(){return 0}fd_fdstat_get(){return{ret:58,fdstat:null}}fd_fdstat_set_flags(e){return 58}fd_fdstat_set_rights(e,i){return 58}fd_filestat_get(){return{ret:58,filestat:null}}fd_filestat_set_size(e){return 58}fd_filestat_set_times(e,i,c){return 58}fd_pread(e,i){return{ret:58,data:new Uint8Array}}fd_prestat_get(){return{ret:58,prestat:null}}fd_pwrite(e,i){return{ret:58,nwritten:0}}fd_read(e){return{ret:58,data:new Uint8Array}}fd_readdir_single(e){return{ret:58,dirent:null}}fd_seek(e,i){return{ret:58,offset:0n}}fd_sync(){return 0}fd_tell(){return{ret:58,offset:0n}}fd_write(e){return{ret:58,nwritten:0}}path_create_directory(e){return 58}path_filestat_get(e,i){return{ret:58,filestat:null}}path_filestat_set_times(e,i,c,E,t){return 58}path_link(e,i,c){return 58}path_unlink(e){return{ret:58,inode_obj:null}}path_lookup(e,i){return{ret:58,inode_obj:null}}path_open(e,i,c,E,t,r){return{ret:54,fd_obj:null}}path_readlink(e){return{ret:58,data:null}}path_remove_directory(e){return 58}path_rename(e,i,c){return 58}path_unlink_file(e){return 58}},m=class a{static issue_ino(){return a.next_ino++}static root_ino(){return 0n}constructor(){this.ino=a.issue_ino()}};m.next_ino=1n;var b=class extends g{fd_allocate(e,i){if(!(this.file.size>e+i)){let c=new Uint8Array(Number(e+i));c.set(this.file.data,0),this.file.data=c}return 0}fd_fdstat_get(){return{ret:0,fdstat:new x(W,0)}}fd_filestat_set_size(e){if(this.file.size>e)this.file.data=new Uint8Array(this.file.data.buffer.slice(0,Number(e)));else{let i=new Uint8Array(Number(e));i.set(this.file.data,0),this.file.data=i}return 0}fd_read(e){let i=this.file.data.slice(Number(this.file_pos),Number(this.file_pos+BigInt(e)));return this.file_pos+=BigInt(i.length),{ret:0,data:i}}fd_pread(e,i){return{ret:0,data:this.file.data.slice(Number(i),Number(i+BigInt(e)))}}fd_seek(e,i){let c;switch(i){case Q:c=e;break;case Z:c=this.file_pos+e;break;case V:c=BigInt(this.file.data.byteLength)+e;break;default:return{ret:28,offset:0n}}return c<0?{ret:28,offset:0n}:(this.file_pos=c,{ret:0,offset:this.file_pos})}fd_tell(){return{ret:0,offset:this.file_pos}}fd_write(e){if(this.file.readonly)return{ret:8,nwritten:0};if(this.file_pos+BigInt(e.byteLength)>this.file.size){let i=this.file.data;this.file.data=new Uint8Array(Number(this.file_pos+BigInt(e.byteLength))),this.file.data.set(i)}return this.file.data.set(e,Number(this.file_pos)),this.file_pos+=BigInt(e.byteLength),{ret:0,nwritten:e.byteLength}}fd_pwrite(e,i){if(this.file.readonly)return{ret:8,nwritten:0};if(i+BigInt(e.byteLength)>this.file.size){let c=this.file.data;this.file.data=new Uint8Array(Number(i+BigInt(e.byteLength))),this.file.data.set(c)}return this.file.data.set(e,Number(i)),{ret:0,nwritten:e.byteLength}}fd_filestat_get(){return{ret:0,filestat:this.file.stat()}}constructor(e){super(),this.file_pos=0n,this.file=e}};var F=class extends m{path_open(e,i,c){if(this.readonly&&(i&BigInt(64))==BigInt(64))return{ret:63,fd_obj:null};if((e&j)==j){if(this.readonly)return{ret:63,fd_obj:null};this.data=new Uint8Array([])}let E=new b(this);return c&q&&E.fd_seek(0n,V),{ret:0,fd_obj:E}}get size(){return BigInt(this.data.byteLength)}stat(){return new A(this.ino,W,this.size)}constructor(e,i){super(),this.data=new Uint8Array(e),this.readonly=!!i?.readonly}};var P=class a extends g{fd_filestat_get(){return{ret:0,filestat:new A(this.ino,J,BigInt(0))}}fd_fdstat_get(){let e=new x(J,0);return e.fs_rights_base=BigInt(64),{ret:0,fdstat:e}}fd_write(e){return this.write(e),{ret:0,nwritten:e.byteLength}}static lineBuffered(e){let i=new TextDecoder("utf-8",{fatal:!1}),c="";return new a(E=>{c+=i.decode(E,{stream:!0});let t=c.split(`\n`);for(let[r,n]of t.entries())r<t.length-1?e(n):c=n})}constructor(e){super(),this.ino=m.issue_ino(),this.write=e}};var ct="code-playpad Clang 20.1.2 / Emscripten 4.0.6 r1",lt={"clang.js":{bytes:74300,sha256:"b437a648812aabd1cc87cba4a7268e2f53ab94a9071a854ba983dd62328dc30c"},"clang.wasm":{bytes:42578038,sha256:"534571fd4f9136c85d3e25a395cc31983ec3cbd41012e3928b45879a518718fa"},"lld.js":{bytes:71711,sha256:"2da4b0a04b6953bdc4869137631abd11ea7eb5a667fbd19c4ff6d68d56f302bb"},"lld.wasm":{bytes:23228304,sha256:"55ffbe1366525c1b55b65140630e0ca00ff47eae7acfdee6a15b46e738800ec7"},"sysroot.tar":{bytes:29009920,sha256:"a0d92a9fc1dccc2c181ae6812b6c169de3dad851ee4d4e796d15940776648ac5"}};function K(a){if(!a||a.startsWith("/")||/[\\\\\\x00-\\x1f:]/.test(a)||a.split("/").some(e=>!e||e==="."||e===".."))throw new Error(`Invalid project path: ${JSON.stringify(a)}. Use relative paths without . or ...`);return a}function ut(a,e,i,c){let E=K(i??(c==="c"?"main.c":"main.cpp")),t=e?{...e}:{[E]:a};if(!Object.hasOwn(t,E))throw new Error(`Entry file ${E} does not exist.`);let r=Object.keys(t).map(K).sort(),n=f=>/\\.c$/.test(f),s=f=>/\\.(cpp|cc|cxx)$/.test(f);if(r.some(c==="c"?s:n))throw new Error("Mixed C/C++ source projects are not supported yet.");let o=r.filter(c==="c"?n:s);if(!o.includes(E))throw new Error(`Entry ${E} must have a ${c==="c"?".c":".cpp, .cc, or .cxx"} extension.`);if(o.length>32||r.length>256)throw new Error("Project limit: 32 source files and 256 files total.");if(Object.values(t).reduce((f,_)=>f+new TextEncoder().encode(_).length,0)>2e6)throw new Error("Project exceeds the 2 MB source limit.");return{files:t,sources:o,entry:E}}var st,v,dt=Promise.resolve(),G=a=>globalThis.postMessage(a),M=(a,e,i)=>G({type:"progress",id:a,phase:e,message:i}),B=(a,e)=>ot(a,lt[a],st,it,i=>M(e,"downloading",i));function St(a){let e=new Uint8Array(a),i=new TextDecoder,c=[],E=(t,r)=>i.decode(e.subarray(t,t+r)).replace(/\\0.*$/,"");for(let t=0;t+512<=e.length;){let r=E(t,100);if(!r)break;let n=E(t+345,155);n&&(r=n+"/"+r);let s=parseInt(E(t+124,12).trim()||"0",8),o=e[t+156];if(!Number.isSafeInteger(s)||s<0||t+512+s>e.length)throw new Error("Invalid sysroot archive.");if(o===48||o===0)c.push({name:"/"+K(r),data:e.subarray(t+512,t+512+s)});else if(o!==53)throw new Error("Unsupported sysroot archive entry.");t+=512+Math.ceil(s/512)*512}return c}async function Rt(a){let e=URL.createObjectURL(new Blob([a],{type:"text/javascript"}));try{return(await import(e)).default}finally{URL.revokeObjectURL(e)}}function yt(a){return st?(v||(v=(async()=>{let e=await Rt(await B("clang.js",a)),i=await Rt(await B("lld.js",a)),c=await WebAssembly.compile(await B("clang.wasm",a)),E=await WebAssembly.compile(await B("lld.wasm",a));M(a,"booting","Preparing C/C++ standard libraries\\u2026");let t=St(await B("sysroot.tar",a));return{clang:e,lld:i,clangModule:c,lldModule:E,sysroot:t}})().catch(e=>{throw v=void 0,e})),v):Promise.reject(new Error("Configure the rebuilt C/C++ assets with configureCpp({ indexURL }) before creating widgets. See docs/CPP-REBUILD.md."))}async function Et(a,e,i,c){let E,t=await a({thisProgram:i,noInitialRun:!0,print:c,printErr:c,instantiateWasm(r,n){let s=new WebAssembly.Instance(e,r);return E=Object.values(s.exports).find(o=>o instanceof WebAssembly.Memory),n(s,e),s.exports}});return t.memory=E,t}function $(a,e,i){a.mkdirTree(e.slice(0,e.lastIndexOf("/"))||"/"),a.writeFile(e,i)}async function mt(a){let e=performance.now(),i=0,c=(E,t)=>{if(i+=t.length,i>1e6)throw new Error("Output limit exceeded (1 MB).");t&&G({type:E,id:a.id,text:t})};try{let E=ut(a.code,a.files,a.entry,a.compilerLanguage),t=await yt(a.id),r=[],n=0;for(let R of E.sources){M(a.id,"compiling",`Compiling ${R}\\u2026`);let h=await Et(t.clang,t.clangModule,"clang",T=>c("stderr",T+`\n`));for(let T of t.sysroot)$(h.FS,T.name,T.data);for(let[T,pt]of Object.entries(E.files))$(h.FS,"/project/"+T,pt);let S=a.compilerLanguage==="cpp",X=["-cc1","-triple","wasm32-unknown-wasi","-emit-obj","-O0","-std="+(S?"c++20":"c17"),"-resource-dir","/lib/clang/20",...S?["-internal-isystem","/include/wasm32-wasi/c++/v1","-internal-isystem","/include/c++/v1"]:[],"-internal-isystem","/lib/clang/20/include","-internal-isystem","/include/wasm32-wasi","-internal-isystem","/include","-I","/project","-ferror-limit","20","-o","/tmp/output.o","-x",S?"c++":"c","/project/"+R],H=h.callMain(X);if(n=Math.max(n,h.memory?.buffer.byteLength??0),H!==0)throw new Error(`Compilation failed (${R}, exit ${H}).`);r.push(h.FS.readFile("/tmp/output.o").slice())}M(a.id,"linking","Linking\\u2026");let s=await Et(t.lld,t.lldModule,"wasm-ld",R=>c("stderr",R+`\n`));for(let R of t.sysroot)R.name.startsWith("/include/")||$(s.FS,R.name,R.data);r.forEach((R,h)=>$(s.FS,"/tmp/"+h+".o",R));let o=s.callMain(["-m","wasm32","-z","stack-size=1048576","--max-memory=268435456","-L/lib/wasm32-wasi","/lib/wasm32-wasi/crt1-command.o",...r.map((R,h)=>"/tmp/"+h+".o"),...a.compilerLanguage==="cpp"?["-lc++","-lc++abi"]:[],"-lc","/lib/clang/20/lib/wasm32-unknown-wasi/libclang_rt.builtins.a","-o","/tmp/program.wasm"]);if(n=Math.max(n,s.memory?.buffer.byteLength??0),o!==0)throw new Error(`Linking failed (exit ${o}).`);let f=await WebAssembly.compile(s.FS.readFile("/tmp/program.wasm").slice().buffer);M(a.id,"running","Running\\u2026");let _={stdout:new TextDecoder,stderr:new TextDecoder},l=R=>new P(h=>c(R,_[R].decode(h,{stream:!0}))),u=new rt([E.entry],[],[new b(new F(new TextEncoder().encode(a.stdin??""))),l("stdout"),l("stderr")]),p=await WebAssembly.instantiate(f,{wasi_snapshot_preview1:u.wasiImport}),d=u.start(p);if(c("stdout",_.stdout.decode()),c("stderr",_.stderr.decode()),d!==0)throw new Error(`Program exited with status ${d}.`);G({type:"result",id:a.id,durationMs:performance.now()-e,memory:{compilerBytes:n,programBytes:p.exports.memory.buffer.byteLength}})}catch(E){G({type:"error",id:a.id,message:E instanceof Error?E.message:String(E),durationMs:performance.now()-e})}}globalThis.onmessage=({data:a})=>{a.type==="init"?(st=a.toolchainURL,G({type:"ready",version:ct,interactiveStdin:!1})):a.type==="run"&&(dt=dt.then(()=>mt(a)))};})();\n',o=new class extends t{id=`cpp`;get label(){return`C/C++ (Clang 20, experimental)`}get source(){return a}async load(e){return await i(n),super.load(e)}initPayload(){return{toolchainURL:e().indexURL}}};function s(t){return{id:t,label:t===`c`?`C17 (experimental)`:`C++20 (experimental)`,statusDecidesFailure:!0,get ready(){return o.ready},interactiveStdin:!1,async editorLanguage(){return(await import(`@codemirror/lang-cpp`)).cpp()},load:e=>o.load(e),run:(n,r={})=>o.run(n,{...r,compilerLanguage:t,timeoutMs:r.timeoutMs??e().timeoutMs}),stop:e=>o.stop(e)}}var c=s(`c`),l=s(`cpp`);export{c as cRuntime,l as cppRuntime};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* code-playpad — MIT © 2026 Seung Hun Lee
|
|
3
|
+
* Bundles CodeMirror 6 and Lezer (MIT) © Marijn Haverbeke and others.
|
|
4
|
+
* Full third-party licences: THIRD-PARTY-NOTICES.txt in this package.
|
|
5
|
+
*/
|
|
6
|
+
import{a as e}from"./config-cwuPIQ48.js";import{t}from"./worker-runtime-DfYet3xy.js";var n=`code-playpad-cpp-20.1.2-emscripten-4.0.6-r1`,r=/* @__PURE__ */ new Map;async function i(e){r.has(e)||r.set(e,(async()=>{try{return await caches.open(e)}catch{return}})()),await r.get(e)}var a='"use strict";(()=>{var it="code-playpad-cpp-20.1.2-emscripten-4.0.6-r1";async function ot(a,e,i,c,E){let t=new URL(a,i).href,r;try{r=await caches.open(c)}catch{}let n;try{n=await r?.match(t)}catch{}let s=async _=>{if(!_.ok)throw new Error(`Toolchain download failed: ${a} (HTTP ${_.status}). Check the asset URL and retry.`);let l=_.body?.getReader();if(!l)return _.arrayBuffer();let u=[],p=0,d=0;for(;;){let S=await l.read();if(S.done)break;if(p+=S.value.length,p>e.bytes)throw await l.cancel(),new Error(`Unexpected toolchain size: ${a}.`);u.push(S.value),performance.now()-d>100&&(E(`${n?"Reading cached":"Downloading"} ${a}: ${(p/1e6).toFixed(1)} / ${(e.bytes/1e6).toFixed(1)} MB (decoded)`),d=performance.now())}let R=new Uint8Array(p),h=0;for(let S of u)R.set(S,h),h+=S.length;return R.buffer},o=async _=>_.byteLength===e.bytes&&[...new Uint8Array(await crypto.subtle.digest("SHA-256",_))].map(l=>l.toString(16).padStart(2,"0")).join("")===e.sha256;if(n){try{let _=await s(n);if(await o(_))return _}catch{}try{await r?.delete(t)}catch{}n=void 0}let f=await s(await fetch(t));if(!await o(f))throw new Error(`Toolchain integrity check failed: ${a}. Use the pinned toolchain assets.`);try{await r?.put(t,new Response(f))}catch{}return f}var C=class a{static read_bytes(e,i){let c=new a;return c.buf=e.getUint32(i,!0),c.buf_len=e.getUint32(i+4,!0),c}static read_bytes_array(e,i,c){let E=[];for(let t=0;t<c;t++)E.push(a.read_bytes(e,i+8*t));return E}},L=class a{static read_bytes(e,i){let c=new a;return c.buf=e.getUint32(i,!0),c.buf_len=e.getUint32(i+4,!0),c}static read_bytes_array(e,i,c){let E=[];for(let t=0;t<c;t++)E.push(a.read_bytes(e,i+8*t));return E}},Q=0,Z=1,V=2;var J=2;var W=4;var q=1;var x=class{write_bytes(e,i){e.setUint8(i,this.fs_filetype),e.setUint16(i+2,this.fs_flags,!0),e.setBigUint64(i+8,this.fs_rights_base,!0),e.setBigUint64(i+16,this.fs_rights_inherited,!0)}constructor(e,i){this.fs_rights_base=0n,this.fs_rights_inherited=0n,this.fs_filetype=e,this.fs_flags=i}};var j=8,A=class{write_bytes(e,i){e.setBigUint64(i,this.dev,!0),e.setBigUint64(i+8,this.ino,!0),e.setUint8(i+16,this.filetype),e.setBigUint64(i+24,this.nlink,!0),e.setBigUint64(i+32,this.size,!0),e.setBigUint64(i+38,this.atim,!0),e.setBigUint64(i+46,this.mtim,!0),e.setBigUint64(i+52,this.ctim,!0)}constructor(e,i,c){this.dev=0n,this.nlink=0n,this.atim=0n,this.mtim=0n,this.ctim=0n,this.ino=e,this.filetype=i,this.size=c}},at=0;var ft=1,k=class a{static read_bytes(e,i){return new a(e.getBigUint64(i,!0),e.getUint8(i+8),e.getUint32(i+16,!0),e.getBigUint64(i+24,!0),e.getUint16(i+36,!0))}constructor(e,i,c,E,t){this.userdata=e,this.eventtype=i,this.clockid=c,this.timeout=E,this.flags=t}},Y=class{write_bytes(e,i){e.setBigUint64(i,this.userdata,!0),e.setUint16(i+8,this.error,!0),e.setUint8(i+10,this.eventtype)}constructor(e,i,c){this.userdata=e,this.error=i,this.eventtype=c}};var wt=class{enable(e){this.log=ht(e===void 0?!0:e,this.prefix)}get enabled(){return this.isEnabled}constructor(e){this.isEnabled=e,this.prefix="wasi:",this.enable(e)}};function ht(a,e){return a?console.log.bind(console,"%c%s","color: #265BA0",e):()=>{}}var y=new wt(!1);var U=class extends Error{constructor(e){super("exit with exit code "+e),this.code=e}},rt=class{start(e){this.inst=e;try{return e.exports._start(),0}catch(i){if(i instanceof U)return i.code;throw i}}initialize(e){this.inst=e,e.exports._initialize&&e.exports._initialize()}constructor(e,i,c,E={}){this.args=[],this.env=[],this.fds=[],y.enable(E.debug),this.args=e,this.env=i,this.fds=c;let t=this;this.wasiImport={args_sizes_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);s.setUint32(r,t.args.length,!0);let o=0;for(let f of t.args)o+=f.length+1;return s.setUint32(n,o,!0),y.log(s.getUint32(r,!0),s.getUint32(n,!0)),0},args_get(r,n){let s=new DataView(t.inst.exports.memory.buffer),o=new Uint8Array(t.inst.exports.memory.buffer),f=n;for(let _=0;_<t.args.length;_++){s.setUint32(r,n,!0),r+=4;let l=new TextEncoder().encode(t.args[_]);o.set(l,n),s.setUint8(n+l.length,0),n+=l.length+1}return y.enabled&&y.log(new TextDecoder("utf-8").decode(o.slice(f,n))),0},environ_sizes_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);s.setUint32(r,t.env.length,!0);let o=0;for(let f of t.env)o+=new TextEncoder().encode(f).length+1;return s.setUint32(n,o,!0),y.log(s.getUint32(r,!0),s.getUint32(n,!0)),0},environ_get(r,n){let s=new DataView(t.inst.exports.memory.buffer),o=new Uint8Array(t.inst.exports.memory.buffer),f=n;for(let _=0;_<t.env.length;_++){s.setUint32(r,n,!0),r+=4;let l=new TextEncoder().encode(t.env[_]);o.set(l,n),s.setUint8(n+l.length,0),n+=l.length+1}return y.enabled&&y.log(new TextDecoder("utf-8").decode(o.slice(f,n))),0},clock_res_get(r,n){let s;switch(r){case 1:{s=5000n;break}case 0:{s=1000000n;break}default:return 52}return new DataView(t.inst.exports.memory.buffer).setBigUint64(n,s,!0),0},clock_time_get(r,n,s){let o=new DataView(t.inst.exports.memory.buffer);if(r===0)o.setBigUint64(s,BigInt(new Date().getTime())*1000000n,!0);else if(r==1){let f;try{f=BigInt(Math.round(performance.now()*1e6))}catch{f=0n}o.setBigUint64(s,f,!0)}else o.setBigUint64(s,0n,!0);return 0},fd_advise(r,n,s,o){return t.fds[r]!=null?0:8},fd_allocate(r,n,s){return t.fds[r]!=null?t.fds[r].fd_allocate(n,s):8},fd_close(r){if(t.fds[r]!=null){let n=t.fds[r].fd_close();return t.fds[r]=void 0,n}else return 8},fd_datasync(r){return t.fds[r]!=null?t.fds[r].fd_sync():8},fd_fdstat_get(r,n){if(t.fds[r]!=null){let{ret:s,fdstat:o}=t.fds[r].fd_fdstat_get();return o?.write_bytes(new DataView(t.inst.exports.memory.buffer),n),s}else return 8},fd_fdstat_set_flags(r,n){return t.fds[r]!=null?t.fds[r].fd_fdstat_set_flags(n):8},fd_fdstat_set_rights(r,n,s){return t.fds[r]!=null?t.fds[r].fd_fdstat_set_rights(n,s):8},fd_filestat_get(r,n){if(t.fds[r]!=null){let{ret:s,filestat:o}=t.fds[r].fd_filestat_get();return o?.write_bytes(new DataView(t.inst.exports.memory.buffer),n),s}else return 8},fd_filestat_set_size(r,n){return t.fds[r]!=null?t.fds[r].fd_filestat_set_size(n):8},fd_filestat_set_times(r,n,s,o){return t.fds[r]!=null?t.fds[r].fd_filestat_set_times(n,s,o):8},fd_pread(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=C.read_bytes_array(_,n,s),p=0;for(let d of u){let{ret:R,data:h}=t.fds[r].fd_pread(d.buf_len,o);if(R!=0)return _.setUint32(f,p,!0),R;if(l.set(h,d.buf),p+=h.length,o+=BigInt(h.length),h.length!=d.buf_len)break}return _.setUint32(f,p,!0),0}else return 8},fd_prestat_get(r,n){let s=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:o,prestat:f}=t.fds[r].fd_prestat_get();return f?.write_bytes(s,n),o}else return 8},fd_prestat_dir_name(r,n,s){if(t.fds[r]!=null){let{ret:o,prestat:f}=t.fds[r].fd_prestat_get();if(f==null)return o;let _=f.inner.pr_name;return new Uint8Array(t.inst.exports.memory.buffer).set(_.slice(0,s),n),_.byteLength>s?37:0}else return 8},fd_pwrite(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=L.read_bytes_array(_,n,s),p=0;for(let d of u){let R=l.slice(d.buf,d.buf+d.buf_len),{ret:h,nwritten:S}=t.fds[r].fd_pwrite(R,o);if(h!=0)return _.setUint32(f,p,!0),h;if(p+=S,o+=BigInt(S),S!=R.byteLength)break}return _.setUint32(f,p,!0),0}else return 8},fd_read(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer),_=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let l=C.read_bytes_array(f,n,s),u=0;for(let p of l){let{ret:d,data:R}=t.fds[r].fd_read(p.buf_len);if(d!=0)return f.setUint32(o,u,!0),d;if(_.set(R,p.buf),u+=R.length,R.length!=p.buf_len)break}return f.setUint32(o,u,!0),0}else return 8},fd_readdir(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=0;for(;;){let{ret:p,dirent:d}=t.fds[r].fd_readdir_single(o);if(p!=0)return _.setUint32(f,u,!0),p;if(d==null)break;if(s-u<d.head_length()){u=s;break}let R=new ArrayBuffer(d.head_length());if(d.write_head_bytes(new DataView(R),0),l.set(new Uint8Array(R).slice(0,Math.min(R.byteLength,s-u)),n),n+=d.head_length(),u+=d.head_length(),s-u<d.name_length()){u=s;break}d.write_name_bytes(l,n,s-u),n+=d.name_length(),u+=d.name_length(),o=d.d_next}return _.setUint32(f,u,!0),0}else return 8},fd_renumber(r,n){if(t.fds[r]!=null&&t.fds[n]!=null){let s=t.fds[n].fd_close();return s!=0?s:(t.fds[n]=t.fds[r],t.fds[r]=void 0,0)}else return 8},fd_seek(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:_,offset:l}=t.fds[r].fd_seek(n,s);return f.setBigInt64(o,l,!0),_}else return 8},fd_sync(r){return t.fds[r]!=null?t.fds[r].fd_sync():8},fd_tell(r,n){let s=new DataView(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let{ret:o,offset:f}=t.fds[r].fd_tell();return s.setBigUint64(n,f,!0),o}else return 8},fd_write(r,n,s,o){let f=new DataView(t.inst.exports.memory.buffer),_=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let l=L.read_bytes_array(f,n,s),u=0;for(let p of l){let d=_.slice(p.buf,p.buf+p.buf_len),{ret:R,nwritten:h}=t.fds[r].fd_write(d);if(R!=0)return f.setUint32(o,u,!0),R;if(u+=h,h!=d.byteLength)break}return f.setUint32(o,u,!0),0}else return 8},path_create_directory(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_create_directory(f)}else return 8},path_filestat_get(r,n,s,o,f){let _=new DataView(t.inst.exports.memory.buffer),l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let u=new TextDecoder("utf-8").decode(l.slice(s,s+o)),{ret:p,filestat:d}=t.fds[r].path_filestat_get(n,u);return d?.write_bytes(_,f),p}else return 8},path_filestat_set_times(r,n,s,o,f,_,l){let u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let p=new TextDecoder("utf-8").decode(u.slice(s,s+o));return t.fds[r].path_filestat_set_times(n,p,f,_,l)}else return 8},path_link(r,n,s,o,f,_,l){let u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null&&t.fds[f]!=null){let p=new TextDecoder("utf-8").decode(u.slice(s,s+o)),d=new TextDecoder("utf-8").decode(u.slice(_,_+l)),{ret:R,inode_obj:h}=t.fds[r].path_lookup(p,n);return h==null?R:t.fds[f].path_link(d,h,!1)}else return 8},path_open(r,n,s,o,f,_,l,u,p){let d=new DataView(t.inst.exports.memory.buffer),R=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let h=new TextDecoder("utf-8").decode(R.slice(s,s+o));y.log(h);let{ret:S,fd_obj:X}=t.fds[r].path_open(n,h,f,_,l,u);if(S!=0)return S;t.fds.push(X);let H=t.fds.length-1;return d.setUint32(p,H,!0),0}else return 8},path_readlink(r,n,s,o,f,_){let l=new DataView(t.inst.exports.memory.buffer),u=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let p=new TextDecoder("utf-8").decode(u.slice(n,n+s));y.log(p);let{ret:d,data:R}=t.fds[r].path_readlink(p);if(R!=null){let h=new TextEncoder().encode(R);if(h.length>f)return l.setUint32(_,0,!0),8;u.set(h,o),l.setUint32(_,h.length,!0)}return d}else return 8},path_remove_directory(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_remove_directory(f)}else return 8},path_rename(r,n,s,o,f,_){let l=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null&&t.fds[o]!=null){let u=new TextDecoder("utf-8").decode(l.slice(n,n+s)),p=new TextDecoder("utf-8").decode(l.slice(f,f+_)),{ret:d,inode_obj:R}=t.fds[r].path_unlink(u);if(R==null)return d;if(d=t.fds[o].path_link(p,R,!0),d!=0&&t.fds[r].path_link(u,R,!0)!=0)throw"path_link should always return success when relinking an inode back to the original place";return d}else return 8},path_symlink(r,n,s,o,f){let _=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[s]!=null){let l=new TextDecoder("utf-8").decode(_.slice(r,r+n)),u=new TextDecoder("utf-8").decode(_.slice(o,o+f));return 58}else return 8},path_unlink_file(r,n,s){let o=new Uint8Array(t.inst.exports.memory.buffer);if(t.fds[r]!=null){let f=new TextDecoder("utf-8").decode(o.slice(n,n+s));return t.fds[r].path_unlink_file(f)}else return 8},poll_oneoff(r,n,s){if(s===0)return 28;if(s>1)return y.log("poll_oneoff: only a single subscription is supported"),58;let o=new DataView(t.inst.exports.memory.buffer),f=k.read_bytes(o,r),_=f.eventtype,l=f.clockid,u=f.timeout;if(_!==at)return y.log("poll_oneoff: only clock subscriptions are supported"),58;let p;if(l===1)p=()=>BigInt(Math.round(performance.now()*1e6));else if(l===0)p=()=>BigInt(new Date().getTime())*1000000n;else return 28;let d=(f.flags&ft)!==0?u:p()+u;for(;d>p(););return new Y(f.userdata,0,_).write_bytes(o,n),0},proc_exit(r){throw new U(r)},proc_raise(r){throw"raised signal "+r},sched_yield(){},random_get(r,n){let s=new Uint8Array(t.inst.exports.memory.buffer).subarray(r,r+n);if("crypto"in globalThis&&(typeof SharedArrayBuffer>"u"||!(t.inst.exports.memory.buffer instanceof SharedArrayBuffer)))for(let o=0;o<n;o+=65536)crypto.getRandomValues(s.subarray(o,o+65536));else for(let o=0;o<n;o++)s[o]=Math.random()*256|0},sock_recv(r,n,s){throw"sockets not supported"},sock_send(r,n,s){throw"sockets not supported"},sock_shutdown(r,n){throw"sockets not supported"},sock_accept(r,n){throw"sockets not supported"}}}};var g=class{fd_allocate(e,i){return 58}fd_close(){return 0}fd_fdstat_get(){return{ret:58,fdstat:null}}fd_fdstat_set_flags(e){return 58}fd_fdstat_set_rights(e,i){return 58}fd_filestat_get(){return{ret:58,filestat:null}}fd_filestat_set_size(e){return 58}fd_filestat_set_times(e,i,c){return 58}fd_pread(e,i){return{ret:58,data:new Uint8Array}}fd_prestat_get(){return{ret:58,prestat:null}}fd_pwrite(e,i){return{ret:58,nwritten:0}}fd_read(e){return{ret:58,data:new Uint8Array}}fd_readdir_single(e){return{ret:58,dirent:null}}fd_seek(e,i){return{ret:58,offset:0n}}fd_sync(){return 0}fd_tell(){return{ret:58,offset:0n}}fd_write(e){return{ret:58,nwritten:0}}path_create_directory(e){return 58}path_filestat_get(e,i){return{ret:58,filestat:null}}path_filestat_set_times(e,i,c,E,t){return 58}path_link(e,i,c){return 58}path_unlink(e){return{ret:58,inode_obj:null}}path_lookup(e,i){return{ret:58,inode_obj:null}}path_open(e,i,c,E,t,r){return{ret:54,fd_obj:null}}path_readlink(e){return{ret:58,data:null}}path_remove_directory(e){return 58}path_rename(e,i,c){return 58}path_unlink_file(e){return 58}},m=class a{static issue_ino(){return a.next_ino++}static root_ino(){return 0n}constructor(){this.ino=a.issue_ino()}};m.next_ino=1n;var b=class extends g{fd_allocate(e,i){if(!(this.file.size>e+i)){let c=new Uint8Array(Number(e+i));c.set(this.file.data,0),this.file.data=c}return 0}fd_fdstat_get(){return{ret:0,fdstat:new x(W,0)}}fd_filestat_set_size(e){if(this.file.size>e)this.file.data=new Uint8Array(this.file.data.buffer.slice(0,Number(e)));else{let i=new Uint8Array(Number(e));i.set(this.file.data,0),this.file.data=i}return 0}fd_read(e){let i=this.file.data.slice(Number(this.file_pos),Number(this.file_pos+BigInt(e)));return this.file_pos+=BigInt(i.length),{ret:0,data:i}}fd_pread(e,i){return{ret:0,data:this.file.data.slice(Number(i),Number(i+BigInt(e)))}}fd_seek(e,i){let c;switch(i){case Q:c=e;break;case Z:c=this.file_pos+e;break;case V:c=BigInt(this.file.data.byteLength)+e;break;default:return{ret:28,offset:0n}}return c<0?{ret:28,offset:0n}:(this.file_pos=c,{ret:0,offset:this.file_pos})}fd_tell(){return{ret:0,offset:this.file_pos}}fd_write(e){if(this.file.readonly)return{ret:8,nwritten:0};if(this.file_pos+BigInt(e.byteLength)>this.file.size){let i=this.file.data;this.file.data=new Uint8Array(Number(this.file_pos+BigInt(e.byteLength))),this.file.data.set(i)}return this.file.data.set(e,Number(this.file_pos)),this.file_pos+=BigInt(e.byteLength),{ret:0,nwritten:e.byteLength}}fd_pwrite(e,i){if(this.file.readonly)return{ret:8,nwritten:0};if(i+BigInt(e.byteLength)>this.file.size){let c=this.file.data;this.file.data=new Uint8Array(Number(i+BigInt(e.byteLength))),this.file.data.set(c)}return this.file.data.set(e,Number(i)),{ret:0,nwritten:e.byteLength}}fd_filestat_get(){return{ret:0,filestat:this.file.stat()}}constructor(e){super(),this.file_pos=0n,this.file=e}};var F=class extends m{path_open(e,i,c){if(this.readonly&&(i&BigInt(64))==BigInt(64))return{ret:63,fd_obj:null};if((e&j)==j){if(this.readonly)return{ret:63,fd_obj:null};this.data=new Uint8Array([])}let E=new b(this);return c&q&&E.fd_seek(0n,V),{ret:0,fd_obj:E}}get size(){return BigInt(this.data.byteLength)}stat(){return new A(this.ino,W,this.size)}constructor(e,i){super(),this.data=new Uint8Array(e),this.readonly=!!i?.readonly}};var P=class a extends g{fd_filestat_get(){return{ret:0,filestat:new A(this.ino,J,BigInt(0))}}fd_fdstat_get(){let e=new x(J,0);return e.fs_rights_base=BigInt(64),{ret:0,fdstat:e}}fd_write(e){return this.write(e),{ret:0,nwritten:e.byteLength}}static lineBuffered(e){let i=new TextDecoder("utf-8",{fatal:!1}),c="";return new a(E=>{c+=i.decode(E,{stream:!0});let t=c.split(`\n`);for(let[r,n]of t.entries())r<t.length-1?e(n):c=n})}constructor(e){super(),this.ino=m.issue_ino(),this.write=e}};var ct="code-playpad Clang 20.1.2 / Emscripten 4.0.6 r1",lt={"clang.js":{bytes:74300,sha256:"b437a648812aabd1cc87cba4a7268e2f53ab94a9071a854ba983dd62328dc30c"},"clang.wasm":{bytes:42578038,sha256:"534571fd4f9136c85d3e25a395cc31983ec3cbd41012e3928b45879a518718fa"},"lld.js":{bytes:71711,sha256:"2da4b0a04b6953bdc4869137631abd11ea7eb5a667fbd19c4ff6d68d56f302bb"},"lld.wasm":{bytes:23228304,sha256:"55ffbe1366525c1b55b65140630e0ca00ff47eae7acfdee6a15b46e738800ec7"},"sysroot.tar":{bytes:29009920,sha256:"a0d92a9fc1dccc2c181ae6812b6c169de3dad851ee4d4e796d15940776648ac5"}};function K(a){if(!a||a.startsWith("/")||/[\\\\\\x00-\\x1f:]/.test(a)||a.split("/").some(e=>!e||e==="."||e===".."))throw new Error(`Invalid project path: ${JSON.stringify(a)}. Use relative paths without . or ...`);return a}function ut(a,e,i,c){let E=K(i??(c==="c"?"main.c":"main.cpp")),t=e?{...e}:{[E]:a};if(!Object.hasOwn(t,E))throw new Error(`Entry file ${E} does not exist.`);let r=Object.keys(t).map(K).sort(),n=f=>/\\.c$/.test(f),s=f=>/\\.(cpp|cc|cxx)$/.test(f);if(r.some(c==="c"?s:n))throw new Error("Mixed C/C++ source projects are not supported yet.");let o=r.filter(c==="c"?n:s);if(!o.includes(E))throw new Error(`Entry ${E} must have a ${c==="c"?".c":".cpp, .cc, or .cxx"} extension.`);if(o.length>32||r.length>256)throw new Error("Project limit: 32 source files and 256 files total.");if(Object.values(t).reduce((f,_)=>f+new TextEncoder().encode(_).length,0)>2e6)throw new Error("Project exceeds the 2 MB source limit.");return{files:t,sources:o,entry:E}}var st,v,dt=Promise.resolve(),G=a=>globalThis.postMessage(a),M=(a,e,i)=>G({type:"progress",id:a,phase:e,message:i}),B=(a,e)=>ot(a,lt[a],st,it,i=>M(e,"downloading",i));function St(a){let e=new Uint8Array(a),i=new TextDecoder,c=[],E=(t,r)=>i.decode(e.subarray(t,t+r)).replace(/\\0.*$/,"");for(let t=0;t+512<=e.length;){let r=E(t,100);if(!r)break;let n=E(t+345,155);n&&(r=n+"/"+r);let s=parseInt(E(t+124,12).trim()||"0",8),o=e[t+156];if(!Number.isSafeInteger(s)||s<0||t+512+s>e.length)throw new Error("Invalid sysroot archive.");if(o===48||o===0)c.push({name:"/"+K(r),data:e.subarray(t+512,t+512+s)});else if(o!==53)throw new Error("Unsupported sysroot archive entry.");t+=512+Math.ceil(s/512)*512}return c}async function Rt(a){let e=URL.createObjectURL(new Blob([a],{type:"text/javascript"}));try{return(await import(e)).default}finally{URL.revokeObjectURL(e)}}function yt(a){return st?(v||(v=(async()=>{let e=await Rt(await B("clang.js",a)),i=await Rt(await B("lld.js",a)),c=await WebAssembly.compile(await B("clang.wasm",a)),E=await WebAssembly.compile(await B("lld.wasm",a));M(a,"booting","Preparing C/C++ standard libraries\\u2026");let t=St(await B("sysroot.tar",a));return{clang:e,lld:i,clangModule:c,lldModule:E,sysroot:t}})().catch(e=>{throw v=void 0,e})),v):Promise.reject(new Error("Configure the rebuilt C/C++ assets with configureCpp({ indexURL }) before creating widgets. See docs/CPP-REBUILD.md."))}async function Et(a,e,i,c){let E,t=await a({thisProgram:i,noInitialRun:!0,print:c,printErr:c,instantiateWasm(r,n){let s=new WebAssembly.Instance(e,r);return E=Object.values(s.exports).find(o=>o instanceof WebAssembly.Memory),n(s,e),s.exports}});return t.memory=E,t}function $(a,e,i){a.mkdirTree(e.slice(0,e.lastIndexOf("/"))||"/"),a.writeFile(e,i)}async function mt(a){let e=performance.now(),i=0,c=(E,t)=>{if(i+=t.length,i>1e6)throw new Error("Output limit exceeded (1 MB).");t&&G({type:E,id:a.id,text:t})};try{let E=ut(a.code,a.files,a.entry,a.compilerLanguage),t=await yt(a.id),r=[],n=0;for(let R of E.sources){M(a.id,"compiling",`Compiling ${R}\\u2026`);let h=await Et(t.clang,t.clangModule,"clang",T=>c("stderr",T+`\n`));for(let T of t.sysroot)$(h.FS,T.name,T.data);for(let[T,pt]of Object.entries(E.files))$(h.FS,"/project/"+T,pt);let S=a.compilerLanguage==="cpp",X=["-cc1","-triple","wasm32-unknown-wasi","-emit-obj","-O0","-std="+(S?"c++20":"c17"),"-resource-dir","/lib/clang/20",...S?["-internal-isystem","/include/wasm32-wasi/c++/v1","-internal-isystem","/include/c++/v1"]:[],"-internal-isystem","/lib/clang/20/include","-internal-isystem","/include/wasm32-wasi","-internal-isystem","/include","-I","/project","-ferror-limit","20","-o","/tmp/output.o","-x",S?"c++":"c","/project/"+R],H=h.callMain(X);if(n=Math.max(n,h.memory?.buffer.byteLength??0),H!==0)throw new Error(`Compilation failed (${R}, exit ${H}).`);r.push(h.FS.readFile("/tmp/output.o").slice())}M(a.id,"linking","Linking\\u2026");let s=await Et(t.lld,t.lldModule,"wasm-ld",R=>c("stderr",R+`\n`));for(let R of t.sysroot)R.name.startsWith("/include/")||$(s.FS,R.name,R.data);r.forEach((R,h)=>$(s.FS,"/tmp/"+h+".o",R));let o=s.callMain(["-m","wasm32","-z","stack-size=1048576","--max-memory=268435456","-L/lib/wasm32-wasi","/lib/wasm32-wasi/crt1-command.o",...r.map((R,h)=>"/tmp/"+h+".o"),...a.compilerLanguage==="cpp"?["-lc++","-lc++abi"]:[],"-lc","/lib/clang/20/lib/wasm32-unknown-wasi/libclang_rt.builtins.a","-o","/tmp/program.wasm"]);if(n=Math.max(n,s.memory?.buffer.byteLength??0),o!==0)throw new Error(`Linking failed (exit ${o}).`);let f=await WebAssembly.compile(s.FS.readFile("/tmp/program.wasm").slice().buffer);M(a.id,"running","Running\\u2026");let _={stdout:new TextDecoder,stderr:new TextDecoder},l=R=>new P(h=>c(R,_[R].decode(h,{stream:!0}))),u=new rt([E.entry],[],[new b(new F(new TextEncoder().encode(a.stdin??""))),l("stdout"),l("stderr")]),p=await WebAssembly.instantiate(f,{wasi_snapshot_preview1:u.wasiImport}),d=u.start(p);if(c("stdout",_.stdout.decode()),c("stderr",_.stderr.decode()),d!==0)throw new Error(`Program exited with status ${d}.`);G({type:"result",id:a.id,durationMs:performance.now()-e,memory:{compilerBytes:n,programBytes:p.exports.memory.buffer.byteLength}})}catch(E){G({type:"error",id:a.id,message:E instanceof Error?E.message:String(E),durationMs:performance.now()-e})}}globalThis.onmessage=({data:a})=>{a.type==="init"?(st=a.toolchainURL,G({type:"ready",version:ct,interactiveStdin:!1})):a.type==="run"&&(dt=dt.then(()=>mt(a)))};})();\n',o=new class extends t{id=`cpp`;get label(){return`C/C++ (Clang 20, experimental)`}get source(){return a}async load(e){return await i(n),super.load(e)}initPayload(){return{toolchainURL:e().indexURL}}};function s(t){return{id:t,label:t===`c`?`C17 (experimental)`:`C++20 (experimental)`,statusDecidesFailure:!0,get ready(){return o.ready},interactiveStdin:!1,async editorLanguage(){return(await import(`./dist-CNOK8CHE.js`)).cpp()},load:e=>o.load(e),run:(n,r={})=>o.run(n,{...r,compilerLanguage:t,timeoutMs:r.timeoutMs??e().timeoutMs}),stop:e=>o.stop(e)}}var c=s(`c`),l=s(`cpp`);export{c as cRuntime,l as cppRuntime};
|