aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-10-15 19:35:48 +0300
committerKostya <mail@sartin.in>2026-10-15 19:36:15 +0300
commitc263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e (patch)
treed9b721c72a4ffa2d6256adc305716c8432cb190c
parentc67d5ff663b876a15a3831f5a2b564c4002e99b6 (diff)
downloadguess-market-c263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e.tar.gz
guess-market-c263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e.tar.xz
guess-market-c263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e.zip
ui-web: add browser client for the Ex4 bonus HEAD4.0master
A React + TypeScript single-page client served by Vite, working against the same servlets as the desktop client: login, the events screen with filters, details, order books and trading, and the account screen with deposit, holdings, ledger rows and the user directory. No file upload, as the exercise specifies. It looks like the desktop client on purpose: the three skins of theme.css as CSS variables, the four animations redone with SVG and keyframes, and the desktop's Nerd Fonts, which npm run dev copies from ui-fx instead of keeping a second copy in the repo. The shared chat sits in a drawer above the status bar, as on the desktop, on its own poll because chat lines don't move the market version. Vite forwards /guess-market to Tomcat on 8080, so the page and the API share an origin and the session cookie needs no CORS. The client polls /api/sync once a second and reloads only when the version moved. run-web.bat installs the packages and starts it on localhost:5173. package.sh stages the sources under build/dist/ex4, without node_modules.
-rw-r--r--.gitignore4
-rw-r--r--tools/package.sh7
-rw-r--r--ui-web/index.html12
-rw-r--r--ui-web/package-lock.json1746
-rw-r--r--ui-web/package.json22
-rw-r--r--ui-web/run-web.bat10
-rw-r--r--ui-web/src/App.tsx502
-rw-r--r--ui-web/src/Chart.tsx94
-rw-r--r--ui-web/src/Events.tsx370
-rw-r--r--ui-web/src/Users.tsx298
-rw-r--r--ui-web/src/api.ts176
-rw-r--r--ui-web/src/graphics.tsx51
-rw-r--r--ui-web/src/main.tsx10
-rw-r--r--ui-web/src/styles.css1068
-rw-r--r--ui-web/tsconfig.json15
-rw-r--r--ui-web/vite.config.ts14
16 files changed, 4399 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ebd5255..315c693 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,8 @@
1
1.*/ 2.*/
2 3
3bin/ 4bin/
4build/ 5build/
6node_modules/
7ui-web/dist/
8ui-web/public/fonts/
diff --git a/tools/package.sh b/tools/package.sh
index 2569e96..c8c6cc1 100644
--- a/tools/package.sh
+++ b/tools/package.sh
@@ -105,6 +105,13 @@ done
105cp "$DIST/run-${CLIENT#ui-}.bat" "$CDIR/" 105cp "$DIST/run-${CLIENT#ui-}.bat" "$CDIR/"
106ls "$CDIR" | sed 's/^/ /' 106ls "$CDIR" | sed 's/^/ /'
107 107
108echo "=== Exercise 4: web client ==="
109EX4="$DIST/ex4/ui-web"
110mkdir -p "$EX4"
111(cd ui-web && tar cf - --exclude=node_modules --exclude=dist .) | (cd "$EX4" && tar xf -)
112cp "$EX3/$WAR_NAME.war" "$DIST/ex4/"
113ls -A "$DIST/ex4" "$EX4" | sed 's/^/ /'
114
108echo "=== Manifest as it actually landed in the jar ===" 115echo "=== Manifest as it actually landed in the jar ==="
109# Cheapest check that prevents a Level-0: if Main-Class or Class-Path didn't 116# Cheapest check that prevents a Level-0: if Main-Class or Class-Path didn't
110# survive, it surfaces here instead of on the grader's machine. 117# survive, it surfaces here instead of on the grader's machine.
diff --git a/ui-web/index.html b/ui-web/index.html
new file mode 100644
index 0000000..279b73a
--- /dev/null
+++ b/ui-web/index.html
@@ -0,0 +1,12 @@
1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <title>Guess Market</title>
7 </head>
8 <body>
9 <div id="root"></div>
10 <script type="module" src="/src/main.tsx"></script>
11 </body>
12</html>
diff --git a/ui-web/package-lock.json b/ui-web/package-lock.json
new file mode 100644
index 0000000..96f2ce1
--- /dev/null
+++ b/ui-web/package-lock.json
@@ -0,0 +1,1746 @@
1{
2 "name": "guess-market-web",
3 "version": "1.0.0",
4 "lockfileVersion": 3,
5 "requires": true,
6 "packages": {
7 "": {
8 "name": "guess-market-web",
9 "version": "1.0.0",
10 "dependencies": {
11 "react": "18.3.1",
12 "react-dom": "18.3.1"
13 },
14 "devDependencies": {
15 "@types/react": "18.3.12",
16 "@types/react-dom": "18.3.1",
17 "@vitejs/plugin-react": "4.3.4",
18 "typescript": "5.6.3",
19 "vite": "5.4.11"
20 }
21 },
22 "node_modules/@babel/code-frame": {
23 "version": "7.29.7",
24 "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
25 "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
26 "dev": true,
27 "license": "MIT",
28 "dependencies": {
29 "@babel/helper-validator-identifier": "^7.29.7",
30 "js-tokens": "^4.0.0",
31 "picocolors": "^1.1.1"
32 },
33 "engines": {
34 "node": ">=6.9.0"
35 }
36 },
37 "node_modules/@babel/compat-data": {
38 "version": "7.29.7",
39 "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
40 "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
41 "dev": true,
42 "license": "MIT",
43 "engines": {
44 "node": ">=6.9.0"
45 }
46 },
47 "node_modules/@babel/core": {
48 "version": "7.29.7",
49 "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
50 "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
51 "dev": true,
52 "license": "MIT",
53 "peer": true,
54 "dependencies": {
55 "@babel/code-frame": "^7.29.7",
56 "@babel/generator": "^7.29.7",
57 "@babel/helper-compilation-targets": "^7.29.7",
58 "@babel/helper-module-transforms": "^7.29.7",
59 "@babel/helpers": "^7.29.7",
60 "@babel/parser": "^7.29.7",
61 "@babel/template": "^7.29.7",
62 "@babel/traverse": "^7.29.7",
63 "@babel/types": "^7.29.7",
64 "@jridgewell/remapping": "^2.3.5",
65 "convert-source-map": "^2.0.0",
66 "debug": "^4.1.0",
67 "gensync": "^1.0.0-beta.2",
68 "json5": "^2.2.3",
69 "semver": "^6.3.1"
70 },
71 "engines": {
72 "node": ">=6.9.0"
73 },
74 "funding": {
75 "type": "opencollective",
76 "url": "https://opencollective.com/babel"
77 }
78 },
79 "node_modules/@babel/generator": {
80 "version": "7.29.8",
81 "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz",
82 "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==",
83 "dev": true,
84 "license": "MIT",
85 "dependencies": {
86 "@babel/parser": "^7.29.8",
87 "@babel/types": "^7.29.8",
88 "@jridgewell/gen-mapping": "^0.3.12",
89 "@jridgewell/trace-mapping": "^0.3.28",
90 "jsesc": "^3.0.2"
91 },
92 "engines": {
93 "node": ">=6.9.0"
94 }
95 },
96 "node_modules/@babel/helper-compilation-targets": {
97 "version": "7.29.7",
98 "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
99 "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
100 "dev": true,
101 "license": "MIT",
102 "dependencies": {
103 "@babel/compat-data": "^7.29.7",
104 "@babel/helper-validator-option": "^7.29.7",
105 "browserslist": "^4.24.0",
106 "lru-cache": "^5.1.1",
107 "semver": "^6.3.1"
108 },
109 "engines": {
110 "node": ">=6.9.0"
111 }
112 },
113 "node_modules/@babel/helper-globals": {
114 "version": "7.29.7",
115 "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
116 "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
117 "dev": true,
118 "license": "MIT",
119 "engines": {
120 "node": ">=6.9.0"
121 }
122 },
123 "node_modules/@babel/helper-module-imports": {
124 "version": "7.29.7",
125 "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
126 "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
127 "dev": true,
128 "license": "MIT",
129 "dependencies": {
130 "@babel/traverse": "^7.29.7",
131 "@babel/types": "^7.29.7"
132 },
133 "engines": {
134 "node": ">=6.9.0"
135 }
136 },
137 "node_modules/@babel/helper-module-transforms": {
138 "version": "7.29.7",
139 "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
140 "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
141 "dev": true,
142 "license": "MIT",
143 "dependencies": {
144 "@babel/helper-module-imports": "^7.29.7",
145 "@babel/helper-validator-identifier": "^7.29.7",
146 "@babel/traverse": "^7.29.7"
147 },
148 "engines": {
149 "node": ">=6.9.0"
150 },
151 "peerDependencies": {
152 "@babel/core": "^7.0.0"
153 }
154 },
155 "node_modules/@babel/helper-plugin-utils": {
156 "version": "7.29.7",
157 "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz",
158 "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==",
159 "dev": true,
160 "license": "MIT",
161 "engines": {
162 "node": ">=6.9.0"
163 }
164 },
165 "node_modules/@babel/helper-string-parser": {
166 "version": "7.29.7",
167 "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
168 "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
169 "dev": true,
170 "license": "MIT",
171 "engines": {
172 "node": ">=6.9.0"
173 }
174 },
175 "node_modules/@babel/helper-validator-identifier": {
176 "version": "7.29.7",
177 "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
178 "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
179 "dev": true,
180 "license": "MIT",
181 "engines": {
182 "node": ">=6.9.0"
183 }
184 },
185 "node_modules/@babel/helper-validator-option": {
186 "version": "7.29.7",
187 "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
188 "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
189 "dev": true,
190 "license": "MIT",
191 "engines": {
192 "node": ">=6.9.0"
193 }
194 },
195 "node_modules/@babel/helpers": {
196 "version": "7.29.10",
197 "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz",
198 "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==",
199 "dev": true,
200 "license": "MIT",
201 "dependencies": {
202 "@babel/template": "^7.29.7",
203 "@babel/types": "^7.29.8"
204 },
205 "engines": {
206 "node": ">=6.9.0"
207 }
208 },
209 "node_modules/@babel/parser": {
210 "version": "7.29.9",
211 "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
212 "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
213 "dev": true,
214 "license": "MIT",
215 "dependencies": {
216 "@babel/types": "^7.29.8"
217 },
218 "bin": {
219 "parser": "bin/babel-parser.js"
220 },
221 "engines": {
222 "node": ">=6.0.0"
223 }
224 },
225 "node_modules/@babel/plugin-transform-react-jsx-self": {
226 "version": "7.29.7",
227 "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz",
228 "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==",
229 "dev": true,
230 "license": "MIT",
231 "dependencies": {
232 "@babel/helper-plugin-utils": "^7.29.7"
233 },
234 "engines": {
235 "node": ">=6.9.0"
236 },
237 "peerDependencies": {
238 "@babel/core": "^7.0.0-0"
239 }
240 },
241 "node_modules/@babel/plugin-transform-react-jsx-source": {
242 "version": "7.29.7",
243 "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz",
244 "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==",
245 "dev": true,
246 "license": "MIT",
247 "dependencies": {
248 "@babel/helper-plugin-utils": "^7.29.7"
249 },
250 "engines": {
251 "node": ">=6.9.0"
252 },
253 "peerDependencies": {
254 "@babel/core": "^7.0.0-0"
255 }
256 },
257 "node_modules/@babel/template": {
258 "version": "7.29.7",
259 "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
260 "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
261 "dev": true,
262 "license": "MIT",
263 "dependencies": {
264 "@babel/code-frame": "^7.29.7",
265 "@babel/parser": "^7.29.7",
266 "@babel/types": "^7.29.7"
267 },
268 "engines": {
269 "node": ">=6.9.0"
270 }
271 },
272 "node_modules/@babel/traverse": {
273 "version": "7.29.10",
274 "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz",
275 "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==",
276 "dev": true,
277 "license": "MIT",
278 "dependencies": {
279 "@babel/code-frame": "^7.29.7",
280 "@babel/generator": "^7.29.8",
281 "@babel/helper-globals": "^7.29.7",
282 "@babel/parser": "^7.29.9",
283 "@babel/template": "^7.29.7",
284 "@babel/types": "^7.29.8",
285 "debug": "^4.3.1"
286 },
287 "engines": {
288 "node": ">=6.9.0"
289 }
290 },
291 "node_modules/@babel/types": {
292 "version": "7.29.8",
293 "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz",
294 "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==",
295 "dev": true,
296 "license": "MIT",
297 "dependencies": {
298 "@babel/helper-string-parser": "^7.29.7",
299 "@babel/helper-validator-identifier": "^7.29.7"
300 },
301 "engines": {
302 "node": ">=6.9.0"
303 }
304 },
305 "node_modules/@esbuild/aix-ppc64": {
306 "version": "0.21.5",
307 "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
308 "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
309 "cpu": [
310 "ppc64"
311 ],
312 "dev": true,
313 "license": "MIT",
314 "optional": true,
315 "os": [
316 "aix"
317 ],
318 "engines": {
319 "node": ">=12"
320 }
321 },
322 "node_modules/@esbuild/android-arm": {
323 "version": "0.21.5",
324 "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
325 "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
326 "cpu": [
327 "arm"
328 ],
329 "dev": true,
330 "license": "MIT",
331 "optional": true,
332 "os": [
333 "android"
334 ],
335 "engines": {
336 "node": ">=12"
337 }
338 },
339 "node_modules/@esbuild/android-arm64": {
340 "version": "0.21.5",
341 "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
342 "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
343 "cpu": [
344 "arm64"
345 ],
346 "dev": true,
347 "license": "MIT",
348 "optional": true,
349 "os": [
350 "android"
351 ],
352 "engines": {
353 "node": ">=12"
354 }
355 },
356 "node_modules/@esbuild/android-x64": {
357 "version": "0.21.5",
358 "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
359 "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
360 "cpu": [
361 "x64"
362 ],
363 "dev": true,
364 "license": "MIT",
365 "optional": true,
366 "os": [
367 "android"
368 ],
369 "engines": {
370 "node": ">=12"
371 }
372 },
373 "node_modules/@esbuild/darwin-arm64": {
374 "version": "0.21.5",
375 "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
376 "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
377 "cpu": [
378 "arm64"
379 ],
380 "dev": true,
381 "license": "MIT",
382 "optional": true,
383 "os": [
384 "darwin"
385 ],
386 "engines": {
387 "node": ">=12"
388 }
389 },
390 "node_modules/@esbuild/darwin-x64": {
391 "version": "0.21.5",
392 "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
393 "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
394 "cpu": [
395 "x64"
396 ],
397 "dev": true,
398 "license": "MIT",
399 "optional": true,
400 "os": [
401 "darwin"
402 ],
403 "engines": {
404 "node": ">=12"
405 }
406 },
407 "node_modules/@esbuild/freebsd-arm64": {
408 "version": "0.21.5",
409 "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
410 "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
411 "cpu": [
412 "arm64"
413 ],
414 "dev": true,
415 "license": "MIT",
416 "optional": true,
417 "os": [
418 "freebsd"
419 ],
420 "engines": {
421 "node": ">=12"
422 }
423 },
424 "node_modules/@esbuild/freebsd-x64": {
425 "version": "0.21.5",
426 "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
427 "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
428 "cpu": [
429 "x64"
430 ],
431 "dev": true,
432 "license": "MIT",
433 "optional": true,
434 "os": [
435 "freebsd"
436 ],
437 "engines": {
438 "node": ">=12"
439 }
440 },
441 "node_modules/@esbuild/linux-arm": {
442 "version": "0.21.5",
443 "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
444 "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
445 "cpu": [
446 "arm"
447 ],
448 "dev": true,
449 "license": "MIT",
450 "optional": true,
451 "os": [
452 "linux"
453 ],
454 "engines": {
455 "node": ">=12"
456 }
457 },
458 "node_modules/@esbuild/linux-arm64": {
459 "version": "0.21.5",
460 "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
461 "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
462 "cpu": [
463 "arm64"
464 ],
465 "dev": true,
466 "license": "MIT",
467 "optional": true,
468 "os": [
469 "linux"
470 ],
471 "engines": {
472 "node": ">=12"
473 }
474 },
475 "node_modules/@esbuild/linux-ia32": {
476 "version": "0.21.5",
477 "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
478 "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
479 "cpu": [
480 "ia32"
481 ],
482 "dev": true,
483 "license": "MIT",
484 "optional": true,
485 "os": [
486 "linux"
487 ],
488 "engines": {
489 "node": ">=12"
490 }
491 },
492 "node_modules/@esbuild/linux-loong64": {
493 "version": "0.21.5",
494 "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
495 "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
496 "cpu": [
497 "loong64"
498 ],
499 "dev": true,
500 "license": "MIT",
501 "optional": true,
502 "os": [
503 "linux"
504 ],
505 "engines": {
506 "node": ">=12"
507 }
508 },
509 "node_modules/@esbuild/linux-mips64el": {
510 "version": "0.21.5",
511 "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
512 "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
513 "cpu": [
514 "mips64el"
515 ],
516 "dev": true,
517 "license": "MIT",
518 "optional": true,
519 "os": [
520 "linux"
521 ],
522 "engines": {
523 "node": ">=12"
524 }
525 },
526 "node_modules/@esbuild/linux-ppc64": {
527 "version": "0.21.5",
528 "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
529 "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
530 "cpu": [
531 "ppc64"
532 ],
533 "dev": true,
534 "license": "MIT",
535 "optional": true,
536 "os": [
537 "linux"
538 ],
539 "engines": {
540 "node": ">=12"
541 }
542 },
543 "node_modules/@esbuild/linux-riscv64": {
544 "version": "0.21.5",
545 "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
546 "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
547 "cpu": [
548 "riscv64"
549 ],
550 "dev": true,
551 "license": "MIT",
552 "optional": true,
553 "os": [
554 "linux"
555 ],
556 "engines": {
557 "node": ">=12"
558 }
559 },
560 "node_modules/@esbuild/linux-s390x": {
561 "version": "0.21.5",
562 "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
563 "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
564 "cpu": [
565 "s390x"
566 ],
567 "dev": true,
568 "license": "MIT",
569 "optional": true,
570 "os": [
571 "linux"
572 ],
573 "engines": {
574 "node": ">=12"
575 }
576 },
577 "node_modules/@esbuild/linux-x64": {
578 "version": "0.21.5",
579 "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
580 "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
581 "cpu": [
582 "x64"
583 ],
584 "dev": true,
585 "license": "MIT",
586 "optional": true,
587 "os": [
588 "linux"
589 ],
590 "engines": {
591 "node": ">=12"
592 }
593 },
594 "node_modules/@esbuild/netbsd-x64": {
595 "version": "0.21.5",
596 "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
597 "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
598 "cpu": [
599 "x64"
600 ],
601 "dev": true,
602 "license": "MIT",
603 "optional": true,
604 "os": [
605 "netbsd"
606 ],
607 "engines": {
608 "node": ">=12"
609 }
610 },
611 "node_modules/@esbuild/openbsd-x64": {
612 "version": "0.21.5",
613 "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
614 "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
615 "cpu": [
616 "x64"
617 ],
618 "dev": true,
619 "license": "MIT",
620 "optional": true,
621 "os": [
622 "openbsd"
623 ],
624 "engines": {
625 "node": ">=12"
626 }
627 },
628 "node_modules/@esbuild/sunos-x64": {
629 "version": "0.21.5",
630 "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
631 "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
632 "cpu": [
633 "x64"
634 ],
635 "dev": true,
636 "license": "MIT",
637 "optional": true,
638 "os": [
639 "sunos"
640 ],
641 "engines": {
642 "node": ">=12"
643 }
644 },
645 "node_modules/@esbuild/win32-arm64": {
646 "version": "0.21.5",
647 "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
648 "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
649 "cpu": [
650 "arm64"
651 ],
652 "dev": true,
653 "license": "MIT",
654 "optional": true,
655 "os": [
656 "win32"
657 ],
658 "engines": {
659 "node": ">=12"
660 }
661 },
662 "node_modules/@esbuild/win32-ia32": {
663 "version": "0.21.5",
664 "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
665 "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
666 "cpu": [
667 "ia32"
668 ],
669 "dev": true,
670 "license": "MIT",
671 "optional": true,
672 "os": [
673 "win32"
674 ],
675 "engines": {
676 "node": ">=12"
677 }
678 },
679 "node_modules/@esbuild/win32-x64": {
680 "version": "0.21.5",
681 "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
682 "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
683 "cpu": [
684 "x64"
685 ],
686 "dev": true,
687 "license": "MIT",
688 "optional": true,
689 "os": [
690 "win32"
691 ],
692 "engines": {
693 "node": ">=12"
694 }
695 },
696 "node_modules/@jridgewell/gen-mapping": {
697 "version": "0.3.13",
698 "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
699 "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
700 "dev": true,
701 "license": "MIT",
702 "dependencies": {
703 "@jridgewell/sourcemap-codec": "^1.5.0",
704 "@jridgewell/trace-mapping": "^0.3.24"
705 }
706 },
707 "node_modules/@jridgewell/remapping": {
708 "version": "2.3.5",
709 "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
710 "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
711 "dev": true,
712 "license": "MIT",
713 "dependencies": {
714 "@jridgewell/gen-mapping": "^0.3.5",
715 "@jridgewell/trace-mapping": "^0.3.24"
716 }
717 },
718 "node_modules/@jridgewell/resolve-uri": {
719 "version": "3.1.2",
720 "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
721 "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
722 "dev": true,
723 "license": "MIT",
724 "engines": {
725 "node": ">=6.0.0"
726 }
727 },
728 "node_modules/@jridgewell/sourcemap-codec": {
729 "version": "1.6.0",
730 "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
731 "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
732 "dev": true,
733 "license": "MIT"
734 },
735 "node_modules/@jridgewell/trace-mapping": {
736 "version": "0.3.31",
737 "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
738 "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
739 "dev": true,
740 "license": "MIT",
741 "dependencies": {
742 "@jridgewell/resolve-uri": "^3.1.0",
743 "@jridgewell/sourcemap-codec": "^1.4.14"
744 }
745 },
746 "node_modules/@napi-rs/lzma-linux-x64-gnu": {
747 "version": "1.5.1",
748 "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
749 "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
750 "cpu": [
751 "x64"
752 ],
753 "dev": true,
754 "license": "MIT",
755 "optional": true,
756 "os": [
757 "linux"
758 ],
759 "engines": {
760 "node": "^22.20 || ^24.12 || >=25"
761 }
762 },
763 "node_modules/@rollup/rollup-android-arm-eabi": {
764 "version": "4.64.6",
765 "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.6.tgz",
766 "integrity": "sha512-FkO19Fowv/OQeJZPVfdetJaI3/VpbZmBsnmAlR/rQ+b3QwfiGQiOpVegpSRH331kelvHTVw9hXYG3DwjAaRzyQ==",
767 "cpu": [
768 "arm"
769 ],
770 "dev": true,
771 "license": "MIT",
772 "optional": true,
773 "os": [
774 "android"
775 ]
776 },
777 "node_modules/@rollup/rollup-android-arm64": {
778 "version": "4.64.6",
779 "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.6.tgz",
780 "integrity": "sha512-si5/Etm6MphPc2xYHnk455Shls/hoMjTy3mhXge4OPmvCw7TwC4KP4fKokAlKLV4XaQvLvgSHfafPcblLMYYdQ==",
781 "cpu": [
782 "arm64"
783 ],
784 "dev": true,
785 "license": "MIT",
786 "optional": true,
787 "os": [
788 "android"
789 ]
790 },
791 "node_modules/@rollup/rollup-darwin-arm64": {
792 "version": "4.64.6",
793 "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.6.tgz",
794 "integrity": "sha512-PQCl3q7b0BgvVt72i2xrWM6I5KliwwVe4GpWW5QDGyUQawDS9aPZss/aGyFqBmxdRxlE8wDc9CaxiQ5DHRSp/Q==",
795 "cpu": [
796 "arm64"
797 ],
798 "dev": true,
799 "license": "MIT",
800 "optional": true,
801 "os": [
802 "darwin"
803 ]
804 },
805 "node_modules/@rollup/rollup-darwin-x64": {
806 "version": "4.64.6",
807 "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.6.tgz",
808 "integrity": "sha512-l9DFl1Itb1YYdSrP1K3U8ih44AOHa/p+Q4WMMDfGvH5qVWp+ajfgS1DlYo4yCRh8wJ2ZJv0Fqccf+ULAmMFjmg==",
809 "cpu": [
810 "x64"
811 ],
812 "dev": true,
813 "license": "MIT",
814 "optional": true,
815 "os": [
816 "darwin"
817 ]
818 },
819 "node_modules/@rollup/rollup-freebsd-arm64": {
820 "version": "4.64.6",
821 "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.6.tgz",
822 "integrity": "sha512-bR4GR3205N9+od0+l5Dd9/iZTDpJkIe6d6Ydp2qbcQZJLmKBdYQQRp8gbWpbMt92twKJY66o1vK4NkoKQODIrA==",
823 "cpu": [
824 "arm64"
825 ],
826 "dev": true,
827 "license": "MIT",
828 "optional": true,
829 "os": [
830 "freebsd"
831 ]
832 },
833 "node_modules/@rollup/rollup-freebsd-x64": {
834 "version": "4.64.6",
835 "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.6.tgz",
836 "integrity": "sha512-XTVNaDzcFl2TeBglvxdGgsCv9JGtAGRAoJENmGBR/XvDH2mA2K0IXc2aMfP0dR8mexSXSKifJ85FixoXX1wfTw==",
837 "cpu": [
838 "x64"
839 ],
840 "dev": true,
841 "license": "MIT",
842 "optional": true,
843 "os": [
844 "freebsd"
845 ]
846 },
847 "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
848 "version": "4.64.6",
849 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.6.tgz",
850 "integrity": "sha512-qWc6qbc+25ugG9vqPR9P422KJBbVfZ05mjcMggoq8tsfWP+eRfC+/tiDdIlRF5VL2pDVZWN9zAhWsmu7R1+7Dw==",
851 "cpu": [
852 "arm"
853 ],
854 "dev": true,
855 "license": "MIT",
856 "optional": true,
857 "os": [
858 "linux"
859 ]
860 },
861 "node_modules/@rollup/rollup-linux-arm-musleabihf": {
862 "version": "4.64.6",
863 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.6.tgz",
864 "integrity": "sha512-V4Nwkp8844X/Xnww3PI1LYS0YPei8XQEVG70R+5MPZGO7AhYoun4hCN7Svs4U3wbQLZbwiz+9xRFhUZZdRl8Ww==",
865 "cpu": [
866 "arm"
867 ],
868 "dev": true,
869 "license": "MIT",
870 "optional": true,
871 "os": [
872 "linux"
873 ]
874 },
875 "node_modules/@rollup/rollup-linux-arm64-gnu": {
876 "version": "4.64.6",
877 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.6.tgz",
878 "integrity": "sha512-xb72A1aPaaIsp+a88VtRae/ovIEXislbUMyp7b9AQQU7ZkP2m/+ik6DW9TQcJyw5R8/RIailF9zExYwkjR++UA==",
879 "cpu": [
880 "arm64"
881 ],
882 "dev": true,
883 "license": "MIT",
884 "optional": true,
885 "os": [
886 "linux"
887 ]
888 },
889 "node_modules/@rollup/rollup-linux-arm64-musl": {
890 "version": "4.64.6",
891 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.6.tgz",
892 "integrity": "sha512-pbcs1BVBwC43hZkjhjlF8Rx8m5G0KnhLZs9Azy/gqccP6UsNSzJr0hKGIAVPqzAH1O/NdPxxC9GVGb4msQg/aw==",
893 "cpu": [
894 "arm64"
895 ],
896 "dev": true,
897 "license": "MIT",
898 "optional": true,
899 "os": [
900 "linux"
901 ]
902 },
903 "node_modules/@rollup/rollup-linux-loong64-gnu": {
904 "version": "4.64.6",
905 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.6.tgz",
906 "integrity": "sha512-EKOC8os6Vsg487ZLKUqzLF99Jsmnq6tu7O7mAELakNpcA+8KadktFf/JYdRuHe/DzCUXmN38pUKu4XBcKlqGbQ==",
907 "cpu": [
908 "loong64"
909 ],
910 "dev": true,
911 "license": "MIT",
912 "optional": true,
913 "os": [
914 "linux"
915 ]
916 },
917 "node_modules/@rollup/rollup-linux-loong64-musl": {
918 "version": "4.64.6",
919 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.6.tgz",
920 "integrity": "sha512-v/SQ68GnSlr/HyjB79sNXesGDwkOPu9JjbHfmWaymCiM+nZsQ9TstG1KfA4MuEvTr2d3PoY8PhFxj9bt0e32JA==",
921 "cpu": [
922 "loong64"
923 ],
924 "dev": true,
925 "license": "MIT",
926 "optional": true,
927 "os": [
928 "linux"
929 ]
930 },
931 "node_modules/@rollup/rollup-linux-ppc64-gnu": {
932 "version": "4.64.6",
933 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.6.tgz",
934 "integrity": "sha512-G3pmliMQ7r15zFFNwBlaT/xTdSLi4lfgI7CUrQueyKYheNVhrd8JrWCE6Ll8xf4AA1RZFqq+mNJYntiElsVOyA==",
935 "cpu": [
936 "ppc64"
937 ],
938 "dev": true,
939 "license": "MIT",
940 "optional": true,
941 "os": [
942 "linux"
943 ]
944 },
945 "node_modules/@rollup/rollup-linux-ppc64-musl": {
946 "version": "4.64.6",
947 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.6.tgz",
948 "integrity": "sha512-XQTB/IPoB/wG6x/wu9uomAt8YH61IAr5iZTubMiad/lu88sotq2ocz9hJd556+Jz2kIkF7ZQZIsUuWE3OWqtcA==",
949 "cpu": [
950 "ppc64"
951 ],
952 "dev": true,
953 "license": "MIT",
954 "optional": true,
955 "os": [
956 "linux"
957 ]
958 },
959 "node_modules/@rollup/rollup-linux-riscv64-gnu": {
960 "version": "4.64.6",
961 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.6.tgz",
962 "integrity": "sha512-O5mpokth6+ydMuwiGtY8fIjvOBfH7u6SzmDNmZ3k6GK5C6iEAC2q2ZN/T5L9jYILx0IcCT0KnfMDihQ5yQFSBw==",
963 "cpu": [
964 "riscv64"
965 ],
966 "dev": true,
967 "license": "MIT",
968 "optional": true,
969 "os": [
970 "linux"
971 ]
972 },
973 "node_modules/@rollup/rollup-linux-riscv64-musl": {
974 "version": "4.64.6",
975 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.6.tgz",
976 "integrity": "sha512-aIFxbAD9v3TvIaEDsKmukjcDg1JS4/tFXw8SHyQQgzOwzWCQ4cyDK7Ju1pQKqUXDFkEu/BZCFDCDATsKhQcB/Q==",
977 "cpu": [
978 "riscv64"
979 ],
980 "dev": true,
981 "license": "MIT",
982 "optional": true,
983 "os": [
984 "linux"
985 ]
986 },
987 "node_modules/@rollup/rollup-linux-s390x-gnu": {
988 "version": "4.64.6",
989 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.6.tgz",
990 "integrity": "sha512-fuNo1UwBc6BxnHDOxxguQL/InhheMN3RJcJMb0b4xP8r5Q3CNCrJbVg0eCIFuJ4e/zAfjR2gYbOfbzO/G7CIyw==",
991 "cpu": [
992 "s390x"
993 ],
994 "dev": true,
995 "license": "MIT",
996 "optional": true,
997 "os": [
998 "linux"
999 ]
1000 },
1001 "node_modules/@rollup/rollup-linux-x64-gnu": {
1002 "version": "4.64.6",
1003 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.6.tgz",
1004 "integrity": "sha512-05v6wFKDKJPZs9xlytVrrRu6IbRuoSvlH9xNwEOafXsKyjBFZPvAcZz2VIAB/M+lblYeKa9iOYC4RDVdfcAAaw==",
1005 "cpu": [
1006 "x64"
1007 ],
1008 "dev": true,
1009 "license": "MIT",
1010 "optional": true,
1011 "os": [
1012 "linux"
1013 ]
1014 },
1015 "node_modules/@rollup/rollup-linux-x64-musl": {
1016 "version": "4.64.6",
1017 "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.6.tgz",
1018 "integrity": "sha512-wJXKcdMjvkc/FaavZXNP1yW4i0pfOmhZAIWRSLG2yJ0PB0TWi7dkLErhX0u0vptDcXKKO/m1Y/YTeuyvb2MXwg==",
1019 "cpu": [
1020 "x64"
1021 ],
1022 "dev": true,
1023 "license": "MIT",
1024 "optional": true,
1025 "os": [
1026 "linux"
1027 ]
1028 },
1029 "node_modules/@rollup/rollup-openbsd-x64": {
1030 "version": "4.64.6",
1031 "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.6.tgz",
1032 "integrity": "sha512-cwg7/h0ThvJwy8CBkmACdiHAxRWpbsCmIsjOt+Zzx0hTnIcSUmKYEV03bGg+hD827OnwUsbKh1ZZDW754xWyBA==",
1033 "cpu": [
1034 "x64"
1035 ],
1036 "dev": true,
1037 "license": "MIT",
1038 "optional": true,
1039 "os": [
1040 "openbsd"
1041 ]
1042 },
1043 "node_modules/@rollup/rollup-openharmony-arm64": {
1044 "version": "4.64.6",
1045 "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.6.tgz",
1046 "integrity": "sha512-T0RkYIJbdYXJEQFw+tMBO09KDFdgmNxkHsof3wWAABrvnx15Yh8RytmrgYy9+q9cBeBNZF66MMQZC+5nzEz6vg==",
1047 "cpu": [
1048 "arm64"
1049 ],
1050 "dev": true,
1051 "license": "MIT",
1052 "optional": true,
1053 "os": [
1054 "openharmony"
1055 ]
1056 },
1057 "node_modules/@rollup/rollup-win32-arm64-msvc": {
1058 "version": "4.64.6",
1059 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.6.tgz",
1060 "integrity": "sha512-KlfpmF1AAIdAWxt8QQNClbpLFlAUfYOzqIuJ7IXEStMHpFRuH78RG6FjqPb3Rqhh0K89F5npvG+/i3Fjl6IveQ==",
1061 "cpu": [
1062 "arm64"
1063 ],
1064 "dev": true,
1065 "license": "MIT",
1066 "optional": true,
1067 "os": [
1068 "win32"
1069 ]
1070 },
1071 "node_modules/@rollup/rollup-win32-ia32-msvc": {
1072 "version": "4.64.6",
1073 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.6.tgz",
1074 "integrity": "sha512-MrTLjd7Jlt9/ZavJZYG61KQv9Iy9bzbY+yXy73Xvwoa2uP66wvDShkyBr5Chz/yrE6lbD/zHMuTmKQVNQqBApg==",
1075 "cpu": [
1076 "ia32"
1077 ],
1078 "dev": true,
1079 "license": "MIT",
1080 "optional": true,
1081 "os": [
1082 "win32"
1083 ]
1084 },
1085 "node_modules/@rollup/rollup-win32-x64-gnu": {
1086 "version": "4.64.6",
1087 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.6.tgz",
1088 "integrity": "sha512-8fWDH1CkPI8GdBKAxzHDza7UmgficsKo2+MVbvUgOGhB0629w5sHMg3Qu5y7TZsrYKHHWpz8fla4KvoT7WsO3Q==",
1089 "cpu": [
1090 "x64"
1091 ],
1092 "dev": true,
1093 "license": "MIT",
1094 "optional": true,
1095 "os": [
1096 "win32"
1097 ]
1098 },
1099 "node_modules/@rollup/rollup-win32-x64-msvc": {
1100 "version": "4.64.6",
1101 "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.6.tgz",
1102 "integrity": "sha512-9/c9PWdr5GCIHkkxiHM1HjNBQMVdftP4O8QTcoUAaRza2FSqJ4axbf8QAnBuE6BIGQDl71SaRPeDdDYid5ecTw==",
1103 "cpu": [
1104 "x64"
1105 ],
1106 "dev": true,
1107 "license": "MIT",
1108 "optional": true,
1109 "os": [
1110 "win32"
1111 ]
1112 },
1113 "node_modules/@types/babel__core": {
1114 "version": "7.20.5",
1115 "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
1116 "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
1117 "dev": true,
1118 "license": "MIT",
1119 "dependencies": {
1120 "@babel/parser": "^7.20.7",
1121 "@babel/types": "^7.20.7",
1122 "@types/babel__generator": "*",
1123 "@types/babel__template": "*",
1124 "@types/babel__traverse": "*"
1125 }
1126 },
1127 "node_modules/@types/babel__generator": {
1128 "version": "7.27.0",
1129 "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",
1130 "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",
1131 "dev": true,
1132 "license": "MIT",
1133 "dependencies": {
1134 "@babel/types": "^7.0.0"
1135 }
1136 },
1137 "node_modules/@types/babel__template": {
1138 "version": "7.4.4",
1139 "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
1140 "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
1141 "dev": true,
1142 "license": "MIT",
1143 "dependencies": {
1144 "@babel/parser": "^7.1.0",
1145 "@babel/types": "^7.0.0"
1146 }
1147 },
1148 "node_modules/@types/babel__traverse": {
1149 "version": "7.28.0",
1150 "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",
1151 "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",
1152 "dev": true,
1153 "license": "MIT",
1154 "dependencies": {
1155 "@babel/types": "^7.28.2"
1156 }
1157 },
1158 "node_modules/@types/estree": {
1159 "version": "1.0.9",
1160 "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
1161 "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
1162 "dev": true,
1163 "license": "MIT"
1164 },
1165 "node_modules/@types/prop-types": {
1166 "version": "15.7.15",
1167 "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz",
1168 "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",
1169 "dev": true,
1170 "license": "MIT"
1171 },
1172 "node_modules/@types/react": {
1173 "version": "18.3.12",
1174 "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz",
1175 "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==",
1176 "dev": true,
1177 "license": "MIT",
1178 "dependencies": {
1179 "@types/prop-types": "*",
1180 "csstype": "^3.0.2"
1181 }
1182 },
1183 "node_modules/@types/react-dom": {
1184 "version": "18.3.1",
1185 "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.1.tgz",
1186 "integrity": "sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==",
1187 "dev": true,
1188 "license": "MIT",
1189 "dependencies": {
1190 "@types/react": "*"
1191 }
1192 },
1193 "node_modules/@vitejs/plugin-react": {
1194 "version": "4.3.4",
1195 "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.4.tgz",
1196 "integrity": "sha512-SCCPBJtYLdE8PX/7ZQAs1QAZ8Jqwih+0VBLum1EGqmCCQal+MIUqLCzj3ZUy8ufbC0cAM4LRlSTm7IQJwWT4ug==",
1197 "dev": true,
1198 "license": "MIT",
1199 "dependencies": {
1200 "@babel/core": "^7.26.0",
1201 "@babel/plugin-transform-react-jsx-self": "^7.25.9",
1202 "@babel/plugin-transform-react-jsx-source": "^7.25.9",
1203 "@types/babel__core": "^7.20.5",
1204 "react-refresh": "^0.14.2"
1205 },
1206 "engines": {
1207 "node": "^14.18.0 || >=16.0.0"
1208 },
1209 "peerDependencies": {
1210 "vite": "^4.2.0 || ^5.0.0 || ^6.0.0"
1211 }
1212 },
1213 "node_modules/baseline-browser-mapping": {
1214 "version": "2.11.28",
1215 "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz",
1216 "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==",
1217 "dev": true,
1218 "license": "Apache-2.0",
1219 "bin": {
1220 "baseline-browser-mapping": "dist/cli.cjs"
1221 },
1222 "engines": {
1223 "node": ">=6.0.0"
1224 }
1225 },
1226 "node_modules/browserslist": {
1227 "version": "4.29.3",
1228 "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz",
1229 "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==",
1230 "dev": true,
1231 "funding": [
1232 {
1233 "type": "opencollective",
1234 "url": "https://opencollective.com/browserslist"
1235 },
1236 {
1237 "type": "tidelift",
1238 "url": "https://tidelift.com/funding/github/npm/browserslist"
1239 },
1240 {
1241 "type": "github",
1242 "url": "https://github.com/sponsors/ai"
1243 }
1244 ],
1245 "license": "MIT",
1246 "peer": true,
1247 "dependencies": {
1248 "baseline-browser-mapping": "^2.11.26",
1249 "caniuse-lite": "^1.0.30001813",
1250 "electron-to-chromium": "^1.5.439",
1251 "node-releases": "^2.0.57",
1252 "update-browserslist-db": "^1.3.3"
1253 },
1254 "bin": {
1255 "browserslist": "cli.js"
1256 },
1257 "engines": {
1258 "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
1259 }
1260 },
1261 "node_modules/caniuse-lite": {
1262 "version": "1.0.30001816",
1263 "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz",
1264 "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==",
1265 "dev": true,
1266 "funding": [
1267 {
1268 "type": "opencollective",
1269 "url": "https://opencollective.com/browserslist"
1270 },
1271 {
1272 "type": "tidelift",
1273 "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
1274 },
1275 {
1276 "type": "github",
1277 "url": "https://github.com/sponsors/ai"
1278 }
1279 ],
1280 "license": "CC-BY-4.0"
1281 },
1282 "node_modules/convert-source-map": {
1283 "version": "2.0.0",
1284 "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
1285 "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
1286 "dev": true,
1287 "license": "MIT"
1288 },
1289 "node_modules/csstype": {
1290 "version": "3.2.3",
1291 "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
1292 "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
1293 "dev": true,
1294 "license": "MIT"
1295 },
1296 "node_modules/debug": {
1297 "version": "4.4.3",
1298 "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
1299 "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
1300 "dev": true,
1301 "license": "MIT",
1302 "dependencies": {
1303 "ms": "^2.1.3"
1304 },
1305 "engines": {
1306 "node": ">=6.0"
1307 },
1308 "peerDependenciesMeta": {
1309 "supports-color": {
1310 "optional": true
1311 }
1312 }
1313 },
1314 "node_modules/electron-to-chromium": {
1315 "version": "1.5.454",
1316 "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.454.tgz",
1317 "integrity": "sha512-NqD5GhkXnxJpDQVCmmpc546qjH6kei2VI9m45CTF+sQU7bcS7YeVt7ba0cnjueMH1AXGRu/driZUP9iYVSv7vg==",
1318 "dev": true,
1319 "license": "ISC"
1320 },
1321 "node_modules/esbuild": {
1322 "version": "0.21.5",
1323 "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
1324 "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
1325 "dev": true,
1326 "hasInstallScript": true,
1327 "license": "MIT",
1328 "bin": {
1329 "esbuild": "bin/esbuild"
1330 },
1331 "engines": {
1332 "node": ">=12"
1333 },
1334 "optionalDependencies": {
1335 "@esbuild/aix-ppc64": "0.21.5",
1336 "@esbuild/android-arm": "0.21.5",
1337 "@esbuild/android-arm64": "0.21.5",
1338 "@esbuild/android-x64": "0.21.5",
1339 "@esbuild/darwin-arm64": "0.21.5",
1340 "@esbuild/darwin-x64": "0.21.5",
1341 "@esbuild/freebsd-arm64": "0.21.5",
1342 "@esbuild/freebsd-x64": "0.21.5",
1343 "@esbuild/linux-arm": "0.21.5",
1344 "@esbuild/linux-arm64": "0.21.5",
1345 "@esbuild/linux-ia32": "0.21.5",
1346 "@esbuild/linux-loong64": "0.21.5",
1347 "@esbuild/linux-mips64el": "0.21.5",
1348 "@esbuild/linux-ppc64": "0.21.5",
1349 "@esbuild/linux-riscv64": "0.21.5",
1350 "@esbuild/linux-s390x": "0.21.5",
1351 "@esbuild/linux-x64": "0.21.5",
1352 "@esbuild/netbsd-x64": "0.21.5",
1353 "@esbuild/openbsd-x64": "0.21.5",
1354 "@esbuild/sunos-x64": "0.21.5",
1355 "@esbuild/win32-arm64": "0.21.5",
1356 "@esbuild/win32-ia32": "0.21.5",
1357 "@esbuild/win32-x64": "0.21.5"
1358 }
1359 },
1360 "node_modules/escalade": {
1361 "version": "3.2.0",
1362 "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
1363 "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
1364 "dev": true,
1365 "license": "MIT",
1366 "engines": {
1367 "node": ">=6"
1368 }
1369 },
1370 "node_modules/fsevents": {
1371 "version": "2.3.3",
1372 "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
1373 "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
1374 "dev": true,
1375 "hasInstallScript": true,
1376 "license": "MIT",
1377 "optional": true,
1378 "os": [
1379 "darwin"
1380 ],
1381 "engines": {
1382 "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
1383 }
1384 },
1385 "node_modules/gensync": {
1386 "version": "1.0.0-beta.2",
1387 "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
1388 "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
1389 "dev": true,
1390 "license": "MIT",
1391 "engines": {
1392 "node": ">=6.9.0"
1393 }
1394 },
1395 "node_modules/js-tokens": {
1396 "version": "4.0.0",
1397 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
1398 "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
1399 "license": "MIT"
1400 },
1401 "node_modules/jsesc": {
1402 "version": "3.1.0",
1403 "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
1404 "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
1405 "dev": true,
1406 "license": "MIT",
1407 "bin": {
1408 "jsesc": "bin/jsesc"
1409 },
1410 "engines": {
1411 "node": ">=6"
1412 }
1413 },
1414 "node_modules/json5": {
1415 "version": "2.2.3",
1416 "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
1417 "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
1418 "dev": true,
1419 "license": "MIT",
1420 "bin": {
1421 "json5": "lib/cli.js"
1422 },
1423 "engines": {
1424 "node": ">=6"
1425 }
1426 },
1427 "node_modules/loose-envify": {
1428 "version": "1.4.0",
1429 "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
1430 "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
1431 "license": "MIT",
1432 "dependencies": {
1433 "js-tokens": "^3.0.0 || ^4.0.0"
1434 },
1435 "bin": {
1436 "loose-envify": "cli.js"
1437 }
1438 },
1439 "node_modules/lru-cache": {
1440 "version": "5.1.1",
1441 "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
1442 "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
1443 "dev": true,
1444 "license": "ISC",
1445 "dependencies": {
1446 "yallist": "^3.0.2"
1447 }
1448 },
1449 "node_modules/ms": {
1450 "version": "2.1.3",
1451 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
1452 "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
1453 "dev": true,
1454 "license": "MIT"
1455 },
1456 "node_modules/nanoid": {
1457 "version": "3.3.20",
1458 "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
1459 "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
1460 "dev": true,
1461 "funding": [
1462 {
1463 "type": "github",
1464 "url": "https://github.com/sponsors/ai"
1465 }
1466 ],
1467 "license": "MIT",
1468 "bin": {
1469 "nanoid": "bin/nanoid.cjs"
1470 },
1471 "engines": {
1472 "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
1473 }
1474 },
1475 "node_modules/node-releases": {
1476 "version": "2.0.58",
1477 "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.58.tgz",
1478 "integrity": "sha512-BdiKAgbfRlvfMq/XzO/AF9NPmaA8a+YpLAyAFTVFBj3gARrAIfWvNq7Q7NE4se3KgFu0KkrvQMxTS0XVnsGzHg==",
1479 "dev": true,
1480 "license": "MIT",
1481 "engines": {
1482 "node": ">=18"
1483 }
1484 },
1485 "node_modules/picocolors": {
1486 "version": "1.1.1",
1487 "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
1488 "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
1489 "dev": true,
1490 "license": "ISC"
1491 },
1492 "node_modules/postcss": {
1493 "version": "8.5.30",
1494 "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz",
1495 "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==",
1496 "dev": true,
1497 "funding": [
1498 {
1499 "type": "opencollective",
1500 "url": "https://opencollective.com/postcss/"
1501 },
1502 {
1503 "type": "tidelift",
1504 "url": "https://tidelift.com/funding/github/npm/postcss"
1505 },
1506 {
1507 "type": "github",
1508 "url": "https://github.com/sponsors/ai"
1509 }
1510 ],
1511 "license": "MIT",
1512 "dependencies": {
1513 "nanoid": "^3.3.20",
1514 "picocolors": "^1.1.1",
1515 "source-map-js": "^1.2.2"
1516 },
1517 "engines": {
1518 "node": "^10 || ^12 || >=14"
1519 }
1520 },
1521 "node_modules/react": {
1522 "version": "18.3.1",
1523 "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
1524 "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
1525 "license": "MIT",
1526 "peer": true,
1527 "dependencies": {
1528 "loose-envify": "^1.1.0"
1529 },
1530 "engines": {
1531 "node": ">=0.10.0"
1532 }
1533 },
1534 "node_modules/react-dom": {
1535 "version": "18.3.1",
1536 "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
1537 "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
1538 "license": "MIT",
1539 "dependencies": {
1540 "loose-envify": "^1.1.0",
1541 "scheduler": "^0.23.2"
1542 },
1543 "peerDependencies": {
1544 "react": "^18.3.1"
1545 }
1546 },
1547 "node_modules/react-refresh": {
1548 "version": "0.14.2",
1549 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz",
1550 "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==",
1551 "dev": true,
1552 "license": "MIT",
1553 "engines": {
1554 "node": ">=0.10.0"
1555 }
1556 },
1557 "node_modules/rollup": {
1558 "version": "4.64.6",
1559 "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.6.tgz",
1560 "integrity": "sha512-fX1Vy+UNKdXn+xKDnu/HBXbHVr1AY8cSdQj9BU4kLv5aFCMqGpvrVbyUMmjN3DdzWhSAuTbcX8PCNEVaumthYA==",
1561 "dev": true,
1562 "license": "MIT",
1563 "dependencies": {
1564 "@types/estree": "1.0.9"
1565 },
1566 "bin": {
1567 "rollup": "dist/bin/rollup"
1568 },
1569 "engines": {
1570 "node": ">=18.0.0",
1571 "npm": ">=8.0.0"
1572 },
1573 "optionalDependencies": {
1574 "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
1575 "@rollup/rollup-android-arm-eabi": "4.64.6",
1576 "@rollup/rollup-android-arm64": "4.64.6",
1577 "@rollup/rollup-darwin-arm64": "4.64.6",
1578 "@rollup/rollup-darwin-x64": "4.64.6",
1579 "@rollup/rollup-freebsd-arm64": "4.64.6",
1580 "@rollup/rollup-freebsd-x64": "4.64.6",
1581 "@rollup/rollup-linux-arm-gnueabihf": "4.64.6",
1582 "@rollup/rollup-linux-arm-musleabihf": "4.64.6",
1583 "@rollup/rollup-linux-arm64-gnu": "4.64.6",
1584 "@rollup/rollup-linux-arm64-musl": "4.64.6",
1585 "@rollup/rollup-linux-loong64-gnu": "4.64.6",
1586 "@rollup/rollup-linux-loong64-musl": "4.64.6",
1587 "@rollup/rollup-linux-ppc64-gnu": "4.64.6",
1588 "@rollup/rollup-linux-ppc64-musl": "4.64.6",
1589 "@rollup/rollup-linux-riscv64-gnu": "4.64.6",
1590 "@rollup/rollup-linux-riscv64-musl": "4.64.6",
1591 "@rollup/rollup-linux-s390x-gnu": "4.64.6",
1592 "@rollup/rollup-linux-x64-gnu": "4.64.6",
1593 "@rollup/rollup-linux-x64-musl": "4.64.6",
1594 "@rollup/rollup-openbsd-x64": "4.64.6",
1595 "@rollup/rollup-openharmony-arm64": "4.64.6",
1596 "@rollup/rollup-win32-arm64-msvc": "4.64.6",
1597 "@rollup/rollup-win32-ia32-msvc": "4.64.6",
1598 "@rollup/rollup-win32-x64-gnu": "4.64.6",
1599 "@rollup/rollup-win32-x64-msvc": "4.64.6",
1600 "fsevents": "~2.3.2"
1601 }
1602 },
1603 "node_modules/scheduler": {
1604 "version": "0.23.2",
1605 "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
1606 "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
1607 "license": "MIT",
1608 "dependencies": {
1609 "loose-envify": "^1.1.0"
1610 }
1611 },
1612 "node_modules/semver": {
1613 "version": "6.3.1",
1614 "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
1615 "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
1616 "dev": true,
1617 "license": "ISC",
1618 "bin": {
1619 "semver": "bin/semver.js"
1620 }
1621 },
1622 "node_modules/source-map-js": {
1623 "version": "1.2.2",
1624 "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
1625 "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
1626 "dev": true,
1627 "license": "BSD-3-Clause",
1628 "engines": {
1629 "node": ">=0.10.0"
1630 }
1631 },
1632 "node_modules/typescript": {
1633 "version": "5.6.3",
1634 "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
1635 "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
1636 "dev": true,
1637 "license": "Apache-2.0",
1638 "bin": {
1639 "tsc": "bin/tsc",
1640 "tsserver": "bin/tsserver"
1641 },
1642 "engines": {
1643 "node": ">=14.17"
1644 }
1645 },
1646 "node_modules/update-browserslist-db": {
1647 "version": "1.3.4",
1648 "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz",
1649 "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==",
1650 "dev": true,
1651 "funding": [
1652 {
1653 "type": "opencollective",
1654 "url": "https://opencollective.com/browserslist"
1655 },
1656 {
1657 "type": "tidelift",
1658 "url": "https://tidelift.com/funding/github/npm/browserslist"
1659 },
1660 {
1661 "type": "github",
1662 "url": "https://github.com/sponsors/ai"
1663 }
1664 ],
1665 "license": "MIT",
1666 "dependencies": {
1667 "escalade": "^3.2.0",
1668 "picocolors": "^1.1.1"
1669 },
1670 "bin": {
1671 "update-browserslist-db": "cli.js"
1672 },
1673 "peerDependencies": {
1674 "browserslist": ">= 4.21.0"
1675 }
1676 },
1677 "node_modules/vite": {
1678 "version": "5.4.11",
1679 "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz",
1680 "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==",
1681 "dev": true,
1682 "license": "MIT",
1683 "peer": true,
1684 "dependencies": {
1685 "esbuild": "^0.21.3",
1686 "postcss": "^8.4.43",
1687 "rollup": "^4.20.0"
1688 },
1689 "bin": {
1690 "vite": "bin/vite.js"
1691 },
1692 "engines": {
1693 "node": "^18.0.0 || >=20.0.0"
1694 },
1695 "funding": {
1696 "url": "https://github.com/vitejs/vite?sponsor=1"
1697 },
1698 "optionalDependencies": {
1699 "fsevents": "~2.3.3"
1700 },
1701 "peerDependencies": {
1702 "@types/node": "^18.0.0 || >=20.0.0",
1703 "less": "*",
1704 "lightningcss": "^1.21.0",
1705 "sass": "*",
1706 "sass-embedded": "*",
1707 "stylus": "*",
1708 "sugarss": "*",
1709 "terser": "^5.4.0"
1710 },
1711 "peerDependenciesMeta": {
1712 "@types/node": {
1713 "optional": true
1714 },
1715 "less": {
1716 "optional": true
1717 },
1718 "lightningcss": {
1719 "optional": true
1720 },
1721 "sass": {
1722 "optional": true
1723 },
1724 "sass-embedded": {
1725 "optional": true
1726 },
1727 "stylus": {
1728 "optional": true
1729 },
1730 "sugarss": {
1731 "optional": true
1732 },
1733 "terser": {
1734 "optional": true
1735 }
1736 }
1737 },
1738 "node_modules/yallist": {
1739 "version": "3.1.1",
1740 "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
1741 "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
1742 "dev": true,
1743 "license": "ISC"
1744 }
1745 }
1746}
diff --git a/ui-web/package.json b/ui-web/package.json
new file mode 100644
index 0000000..618734d
--- /dev/null
+++ b/ui-web/package.json
@@ -0,0 +1,22 @@
1{
2 "name": "guess-market-web",
3 "private": true,
4 "version": "1.0.0",
5 "type": "module",
6 "scripts": {
7 "predev": "node -e \"const f='../ui-fx/src/main/resources/market/guess/ui/desktop/fonts', fs=require('fs'); fs.existsSync(f) && fs.cpSync(f, 'public/fonts', {recursive: true})\"",
8 "dev": "vite",
9 "check": "tsc --noEmit"
10 },
11 "dependencies": {
12 "react": "18.3.1",
13 "react-dom": "18.3.1"
14 },
15 "devDependencies": {
16 "@types/react": "18.3.12",
17 "@types/react-dom": "18.3.1",
18 "@vitejs/plugin-react": "4.3.4",
19 "typescript": "5.6.3",
20 "vite": "5.4.11"
21 }
22}
diff --git a/ui-web/run-web.bat b/ui-web/run-web.bat
new file mode 100644
index 0000000..c5f0658
--- /dev/null
+++ b/ui-web/run-web.bat
@@ -0,0 +1,10 @@
1@echo off
2cd /d "%~dp0"
3call npm install
4if errorlevel 1 (
5 echo npm install failed. Is Node.js installed and is there an internet connection?
6 pause
7 exit /b 1
8)
9call npm run dev
10pause
diff --git a/ui-web/src/App.tsx b/ui-web/src/App.tsx
new file mode 100644
index 0000000..204beae
--- /dev/null
+++ b/ui-web/src/App.tsx
@@ -0,0 +1,502 @@
1import { FormEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
2import {
3 api,
4 ApiError,
5 ChatMessage,
6 CHEVRON,
7 EventDetail,
8 eventPath,
9 GLYPH,
10 Ledger,
11 MarketData,
12 money,
13 num,
14 optionTitle,
15 same,
16 Sync,
17} from './api';
18import { Events } from './Events';
19import { MarketChart, Pinwheel } from './graphics';
20import { Users } from './Users';
21
22export type Act = (work: () => Promise<unknown>, done: string) => Promise<void>;
23
24const SKINS = [
25 ['rose-pine-dawn', 'Rosé Pine Dawn'],
26 ['catppuccin', 'Catppuccin'],
27 ['gruvbox', 'Gruvbox'],
28];
29
30function useSetting(key: string, initial: string): [string, (value: string) => void] {
31 const [value, setValue] = useState(() => {
32 try {
33 return localStorage.getItem(key) ?? initial;
34 } catch {
35 return initial;
36 }
37 });
38 const set = (next: string) => {
39 setValue(next);
40 try {
41 localStorage.setItem(key, next);
42 } catch {
43 }
44 };
45 return [value, set];
46}
47
48export function App() {
49 const [user, setUser] = useState<string | null | undefined>(undefined);
50 const [notice, setNotice] = useState<string | null>(null);
51 const [skin, setSkin] = useSetting('gm-skin', SKINS[0][0]);
52 const [animations, setAnimations] = useSetting('gm-animations', 'on');
53
54 useEffect(() => {
55 document.documentElement.dataset.skin = skin;
56 document.documentElement.classList.toggle('anim', animations === 'on');
57 }, [skin, animations]);
58
59 useEffect(() => {
60 api<Ledger>('/user/account')
61 .then((account) => setUser(account.owner))
62 .catch(() => setUser(null));
63 }, []);
64
65 const leave = useCallback((why?: string) => {
66 setNotice(why ?? null);
67 setUser(null);
68 }, []);
69
70 const controls = (
71 <>
72 <button
73 className={animations === 'on' ? 'btn icon on' : 'btn icon'}
74 title="Toggle animations"
75 aria-label="Toggle animations"
76 aria-pressed={animations === 'on'}
77 onClick={() => setAnimations(animations === 'on' ? 'off' : 'on')}
78 >
79 <Pinwheel />
80 </button>
81 <select className="select" aria-label="Skin" value={skin} onChange={(e) => setSkin(e.target.value)}>
82 {SKINS.map(([id, name]) => (
83 <option key={id} value={id}>
84 {name}
85 </option>
86 ))}
87 </select>
88 </>
89 );
90
91 if (user === undefined) return null;
92 if (user === null) return <Login notice={notice} onLoggedIn={setUser} />;
93 return <Market user={user} onLoggedOut={leave} controls={controls} />;
94}
95
96function Login({ notice, onLoggedIn }: { notice: string | null; onLoggedIn: (user: string) => void }) {
97 const [name, setName] = useState('');
98 const [error, setError] = useState(notice);
99 const [busy, setBusy] = useState(false);
100
101 async function submit(e: FormEvent) {
102 e.preventDefault();
103 setBusy(true);
104 setError(null);
105 try {
106 const res = await api<{ username: string }>('/login', { username: name });
107 onLoggedIn(res.username);
108 } catch (err) {
109 setError((err as Error).message);
110 setBusy(false);
111 }
112 }
113
114 return (
115 <main className="login">
116 <form className="card" onSubmit={submit}>
117 <h1 className="xl bold">Guess Market</h1>
118 <p className="base ink2">Sign in to a market server</p>
119 <label className="base ink2" htmlFor="username" style={{ marginTop: 8 }}>
120 User name
121 </label>
122 <input id="username" className="field" autoFocus value={name} onChange={(e) => setName(e.target.value)} />
123 {error && <p className="base bold no">{error}</p>}
124 <button className="btn primary" style={{ marginTop: 8 }} disabled={busy || name.trim() === ''}>
125 Log in
126 </button>
127 </form>
128 </main>
129 );
130}
131
132function Market(props: { user: string; onLoggedOut: (why?: string) => void; controls: ReactNode }) {
133 const { user, onLoggedOut } = props;
134 const [data, setData] = useState<MarketData | null>(null);
135 const [tab, setTab] = useState<'events' | 'users'>('events');
136 const [selectedKey, setSelectedKey] = useState<string | null>(null);
137 const [dialog, setDialog] = useState<'deposit' | 'resolve' | null>(null);
138 const [offline, setOffline] = useState(false);
139 const [toast, setToast] = useState<string | null>(null);
140 const refresh = useRef<() => Promise<void>>(async () => {});
141
142 useEffect(() => {
143 let stopped = false;
144 let version = -1;
145 let timer: number | undefined;
146
147 async function pull() {
148 const sync = await api<Sync>(`/sync?since=${version}`);
149 if (!sync.changed) return;
150 const details = await Promise.all(sync.events.map((e) => api<EventDetail>(eventPath(e.name))));
151 if (stopped || sync.version < version) return;
152 version = sync.version;
153 setData({
154 events: sync.events,
155 details: Object.fromEntries(details.map((d) => [d.summary.key, d])),
156 users: sync.users,
157 account: sync.account,
158 });
159 }
160
161 async function tick() {
162 try {
163 await pull();
164 setOffline(false);
165 } catch (err) {
166 if (err instanceof ApiError && err.status === 401) {
167 stopped = true;
168 onLoggedOut('Your session ended. Please log in again.');
169 } else {
170 setOffline(true);
171 }
172 }
173 }
174
175 async function loop() {
176 await tick();
177 if (!stopped) timer = window.setTimeout(loop, 1000);
178 }
179
180 refresh.current = tick;
181 loop();
182 return () => {
183 stopped = true;
184 window.clearTimeout(timer);
185 };
186 }, [onLoggedOut]);
187
188 useEffect(() => {
189 if (!toast) return;
190 const timer = window.setTimeout(() => setToast(null), 2500);
191 return () => window.clearTimeout(timer);
192 }, [toast]);
193
194 const act: Act = useCallback(async (work, done) => {
195 try {
196 await work();
197 setToast(done);
198 } catch (err) {
199 setToast((err as Error).message);
200 }
201 await refresh.current();
202 }, []);
203
204 async function logout() {
205 try {
206 await api('/logout', {});
207 } catch {
208 }
209 onLoggedOut();
210 }
211
212 const selected = data?.events.find((e) => e.key === selectedKey) ?? data?.events[0];
213 const detail = selected && data?.details[selected.key];
214
215 return (
216 <div className="app">
217 <div className="windowbar">Guess Market</div>
218
219 <div className="toolbar">
220 <button className="btn primary" onClick={logout}>
221 Log out
222 </button>
223 <div className="path card2 grow">
224 <span className="ink2">{CHEVRON}</span>
225 <span className="ellipsis">{window.location.host}/guess-market</span>
226 </div>
227 {props.controls}
228 </div>
229
230 {offline && <div className="banner">Cannot reach the server. Retrying every second…</div>}
231
232 {data === null || data.events.length === 0 ? (
233 <div className="empty">
234 <MarketChart />
235 <p className="xl bold">{data === null ? 'Loading the market…' : 'No events yet'}</p>
236 {data !== null && (
237 <p className="ink2" style={{ maxWidth: 420 }}>
238 Events are uploaded from the desktop client. They appear here by themselves.
239 </p>
240 )}
241 </div>
242 ) : (
243 <>
244 <div className="tabs">
245 <button className={tab === 'events' ? 'tab on' : 'tab'} onClick={() => setTab('events')}>
246 Events
247 </button>
248 <button className={tab === 'users' ? 'tab on' : 'tab'} onClick={() => setTab('users')}>
249 Users
250 </button>
251 <span className="grow" />
252 <span className="tabinfo">
253 <span style={{ paddingRight: 12 }}>acting as {user}</span>
254 ACCOUNT BALANCE
255 <span className={num(data.account.balance) < 0 ? 'lg bold no' : 'lg bold accent'}>
256 {money(data.account.balance)}
257 </span>
258 </span>
259 </div>
260
261 {/* key: a new element per tab, so the fade-in runs on every switch */}
262 <div className="content fade" key={tab}>
263 {tab === 'events' ? (
264 <Events
265 data={data}
266 user={user}
267 selected={selected}
268 onSelect={setSelectedKey}
269 act={act}
270 onTrade={() => setTab('users')}
271 onResolve={() => setDialog('resolve')}
272 />
273 ) : (
274 <Users
275 data={data}
276 user={user}
277 selected={selected}
278 onSelect={setSelectedKey}
279 act={act}
280 onDeposit={() => setDialog('deposit')}
281 />
282 )}
283 </div>
284 </>
285 )}
286
287 <div className="statusbar">
288 <span className="grow">
289 {data === null
290 ? ` IDLE ${CHEVRON}`
291 : ` ${GLYPH.file} ${user} ${CHEVRON} ${GLYPH.bolt} ${data.events.length} events ${CHEVRON} ${GLYPH.users} ${data.users.length} users`}
292 </span>
293 <Chat user={user} onError={setToast} />
294 </div>
295
296 {dialog === 'deposit' && (
297 <DepositDialog
298 onCancel={() => setDialog(null)}
299 onConfirm={(amount) => {
300 setDialog(null);
301 act(() => api('/user/deposit', { amount }), `Deposited ${money(amount)}`);
302 }}
303 />
304 )}
305 {dialog === 'resolve' && detail && (
306 <ResolveDialog
307 detail={detail}
308 onCancel={() => setDialog(null)}
309 onConfirm={(i) => {
310 setDialog(null);
311 act(
312 () => api(eventPath(detail.summary.name) + '/resolve', { option: detail.state.markets[i].key }),
313 `Event resolved as ${detail.summary.optionNames[i]}`,
314 );
315 }}
316 />
317 )}
318
319 {toast && (
320 <div className="toast" role="status">
321 {toast}
322 </div>
323 )}
324 </div>
325 );
326}
327
328function Chat({ user, onError }: { user: string; onError: (message: string) => void }) {
329 const [messages, setMessages] = useState<ChatMessage[]>([]);
330 const [open, setOpen] = useState(false);
331 const [unread, setUnread] = useState(0);
332 const [text, setText] = useState('');
333 const openRef = useRef(open);
334 openRef.current = open;
335 const list = useRef<HTMLDivElement>(null);
336
337 useEffect(() => {
338 let stopped = false;
339 let last = 0;
340 let timer: number | undefined;
341 async function loop() {
342 try {
343 const said = await api<ChatMessage[]>(`/chat?since=${last}`);
344 if (!stopped && said.length > 0) {
345 last = said[said.length - 1].id;
346 setMessages((m) => [...m, ...said]);
347 if (!openRef.current) setUnread((n) => n + said.length);
348 }
349 } catch {
350 }
351 if (!stopped) timer = window.setTimeout(loop, 1000);
352 }
353 loop();
354 return () => {
355 stopped = true;
356 window.clearTimeout(timer);
357 };
358 }, []);
359
360 useEffect(() => {
361 if (list.current) list.current.scrollTop = list.current.scrollHeight;
362 }, [messages, open]);
363
364 async function send(e: FormEvent) {
365 e.preventDefault();
366 const line = text.trim();
367 if (line === '') return;
368 setText('');
369 try {
370 await api('/chat', { text: line.slice(0, 500) });
371 } catch (err) {
372 onError((err as Error).message);
373 }
374 }
375
376 return (
377 <>
378 <button
379 className={open ? 'chatbtn on' : 'chatbtn'}
380 title="Chat"
381 aria-label="Chat"
382 aria-expanded={open}
383 onClick={() => {
384 setOpen(!open);
385 setUnread(0);
386 }}
387 >
388 {GLYPH.chat}
389 {unread > 0 && ` ${unread}`}
390 </button>
391 {open && (
392 <div className="card chat">
393 <p className="base bold">Chat</p>
394 <div className="chatlist" ref={list}>
395 {messages.map((m) => (
396 <div key={m.id}>
397 <div className={same(m.sender, user) ? 'xs bold accent' : 'xs bold ink2'}>
398 {m.sender} {m.at}
399 </div>
400 <div className="base">{m.text}</div>
401 </div>
402 ))}
403 </div>
404 <form className="row" onSubmit={send}>
405 <input
406 className="field grow"
407 placeholder="Message everyone"
408 autoFocus
409 value={text}
410 onChange={(e) => setText(e.target.value)}
411 />
412 <button className="btn primary" disabled={text.trim() === ''}>
413 Send
414 </button>
415 </form>
416 </div>
417 )}
418 </>
419 );
420}
421
422function DepositDialog(props: { onCancel: () => void; onConfirm: (amount: string) => void }) {
423 const [amount, setAmount] = useState('');
424 const valid = num(amount) > 0;
425 return (
426 <div className="scrim">
427 <form
428 className="card dialog"
429 onSubmit={(e) => {
430 e.preventDefault();
431 if (valid) props.onConfirm(amount.trim());
432 }}
433 >
434 <header>Deposit funds</header>
435 <div>
436 <label className="base ink2" htmlFor="amount">
437 Amount to add to your account
438 </label>
439 <input
440 id="amount"
441 className={amount !== '' && !valid ? 'field bad' : 'field'}
442 style={{ width: '100%' }}
443 autoFocus
444 placeholder="100.00"
445 inputMode="decimal"
446 value={amount}
447 onChange={(e) => setAmount(e.target.value)}
448 />
449 </div>
450 <footer>
451 <button type="button" className="btn" onClick={props.onCancel}>
452 Cancel
453 </button>
454 <button className="btn primary" disabled={!valid}>
455 Deposit
456 </button>
457 </footer>
458 </form>
459 </div>
460 );
461}
462
463function ResolveDialog(props: { detail: EventDetail; onCancel: () => void; onConfirm: (option: number) => void }) {
464 const [option, setOption] = useState<number | null>(null);
465 const e = props.detail.summary;
466 return (
467 <div className="scrim">
468 <div className="card dialog" style={{ width: 470 }}>
469 <header>Close &amp; resolve event</header>
470 <div>
471 <p className="base ink2">
472 Pick the option the event ended with. The contract account is emptied to holders of the winning option; a
473 close-time fee is moved to the market maker. This cannot be undone.
474 </p>
475 <div className="row">
476 {[0, 1].map((i) => (
477 <button
478 key={i}
479 className={`resolveopt ${i === 0 ? 'yes' : 'no'}${option === i ? ' on' : ''}`}
480 onClick={() => setOption(i)}
481 >
482 {optionTitle(e, i)}
483 </button>
484 ))}
485 </div>
486 </div>
487 <footer>
488 <button className="btn" onClick={props.onCancel}>
489 Cancel
490 </button>
491 <button
492 className="btn destructive"
493 disabled={option === null}
494 onClick={() => option !== null && props.onConfirm(option)}
495 >
496 Resolve as {option === null ? '…' : option === 0 ? 'YES' : 'NO'}
497 </button>
498 </footer>
499 </div>
500 </div>
501 );
502}
diff --git a/ui-web/src/Chart.tsx b/ui-web/src/Chart.tsx
new file mode 100644
index 0000000..4caf3a5
--- /dev/null
+++ b/ui-web/src/Chart.tsx
@@ -0,0 +1,94 @@
1import { EventDetail, Ledger, num } from './api';
2
3export type Point = [number, number];
4
5const seconds = (at: string) => {
6 const t = Date.parse(at.replace(' ', 'T'));
7 return Number.isNaN(t) ? 0 : t / 1000;
8};
9const now = () => Date.now() / 1000;
10const clock = (t: number) => new Date(t * 1000).toTimeString().slice(0, 8);
11
12export function priceSeries(detail: EventDetail): Point[] {
13 const first = detail.summary.optionNames[0];
14 const current = num(detail.state.markets[0]?.price) || 0.5;
15 const trades = [...detail.history].reverse();
16 if (trades.length === 0) {
17 return [
18 [now() - 60, current],
19 [now(), current],
20 ];
21 }
22 const start = seconds(trades[0].at) || now();
23 const points: Point[] = [[start - 60, 0.5]];
24 for (const t of trades) {
25 const quantity = num(t.quantity);
26 const unit = quantity > 0 ? num(t.pricePaid) / quantity : current;
27 const price = t.optionName === first ? unit : 1 - unit;
28 points.push([seconds(t.at) || start, Math.max(0, Math.min(1, price))]);
29 }
30 return points;
31}
32
33export function balanceSeries(ledger: Ledger): Point[] {
34 const rows = ledger.entries;
35 const balance = num(ledger.balance);
36 if (rows.length === 0) {
37 return [
38 [now() - 60, balance],
39 [now(), balance],
40 ];
41 }
42 const start = seconds(rows[0].at) || now();
43 const points: Point[] = [[start - 60, Math.max(0, num(rows[0].balanceAfter) - num(rows[0].amount))]];
44 for (const row of rows) {
45 points.push([seconds(row.at) || start, num(row.balanceAfter)]);
46 }
47 return points;
48}
49
50const TICKS = [0, 1, 2, 3, 4];
51
52export function LineChart(props: {
53 series: { points: Point[]; tone: 'accent' | 'yes' | 'no' }[];
54 range?: [number, number];
55 height?: number;
56}) {
57 const all = props.series.flatMap((s) => s.points);
58 const t0 = Math.min(...all.map((p) => p[0]));
59 const t1 = Math.max(...all.map((p) => p[0]), t0 + 60);
60 let [lo, hi] = props.range ?? [Math.min(...all.map((p) => p[1]), 0), Math.max(...all.map((p) => p[1]))];
61 if (hi <= lo) hi = lo + 1;
62 if (!props.range) hi = lo + Math.ceil(((hi - lo) * 1.1) / 4) * 4; // headroom, in four whole steps
63
64 const x = (t: number) => ((t - t0) / (t1 - t0)) * 100;
65 const y = (v: number) => 100 - ((v - lo) / (hi - lo)) * 100;
66 const label = (v: number) => (hi - lo <= 1 ? v.toFixed(2).replace(/\.?0+$/, '') || '0' : Math.round(v).toLocaleString());
67
68 return (
69 <div className="chart card2">
70 <div className="yaxis">
71 {TICKS.map((i) => (
72 <span key={i}>{label(hi - ((hi - lo) * i) / 4)}</span>
73 ))}
74 </div>
75 <svg viewBox="0 0 100 100" preserveAspectRatio="none" style={{ height: props.height ?? 150 }}>
76 {TICKS.map((i) => (
77 <line key={i} className="grid" x1="0" x2="100" y1={i * 25} y2={i * 25} />
78 ))}
79 {props.series.map((s, i) => (
80 <path
81 key={i}
82 className={'stroke-' + s.tone}
83 d={s.points.map((p, j) => `${j ? 'L' : 'M'}${x(p[0]).toFixed(2)} ${y(p[1]).toFixed(2)}`).join(' ')}
84 />
85 ))}
86 </svg>
87 <div className="xaxis">
88 {TICKS.map((i) => (
89 <span key={i}>{clock(t0 + ((t1 - t0) * i) / 4)}</span>
90 ))}
91 </div>
92 </div>
93 );
94}
diff --git a/ui-web/src/Events.tsx b/ui-web/src/Events.tsx
new file mode 100644
index 0000000..e33b4e2
--- /dev/null
+++ b/ui-web/src/Events.tsx
@@ -0,0 +1,370 @@
1import { useState } from 'react';
2import {
3 api,
4 EventDetail,
5 eventPath,
6 EventSummary,
7 feeLabel,
8 FeeTiming,
9 MarketData,
10 Mechanism,
11 mechanismLabel,
12 money,
13 num,
14 OrderBook,
15 same,
16 SEP,
17 Status,
18} from './api';
19import type { Act } from './App';
20import { LineChart, priceSeries } from './Chart';
21import { Equalizer } from './graphics';
22
23const STATUS_PILL: Record<Status, [string, string]> = {
24 DRAFT: ['', 'IDLE'],
25 ACTIVE: ['active', 'ACTIVE'],
26 SETTLED: ['closed', 'CLOSED'],
27};
28
29function Filter<T extends string>(props: {
30 label: string;
31 value: T | null;
32 options: [T, string][];
33 onChange: (value: T | null) => void;
34}) {
35 return (
36 <div className="filter">
37 <span>{props.label}</span>
38 <button className={props.value === null ? 'toggle on' : 'toggle'} onClick={() => props.onChange(null)}>
39 All
40 </button>
41 {props.options.map(([value, text]) => (
42 <button
43 key={value}
44 className={props.value === value ? 'toggle on' : 'toggle'}
45 onClick={() => props.onChange(value)}
46 >
47 {text}
48 </button>
49 ))}
50 </div>
51 );
52}
53
54export function Events(props: {
55 data: MarketData;
56 user: string;
57 selected: EventSummary | undefined;
58 onSelect: (key: string) => void;
59 act: Act;
60 onTrade: () => void;
61 onResolve: () => void;
62}) {
63 const { data, selected } = props;
64 const [method, setMethod] = useState<Mechanism | null>(null);
65 const [status, setStatus] = useState<Status | null>(null);
66 const [fee, setFee] = useState<FeeTiming | null>(null);
67
68 const shown = data.events.filter(
69 (e) =>
70 (method === null || e.mechanism === method) &&
71 (status === null || e.status === status) &&
72 (fee === null || e.commissionTiming === fee),
73 );
74 const detail = selected && data.details[selected.key];
75
76 return (
77 <>
78 <section className="card side events">
79 <Filter
80 label="Method"
81 value={method}
82 onChange={setMethod}
83 options={[
84 ['LMSR', 'LMSR'],
85 ['ORDER_BOOK', 'Order Book'],
86 ]}
87 />
88 <Filter
89 label="Status"
90 value={status}
91 onChange={setStatus}
92 options={[
93 ['DRAFT', 'Not started'],
94 ['ACTIVE', 'Active'],
95 ['SETTLED', 'Closed'],
96 ]}
97 />
98 <Filter
99 label="Fee"
100 value={fee}
101 onChange={setFee}
102 options={[
103 ['ON_PURCHASE', 'On purchase'],
104 ['ON_CLOSE', 'On close'],
105 ]}
106 />
107 <div className="list">
108 {shown.map((e) => (
109 <button
110 key={e.key}
111 className={e.key === selected?.key ? 'listrow on' : 'listrow'}
112 style={{ flexDirection: 'column', alignItems: 'stretch', gap: 6 }}
113 onClick={() => props.onSelect(e.key)}
114 >
115 <span className="row">
116 <span className="sm ink2">#{e.displayId}</span>
117 <span className="bold ellipsis">{e.name}</span>
118 </span>
119 <span className="row sm ink2">
120 <span>{mechanismLabel(e.mechanism)}</span>
121 <span className={'pill ' + STATUS_PILL[e.status][0]}>{STATUS_PILL[e.status][1]}</span>
122 <span>{feeLabel(e)}</span>
123 <span className="grow" />
124 <span>{money(e.accountBalance)}</span>
125 </span>
126 </button>
127 ))}
128 </div>
129 <span className="sm ink2">
130 {shown.length} of {data.events.length} events shown
131 </span>
132 </section>
133
134 {detail ? (
135 <EventView detail={detail} user={props.user} act={props.act} onTrade={props.onTrade} onResolve={props.onResolve} />
136 ) : (
137 <section className="card main" />
138 )}
139 </>
140 );
141}
142
143function EventView(props: { detail: EventDetail; user: string; act: Act; onTrade: () => void; onResolve: () => void }) {
144 const { detail, user, act } = props;
145 const e = detail.summary;
146 const markets = detail.state.markets;
147 const isMm = same(e.marketMaker, user);
148 const live = e.status === 'ACTIVE' ? 'LIVE' : e.status === 'SETTLED' ? 'ENDED' : 'IDLE';
149 const yes = priceSeries(detail);
150
151 return (
152 <section className="card main">
153 <div className="head" style={{ flexDirection: 'column', gap: 9 }}>
154 <div className="row" style={{ alignItems: 'flex-start', gap: 14, width: '100%' }}>
155 <div className="grow">
156 <h2 className="xl bold">
157 {e.displayId}. {e.name}
158 </h2>
159 <p className="base ink2 ellipsis" title={e.description}>
160 {e.description}
161 </p>
162 </div>
163 {/* Open = go trade on an active event, or the Market Maker starting their own */}
164 {e.status === 'ACTIVE' && (
165 <button className="btn primary" onClick={props.onTrade}>
166 Trade
167 </button>
168 )}
169 {e.status === 'DRAFT' && isMm && (
170 <button
171 className="btn primary"
172 onClick={() => act(() => api(eventPath(e.name) + '/open', {}), `Event started`)}
173 >
174 Start Event
175 </button>
176 )}
177 {e.status === 'ACTIVE' && isMm && (
178 <button className="btn" onClick={props.onResolve}>
179 Close &amp; Resolve…
180 </button>
181 )}
182 </div>
183 <div className="meta">
184 <span className={'pill ' + STATUS_PILL[e.status][0]}>
185 <Equalizer />
186 {live}
187 </span>
188 <span>
189 <span className="ink2">Method</span> <b>{mechanismLabel(e.mechanism)}</b>
190 </span>
191 <span>
192 <span className="ink2">Status</span> <b>{e.status}</b>
193 </span>
194 <span>
195 <span className="ink2">Market Maker</span> <b>{e.marketMaker}</b>
196 </span>
197 <span>
198 <span className="ink2">Fee</span> <b>{feeLabel(e)}</b>
199 </span>
200 <span>
201 <span className="ink2">Contract</span> <b>{money(e.accountBalance)}</b>
202 </span>
203 </div>
204 </div>
205
206 <div className="body">
207 {e.status === 'SETTLED' && (
208 <div className="notice">
209 <span className="pill resolved">RESOLVED</span>
210 <span>
211 Winning option: <b>{detail.settledMarket}</b> {SEP} contract emptied to its holders
212 </span>
213 </div>
214 )}
215
216 {e.mechanism === 'LMSR' ? (
217 <>
218 <div className="pair">
219 {markets.map((m, i) => (
220 <div key={m.key} className={i === 0 ? 'optcard yes' : 'optcard no'}>
221 <div className="row">
222 <span className="bold grow ellipsis">
223 {i === 0 ? 'YES' : 'NO'} <span className="sm">{m.name}</span>
224 </span>
225 <span className="bold" style={{ fontSize: 22 }}>
226 {money(m.price)}
227 </span>
228 </div>
229 <div className="bar">
230 <i style={{ width: `${num(m.price) * 100}%` }} />
231 </div>
232 <span className="sm ink2">
233 {m.volume} shares {SEP} p = {num(m.price).toFixed(2)}
234 </span>
235 </div>
236 ))}
237 </div>
238 <div className="section">
239 <div className="section-title">
240 Share price over time <span className="grow" />
241 <span className="sm ink2" style={{ fontWeight: 400 }}>
242 YES / NO {SEP} LMSR
243 </span>
244 </div>
245 <LineChart
246 range={[0, 1]}
247 series={[
248 { points: yes, tone: 'yes' },
249 { points: yes.map(([t, v]) => [t, 1 - v]), tone: 'no' },
250 ]}
251 />
252 </div>
253 </>
254 ) : (
255 <>
256 <div className="pair">
257 {detail.orderBooks.map((book, i) => (
258 <Book key={book.optionKey} book={book} last={markets[i]?.price} side={i === 0 ? 'YES' : 'NO'} />
259 ))}
260 </div>
261 <div className="section">
262 <div className="section-title">
263 Last trade price over time <span className="grow" />
264 <span className="sm ink2" style={{ fontWeight: 400 }}>
265 last trade YES
266 </span>
267 </div>
268 <LineChart range={[0, 1]} series={[{ points: yes, tone: 'accent' }]} />
269 </div>
270 </>
271 )}
272
273 <div className="section">
274 <div className="section-title">
275 Trade history <span className="sm ink2">newest first</span>
276 </div>
277 <div className="table">
278 <div className="thead">
279 <span className="w66">#</span>
280 <span className="grow">User</span>
281 <span className="w150">Option</span>
282 <span className="w92 num">Shares</span>
283 <span className="w92 num">Paid</span>
284 </div>
285 {detail.history.map((t, i) => (
286 <div className="trow" key={i}>
287 <span className="w66 ink2 bold">#{detail.history.length - i}</span>
288 <span className="grow ellipsis">{t.userName}</span>
289 <span className={`w150 bold ellipsis ${t.optionName === e.optionNames[0] ? 'yes' : 'no'}`}>
290 {t.optionName}
291 </span>
292 <span className="w92 num">{t.quantity} shares</span>
293 <span className="w92 num bold accent">{money(t.pricePaid)}</span>
294 </div>
295 ))}
296 {detail.history.length === 0 && <div className="trow ink2">No trades yet</div>}
297 </div>
298 </div>
299
300 <div className="section">
301 <div className="section-title">Participants</div>
302 <div className="table">
303 <div className="thead">
304 <span className="grow">User</span>
305 <span className="w78 num">YES</span>
306 <span className="w78 num">NO</span>
307 <span className="w92 num">Value</span>
308 <span className="w92 num">Fees paid</span>
309 </div>
310 {detail.participants.map((p) => (
311 <div className="trow" key={p.user}>
312 <span className="grow ellipsis bold">
313 {p.user}
314 {p.tag && ` (${p.tag})`}
315 </span>
316 <span className="w78 num">{p.yes}</span>
317 <span className="w78 num">{p.no}</span>
318 <span className="w92 num">{p.value}</span>
319 <span className="w92 num">{p.fees}</span>
320 </div>
321 ))}
322 {detail.participants.length === 0 && <div className="trow ink2">Nobody yet</div>}
323 </div>
324 </div>
325 </div>
326 </section>
327 );
328}
329
330function Book({ book, last, side }: { book: OrderBook; last: string | undefined; side: string }) {
331 const mid = book.bestBid && book.bestAsk ? money((num(book.bestBid) + num(book.bestAsk)) / 2) : '—';
332 return (
333 <div className="table">
334 <div className="row" style={{ padding: '10px 11px 0' }}>
335 <span className={side === 'YES' ? 'bold yes' : 'bold no'}>{side} Order Book</span>
336 <span className="sm ink2 ellipsis grow">{book.optionName}</span>
337 <span className="sm ink2">{book.orders.length} orders</span>
338 </div>
339 <div className="stats">
340 {[
341 ['Last', money(last)],
342 ['Best bid', book.bestBid ?? '—'],
343 ['Best ask', book.bestAsk ?? '—'],
344 ['Mid', mid],
345 ['Spread', book.spread ?? '—'],
346 ].map(([label, value]) => (
347 <span key={label}>
348 <span className="xs ink2">{label}</span>
349 <b>{value}</b>
350 </span>
351 ))}
352 </div>
353 <div className="thead">
354 <span className="w54 num">Price</span>
355 <span className="w54 num">Side</span>
356 <span className="w54 num">Qty</span>
357 <span className="grow">User</span>
358 </div>
359 {book.orders.map((o, i) => (
360 <div className={o.isBid ? 'trow bid' : 'trow ask'} key={i}>
361 <span className="w54 num bold">{o.price}</span>
362 <span className={o.isBid ? 'w54 num yes' : 'w54 num no'}>{o.side}</span>
363 <span className="w54 num">{o.quantity}</span>
364 <span className="grow ellipsis">{o.user}</span>
365 </div>
366 ))}
367 {book.orders.length === 0 && <div className="trow ink2">No resting orders</div>}
368 </div>
369 );
370}
diff --git a/ui-web/src/Users.tsx b/ui-web/src/Users.tsx
new file mode 100644
index 0000000..b2593d9
--- /dev/null
+++ b/ui-web/src/Users.tsx
@@ -0,0 +1,298 @@
1import { useState } from 'react';
2import { api, EventSummary, feeLabel, MarketData, mechanismLabel, money, num, same, SEP } from './api';
3import type { Act } from './App';
4import { balanceSeries, LineChart } from './Chart';
5import { Sparkline } from './graphics';
6
7export function Users(props: {
8 data: MarketData;
9 user: string;
10 selected: EventSummary | undefined;
11 onSelect: (key: string) => void;
12 act: Act;
13 onDeposit: () => void;
14}) {
15 const { data, user, selected } = props;
16 const account = data.account;
17 const balance = num(account.balance);
18
19 const myEvents = data.events.flatMap((e) => {
20 const me = data.details[e.key]?.participants.find((p) => same(p.user, user));
21 const owner = same(e.marketMaker, user);
22 return owner || (me && (me.yes > 0 || me.no > 0)) ? [{ e, me, owner }] : [];
23 });
24 const isMm = myEvents.some((row) => row.owner);
25
26 return (
27 <>
28 <section className="card side users">
29 <div className="row xs bold ink2">
30 <span className="grow">User</span>
31 <span>Balance</span>
32 </div>
33 {/* A directory of everyone on the server; you can only ever act as yourself */}
34 <div className="list">
35 {data.users.map((u) => {
36 const me = same(u.username, user);
37 return (
38 <div key={u.username} className={me ? 'listrow plain on' : 'listrow plain'}>
39 <span className="grow">
40 <span className="bold ellipsis" style={{ display: 'block' }}>
41 {u.username}
42 </span>
43 <span className="xs ink2">
44 {u.marketMaker ? 'Market Maker' : 'Trader'}
45 {me ? ' (you)' : u.online ? '' : ' · offline'}
46 </span>
47 </span>
48 <span className={num(u.balance) < 0 ? 'balcell neg' : 'balcell'}>{money(u.balance)}</span>
49 </div>
50 );
51 })}
52 </div>
53 <button className="btn primary" onClick={props.onDeposit}>
54 Deposit Funds
55 </button>
56 </section>
57
58 <section className="card main">
59 <div className="head" style={{ alignItems: 'center' }}>
60 <div className="grow">
61 <div className="row" style={{ gap: 9 }}>
62 <h2 className="xl bold">{user}</h2>
63 <span className={account.blocked ? 'pill blocked' : isMm ? 'pill mm' : 'pill'}>
64 {account.blocked ? 'BLOCKED' : isMm ? 'MARKET MAKER' : 'TRADER'}
65 </span>
66 </div>
67 <p className="base ink2">Active in {myEvents.length} events</p>
68 </div>
69 <Sparkline negative={balance < 0} />
70 <div style={{ textAlign: 'right' }}>
71 <div className="base ink2">Balance</div>
72 <div className={balance < 0 ? 'balance neg' : 'balance'}>{money(account.balance)}</div>
73 </div>
74 </div>
75
76 <div className="body">
77 {account.blocked && (
78 <div className="notice blocked">
79 <span className="pill blocked">BLOCKED</span>
80 <span>
81 This account reached a negative balance. All trading actions are disabled until you deposit enough
82 funds to bring it back above zero.
83 </span>
84 </div>
85 )}
86
87 <div className="section">
88 <div className="section-title">
89 Account balance over time <span className="grow" />
90 <span className="sm ink2" style={{ fontWeight: 400 }}>
91 every trade, fee and payout
92 </span>
93 </div>
94 <LineChart series={[{ points: balanceSeries(account), tone: balance < 0 ? 'no' : 'accent' }]} />
95 </div>
96
97 <div className="section">
98 <div className="section-title">Events participation / owner</div>
99 <div className="table">
100 <div className="thead">
101 <span className="grow">Event</span>
102 <span className="w92">Role</span>
103 <span className="w78">Type</span>
104 <span className="w78 num">YES</span>
105 <span className="w78 num">NO</span>
106 <span className="w92 num">P/L</span>
107 </div>
108 {myEvents.map(({ e, me, owner }) => {
109 const pnl = e.status === 'SETTLED' ? (me?.pnl ?? '$0.00') : '—';
110 return (
111 <div
112 key={e.key}
113 className={e.key === selected?.key ? 'trow click on' : 'trow click'}
114 onClick={() => props.onSelect(e.key)}
115 >
116 <span className="grow ellipsis">{e.name}</span>
117 <span className="w92 ink2">{owner ? 'Market Maker' : 'Trader'}</span>
118 <span className="w78 ink2">{mechanismLabel(e.mechanism)}</span>
119 <span className="w78 num">{me?.yes ?? 0}</span>
120 <span className="w78 num">{me?.no ?? 0}</span>
121 <span className={num(pnl) < 0 ? 'w92 num pnl neg' : 'w92 num pnl'}>{pnl}</span>
122 </div>
123 );
124 })}
125 {myEvents.length === 0 && <div className="trow ink2">You are not part of any event yet</div>}
126 </div>
127 </div>
128
129 {/* key: a different event starts with a fresh form */}
130 {selected ? (
131 <TradePanel key={selected.key} {...props} event={selected} />
132 ) : (
133 <div className="card2 base ink2" style={{ padding: '13px 14px' }}>
134 Select an event to trade.
135 </div>
136 )}
137
138 <div className="section">
139 <div className="section-title">
140 Account activity <span className="grow" />
141 <span className="sm ink2" style={{ fontWeight: 400 }}>
142 newest first
143 </span>
144 </div>
145 <div className="table">
146 <div className="thead">
147 <span className="w150">Time</span>
148 <span className="w92">Type</span>
149 <span className="grow">Details</span>
150 <span className="w92 num">Amount</span>
151 <span className="w92 num">Balance</span>
152 </div>
153 {/* seq is not unique across entries, so the position is the key */}
154 {[...account.entries].reverse().map((row, i) => (
155 <div className="trow" key={account.entries.length - i}>
156 <span className="w150 ink2">{row.at}</span>
157 <span className="w92 ink2">{row.type}</span>
158 <span className="grow ellipsis">{row.note}</span>
159 <span className="w92 num">{row.amount}</span>
160 <span className="w92 num">{row.balanceAfter}</span>
161 </div>
162 ))}
163 {account.entries.length === 0 && (
164 <div className="trow ink2">Nothing yet. Deposit funds to start trading.</div>
165 )}
166 </div>
167 </div>
168 </div>
169 </section>
170 </>
171 );
172}
173
174function TradePanel(props: { data: MarketData; user: string; act: Act; event: EventSummary }) {
175 const { data, user, event: e } = props;
176 const detail = data.details[e.key];
177 const markets = detail?.state.markets ?? [];
178 const me = detail?.participants.find((p) => same(p.user, user));
179 const held = [me?.yes ?? 0, me?.no ?? 0];
180 const isBook = e.mechanism === 'ORDER_BOOK';
181
182 const [option, setOption] = useState(0);
183 const [side, setSide] = useState<'BUY' | 'SELL'>('BUY');
184 const [quantity, setQuantity] = useState('50');
185 const [price, setPrice] = useState('0.62');
186
187 const qty = Number(quantity);
188 const qtyOk = Number.isInteger(qty) && qty > 0;
189 const unit = isBook ? Number(price) : num(markets[option]?.price);
190 const priceOk = unit > 0;
191 const cost = qty * unit;
192
193 let hint: string;
194 let allowed = false;
195 if (!qtyOk) hint = 'Shares must be a positive whole number.';
196 else if (!priceOk) hint = 'Price per share must be positive.';
197 else if (data.account.blocked) hint = 'Trading is disabled because this account is blocked.';
198 else if (e.status !== 'ACTIVE') hint = 'Trading is only available for ACTIVE events.';
199 else if (side === 'SELL' && !same(e.marketMaker, user) && qty > held[option])
200 hint = `Cannot sell ${qty} shares; you only hold ${held[option]}.`;
201 else if (side === 'BUY' && num(data.account.balance) < cost)
202 hint = `Insufficient balance. Required: ${money(cost)}, available: ${money(data.account.balance)}`;
203 else {
204 allowed = true;
205 hint =
206 side === 'SELL'
207 ? 'Sell order will match existing bids or rest as an ask.'
208 : isBook
209 ? 'Buy order will match existing asks or rest as a bid.'
210 : 'Orders execute immediately against the market maker.';
211 }
212
213 const submit = () =>
214 props.act(
215 () =>
216 api('/orders', {
217 event: e.name,
218 option: markets[option].key,
219 side,
220 price: isBook ? price.trim() : markets[option].price,
221 quantity: String(qty),
222 }),
223 `Order placed ${SEP} ${side === 'BUY' ? 'Bought' : 'Sold'} ${qty} ${e.optionNames[option]}`,
224 );
225
226 return (
227 <div className="card2 section" style={{ padding: '13px 14px', gap: 9 }}>
228 <div className="row" style={{ alignItems: 'baseline' }}>
229 <span className="lg bold grow ellipsis">
230 {e.displayId}. {e.name}
231 </span>
232 <span className="sm ink2">
233 {mechanismLabel(e.mechanism)} {SEP} Status: {e.status} {SEP} Fee: {feeLabel(e)}
234 </span>
235 </div>
236 <div className="pair">
237 {markets.map((m, i) => (
238 <button
239 key={m.key}
240 className={`optcard pick ${i === 0 ? 'yes' : 'no'}${option === i ? ' on' : ''}`}
241 onClick={() => setOption(i)}
242 >
243 <span className="row">
244 <span className={i === 0 ? 'bold yes grow ellipsis' : 'bold no grow ellipsis'}>
245 {i === 0 ? 'YES' : 'NO'} <span className="sm">{m.name}</span>
246 </span>
247 <span className={i === 0 ? 'xl bold yes' : 'xl bold no'}>{money(m.price)}</span>
248 </span>
249 <span className="sm ink2">You hold {held[i]} shares</span>
250 </button>
251 ))}
252 </div>
253 <div className="tradeform">
254 <label>
255 Action
256 <span>
257 <button className={side === 'BUY' ? 'seg on' : 'seg'} onClick={() => setSide('BUY')}>
258 Buy
259 </button>
260 <button className={side === 'SELL' ? 'seg on' : 'seg'} onClick={() => setSide('SELL')}>
261 Sell
262 </button>
263 </span>
264 </label>
265 <label>
266 Shares
267 <input
268 className={qtyOk ? 'field' : 'field bad'}
269 inputMode="numeric"
270 value={quantity}
271 onChange={(ev) => setQuantity(ev.target.value)}
272 />
273 </label>
274 {isBook && (
275 <label>
276 Price / share
277 <input
278 className={priceOk ? 'field' : 'field bad'}
279 inputMode="decimal"
280 value={price}
281 onChange={(ev) => setPrice(ev.target.value)}
282 />
283 </label>
284 )}
285 <label>
286 Estimated cost
287 <span className="lg bold" style={{ color: 'var(--ink)', padding: '7px 0' }}>
288 {qtyOk && priceOk ? money(cost) : '—'}
289 </span>
290 </label>
291 <button className="btn primary" disabled={!allowed} onClick={submit}>
292 Place {side === 'BUY' ? 'Buy' : 'Sell'} Order
293 </button>
294 </div>
295 <span className="sm ink2">{hint}</span>
296 </div>
297 );
298}
diff --git a/ui-web/src/api.ts b/ui-web/src/api.ts
new file mode 100644
index 0000000..2ce1a8d
--- /dev/null
+++ b/ui-web/src/api.ts
@@ -0,0 +1,176 @@
1
2export type Mechanism = 'LMSR' | 'ORDER_BOOK';
3export type Status = 'DRAFT' | 'ACTIVE' | 'SETTLED';
4export type FeeTiming = 'ON_PURCHASE' | 'ON_CLOSE';
5
6export interface EventSummary {
7 key: string;
8 displayId: number;
9 name: string;
10 description: string;
11 commissionPercent: number;
12 commissionTiming: FeeTiming;
13 mechanism: Mechanism;
14 status: Status;
15 optionNames: string[];
16 accountBalance: string;
17 marketMaker: string;
18}
19
20export interface Market {
21 key: string;
22 name: string;
23 price: string;
24 volume: string;
25}
26
27export interface BookOrder {
28 side: string;
29 user: string;
30 quantity: number;
31 price: string;
32 isBid: boolean;
33}
34
35export interface OrderBook {
36 optionKey: string;
37 optionName: string;
38 bestBid: string | null;
39 bestAsk: string | null;
40 spread: string | null;
41 orders: BookOrder[];
42}
43
44export interface TradeRow {
45 at: string;
46 userName: string;
47 optionName: string;
48 quantity: string;
49 pricePaid: string;
50}
51
52export interface Participant {
53 user: string;
54 tag: string;
55 yes: number;
56 no: number;
57 value: string;
58 fees: string;
59 pnl: string;
60}
61
62export interface EventDetail {
63 summary: EventSummary;
64 state: { markets: Market[]; accountBalance: string; commissionCollected: string };
65 history: TradeRow[];
66 settledMarket: string;
67 orderBooks: OrderBook[];
68 participants: Participant[];
69}
70
71export interface LedgerEntry {
72 seq: number;
73 at: string;
74 type: string;
75 amount: string;
76 balanceAfter: string;
77 note: string;
78}
79
80export interface Ledger {
81 owner: string;
82 balance: string;
83 blocked: boolean;
84 entries: LedgerEntry[];
85}
86
87export interface UserSummary {
88 username: string;
89 balance: string;
90 marketMaker: boolean;
91 online: boolean;
92}
93
94export interface Sync {
95 changed: boolean;
96 version: number;
97 events: EventSummary[];
98 users: UserSummary[];
99 account: Ledger;
100}
101
102export interface ChatMessage {
103 id: number;
104 at: string;
105 sender: string;
106 text: string;
107}
108
109export interface MarketData {
110 events: EventSummary[];
111 details: Record<string, EventDetail>;
112 users: UserSummary[];
113 account: Ledger;
114}
115
116export class ApiError extends Error {
117 constructor(
118 public status: number,
119 message: string,
120 ) {
121 super(message);
122 }
123}
124
125const BASE = '/guess-market/api';
126const UNREACHABLE = 'Cannot reach the server. Is Tomcat running on port 8080?';
127
128export async function api<T>(path: string, form?: Record<string, string>): Promise<T> {
129 let res: Response;
130 try {
131 res = await fetch(
132 BASE + path,
133 form ? { method: 'POST', body: new URLSearchParams(form) } : undefined,
134 );
135 } catch {
136 throw new ApiError(0, UNREACHABLE);
137 }
138 const text = await res.text();
139 let body: any = null;
140 try {
141 body = text ? JSON.parse(text) : null;
142 } catch {
143 }
144 if (!res.ok) {
145 throw new ApiError(res.status, body?.message ?? (res.status >= 500 ? UNREACHABLE : `The server answered ${res.status}.`));
146 }
147 return body as T;
148}
149
150export const eventPath = (name: string) => '/events/' + encodeURIComponent(name);
151
152export function num(value: string | number | null | undefined): number {
153 const n = typeof value === 'number' ? value : Number(String(value ?? '').replace(/[$,]/g, ''));
154 return Number.isNaN(n) ? 0 : n;
155}
156
157export const same = (a: string, b: string) => a.toLowerCase() === b.toLowerCase();
158
159export function money(value: string | number | null | undefined): string {
160 if (value === null || value === undefined || value === '') return '—';
161 const n = typeof value === 'number' ? value : Number(String(value).replace(/[$,]/g, ''));
162 if (Number.isNaN(n)) return String(value);
163 return (n < 0 ? '-$' : '$') + Math.abs(n).toFixed(2);
164}
165
166export const mechanismLabel = (m: Mechanism) => (m === 'LMSR' ? 'LMSR' : 'Order Book');
167
168export const CHEVRON = '\ue0b1';
169export const SEP = '\ueb04';
170
171export const optionTitle = (e: EventSummary, i: number) => `${i === 0 ? 'YES' : 'NO'} ${SEP} ${e.optionNames[i]}`;
172
173export const feeLabel = (e: EventSummary) =>
174 `${e.commissionPercent}% ${e.commissionTiming === 'ON_PURCHASE' ? 'on purchase' : 'on close'}`;
175
176export const GLYPH = { file: '\uf15b', bolt: '\uf0e7', users: '\uf0c0', chat: '\u{f0b79}' };
diff --git a/ui-web/src/graphics.tsx b/ui-web/src/graphics.tsx
new file mode 100644
index 0000000..2d452df
--- /dev/null
+++ b/ui-web/src/graphics.tsx
@@ -0,0 +1,51 @@
1
2export function Equalizer() {
3 return (
4 <svg className="eq" width="16" height="12" viewBox="0 0 16 12" aria-hidden="true">
5 <rect className="b0" x="0" width="4" height="12" rx="1" />
6 <rect className="b1" x="6" width="4" height="12" rx="1" />
7 <rect className="b2" x="12" width="4" height="12" rx="1" />
8 </svg>
9 );
10}
11
12export function Sparkline({ negative }: { negative: boolean }) {
13 return (
14 <svg className={negative ? 'spark neg' : 'spark'} width="64" height="28" viewBox="0 0 64 28" aria-hidden="true">
15 <polyline className="draw" pathLength="100" points="2,20 14,16 26,22 38,11 50,14 62,5" />
16 <circle className="rider" r="2.8" />
17 </svg>
18 );
19}
20
21export function MarketChart() {
22 return (
23 <svg className="mchart" width="300" height="162" viewBox="0 0 240 130" aria-hidden="true">
24 <line className="rule" x1="18" y1="20" x2="228" y2="20" />
25 <line className="rule" x1="18" y1="65" x2="228" y2="65" strokeDasharray="3 4" />
26 <line className="rule" x1="18" y1="110" x2="228" y2="110" />
27 <line className="rule" x1="18" y1="14" x2="18" y2="116" />
28 <text x="0" y="24">
29 1.0
30 </text>
31 <text className="lo" x="0" y="114">
32 0.0
33 </text>
34 <path className="draw y" pathLength="100" d="M22 66 C96 64 150 22 224 22" />
35 <path className="draw n" pathLength="100" d="M22 66 C96 68 150 110 224 110" />
36 <circle className="rider y" r="4" />
37 <circle className="rider n" r="4" />
38 </svg>
39 );
40}
41
42export function Pinwheel() {
43 return (
44 <svg className="pinwheel" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">
45 <g>
46 <path d="M 10 10 L 10 2 A 8 8 0 0 1 15.65 4.35 Q 12 8 10 10 Z M 10 10 L 18 10 A 8 8 0 0 1 15.65 15.65 Q 12 12 10 10 Z M 10 10 L 10 18 A 8 8 0 0 1 4.35 15.65 Q 8 12 10 10 Z M 10 10 L 2 10 A 8 8 0 0 1 4.35 4.35 Q 8 8 10 10 Z" />
47 <circle cx="10" cy="10" r="2.2" />
48 </g>
49 </svg>
50 );
51}
diff --git a/ui-web/src/main.tsx b/ui-web/src/main.tsx
new file mode 100644
index 0000000..ed3b67f
--- /dev/null
+++ b/ui-web/src/main.tsx
@@ -0,0 +1,10 @@
1import { StrictMode } from 'react';
2import { createRoot } from 'react-dom/client';
3import { App } from './App';
4import './styles.css';
5
6createRoot(document.getElementById('root')!).render(
7 <StrictMode>
8 <App />
9 </StrictMode>,
10);
diff --git a/ui-web/src/styles.css b/ui-web/src/styles.css
new file mode 100644
index 0000000..028e2d2
--- /dev/null
+++ b/ui-web/src/styles.css
@@ -0,0 +1,1068 @@
1
2@font-face {
3 font-family: 'CaskaydiaCove NF';
4 src: url('/fonts/CaskaydiaCoveNerdFont-Regular.ttf');
5}
6@font-face {
7 font-family: 'CaskaydiaCove NF';
8 font-weight: bold;
9 src: url('/fonts/CaskaydiaCoveNerdFont-Bold.ttf');
10}
11@font-face {
12 font-family: 'JetBrainsMono NF';
13 src: url('/fonts/JetBrainsMonoNerdFont-Regular.ttf');
14}
15@font-face {
16 font-family: 'JetBrainsMono NF';
17 font-weight: bold;
18 src: url('/fonts/JetBrainsMonoNerdFont-Bold.ttf');
19}
20@font-face {
21 font-family: 'FiraCode Nerd Font';
22 src: url('/fonts/FiraCodeNerdFont-Regular.ttf');
23}
24@font-face {
25 font-family: 'FiraCode Nerd Font';
26 font-weight: bold;
27 src: url('/fonts/FiraCodeNerdFont-Bold.ttf');
28}
29
30:root,
31:root[data-skin='rose-pine-dawn'] {
32 --font: 'CaskaydiaCove NF', Consolas, monospace;
33 --size: 13px;
34 --bg: #faf4ed;
35 --panel: #fffaf3;
36 --panel2: #f2e9e1;
37 --panel3: #dfdad9;
38 --line: #cecacd;
39 --ink: #575279;
40 --ink2: #797593;
41 --accent: #907aa9;
42 --accent-fg: #fffaf3;
43 --btn: #f2e9e1;
44 --btn-line: #cecacd;
45 --yes: #286983;
46 --no: #b4637a;
47 --yes-soft: #e3edf0;
48 --no-soft: #f5e6ea;
49}
50
51:root[data-skin='catppuccin'] {
52 --font: 'JetBrainsMono NF', Consolas, monospace;
53 --bg: #181825;
54 --panel: #1e1e2e;
55 --panel2: #313244;
56 --panel3: #45475a;
57 --line: #585b70;
58 --ink: #cdd6f4;
59 --ink2: #a6adc8;
60 --accent: #cba6f7;
61 --accent-fg: #1e1e2e;
62 --btn: #313244;
63 --btn-line: #585b70;
64 --yes: #a6e3a1;
65 --no: #f38ba8;
66 --yes-soft: #23312a;
67 --no-soft: #34232c;
68}
69
70:root[data-skin='gruvbox'] {
71 --font: 'FiraCode Nerd Font', Consolas, monospace;
72 --size: 13.5px;
73 --bg: #1d2021;
74 --panel: #282828;
75 --panel2: #3c3836;
76 --panel3: #504945;
77 --line: #665c54;
78 --ink: #ebdbb2;
79 --ink2: #a89984;
80 --accent: #fe8019;
81 --accent-fg: #1d2021;
82 --btn: #3c3836;
83 --btn-line: #665c54;
84 --yes: #b8bb26;
85 --no: #fb4934;
86 --yes-soft: #2b3021;
87 --no-soft: #3b2320;
88}
89
90 box-sizing: border-box;
91}
92html,
93body,
94 height: 100%;
95}
96body {
97 margin: 0;
98 background: var(--bg);
99 color: var(--ink);
100 font: var(--size) / 1.35 var(--font);
101}
102h1,
103h2,
104h3,
105p {
106 margin: 0;
107 font-weight: inherit;
108}
109
110.ink2 {
111 color: var(--ink2);
112}
113.accent {
114 color: var(--accent);
115}
116.yes {
117 color: var(--yes);
118}
119.no {
120 color: var(--no);
121}
122.bold {
123 font-weight: 700;
124}
125.xs {
126 font-size: 10.5px;
127}
128.sm {
129 font-size: 11.5px;
130}
131.base {
132 font-size: 12.5px;
133}
134.lg {
135 font-size: 14px;
136}
137.xl {
138 font-size: 17px;
139}
140.grow {
141 flex: 1;
142 min-width: 0;
143}
144.ellipsis {
145 overflow: hidden;
146 text-overflow: ellipsis;
147 white-space: nowrap;
148}
149.row {
150 display: flex;
151 align-items: center;
152 gap: 8px;
153}
154.num {
155 text-align: right;
156 white-space: nowrap;
157}
158
159button,
160input,
161select {
162 font: inherit;
163 color: inherit;
164}
165button {
166 cursor: pointer;
167}
168button:disabled {
169 opacity: 0.45;
170 cursor: default;
171}
172:focus-visible {
173 outline: 2px solid var(--accent);
174 outline-offset: 1px;
175}
176.btn {
177 border: 1px solid var(--btn-line);
178 border-radius: 5px;
179 background: var(--btn);
180 font-size: 13px;
181 font-weight: 700;
182 padding: 8px 15px;
183 white-space: nowrap;
184}
185.btn:hover:not(:disabled) {
186 opacity: 0.92;
187}
188.btn.primary {
189 background: var(--accent);
190 border-color: var(--accent);
191 color: var(--accent-fg);
192}
193.btn.destructive {
194 background: var(--no);
195 border-color: var(--no);
196 color: var(--accent-fg);
197}
198.btn.icon {
199 padding: 4px 8px;
200 min-width: 34px;
201 height: 30px;
202 display: grid;
203 place-items: center;
204}
205.btn.icon.on {
206 background: var(--panel3);
207 border-color: var(--accent);
208}
209.toggle {
210 border: 1px solid var(--btn-line);
211 border-radius: 4px;
212 background: var(--btn);
213 color: var(--ink2);
214 font-size: 12px;
215 padding: 5px 11px;
216}
217.toggle.on {
218 background: var(--accent);
219 border-color: var(--accent);
220 color: var(--accent-fg);
221}
222.seg {
223 border: 1px solid var(--btn-line);
224 background: var(--btn);
225 font-size: 12px;
226 font-weight: 700;
227 padding: 8px 15px;
228}
229.seg:first-child {
230 border-radius: 5px 0 0 5px;
231}
232.seg:last-child {
233 border-radius: 0 5px 5px 0;
234 border-left: 0;
235}
236.seg.on {
237 background: var(--accent);
238 color: var(--accent-fg);
239}
240.field {
241 background: var(--panel2);
242 border: 1px solid var(--btn-line);
243 border-radius: 5px;
244 padding: 8px 10px;
245 font-size: 13px;
246 color: var(--ink);
247 width: 96px;
248}
249.field.bad {
250 border-color: var(--no);
251 border-width: 1.5px;
252}
253.select {
254 background: var(--btn);
255 border: 1px solid var(--btn-line);
256 border-radius: 5px;
257 padding: 6px 8px;
258 font-size: 12.5px;
259}
260
261.pill {
262 display: inline-flex;
263 align-items: center;
264 gap: 7px;
265 border-radius: 3px;
266 padding: 3px 6px;
267 font-size: 10px;
268 font-weight: 700;
269 background: var(--panel3);
270 color: var(--ink2);
271 white-space: nowrap;
272}
273.pill.active {
274 background: var(--yes-soft);
275 color: var(--yes);
276}
277.pill.closed {
278 background: var(--no-soft);
279 color: var(--no);
280}
281.pill.mm {
282 background: var(--accent);
283 color: var(--accent-fg);
284}
285.pill.blocked {
286 background: var(--no);
287 color: var(--accent-fg);
288}
289.pill.resolved {
290 background: var(--yes);
291 color: var(--accent-fg);
292}
293
294.card {
295 background: var(--panel);
296 border: 1px solid var(--line);
297 border-radius: 7px;
298}
299.card2 {
300 background: var(--panel2);
301 border: 1px solid var(--line);
302 border-radius: 6px;
303}
304.table {
305 background: var(--panel);
306 border: 1px solid var(--line);
307 border-radius: 6px;
308 overflow: hidden;
309}
310.thead,
311.trow {
312 display: flex;
313 align-items: center;
314 gap: 8px;
315 padding: 8px 11px;
316}
317.thead {
318 background: var(--panel3);
319 color: var(--ink2);
320 font-size: 10.5px;
321 font-weight: 700;
322}
323.trow {
324 border-top: 1px solid var(--line);
325 font-size: 11.5px;
326}
327.trow.click {
328 cursor: pointer;
329}
330.trow.click:hover {
331 background: var(--panel2);
332}
333.trow.on {
334 background: var(--panel3);
335}
336.trow.bid {
337 background: var(--yes-soft);
338}
339.trow.ask {
340 background: var(--no-soft);
341}
342.w54 {
343 width: 54px;
344}
345.w66 {
346 width: 66px;
347}
348.w78 {
349 width: 78px;
350}
351.w92 {
352 width: 92px;
353}
354.w150 {
355 width: 150px;
356}
357
358.app {
359 display: flex;
360 flex-direction: column;
361 height: 100%;
362 min-width: 1040px;
363}
364.windowbar {
365 display: flex;
366 align-items: center;
367 gap: 10px;
368 height: 32px;
369 padding: 0 14px;
370 background: var(--panel2);
371 border-bottom: 1px solid var(--line);
372 font-size: 12.5px;
373 font-weight: 700;
374 color: var(--ink2);
375}
376.toolbar {
377 display: flex;
378 align-items: center;
379 gap: 12px;
380 padding: 12px 16px;
381 background: var(--panel);
382 border-bottom: 1px solid var(--line);
383}
384.path {
385 display: flex;
386 align-items: center;
387 gap: 10px;
388 padding: 8px 12px;
389 font-size: 12.5px;
390}
391.tabs {
392 display: flex;
393 align-items: flex-end;
394 gap: 2px;
395 padding: 6px 16px 0;
396 background: var(--panel);
397 border-bottom: 1px solid var(--line);
398}
399.tab {
400 border: 1px solid var(--line);
401 border-bottom: 0;
402 border-radius: 6px 6px 0 0;
403 background: var(--panel2);
404 color: var(--ink2);
405 font-size: 13px;
406 font-weight: 700;
407 padding: 9px 20px;
408 margin-bottom: -1px;
409}
410.tab.on {
411 background: var(--bg);
412 color: var(--ink);
413}
414.tabinfo {
415 display: flex;
416 align-items: center;
417 gap: 8px;
418 padding: 0 4px 8px;
419 font-size: 12.5px;
420 color: var(--ink2);
421}
422.content {
423 flex: 1;
424 min-height: 0;
425 display: flex;
426 gap: 12px;
427 padding: 12px 16px;
428}
429.statusbar {
430 display: flex;
431 align-items: center;
432 height: 30px;
433 padding: 0 14px;
434 background: var(--panel2);
435 border-top: 1px solid var(--line);
436 font-size: 11.5px;
437 color: var(--ink2);
438 white-space: pre;
439}
440.chatbtn {
441 border: 0;
442 background: none;
443 padding: 0 2px;
444 color: var(--ink2);
445 font-size: 14.5px;
446 cursor: pointer;
447}
448.chatbtn.on {
449 color: var(--accent);
450}
451.chat {
452 position: fixed;
453 right: 14px;
454 bottom: 31px;
455 width: 320px;
456 height: 380px;
457 display: flex;
458 flex-direction: column;
459 gap: 8px;
460 padding: 12px;
461 white-space: normal;
462 color: var(--ink);
463 box-shadow: 0 4px 18px rgb(0 0 0 / 0.3);
464 z-index: 2;
465}
466.chatlist {
467 flex: 1;
468 min-height: 0;
469 overflow-y: auto;
470 display: flex;
471 flex-direction: column;
472 gap: 9px;
473 overflow-wrap: anywhere;
474}
475.banner {
476 padding: 8px 16px;
477 font-weight: 700;
478 background: var(--no-soft);
479 color: var(--no);
480 border-bottom: 1px solid var(--no);
481}
482.toast {
483 position: fixed;
484 left: 50%;
485 bottom: 44px;
486 transform: translateX(-50%);
487 max-width: 90vw;
488 background: var(--ink);
489 color: var(--bg);
490 border-radius: 6px;
491 padding: 10px 16px;
492 font-size: 12.5px;
493 font-weight: 700;
494 z-index: 3;
495}
496.empty {
497 flex: 1;
498 display: flex;
499 flex-direction: column;
500 align-items: center;
501 justify-content: center;
502 gap: 14px;
503 text-align: center;
504}
505
506.side {
507 display: flex;
508 flex-direction: column;
509 gap: 6px;
510 padding: 12px;
511}
512.side.events {
513 width: 498px;
514}
515.side.users {
516 width: 274px;
517}
518.main {
519 flex: 1;
520 min-width: 0;
521 display: flex;
522 flex-direction: column;
523}
524.head {
525 display: flex;
526 align-items: flex-start;
527 gap: 14px;
528 padding: 14px 16px;
529 border-bottom: 1px solid var(--line);
530}
531.body {
532 flex: 1;
533 min-height: 0;
534 overflow-y: auto;
535 display: flex;
536 flex-direction: column;
537 gap: 14px;
538 padding: 14px 16px;
539}
540.body > * {
541 flex-shrink: 0;
542}
543.section {
544 display: flex;
545 flex-direction: column;
546 gap: 7px;
547}
548.section-title {
549 display: flex;
550 align-items: baseline;
551 gap: 8px;
552 font-size: 12.5px;
553 font-weight: 700;
554}
555.filter {
556 display: flex;
557 align-items: center;
558 gap: 8px;
559 margin-bottom: 4px;
560}
561.filter > span {
562 width: 74px;
563 font-size: 12.5px;
564 color: var(--ink2);
565}
566.list {
567 flex: 1;
568 min-height: 0;
569 overflow-y: auto;
570 display: flex;
571 flex-direction: column;
572 gap: 2px;
573}
574.listrow {
575 display: flex;
576 align-items: center;
577 gap: 8px;
578 width: 100%;
579 text-align: left;
580 background: transparent;
581 border: 0;
582 border-left: 3px solid transparent;
583 border-radius: 5px;
584 padding: 9px 11px;
585}
586.listrow:hover {
587 background: var(--panel2);
588}
589.listrow.on {
590 background: var(--panel3);
591 border-left-color: var(--accent);
592}
593.listrow.plain {
594 cursor: default;
595}
596.meta {
597 display: flex;
598 align-items: center;
599 flex-wrap: wrap;
600 gap: 4px 16px;
601 font-size: 12.5px;
602}
603.meta b {
604 font-weight: 700;
605}
606.pair {
607 display: grid;
608 grid-template-columns: 1fr 1fr;
609 gap: 10px;
610}
611.optcard {
612 border: 1px solid var(--line);
613 border-radius: 6px;
614 padding: 12px 14px;
615 display: flex;
616 flex-direction: column;
617 gap: 8px;
618}
619.optcard.yes {
620 background: var(--yes-soft);
621}
622.optcard.no {
623 background: var(--no-soft);
624}
625.optcard.pick {
626 background: var(--panel);
627 cursor: pointer;
628 text-align: left;
629 color: var(--ink);
630 padding: 10px 12px;
631 gap: 6px;
632}
633.optcard.pick.yes.on {
634 background: var(--yes-soft);
635 border: 1.5px solid var(--yes);
636}
637.optcard.pick.no.on {
638 background: var(--no-soft);
639 border: 1.5px solid var(--no);
640}
641.bar {
642 height: 6px;
643 border-radius: 3px;
644 background: var(--panel3);
645 overflow: hidden;
646}
647.bar i {
648 display: block;
649 height: 100%;
650 border-radius: 3px;
651 background: currentColor;
652 transition: width 0.3s;
653}
654.stats {
655 display: flex;
656 gap: 16px;
657 padding: 8px 11px;
658 font-size: 11.5px;
659}
660.stats span {
661 display: flex;
662 flex-direction: column;
663 gap: 2px;
664}
665.tradeform {
666 display: flex;
667 flex-wrap: wrap;
668 align-items: flex-end;
669 gap: 10px;
670}
671.tradeform label {
672 display: flex;
673 flex-direction: column;
674 gap: 5px;
675 font-size: 12.5px;
676 color: var(--ink2);
677}
678.balance {
679 font-size: 22px;
680 font-weight: 700;
681 color: var(--accent);
682}
683.balance.neg,
684.neg {
685 color: var(--no);
686}
687.balcell {
688 font-weight: 700;
689 color: var(--accent);
690}
691.pnl {
692 font-size: 12px;
693 font-weight: 700;
694 color: var(--yes);
695}
696.notice {
697 display: flex;
698 align-items: center;
699 gap: 11px;
700 padding: 11px 13px;
701 border-radius: 6px;
702 border: 1px solid var(--line);
703 background: var(--yes-soft);
704 font-size: 12.5px;
705}
706.notice.blocked {
707 background: var(--no-soft);
708 border-color: var(--no);
709}
710
711.chart {
712 display: grid;
713 grid-template-columns: auto 1fr;
714 gap: 4px 6px;
715 padding: 10px;
716 font-size: 10px;
717 color: var(--ink2);
718}
719.chart .yaxis {
720 display: flex;
721 flex-direction: column;
722 justify-content: space-between;
723 text-align: right;
724 border-right: 1px solid var(--line);
725 padding-right: 6px;
726 line-height: 1;
727}
728.chart .xaxis {
729 grid-column: 2;
730 display: flex;
731 justify-content: space-between;
732 border-top: 1px solid var(--line);
733 padding-top: 4px;
734}
735.chart svg {
736 width: 100%;
737 display: block;
738}
739.chart .grid {
740 stroke: var(--line);
741 stroke-width: 1;
742 opacity: 0.6;
743}
744.chart path {
745 fill: none;
746 stroke-width: 2.5;
747 stroke-linejoin: round;
748 vector-effect: non-scaling-stroke;
749}
750.chart line {
751 vector-effect: non-scaling-stroke;
752}
753.stroke-accent {
754 stroke: var(--accent);
755}
756.stroke-yes {
757 stroke: var(--yes);
758}
759.stroke-no {
760 stroke: var(--no);
761}
762
763.scrim {
764 position: fixed;
765 inset: 0;
766 display: grid;
767 place-items: center;
768 background: rgba(10, 10, 10, 0.42);
769 z-index: 2;
770}
771.dialog {
772 width: 430px;
773 max-width: calc(100vw - 32px);
774}
775.dialog > header {
776 padding: 16px 20px;
777 border-bottom: 1px solid var(--line);
778 font-size: 14px;
779 font-weight: 700;
780}
781.dialog > div {
782 display: flex;
783 flex-direction: column;
784 gap: 10px;
785 padding: 18px 20px;
786}
787.dialog > footer {
788 display: flex;
789 justify-content: flex-end;
790 gap: 9px;
791 padding: 14px 20px;
792 border-top: 1px solid var(--line);
793}
794.resolveopt {
795 flex: 1;
796 border: 1px solid var(--line);
797 border-radius: 6px;
798 background: var(--panel2);
799 font-size: 14px;
800 font-weight: 700;
801 padding: 14px 6px;
802}
803.resolveopt.yes.on {
804 background: var(--yes-soft);
805 border: 1.5px solid var(--yes);
806}
807.resolveopt.no.on {
808 background: var(--no-soft);
809 border: 1.5px solid var(--no);
810}
811
812.login {
813 height: 100%;
814 display: grid;
815 place-items: center;
816 padding: 24px;
817}
818.login form {
819 width: 380px;
820 max-width: 100%;
821 display: flex;
822 flex-direction: column;
823 gap: 8px;
824 padding: 20px 22px;
825}
826.login .field {
827 width: 100%;
828}
829
830.eq rect {
831 fill: var(--ink2);
832 transform-box: fill-box;
833 transform-origin: bottom;
834}
835.pill.active .eq rect {
836 fill: var(--yes);
837}
838.pill.closed .eq rect {
839 fill: var(--no);
840}
841.eq .b0 {
842 transform: scaleY(0.35);
843}
844.eq .b1 {
845 transform: scaleY(0.8);
846}
847.eq .b2 {
848 transform: scaleY(0.55);
849}
850.anim .eq .b0 {
851 animation: eq0 3.6s linear infinite;
852}
853.anim .eq .b1 {
854 animation: eq1 3.6s linear infinite;
855}
856.anim .eq .b2 {
857 animation: eq2 3.6s linear infinite;
858}
859@keyframes eq0 {
860 0%,
861 100% {
862 transform: scaleY(0.35);
863 }
864 30% {
865 transform: scaleY(1);
866 }
867 60% {
868 transform: scaleY(0.6);
869 }
870}
871@keyframes eq1 {
872 0%,
873 100% {
874 transform: scaleY(0.8);
875 }
876 25% {
877 transform: scaleY(0.3);
878 }
879 70% {
880 transform: scaleY(1);
881 }
882}
883@keyframes eq2 {
884 0%,
885 100% {
886 transform: scaleY(0.55);
887 }
888 45% {
889 transform: scaleY(1);
890 }
891 80% {
892 transform: scaleY(0.4);
893 }
894}
895
896.draw {
897 fill: none;
898 stroke-linecap: round;
899 stroke-linejoin: round;
900 stroke-dasharray: 100;
901 stroke-dashoffset: 0;
902}
903.rider {
904 offset-rotate: 0deg;
905 offset-distance: 100%;
906}
907.spark .draw {
908 stroke: var(--accent);
909 stroke-width: 2;
910}
911.spark .rider {
912 fill: var(--accent);
913 offset-path: path('M2 20 L14 16 L26 22 L38 11 L50 14 L62 5');
914}
915.spark.neg .draw {
916 stroke: var(--no);
917}
918.spark.neg .rider {
919 fill: var(--no);
920}
921.anim .spark .draw {
922 animation: draw70 3.6s infinite;
923}
924.anim .spark .rider {
925 animation:
926 ride70 3.6s infinite,
927 appear 3.6s linear infinite;
928}
929@keyframes draw70 {
930 0% {
931 stroke-dashoffset: 100;
932 animation-timing-function: ease-in-out;
933 }
934 70%,
935 100% {
936 stroke-dashoffset: 0;
937 }
938}
939@keyframes ride70 {
940 0% {
941 offset-distance: 0%;
942 animation-timing-function: ease-in-out;
943 }
944 70%,
945 100% {
946 offset-distance: 100%;
947 }
948}
949@keyframes appear {
950 0% {
951 opacity: 0;
952 }
953 8%,
954 100% {
955 opacity: 1;
956 }
957}
958
959.mchart .rule {
960 stroke: var(--line);
961}
962.mchart text {
963 fill: var(--ink2);
964 font-size: 9px;
965 opacity: 0.7;
966}
967.mchart .draw {
968 stroke-width: 2.5;
969}
970.mchart .y {
971 stroke: var(--yes);
972}
973.mchart .n {
974 stroke: var(--no);
975}
976.mchart .rider.y {
977 fill: var(--yes);
978 stroke: none;
979 offset-path: path('M22 66 C96 64 150 22 224 22');
980}
981.mchart .rider.n {
982 fill: var(--no);
983 stroke: none;
984 offset-path: path('M22 66 C96 68 150 110 224 110');
985}
986.anim .mchart .draw {
987 animation: draw55 3.6s infinite;
988}
989.anim .mchart .rider {
990 animation:
991 ride55 3.6s infinite,
992 appear 3.6s linear infinite;
993}
994.anim .mchart text {
995 animation: breathe 3.6s linear infinite;
996}
997.anim .mchart text.lo {
998 animation-delay: -3.2s;
999}
1000@keyframes draw55 {
1001 0% {
1002 stroke-dashoffset: 100;
1003 animation-timing-function: ease-in-out;
1004 }
1005 55%,
1006 100% {
1007 stroke-dashoffset: 0;
1008 }
1009}
1010@keyframes ride55 {
1011 0% {
1012 offset-distance: 0%;
1013 animation-timing-function: ease-in-out;
1014 }
1015 55%,
1016 100% {
1017 offset-distance: 100%;
1018 }
1019}
1020@keyframes breathe {
1021 0%,
1022 100% {
1023 opacity: 0.25;
1024 }
1025 50% {
1026 opacity: 0.7;
1027 }
1028}
1029
1030.pinwheel path {
1031 fill: var(--ink2);
1032}
1033.pinwheel circle {
1034 fill: var(--panel);
1035 stroke: var(--ink2);
1036}
1037.btn.icon.on .pinwheel path {
1038 fill: var(--accent);
1039}
1040.btn.icon.on .pinwheel circle {
1041 stroke: var(--accent);
1042}
1043.pinwheel g {
1044 transform-origin: 10px 10px;
1045}
1046.anim .pinwheel g {
1047 animation: spin 2.4s linear infinite;
1048}
1049@keyframes spin {
1050 to {
1051 transform: rotate(360deg);
1052 }
1053}
1054
1055.anim .fade {
1056 animation: fade 0.5s;
1057}
1058@keyframes fade {
1059 from {
1060 opacity: 0;
1061 }
1062}
1063
1064@media (prefers-reduced-motion: reduce) {
1065 .anim * {
1066 animation: none !important;
1067 }
1068}
diff --git a/ui-web/tsconfig.json b/ui-web/tsconfig.json
new file mode 100644
index 0000000..082767a
--- /dev/null
+++ b/ui-web/tsconfig.json
@@ -0,0 +1,15 @@
1{
2 "compilerOptions": {
3 "target": "ES2022",
4 "lib": ["ES2022", "DOM", "DOM.Iterable"],
5 "module": "ESNext",
6 "moduleResolution": "bundler",
7 "jsx": "react-jsx",
8 "strict": true,
9 "noEmit": true,
10 "skipLibCheck": true,
11 "isolatedModules": true,
12 "types": ["vite/client"]
13 },
14 "include": ["src", "vite.config.ts"]
15}
diff --git a/ui-web/vite.config.ts b/ui-web/vite.config.ts
new file mode 100644
index 0000000..b667c41
--- /dev/null
+++ b/ui-web/vite.config.ts
@@ -0,0 +1,14 @@
1import react from '@vitejs/plugin-react';
2import { defineConfig } from 'vite';
3
4export default defineConfig({
5 plugins: [react()],
6 server: {
7 port: 5173,
8 strictPort: true,
9 open: true,
10 proxy: {
11 '/guess-market': 'http://localhost:8080',
12 },
13 },
14});