Spaces:
Running
Running
Commit ·
6367981
1
Parent(s): 537347e
update: sync from starry 2026-04-23
Browse files- Rebuild frontend, omr bundle, cluster-server
- Rename seed scores: 巴赫→Bach BWV 790, Chopin Nocturnes→Chopin Op.27 No.2
- Expand seed-data.sql.gz: full solution_cache (910K rows, 61MB)
- Fix Dockerfile: add proxy ARGs, ca-certificates, seed COPY lines
- Update .gitignore: exclude __pycache__, .umi cache, python .env
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +5 -0
- Dockerfile +13 -0
- backend/cluster-server/dist/tsconfig.build.tsbuildinfo +0 -0
- backend/cluster-server/package-lock.json +0 -0
- backend/omr-service/package-lock.json +243 -416
- backend/omr-service/src/db/backfillHash.ts +117 -0
- backend/omr-service/src/db/migrate.ts +16 -0
- backend/omr-service/src/lib/regulateWithProgress.ts +4 -3
- backend/omr-service/src/routes/issueMeasures.ts +26 -5
- backend/omr-service/src/routes/tag.ts +0 -1
- backend/omr-service/src/scripts/score-hashes.ts +40 -0
- backend/omr-service/src/services/issueMeasure.service.ts +51 -12
- backend/omr-service/src/services/measure.service.ts +17 -2
- backend/omr-service/src/services/predictor.service.ts +3 -2
- backend/omr-service/src/services/solutionCache.service.ts +7 -2
- backend/omr/dist/gauge-server.js +1 -1
- backend/omr/dist/gauge-server.js.map +1 -1
- backend/omr/dist/index.js +0 -0
- backend/omr/dist/index.js.map +0 -0
- backend/omr/dist/regulator.d.ts +15 -15
- backend/omr/dist/regulator.js +99 -31
- backend/omr/dist/regulator.js.map +0 -0
- backend/omr/dist/worker.js +9 -9
- backend/omr/dist/worker.js.map +0 -0
- backend/python-services/services/layout_service.py +2 -1
- dist/assets/DeleteOutlined-1f8a2958.js +1 -0
- dist/assets/PlaySquareOutlined-c471435e.js +1 -0
- dist/assets/ScoreEncoder-da446433.js +0 -0
- dist/assets/Table-2648cf63.js +0 -0
- dist/assets/Table-42978533.css +0 -0
- dist/assets/Table-5199d45f.css +0 -0
- dist/assets/Table-5d4bbec4.js +0 -0
- dist/assets/Tags-7859f157.js +1 -0
- dist/assets/Tags-d90bdcf5.js +0 -1
- dist/assets/_setToString-038b76d7.js +0 -0
- dist/assets/_setToString-2991057b.js +0 -0
- dist/assets/{button-95279f00.js → button-eb671c5b.js} +2 -2
- dist/assets/confirm-345857b8.js +0 -0
- dist/assets/confirm-e4ccfd64.js +0 -0
- dist/assets/{font-eb3b2c70.js → font-e9e03177.js} +1 -1
- dist/assets/{gauge-aae36b83.js → gauge-ab1f0653.js} +1 -1
- dist/assets/gaugeRendererGL-41abf4c6.js +0 -82
- dist/assets/gaugeRendererGL-9dc55e03.js +82 -0
- dist/assets/index-054c816b.js +1 -0
- dist/assets/index-11d8c807.css +1 -0
- dist/assets/index-16c0d1b2.js +0 -1
- dist/assets/{index-345e5e52.js → index-22b5485d.js} +0 -0
- dist/assets/{index-5e62e59b.js → index-38b3d0db.js} +5 -5
- dist/assets/index-3ac22147.js +1 -0
- dist/assets/index-3adfbdb0.css +1 -0
.gitignore
CHANGED
|
@@ -1,3 +1,8 @@
|
|
| 1 |
node_modules/
|
| 2 |
*.log
|
| 3 |
prepare.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
node_modules/
|
| 2 |
*.log
|
| 3 |
prepare.sh
|
| 4 |
+
__pycache__/
|
| 5 |
+
*.pyc
|
| 6 |
+
*.pyo
|
| 7 |
+
backend/omr-service/src/.umi/
|
| 8 |
+
backend/python-services/.env
|
Dockerfile
CHANGED
|
@@ -17,8 +17,18 @@ FROM node:20-slim
|
|
| 17 |
|
| 18 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# --- System deps ---
|
| 21 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
| 22 |
postgresql postgresql-client \
|
| 23 |
nginx \
|
| 24 |
tini \
|
|
@@ -46,6 +56,9 @@ RUN pip install --no-cache-dir --break-system-packages \
|
|
| 46 |
pyzmq>=22.0.0 \
|
| 47 |
msgpack>=1.0.0
|
| 48 |
|
|
|
|
|
|
|
|
|
|
| 49 |
ENV TF_USE_LEGACY_KERAS=1
|
| 50 |
ENV PYTHONUNBUFFERED=1
|
| 51 |
|
|
|
|
| 17 |
|
| 18 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 19 |
|
| 20 |
+
# Build-time proxy — pass via --build-arg; transparent proxy, not MITM
|
| 21 |
+
ARG HTTP_PROXY
|
| 22 |
+
ARG HTTPS_PROXY
|
| 23 |
+
ARG http_proxy
|
| 24 |
+
ARG https_proxy
|
| 25 |
+
# Export for all RUN commands during build
|
| 26 |
+
ENV http_proxy=${http_proxy:-$HTTP_PROXY} \
|
| 27 |
+
https_proxy=${https_proxy:-$HTTPS_PROXY}
|
| 28 |
+
|
| 29 |
# --- System deps ---
|
| 30 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 31 |
+
ca-certificates \
|
| 32 |
postgresql postgresql-client \
|
| 33 |
nginx \
|
| 34 |
tini \
|
|
|
|
| 56 |
pyzmq>=22.0.0 \
|
| 57 |
msgpack>=1.0.0
|
| 58 |
|
| 59 |
+
# Clear proxy from final image env
|
| 60 |
+
ENV http_proxy= https_proxy=
|
| 61 |
+
|
| 62 |
ENV TF_USE_LEGACY_KERAS=1
|
| 63 |
ENV PYTHONUNBUFFERED=1
|
| 64 |
|
backend/cluster-server/dist/tsconfig.build.tsbuildinfo
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/cluster-server/package-lock.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/omr-service/package-lock.json
CHANGED
|
@@ -60,6 +60,34 @@
|
|
| 60 |
"node": ">= 14"
|
| 61 |
}
|
| 62 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
"node_modules/@emnapi/runtime": {
|
| 64 |
"version": "1.8.1",
|
| 65 |
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz",
|
|
@@ -70,9 +98,9 @@
|
|
| 70 |
}
|
| 71 |
},
|
| 72 |
"node_modules/@esbuild/aix-ppc64": {
|
| 73 |
-
"version": "0.27.
|
| 74 |
-
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.
|
| 75 |
-
"integrity": "sha512-
|
| 76 |
"cpu": [
|
| 77 |
"ppc64"
|
| 78 |
],
|
|
@@ -86,9 +114,9 @@
|
|
| 86 |
}
|
| 87 |
},
|
| 88 |
"node_modules/@esbuild/android-arm": {
|
| 89 |
-
"version": "0.27.
|
| 90 |
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.
|
| 91 |
-
"integrity": "sha512-
|
| 92 |
"cpu": [
|
| 93 |
"arm"
|
| 94 |
],
|
|
@@ -102,9 +130,9 @@
|
|
| 102 |
}
|
| 103 |
},
|
| 104 |
"node_modules/@esbuild/android-arm64": {
|
| 105 |
-
"version": "0.27.
|
| 106 |
-
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.
|
| 107 |
-
"integrity": "sha512-
|
| 108 |
"cpu": [
|
| 109 |
"arm64"
|
| 110 |
],
|
|
@@ -118,9 +146,9 @@
|
|
| 118 |
}
|
| 119 |
},
|
| 120 |
"node_modules/@esbuild/android-x64": {
|
| 121 |
-
"version": "0.27.
|
| 122 |
-
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.
|
| 123 |
-
"integrity": "sha512-
|
| 124 |
"cpu": [
|
| 125 |
"x64"
|
| 126 |
],
|
|
@@ -134,9 +162,9 @@
|
|
| 134 |
}
|
| 135 |
},
|
| 136 |
"node_modules/@esbuild/darwin-arm64": {
|
| 137 |
-
"version": "0.27.
|
| 138 |
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.
|
| 139 |
-
"integrity": "sha512-
|
| 140 |
"cpu": [
|
| 141 |
"arm64"
|
| 142 |
],
|
|
@@ -150,9 +178,9 @@
|
|
| 150 |
}
|
| 151 |
},
|
| 152 |
"node_modules/@esbuild/darwin-x64": {
|
| 153 |
-
"version": "0.27.
|
| 154 |
-
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.
|
| 155 |
-
"integrity": "sha512-
|
| 156 |
"cpu": [
|
| 157 |
"x64"
|
| 158 |
],
|
|
@@ -166,9 +194,9 @@
|
|
| 166 |
}
|
| 167 |
},
|
| 168 |
"node_modules/@esbuild/freebsd-arm64": {
|
| 169 |
-
"version": "0.27.
|
| 170 |
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.
|
| 171 |
-
"integrity": "sha512-
|
| 172 |
"cpu": [
|
| 173 |
"arm64"
|
| 174 |
],
|
|
@@ -182,9 +210,9 @@
|
|
| 182 |
}
|
| 183 |
},
|
| 184 |
"node_modules/@esbuild/freebsd-x64": {
|
| 185 |
-
"version": "0.27.
|
| 186 |
-
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.
|
| 187 |
-
"integrity": "sha512-
|
| 188 |
"cpu": [
|
| 189 |
"x64"
|
| 190 |
],
|
|
@@ -198,9 +226,9 @@
|
|
| 198 |
}
|
| 199 |
},
|
| 200 |
"node_modules/@esbuild/linux-arm": {
|
| 201 |
-
"version": "0.27.
|
| 202 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.
|
| 203 |
-
"integrity": "sha512-
|
| 204 |
"cpu": [
|
| 205 |
"arm"
|
| 206 |
],
|
|
@@ -214,9 +242,9 @@
|
|
| 214 |
}
|
| 215 |
},
|
| 216 |
"node_modules/@esbuild/linux-arm64": {
|
| 217 |
-
"version": "0.27.
|
| 218 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.
|
| 219 |
-
"integrity": "sha512-
|
| 220 |
"cpu": [
|
| 221 |
"arm64"
|
| 222 |
],
|
|
@@ -230,9 +258,9 @@
|
|
| 230 |
}
|
| 231 |
},
|
| 232 |
"node_modules/@esbuild/linux-ia32": {
|
| 233 |
-
"version": "0.27.
|
| 234 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.
|
| 235 |
-
"integrity": "sha512-
|
| 236 |
"cpu": [
|
| 237 |
"ia32"
|
| 238 |
],
|
|
@@ -246,9 +274,9 @@
|
|
| 246 |
}
|
| 247 |
},
|
| 248 |
"node_modules/@esbuild/linux-loong64": {
|
| 249 |
-
"version": "0.27.
|
| 250 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.
|
| 251 |
-
"integrity": "sha512-
|
| 252 |
"cpu": [
|
| 253 |
"loong64"
|
| 254 |
],
|
|
@@ -262,9 +290,9 @@
|
|
| 262 |
}
|
| 263 |
},
|
| 264 |
"node_modules/@esbuild/linux-mips64el": {
|
| 265 |
-
"version": "0.27.
|
| 266 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.
|
| 267 |
-
"integrity": "sha512-
|
| 268 |
"cpu": [
|
| 269 |
"mips64el"
|
| 270 |
],
|
|
@@ -278,9 +306,9 @@
|
|
| 278 |
}
|
| 279 |
},
|
| 280 |
"node_modules/@esbuild/linux-ppc64": {
|
| 281 |
-
"version": "0.27.
|
| 282 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.
|
| 283 |
-
"integrity": "sha512-
|
| 284 |
"cpu": [
|
| 285 |
"ppc64"
|
| 286 |
],
|
|
@@ -294,9 +322,9 @@
|
|
| 294 |
}
|
| 295 |
},
|
| 296 |
"node_modules/@esbuild/linux-riscv64": {
|
| 297 |
-
"version": "0.27.
|
| 298 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.
|
| 299 |
-
"integrity": "sha512-
|
| 300 |
"cpu": [
|
| 301 |
"riscv64"
|
| 302 |
],
|
|
@@ -310,9 +338,9 @@
|
|
| 310 |
}
|
| 311 |
},
|
| 312 |
"node_modules/@esbuild/linux-s390x": {
|
| 313 |
-
"version": "0.27.
|
| 314 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.
|
| 315 |
-
"integrity": "sha512-
|
| 316 |
"cpu": [
|
| 317 |
"s390x"
|
| 318 |
],
|
|
@@ -326,9 +354,9 @@
|
|
| 326 |
}
|
| 327 |
},
|
| 328 |
"node_modules/@esbuild/linux-x64": {
|
| 329 |
-
"version": "0.27.
|
| 330 |
-
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.
|
| 331 |
-
"integrity": "sha512-
|
| 332 |
"cpu": [
|
| 333 |
"x64"
|
| 334 |
],
|
|
@@ -342,9 +370,9 @@
|
|
| 342 |
}
|
| 343 |
},
|
| 344 |
"node_modules/@esbuild/netbsd-arm64": {
|
| 345 |
-
"version": "0.27.
|
| 346 |
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.
|
| 347 |
-
"integrity": "sha512-
|
| 348 |
"cpu": [
|
| 349 |
"arm64"
|
| 350 |
],
|
|
@@ -358,9 +386,9 @@
|
|
| 358 |
}
|
| 359 |
},
|
| 360 |
"node_modules/@esbuild/netbsd-x64": {
|
| 361 |
-
"version": "0.27.
|
| 362 |
-
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.
|
| 363 |
-
"integrity": "sha512-
|
| 364 |
"cpu": [
|
| 365 |
"x64"
|
| 366 |
],
|
|
@@ -374,9 +402,9 @@
|
|
| 374 |
}
|
| 375 |
},
|
| 376 |
"node_modules/@esbuild/openbsd-arm64": {
|
| 377 |
-
"version": "0.27.
|
| 378 |
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.
|
| 379 |
-
"integrity": "sha512-
|
| 380 |
"cpu": [
|
| 381 |
"arm64"
|
| 382 |
],
|
|
@@ -390,9 +418,9 @@
|
|
| 390 |
}
|
| 391 |
},
|
| 392 |
"node_modules/@esbuild/openbsd-x64": {
|
| 393 |
-
"version": "0.27.
|
| 394 |
-
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.
|
| 395 |
-
"integrity": "sha512-
|
| 396 |
"cpu": [
|
| 397 |
"x64"
|
| 398 |
],
|
|
@@ -406,9 +434,9 @@
|
|
| 406 |
}
|
| 407 |
},
|
| 408 |
"node_modules/@esbuild/openharmony-arm64": {
|
| 409 |
-
"version": "0.27.
|
| 410 |
-
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.
|
| 411 |
-
"integrity": "sha512-
|
| 412 |
"cpu": [
|
| 413 |
"arm64"
|
| 414 |
],
|
|
@@ -422,9 +450,9 @@
|
|
| 422 |
}
|
| 423 |
},
|
| 424 |
"node_modules/@esbuild/sunos-x64": {
|
| 425 |
-
"version": "0.27.
|
| 426 |
-
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.
|
| 427 |
-
"integrity": "sha512-
|
| 428 |
"cpu": [
|
| 429 |
"x64"
|
| 430 |
],
|
|
@@ -438,9 +466,9 @@
|
|
| 438 |
}
|
| 439 |
},
|
| 440 |
"node_modules/@esbuild/win32-arm64": {
|
| 441 |
-
"version": "0.27.
|
| 442 |
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.
|
| 443 |
-
"integrity": "sha512-
|
| 444 |
"cpu": [
|
| 445 |
"arm64"
|
| 446 |
],
|
|
@@ -454,9 +482,9 @@
|
|
| 454 |
}
|
| 455 |
},
|
| 456 |
"node_modules/@esbuild/win32-ia32": {
|
| 457 |
-
"version": "0.27.
|
| 458 |
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.
|
| 459 |
-
"integrity": "sha512-
|
| 460 |
"cpu": [
|
| 461 |
"ia32"
|
| 462 |
],
|
|
@@ -470,9 +498,9 @@
|
|
| 470 |
}
|
| 471 |
},
|
| 472 |
"node_modules/@esbuild/win32-x64": {
|
| 473 |
-
"version": "0.27.
|
| 474 |
-
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.
|
| 475 |
-
"integrity": "sha512-
|
| 476 |
"cpu": [
|
| 477 |
"x64"
|
| 478 |
],
|
|
@@ -601,6 +629,31 @@
|
|
| 601 |
"p-limit": "^3.1.0"
|
| 602 |
}
|
| 603 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
"node_modules/@fastify/websocket": {
|
| 605 |
"version": "10.0.1",
|
| 606 |
"resolved": "https://registry.npmjs.org/@fastify/websocket/-/websocket-10.0.1.tgz",
|
|
@@ -1511,9 +1564,9 @@
|
|
| 1511 |
"dev": true
|
| 1512 |
},
|
| 1513 |
"node_modules/@types/node": {
|
| 1514 |
-
"version": "20.19.
|
| 1515 |
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.
|
| 1516 |
-
"integrity": "sha512-
|
| 1517 |
"dev": true,
|
| 1518 |
"dependencies": {
|
| 1519 |
"undici-types": "~6.21.0"
|
|
@@ -1564,33 +1617,6 @@
|
|
| 1564 |
"url": "https://opencollective.com/vitest"
|
| 1565 |
}
|
| 1566 |
},
|
| 1567 |
-
"node_modules/@vitest/runner/node_modules/p-limit": {
|
| 1568 |
-
"version": "5.0.0",
|
| 1569 |
-
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz",
|
| 1570 |
-
"integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==",
|
| 1571 |
-
"dev": true,
|
| 1572 |
-
"dependencies": {
|
| 1573 |
-
"yocto-queue": "^1.0.0"
|
| 1574 |
-
},
|
| 1575 |
-
"engines": {
|
| 1576 |
-
"node": ">=18"
|
| 1577 |
-
},
|
| 1578 |
-
"funding": {
|
| 1579 |
-
"url": "https://github.com/sponsors/sindresorhus"
|
| 1580 |
-
}
|
| 1581 |
-
},
|
| 1582 |
-
"node_modules/@vitest/runner/node_modules/yocto-queue": {
|
| 1583 |
-
"version": "1.2.2",
|
| 1584 |
-
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz",
|
| 1585 |
-
"integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==",
|
| 1586 |
-
"dev": true,
|
| 1587 |
-
"engines": {
|
| 1588 |
-
"node": ">=12.20"
|
| 1589 |
-
},
|
| 1590 |
-
"funding": {
|
| 1591 |
-
"url": "https://github.com/sponsors/sindresorhus"
|
| 1592 |
-
}
|
| 1593 |
-
},
|
| 1594 |
"node_modules/@vitest/snapshot": {
|
| 1595 |
"version": "1.6.1",
|
| 1596 |
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.1.tgz",
|
|
@@ -1677,14 +1703,6 @@
|
|
| 1677 |
"node": ">=0.4.0"
|
| 1678 |
}
|
| 1679 |
},
|
| 1680 |
-
"node_modules/adm-zip": {
|
| 1681 |
-
"version": "0.5.16",
|
| 1682 |
-
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz",
|
| 1683 |
-
"integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==",
|
| 1684 |
-
"engines": {
|
| 1685 |
-
"node": ">=12.0"
|
| 1686 |
-
}
|
| 1687 |
-
},
|
| 1688 |
"node_modules/agent-base": {
|
| 1689 |
"version": "6.0.2",
|
| 1690 |
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
|
@@ -1697,9 +1715,9 @@
|
|
| 1697 |
}
|
| 1698 |
},
|
| 1699 |
"node_modules/ajv": {
|
| 1700 |
-
"version": "8.
|
| 1701 |
-
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.
|
| 1702 |
-
"integrity": "sha512-
|
| 1703 |
"dependencies": {
|
| 1704 |
"fast-deep-equal": "^3.1.3",
|
| 1705 |
"fast-uri": "^3.0.1",
|
|
@@ -1780,6 +1798,19 @@
|
|
| 1780 |
"node": ">=10"
|
| 1781 |
}
|
| 1782 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1783 |
"node_modules/assertion-error": {
|
| 1784 |
"version": "1.1.0",
|
| 1785 |
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
|
@@ -1835,12 +1866,6 @@
|
|
| 1835 |
}
|
| 1836 |
]
|
| 1837 |
},
|
| 1838 |
-
"node_modules/boolean": {
|
| 1839 |
-
"version": "3.2.0",
|
| 1840 |
-
"resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",
|
| 1841 |
-
"integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",
|
| 1842 |
-
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."
|
| 1843 |
-
},
|
| 1844 |
"node_modules/brace-expansion": {
|
| 1845 |
"version": "2.0.2",
|
| 1846 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
|
@@ -2034,38 +2059,6 @@
|
|
| 2034 |
"node": ">=6"
|
| 2035 |
}
|
| 2036 |
},
|
| 2037 |
-
"node_modules/define-data-property": {
|
| 2038 |
-
"version": "1.1.4",
|
| 2039 |
-
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
|
| 2040 |
-
"integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
|
| 2041 |
-
"dependencies": {
|
| 2042 |
-
"es-define-property": "^1.0.0",
|
| 2043 |
-
"es-errors": "^1.3.0",
|
| 2044 |
-
"gopd": "^1.0.1"
|
| 2045 |
-
},
|
| 2046 |
-
"engines": {
|
| 2047 |
-
"node": ">= 0.4"
|
| 2048 |
-
},
|
| 2049 |
-
"funding": {
|
| 2050 |
-
"url": "https://github.com/sponsors/ljharb"
|
| 2051 |
-
}
|
| 2052 |
-
},
|
| 2053 |
-
"node_modules/define-properties": {
|
| 2054 |
-
"version": "1.2.1",
|
| 2055 |
-
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
|
| 2056 |
-
"integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",
|
| 2057 |
-
"dependencies": {
|
| 2058 |
-
"define-data-property": "^1.0.1",
|
| 2059 |
-
"has-property-descriptors": "^1.0.0",
|
| 2060 |
-
"object-keys": "^1.1.1"
|
| 2061 |
-
},
|
| 2062 |
-
"engines": {
|
| 2063 |
-
"node": ">= 0.4"
|
| 2064 |
-
},
|
| 2065 |
-
"funding": {
|
| 2066 |
-
"url": "https://github.com/sponsors/ljharb"
|
| 2067 |
-
}
|
| 2068 |
-
},
|
| 2069 |
"node_modules/delegates": {
|
| 2070 |
"version": "1.0.0",
|
| 2071 |
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
|
@@ -2087,11 +2080,6 @@
|
|
| 2087 |
"node": ">=8"
|
| 2088 |
}
|
| 2089 |
},
|
| 2090 |
-
"node_modules/detect-node": {
|
| 2091 |
-
"version": "2.1.0",
|
| 2092 |
-
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
|
| 2093 |
-
"integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g=="
|
| 2094 |
-
},
|
| 2095 |
"node_modules/diff-sequences": {
|
| 2096 |
"version": "29.6.3",
|
| 2097 |
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz",
|
|
@@ -2123,6 +2111,19 @@
|
|
| 2123 |
"stream-shift": "^1.0.2"
|
| 2124 |
}
|
| 2125 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2126 |
"node_modules/emoji-regex": {
|
| 2127 |
"version": "8.0.0",
|
| 2128 |
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
|
@@ -2136,31 +2137,10 @@
|
|
| 2136 |
"once": "^1.4.0"
|
| 2137 |
}
|
| 2138 |
},
|
| 2139 |
-
"node_modules/es-define-property": {
|
| 2140 |
-
"version": "1.0.1",
|
| 2141 |
-
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
| 2142 |
-
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
| 2143 |
-
"engines": {
|
| 2144 |
-
"node": ">= 0.4"
|
| 2145 |
-
}
|
| 2146 |
-
},
|
| 2147 |
-
"node_modules/es-errors": {
|
| 2148 |
-
"version": "1.3.0",
|
| 2149 |
-
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
| 2150 |
-
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
| 2151 |
-
"engines": {
|
| 2152 |
-
"node": ">= 0.4"
|
| 2153 |
-
}
|
| 2154 |
-
},
|
| 2155 |
-
"node_modules/es6-error": {
|
| 2156 |
-
"version": "4.1.1",
|
| 2157 |
-
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
|
| 2158 |
-
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg=="
|
| 2159 |
-
},
|
| 2160 |
"node_modules/esbuild": {
|
| 2161 |
-
"version": "0.27.
|
| 2162 |
-
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.
|
| 2163 |
-
"integrity": "sha512-
|
| 2164 |
"dev": true,
|
| 2165 |
"hasInstallScript": true,
|
| 2166 |
"bin": {
|
|
@@ -2170,32 +2150,32 @@
|
|
| 2170 |
"node": ">=18"
|
| 2171 |
},
|
| 2172 |
"optionalDependencies": {
|
| 2173 |
-
"@esbuild/aix-ppc64": "0.27.
|
| 2174 |
-
"@esbuild/android-arm": "0.27.
|
| 2175 |
-
"@esbuild/android-arm64": "0.27.
|
| 2176 |
-
"@esbuild/android-x64": "0.27.
|
| 2177 |
-
"@esbuild/darwin-arm64": "0.27.
|
| 2178 |
-
"@esbuild/darwin-x64": "0.27.
|
| 2179 |
-
"@esbuild/freebsd-arm64": "0.27.
|
| 2180 |
-
"@esbuild/freebsd-x64": "0.27.
|
| 2181 |
-
"@esbuild/linux-arm": "0.27.
|
| 2182 |
-
"@esbuild/linux-arm64": "0.27.
|
| 2183 |
-
"@esbuild/linux-ia32": "0.27.
|
| 2184 |
-
"@esbuild/linux-loong64": "0.27.
|
| 2185 |
-
"@esbuild/linux-mips64el": "0.27.
|
| 2186 |
-
"@esbuild/linux-ppc64": "0.27.
|
| 2187 |
-
"@esbuild/linux-riscv64": "0.27.
|
| 2188 |
-
"@esbuild/linux-s390x": "0.27.
|
| 2189 |
-
"@esbuild/linux-x64": "0.27.
|
| 2190 |
-
"@esbuild/netbsd-arm64": "0.27.
|
| 2191 |
-
"@esbuild/netbsd-x64": "0.27.
|
| 2192 |
-
"@esbuild/openbsd-arm64": "0.27.
|
| 2193 |
-
"@esbuild/openbsd-x64": "0.27.
|
| 2194 |
-
"@esbuild/openharmony-arm64": "0.27.
|
| 2195 |
-
"@esbuild/sunos-x64": "0.27.
|
| 2196 |
-
"@esbuild/win32-arm64": "0.27.
|
| 2197 |
-
"@esbuild/win32-ia32": "0.27.
|
| 2198 |
-
"@esbuild/win32-x64": "0.27.
|
| 2199 |
}
|
| 2200 |
},
|
| 2201 |
"node_modules/escape-html": {
|
|
@@ -2203,17 +2183,6 @@
|
|
| 2203 |
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
| 2204 |
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
|
| 2205 |
},
|
| 2206 |
-
"node_modules/escape-string-regexp": {
|
| 2207 |
-
"version": "4.0.0",
|
| 2208 |
-
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
|
| 2209 |
-
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
|
| 2210 |
-
"engines": {
|
| 2211 |
-
"node": ">=10"
|
| 2212 |
-
},
|
| 2213 |
-
"funding": {
|
| 2214 |
-
"url": "https://github.com/sponsors/sindresorhus"
|
| 2215 |
-
}
|
| 2216 |
-
},
|
| 2217 |
"node_modules/estree-walker": {
|
| 2218 |
"version": "3.0.3",
|
| 2219 |
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
|
@@ -2262,18 +2231,6 @@
|
|
| 2262 |
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
| 2263 |
}
|
| 2264 |
},
|
| 2265 |
-
"node_modules/execa/node_modules/signal-exit": {
|
| 2266 |
-
"version": "4.1.0",
|
| 2267 |
-
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
| 2268 |
-
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
| 2269 |
-
"dev": true,
|
| 2270 |
-
"engines": {
|
| 2271 |
-
"node": ">=14"
|
| 2272 |
-
},
|
| 2273 |
-
"funding": {
|
| 2274 |
-
"url": "https://github.com/sponsors/isaacs"
|
| 2275 |
-
}
|
| 2276 |
-
},
|
| 2277 |
"node_modules/fast-content-type-parse": {
|
| 2278 |
"version": "1.1.0",
|
| 2279 |
"resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz",
|
|
@@ -2433,9 +2390,9 @@
|
|
| 2433 |
]
|
| 2434 |
},
|
| 2435 |
"node_modules/fastify/node_modules/sonic-boom": {
|
| 2436 |
-
"version": "4.2.
|
| 2437 |
-
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.
|
| 2438 |
-
"integrity": "sha512-
|
| 2439 |
"dependencies": {
|
| 2440 |
"atomic-sleep": "^1.0.0"
|
| 2441 |
}
|
|
@@ -2538,6 +2495,11 @@
|
|
| 2538 |
"node": ">=10"
|
| 2539 |
}
|
| 2540 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2541 |
"node_modules/get-func-name": {
|
| 2542 |
"version": "2.0.2",
|
| 2543 |
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
|
|
@@ -2560,9 +2522,9 @@
|
|
| 2560 |
}
|
| 2561 |
},
|
| 2562 |
"node_modules/get-tsconfig": {
|
| 2563 |
-
"version": "4.13.
|
| 2564 |
-
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.
|
| 2565 |
-
"integrity": "sha512-
|
| 2566 |
"dev": true,
|
| 2567 |
"dependencies": {
|
| 2568 |
"resolve-pkg-maps": "^1.0.0"
|
|
@@ -2590,59 +2552,6 @@
|
|
| 2590 |
"url": "https://github.com/sponsors/isaacs"
|
| 2591 |
}
|
| 2592 |
},
|
| 2593 |
-
"node_modules/global-agent": {
|
| 2594 |
-
"version": "3.0.0",
|
| 2595 |
-
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
|
| 2596 |
-
"integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==",
|
| 2597 |
-
"dependencies": {
|
| 2598 |
-
"boolean": "^3.0.1",
|
| 2599 |
-
"es6-error": "^4.1.1",
|
| 2600 |
-
"matcher": "^3.0.0",
|
| 2601 |
-
"roarr": "^2.15.3",
|
| 2602 |
-
"semver": "^7.3.2",
|
| 2603 |
-
"serialize-error": "^7.0.1"
|
| 2604 |
-
},
|
| 2605 |
-
"engines": {
|
| 2606 |
-
"node": ">=10.0"
|
| 2607 |
-
}
|
| 2608 |
-
},
|
| 2609 |
-
"node_modules/globalthis": {
|
| 2610 |
-
"version": "1.0.4",
|
| 2611 |
-
"resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
|
| 2612 |
-
"integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
|
| 2613 |
-
"dependencies": {
|
| 2614 |
-
"define-properties": "^1.2.1",
|
| 2615 |
-
"gopd": "^1.0.1"
|
| 2616 |
-
},
|
| 2617 |
-
"engines": {
|
| 2618 |
-
"node": ">= 0.4"
|
| 2619 |
-
},
|
| 2620 |
-
"funding": {
|
| 2621 |
-
"url": "https://github.com/sponsors/ljharb"
|
| 2622 |
-
}
|
| 2623 |
-
},
|
| 2624 |
-
"node_modules/gopd": {
|
| 2625 |
-
"version": "1.2.0",
|
| 2626 |
-
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
| 2627 |
-
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
| 2628 |
-
"engines": {
|
| 2629 |
-
"node": ">= 0.4"
|
| 2630 |
-
},
|
| 2631 |
-
"funding": {
|
| 2632 |
-
"url": "https://github.com/sponsors/ljharb"
|
| 2633 |
-
}
|
| 2634 |
-
},
|
| 2635 |
-
"node_modules/has-property-descriptors": {
|
| 2636 |
-
"version": "1.0.2",
|
| 2637 |
-
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
|
| 2638 |
-
"integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
|
| 2639 |
-
"dependencies": {
|
| 2640 |
-
"es-define-property": "^1.0.0"
|
| 2641 |
-
},
|
| 2642 |
-
"funding": {
|
| 2643 |
-
"url": "https://github.com/sponsors/ljharb"
|
| 2644 |
-
}
|
| 2645 |
-
},
|
| 2646 |
"node_modules/has-unicode": {
|
| 2647 |
"version": "2.0.1",
|
| 2648 |
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
|
@@ -2771,11 +2680,6 @@
|
|
| 2771 |
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
| 2772 |
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
|
| 2773 |
},
|
| 2774 |
-
"node_modules/json-stringify-safe": {
|
| 2775 |
-
"version": "5.0.1",
|
| 2776 |
-
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
| 2777 |
-
"integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="
|
| 2778 |
-
},
|
| 2779 |
"node_modules/light-my-request": {
|
| 2780 |
"version": "5.14.0",
|
| 2781 |
"resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.14.0.tgz",
|
|
@@ -2842,17 +2746,6 @@
|
|
| 2842 |
"semver": "bin/semver.js"
|
| 2843 |
}
|
| 2844 |
},
|
| 2845 |
-
"node_modules/matcher": {
|
| 2846 |
-
"version": "3.0.0",
|
| 2847 |
-
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
|
| 2848 |
-
"integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
|
| 2849 |
-
"dependencies": {
|
| 2850 |
-
"escape-string-regexp": "^4.0.0"
|
| 2851 |
-
},
|
| 2852 |
-
"engines": {
|
| 2853 |
-
"node": ">=10"
|
| 2854 |
-
}
|
| 2855 |
-
},
|
| 2856 |
"node_modules/merge-stream": {
|
| 2857 |
"version": "2.0.0",
|
| 2858 |
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
|
@@ -3126,14 +3019,6 @@
|
|
| 3126 |
"node": ">=0.10.0"
|
| 3127 |
}
|
| 3128 |
},
|
| 3129 |
-
"node_modules/object-keys": {
|
| 3130 |
-
"version": "1.1.1",
|
| 3131 |
-
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
| 3132 |
-
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
|
| 3133 |
-
"engines": {
|
| 3134 |
-
"node": ">= 0.4"
|
| 3135 |
-
}
|
| 3136 |
-
},
|
| 3137 |
"node_modules/obliterator": {
|
| 3138 |
"version": "2.0.5",
|
| 3139 |
"resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.5.tgz",
|
|
@@ -3171,35 +3056,33 @@
|
|
| 3171 |
}
|
| 3172 |
},
|
| 3173 |
"node_modules/onnxruntime-common": {
|
| 3174 |
-
"version": "1.
|
| 3175 |
-
"resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.
|
| 3176 |
-
"integrity": "sha512-
|
| 3177 |
},
|
| 3178 |
"node_modules/onnxruntime-node": {
|
| 3179 |
-
"version": "1.
|
| 3180 |
-
"resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.
|
| 3181 |
-
"integrity": "sha512-
|
| 3182 |
-
"hasInstallScript": true,
|
| 3183 |
"os": [
|
| 3184 |
"win32",
|
| 3185 |
"darwin",
|
| 3186 |
"linux"
|
| 3187 |
],
|
| 3188 |
"dependencies": {
|
| 3189 |
-
"
|
| 3190 |
-
"global-agent": "^3.0.0",
|
| 3191 |
-
"onnxruntime-common": "1.24.1"
|
| 3192 |
}
|
| 3193 |
},
|
| 3194 |
"node_modules/p-limit": {
|
| 3195 |
-
"version": "
|
| 3196 |
-
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-
|
| 3197 |
-
"integrity": "sha512-
|
|
|
|
| 3198 |
"dependencies": {
|
| 3199 |
-
"yocto-queue": "^
|
| 3200 |
},
|
| 3201 |
"engines": {
|
| 3202 |
-
"node": ">=
|
| 3203 |
},
|
| 3204 |
"funding": {
|
| 3205 |
"url": "https://github.com/sponsors/sindresorhus"
|
|
@@ -3364,21 +3247,6 @@
|
|
| 3364 |
"split2": "^4.0.0"
|
| 3365 |
}
|
| 3366 |
},
|
| 3367 |
-
"node_modules/pino-abstract-transport/node_modules/readable-stream": {
|
| 3368 |
-
"version": "4.7.0",
|
| 3369 |
-
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz",
|
| 3370 |
-
"integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==",
|
| 3371 |
-
"dependencies": {
|
| 3372 |
-
"abort-controller": "^3.0.0",
|
| 3373 |
-
"buffer": "^6.0.3",
|
| 3374 |
-
"events": "^3.3.0",
|
| 3375 |
-
"process": "^0.11.10",
|
| 3376 |
-
"string_decoder": "^1.3.0"
|
| 3377 |
-
},
|
| 3378 |
-
"engines": {
|
| 3379 |
-
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
| 3380 |
-
}
|
| 3381 |
-
},
|
| 3382 |
"node_modules/pino-std-serializers": {
|
| 3383 |
"version": "6.2.2",
|
| 3384 |
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz",
|
|
@@ -3515,16 +3383,18 @@
|
|
| 3515 |
"dev": true
|
| 3516 |
},
|
| 3517 |
"node_modules/readable-stream": {
|
| 3518 |
-
"version": "
|
| 3519 |
-
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-
|
| 3520 |
-
"integrity": "sha512-
|
| 3521 |
"dependencies": {
|
| 3522 |
-
"
|
| 3523 |
-
"
|
| 3524 |
-
"
|
|
|
|
|
|
|
| 3525 |
},
|
| 3526 |
"engines": {
|
| 3527 |
-
"node": ">=
|
| 3528 |
}
|
| 3529 |
},
|
| 3530 |
"node_modules/real-require": {
|
|
@@ -3629,22 +3499,6 @@
|
|
| 3629 |
"node": "*"
|
| 3630 |
}
|
| 3631 |
},
|
| 3632 |
-
"node_modules/roarr": {
|
| 3633 |
-
"version": "2.15.4",
|
| 3634 |
-
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
|
| 3635 |
-
"integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==",
|
| 3636 |
-
"dependencies": {
|
| 3637 |
-
"boolean": "^3.0.1",
|
| 3638 |
-
"detect-node": "^2.0.4",
|
| 3639 |
-
"globalthis": "^1.0.1",
|
| 3640 |
-
"json-stringify-safe": "^5.0.1",
|
| 3641 |
-
"semver-compare": "^1.0.0",
|
| 3642 |
-
"sprintf-js": "^1.1.2"
|
| 3643 |
-
},
|
| 3644 |
-
"engines": {
|
| 3645 |
-
"node": ">=8.0"
|
| 3646 |
-
}
|
| 3647 |
-
},
|
| 3648 |
"node_modules/rollup": {
|
| 3649 |
"version": "4.57.1",
|
| 3650 |
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",
|
|
@@ -3730,9 +3584,9 @@
|
|
| 3730 |
"integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="
|
| 3731 |
},
|
| 3732 |
"node_modules/semver": {
|
| 3733 |
-
"version": "7.7.
|
| 3734 |
-
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.
|
| 3735 |
-
"integrity": "sha512-
|
| 3736 |
"bin": {
|
| 3737 |
"semver": "bin/semver.js"
|
| 3738 |
},
|
|
@@ -3740,25 +3594,6 @@
|
|
| 3740 |
"node": ">=10"
|
| 3741 |
}
|
| 3742 |
},
|
| 3743 |
-
"node_modules/semver-compare": {
|
| 3744 |
-
"version": "1.0.0",
|
| 3745 |
-
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
|
| 3746 |
-
"integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow=="
|
| 3747 |
-
},
|
| 3748 |
-
"node_modules/serialize-error": {
|
| 3749 |
-
"version": "7.0.1",
|
| 3750 |
-
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
|
| 3751 |
-
"integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
|
| 3752 |
-
"dependencies": {
|
| 3753 |
-
"type-fest": "^0.13.1"
|
| 3754 |
-
},
|
| 3755 |
-
"engines": {
|
| 3756 |
-
"node": ">=10"
|
| 3757 |
-
},
|
| 3758 |
-
"funding": {
|
| 3759 |
-
"url": "https://github.com/sponsors/sindresorhus"
|
| 3760 |
-
}
|
| 3761 |
-
},
|
| 3762 |
"node_modules/set-blocking": {
|
| 3763 |
"version": "2.0.0",
|
| 3764 |
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
|
@@ -3845,9 +3680,16 @@
|
|
| 3845 |
"dev": true
|
| 3846 |
},
|
| 3847 |
"node_modules/signal-exit": {
|
| 3848 |
-
"version": "
|
| 3849 |
-
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-
|
| 3850 |
-
"integrity": "sha512-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3851 |
},
|
| 3852 |
"node_modules/simple-concat": {
|
| 3853 |
"version": "1.0.1",
|
|
@@ -3931,11 +3773,6 @@
|
|
| 3931 |
"node": ">= 10.x"
|
| 3932 |
}
|
| 3933 |
},
|
| 3934 |
-
"node_modules/sprintf-js": {
|
| 3935 |
-
"version": "1.1.3",
|
| 3936 |
-
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
|
| 3937 |
-
"integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA=="
|
| 3938 |
-
},
|
| 3939 |
"node_modules/stackback": {
|
| 3940 |
"version": "0.0.2",
|
| 3941 |
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
|
|
@@ -4141,17 +3978,6 @@
|
|
| 4141 |
"node": ">=4"
|
| 4142 |
}
|
| 4143 |
},
|
| 4144 |
-
"node_modules/type-fest": {
|
| 4145 |
-
"version": "0.13.1",
|
| 4146 |
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
|
| 4147 |
-
"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
|
| 4148 |
-
"engines": {
|
| 4149 |
-
"node": ">=10"
|
| 4150 |
-
},
|
| 4151 |
-
"funding": {
|
| 4152 |
-
"url": "https://github.com/sponsors/sindresorhus"
|
| 4153 |
-
}
|
| 4154 |
-
},
|
| 4155 |
"node_modules/typescript": {
|
| 4156 |
"version": "5.9.3",
|
| 4157 |
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
@@ -4843,11 +4669,12 @@
|
|
| 4843 |
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
| 4844 |
},
|
| 4845 |
"node_modules/yocto-queue": {
|
| 4846 |
-
"version": "
|
| 4847 |
-
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-
|
| 4848 |
-
"integrity": "sha512-
|
|
|
|
| 4849 |
"engines": {
|
| 4850 |
-
"node": ">=
|
| 4851 |
},
|
| 4852 |
"funding": {
|
| 4853 |
"url": "https://github.com/sponsors/sindresorhus"
|
|
|
|
| 60 |
"node": ">= 14"
|
| 61 |
}
|
| 62 |
},
|
| 63 |
+
"../omr-lite": {
|
| 64 |
+
"name": "starry-omr-lite",
|
| 65 |
+
"version": "1.0.0",
|
| 66 |
+
"extraneous": true,
|
| 67 |
+
"license": "ISC",
|
| 68 |
+
"devDependencies": {
|
| 69 |
+
"@rollup/plugin-commonjs": "^21.1.0",
|
| 70 |
+
"@rollup/plugin-json": "^5.0.2",
|
| 71 |
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
| 72 |
+
"@rollup/plugin-typescript": "^10.0.1",
|
| 73 |
+
"@types/three": "^0.139.0",
|
| 74 |
+
"cpy-cli": "^4.1.0",
|
| 75 |
+
"cross-env": "^7.0.3",
|
| 76 |
+
"dts-cli": "^1.5.1",
|
| 77 |
+
"rimraf": "^3.0.2",
|
| 78 |
+
"rollup": "^2.77.4-1",
|
| 79 |
+
"rollup-plugin-dts": "^5.0.0",
|
| 80 |
+
"rollup-plugin-node-polyfills": "^0.2.1",
|
| 81 |
+
"rollup-plugin-terser": "^7.0.2",
|
| 82 |
+
"rollup-plugin-ts": "^3.0.2",
|
| 83 |
+
"ts-node": "^10.4.0",
|
| 84 |
+
"typescript": "^4.9.4",
|
| 85 |
+
"yargs": "^17.3.1"
|
| 86 |
+
},
|
| 87 |
+
"engines": {
|
| 88 |
+
"node": ">= 14"
|
| 89 |
+
}
|
| 90 |
+
},
|
| 91 |
"node_modules/@emnapi/runtime": {
|
| 92 |
"version": "1.8.1",
|
| 93 |
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.8.1.tgz",
|
|
|
|
| 98 |
}
|
| 99 |
},
|
| 100 |
"node_modules/@esbuild/aix-ppc64": {
|
| 101 |
+
"version": "0.27.2",
|
| 102 |
+
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz",
|
| 103 |
+
"integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==",
|
| 104 |
"cpu": [
|
| 105 |
"ppc64"
|
| 106 |
],
|
|
|
|
| 114 |
}
|
| 115 |
},
|
| 116 |
"node_modules/@esbuild/android-arm": {
|
| 117 |
+
"version": "0.27.2",
|
| 118 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz",
|
| 119 |
+
"integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==",
|
| 120 |
"cpu": [
|
| 121 |
"arm"
|
| 122 |
],
|
|
|
|
| 130 |
}
|
| 131 |
},
|
| 132 |
"node_modules/@esbuild/android-arm64": {
|
| 133 |
+
"version": "0.27.2",
|
| 134 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz",
|
| 135 |
+
"integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==",
|
| 136 |
"cpu": [
|
| 137 |
"arm64"
|
| 138 |
],
|
|
|
|
| 146 |
}
|
| 147 |
},
|
| 148 |
"node_modules/@esbuild/android-x64": {
|
| 149 |
+
"version": "0.27.2",
|
| 150 |
+
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz",
|
| 151 |
+
"integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==",
|
| 152 |
"cpu": [
|
| 153 |
"x64"
|
| 154 |
],
|
|
|
|
| 162 |
}
|
| 163 |
},
|
| 164 |
"node_modules/@esbuild/darwin-arm64": {
|
| 165 |
+
"version": "0.27.2",
|
| 166 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz",
|
| 167 |
+
"integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==",
|
| 168 |
"cpu": [
|
| 169 |
"arm64"
|
| 170 |
],
|
|
|
|
| 178 |
}
|
| 179 |
},
|
| 180 |
"node_modules/@esbuild/darwin-x64": {
|
| 181 |
+
"version": "0.27.2",
|
| 182 |
+
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz",
|
| 183 |
+
"integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==",
|
| 184 |
"cpu": [
|
| 185 |
"x64"
|
| 186 |
],
|
|
|
|
| 194 |
}
|
| 195 |
},
|
| 196 |
"node_modules/@esbuild/freebsd-arm64": {
|
| 197 |
+
"version": "0.27.2",
|
| 198 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz",
|
| 199 |
+
"integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==",
|
| 200 |
"cpu": [
|
| 201 |
"arm64"
|
| 202 |
],
|
|
|
|
| 210 |
}
|
| 211 |
},
|
| 212 |
"node_modules/@esbuild/freebsd-x64": {
|
| 213 |
+
"version": "0.27.2",
|
| 214 |
+
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz",
|
| 215 |
+
"integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==",
|
| 216 |
"cpu": [
|
| 217 |
"x64"
|
| 218 |
],
|
|
|
|
| 226 |
}
|
| 227 |
},
|
| 228 |
"node_modules/@esbuild/linux-arm": {
|
| 229 |
+
"version": "0.27.2",
|
| 230 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz",
|
| 231 |
+
"integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==",
|
| 232 |
"cpu": [
|
| 233 |
"arm"
|
| 234 |
],
|
|
|
|
| 242 |
}
|
| 243 |
},
|
| 244 |
"node_modules/@esbuild/linux-arm64": {
|
| 245 |
+
"version": "0.27.2",
|
| 246 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz",
|
| 247 |
+
"integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==",
|
| 248 |
"cpu": [
|
| 249 |
"arm64"
|
| 250 |
],
|
|
|
|
| 258 |
}
|
| 259 |
},
|
| 260 |
"node_modules/@esbuild/linux-ia32": {
|
| 261 |
+
"version": "0.27.2",
|
| 262 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz",
|
| 263 |
+
"integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==",
|
| 264 |
"cpu": [
|
| 265 |
"ia32"
|
| 266 |
],
|
|
|
|
| 274 |
}
|
| 275 |
},
|
| 276 |
"node_modules/@esbuild/linux-loong64": {
|
| 277 |
+
"version": "0.27.2",
|
| 278 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz",
|
| 279 |
+
"integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==",
|
| 280 |
"cpu": [
|
| 281 |
"loong64"
|
| 282 |
],
|
|
|
|
| 290 |
}
|
| 291 |
},
|
| 292 |
"node_modules/@esbuild/linux-mips64el": {
|
| 293 |
+
"version": "0.27.2",
|
| 294 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz",
|
| 295 |
+
"integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==",
|
| 296 |
"cpu": [
|
| 297 |
"mips64el"
|
| 298 |
],
|
|
|
|
| 306 |
}
|
| 307 |
},
|
| 308 |
"node_modules/@esbuild/linux-ppc64": {
|
| 309 |
+
"version": "0.27.2",
|
| 310 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz",
|
| 311 |
+
"integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==",
|
| 312 |
"cpu": [
|
| 313 |
"ppc64"
|
| 314 |
],
|
|
|
|
| 322 |
}
|
| 323 |
},
|
| 324 |
"node_modules/@esbuild/linux-riscv64": {
|
| 325 |
+
"version": "0.27.2",
|
| 326 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz",
|
| 327 |
+
"integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==",
|
| 328 |
"cpu": [
|
| 329 |
"riscv64"
|
| 330 |
],
|
|
|
|
| 338 |
}
|
| 339 |
},
|
| 340 |
"node_modules/@esbuild/linux-s390x": {
|
| 341 |
+
"version": "0.27.2",
|
| 342 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz",
|
| 343 |
+
"integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==",
|
| 344 |
"cpu": [
|
| 345 |
"s390x"
|
| 346 |
],
|
|
|
|
| 354 |
}
|
| 355 |
},
|
| 356 |
"node_modules/@esbuild/linux-x64": {
|
| 357 |
+
"version": "0.27.2",
|
| 358 |
+
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz",
|
| 359 |
+
"integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==",
|
| 360 |
"cpu": [
|
| 361 |
"x64"
|
| 362 |
],
|
|
|
|
| 370 |
}
|
| 371 |
},
|
| 372 |
"node_modules/@esbuild/netbsd-arm64": {
|
| 373 |
+
"version": "0.27.2",
|
| 374 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz",
|
| 375 |
+
"integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==",
|
| 376 |
"cpu": [
|
| 377 |
"arm64"
|
| 378 |
],
|
|
|
|
| 386 |
}
|
| 387 |
},
|
| 388 |
"node_modules/@esbuild/netbsd-x64": {
|
| 389 |
+
"version": "0.27.2",
|
| 390 |
+
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz",
|
| 391 |
+
"integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==",
|
| 392 |
"cpu": [
|
| 393 |
"x64"
|
| 394 |
],
|
|
|
|
| 402 |
}
|
| 403 |
},
|
| 404 |
"node_modules/@esbuild/openbsd-arm64": {
|
| 405 |
+
"version": "0.27.2",
|
| 406 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz",
|
| 407 |
+
"integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==",
|
| 408 |
"cpu": [
|
| 409 |
"arm64"
|
| 410 |
],
|
|
|
|
| 418 |
}
|
| 419 |
},
|
| 420 |
"node_modules/@esbuild/openbsd-x64": {
|
| 421 |
+
"version": "0.27.2",
|
| 422 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz",
|
| 423 |
+
"integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==",
|
| 424 |
"cpu": [
|
| 425 |
"x64"
|
| 426 |
],
|
|
|
|
| 434 |
}
|
| 435 |
},
|
| 436 |
"node_modules/@esbuild/openharmony-arm64": {
|
| 437 |
+
"version": "0.27.2",
|
| 438 |
+
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz",
|
| 439 |
+
"integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==",
|
| 440 |
"cpu": [
|
| 441 |
"arm64"
|
| 442 |
],
|
|
|
|
| 450 |
}
|
| 451 |
},
|
| 452 |
"node_modules/@esbuild/sunos-x64": {
|
| 453 |
+
"version": "0.27.2",
|
| 454 |
+
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz",
|
| 455 |
+
"integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==",
|
| 456 |
"cpu": [
|
| 457 |
"x64"
|
| 458 |
],
|
|
|
|
| 466 |
}
|
| 467 |
},
|
| 468 |
"node_modules/@esbuild/win32-arm64": {
|
| 469 |
+
"version": "0.27.2",
|
| 470 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz",
|
| 471 |
+
"integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==",
|
| 472 |
"cpu": [
|
| 473 |
"arm64"
|
| 474 |
],
|
|
|
|
| 482 |
}
|
| 483 |
},
|
| 484 |
"node_modules/@esbuild/win32-ia32": {
|
| 485 |
+
"version": "0.27.2",
|
| 486 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz",
|
| 487 |
+
"integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==",
|
| 488 |
"cpu": [
|
| 489 |
"ia32"
|
| 490 |
],
|
|
|
|
| 498 |
}
|
| 499 |
},
|
| 500 |
"node_modules/@esbuild/win32-x64": {
|
| 501 |
+
"version": "0.27.2",
|
| 502 |
+
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz",
|
| 503 |
+
"integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==",
|
| 504 |
"cpu": [
|
| 505 |
"x64"
|
| 506 |
],
|
|
|
|
| 629 |
"p-limit": "^3.1.0"
|
| 630 |
}
|
| 631 |
},
|
| 632 |
+
"node_modules/@fastify/static/node_modules/p-limit": {
|
| 633 |
+
"version": "3.1.0",
|
| 634 |
+
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
| 635 |
+
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
|
| 636 |
+
"dependencies": {
|
| 637 |
+
"yocto-queue": "^0.1.0"
|
| 638 |
+
},
|
| 639 |
+
"engines": {
|
| 640 |
+
"node": ">=10"
|
| 641 |
+
},
|
| 642 |
+
"funding": {
|
| 643 |
+
"url": "https://github.com/sponsors/sindresorhus"
|
| 644 |
+
}
|
| 645 |
+
},
|
| 646 |
+
"node_modules/@fastify/static/node_modules/yocto-queue": {
|
| 647 |
+
"version": "0.1.0",
|
| 648 |
+
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
| 649 |
+
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
|
| 650 |
+
"engines": {
|
| 651 |
+
"node": ">=10"
|
| 652 |
+
},
|
| 653 |
+
"funding": {
|
| 654 |
+
"url": "https://github.com/sponsors/sindresorhus"
|
| 655 |
+
}
|
| 656 |
+
},
|
| 657 |
"node_modules/@fastify/websocket": {
|
| 658 |
"version": "10.0.1",
|
| 659 |
"resolved": "https://registry.npmjs.org/@fastify/websocket/-/websocket-10.0.1.tgz",
|
|
|
|
| 1564 |
"dev": true
|
| 1565 |
},
|
| 1566 |
"node_modules/@types/node": {
|
| 1567 |
+
"version": "20.19.31",
|
| 1568 |
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.31.tgz",
|
| 1569 |
+
"integrity": "sha512-5jsi0wpncvTD33Sh1UCgacK37FFwDn+EG7wCmEvs62fCvBL+n8/76cAYDok21NF6+jaVWIqKwCZyX7Vbu8eB3A==",
|
| 1570 |
"dev": true,
|
| 1571 |
"dependencies": {
|
| 1572 |
"undici-types": "~6.21.0"
|
|
|
|
| 1617 |
"url": "https://opencollective.com/vitest"
|
| 1618 |
}
|
| 1619 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1620 |
"node_modules/@vitest/snapshot": {
|
| 1621 |
"version": "1.6.1",
|
| 1622 |
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.1.tgz",
|
|
|
|
| 1703 |
"node": ">=0.4.0"
|
| 1704 |
}
|
| 1705 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1706 |
"node_modules/agent-base": {
|
| 1707 |
"version": "6.0.2",
|
| 1708 |
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
|
|
|
| 1715 |
}
|
| 1716 |
},
|
| 1717 |
"node_modules/ajv": {
|
| 1718 |
+
"version": "8.17.1",
|
| 1719 |
+
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
| 1720 |
+
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
| 1721 |
"dependencies": {
|
| 1722 |
"fast-deep-equal": "^3.1.3",
|
| 1723 |
"fast-uri": "^3.0.1",
|
|
|
|
| 1798 |
"node": ">=10"
|
| 1799 |
}
|
| 1800 |
},
|
| 1801 |
+
"node_modules/are-we-there-yet/node_modules/readable-stream": {
|
| 1802 |
+
"version": "3.6.2",
|
| 1803 |
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
| 1804 |
+
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
| 1805 |
+
"dependencies": {
|
| 1806 |
+
"inherits": "^2.0.3",
|
| 1807 |
+
"string_decoder": "^1.1.1",
|
| 1808 |
+
"util-deprecate": "^1.0.1"
|
| 1809 |
+
},
|
| 1810 |
+
"engines": {
|
| 1811 |
+
"node": ">= 6"
|
| 1812 |
+
}
|
| 1813 |
+
},
|
| 1814 |
"node_modules/assertion-error": {
|
| 1815 |
"version": "1.1.0",
|
| 1816 |
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
|
|
|
| 1866 |
}
|
| 1867 |
]
|
| 1868 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1869 |
"node_modules/brace-expansion": {
|
| 1870 |
"version": "2.0.2",
|
| 1871 |
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
|
|
|
| 2059 |
"node": ">=6"
|
| 2060 |
}
|
| 2061 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2062 |
"node_modules/delegates": {
|
| 2063 |
"version": "1.0.0",
|
| 2064 |
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
|
|
|
| 2080 |
"node": ">=8"
|
| 2081 |
}
|
| 2082 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2083 |
"node_modules/diff-sequences": {
|
| 2084 |
"version": "29.6.3",
|
| 2085 |
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz",
|
|
|
|
| 2111 |
"stream-shift": "^1.0.2"
|
| 2112 |
}
|
| 2113 |
},
|
| 2114 |
+
"node_modules/duplexify/node_modules/readable-stream": {
|
| 2115 |
+
"version": "3.6.2",
|
| 2116 |
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
| 2117 |
+
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
| 2118 |
+
"dependencies": {
|
| 2119 |
+
"inherits": "^2.0.3",
|
| 2120 |
+
"string_decoder": "^1.1.1",
|
| 2121 |
+
"util-deprecate": "^1.0.1"
|
| 2122 |
+
},
|
| 2123 |
+
"engines": {
|
| 2124 |
+
"node": ">= 6"
|
| 2125 |
+
}
|
| 2126 |
+
},
|
| 2127 |
"node_modules/emoji-regex": {
|
| 2128 |
"version": "8.0.0",
|
| 2129 |
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
|
|
|
| 2137 |
"once": "^1.4.0"
|
| 2138 |
}
|
| 2139 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2140 |
"node_modules/esbuild": {
|
| 2141 |
+
"version": "0.27.2",
|
| 2142 |
+
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
|
| 2143 |
+
"integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==",
|
| 2144 |
"dev": true,
|
| 2145 |
"hasInstallScript": true,
|
| 2146 |
"bin": {
|
|
|
|
| 2150 |
"node": ">=18"
|
| 2151 |
},
|
| 2152 |
"optionalDependencies": {
|
| 2153 |
+
"@esbuild/aix-ppc64": "0.27.2",
|
| 2154 |
+
"@esbuild/android-arm": "0.27.2",
|
| 2155 |
+
"@esbuild/android-arm64": "0.27.2",
|
| 2156 |
+
"@esbuild/android-x64": "0.27.2",
|
| 2157 |
+
"@esbuild/darwin-arm64": "0.27.2",
|
| 2158 |
+
"@esbuild/darwin-x64": "0.27.2",
|
| 2159 |
+
"@esbuild/freebsd-arm64": "0.27.2",
|
| 2160 |
+
"@esbuild/freebsd-x64": "0.27.2",
|
| 2161 |
+
"@esbuild/linux-arm": "0.27.2",
|
| 2162 |
+
"@esbuild/linux-arm64": "0.27.2",
|
| 2163 |
+
"@esbuild/linux-ia32": "0.27.2",
|
| 2164 |
+
"@esbuild/linux-loong64": "0.27.2",
|
| 2165 |
+
"@esbuild/linux-mips64el": "0.27.2",
|
| 2166 |
+
"@esbuild/linux-ppc64": "0.27.2",
|
| 2167 |
+
"@esbuild/linux-riscv64": "0.27.2",
|
| 2168 |
+
"@esbuild/linux-s390x": "0.27.2",
|
| 2169 |
+
"@esbuild/linux-x64": "0.27.2",
|
| 2170 |
+
"@esbuild/netbsd-arm64": "0.27.2",
|
| 2171 |
+
"@esbuild/netbsd-x64": "0.27.2",
|
| 2172 |
+
"@esbuild/openbsd-arm64": "0.27.2",
|
| 2173 |
+
"@esbuild/openbsd-x64": "0.27.2",
|
| 2174 |
+
"@esbuild/openharmony-arm64": "0.27.2",
|
| 2175 |
+
"@esbuild/sunos-x64": "0.27.2",
|
| 2176 |
+
"@esbuild/win32-arm64": "0.27.2",
|
| 2177 |
+
"@esbuild/win32-ia32": "0.27.2",
|
| 2178 |
+
"@esbuild/win32-x64": "0.27.2"
|
| 2179 |
}
|
| 2180 |
},
|
| 2181 |
"node_modules/escape-html": {
|
|
|
|
| 2183 |
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
| 2184 |
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
|
| 2185 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2186 |
"node_modules/estree-walker": {
|
| 2187 |
"version": "3.0.3",
|
| 2188 |
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
|
|
|
|
| 2231 |
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
| 2232 |
}
|
| 2233 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2234 |
"node_modules/fast-content-type-parse": {
|
| 2235 |
"version": "1.1.0",
|
| 2236 |
"resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz",
|
|
|
|
| 2390 |
]
|
| 2391 |
},
|
| 2392 |
"node_modules/fastify/node_modules/sonic-boom": {
|
| 2393 |
+
"version": "4.2.0",
|
| 2394 |
+
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz",
|
| 2395 |
+
"integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==",
|
| 2396 |
"dependencies": {
|
| 2397 |
"atomic-sleep": "^1.0.0"
|
| 2398 |
}
|
|
|
|
| 2495 |
"node": ">=10"
|
| 2496 |
}
|
| 2497 |
},
|
| 2498 |
+
"node_modules/gauge/node_modules/signal-exit": {
|
| 2499 |
+
"version": "3.0.7",
|
| 2500 |
+
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
| 2501 |
+
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
| 2502 |
+
},
|
| 2503 |
"node_modules/get-func-name": {
|
| 2504 |
"version": "2.0.2",
|
| 2505 |
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
|
|
|
|
| 2522 |
}
|
| 2523 |
},
|
| 2524 |
"node_modules/get-tsconfig": {
|
| 2525 |
+
"version": "4.13.1",
|
| 2526 |
+
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.1.tgz",
|
| 2527 |
+
"integrity": "sha512-EoY1N2xCn44xU6750Sx7OjOIT59FkmstNc3X6y5xpz7D5cBtZRe/3pSlTkDJgqsOk3WwZPkWfonhhUJfttQo3w==",
|
| 2528 |
"dev": true,
|
| 2529 |
"dependencies": {
|
| 2530 |
"resolve-pkg-maps": "^1.0.0"
|
|
|
|
| 2552 |
"url": "https://github.com/sponsors/isaacs"
|
| 2553 |
}
|
| 2554 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2555 |
"node_modules/has-unicode": {
|
| 2556 |
"version": "2.0.1",
|
| 2557 |
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
|
|
|
| 2680 |
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
| 2681 |
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
|
| 2682 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2683 |
"node_modules/light-my-request": {
|
| 2684 |
"version": "5.14.0",
|
| 2685 |
"resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.14.0.tgz",
|
|
|
|
| 2746 |
"semver": "bin/semver.js"
|
| 2747 |
}
|
| 2748 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2749 |
"node_modules/merge-stream": {
|
| 2750 |
"version": "2.0.0",
|
| 2751 |
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
|
|
|
| 3019 |
"node": ">=0.10.0"
|
| 3020 |
}
|
| 3021 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3022 |
"node_modules/obliterator": {
|
| 3023 |
"version": "2.0.5",
|
| 3024 |
"resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.5.tgz",
|
|
|
|
| 3056 |
}
|
| 3057 |
},
|
| 3058 |
"node_modules/onnxruntime-common": {
|
| 3059 |
+
"version": "1.12.1",
|
| 3060 |
+
"resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.12.1.tgz",
|
| 3061 |
+
"integrity": "sha512-tWr/9nkQtzc61SH6zSE+3j2/HWBLgVcrXqS5HqQFitJ6hYNmNDcXwV2LYtFDH6CB9Qg987BMMv0ldaDUdB78VA=="
|
| 3062 |
},
|
| 3063 |
"node_modules/onnxruntime-node": {
|
| 3064 |
+
"version": "1.12.1",
|
| 3065 |
+
"resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.12.1.tgz",
|
| 3066 |
+
"integrity": "sha512-H06kB4tRcZf93YDipL2nG5Oqs8WGhZzpWMgWUhH8r6ciGTZ85JrZpHuqRIabTS6Rls/IjbnBcrPXYPZnSgXqkQ==",
|
|
|
|
| 3067 |
"os": [
|
| 3068 |
"win32",
|
| 3069 |
"darwin",
|
| 3070 |
"linux"
|
| 3071 |
],
|
| 3072 |
"dependencies": {
|
| 3073 |
+
"onnxruntime-common": "~1.12.1"
|
|
|
|
|
|
|
| 3074 |
}
|
| 3075 |
},
|
| 3076 |
"node_modules/p-limit": {
|
| 3077 |
+
"version": "5.0.0",
|
| 3078 |
+
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz",
|
| 3079 |
+
"integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==",
|
| 3080 |
+
"dev": true,
|
| 3081 |
"dependencies": {
|
| 3082 |
+
"yocto-queue": "^1.0.0"
|
| 3083 |
},
|
| 3084 |
"engines": {
|
| 3085 |
+
"node": ">=18"
|
| 3086 |
},
|
| 3087 |
"funding": {
|
| 3088 |
"url": "https://github.com/sponsors/sindresorhus"
|
|
|
|
| 3247 |
"split2": "^4.0.0"
|
| 3248 |
}
|
| 3249 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3250 |
"node_modules/pino-std-serializers": {
|
| 3251 |
"version": "6.2.2",
|
| 3252 |
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz",
|
|
|
|
| 3383 |
"dev": true
|
| 3384 |
},
|
| 3385 |
"node_modules/readable-stream": {
|
| 3386 |
+
"version": "4.7.0",
|
| 3387 |
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz",
|
| 3388 |
+
"integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==",
|
| 3389 |
"dependencies": {
|
| 3390 |
+
"abort-controller": "^3.0.0",
|
| 3391 |
+
"buffer": "^6.0.3",
|
| 3392 |
+
"events": "^3.3.0",
|
| 3393 |
+
"process": "^0.11.10",
|
| 3394 |
+
"string_decoder": "^1.3.0"
|
| 3395 |
},
|
| 3396 |
"engines": {
|
| 3397 |
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
| 3398 |
}
|
| 3399 |
},
|
| 3400 |
"node_modules/real-require": {
|
|
|
|
| 3499 |
"node": "*"
|
| 3500 |
}
|
| 3501 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3502 |
"node_modules/rollup": {
|
| 3503 |
"version": "4.57.1",
|
| 3504 |
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",
|
|
|
|
| 3584 |
"integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="
|
| 3585 |
},
|
| 3586 |
"node_modules/semver": {
|
| 3587 |
+
"version": "7.7.3",
|
| 3588 |
+
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
| 3589 |
+
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
|
| 3590 |
"bin": {
|
| 3591 |
"semver": "bin/semver.js"
|
| 3592 |
},
|
|
|
|
| 3594 |
"node": ">=10"
|
| 3595 |
}
|
| 3596 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3597 |
"node_modules/set-blocking": {
|
| 3598 |
"version": "2.0.0",
|
| 3599 |
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
|
|
|
| 3680 |
"dev": true
|
| 3681 |
},
|
| 3682 |
"node_modules/signal-exit": {
|
| 3683 |
+
"version": "4.1.0",
|
| 3684 |
+
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
| 3685 |
+
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
| 3686 |
+
"dev": true,
|
| 3687 |
+
"engines": {
|
| 3688 |
+
"node": ">=14"
|
| 3689 |
+
},
|
| 3690 |
+
"funding": {
|
| 3691 |
+
"url": "https://github.com/sponsors/isaacs"
|
| 3692 |
+
}
|
| 3693 |
},
|
| 3694 |
"node_modules/simple-concat": {
|
| 3695 |
"version": "1.0.1",
|
|
|
|
| 3773 |
"node": ">= 10.x"
|
| 3774 |
}
|
| 3775 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3776 |
"node_modules/stackback": {
|
| 3777 |
"version": "0.0.2",
|
| 3778 |
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
|
|
|
|
| 3978 |
"node": ">=4"
|
| 3979 |
}
|
| 3980 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3981 |
"node_modules/typescript": {
|
| 3982 |
"version": "5.9.3",
|
| 3983 |
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
|
|
|
| 4669 |
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
| 4670 |
},
|
| 4671 |
"node_modules/yocto-queue": {
|
| 4672 |
+
"version": "1.2.2",
|
| 4673 |
+
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz",
|
| 4674 |
+
"integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==",
|
| 4675 |
+
"dev": true,
|
| 4676 |
"engines": {
|
| 4677 |
+
"node": ">=12.20"
|
| 4678 |
},
|
| 4679 |
"funding": {
|
| 4680 |
"url": "https://github.com/sponsors/sindresorhus"
|
backend/omr-service/src/db/backfillHash.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { starry } from 'starry-omr';
|
| 2 |
+
import { pool } from './client.js';
|
| 3 |
+
|
| 4 |
+
const BATCH_SIZE = 500;
|
| 5 |
+
|
| 6 |
+
async function backfillHash() {
|
| 7 |
+
console.log('Backfilling hash for issue_measures...');
|
| 8 |
+
|
| 9 |
+
let updated = 0;
|
| 10 |
+
let failed = 0;
|
| 11 |
+
let duplicateConflicts = 0;
|
| 12 |
+
|
| 13 |
+
// Phase 1: Compute hashes in memory (without writing) to detect duplicates first
|
| 14 |
+
console.log('Phase 1: Computing hashes...');
|
| 15 |
+
const hashMap = new Map<string, { id: string; hash: string; score_id: string; measure_index: number; updated_at: Date }[]>();
|
| 16 |
+
let lastId = '00000000-0000-0000-0000-000000000000';
|
| 17 |
+
|
| 18 |
+
while (true) {
|
| 19 |
+
const { rows } = await pool.query(
|
| 20 |
+
'SELECT id, score_id, measure_index, measure, status, updated_at FROM issue_measures WHERE hash IS NULL AND id > $1 ORDER BY id LIMIT $2',
|
| 21 |
+
[lastId, BATCH_SIZE]
|
| 22 |
+
);
|
| 23 |
+
|
| 24 |
+
if (rows.length === 0) break;
|
| 25 |
+
|
| 26 |
+
console.log(` Computing batch of ${rows.length} rows (after id ${lastId.slice(0, 8)}...)...`);
|
| 27 |
+
|
| 28 |
+
for (const row of rows) {
|
| 29 |
+
try {
|
| 30 |
+
const recovered = starry.recoverJSON(row.measure, starry);
|
| 31 |
+
const hash = recovered.regulationHash0;
|
| 32 |
+
if (!hash) {
|
| 33 |
+
console.warn(` Row ${row.id}: no regulationHash0, skipping`);
|
| 34 |
+
failed++;
|
| 35 |
+
continue;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
const key = `${row.score_id}::${hash}`;
|
| 39 |
+
if (!hashMap.has(key)) hashMap.set(key, []);
|
| 40 |
+
hashMap.get(key)!.push({ id: row.id, hash, score_id: row.score_id, measure_index: row.measure_index, updated_at: row.updated_at });
|
| 41 |
+
} catch (err: any) {
|
| 42 |
+
console.error(` Row ${row.id}: ${err.message}`);
|
| 43 |
+
failed++;
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
lastId = rows[rows.length - 1].id;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
console.log(` Computed ${hashMap.size} unique (score_id, hash) groups from NULL-hash rows.`);
|
| 51 |
+
|
| 52 |
+
// Phase 2: Check which hashes already exist (from previously backfilled rows)
|
| 53 |
+
const allHashes = [...new Set([...hashMap.values()].flat().map((r) => r.hash))];
|
| 54 |
+
const { rows: existingRows } = await pool.query('SELECT id, score_id, hash, updated_at FROM issue_measures WHERE hash = ANY($1) AND status > 0', [
|
| 55 |
+
allHashes,
|
| 56 |
+
]);
|
| 57 |
+
const existingSet = new Set(existingRows.map((r) => `${r.score_id}::${r.hash}`));
|
| 58 |
+
console.log(` ${existingSet.size} hashes already exist in DB from previous backfill.`);
|
| 59 |
+
|
| 60 |
+
// Phase 3: For each group, decide what to keep and write
|
| 61 |
+
console.log('\nPhase 2: Writing hashes and deduplicating...');
|
| 62 |
+
|
| 63 |
+
for (const [key, rows] of hashMap) {
|
| 64 |
+
const alreadyExists = existingSet.has(key);
|
| 65 |
+
|
| 66 |
+
if (rows.length === 1 && !alreadyExists) {
|
| 67 |
+
// Simple case: single row, no conflict
|
| 68 |
+
try {
|
| 69 |
+
await pool.query('UPDATE issue_measures SET hash = $1 WHERE id = $2', [rows[0].hash, rows[0].id]);
|
| 70 |
+
updated++;
|
| 71 |
+
} catch (err: any) {
|
| 72 |
+
console.error(` Row ${rows[0].id}: ${err.message}`);
|
| 73 |
+
failed++;
|
| 74 |
+
}
|
| 75 |
+
} else {
|
| 76 |
+
// Duplicate case: multiple NULL-hash rows map to same (score_id, hash),
|
| 77 |
+
// or a row with this hash already exists.
|
| 78 |
+
// Sort by updated_at DESC to find the best candidate
|
| 79 |
+
rows.sort((a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime());
|
| 80 |
+
|
| 81 |
+
if (alreadyExists) {
|
| 82 |
+
// All NULL-hash rows are duplicates of an already-backfilled row; delete them all
|
| 83 |
+
const idsToDelete = rows.map((r) => r.id);
|
| 84 |
+
console.log(` ${key}: already exists, deleting ${idsToDelete.length} duplicate NULL-hash rows`);
|
| 85 |
+
await pool.query('DELETE FROM issue_measures WHERE id = ANY($1)', [idsToDelete]);
|
| 86 |
+
duplicateConflicts += idsToDelete.length;
|
| 87 |
+
} else {
|
| 88 |
+
// Keep the most recent, update its hash, delete the rest
|
| 89 |
+
const keeper = rows[0];
|
| 90 |
+
const idsToDelete = rows.slice(1).map((r) => r.id);
|
| 91 |
+
try {
|
| 92 |
+
await pool.query('UPDATE issue_measures SET hash = $1 WHERE id = $2', [keeper.hash, keeper.id]);
|
| 93 |
+
updated++;
|
| 94 |
+
} catch (err: any) {
|
| 95 |
+
console.error(` Row ${keeper.id}: ${err.message}`);
|
| 96 |
+
failed++;
|
| 97 |
+
}
|
| 98 |
+
if (idsToDelete.length > 0) {
|
| 99 |
+
console.log(` ${key}: keeping ${keeper.id.slice(0, 8)}, deleting ${idsToDelete.length} duplicates`);
|
| 100 |
+
await pool.query('DELETE FROM issue_measures WHERE id = ANY($1)', [idsToDelete]);
|
| 101 |
+
duplicateConflicts += idsToDelete.length;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
console.log(`\nUpdated: ${updated}, Failed: ${failed}, Duplicates removed: ${duplicateConflicts}`);
|
| 108 |
+
|
| 109 |
+
console.log('\nBackfill complete.');
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
backfillHash()
|
| 113 |
+
.then(() => process.exit(0))
|
| 114 |
+
.catch((err) => {
|
| 115 |
+
console.error('Backfill failed:', err);
|
| 116 |
+
process.exit(1);
|
| 117 |
+
});
|
backend/omr-service/src/db/migrate.ts
CHANGED
|
@@ -133,6 +133,22 @@ const migrations = [
|
|
| 133 |
ALTER TABLE issue_measures ADD COLUMN IF NOT EXISTS annotator VARCHAR(100);
|
| 134 |
`,
|
| 135 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
];
|
| 137 |
|
| 138 |
async function runMigrations() {
|
|
|
|
| 133 |
ALTER TABLE issue_measures ADD COLUMN IF NOT EXISTS annotator VARCHAR(100);
|
| 134 |
`,
|
| 135 |
},
|
| 136 |
+
{
|
| 137 |
+
name: '009_add_hash_to_issue_measures',
|
| 138 |
+
sql: `
|
| 139 |
+
ALTER TABLE issue_measures ADD COLUMN IF NOT EXISTS hash VARCHAR(64);
|
| 140 |
+
CREATE INDEX IF NOT EXISTS idx_issue_measures_hash_active
|
| 141 |
+
ON issue_measures(hash) WHERE status > 0 AND hash IS NOT NULL;
|
| 142 |
+
`,
|
| 143 |
+
},
|
| 144 |
+
{
|
| 145 |
+
name: '010_switch_issue_measures_unique_index',
|
| 146 |
+
sql: `
|
| 147 |
+
DROP INDEX IF EXISTS idx_issue_measures_score_measure;
|
| 148 |
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_issue_measures_score_hash
|
| 149 |
+
ON issue_measures(score_id, hash) WHERE status > 0 AND hash IS NOT NULL;
|
| 150 |
+
`,
|
| 151 |
+
},
|
| 152 |
];
|
| 153 |
|
| 154 |
async function runMigrations() {
|
backend/omr-service/src/lib/regulateWithProgress.ts
CHANGED
|
@@ -76,14 +76,15 @@ export async function regulateScoreWithProgress(scoreId: string): Promise<void>
|
|
| 76 |
});
|
| 77 |
},
|
| 78 |
onSaveIssueMeasure: (data) => {
|
|
|
|
|
|
|
| 79 |
issueMeasureService
|
| 80 |
-
.upsert(scoreId,
|
| 81 |
.catch((err: any) => console.error('[regulateWithProgress] failed to save issue measure:', err));
|
| 82 |
},
|
| 83 |
});
|
| 84 |
|
| 85 |
-
//
|
| 86 |
-
await scoreService.updateScore(scoreId, { data: (score as any).toJSON() });
|
| 87 |
|
| 88 |
// 6. Broadcast completed
|
| 89 |
broadcast(scoreId, { type: 'completed', scoreId, stat });
|
|
|
|
| 76 |
});
|
| 77 |
},
|
| 78 |
onSaveIssueMeasure: (data) => {
|
| 79 |
+
const editable = new starry.EditableMeasure(data.measure);
|
| 80 |
+
const hash = editable.regulationHash0;
|
| 81 |
issueMeasureService
|
| 82 |
+
.upsert(scoreId, hash, editable, data.status, undefined, data.measureIndex)
|
| 83 |
.catch((err: any) => console.error('[regulateWithProgress] failed to save issue measure:', err));
|
| 84 |
},
|
| 85 |
});
|
| 86 |
|
| 87 |
+
// No need to save score, solutions already saved in cache.
|
|
|
|
| 88 |
|
| 89 |
// 6. Broadcast completed
|
| 90 |
broadcast(scoreId, { type: 'completed', scoreId, stat });
|
backend/omr-service/src/routes/issueMeasures.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
| 1 |
import { FastifyInstance } from 'fastify';
|
|
|
|
| 2 |
import * as issueMeasureService from '../services/issueMeasure.service.js';
|
| 3 |
|
| 4 |
interface ScoreParams {
|
| 5 |
id: string;
|
| 6 |
}
|
| 7 |
|
| 8 |
-
interface MeasureParams extends ScoreParams {
|
| 9 |
-
measureIndex: string;
|
| 10 |
-
}
|
| 11 |
-
|
| 12 |
interface ListQuery {
|
| 13 |
offset?: string;
|
| 14 |
limit?: string;
|
|
@@ -22,6 +19,15 @@ interface UpsertBody {
|
|
| 22 |
annotator?: string;
|
| 23 |
}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
export default async function issueMeasuresRoutes(fastify: FastifyInstance) {
|
| 26 |
// List issue measures for a score
|
| 27 |
fastify.get<{ Params: ScoreParams; Querystring: ListQuery }>('/scores/:id/issueMeasures', async (request) => {
|
|
@@ -47,11 +53,26 @@ export default async function issueMeasuresRoutes(fastify: FastifyInstance) {
|
|
| 47 |
return { code: 400, message: 'measureIndex, measure, and status are required' };
|
| 48 |
}
|
| 49 |
|
| 50 |
-
const
|
|
|
|
| 51 |
|
| 52 |
return { code: 0, data: result };
|
| 53 |
});
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
// Delete all issue measures for a score
|
| 56 |
fastify.delete<{ Params: ScoreParams }>('/scores/:id/issueMeasures', async (request) => {
|
| 57 |
const count = await issueMeasureService.deleteByScore(request.params.id);
|
|
|
|
| 1 |
import { FastifyInstance } from 'fastify';
|
| 2 |
+
import { starry } from 'starry-omr';
|
| 3 |
import * as issueMeasureService from '../services/issueMeasure.service.js';
|
| 4 |
|
| 5 |
interface ScoreParams {
|
| 6 |
id: string;
|
| 7 |
}
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
interface ListQuery {
|
| 10 |
offset?: string;
|
| 11 |
limit?: string;
|
|
|
|
| 19 |
annotator?: string;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
interface BatchGetBody {
|
| 23 |
+
hashes: string[];
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
function computeHash(measure: any): string {
|
| 27 |
+
const recovered = starry.recoverJSON(measure, starry);
|
| 28 |
+
return recovered.regulationHash0;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
export default async function issueMeasuresRoutes(fastify: FastifyInstance) {
|
| 32 |
// List issue measures for a score
|
| 33 |
fastify.get<{ Params: ScoreParams; Querystring: ListQuery }>('/scores/:id/issueMeasures', async (request) => {
|
|
|
|
| 53 |
return { code: 400, message: 'measureIndex, measure, and status are required' };
|
| 54 |
}
|
| 55 |
|
| 56 |
+
const hash = computeHash(measure);
|
| 57 |
+
const result = await issueMeasureService.upsert(request.params.id, hash, measure, status, annotator, measureIndex);
|
| 58 |
|
| 59 |
return { code: 0, data: result };
|
| 60 |
});
|
| 61 |
|
| 62 |
+
// Batch get issue measures by hash
|
| 63 |
+
fastify.post<{ Body: BatchGetBody }>('/issueMeasures/batchGet', async (request, reply) => {
|
| 64 |
+
const { hashes } = request.body || {};
|
| 65 |
+
|
| 66 |
+
if (!Array.isArray(hashes) || hashes.length === 0) {
|
| 67 |
+
reply.code(400);
|
| 68 |
+
return { code: 400, message: 'hashes array is required' };
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
const results = await issueMeasureService.batchGetByHash(hashes);
|
| 72 |
+
|
| 73 |
+
return { code: 0, data: results };
|
| 74 |
+
});
|
| 75 |
+
|
| 76 |
// Delete all issue measures for a score
|
| 77 |
fastify.delete<{ Params: ScoreParams }>('/scores/:id/issueMeasures', async (request) => {
|
| 78 |
const count = await issueMeasureService.deleteByScore(request.params.id);
|
backend/omr-service/src/routes/tag.ts
CHANGED
|
@@ -31,7 +31,6 @@ export default async function tagRoutes(fastify: FastifyInstance) {
|
|
| 31 |
|
| 32 |
const tag = await tagService.getOrCreateTag(name);
|
| 33 |
|
| 34 |
-
reply.code(201);
|
| 35 |
return {
|
| 36 |
code: 0,
|
| 37 |
data: tag,
|
|
|
|
| 31 |
|
| 32 |
const tag = await tagService.getOrCreateTag(name);
|
| 33 |
|
|
|
|
| 34 |
return {
|
| 35 |
code: 0,
|
| 36 |
data: tag,
|
backend/omr-service/src/scripts/score-hashes.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* score-hashes.ts — Print all regulation hashes for a score's measures.
|
| 3 |
+
*
|
| 4 |
+
* Usage:
|
| 5 |
+
* npx tsx src/scripts/score-hashes.ts <score_id>
|
| 6 |
+
*
|
| 7 |
+
* Output: JSON array of SHA1 hash strings to stdout.
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
import { starry } from 'starry-omr';
|
| 11 |
+
import { pool, query } from '../db/client.js';
|
| 12 |
+
|
| 13 |
+
const scoreId = process.argv[2];
|
| 14 |
+
if (!scoreId) {
|
| 15 |
+
console.error('Usage: npx tsx src/scripts/score-hashes.ts <score_id>');
|
| 16 |
+
process.exit(1);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
const { rows } = await query('SELECT data FROM scores WHERE id = $1', [scoreId]);
|
| 20 |
+
if (!rows.length) {
|
| 21 |
+
console.error(`Score not found: ${scoreId}`);
|
| 22 |
+
process.exit(1);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
const scoreData = rows[0].data;
|
| 26 |
+
const score = starry.recoverJSON(scoreData, starry);
|
| 27 |
+
score.assemble();
|
| 28 |
+
const spartito = score.makeSpartito();
|
| 29 |
+
|
| 30 |
+
const hashes = new Set<string>();
|
| 31 |
+
for (const measure of spartito.measures) {
|
| 32 |
+
const editable = new starry.EditableMeasure(measure);
|
| 33 |
+
for (const h of editable.regulationHashes) {
|
| 34 |
+
hashes.add(h);
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
console.log(JSON.stringify(Array.from(hashes)));
|
| 39 |
+
await pool.end();
|
| 40 |
+
process.exit(0);
|
backend/omr-service/src/services/issueMeasure.service.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface IssueMeasureRow {
|
|
| 4 |
id: string;
|
| 5 |
score_id: string;
|
| 6 |
measure_index: number;
|
|
|
|
| 7 |
measure: any;
|
| 8 |
status: number;
|
| 9 |
by_user: boolean;
|
|
@@ -16,6 +17,7 @@ interface IssueMeasureResult {
|
|
| 16 |
id: string;
|
| 17 |
scoreId: string;
|
| 18 |
measureIndex: number;
|
|
|
|
| 19 |
measure: any;
|
| 20 |
status: number;
|
| 21 |
byUser: boolean;
|
|
@@ -28,6 +30,7 @@ function rowToResult(row: IssueMeasureRow): IssueMeasureResult {
|
|
| 28 |
id: row.id,
|
| 29 |
scoreId: row.score_id,
|
| 30 |
measureIndex: row.measure_index,
|
|
|
|
| 31 |
measure: row.measure,
|
| 32 |
status: row.status,
|
| 33 |
byUser: row.by_user,
|
|
@@ -65,32 +68,52 @@ export async function list(
|
|
| 65 |
};
|
| 66 |
}
|
| 67 |
|
| 68 |
-
export async function upsert(
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
let row: IssueMeasureRow;
|
| 76 |
// undefined = not provided (preserve existing), null = explicitly cleared
|
| 77 |
const annotatorProvided = annotator !== undefined;
|
| 78 |
|
| 79 |
if (existing.length > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
const { rows } = await query<IssueMeasureRow>(
|
| 81 |
`UPDATE issue_measures
|
| 82 |
-
SET
|
| 83 |
-
WHERE id = $
|
| 84 |
RETURNING *`,
|
| 85 |
-
|
| 86 |
);
|
| 87 |
row = rows[0];
|
| 88 |
} else {
|
| 89 |
const { rows } = await query<IssueMeasureRow>(
|
| 90 |
-
`INSERT INTO issue_measures (score_id, measure_index, measure, status, by_user, annotator)
|
| 91 |
-
VALUES ($1, $2, $3, $4, false, $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
RETURNING *`,
|
| 93 |
-
[scoreId, measureIndex, JSON.stringify(measure), status, annotator ?? null]
|
| 94 |
);
|
| 95 |
row = rows[0];
|
| 96 |
}
|
|
@@ -98,6 +121,22 @@ export async function upsert(scoreId: string, measureIndex: number, measure: any
|
|
| 98 |
return rowToResult(row);
|
| 99 |
}
|
| 100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
export async function deleteByScore(scoreId: string): Promise<number> {
|
| 102 |
const result = await query('DELETE FROM issue_measures WHERE score_id = $1', [scoreId]);
|
| 103 |
return result.rowCount ?? 0;
|
|
|
|
| 4 |
id: string;
|
| 5 |
score_id: string;
|
| 6 |
measure_index: number;
|
| 7 |
+
hash: string | null;
|
| 8 |
measure: any;
|
| 9 |
status: number;
|
| 10 |
by_user: boolean;
|
|
|
|
| 17 |
id: string;
|
| 18 |
scoreId: string;
|
| 19 |
measureIndex: number;
|
| 20 |
+
hash: string | null;
|
| 21 |
measure: any;
|
| 22 |
status: number;
|
| 23 |
byUser: boolean;
|
|
|
|
| 30 |
id: row.id,
|
| 31 |
scoreId: row.score_id,
|
| 32 |
measureIndex: row.measure_index,
|
| 33 |
+
hash: row.hash,
|
| 34 |
measure: row.measure,
|
| 35 |
status: row.status,
|
| 36 |
byUser: row.by_user,
|
|
|
|
| 68 |
};
|
| 69 |
}
|
| 70 |
|
| 71 |
+
export async function upsert(
|
| 72 |
+
scoreId: string,
|
| 73 |
+
hash: string,
|
| 74 |
+
measure: any,
|
| 75 |
+
status: number,
|
| 76 |
+
annotator?: string | null,
|
| 77 |
+
measureIndex?: number
|
| 78 |
+
): Promise<IssueMeasureResult> {
|
| 79 |
+
// Try to find existing record for this score+hash (any status)
|
| 80 |
+
const { rows: existing } = await query<IssueMeasureRow>('SELECT * FROM issue_measures WHERE score_id = $1 AND hash = $2 ORDER BY updated_at DESC LIMIT 1', [
|
| 81 |
+
scoreId,
|
| 82 |
+
hash,
|
| 83 |
+
]);
|
| 84 |
|
| 85 |
let row: IssueMeasureRow;
|
| 86 |
// undefined = not provided (preserve existing), null = explicitly cleared
|
| 87 |
const annotatorProvided = annotator !== undefined;
|
| 88 |
|
| 89 |
if (existing.length > 0) {
|
| 90 |
+
const params: any[] = [JSON.stringify(measure), status, annotator ?? null];
|
| 91 |
+
const setClauses = ['measure = $1', 'status = $2', `annotator = ${annotatorProvided ? '$3' : 'COALESCE($3, annotator)'}`, 'updated_at = NOW()'];
|
| 92 |
+
// Update measure_index if provided (parameterized to prevent injection)
|
| 93 |
+
if (measureIndex !== undefined) {
|
| 94 |
+
params.push(measureIndex);
|
| 95 |
+
setClauses.push(`measure_index = $${params.length}`);
|
| 96 |
+
}
|
| 97 |
+
params.push(existing[0].id);
|
| 98 |
const { rows } = await query<IssueMeasureRow>(
|
| 99 |
`UPDATE issue_measures
|
| 100 |
+
SET ${setClauses.join(', ')}
|
| 101 |
+
WHERE id = $${params.length}
|
| 102 |
RETURNING *`,
|
| 103 |
+
params
|
| 104 |
);
|
| 105 |
row = rows[0];
|
| 106 |
} else {
|
| 107 |
const { rows } = await query<IssueMeasureRow>(
|
| 108 |
+
`INSERT INTO issue_measures (score_id, measure_index, hash, measure, status, by_user, annotator)
|
| 109 |
+
VALUES ($1, $2, $3, $4, $5, false, $6)
|
| 110 |
+
ON CONFLICT (score_id, hash) WHERE status > 0 AND hash IS NOT NULL
|
| 111 |
+
DO UPDATE SET measure = EXCLUDED.measure, status = EXCLUDED.status,
|
| 112 |
+
annotator = ${annotatorProvided ? 'EXCLUDED.annotator' : 'COALESCE(EXCLUDED.annotator, issue_measures.annotator)'},
|
| 113 |
+
measure_index = COALESCE(EXCLUDED.measure_index, issue_measures.measure_index),
|
| 114 |
+
updated_at = NOW()
|
| 115 |
RETURNING *`,
|
| 116 |
+
[scoreId, measureIndex ?? -1, hash, JSON.stringify(measure), status, annotator ?? null]
|
| 117 |
);
|
| 118 |
row = rows[0];
|
| 119 |
}
|
|
|
|
| 121 |
return rowToResult(row);
|
| 122 |
}
|
| 123 |
|
| 124 |
+
export async function batchGetByHash(hashes: string[]): Promise<IssueMeasureResult[]> {
|
| 125 |
+
if (hashes.length === 0) return [];
|
| 126 |
+
|
| 127 |
+
// Dedupe and cap batch size
|
| 128 |
+
const uniqueHashes = [...new Set(hashes)].slice(0, 1000);
|
| 129 |
+
|
| 130 |
+
const { rows } = await query<IssueMeasureRow>('SELECT * FROM issue_measures WHERE hash = ANY($1)', [uniqueHashes]);
|
| 131 |
+
|
| 132 |
+
return rows.map(rowToResult);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
export async function getByScoreId(scoreId: string): Promise<IssueMeasureResult[]> {
|
| 136 |
+
const { rows } = await query<IssueMeasureRow>('SELECT * FROM issue_measures WHERE score_id = $1 ORDER BY measure_index ASC', [scoreId]);
|
| 137 |
+
return rows.map(rowToResult);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
export async function deleteByScore(scoreId: string): Promise<number> {
|
| 141 |
const result = await query('DELETE FROM issue_measures WHERE score_id = $1', [scoreId]);
|
| 142 |
return result.rowCount ?? 0;
|
backend/omr-service/src/services/measure.service.ts
CHANGED
|
@@ -102,7 +102,16 @@ export async function updateMeasure(scoreId: string, index: number, patch: any)
|
|
| 102 |
|
| 103 |
// Apply patch fields to the measure
|
| 104 |
const measure = spartito.measures[index];
|
| 105 |
-
if (patch.events)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
if (patch.voices) measure.voices = patch.voices;
|
| 107 |
if (patch.duration !== undefined) measure.duration = patch.duration;
|
| 108 |
if (patch.contexts) measure.contexts = starry.recoverJSON(patch.contexts, starry);
|
|
@@ -119,6 +128,9 @@ export async function updateMeasure(scoreId: string, index: number, patch: any)
|
|
| 119 |
voices: measure.voices,
|
| 120 |
});
|
| 121 |
|
|
|
|
|
|
|
|
|
|
| 122 |
const patches = (score as any).patches || [];
|
| 123 |
const existingIdx = patches.findIndex((p: any) => p.measureIndex === index);
|
| 124 |
if (existingIdx >= 0) {
|
|
@@ -312,6 +324,7 @@ export async function annotateMeasure(scoreId: string, index: number, body: Anno
|
|
| 312 |
if (measure.events[idx]) {
|
| 313 |
measure.events[idx].division = value.division;
|
| 314 |
measure.events[idx].dots = value.dots;
|
|
|
|
| 315 |
}
|
| 316 |
}
|
| 317 |
}
|
|
@@ -335,6 +348,7 @@ export async function annotateMeasure(scoreId: string, index: number, body: Anno
|
|
| 335 |
event.tick = undefined;
|
| 336 |
event.tickGroup = undefined;
|
| 337 |
event.timeWarp = undefined;
|
|
|
|
| 338 |
}
|
| 339 |
|
| 340 |
if (policy === 'advanced') {
|
|
@@ -397,7 +411,8 @@ export async function annotateMeasure(scoreId: string, index: number, body: Anno
|
|
| 397 |
|
| 398 |
// Save issue_measures (outside transaction)
|
| 399 |
try {
|
| 400 |
-
|
|
|
|
| 401 |
saved.issueMeasure = true;
|
| 402 |
} catch (err) {
|
| 403 |
console.error('[annotate] failed to save issue_measure:', err);
|
|
|
|
| 102 |
|
| 103 |
// Apply patch fields to the measure
|
| 104 |
const measure = spartito.measures[index];
|
| 105 |
+
if (patch.events) {
|
| 106 |
+
measure.events = starry.recoverJSON(patch.events, starry);
|
| 107 |
+
// Clear stale multiplier on events — multiplier is an internal field set by
|
| 108 |
+
// the duration setter for non-standard values. When events are submitted via
|
| 109 |
+
// PUT with explicit division/dots, any leftover multiplier from a previous
|
| 110 |
+
// regulation is stale and corrupts the duration computation.
|
| 111 |
+
for (const event of measure.events) {
|
| 112 |
+
if (event.multiplier) event.multiplier = undefined;
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
if (patch.voices) measure.voices = patch.voices;
|
| 116 |
if (patch.duration !== undefined) measure.duration = patch.duration;
|
| 117 |
if (patch.contexts) measure.contexts = starry.recoverJSON(patch.contexts, starry);
|
|
|
|
| 128 |
voices: measure.voices,
|
| 129 |
});
|
| 130 |
|
| 131 |
+
// Sync duration from the PatchMeasure getter (computes from events+voices)
|
| 132 |
+
measure.duration = patchMeasure.duration;
|
| 133 |
+
|
| 134 |
const patches = (score as any).patches || [];
|
| 135 |
const existingIdx = patches.findIndex((p: any) => p.measureIndex === index);
|
| 136 |
if (existingIdx >= 0) {
|
|
|
|
| 324 |
if (measure.events[idx]) {
|
| 325 |
measure.events[idx].division = value.division;
|
| 326 |
measure.events[idx].dots = value.dots;
|
| 327 |
+
measure.events[idx].multiplier = undefined;
|
| 328 |
}
|
| 329 |
}
|
| 330 |
}
|
|
|
|
| 348 |
event.tick = undefined;
|
| 349 |
event.tickGroup = undefined;
|
| 350 |
event.timeWarp = undefined;
|
| 351 |
+
event.multiplier = undefined;
|
| 352 |
}
|
| 353 |
|
| 354 |
if (policy === 'advanced') {
|
|
|
|
| 411 |
|
| 412 |
// Save issue_measures (outside transaction)
|
| 413 |
try {
|
| 414 |
+
const hash = measure.regulationHash0;
|
| 415 |
+
await issueMeasureService.upsert(scoreId, hash, measure.toJSON(), body.status ?? 0, body.annotator, index);
|
| 416 |
saved.issueMeasure = true;
|
| 417 |
} catch (err) {
|
| 418 |
console.error('[annotate] failed to save issue_measure:', err);
|
backend/omr-service/src/services/predictor.service.ts
CHANGED
|
@@ -227,7 +227,7 @@ async function extractStaffImagesFromPage(imageData: Buffer, layout: any): Promi
|
|
| 227 |
const interval = layout.interval || layout.detection?.interval || 10;
|
| 228 |
|
| 229 |
for (const area of layout.detection.areas) {
|
| 230 |
-
const areaInterval = area.staves?.interval
|
| 231 |
const unitScaling = UNIT_SIZE / areaInterval;
|
| 232 |
const middleRhos = area.staves?.middleRhos || [];
|
| 233 |
|
|
@@ -267,11 +267,12 @@ async function extractStaffImagesFromPage(imageData: Buffer, layout: any): Promi
|
|
| 267 |
staffImages.push(staffBuffer);
|
| 268 |
|
| 269 |
// Store staff image metadata in layout (matching Python service format)
|
|
|
|
| 270 |
area.staff_images.push({
|
| 271 |
hash: null,
|
| 272 |
image: { type: 'Buffer', data: Array.from(staffBuffer) },
|
| 273 |
position: {
|
| 274 |
-
x: -STAFF_PADDING_LEFT / UNIT_SIZE,
|
| 275 |
y: -STAFF_HEIGHT_UNITS / 2,
|
| 276 |
width: targetWidth / UNIT_SIZE,
|
| 277 |
height: STAFF_HEIGHT_UNITS,
|
|
|
|
| 227 |
const interval = layout.interval || layout.detection?.interval || 10;
|
| 228 |
|
| 229 |
for (const area of layout.detection.areas) {
|
| 230 |
+
const areaInterval = area.staves?.interval ?? interval;
|
| 231 |
const unitScaling = UNIT_SIZE / areaInterval;
|
| 232 |
const middleRhos = area.staves?.middleRhos || [];
|
| 233 |
|
|
|
|
| 267 |
staffImages.push(staffBuffer);
|
| 268 |
|
| 269 |
// Store staff image metadata in layout (matching Python service format)
|
| 270 |
+
const phi1 = area.staves?.phi1 ?? 0;
|
| 271 |
area.staff_images.push({
|
| 272 |
hash: null,
|
| 273 |
image: { type: 'Buffer', data: Array.from(staffBuffer) },
|
| 274 |
position: {
|
| 275 |
+
x: -STAFF_PADDING_LEFT / UNIT_SIZE - (areaInterval ? phi1 / areaInterval : 0),
|
| 276 |
y: -STAFF_HEIGHT_UNITS / 2,
|
| 277 |
width: targetWidth / UNIT_SIZE,
|
| 278 |
height: STAFF_HEIGHT_UNITS,
|
backend/omr-service/src/services/solutionCache.service.ts
CHANGED
|
@@ -18,7 +18,10 @@ export async function set(name: string, value: any): Promise<void> {
|
|
| 18 |
return;
|
| 19 |
}
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
// Upsert with priority check: only overwrite if new priority >= old priority
|
| 24 |
await query(
|
|
@@ -30,7 +33,9 @@ export async function set(name: string, value: any): Promise<void> {
|
|
| 30 |
updated_at = NOW()
|
| 31 |
WHERE solution_cache.priority IS NULL
|
| 32 |
OR EXCLUDED.priority IS NULL
|
| 33 |
-
OR EXCLUDED.priority >= solution_cache.priority
|
|
|
|
|
|
|
| 34 |
[name, JSON.stringify(value), priority]
|
| 35 |
);
|
| 36 |
}
|
|
|
|
| 18 |
return;
|
| 19 |
}
|
| 20 |
|
| 21 |
+
// NaN is treated as -inf (lowest priority): normalize to NULL so any finite
|
| 22 |
+
// priority will overwrite it, and it never blocks a valid solution.
|
| 23 |
+
const rawPriority = typeof value.priority === 'number' ? value.priority : null;
|
| 24 |
+
const priority = rawPriority !== null && isFinite(rawPriority) ? rawPriority : null;
|
| 25 |
|
| 26 |
// Upsert with priority check: only overwrite if new priority >= old priority
|
| 27 |
await query(
|
|
|
|
| 33 |
updated_at = NOW()
|
| 34 |
WHERE solution_cache.priority IS NULL
|
| 35 |
OR EXCLUDED.priority IS NULL
|
| 36 |
+
OR EXCLUDED.priority >= solution_cache.priority
|
| 37 |
+
OR solution_cache.priority = 'NaN'::float8
|
| 38 |
+
OR solution_cache.priority = 0`,
|
| 39 |
[name, JSON.stringify(value), priority]
|
| 40 |
);
|
| 41 |
}
|
backend/omr/dist/gauge-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
"use strict";var e=require("yargs"),t=require("msgpackr"),i=require("zeromq"),r=require("skia-canvas");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(require("gl"));globalThis.ImageData=r.ImageData;const o=e=>{const t=[];for(const i of e)for(const e of i)t.push(e);return t};class GLCanvas{constructor(e){this._width=256,this._height=192,this.ctx=e}get width(){return this._width}set width(e){this._width=e;this.ctx.getExtension("STACKGL_resize_drawingbuffer").resize(e,this.height)}get height(){return this._height}set height(e){this._height=e;this.ctx.getExtension("STACKGL_resize_drawingbuffer").resize(this.width,e)}addEventListener(e){}async toBuffer(){const e=new Uint8Array(this.width*this.height*4);this.ctx.readPixels(0,0,this.width,this.height,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e);const t=new r.Canvas(this.width,this.height);return t.getContext("2d").putImageData(new r.ImageData(new Uint8ClampedArray(e),this.width,this.height),0,0),t.toBuffer("png")}}const s=a.default(512,192,{antialias:!0});const h=new class GaugeRenderer{constructor(e){this.width=256,this.height=192,this.source=e.source,this.gauge=e.gauge,this.canvas=new GLCanvas(s),s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT),s.getExtension("OES_element_index_uint"),this.program=s.createProgram();const t=s.createShader(s.VERTEX_SHADER);s.shaderSource(t,"//#version 300 es\n//#define attribute in\n//#define varying out\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define VERTEX_TEXTURES\n#define USE_MAP\n#define USE_UV\n#define BONE_TEXTURE\n#define DOUBLE_SIDED\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\n#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n\nvoid main() {\n#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif\n\n\tvec3 transformed = vec3( position );\n\n\tvec4 mvPosition = vec4( transformed, 1.0 );\n\tmvPosition = modelViewMatrix * mvPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n}\n"),s.compileShader(t);const i=s.getShaderInfoLog(t);i&&console.warn("vs log:",i);const r=s.createShader(s.FRAGMENT_SHADER);s.shaderSource(r,"//#version 300 es\n//#define varying in\n//out highp vec4 pc_fragColor;\n//#define gl_FragColor pc_fragColor\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define USE_MAP\n#define USE_UV\n#define DOUBLE_SIDED\nuniform vec3 cameraPosition;\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }\n\nuniform vec3 diffuse;\nuniform float opacity;\n\n#if defined( USE_UV )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n\n\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n\n\tgl_FragColor = diffuseColor;\n}\n"),s.compileShader(r);const n=s.getShaderInfoLog(r);n&&console.warn("fs log:",n),s.attachShader(this.program,t),s.attachShader(this.program,r),s.linkProgram(this.program);const a=s.getProgramInfoLog(this.program);a&&console.warn("program log:",a),s.deleteShader(t),s.deleteShader(r);const{name:o}=s.getActiveUniform(this.program,0),h=s.getUniformLocation(this.program,o),{name:c}=s.getActiveUniform(this.program,1),g=s.getUniformLocation(this.program,c),{name:f}=s.getActiveUniform(this.program,2),d=s.getUniformLocation(this.program,f),{name:u}=s.getActiveUniform(this.program,3),l=s.getUniformLocation(this.program,u),{name:m}=s.getActiveUniform(this.program,4),E=s.getUniformLocation(this.program,m),{name:p}=s.getActiveUniform(this.program,5),v=s.getUniformLocation(this.program,p);s.useProgram(this.program),s.uniformMatrix4fv(g,!1,new Float32Array([.002739726100116968,0,0,0,0,.010416666977107525,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1])),s.uniformMatrix4fv(h,!1,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1,1])),s.uniformMatrix3fv(d,!1,new Float32Array([1,0,0,0,1,0,0,0,1])),s.uniform3f(l,1,1,1),s.uniform1f(E,1),s.uniform1i(v,0),this.texture=s.createTexture(),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.texture),s.pixelStorei(37440,!0),s.pixelStorei(37441,!1),s.pixelStorei(s.UNPACK_ALIGNMENT,4),s.pixelStorei(37443,0),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR_MIPMAP_LINEAR),s.disable(s.CULL_FACE),s.depthMask(!0),s.colorMask(!0,!0,!0,!0),s.disable(s.STENCIL_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),this.pos=s.createBuffer(),this.uv=s.createBuffer(),this.ib=s.createBuffer();const A=s.getAttribLocation(this.program,"position"),_=s.getAttribLocation(this.program,"uv");s.enableVertexAttribArray(A),s.bindBuffer(s.ARRAY_BUFFER,this.pos),s.vertexAttribPointer(A,3,s.FLOAT,!1,0,0),s.enableVertexAttribArray(_),s.bindBuffer(s.ARRAY_BUFFER,this.uv),s.vertexAttribPointer(_,2,s.FLOAT,!1,0,0)}updateMaterial({width:e=null,sw:t=this.width,sh:i=this.height}={}){if(t!==this.width||i!==this.height){Number.isFinite(e)?this.width=e:this.width=Math.round(this.height*t/i),this.canvas.width=this.width,this.canvas.height=this.height,s.viewport(0,0,this.width,this.height);const r=s.getUniformLocation(this.program,"projectionMatrix");s.uniformMatrix4fv(r,!1,new Float32Array([2/this.width,0,0,0,0,2/this.height,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1]))}const n=new r.Canvas(this.source.width,this.source.height);n.getContext("2d").drawImage(this.source,0,0),s.bindTexture(s.TEXTURE_2D,this.texture),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,n),s.generateMipmap(s.TEXTURE_2D)}updateGeometry(e=null){const{width:t,height:i}=this.gauge,n=new r.Canvas(t,i).getContext("2d");n.drawImage(this.gauge,0,0);const{data:a}=n.getImageData(0,0,t,i),h=this.width/t;e=Math.round(Number.isFinite(e)?e:i/2),e=Math.max(0,Math.min(i-1,e));const c=Array(i).fill(null).map((e,r)=>Array(t).fill(null).map((e,n)=>({uv:[(n+.5)/t,1-(r+.5)/i],position:[(n-t/2)*h,(a[4*(r*t+n)]+a[4*(r*t+n)+2]/256-128)/h,0]})));for(let i=e;i>0;--i)for(let e=0;e<t;++e)c[i-1][e].position[0]=c[i][e].position[0]-(a[4*(i*t+e)+1]-128)*h/127;for(let r=e+1;r<i;++r)for(let e=0;e<t;++e)c[r][e].position[0]=c[r-1][e].position[0]+(a[4*((r-1)*t+e)+1]-128)*h/127;const g=o(o(c).map(e=>e.uv)),f=o(o(c).map(e=>e.position)),d=Array(i-1).fill(null).map((e,i)=>Array(t-1).fill(null).map((e,r)=>[i*t+r,i*t+r+1,(i+1)*t+r,(i+1)*t+r,(i+1)*t+r+1,i*t+r+1])),u=o(o(d));s.bindBuffer(s.ARRAY_BUFFER,this.pos),s.bufferData(s.ARRAY_BUFFER,new Float32Array(f),s.STATIC_DRAW),s.bindBuffer(s.ARRAY_BUFFER,this.uv),s.bufferData(s.ARRAY_BUFFER,new Float32Array(g),s.STATIC_DRAW),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,this.ib),s.bufferData(s.ELEMENT_ARRAY_BUFFER,new Uint32Array(u),s.STATIC_DRAW),this.primitiveCount=u.length}render(){return s.clearColor(1,1,1,1),s.clear(s.COLOR_BUFFER_BIT),s.drawElements(s.TRIANGLES,this.primitiveCount,s.UNSIGNED_INT,0),this.canvas.toBuffer()}dispose(){s.deleteBuffer(this.pos),s.deleteBuffer(this.uv),s.deleteBuffer(this.ib),s.deleteProgram(this.program),s.deleteTexture(this.texture)}}({source:new r.Image,gauge:new r.Image});console.info("%cstarry-omr%c v1.0.0 2026-
|
| 2 |
//# sourceMappingURL=gauge-server.js.map
|
|
|
|
| 1 |
+
"use strict";var e=require("yargs"),t=require("msgpackr"),i=require("zeromq"),r=require("skia-canvas");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=n(require("gl"));globalThis.ImageData=r.ImageData;const o=e=>{const t=[];for(const i of e)for(const e of i)t.push(e);return t};class GLCanvas{constructor(e){this._width=256,this._height=192,this.ctx=e}get width(){return this._width}set width(e){this._width=e;this.ctx.getExtension("STACKGL_resize_drawingbuffer").resize(e,this.height)}get height(){return this._height}set height(e){this._height=e;this.ctx.getExtension("STACKGL_resize_drawingbuffer").resize(this.width,e)}addEventListener(e){}async toBuffer(){const e=new Uint8Array(this.width*this.height*4);this.ctx.readPixels(0,0,this.width,this.height,this.ctx.RGBA,this.ctx.UNSIGNED_BYTE,e);const t=new r.Canvas(this.width,this.height);return t.getContext("2d").putImageData(new r.ImageData(new Uint8ClampedArray(e),this.width,this.height),0,0),t.toBuffer("png")}}const s=a.default(512,192,{antialias:!0});const h=new class GaugeRenderer{constructor(e){this.width=256,this.height=192,this.source=e.source,this.gauge=e.gauge,this.canvas=new GLCanvas(s),s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT),s.getExtension("OES_element_index_uint"),this.program=s.createProgram();const t=s.createShader(s.VERTEX_SHADER);s.shaderSource(t,"//#version 300 es\n//#define attribute in\n//#define varying out\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define VERTEX_TEXTURES\n#define USE_MAP\n#define USE_UV\n#define BONE_TEXTURE\n#define DOUBLE_SIDED\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\n#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n\nvoid main() {\n#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif\n\n\tvec3 transformed = vec3( position );\n\n\tvec4 mvPosition = vec4( transformed, 1.0 );\n\tmvPosition = modelViewMatrix * mvPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n}\n"),s.compileShader(t);const i=s.getShaderInfoLog(t);i&&console.warn("vs log:",i);const r=s.createShader(s.FRAGMENT_SHADER);s.shaderSource(r,"//#version 300 es\n//#define varying in\n//out highp vec4 pc_fragColor;\n//#define gl_FragColor pc_fragColor\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define USE_MAP\n#define USE_UV\n#define DOUBLE_SIDED\nuniform vec3 cameraPosition;\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }\n\nuniform vec3 diffuse;\nuniform float opacity;\n\n#if defined( USE_UV )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n\n\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n\n\tgl_FragColor = diffuseColor;\n}\n"),s.compileShader(r);const n=s.getShaderInfoLog(r);n&&console.warn("fs log:",n),s.attachShader(this.program,t),s.attachShader(this.program,r),s.linkProgram(this.program);const a=s.getProgramInfoLog(this.program);a&&console.warn("program log:",a),s.deleteShader(t),s.deleteShader(r);const{name:o}=s.getActiveUniform(this.program,0),h=s.getUniformLocation(this.program,o),{name:c}=s.getActiveUniform(this.program,1),g=s.getUniformLocation(this.program,c),{name:f}=s.getActiveUniform(this.program,2),d=s.getUniformLocation(this.program,f),{name:u}=s.getActiveUniform(this.program,3),l=s.getUniformLocation(this.program,u),{name:m}=s.getActiveUniform(this.program,4),E=s.getUniformLocation(this.program,m),{name:p}=s.getActiveUniform(this.program,5),v=s.getUniformLocation(this.program,p);s.useProgram(this.program),s.uniformMatrix4fv(g,!1,new Float32Array([.002739726100116968,0,0,0,0,.010416666977107525,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1])),s.uniformMatrix4fv(h,!1,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1,1])),s.uniformMatrix3fv(d,!1,new Float32Array([1,0,0,0,1,0,0,0,1])),s.uniform3f(l,1,1,1),s.uniform1f(E,1),s.uniform1i(v,0),this.texture=s.createTexture(),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.texture),s.pixelStorei(37440,!0),s.pixelStorei(37441,!1),s.pixelStorei(s.UNPACK_ALIGNMENT,4),s.pixelStorei(37443,0),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR_MIPMAP_LINEAR),s.disable(s.CULL_FACE),s.depthMask(!0),s.colorMask(!0,!0,!0,!0),s.disable(s.STENCIL_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),this.pos=s.createBuffer(),this.uv=s.createBuffer(),this.ib=s.createBuffer();const A=s.getAttribLocation(this.program,"position"),_=s.getAttribLocation(this.program,"uv");s.enableVertexAttribArray(A),s.bindBuffer(s.ARRAY_BUFFER,this.pos),s.vertexAttribPointer(A,3,s.FLOAT,!1,0,0),s.enableVertexAttribArray(_),s.bindBuffer(s.ARRAY_BUFFER,this.uv),s.vertexAttribPointer(_,2,s.FLOAT,!1,0,0)}updateMaterial({width:e=null,sw:t=this.width,sh:i=this.height}={}){if(t!==this.width||i!==this.height){Number.isFinite(e)?this.width=e:this.width=Math.round(this.height*t/i),this.canvas.width=this.width,this.canvas.height=this.height,s.viewport(0,0,this.width,this.height);const r=s.getUniformLocation(this.program,"projectionMatrix");s.uniformMatrix4fv(r,!1,new Float32Array([2/this.width,0,0,0,0,2/this.height,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1]))}const n=new r.Canvas(this.source.width,this.source.height);n.getContext("2d").drawImage(this.source,0,0),s.bindTexture(s.TEXTURE_2D,this.texture),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,n),s.generateMipmap(s.TEXTURE_2D)}updateGeometry(e=null){const{width:t,height:i}=this.gauge,n=new r.Canvas(t,i).getContext("2d");n.drawImage(this.gauge,0,0);const{data:a}=n.getImageData(0,0,t,i),h=this.width/t;e=Math.round(Number.isFinite(e)?e:i/2),e=Math.max(0,Math.min(i-1,e));const c=Array(i).fill(null).map((e,r)=>Array(t).fill(null).map((e,n)=>({uv:[(n+.5)/t,1-(r+.5)/i],position:[(n-t/2)*h,(a[4*(r*t+n)]+a[4*(r*t+n)+2]/256-128)/h,0]})));for(let i=e;i>0;--i)for(let e=0;e<t;++e)c[i-1][e].position[0]=c[i][e].position[0]-(a[4*(i*t+e)+1]-128)*h/127;for(let r=e+1;r<i;++r)for(let e=0;e<t;++e)c[r][e].position[0]=c[r-1][e].position[0]+(a[4*((r-1)*t+e)+1]-128)*h/127;const g=o(o(c).map(e=>e.uv)),f=o(o(c).map(e=>e.position)),d=Array(i-1).fill(null).map((e,i)=>Array(t-1).fill(null).map((e,r)=>[i*t+r,i*t+r+1,(i+1)*t+r,(i+1)*t+r,(i+1)*t+r+1,i*t+r+1])),u=o(o(d));s.bindBuffer(s.ARRAY_BUFFER,this.pos),s.bufferData(s.ARRAY_BUFFER,new Float32Array(f),s.STATIC_DRAW),s.bindBuffer(s.ARRAY_BUFFER,this.uv),s.bufferData(s.ARRAY_BUFFER,new Float32Array(g),s.STATIC_DRAW),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,this.ib),s.bufferData(s.ELEMENT_ARRAY_BUFFER,new Uint32Array(u),s.STATIC_DRAW),this.primitiveCount=u.length}render(){return s.clearColor(1,1,1,1),s.clear(s.COLOR_BUFFER_BIT),s.drawElements(s.TRIANGLES,this.primitiveCount,s.UNSIGNED_INT,0),this.canvas.toBuffer()}dispose(){s.deleteBuffer(this.pos),s.deleteBuffer(this.uv),s.deleteBuffer(this.ib),s.deleteProgram(this.program),s.deleteTexture(this.texture)}}({source:new r.Image,gauge:new r.Image});console.info("%cstarry-omr%c v1.0.0 2026-04-23T11:21:07.532Z","color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;","color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;");const c=["bind","constructor","toString","toJSON"];class GaugeServer{async bind(e){this.socket=new i.Reply,await this.socket.bind(e),console.log(`gauge server listening at ${e}`);try{for await(const[e]of this.socket){const{method:i,args:r,kwargs:n}=t.unpack(e)??{};if(console.log(`request: ${i}`),!c.includes(i)&&this[i])try{const e=await(this[i]?.(r,n));console.log(`success: ${i}`),await this.socket.send(t.pack({code:0,msg:"success",data:e}))}catch(e){console.error(`fail: ${i}, error: ${e}`),await this.socket.send(t.pack({code:-1,msg:`Error: ${JSON.stringify(e)}`,data:null}))}else console.error(`fail: ${i}, error: no method`),await this.socket.send(t.pack({code:-1,msg:`no method: ${i}`,data:null}))}}catch(t){console.log("restarting gauge server..",t.stack),await this.socket.close(),await this.bind(e)}}async predict(e,t){let i,n,a;return e&&([i,n,a]=e),t&&({source:i,gauge:n,baseY:a}=t),(async(e,t,i)=>{const n=await r.loadImage(e),a=await r.loadImage(t);return h.source=n,h.gauge=a,h.updateMaterial({width:a.width,sw:n.width,sh:n.height}),h.updateGeometry(i),console.log(process.memoryUsage().heapUsed),{buffer:await h.render(),size:{width:h.width,height:h.height}}})(i,n,a)}}!async function(){const t=new GaugeServer;await t.bind(`tcp://*:${e.argv.port}`)}();
|
| 2 |
//# sourceMappingURL=gauge-server.js.map
|
backend/omr/dist/gauge-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"version":3,"file":"gauge-server.js","sources":["../../libs/gauge-renderer.ts","../../../src/pages/playground/scripts/shaders.ts","../src/gauge-server.ts"],"sourcesContent":["/* global cv */\nimport { Canvas, Image, loadImage, ImageData } from 'skia-canvas';\n// threejs内部使用了OffscreenCanvas\n//(globalThis as any).OffscreenCanvas = (globalThis as any).OffscreenCanvas || Canvas;\nglobalThis.ImageData = ImageData;\n\nimport createContext from 'gl';\n\nimport * as SHADER_SOURCE from '../../src/pages/playground/scripts/shaders';\n\n//const cc = <T>(a: T[][]): T[] => a.flat(1);\t// This is slower!\nconst cc = <T>(a: T[][]): T[] => {\n\tconst result: T[] = [];\n\tfor (const x of a) {\n\t\tfor (const e of x) result.push(e);\n\t}\n\n\treturn result;\n};\n\ntype RenderContext = ReturnType<typeof createContext>;\n\nclass GLCanvas {\n\tctx: RenderContext;\n\t_width: number = 256;\n\t_height: number = 192;\n\n\tresizeBuffer: number[];\n\n\tconstructor(context: RenderContext) {\n\t\tthis.ctx = context;\n\t}\n\n\tget width() {\n\t\treturn this._width;\n\t}\n\n\tset width(width: number) {\n\t\tthis._width = width;\n\t\tconst ext = this.ctx.getExtension('STACKGL_resize_drawingbuffer');\n\t\text.resize(width, this.height);\n\t}\n\n\tget height() {\n\t\treturn this._height;\n\t}\n\n\tset height(height: number) {\n\t\tthis._height = height;\n\t\tconst ext = this.ctx.getExtension('STACKGL_resize_drawingbuffer');\n\t\text.resize(this.width, height);\n\t}\n\n\t/*// @ts-ignore\n\tgetContext(type, options) {\n\t\tif (type === 'webgl') {\n\t\t\tthis.ctx = createContext(200, 300, options);\n\n\t\t\treturn this.ctx;\n\t\t}\n\n\t\treturn null as WebGLRenderingContext;\n\t}*/\n\n\taddEventListener(evt: 'webglcontextlost') {}\n\n\tasync toBuffer() {\n\t\tconst pixels = new Uint8Array(this.width * this.height * 4);\n\t\tthis.ctx.readPixels(0, 0, this.width, this.height, this.ctx.RGBA, this.ctx.UNSIGNED_BYTE, pixels);\n\n\t\tconst canvas = new Canvas(this.width, this.height);\n\t\tconst ctx = canvas.getContext('2d');\n\t\tctx.putImageData(new ImageData(new Uint8ClampedArray(pixels), this.width, this.height), 0, 0);\n\n\t\treturn canvas.toBuffer('png');\n\t}\n}\n\ninterface GaugeRendererInitOptions {\n\tsource: HTMLImageElement;\n\tgauge: HTMLImageElement;\n}\n\nconst gl = createContext(512, 192, { antialias: true });\n\nexport default class GaugeRenderer {\n\tsource: Image; // base64 string\n\tgauge: Image;\n\tcanvas: GLCanvas;\n\n\tprogram: WebGLProgram;\n\ttexture: WebGLTexture;\n\tpos: WebGLBuffer;\n\tuv: WebGLBuffer;\n\tib: WebGLBuffer;\n\tprimitiveCount: number;\n\n\twidth: number = 256;\n\theight: number = 192;\n\n\tconstructor(options: GaugeRendererInitOptions) {\n\t\tthis.source = options.source;\n\t\tthis.gauge = options.gauge;\n\t\tthis.canvas = new GLCanvas(gl);\n\n\t\tgl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT);\n\t\tgl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n\n\t\tgl.getExtension('OES_element_index_uint');\n\n\t\t// initial program\n\t\tthis.program = gl.createProgram();\n\n\t\tconst vsShader = gl.createShader(gl.VERTEX_SHADER);\n\t\tgl.shaderSource(vsShader, SHADER_SOURCE.vs);\n\t\tgl.compileShader(vsShader);\n\t\tconst logVs = gl.getShaderInfoLog(vsShader);\n\t\tlogVs && console.warn('vs log:', logVs);\n\n\t\tconst fsShader = gl.createShader(gl.FRAGMENT_SHADER);\n\t\tgl.shaderSource(fsShader, SHADER_SOURCE.fs);\n\t\tgl.compileShader(fsShader);\n\t\tconst logFs = gl.getShaderInfoLog(fsShader);\n\t\tlogFs && console.warn('fs log:', logFs);\n\n\t\tgl.attachShader(this.program, vsShader);\n\t\tgl.attachShader(this.program, fsShader);\n\t\tgl.linkProgram(this.program);\n\n\t\tconst logProgram = gl.getProgramInfoLog(this.program);\n\t\tlogProgram && console.warn('program log:', logProgram);\n\n\t\tgl.deleteShader(vsShader);\n\t\tgl.deleteShader(fsShader);\n\n\t\tconst { name: nameModelView } = gl.getActiveUniform(this.program, 0);\n\t\tconst modelMat = gl.getUniformLocation(this.program, nameModelView);\n\t\tconst { name: nameProj } = gl.getActiveUniform(this.program, 1);\n\t\tconst projMat = gl.getUniformLocation(this.program, nameProj);\n\t\tconst { name: nameUV } = gl.getActiveUniform(this.program, 2);\n\t\tconst uvMat = gl.getUniformLocation(this.program, nameUV);\n\t\tconst { name: nameDiffuse } = gl.getActiveUniform(this.program, 3);\n\t\tconst diffuse = gl.getUniformLocation(this.program, nameDiffuse);\n\t\tconst { name: nameOpacity } = gl.getActiveUniform(this.program, 4);\n\t\tconst opacity = gl.getUniformLocation(this.program, nameOpacity);\n\t\tconst { name: nameMap } = gl.getActiveUniform(this.program, 5);\n\t\tconst map = gl.getUniformLocation(this.program, nameMap);\n\n\t\tgl.useProgram(this.program);\n\n\t\tgl.uniformMatrix4fv(\n\t\t\tprojMat,\n\t\t\tfalse,\n\t\t\t//new Float32Array([0.0026385225355625153, 0, 0, 0, 0, -0.010416666977107525, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t\tnew Float32Array([0.002739726100116968, 0, 0, 0, 0, 0.010416666977107525, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t);\n\t\tgl.uniformMatrix4fv(modelMat, false, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -1, 1]));\n\t\tgl.uniformMatrix3fv(uvMat, false, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]));\n\t\tgl.uniform3f(diffuse, 1, 1, 1);\n\t\tgl.uniform1f(opacity, 1);\n\t\tgl.uniform1i(map, 0);\n\n\t\t// texture\n\t\tthis.texture = gl.createTexture();\n\t\tgl.activeTexture(gl.TEXTURE0);\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t\tgl.pixelStorei(37440, true);\n\t\tgl.pixelStorei(37441, false);\n\t\tgl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);\n\t\tgl.pixelStorei(37443, 0);\n\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n\n\t\tgl.disable(gl.CULL_FACE);\n\t\tgl.depthMask(true);\n\t\tgl.colorMask(true, true, true, true);\n\t\tgl.disable(gl.STENCIL_TEST);\n\t\tgl.disable(gl.POLYGON_OFFSET_FILL);\n\t\tgl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\n\t\t// buffers\n\t\tthis.pos = gl.createBuffer();\n\t\tthis.uv = gl.createBuffer();\n\t\tthis.ib = gl.createBuffer();\n\n\t\tconst iPos = gl.getAttribLocation(this.program, 'position');\n\t\tconst iUV = gl.getAttribLocation(this.program, 'uv');\n\t\t//console.log('indices:', iPos, iUV);\n\n\t\tgl.enableVertexAttribArray(iPos);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.pos);\n\t\tgl.vertexAttribPointer(iPos, 3, gl.FLOAT, false, 0, 0);\n\n\t\tgl.enableVertexAttribArray(iUV);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.uv);\n\t\tgl.vertexAttribPointer(iUV, 2, gl.FLOAT, false, 0, 0);\n\t}\n\n\tupdateMaterial({ width = null, sw = this.width, sh = this.height } = {}) {\n\t\tif (sw !== this.width || sh !== this.height) {\n\t\t\tif (Number.isFinite(width)) {\n\t\t\t\tthis.width = width;\n\t\t\t} else {\n\t\t\t\tthis.width = Math.round((this.height * sw) / sh);\n\t\t\t}\n\n\t\t\tthis.canvas.width = this.width;\n\t\t\tthis.canvas.height = this.height;\n\n\t\t\tgl.viewport(0, 0, this.width, this.height);\n\n\t\t\tconst projMat = gl.getUniformLocation(this.program, 'projectionMatrix');\n\t\t\tgl.uniformMatrix4fv(\n\t\t\t\tprojMat,\n\t\t\t\tfalse,\n\t\t\t\tnew Float32Array([2 / this.width, 0, 0, 0, 0, 2 / this.height, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t\t);\n\t\t}\n\n\t\t// image to canvas\n\t\tconst sourceCanvas = new Canvas(this.source.width, this.source.height);\n\t\tsourceCanvas.getContext('2d').drawImage(this.source, 0, 0);\n\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, sourceCanvas as any);\n\t\tgl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\tupdateGeometry(baseY = null) {\n\t\tconst { width, height } = this.gauge;\n\t\tconst canvas = new Canvas(width, height);\n\t\tconst ctx = canvas.getContext('2d');\n\t\tctx.drawImage(this.gauge, 0, 0);\n\t\tconst { data: buffer } = ctx.getImageData(0, 0, width, height);\n\n\t\tconst xFactor = this.width / width;\n\n\t\tbaseY = Math.round(Number.isFinite(baseY) ? baseY : height / 2);\n\t\tbaseY = Math.max(0, Math.min(height - 1, baseY));\n\n\t\tconst propertyArray = Array(height)\n\t\t\t.fill(null)\n\t\t\t.map((_, y) =>\n\t\t\t\tArray(width)\n\t\t\t\t\t.fill(null)\n\t\t\t\t\t.map((_, x) => ({\n\t\t\t\t\t\tuv: [(x + 0.5) / width, 1 - (y + 0.5) / height],\n\t\t\t\t\t\tposition: [(x - width / 2) * xFactor, (buffer[(y * width + x) * 4] + buffer[(y * width + x) * 4 + 2] / 256 - 128) / xFactor, 0],\n\t\t\t\t\t}))\n\t\t\t);\n\n\t\t// integral X by K\n\t\tfor (let y = baseY; y > 0; --y) {\n\t\t\tfor (let x = 0; x < width; ++x)\n\t\t\t\tpropertyArray[y - 1][x].position[0] = propertyArray[y][x].position[0] - ((buffer[(y * width + x) * 4 + 1] - 128) * xFactor) / 127;\n\t\t}\n\t\tfor (let y = baseY + 1; y < height; ++y) {\n\t\t\tfor (let x = 0; x < width; ++x)\n\t\t\t\tpropertyArray[y][x].position[0] = propertyArray[y - 1][x].position[0] + ((buffer[((y - 1) * width + x) * 4 + 1] - 128) * xFactor) / 127;\n\t\t}\n\n\t\tconst uvs = cc(cc(propertyArray).map((p) => p.uv));\n\t\tconst positions = cc(cc(propertyArray).map((p) => p.position));\n\n\t\tconst faces = Array(height - 1)\n\t\t\t.fill(null)\n\t\t\t.map((_, y) =>\n\t\t\t\tArray(width - 1)\n\t\t\t\t\t.fill(null)\n\t\t\t\t\t.map((_, x) => [y * width + x, y * width + x + 1, (y + 1) * width + x, (y + 1) * width + x, (y + 1) * width + x + 1, y * width + x + 1])\n\t\t\t);\n\t\tconst indices = cc(cc(faces));\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.pos);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.uv);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(uvs), gl.STATIC_DRAW);\n\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ib);\n\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(indices), gl.STATIC_DRAW);\n\n\t\tthis.primitiveCount = indices.length;\n\t}\n\n\trender() {\n\t\tgl.clearColor(1, 1, 1, 1);\n\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\n\t\t//gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ib);\n\n\t\tgl.drawElements(gl.TRIANGLES, this.primitiveCount, gl.UNSIGNED_INT, 0);\n\n\t\treturn this.canvas.toBuffer();\n\t}\n\n\tdispose() {\n\t\tgl.deleteBuffer(this.pos);\n\t\tgl.deleteBuffer(this.uv);\n\t\tgl.deleteBuffer(this.ib);\n\n\t\tgl.deleteProgram(this.program);\n\t\tgl.deleteTexture(this.texture);\n\t}\n}\n\nconst gaugeRenderer = new GaugeRenderer({\n\tsource: new Image(),\n\tgauge: new Image(),\n});\n\nexport const renderGaugeImage = async (sourceURL: string | Buffer, gaugeURL: string | Buffer, baseY?: number) => {\n\tconst source = await loadImage(sourceURL);\n\tconst gauge = await loadImage(gaugeURL);\n\n\tgaugeRenderer.source = source;\n\tgaugeRenderer.gauge = gauge;\n\n\tgaugeRenderer.updateMaterial({\n\t\twidth: gauge.width,\n\t\tsw: source.width,\n\t\tsh: source.height,\n\t});\n\n\tgaugeRenderer.updateGeometry(baseY);\n\n\tconsole.log(process.memoryUsage().heapUsed);\n\n\treturn {\n\t\tbuffer: await gaugeRenderer.render(),\n\t\tsize: {\n\t\t\twidth: gaugeRenderer.width,\n\t\t\theight: gaugeRenderer.height,\n\t\t},\n\t};\n};\n\n// renderGaugeImage('./images/source.png', './images/gauge.png');\n","export const vs = `//#version 300 es\n//#define attribute in\n//#define varying out\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define VERTEX_TEXTURES\n#define USE_MAP\n#define USE_UV\n#define BONE_TEXTURE\n#define DOUBLE_SIDED\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\n#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n\nvoid main() {\n#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif\n\n\tvec3 transformed = vec3( position );\n\n\tvec4 mvPosition = vec4( transformed, 1.0 );\n\tmvPosition = modelViewMatrix * mvPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n}\n`;\n\nexport const fs = `//#version 300 es\n//#define varying in\n//out highp vec4 pc_fragColor;\n//#define gl_FragColor pc_fragColor\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define USE_MAP\n#define USE_UV\n#define DOUBLE_SIDED\nuniform vec3 cameraPosition;\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }\n\nuniform vec3 diffuse;\nuniform float opacity;\n\n#if defined( USE_UV )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n\n\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n\n\tgl_FragColor = diffuseColor;\n}\n`;\n","console.info(`%cstarry-omr%c v1.0.0 2026-02-20T12:54:01.066Z`, 'color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;', 'color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;');\nimport { argv } from 'yargs';\nimport { pack, unpack } from 'msgpackr';\nimport { Reply } from 'zeromq';\nimport { renderGaugeImage } from '../../libs/gauge-renderer';\n\ninterface Params {\n\tmethod: string;\n\targs: any[];\n\tkwargs: Record<any, any>;\n}\n\nconst unsafeMethods = ['bind', 'constructor', 'toString', 'toJSON'];\n\nclass GaugeServer {\n\tprivate socket: Reply;\n\n\tasync bind(port?: string) {\n\t\tthis.socket = new Reply();\n\t\tawait this.socket.bind(port);\n\n\t\tconsole.log(`gauge server listening at ${port}`);\n\n\t\ttry {\n\t\t\tfor await (const [data] of this.socket) {\n\t\t\t\tconst { method, args, kwargs } = (unpack(data) as Params) ?? {};\n\n\t\t\t\tconsole.log(`request: ${method}`);\n\n\t\t\t\tif (!unsafeMethods.includes(method) && this[method]) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst data = await this[method]?.(args, kwargs);\n\t\t\t\t\t\tconsole.log(`success: ${method}`);\n\n\t\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\t\tcode: 0,\n\t\t\t\t\t\t\t\tmsg: 'success',\n\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(`fail: ${method}, error: ${err}`);\n\t\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\t\tcode: -1,\n\t\t\t\t\t\t\t\tmsg: `Error: ${JSON.stringify(err)}`,\n\t\t\t\t\t\t\t\tdata: null,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`fail: ${method}, error: no method`);\n\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\tcode: -1,\n\t\t\t\t\t\t\tmsg: `no method: ${method}`,\n\t\t\t\t\t\t\tdata: null,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log('restarting gauge server..', err.stack);\n\t\t\tawait this.socket.close();\n\t\t\tawait this.bind(port);\n\t\t}\n\t}\n\n\tasync predict(args?: any[], kwargs?: Record<any, any>) {\n\t\tlet source, gauge, baseY;\n\n\t\tif (args) {\n\t\t\t[source, gauge, baseY] = args;\n\t\t}\n\n\t\tif (kwargs) {\n\t\t\t({ source, gauge, baseY } = kwargs);\n\t\t}\n\n\t\treturn renderGaugeImage(source, gauge, baseY);\n\t}\n}\n\nasync function main() {\n\tconst server = new GaugeServer();\n\n\tawait server.bind(`tcp://*:${argv.port}`);\n}\n\nmain();\n"],"names":["globalThis","ImageData","cc","a","result","x","e","push","GLCanvas","constructor","context","this","_width","_height","ctx","width","getExtension","resize","height","addEventListener","evt","toBuffer","pixels","Uint8Array","readPixels","RGBA","UNSIGNED_BYTE","canvas","Canvas","getContext","putImageData","Uint8ClampedArray","gl","createContext","antialias","gaugeRenderer","GaugeRenderer","options","source","gauge","getShaderPrecisionFormat","VERTEX_SHADER","HIGH_FLOAT","FRAGMENT_SHADER","program","createProgram","vsShader","createShader","shaderSource","compileShader","logVs","getShaderInfoLog","console","warn","fsShader","logFs","attachShader","linkProgram","logProgram","getProgramInfoLog","deleteShader","name","nameModelView","getActiveUniform","modelMat","getUniformLocation","nameProj","projMat","nameUV","uvMat","nameDiffuse","diffuse","nameOpacity","opacity","nameMap","map","useProgram","uniformMatrix4fv","Float32Array","uniformMatrix3fv","uniform3f","uniform1f","uniform1i","texture","createTexture","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","pixelStorei","UNPACK_ALIGNMENT","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_LINEAR","disable","CULL_FACE","depthMask","colorMask","STENCIL_TEST","POLYGON_OFFSET_FILL","SAMPLE_ALPHA_TO_COVERAGE","pos","createBuffer","uv","ib","iPos","getAttribLocation","iUV","enableVertexAttribArray","bindBuffer","ARRAY_BUFFER","vertexAttribPointer","FLOAT","updateMaterial","sw","sh","Number","isFinite","Math","round","viewport","sourceCanvas","drawImage","texImage2D","generateMipmap","updateGeometry","baseY","data","buffer","getImageData","xFactor","max","min","propertyArray","Array","fill","_","y","position","uvs","p","positions","faces","indices","bufferData","STATIC_DRAW","ELEMENT_ARRAY_BUFFER","Uint32Array","primitiveCount","length","render","clearColor","clear","COLOR_BUFFER_BIT","drawElements","TRIANGLES","UNSIGNED_INT","dispose","deleteBuffer","deleteProgram","deleteTexture","Image","info","unsafeMethods","GaugeServer","bind","port","socket","Reply","log","method","args","kwargs","unpack","includes","send","pack","code","msg","err","error","JSON","stringify","stack","close","predict","async","sourceURL","gaugeURL","loadImage","process","memoryUsage","heapUsed","size","renderGaugeImage","server","argv","main"],"mappings":"sMAIAA,WAAWC,UAAYA,EAAAA,UAOvB,MAAMC,EAASC,IACd,MAAMC,EAAc,GACpB,IAAK,MAAMC,KAAKF,EACf,IAAK,MAAMG,KAAKD,EAAGD,EAAOG,KAAKD,GAGhC,OAAOF,GAKR,MAAMI,SAOL,WAAAC,CAAYC,GALZC,KAAMC,OAAW,IACjBD,KAAOE,QAAW,IAKjBF,KAAKG,IAAMJ,CACX,CAED,SAAIK,GACH,OAAOJ,KAAKC,MACZ,CAED,SAAIG,CAAMA,GACTJ,KAAKC,OAASG,EACFJ,KAAKG,IAAIE,aAAa,gCAC9BC,OAAOF,EAAOJ,KAAKO,OACvB,CAED,UAAIA,GACH,OAAOP,KAAKE,OACZ,CAED,UAAIK,CAAOA,GACVP,KAAKE,QAAUK,EACHP,KAAKG,IAAIE,aAAa,gCAC9BC,OAAON,KAAKI,MAAOG,EACvB,CAaD,gBAAAC,CAAiBC,GAA2B,CAE5C,cAAMC,GACL,MAAMC,EAAS,IAAIC,WAAWZ,KAAKI,MAAQJ,KAAKO,OAAS,GACzDP,KAAKG,IAAIU,WAAW,EAAG,EAAGb,KAAKI,MAAOJ,KAAKO,OAAQP,KAAKG,IAAIW,KAAMd,KAAKG,IAAIY,cAAeJ,GAE1F,MAAMK,EAAS,IAAIC,SAAOjB,KAAKI,MAAOJ,KAAKO,QAI3C,OAHYS,EAAOE,WAAW,MAC1BC,aAAa,IAAI7B,EAASA,UAAC,IAAI8B,kBAAkBT,GAASX,KAAKI,MAAOJ,KAAKO,QAAS,EAAG,GAEpFS,EAAON,SAAS,MACvB,EAQF,MAAMW,EAAKC,EAAa,QAAC,IAAK,IAAK,CAAEC,WAAW,IAkOhD,MAAMC,EAAgB,IAhOR,MAAOC,cAepB,WAAA3B,CAAY4B,GAHZ1B,KAAKI,MAAW,IAChBJ,KAAMO,OAAW,IAGhBP,KAAK2B,OAASD,EAAQC,OACtB3B,KAAK4B,MAAQF,EAAQE,MACrB5B,KAAKgB,OAAS,IAAInB,SAASwB,GAE3BA,EAAGQ,yBAAyBR,EAAGS,cAAeT,EAAGU,YACjDV,EAAGQ,yBAAyBR,EAAGW,gBAAiBX,EAAGU,YAEnDV,EAAGhB,aAAa,0BAGhBL,KAAKiC,QAAUZ,EAAGa,gBAElB,MAAMC,EAAWd,EAAGe,aAAaf,EAAGS,eACpCT,EAAGgB,aAAaF,EClHA,2zBDmHhBd,EAAGiB,cAAcH,GACjB,MAAMI,EAAQlB,EAAGmB,iBAAiBL,GAClCI,GAASE,QAAQC,KAAK,UAAWH,GAEjC,MAAMI,EAAWtB,EAAGe,aAAaf,EAAGW,iBACpCX,EAAGgB,aAAaM,EC/EA,i3BDgFhBtB,EAAGiB,cAAcK,GACjB,MAAMC,EAAQvB,EAAGmB,iBAAiBG,GAClCC,GAASH,QAAQC,KAAK,UAAWE,GAEjCvB,EAAGwB,aAAa7C,KAAKiC,QAASE,GAC9Bd,EAAGwB,aAAa7C,KAAKiC,QAASU,GAC9BtB,EAAGyB,YAAY9C,KAAKiC,SAEpB,MAAMc,EAAa1B,EAAG2B,kBAAkBhD,KAAKiC,SAC7Cc,GAAcN,QAAQC,KAAK,eAAgBK,GAE3C1B,EAAG4B,aAAad,GAChBd,EAAG4B,aAAaN,GAEhB,MAAQO,KAAMC,GAAkB9B,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC5DoB,EAAWhC,EAAGiC,mBAAmBtD,KAAKiC,QAASkB,IAC7CD,KAAMK,GAAalC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACvDuB,EAAUnC,EAAGiC,mBAAmBtD,KAAKiC,QAASsB,IAC5CL,KAAMO,GAAWpC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACrDyB,EAAQrC,EAAGiC,mBAAmBtD,KAAKiC,QAASwB,IAC1CP,KAAMS,GAAgBtC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC1D2B,EAAUvC,EAAGiC,mBAAmBtD,KAAKiC,QAAS0B,IAC5CT,KAAMW,GAAgBxC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC1D6B,EAAUzC,EAAGiC,mBAAmBtD,KAAKiC,QAAS4B,IAC5CX,KAAMa,GAAY1C,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACtD+B,EAAM3C,EAAGiC,mBAAmBtD,KAAKiC,QAAS8B,GAEhD1C,EAAG4C,WAAWjE,KAAKiC,SAEnBZ,EAAG6C,iBACFV,GACA,EAEA,IAAIW,aAAa,CAAC,oBAAsB,EAAG,EAAG,EAAG,EAAG,oBAAsB,EAAG,EAAG,EAAG,GAAI,mBAAqB,EAAG,EAAG,GAAI,mBAAoB,KAE3I9C,EAAG6C,iBAAiBb,GAAU,EAAO,IAAIc,aAAa,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,EAAG,KACrG9C,EAAG+C,iBAAiBV,GAAO,EAAO,IAAIS,aAAa,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,KAC5E9C,EAAGgD,UAAUT,EAAS,EAAG,EAAG,GAC5BvC,EAAGiD,UAAUR,EAAS,GACtBzC,EAAGkD,UAAUP,EAAK,GAGlBhE,KAAKwE,QAAUnD,EAAGoD,gBAClBpD,EAAGqD,cAAcrD,EAAGsD,UACpBtD,EAAGuD,YAAYvD,EAAGwD,WAAY7E,KAAKwE,SACnCnD,EAAGyD,YAAY,OAAO,GACtBzD,EAAGyD,YAAY,OAAO,GACtBzD,EAAGyD,YAAYzD,EAAG0D,iBAAkB,GACpC1D,EAAGyD,YAAY,MAAO,GAEtBzD,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG4D,eAAgB5D,EAAG6D,eACtD7D,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG8D,eAAgB9D,EAAG6D,eACtD7D,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG+D,mBAAoB/D,EAAGgE,QAC1DhE,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAGiE,mBAAoBjE,EAAGkE,sBAE1DlE,EAAGmE,QAAQnE,EAAGoE,WACdpE,EAAGqE,WAAU,GACbrE,EAAGsE,WAAU,GAAM,GAAM,GAAM,GAC/BtE,EAAGmE,QAAQnE,EAAGuE,cACdvE,EAAGmE,QAAQnE,EAAGwE,qBACdxE,EAAGmE,QAAQnE,EAAGyE,0BAGd9F,KAAK+F,IAAM1E,EAAG2E,eACdhG,KAAKiG,GAAK5E,EAAG2E,eACbhG,KAAKkG,GAAK7E,EAAG2E,eAEb,MAAMG,EAAO9E,EAAG+E,kBAAkBpG,KAAKiC,QAAS,YAC1CoE,EAAMhF,EAAG+E,kBAAkBpG,KAAKiC,QAAS,MAG/CZ,EAAGiF,wBAAwBH,GAC3B9E,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAK+F,KACpC1E,EAAGoF,oBAAoBN,EAAM,EAAG9E,EAAGqF,OAAO,EAAO,EAAG,GAEpDrF,EAAGiF,wBAAwBD,GAC3BhF,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAKiG,IACpC5E,EAAGoF,oBAAoBJ,EAAK,EAAGhF,EAAGqF,OAAO,EAAO,EAAG,EACnD,CAED,cAAAC,EAAevG,MAAEA,EAAQ,KAAIwG,GAAEA,EAAK5G,KAAKI,MAAKyG,GAAEA,EAAK7G,KAAKO,QAAW,CAAA,GACpE,GAAIqG,IAAO5G,KAAKI,OAASyG,IAAO7G,KAAKO,OAAQ,CACxCuG,OAAOC,SAAS3G,GACnBJ,KAAKI,MAAQA,EAEbJ,KAAKI,MAAQ4G,KAAKC,MAAOjH,KAAKO,OAASqG,EAAMC,GAG9C7G,KAAKgB,OAAOZ,MAAQJ,KAAKI,MACzBJ,KAAKgB,OAAOT,OAASP,KAAKO,OAE1Bc,EAAG6F,SAAS,EAAG,EAAGlH,KAAKI,MAAOJ,KAAKO,QAEnC,MAAMiD,EAAUnC,EAAGiC,mBAAmBtD,KAAKiC,QAAS,oBACpDZ,EAAG6C,iBACFV,GACA,EACA,IAAIW,aAAa,CAAC,EAAInE,KAAKI,MAAO,EAAG,EAAG,EAAG,EAAG,EAAIJ,KAAKO,OAAQ,EAAG,EAAG,EAAG,GAAI,mBAAqB,EAAG,EAAG,GAAI,mBAAoB,IAEhI,CAGD,MAAM4G,EAAe,IAAIlG,EAAMA,OAACjB,KAAK2B,OAAOvB,MAAOJ,KAAK2B,OAAOpB,QAC/D4G,EAAajG,WAAW,MAAMkG,UAAUpH,KAAK2B,OAAQ,EAAG,GAExDN,EAAGuD,YAAYvD,EAAGwD,WAAY7E,KAAKwE,SACnCnD,EAAGgG,WAAWhG,EAAGwD,WAAY,EAAGxD,EAAGP,KAAMO,EAAGP,KAAMO,EAAGN,cAAeoG,GACpE9F,EAAGiG,eAAejG,EAAGwD,WACrB,CAED,cAAA0C,CAAeC,EAAQ,MACtB,MAAMpH,MAAEA,EAAKG,OAAEA,GAAWP,KAAK4B,MAEzBzB,EADS,IAAIc,EAAAA,OAAOb,EAAOG,GACdW,WAAW,MAC9Bf,EAAIiH,UAAUpH,KAAK4B,MAAO,EAAG,GAC7B,MAAQ6F,KAAMC,GAAWvH,EAAIwH,aAAa,EAAG,EAAGvH,EAAOG,GAEjDqH,EAAU5H,KAAKI,MAAQA,EAE7BoH,EAAQR,KAAKC,MAAMH,OAAOC,SAASS,GAASA,EAAQjH,EAAS,GAC7DiH,EAAQR,KAAKa,IAAI,EAAGb,KAAKc,IAAIvH,EAAS,EAAGiH,IAEzC,MAAMO,EAAgBC,MAAMzH,GAC1B0H,KAAK,MACLjE,IAAI,CAACkE,EAAGC,IACRH,MAAM5H,GACJ6H,KAAK,MACLjE,IAAI,CAACkE,EAAGxI,KAAO,CACfuG,GAAI,EAAEvG,EAAI,IAAOU,EAAO,GAAK+H,EAAI,IAAO5H,GACxC6H,SAAU,EAAE1I,EAAIU,EAAQ,GAAKwH,GAAUF,EAAyB,GAAjBS,EAAI/H,EAAQV,IAAUgI,EAAyB,GAAjBS,EAAI/H,EAAQV,GAAS,GAAK,IAAM,KAAOkI,EAAS,OAKjI,IAAK,IAAIO,EAAIX,EAAOW,EAAI,IAAKA,EAC5B,IAAK,IAAIzI,EAAI,EAAGA,EAAIU,IAASV,EAC5BqI,EAAcI,EAAI,GAAGzI,GAAG0I,SAAS,GAAKL,EAAcI,GAAGzI,GAAG0I,SAAS,IAAOV,EAAyB,GAAjBS,EAAI/H,EAAQV,GAAS,GAAK,KAAOkI,EAAW,IAEhI,IAAK,IAAIO,EAAIX,EAAQ,EAAGW,EAAI5H,IAAU4H,EACrC,IAAK,IAAIzI,EAAI,EAAGA,EAAIU,IAASV,EAC5BqI,EAAcI,GAAGzI,GAAG0I,SAAS,GAAKL,EAAcI,EAAI,GAAGzI,GAAG0I,SAAS,IAAOV,EAA+B,IAAtBS,EAAI,GAAK/H,EAAQV,GAAS,GAAK,KAAOkI,EAAW,IAGtI,MAAMS,EAAM9I,EAAGA,EAAGwI,GAAe/D,IAAKsE,GAAMA,EAAErC,KACxCsC,EAAYhJ,EAAGA,EAAGwI,GAAe/D,IAAKsE,GAAMA,EAAEF,WAE9CI,EAAQR,MAAMzH,EAAS,GAC3B0H,KAAK,MACLjE,IAAI,CAACkE,EAAGC,IACRH,MAAM5H,EAAQ,GACZ6H,KAAK,MACLjE,IAAI,CAACkE,EAAGxI,IAAM,CAACyI,EAAI/H,EAAQV,EAAGyI,EAAI/H,EAAQV,EAAI,GAAIyI,EAAI,GAAK/H,EAAQV,GAAIyI,EAAI,GAAK/H,EAAQV,GAAIyI,EAAI,GAAK/H,EAAQV,EAAI,EAAGyI,EAAI/H,EAAQV,EAAI,KAElI+I,EAAUlJ,EAAGA,EAAGiJ,IAEtBnH,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAK+F,KACpC1E,EAAGqH,WAAWrH,EAAGmF,aAAc,IAAIrC,aAAaoE,GAAYlH,EAAGsH,aAE/DtH,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAKiG,IACpC5E,EAAGqH,WAAWrH,EAAGmF,aAAc,IAAIrC,aAAakE,GAAMhH,EAAGsH,aAEzDtH,EAAGkF,WAAWlF,EAAGuH,qBAAsB5I,KAAKkG,IAC5C7E,EAAGqH,WAAWrH,EAAGuH,qBAAsB,IAAIC,YAAYJ,GAAUpH,EAAGsH,aAEpE3I,KAAK8I,eAAiBL,EAAQM,MAC9B,CAED,MAAAC,GAQC,OAPA3H,EAAG4H,WAAW,EAAG,EAAG,EAAG,GACvB5H,EAAG6H,MAAM7H,EAAG8H,kBAIZ9H,EAAG+H,aAAa/H,EAAGgI,UAAWrJ,KAAK8I,eAAgBzH,EAAGiI,aAAc,GAE7DtJ,KAAKgB,OAAON,UACnB,CAED,OAAA6I,GACClI,EAAGmI,aAAaxJ,KAAK+F,KACrB1E,EAAGmI,aAAaxJ,KAAKiG,IACrB5E,EAAGmI,aAAaxJ,KAAKkG,IAErB7E,EAAGoI,cAAczJ,KAAKiC,SACtBZ,EAAGqI,cAAc1J,KAAKwE,QACtB,GAGsC,CACvC7C,OAAQ,IAAIgI,EAAAA,MACZ/H,MAAO,IAAI+H,EAAAA,QEvTZlH,QAAQmH,KAAK,kDAAmD,8EAA+E,mFAY/I,MAAMC,EAAgB,CAAC,OAAQ,cAAe,WAAY,UAE1D,MAAMC,YAGL,UAAMC,CAAKC,GACVhK,KAAKiK,OAAS,IAAIC,EAAAA,YACZlK,KAAKiK,OAAOF,KAAKC,GAEvBvH,QAAQ0H,IAAI,6BAA6BH,KAEzC,IACC,UAAW,MAAOvC,KAASzH,KAAKiK,OAAQ,CACvC,MAAMG,OAAEA,EAAMC,KAAEA,EAAIC,OAAEA,GAAYC,SAAO9C,IAAoB,GAI7D,GAFAhF,QAAQ0H,IAAI,YAAYC,MAEnBP,EAAcW,SAASJ,IAAWpK,KAAKoK,GAC3C,IACC,MAAM3C,QAAazH,KAAKoK,KAAUC,EAAMC,IACxC7H,QAAQ0H,IAAI,YAAYC,WAElBpK,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,KAAM,EACNC,IAAK,UACLnD,SAGF,CAAC,MAAOoD,GACRpI,QAAQqI,MAAM,SAASV,aAAkBS,WACnC7K,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,MAAO,EACPC,IAAK,UAAUG,KAAKC,UAAUH,KAC9BpD,KAAM,OAGR,MAEDhF,QAAQqI,MAAM,SAASV,6BACjBpK,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,MAAO,EACPC,IAAK,cAAcR,IACnB3C,KAAM,OAIT,CACD,CAAC,MAAOoD,GACRpI,QAAQ0H,IAAI,4BAA6BU,EAAII,aACvCjL,KAAKiK,OAAOiB,cACZlL,KAAK+J,KAAKC,EAChB,CACD,CAED,aAAMmB,CAAQd,EAAcC,GAC3B,IAAI3I,EAAQC,EAAO4F,EAUnB,OARI6C,KACF1I,EAAQC,EAAO4F,GAAS6C,GAGtBC,KACA3I,SAAQC,QAAO4F,SAAU8C,GF6OCc,OAAOC,EAA4BC,EAA2B9D,KAC7F,MAAM7F,QAAe4J,YAAUF,GACzBzJ,QAAc2J,YAAUD,GAe9B,OAbA9J,EAAcG,OAASA,EACvBH,EAAcI,MAAQA,EAEtBJ,EAAcmF,eAAe,CAC5BvG,MAAOwB,EAAMxB,MACbwG,GAAIjF,EAAOvB,MACXyG,GAAIlF,EAAOpB,SAGZiB,EAAc+F,eAAeC,GAE7B/E,QAAQ0H,IAAIqB,QAAQC,cAAcC,UAE3B,CACNhE,aAAclG,EAAcwH,SAC5B2C,KAAM,CACLvL,MAAOoB,EAAcpB,MACrBG,OAAQiB,EAAcjB,UE/PhBqL,CAAiBjK,EAAQC,EAAO4F,EACvC,GAGF4D,iBACC,MAAMS,EAAS,IAAI/B,kBAEb+B,EAAO9B,KAAK,WAAW+B,EAAAA,KAAK9B,OACnC,CAEA+B"}
|
|
|
|
| 1 |
+
{"version":3,"file":"gauge-server.js","sources":["../../libs/gauge-renderer.ts","../../../src/pages/playground/scripts/shaders.ts","../src/gauge-server.ts"],"sourcesContent":["/* global cv */\nimport { Canvas, Image, loadImage, ImageData } from 'skia-canvas';\n// threejs内部使用了OffscreenCanvas\n//(globalThis as any).OffscreenCanvas = (globalThis as any).OffscreenCanvas || Canvas;\nglobalThis.ImageData = ImageData;\n\nimport createContext from 'gl';\n\nimport * as SHADER_SOURCE from '../../src/pages/playground/scripts/shaders';\n\n//const cc = <T>(a: T[][]): T[] => a.flat(1);\t// This is slower!\nconst cc = <T>(a: T[][]): T[] => {\n\tconst result: T[] = [];\n\tfor (const x of a) {\n\t\tfor (const e of x) result.push(e);\n\t}\n\n\treturn result;\n};\n\ntype RenderContext = ReturnType<typeof createContext>;\n\nclass GLCanvas {\n\tctx: RenderContext;\n\t_width: number = 256;\n\t_height: number = 192;\n\n\tresizeBuffer: number[];\n\n\tconstructor(context: RenderContext) {\n\t\tthis.ctx = context;\n\t}\n\n\tget width() {\n\t\treturn this._width;\n\t}\n\n\tset width(width: number) {\n\t\tthis._width = width;\n\t\tconst ext = this.ctx.getExtension('STACKGL_resize_drawingbuffer');\n\t\text.resize(width, this.height);\n\t}\n\n\tget height() {\n\t\treturn this._height;\n\t}\n\n\tset height(height: number) {\n\t\tthis._height = height;\n\t\tconst ext = this.ctx.getExtension('STACKGL_resize_drawingbuffer');\n\t\text.resize(this.width, height);\n\t}\n\n\t/*// @ts-ignore\n\tgetContext(type, options) {\n\t\tif (type === 'webgl') {\n\t\t\tthis.ctx = createContext(200, 300, options);\n\n\t\t\treturn this.ctx;\n\t\t}\n\n\t\treturn null as WebGLRenderingContext;\n\t}*/\n\n\taddEventListener(evt: 'webglcontextlost') {}\n\n\tasync toBuffer() {\n\t\tconst pixels = new Uint8Array(this.width * this.height * 4);\n\t\tthis.ctx.readPixels(0, 0, this.width, this.height, this.ctx.RGBA, this.ctx.UNSIGNED_BYTE, pixels);\n\n\t\tconst canvas = new Canvas(this.width, this.height);\n\t\tconst ctx = canvas.getContext('2d');\n\t\tctx.putImageData(new ImageData(new Uint8ClampedArray(pixels), this.width, this.height), 0, 0);\n\n\t\treturn canvas.toBuffer('png');\n\t}\n}\n\ninterface GaugeRendererInitOptions {\n\tsource: HTMLImageElement;\n\tgauge: HTMLImageElement;\n}\n\nconst gl = createContext(512, 192, { antialias: true });\n\nexport default class GaugeRenderer {\n\tsource: Image; // base64 string\n\tgauge: Image;\n\tcanvas: GLCanvas;\n\n\tprogram: WebGLProgram;\n\ttexture: WebGLTexture;\n\tpos: WebGLBuffer;\n\tuv: WebGLBuffer;\n\tib: WebGLBuffer;\n\tprimitiveCount: number;\n\n\twidth: number = 256;\n\theight: number = 192;\n\n\tconstructor(options: GaugeRendererInitOptions) {\n\t\tthis.source = options.source;\n\t\tthis.gauge = options.gauge;\n\t\tthis.canvas = new GLCanvas(gl);\n\n\t\tgl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT);\n\t\tgl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n\n\t\tgl.getExtension('OES_element_index_uint');\n\n\t\t// initial program\n\t\tthis.program = gl.createProgram();\n\n\t\tconst vsShader = gl.createShader(gl.VERTEX_SHADER);\n\t\tgl.shaderSource(vsShader, SHADER_SOURCE.vs);\n\t\tgl.compileShader(vsShader);\n\t\tconst logVs = gl.getShaderInfoLog(vsShader);\n\t\tlogVs && console.warn('vs log:', logVs);\n\n\t\tconst fsShader = gl.createShader(gl.FRAGMENT_SHADER);\n\t\tgl.shaderSource(fsShader, SHADER_SOURCE.fs);\n\t\tgl.compileShader(fsShader);\n\t\tconst logFs = gl.getShaderInfoLog(fsShader);\n\t\tlogFs && console.warn('fs log:', logFs);\n\n\t\tgl.attachShader(this.program, vsShader);\n\t\tgl.attachShader(this.program, fsShader);\n\t\tgl.linkProgram(this.program);\n\n\t\tconst logProgram = gl.getProgramInfoLog(this.program);\n\t\tlogProgram && console.warn('program log:', logProgram);\n\n\t\tgl.deleteShader(vsShader);\n\t\tgl.deleteShader(fsShader);\n\n\t\tconst { name: nameModelView } = gl.getActiveUniform(this.program, 0);\n\t\tconst modelMat = gl.getUniformLocation(this.program, nameModelView);\n\t\tconst { name: nameProj } = gl.getActiveUniform(this.program, 1);\n\t\tconst projMat = gl.getUniformLocation(this.program, nameProj);\n\t\tconst { name: nameUV } = gl.getActiveUniform(this.program, 2);\n\t\tconst uvMat = gl.getUniformLocation(this.program, nameUV);\n\t\tconst { name: nameDiffuse } = gl.getActiveUniform(this.program, 3);\n\t\tconst diffuse = gl.getUniformLocation(this.program, nameDiffuse);\n\t\tconst { name: nameOpacity } = gl.getActiveUniform(this.program, 4);\n\t\tconst opacity = gl.getUniformLocation(this.program, nameOpacity);\n\t\tconst { name: nameMap } = gl.getActiveUniform(this.program, 5);\n\t\tconst map = gl.getUniformLocation(this.program, nameMap);\n\n\t\tgl.useProgram(this.program);\n\n\t\tgl.uniformMatrix4fv(\n\t\t\tprojMat,\n\t\t\tfalse,\n\t\t\t//new Float32Array([0.0026385225355625153, 0, 0, 0, 0, -0.010416666977107525, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t\tnew Float32Array([0.002739726100116968, 0, 0, 0, 0, 0.010416666977107525, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t);\n\t\tgl.uniformMatrix4fv(modelMat, false, new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -1, 1]));\n\t\tgl.uniformMatrix3fv(uvMat, false, new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]));\n\t\tgl.uniform3f(diffuse, 1, 1, 1);\n\t\tgl.uniform1f(opacity, 1);\n\t\tgl.uniform1i(map, 0);\n\n\t\t// texture\n\t\tthis.texture = gl.createTexture();\n\t\tgl.activeTexture(gl.TEXTURE0);\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t\tgl.pixelStorei(37440, true);\n\t\tgl.pixelStorei(37441, false);\n\t\tgl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);\n\t\tgl.pixelStorei(37443, 0);\n\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n\n\t\tgl.disable(gl.CULL_FACE);\n\t\tgl.depthMask(true);\n\t\tgl.colorMask(true, true, true, true);\n\t\tgl.disable(gl.STENCIL_TEST);\n\t\tgl.disable(gl.POLYGON_OFFSET_FILL);\n\t\tgl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\n\t\t// buffers\n\t\tthis.pos = gl.createBuffer();\n\t\tthis.uv = gl.createBuffer();\n\t\tthis.ib = gl.createBuffer();\n\n\t\tconst iPos = gl.getAttribLocation(this.program, 'position');\n\t\tconst iUV = gl.getAttribLocation(this.program, 'uv');\n\t\t//console.log('indices:', iPos, iUV);\n\n\t\tgl.enableVertexAttribArray(iPos);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.pos);\n\t\tgl.vertexAttribPointer(iPos, 3, gl.FLOAT, false, 0, 0);\n\n\t\tgl.enableVertexAttribArray(iUV);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.uv);\n\t\tgl.vertexAttribPointer(iUV, 2, gl.FLOAT, false, 0, 0);\n\t}\n\n\tupdateMaterial({ width = null, sw = this.width, sh = this.height } = {}) {\n\t\tif (sw !== this.width || sh !== this.height) {\n\t\t\tif (Number.isFinite(width)) {\n\t\t\t\tthis.width = width;\n\t\t\t} else {\n\t\t\t\tthis.width = Math.round((this.height * sw) / sh);\n\t\t\t}\n\n\t\t\tthis.canvas.width = this.width;\n\t\t\tthis.canvas.height = this.height;\n\n\t\t\tgl.viewport(0, 0, this.width, this.height);\n\n\t\t\tconst projMat = gl.getUniformLocation(this.program, 'projectionMatrix');\n\t\t\tgl.uniformMatrix4fv(\n\t\t\t\tprojMat,\n\t\t\t\tfalse,\n\t\t\t\tnew Float32Array([2 / this.width, 0, 0, 0, 0, 2 / this.height, 0, 0, 0, 0, -0.20202019810676575, 0, 0, 0, -1.0202020406723022, 1])\n\t\t\t);\n\t\t}\n\n\t\t// image to canvas\n\t\tconst sourceCanvas = new Canvas(this.source.width, this.source.height);\n\t\tsourceCanvas.getContext('2d').drawImage(this.source, 0, 0);\n\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, sourceCanvas as any);\n\t\tgl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\tupdateGeometry(baseY = null) {\n\t\tconst { width, height } = this.gauge;\n\t\tconst canvas = new Canvas(width, height);\n\t\tconst ctx = canvas.getContext('2d');\n\t\tctx.drawImage(this.gauge, 0, 0);\n\t\tconst { data: buffer } = ctx.getImageData(0, 0, width, height);\n\n\t\tconst xFactor = this.width / width;\n\n\t\tbaseY = Math.round(Number.isFinite(baseY) ? baseY : height / 2);\n\t\tbaseY = Math.max(0, Math.min(height - 1, baseY));\n\n\t\tconst propertyArray = Array(height)\n\t\t\t.fill(null)\n\t\t\t.map((_, y) =>\n\t\t\t\tArray(width)\n\t\t\t\t\t.fill(null)\n\t\t\t\t\t.map((_, x) => ({\n\t\t\t\t\t\tuv: [(x + 0.5) / width, 1 - (y + 0.5) / height],\n\t\t\t\t\t\tposition: [(x - width / 2) * xFactor, (buffer[(y * width + x) * 4] + buffer[(y * width + x) * 4 + 2] / 256 - 128) / xFactor, 0],\n\t\t\t\t\t}))\n\t\t\t);\n\n\t\t// integral X by K\n\t\tfor (let y = baseY; y > 0; --y) {\n\t\t\tfor (let x = 0; x < width; ++x)\n\t\t\t\tpropertyArray[y - 1][x].position[0] = propertyArray[y][x].position[0] - ((buffer[(y * width + x) * 4 + 1] - 128) * xFactor) / 127;\n\t\t}\n\t\tfor (let y = baseY + 1; y < height; ++y) {\n\t\t\tfor (let x = 0; x < width; ++x)\n\t\t\t\tpropertyArray[y][x].position[0] = propertyArray[y - 1][x].position[0] + ((buffer[((y - 1) * width + x) * 4 + 1] - 128) * xFactor) / 127;\n\t\t}\n\n\t\tconst uvs = cc(cc(propertyArray).map((p) => p.uv));\n\t\tconst positions = cc(cc(propertyArray).map((p) => p.position));\n\n\t\tconst faces = Array(height - 1)\n\t\t\t.fill(null)\n\t\t\t.map((_, y) =>\n\t\t\t\tArray(width - 1)\n\t\t\t\t\t.fill(null)\n\t\t\t\t\t.map((_, x) => [y * width + x, y * width + x + 1, (y + 1) * width + x, (y + 1) * width + x, (y + 1) * width + x + 1, y * width + x + 1])\n\t\t\t);\n\t\tconst indices = cc(cc(faces));\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.pos);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.uv);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(uvs), gl.STATIC_DRAW);\n\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ib);\n\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(indices), gl.STATIC_DRAW);\n\n\t\tthis.primitiveCount = indices.length;\n\t}\n\n\trender() {\n\t\tgl.clearColor(1, 1, 1, 1);\n\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\n\t\t//gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ib);\n\n\t\tgl.drawElements(gl.TRIANGLES, this.primitiveCount, gl.UNSIGNED_INT, 0);\n\n\t\treturn this.canvas.toBuffer();\n\t}\n\n\tdispose() {\n\t\tgl.deleteBuffer(this.pos);\n\t\tgl.deleteBuffer(this.uv);\n\t\tgl.deleteBuffer(this.ib);\n\n\t\tgl.deleteProgram(this.program);\n\t\tgl.deleteTexture(this.texture);\n\t}\n}\n\nconst gaugeRenderer = new GaugeRenderer({\n\tsource: new Image(),\n\tgauge: new Image(),\n});\n\nexport const renderGaugeImage = async (sourceURL: string | Buffer, gaugeURL: string | Buffer, baseY?: number) => {\n\tconst source = await loadImage(sourceURL);\n\tconst gauge = await loadImage(gaugeURL);\n\n\tgaugeRenderer.source = source;\n\tgaugeRenderer.gauge = gauge;\n\n\tgaugeRenderer.updateMaterial({\n\t\twidth: gauge.width,\n\t\tsw: source.width,\n\t\tsh: source.height,\n\t});\n\n\tgaugeRenderer.updateGeometry(baseY);\n\n\tconsole.log(process.memoryUsage().heapUsed);\n\n\treturn {\n\t\tbuffer: await gaugeRenderer.render(),\n\t\tsize: {\n\t\t\twidth: gaugeRenderer.width,\n\t\t\theight: gaugeRenderer.height,\n\t\t},\n\t};\n};\n\n// renderGaugeImage('./images/source.png', './images/gauge.png');\n","export const vs = `//#version 300 es\n//#define attribute in\n//#define varying out\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define VERTEX_TEXTURES\n#define USE_MAP\n#define USE_UV\n#define BONE_TEXTURE\n#define DOUBLE_SIDED\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec3 cameraPosition;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\n#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n\nvoid main() {\n#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif\n\n\tvec3 transformed = vec3( position );\n\n\tvec4 mvPosition = vec4( transformed, 1.0 );\n\tmvPosition = modelViewMatrix * mvPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n}\n`;\n\nexport const fs = `//#version 300 es\n//#define varying in\n//out highp vec4 pc_fragColor;\n//#define gl_FragColor pc_fragColor\n//#define texture2D texture\n\nprecision highp float;\nprecision highp int;\n\n#define HIGH_PRECISION\n#define SHADER_NAME MeshBasicMaterial\n#define USE_MAP\n#define USE_UV\n#define DOUBLE_SIDED\nuniform vec3 cameraPosition;\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }\n\nuniform vec3 diffuse;\nuniform float opacity;\n\n#if defined( USE_UV )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n\n\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n\n\tgl_FragColor = diffuseColor;\n}\n`;\n","console.info(`%cstarry-omr%c v1.0.0 2026-04-23T11:21:07.532Z`, 'color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;', 'color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;');\nimport { argv } from 'yargs';\nimport { pack, unpack } from 'msgpackr';\nimport { Reply } from 'zeromq';\nimport { renderGaugeImage } from '../../libs/gauge-renderer';\n\ninterface Params {\n\tmethod: string;\n\targs: any[];\n\tkwargs: Record<any, any>;\n}\n\nconst unsafeMethods = ['bind', 'constructor', 'toString', 'toJSON'];\n\nclass GaugeServer {\n\tprivate socket: Reply;\n\n\tasync bind(port?: string) {\n\t\tthis.socket = new Reply();\n\t\tawait this.socket.bind(port);\n\n\t\tconsole.log(`gauge server listening at ${port}`);\n\n\t\ttry {\n\t\t\tfor await (const [data] of this.socket) {\n\t\t\t\tconst { method, args, kwargs } = (unpack(data) as Params) ?? {};\n\n\t\t\t\tconsole.log(`request: ${method}`);\n\n\t\t\t\tif (!unsafeMethods.includes(method) && this[method]) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst data = await this[method]?.(args, kwargs);\n\t\t\t\t\t\tconsole.log(`success: ${method}`);\n\n\t\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\t\tcode: 0,\n\t\t\t\t\t\t\t\tmsg: 'success',\n\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(`fail: ${method}, error: ${err}`);\n\t\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\t\tcode: -1,\n\t\t\t\t\t\t\t\tmsg: `Error: ${JSON.stringify(err)}`,\n\t\t\t\t\t\t\t\tdata: null,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`fail: ${method}, error: no method`);\n\t\t\t\t\tawait this.socket.send(\n\t\t\t\t\t\tpack({\n\t\t\t\t\t\t\tcode: -1,\n\t\t\t\t\t\t\tmsg: `no method: ${method}`,\n\t\t\t\t\t\t\tdata: null,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log('restarting gauge server..', err.stack);\n\t\t\tawait this.socket.close();\n\t\t\tawait this.bind(port);\n\t\t}\n\t}\n\n\tasync predict(args?: any[], kwargs?: Record<any, any>) {\n\t\tlet source, gauge, baseY;\n\n\t\tif (args) {\n\t\t\t[source, gauge, baseY] = args;\n\t\t}\n\n\t\tif (kwargs) {\n\t\t\t({ source, gauge, baseY } = kwargs);\n\t\t}\n\n\t\treturn renderGaugeImage(source, gauge, baseY);\n\t}\n}\n\nasync function main() {\n\tconst server = new GaugeServer();\n\n\tawait server.bind(`tcp://*:${argv.port}`);\n}\n\nmain();\n"],"names":["globalThis","ImageData","cc","a","result","x","e","push","GLCanvas","constructor","context","this","_width","_height","ctx","width","getExtension","resize","height","addEventListener","evt","toBuffer","pixels","Uint8Array","readPixels","RGBA","UNSIGNED_BYTE","canvas","Canvas","getContext","putImageData","Uint8ClampedArray","gl","createContext","antialias","gaugeRenderer","GaugeRenderer","options","source","gauge","getShaderPrecisionFormat","VERTEX_SHADER","HIGH_FLOAT","FRAGMENT_SHADER","program","createProgram","vsShader","createShader","shaderSource","compileShader","logVs","getShaderInfoLog","console","warn","fsShader","logFs","attachShader","linkProgram","logProgram","getProgramInfoLog","deleteShader","name","nameModelView","getActiveUniform","modelMat","getUniformLocation","nameProj","projMat","nameUV","uvMat","nameDiffuse","diffuse","nameOpacity","opacity","nameMap","map","useProgram","uniformMatrix4fv","Float32Array","uniformMatrix3fv","uniform3f","uniform1f","uniform1i","texture","createTexture","activeTexture","TEXTURE0","bindTexture","TEXTURE_2D","pixelStorei","UNPACK_ALIGNMENT","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_LINEAR","disable","CULL_FACE","depthMask","colorMask","STENCIL_TEST","POLYGON_OFFSET_FILL","SAMPLE_ALPHA_TO_COVERAGE","pos","createBuffer","uv","ib","iPos","getAttribLocation","iUV","enableVertexAttribArray","bindBuffer","ARRAY_BUFFER","vertexAttribPointer","FLOAT","updateMaterial","sw","sh","Number","isFinite","Math","round","viewport","sourceCanvas","drawImage","texImage2D","generateMipmap","updateGeometry","baseY","data","buffer","getImageData","xFactor","max","min","propertyArray","Array","fill","_","y","position","uvs","p","positions","faces","indices","bufferData","STATIC_DRAW","ELEMENT_ARRAY_BUFFER","Uint32Array","primitiveCount","length","render","clearColor","clear","COLOR_BUFFER_BIT","drawElements","TRIANGLES","UNSIGNED_INT","dispose","deleteBuffer","deleteProgram","deleteTexture","Image","info","unsafeMethods","GaugeServer","bind","port","socket","Reply","log","method","args","kwargs","unpack","includes","send","pack","code","msg","err","error","JSON","stringify","stack","close","predict","async","sourceURL","gaugeURL","loadImage","process","memoryUsage","heapUsed","size","renderGaugeImage","server","argv","main"],"mappings":"sMAIAA,WAAWC,UAAYA,EAAAA,UAOvB,MAAMC,EAASC,IACd,MAAMC,EAAc,GACpB,IAAK,MAAMC,KAAKF,EACf,IAAK,MAAMG,KAAKD,EAAGD,EAAOG,KAAKD,GAGhC,OAAOF,GAKR,MAAMI,SAOL,WAAAC,CAAYC,GALZC,KAAMC,OAAW,IACjBD,KAAOE,QAAW,IAKjBF,KAAKG,IAAMJ,CACX,CAED,SAAIK,GACH,OAAOJ,KAAKC,MACZ,CAED,SAAIG,CAAMA,GACTJ,KAAKC,OAASG,EACFJ,KAAKG,IAAIE,aAAa,gCAC9BC,OAAOF,EAAOJ,KAAKO,OACvB,CAED,UAAIA,GACH,OAAOP,KAAKE,OACZ,CAED,UAAIK,CAAOA,GACVP,KAAKE,QAAUK,EACHP,KAAKG,IAAIE,aAAa,gCAC9BC,OAAON,KAAKI,MAAOG,EACvB,CAaD,gBAAAC,CAAiBC,GAA2B,CAE5C,cAAMC,GACL,MAAMC,EAAS,IAAIC,WAAWZ,KAAKI,MAAQJ,KAAKO,OAAS,GACzDP,KAAKG,IAAIU,WAAW,EAAG,EAAGb,KAAKI,MAAOJ,KAAKO,OAAQP,KAAKG,IAAIW,KAAMd,KAAKG,IAAIY,cAAeJ,GAE1F,MAAMK,EAAS,IAAIC,SAAOjB,KAAKI,MAAOJ,KAAKO,QAI3C,OAHYS,EAAOE,WAAW,MAC1BC,aAAa,IAAI7B,EAASA,UAAC,IAAI8B,kBAAkBT,GAASX,KAAKI,MAAOJ,KAAKO,QAAS,EAAG,GAEpFS,EAAON,SAAS,MACvB,EAQF,MAAMW,EAAKC,EAAa,QAAC,IAAK,IAAK,CAAEC,WAAW,IAkOhD,MAAMC,EAAgB,IAhOR,MAAOC,cAepB,WAAA3B,CAAY4B,GAHZ1B,KAAKI,MAAW,IAChBJ,KAAMO,OAAW,IAGhBP,KAAK2B,OAASD,EAAQC,OACtB3B,KAAK4B,MAAQF,EAAQE,MACrB5B,KAAKgB,OAAS,IAAInB,SAASwB,GAE3BA,EAAGQ,yBAAyBR,EAAGS,cAAeT,EAAGU,YACjDV,EAAGQ,yBAAyBR,EAAGW,gBAAiBX,EAAGU,YAEnDV,EAAGhB,aAAa,0BAGhBL,KAAKiC,QAAUZ,EAAGa,gBAElB,MAAMC,EAAWd,EAAGe,aAAaf,EAAGS,eACpCT,EAAGgB,aAAaF,EClHA,2zBDmHhBd,EAAGiB,cAAcH,GACjB,MAAMI,EAAQlB,EAAGmB,iBAAiBL,GAClCI,GAASE,QAAQC,KAAK,UAAWH,GAEjC,MAAMI,EAAWtB,EAAGe,aAAaf,EAAGW,iBACpCX,EAAGgB,aAAaM,EC/EA,i3BDgFhBtB,EAAGiB,cAAcK,GACjB,MAAMC,EAAQvB,EAAGmB,iBAAiBG,GAClCC,GAASH,QAAQC,KAAK,UAAWE,GAEjCvB,EAAGwB,aAAa7C,KAAKiC,QAASE,GAC9Bd,EAAGwB,aAAa7C,KAAKiC,QAASU,GAC9BtB,EAAGyB,YAAY9C,KAAKiC,SAEpB,MAAMc,EAAa1B,EAAG2B,kBAAkBhD,KAAKiC,SAC7Cc,GAAcN,QAAQC,KAAK,eAAgBK,GAE3C1B,EAAG4B,aAAad,GAChBd,EAAG4B,aAAaN,GAEhB,MAAQO,KAAMC,GAAkB9B,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC5DoB,EAAWhC,EAAGiC,mBAAmBtD,KAAKiC,QAASkB,IAC7CD,KAAMK,GAAalC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACvDuB,EAAUnC,EAAGiC,mBAAmBtD,KAAKiC,QAASsB,IAC5CL,KAAMO,GAAWpC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACrDyB,EAAQrC,EAAGiC,mBAAmBtD,KAAKiC,QAASwB,IAC1CP,KAAMS,GAAgBtC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC1D2B,EAAUvC,EAAGiC,mBAAmBtD,KAAKiC,QAAS0B,IAC5CT,KAAMW,GAAgBxC,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GAC1D6B,EAAUzC,EAAGiC,mBAAmBtD,KAAKiC,QAAS4B,IAC5CX,KAAMa,GAAY1C,EAAG+B,iBAAiBpD,KAAKiC,QAAS,GACtD+B,EAAM3C,EAAGiC,mBAAmBtD,KAAKiC,QAAS8B,GAEhD1C,EAAG4C,WAAWjE,KAAKiC,SAEnBZ,EAAG6C,iBACFV,GACA,EAEA,IAAIW,aAAa,CAAC,oBAAsB,EAAG,EAAG,EAAG,EAAG,oBAAsB,EAAG,EAAG,EAAG,GAAI,mBAAqB,EAAG,EAAG,GAAI,mBAAoB,KAE3I9C,EAAG6C,iBAAiBb,GAAU,EAAO,IAAIc,aAAa,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,EAAG,KACrG9C,EAAG+C,iBAAiBV,GAAO,EAAO,IAAIS,aAAa,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,KAC5E9C,EAAGgD,UAAUT,EAAS,EAAG,EAAG,GAC5BvC,EAAGiD,UAAUR,EAAS,GACtBzC,EAAGkD,UAAUP,EAAK,GAGlBhE,KAAKwE,QAAUnD,EAAGoD,gBAClBpD,EAAGqD,cAAcrD,EAAGsD,UACpBtD,EAAGuD,YAAYvD,EAAGwD,WAAY7E,KAAKwE,SACnCnD,EAAGyD,YAAY,OAAO,GACtBzD,EAAGyD,YAAY,OAAO,GACtBzD,EAAGyD,YAAYzD,EAAG0D,iBAAkB,GACpC1D,EAAGyD,YAAY,MAAO,GAEtBzD,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG4D,eAAgB5D,EAAG6D,eACtD7D,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG8D,eAAgB9D,EAAG6D,eACtD7D,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAG+D,mBAAoB/D,EAAGgE,QAC1DhE,EAAG2D,cAAc3D,EAAGwD,WAAYxD,EAAGiE,mBAAoBjE,EAAGkE,sBAE1DlE,EAAGmE,QAAQnE,EAAGoE,WACdpE,EAAGqE,WAAU,GACbrE,EAAGsE,WAAU,GAAM,GAAM,GAAM,GAC/BtE,EAAGmE,QAAQnE,EAAGuE,cACdvE,EAAGmE,QAAQnE,EAAGwE,qBACdxE,EAAGmE,QAAQnE,EAAGyE,0BAGd9F,KAAK+F,IAAM1E,EAAG2E,eACdhG,KAAKiG,GAAK5E,EAAG2E,eACbhG,KAAKkG,GAAK7E,EAAG2E,eAEb,MAAMG,EAAO9E,EAAG+E,kBAAkBpG,KAAKiC,QAAS,YAC1CoE,EAAMhF,EAAG+E,kBAAkBpG,KAAKiC,QAAS,MAG/CZ,EAAGiF,wBAAwBH,GAC3B9E,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAK+F,KACpC1E,EAAGoF,oBAAoBN,EAAM,EAAG9E,EAAGqF,OAAO,EAAO,EAAG,GAEpDrF,EAAGiF,wBAAwBD,GAC3BhF,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAKiG,IACpC5E,EAAGoF,oBAAoBJ,EAAK,EAAGhF,EAAGqF,OAAO,EAAO,EAAG,EACnD,CAED,cAAAC,EAAevG,MAAEA,EAAQ,KAAIwG,GAAEA,EAAK5G,KAAKI,MAAKyG,GAAEA,EAAK7G,KAAKO,QAAW,CAAA,GACpE,GAAIqG,IAAO5G,KAAKI,OAASyG,IAAO7G,KAAKO,OAAQ,CACxCuG,OAAOC,SAAS3G,GACnBJ,KAAKI,MAAQA,EAEbJ,KAAKI,MAAQ4G,KAAKC,MAAOjH,KAAKO,OAASqG,EAAMC,GAG9C7G,KAAKgB,OAAOZ,MAAQJ,KAAKI,MACzBJ,KAAKgB,OAAOT,OAASP,KAAKO,OAE1Bc,EAAG6F,SAAS,EAAG,EAAGlH,KAAKI,MAAOJ,KAAKO,QAEnC,MAAMiD,EAAUnC,EAAGiC,mBAAmBtD,KAAKiC,QAAS,oBACpDZ,EAAG6C,iBACFV,GACA,EACA,IAAIW,aAAa,CAAC,EAAInE,KAAKI,MAAO,EAAG,EAAG,EAAG,EAAG,EAAIJ,KAAKO,OAAQ,EAAG,EAAG,EAAG,GAAI,mBAAqB,EAAG,EAAG,GAAI,mBAAoB,IAEhI,CAGD,MAAM4G,EAAe,IAAIlG,EAAMA,OAACjB,KAAK2B,OAAOvB,MAAOJ,KAAK2B,OAAOpB,QAC/D4G,EAAajG,WAAW,MAAMkG,UAAUpH,KAAK2B,OAAQ,EAAG,GAExDN,EAAGuD,YAAYvD,EAAGwD,WAAY7E,KAAKwE,SACnCnD,EAAGgG,WAAWhG,EAAGwD,WAAY,EAAGxD,EAAGP,KAAMO,EAAGP,KAAMO,EAAGN,cAAeoG,GACpE9F,EAAGiG,eAAejG,EAAGwD,WACrB,CAED,cAAA0C,CAAeC,EAAQ,MACtB,MAAMpH,MAAEA,EAAKG,OAAEA,GAAWP,KAAK4B,MAEzBzB,EADS,IAAIc,EAAAA,OAAOb,EAAOG,GACdW,WAAW,MAC9Bf,EAAIiH,UAAUpH,KAAK4B,MAAO,EAAG,GAC7B,MAAQ6F,KAAMC,GAAWvH,EAAIwH,aAAa,EAAG,EAAGvH,EAAOG,GAEjDqH,EAAU5H,KAAKI,MAAQA,EAE7BoH,EAAQR,KAAKC,MAAMH,OAAOC,SAASS,GAASA,EAAQjH,EAAS,GAC7DiH,EAAQR,KAAKa,IAAI,EAAGb,KAAKc,IAAIvH,EAAS,EAAGiH,IAEzC,MAAMO,EAAgBC,MAAMzH,GAC1B0H,KAAK,MACLjE,IAAI,CAACkE,EAAGC,IACRH,MAAM5H,GACJ6H,KAAK,MACLjE,IAAI,CAACkE,EAAGxI,KAAO,CACfuG,GAAI,EAAEvG,EAAI,IAAOU,EAAO,GAAK+H,EAAI,IAAO5H,GACxC6H,SAAU,EAAE1I,EAAIU,EAAQ,GAAKwH,GAAUF,EAAyB,GAAjBS,EAAI/H,EAAQV,IAAUgI,EAAyB,GAAjBS,EAAI/H,EAAQV,GAAS,GAAK,IAAM,KAAOkI,EAAS,OAKjI,IAAK,IAAIO,EAAIX,EAAOW,EAAI,IAAKA,EAC5B,IAAK,IAAIzI,EAAI,EAAGA,EAAIU,IAASV,EAC5BqI,EAAcI,EAAI,GAAGzI,GAAG0I,SAAS,GAAKL,EAAcI,GAAGzI,GAAG0I,SAAS,IAAOV,EAAyB,GAAjBS,EAAI/H,EAAQV,GAAS,GAAK,KAAOkI,EAAW,IAEhI,IAAK,IAAIO,EAAIX,EAAQ,EAAGW,EAAI5H,IAAU4H,EACrC,IAAK,IAAIzI,EAAI,EAAGA,EAAIU,IAASV,EAC5BqI,EAAcI,GAAGzI,GAAG0I,SAAS,GAAKL,EAAcI,EAAI,GAAGzI,GAAG0I,SAAS,IAAOV,EAA+B,IAAtBS,EAAI,GAAK/H,EAAQV,GAAS,GAAK,KAAOkI,EAAW,IAGtI,MAAMS,EAAM9I,EAAGA,EAAGwI,GAAe/D,IAAKsE,GAAMA,EAAErC,KACxCsC,EAAYhJ,EAAGA,EAAGwI,GAAe/D,IAAKsE,GAAMA,EAAEF,WAE9CI,EAAQR,MAAMzH,EAAS,GAC3B0H,KAAK,MACLjE,IAAI,CAACkE,EAAGC,IACRH,MAAM5H,EAAQ,GACZ6H,KAAK,MACLjE,IAAI,CAACkE,EAAGxI,IAAM,CAACyI,EAAI/H,EAAQV,EAAGyI,EAAI/H,EAAQV,EAAI,GAAIyI,EAAI,GAAK/H,EAAQV,GAAIyI,EAAI,GAAK/H,EAAQV,GAAIyI,EAAI,GAAK/H,EAAQV,EAAI,EAAGyI,EAAI/H,EAAQV,EAAI,KAElI+I,EAAUlJ,EAAGA,EAAGiJ,IAEtBnH,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAK+F,KACpC1E,EAAGqH,WAAWrH,EAAGmF,aAAc,IAAIrC,aAAaoE,GAAYlH,EAAGsH,aAE/DtH,EAAGkF,WAAWlF,EAAGmF,aAAcxG,KAAKiG,IACpC5E,EAAGqH,WAAWrH,EAAGmF,aAAc,IAAIrC,aAAakE,GAAMhH,EAAGsH,aAEzDtH,EAAGkF,WAAWlF,EAAGuH,qBAAsB5I,KAAKkG,IAC5C7E,EAAGqH,WAAWrH,EAAGuH,qBAAsB,IAAIC,YAAYJ,GAAUpH,EAAGsH,aAEpE3I,KAAK8I,eAAiBL,EAAQM,MAC9B,CAED,MAAAC,GAQC,OAPA3H,EAAG4H,WAAW,EAAG,EAAG,EAAG,GACvB5H,EAAG6H,MAAM7H,EAAG8H,kBAIZ9H,EAAG+H,aAAa/H,EAAGgI,UAAWrJ,KAAK8I,eAAgBzH,EAAGiI,aAAc,GAE7DtJ,KAAKgB,OAAON,UACnB,CAED,OAAA6I,GACClI,EAAGmI,aAAaxJ,KAAK+F,KACrB1E,EAAGmI,aAAaxJ,KAAKiG,IACrB5E,EAAGmI,aAAaxJ,KAAKkG,IAErB7E,EAAGoI,cAAczJ,KAAKiC,SACtBZ,EAAGqI,cAAc1J,KAAKwE,QACtB,GAGsC,CACvC7C,OAAQ,IAAIgI,EAAAA,MACZ/H,MAAO,IAAI+H,EAAAA,QEvTZlH,QAAQmH,KAAK,kDAAmD,8EAA+E,mFAY/I,MAAMC,EAAgB,CAAC,OAAQ,cAAe,WAAY,UAE1D,MAAMC,YAGL,UAAMC,CAAKC,GACVhK,KAAKiK,OAAS,IAAIC,EAAAA,YACZlK,KAAKiK,OAAOF,KAAKC,GAEvBvH,QAAQ0H,IAAI,6BAA6BH,KAEzC,IACC,UAAW,MAAOvC,KAASzH,KAAKiK,OAAQ,CACvC,MAAMG,OAAEA,EAAMC,KAAEA,EAAIC,OAAEA,GAAYC,SAAO9C,IAAoB,GAI7D,GAFAhF,QAAQ0H,IAAI,YAAYC,MAEnBP,EAAcW,SAASJ,IAAWpK,KAAKoK,GAC3C,IACC,MAAM3C,QAAazH,KAAKoK,KAAUC,EAAMC,IACxC7H,QAAQ0H,IAAI,YAAYC,WAElBpK,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,KAAM,EACNC,IAAK,UACLnD,SAGF,CAAC,MAAOoD,GACRpI,QAAQqI,MAAM,SAASV,aAAkBS,WACnC7K,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,MAAO,EACPC,IAAK,UAAUG,KAAKC,UAAUH,KAC9BpD,KAAM,OAGR,MAEDhF,QAAQqI,MAAM,SAASV,6BACjBpK,KAAKiK,OAAOQ,KACjBC,OAAK,CACJC,MAAO,EACPC,IAAK,cAAcR,IACnB3C,KAAM,OAIT,CACD,CAAC,MAAOoD,GACRpI,QAAQ0H,IAAI,4BAA6BU,EAAII,aACvCjL,KAAKiK,OAAOiB,cACZlL,KAAK+J,KAAKC,EAChB,CACD,CAED,aAAMmB,CAAQd,EAAcC,GAC3B,IAAI3I,EAAQC,EAAO4F,EAUnB,OARI6C,KACF1I,EAAQC,EAAO4F,GAAS6C,GAGtBC,KACA3I,SAAQC,QAAO4F,SAAU8C,GF6OCc,OAAOC,EAA4BC,EAA2B9D,KAC7F,MAAM7F,QAAe4J,YAAUF,GACzBzJ,QAAc2J,YAAUD,GAe9B,OAbA9J,EAAcG,OAASA,EACvBH,EAAcI,MAAQA,EAEtBJ,EAAcmF,eAAe,CAC5BvG,MAAOwB,EAAMxB,MACbwG,GAAIjF,EAAOvB,MACXyG,GAAIlF,EAAOpB,SAGZiB,EAAc+F,eAAeC,GAE7B/E,QAAQ0H,IAAIqB,QAAQC,cAAcC,UAE3B,CACNhE,aAAclG,EAAcwH,SAC5B2C,KAAM,CACLvL,MAAOoB,EAAcpB,MACrBG,OAAQiB,EAAcjB,UE/PhBqL,CAAiBjK,EAAQC,EAAO4F,EACvC,GAGF4D,iBACC,MAAMS,EAAS,IAAI/B,kBAEb+B,EAAO9B,KAAK,WAAW+B,EAAAA,KAAK9B,OACnC,CAEA+B"}
|
backend/omr/dist/index.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/omr/dist/index.js.map
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/omr/dist/regulator.d.ts
CHANGED
|
@@ -2383,21 +2383,6 @@ declare namespace beadSolver {
|
|
| 2383 |
// page general
|
| 2384 |
Other = "Other"
|
| 2385 |
}
|
| 2386 |
-
class PatchMeasure extends SimpleClass {
|
| 2387 |
-
static className: string;
|
| 2388 |
-
measureIndex: number;
|
| 2389 |
-
staffMask: number;
|
| 2390 |
-
basic: StaffBasic;
|
| 2391 |
-
//points: SemanticPoint[];
|
| 2392 |
-
events: EventTerm[];
|
| 2393 |
-
contexts: ContextedTerm[][]; // [staff]
|
| 2394 |
-
marks: MarkTerm[];
|
| 2395 |
-
voices: number[][]; // [voice, id]
|
| 2396 |
-
constructor(data: any);
|
| 2397 |
-
get staffN(): number;
|
| 2398 |
-
get basics(): StaffBasic[];
|
| 2399 |
-
get duration(): number;
|
| 2400 |
-
}
|
| 2401 |
enum EventElementType {
|
| 2402 |
PAD = 0,
|
| 2403 |
BOS = 1,
|
|
@@ -2477,6 +2462,21 @@ declare namespace beadSolver {
|
|
| 2477 |
static roll(events: EventTerm[]): MeasureRectification;
|
| 2478 |
}
|
| 2479 |
const genMeasureRectifications: (measure: SpartitoMeasure) => Generator<MeasureRectification>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2480 |
enum SemanticType {
|
| 2481 |
// clefs
|
| 2482 |
ClefG = "ClefG",
|
|
|
|
| 2383 |
// page general
|
| 2384 |
Other = "Other"
|
| 2385 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2386 |
enum EventElementType {
|
| 2387 |
PAD = 0,
|
| 2388 |
BOS = 1,
|
|
|
|
| 2462 |
static roll(events: EventTerm[]): MeasureRectification;
|
| 2463 |
}
|
| 2464 |
const genMeasureRectifications: (measure: SpartitoMeasure) => Generator<MeasureRectification>;
|
| 2465 |
+
class PatchMeasure extends SimpleClass {
|
| 2466 |
+
static className: string;
|
| 2467 |
+
measureIndex: number;
|
| 2468 |
+
staffMask: number;
|
| 2469 |
+
basic: StaffBasic;
|
| 2470 |
+
//points: SemanticPoint[];
|
| 2471 |
+
events: EventTerm[];
|
| 2472 |
+
contexts: ContextedTerm[][]; // [staff]
|
| 2473 |
+
marks: MarkTerm[];
|
| 2474 |
+
voices: number[][]; // [voice, id]
|
| 2475 |
+
constructor(data: any);
|
| 2476 |
+
get staffN(): number;
|
| 2477 |
+
get basics(): StaffBasic[];
|
| 2478 |
+
get duration(): number;
|
| 2479 |
+
}
|
| 2480 |
enum SemanticType {
|
| 2481 |
// clefs
|
| 2482 |
ClefG = "ClefG",
|
backend/omr/dist/regulator.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
/**
|
| 2 |
* name: backend
|
| 3 |
* version: v1.0.0
|
| 4 |
-
* build time:
|
| 5 |
* system user: camus
|
| 6 |
* git user name: k.l.lambda
|
| 7 |
* git user email: k.l.lambda@gmail.com
|
|
@@ -2626,6 +2626,7 @@ var measureLayout = /*#__PURE__*/Object.freeze({
|
|
| 2626 |
ABAMLayout: ABAMLayout
|
| 2627 |
});
|
| 2628 |
|
|
|
|
| 2629 |
/* parser generated by jison 0.4.18 */
|
| 2630 |
/*
|
| 2631 |
Returns a Parser object of the following structure:
|
|
@@ -3750,6 +3751,7 @@ class StaffLayout {
|
|
| 3750 |
}
|
| 3751 |
}
|
| 3752 |
|
|
|
|
| 3753 |
/* parser generated by jison 0.4.18 */
|
| 3754 |
/*
|
| 3755 |
Returns a Parser object of the following structure:
|
|
@@ -5032,15 +5034,20 @@ const evaluateMeasure = (measure) => {
|
|
| 5032 |
// console.log("irregularTick:", event.tick, fragment);
|
| 5033 |
return fragment < WHOLE_DURATION;
|
| 5034 |
});
|
| 5035 |
-
const beamStatus = measure.voices.map((voice) => voice.reduce(({ status, broken }, ei) => {
|
| 5036 |
const event = eventMap[ei];
|
| 5037 |
if (event.beam) {
|
|
|
|
|
|
|
|
|
|
| 5038 |
status += BEAM_STATUS[event.beam];
|
| 5039 |
broken = broken || !(status >= 0 && status <= 1);
|
| 5040 |
}
|
|
|
|
|
|
|
| 5041 |
return { status, broken };
|
| 5042 |
}, { status: 0, broken: false }));
|
| 5043 |
-
const beamBroken = beamStatus.some(({
|
| 5044 |
let spaceTime = 0;
|
| 5045 |
let surplusTime = 0;
|
| 5046 |
measure.voices.forEach((voice) => {
|
|
@@ -5889,9 +5896,11 @@ class Measure extends SimpleClass {
|
|
| 5889 |
flag.y < flagRange[1]);
|
| 5890 |
chord.division = nearbyFlags.reduce((d, flag) => Math.max(d, flag.division), chord.division);
|
| 5891 |
nearbyFlags.forEach((flag) => accs.add(flag.id));
|
| 5892 |
-
|
| 5893 |
-
|
| 5894 |
-
|
|
|
|
|
|
|
| 5895 |
}
|
| 5896 |
const nearbyDots = dots.filter((dot) => !accs.has(dot.id) &&
|
| 5897 |
dot.x > rect.x + rect.width - 0.2 &&
|
|
@@ -6214,7 +6223,7 @@ class Staff extends SimpleClass {
|
|
| 6214 |
};
|
| 6215 |
// find root noteheads on stem
|
| 6216 |
stems.forEach((stem) => {
|
| 6217 |
-
const attachedHeads = noteheads.filter((nh) => Math.abs(nh.x - stem.x) - NOTEHEAD_WIDTHS[nh.semantic] / 2 < 0.
|
| 6218 |
Math.abs(nh.x - stem.x) - NOTEHEAD_WIDTHS[nh.semantic] / 2 > -0.44 && // for grace noteheads, more close to their stem
|
| 6219 |
nh.y > stem.y1 - 0.5 &&
|
| 6220 |
nh.y < stem.y2 + 0.5 &&
|
|
@@ -6849,6 +6858,14 @@ class System extends SimpleClass {
|
|
| 6849 |
const barXs = Object.entries(barColumns)
|
| 6850 |
.filter(([x, intensity]) => (intensity > 3 * this.staves.length))
|
| 6851 |
.map(([x]) => Number(x));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6852 |
barXs.sort((x1, x2) => x1 - x2);
|
| 6853 |
barXs.forEach((x, i) => {
|
| 6854 |
if (i <= 0 || x - barXs[i - 1] > 2)
|
|
@@ -11996,26 +12013,6 @@ class Solver {
|
|
| 11996 |
}
|
| 11997 |
}
|
| 11998 |
|
| 11999 |
-
class PatchMeasure extends SimpleClass {
|
| 12000 |
-
constructor(data) {
|
| 12001 |
-
super();
|
| 12002 |
-
Object.assign(this, data);
|
| 12003 |
-
}
|
| 12004 |
-
get staffN() {
|
| 12005 |
-
return Math.floor(Math.log2(this.staffMask)) + 1;
|
| 12006 |
-
}
|
| 12007 |
-
get basics() {
|
| 12008 |
-
return Array(this.staffN).fill(this.basic);
|
| 12009 |
-
}
|
| 12010 |
-
get duration() {
|
| 12011 |
-
return Math.max(0, ...this.voices.map((ids) => {
|
| 12012 |
-
const events = ids.map((id) => this.events.find((e) => e.id === id));
|
| 12013 |
-
return events.reduce((duration, event) => duration + event.duration, 0);
|
| 12014 |
-
}));
|
| 12015 |
-
}
|
| 12016 |
-
}
|
| 12017 |
-
PatchMeasure.className = 'PatchMeasure';
|
| 12018 |
-
|
| 12019 |
var EventElementType;
|
| 12020 |
(function (EventElementType) {
|
| 12021 |
EventElementType[EventElementType["PAD"] = 0] = "PAD";
|
|
@@ -12095,6 +12092,26 @@ class EventClusterSet extends SimpleClass {
|
|
| 12095 |
}
|
| 12096 |
EventClusterSet.className = 'EventClusterSet';
|
| 12097 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12098 |
var SimplePolicy;
|
| 12099 |
(function (SimplePolicy) {
|
| 12100 |
const constructXMap = (measure) => {
|
|
@@ -12747,7 +12764,13 @@ class SpartitoMeasure extends SimpleClass {
|
|
| 12747 |
return !this.events?.length || !this.voices?.length;
|
| 12748 |
}
|
| 12749 |
get hasIllEvent() {
|
| 12750 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12751 |
}
|
| 12752 |
get brief() {
|
| 12753 |
const timesig = `${this.timeSignature.numerator}/${this.timeSignature.denominator}`;
|
|
@@ -12901,7 +12924,7 @@ class SpartitoMeasure extends SimpleClass {
|
|
| 12901 |
event.division = se.division;
|
| 12902 |
if (Number.isFinite(se.dots))
|
| 12903 |
event.dots = se.dots;
|
| 12904 |
-
if (se.beam)
|
| 12905 |
event.beam = se.beam;
|
| 12906 |
if (se.grace !== undefined)
|
| 12907 |
event.grace = se.grace ? GraceType.Grace : undefined;
|
|
@@ -13355,6 +13378,36 @@ class Spartito extends SimpleClass {
|
|
| 13355 |
event.pitches.forEach((pitch) => (pitch.tied = true));
|
| 13356 |
});
|
| 13357 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13358 |
// [measure, voice]
|
| 13359 |
const measures = this.measures.map((measure /*, mi*/) => {
|
| 13360 |
console.assert(measure.validRegulated, '[makeVoiceStaves] measure is invalid:', measure);
|
|
@@ -13458,7 +13511,6 @@ class Spartito extends SimpleClass {
|
|
| 13458 |
}
|
| 13459 |
return voices;
|
| 13460 |
});
|
| 13461 |
-
//console.log("measures:", measures);
|
| 13462 |
// compute traits for voice-measures
|
| 13463 |
measures.forEach((voices) => voices.forEach((measure) => {
|
| 13464 |
const words = [];
|
|
@@ -14380,6 +14432,7 @@ class Score extends SimpleClass {
|
|
| 14380 |
matrixH: cluster ,
|
| 14381 |
matrixV: cluster ,
|
| 14382 |
voices: patch ? patch.voices : null,
|
|
|
|
| 14383 |
});
|
| 14384 |
})));
|
| 14385 |
const staffLayout = this.staffLayout;
|
|
@@ -14765,6 +14818,8 @@ class EditableEvent extends EventTerm {
|
|
| 14765 |
return !!self.grace;
|
| 14766 |
case 'timeWarp':
|
| 14767 |
return self.timeWarp ? `${self.timeWarp.numerator}/${self.timeWarp.denominator}` : null;
|
|
|
|
|
|
|
| 14768 |
case 'pitches':
|
| 14769 |
return self.pitches;
|
| 14770 |
}
|
|
@@ -14803,6 +14858,18 @@ class EditableEvent extends EventTerm {
|
|
| 14803 |
}
|
| 14804 |
}
|
| 14805 |
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14806 |
case 'id':
|
| 14807 |
case 'pitches':
|
| 14808 |
return true;
|
|
@@ -14820,6 +14887,7 @@ class EditableEvent extends EventTerm {
|
|
| 14820 |
'tied',
|
| 14821 |
'beam',
|
| 14822 |
'timeWarp',
|
|
|
|
| 14823 |
'tremolo',
|
| 14824 |
'tremoloLink',
|
| 14825 |
'glissando',
|
|
@@ -16191,7 +16259,7 @@ const saveEditableMeasures = async (score, measureIndices, saveMeasure, { status
|
|
| 16191 |
});
|
| 16192 |
};
|
| 16193 |
|
| 16194 |
-
console.info(`%cstarry-omr%c v1.0.0 2026-
|
| 16195 |
|
| 16196 |
exports.PyClients = PyClients;
|
| 16197 |
exports.abstractRegulationBeadStats = abstractRegulationBeadStats;
|
|
|
|
| 1 |
/**
|
| 2 |
* name: backend
|
| 3 |
* version: v1.0.0
|
| 4 |
+
* build time: 4/23/2026, 7:20:50 PM
|
| 5 |
* system user: camus
|
| 6 |
* git user name: k.l.lambda
|
| 7 |
* git user email: k.l.lambda@gmail.com
|
|
|
|
| 2626 |
ABAMLayout: ABAMLayout
|
| 2627 |
});
|
| 2628 |
|
| 2629 |
+
// @ts-nocheck
|
| 2630 |
/* parser generated by jison 0.4.18 */
|
| 2631 |
/*
|
| 2632 |
Returns a Parser object of the following structure:
|
|
|
|
| 3751 |
}
|
| 3752 |
}
|
| 3753 |
|
| 3754 |
+
// @ts-nocheck
|
| 3755 |
/* parser generated by jison 0.4.18 */
|
| 3756 |
/*
|
| 3757 |
Returns a Parser object of the following structure:
|
|
|
|
| 5034 |
// console.log("irregularTick:", event.tick, fragment);
|
| 5035 |
return fragment < WHOLE_DURATION;
|
| 5036 |
});
|
| 5037 |
+
const beamStatus = measure.voices.map((voice) => voice.reduce(({ status, broken }, ei, evi) => {
|
| 5038 |
const event = eventMap[ei];
|
| 5039 |
if (event.beam) {
|
| 5040 |
+
// allow an open beam at beginning of a voice
|
| 5041 |
+
if (evi === 0 && [StemBeam.Continue, StemBeam.Close].includes(event.beam))
|
| 5042 |
+
status = 1;
|
| 5043 |
status += BEAM_STATUS[event.beam];
|
| 5044 |
broken = broken || !(status >= 0 && status <= 1);
|
| 5045 |
}
|
| 5046 |
+
else if (!event.rest)
|
| 5047 |
+
broken = broken || status !== 0;
|
| 5048 |
return { status, broken };
|
| 5049 |
}, { status: 0, broken: false }));
|
| 5050 |
+
const beamBroken = beamStatus.some(({ broken }) => broken); // allow an open beam at the end of a voice (status == 1)
|
| 5051 |
let spaceTime = 0;
|
| 5052 |
let surplusTime = 0;
|
| 5053 |
measure.voices.forEach((voice) => {
|
|
|
|
| 5896 |
flag.y < flagRange[1]);
|
| 5897 |
chord.division = nearbyFlags.reduce((d, flag) => Math.max(d, flag.division), chord.division);
|
| 5898 |
nearbyFlags.forEach((flag) => accs.add(flag.id));
|
| 5899 |
+
if (chord.division >= 3) {
|
| 5900 |
+
const beamToken = rect.tip && beams.find((t) => Math.abs(rect.tip.x - t.x) < 0.3 && Math.abs(rect.tip.y - t.y) < 0.7);
|
| 5901 |
+
if (beamToken)
|
| 5902 |
+
chord.beam = TOKEN_TO_STEMBEAM[beamToken.type];
|
| 5903 |
+
}
|
| 5904 |
}
|
| 5905 |
const nearbyDots = dots.filter((dot) => !accs.has(dot.id) &&
|
| 5906 |
dot.x > rect.x + rect.width - 0.2 &&
|
|
|
|
| 6223 |
};
|
| 6224 |
// find root noteheads on stem
|
| 6225 |
stems.forEach((stem) => {
|
| 6226 |
+
const attachedHeads = noteheads.filter((nh) => Math.abs(nh.x - stem.x) - NOTEHEAD_WIDTHS[nh.semantic] / 2 < 0.32 &&
|
| 6227 |
Math.abs(nh.x - stem.x) - NOTEHEAD_WIDTHS[nh.semantic] / 2 > -0.44 && // for grace noteheads, more close to their stem
|
| 6228 |
nh.y > stem.y1 - 0.5 &&
|
| 6229 |
nh.y < stem.y2 + 0.5 &&
|
|
|
|
| 6858 |
const barXs = Object.entries(barColumns)
|
| 6859 |
.filter(([x, intensity]) => (intensity > 3 * this.staves.length))
|
| 6860 |
.map(([x]) => Number(x));
|
| 6861 |
+
// Include bar positions from whitelisted semantic points
|
| 6862 |
+
if (this.sidWhiteList.length) {
|
| 6863 |
+
for (const bar of bars) {
|
| 6864 |
+
if (this.sidWhiteList.includes(bar.id) && !barXs.some((x) => Math.abs(x - bar.x) <= 2)) {
|
| 6865 |
+
barXs.push(bar.x);
|
| 6866 |
+
}
|
| 6867 |
+
}
|
| 6868 |
+
}
|
| 6869 |
barXs.sort((x1, x2) => x1 - x2);
|
| 6870 |
barXs.forEach((x, i) => {
|
| 6871 |
if (i <= 0 || x - barXs[i - 1] > 2)
|
|
|
|
| 12013 |
}
|
| 12014 |
}
|
| 12015 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12016 |
var EventElementType;
|
| 12017 |
(function (EventElementType) {
|
| 12018 |
EventElementType[EventElementType["PAD"] = 0] = "PAD";
|
|
|
|
| 12092 |
}
|
| 12093 |
EventClusterSet.className = 'EventClusterSet';
|
| 12094 |
|
| 12095 |
+
class PatchMeasure extends SimpleClass {
|
| 12096 |
+
constructor(data) {
|
| 12097 |
+
super();
|
| 12098 |
+
Object.assign(this, data);
|
| 12099 |
+
}
|
| 12100 |
+
get staffN() {
|
| 12101 |
+
return Math.floor(Math.log2(this.staffMask)) + 1;
|
| 12102 |
+
}
|
| 12103 |
+
get basics() {
|
| 12104 |
+
return Array(this.staffN).fill(this.basic);
|
| 12105 |
+
}
|
| 12106 |
+
get duration() {
|
| 12107 |
+
return Math.max(0, ...(this.voices || []).map((ids) => {
|
| 12108 |
+
const events = ids.map((id) => this.events.find((e) => e.id === id));
|
| 12109 |
+
return events.reduce((duration, event) => duration + event.duration, 0);
|
| 12110 |
+
}));
|
| 12111 |
+
}
|
| 12112 |
+
}
|
| 12113 |
+
PatchMeasure.className = 'PatchMeasure';
|
| 12114 |
+
|
| 12115 |
var SimplePolicy;
|
| 12116 |
(function (SimplePolicy) {
|
| 12117 |
const constructXMap = (measure) => {
|
|
|
|
| 12764 |
return !this.events?.length || !this.voices?.length;
|
| 12765 |
}
|
| 12766 |
get hasIllEvent() {
|
| 12767 |
+
const voicedEventIds = this.voices.flat(1);
|
| 12768 |
+
const eventMap = this.eventMap;
|
| 12769 |
+
return (this.regulated &&
|
| 12770 |
+
voicedEventIds.some((id) => {
|
| 12771 |
+
const event = eventMap[id];
|
| 12772 |
+
return !event.zeroHolder && !Number.isFinite(event.tick) && !event.fullMeasureRest;
|
| 12773 |
+
}));
|
| 12774 |
}
|
| 12775 |
get brief() {
|
| 12776 |
const timesig = `${this.timeSignature.numerator}/${this.timeSignature.denominator}`;
|
|
|
|
| 12924 |
event.division = se.division;
|
| 12925 |
if (Number.isFinite(se.dots))
|
| 12926 |
event.dots = se.dots;
|
| 12927 |
+
if (se.beam !== undefined)
|
| 12928 |
event.beam = se.beam;
|
| 12929 |
if (se.grace !== undefined)
|
| 12930 |
event.grace = se.grace ? GraceType.Grace : undefined;
|
|
|
|
| 13378 |
event.pitches.forEach((pitch) => (pitch.tied = true));
|
| 13379 |
});
|
| 13380 |
});
|
| 13381 |
+
// Move courtesy clefs to the next measure.
|
| 13382 |
+
// A courtesy clef that appears after all events on its staff announces the
|
| 13383 |
+
// clef change for the next measure rather than applying to the current one.
|
| 13384 |
+
for (let mi = 0; mi < this.measures.length - 1; mi++) {
|
| 13385 |
+
const measure = this.measures[mi];
|
| 13386 |
+
const nextMeasure = this.measures[mi + 1];
|
| 13387 |
+
if (!measure.contexts || !nextMeasure?.contexts)
|
| 13388 |
+
continue;
|
| 13389 |
+
for (let si = 0; si < measure.contexts.length; si++) {
|
| 13390 |
+
const ctxList = measure.contexts[si];
|
| 13391 |
+
if (!ctxList)
|
| 13392 |
+
continue;
|
| 13393 |
+
const staffEvents = measure.events?.filter((e) => e.staff === si) || [];
|
| 13394 |
+
const maxEventX = staffEvents.reduce((max, e) => Math.max(max, e.x || 0), -Infinity);
|
| 13395 |
+
if (!Number.isFinite(maxEventX))
|
| 13396 |
+
continue;
|
| 13397 |
+
const deferred = [];
|
| 13398 |
+
measure.contexts[si] = ctxList.filter((term) => {
|
| 13399 |
+
if (term.type === 0 /* ContextType.Clef */ && term.x > maxEventX) {
|
| 13400 |
+
deferred.push(term);
|
| 13401 |
+
return false;
|
| 13402 |
+
}
|
| 13403 |
+
return true;
|
| 13404 |
+
});
|
| 13405 |
+
if (deferred.length > 0 && nextMeasure.contexts[si]) {
|
| 13406 |
+
deferred.forEach((term) => (term.tick = 0));
|
| 13407 |
+
nextMeasure.contexts[si] = [...deferred, ...nextMeasure.contexts[si]];
|
| 13408 |
+
}
|
| 13409 |
+
}
|
| 13410 |
+
}
|
| 13411 |
// [measure, voice]
|
| 13412 |
const measures = this.measures.map((measure /*, mi*/) => {
|
| 13413 |
console.assert(measure.validRegulated, '[makeVoiceStaves] measure is invalid:', measure);
|
|
|
|
| 13511 |
}
|
| 13512 |
return voices;
|
| 13513 |
});
|
|
|
|
| 13514 |
// compute traits for voice-measures
|
| 13515 |
measures.forEach((voices) => voices.forEach((measure) => {
|
| 13516 |
const words = [];
|
|
|
|
| 14432 |
matrixH: cluster ,
|
| 14433 |
matrixV: cluster ,
|
| 14434 |
voices: patch ? patch.voices : null,
|
| 14435 |
+
patched: !!patch,
|
| 14436 |
});
|
| 14437 |
})));
|
| 14438 |
const staffLayout = this.staffLayout;
|
|
|
|
| 14818 |
return !!self.grace;
|
| 14819 |
case 'timeWarp':
|
| 14820 |
return self.timeWarp ? `${self.timeWarp.numerator}/${self.timeWarp.denominator}` : null;
|
| 14821 |
+
case 'multiplier':
|
| 14822 |
+
return self.multiplier ? `${self.multiplier.numerator}/${self.multiplier.denominator}` : null;
|
| 14823 |
case 'pitches':
|
| 14824 |
return self.pitches;
|
| 14825 |
}
|
|
|
|
| 14858 |
}
|
| 14859 |
}
|
| 14860 |
return true;
|
| 14861 |
+
case 'multiplier':
|
| 14862 |
+
self.multiplier = null;
|
| 14863 |
+
if (value && typeof value === 'string') {
|
| 14864 |
+
const captures = value.match(/^(\d+)\/(\d+)/);
|
| 14865 |
+
if (captures) {
|
| 14866 |
+
self.multiplier = {
|
| 14867 |
+
numerator: parseInt(captures[1]),
|
| 14868 |
+
denominator: parseInt(captures[2]),
|
| 14869 |
+
};
|
| 14870 |
+
}
|
| 14871 |
+
}
|
| 14872 |
+
return true;
|
| 14873 |
case 'id':
|
| 14874 |
case 'pitches':
|
| 14875 |
return true;
|
|
|
|
| 14887 |
'tied',
|
| 14888 |
'beam',
|
| 14889 |
'timeWarp',
|
| 14890 |
+
'multiplier',
|
| 14891 |
'tremolo',
|
| 14892 |
'tremoloLink',
|
| 14893 |
'glissando',
|
|
|
|
| 16259 |
});
|
| 16260 |
};
|
| 16261 |
|
| 16262 |
+
console.info(`%cstarry-omr%c v1.0.0 2026-04-23T11:21:15.791Z`, 'color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;', 'color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;');
|
| 16263 |
|
| 16264 |
exports.PyClients = PyClients;
|
| 16265 |
exports.abstractRegulationBeadStats = abstractRegulationBeadStats;
|
backend/omr/dist/regulator.js.map
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/omr/dist/worker.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
(function(){"use strict";var environment$2={exports:{}},requireFoolWebpack$1=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),requireFoolWebpack_1=requireFoolWebpack$1;function Promise$2(e,t){var r=this;if(!(this instanceof Promise$2))throw new SyntaxError("Constructor must be called with the new operator");if("function"!=typeof e)throw new SyntaxError("Function parameter handler(resolve, reject) missing");var n=[],s=[];this.resolved=!1,this.rejected=!1,this.pending=!0;var i=function(e,t){n.push(e),s.push(t)};this.then=function(e,t){return new Promise$2(function(r,n){var s=e?_then(e,r,n):r,o=t?_then(t,r,n):n;i(s,o)},r)};var o=function(e){return r.resolved=!0,r.rejected=!1,r.pending=!1,n.forEach(function(t){t(e)}),i=function(t,r){t(e)},o=a=function(){},r},a=function(e){return r.resolved=!1,r.rejected=!0,r.pending=!1,s.forEach(function(t){t(e)}),i=function(t,r){r(e)},o=a=function(){},r};this.cancel=function(){return t?t.cancel():a(new CancellationError),r},this.timeout=function(e){if(t)t.timeout(e);else{var n=setTimeout(function(){a(new TimeoutError("Promise timed out after "+e+" ms"))},e);r.always(function(){clearTimeout(n)})}return r},e(function(e){o(e)},function(e){a(e)})}function _then(e,t,r){return function(n){try{var s=e(n);s&&"function"==typeof s.then&&"function"==typeof s.catch?s.then(t,r):t(s)}catch(e){r(e)}}}function CancellationError(e){this.message=e||"promise cancelled",this.stack=(new Error).stack}function TimeoutError(e){this.message=e||"timeout exceeded",this.stack=(new Error).stack}!function(e){var t=requireFoolWebpack_1,r=function(e){return void 0!==e&&null!=e.versions&&null!=e.versions.node};e.exports.isNode=r,e.exports.platform="undefined"!=typeof process&&r(process)?"node":"browser";var n=function(e){try{return t(e)}catch(e){return null}}("worker_threads");e.exports.isMainThread="node"===e.exports.platform?(!n||n.isMainThread)&&!process.connected:"undefined"!=typeof Window,e.exports.cpus="browser"===e.exports.platform?self.navigator.hardwareConcurrency:t("os").cpus().length}(environment$2),Promise$2.prototype.catch=function(e){return this.then(null,e)},Promise$2.prototype.always=function(e){return this.then(e,e)},Promise$2.all=function(e){return new Promise$2(function(t,r){var n=e.length,s=[];n?e.forEach(function(e,i){e.then(function(e){s[i]=e,0==--n&&t(s)},function(e){n=0,r(e)})}):t(s)})},Promise$2.defer=function(){var e={};return e.promise=new Promise$2(function(t,r){e.resolve=t,e.reject=r}),e},CancellationError.prototype=new Error,CancellationError.prototype.constructor=Error,CancellationError.prototype.name="CancellationError",Promise$2.CancellationError=CancellationError,TimeoutError.prototype=new Error,TimeoutError.prototype.constructor=Error,TimeoutError.prototype.name="TimeoutError",Promise$2.TimeoutError=TimeoutError;var _Promise=Promise$2,WorkerHandler$1={exports:{}},embeddedWorker='!function(){var __webpack_modules__={577:function(e){e.exports=function(e,r){this.message=e,this.transfer=r}}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];return void 0!==r||(r=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e](r,r.exports,__webpack_require__)),r.exports}var __webpack_exports__={};!function(){var exports=__webpack_exports__,__webpack_unused_export__;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Transfer=__webpack_require__(577),requireFoolWebpack=eval("typeof require !== \'undefined\' ? require : function (module) { throw new Error(\'Module \\" + module + \\" not found.\') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}},WorkerThreads,parentPort;if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,r){addEventListener(e,function(e){r(e.data)})},worker.send=function(e){postMessage(e)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(error){if("object"!==_typeof(error)||null===error||"MODULE_NOT_FOUND"!==error.code)throw error}WorkerThreads&&null!==WorkerThreads.parentPort?(parentPort=WorkerThreads.parentPort,worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort)):(worker.on=process.on.bind(process),worker.send=function(e){process.send(e)},worker.on("disconnect",function(){process.exit(1)})),worker.exit=process.exit.bind(process)}function convertError(o){return Object.getOwnPropertyNames(o).reduce(function(e,r){return Object.defineProperty(e,r,{value:o[r],enumerable:!0})},{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,r){e=new Function("return ("+e+").apply(null, arguments);");return e.apply(e,r)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){function r(){worker.exit(e)}if(!worker.terminationHandler)return r();var o=worker.terminationHandler(e);isPromise(o)?o.then(r,r):r()};var currentRequestId=null;worker.on("message",function(r){if(r===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var e=worker.methods[r.method];if(!e)throw new Error(\'Unknown method "\'+r.method+\'"\');currentRequestId=r.id;var o=e.apply(e,r.params);isPromise(o)?o.then(function(e){e instanceof Transfer?worker.send({id:r.id,result:e.message,error:null},e.transfer):worker.send({id:r.id,result:e,error:null}),currentRequestId=null}).catch(function(e){worker.send({id:r.id,result:null,error:convertError(e)}),currentRequestId=null}):(o instanceof Transfer?worker.send({id:r.id,result:o.message,error:null},o.transfer):worker.send({id:r.id,result:o,error:null}),currentRequestId=null)}catch(e){worker.send({id:r.id,result:null,error:convertError(e)})}}),worker.register=function(e,r){if(e)for(var o in e)e.hasOwnProperty(o)&&(worker.methods[o]=e[o]);r&&(worker.terminationHandler=r.onTerminate),worker.send("ready")},worker.emit=function(e){currentRequestId&&(e instanceof Transfer?worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer):worker.send({id:currentRequestId,isEvent:!0,payload:e}))},__webpack_unused_export__=worker.register,worker.emit}()}();',Promise$1=_Promise,environment$1=environment$2.exports,requireFoolWebpack=requireFoolWebpack_1,TERMINATE_METHOD_ID="__workerpool-terminate__";function ensureWorkerThreads(){var e=tryRequireWorkerThreads();if(!e)throw new Error("WorkerPool: workerType = 'thread' is not supported, Node >= 11.7.0 required");return e}function ensureWebWorker(){if("function"!=typeof Worker&&("object"!=typeof Worker||"function"!=typeof Worker.prototype.constructor))throw new Error("WorkerPool: Web Workers not supported")}function tryRequireWorkerThreads(){try{return requireFoolWebpack("worker_threads")}catch(e){if("object"==typeof e&&null!==e&&"MODULE_NOT_FOUND"===e.code)return null;throw e}}function getDefaultWorker(){if("browser"===environment$1.platform){if("undefined"==typeof Blob)throw new Error("Blob not supported by the browser");if(!window.URL||"function"!=typeof window.URL.createObjectURL)throw new Error("URL.createObjectURL not supported by the browser");var e=new Blob([embeddedWorker],{type:"text/javascript"});return window.URL.createObjectURL(e)}return __dirname+"/worker.js"}function setupWorker(e,t){if("web"===t.workerType)return ensureWebWorker(),setupBrowserWorker(e,t.workerOpts,Worker);if("thread"===t.workerType)return setupWorkerThreadWorker(e,r=ensureWorkerThreads(),t.workerThreadOpts);if("process"!==t.workerType&&t.workerType){if("browser"===environment$1.platform)return ensureWebWorker(),setupBrowserWorker(e,t.workerOpts,Worker);var r=tryRequireWorkerThreads();return r?setupWorkerThreadWorker(e,r,t.workerThreadOpts):setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack("child_process"))}return setupProcessWorker(e,resolveForkOptions(t),requireFoolWebpack("child_process"))}function setupBrowserWorker(e,t,r){var n=new r(e,t);return n.isBrowserWorker=!0,n.on=function(e,t){this.addEventListener(e,function(e){t(e.data)})},n.send=function(e,t){this.postMessage(e,t)},n}function setupWorkerThreadWorker(e,t,r){var n=new t.Worker(e,{stdout:!1,stderr:!1,...r});return n.isWorkerThread=!0,n.send=function(e,t){this.postMessage(e,t)},n.kill=function(){return this.terminate(),!0},n.disconnect=function(){this.terminate()},n}function setupProcessWorker(e,t,r){var n=r.fork(e,t.forkArgs,t.forkOpts),s=n.send;return n.send=function(e){return s.call(n,e)},n.isChildProcess=!0,n}function resolveForkOptions(e){e=e||{};var t=process.execArgv.join(" "),r=-1!==t.indexOf("--inspect"),n=-1!==t.indexOf("--debug-brk"),s=[];return r&&(s.push("--inspect="+e.debugPort),n&&s.push("--debug-brk")),process.execArgv.forEach(function(e){e.indexOf("--max-old-space-size")>-1&&s.push(e)}),Object.assign({},e,{forkArgs:e.forkArgs,forkOpts:Object.assign({},e.forkOpts,{execArgv:(e.forkOpts&&e.forkOpts.execArgv||[]).concat(s)})})}function objectToError(e){for(var t=new Error(""),r=Object.keys(e),n=0;n<r.length;n++)t[r[n]]=e[r[n]];return t}function WorkerHandler(e,t){var r=this,n=t||{};function s(e){for(var t in r.terminated=!0,r.processing)void 0!==r.processing[t]&&r.processing[t].resolver.reject(e);r.processing=Object.create(null)}this.script=e||getDefaultWorker(),this.worker=setupWorker(this.script,n),this.debugPort=n.debugPort,this.forkOpts=n.forkOpts,this.forkArgs=n.forkArgs,this.workerOpts=n.workerOpts,this.workerThreadOpts=n.workerThreadOpts,this.workerTerminateTimeout=n.workerTerminateTimeout,e||(this.worker.ready=!0),this.requestQueue=[],this.worker.on("message",function(e){if(!r.terminated)if("string"==typeof e&&"ready"===e)r.worker.ready=!0,function(){for(const e of r.requestQueue.splice(0))r.worker.send(e.message,e.transfer)}();else{var t=e.id,n=r.processing[t];void 0!==n&&(e.isEvent?n.options&&"function"==typeof n.options.on&&n.options.on(e.payload):(delete r.processing[t],!0===r.terminating&&r.terminate(),e.error?n.resolver.reject(objectToError(e.error)):n.resolver.resolve(e.result)))}});var i=this.worker;this.worker.on("error",s),this.worker.on("exit",function(e,t){var n="Workerpool Worker terminated Unexpectedly\n";n+=" exitCode: `"+e+"`\n",n+=" signalCode: `"+t+"`\n",n+=" workerpool.script: `"+r.script+"`\n",n+=" spawnArgs: `"+i.spawnargs+"`\n",n+=" spawnfile: `"+i.spawnfile+"`\n",n+=" stdout: `"+i.stdout+"`\n",n+=" stderr: `"+i.stderr+"`\n",s(new Error(n))}),this.processing=Object.create(null),this.terminating=!1,this.terminated=!1,this.cleaning=!1,this.terminationHandler=null,this.lastId=0}WorkerHandler.prototype.methods=function(){return this.exec("methods")},WorkerHandler.prototype.exec=function(e,t,r,n){r||(r=Promise$1.defer());var s=++this.lastId;this.processing[s]={id:s,resolver:r,options:n};var i={message:{id:s,method:e,params:t},transfer:n&&n.transfer};this.terminated?r.reject(new Error("Worker is terminated")):this.worker.ready?this.worker.send(i.message,i.transfer):this.requestQueue.push(i);var o=this;return r.promise.catch(function(e){if(e instanceof Promise$1.CancellationError||e instanceof Promise$1.TimeoutError)return delete o.processing[s],o.terminateAndNotify(!0).then(function(){throw e},function(e){throw e});throw e})},WorkerHandler.prototype.busy=function(){return this.cleaning||Object.keys(this.processing).length>0},WorkerHandler.prototype.terminate=function(e,t){var r=this;if(e){for(var n in this.processing)void 0!==this.processing[n]&&this.processing[n].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}if("function"==typeof t&&(this.terminationHandler=t),this.busy())this.terminating=!0;else{var s=function(e){if(r.terminated=!0,r.cleaning=!1,null!=r.worker&&r.worker.removeAllListeners&&r.worker.removeAllListeners("message"),r.worker=null,r.terminating=!1,r.terminationHandler)r.terminationHandler(e,r);else if(e)throw e};if(this.worker){if("function"==typeof this.worker.kill){if(this.worker.killed)return void s(new Error("worker already killed!"));var i=setTimeout(function(){r.worker&&r.worker.kill()},this.workerTerminateTimeout);return this.worker.once("exit",function(){clearTimeout(i),r.worker&&(r.worker.killed=!0),s()}),this.worker.ready?this.worker.send(TERMINATE_METHOD_ID):this.requestQueue.push({message:TERMINATE_METHOD_ID}),void(this.cleaning=!0)}if("function"!=typeof this.worker.terminate)throw new Error("Failed to terminate worker");this.worker.terminate(),this.worker.killed=!0}s()}},WorkerHandler.prototype.terminateAndNotify=function(e,t){var r=Promise$1.defer();return t&&r.promise.timeout(t),this.terminate(e,function(e,t){e?r.reject(e):r.resolve(t)}),r.promise},WorkerHandler$1.exports=WorkerHandler,WorkerHandler$1.exports._tryRequireWorkerThreads=tryRequireWorkerThreads,WorkerHandler$1.exports._setupProcessWorker=setupProcessWorker,WorkerHandler$1.exports._setupBrowserWorker=setupBrowserWorker,WorkerHandler$1.exports._setupWorkerThreadWorker=setupWorkerThreadWorker,WorkerHandler$1.exports.ensureWorkerThreads=ensureWorkerThreads;var worker$1={};function Transfer(e,t){this.message=e,this.transfer=t}var transfer=Transfer;(function(exports){var Transfer=transfer,requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \" + module + \" not found.') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}};if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(e,t){addEventListener(e,function(e){t(e.data)})},worker.send=function(e){postMessage(e)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");var WorkerThreads;try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(e){if("object"!=typeof e||null===e||"MODULE_NOT_FOUND"!==e.code)throw e}if(WorkerThreads&&null!==WorkerThreads.parentPort){var parentPort=WorkerThreads.parentPort;worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort),worker.exit=process.exit.bind(process)}else worker.on=process.on.bind(process),worker.send=function(e){process.send(e)},worker.on("disconnect",function(){process.exit(1)}),worker.exit=process.exit.bind(process)}function convertError(e){return Object.getOwnPropertyNames(e).reduce(function(t,r){return Object.defineProperty(t,r,{value:e[r],enumerable:!0})},{})}function isPromise(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}worker.methods={},worker.methods.run=function(e,t){var r=new Function("return ("+e+").apply(null, arguments);");return r.apply(r,t)},worker.methods.methods=function(){return Object.keys(worker.methods)},worker.terminationHandler=void 0,worker.cleanupAndExit=function(e){var t=function(){worker.exit(e)};if(!worker.terminationHandler)return t();var r=worker.terminationHandler(e);isPromise(r)?r.then(t,t):t()};var currentRequestId=null;worker.on("message",function(e){if(e===TERMINATE_METHOD_ID)return worker.cleanupAndExit(0);try{var t=worker.methods[e.method];if(!t)throw new Error('Unknown method "'+e.method+'"');currentRequestId=e.id;var r=t.apply(t,e.params);isPromise(r)?r.then(function(t){t instanceof Transfer?worker.send({id:e.id,result:t.message,error:null},t.transfer):worker.send({id:e.id,result:t,error:null}),currentRequestId=null}).catch(function(t){worker.send({id:e.id,result:null,error:convertError(t)}),currentRequestId=null}):(r instanceof Transfer?worker.send({id:e.id,result:r.message,error:null},r.transfer):worker.send({id:e.id,result:r,error:null}),currentRequestId=null)}catch(t){worker.send({id:e.id,result:null,error:convertError(t)})}}),worker.register=function(e,t){if(e)for(var r in e)e.hasOwnProperty(r)&&(worker.methods[r]=e[r]);t&&(worker.terminationHandler=t.onTerminate),worker.send("ready")},worker.emit=function(e){if(currentRequestId){if(e instanceof Transfer)return void worker.send({id:currentRequestId,isEvent:!0,payload:e.message},e.transfer);worker.send({id:currentRequestId,isEvent:!0,payload:e})}},exports.add=worker.register,exports.emit=worker.emit})(worker$1);var environment=environment$2.exports,worker=function(e,t){var r=worker$1;r.add(e,t)};environment.platform,environment.isMainThread,environment.cpus;var Sylvester={Matrix:function(){}};Sylvester.Matrix.create=function(e){return(new Sylvester.Matrix).setElements(e)},Sylvester.Matrix.I=function(e){for(var t,r=[],n=e;n--;)for(t=e,r[n]=[];t--;)r[n][t]=n===t?1:0;return Sylvester.Matrix.create(r)},Sylvester.Matrix.prototype={dup:function(){return Sylvester.Matrix.create(this.elements)},isSquare:function(){var e=0===this.elements.length?0:this.elements[0].length;return this.elements.length===e},toRightTriangular:function(){if(0===this.elements.length)return Sylvester.Matrix.create([]);var e,t,r,n,s=this.dup(),i=this.elements.length,o=this.elements[0].length;for(t=0;t<i;t++){if(0===s.elements[t][t])for(r=t+1;r<i;r++)if(0!==s.elements[r][t]){for(e=[],n=0;n<o;n++)e.push(s.elements[t][n]+s.elements[r][n]);s.elements[t]=e;break}if(0!==s.elements[t][t])for(r=t+1;r<i;r++){var a=s.elements[r][t]/s.elements[t][t];for(e=[],n=0;n<o;n++)e.push(n<=t?0:s.elements[r][n]-s.elements[t][n]*a);s.elements[r]=e}}return s},determinant:function(){if(0===this.elements.length)return 1;if(!this.isSquare())return null;for(var e=this.toRightTriangular(),t=e.elements[0][0],r=e.elements.length,n=1;n<r;n++)t*=e.elements[n][n];return t},isSingular:function(){return this.isSquare()&&0===this.determinant()},augment:function(e){if(0===this.elements.length)return this.dup();var t=e.elements||e;void 0===t[0][0]&&(t=Sylvester.Matrix.create(t).elements);var r,n=this.dup(),s=n.elements[0].length,i=n.elements.length,o=t[0].length;if(i!==t.length)return null;for(;i--;)for(r=o;r--;)n.elements[i][s+r]=t[i][r];return n},inverse:function(){if(0===this.elements.length)return null;if(!this.isSquare()||this.isSingular())return null;for(var e,t,r,n,s,i=this.elements.length,o=i,a=this.augment(Sylvester.Matrix.I(i)).toRightTriangular(),c=a.elements[0].length,l=[];o--;){for(r=[],l[o]=[],n=a.elements[o][o],t=0;t<c;t++)s=a.elements[o][t]/n,r.push(s),t>=i&&l[o].push(s);for(a.elements[o]=r,e=o;e--;){for(r=[],t=0;t<c;t++)r.push(a.elements[e][t]-a.elements[o][t]*a.elements[e][o]);a.elements[e]=r}}return Sylvester.Matrix.create(l)},setElements:function(e){var t,r,n=e.elements||e;if(n[0]&&void 0!==n[0][0]){for(t=n.length,this.elements=[];t--;)for(r=n[t].length,this.elements[t]=[];r--;)this.elements[t][r]=n[t][r];return this}var s=n.length;for(this.elements=[],t=0;t<s;t++)this.elements.push([n[t]]);return this}};var matrixInverse=function(e){const t=Sylvester.Matrix.create(e).inverse();return null!==t?t.elements:null},sha1={exports:{}},SemanticType;
|
| 2 |
/*
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
(function(module){(function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&module.exports,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(e){return function(t){return new Sha1(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Sha1},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var r=OUTPUT_TYPES[t];e[r]=createOutputMethod(r)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("sha1").update(e,"utf8").digest("hex");if(e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(void 0===e.length)return method(e);return crypto.createHash("sha1").update(new Buffer(e)).digest("hex")};return nodeMethod};function Sha1(e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Sha1.prototype.update=function(e){if(!this.finalized){var t="string"!=typeof e;t&&e.constructor===root.ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,s=0,i=e.length||0,o=this.blocks;s<i;){if(this.hashed&&(this.hashed=!1,o[0]=this.block,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),t)for(n=this.start;s<i&&n<64;++s)o[n>>2]|=e[s]<<SHIFT[3&n++];else for(n=this.start;s<i&&n<64;++s)(r=e.charCodeAt(s))<128?o[n>>2]|=r<<SHIFT[3&n++]:r<2048?(o[n>>2]|=(192|r>>6)<<SHIFT[3&n++],o[n>>2]|=(128|63&r)<<SHIFT[3&n++]):r<55296||r>=57344?(o[n>>2]|=(224|r>>12)<<SHIFT[3&n++],o[n>>2]|=(128|r>>6&63)<<SHIFT[3&n++],o[n>>2]|=(128|63&r)<<SHIFT[3&n++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++s)),o[n>>2]|=(240|r>>18)<<SHIFT[3&n++],o[n>>2]|=(128|r>>12&63)<<SHIFT[3&n++],o[n>>2]|=(128|r>>6&63)<<SHIFT[3&n++],o[n>>2]|=(128|63&r)<<SHIFT[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.block=o[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e,t,r=this.h0,n=this.h1,s=this.h2,i=this.h3,o=this.h4,a=this.blocks;for(e=16;e<80;++e)t=a[e-3]^a[e-8]^a[e-14]^a[e-16],a[e]=t<<1|t>>>31;for(e=0;e<20;e+=5)r=(t=(n=(t=(s=(t=(i=(t=(o=(t=r<<5|r>>>27)+(n&s|~n&i)+o+1518500249+a[e]|0)<<5|o>>>27)+(r&(n=n<<30|n>>>2)|~r&s)+i+1518500249+a[e+1]|0)<<5|i>>>27)+(o&(r=r<<30|r>>>2)|~o&n)+s+1518500249+a[e+2]|0)<<5|s>>>27)+(i&(o=o<<30|o>>>2)|~i&r)+n+1518500249+a[e+3]|0)<<5|n>>>27)+(s&(i=i<<30|i>>>2)|~s&o)+r+1518500249+a[e+4]|0,s=s<<30|s>>>2;for(;e<40;e+=5)r=(t=(n=(t=(s=(t=(i=(t=(o=(t=r<<5|r>>>27)+(n^s^i)+o+1859775393+a[e]|0)<<5|o>>>27)+(r^(n=n<<30|n>>>2)^s)+i+1859775393+a[e+1]|0)<<5|i>>>27)+(o^(r=r<<30|r>>>2)^n)+s+1859775393+a[e+2]|0)<<5|s>>>27)+(i^(o=o<<30|o>>>2)^r)+n+1859775393+a[e+3]|0)<<5|n>>>27)+(s^(i=i<<30|i>>>2)^o)+r+1859775393+a[e+4]|0,s=s<<30|s>>>2;for(;e<60;e+=5)r=(t=(n=(t=(s=(t=(i=(t=(o=(t=r<<5|r>>>27)+(n&s|n&i|s&i)+o-1894007588+a[e]|0)<<5|o>>>27)+(r&(n=n<<30|n>>>2)|r&s|n&s)+i-1894007588+a[e+1]|0)<<5|i>>>27)+(o&(r=r<<30|r>>>2)|o&n|r&n)+s-1894007588+a[e+2]|0)<<5|s>>>27)+(i&(o=o<<30|o>>>2)|i&r|o&r)+n-1894007588+a[e+3]|0)<<5|n>>>27)+(s&(i=i<<30|i>>>2)|s&o|i&o)+r-1894007588+a[e+4]|0,s=s<<30|s>>>2;for(;e<80;e+=5)r=(t=(n=(t=(s=(t=(i=(t=(o=(t=r<<5|r>>>27)+(n^s^i)+o-899497514+a[e]|0)<<5|o>>>27)+(r^(n=n<<30|n>>>2)^s)+i-899497514+a[e+1]|0)<<5|i>>>27)+(o^(r=r<<30|r>>>2)^n)+s-899497514+a[e+2]|0)<<5|s>>>27)+(i^(o=o<<30|o>>>2)^r)+n-899497514+a[e+3]|0)<<5|n>>>27)+(s^(i=i<<30|i>>>2)^o)+r-899497514+a[e+4]|0,s=s<<30|s>>>2;this.h0=this.h0+r|0,this.h1=this.h1+n|0,this.h2=this.h2+s|0,this.h3=this.h3+i|0,this.h4=this.h4+o|0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,s=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,s=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,s>>24&255,s>>16&255,s>>8&255,255&s]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:root.sha1=exports})()})(sha1),function(e){e.ClefG="ClefG",e.ClefF="ClefF",e.ClefC="ClefC",e.NoteheadS0="NoteheadS0",e.NoteheadS1="NoteheadS1",e.NoteheadS2="NoteheadS2",e.NoteheadS1stemU="NoteheadS1stemU",e.NoteheadS1stemD="NoteheadS1stemD",e.NoteheadS2stemU="NoteheadS2stemU",e.NoteheadS2stemD="NoteheadS2stemD",e.vline_Stem="vline_Stem",e.Flag3="Flag3",e.BeamLeft="BeamLeft",e.BeamContinue="BeamContinue",e.BeamRight="BeamRight",e.TremoloLeft="TremoloLeft",e.TremoloRight="TremoloRight",e.TremoloMiddle="TremoloMiddle",e.Dot="Dot",e.Rest0="Rest0",e.Rest1="Rest1",e.Rest2="Rest2",e.Rest3="Rest3",e.Rest4="Rest4",e.Rest5="Rest5",e.Rest6="Rest6",e.Rest0W="Rest0W",e.RestM1="RestM1",e.AccNatural="AccNatural",e.AccSharp="AccSharp",e.AccDoublesharp="AccDoublesharp",e.AccFlat="AccFlat",e.AccFlatflat="AccFlatflat",e.vline_VoltaLeft="vline_VoltaLeft",e.vline_VoltaRight="vline_VoltaRight",e.VoltaLeft="VoltaLeft",e.VoltaRight="VoltaRight",e.VoltaAlternativeBegin="VoltaAlternativeBegin",e.BarMeasure="BarMeasure",e.vline_BarMeasure="vline_BarMeasure",e.vline_BarTerminal="vline_BarTerminal",e.vline_BarSegment="vline_BarSegment",e.SlurBegin="SlurBegin",e.SlurEnd="SlurEnd",e.TimesigC44="TimesigC44",e.TimesigC22="TimesigC22",e.TimesigZero="TimesigZero",e.TimesigOne="TimesigOne",e.TimesigTwo="TimesigTwo",e.TimesigThree="TimesigThree",e.TimesigFour="TimesigFour",e.TimesigFive="TimesigFive",e.TimesigSix="TimesigSix",e.TimesigSeven="TimesigSeven",e.TimesigEight="TimesigEight",e.TimesigNine="TimesigNine",e.OctaveShift8va="OctaveShift8va",e.OctaveShift8vb="OctaveShift8vb",e.OctaveShift8="OctaveShift8",e.OctaveShift0="OctaveShift0",e.Zero="Zero",e.One="One",e.Two="Two",e.Three="Three",e.Four="Four",e.Five="Five",e.Six="Six",e.Seven="Seven",e.Eight="Eight",e.Nine="Nine",e.f="f",e.p="p",e.m="m",e.n="n",e.r="r",e.s="s",e.z="z",e.CrescendoBegin="CrescendoBegin",e.CrescendoEnd="CrescendoEnd",e.DecrescendoBegin="DecrescendoBegin",e.DecrescendoEnd="DecrescendoEnd",e.ScriptFermata="ScriptFermata",e.ScriptShortFermata="ScriptShortFermata",e.ScriptSforzato="ScriptSforzato",e.ScriptStaccato="ScriptStaccato",e.ScriptStaccatissimo="ScriptStaccatissimo",e.ScriptTurn="ScriptTurn",e.ScriptTrill="ScriptTrill",e.ScriptSegno="ScriptSegno",e.ScriptCoda="ScriptCoda",e.ScriptArpeggio="ScriptArpeggio",e.ScriptPrall="ScriptPrall",e.ScriptMordent="ScriptMordent",e.ScriptMarcato="ScriptMarcato",e.ScriptTenuto="ScriptTenuto",e.ScriptPortato="ScriptPortato",e.PedalStar="PedalStar",e.PedalPed="PedalPed",e.KeyAcc="KeyAcc",e.TempoNotehead="TempoNotehead",e.GraceNotehead="GraceNotehead",e.SignLined="SignLined",e.SignInterval="SignInterval",e.rect_Text="rect_Text",e.rect_Lyric="rect_Lyric"}(SemanticType||(SemanticType={})),SemanticType.BarMeasure,SemanticType.vline_BarMeasure,SemanticType.vline_BarTerminal,SemanticType.vline_BarSegment,SemanticType.vline_VoltaLeft,SemanticType.vline_VoltaRight,SemanticType.VoltaAlternativeBegin;const st=SemanticType;st.NoteheadS0,st.NoteheadS1,st.NoteheadS2,st.Zero,st.One,st.Two,st.Three,st.Four,st.Five,st.Six,st.Seven,st.Eight,st.Nine,st.ScriptStaccatissimo,st.TimesigZero,st.TimesigOne,st.TimesigTwo,st.TimesigThree,st.TimesigFour,st.TimesigFive,st.TimesigSix,st.TimesigSeven,st.TimesigEight,st.TimesigNine,st.Rest0,st.Rest1,st.Rest2,st.Rest3,st.Rest4,st.Rest5,st.Rest6,st.Rest0W,st.RestM1,st.SignInterval,st.SignLined,st.BeamLeft,st.BeamContinue,st.BeamRight,st.ClefG,st.ClefF,st.ClefC,st.NoteheadS0,st.NoteheadS1,st.NoteheadS2,st.Dot,st.Rest0,st.Rest1,st.Rest2,st.Rest3,st.Rest4,st.Rest5,st.Rest6,st.RestM1,st.AccNatural,st.AccSharp,st.AccDoublesharp,st.AccFlat,st.AccFlatflat,st.TimesigC44,st.TimesigC22,st.TimesigZero,st.TimesigOne,st.TimesigTwo,st.TimesigThree,st.TimesigFour,st.TimesigFive,st.TimesigSix,st.TimesigSeven,st.TimesigEight,st.TimesigNine,st.One,st.Two,st.Three,st.Four,st.Five,st.OctaveShift8,st.OctaveShift0,st.f,st.p,st.m,st.n,st.r,st.s,st.z,st.ScriptFermata,st.ScriptShortFermata,st.ScriptSforzato,st.ScriptStaccato,st.ScriptStaccatissimo,st.ScriptTurn,st.ScriptTrill,st.ScriptSegno,st.ScriptCoda,st.ScriptArpeggio,st.ScriptPrall,st.ScriptMordent,st.ScriptMarcato,st.ScriptTenuto,st.ScriptPortato,st.PedalStar,st.PedalPed;const roundNumber=(e,t,r=-1/0)=>Math.max(Math.round(e/t)*t,r),gcd=(e,t)=>Number.isInteger(e)&&Number.isInteger(t)?0===t?e:gcd(t,e%t):(console.error("non-integer gcd:",e,t),1),frac=(e,t)=>({numerator:e,denominator:t}),reducedFraction=(e,t)=>{e=Math.round(e),t=Math.round(t);const r=0!==e?gcd(e,t):t;return frac(e/r,t/r)},fractionMul=(e,t)=>t?e*t.numerator/t.denominator:e;class DummyLogger{debug(...e){}group(...e){}groupCollapsed(...e){}groupEnd(){}info(...e){}warn(...e){}assert(...e){}}const EOM=-1,GREAT_NUMBER=1920,DURATION_MULTIPLIER=1921920,floatToFrac=e=>{const t=Math.round(e*GREAT_NUMBER);return reducedFraction(t,GREAT_NUMBER)},floatToTimeWarp=e=>1===e?null:floatToFrac(e);var ActionType;!function(e){e[e.PLACE=0]="PLACE",e[e.VERTICAL=1]="VERTICAL",e[e.HORIZONTAL=2]="HORIZONTAL"}(ActionType||(ActionType={}));class Action{constructor(e){Object.assign(this,e)}static P(e){return new Action({type:ActionType.PLACE,e1:e})}static V(e,t,r=1){return new Action({type:ActionType.VERTICAL,e1:r>0?e:t,e2:r>0?t:e})}static H(e,t){return new Action({type:ActionType.HORIZONTAL,e1:e,e2:t})}get id(){switch(this.type){case ActionType.PLACE:return this.e1.toString();case ActionType.VERTICAL:return`${this.e1}|${this.e2}`;case ActionType.HORIZONTAL:return`${this.e1}-${this.e2>=0?this.e2:"."}`}}get events(){return[this.e1,this.e2].filter(Number.isFinite)}}class StageMatrix{static fromNode(e,t){const r=Array(e.stages.length).fill(null).map(()=>Array(e.stages.length).fill(null).map(()=>new Set));e.actions.filter(e=>e.type===ActionType.HORIZONTAL).forEach(t=>{const n=e.stages.findIndex(e=>e.events.includes(t.e1)),s=e.stages.findIndex(e=>e.events.includes(t.e2));console.assert(n>=0&&s>=0,"invalid stages for H action:",e.id,e.stages,t),r[n][s].add(t.e1)}),r[0][e.stages.length-1].add(0);const n=e.stagedEvents,s=t.matrixH[t.matrixH.length-1].filter((e,t)=>!n.has(t)),i=Math.max(0,Math.max(...s)-.01),o=e.actions.filter(e=>e.type===ActionType.HORIZONTAL),a=Object.keys(t.eventMap).map(Number).filter(e=>!o.find(t=>t.e2===e));return e.stages.forEach(n=>{n.events.forEach(s=>{if(s>0){!o.find(e=>e.e1===s)&&t.matrixH[t.matrixH.length-1][s]>=i&&(a.some(e=>t.matrixH[e][s]>0)||r[n.index][e.stages.length-1].add(s))}})}),new StageMatrix({matrix:r})}constructor(e){Object.assign(this,e)}pathOf(e,t,r,n=0){if(this.matrix[e][t].size){const s=[...this.matrix[e][t]][n];if(t===r)return[s];for(let e=t+1;e<=r;++e){const n=this.pathOf(t,e,r);if(n)return[s,...n]}}return null}findDoublePath(e,t){const r=[];for(let n=t;n>=e+1;--n)for(let s=0;s<this.matrix[e][n].size;++s){const i=this.pathOf(e,n,t,s);if(i&&(r.push(i),2===r.length))return[r[0],r[1]]}return null}reducePath(e){this.matrix.forEach(t=>t.forEach(t=>e.forEach(e=>t.delete(e))))}toEquations(e){const t=[];for(let r=1;r<this.matrix.length;r++)for(let n=0;n<this.matrix.length-r;n++){const s=n+r;for(;;){const r=this.findDoublePath(n,s);if(!r)break;{const[n,s]=r,i=Array(e).fill(0);n.forEach(e=>i[e]=1),s.forEach(e=>i[e]=-1),t.push(i),this.reducePath(n.length>s.length?n:s)}}}return t}}class PathNode{constructor(e){Object.assign(this,e),console.assert(this.logger,"logger is null:",e)}get actions(){const e=this.parent?this.parent.actions:[];return this.action?[...e,this.action]:e}get id(){return this.actions.map(e=>e.id).sort().join(" ")}get stagedEvents(){const e=new Set;return this.stages&&this.stages.forEach(t=>t.events.forEach(t=>t>=0&&e.add(t))),e}like(e){return e.split(" ").sort().join(" ")===this.id}constructStages(e){this.stages=[{events:[EOM]}];for(const t of this.actions)switch(t.type){case ActionType.PLACE:this.stages.unshift({events:[t.e1]});break;case ActionType.VERTICAL:{const e=this.stages.find(e=>e.events.includes(t.e1)),r=this.stages.find(e=>e.events.includes(t.e2));console.assert(e||r,"invalid V action:",this.stages,t),e&&r?(e.events.push(...r.events),r.events=null,this.stages=this.stages.filter(e=>e.events)):e?r||e.events.push(t.e2):r.events.unshift(t.e1)}break;case ActionType.HORIZONTAL:{const r=this.stages.find(e=>e.events.includes(t.e1)),n=this.stages.find(e=>e.events.includes(t.e2));console.assert(r||n,"invalid H action:",this.stages,t);const s=r=>{console.assert(e.eventMap[r],"invalid event id:",t.id,r,e.eventMap);const n=e.eventMap[r].x,s=this.stages.find(t=>t.events.some(t=>t>0&&e.eventMap[t].x<=n)&&t.events.some(t=>t>0&&e.eventMap[t].x>=n));if(s)s.events.push(r);else{const t={events:[r]},s=this.stages.findIndex(t=>t.events[0]===EOM||e.eventMap[t.events[0]].x>=n);this.stages.splice(s,0,t)}};r||s(t.e1),n||s(t.e2)}}this.stages.forEach((e,t)=>e.index=t)}constructConstraints(e){const t=Object.keys(e.eventMap).length,r=StageMatrix.fromNode(this,e).toEquations(t),n=Array(t).fill(null).map((t,r)=>e.eventMap[r].duration);this.constraints=r.map(e=>e.map((e,t)=>e*n[t]))}inbalancesConstraints(e){console.assert(this.constraints,"constraints not constructed.");const t=Object.keys(e.eventMap).length,r=Array(t).fill(!0),n=Array(t).fill(!1),s=[];for(const e of this.constraints){const t=e.reduce((e,t)=>e+t,0);if(0!==t){const i=t<0?e.map(e=>-e):e;if(i[0]>0)continue;s.push(i),i.forEach((e,t)=>{n[t]=n[t]||e<0,e&&(r[t]=e<0||n[t])})}}return this.constraints.forEach(e=>{0!==e.reduce((e,t)=>e+t,0)||e[0]||e.some((e,t)=>e&&!r[t])&&(e.forEach((e,t)=>e&&(r[t]=!1)),s.push(e))}),{ones:r,inbalances:s}}solveEquations({ones:e,inbalances:t}){if(!t.length)return e.map(()=>1);const r=e.map((e,t)=>({fixed:e,i:t})).filter(({fixed:e})=>!e).map(({i:e})=>e).filter(e=>t.some(t=>0!==t[e]));if(!r.length)return e.map(()=>1);const n=r.map(e=>Math.abs(t.find(t=>0!==t[e])[e])),s=new Map;let i=!1;const o=t.map(e=>({line:e.filter((e,t)=>r.includes(t)),bias:-e.reduce((e,t,n)=>e+(r.includes(n)?0:t),0)})).filter(({line:e,bias:t})=>{if(e.every(e=>0===e))return!1;const r=e.join(",");return s.has(r)?(i=s.get(r)!==t,!1):(s.set(r,t),!0)});if(i)return null;const a=o.slice(0,r.length),c=o.slice(r.length);if(a.length<r.length){const e=[];for(let t=0;t<r.length-1;++t){const s=t+1,i={line:r.map((e,r)=>r===t?1:r===s?-1:0),bias:0,prior:(n[t]+n[s])/DURATION_MULTIPLIER};a.some(e=>e.line[t]&&e.line[s])&&(i.prior-=10),a.some(e=>1===e.line.filter(Number).length&&(e.line[t]||e.line[s]))&&(i.prior+=1),e.push(i)}e.sort((e,t)=>e.prior-t.prior),a.push(...e.slice(0,r.length-a.length))}const l=a.map(({line:e})=>e),u=a.map(({bias:e})=>e),h=matrixInverse(l);if(!h)return this.logger.warn("null invert:",l),null;const d=h.map(e=>e.reduce((e,t,r)=>e+t*u[r],0));if(c.length&&c.some(e=>Math.abs(e.line.reduce((e,t,r)=>e+t*d[r],0))>.001))return null;const f=e.map(()=>1);return r.forEach((e,t)=>f[e]=d[t]),f}optimallySolve(e){const{ones:t,inbalances:r}=this.inbalancesConstraints(e),n=t.map((t,r)=>t?-1:roundNumber(e.eventMap[r].shrinkness,.01)).reduce((e,t,r)=>(t>=0&&(e[t]=e[t]||[],e[t].push(r)),e),{}),s=Object.entries(n).sort((e,t)=>Number(t[0])-Number(e[0])).map(e=>e[1]);for(let n=1;n<s.length;++n){const i=[].concat(...s.slice(0,n)),o=t.map((e,t)=>!i.includes(t)),a=this.solveEquations({ones:o,inbalances:r});if(a&&a.every((t,r)=>t<=1&&t>e.eventMap[r].lowWarp))return a}return this.solveEquations({ones:t,inbalances:r})}isConflicted(e){const{ones:t,inbalances:r}=this.inbalancesConstraints(e);for(const n of r){if(n.reduce((r,n,s)=>r+n*(t[s]||n<=0?1:e.eventMap[s].lowWarp),0)>=0)return n.forEach((t,r)=>{t&&(e.eventTendencies[r]+=t>0?1:-1)}),!0}if(!r.length)return!1;const n=this.solveEquations({ones:t,inbalances:r});return!n||!n.every((t,r)=>t>e.eventMap[r].lowWarp&&t<=1)}getSolution(e){const t=t=>e.eventMap[t.e2]?e.eventMap[t.e2].x+.06*Math.abs(e.eventMap[t.e2].x-e.eventMap[t.e1].x):e.eventMap[t.e1].x+1e4,r=this.actions.filter(e=>e.type===ActionType.HORIZONTAL).sort((e,r)=>t(e)-t(r)),n=r.reduce((e,t)=>({...e,[t.e1]:t.e2}),{}),s=new Set([...Object.keys(n)].map(Number));r.forEach(e=>s.delete(e.e2)),this.stages[0].events.forEach(e=>e>0&&s.add(e));let i=[...s].map(e=>{const t=[e];let r=e;for(;n[r]&&(r=n[r],!(r<0||t.includes(r)));)t.push(r);return t});const o=Object.values(e.eventMap).filter(e=>e.id>0).map(e=>({id:e.id,tick:null,endTick:null,tickGroup:null,timeWarp:null})),a=o.filter(e=>i.some(t=>t.includes(e.id))||r.some(t=>[t.e1,t.e2].includes(e.id))).reduce((e,t)=>({...e,[t.id]:t}),{});this.stages.forEach((e,t)=>e.events.forEach(e=>a[e]&&(a[e].tickGroup=t))),this.stages[0].tick=0,this.stages[0].events.forEach(e=>a[e]&&(a[e].tick=0));const c=this.optimallySolve(e);o.forEach(e=>e.timeWarp=floatToTimeWarp(c[e.id]));const l=this.stages.slice(0,this.stages.length-1),u=()=>{if(l.every(e=>Number.isFinite(e.tick)))return!1;let t=!1;return r.forEach(r=>{const n=this.stages.find(e=>e.events.includes(r.e1)),s=this.stages.find(e=>e.events.includes(r.e2));Number.isFinite(n.tick)&&!Number.isFinite(s.tick)&&(s.tick=n.tick+fractionMul(e.eventMap[r.e1].duration,a[r.e1].timeWarp),s.events.forEach(e=>a[e]&&(a[e].tick=s.tick)),t=!0)}),[...r].reverse().forEach(r=>{const n=this.stages.find(e=>e.events.includes(r.e1)),s=this.stages.find(e=>e.events.includes(r.e2));!Number.isFinite(n.tick)&&Number.isFinite(s.tick)&&(n.tick=s.tick-fractionMul(e.eventMap[r.e1].duration,a[r.e1].timeWarp),n.events.forEach(e=>a[e]&&(a[e].tick=n.tick)),t=!0)}),t};for(;u(););console.assert(l.every(e=>Number.isFinite(e.tick)),"stage ticks not all solved:",this.stages,this.id),o.filter(e=>Number.isFinite(e.tick)).forEach(t=>t.endTick=t.tick+fractionMul(e.eventMap[t.id].duration,t.timeWarp));const h=e.eventMap[0].duration;i.forEach(e=>{const t=e.findIndex(e=>a[e].endTick>h);if(t>=0){e.splice(t,e.length-t).forEach(e=>{a[e].tick=null,a[e].endTick=null})}}),i=i.filter(e=>e.length);const d=Math.max(0,...o.map(e=>e.endTick).filter(Number.isFinite));return this.logger.debug(String.fromCodePoint(127822),this.id,c),{voices:i,events:o,duration:d,actions:this.actions.map(e=>e.id).join(" ")}}deduce(e,t){this.stages||this.constructStages(e);const r=e.actionAccessing.get(this.id)||{times:0};if(++r.times,e.actionAccessing.set(this.id,r),this.constructConstraints(e),this.isConflicted(e))return r.closed=!0,this.logger.info(this.action.id,"❌"),null;if(this.logger.group(this.action&&this.action.id),t.credits>0){if(--t.credits,this.children||this.expand(e),this.children=this.children.filter(t=>!e.actionAccessing.get(t.id)||!e.actionAccessing.get(t.id).closed),this.children.length){const r=t=>t.possibility/((e.actionAccessing.get(t.id)||{times:0}).times+1);this.children.sort((e,t)=>r(t)-r(e));for(const r of this.children){const n=r.deduce(e,t);if(n)return this.logger.groupEnd(),n;if(t.credits<=0)break}}}else this.logger.debug("quota exhausted.");return this.logger.groupEnd(),r.closed=!0,this.getSolution(e)}expand(e){this.constructStages(e);const{eventMap:t,matrixV:r,matrixH:n}=e,s=this.stagedEvents,i=[],o=e=>{if(!this.actions.some(t=>t.id===e.action.id)&&!i.some(t=>t.action.id===e.action.id)){const t=this.stages.find(t=>t.events.includes(e.action.e1)),n=this.stages.find(t=>t.events.includes(e.action.e2));if(t===n||t&&n&&t.index>=n.index)return;if(t&&n)if(e.action.type===ActionType.VERTICAL){if(n.index-t.index>1)return;if(this.actions.some(e=>t.events.includes(e.e1)&&n.events.includes(e.e2)))return}else if(e.action.type===ActionType.HORIZONTAL&&t.index>n.index)return;if(e.action.type===ActionType.HORIZONTAL&&this.actions.some(t=>t.type===ActionType.HORIZONTAL&&(t.e1===e.action.e1||t.e2===e.action.e2||t.e1===e.action.e2&&t.e2===e.action.e1)))return;if(e.action.type===ActionType.VERTICAL){if(t&&(e.possibility=Math.min(e.possibility,...t.events.map(t=>r[e.action.e2][t])),e.possibility<=0))return;if(n&&(e.possibility=Math.min(e.possibility,...n.events.map(t=>r[t][e.action.e1])),e.possibility<=0))return}i.push(e)}};for(const e of s)e<0||(r[e].forEach((t,r)=>{t>0&&e!==r&&o({action:Action.V(r,e),possibility:t})}),r.forEach((t,r)=>{const n=t[e];n>0&&o({action:Action.V(e,r),possibility:n})}),n[e].forEach((t,r)=>{t>0&&o({action:Action.H(r,e),possibility:t})}),n.forEach((r,n)=>{n=n>=Object.keys(t).length?-1:n;const s=r[e];s>0&&o({action:Action.H(e,n),possibility:s})}));i.some(e=>[ActionType.HORIZONTAL,ActionType.PLACE].includes(e.action.type)||!s.has(e.action.e1)||!s.has(e.action.e2))?this.children=i.map(e=>new PathNode({logger:this.logger,parent:this,...e})):this.children=[]}}class Solver{constructor(e,{quota:t=1e3,logger:r=new DummyLogger}={}){this.quota=t,this.logger=r;const n={id:0,x:0,confidence:1,shrinkness:e.measureShrinkness,duration:e.expectedDuration,lowWarp:0};this.events=[n,...e.events.map(e=>({id:e.id,x:e.x,confidence:e.confidence,shrinkness:e.shrinkness,staff:e.staff,duration:e.duration,lowWarp:.5}))],this.eventMap=this.events.reduce((e,t)=>({...e,[t.id]:t}),{}),this.matrixH=e.matrixH,this.matrixV=e.matrixV,this.xSpan=e.endX-Math.min(e.endX-1,...e.events.map(e=>e.x)),this.actionAccessing=new Map}solve(){this.pathRoot=new PathNode({logger:this.logger,action:null}),this.pathRoot.children=this.events.slice(1).map(e=>new PathNode({logger:this.logger,parent:this.pathRoot,action:Action.P(e.id),possibility:this.matrixV[e.id].reduce((e,t)=>e+t,0)}));let e=null;this.logger.groupCollapsed("solve");const t=Array(this.events.length).fill(0),r={credits:this.quota,times:0};for(;r.credits>0;){++r.times;const n={eventMap:this.eventMap,matrixH:this.matrixH,matrixV:this.matrixV,actionAccessing:this.actionAccessing,eventTendencies:t},s=this.pathRoot.deduce(n,r);if(s.credits=this.quota-r.credits,s.times=r.times,this.evaluateSolution(s),this.logger.debug("loss:",s.loss),e=!e||s.loss<e.loss?s:e,!e.loss)break;if(this.actionAccessing.get("").closed)break}return this.logger.groupEnd(),this.logger.debug("solution",e&&e.loss,e),this.logger.debug("cost:",this.quota-r.credits),this.logger.debug("eventTendencies:",t.map(e=>e/r.times)),e}evaluateSolution(e){e.loss=0;const t=e.events.reduce((e,t)=>({...e,[t.id]:{...t,...this.eventMap[t.id]}}),{}),r=e.events.filter(e=>Number.isFinite(e.tick)).map(e=>t[e.id]),n=r.reduce((e,t)=>(e[t.staff]=e[t.staff]||[],e[t.staff].push(t),e),{});Object.values(n).forEach(t=>{t.sort((e,t)=>e.x-t.x).slice(0,t.length-1).forEach((r,n)=>{t[n+1].tick<r.tick&&(e.loss+=1e3)})});const s=new Map;e.events.forEach(r=>{if(Number.isFinite(r.tick)&&!e.voices.every(e=>!e.includes(r.id))||(e.loss+=100*t[r.id].confidence),r.timeWarp){const{numerator:e,denominator:n}=r.timeWarp,i=t[r.id].shrinkness;s.set(e,Math.max(s.get(e)||0,1-i)),s.set(n,Math.max(s.get(n)||0,1-i))}});const i=reducedFraction(e.duration,this.eventMap[0].duration);s.set(i.numerator,Math.max(s.get(i.numerator)||0,1-this.eventMap[0].shrinkness)),s.set(i.denominator,Math.max(s.get(i.denominator)||0,1-this.eventMap[0].shrinkness));for(const[t,r]of s.entries())t>1&&(e.loss+=Math.log(t)*r);let o=0,a=0;e.voices.forEach(r=>{console.assert(t[r[0]],"invalid voice:",r,Object.keys(t));const n=Math.abs(t[r[0]].tick),s=t[r[r.length-1]].endTick;o+=Math.max(0,n+e.duration-s);let i=null;r.forEach(e=>{const r=t[e];r.staff!==i&&(null!==i&&++a,i=r.staff)})}),e.loss+=10*o/DURATION_MULTIPLIER,e.loss+=5**a-1;const c=[...r].sort((e,t)=>e.x-t.x),l=c.slice(1).map((t,r)=>{const n=c[r],s=t.x-n.x,i=t.tick-n.tick;if(!i)return s/this.xSpan;return(4*Math.atan2(i/e.duration,s/this.xSpan)/Math.PI-1)**2}),u=Math.max(...l,0);e.loss+=u**2,console.assert(e.loss>=0,"Invalid solution loss!!!",e.loss,s,o,a),e.loss<0&&(e.loss=1/0)}}const solveStaffGroup=(e,t)=>{if(!e.events.length)return{events:[],voices:[],duration:0};return new Solver(e,t).solve()};worker({solveStaffGroup:solveStaffGroup}),console.info("%cstarry-omr%c v1.0.0 2026-02-20T12:54:03.964Z","color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;","color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;")})();
|
| 11 |
//# sourceMappingURL=worker.js.map
|
|
|
|
| 1 |
+
(function(){"use strict";var Sylvester={Matrix:function(){}};Sylvester.Matrix.create=function(t){return(new Sylvester.Matrix).setElements(t)},Sylvester.Matrix.I=function(t){for(var e,s=[],i=t;i--;)for(e=t,s[i]=[];e--;)s[i][e]=i===e?1:0;return Sylvester.Matrix.create(s)},Sylvester.Matrix.prototype={dup:function(){return Sylvester.Matrix.create(this.elements)},isSquare:function(){var t=0===this.elements.length?0:this.elements[0].length;return this.elements.length===t},toRightTriangular:function(){if(0===this.elements.length)return Sylvester.Matrix.create([]);var t,e,s,i,n=this.dup(),r=this.elements.length,o=this.elements[0].length;for(e=0;e<r;e++){if(0===n.elements[e][e])for(s=e+1;s<r;s++)if(0!==n.elements[s][e]){for(t=[],i=0;i<o;i++)t.push(n.elements[e][i]+n.elements[s][i]);n.elements[e]=t;break}if(0!==n.elements[e][e])for(s=e+1;s<r;s++){var a=n.elements[s][e]/n.elements[e][e];for(t=[],i=0;i<o;i++)t.push(i<=e?0:n.elements[s][i]-n.elements[e][i]*a);n.elements[s]=t}}return n},determinant:function(){if(0===this.elements.length)return 1;if(!this.isSquare())return null;for(var t=this.toRightTriangular(),e=t.elements[0][0],s=t.elements.length,i=1;i<s;i++)e*=t.elements[i][i];return e},isSingular:function(){return this.isSquare()&&0===this.determinant()},augment:function(t){if(0===this.elements.length)return this.dup();var e=t.elements||t;void 0===e[0][0]&&(e=Sylvester.Matrix.create(e).elements);var s,i=this.dup(),n=i.elements[0].length,r=i.elements.length,o=e[0].length;if(r!==e.length)return null;for(;r--;)for(s=o;s--;)i.elements[r][n+s]=e[r][s];return i},inverse:function(){if(0===this.elements.length)return null;if(!this.isSquare()||this.isSingular())return null;for(var t,e,s,i,n,r=this.elements.length,o=r,a=this.augment(Sylvester.Matrix.I(r)).toRightTriangular(),c=a.elements[0].length,h=[];o--;){for(s=[],h[o]=[],i=a.elements[o][o],e=0;e<c;e++)n=a.elements[o][e]/i,s.push(n),e>=r&&h[o].push(n);for(a.elements[o]=s,t=o;t--;){for(s=[],e=0;e<c;e++)s.push(a.elements[t][e]-a.elements[o][e]*a.elements[t][o]);a.elements[t]=s}}return Sylvester.Matrix.create(h)},setElements:function(t){var e,s,i=t.elements||t;if(i[0]&&void 0!==i[0][0]){for(e=i.length,this.elements=[];e--;)for(s=i[e].length,this.elements[e]=[];s--;)this.elements[e][s]=i[e][s];return this}var n=i.length;for(this.elements=[],e=0;e<n;e++)this.elements.push([i[e]]);return this}};var matrixInverse=function(t){const e=Sylvester.Matrix.create(t).inverse();return null!==e?e.elements:null},sha1={exports:{}},SemanticType;
|
| 2 |
/*
|
| 3 |
+
* [js-sha1]{@link https://github.com/emn178/js-sha1}
|
| 4 |
+
*
|
| 5 |
+
* @version 0.6.0
|
| 6 |
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
| 7 |
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
| 8 |
+
* @license MIT
|
| 9 |
+
*/
|
| 10 |
+
(function(module){(function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&module.exports,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e<OUTPUT_TYPES.length;++e){var s=OUTPUT_TYPES[e];t[s]=createOutputMethod(s)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if("string"==typeof t)return crypto.createHash("sha1").update(t,"utf8").digest("hex");if(t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(void 0===t.length)return method(t);return crypto.createHash("sha1").update(new Buffer(t)).digest("hex")};return nodeMethod};function Sha1(t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Sha1.prototype.update=function(t){if(!this.finalized){var e="string"!=typeof t;e&&t.constructor===root.ArrayBuffer&&(t=new Uint8Array(t));for(var s,i,n=0,r=t.length||0,o=this.blocks;n<r;){if(this.hashed&&(this.hashed=!1,o[0]=this.block,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),e)for(i=this.start;n<r&&i<64;++n)o[i>>2]|=t[n]<<SHIFT[3&i++];else for(i=this.start;n<r&&i<64;++n)(s=t.charCodeAt(n))<128?o[i>>2]|=s<<SHIFT[3&i++]:s<2048?(o[i>>2]|=(192|s>>6)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]):s<55296||s>=57344?(o[i>>2]|=(224|s>>12)<<SHIFT[3&i++],o[i>>2]|=(128|s>>6&63)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++n)),o[i>>2]|=(240|s>>18)<<SHIFT[3&i++],o[i>>2]|=(128|s>>12&63)<<SHIFT[3&i++],o[i>>2]|=(128|s>>6&63)<<SHIFT[3&i++],o[i>>2]|=(128|63&s)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=o[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var t,e,s=this.h0,i=this.h1,n=this.h2,r=this.h3,o=this.h4,a=this.blocks;for(t=16;t<80;++t)e=a[t-3]^a[t-8]^a[t-14]^a[t-16],a[t]=e<<1|e>>>31;for(t=0;t<20;t+=5)s=(e=(i=(e=(n=(e=(r=(e=(o=(e=s<<5|s>>>27)+(i&n|~i&r)+o+1518500249+a[t]|0)<<5|o>>>27)+(s&(i=i<<30|i>>>2)|~s&n)+r+1518500249+a[t+1]|0)<<5|r>>>27)+(o&(s=s<<30|s>>>2)|~o&i)+n+1518500249+a[t+2]|0)<<5|n>>>27)+(r&(o=o<<30|o>>>2)|~r&s)+i+1518500249+a[t+3]|0)<<5|i>>>27)+(n&(r=r<<30|r>>>2)|~n&o)+s+1518500249+a[t+4]|0,n=n<<30|n>>>2;for(;t<40;t+=5)s=(e=(i=(e=(n=(e=(r=(e=(o=(e=s<<5|s>>>27)+(i^n^r)+o+1859775393+a[t]|0)<<5|o>>>27)+(s^(i=i<<30|i>>>2)^n)+r+1859775393+a[t+1]|0)<<5|r>>>27)+(o^(s=s<<30|s>>>2)^i)+n+1859775393+a[t+2]|0)<<5|n>>>27)+(r^(o=o<<30|o>>>2)^s)+i+1859775393+a[t+3]|0)<<5|i>>>27)+(n^(r=r<<30|r>>>2)^o)+s+1859775393+a[t+4]|0,n=n<<30|n>>>2;for(;t<60;t+=5)s=(e=(i=(e=(n=(e=(r=(e=(o=(e=s<<5|s>>>27)+(i&n|i&r|n&r)+o-1894007588+a[t]|0)<<5|o>>>27)+(s&(i=i<<30|i>>>2)|s&n|i&n)+r-1894007588+a[t+1]|0)<<5|r>>>27)+(o&(s=s<<30|s>>>2)|o&i|s&i)+n-1894007588+a[t+2]|0)<<5|n>>>27)+(r&(o=o<<30|o>>>2)|r&s|o&s)+i-1894007588+a[t+3]|0)<<5|i>>>27)+(n&(r=r<<30|r>>>2)|n&o|r&o)+s-1894007588+a[t+4]|0,n=n<<30|n>>>2;for(;t<80;t+=5)s=(e=(i=(e=(n=(e=(r=(e=(o=(e=s<<5|s>>>27)+(i^n^r)+o-899497514+a[t]|0)<<5|o>>>27)+(s^(i=i<<30|i>>>2)^n)+r-899497514+a[t+1]|0)<<5|r>>>27)+(o^(s=s<<30|s>>>2)^i)+n-899497514+a[t+2]|0)<<5|n>>>27)+(r^(o=o<<30|o>>>2)^s)+i-899497514+a[t+3]|0)<<5|i>>>27)+(n^(r=r<<30|r>>>2)^o)+s-899497514+a[t+4]|0,n=n<<30|n>>>2;this.h0=this.h0+s|0,this.h1=this.h1+i|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0,this.h4=this.h4+o|0},Sha1.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,s=this.h2,i=this.h3,n=this.h4;return HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,s=this.h2,i=this.h3,n=this.h4;return[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),t};var exports=createMethod();COMMON_JS?module.exports=exports:root.sha1=exports})()})(sha1),function(t){t.ClefG="ClefG",t.ClefF="ClefF",t.ClefC="ClefC",t.NoteheadS0="NoteheadS0",t.NoteheadS1="NoteheadS1",t.NoteheadS2="NoteheadS2",t.NoteheadS1stemU="NoteheadS1stemU",t.NoteheadS1stemD="NoteheadS1stemD",t.NoteheadS2stemU="NoteheadS2stemU",t.NoteheadS2stemD="NoteheadS2stemD",t.vline_Stem="vline_Stem",t.Flag3="Flag3",t.BeamLeft="BeamLeft",t.BeamContinue="BeamContinue",t.BeamRight="BeamRight",t.TremoloLeft="TremoloLeft",t.TremoloRight="TremoloRight",t.TremoloMiddle="TremoloMiddle",t.Dot="Dot",t.Rest0="Rest0",t.Rest1="Rest1",t.Rest2="Rest2",t.Rest3="Rest3",t.Rest4="Rest4",t.Rest5="Rest5",t.Rest6="Rest6",t.Rest0W="Rest0W",t.RestM1="RestM1",t.AccNatural="AccNatural",t.AccSharp="AccSharp",t.AccDoublesharp="AccDoublesharp",t.AccFlat="AccFlat",t.AccFlatflat="AccFlatflat",t.vline_VoltaLeft="vline_VoltaLeft",t.vline_VoltaRight="vline_VoltaRight",t.VoltaLeft="VoltaLeft",t.VoltaRight="VoltaRight",t.VoltaAlternativeBegin="VoltaAlternativeBegin",t.BarMeasure="BarMeasure",t.vline_BarMeasure="vline_BarMeasure",t.vline_BarTerminal="vline_BarTerminal",t.vline_BarSegment="vline_BarSegment",t.SlurBegin="SlurBegin",t.SlurEnd="SlurEnd",t.TimesigC44="TimesigC44",t.TimesigC22="TimesigC22",t.TimesigZero="TimesigZero",t.TimesigOne="TimesigOne",t.TimesigTwo="TimesigTwo",t.TimesigThree="TimesigThree",t.TimesigFour="TimesigFour",t.TimesigFive="TimesigFive",t.TimesigSix="TimesigSix",t.TimesigSeven="TimesigSeven",t.TimesigEight="TimesigEight",t.TimesigNine="TimesigNine",t.OctaveShift8va="OctaveShift8va",t.OctaveShift8vb="OctaveShift8vb",t.OctaveShift8="OctaveShift8",t.OctaveShift0="OctaveShift0",t.Zero="Zero",t.One="One",t.Two="Two",t.Three="Three",t.Four="Four",t.Five="Five",t.Six="Six",t.Seven="Seven",t.Eight="Eight",t.Nine="Nine",t.f="f",t.p="p",t.m="m",t.n="n",t.r="r",t.s="s",t.z="z",t.CrescendoBegin="CrescendoBegin",t.CrescendoEnd="CrescendoEnd",t.DecrescendoBegin="DecrescendoBegin",t.DecrescendoEnd="DecrescendoEnd",t.ScriptFermata="ScriptFermata",t.ScriptShortFermata="ScriptShortFermata",t.ScriptSforzato="ScriptSforzato",t.ScriptStaccato="ScriptStaccato",t.ScriptStaccatissimo="ScriptStaccatissimo",t.ScriptTurn="ScriptTurn",t.ScriptTrill="ScriptTrill",t.ScriptSegno="ScriptSegno",t.ScriptCoda="ScriptCoda",t.ScriptArpeggio="ScriptArpeggio",t.ScriptPrall="ScriptPrall",t.ScriptMordent="ScriptMordent",t.ScriptMarcato="ScriptMarcato",t.ScriptTenuto="ScriptTenuto",t.ScriptPortato="ScriptPortato",t.PedalStar="PedalStar",t.PedalPed="PedalPed",t.KeyAcc="KeyAcc",t.TempoNotehead="TempoNotehead",t.GraceNotehead="GraceNotehead",t.SignLined="SignLined",t.SignInterval="SignInterval",t.rect_Text="rect_Text",t.rect_Lyric="rect_Lyric"}(SemanticType||(SemanticType={})),SemanticType.BarMeasure,SemanticType.vline_BarMeasure,SemanticType.vline_BarTerminal,SemanticType.vline_BarSegment,SemanticType.vline_VoltaLeft,SemanticType.vline_VoltaRight,SemanticType.VoltaAlternativeBegin;const st=SemanticType;st.NoteheadS0,st.NoteheadS1,st.NoteheadS2,st.Zero,st.One,st.Two,st.Three,st.Four,st.Five,st.Six,st.Seven,st.Eight,st.Nine,st.ScriptStaccatissimo,st.TimesigZero,st.TimesigOne,st.TimesigTwo,st.TimesigThree,st.TimesigFour,st.TimesigFive,st.TimesigSix,st.TimesigSeven,st.TimesigEight,st.TimesigNine,st.Rest0,st.Rest1,st.Rest2,st.Rest3,st.Rest4,st.Rest5,st.Rest6,st.Rest0W,st.RestM1,st.SignInterval,st.SignLined,st.BeamLeft,st.BeamContinue,st.BeamRight,st.ClefG,st.ClefF,st.ClefC,st.NoteheadS0,st.NoteheadS1,st.NoteheadS2,st.Dot,st.Rest0,st.Rest1,st.Rest2,st.Rest3,st.Rest4,st.Rest5,st.Rest6,st.RestM1,st.AccNatural,st.AccSharp,st.AccDoublesharp,st.AccFlat,st.AccFlatflat,st.TimesigC44,st.TimesigC22,st.TimesigZero,st.TimesigOne,st.TimesigTwo,st.TimesigThree,st.TimesigFour,st.TimesigFive,st.TimesigSix,st.TimesigSeven,st.TimesigEight,st.TimesigNine,st.One,st.Two,st.Three,st.Four,st.Five,st.OctaveShift8,st.OctaveShift0,st.f,st.p,st.m,st.n,st.r,st.s,st.z,st.ScriptFermata,st.ScriptShortFermata,st.ScriptSforzato,st.ScriptStaccato,st.ScriptStaccatissimo,st.ScriptTurn,st.ScriptTrill,st.ScriptSegno,st.ScriptCoda,st.ScriptArpeggio,st.ScriptPrall,st.ScriptMordent,st.ScriptMarcato,st.ScriptTenuto,st.ScriptPortato,st.PedalStar,st.PedalPed;const roundNumber=(t,e,s=-1/0)=>Math.max(Math.round(t/e)*e,s),gcd=(t,e)=>Number.isInteger(t)&&Number.isInteger(e)?0===e?t:gcd(e,t%e):(console.error("non-integer gcd:",t,e),1),frac=(t,e)=>({numerator:t,denominator:e}),reducedFraction=(t,e)=>{t=Math.round(t),e=Math.round(e);const s=0!==t?gcd(t,e):e;return frac(t/s,e/s)},fractionMul=(t,e)=>e?t*e.numerator/e.denominator:t;class DummyLogger{debug(...t){}group(...t){}groupCollapsed(...t){}groupEnd(){}info(...t){}warn(...t){}assert(...t){}}const EOM=-1,GREAT_NUMBER=1920,DURATION_MULTIPLIER=1921920,floatToFrac=t=>{const e=Math.round(t*GREAT_NUMBER);return reducedFraction(e,GREAT_NUMBER)},floatToTimeWarp=t=>1===t?null:floatToFrac(t);var ActionType;!function(t){t[t.PLACE=0]="PLACE",t[t.VERTICAL=1]="VERTICAL",t[t.HORIZONTAL=2]="HORIZONTAL"}(ActionType||(ActionType={}));class Action{constructor(t){Object.assign(this,t)}static P(t){return new Action({type:ActionType.PLACE,e1:t})}static V(t,e,s=1){return new Action({type:ActionType.VERTICAL,e1:s>0?t:e,e2:s>0?e:t})}static H(t,e){return new Action({type:ActionType.HORIZONTAL,e1:t,e2:e})}get id(){switch(this.type){case ActionType.PLACE:return this.e1.toString();case ActionType.VERTICAL:return`${this.e1}|${this.e2}`;case ActionType.HORIZONTAL:return`${this.e1}-${this.e2>=0?this.e2:"."}`}}get events(){return[this.e1,this.e2].filter(Number.isFinite)}}class StageMatrix{static fromNode(t,e){const s=Array(t.stages.length).fill(null).map(()=>Array(t.stages.length).fill(null).map(()=>new Set));t.actions.filter(t=>t.type===ActionType.HORIZONTAL).forEach(e=>{const i=t.stages.findIndex(t=>t.events.includes(e.e1)),n=t.stages.findIndex(t=>t.events.includes(e.e2));console.assert(i>=0&&n>=0,"invalid stages for H action:",t.id,t.stages,e),s[i][n].add(e.e1)}),s[0][t.stages.length-1].add(0);const i=t.stagedEvents,n=e.matrixH[e.matrixH.length-1].filter((t,e)=>!i.has(e)),r=Math.max(0,Math.max(...n)-.01),o=t.actions.filter(t=>t.type===ActionType.HORIZONTAL),a=Object.keys(e.eventMap).map(Number).filter(t=>!o.find(e=>e.e2===t));return t.stages.forEach(i=>{i.events.forEach(n=>{if(n>0){!o.find(t=>t.e1===n)&&e.matrixH[e.matrixH.length-1][n]>=r&&(a.some(t=>e.matrixH[t][n]>0)||s[i.index][t.stages.length-1].add(n))}})}),new StageMatrix({matrix:s})}constructor(t){Object.assign(this,t)}pathOf(t,e,s,i=0){if(this.matrix[t][e].size){const n=[...this.matrix[t][e]][i];if(e===s)return[n];for(let t=e+1;t<=s;++t){const i=this.pathOf(e,t,s);if(i)return[n,...i]}}return null}findDoublePath(t,e){const s=[];for(let i=e;i>=t+1;--i)for(let n=0;n<this.matrix[t][i].size;++n){const r=this.pathOf(t,i,e,n);if(r&&(s.push(r),2===s.length))return[s[0],s[1]]}return null}reducePath(t){this.matrix.forEach(e=>e.forEach(e=>t.forEach(t=>e.delete(t))))}toEquations(t){const e=[];for(let s=1;s<this.matrix.length;s++)for(let i=0;i<this.matrix.length-s;i++){const n=i+s;for(;;){const s=this.findDoublePath(i,n);if(!s)break;{const[i,n]=s,r=Array(t).fill(0);i.forEach(t=>r[t]=1),n.forEach(t=>r[t]=-1),e.push(r),this.reducePath(i.length>n.length?i:n)}}}return e}}class PathNode{constructor(t){Object.assign(this,t),console.assert(this.logger,"logger is null:",t)}get actions(){const t=this.parent?this.parent.actions:[];return this.action?[...t,this.action]:t}get id(){return this.actions.map(t=>t.id).sort().join(" ")}get stagedEvents(){const t=new Set;return this.stages&&this.stages.forEach(e=>e.events.forEach(e=>e>=0&&t.add(e))),t}like(t){return t.split(" ").sort().join(" ")===this.id}constructStages(t){this.stages=[{events:[EOM]}];for(const e of this.actions)switch(e.type){case ActionType.PLACE:this.stages.unshift({events:[e.e1]});break;case ActionType.VERTICAL:{const t=this.stages.find(t=>t.events.includes(e.e1)),s=this.stages.find(t=>t.events.includes(e.e2));console.assert(t||s,"invalid V action:",this.stages,e),t&&s?(t.events.push(...s.events),s.events=null,this.stages=this.stages.filter(t=>t.events)):t?s||t.events.push(e.e2):s.events.unshift(e.e1)}break;case ActionType.HORIZONTAL:{const s=this.stages.find(t=>t.events.includes(e.e1)),i=this.stages.find(t=>t.events.includes(e.e2));console.assert(s||i,"invalid H action:",this.stages,e);const n=s=>{console.assert(t.eventMap[s],"invalid event id:",e.id,s,t.eventMap);const i=t.eventMap[s].x,n=this.stages.find(e=>e.events.some(e=>e>0&&t.eventMap[e].x<=i)&&e.events.some(e=>e>0&&t.eventMap[e].x>=i));if(n)n.events.push(s);else{const e={events:[s]},n=this.stages.findIndex(e=>e.events[0]===EOM||t.eventMap[e.events[0]].x>=i);this.stages.splice(n,0,e)}};s||n(e.e1),i||n(e.e2)}}this.stages.forEach((t,e)=>t.index=e)}constructConstraints(t){const e=Object.keys(t.eventMap).length,s=StageMatrix.fromNode(this,t).toEquations(e),i=Array(e).fill(null).map((e,s)=>t.eventMap[s].duration);this.constraints=s.map(t=>t.map((t,e)=>t*i[e]))}inbalancesConstraints(t){console.assert(this.constraints,"constraints not constructed.");const e=Object.keys(t.eventMap).length,s=Array(e).fill(!0),i=Array(e).fill(!1),n=[];for(const t of this.constraints){const e=t.reduce((t,e)=>t+e,0);if(0!==e){const r=e<0?t.map(t=>-t):t;if(r[0]>0)continue;n.push(r),r.forEach((t,e)=>{i[e]=i[e]||t<0,t&&(s[e]=t<0||i[e])})}}return this.constraints.forEach(t=>{0!==t.reduce((t,e)=>t+e,0)||t[0]||t.some((t,e)=>t&&!s[e])&&(t.forEach((t,e)=>t&&(s[e]=!1)),n.push(t))}),{ones:s,inbalances:n}}solveEquations({ones:t,inbalances:e}){if(!e.length)return t.map(()=>1);const s=t.map((t,e)=>({fixed:t,i:e})).filter(({fixed:t})=>!t).map(({i:t})=>t).filter(t=>e.some(e=>0!==e[t]));if(!s.length)return t.map(()=>1);const i=s.map(t=>Math.abs(e.find(e=>0!==e[t])[t])),n=new Map;let r=!1;const o=e.map(t=>({line:t.filter((t,e)=>s.includes(e)),bias:-t.reduce((t,e,i)=>t+(s.includes(i)?0:e),0)})).filter(({line:t,bias:e})=>{if(t.every(t=>0===t))return!1;const s=t.join(",");return n.has(s)?(r=n.get(s)!==e,!1):(n.set(s,e),!0)});if(r)return null;const a=o.slice(0,s.length),c=o.slice(s.length);if(a.length<s.length){const t=[];for(let e=0;e<s.length-1;++e){const n=e+1,r={line:s.map((t,s)=>s===e?1:s===n?-1:0),bias:0,prior:(i[e]+i[n])/DURATION_MULTIPLIER};a.some(t=>t.line[e]&&t.line[n])&&(r.prior-=10),a.some(t=>1===t.line.filter(Number).length&&(t.line[e]||t.line[n]))&&(r.prior+=1),t.push(r)}t.sort((t,e)=>t.prior-e.prior),a.push(...t.slice(0,s.length-a.length))}const h=a.map(({line:t})=>t),l=a.map(({bias:t})=>t),u=matrixInverse(h);if(!u)return this.logger.warn("null invert:",h),null;const d=u.map(t=>t.reduce((t,e,s)=>t+e*l[s],0));if(c.length&&c.some(t=>Math.abs(t.line.reduce((t,e,s)=>t+e*d[s],0))>.001))return null;const f=t.map(()=>1);return s.forEach((t,e)=>f[t]=d[e]),f}optimallySolve(t){const{ones:e,inbalances:s}=this.inbalancesConstraints(t),i=e.map((e,s)=>e?-1:roundNumber(t.eventMap[s].shrinkness,.01)).reduce((t,e,s)=>(e>=0&&(t[e]=t[e]||[],t[e].push(s)),t),{}),n=Object.entries(i).sort((t,e)=>Number(e[0])-Number(t[0])).map(t=>t[1]);for(let i=1;i<n.length;++i){const r=[].concat(...n.slice(0,i)),o=e.map((t,e)=>!r.includes(e)),a=this.solveEquations({ones:o,inbalances:s});if(a&&a.every((e,s)=>e<=1&&e>t.eventMap[s].lowWarp))return a}return this.solveEquations({ones:e,inbalances:s})}isConflicted(t){const{ones:e,inbalances:s}=this.inbalancesConstraints(t);for(const i of s){if(i.reduce((s,i,n)=>s+i*(e[n]||i<=0?1:t.eventMap[n].lowWarp),0)>=0)return i.forEach((e,s)=>{e&&(t.eventTendencies[s]+=e>0?1:-1)}),!0}if(!s.length)return!1;const i=this.solveEquations({ones:e,inbalances:s});return!i||!i.every((e,s)=>e>t.eventMap[s].lowWarp&&e<=1)}getSolution(t){const e=e=>t.eventMap[e.e2]?t.eventMap[e.e2].x+.06*Math.abs(t.eventMap[e.e2].x-t.eventMap[e.e1].x):t.eventMap[e.e1].x+1e4,s=this.actions.filter(t=>t.type===ActionType.HORIZONTAL).sort((t,s)=>e(t)-e(s)),i=s.reduce((t,e)=>({...t,[e.e1]:e.e2}),{}),n=new Set([...Object.keys(i)].map(Number));s.forEach(t=>n.delete(t.e2)),this.stages[0].events.forEach(t=>t>0&&n.add(t));let r=[...n].map(t=>{const e=[t];let s=t;for(;i[s]&&(s=i[s],!(s<0||e.includes(s)));)e.push(s);return e});const o=Object.values(t.eventMap).filter(t=>t.id>0).map(t=>({id:t.id,tick:null,endTick:null,tickGroup:null,timeWarp:null})),a=o.filter(t=>r.some(e=>e.includes(t.id))||s.some(e=>[e.e1,e.e2].includes(t.id))).reduce((t,e)=>({...t,[e.id]:e}),{});this.stages.forEach((t,e)=>t.events.forEach(t=>a[t]&&(a[t].tickGroup=e))),this.stages[0].tick=0,this.stages[0].events.forEach(t=>a[t]&&(a[t].tick=0));const c=this.optimallySolve(t);o.forEach(t=>t.timeWarp=floatToTimeWarp(c[t.id]));const h=this.stages.slice(0,this.stages.length-1),l=()=>{if(h.every(t=>Number.isFinite(t.tick)))return!1;let e=!1;return s.forEach(s=>{const i=this.stages.find(t=>t.events.includes(s.e1)),n=this.stages.find(t=>t.events.includes(s.e2));Number.isFinite(i.tick)&&!Number.isFinite(n.tick)&&(n.tick=i.tick+fractionMul(t.eventMap[s.e1].duration,a[s.e1].timeWarp),n.events.forEach(t=>a[t]&&(a[t].tick=n.tick)),e=!0)}),[...s].reverse().forEach(s=>{const i=this.stages.find(t=>t.events.includes(s.e1)),n=this.stages.find(t=>t.events.includes(s.e2));!Number.isFinite(i.tick)&&Number.isFinite(n.tick)&&(i.tick=n.tick-fractionMul(t.eventMap[s.e1].duration,a[s.e1].timeWarp),i.events.forEach(t=>a[t]&&(a[t].tick=i.tick)),e=!0)}),e};for(;l(););console.assert(h.every(t=>Number.isFinite(t.tick)),"stage ticks not all solved:",this.stages,this.id),o.filter(t=>Number.isFinite(t.tick)).forEach(e=>e.endTick=e.tick+fractionMul(t.eventMap[e.id].duration,e.timeWarp));const u=t.eventMap[0].duration;r.forEach(t=>{const e=t.findIndex(t=>a[t].endTick>u);if(e>=0){t.splice(e,t.length-e).forEach(t=>{a[t].tick=null,a[t].endTick=null})}}),r=r.filter(t=>t.length);const d=Math.max(0,...o.map(t=>t.endTick).filter(Number.isFinite));return this.logger.debug(String.fromCodePoint(127822),this.id,c),{voices:r,events:o,duration:d,actions:this.actions.map(t=>t.id).join(" ")}}deduce(t,e){this.stages||this.constructStages(t);const s=t.actionAccessing.get(this.id)||{times:0};if(++s.times,t.actionAccessing.set(this.id,s),this.constructConstraints(t),this.isConflicted(t))return s.closed=!0,this.logger.info(this.action.id,"❌"),null;if(this.logger.group(this.action&&this.action.id),e.credits>0){if(--e.credits,this.children||this.expand(t),this.children=this.children.filter(e=>!t.actionAccessing.get(e.id)||!t.actionAccessing.get(e.id).closed),this.children.length){const s=e=>e.possibility/((t.actionAccessing.get(e.id)||{times:0}).times+1);this.children.sort((t,e)=>s(e)-s(t));for(const s of this.children){const i=s.deduce(t,e);if(i)return this.logger.groupEnd(),i;if(e.credits<=0)break}}}else this.logger.debug("quota exhausted.");return this.logger.groupEnd(),s.closed=!0,this.getSolution(t)}expand(t){this.constructStages(t);const{eventMap:e,matrixV:s,matrixH:i}=t,n=this.stagedEvents,r=[],o=t=>{if(!this.actions.some(e=>e.id===t.action.id)&&!r.some(e=>e.action.id===t.action.id)){const e=this.stages.find(e=>e.events.includes(t.action.e1)),i=this.stages.find(e=>e.events.includes(t.action.e2));if(e===i||e&&i&&e.index>=i.index)return;if(e&&i)if(t.action.type===ActionType.VERTICAL){if(i.index-e.index>1)return;if(this.actions.some(t=>e.events.includes(t.e1)&&i.events.includes(t.e2)))return}else if(t.action.type===ActionType.HORIZONTAL&&e.index>i.index)return;if(t.action.type===ActionType.HORIZONTAL&&this.actions.some(e=>e.type===ActionType.HORIZONTAL&&(e.e1===t.action.e1||e.e2===t.action.e2||e.e1===t.action.e2&&e.e2===t.action.e1)))return;if(t.action.type===ActionType.VERTICAL){if(e&&(t.possibility=Math.min(t.possibility,...e.events.map(e=>s[t.action.e2][e])),t.possibility<=0))return;if(i&&(t.possibility=Math.min(t.possibility,...i.events.map(e=>s[e][t.action.e1])),t.possibility<=0))return}r.push(t)}};for(const t of n)t<0||(s[t].forEach((e,s)=>{e>0&&t!==s&&o({action:Action.V(s,t),possibility:e})}),s.forEach((e,s)=>{const i=e[t];i>0&&o({action:Action.V(t,s),possibility:i})}),i[t].forEach((e,s)=>{e>0&&o({action:Action.H(s,t),possibility:e})}),i.forEach((s,i)=>{i=i>=Object.keys(e).length?-1:i;const n=s[t];n>0&&o({action:Action.H(t,i),possibility:n})}));r.some(t=>[ActionType.HORIZONTAL,ActionType.PLACE].includes(t.action.type)||!n.has(t.action.e1)||!n.has(t.action.e2))?this.children=r.map(t=>new PathNode({logger:this.logger,parent:this,...t})):this.children=[]}}class Solver{constructor(t,{quota:e=1e3,logger:s=new DummyLogger}={}){this.quota=e,this.logger=s;const i={id:0,x:0,confidence:1,shrinkness:t.measureShrinkness,duration:t.expectedDuration,lowWarp:0};this.events=[i,...t.events.map(t=>({id:t.id,x:t.x,confidence:t.confidence,shrinkness:t.shrinkness,staff:t.staff,duration:t.duration,lowWarp:.5}))],this.eventMap=this.events.reduce((t,e)=>({...t,[e.id]:e}),{}),this.matrixH=t.matrixH,this.matrixV=t.matrixV,this.xSpan=t.endX-Math.min(t.endX-1,...t.events.map(t=>t.x)),this.actionAccessing=new Map}solve(){this.pathRoot=new PathNode({logger:this.logger,action:null}),this.pathRoot.children=this.events.slice(1).map(t=>new PathNode({logger:this.logger,parent:this.pathRoot,action:Action.P(t.id),possibility:this.matrixV[t.id].reduce((t,e)=>t+e,0)}));let t=null;this.logger.groupCollapsed("solve");const e=Array(this.events.length).fill(0),s={credits:this.quota,times:0};for(;s.credits>0;){++s.times;const i={eventMap:this.eventMap,matrixH:this.matrixH,matrixV:this.matrixV,actionAccessing:this.actionAccessing,eventTendencies:e},n=this.pathRoot.deduce(i,s);if(n.credits=this.quota-s.credits,n.times=s.times,this.evaluateSolution(n),this.logger.debug("loss:",n.loss),t=!t||n.loss<t.loss?n:t,!t.loss)break;if(this.actionAccessing.get("").closed)break}return this.logger.groupEnd(),this.logger.debug("solution",t&&t.loss,t),this.logger.debug("cost:",this.quota-s.credits),this.logger.debug("eventTendencies:",e.map(t=>t/s.times)),t}evaluateSolution(t){t.loss=0;const e=t.events.reduce((t,e)=>({...t,[e.id]:{...e,...this.eventMap[e.id]}}),{}),s=t.events.filter(t=>Number.isFinite(t.tick)).map(t=>e[t.id]),i=s.reduce((t,e)=>(t[e.staff]=t[e.staff]||[],t[e.staff].push(e),t),{});Object.values(i).forEach(e=>{e.sort((t,e)=>t.x-e.x).slice(0,e.length-1).forEach((s,i)=>{e[i+1].tick<s.tick&&(t.loss+=1e3)})});const n=new Map;t.events.forEach(s=>{if(Number.isFinite(s.tick)&&!t.voices.every(t=>!t.includes(s.id))||(t.loss+=100*e[s.id].confidence),s.timeWarp){const{numerator:t,denominator:i}=s.timeWarp,r=e[s.id].shrinkness;n.set(t,Math.max(n.get(t)||0,1-r)),n.set(i,Math.max(n.get(i)||0,1-r))}});const r=reducedFraction(t.duration,this.eventMap[0].duration);n.set(r.numerator,Math.max(n.get(r.numerator)||0,1-this.eventMap[0].shrinkness)),n.set(r.denominator,Math.max(n.get(r.denominator)||0,1-this.eventMap[0].shrinkness));for(const[e,s]of n.entries())e>1&&(t.loss+=Math.log(e)*s);let o=0,a=0;t.voices.forEach(s=>{console.assert(e[s[0]],"invalid voice:",s,Object.keys(e));const i=Math.abs(e[s[0]].tick),n=e[s[s.length-1]].endTick;o+=Math.max(0,i+t.duration-n);let r=null;s.forEach(t=>{const s=e[t];s.staff!==r&&(null!==r&&++a,r=s.staff)})}),t.loss+=10*o/DURATION_MULTIPLIER,t.loss+=5**a-1;const c=[...s].sort((t,e)=>t.x-e.x),h=c.slice(1).map((e,s)=>{const i=c[s],n=e.x-i.x,r=e.tick-i.tick;if(!r)return n/this.xSpan;return(4*Math.atan2(r/t.duration,n/this.xSpan)/Math.PI-1)**2}),l=Math.max(...h,0);t.loss+=l**2,console.assert(t.loss>=0,"Invalid solution loss!!!",t.loss,n,o,a),t.loss<0&&(t.loss=1/0)}}const solveStaffGroup=(t,e)=>{if(!t.events.length)return{events:[],voices:[],duration:0};return new Solver(t,e).solve()};self.onmessage=t=>{const{id:e,args:s}=t.data;try{const t=solveStaffGroup(s[0],s[1]);self.postMessage({id:e,result:t})}catch(t){self.postMessage({id:e,error:t.message})}},console.info("%cstarry-omr%c v1.0.0 2026-04-23T11:21:11.382Z","color:#fff; background-color: #555;padding: 5px;border-radius: 3px 0 0 3px;","color: #fff; background-color: #007dc6;padding: 5px;border-radius: 0 3px 3px 0;")})();
|
| 11 |
//# sourceMappingURL=worker.js.map
|
backend/omr/dist/worker.js.map
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
backend/python-services/services/layout_service.py
CHANGED
|
@@ -258,11 +258,12 @@ class PageLayout:
|
|
| 258 |
_, png_data = cv2.imencode('.png', staff_image)
|
| 259 |
staff_bytes = png_data.tobytes()
|
| 260 |
|
|
|
|
| 261 |
area['staff_images'].append({
|
| 262 |
'hash': None,
|
| 263 |
'image': staff_bytes,
|
| 264 |
'position': {
|
| 265 |
-
'x': -STAFF_PADDING_LEFT / UNIT_SIZE,
|
| 266 |
'y': -STAFF_HEIGHT_UNITS / 2,
|
| 267 |
'width': staff_size[0] / UNIT_SIZE,
|
| 268 |
'height': staff_size[1] / UNIT_SIZE,
|
|
|
|
| 258 |
_, png_data = cv2.imencode('.png', staff_image)
|
| 259 |
staff_bytes = png_data.tobytes()
|
| 260 |
|
| 261 |
+
phi1 = area['staves'].get('phi1', 0)
|
| 262 |
area['staff_images'].append({
|
| 263 |
'hash': None,
|
| 264 |
'image': staff_bytes,
|
| 265 |
'position': {
|
| 266 |
+
'x': -STAFF_PADDING_LEFT / UNIT_SIZE - (phi1 / interval if interval else 0),
|
| 267 |
'y': -STAFF_HEIGHT_UNITS / 2,
|
| 268 |
'width': staff_size[0] / UNIT_SIZE,
|
| 269 |
'height': staff_size[1] / UNIT_SIZE,
|
dist/assets/DeleteOutlined-1f8a2958.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as l,f as e}from"./_setToString-038b76d7.js";import{r as t}from"./umi-2135699e.js";var a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const n=a;var o=function(c,r){return t.createElement(l,e(e({},c),{},{ref:r,icon:n}))},v=t.forwardRef(o);const h=v;export{h as D};
|
dist/assets/PlaySquareOutlined-c471435e.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as c,f as e}from"./_setToString-038b76d7.js";import{r as a}from"./umi-2135699e.js";var l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"};const i=l;var s=function(t,r){return a.createElement(c,e(e({},t),{},{ref:r,icon:i}))},u=a.forwardRef(s);const P=u;var o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M442.3 677.6l199.4-156.7a11.3 11.3 0 000-17.7L442.3 346.4c-7.4-5.8-18.3-.6-18.3 8.8v313.5c0 9.4 10.9 14.7 18.3 8.9z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"play-square",theme:"outlined"};const d=o;var f=function(t,r){return a.createElement(c,e(e({},t),{},{ref:r,icon:d}))},v=a.forwardRef(f);const p=v;export{p as P,P as a};
|
dist/assets/ScoreEncoder-da446433.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/Table-2648cf63.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/Table-42978533.css
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/Table-5199d45f.css
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/Table-5d4bbec4.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/Tags-7859f157.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as L,f as E,N as b,a as J,O as G,P as H,o as q,c as K,r as T}from"./_setToString-038b76d7.js";import{r as s,_ as U,j as l}from"./umi-2135699e.js";import{t as X,B as w}from"./button-eb671c5b.js";import{b as N,D as F,a as Q}from"./index-c4a8d365.js";import{T as R}from"./useDebounce-ed4013a1.js";import{i as W,n as _}from"./util-e99b60d9.js";import{u as Y}from"./useAsyncFn-1ec42995.js";import{E as Z}from"./index-bbd283be.js";var V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const ee=V;var te=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:ee}))},se=s.forwardRef(te);const Ce=se;var ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 000 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM459.7 834.7L189.3 564.3 589 164.6 836 188l23.4 247-399.7 399.7zM680 256c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm0 120c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]},name:"tag",theme:"outlined"};const re=ae;var ne=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:re}))},ie=s.forwardRef(ne);const ce=ie;var z=N.Option;function I(a){return a&&a.type&&(a.type.isSelectOption||a.type.isSelectOptGroup)}var le=function(n,r){var O=n.prefixCls,g=n.className,x=n.popupClassName,p=n.dropdownClassName,o=n.children,C=n.dataSource,u=X(o),i;if(u.length===1&&b(u[0])&&!I(u[0])){var f=J(u,1);i=f[0]}var c=i?function(){return i}:void 0,v;return u.length&&I(u[0])?v=o:v=C?C.map(function(d){if(b(d))return d;switch(G(d)){case"string":return s.createElement(z,{key:d,value:d},d);case"object":{var S=d.value;return s.createElement(z,{key:S,value:S},d.text)}default:return}}):[],s.createElement(H,null,function(d){var S=d.getPrefixCls,y=S("select",O);return s.createElement(N,U({ref:r},q(n,["dataSource"]),{prefixCls:y,popupClassName:x||p,className:K("".concat(y,"-auto-complete"),g),mode:N.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:c}),v)})},P=s.forwardRef(le);P.Option=z;const oe=P;var ue=function(a,n,r){if(!W)return[n,_,_];if(!a)throw new Error("useLocalStorage key may not be falsy");var O=r?r.raw?function(i){return i}:r.deserializer:JSON.parse,g=s.useRef(function(i){try{var f=r?r.raw?String:r.serializer:JSON.stringify,c=localStorage.getItem(i);return c!==null?O(c):(n&&localStorage.setItem(i,f(n)),n)}catch{return n}}),x=s.useState(function(){return g.current(a)}),p=x[0],o=x[1];s.useLayoutEffect(function(){return o(g.current(a))},[a]);var C=s.useCallback(function(i){try{var f=typeof i=="function"?i(p):i;if(typeof f>"u")return;var c=void 0;r?r.raw?typeof f=="string"?c=f:c=JSON.stringify(f):r.serializer?c=r.serializer(f):c=JSON.stringify(f):c=JSON.stringify(f),localStorage.setItem(a,c),o(O(c))}catch{}},[a,o]),u=s.useCallback(function(){try{localStorage.removeItem(a),o(void 0)}catch{}},[a,o]);return[p,C,u]};const fe=ue,de=({id:a,tagList:n,onChange:r,preview:O})=>{const[g,x]=s.useState(""),p=s.useRef(null),[o,C]=fe("TAG_PRIORITIES",{}),[u,i]=s.useState(!1),[f,c]=s.useState(null),[v,d]=s.useState(!1),[S,y]=Y(async()=>T.get("/api/tags"),[]);s.useLayoutEffect(()=>{var e;u&&((e=p.current)==null||e.focus())},[u]);const h=f||n,$=s.useMemo(()=>{var e;return((e=S.value)==null?void 0:e.filter(t=>!h.some(m=>m.id===t.id)).sort((t,m)=>(o[m.id]||0)-(o[t.id]||0)).filter(t=>t.name.indexOf(g)>-1).map(t=>({value:t.name})))??[]},[h,S.value,o,g]),A=async e=>{const t=await T.post("/api/tags",{data:{name:e}});return{name:e,id:t.id}},B=async(e,t)=>{C({...o,[t]:Date.now()});const m=await T.post(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},M=async(e,t)=>{const m=await T.delete(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},D=async()=>{if(!g){i(!1);return}const e=await A(g);if(a&&await B(a,e.id),g&&!h.some(t=>t.id===e.id)){const t=[...h,e];c(t),r&&r(t)}i(!1),x("")},k=async e=>{a&&await M(a,e.id);const t=h.filter(m=>m.id!==e.id);c(t),r&&r(t)},j=s.useCallback(async()=>{await y(),d(!v)},[]);return l.jsxs(l.Fragment,{children:[O?l.jsx("div",{onClick:j,children:h.length?h.map(e=>l.jsx(R,{style:{display:"inline-block",fontSize:"12px",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id)):l.jsx(w,{type:"dashed",icon:l.jsx(Z,{}),size:"small"})}):l.jsx(w,{title:"标签",icon:l.jsx(ce,{}),onClick:j}),l.jsx(F,{title:"标签管理",placement:"right",onClose:()=>d(!1),open:v,mask:!0,style:{marginTop:"64px",height:"calc(100vh - 64px)"},children:l.jsxs("div",{className:"score-tags",children:[l.jsx("div",{className:"list",children:h.map(e=>l.jsx(R,{closable:!0,onClose:()=>k(e),style:{display:"inline-block",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id))}),u&&l.jsx(oe,{ref:p,size:"small",backfill:!0,options:$,style:{width:100},onChange:e=>{x(e)},placeholder:"输入",onBlur:()=>D(),onSelect:()=>{setTimeout(()=>{var e;(e=p.current)==null||e.blur()},0)},onKeyDown:e=>{e.key==="Enter"&&p.current.blur()}}),!u&&l.jsx(w,{className:"site-tag-plus",size:"small",onClick:()=>i(!0),children:l.jsx(Q,{})})]})})]})},ye=de;export{oe as A,Ce as P,ye as S,ce as T,fe as u};
|
dist/assets/Tags-d90bdcf5.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{A as L,g as E,V as b,a as J,W as G,X as H,o as X,c as q,f as K,r as T}from"./_setToString-2991057b.js";import{r as s,_ as U,j as l}from"./umi-d55575d8.js";import{t as W,B as w}from"./button-95279f00.js";import{S as z,T as R,D as F,a as Q}from"./useDebounce-e3ca8075.js";import{i as V,n as _,E as Y}from"./index-ef09616c.js";var Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const ee=Z;var te=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:ee}))},se=s.forwardRef(te);const xe=se;var ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 000 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM459.7 834.7L189.3 564.3 589 164.6 836 188l23.4 247-399.7 399.7zM680 256c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm0 120c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]},name:"tag",theme:"outlined"};const re=ae;var ne=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:re}))},ie=s.forwardRef(ne);const ce=ie;var N=z.Option;function I(a){return a&&a.type&&(a.type.isSelectOption||a.type.isSelectOptGroup)}var le=function(n,r){var C=n.prefixCls,g=n.className,x=n.popupClassName,p=n.dropdownClassName,o=n.children,O=n.dataSource,u=W(o),i;if(u.length===1&&b(u[0])&&!I(u[0])){var f=J(u,1);i=f[0]}var c=i?function(){return i}:void 0,v;return u.length&&I(u[0])?v=o:v=O?O.map(function(d){if(b(d))return d;switch(G(d)){case"string":return s.createElement(N,{key:d,value:d},d);case"object":{var S=d.value;return s.createElement(N,{key:S,value:S},d.text)}default:return}}):[],s.createElement(H,null,function(d){var S=d.getPrefixCls,y=S("select",C);return s.createElement(z,U({ref:r},X(n,["dataSource"]),{prefixCls:y,popupClassName:x||p,className:q("".concat(y,"-auto-complete"),g),mode:z.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:c}),v)})},$=s.forwardRef(le);$.Option=N;const oe=$;var ue=function(a,n,r){if(!V)return[n,_,_];if(!a)throw new Error("useLocalStorage key may not be falsy");var C=r?r.raw?function(i){return i}:r.deserializer:JSON.parse,g=s.useRef(function(i){try{var f=r?r.raw?String:r.serializer:JSON.stringify,c=localStorage.getItem(i);return c!==null?C(c):(n&&localStorage.setItem(i,f(n)),n)}catch{return n}}),x=s.useState(function(){return g.current(a)}),p=x[0],o=x[1];s.useLayoutEffect(function(){return o(g.current(a))},[a]);var O=s.useCallback(function(i){try{var f=typeof i=="function"?i(p):i;if(typeof f>"u")return;var c=void 0;r?r.raw?typeof f=="string"?c=f:c=JSON.stringify(f):r.serializer?c=r.serializer(f):c=JSON.stringify(f):c=JSON.stringify(f),localStorage.setItem(a,c),o(C(c))}catch{}},[a,o]),u=s.useCallback(function(){try{localStorage.removeItem(a),o(void 0)}catch{}},[a,o]);return[p,O,u]};const fe=ue,de=({id:a,tagList:n,onChange:r,preview:C})=>{const[g,x]=s.useState(""),p=s.useRef(null),[o,O]=fe("TAG_PRIORITIES",{}),[u,i]=s.useState(!1),[f,c]=s.useState(null),[v,d]=s.useState(!1),[S,y]=K(async()=>T.get("/api/tags"),[]);s.useLayoutEffect(()=>{var e;u&&((e=p.current)==null||e.focus())},[u]);const h=f||n,A=s.useMemo(()=>{var e;return((e=S.value)==null?void 0:e.filter(t=>!h.some(m=>m.id===t.id)).sort((t,m)=>(o[m.id]||0)-(o[t.id]||0)).filter(t=>t.name.indexOf(g)>-1).map(t=>({value:t.name})))??[]},[h,S.value,o,g]),P=async e=>{const t=await T.post("/api/tags",{data:{name:e}});return{name:e,id:t.id}},B=async(e,t)=>{O({...o,[t]:Date.now()});const m=await T.post(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},M=async(e,t)=>{const m=await T.delete(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},D=async()=>{if(!g){i(!1);return}const e=await P(g);if(a&&await B(a,e.id),g&&!h.some(t=>t.id===e.id)){const t=[...h,e];c(t),r&&r(t)}i(!1),x("")},k=async e=>{a&&await M(a,e.id);const t=h.filter(m=>m.id!==e.id);c(t),r&&r(t)},j=s.useCallback(async()=>{await y(),d(!v)},[]);return l.jsxs(l.Fragment,{children:[C?l.jsx("div",{onClick:j,children:h.length?h.map(e=>l.jsx(R,{style:{display:"inline-block",fontSize:"12px",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id)):l.jsx(w,{type:"dashed",icon:l.jsx(Y,{}),size:"small"})}):l.jsx(w,{title:"标签",icon:l.jsx(ce,{}),onClick:j}),l.jsx(F,{title:"标签管理",placement:"right",onClose:()=>d(!1),open:v,mask:!0,style:{marginTop:"64px",height:"calc(100vh - 64px)"},children:l.jsxs("div",{className:"score-tags",children:[l.jsx("div",{className:"list",children:h.map(e=>l.jsx(R,{closable:!0,onClose:()=>k(e),style:{display:"inline-block",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id))}),u&&l.jsx(oe,{ref:p,size:"small",backfill:!0,options:A,style:{width:100},onChange:e=>{x(e)},placeholder:"输入",onBlur:()=>D(),onSelect:()=>{setTimeout(()=>{var e;(e=p.current)==null||e.blur()},0)},onKeyDown:e=>{e.key==="Enter"&&p.current.blur()}}),!u&&l.jsx(w,{className:"site-tag-plus",size:"small",onClick:()=>i(!0),children:l.jsx(Q,{})})]})})]})},Se=de;export{oe as A,xe as P,Se as S,ce as T,fe as u};
|
|
|
|
|
|
dist/assets/_setToString-038b76d7.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/_setToString-2991057b.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{button-95279f00.js → button-eb671c5b.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{R as S,r as i,_ as O}from"./umi-
|
| 2 |
[`.concat(b(""),"-click-animating-without-extra-node='true']::after, .").concat(b(""),`-click-animating-node {
|
| 3 |
--antd-wave-shadow-color: `).concat(r,`;
|
| 4 |
-
}`),"antd-wave",{csp:n.csp,attachTo:f})}l&&e.appendChild(g),["transition","animation"].forEach(function(m){e.addEventListener("".concat(m,"start"),n.onTransitionStart),e.addEventListener("".concat(m,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(e){if(!n.destroyed){var r=n.containerRef.current;!e||e.target!==r||n.animationStart||n.resetEffect(r)}},n.onTransitionEnd=function(e){!e||e.animationName!=="fadeEffect"||n.resetEffect(e.target)},n.bindAnimationEvent=function(e){if(!(!e||!e.getAttribute||e.getAttribute("disabled")||e.className.includes("disabled"))){var r=function(c){if(!(c.target.tagName==="INPUT"||Ce(c.target))){n.resetEffect(e);var s=getComputedStyle(e).getPropertyValue("border-top-color")||getComputedStyle(e).getPropertyValue("border-color")||getComputedStyle(e).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(e,s)},0),z.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=z(function(){n.animationStart=!1},10)}};return e.addEventListener("click",r,!0),{cancel:function(){e.removeEventListener("click",r,!0)}}}},n.renderWave=function(e){var r=e.csp,o=n.props.children;if(n.csp=r,!i.isValidElement(o))return o;var c=n.containerRef;return Be(o)&&(c=Fe(o.ref,n.containerRef)),be(o,{ref:c})},n}return Me(t,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;!e||e.nodeType!==1||(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,r=this.props.insertExtraNode;return r?"".concat(e(""),"-click-animating"):"".concat(e(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var r=this;if(!(!e||e===this.extraNode||!(e instanceof Element))){var o=this.props.insertExtraNode,c=this.getAttributeName();e.setAttribute(c,"false"),F&&(F.innerHTML=""),o&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach(function(s){e.removeEventListener("".concat(s,"start"),r.onTransitionStart),e.removeEventListener("".concat(s,"end"),r.onTransitionEnd)})}}},{key:"render",value:function(){return i.createElement(Ge,null,this.renderWave)}}]),t}(i.Component);xe.contextType=w;const it=xe;var ot=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},Ne=i.createContext(void 0),ct=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.prefixCls,c=t.size,s=t.className,l=ot(t,["prefixCls","size","className"]),v=e("btn-group",o),p="";switch(c){case"large":p="lg";break;case"small":p="sm";break}var g=R(v,u(u({},"".concat(v,"-").concat(p),p),"".concat(v,"-rtl"),r==="rtl"),s);return i.createElement(Ne.Provider,{value:c},i.createElement("div",O({},l,{className:g})))};const st=ct;var M=function(){return{width:0,opacity:0,transform:"scale(0)"}},G=function(t){return{width:t.scrollWidth,opacity:1,transform:"scale(1)"}},lt=function(t){var n=t.prefixCls,e=t.loading,r=t.existIcon,o=!!e;return r?S.createElement("span",{className:"".concat(n,"-loading-icon")},S.createElement(pe,null)):S.createElement(He,{visible:o,motionName:"".concat(n,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:M,onAppearActive:G,onEnterStart:M,onEnterActive:G,onLeaveStart:G,onLeaveActive:M},function(c,s){var l=c.className,v=c.style;return S.createElement("span",{className:"".concat(n,"-loading-icon"),style:v,ref:s},S.createElement(pe,{className:l}))})};const ut=lt;var ft=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},he=/^[\u4e00-\u9fa5]{2}$/,
|
|
|
|
| 1 |
+
import{R as S,r as i,_ as O}from"./umi-2135699e.js";import{bK as $e,C as w,c as R,b as u,w as V,V as Ae,U as We,Y as De,bH as je,ak as Be,a1 as Fe,e as be,T as Me,P as Ge,W as ve,X as Ue,aY as Ve,L as pe,d as He,ae as K,a9 as Ye,aa as Ke,a as ge,o as Xe,O as qe,bG as Je}from"./_setToString-038b76d7.js";function H(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return S.Children.forEach(a,function(e){e==null&&!t.keepEmpty||(Array.isArray(e)?n=n.concat(H(e)):$e(e)&&e.props?n=n.concat(H(e.props.children,t)):n.push(e))}),n}var ye=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},L=i.createContext(null),Qe=function(t,n){var e=i.useContext(L),r=i.useMemo(function(){if(!e)return"";var o=e.compactDirection,c=e.isFirstItem,s=e.isLastItem,l=o==="vertical"?"-vertical-":"-";return R(u(u(u(u({},"".concat(t,"-compact").concat(l,"item"),!0),"".concat(t,"-compact").concat(l,"first-item"),c),"".concat(t,"-compact").concat(l,"last-item"),s),"".concat(t,"-compact").concat(l,"item-rtl"),n==="rtl"))},[t,n,e]);return{compactSize:e==null?void 0:e.compactSize,compactDirection:e==null?void 0:e.compactDirection,compactItemClassnames:r}},ht=function(t){var n=t.children;return i.createElement(L.Provider,{value:null},n)},Ze=function(t){var n=t.children,e=ye(t,["children"]);return i.createElement(L.Provider,{value:e},n)},et=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.size,c=o===void 0?"middle":o,s=t.direction,l=t.block,v=t.prefixCls,p=t.className,g=t.children,b=ye(t,["size","direction","block","prefixCls","className","children"]),C=e("space-compact",v),x=R(C,u(u(u({},"".concat(C,"-rtl"),r==="rtl"),"".concat(C,"-block"),l),"".concat(C,"-vertical"),s==="vertical"),p),f=i.useContext(L),m=H(g),I=i.useMemo(function(){return m.map(function(T,N){var $=T&&T.key||"".concat(C,"-item-").concat(N);return i.createElement(Ze,{key:$,compactSize:c,compactDirection:s,isFirstItem:N===0&&(!f||(f==null?void 0:f.isFirstItem)),isLastItem:N===m.length-1&&(!f||(f==null?void 0:f.isLastItem))},T)})},[c,m,f]);return m.length===0?null:i.createElement("div",O({className:x},b),I)};const bt=et;var tt=0,k={};function z(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=tt++,e=t;function r(){e-=1,e<=0?(a(),delete k[n]):k[n]=V(r)}return k[n]=V(r),n}z.cancel=function(t){t!==void 0&&(V.cancel(k[t]),delete k[t])};z.ids=k;function nt(a,t,n){return t=ve(t),Ue(a,Ve()?Reflect.construct(t,n||[],ve(a).constructor):t.apply(a,n))}var F;function Ce(a){return!a||a.offsetParent===null||a.hidden}function at(a){return a instanceof Document?a.body:Array.from(a.childNodes).find(function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE})}function rt(a){var t=(a||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}var xe=function(a){Ae(t,a);function t(){var n;return We(this,t),n=nt(this,t,arguments),n.containerRef=i.createRef(),n.animationStart=!1,n.destroyed=!1,n.onClick=function(e,r){var o,c,s=n.props,l=s.insertExtraNode,v=s.disabled;if(!(v||!e||Ce(e)||e.className.includes("-leave"))){n.extraNode=document.createElement("div");var p=De(n),g=p.extraNode,b=n.context.getPrefixCls;g.className="".concat(b(""),"-click-animating-node");var C=n.getAttributeName();if(e.setAttribute(C,"true"),r&&r!=="#fff"&&r!=="#ffffff"&&r!=="rgb(255, 255, 255)"&&r!=="rgba(255, 255, 255, 1)"&&rt(r)&&!/rgba\((?:\d*, ){3}0\)/.test(r)&&r!=="transparent"){g.style.borderColor=r;var x=((o=e.getRootNode)===null||o===void 0?void 0:o.call(e))||e.ownerDocument,f=(c=at(x))!==null&&c!==void 0?c:x;F=je(`
|
| 2 |
[`.concat(b(""),"-click-animating-without-extra-node='true']::after, .").concat(b(""),`-click-animating-node {
|
| 3 |
--antd-wave-shadow-color: `).concat(r,`;
|
| 4 |
+
}`),"antd-wave",{csp:n.csp,attachTo:f})}l&&e.appendChild(g),["transition","animation"].forEach(function(m){e.addEventListener("".concat(m,"start"),n.onTransitionStart),e.addEventListener("".concat(m,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(e){if(!n.destroyed){var r=n.containerRef.current;!e||e.target!==r||n.animationStart||n.resetEffect(r)}},n.onTransitionEnd=function(e){!e||e.animationName!=="fadeEffect"||n.resetEffect(e.target)},n.bindAnimationEvent=function(e){if(!(!e||!e.getAttribute||e.getAttribute("disabled")||e.className.includes("disabled"))){var r=function(c){if(!(c.target.tagName==="INPUT"||Ce(c.target))){n.resetEffect(e);var s=getComputedStyle(e).getPropertyValue("border-top-color")||getComputedStyle(e).getPropertyValue("border-color")||getComputedStyle(e).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(e,s)},0),z.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=z(function(){n.animationStart=!1},10)}};return e.addEventListener("click",r,!0),{cancel:function(){e.removeEventListener("click",r,!0)}}}},n.renderWave=function(e){var r=e.csp,o=n.props.children;if(n.csp=r,!i.isValidElement(o))return o;var c=n.containerRef;return Be(o)&&(c=Fe(o.ref,n.containerRef)),be(o,{ref:c})},n}return Me(t,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;!e||e.nodeType!==1||(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,r=this.props.insertExtraNode;return r?"".concat(e(""),"-click-animating"):"".concat(e(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var r=this;if(!(!e||e===this.extraNode||!(e instanceof Element))){var o=this.props.insertExtraNode,c=this.getAttributeName();e.setAttribute(c,"false"),F&&(F.innerHTML=""),o&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach(function(s){e.removeEventListener("".concat(s,"start"),r.onTransitionStart),e.removeEventListener("".concat(s,"end"),r.onTransitionEnd)})}}},{key:"render",value:function(){return i.createElement(Ge,null,this.renderWave)}}]),t}(i.Component);xe.contextType=w;const it=xe;var ot=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},Ne=i.createContext(void 0),ct=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.prefixCls,c=t.size,s=t.className,l=ot(t,["prefixCls","size","className"]),v=e("btn-group",o),p="";switch(c){case"large":p="lg";break;case"small":p="sm";break}var g=R(v,u(u({},"".concat(v,"-").concat(p),p),"".concat(v,"-rtl"),r==="rtl"),s);return i.createElement(Ne.Provider,{value:c},i.createElement("div",O({},l,{className:g})))};const st=ct;var M=function(){return{width:0,opacity:0,transform:"scale(0)"}},G=function(t){return{width:t.scrollWidth,opacity:1,transform:"scale(1)"}},lt=function(t){var n=t.prefixCls,e=t.loading,r=t.existIcon,o=!!e;return r?S.createElement("span",{className:"".concat(n,"-loading-icon")},S.createElement(pe,null)):S.createElement(He,{visible:o,motionName:"".concat(n,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:M,onAppearActive:G,onEnterStart:M,onEnterActive:G,onLeaveStart:G,onLeaveActive:M},function(c,s){var l=c.className,v=c.style;return S.createElement("span",{className:"".concat(n,"-loading-icon"),style:v,ref:s},S.createElement(pe,{className:l}))})};const ut=lt;var ft=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},he=/^[\u4e00-\u9fa5]{2}$/,Y=he.test.bind(he);function dt(a){return typeof a=="string"}function U(a){return a==="text"||a==="link"}function mt(a,t){if(a!=null){var n=t?" ":"";return typeof a!="string"&&typeof a!="number"&&dt(a.type)&&Y(a.props.children)?be(a,{children:a.props.children.split("").join(n)}):typeof a=="string"?Y(a)?i.createElement("span",null,a.split("").join(n)):i.createElement("span",null,a):Je(a)?i.createElement("span",null,a):a}}function vt(a,t){var n=!1,e=[];return i.Children.forEach(a,function(r){var o=qe(r),c=o==="string"||o==="number";if(n&&c){var s=e.length-1,l=e[s];e[s]="".concat(l).concat(r)}else e.push(r);n=c}),i.Children.map(e,function(r){return mt(r,t)})}K("default","primary","ghost","dashed","link","text");K("default","circle","round");K("submit","button","reset");function yt(a){return a==="danger"?{danger:!0}:{type:a}}var pt=function(t,n){var e,r=t.loading,o=r===void 0?!1:r,c=t.prefixCls,s=t.type,l=s===void 0?"default":s,v=t.danger,p=t.shape,g=p===void 0?"default":p,b=t.size,C=t.disabled,x=t.className,f=t.children,m=t.icon,I=t.ghost,T=I===void 0?!1:I,N=t.block,$=N===void 0?!1:N,q=t.htmlType,Ee=q===void 0?"button":q,J=ft(t,["loading","prefixCls","type","danger","shape","size","disabled","className","children","icon","ghost","block","htmlType"]),Se=i.useContext(Ye),ke=i.useContext(Ke),A=C??ke,Te=i.useContext(Ne),_e=i.useState(!!o),Q=ge(_e,2),y=Q[0],Z=Q[1],Ie=i.useState(!1),ee=ge(Ie,2),W=ee[0],te=ee[1],D=i.useContext(w),Pe=D.getPrefixCls,ne=D.autoInsertSpaceInButton,ae=D.direction,E=n||i.createRef(),re=function(){return i.Children.count(f)===1&&!m&&!U(l)},Oe=function(){if(!(!E||!E.current||ne===!1)){var P=E.current.textContent;re()&&Y(P)?W||te(!0):W&&te(!1)}},_=typeof o=="boolean"?o:(o==null?void 0:o.delay)||!0;i.useEffect(function(){var h=null;return typeof _=="number"?h=window.setTimeout(function(){h=null,Z(_)},_):Z(_),function(){h&&(window.clearTimeout(h),h=null)}},[_]),i.useEffect(Oe,[E]);var ie=function(P){var B=t.onClick;if(y||A){P.preventDefault();return}B==null||B(P)},d=Pe("btn",c),oe=ne!==!1,ce=Qe(d,ae),ze=ce.compactSize,we=ce.compactItemClassnames,Re={large:"lg",small:"sm",middle:void 0},se=ze||Te||b||Se,le=se&&Re[se]||"",Le=y?"loading":m,j=Xe(J,["navigate"]),ue=R(d,(e={},u(u(u(u(u(u(u(u(u(u(e,"".concat(d,"-").concat(g),g!=="default"&&g),"".concat(d,"-").concat(l),l),"".concat(d,"-").concat(le),le),"".concat(d,"-icon-only"),!f&&f!==0&&!!Le),"".concat(d,"-background-ghost"),T&&!U(l)),"".concat(d,"-loading"),y),"".concat(d,"-two-chinese-chars"),W&&oe&&!y),"".concat(d,"-block"),$),"".concat(d,"-dangerous"),!!v),"".concat(d,"-rtl"),ae==="rtl"),u(e,"".concat(d,"-disabled"),j.href!==void 0&&A)),we,x),fe=m&&!y?m:i.createElement(ut,{existIcon:!!m,prefixCls:d,loading:!!y}),de=f||f===0?vt(f,re()&&oe):null;if(j.href!==void 0)return i.createElement("a",O({},j,{className:ue,onClick:ie,ref:E}),fe,de);var me=i.createElement("button",O({},J,{type:Ee,className:ue,onClick:ie,disabled:A,ref:E}),fe,de);return U(l)?me:i.createElement(it,{disabled:!!y},me)},X=i.forwardRef(pt);X.Group=st;X.__ANT_BUTTON=!0;const xt=X;export{xt as B,bt as C,ht as N,it as W,yt as c,H as t,Qe as u};
|
dist/assets/confirm-345857b8.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/confirm-e4ccfd64.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{font-eb3b2c70.js → font-e9e03177.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e}from"./umi-d55575d8.js";const l={rests:[["rests-0","E000"],["rests-1","E001"],["rests-0o","E002"],["rests-1o","E003"],["rests-M3","E004"],["rests-M2","E005"],["rests-M1","E006"],["rests-M1o","E007"],["rests-2","E008"],["rests-2classical","E009"],["rests-2z","E00A"],["rests-3","E00B"],["rests-4","E00C"],["rests-5","E00D"],["rests-6","E00E"],["rests-7","E00F"],["rests-8","E010"],["rests-9","E011"],["rests-10","E012"],["rests-M3neomensural","E144"],["rests-M2neomensural","E145"],["rests-M1neomensural","E146"],["rests-0neomensural","E147"],["rests-1neomensural","E148"],["rests-2neomensural","E149"],["rests-3neomensural","E14A"],["rests-4neomensural","E14B"],["rests-M3mensural","E14C"],["rests-M2mensural","E14D"],["rests-M1mensural","E14E"],["rests-0mensural","E14F"],["rests-1mensural","E150"],["rests-2mensural","E151"],["rests-3mensural","E152"],["rests-4mensural","E153"]],accidentals:[["accidentals-sharp","E013"],["accidentals-sharp-arrowup","E014"],["accidentals-sharp-arrowdown","E015"],["accidentals-sharp-arrowboth","E016"],["accidentals-sharp-slashslash-stem","E017"],["accidentals-sharp-slashslashslash-stemstem","E018"],["accidentals-sharp-slashslashslash-stem","E019"],["accidentals-sharp-slash-stem","E01A"],["accidentals-sharp-slashslash-stemstemstem","E01B"],["accidentals-doublesharp","E01C"],["accidentals-natural","E01D"],["accidentals-natural-arrowup","E01E"],["accidentals-natural-arrowdown","E01F"],["accidentals-natural-arrowboth","E020"],["accidentals-flat","E021"],["accidentals-flat-arrowup","E022"],["accidentals-flat-arrowdown","E023"],["accidentals-flat-arrowboth","E024"],["accidentals-flat-slash","E025"],["accidentals-flat-slashslash","E026"],["accidentals-mirroredflat-flat","E027"],["accidentals-mirroredflat","E028"],["accidentals-mirroredflat-backslash","E029"],["accidentals-flatflat","E02A"],["accidentals-flatflat-slash","E02B"],["accidentals-rightparen","E02C"],["accidentals-leftparen","E02D"],["accidentals-medicaeaM1","E194"],["accidentals-vaticanaM1","E195"],["accidentals-vaticana0","E196"],["accidentals-mensural1","E197"],["accidentals-mensuralM1","E198"],["accidentals-hufnagelM1","E199"],["accidentals-kievan1","E19A"],["accidentals-kievanM1","E19B"]],arrowheads:[["arrowheads-open-01","E02E"],["arrowheads-open-0M1","E02F"],["arrowheads-open-11","E030"],["arrowheads-open-1M1","E031"],["arrowheads-close-01","E032"],["arrowheads-close-0M1","E033"],["arrowheads-close-11","E034"],["arrowheads-close-1M1","E035"]],dot:[["dot","E036"]],scripts:[["scripts-ufermata","E037"],["scripts-dfermata","E038"],["scripts-uhenzeshortfermata","E039"],["scripts-dhenzeshortfermata","E03A"],["scripts-uhenzelongfermata","E03B"],["scripts-dhenzelongfermata","E03C"],["scripts-ushortfermata","E03D"],["scripts-dshortfermata","E03E"],["scripts-uveryshortfermata","E03F"],["scripts-dveryshortfermata","E040"],["scripts-ulongfermata","E041"],["scripts-dlongfermata","E042"],["scripts-uverylongfermata","E043"],["scripts-dverylongfermata","E044"],["scripts-thumb","E045"],["scripts-sforzato","E046"],["scripts-espr","E047"],["scripts-staccato","E048"],["scripts-ustaccatissimo","E049"],["scripts-dstaccatissimo","E04A"],["scripts-tenuto","E04B"],["scripts-uportato","E04C"],["scripts-dportato","E04D"],["scripts-umarcato","E04E"],["scripts-dmarcato","E04F"],["scripts-open","E050"],["scripts-halfopen","E051"],["scripts-halfopenvertical","E052"],["scripts-stopped","E053"],["scripts-upbow","E054"],["scripts-downbow","E055"],["scripts-reverseturn","E056"],["scripts-turn","E057"],["scripts-slashturn","E058"],["scripts-haydnturn","E059"],["scripts-trill","E05A"],["scripts-upedalheel","E05B"],["scripts-dpedalheel","E05C"],["scripts-upedaltoe","E05D"],["scripts-dpedaltoe","E05E"],["scripts-flageolet","E05F"],["scripts-segno","E060"],["scripts-varsegno","E061"],["scripts-coda","E062"],["scripts-varcoda","E063"],["scripts-rcomma","E064"],["scripts-lcomma","E065"],["scripts-rvarcomma","E066"],["scripts-lvarcomma","E067"],["scripts-arpeggio","E068"],["scripts-trill_element","E069"],["scripts-arpeggio-arrow-M1","E06A"],["scripts-arpeggio-arrow-1","E06B"],["scripts-trillelement","E06C"],["scripts-prall","E06D"],["scripts-mordent","E06E"],["scripts-prallprall","E06F"],["scripts-prallmordent","E070"],["scripts-upprall","E071"],["scripts-upmordent","E072"],["scripts-prallup","E073"],["scripts-downprall","E074"],["scripts-downmordent","E075"],["scripts-pralldown","E076"],["scripts-lineprall","E077"],["scripts-caesura-curved","E078"],["scripts-caesura-straight","E079"],["scripts-tickmark","E07A"],["scripts-snappizzicato","E07B"],["scripts-ictus","E1CA"],["scripts-uaccentus","E1CB"],["scripts-daccentus","E1CC"],["scripts-usemicirculus","E1CD"],["scripts-dsemicirculus","E1CE"],["scripts-circulus","E1CF"],["scripts-augmentum","E1D0"],["scripts-usignumcongruentiae","E1D1"],["scripts-dsignumcongruentiae","E1D2"],["scripts-barline-kievan","E1D3"]],clefs:[["clefs-C","E07C"],["clefs-C_change","E07D"],["clefs-varC","E07E"],["clefs-varC_change","E07F"],["clefs-F","E080"],["clefs-F_change","E081"],["clefs-G","E082"],["clefs-G_change","E083"],["clefs-GG","E084"],["clefs-GG_change","E085"],["clefs-tenorG","E086"],["clefs-tenorG_change","E087"],["clefs-percussion","E088"],["clefs-percussion_change","E089"],["clefs-varpercussion","E08A"],["clefs-varpercussion_change","E08B"],["clefs-tab","E08C"],["clefs-tab_change","E08D"],["clefs-vaticana-do","E154"],["clefs-vaticana-do_change","E155"],["clefs-vaticana-fa","E156"],["clefs-vaticana-fa_change","E157"],["clefs-medicaea-do","E158"],["clefs-medicaea-do_change","E159"],["clefs-medicaea-fa","E15A"],["clefs-medicaea-fa_change","E15B"],["clefs-neomensural-c","E15C"],["clefs-neomensural-c_change","E15D"],["clefs-petrucci-c1","E15E"],["clefs-petrucci-c1_change","E15F"],["clefs-petrucci-c2","E160"],["clefs-petrucci-c2_change","E161"],["clefs-petrucci-c3","E162"],["clefs-petrucci-c3_change","E163"],["clefs-petrucci-c4","E164"],["clefs-petrucci-c4_change","E165"],["clefs-petrucci-c5","E166"],["clefs-petrucci-c5_change","E167"],["clefs-mensural-c","E168"],["clefs-mensural-c_change","E169"],["clefs-blackmensural-c","E16A"],["clefs-blackmensural-c_change","E16B"],["clefs-petrucci-f","E16C"],["clefs-petrucci-f_change","E16D"],["clefs-mensural-f","E16E"],["clefs-mensural-f_change","E16F"],["clefs-petrucci-g","E170"],["clefs-petrucci-g_change","E171"],["clefs-mensural-g","E172"],["clefs-mensural-g_change","E173"],["clefs-hufnagel-do","E174"],["clefs-hufnagel-do_change","E175"],["clefs-hufnagel-fa","E176"],["clefs-hufnagel-fa_change","E177"],["clefs-hufnagel-do-fa","E178"],["clefs-hufnagel-do-fa_change","E179"],["clefs-kievan-do","E17A"],["clefs-kievan-do_change","E17B"]],timesig:[["timesig-C44","E08E"],["timesig-C22","E08F"],["timesig-mensural44","E1B4"],["timesig-mensural22","E1B5"],["timesig-mensural32","E1B6"],["timesig-mensural64","E1B7"],["timesig-mensural94","E1B8"],["timesig-mensural34","E1B9"],["timesig-mensural68","E1BA"],["timesig-mensural98","E1BB"],["timesig-mensural48","E1BC"],["timesig-mensural68alt","E1BD"],["timesig-mensural24","E1BE"],["timesig-neomensural44","E1BF"],["timesig-neomensural22","E1C0"],["timesig-neomensural32","E1C1"],["timesig-neomensural64","E1C2"],["timesig-neomensural94","E1C3"],["timesig-neomensural34","E1C4"],["timesig-neomensural68","E1C5"],["timesig-neomensural98","E1C6"],["timesig-neomensural48","E1C7"],["timesig-neomensural68alt","E1C8"],["timesig-neomensural24","E1C9"]],pedal:[["pedal-star","E090"],["pedal-M","E091"],["pedal--","E092"],["pedal-P","E093"],["pedal-d","E094"],["pedal-e","E095"],["pedal-Ped","E096"]],brackettips:[["brackettips-up","E097"],["brackettips-down","E098"]],accordion:[["accordion-discant","E099"],["accordion-dot","E09A"],["accordion-freebass","E09B"],["accordion-stdbass","E09C"],["accordion-bayanbass","E09D"],["accordion-oldEE","E09E"],["accordion-push","E09F"],["accordion-pull","E0A0"]],ties:[["ties-lyric-short","E0A1"],["ties-lyric-default","E0A2"]],noteheads:[["noteheads-uM2","E0A3"],["noteheads-dM2","E0A4"],["noteheads-sM1","E0A5"],["noteheads-sM1double","E0A6"],["noteheads-s0","E0A7"],["noteheads-s1","E0A8"],["noteheads-s2","E0A9"],["noteheads-s0diamond","E0AA"],["noteheads-s1diamond","E0AB"],["noteheads-s2diamond","E0AC"],["noteheads-s0triangle","E0AD"],["noteheads-d1triangle","E0AE"],["noteheads-u1triangle","E0AF"],["noteheads-u2triangle","E0B0"],["noteheads-d2triangle","E0B1"],["noteheads-s0slash","E0B2"],["noteheads-s1slash","E0B3"],["noteheads-s2slash","E0B4"],["noteheads-s0cross","E0B5"],["noteheads-s1cross","E0B6"],["noteheads-s2cross","E0B7"],["noteheads-s2xcircle","E0B8"],["noteheads-s0do","E0B9"],["noteheads-d1do","E0BA"],["noteheads-u1do","E0BB"],["noteheads-d2do","E0BC"],["noteheads-u2do","E0BD"],["noteheads-s0doThin","E0BE"],["noteheads-d1doThin","E0BF"],["noteheads-u1doThin","E0C0"],["noteheads-d2doThin","E0C1"],["noteheads-u2doThin","E0C2"],["noteheads-s0re","E0C3"],["noteheads-u1re","E0C4"],["noteheads-d1re","E0C5"],["noteheads-u2re","E0C6"],["noteheads-d2re","E0C7"],["noteheads-s0reThin","E0C8"],["noteheads-u1reThin","E0C9"],["noteheads-d1reThin","E0CA"],["noteheads-u2reThin","E0CB"],["noteheads-d2reThin","E0CC"],["noteheads-s0mi","E0CD"],["noteheads-s1mi","E0CE"],["noteheads-s2mi","E0CF"],["noteheads-s0miMirror","E0D0"],["noteheads-s1miMirror","E0D1"],["noteheads-s2miMirror","E0D2"],["noteheads-s0miThin","E0D3"],["noteheads-s1miThin","E0D4"],["noteheads-s2miThin","E0D5"],["noteheads-u0fa","E0D6"],["noteheads-d0fa","E0D7"],["noteheads-u1fa","E0D8"],["noteheads-d1fa","E0D9"],["noteheads-u2fa","E0DA"],["noteheads-d2fa","E0DB"],["noteheads-u0faThin","E0DC"],["noteheads-d0faThin","E0DD"],["noteheads-u1faThin","E0DE"],["noteheads-d1faThin","E0DF"],["noteheads-u2faThin","E0E0"],["noteheads-d2faThin","E0E1"],["noteheads-s0sol","E0E2"],["noteheads-s1sol","E0E3"],["noteheads-s2sol","E0E4"],["noteheads-s0la","E0E5"],["noteheads-s1la","E0E6"],["noteheads-s2la","E0E7"],["noteheads-s0laThin","E0E8"],["noteheads-s1laThin","E0E9"],["noteheads-s2laThin","E0EA"],["noteheads-s0ti","E0EB"],["noteheads-u1ti","E0EC"],["noteheads-d1ti","E0ED"],["noteheads-u2ti","E0EE"],["noteheads-d2ti","E0EF"],["noteheads-s0tiThin","E0F0"],["noteheads-u1tiThin","E0F1"],["noteheads-d1tiThin","E0F2"],["noteheads-u2tiThin","E0F3"],["noteheads-d2tiThin","E0F4"],["noteheads-u0doFunk","E0F5"],["noteheads-d0doFunk","E0F6"],["noteheads-u1doFunk","E0F7"],["noteheads-d1doFunk","E0F8"],["noteheads-u2doFunk","E0F9"],["noteheads-d2doFunk","E0FA"],["noteheads-u0reFunk","E0FB"],["noteheads-d0reFunk","E0FC"],["noteheads-u1reFunk","E0FD"],["noteheads-d1reFunk","E0FE"],["noteheads-u2reFunk","E0FF"],["noteheads-d2reFunk","E100"],["noteheads-u0miFunk","E101"],["noteheads-d0miFunk","E102"],["noteheads-u1miFunk","E103"],["noteheads-d1miFunk","E104"],["noteheads-s2miFunk","E105"],["noteheads-u0faFunk","E106"],["noteheads-d0faFunk","E107"],["noteheads-u1faFunk","E108"],["noteheads-d1faFunk","E109"],["noteheads-u2faFunk","E10A"],["noteheads-d2faFunk","E10B"],["noteheads-s0solFunk","E10C"],["noteheads-s1solFunk","E10D"],["noteheads-s2solFunk","E10E"],["noteheads-s0laFunk","E10F"],["noteheads-s1laFunk","E110"],["noteheads-s2laFunk","E111"],["noteheads-u0tiFunk","E112"],["noteheads-d0tiFunk","E113"],["noteheads-u1tiFunk","E114"],["noteheads-d1tiFunk","E115"],["noteheads-u2tiFunk","E116"],["noteheads-d2tiFunk","E117"],["noteheads-s0doWalker","E118"],["noteheads-u1doWalker","E119"],["noteheads-d1doWalker","E11A"],["noteheads-u2doWalker","E11B"],["noteheads-d2doWalker","E11C"],["noteheads-s0reWalker","E11D"],["noteheads-u1reWalker","E11E"],["noteheads-d1reWalker","E11F"],["noteheads-u2reWalker","E120"],["noteheads-d2reWalker","E121"],["noteheads-s0miWalker","E122"],["noteheads-s1miWalker","E123"],["noteheads-s2miWalker","E124"],["noteheads-s0faWalker","E125"],["noteheads-u1faWalker","E126"],["noteheads-d1faWalker","E127"],["noteheads-u2faWalker","E128"],["noteheads-d2faWalker","E129"],["noteheads-s0laWalker","E12A"],["noteheads-s1laWalker","E12B"],["noteheads-s2laWalker","E12C"],["noteheads-s0tiWalker","E12D"],["noteheads-u1tiWalker","E12E"],["noteheads-d1tiWalker","E12F"],["noteheads-u2tiWalker","E130"],["noteheads-d2tiWalker","E131"],["noteheads-uM3neomensural","E1D6"],["noteheads-dM3neomensural","E1D7"],["noteheads-uM2neomensural","E1D8"],["noteheads-dM2neomensural","E1D9"],["noteheads-sM1neomensural","E1DA"],["noteheads-urM3neomensural","E1DB"],["noteheads-drM3neomensural","E1DC"],["noteheads-urM2neomensural","E1DD"],["noteheads-drM2neomensural","E1DE"],["noteheads-srM1neomensural","E1DF"],["noteheads-s0neomensural","E1E0"],["noteheads-s1neomensural","E1E1"],["noteheads-s2neomensural","E1E2"],["noteheads-s0harmonic","E1E3"],["noteheads-s2harmonic","E1E4"],["noteheads-uM3mensural","E1E5"],["noteheads-dM3mensural","E1E6"],["noteheads-sM3ligmensural","E1E7"],["noteheads-uM2mensural","E1E8"],["noteheads-dM2mensural","E1E9"],["noteheads-sM2ligmensural","E1EA"],["noteheads-sM1mensural","E1EB"],["noteheads-urM3mensural","E1EC"],["noteheads-drM3mensural","E1ED"],["noteheads-srM3ligmensural","E1EE"],["noteheads-urM2mensural","E1EF"],["noteheads-drM2mensural","E1F0"],["noteheads-srM2ligmensural","E1F1"],["noteheads-srM1mensural","E1F2"],["noteheads-uM3semimensural","E1F3"],["noteheads-dM3semimensural","E1F4"],["noteheads-sM3semiligmensural","E1F5"],["noteheads-uM2semimensural","E1F6"],["noteheads-dM2semimensural","E1F7"],["noteheads-sM2semiligmensural","E1F8"],["noteheads-sM1semimensural","E1F9"],["noteheads-urM3semimensural","E1FA"],["noteheads-drM3semimensural","E1FB"],["noteheads-srM3semiligmensural","E1FC"],["noteheads-urM2semimensural","E1FD"],["noteheads-drM2semimensural","E1FE"],["noteheads-srM2semiligmensural","E1FF"],["noteheads-srM1semimensural","E200"],["noteheads-uM3blackmensural","E201"],["noteheads-dM3blackmensural","E202"],["noteheads-sM3blackligmensural","E203"],["noteheads-uM2blackmensural","E204"],["noteheads-dM2blackmensural","E205"],["noteheads-sM2blackligmensural","E206"],["noteheads-sM1blackmensural","E207"],["noteheads-s0mensural","E208"],["noteheads-s1mensural","E209"],["noteheads-s2mensural","E20A"],["noteheads-s0blackmensural","E20B"],["noteheads-s0petrucci","E20C"],["noteheads-s1petrucci","E20D"],["noteheads-s2petrucci","E20E"],["noteheads-s0blackpetrucci","E20F"],["noteheads-s1blackpetrucci","E210"],["noteheads-s2blackpetrucci","E211"],["noteheads-svaticana-punctum","E212"],["noteheads-svaticana-punctum-cavum","E213"],["noteheads-svaticana-linea-punctum","E214"],["noteheads-svaticana-linea-punctum-cavum","E215"],["noteheads-svaticana-inclinatum","E216"],["noteheads-svaticana-lpes","E217"],["noteheads-svaticana-vlpes","E218"],["noteheads-svaticana-upes","E219"],["noteheads-svaticana-vupes","E21A"],["noteheads-svaticana-plica","E21B"],["noteheads-svaticana-vplica","E21C"],["noteheads-svaticana-epiphonus","E21D"],["noteheads-svaticana-vepiphonus","E21E"],["noteheads-svaticana-reverse-plica","E21F"],["noteheads-svaticana-reverse-vplica","E220"],["noteheads-svaticana-inner-cephalicus","E221"],["noteheads-svaticana-cephalicus","E222"],["noteheads-svaticana-quilisma","E223"],["noteheads-ssolesmes-incl-parvum","E224"],["noteheads-ssolesmes-auct-asc","E225"],["noteheads-ssolesmes-auct-desc","E226"],["noteheads-ssolesmes-incl-auctum","E227"],["noteheads-ssolesmes-stropha","E228"],["noteheads-ssolesmes-stropha-aucta","E229"],["noteheads-ssolesmes-oriscus","E22A"],["noteheads-smedicaea-inclinatum","E22B"],["noteheads-smedicaea-punctum","E22C"],["noteheads-smedicaea-rvirga","E22D"],["noteheads-smedicaea-virga","E22E"],["noteheads-shufnagel-punctum","E22F"],["noteheads-shufnagel-virga","E230"],["noteheads-shufnagel-lpes","E231"],["noteheads-sM2kievan","E232"],["noteheads-sM1kievan","E233"],["noteheads-s0kievan","E234"],["noteheads-d2kievan","E235"],["noteheads-u2kievan","E236"],["noteheads-s1kievan","E237"],["noteheads-sr1kievan","E238"],["noteheads-d3kievan","E239"],["noteheads-u3kievan","E23A"]],flags:[["flags-u3","E132"],["flags-u4","E133"],["flags-u5","E134"],["flags-u6","E135"],["flags-u7","E136"],["flags-u8","E137"],["flags-u9","E138"],["flags-u10","E139"],["flags-d3","E13A"],["flags-d4","E13B"],["flags-d5","E13C"],["flags-d6","E13D"],["flags-d7","E13E"],["flags-d8","E13F"],["flags-d9","E140"],["flags-d10","E141"],["flags-ugrace","E142"],["flags-dgrace","E143"],["flags-mensuralu03","E19C"],["flags-mensuralu13","E19D"],["flags-mensuralu23","E19E"],["flags-mensurald03","E19F"],["flags-mensurald13","E1A0"],["flags-mensurald23","E1A1"],["flags-mensuralu04","E1A2"],["flags-mensuralu14","E1A3"],["flags-mensuralu24","E1A4"],["flags-mensurald04","E1A5"],["flags-mensurald14","E1A6"],["flags-mensurald24","E1A7"],["flags-mensuralu05","E1A8"],["flags-mensuralu15","E1A9"],["flags-mensuralu25","E1AA"],["flags-mensurald05","E1AB"],["flags-mensurald15","E1AC"],["flags-mensurald25","E1AD"],["flags-mensuralu06","E1AE"],["flags-mensuralu16","E1AF"],["flags-mensuralu26","E1B0"],["flags-mensurald06","E1B1"],["flags-mensurald16","E1B2"],["flags-mensurald26","E1B3"]],custodes:[["custodes-hufnagel-u0","E17C"],["custodes-hufnagel-u1","E17D"],["custodes-hufnagel-u2","E17E"],["custodes-hufnagel-d0","E17F"],["custodes-hufnagel-d1","E180"],["custodes-hufnagel-d2","E181"],["custodes-medicaea-u0","E182"],["custodes-medicaea-u1","E183"],["custodes-medicaea-u2","E184"],["custodes-medicaea-d0","E185"],["custodes-medicaea-d1","E186"],["custodes-medicaea-d2","E187"],["custodes-vaticana-u0","E188"],["custodes-vaticana-u1","E189"],["custodes-vaticana-u2","E18A"],["custodes-vaticana-d0","E18B"],["custodes-vaticana-d1","E18C"],["custodes-vaticana-d2","E18D"],["custodes-mensural-u0","E18E"],["custodes-mensural-u1","E18F"],["custodes-mensural-u2","E190"],["custodes-mensural-d0","E191"],["custodes-mensural-d1","E192"],["custodes-mensural-d2","E193"]],dots:[["dots-dotvaticana","E1D4"],["dots-dotkievan","E1D5"]]},i={rests:"Rests",accidentals:"Accidentals",arrowheads:"Arrowheads",dot:"Dot",scripts:"Scripts & Articulations",clefs:"Clefs",timesig:"Time Signatures",pedal:"Pedal",brackettips:"Bracket Tips",accordion:"Accordion",ties:"Ties",noteheads:"Noteheads",flags:"Flags",custodes:"Custodes",dots:"Dots"};function f(){const[o,u]=d.useState(!1),[E,h]=d.useState(""),[r,m]=d.useState(40);d.useEffect(()=>{document.fonts.ready.then(()=>{u(document.fonts.check("40px Emmentaler-26"))})},[]);const c=Object.keys(l);return e.jsxs("div",{className:"font-test-page",children:[e.jsxs("div",{className:"font-test-header",children:[e.jsx("h1",{children:"Emmentaler-26 Font Glyphs"}),e.jsxs("div",{className:"font-test-status",children:["Font status: ",e.jsx("span",{className:o?"loaded":"not-loaded",children:o?"Loaded":"Not loaded"}),e.jsxs("span",{className:"glyph-count",children:[Object.values(l).reduce((s,n)=>s+n.length,0)," glyphs"]})]}),e.jsxs("div",{className:"font-test-controls",children:[e.jsx("input",{type:"text",placeholder:"Filter glyphs...",value:E,onChange:s=>h(s.target.value)}),e.jsxs("label",{children:["Size:",e.jsx("input",{type:"range",min:20,max:80,value:r,onChange:s=>m(Number(s.target.value))}),r,"px"]})]}),e.jsx("div",{className:"font-test-toc",children:c.map(s=>e.jsxs("a",{href:`#cat-${s}`,children:[i[s]||s," (",l[s].length,")"]},s))})]}),c.map(s=>{const n=l[s].filter(([a,t])=>!E||a.toLowerCase().includes(E.toLowerCase())||t.toLowerCase().includes(E.toLowerCase()));return n.length===0?null:e.jsxs("div",{id:`cat-${s}`,className:"font-test-category",children:[e.jsxs("h2",{children:[i[s]||s," ",e.jsxs("span",{children:["(",n.length,")"]})]}),e.jsx("div",{className:"glyph-grid",children:n.map(([a,t])=>e.jsxs("div",{className:"glyph-cell",title:a,children:[e.jsx("div",{className:"glyph-render",style:{fontSize:r},children:e.jsx("i",{className:`emmentaler glyph-${a}`})}),e.jsx("div",{className:"glyph-unicode",style:{fontSize:r},children:String.fromCodePoint(parseInt(t,16))}),e.jsx("div",{className:"glyph-name",children:a}),e.jsxs("div",{className:"glyph-code",children:["U+",t]})]},`${a}-${t}`))})]},s)})]})}export{f as default};
|
|
|
|
| 1 |
+
import{r as d,j as e}from"./umi-2135699e.js";const l={rests:[["rests-0","E000"],["rests-1","E001"],["rests-0o","E002"],["rests-1o","E003"],["rests-M3","E004"],["rests-M2","E005"],["rests-M1","E006"],["rests-M1o","E007"],["rests-2","E008"],["rests-2classical","E009"],["rests-2z","E00A"],["rests-3","E00B"],["rests-4","E00C"],["rests-5","E00D"],["rests-6","E00E"],["rests-7","E00F"],["rests-8","E010"],["rests-9","E011"],["rests-10","E012"],["rests-M3neomensural","E144"],["rests-M2neomensural","E145"],["rests-M1neomensural","E146"],["rests-0neomensural","E147"],["rests-1neomensural","E148"],["rests-2neomensural","E149"],["rests-3neomensural","E14A"],["rests-4neomensural","E14B"],["rests-M3mensural","E14C"],["rests-M2mensural","E14D"],["rests-M1mensural","E14E"],["rests-0mensural","E14F"],["rests-1mensural","E150"],["rests-2mensural","E151"],["rests-3mensural","E152"],["rests-4mensural","E153"]],accidentals:[["accidentals-sharp","E013"],["accidentals-sharp-arrowup","E014"],["accidentals-sharp-arrowdown","E015"],["accidentals-sharp-arrowboth","E016"],["accidentals-sharp-slashslash-stem","E017"],["accidentals-sharp-slashslashslash-stemstem","E018"],["accidentals-sharp-slashslashslash-stem","E019"],["accidentals-sharp-slash-stem","E01A"],["accidentals-sharp-slashslash-stemstemstem","E01B"],["accidentals-doublesharp","E01C"],["accidentals-natural","E01D"],["accidentals-natural-arrowup","E01E"],["accidentals-natural-arrowdown","E01F"],["accidentals-natural-arrowboth","E020"],["accidentals-flat","E021"],["accidentals-flat-arrowup","E022"],["accidentals-flat-arrowdown","E023"],["accidentals-flat-arrowboth","E024"],["accidentals-flat-slash","E025"],["accidentals-flat-slashslash","E026"],["accidentals-mirroredflat-flat","E027"],["accidentals-mirroredflat","E028"],["accidentals-mirroredflat-backslash","E029"],["accidentals-flatflat","E02A"],["accidentals-flatflat-slash","E02B"],["accidentals-rightparen","E02C"],["accidentals-leftparen","E02D"],["accidentals-medicaeaM1","E194"],["accidentals-vaticanaM1","E195"],["accidentals-vaticana0","E196"],["accidentals-mensural1","E197"],["accidentals-mensuralM1","E198"],["accidentals-hufnagelM1","E199"],["accidentals-kievan1","E19A"],["accidentals-kievanM1","E19B"]],arrowheads:[["arrowheads-open-01","E02E"],["arrowheads-open-0M1","E02F"],["arrowheads-open-11","E030"],["arrowheads-open-1M1","E031"],["arrowheads-close-01","E032"],["arrowheads-close-0M1","E033"],["arrowheads-close-11","E034"],["arrowheads-close-1M1","E035"]],dot:[["dot","E036"]],scripts:[["scripts-ufermata","E037"],["scripts-dfermata","E038"],["scripts-uhenzeshortfermata","E039"],["scripts-dhenzeshortfermata","E03A"],["scripts-uhenzelongfermata","E03B"],["scripts-dhenzelongfermata","E03C"],["scripts-ushortfermata","E03D"],["scripts-dshortfermata","E03E"],["scripts-uveryshortfermata","E03F"],["scripts-dveryshortfermata","E040"],["scripts-ulongfermata","E041"],["scripts-dlongfermata","E042"],["scripts-uverylongfermata","E043"],["scripts-dverylongfermata","E044"],["scripts-thumb","E045"],["scripts-sforzato","E046"],["scripts-espr","E047"],["scripts-staccato","E048"],["scripts-ustaccatissimo","E049"],["scripts-dstaccatissimo","E04A"],["scripts-tenuto","E04B"],["scripts-uportato","E04C"],["scripts-dportato","E04D"],["scripts-umarcato","E04E"],["scripts-dmarcato","E04F"],["scripts-open","E050"],["scripts-halfopen","E051"],["scripts-halfopenvertical","E052"],["scripts-stopped","E053"],["scripts-upbow","E054"],["scripts-downbow","E055"],["scripts-reverseturn","E056"],["scripts-turn","E057"],["scripts-slashturn","E058"],["scripts-haydnturn","E059"],["scripts-trill","E05A"],["scripts-upedalheel","E05B"],["scripts-dpedalheel","E05C"],["scripts-upedaltoe","E05D"],["scripts-dpedaltoe","E05E"],["scripts-flageolet","E05F"],["scripts-segno","E060"],["scripts-varsegno","E061"],["scripts-coda","E062"],["scripts-varcoda","E063"],["scripts-rcomma","E064"],["scripts-lcomma","E065"],["scripts-rvarcomma","E066"],["scripts-lvarcomma","E067"],["scripts-arpeggio","E068"],["scripts-trill_element","E069"],["scripts-arpeggio-arrow-M1","E06A"],["scripts-arpeggio-arrow-1","E06B"],["scripts-trillelement","E06C"],["scripts-prall","E06D"],["scripts-mordent","E06E"],["scripts-prallprall","E06F"],["scripts-prallmordent","E070"],["scripts-upprall","E071"],["scripts-upmordent","E072"],["scripts-prallup","E073"],["scripts-downprall","E074"],["scripts-downmordent","E075"],["scripts-pralldown","E076"],["scripts-lineprall","E077"],["scripts-caesura-curved","E078"],["scripts-caesura-straight","E079"],["scripts-tickmark","E07A"],["scripts-snappizzicato","E07B"],["scripts-ictus","E1CA"],["scripts-uaccentus","E1CB"],["scripts-daccentus","E1CC"],["scripts-usemicirculus","E1CD"],["scripts-dsemicirculus","E1CE"],["scripts-circulus","E1CF"],["scripts-augmentum","E1D0"],["scripts-usignumcongruentiae","E1D1"],["scripts-dsignumcongruentiae","E1D2"],["scripts-barline-kievan","E1D3"]],clefs:[["clefs-C","E07C"],["clefs-C_change","E07D"],["clefs-varC","E07E"],["clefs-varC_change","E07F"],["clefs-F","E080"],["clefs-F_change","E081"],["clefs-G","E082"],["clefs-G_change","E083"],["clefs-GG","E084"],["clefs-GG_change","E085"],["clefs-tenorG","E086"],["clefs-tenorG_change","E087"],["clefs-percussion","E088"],["clefs-percussion_change","E089"],["clefs-varpercussion","E08A"],["clefs-varpercussion_change","E08B"],["clefs-tab","E08C"],["clefs-tab_change","E08D"],["clefs-vaticana-do","E154"],["clefs-vaticana-do_change","E155"],["clefs-vaticana-fa","E156"],["clefs-vaticana-fa_change","E157"],["clefs-medicaea-do","E158"],["clefs-medicaea-do_change","E159"],["clefs-medicaea-fa","E15A"],["clefs-medicaea-fa_change","E15B"],["clefs-neomensural-c","E15C"],["clefs-neomensural-c_change","E15D"],["clefs-petrucci-c1","E15E"],["clefs-petrucci-c1_change","E15F"],["clefs-petrucci-c2","E160"],["clefs-petrucci-c2_change","E161"],["clefs-petrucci-c3","E162"],["clefs-petrucci-c3_change","E163"],["clefs-petrucci-c4","E164"],["clefs-petrucci-c4_change","E165"],["clefs-petrucci-c5","E166"],["clefs-petrucci-c5_change","E167"],["clefs-mensural-c","E168"],["clefs-mensural-c_change","E169"],["clefs-blackmensural-c","E16A"],["clefs-blackmensural-c_change","E16B"],["clefs-petrucci-f","E16C"],["clefs-petrucci-f_change","E16D"],["clefs-mensural-f","E16E"],["clefs-mensural-f_change","E16F"],["clefs-petrucci-g","E170"],["clefs-petrucci-g_change","E171"],["clefs-mensural-g","E172"],["clefs-mensural-g_change","E173"],["clefs-hufnagel-do","E174"],["clefs-hufnagel-do_change","E175"],["clefs-hufnagel-fa","E176"],["clefs-hufnagel-fa_change","E177"],["clefs-hufnagel-do-fa","E178"],["clefs-hufnagel-do-fa_change","E179"],["clefs-kievan-do","E17A"],["clefs-kievan-do_change","E17B"]],timesig:[["timesig-C44","E08E"],["timesig-C22","E08F"],["timesig-mensural44","E1B4"],["timesig-mensural22","E1B5"],["timesig-mensural32","E1B6"],["timesig-mensural64","E1B7"],["timesig-mensural94","E1B8"],["timesig-mensural34","E1B9"],["timesig-mensural68","E1BA"],["timesig-mensural98","E1BB"],["timesig-mensural48","E1BC"],["timesig-mensural68alt","E1BD"],["timesig-mensural24","E1BE"],["timesig-neomensural44","E1BF"],["timesig-neomensural22","E1C0"],["timesig-neomensural32","E1C1"],["timesig-neomensural64","E1C2"],["timesig-neomensural94","E1C3"],["timesig-neomensural34","E1C4"],["timesig-neomensural68","E1C5"],["timesig-neomensural98","E1C6"],["timesig-neomensural48","E1C7"],["timesig-neomensural68alt","E1C8"],["timesig-neomensural24","E1C9"]],pedal:[["pedal-star","E090"],["pedal-M","E091"],["pedal--","E092"],["pedal-P","E093"],["pedal-d","E094"],["pedal-e","E095"],["pedal-Ped","E096"]],brackettips:[["brackettips-up","E097"],["brackettips-down","E098"]],accordion:[["accordion-discant","E099"],["accordion-dot","E09A"],["accordion-freebass","E09B"],["accordion-stdbass","E09C"],["accordion-bayanbass","E09D"],["accordion-oldEE","E09E"],["accordion-push","E09F"],["accordion-pull","E0A0"]],ties:[["ties-lyric-short","E0A1"],["ties-lyric-default","E0A2"]],noteheads:[["noteheads-uM2","E0A3"],["noteheads-dM2","E0A4"],["noteheads-sM1","E0A5"],["noteheads-sM1double","E0A6"],["noteheads-s0","E0A7"],["noteheads-s1","E0A8"],["noteheads-s2","E0A9"],["noteheads-s0diamond","E0AA"],["noteheads-s1diamond","E0AB"],["noteheads-s2diamond","E0AC"],["noteheads-s0triangle","E0AD"],["noteheads-d1triangle","E0AE"],["noteheads-u1triangle","E0AF"],["noteheads-u2triangle","E0B0"],["noteheads-d2triangle","E0B1"],["noteheads-s0slash","E0B2"],["noteheads-s1slash","E0B3"],["noteheads-s2slash","E0B4"],["noteheads-s0cross","E0B5"],["noteheads-s1cross","E0B6"],["noteheads-s2cross","E0B7"],["noteheads-s2xcircle","E0B8"],["noteheads-s0do","E0B9"],["noteheads-d1do","E0BA"],["noteheads-u1do","E0BB"],["noteheads-d2do","E0BC"],["noteheads-u2do","E0BD"],["noteheads-s0doThin","E0BE"],["noteheads-d1doThin","E0BF"],["noteheads-u1doThin","E0C0"],["noteheads-d2doThin","E0C1"],["noteheads-u2doThin","E0C2"],["noteheads-s0re","E0C3"],["noteheads-u1re","E0C4"],["noteheads-d1re","E0C5"],["noteheads-u2re","E0C6"],["noteheads-d2re","E0C7"],["noteheads-s0reThin","E0C8"],["noteheads-u1reThin","E0C9"],["noteheads-d1reThin","E0CA"],["noteheads-u2reThin","E0CB"],["noteheads-d2reThin","E0CC"],["noteheads-s0mi","E0CD"],["noteheads-s1mi","E0CE"],["noteheads-s2mi","E0CF"],["noteheads-s0miMirror","E0D0"],["noteheads-s1miMirror","E0D1"],["noteheads-s2miMirror","E0D2"],["noteheads-s0miThin","E0D3"],["noteheads-s1miThin","E0D4"],["noteheads-s2miThin","E0D5"],["noteheads-u0fa","E0D6"],["noteheads-d0fa","E0D7"],["noteheads-u1fa","E0D8"],["noteheads-d1fa","E0D9"],["noteheads-u2fa","E0DA"],["noteheads-d2fa","E0DB"],["noteheads-u0faThin","E0DC"],["noteheads-d0faThin","E0DD"],["noteheads-u1faThin","E0DE"],["noteheads-d1faThin","E0DF"],["noteheads-u2faThin","E0E0"],["noteheads-d2faThin","E0E1"],["noteheads-s0sol","E0E2"],["noteheads-s1sol","E0E3"],["noteheads-s2sol","E0E4"],["noteheads-s0la","E0E5"],["noteheads-s1la","E0E6"],["noteheads-s2la","E0E7"],["noteheads-s0laThin","E0E8"],["noteheads-s1laThin","E0E9"],["noteheads-s2laThin","E0EA"],["noteheads-s0ti","E0EB"],["noteheads-u1ti","E0EC"],["noteheads-d1ti","E0ED"],["noteheads-u2ti","E0EE"],["noteheads-d2ti","E0EF"],["noteheads-s0tiThin","E0F0"],["noteheads-u1tiThin","E0F1"],["noteheads-d1tiThin","E0F2"],["noteheads-u2tiThin","E0F3"],["noteheads-d2tiThin","E0F4"],["noteheads-u0doFunk","E0F5"],["noteheads-d0doFunk","E0F6"],["noteheads-u1doFunk","E0F7"],["noteheads-d1doFunk","E0F8"],["noteheads-u2doFunk","E0F9"],["noteheads-d2doFunk","E0FA"],["noteheads-u0reFunk","E0FB"],["noteheads-d0reFunk","E0FC"],["noteheads-u1reFunk","E0FD"],["noteheads-d1reFunk","E0FE"],["noteheads-u2reFunk","E0FF"],["noteheads-d2reFunk","E100"],["noteheads-u0miFunk","E101"],["noteheads-d0miFunk","E102"],["noteheads-u1miFunk","E103"],["noteheads-d1miFunk","E104"],["noteheads-s2miFunk","E105"],["noteheads-u0faFunk","E106"],["noteheads-d0faFunk","E107"],["noteheads-u1faFunk","E108"],["noteheads-d1faFunk","E109"],["noteheads-u2faFunk","E10A"],["noteheads-d2faFunk","E10B"],["noteheads-s0solFunk","E10C"],["noteheads-s1solFunk","E10D"],["noteheads-s2solFunk","E10E"],["noteheads-s0laFunk","E10F"],["noteheads-s1laFunk","E110"],["noteheads-s2laFunk","E111"],["noteheads-u0tiFunk","E112"],["noteheads-d0tiFunk","E113"],["noteheads-u1tiFunk","E114"],["noteheads-d1tiFunk","E115"],["noteheads-u2tiFunk","E116"],["noteheads-d2tiFunk","E117"],["noteheads-s0doWalker","E118"],["noteheads-u1doWalker","E119"],["noteheads-d1doWalker","E11A"],["noteheads-u2doWalker","E11B"],["noteheads-d2doWalker","E11C"],["noteheads-s0reWalker","E11D"],["noteheads-u1reWalker","E11E"],["noteheads-d1reWalker","E11F"],["noteheads-u2reWalker","E120"],["noteheads-d2reWalker","E121"],["noteheads-s0miWalker","E122"],["noteheads-s1miWalker","E123"],["noteheads-s2miWalker","E124"],["noteheads-s0faWalker","E125"],["noteheads-u1faWalker","E126"],["noteheads-d1faWalker","E127"],["noteheads-u2faWalker","E128"],["noteheads-d2faWalker","E129"],["noteheads-s0laWalker","E12A"],["noteheads-s1laWalker","E12B"],["noteheads-s2laWalker","E12C"],["noteheads-s0tiWalker","E12D"],["noteheads-u1tiWalker","E12E"],["noteheads-d1tiWalker","E12F"],["noteheads-u2tiWalker","E130"],["noteheads-d2tiWalker","E131"],["noteheads-uM3neomensural","E1D6"],["noteheads-dM3neomensural","E1D7"],["noteheads-uM2neomensural","E1D8"],["noteheads-dM2neomensural","E1D9"],["noteheads-sM1neomensural","E1DA"],["noteheads-urM3neomensural","E1DB"],["noteheads-drM3neomensural","E1DC"],["noteheads-urM2neomensural","E1DD"],["noteheads-drM2neomensural","E1DE"],["noteheads-srM1neomensural","E1DF"],["noteheads-s0neomensural","E1E0"],["noteheads-s1neomensural","E1E1"],["noteheads-s2neomensural","E1E2"],["noteheads-s0harmonic","E1E3"],["noteheads-s2harmonic","E1E4"],["noteheads-uM3mensural","E1E5"],["noteheads-dM3mensural","E1E6"],["noteheads-sM3ligmensural","E1E7"],["noteheads-uM2mensural","E1E8"],["noteheads-dM2mensural","E1E9"],["noteheads-sM2ligmensural","E1EA"],["noteheads-sM1mensural","E1EB"],["noteheads-urM3mensural","E1EC"],["noteheads-drM3mensural","E1ED"],["noteheads-srM3ligmensural","E1EE"],["noteheads-urM2mensural","E1EF"],["noteheads-drM2mensural","E1F0"],["noteheads-srM2ligmensural","E1F1"],["noteheads-srM1mensural","E1F2"],["noteheads-uM3semimensural","E1F3"],["noteheads-dM3semimensural","E1F4"],["noteheads-sM3semiligmensural","E1F5"],["noteheads-uM2semimensural","E1F6"],["noteheads-dM2semimensural","E1F7"],["noteheads-sM2semiligmensural","E1F8"],["noteheads-sM1semimensural","E1F9"],["noteheads-urM3semimensural","E1FA"],["noteheads-drM3semimensural","E1FB"],["noteheads-srM3semiligmensural","E1FC"],["noteheads-urM2semimensural","E1FD"],["noteheads-drM2semimensural","E1FE"],["noteheads-srM2semiligmensural","E1FF"],["noteheads-srM1semimensural","E200"],["noteheads-uM3blackmensural","E201"],["noteheads-dM3blackmensural","E202"],["noteheads-sM3blackligmensural","E203"],["noteheads-uM2blackmensural","E204"],["noteheads-dM2blackmensural","E205"],["noteheads-sM2blackligmensural","E206"],["noteheads-sM1blackmensural","E207"],["noteheads-s0mensural","E208"],["noteheads-s1mensural","E209"],["noteheads-s2mensural","E20A"],["noteheads-s0blackmensural","E20B"],["noteheads-s0petrucci","E20C"],["noteheads-s1petrucci","E20D"],["noteheads-s2petrucci","E20E"],["noteheads-s0blackpetrucci","E20F"],["noteheads-s1blackpetrucci","E210"],["noteheads-s2blackpetrucci","E211"],["noteheads-svaticana-punctum","E212"],["noteheads-svaticana-punctum-cavum","E213"],["noteheads-svaticana-linea-punctum","E214"],["noteheads-svaticana-linea-punctum-cavum","E215"],["noteheads-svaticana-inclinatum","E216"],["noteheads-svaticana-lpes","E217"],["noteheads-svaticana-vlpes","E218"],["noteheads-svaticana-upes","E219"],["noteheads-svaticana-vupes","E21A"],["noteheads-svaticana-plica","E21B"],["noteheads-svaticana-vplica","E21C"],["noteheads-svaticana-epiphonus","E21D"],["noteheads-svaticana-vepiphonus","E21E"],["noteheads-svaticana-reverse-plica","E21F"],["noteheads-svaticana-reverse-vplica","E220"],["noteheads-svaticana-inner-cephalicus","E221"],["noteheads-svaticana-cephalicus","E222"],["noteheads-svaticana-quilisma","E223"],["noteheads-ssolesmes-incl-parvum","E224"],["noteheads-ssolesmes-auct-asc","E225"],["noteheads-ssolesmes-auct-desc","E226"],["noteheads-ssolesmes-incl-auctum","E227"],["noteheads-ssolesmes-stropha","E228"],["noteheads-ssolesmes-stropha-aucta","E229"],["noteheads-ssolesmes-oriscus","E22A"],["noteheads-smedicaea-inclinatum","E22B"],["noteheads-smedicaea-punctum","E22C"],["noteheads-smedicaea-rvirga","E22D"],["noteheads-smedicaea-virga","E22E"],["noteheads-shufnagel-punctum","E22F"],["noteheads-shufnagel-virga","E230"],["noteheads-shufnagel-lpes","E231"],["noteheads-sM2kievan","E232"],["noteheads-sM1kievan","E233"],["noteheads-s0kievan","E234"],["noteheads-d2kievan","E235"],["noteheads-u2kievan","E236"],["noteheads-s1kievan","E237"],["noteheads-sr1kievan","E238"],["noteheads-d3kievan","E239"],["noteheads-u3kievan","E23A"]],flags:[["flags-u3","E132"],["flags-u4","E133"],["flags-u5","E134"],["flags-u6","E135"],["flags-u7","E136"],["flags-u8","E137"],["flags-u9","E138"],["flags-u10","E139"],["flags-d3","E13A"],["flags-d4","E13B"],["flags-d5","E13C"],["flags-d6","E13D"],["flags-d7","E13E"],["flags-d8","E13F"],["flags-d9","E140"],["flags-d10","E141"],["flags-ugrace","E142"],["flags-dgrace","E143"],["flags-mensuralu03","E19C"],["flags-mensuralu13","E19D"],["flags-mensuralu23","E19E"],["flags-mensurald03","E19F"],["flags-mensurald13","E1A0"],["flags-mensurald23","E1A1"],["flags-mensuralu04","E1A2"],["flags-mensuralu14","E1A3"],["flags-mensuralu24","E1A4"],["flags-mensurald04","E1A5"],["flags-mensurald14","E1A6"],["flags-mensurald24","E1A7"],["flags-mensuralu05","E1A8"],["flags-mensuralu15","E1A9"],["flags-mensuralu25","E1AA"],["flags-mensurald05","E1AB"],["flags-mensurald15","E1AC"],["flags-mensurald25","E1AD"],["flags-mensuralu06","E1AE"],["flags-mensuralu16","E1AF"],["flags-mensuralu26","E1B0"],["flags-mensurald06","E1B1"],["flags-mensurald16","E1B2"],["flags-mensurald26","E1B3"]],custodes:[["custodes-hufnagel-u0","E17C"],["custodes-hufnagel-u1","E17D"],["custodes-hufnagel-u2","E17E"],["custodes-hufnagel-d0","E17F"],["custodes-hufnagel-d1","E180"],["custodes-hufnagel-d2","E181"],["custodes-medicaea-u0","E182"],["custodes-medicaea-u1","E183"],["custodes-medicaea-u2","E184"],["custodes-medicaea-d0","E185"],["custodes-medicaea-d1","E186"],["custodes-medicaea-d2","E187"],["custodes-vaticana-u0","E188"],["custodes-vaticana-u1","E189"],["custodes-vaticana-u2","E18A"],["custodes-vaticana-d0","E18B"],["custodes-vaticana-d1","E18C"],["custodes-vaticana-d2","E18D"],["custodes-mensural-u0","E18E"],["custodes-mensural-u1","E18F"],["custodes-mensural-u2","E190"],["custodes-mensural-d0","E191"],["custodes-mensural-d1","E192"],["custodes-mensural-d2","E193"]],dots:[["dots-dotvaticana","E1D4"],["dots-dotkievan","E1D5"]]},i={rests:"Rests",accidentals:"Accidentals",arrowheads:"Arrowheads",dot:"Dot",scripts:"Scripts & Articulations",clefs:"Clefs",timesig:"Time Signatures",pedal:"Pedal",brackettips:"Bracket Tips",accordion:"Accordion",ties:"Ties",noteheads:"Noteheads",flags:"Flags",custodes:"Custodes",dots:"Dots"};function f(){const[o,u]=d.useState(!1),[E,h]=d.useState(""),[r,m]=d.useState(40);d.useEffect(()=>{document.fonts.ready.then(()=>{u(document.fonts.check("40px Emmentaler-26"))})},[]);const c=Object.keys(l);return e.jsxs("div",{className:"font-test-page",children:[e.jsxs("div",{className:"font-test-header",children:[e.jsx("h1",{children:"Emmentaler-26 Font Glyphs"}),e.jsxs("div",{className:"font-test-status",children:["Font status: ",e.jsx("span",{className:o?"loaded":"not-loaded",children:o?"Loaded":"Not loaded"}),e.jsxs("span",{className:"glyph-count",children:[Object.values(l).reduce((s,n)=>s+n.length,0)," glyphs"]})]}),e.jsxs("div",{className:"font-test-controls",children:[e.jsx("input",{type:"text",placeholder:"Filter glyphs...",value:E,onChange:s=>h(s.target.value)}),e.jsxs("label",{children:["Size:",e.jsx("input",{type:"range",min:20,max:80,value:r,onChange:s=>m(Number(s.target.value))}),r,"px"]})]}),e.jsx("div",{className:"font-test-toc",children:c.map(s=>e.jsxs("a",{href:`#cat-${s}`,children:[i[s]||s," (",l[s].length,")"]},s))})]}),c.map(s=>{const n=l[s].filter(([a,t])=>!E||a.toLowerCase().includes(E.toLowerCase())||t.toLowerCase().includes(E.toLowerCase()));return n.length===0?null:e.jsxs("div",{id:`cat-${s}`,className:"font-test-category",children:[e.jsxs("h2",{children:[i[s]||s," ",e.jsxs("span",{children:["(",n.length,")"]})]}),e.jsx("div",{className:"glyph-grid",children:n.map(([a,t])=>e.jsxs("div",{className:"glyph-cell",title:a,children:[e.jsx("div",{className:"glyph-render",style:{fontSize:r},children:e.jsx("i",{className:`emmentaler glyph-${a}`})}),e.jsx("div",{className:"glyph-unicode",style:{fontSize:r},children:String.fromCodePoint(parseInt(t,16))}),e.jsx("div",{className:"glyph-name",children:a}),e.jsxs("div",{className:"glyph-code",children:["U+",t]})]},`${a}-${t}`))})]},s)})]})}export{f as default};
|
dist/assets/{gauge-aae36b83.js → gauge-ab1f0653.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as e,j as r}from"./umi-
|
|
|
|
| 1 |
+
import{r as e,j as r}from"./umi-2135699e.js";import{G as d}from"./gaugeRendererGL-9dc55e03.js";const a=[["source1.png","gauge1.png"],["source2.png","gauge2.png"]];function l(){const n=e.useRef(),t=e.useRef(),s=e.useRef(),[c,o]=e.useState(),[u,g]=e.useState(0);return e.useEffect(()=>{o(new d({source:n.current,gauge:t.current,canvas:s.current}))},[n.current,t.current,s.current]),r.jsxs("div",{children:[r.jsx("img",{ref:n,src:`/test.local/${a[u][0]}`}),r.jsx("img",{ref:t,src:`/test.local/${a[u][1]}`}),r.jsx("canvas",{ref:s}),r.jsx("button",{onClick:()=>g((u+1)%a.length),children:"change"}),r.jsx("button",{onClick:()=>{c.updateMaterial({width:t.current.width}),c.updateGeometry(),c.render()},children:"render"})]})}export{l as default};
|
dist/assets/gaugeRendererGL-41abf4c6.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
| 1 |
-
const U=`//#version 300 es
|
| 2 |
-
//#define attribute in
|
| 3 |
-
//#define varying out
|
| 4 |
-
//#define texture2D texture
|
| 5 |
-
|
| 6 |
-
precision highp float;
|
| 7 |
-
precision highp int;
|
| 8 |
-
|
| 9 |
-
#define HIGH_PRECISION
|
| 10 |
-
#define SHADER_NAME MeshBasicMaterial
|
| 11 |
-
#define VERTEX_TEXTURES
|
| 12 |
-
#define USE_MAP
|
| 13 |
-
#define USE_UV
|
| 14 |
-
#define BONE_TEXTURE
|
| 15 |
-
#define DOUBLE_SIDED
|
| 16 |
-
uniform mat4 modelViewMatrix;
|
| 17 |
-
uniform mat4 projectionMatrix;
|
| 18 |
-
uniform vec3 cameraPosition;
|
| 19 |
-
|
| 20 |
-
attribute vec3 position;
|
| 21 |
-
attribute vec3 normal;
|
| 22 |
-
attribute vec2 uv;
|
| 23 |
-
|
| 24 |
-
#ifdef USE_UV
|
| 25 |
-
varying vec2 vUv;
|
| 26 |
-
uniform mat3 uvTransform;
|
| 27 |
-
#endif
|
| 28 |
-
|
| 29 |
-
void main() {
|
| 30 |
-
#ifdef USE_UV
|
| 31 |
-
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
| 32 |
-
#endif
|
| 33 |
-
|
| 34 |
-
vec3 transformed = vec3( position );
|
| 35 |
-
|
| 36 |
-
vec4 mvPosition = vec4( transformed, 1.0 );
|
| 37 |
-
mvPosition = modelViewMatrix * mvPosition;
|
| 38 |
-
gl_Position = projectionMatrix * mvPosition;
|
| 39 |
-
}
|
| 40 |
-
`,x=`//#version 300 es
|
| 41 |
-
//#define varying in
|
| 42 |
-
//out highp vec4 pc_fragColor;
|
| 43 |
-
//#define gl_FragColor pc_fragColor
|
| 44 |
-
//#define texture2D texture
|
| 45 |
-
|
| 46 |
-
precision highp float;
|
| 47 |
-
precision highp int;
|
| 48 |
-
|
| 49 |
-
#define HIGH_PRECISION
|
| 50 |
-
#define SHADER_NAME MeshBasicMaterial
|
| 51 |
-
#define USE_MAP
|
| 52 |
-
#define USE_UV
|
| 53 |
-
#define DOUBLE_SIDED
|
| 54 |
-
uniform vec3 cameraPosition;
|
| 55 |
-
|
| 56 |
-
vec4 LinearToLinear( in vec4 value ) {
|
| 57 |
-
return value;
|
| 58 |
-
}
|
| 59 |
-
vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
|
| 60 |
-
|
| 61 |
-
uniform vec3 diffuse;
|
| 62 |
-
uniform float opacity;
|
| 63 |
-
|
| 64 |
-
#if defined( USE_UV )
|
| 65 |
-
varying vec2 vUv;
|
| 66 |
-
#endif
|
| 67 |
-
#ifdef USE_MAP
|
| 68 |
-
uniform sampler2D map;
|
| 69 |
-
#endif
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
void main() {
|
| 73 |
-
vec4 diffuseColor = vec4( diffuse, opacity );
|
| 74 |
-
#ifdef USE_MAP
|
| 75 |
-
vec4 texelColor = texture2D( map, vUv );
|
| 76 |
-
texelColor = mapTexelToLinear( texelColor );
|
| 77 |
-
diffuseColor *= texelColor;
|
| 78 |
-
#endif
|
| 79 |
-
|
| 80 |
-
gl_FragColor = diffuseColor;
|
| 81 |
-
}
|
| 82 |
-
`,l=p=>p.flat(1);class S{sourceElem;gaugeElem;canvas;context;program;texture;pos;uv;ib;primitiveCount;width=256;height=192;constructor(t){if(this.sourceElem=t.source,this.gaugeElem=t.gauge,this.canvas=t.canvas,Number.isFinite(t.height)&&(this.height=t.height),this.context=this.canvas.getContext("webgl2",{antialias:!0,depth:!1}),!this.context){console.warn("WebGL2 is not available, GaugeRenderer disabled.");return}const e=this.context;e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT),e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT),this.program=e.createProgram();const a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,U),e.compileShader(a);const h=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(h,x),e.compileShader(h),e.attachShader(this.program,a),e.attachShader(this.program,h),e.linkProgram(this.program);const m=e.getProgramInfoLog(this.program);m&&console.warn("program log:",m);const c=e.getShaderInfoLog(a);c&&console.warn("vs log:",c);const f=e.getShaderInfoLog(h);f&&console.warn("fs log:",f),e.deleteShader(a),e.deleteShader(h);const{name:s}=e.getActiveUniform(this.program,0),g=e.getUniformLocation(this.program,s),{name:E}=e.getActiveUniform(this.program,1),d=e.getUniformLocation(this.program,E),{name:u}=e.getActiveUniform(this.program,2),o=e.getUniformLocation(this.program,u),{name:r}=e.getActiveUniform(this.program,3),i=e.getUniformLocation(this.program,r),{name:v}=e.getActiveUniform(this.program,4),n=e.getUniformLocation(this.program,v),{name:T}=e.getActiveUniform(this.program,5),R=e.getUniformLocation(this.program,T);e.useProgram(this.program),e.uniformMatrix4fv(d,!1,new Float32Array([.0026385225355625153,0,0,0,0,-.010416666977107525,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1])),e.uniformMatrix4fv(g,!1,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1,1])),e.uniformMatrix3fv(o,!1,new Float32Array([1,0,0,0,1,0,0,0,1])),e.uniform3f(i,1,1,1),e.uniform1f(n,1),e.uniform1i(R,0),this.texture=e.createTexture(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(37440,!0),e.pixelStorei(37441,!1),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(37443,0),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.disable(e.CULL_FACE),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.disable(e.STENCIL_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),this.pos=e.createBuffer(),this.uv=e.createBuffer(),this.ib=e.createBuffer();const A=e.getAttribLocation(this.program,"position"),_=e.getAttribLocation(this.program,"uv");e.enableVertexAttribArray(A),e.bindBuffer(e.ARRAY_BUFFER,this.pos),e.vertexAttribPointer(A,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(_),e.bindBuffer(e.ARRAY_BUFFER,this.uv),e.vertexAttribPointer(_,2,e.FLOAT,!1,0,0)}updateMaterial({width:t=null}={}){if(!this.context)return;const e=this.context;if(this.sourceElem.naturalWidth!==this.width||this.sourceElem.naturalHeight!==this.height){Number.isFinite(t)?this.width=t:this.width=Math.round(this.height*this.sourceElem.naturalWidth/this.sourceElem.naturalHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.viewport(0,0,this.width,this.height);const a=e.getUniformLocation(this.program,"projectionMatrix");e.uniformMatrix4fv(a,!1,new Float32Array([2/this.width,0,0,0,0,-2/this.height,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1]))}e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA8,e.RGBA,e.UNSIGNED_BYTE,this.sourceElem),e.generateMipmap(e.TEXTURE_2D)}updateGeometry(t=null){if(!this.context)return;const{naturalWidth:e,naturalHeight:a}=this.gaugeElem,m=new OffscreenCanvas(e,a).getContext("2d");m.drawImage(this.gaugeElem,0,0);const{data:c}=m.getImageData(0,0,e,a),f=this.width/e;t=Math.round(Number.isFinite(t)?t:a/2),t=Math.max(0,Math.min(a-1,t));const s=Array(a).fill(null).map((r,i)=>Array(e).fill(null).map((v,n)=>({uv:[(n+.5)/e,1-(i+.5)/a],position:[(n-e/2)*f,(c[(i*e+n)*4]+c[(i*e+n)*4+2]/256-128)/f,0]})));for(let r=t;r>0;--r)for(let i=0;i<e;++i)s[r-1][i].position[0]=s[r][i].position[0]-(c[(r*e+i)*4+1]-128)*f/127;for(let r=t+1;r<a;++r)for(let i=0;i<e;++i)s[r][i].position[0]=s[r-1][i].position[0]+(c[((r-1)*e+i)*4+1]-128)*f/127;const g=l(l(s).map(r=>r.uv)),E=l(l(s).map(r=>r.position)),d=Array(a-1).fill(null).map((r,i)=>Array(e-1).fill(null).map((v,n)=>[i*e+n,i*e+n+1,(i+1)*e+n,(i+1)*e+n,(i+1)*e+n+1,i*e+n+1])),u=l(l(d)),o=this.context;o.bindBuffer(o.ARRAY_BUFFER,this.pos),o.bufferData(o.ARRAY_BUFFER,new Float32Array(E),o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,this.uv),o.bufferData(o.ARRAY_BUFFER,new Float32Array(g),o.STATIC_DRAW),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,this.ib),o.bufferData(o.ELEMENT_ARRAY_BUFFER,new Uint32Array(u),o.STATIC_DRAW),this.primitiveCount=u.length}render(){if(!this.context)return"";const t=this.context;return t.clearColor(1,1,1,0),t.clear(t.COLOR_BUFFER_BIT),t.drawElements(t.TRIANGLES,this.primitiveCount,t.UNSIGNED_INT,0),this.canvas.toDataURL()}getBlob(){return new Promise(t=>this.canvas.toBlob(t,"image/png"))}}export{S as G};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dist/assets/gaugeRendererGL-9dc55e03.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const U=`//#version 300 es
|
| 2 |
+
//#define attribute in
|
| 3 |
+
//#define varying out
|
| 4 |
+
//#define texture2D texture
|
| 5 |
+
|
| 6 |
+
precision highp float;
|
| 7 |
+
precision highp int;
|
| 8 |
+
|
| 9 |
+
#define HIGH_PRECISION
|
| 10 |
+
#define SHADER_NAME MeshBasicMaterial
|
| 11 |
+
#define VERTEX_TEXTURES
|
| 12 |
+
#define USE_MAP
|
| 13 |
+
#define USE_UV
|
| 14 |
+
#define BONE_TEXTURE
|
| 15 |
+
#define DOUBLE_SIDED
|
| 16 |
+
uniform mat4 modelViewMatrix;
|
| 17 |
+
uniform mat4 projectionMatrix;
|
| 18 |
+
uniform vec3 cameraPosition;
|
| 19 |
+
|
| 20 |
+
attribute vec3 position;
|
| 21 |
+
attribute vec3 normal;
|
| 22 |
+
attribute vec2 uv;
|
| 23 |
+
|
| 24 |
+
#ifdef USE_UV
|
| 25 |
+
varying vec2 vUv;
|
| 26 |
+
uniform mat3 uvTransform;
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
void main() {
|
| 30 |
+
#ifdef USE_UV
|
| 31 |
+
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
vec3 transformed = vec3( position );
|
| 35 |
+
|
| 36 |
+
vec4 mvPosition = vec4( transformed, 1.0 );
|
| 37 |
+
mvPosition = modelViewMatrix * mvPosition;
|
| 38 |
+
gl_Position = projectionMatrix * mvPosition;
|
| 39 |
+
}
|
| 40 |
+
`,S=`//#version 300 es
|
| 41 |
+
//#define varying in
|
| 42 |
+
//out highp vec4 pc_fragColor;
|
| 43 |
+
//#define gl_FragColor pc_fragColor
|
| 44 |
+
//#define texture2D texture
|
| 45 |
+
|
| 46 |
+
precision highp float;
|
| 47 |
+
precision highp int;
|
| 48 |
+
|
| 49 |
+
#define HIGH_PRECISION
|
| 50 |
+
#define SHADER_NAME MeshBasicMaterial
|
| 51 |
+
#define USE_MAP
|
| 52 |
+
#define USE_UV
|
| 53 |
+
#define DOUBLE_SIDED
|
| 54 |
+
uniform vec3 cameraPosition;
|
| 55 |
+
|
| 56 |
+
vec4 LinearToLinear( in vec4 value ) {
|
| 57 |
+
return value;
|
| 58 |
+
}
|
| 59 |
+
vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
|
| 60 |
+
|
| 61 |
+
uniform vec3 diffuse;
|
| 62 |
+
uniform float opacity;
|
| 63 |
+
|
| 64 |
+
#if defined( USE_UV )
|
| 65 |
+
varying vec2 vUv;
|
| 66 |
+
#endif
|
| 67 |
+
#ifdef USE_MAP
|
| 68 |
+
uniform sampler2D map;
|
| 69 |
+
#endif
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
void main() {
|
| 73 |
+
vec4 diffuseColor = vec4( diffuse, opacity );
|
| 74 |
+
#ifdef USE_MAP
|
| 75 |
+
vec4 texelColor = texture2D( map, vUv );
|
| 76 |
+
texelColor = mapTexelToLinear( texelColor );
|
| 77 |
+
diffuseColor *= texelColor;
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
gl_FragColor = diffuseColor;
|
| 81 |
+
}
|
| 82 |
+
`,m=p=>p.flat(1);class x{sourceElem;gaugeElem;canvas;context;program;texture;pos;uv;ib;primitiveCount;width=256;height=192;constructor(t){this.sourceElem=t.source,this.gaugeElem=t.gauge,this.canvas=t.canvas,Number.isFinite(t.height)&&(this.height=t.height),this.context=this.canvas.getContext("webgl2",{antialias:!0,depth:!1});const e=this.context;window.gl=e,e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT),e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT),this.program=e.createProgram();const a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,U),e.compileShader(a);const h=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(h,S),e.compileShader(h),e.attachShader(this.program,a),e.attachShader(this.program,h),e.linkProgram(this.program);const l=e.getProgramInfoLog(this.program);l&&console.warn("program log:",l);const c=e.getShaderInfoLog(a);c&&console.warn("vs log:",c);const f=e.getShaderInfoLog(h);f&&console.warn("fs log:",f),e.deleteShader(a),e.deleteShader(h);const{name:s}=e.getActiveUniform(this.program,0),g=e.getUniformLocation(this.program,s),{name:E}=e.getActiveUniform(this.program,1),d=e.getUniformLocation(this.program,E),{name:u}=e.getActiveUniform(this.program,2),o=e.getUniformLocation(this.program,u),{name:r}=e.getActiveUniform(this.program,3),i=e.getUniformLocation(this.program,r),{name:v}=e.getActiveUniform(this.program,4),n=e.getUniformLocation(this.program,v),{name:T}=e.getActiveUniform(this.program,5),R=e.getUniformLocation(this.program,T);e.useProgram(this.program),e.uniformMatrix4fv(d,!1,new Float32Array([.0026385225355625153,0,0,0,0,-.010416666977107525,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1])),e.uniformMatrix4fv(g,!1,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1,1])),e.uniformMatrix3fv(o,!1,new Float32Array([1,0,0,0,1,0,0,0,1])),e.uniform3f(i,1,1,1),e.uniform1f(n,1),e.uniform1i(R,0),this.texture=e.createTexture(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.texture),e.pixelStorei(37440,!0),e.pixelStorei(37441,!1),e.pixelStorei(e.UNPACK_ALIGNMENT,4),e.pixelStorei(37443,0),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.disable(e.CULL_FACE),e.depthMask(!0),e.colorMask(!0,!0,!0,!0),e.disable(e.STENCIL_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),this.pos=e.createBuffer(),this.uv=e.createBuffer(),this.ib=e.createBuffer();const A=e.getAttribLocation(this.program,"position"),_=e.getAttribLocation(this.program,"uv");e.enableVertexAttribArray(A),e.bindBuffer(e.ARRAY_BUFFER,this.pos),e.vertexAttribPointer(A,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(_),e.bindBuffer(e.ARRAY_BUFFER,this.uv),e.vertexAttribPointer(_,2,e.FLOAT,!1,0,0)}updateMaterial({width:t=null}={}){const e=this.context;if(this.sourceElem.naturalWidth!==this.width||this.sourceElem.naturalHeight!==this.height){Number.isFinite(t)?this.width=t:this.width=Math.round(this.height*this.sourceElem.naturalWidth/this.sourceElem.naturalHeight),this.canvas.width=this.width,this.canvas.height=this.height,e.viewport(0,0,this.width,this.height);const a=e.getUniformLocation(this.program,"projectionMatrix");e.uniformMatrix4fv(a,!1,new Float32Array([2/this.width,0,0,0,0,-2/this.height,0,0,0,0,-.20202019810676575,0,0,0,-1.0202020406723022,1]))}e.bindTexture(e.TEXTURE_2D,this.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA8,e.RGBA,e.UNSIGNED_BYTE,this.sourceElem),e.generateMipmap(e.TEXTURE_2D)}updateGeometry(t=null){const{naturalWidth:e,naturalHeight:a}=this.gaugeElem,l=new OffscreenCanvas(e,a).getContext("2d");l.drawImage(this.gaugeElem,0,0);const{data:c}=l.getImageData(0,0,e,a),f=this.width/e;t=Math.round(Number.isFinite(t)?t:a/2),t=Math.max(0,Math.min(a-1,t));const s=Array(a).fill(null).map((r,i)=>Array(e).fill(null).map((v,n)=>({uv:[(n+.5)/e,1-(i+.5)/a],position:[(n-e/2)*f,(c[(i*e+n)*4]+c[(i*e+n)*4+2]/256-128)/f,0]})));for(let r=t;r>0;--r)for(let i=0;i<e;++i)s[r-1][i].position[0]=s[r][i].position[0]-(c[(r*e+i)*4+1]-128)*f/127;for(let r=t+1;r<a;++r)for(let i=0;i<e;++i)s[r][i].position[0]=s[r-1][i].position[0]+(c[((r-1)*e+i)*4+1]-128)*f/127;const g=m(m(s).map(r=>r.uv)),E=m(m(s).map(r=>r.position)),d=Array(a-1).fill(null).map((r,i)=>Array(e-1).fill(null).map((v,n)=>[i*e+n,i*e+n+1,(i+1)*e+n,(i+1)*e+n,(i+1)*e+n+1,i*e+n+1])),u=m(m(d)),o=this.context;o.bindBuffer(o.ARRAY_BUFFER,this.pos),o.bufferData(o.ARRAY_BUFFER,new Float32Array(E),o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,this.uv),o.bufferData(o.ARRAY_BUFFER,new Float32Array(g),o.STATIC_DRAW),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,this.ib),o.bufferData(o.ELEMENT_ARRAY_BUFFER,new Uint32Array(u),o.STATIC_DRAW),this.primitiveCount=u.length}render(){const t=this.context;return t.clearColor(1,1,1,0),t.clear(t.COLOR_BUFFER_BIT),t.drawElements(t.TRIANGLES,this.primitiveCount,t.UNSIGNED_INT,0),this.canvas.toDataURL()}getBlob(){return new Promise(t=>this.canvas.toBlob(t,"image/png"))}}export{x as G};
|
dist/assets/index-054c816b.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as i,R as ze,_ as C,e as Ge,j as w}from"./umi-2135699e.js";import{M as xt}from"./index-ca8300a2.js";import{S as bt}from"./index-abee73dc.js";import{I as K,u as St,m as Ct,P as Et}from"./tiny-invariant-23ba74ad.js";import{D as ot,A as Rt,r as kt}from"./confirm-345857b8.js";import{o as Ke,q as Pt,y as Mt,x as Ut,P as Ft,r as st,s as it,I as Lt,J as He,K as Dt}from"./index-22b5485d.js";import{A as Ue,f as se,a5 as jt,V as lt,a6 as ct,U as ut,_ as ye,T as dt,Z as $t,c as X,b as T,aJ as Ot,aK as De,O as ft,a as Me,C as Ve,d as pt,b2 as Tt,e as Je,N as Xe,L as Ze,aa as Nt,ab as At,af as Bt,m as zt,H as Ht,r as _t}from"./_setToString-038b76d7.js";import{J as Vt,z as qt,T as Wt,M as Yt,d as Gt,u as Kt,b as mt,R as Jt,C as Qe,L as Xt,S as et}from"./util-e99b60d9.js";import{B as je}from"./button-eb671c5b.js";import{P as Zt,D as Qt,S as en}from"./index-c4a8d365.js";import{D as tn}from"./DeleteOutlined-1f8a2958.js";import"./index-61307b6b.js";import"./jszip.min-f3ba6370.js";import"./index-eb226363.js";var nn={icon:function(e,a){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:a}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"};const an=nn;var rn=function(e,a){return i.createElement(Ue,se(se({},e),{},{ref:a,icon:an}))},on=i.forwardRef(rn);const sn=on;var ln={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"};const cn=ln;var un=function(e,a){return i.createElement(Ue,se(se({},e),{},{ref:a,icon:cn}))},dn=i.forwardRef(un);const fn=dn;var pn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"};const mn=pn;var vn=function(e,a){return i.createElement(Ue,se(se({},e),{},{ref:a,icon:mn}))},hn=i.forwardRef(vn);const gn=hn;var wn={icon:function(e,a){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:a}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:a}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:a}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"};const yn=wn;var In=function(e,a){return i.createElement(Ue,se(se({},e),{},{ref:a,icon:yn}))},xn=i.forwardRef(In);const bn=xn;var Sn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const Cn=Sn;var En=function(e,a){return i.createElement(Ue,se(se({},e),{},{ref:a,icon:Cn}))},Rn=i.forwardRef(En);const kn=Rn;function Pn(t,e){var a="cannot ".concat(t.method," ").concat(t.action," ").concat(e.status,"'"),n=new Error(a);return n.status=e.status,n.method=t.method,n.url=t.action,n}function tt(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}function Mn(t){var e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=function(l){l.total>0&&(l.percent=l.loaded/l.total*100),t.onProgress(l)});var a=new FormData;t.data&&Object.keys(t.data).forEach(function(o){var l=t.data[o];if(Array.isArray(l)){l.forEach(function(s){a.append("".concat(o,"[]"),s)});return}a.append(o,l)}),t.file instanceof Blob?a.append(t.filename,t.file,t.file.name):a.append(t.filename,t.file),e.onerror=function(l){t.onError(l)},e.onload=function(){return e.status<200||e.status>=300?t.onError(Pn(t,e),tt(e)):t.onSuccess(tt(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var n=t.headers||{};return n["X-Requested-With"]!==null&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(o){n[o]!==null&&e.setRequestHeader(o,n[o])}),e.send(a),{abort:function(){e.abort()}}}var Un=+new Date,Fn=0;function Te(){return"rc-upload-".concat(Un,"-").concat(++Fn)}const Ne=function(t,e){if(t&&e){var a=Array.isArray(e)?e:e.split(","),n=t.name||"",o=t.type||"",l=o.replace(/\/.*$/,"");return a.some(function(s){var r=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(r.charAt(0)==="."){var p=n.toLowerCase(),c=r.toLowerCase(),d=[c];return(c===".jpg"||c===".jpeg")&&(d=[".jpg",".jpeg"]),d.some(function(f){return p.endsWith(f)})}return/\/\*$/.test(r)?l===r.replace(/\/.*$/,""):o===r?!0:/^\w+$/.test(r)?(jt(!1,"Upload takes an invalidate 'accept' type '".concat(r,"'.Skip for check.")),!0):!1})}return!0};function Ln(t,e){var a=t.createReader(),n=[];function o(){a.readEntries(function(l){var s=Array.prototype.slice.apply(l);n=n.concat(s);var r=!s.length;r?e(n):o()})}o()}var Dn=function(e,a,n){var o=function l(s,r){s&&(s.path=r||"",s.isFile?s.file(function(p){n(p)&&(s.fullPath&&!p.webkitRelativePath&&(Object.defineProperties(p,{webkitRelativePath:{writable:!0}}),p.webkitRelativePath=s.fullPath.replace(/^\//,""),Object.defineProperties(p,{webkitRelativePath:{writable:!1}})),a([p]))}):s.isDirectory&&Ln(s,function(p){p.forEach(function(c){l(c,"".concat(r).concat(s.name,"/"))})}))};e.forEach(function(l){o(l.webkitGetAsEntry())})},jn=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],$n=function(t){lt(a,t);var e=ct(a);function a(){var n;ut(this,a);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return n=e.call.apply(e,[this].concat(l)),n.state={uid:Te()},n.reqs={},n.fileInput=void 0,n._isMounted=void 0,n.onChange=function(r){var p=n.props,c=p.accept,d=p.directory,f=r.target.files,u=ye(f).filter(function(v){return!d||Ne(v,c)});n.uploadFiles(u),n.reset()},n.onClick=function(r){var p=n.fileInput;if(p){var c=r.target,d=n.props.onClick;if(c&&c.tagName==="BUTTON"){var f=p.parentNode;f.focus(),c.blur()}p.click(),d&&d(r)}},n.onKeyDown=function(r){r.key==="Enter"&&n.onClick(r)},n.onFileDrop=function(r){var p=n.props.multiple;if(r.preventDefault(),r.type!=="dragover")if(n.props.directory)Dn(Array.prototype.slice.call(r.dataTransfer.items),n.uploadFiles,function(d){return Ne(d,n.props.accept)});else{var c=ye(r.dataTransfer.files).filter(function(d){return Ne(d,n.props.accept)});p===!1&&(c=c.slice(0,1)),n.uploadFiles(c)}},n.uploadFiles=function(r){var p=ye(r),c=p.map(function(d){return d.uid=Te(),n.processFile(d,p)});Promise.all(c).then(function(d){var f=n.props.onBatchStart;f==null||f(d.map(function(u){var v=u.origin,h=u.parsedFile;return{file:v,parsedFile:h}})),d.filter(function(u){return u.parsedFile!==null}).forEach(function(u){n.post(u)})})},n.processFile=function(){var r=Ot(De().mark(function p(c,d){var f,u,v,h,y,R,U,D,$;return De().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(f=n.props.beforeUpload,u=c,!f){m.next=14;break}return m.prev=3,m.next=6,f(c,d);case 6:u=m.sent,m.next=12;break;case 9:m.prev=9,m.t0=m.catch(3),u=!1;case 12:if(u!==!1){m.next=14;break}return m.abrupt("return",{origin:c,parsedFile:null,action:null,data:null});case 14:if(v=n.props.action,typeof v!="function"){m.next=21;break}return m.next=18,v(c);case 18:h=m.sent,m.next=22;break;case 21:h=v;case 22:if(y=n.props.data,typeof y!="function"){m.next=29;break}return m.next=26,y(c);case 26:R=m.sent,m.next=30;break;case 29:R=y;case 30:return U=(ft(u)==="object"||typeof u=="string")&&u?u:c,U instanceof File?D=U:D=new File([U],c.name,{type:c.type}),$=D,$.uid=c.uid,m.abrupt("return",{origin:c,data:R,parsedFile:$,action:h});case 35:case"end":return m.stop()}},p,null,[[3,9]])}));return function(p,c){return r.apply(this,arguments)}}(),n.saveFileInput=function(r){n.fileInput=r},n}return dt(a,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(o){var l=this,s=o.data,r=o.origin,p=o.action,c=o.parsedFile;if(this._isMounted){var d=this.props,f=d.onStart,u=d.customRequest,v=d.name,h=d.headers,y=d.withCredentials,R=d.method,U=r.uid,D=u||Mn,$={action:p,filename:v,data:s,file:c,headers:h,withCredentials:y,method:R||"post",onProgress:function(m){var A=l.props.onProgress;A==null||A(m,c)},onSuccess:function(m,A){var M=l.props.onSuccess;M==null||M(m,c,A),delete l.reqs[U]},onError:function(m,A){var M=l.props.onError;M==null||M(m,A,c),delete l.reqs[U]}};f(r),this.reqs[U]=D($)}}},{key:"reset",value:function(){this.setState({uid:Te()})}},{key:"abort",value:function(o){var l=this.reqs;if(o){var s=o.uid?o.uid:o;l[s]&&l[s].abort&&l[s].abort(),delete l[s]}else Object.keys(l).forEach(function(r){l[r]&&l[r].abort&&l[r].abort(),delete l[r]})}},{key:"render",value:function(){var o=this.props,l=o.component,s=o.prefixCls,r=o.className,p=o.disabled,c=o.id,d=o.style,f=o.multiple,u=o.accept,v=o.capture,h=o.children,y=o.directory,R=o.openFileDialogOnClick,U=o.onMouseEnter,D=o.onMouseLeave,$=$t(o,jn),P=X(T(T(T({},s,!0),"".concat(s,"-disabled"),p),r,r)),m=y?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},A=p?{}:{onClick:R?this.onClick:function(){},onKeyDown:R?this.onKeyDown:function(){},onMouseEnter:U,onMouseLeave:D,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return ze.createElement(l,C({},A,{className:P,role:"button",style:d}),ze.createElement("input",C({},Vt($,{aria:!0,data:!0}),{id:c,disabled:p,type:"file",ref:this.saveFileInput,onClick:function(_){return _.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:u},m,{multiple:f,onChange:this.onChange},v!=null?{capture:v}:{})),h)}}]),a}(i.Component);function Ae(){}var _e=function(t){lt(a,t);var e=ct(a);function a(){var n;ut(this,a);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return n=e.call.apply(e,[this].concat(l)),n.uploader=void 0,n.saveUploader=function(r){n.uploader=r},n}return dt(a,[{key:"abort",value:function(o){this.uploader.abort(o)}},{key:"render",value:function(){return ze.createElement($n,C({},this.props,{ref:this.saveUploader}))}}]),a}(i.Component);_e.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Ae,onError:Ae,onSuccess:Ae,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};function Fe(t){return C(C({},t),{lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate,name:t.name,size:t.size,type:t.type,uid:t.uid,percent:0,originFileObj:t})}function Le(t,e){var a=ye(e),n=a.findIndex(function(o){var l=o.uid;return l===t.uid});return n===-1?a.push(t):a[n]=t,a}function Be(t,e){var a=t.uid!==void 0?"uid":"name";return e.filter(function(n){return n[a]===t[a]})[0]}function On(t,e){var a=t.uid!==void 0?"uid":"name",n=e.filter(function(o){return o[a]!==t[a]});return n.length===e.length?null:n}var Tn=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=e.split("/"),n=a[a.length-1],o=n.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(o)||[""])[0]},vt=function(e){return e.indexOf("image/")===0},Nn=function(e){if(e.type&&!e.thumbUrl)return vt(e.type);var a=e.thumbUrl||e.url||"",n=Tn(a);return/^data:image\//.test(a)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(a)||n)},ve=200;function An(t){return new Promise(function(e){if(!t.type||!vt(t.type)){e("");return}var a=document.createElement("canvas");a.width=ve,a.height=ve,a.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(ve,"px; height: ").concat(ve,"px; z-index: 9999; display: none;"),document.body.appendChild(a);var n=a.getContext("2d"),o=new Image;if(o.onload=function(){var r=o.width,p=o.height,c=ve,d=ve,f=0,u=0;r>p?(d=p*(ve/r),u=-(d-c)/2):(c=r*(ve/p),f=-(c-d)/2),n.drawImage(o,f,u,c,d);var v=a.toDataURL();document.body.removeChild(a),window.URL.revokeObjectURL(o.src),e(v)},o.crossOrigin="anonymous",t.type.startsWith("image/svg+xml")){var l=new FileReader;l.onload=function(){l.result&&(o.src=l.result)},l.readAsDataURL(t)}else if(t.type.startsWith("image/gif")){var s=new FileReader;s.onload=function(){s.result&&e(s.result)},s.readAsDataURL(t)}else o.src=window.URL.createObjectURL(t)})}var Bn=i.forwardRef(function(t,e){var a=t.prefixCls,n=t.className,o=t.style,l=t.locale,s=t.listType,r=t.file,p=t.items,c=t.progress,d=t.iconRender,f=t.actionIconRender,u=t.itemRender,v=t.isImgUrl,h=t.showPreviewIcon,y=t.showRemoveIcon,R=t.showDownloadIcon,U=t.previewIcon,D=t.removeIcon,$=t.downloadIcon,P=t.onPreview,m=t.onDownload,A=t.onClose,M,_,Q=r.status,ie=i.useState(Q),ee=Me(ie,2),b=ee[0],B=ee[1];i.useEffect(function(){Q!=="removed"&&B(Q)},[Q]);var O=i.useState(!1),Z=Me(O,2),te=Z[0],le=Z[1],V=i.useRef(null);i.useEffect(function(){return V.current=setTimeout(function(){le(!0)},300),function(){V.current&&clearTimeout(V.current)}},[]);var ce="".concat(a,"-span"),S=d(r),J=i.createElement("div",{className:"".concat(a,"-text-icon")},S);if(s==="picture"||s==="picture-card")if(b==="uploading"||!r.thumbUrl&&!r.url){var Ie=X(T(T({},"".concat(a,"-list-item-thumbnail"),!0),"".concat(a,"-list-item-file"),b!=="uploading"));J=i.createElement("div",{className:Ie},S)}else{var ne=v!=null&&v(r)?i.createElement("img",{src:r.thumbUrl||r.url,alt:r.name,className:"".concat(a,"-list-item-image"),crossOrigin:r.crossOrigin}):S,Ee=X(T(T({},"".concat(a,"-list-item-thumbnail"),!0),"".concat(a,"-list-item-file"),v&&!v(r)));J=i.createElement("a",{className:Ee,onClick:function(k){return P(r,k)},href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer"},ne)}var xe=X(T(T(T({},"".concat(a,"-list-item"),!0),"".concat(a,"-list-item-").concat(b),!0),"".concat(a,"-list-item-list-type-").concat(s),!0)),z=typeof r.linkProps=="string"?JSON.parse(r.linkProps):r.linkProps,he=y?f((typeof D=="function"?D(r):D)||i.createElement(tn,null),function(){return A(r)},a,l.removeFile):null,be=R&&b==="done"?f((typeof $=="function"?$(r):$)||i.createElement(ot,null),function(){return m(r)},a,l.downloadFile):null,ge=s!=="picture-card"&&i.createElement("span",{key:"download-delete",className:X("".concat(a,"-list-item-card-actions"),{picture:s==="picture"})},be,he),oe=X("".concat(a,"-list-item-name")),Re=r.url?[i.createElement("a",C({key:"view",target:"_blank",rel:"noopener noreferrer",className:oe,title:r.name},z,{href:r.url,onClick:function(k){return P(r,k)}}),r.name),ge]:[i.createElement("span",{key:"view",className:oe,onClick:function(k){return P(r,k)},title:r.name},r.name),ge],pe={pointerEvents:"none",opacity:.5},ue=h?i.createElement("a",{href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:r.url||r.thumbUrl?void 0:pe,onClick:function(k){return P(r,k)},title:l.previewFile},typeof U=="function"?U(r):U||i.createElement(qt,null)):null,me=s==="picture-card"&&b!=="uploading"&&i.createElement("span",{className:"".concat(a,"-list-item-actions")},ue,b==="done"&&be,he),E;r.response&&typeof r.response=="string"?E=r.response:E=((M=r.error)===null||M===void 0?void 0:M.statusText)||((_=r.error)===null||_===void 0?void 0:_.message)||l.uploadError;var x=i.createElement("span",{className:ce},J,Re),H=i.useContext(Ve),q=H.getPrefixCls,ae=q(),de=i.createElement("div",{className:xe},i.createElement("div",{className:"".concat(a,"-list-item-info")},x),me,te&&i.createElement(pt,{motionName:"".concat(ae,"-fade"),visible:b==="uploading",motionDeadline:2e3},function(re){var k=re.className,we="percent"in r?i.createElement(Zt,C({},c,{type:"line",percent:r.percent})):null;return i.createElement("div",{className:X("".concat(a,"-list-item-progress"),k)},we)})),Se=X("".concat(a,"-list-").concat(s,"-container"),n),Ce=b==="error"?i.createElement(Wt,{title:E,getPopupContainer:function(k){return k.parentNode}},de):de;return i.createElement("div",{className:Se,style:o,ref:e},u?u(Ce,r,p,{download:m.bind(null,r),preview:P.bind(null,r),remove:A.bind(null,r)}):Ce)});const zn=Bn;var $e=C({},Yt);delete $e.onAppearEnd;delete $e.onEnterEnd;delete $e.onLeaveEnd;var Hn=function(e,a){var n=e.listType,o=n===void 0?"text":n,l=e.previewFile,s=l===void 0?An:l,r=e.onPreview,p=e.onDownload,c=e.onRemove,d=e.locale,f=e.iconRender,u=e.isImageUrl,v=u===void 0?Nn:u,h=e.prefixCls,y=e.items,R=y===void 0?[]:y,U=e.showPreviewIcon,D=U===void 0?!0:U,$=e.showRemoveIcon,P=$===void 0?!0:$,m=e.showDownloadIcon,A=m===void 0?!1:m,M=e.removeIcon,_=e.previewIcon,Q=e.downloadIcon,ie=e.progress,ee=ie===void 0?{strokeWidth:2,showInfo:!1}:ie,b=e.appendAction,B=e.appendActionVisible,O=B===void 0?!0:B,Z=e.itemRender,te=e.disabled,le=Gt(),V=i.useState(!1),ce=Me(V,2),S=ce[0],J=ce[1];i.useEffect(function(){o!=="picture"&&o!=="picture-card"||(R||[]).forEach(function(E){typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(E.originFileObj instanceof File||E.originFileObj instanceof Blob)||E.thumbUrl!==void 0||(E.thumbUrl="",s&&s(E.originFileObj).then(function(x){E.thumbUrl=x||"",le()}))})},[o,R,s]),i.useEffect(function(){J(!0)},[]);var Ie=function(x,H){if(r)return H==null||H.preventDefault(),r(x)},ne=function(x){typeof p=="function"?p(x):x.url&&window.open(x.url)},Ee=function(x){c==null||c(x)},xe=function(x){if(f)return f(x,o);var H=x.status==="uploading",q=v&&v(x)?i.createElement(bn,null):i.createElement(sn,null),ae=H?i.createElement(Ze,null):i.createElement(gn,null);return o==="picture"?ae=H?i.createElement(Ze,null):q:o==="picture-card"&&(ae=H?d.uploading:q),ae},z=function(x,H,q,ae){var de={type:"text",size:"small",title:ae,disabled:te,onClick:function(re){H(),Xe(x)&&x.props.onClick&&x.props.onClick(re)},className:"".concat(q,"-list-item-card-actions-btn")};if(Xe(x)){var Se=Je(x,C(C({},x.props),{onClick:function(){}}));return i.createElement(je,C({},de,{icon:Se}))}return i.createElement(je,C({},de),i.createElement("span",null,x))};i.useImperativeHandle(a,function(){return{handlePreview:Ie,handleDownload:ne}});var he=i.useContext(Ve),be=he.getPrefixCls,ge=he.direction,oe=be("upload",h),Re=X(T(T(T({},"".concat(oe,"-list"),!0),"".concat(oe,"-list-").concat(o),!0),"".concat(oe,"-list-rtl"),ge==="rtl")),pe=ye(R.map(function(E){return{key:E.uid,file:E}})),ue=o==="picture-card"?"animate-inline":"animate",me={motionDeadline:2e3,motionName:"".concat(oe,"-").concat(ue),keys:pe,motionAppear:S};return o!=="picture-card"&&(me=C(C({},$e),me)),i.createElement("div",{className:Re},i.createElement(Tt,C({},me,{component:!1}),function(E){var x=E.key,H=E.file,q=E.className,ae=E.style;return i.createElement(zn,{key:x,locale:d,prefixCls:oe,className:q,style:ae,file:H,items:R,progress:ee,listType:o,isImgUrl:v,showPreviewIcon:D,showRemoveIcon:P,showDownloadIcon:A,removeIcon:M,previewIcon:_,downloadIcon:Q,iconRender:xe,actionIconRender:z,itemRender:Z,onPreview:Ie,onDownload:ne,onClose:Ee})}),b&&i.createElement(pt,C({},me,{visible:O,forceRender:!0}),function(E){var x=E.className,H=E.style;return Je(b,function(q){return{className:X(q.className,x),style:C(C(C({},H),{pointerEvents:x?"none":void 0}),q.style)}})}))},_n=i.forwardRef(Hn);const Vn=_n;var qn=globalThis&&globalThis.__awaiter||function(t,e,a,n){function o(l){return l instanceof a?l:new a(function(s){s(l)})}return new(a||(a=Promise))(function(l,s){function r(d){try{c(n.next(d))}catch(f){s(f)}}function p(d){try{c(n.throw(d))}catch(f){s(f)}}function c(d){d.done?l(d.value):o(d.value).then(r,p)}c((n=n.apply(t,e||[])).next())})},Pe="__LIST_IGNORE_".concat(Date.now(),"__"),Wn=function(e,a){var n=e.fileList,o=e.defaultFileList,l=e.onRemove,s=e.showUploadList,r=s===void 0?!0:s,p=e.listType,c=p===void 0?"text":p,d=e.onPreview,f=e.onDownload,u=e.onChange,v=e.onDrop,h=e.previewFile,y=e.disabled,R=e.locale,U=e.iconRender,D=e.isImageUrl,$=e.progress,P=e.prefixCls,m=e.className,A=e.type,M=A===void 0?"select":A,_=e.children,Q=e.style,ie=e.itemRender,ee=e.maxCount,b=e.data,B=b===void 0?{}:b,O=e.multiple,Z=O===void 0?!1:O,te=e.action,le=te===void 0?"":te,V=e.accept,ce=V===void 0?"":V,S=e.supportServerRender,J=S===void 0?!0:S,Ie=i.useContext(Nt),ne=y??Ie,Ee=Kt(o||[],{value:n,postState:function(I){return I??[]}}),xe=Me(Ee,2),z=xe[0],he=xe[1],be=i.useState("drop"),ge=Me(be,2),oe=ge[0],Re=ge[1],pe=i.useRef(null);i.useMemo(function(){var W=Date.now();(n||[]).forEach(function(I,L){!I.uid&&!Object.isFrozen(I)&&(I.uid="__AUTO__".concat(W,"_").concat(L,"__"))})},[n]);var ue=function(I,L,N){var g=ye(L);ee===1?g=g.slice(-1):ee&&(g=g.slice(0,ee)),Ge.flushSync(function(){he(g)});var F={file:I,fileList:g};N&&(F.event=N),Ge.flushSync(function(){u==null||u(F)})},me=function(I,L){return qn(void 0,void 0,void 0,De().mark(function N(){var g,F,Y,G;return De().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(g=e.beforeUpload,F=e.transformFile,Y=I,!g){j.next=13;break}return j.next=5,g(I,L);case 5:if(G=j.sent,G!==!1){j.next=8;break}return j.abrupt("return",!1);case 8:if(delete I[Pe],G!==Pe){j.next=12;break}return Object.defineProperty(I,Pe,{value:!0,configurable:!0}),j.abrupt("return",!1);case 12:ft(G)==="object"&&G&&(Y=G);case 13:if(!F){j.next=17;break}return j.next=16,F(Y);case 16:Y=j.sent;case 17:return j.abrupt("return",Y);case 18:case"end":return j.stop()}},N)}))},E=function(I){var L=I.filter(function(F){return!F.file[Pe]});if(L.length){var N=L.map(function(F){return Fe(F.file)}),g=ye(z);N.forEach(function(F){g=Le(F,g)}),N.forEach(function(F,Y){var G=F;if(L[Y].parsedFile)F.status="uploading";else{var fe=F.originFileObj,j;try{j=new File([fe],fe.name,{type:fe.type})}catch{j=new Blob([fe],{type:fe.type}),j.name=fe.name,j.lastModifiedDate=new Date,j.lastModified=new Date().getTime()}j.uid=F.uid,G=j}ue(G,g)})}},x=function(I,L,N){try{typeof I=="string"&&(I=JSON.parse(I))}catch{}if(Be(L,z)){var g=Fe(L);g.status="done",g.percent=100,g.response=I,g.xhr=N;var F=Le(g,z);ue(g,F)}},H=function(I,L){if(Be(L,z)){var N=Fe(L);N.status="uploading",N.percent=I.percent;var g=Le(N,z);ue(N,g,I)}},q=function(I,L,N){if(Be(N,z)){var g=Fe(N);g.error=I,g.response=L,g.status="error";var F=Le(g,z);ue(g,F)}},ae=function(I){var L;Promise.resolve(typeof l=="function"?l(I):l).then(function(N){var g;if(N!==!1){var F=On(I,z);F&&(L=C(C({},I),{status:"removed"}),z==null||z.forEach(function(Y){var G=L.uid!==void 0?"uid":"name";Y[G]===L[G]&&!Object.isFrozen(Y)&&(Y.status="removed")}),(g=pe.current)===null||g===void 0||g.abort(L),ue(L,F))}})},de=function(I){Re(I.type),I.type==="drop"&&(v==null||v(I))};i.useImperativeHandle(a,function(){return{onBatchStart:E,onSuccess:x,onProgress:H,onError:q,fileList:z,upload:pe.current}});var Se=i.useContext(Ve),Ce=Se.getPrefixCls,re=Se.direction,k=Ce("upload",P),we=C(C({onBatchStart:E,onError:q,onProgress:H,onSuccess:x},e),{data:B,multiple:Z,action:le,accept:ce,supportServerRender:J,prefixCls:k,disabled:ne,beforeUpload:me,onChange:void 0});delete we.className,delete we.style,(!_||ne)&&delete we.id;var Oe=function(I,L){return r?i.createElement(At,{componentName:"Upload",defaultLocale:Bt.Upload},function(N){var g=typeof r=="boolean"?{}:r,F=g.showRemoveIcon,Y=g.showPreviewIcon,G=g.showDownloadIcon,fe=g.removeIcon,j=g.previewIcon,Ye=g.downloadIcon;return i.createElement(Vn,{prefixCls:k,listType:c,items:z,previewFile:h,onPreview:d,onDownload:f,onRemove:ae,showRemoveIcon:!ne&&F,showPreviewIcon:Y,showDownloadIcon:G,removeIcon:fe,previewIcon:j,downloadIcon:Ye,iconRender:U,locale:C(C({},N),R),isImageUrl:D,progress:$,appendAction:I,appendActionVisible:L,itemRender:ie,disabled:ne})}):I};if(M==="drag"){var wt=X(k,T(T(T(T(T({},"".concat(k,"-drag"),!0),"".concat(k,"-drag-uploading"),z.some(function(W){return W.status==="uploading"})),"".concat(k,"-drag-hover"),oe==="dragover"),"".concat(k,"-disabled"),ne),"".concat(k,"-rtl"),re==="rtl"),m);return i.createElement("span",null,i.createElement("div",{className:wt,onDrop:de,onDragOver:de,onDragLeave:de,style:Q},i.createElement(_e,C({},we,{ref:pe,className:"".concat(k,"-btn")}),i.createElement("div",{className:"".concat(k,"-drag-container")},_))),Oe())}var yt=X(k,T(T(T(T({},"".concat(k,"-select"),!0),"".concat(k,"-select-").concat(c),!0),"".concat(k,"-disabled"),ne),"".concat(k,"-rtl"),re==="rtl")),It=function(I){return i.createElement("div",{className:yt,style:I},i.createElement(_e,C({},we,{ref:pe})))},We=It(_?void 0:{display:"none"});return c==="picture-card"?i.createElement("span",{className:X("".concat(k,"-picture-card-wrapper"),m)},Oe(We,!!_)):i.createElement("span",{className:m},We,Oe())},Yn=i.forwardRef(Wn);const ht=Yn;var Gn=globalThis&&globalThis.__rest||function(t,e){var a={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(a[n[o]]=t[n[o]]);return a},Kn=i.forwardRef(function(t,e){var a=t.style,n=t.height,o=Gn(t,["style","height"]);return i.createElement(ht,C({ref:e},o,{type:"drag",style:C(C({},a),{height:n})}))});const Jn=Kn;var qe=ht;qe.Dragger=Jn;qe.LIST_IGNORE=Pe;const gt=qe;const ke={normal:"#7776",issue:"#d8f436",ill:"#f4b836",error:"#f44336"},Xn={[K.Discard]:"RosyBrown",[K.Solved]:"GreenYellow",[K.Issue]:"orange",[K.Fatal]:"red"},Zn={[K.Discard]:"-",[K.Issue]:"*",[K.Fatal]:"**"};function Qn(t,e){if(e)return Xn[e.status]??ke.normal;if(!t)return ke.normal;const a=t.tickTwist,n=t.tickRatesInStaves;if(n!=null&&n.some(o=>o<0)||a>=1)return ke.error;try{if(t.hasIllEvent||a>.36)return ke.ill}catch{}return ke.normal}function ea(t){return t?Zn[t.status]??"":""}const ta=i.memo(({stand:t,spartito:e,issueMeasures:a,onMeasureClick:n,selectedMeasureIndex:o})=>{if(!t||t.systems.length===0)return null;const l=2,s=t.maxWidth+l*2,r=t.totalHeight+l*2,p=e==null?void 0:e.measures,c=i.useMemo(()=>{const d=new Map;if(a)for(const f of a)d.set(f.measureIndex,f);return d},[a]);return w.jsx("svg",{className:"spartito-stand",viewBox:`${-l} ${-l} ${s} ${r}`,style:{width:"100%",height:"auto"},children:t.systems.map(d=>{const f=d.staffImages.length>0?d.staffImages[0].position.y:0;return w.jsxs("g",{transform:`translate(0, ${d.y})`,children:[d.staffImages.map((u,v)=>w.jsx("image",{href:u.url,x:u.position.x,y:u.position.y,width:u.position.width,height:u.position.height,preserveAspectRatio:"none"},v)),d.measures.map(u=>{const v=u.measureIndex===o,h=p==null?void 0:p[u.measureIndex],y=c.get(u.measureIndex),R=Qn(h,y),U=h&&h.regulationHash!=h.regulationHash0,D=f-1;return w.jsxs("g",{onClick:()=>n(u.measureIndex),children:[w.jsx("rect",{className:`spartito-measure-rect ${v?"selected":""}`,x:u.left,y:0,width:u.right-u.left,height:d.height}),w.jsxs("text",{className:"spartito-measure-index",x:u.left+.5,y:D,fontSize:2.6,fontWeight:"bold",fill:R,children:[ea(y),u.measureIndex+1,y!=null&&y.annotator?w.jsx("tspan",{dy:"-1",fontSize:"1.6px",fill:"DodgerBlue",children:"★"}):null,U?w.jsx("tspan",{y:D-.8,fontSize:"2px",children:"⚠"}):null]})]},u.measureIndex)})]},d.systemIndex)})})}),nt=5;function at(t){var l;const e=new Map;for(const s of t.measures){const r=s.position.systemIndex;e.has(r)||e.set(r,[]),e.get(r).push(s)}const a=[];let n=0;const o=Array.from(e.keys()).sort((s,r)=>s-r);for(const s of o){const r=e.get(s),p=r[0],c=p.backgroundImages||[];let d=0,f=0;if(c.length>0)f=Math.min(...c.map(y=>y.position.y)),d=Math.max(...c.map(y=>y.position.y+y.position.height))-f;else if((l=p.position.staffYs)!=null&&l.length){const h=p.position.staffYs;d=h[h.length-1]-h[0]+24}const u=c.map(h=>({...h,position:{...h.position,y:h.position.y-f}})),v=Math.max(...r.map(h=>h.position.right));a.push({systemIndex:s,y:n,height:d,width:v,staffImages:u,measures:r.map(h=>({measureIndex:h.measureIndex,left:h.position.left,right:h.position.right}))}),n+=d+nt}return{systems:a,totalHeight:n-(a.length>0?nt:0),maxWidth:Math.max(...a.map(s=>s.width),0)}}function na(t){var p;const e=new Map;for(const c of t.measures){const d=c.position.systemIndex;e.has(d)||e.set(d,[]),e.get(d).push(c)}const n=Array.from(e.keys()).sort((c,d)=>c-d).map(c=>{const d=e.get(c),f=d[0],u=f.backgroundImages||[],v=Math.max(...d.map(m=>m.position.right)),h=u.filter(m=>m.original!==!1),y=f.position.staffYs||[],R=y.length||t.stavesCount||0,U=d.map(m=>m.position.right);let D,$,P;return h.length>=R&&R>0?P=h.map(m=>new Ke({backgroundImage:m.url,imagePosition:m.position,top:0,height:m.position.height,staffY:m.position.y+m.position.height/2,maskImage:null,measureCount:d.length})):h.length>0&&R>h.length&&(D=h[0].url,$=h[0].position,y.length>=R&&(P=y.map((m,A)=>new Ke({top:m-10/2,height:10,staffY:10/2,maskImage:null,measureBars:U})))),new Pt({stavesCount:(P==null?void 0:P.length)||R||t.stavesCount,staves:(P==null?void 0:P.length)>0?P:void 0,backgroundImage:D,imagePosition:$,width:v,left:0,top:0,measureCount:d.length,measureBars:U,semantics:[],sidBlackList:[],sidWhiteList:[]})}),o=new Mt({width:794,height:1122,systems:n,semantics:[]}),l=new Ut({title:"Spartito",pages:[o],staffLayoutCode:((p=t.staffGroups)==null?void 0:p.map(c=>c.length>1?`{${c.map(()=>"-").join("")}}`:"-").join(","))||"",settings:{enabledGauge:!1,pageLayoutMethod:Ft.ByLines,semanticConfidenceThreshold:1}}),s=l.staffLayout,r=s.standaloneGroups.map(c=>c.map(d=>s.staffIds.indexOf(d)));return t.staffGroups=r,t.measures.forEach(c=>c.staffGroups=r),l.spartito=t,l.patches=[],l}const{Header:aa,Content:ra}=mt,{Dragger:oa}=gt,sa=async t=>{let e=null;try{const a=await Ht();e=a==null?void 0:a.omrDomain}catch{}for(const a of t.measures)if(a.backgroundImages)for(const n of a.backgroundImages)n.url.startsWith("md5:")&&(n.url=`/uploads/${n.url.replace("md5:","")}`)},rt=t=>{const e=[];for(const a of t.measures){if(!a.regulated)continue;const n=Lt(a);(!n||n.error||!n.fine)&&e.push({scoreId:null,status:n!=null&&n.error?K.Fatal:K.Issue,measureIndex:a.measureIndex,hash:a.regulationHash0,lastUpdate:null,measure:new He(a)})}return e},ia=async(t,e,a)=>{if(!a)return t;try{const n=await _t.get(`/api/scores/${a}/issueMeasures`,{params:{limit:1e3}}),o=n==null?void 0:n.rows;if(console.log("[spartito] fetchAndMerge: scoreId=%s, resp=%o, fetched=%d, localIssues=%d",a,n,(o==null?void 0:o.length)??0,t.length),!(o!=null&&o.length))return t;const l=new Map;for(const f of o)f.hash&&l.set(f.hash,f);const s=new Map;for(const[f,u]of l)u.measure&&s.set(f,st(u.measure,it));const r=(f,u)=>{var y;const v=s.get(f);if(!v)return;const h=(y=e.measures[u])==null?void 0:y.backgroundImages;e.measures[u]=new Dt(v),h&&(e.measures[u].backgroundImages=h)},p=new Set,c=t.map(f=>{const u=f.hash?l.get(f.hash):null;return u?(p.add(f.hash),r(f.hash,f.measureIndex),{...f,status:u.status,annotator:u.annotator,lastUpdate:u.lastUpdate,id:u.id,measure:new He(e.measures[f.measureIndex])}):f}),d=new Set(c.map(f=>f.measureIndex));for(const[f,u]of l)if(!p.has(f))for(const v of e.measures)v.regulationHash0===f&&!d.has(v.measureIndex)&&(r(f,v.measureIndex),c.push({scoreId:u.scoreId,status:u.status,measureIndex:v.measureIndex,hash:u.hash,lastUpdate:u.lastUpdate,measure:new He(e.measures[v.measureIndex]),annotator:u.annotator,id:u.id}),d.add(v.measureIndex));return console.log("[spartito] merged:",c.map(f=>`m${f.measureIndex}:status=${f.status},ann=${f.annotator||"-"}`)),c}catch(n){return console.warn("Failed to fetch annotations for score:",n),t}},ba=()=>{var _,Q,ie,ee;const[t,e]=i.useState(null),[a,n]=i.useState(null),[o,l]=i.useState(null),[s,r]=St(),[[p,c],[d,f],u]=Ct(),[v,h]=i.useState("mask"),y=i.useRef(!1),R=i.useMemo(()=>(o==null?void 0:o.replace(/\.spartito\.json$/i,"").replace(/\.json$/i,""))||null,[o]),U=i.useMemo(()=>({edit:!0,id:R}),[R]),D=i.useMemo(()=>new Rt,[]),$=i.useCallback(async b=>{try{const B=await b.text(),O=st(B,it);await sa(O);const Z=rt(O),te=b.name.replace(/\.spartito\.json$/i,"").replace(/\.json$/i,""),le=await ia(Z,O,te),V=na(O);await kt(V,{solutionStore:D,onlyFetchCache:!0}),y.current=!0,r(V),e(O),n(at(O)),c(le),f(null),l(b.name)}catch(B){console.error("Failed to load spartito:",B),zt.error(`Failed to load spartito: ${B.message}`)}return!1},[D]);i.useEffect(()=>{var b,B;if(y.current){y.current=!1;return}((B=(b=s==null?void 0:s.spartito)==null?void 0:b.measures)==null?void 0:B.length)>0&&o&&(e(s.spartito),n(at(s.spartito)),c(O=>{const Z=new Map,te=new Map;if(O)for(const S of O)S.hash&&!Z.has(S.hash)&&Z.set(S.hash,S),te.set(S.measureIndex,S);const le=rt(s.spartito),V=new Set,ce=le.map(S=>{V.add(S.measureIndex);const J=te.get(S.measureIndex)||(S.hash?Z.get(S.hash):null);return J?{...S,status:J.status,annotator:J.annotator,id:J.id,lastUpdate:J.lastUpdate}:S});if(O)for(const S of O)!V.has(S.measureIndex)&&(S.annotator||S.status===K.Solved||S.status===K.Discard||S.id)&&(ce.push(S),V.add(S.measureIndex));return ce}))},[s]);const P=i.useCallback(b=>{f(b)},[]),m=i.useCallback(()=>{f(null)},[]),A=i.useCallback(()=>{if(!(s!=null&&s.spartito))return;const b=JSON.stringify(s.spartito.toJSON(),null," "),B=new Blob([b],{type:"application/json"}),O=document.createElement("a");O.href=URL.createObjectURL(B),O.download=(o==null?void 0:o.replace(".json","-annotated.json"))||"annotated.spartito.json",O.click()},[s,o]),M=i.useMemo(()=>{if(!(p!=null&&p.length))return null;const b={issue:0,fatal:0,solved:0};for(const B of p)B.status===K.Issue?b.issue++:B.status===K.Fatal?b.fatal++:B.status===K.Solved&&b.solved++;return b},[p]);return w.jsxs(Et.Provider,{value:U,children:[w.jsx("svg",{width:"0",height:"0",style:{position:"absolute",visibility:"hidden"},children:w.jsx(bt,{})}),w.jsxs(mt,{className:"spartito-page",children:[w.jsx(aa,{className:"spartito-header",children:w.jsxs(Jt,{style:{width:"100%",display:"flex",justifyContent:"space-between"},gutter:16,children:[w.jsxs(Qe,{style:{display:"flex",alignItems:"center"},children:[w.jsx(Xt,{to:"/",className:"spartito-logo",children:"STARRY"}),w.jsx("span",{style:{fontSize:14,color:"#666"},children:o||"Spartito"})]}),t&&w.jsx(Qe,{style:{display:"flex",alignItems:"center"},children:w.jsxs(et,{size:16,children:[w.jsxs("span",{style:{fontSize:13,color:"#999"},children:[t.measures.length," measures",M&&M.issue>0&&` · ${M.issue} issue`,M&&M.fatal>0&&` · ${M.fatal} fatal`,M&&M.solved>0&&` · ${M.solved} solved`]}),w.jsx(je,{size:"small",icon:w.jsx(ot,{}),onClick:A,children:"Download"}),w.jsx(gt,{accept:".json",showUploadList:!1,beforeUpload:$,children:w.jsx(je,{size:"small",icon:w.jsx(kn,{}),children:"Re-upload"})})]})})]})}),w.jsx(ra,{className:"spartito-content",children:t?w.jsx(ta,{stand:a,spartito:t,issueMeasures:p,onMeasureClick:P,selectedMeasureIndex:d}):w.jsx("div",{style:{padding:48,maxWidth:600,margin:"80px auto 0"},children:w.jsxs(oa,{accept:".json",showUploadList:!1,beforeUpload:$,children:[w.jsx("p",{className:"ant-upload-drag-icon",children:w.jsx(fn,{})}),w.jsx("p",{className:"ant-upload-text",children:"Click or drag a .spartito.json file"})]})})}),((Q=(_=s.spartito)==null?void 0:_.measures)==null?void 0:Q.length)>0&&w.jsx(Qt,{title:u?w.jsxs(et,{size:20,children:[w.jsxs("div",{children:["Measure #",u.measureIndex+1]}),(ee=(ie=u.measure.basics)==null?void 0:ie[0])!=null&&ee.timeSignature?w.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",lineHeight:1.1,fontWeight:"bold"},children:[w.jsx("span",{children:u.measure.basics[0].timeSignature.numerator}),w.jsx("span",{children:u.measure.basics[0].timeSignature.denominator})]}):null,w.jsx(en,{checked:v==="mask",onChange:()=>h(v==="mask"?"origin":"mask"),checkedChildren:"Background",unCheckedChildren:"Original"})]}):null,open:!!u,closable:!0,destroyOnClose:!0,footer:null,mask:!0,width:"98vw",onClose:m,children:u?w.jsx(xt,{bgMode:v,style:{width:"300px"},score:s,record:u,onClose:m}):null})]})]})};export{ba as default};
|
dist/assets/index-11d8c807.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.playground{min-height:100vh;display:flex;flex-direction:column;background-color:#eee}.playground.hover{background-color:#efe}.header{flex:0 0 4em;box-shadow:0 0 4px #0004;background-color:#fff;position:sticky;z-index:100;width:100%;height:auto!important;display:flex}.header.admin{background-color:#fafad2}.header.admin .logo:after{content:"#";position:relative;top:-.5em;font-size:70%}.header.edit{background-color:gold}.logo{font-size:26px;font-weight:700;margin-right:20px;color:#000}.logo:hover{text-decoration:none}.updateTime{font-size:80%}.glyphItem{width:50px;height:50px;border:1px solid #999;display:block;float:left}.zoomControl{position:fixed;right:20px;bottom:0;width:100px;height:40px;z-index:10;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.percentText{width:40px;text-align:center;cursor:pointer}.titleInput{width:200px;height:36px;position:relative}.titleInput input{height:100%}.uploadItem{position:relative;padding:10px}.uploadItem img{position:absolute;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.uploadActionsLayer{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;display:flex;justify-content:center;align-items:center}.uploadActionsLayer:hover{opacity:1;background-color:#00000080;z-index:10}.sourceImageList{width:100%;overflow-x:scroll}.playControlBtn{color:#999;font-size:26px;vertical-align:middle}.playControlBtn:hover,.playControlBtnActive{color:#1b9aee}.marking-body{position:relative;width:100%;display:flex;justify-content:space-between;align-items:stretch;background:linear-gradient(90deg,#fff6f6 0%,#fff 50%,#f6fff6 100%);border-top:4px solid #111;border-bottom:4px solid #111;-webkit-user-select:none;-moz-user-select:none;user-select:none}.marking-col{display:flex;flex-direction:column;align-items:stretch;flex:1;flex-shrink:0;overflow-x:scroll;white-space:nowrap}.marking-col::-webkit-scrollbar{display:none}.marking-col:last-child>div{border-left:4px solid #111}.marking-col:first-child>div{border-right:4px solid #111}.with-coord{position:relative;line-height:0;display:inline-block;outline:1px solid rgba(153,153,153,.33);cursor:pointer}.with-coord:hover,.with-coord.active{background-color:#dedee380}.with-coord.white{background-color:#edffe8}.with-coord.black{background-color:#ffe8e8}.with-coord:before{content:"";display:block;position:absolute;left:0;top:50%;width:100%;height:0;border-bottom:1px dashed rgba(70,130,180,.35);transform:translateY(-50%)}.with-coord:after{content:"";display:block;position:absolute;left:50%;top:0;width:0;height:100%;border-right:1px dashed rgba(70,130,180,.35);transform:translate(-50%)}.zoom-box{position:fixed;top:65px;left:0;width:20vw;height:20vw;background-color:#efefefaa;box-shadow:0 0 5px 5px #0000001a;pointer-events:none;font-size:160%}.zoom-box .id{font-size:60%}.marking-tag{background-color:#dedee3;box-shadow:0 1px #9e9e9e inset;flex-shrink:0;cursor:pointer}.marking-tag.checked{background-color:#e6fafd;font-weight:700}.staffTplRow{width:100%;padding-left:10px;cursor:pointer}.staffTplRow:hover{background-color:#efefef}.staffTplRow.current{background-color:#fba5;font-weight:700}.ReactCrop{position:relative;display:inline-block;cursor:crosshair;overflow:hidden;max-width:100%}.ReactCrop:focus{outline:none}.ReactCrop--disabled,.ReactCrop--locked{cursor:inherit}.ReactCrop__image{display:block;max-width:100%;-ms-touch-action:none;touch-action:none}.ReactCrop__crop-selection{position:absolute;top:0;left:0;-webkit-transform:translate3d(0,0,0);transform:translateZ(0);-webkit-box-sizing:border-box;box-sizing:border-box;cursor:move;-webkit-box-shadow:0 0 0 9999em rgba(0,0,0,.5);box-shadow:0 0 0 9999em #00000080;-ms-touch-action:none;touch-action:none;border:1px solid;border-image-source:url(data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==);border-image-slice:1;border-image-repeat:repeat}.ReactCrop--disabled .ReactCrop__crop-selection{cursor:inherit}.ReactCrop--circular-crop .ReactCrop__crop-selection{border-radius:50%;-webkit-box-shadow:0px 0px 1px 1px white,0 0 0 9999em rgba(0,0,0,.5);box-shadow:0 0 1px 1px #fff,0 0 0 9999em #00000080}.ReactCrop--invisible-crop .ReactCrop__crop-selection{display:none}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after,.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{content:"";display:block;position:absolute;background-color:#fff6}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after{width:1px;height:100%}.ReactCrop__rule-of-thirds-vt:before{left:33.3333%;left:calc(100% / 3)}.ReactCrop__rule-of-thirds-vt:after{left:66.6666%;left:calc(100% / 3 * 2)}.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{width:100%;height:1px}.ReactCrop__rule-of-thirds-hz:before{top:33.3333%;top:calc(100% / 3)}.ReactCrop__rule-of-thirds-hz:after{top:66.6666%;top:calc(100% / 3 * 2)}.ReactCrop__drag-handle{position:absolute}.ReactCrop__drag-handle:after{position:absolute;content:"";display:block;width:10px;height:10px;background-color:#0003;border:1px solid rgba(255,255,255,.7);-webkit-box-sizing:border-box;box-sizing:border-box;outline:1px solid transparent}.ReactCrop .ord-nw{top:0;left:0;margin-top:-5px;margin-left:-5px;cursor:nw-resize}.ReactCrop .ord-nw:after{top:0;left:0}.ReactCrop .ord-n{top:0;left:50%;margin-top:-5px;margin-left:-5px;cursor:n-resize}.ReactCrop .ord-n:after{top:0}.ReactCrop .ord-ne{top:0;right:0;margin-top:-5px;margin-right:-5px;cursor:ne-resize}.ReactCrop .ord-ne:after{top:0;right:0}.ReactCrop .ord-e{top:50%;right:0;margin-top:-5px;margin-right:-5px;cursor:e-resize}.ReactCrop .ord-e:after{right:0}.ReactCrop .ord-se{bottom:0;right:0;margin-bottom:-5px;margin-right:-5px;cursor:se-resize}.ReactCrop .ord-se:after{bottom:0;right:0}.ReactCrop .ord-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px;cursor:s-resize}.ReactCrop .ord-s:after{bottom:0}.ReactCrop .ord-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px;cursor:sw-resize}.ReactCrop .ord-sw:after{bottom:0;left:0}.ReactCrop .ord-w{top:50%;left:0;margin-top:-5px;margin-left:-5px;cursor:w-resize}.ReactCrop .ord-w:after{left:0}.ReactCrop__disabled .ReactCrop__drag-handle{cursor:inherit}.ReactCrop__drag-bar{position:absolute}.ReactCrop__drag-bar.ord-n{top:0;left:0;width:100%;height:6px;margin-top:-3px}.ReactCrop__drag-bar.ord-e{right:0;top:0;width:6px;height:100%;margin-right:-3px}.ReactCrop__drag-bar.ord-s{bottom:0;left:0;width:100%;height:6px;margin-bottom:-3px}.ReactCrop__drag-bar.ord-w{top:0;left:0;width:6px;height:100%;margin-left:-3px}.ReactCrop--new-crop .ReactCrop__drag-bar,.ReactCrop--new-crop .ReactCrop__drag-handle,.ReactCrop--fixed-aspect .ReactCrop__drag-bar,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w{display:none}@media (pointer: coarse){.ReactCrop .ord-n,.ReactCrop .ord-e,.ReactCrop .ord-s,.ReactCrop .ord-w{display:none}.ReactCrop__drag-handle{width:24px;height:24px}}.page{width:100%;height:100%;display:inline-block;position:absolute;top:0;left:0;background-repeat:no-repeat;background-size:contain;pointer-events:auto;overflow:hidden}.page .corner-number{position:absolute;color:#06ac;font-size:14px;font-weight:700;left:.2em;top:-1.2em;-webkit-user-select:none;-moz-user-select:none;user-select:none}.page .bottom-controls{position:absolute;left:1em;bottom:1em}.page .bottom-controls>span{display:inline-block;border:1px solid #ccc;font-size:32px;font-weight:700;padding:.4em;border-radius:.4em;cursor:pointer;color:#777}.page .bottom-controls>span+span{margin-left:1em}.page .bottom-controls>span i{display:inline-block;margin:0 .2em}.page .new-system{width:2.4em;color:#ccc;position:relative}.page .new-system:after{content:"+";font-size:40px;position:absolute;left:70%;top:50%;transform:translate(-50%,-50%)}.page .graph{width:100%}.page .graph .staff-lines line,.page .graph .measure-bars line{stroke:#000;stroke-width:.1}.page .graph .staff-lines{pointer-events:none}.page .graph image.background{pointer-events:none;opacity:.3}.page .graph.original image.background{opacity:1}.page .graph .connection{stroke:#000;stroke-width:.1}.page .graph .measure .pad{fill:transparent}.page .graph .measure .pad.highlight{fill:#00ff0021}.page .graph .measure .pad.issue{fill:#d8f43615}.page .graph .measure .pad.ill{fill:#f4b8362a}.page .graph .measure .pad.error{fill:#f443362a}.page .graph .measure:hover .pad,.page .graph .measure.focus .pad{fill:#00ff0021}.page .graph .measure:hover .pad.error,.page .graph .measure.focus .pad.error{fill:#f4433659}.page .graph .measure .chord-rect{fill:#cfca;stroke:#cfc;stroke-width:.1}.page .graph .pan-handle{cursor:move}.page .graph .pan-handle use{fill:#fff;stroke:#0006}.page .graph .pan-handle.holding use{fill:#fdd;stroke:transparent}.page .graph .measure-bar .pan-handle{cursor:col-resize}.page .graph .remove{cursor:pointer}.page .graph .remove use{stroke:#777;fill:transparent}.page .graph .remove:hover use{stroke:red}.page .graph .locator use{stroke:transparent}.page .graph .cursor-token{pointer-events:none}.page .graph .cursor-token use{fill:#0004}.page .graph .cursor-token.active use{fill:#04c}.page .graph .token{-webkit-user-select:none;-moz-user-select:none;user-select:none;color:#4682b4}.page .graph .token .remove{display:none}.page .graph .token.non-glyph{color:#00c2}.page .graph .token.octave-shift{font-weight:700;color:#8a2be2}.page .graph .token.highlight use{color:#f44336}.page .graph .token text.Title{font-weight:700;fill:#333}.page .graph .token text.Author{fill:#355}.page .graph .token text.TempoNumeral{fill:#050;fill-opacity:.2}.page .graph .token text.TempoNumeral:hover{fill-opacity:1}.page .graph .token text.annotated{fill:orange;font-style:italic}.page .graph .anti.tokens .token{color:#fff}.page .graph .semantic[data-semantic-index="1"]{fill:#e62019}.page .graph .semantic[data-semantic-index="2"]{fill:#e62719}.page .graph .semantic[data-semantic-index="3"]{fill:#e62e19}.page .graph .semantic[data-semantic-index="4"]{fill:#e63519}.page .graph .semantic[data-semantic-index="5"]{fill:#e63b19}.page .graph .semantic[data-semantic-index="6"]{fill:#e64219}.page .graph .semantic[data-semantic-index="7"]{fill:#e64919}.page .graph .semantic[data-semantic-index="8"]{fill:#e65019}.page .graph .semantic[data-semantic-index="9"]{fill:#e65719}.page .graph .semantic[data-semantic-index="10"]{fill:#e65e19}.page .graph .semantic[data-semantic-index="11"]{fill:#e66419}.page .graph .semantic[data-semantic-index="12"]{fill:#e66b19}.page .graph .semantic[data-semantic-index="13"]{fill:#e67219}.page .graph .semantic[data-semantic-index="14"]{fill:#e67919}.page .graph .semantic[data-semantic-index="15"]{fill:#e68019}.page .graph .semantic[data-semantic-index="16"]{fill:#e68619}.page .graph .semantic[data-semantic-index="17"]{fill:#e68d19}.page .graph .semantic[data-semantic-index="18"]{fill:#e69419}.page .graph .semantic[data-semantic-index="19"]{fill:#e69b19}.page .graph .semantic[data-semantic-index="20"]{fill:#e6a219}.page .graph .semantic[data-semantic-index="21"]{fill:#e6a819}.page .graph .semantic[data-semantic-index="22"]{fill:#e6af19}.page .graph .semantic[data-semantic-index="23"]{fill:#e6b619}.page .graph .semantic[data-semantic-index="24"]{fill:#e6bd19}.page .graph .semantic[data-semantic-index="25"]{fill:#e6c419}.page .graph .semantic[data-semantic-index="26"]{fill:#e6ca19}.page .graph .semantic[data-semantic-index="27"]{fill:#e6d119}.page .graph .semantic[data-semantic-index="28"]{fill:#e6d819}.page .graph .semantic[data-semantic-index="29"]{fill:#e6df19}.page .graph .semantic[data-semantic-index="30"]{fill:#e5e619}.page .graph .semantic[data-semantic-index="31"]{fill:#dfe619}.page .graph .semantic[data-semantic-index="32"]{fill:#d8e619}.page .graph .semantic[data-semantic-index="33"]{fill:#d1e619}.page .graph .semantic[data-semantic-index="34"]{fill:#cae619}.page .graph .semantic[data-semantic-index="35"]{fill:#c3e619}.page .graph .semantic[data-semantic-index="36"]{fill:#bde619}.page .graph .semantic[data-semantic-index="37"]{fill:#b6e619}.page .graph .semantic[data-semantic-index="38"]{fill:#afe619}.page .graph .semantic[data-semantic-index="39"]{fill:#a8e619}.page .graph .semantic[data-semantic-index="40"]{fill:#a1e619}.page .graph .semantic[data-semantic-index="41"]{fill:#9be619}.page .graph .semantic[data-semantic-index="42"]{fill:#94e619}.page .graph .semantic[data-semantic-index="43"]{fill:#8de619}.page .graph .semantic[data-semantic-index="44"]{fill:#86e619}.page .graph .semantic[data-semantic-index="45"]{fill:#80e619}.page .graph .semantic[data-semantic-index="46"]{fill:#79e619}.page .graph .semantic[data-semantic-index="47"]{fill:#72e619}.page .graph .semantic[data-semantic-index="48"]{fill:#6be619}.page .graph .semantic[data-semantic-index="49"]{fill:#64e619}.page .graph .semantic[data-semantic-index="50"]{fill:#5de619}.page .graph .semantic[data-semantic-index="51"]{fill:#57e619}.page .graph .semantic[data-semantic-index="52"]{fill:#50e619}.page .graph .semantic[data-semantic-index="53"]{fill:#49e619}.page .graph .semantic[data-semantic-index="54"]{fill:#42e619}.page .graph .semantic[data-semantic-index="55"]{fill:#3ce619}.page .graph .semantic[data-semantic-index="56"]{fill:#35e619}.page .graph .semantic[data-semantic-index="57"]{fill:#2ee619}.page .graph .semantic[data-semantic-index="58"]{fill:#27e619}.page .graph .semantic[data-semantic-index="59"]{fill:#20e619}.page .graph .semantic[data-semantic-index="60"]{fill:#19e619}.page .graph .semantic[data-semantic-index="61"]{fill:#19e620}.page .graph .semantic[data-semantic-index="62"]{fill:#19e627}.page .graph .semantic[data-semantic-index="63"]{fill:#19e62e}.page .graph .semantic[data-semantic-index="64"]{fill:#19e635}.page .graph .semantic[data-semantic-index="65"]{fill:#19e63c}.page .graph .semantic[data-semantic-index="66"]{fill:#19e642}.page .graph .semantic[data-semantic-index="67"]{fill:#19e649}.page .graph .semantic[data-semantic-index="68"]{fill:#19e650}.page .graph .semantic[data-semantic-index="69"]{fill:#19e657}.page .graph .semantic[data-semantic-index="70"]{fill:#19e65e}.page .graph .semantic[data-semantic-index="71"]{fill:#19e664}.page .graph .semantic[data-semantic-index="72"]{fill:#19e66b}.page .graph .semantic[data-semantic-index="73"]{fill:#19e672}.page .graph .semantic[data-semantic-index="74"]{fill:#19e679}.page .graph .semantic[data-semantic-index="75"]{fill:#19e680}.page .graph .semantic[data-semantic-index="76"]{fill:#19e686}.page .graph .semantic[data-semantic-index="77"]{fill:#19e68d}.page .graph .semantic[data-semantic-index="78"]{fill:#19e694}.page .graph .semantic[data-semantic-index="79"]{fill:#19e69b}.page .graph .semantic[data-semantic-index="80"]{fill:#19e6a2}.page .graph .semantic[data-semantic-index="81"]{fill:#19e6a8}.page .graph .semantic[data-semantic-index="82"]{fill:#19e6af}.page .graph .semantic[data-semantic-index="83"]{fill:#19e6b6}.page .graph .semantic[data-semantic-index="84"]{fill:#19e6bd}.page .graph .semantic[data-semantic-index="85"]{fill:#19e6c4}.page .graph .semantic[data-semantic-index="86"]{fill:#19e6ca}.page .graph .semantic[data-semantic-index="87"]{fill:#19e6d1}.page .graph .semantic[data-semantic-index="88"]{fill:#19e6d8}.page .graph .semantic[data-semantic-index="89"]{fill:#19e6df}.page .graph .semantic[data-semantic-index="90"]{fill:#19e5e6}.page .graph .semantic[data-semantic-index="91"]{fill:#19dfe6}.page .graph .semantic[data-semantic-index="92"]{fill:#19d8e6}.page .graph .semantic[data-semantic-index="93"]{fill:#19d1e6}.page .graph .semantic[data-semantic-index="94"]{fill:#19cae6}.page .graph .semantic[data-semantic-index="95"]{fill:#19c3e6}.page .graph .semantic[data-semantic-index="96"]{fill:#19bde6}.page .graph .semantic[data-semantic-index="97"]{fill:#19b6e6}.page .graph .semantic[data-semantic-index="98"]{fill:#19afe6}.page .graph .semantic[data-semantic-index="99"]{fill:#19a8e6}.page .graph .semantic[data-semantic-index="100"]{fill:#19a1e6}.page .graph .semantic circle{r:.2}.page .graph .semantic circle:hover{r:.5}.page .graph .semantic circle,.page .graph .semantic rect{fill:currentColor;fill-opacity:.6}.page .graph .semantic.highlight circle,.page .graph .semantic.highlight rect{fill-opacity:.8;r:.3}.page .graph .semantic.moving{opacity:.5}.page .graph .semantic.strong circle,.page .graph .semantic.strong rect{fill-opacity:.8;r:.4!important;stroke:orange;stroke-width:.2}.page .graph .semantic.strong g polygon{transform:scale(1.5)}.page .graph .semantic.strong g rect{stroke-width:.8;stroke:orange}.page .graph .semantic.vline circle{display:none}.page .graph .system .staves{pointer-events:none}.page .graph .system .controls text{font-size:2px;cursor:pointer;fill-opacity:.3}.page .graph .system .controls text.active{stroke:green;stroke-width:.16}.page .graph .system.focus .staff.focus .background{opacity:.6}.page .graph .system .staff.focus .semantic circle{r:.36}.page .graph .system .staff.focus .semantic:hover circle{r:.5}.page .graph .system .staff.moving{cursor:crosshair;-webkit-user-select:none;-moz-user-select:none;user-select:none}.page>.remove{position:absolute;right:0;top:0;transform:translate(100%,-80%);background:white;border-radius:.5em;width:1em;height:1em;text-align:center;opacity:.1}.page>.remove:hover{opacity:1;color:red;font-weight:700}.page .notePlayOn{color:#97ff1e!important}.ant-dropdown-menu{transform:translate(25px)}.staff-layout line{stroke:#000;stroke-width:.1}.staff-rect rect{fill:#f003}.staff-rect line{stroke:#0003}.staff-rect.active rect{fill:transparent}.staff-rect.active line{stroke:#000}.staff-layout-measure-bar{stroke-width:.1}.staff-layout-measure-bar.dashed{stroke-dasharray:.3 .3}.staff-layout-measure-bar.blank{stroke-width:0!important}.brackets-area{fill:transparent;cursor:pointer}.brackets-area:hover{fill:#0002}.tick-line{pointer-events:none}.tick-line rect,.tick-line path{fill:#0d46639c!important}.tick-line .fraction text{font-size:1.2px;font-weight:700}.tick-line .integer{font-size:1px}.staff-lines line,.measure-bars line{stroke:#000;stroke-width:.1}.bp3-omnibar{filter:blur(0);opacity:1;background-color:#fff;border-radius:3px;box-shadow:0 0 0 1px #10161a1a,0 4px 8px #10161a33,0 18px 46px 6px #10161a33;left:calc(50% - 250px);top:20vh;width:500px;z-index:21}.bp3-omnibar.bp3-overlay-enter,.bp3-omnibar.bp3-overlay-appear{filter:blur(20px);opacity:.2}.bp3-omnibar.bp3-overlay-enter-active,.bp3-omnibar.bp3-overlay-appear-active{filter:blur(0);opacity:1;transition-delay:0;transition-duration:.2s;transition-property:filter,opacity;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp3-omnibar.bp3-overlay-exit{filter:blur(0);opacity:1}.bp3-omnibar.bp3-overlay-exit-active{filter:blur(20px);opacity:.2;transition-delay:0;transition-duration:.2s;transition-property:filter,opacity;transition-timing-function:cubic-bezier(.4,1,.75,.9)}.bp3-omnibar .bp3-input{background-color:transparent;border-radius:0}.bp3-omnibar .bp3-input,.bp3-omnibar .bp3-input:focus{box-shadow:none}.bp3-omnibar .bp3-menu{background-color:transparent;border-radius:0;box-shadow:inset 0 1px #10161a26;max-height:calc(60vh - 40px);overflow:auto}.bp3-omnibar .bp3-menu:empty{display:none}.bp3-dark .bp3-omnibar,.bp3-omnibar.bp3-dark{background-color:#30404d;box-shadow:0 0 0 1px #10161a33,0 4px 8px #10161a66,0 18px 46px 6px #10161a66}.bp3-omnibar-overlay .bp3-overlay-backdrop{background-color:#10161a33}.bp3-multi-select{min-width:150px}.bp3-multi-select-popover .bp3-menu{max-height:300px;max-width:400px;overflow:auto}.bp3-select-popover.bp3-select-match-target-width{width:100%}.bp3-select-popover.bp3-select-match-target-width .bp3-menu{max-width:none;min-width:0}.bp3-select-popover .bp3-popover-content{padding:5px}.bp3-select-popover .bp3-input-group{margin-bottom:0}.bp3-select-popover .bp3-menu{max-height:300px;max-width:400px;overflow:auto;padding:0}.bp3-select-popover .bp3-menu:not(:first-child){padding-top:5px}._semanticSelectItem_12toc_1{width:100%;color:#000;border-top:1px solid currentColor;border-left:1px solid currentColor;border-right:1px solid currentColor;display:flex;align-items:center}._semanticSelectItem_12toc_1:hover{background-color:#efefef}._semanticSelectItem_12toc_1:last-child{border-bottom:1px solid currentColor}._semanticSelectItem_12toc_1 svg{display:inline-block}._semanticSelectItemActive_12toc_19{background-color:#607d8b}.ReactCrop--disabled{width:100%}.ReactCrop--disabled .ReactCrop__crop-selection{border:none}.ReactCrop__image{width:100%}.ReactCrop{position:relative;display:inline-block;max-width:none}.hud{position:absolute;left:0;top:0;width:100%;height:100%}.hud .system{outline:1px solid steelblue;background-color:#4683b417}.hud .system.active{background-color:#4682b43d}.hud .system.loading{pointer-events:none;background-color:#4caf5033}.hud .stave{outline:1px rgba(210,72,72,.85) solid;background-color:#ff00001a}.hud .stave.active{background-color:#ff00004d}.hud .stave .index{position:absolute;left:-20px;top:50%;transform:translateY(-50%);color:#d24848d9;font-weight:700}.pageNum{position:absolute;bottom:0;left:50%;transform:translate(-50%,100%);font-size:16px;color:#333}.pageNum:after{content:close-quote}.menu-item{display:flex;align-items:center;min-width:100px}.menu-item .emmentaler{display:inline-block;font-size:30px;height:30px;width:20px}.menu-item .name{display:inline-block;width:150px;height:30px}.menu-item .confidence{color:#999;font-size:80%}.menu-item .whitelist .name,.menu-item .blacklist .name{font-weight:700}.menu-item .whitelist .name{color:green}.menu-item .blacklist .name{text-decoration:line-through;color:red}.pointer-events-none{pointer-events:none}
|
dist/assets/index-16c0d1b2.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as A,_ as H,g as Z,u as _,j as i,h as w}from"./umi-d55575d8.js";import{u as G,a as O,q,L as k,P as V,Q as X,b as S,S as W,c as $}from"./index-ef09616c.js";import{T as ee,S as te,P as R}from"./Tags-d90bdcf5.js";import{w as L,_ as ae,a as ie,C as se,c as Y,b as ne,o as re,d as oe,e as le,u as ce,f as z,r as T,n as U,m as de}from"./_setToString-2991057b.js";import{s as ge,V as Ae,g as ue,I as M,D as me,P as he}from"./Table-2648cf63.js";import{B as J}from"./button-95279f00.js";import{u as Ee}from"./useDebounce-e3ca8075.js";import"./index-a803403e.js";function fe(a){var e,o=function(l){return function(){e=null,a.apply(void 0,ae(l))}},n=function(){if(e==null){for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];e=L(o(d))}};return n.cancel=function(){L.cancel(e),e=null},n}var Qe=function(e){var o=e.prefixCls,n=e.rootPrefixCls,h=e.children,l=e.visible,d=A.createElement("div",{className:"".concat(o,"-content")},A.createElement("div",{className:"".concat(o,"-icon")},A.createElement(Ae,null)));return A.createElement(oe,{visible:l,motionName:"".concat(n,"-fade")},function(u){var v=u.className;return le(h||d,function(f){var r=f.className;return{className:Y(v,r)}})})},ve=function(e){var o=G(!1,{value:e.visible}),n=ie(o,2),h=n[0],l=n[1],d=A.createRef(),u=A.useRef(null),v=function(){return d.current&&d.current.ownerDocument?d.current.ownerDocument:window},f=fe(function(E){var x=e.visibilityHeight,C=x===void 0?400:x,I=ue(E.target,!0);l(I>C)}),r=function(){var x=e.target,C=x||v,I=C();u.current=O(I,"scroll",function(b){f(b)}),f({target:I})};A.useEffect(function(){return r(),function(){u.current&&u.current.remove(),f.cancel()}},[e.target]);var B=function(x){var C=e.onClick,I=e.target,b=e.duration,D=b===void 0?450:b;ge(0,{getContainer:I||v,duration:D}),typeof C=="function"&&C(x)},y=A.useContext(se),p=y.getPrefixCls,N=y.direction,j=e.prefixCls,s=e.className,t=s===void 0?"":s,c=p("back-top",j),g=p(),Q=Y(c,ne({},"".concat(c,"-rtl"),N==="rtl"),t),m=re(e,["prefixCls","className","children","visibilityHeight","target","visible"]);return A.createElement("div",H({},m,{className:Q,onClick:B,ref:d}),A.createElement(Qe,{prefixCls:c,rootPrefixCls:g,visible:h},e.children))};const Be=A.memo(ve),ye=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],xe=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ce=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ie=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],K=(a,e,o)=>{let n=a;return typeof e=="string"||Array.isArray(e)?n=a.toLocaleString(e,o):(e===!0||o!==void 0)&&(n=a.toLocaleString(void 0,o)),n};var Se=(a,e)=>{if(!Number.isFinite(a))throw new TypeError(`Expected a finite number, got ${typeof a}: ${a}`);e=Object.assign({bits:!1,binary:!1},e);const o=e.bits?e.binary?Ie:Ce:e.binary?xe:ye;if(e.signed&&a===0)return` 0 ${o[0]}`;const n=a<0,h=n?"-":e.signed?"+":"";n&&(a=-a);let l;if(e.minimumFractionDigits!==void 0&&(l={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(l=Object.assign({maximumFractionDigits:e.maximumFractionDigits},l)),a<1){const f=K(a,e.locale,l);return h+f+" "+o[0]}const d=Math.min(Math.floor(e.binary?Math.log(a)/Math.log(1024):Math.log10(a)/3),o.length-1);a/=Math.pow(e.binary?1024:1e3,d),l||(a=a.toPrecision(3));const u=K(Number(a),e.locale,l),v=o[d];return h+u+" "+v};const pe=Z(Se);const Ne="_title_jd9ry_1",je="_header_jd9ry_4",be="_logo_jd9ry_14",we="_imageFastPreview_jd9ry_18",Te="_list_jd9ry_53",P={title:Ne,header:je,logo:be,imageFastPreview:we,"site-tag-plus":"_site-tag-plus_jd9ry_34","ant-table-row":"_ant-table-row_jd9ry_38","ant-tag":"_ant-tag_jd9ry_44",delete:"_delete_jd9ry_47","score-tags":"_score-tags_jd9ry_50",list:Te},Me=i.jsx("svg",{style:{width:"1.4em",height:"1.4em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M960 1024H64a64 64 0 0 1-64-64V64a64 64 0 0 1 64-64h896a64 64 0 0 1 64 64v896a64 64 0 0 1-64 64z m0-896a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v768a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V128z m-128 640h-128a64 64 0 0 1 0-128h64V576h-64a64 64 0 0 1 0-128h64V384h-64a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v384a64 64 0 0 1-64 64z m-320-128a64 64 0 0 1 0 128H384a64 64 0 0 1-64-64V512a64 64 0 0 1 64-64h64V384H384a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64H448v64h64z m-320 128a64 64 0 0 1-64-64V320a64 64 0 0 1 128 0v384a64 64 0 0 1-64 64z"})}),Je=i.jsxs("svg",{style:{width:"1.5em",height:"1.5em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:[i.jsx("path",{d:"M428.62 383.7l193.23-45.33v-31.94l-193.23 45.48zM374.7 656c-10.23-8.15-25.15-13.26-41.74-13.26-16.59 0-31.52 5.11-42.02 13.26-8.85 7.19-14.65 16.59-14.65 26.54 0 10.23 5.8 19.63 14.65 26.82 10.5 8.15 25.44 12.99 42.02 12.99 16.59 0 31.51-4.84 41.74-12.99 9.26-7.19 14.93-16.59 14.93-26.82 0.01-9.95-5.67-19.35-14.93-26.54zM607.2 602.65v-0.14c-10.5-8.15-25.44-13.14-42.02-13.14-16.59 0-31.51 4.98-42.02 13.14-8.85 7.05-14.65 16.59-14.65 26.68 0 9.95 5.8 19.49 14.65 26.54 10.52 8.29 25.44 13.26 42.02 13.26 16.59 0 31.52-4.97 42.02-13.26 8.85-6.78 14.38-16.32 14.65-25.99v-0.96c-0.14-9.97-5.8-19.22-14.65-26.13z",fill:"#000000"}),i.jsx("path",{d:"M512 64C264.58 64 64 264.58 64 512s200.58 448 448 448 448-200.58 448-448S759.42 64 512 64z m148.83 565.19v0.82c-0.28 22.26-11.61 42.3-29.85 56.4-17.14 13.55-40.37 21.56-65.8 21.56s-48.79-8.01-65.93-21.29c-18.39-14.51-29.72-34.69-29.72-57.49 0-22.67 11.34-42.86 29.72-57.23 17.14-13.4 40.35-21.57 65.93-21.57 21.02 0 40.64 5.68 56.67 15.34V362.27l-193.23 45.48V683.64c-0.28 22.13-11.75 42.03-29.87 56.41-17.14 13.26-40.35 21.43-65.79 21.43-25.43 0-48.79-8.17-65.8-21.43-18.51-14.65-29.99-34.69-29.99-57.51 0-22.39 11.48-42.84 29.99-57.23 17.01-13.26 40.37-21.29 65.8-21.29 21 0 40.78 5.53 56.67 15.07V333.94l0.27-0.68v-0.28l0.14-0.27V332.02l0.14-0.28 0.14-0.27v-0.55h0.13l0.14-0.7v-0.28c0.41-0.96 0.98-2.06 1.53-2.9v-0.27l0.27-0.14v-0.28l0.28-0.13 0.13-0.57 0.28-0.27 0.55-0.55v-0.55h0.28l0.13-0.28 0.28-0.27 0.27-0.14v-0.14l0.28-0.27 1.1-0.84v-0.27h0.14l0.41-0.28 0.14-0.27h0.14l0.82-0.84 0.28-0.14 0.27-0.14v-0.13l0.28-0.14 0.82-0.41v-0.14l0.69-0.41h0.14c0.84-0.42 1.66-0.7 2.63-0.98 0.82-0.55 1.78-0.82 2.9-0.82l230.83-54.32c10.23-2.35 20.18 3.6 23.23 13.26v0.28c0.82 2.07 1.1 4.15 1.1 6.49v346.11z",fill:"#000000"})]});function Ye(){var N,j;const a=ce(),e=A.useRef(),[o,n]=A.useState(null),h=A.useRef(null),[l,d]=A.useState([]),[u,v]=z(async()=>await T.get("/api/tags"),[]),f=_(),r=A.useMemo(()=>{try{const s=q.parse(f.search),t=JSON.parse(decodeURIComponent(s.search))||{};return F(t)}catch{return{}}},[f.search]);A.useEffect(()=>{v()},[]);const[B,y]=z(async()=>{var s;try{const t=await T("/api/musicSets",{params:{total:(s=B.value)==null?void 0:s.total,limit:50,offset:0,...r}});return{data:t.rows,success:!0,total:t.count}}catch(t){console.error(t)}return{data:void 0,success:!1}},[r]);Ee(()=>{y()},1e3,[r]);const p=[{title:a.formatMessage({id:"home.column.preview"}),dataIndex:"content",width:54,hideInSearch:!0,render:(s,t,c)=>i.jsx(M,{width:40,height:40,preview:!1,onMouseEnter:()=>{var Q,m;const g=(m=(Q=t.content)==null?void 0:Q.images)==null?void 0:m[0];n(g?{...g,url:U(g.url)}:null)},onMouseLeave:()=>n(null),onClick:()=>{n(null),d(t.content.images.map(g=>U(g.url)))},style:{cursor:"pointer"},src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="})},{title:a.formatMessage({id:"home.column.name"}),dataIndex:"name",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="name"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>i.jsx(k,{style:{display:"flex"},to:`/${{stave:"playground",simple:"numbered"}[t.type]}/${t.id}`,children:`${t.name||a.formatMessage({id:"common.untitled"})}`})},{title:a.formatMessage({id:"home.column.type"}),dataIndex:"type",width:"6em",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="type"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>({stave:Je,simple:Me})[t.type]},{title:i.jsx(ee,{}),dataIndex:"tagIdList",width:"2em",valueType:"select",filters:!0,hideInSearch:!0,filteredValue:(r==null?void 0:r.tagIdList)||[],valueEnum:()=>{var s;return((s=u.value)==null?void 0:s.reduce((t,c)=>({...t,[c.id]:{text:c.name||" "}}),{}))||{}},render:(s,t,c)=>i.jsx(te,{preview:!0,id:t.id,tagList:t.tagList,onChange:g=>{console.log("tags",g),t.tagList=g}},t.id)},{title:a.formatMessage({id:"home.column.pages"}),render:(s,t)=>{var c,g;return(g=(c=t.content)==null?void 0:c.images)==null?void 0:g.length},width:"4em",align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.size"}),width:"6em",render:(s,t)=>{var c,g,Q;return((c=t.content)==null?void 0:c.images)&&pe((Q=(g=t.content)==null?void 0:g.images)==null?void 0:Q.reduce((m,E)=>m+((E==null?void 0:E.size)??0),0))},align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.lastUpdate"}),width:"12em",dataIndex:"lastUpdateAt",sorter:!0,sortOrder:r.sortedBy==="lastUpdateAt"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,hideInSearch:!0},{title:a.formatMessage({id:"home.column.actions"}),width:"4em",hideInSearch:!0,render:(s,t,c)=>[(!t.tagList||!t.tagList.length)&&i.jsx(V,{title:a.formatMessage({id:"home.confirmDelete"}),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),icon:i.jsx(X,{}),onConfirm:async()=>{await T.delete(`/api/musicSets/${t.id}`)&&(de.success(a.formatMessage({id:"home.deleteSuccess"})),await y())},children:i.jsx(J,{className:"delete",type:"link",children:i.jsx(me,{})})},"delete")]}];return i.jsxs(S,{children:[i.jsx(S.Header,{className:P.header,children:i.jsxs(W,{children:[i.jsx(k,{className:P.logo,to:"/",children:"STARRY✨"}),i.jsxs(J,{onClick:()=>{w.push("/playground")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createStave"})]}),i.jsxs(J,{onClick:()=>{w.push("/numbered")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createNumbered"})]}),i.jsx($,{})]})}),i.jsx(S,{style:{minHeight:"100vh"},children:i.jsx(S.Content,{style:{padding:"0 50px 50px",marginTop:"104px",width:"unset"},children:i.jsx(he,{loading:B.loading,dataSource:(N=B.value)==null?void 0:N.data,style:{maxWidth:"100em",margin:"0 auto"},actionRef:e,formRef:h,columns:p,search:{filterType:"light"},size:"small",options:{density:!1,reload:y},pagination:{total:(j=B.value)==null?void 0:j.total,pageSize:50,current:+r.offset/+r.limit+1||1},onChange:(s,t,c,g)=>{var E;const Q={ascend:"asc",descend:"desc"}[c.order],m={...r,offset:(s.current-1)*s.pageSize,limit:s.pageSize,tagIdList:t.tagIdList,search:r.search};c.order?(m.sortedBy=c.field,m.sortedType=Q):(m.sortedBy=null,m.sortedType=null),((E=t.tagIdList)==null?void 0:E.length)>0?m.tagIdList=t.tagIdList:m.tagIdList=null,console.log("onChange"),w.push({search:`search=${encodeURIComponent(JSON.stringify(F(m)))}`})},beforeSearchSubmit:s=>{const t={...r,search:s.name};console.log("beforeSearchSubmit",t),w.push({search:Object.values(t).filter(Boolean).length>0?`search=${encodeURIComponent(JSON.stringify(t))}`:""})},rowKey:"id"})})}),i.jsx(S.Footer,{style:{textAlign:"center"},children:a.formatMessage({id:"common.footer"})}),o&&i.jsx("div",{className:P.imageFastPreview,children:i.jsx("img",{src:o.url,style:{objectFit:"contain",objectPosition:"center",maxHeight:"100%",maxWidth:"100%",backgroundColor:"#ffffff",boxShadow:"0 0 10px 0px rgba(0,0,0,0.5)"},alt:""})}),i.jsx(Be,{}),i.jsx(M.PreviewGroup,{preview:{open:l.length>0,destroyOnClose:!0,onOpenChange:s=>{s||d([])}},children:l.map((s,t)=>i.jsx(M,{wrapperStyle:{fontSize:"12px"},height:40,src:s},t))})]})}function F(a){return Object.entries(a).reduce((e,[o,n])=>{var l,d;return(o==="tagIdList"&&((d=(l=n==null?void 0:n.filter)==null?void 0:l.call(n,u=>/^\d+$/.test(String(n))))==null?void 0:d.length)>0||n)&&(e[o]=n),e},{})}export{Ye as default};
|
|
|
|
|
|
dist/assets/{index-345e5e52.js → index-22b5485d.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{index-5e62e59b.js → index-38b3d0db.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
import{r as W,j as c,a as We}from"./umi-
|
| 2 |
`+U.showPosition()+`
|
| 3 |
-
Expecting `+O.join(", ")+", got '"+(this.terminals_[z]||z)+"'":L="Parse error on line "+(P+1)+": Unexpected "+(z==oe?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(L,{text:U.match,token:this.terminals_[z]||z,line:U.yylineno,loc:ce,expected:O})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+z);switch(J[0]){case 1:g.push(z),
|
| 4 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),p=new Array(u.length+1).join("-");return u+this.upcomingInput()+`
|
| 5 |
-
`+p+"^"},test_match:function(u,p){var g,
|
| 6 |
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var p=this.next();return p||this.lex()},begin:function(p){this.conditionStack.push(p)},popState:function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},pushState:function(p){this.begin(p)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(p,g,
|
| 7 |
-
`);return{title:r,subtitle:t}}get authors(){return this.accessories.filter(e=>e.semantic==="Author")}get measureCount(){return this.systems.reduce((e,r)=>e+r.measureCount,0)}get syllableSize(){let e=[];return this.systems.forEach(r=>{r.staves.forEach(t=>{t.measures.forEach(i=>{i.noteBboxes.forEach(a=>{e.push(a[3]-a[1])})})})}),e.sort((r,t)=>t-r)[5]}}class $t extends se{static className="NumberedSystem";left;top;right;bottom;bracketsAppearance;staves;constructor(e){super(),super.assign(e)}get width(){return this.right-this.left}get noteRange(){return{top:0,bottom:this.staves.reduce((e,r)=>Math.max(e,Math.max(...r.accessories.map(t=>t.box[3])),r.measures.reduce((t,i)=>Math.max(t,i.bottom),0)),0)}}get measureCount(){return this.staves[0].measures.length}}class Bt extends se{static className="NumberedStaff";baseY;accessories;measures;voice;constructor(e){super(),super.assign(e)}get lyrics(){return this.accessories.filter(e=>e.semantic==="Lyric").reduce((e,r)=>{if(r.text.replace(/[^A-z-]/g,"").length/r.text.length>.5)return[...e,r];const[t,i,a,n]=r.box,l=(a-t)/r.text.length;let f=[];for(let k=0;k<r.text.length;k++){const d=ie(r.toJSON(),{NumberedAccessory:Fe});d.box=[t+k*l,i,t+(k+1)*l,n],d.text=r.text[k],f.push(d)}return[...e,...f]},[])}get slurs(){return this.accessories.filter(e=>e.semantic==="ArcLine")}get slurConnections(){const e=this.slurs.map(n=>[{slur:n,begin:!0,point:{x:n.box[0],y:n.box[3]}},{slur:n,end:!0,point:{x:n.box[2],y:n.box[3]}}]).flat();let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y};return{note:v,slur:d,points:[$,d.point],angle:Me(d.point,$),distance:Math.sqrt(Math.pow(n.left+(v.bbox[2]-v.bbox[0])/2-d.point[0],2)+Math.pow(n.top+v.bbox[1]-d.point[1],2)),measureHeight:n.bottom-n.top,slurIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=new Set,a=[];for(let n of t)i.has(n.slur)||(i.add(n.slur),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>(n.note.slurBegin=n.slur.begin,n.note.slurEnd=n.slur.end,[n.note,n.slur.slur,n.points,n.angle]))}get lyricConnections(){const e=this.lyrics;let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y},E=K(d.box);return{note:v,lyric:d,points:[$,E],angle:Me(E,$),lyricIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=[],a=[];for(let n of t.filter(l=>l.angle<36))i.includes(n.lyric)||(i.push(n.lyric),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>[n.note,n.lyric,n.points,n.angle])}}class Ue extends se{static className="NumberedMeasure";left;top;right;bottom;expression;noteBboxes;semantics;measureIndex;keySignature;timeSignature;constructor(e){super(),super.assign(e)}get duration(){return this.notes.reduce((e,r)=>e+r.duration,0)}get notes(){const e=this.expression.replace(/[(())]/g,"").replace(/<\s>/g,"").replace(/<+$/g,"").replace(/^\)$/g,"").replace(/_ { \. }/,",");let r=[];try{r=ve.parse(e)}catch(t){console.error(t)}return r?r.filter(t=>t!=="V").map((t,i)=>{var a,n;return t.syllable==="-"?new de({syllable:"-",accidental:"",octaves:0,dots:0,division:2,bbox:this.noteBboxes[i]||[0,0,0,0]}):new de({syllable:t.syllable,accidental:t.acc||"",octaves:t.octaves||0,dots:t.dots||0,division:t.underline+2,bbox:this.noteBboxes[i]||[0,0,0,0],breath:!!t.breath,timeWarp:t.timeWarp,grace:((a=t.grace)==null?void 0:a.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null,postGrace:((n=t.postGrace)==null?void 0:n.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null})}):[]}validate(){}}Tt([Vt],Ue.prototype,"notes",1);class Lt extends se{static className="NumberedSemantic";constructor(e){super(),super.assign(e)}}class Fe extends se{static className="NumberedAccessory";box;semantic;text;constructor(e){super(),super.assign(e)}}class de extends se{static className="NumberedNote";static blackKeys=["prev","next"];prev;next;syllable;accidental;octaves=0;dots=0;division;timeWarp;bbox;slurBegin;slurEnd;breath;grace;id;tick;system;staff;constructor(e){super(),super.assign(e)}get duration(){return kt*2**-this.division*(2-2**-this.dots)*(this.timeWarp?this.timeWarp.numerator/this.timeWarp.denominator:1)}get roundX(){return K(this.bbox||[0,0,0,0]).x}toMidiPitch(e){var t;let r=((t=this.accidental)==null?void 0:t.split("").reduce((i,a)=>i+{b:-1,"#":1,h:0}[a],0))??0;if(["X","0"].includes(this.syllable))return this.syllable;if(this.syllable==="-"){let i=this.prev;for(;!/^[1-7]$/g.test(i.syllable);)i=i.prev;return Oe(e)+Ne[+i.syllable-1]}if(/^[1-7]$/g.test(this.syllable))return Oe(e)+Ne[+this.syllable-1]+this.octaves*12+r}}function K(s,e){const[r,t,i,a]=s;return{x:((e==null?void 0:e.x)??0)+(r+i)/2,y:((e==null?void 0:e.y)??0)+(t+a)/2}}function Dt(s,e){const{x:r,y:t}=K(s),{x:i,y:a}=K(e);return Math.pow(i-r,2)+Math.pow(a-t,2)}function Me(s,e){const{x:r,y:t}=s,{x:i,y:a}=e;return Math.abs(Math.atan((i-r)/(a-t))*180/Math.PI)}function Vt(s,e,r){r.enumerable=!0;const t=r.get;r.get=function(){return this[`__${e}`]||(this[`__${e}`]=t.call(this)),this[`__${e}`]}}function Ut(s,e,r,t,i,a){const n=Math.round(a.x*10),l=Math.round(a.y*10),f=`${s}|${e}|${r}|${t}|${i}|${n}|${l}`,k=wt.array(f).slice(12);return globalThis.btoa(String.fromCharCode(...k)).substring(0,11)}function Oe(s){const r=["C","bD","D","bE","E","F","bG","G","bA","A","bB","B"].findIndex(i=>De[i]===s);let t=r<12-r?r:r-12;return St+t}function Re(s,e){let r=Number.MAX_SAFE_INTEGER,t=null;for(let i of e){const a=Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2);a<r&&(r=a,t=i)}return t}const me=Object.freeze(Object.defineProperty({__proto__:null,AccessoryType:Le,NumberedAccessory:Fe,NumberedMeasure:Ue,NumberedNote:de,NumberedPage:At,NumberedScore:Ve,NumberedSemantic:Lt,NumberedStaff:Bt,NumberedSystem:$t,angleVertical:Me,getBoxCenter:K,squareDistance:Dt},Symbol.toStringTag,{value:"Module"})),Ft=({score:s,page:e,pageIndex:r,onSeekPosition:t})=>{const[i]=Be(),a=W.useRef(null);let n=0;if(i){let l=0;for(const[f,k]of s.pages.entries()){if(i.system>=l-1&&i.system<l+k.systems.length){n=+f;break}l+=k.systems.length}}return W.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,n]),c.jsx("svg",{className:je("graph"),style:{objectFit:"contain",position:"absolute",top:0,left:0},viewBox:`0 0 ${e==null?void 0:e.width} ${e==null?void 0:e.height}`,children:e.systems.map((l,f)=>{const k=s.pages.slice(0,r).reduce((d,b)=>d+b.systems.length,0)+f;return c.jsxs("g",{className:je("system"),transform:`translate(${l.left}, ${l.top})`,children:[c.jsx("rect",{style:{opacity:0},x:0,y:l.noteRange.top,width:l.width,height:l.noteRange.bottom-l.noteRange.top,onClick:d=>{const b=d.target,v=b.getBoundingClientRect(),N=d.clientX-v.left,F=b.getBBox(),$=N/v.width*F.width;t({system:k,x:$})}}),(i==null?void 0:i.system)===k?c.jsx("line",{ref:a,transform:`translate(${i.x-e.syllableSize/4}, 0)`,x1:0,x2:0,y1:l.noteRange.top,y2:l.noteRange.bottom,style:{stroke:"rgba(173, 216, 230, 0.8)",strokeWidth:e.syllableSize/2}}):null]},f)})})},Wt=W.memo(Ft),Te=600;function Ae(s,e=0,r=0){return{x:e+s[0],y:r+s[1],width:s[2]-s[0],height:s[3]-s[1]}}function Gt(s){return[["root","NumberedPage"],["root.accessories[*]","NumberedAccessory"],["root.systems[*]","NumberedSystem"],["root.systems[*].staves[*]","NumberedStaff"],["root.systems[*].staves[*].accessories[*]","NumberedAccessory"],["root.systems[*].staves[*].measures[*]","NumberedMeasure"]].forEach(([r,t])=>{const a=r.split(/[.\[\]]/).filter(Boolean).reduce((n,l)=>l==="root"?n:Array.isArray(n)?l==="*"?n:[].concat(...n.map(f=>f[l])):n[l],s);a&&(Array.isArray(a)?a.forEach(n=>{n.__prototype=t}):a.__prototype=t)}),s}const $e=({begin:s,end:e,strokeWidth:r=2,stroke:t="#000",perturbation:i=!1})=>{const a=e.y-s.y,n=[s.x+a/6,s.y+a/6],l=[e.x+a/6,e.y-a/6];return c.jsxs("g",{children:[c.jsx("path",{d:`M${s.x} ${s.y} C ${n.join(" ")}, ${l.join(" ")}, ${e.x} ${e.y}`,strokeWidth:r,stroke:t,fill:"none"}),c.jsx("circle",{cx:s.x,cy:s.y,r:r*1.618,fill:t}),c.jsx("circle",{cx:e.x,cy:e.y,r:r*1.618,fill:t})]})},zt=({x:s,y:e,width:r,height:t,note:i,fontSize:a,...n})=>c.jsxs("g",{transform:`translate(${s}, ${e})`,...n,children:[c.jsx("text",{className:"measure-note",fontSize:a,children:i.syllable===null?"-":i.syllable}),new Array(Math.max(i.division-2,0)).fill(null).map((l,f)=>c.jsx("line",{x1:0,x2:r,y1:0,y2:0,transform:`translate(0, ${a*.1+f*a*.12})`,strokeWidth:a*.03,stroke:"#000"},f)),new Array(Math.abs(i.octaves)).fill(null).map((l,f)=>{const k=a*.1*i.division;return c.jsx("circle",{transform:`translate(${r/2}, ${i.octaves>0?-a-f*a*.15:k+f*a*.15})`,cx:0,cy:0,r:a*.07,fill:"#000"},f)}),new Array(Math.abs(i.dots)).fill(null).map((l,f)=>c.jsx("circle",{transform:`translate(${r*2+f*(a/2)}, ${-a*.382})`,cx:0,cy:0,r:a*.08,fill:"#000"},f)),i.accidental&&c.jsx("text",{className:"measure-note",transform:`translate(${-r*.6}, ${-a*.3})`,fontSize:a,children:i.accidental.replace(/b/g,"♭").replace(/#/g,"♯").replace(/h/g,"♮")})]}),ns=s=>{var z,Q,J,re;const e=jt(),r=We(),[t,i]=W.useState(new Ve({})),a=W.useRef(null),[n,l]=W.useState(""),[f,k]=W.useState(!1),d=Ge(),[b,v]=W.useState(!0),[N,F]=W.useState(!0),[$,E]=W.useState(!0),[H,V]=st(),I=W.useRef(null),m=W.useRef(null),T=W.useRef(new gt(performance)),R=W.useRef(!1),[G,S]=nt(),[u,p]=Be(),[g,{inc:y,dec:j,set:x,reset:ae}]=rt(90,300,10),[P,pe]=W.useState(null),X=W.useMemo(()=>{var _,C;const o=ze.parse(window.location.search);return(o==null?void 0:o.type)==="admin"?{type:"admin",env:o.env,id:o.id,edit:o.edit==="1"}:{type:"user",id:(r==null?void 0:r.id)||((C=(_=s==null?void 0:s.match)==null?void 0:_.params)==null?void 0:C.id)||P}},[s,P,r]);Ce(async()=>{var o;try{if(!X.id)return null;l(e.formatMessage({id:"common.loading"}));let _=[],C=null,w;if(X.type==="user"){const O=await be.get(`/api/musicSets/${X.id}`);C=Ee((o=O==null?void 0:O.content)==null?void 0:o.scoreURL),C&&(w=ie(await(await fetch(C)).text(),me),await w.replaceImageKeys(async L=>/https?:\/\/|data:/.test(L)?Ee(L):L!=null&&L.startsWith("md5:")?it((await Mt()).omrDomain,L.replace("md5:","")):L),w.assemble())}w?(window.score=w,i(w)):_e.error(e.formatMessage({id:"common.scoreNotFound"})),l("")}catch(_){console.error(_)}},[]);const oe=()=>{m.current.play({nextFrame:()=>(I.current&&p(I.current.lookupPosition(m.current.progressTicks)),new Promise(o=>setTimeout(o,0)))})},ke=async o=>{if(!o.pages.length)return;const{notation:_,tokenMap:C}=o.perform(),w=Array(_.measures.length).fill(null).map((M,Y)=>Y+1),O=_.toPerformingNotationWithEvents(w);O.scaleTempo({headTempo:6e7/g}),I.current=_t.createFromNotation(O,C);const L=m.current?m.current.progressTicks:0;m.current&&m.current.dispose(),m.current=new he.MidiPlayer(O,{cacheSpan:200,onMidi:(M,Y)=>{let h=null;switch(M.subtype){case"noteOn":he.MidiAudio.noteOn(M.channel,M.noteNumber,M.velocity,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.add("notePlayOn")})};break;case"noteOff":he.MidiAudio.noteOff(M.channel,M.noteNumber,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.remove("notePlayOn")})};break}h&&T.current.appendTask(Y,h)},onPlayFinish(){S(!1),m.current&&(m.current.progressTicks=0)},onTurnCursor(){m.current&&I.current&&p(I.current.lookupPosition(m.current.progressTicks))}}),m.current.progressTicks=L,R.current=!1};W.useEffect(()=>{G?(async()=>{var o;(!m.current||R.current)&&(R.current=!1,await ke(t)),(o=m.current)!=null&&o.isPlaying||oe()})():m.current&&m.current.pause()},[G,t]),Ce(()=>he.MidiAudio.WebAudio.empty()?he.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>console.debug("Soundfont loaded.")):Promise.resolve());const U=W.useCallback(async o=>{var C;if(!(I!=null&&I.current)){console.log("scheduler is null:",I==null?void 0:I.current);return}const _=(C=m.current)==null?void 0:C.isPlaying;_&&(m.current.pause(),await new Promise(w=>setTimeout(w,0))),document.querySelectorAll(".notePlayOn").forEach(w=>w.classList.remove("notePlayOn")),m.current.progressTicks=I.current.lookupTick(o),_&&oe()},[]),[q,le]=Nt(async o=>{l(e.formatMessage({id:"common.savingScore"})),await o.replaceImageKeys(async O=>O&&await yt(O));const _=new Blob([JSON.stringify(o.toJSON())],{type:"application/json"}),C=Et(_,`${Date.now()}.json`),w=await Ie(C);await Pe(C,{key:w.key,uploadUrl:w.uploadUrl});try{let O=o.title;O=O||e.formatMessage({id:"common.untitledNumbered"});const L={name:O,content:{images:o.pages.map(Y=>({url:Y.backgroundImage})),scoreURL:w.url},tagIdList:[],type:"simple"};let M;X.id?M=await be.put(`/api/musicSets/${X.id}`,{data:L}):M=await be.post("/api/musicSets",{data:L}),String(M.id)!==X.id&&(pe(M.id),window.history.replaceState(null,"",`/numbered/${M.id}`)),i(ie(JSON.stringify(o),me)),It.success({placement:"bottomRight",message:e.formatMessage({id:"common.saveResult"}),description:e.formatMessage({id:"common.saveSuccess"})})}catch(O){console.log(O)}l("")},[P]);at(()=>{m.current&&m.current.dispose(),l(""),S(!1),V("edit"),p(null),ae()});const ce=ot({onFiles:async(o,_)=>{var w;const C=_.dataTransfer.items;if(C.length===1&&C[0].webkitGetAsEntry().isDirectory){const L=C[0].webkitGetAsEntry().createReader();async function M(Y){const h=await new Promise((A,D)=>{Y.readEntries(async B=>{A(await Promise.all(B.map(async Z=>new Promise(te=>Z.file(ne=>te(ne))))))},D)});return h.length>0?[...h,...await M(Y)]:h}l(e.formatMessage({id:"common.loading"})),await M(L),l("");return}switch(o[0].type){case"application/zip":case"application/x-zip-compressed":case"application/json":const O=o[0];l(e.formatMessage({id:"common.loading"}));const L=await xt(O);L&&i(L),l("");break;case"application/pdf":await((w=a.current)==null?void 0:w.onReceivePDF(o));break;default:console.debug("drop file type:",o[0].type),o[0].type.startsWith("image")&&await ue(o)}},onUri:o=>console.log("uri",o),onText:o=>console.log("text",o)}),ue=async o=>{l(e.formatMessage({id:"common.uploadingImages"}));const _=Array.from(o).map(async h=>{if(typeof h=="string"){const D=await new Promise(te=>{const ne=document.createElement("img");ne.src=h,ne.onload=()=>{te(ne)}}),B=document.createElement("canvas");B.width=D.naturalWidth,B.height=D.naturalHeight;const Z=Pt(B.toDataURL("image/png"),h.slice(h.lastIndexOf("/")+1));return Z.url=h,Z.dimensions={width:D.naturalWidth,height:D.naturalHeight},Z}const A=await Ie(h);return h.url=A.url,t.pages.find(D=>D.backgroundImage===A.url)?(_e.warn(e.formatMessage({id:"common.imageExists"},{name:h.name})),null):(await Pe(h,{key:A.key,uploadUrl:A.uploadUrl}),h)}),C=(await Promise.all(_)).filter(Boolean),w=await Promise.all(C.map(h=>new Promise(A=>{const D=new globalThis.Image;D.src=h.url,D.onload=()=>{h.dimensions={width:D.naturalWidth,height:D.naturalHeight},A(D.naturalHeight/D.naturalWidth)}}))),O=t.pageSize.height/t.pageSize.width;typeof O=="number"&&O&&w.push(O);const L=Math.max(...w);t.pageSize={width:794,height:Math.round(794*L)},l(e.formatMessage({id:"common.recognizingImages"}));const M=await be.post("/api/predict/jianpu",{data:{images:C.map(h=>h.url)}});t.pages.push(...M.map((h,A)=>ie(Gt({...h,backgroundImage:C[A].url}),me))),t.assemble();const Y=ie(JSON.stringify(t),me);window.score=Y,R.current=!0,i(Y),l("")};let ge=0;return c.jsx(Ct,{spinning:!!n,tip:n,style:{backgroundColor:ce.over?"red":"initial"},children:c.jsxs(He,{style:{height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:f?"#efe":"#eee"},onDragOver:o=>{o.preventDefault(),k(f)},onDragLeave:()=>k(!1),onPaste:o=>{const _=o.clipboardData.getData("text/plain");/^https?.*(png|jpe?g|gif|webp)$/.test(_)&&ue([_])},children:[c.jsx(Je,{className:"numbered-header",children:c.jsxs(Ye,{style:{width:"100%",display:"flex",justifyContent:"space-between"},gutter:16,children:[c.jsxs(we,{style:{display:"flex",alignItems:"center"},children:[c.jsx(Ke,{to:"/",className:"logo",children:"STARRY"}),c.jsx(lt,{placeholder:e.formatMessage({id:"numbered.titlePlaceholder"}),defaultValue:e.formatMessage({id:"numbered.defaultTitle"}),style:{height:"30px"},value:t==null?void 0:t.title,onChange:o=>{const _=ie(JSON.stringify(t),me);_.title=o.target.value,i(_)}})]}),c.jsxs(we,{children:[H==="edit"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToPlay"}),disabled:!((z=t==null?void 0:t.pages)!=null&&z.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(ft,{}),onClick:()=>{if(!t.pages.some(o=>{var _;return((_=o.systems)==null?void 0:_.length)>0})){_e.warn(e.formatMessage({id:"numbered.recognizeFirst"}));return}V("play")}}),H==="play"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToEdit"}),disabled:!((Q=t==null?void 0:t.pages)!=null&&Q.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(Xe,{}),onClick:()=>{V("edit"),S(!1)}})]}),H==="play"&&c.jsxs(ye,{style:{flex:1,paddingLeft:"10px"},children:[c.jsx(ct,{title:e.formatMessage({id:"numbered.goToStart"}),className:fe.playControlBtn,onClick:()=>{U({system:0,x:0})}}),G?c.jsx(bt,{title:e.formatMessage({id:"common.pause"}),className:je(fe.playControlBtn,{[fe.playControlBtnActive]:G}),onClick:()=>{S(!G)}}):c.jsx(ut,{title:e.formatMessage({id:"common.play"}),className:fe.playControlBtn,onClick:()=>{S(!G)}}),c.jsxs("div",{children:["𝅘𝅥 =",c.jsx("input",{value:g,style:{padding:"0 5px",display:"inline",border:"none",width:"50px"},type:"number",step:10,onChange:o=>{x(+o.target.value),R.current=!0}})]})]}),c.jsx(we,{style:{flex:1},children:c.jsx(ht,{ref:a,onChange:ue})}),c.jsxs(ye,{style:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[c.jsxs(ee,{icon:c.jsx(mt,{}),loading:q.loading,onClick:()=>le(t),disabled:!((J=t==null?void 0:t.pages)!=null&&J.length)&&(X.type!=="admin"||X.edit),children:[q.loading?e.formatMessage({id:"common.saving"}):e.formatMessage({id:"common.save"})," ",t.modified?"*":""]}),c.jsxs(ee.Group,{size:"small",children:[c.jsx(ee,{type:b?"primary":"ghost",onClick:()=>{v(!b)},children:e.formatMessage({id:"common.originalImage"})}),c.jsx(ee,{type:N?"primary":"ghost",onClick:()=>{F(!N)},children:e.formatMessage({id:"common.symbols"})}),c.jsx(ee,{type:$?"primary":"ghost",onClick:()=>{E(!$)},children:"BBox"})]}),c.jsx(qe,{})]})]})}),c.jsx(Qe,{className:"numbered-score",style:{flex:1,flexShrink:0,overflow:"scroll"},onWheel:o=>{},children:(re=t==null?void 0:t.pages)!=null&&re.length?c.jsx(ye,{wrap:!0,style:{padding:"8px"},children:t==null?void 0:t.pages.map((o,_)=>{const C={x:0,y:0,width:o.width,height:o.height};return c.jsxs("div",{className:"relative numbered-page bg-white",style:{boxShadow:"0 0 5px rgb(44 44 44 / 20%)"},children:[c.jsxs("svg",{width:o.width,height:o.height,viewBox:`0 0 ${o.width} ${o.height}`,style:{width:`${Te}px`,height:`${Te*o.height/o.width}px`},children:[b&&(o==null?void 0:o.backgroundImage)&&c.jsx("image",{className:"background",...C,href:o.backgroundImage}),$&&o.accessories.map((w,O)=>c.jsx(Se,{placement:"top",title:w.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`page-acc-${w.semantic}`,...Ae(w.box),fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(w)})},O)),o.systems.map((w,O)=>{const L=ge;return ge+=w.measureCount,c.jsxs("g",{className:"numbered-system","data-system":O,transform:`translate(${w.left}, ${w.top})`,children:[$&&c.jsx("rect",{x:0,y:0,width:w.right-w.left,height:w.bottom-w.top,fill:"rgba(0, 0, 0, 0.2)"}),w.staves.map((M,Y)=>c.jsxs("g",{className:"numbered-staff",transform:"translate(0, 0)",children:[$&&M.accessories.map((h,A)=>c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(h)},A)),$&&M.lyrics.map((h,A)=>c.jsx(Se,{placement:"top",title:h.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(0, 0, 255, 0.2)","data-text":h.text,onClick:()=>console.log(h)})},A)),M.measures.map((h,A)=>{const D=h.notes.length===0;return c.jsx(Se,{placement:"top",title:h.expression,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsxs("g",{className:"numbered-measure",transform:`translate(${h.left}, ${h.top})`,onClick:()=>console.log(h),children:[$&&c.jsx("rect",{className:"measure-rect",x:0,y:0,width:h.right-h.left,height:h.bottom-h.top,fill:D?"rgba(255, 0, 0, 0.4)":"rgba(0, 255, 0, 0.2)"}),N&&c.jsx("line",{className:"measure-bar",x1:0,y1:0,x2:0,y2:h.bottom-h.top,stroke:"#000",strokeWidth:"2"}),N&&c.jsx("text",{className:"measure-number",x:0,y:-5,fontSize:o.width/80,children:L+A+1}),$&&h.noteBboxes.map((B,Z)=>{var te;return c.jsx("rect",{className:`syllable-${(te=h.notes[Z])==null?void 0:te.syllable}`,...Ae(B),fill:"rgba(255, 0, 0, 0.2)"},Z)}),N&&h.notes.map((B,Z)=>{const te=B.bbox[2]-B.bbox[0],ne=B.bbox[3]-B.bbox[1];return B.bbox?c.jsx(zt,{id:B.id,note:B,x:B.bbox[0],y:M.baseY-h.top-o.syllableSize*.2,width:te,height:ne,fontSize:o.syllableSize},Z):null})]})},A)}),N&&M.slurConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(255, 0, 0, 0.8)",begin:D,end:B},A)}),N&&M.lyricConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(0, 255, 0, 0.8)",begin:D,end:B,perturbation:!0},A)})]},Y))]},O)})]}),H==="play"&&c.jsx(Wt,{score:t,page:o,pageIndex:_,onSeekPosition:U}),c.jsxs(ye,{size:"small",className:"numbered-page-toolbar",children:[c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveForward"}),disabled:_===0,icon:c.jsx(dt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_-1,0,w[0]),d()}}),c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveBackward"}),disabled:_===t.pages.length-1,icon:c.jsx(pt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_+1,0,w[0]),d()}}),c.jsx(Ze,{title:e.formatMessage({id:"numbered.confirmDeletePage"}),okText:e.formatMessage({id:"common.confirm"}),cancelText:e.formatMessage({id:"common.cancel"}),icon:c.jsx(et,{}),onConfirm:async()=>{t.pages.splice(_,1),d()},children:c.jsx(ee,{title:e.formatMessage({id:"numbered.deletePage"}),type:"primary",size:"small",children:e.formatMessage({id:"numbered.deletePage"})})},"delete")]})]},_)})}):c.jsx(tt,{style:{marginTop:"200px"},description:e.formatMessage({id:"numbered.empty"})})})]})})};export{ns as default};
|
|
|
|
| 1 |
+
import{r as W,j as c,a as We}from"./umi-2135699e.js";import{q as Ge,E as ze,L as He,P as Je,Q as Ke}from"./index-bbd283be.js";import{u as Ye,c as Xe,d as qe,b as Qe,E as Ze,S as et,s as fe,P as tt,e as st,f as nt,A as rt,a as it}from"./index.less_used_.module-bdd11d56.js";import{d as Be,j as at,p as ot}from"./tiny-invariant-23ba74ad.js";import{S as lt,u as ct,e as ut}from"./index-61307b6b.js";import{A as se,M as ht,r as ie,W as mt,B as Ne,D as dt,F as pt,m as he}from"./index-22b5485d.js";import{S as gt}from"./scheduler-a7fa9c3c.js";import{c as je,u as ft,r as ye,n as Ee,H as yt,m as we,M as bt,J as Ie,K as Pe,F as xt,Q as vt}from"./_setToString-038b76d7.js";import{d as kt,b as wt,H as St,R as _t,C as Se,L as jt,S as be,f as Mt,T as _e,E as Nt}from"./util-e99b60d9.js";import{B as ee}from"./button-eb671c5b.js";import{S as Et}from"./index-eb226363.js";import{u as Ce}from"./useAsync-6dd4113e.js";import{u as It}from"./useAsyncFn-1ec42995.js";import{P as Pt,a as Ct}from"./PlaySquareOutlined-c471435e.js";import"./jszip.min-f3ba6370.js";var ve={},xe=function(){var s=function(S,u,p,g){for(p=p||{},g=S.length;g--;p[S[g]]=u);return p},e=[19,26,29],r=[2,15],t=[1,12],i=[1,10],a=[4,13,19,25,26,29],n=[1,15],l=[4,12,13,19,25,26,29],y=[1,21],k=[1,23],d=[1,22],b=[19,25,26,29],v=[4,12,13,15,19,20,26,29],N=[1,31],F=[1,32],$=[1,33],E=[4,12,13,15,19,20,25,26,27,28,29],H=[25,26,29],V=[15,19,25,26,29],I={trace:function(){},yy:{},symbols_:{error:2,start_symbol:3,EOF:4,measure:5,music_events:6,music_event:7,event:8,music_breath:9,note:10,grace:11,"|":12,"{":13,note_list:14,"}":15,left_divisions:16,pitch:17,right_divisions:18,"<":19,">":20,syllable:21,accidental:22,decorators:23,notations:24,V:25,ACC:26,DECORATOR:27,NOTATION:28,N:29,$accept:0,$end:1},terminals_:{2:"error",4:"EOF",12:"|",13:"{",15:"}",19:"<",20:">",25:"V",26:"ACC",27:"DECORATOR",28:"NOTATION",29:"N"},productions_:[0,[3,1],[3,2],[5,1],[6,1],[6,2],[7,1],[7,1],[8,1],[8,3],[8,3],[11,3],[14,1],[14,2],[10,3],[16,0],[16,2],[18,0],[18,2],[17,1],[17,2],[17,2],[17,2],[17,2],[17,2],[22,1],[22,2],[23,1],[23,2],[24,1],[24,2],[21,1],[9,1]],performAction:function(u,p,g,f,j,x,ae){var P=x.length-1;switch(j){case 1:return null;case 2:return x[P-1];case 3:this.$=m(x[P]);break;case 4:case 12:case 27:case 29:this.$=[x[P]];break;case 5:case 13:case 28:case 30:this.$=[...x[P-1],x[P]];break;case 9:this.$={...x[P],grace:x[P-2]};break;case 10:this.$={...x[P-2],postGrace:x[P]};break;case 11:case 24:this.$=x[P-1];break;case 14:this.$={ldiv:x[P-2],...A(x[P-1]),rdiv:x[P]};break;case 15:case 17:this.$=0;break;case 16:case 18:this.$=x[P-1]+1;break;case 19:this.$={syllable:x[P]};break;case 20:this.$={acc:x[P-1],...x[P]};break;case 21:this.$={...x[P-1],decorators:[...x[P-1].decorators||[],...x[P]]};break;case 22:this.$={...x[P-1],notations:[...x[P-1].notations||[],...x[P]]};break;case 23:case 25:this.$=x[P];break;case 26:this.$=x[P-1]+x[P];break}},table:[s(e,r,{3:1,5:3,6:4,7:5,8:6,9:7,10:8,11:9,16:11,4:[1,2],13:t,25:i}),{1:[3]},{1:[2,1]},{4:[1,13]},s(e,r,{8:6,9:7,10:8,11:9,16:11,7:14,4:[2,3],13:t,25:i}),s(a,[2,4]),s(a,[2,6],{12:n}),s(a,[2,7]),s(l,[2,8]),{12:[1,16]},s(a,[2,32]),{17:17,19:[1,18],21:19,22:20,25:y,26:k,29:d},s(b,r,{16:11,14:24,10:25}),{1:[2,2]},s(a,[2,5]),{11:26,13:t},s(b,r,{10:8,11:9,16:11,8:27,13:t}),s(v,[2,17],{18:28,23:29,24:30,25:N,27:F,28:$}),s(b,[2,16]),s(E,[2,19]),{17:34,21:19,22:20,25:y,26:[1,35],29:d},{17:36,21:19,22:20,25:y,26:k,29:d},s(E,[2,31]),s(H,[2,25]),s(b,r,{16:11,10:38,15:[1,37]}),s(V,[2,12]),s(l,[2,10]),s(a,[2,9],{12:n}),s([4,12,13,15,19,25,26,29],[2,14],{20:[1,39]}),s([4,12,13,15,19,20,25,26,28,29],[2,21],{27:[1,40]}),s([4,12,13,15,19,20,25,26,27,29],[2,22],{28:[1,41]}),s(E,[2,24]),s(E,[2,27]),s(E,[2,29]),s(v,[2,20],{23:29,24:30,25:N,27:F,28:$}),s(H,[2,26]),s(v,[2,23],{23:29,24:30,25:N,27:F,28:$}),s(l,[2,11]),s(V,[2,13]),s([4,12,13,15,19,20,25,26,29],[2,18]),s(E,[2,28]),s(E,[2,30])],defaultActions:{2:[2,1],13:[2,2]},parseError:function(u,p){if(p.recoverable)this.trace(u);else{var g=new Error(u);throw g.hash=p,g}},parse:function(u){var p=this,g=[0],f=[null],j=[],x=this.table,ae="",P=0,pe=0,X=2,oe=1,ke=j.slice.call(arguments,1),U=Object.create(this.lexer),q={yy:{}};for(var le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,le)&&(q.yy[le]=this.yy[le]);U.setInput(u,q.yy),q.yy.lexer=U,q.yy.parser=this,typeof U.yylloc>"u"&&(U.yylloc={});var ce=U.yylloc;j.push(ce);var ue=U.options&&U.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var ge=function(){var M;return M=U.lex()||oe,typeof M!="number"&&(M=p.symbols_[M]||M),M},z,Q,J,re,o={},_,C,w,O;;){if(Q=g[g.length-1],this.defaultActions[Q]?J=this.defaultActions[Q]:((z===null||typeof z>"u")&&(z=ge()),J=x[Q]&&x[Q][z]),typeof J>"u"||!J.length||!J[0]){var L="";O=[];for(_ in x[Q])this.terminals_[_]&&_>X&&O.push("'"+this.terminals_[_]+"'");U.showPosition?L="Parse error on line "+(P+1)+`:
|
| 2 |
`+U.showPosition()+`
|
| 3 |
+
Expecting `+O.join(", ")+", got '"+(this.terminals_[z]||z)+"'":L="Parse error on line "+(P+1)+": Unexpected "+(z==oe?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(L,{text:U.match,token:this.terminals_[z]||z,line:U.yylineno,loc:ce,expected:O})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+z);switch(J[0]){case 1:g.push(z),f.push(U.yytext),j.push(U.yylloc),g.push(J[1]),z=null,pe=U.yyleng,ae=U.yytext,P=U.yylineno,ce=U.yylloc;break;case 2:if(C=this.productions_[J[1]][1],o.$=f[f.length-C],o._$={first_line:j[j.length-(C||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(C||1)].first_column,last_column:j[j.length-1].last_column},ue&&(o._$.range=[j[j.length-(C||1)].range[0],j[j.length-1].range[1]]),re=this.performAction.apply(o,[ae,pe,P,q.yy,J[1],f,j].concat(ke)),typeof re<"u")return re;C&&(g=g.slice(0,-1*C*2),f=f.slice(0,-1*C),j=j.slice(0,-1*C)),g.push(this.productions_[J[1]][0]),f.push(o.$),j.push(o._$),w=x[g[g.length-2]][g[g.length-1]],g.push(w);break;case 3:return!0}}return!0}};const m=S=>{const u=S.filter(f=>f!=="V"&&f.syllable!=="-");let p=0;for(let f of u)p+=f.ldiv,f.underline=p,p-=f.rdiv,f.grace&&(f.grace=m(f.grace)),f.postGrace&&(f.postGrace=m(f.postGrace)),delete f.ldiv,delete f.rdiv;let g=[];for(let f of u)f.ltuplet&&g.push(f),g.length>0&&!f.ltuplet&&!f.rtuplet&&g.push(f),f.rtuplet&&(g.push(f),g.forEach(j=>{const x=g.length;j.timeWarp={numerator:x-1,denominator:x}}),g=[]),delete f.ltuplet,delete f.rtuplet;return S},A=S=>{if(S.octaves=0,S.dots=0,S.ltuplet=0,S.rtuplet=0,S.decorators){for(let u=0;u<S.decorators.length;u++)switch(S.decorators[u]){case"'":S.octaves+=1;break;case",":S.octaves-=1;break;case".":S.dots+=1;break;case"[":S.ltuplet=1;break;case"]":S.rtuplet=1;break}delete S.decorators}return S.notations&&(S.notations=S.notations.map(u=>u.replace(/[^a-z]/g,""))),S};var R=function(){var S={EOF:1,parseError:function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},setInput:function(u,p){return this.yy=p||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var p=u.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var p=u.length,g=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var j=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[j[0],j[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
| 4 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),p=new Array(u.length+1).join("-");return u+this.upcomingInput()+`
|
| 5 |
+
`+p+"^"},test_match:function(u,p){var g,f,j;if(this.options.backtrack_lexer&&(j={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(j.yylloc.range=this.yylloc.range.slice(0))),f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var x in j)this[x]=j[x];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,p,g,f;this._more||(this.yytext="",this.match="");for(var j=this._currentRules(),x=0;x<j.length;x++)if(g=this._input.match(this.rules[j[x]]),g&&(!p||g[0].length>p[0].length)){if(p=g,f=x,this.options.backtrack_lexer){if(u=this.test_match(g,j[x]),u!==!1)return u;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(u=this.test_match(p,j[f]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
| 6 |
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var p=this.next();return p||this.lex()},begin:function(p){this.conditionStack.push(p)},popState:function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},pushState:function(p){this.begin(p)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(p,g,f,j){switch(f){case 0:break;case 1:return g.yytext;case 2:return 26;case 3:return 29;case 4:return 27;case 5:return 28;case 6:return 4}},rules:[/^(?:\s+)/,/^(?:([<>\|V{}]))/,/^(?:([#bh]))/,/^(?:([0-7X-]))/,/^(?:([.,'\[\]]))/,/^(?:(\^\s?[a-z]+))/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return S}();I.lexer=R;function G(){this.yy={}}return G.prototype=I,I.Parser=G,new G}();ve.parser=xe;ve.Parser=xe.Parser;ve.parse=function(){return xe.parse.apply(xe,arguments)};var Ot=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,At=(s,e,r,t)=>{for(var i=t>1?void 0:t?Rt(e,r):e,a=s.length-1,n;a>=0;a--)(n=s[a])&&(i=(t?n(e,r,i):n(i))||i);return t&&i&&Ot(e,r,i),i},Le=(s=>(s.Title="Title",s.Author="Author",s.MeasureNumber="MeasureNumber",s.ArcLine="ArcLine",s.KeySignature="KeySignature",s.TempoNumeral="TempoNumeral",s.TimeSignature="TimeSignature",s.Lyric="Lyric",s.TextualMark="TextualMark",s.Other="Other",s.Instrument="Instrument",s.Times="Times",s.Alter="Alter",s.Signo="Signo",s.Repeat1="Repeat1",s.Repeat2="Repeat2",s.Jump="Jump",s.Emo_speed="Emo_speed",s.Dstaff="Dstaff",s.Res2="Res2",s.Res3="Res3",s))(Le||{});const De={C:0,G:1,D:2,A:3,E:4,B:5,bG:-6,bD:-5,bA:-4,bE:-3,bB:-2,F:-1,bC:-7,"#F":5,"#C":6};class Ve extends se{static className="NumberedScore";title;pageSize={width:794,height:1122};pages=[];constructor(e){super(),super.assign(e)}get measures(){return this.pages.reduce((e,r,t)=>[...e,...r.systems.reduce((i,a,n)=>{const l=[];return a.staves.forEach((y,k)=>{y.measures.forEach((d,b)=>{l[b]=l[b]||[],l[b][k]=d})}),[...i,...l]},[])],[])}async replaceImageKeys(e){await Promise.all(this.pages.map(async r=>{r.backgroundImage=await e(r.backgroundImage)}))}assemble(){var a;this.title=this.title||((a=this.pages)==null?void 0:a[0].titles.title);let e=0,r=null;const t=[],i=[];this.pages.forEach((n,l)=>{const y=n.accessories.filter(d=>d.semantic==="TimeSignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{const b=d.text.replace(/[^0-9/]/g,"").split(/[^0-9]/);let v;return b.length===2&&(v={numerator:+b[0],denominator:+b[1]}),{token:d,value:v}}).filter(d=>d.value),k=n.accessories.filter(d=>d.semantic==="KeySignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{let b=d.text.replace(/[\b]/g,"b").replace(/[^A-Ga-g]/g,"");return b.length===1&&(b=b.toUpperCase()),b.length===2&&(b=b[0]+b[1].toUpperCase()),{token:d,value:De[b]||0}});n.systems.forEach((d,b)=>{const v=[],N=[];for(;y.length!==0;){const m=y[0];if((m.token.box[3]-m.token.box[1])/2<d.top)v.push(y.shift());else break}for(v.sort((m,A)=>m.token.box[0]-A.token.box[0]);k.length!==0;){const m=k[0];if((m.token.box[3]-m.token.box[1])/2<d.top)N.push(k.shift());else break}N.sort((m,A)=>m.token.box[0]-A.token.box[0]);const F={},$={};if(b===0&&n.titles){if(v.length){const m=v.shift();F[0]=m.value}else F[0]={numerator:4,denominator:4};if(N.length){const m=N.shift();$[0]=m.value}else $[0]=0}v.forEach(m=>{const A=Re(Y(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));A&&(F[A.measureIndex]=m.value)}),N.forEach(m=>{const A=Re(Y(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));A&&($[A.measureIndex]=m.value)});let E=t.at(-1);const H=d.staves[0].measures.map((m,A)=>{const R=F[A];return R?(E=R,R):E});t.push(...H);let V=i.at(-1);const I=d.staves[0].measures.map((m,A)=>{const R=$[A];return R?(V=R,R):V});i.push(...I),d.staves.forEach((m,A)=>{m.measures.forEach((R,G)=>{R.measureIndex=e+G,R.timeSignature=t[R.measureIndex],R.keySignature=i[R.measureIndex],R.notes.forEach((S,u)=>{S.id=Ut(l,b,A,G,S.syllable,Y(S.bbox||[0,0,0,0])),r&&(r.next=S,S.prev=r),r=S})})}),e+=Math.max(...d.staves.map(m=>m.measures.length))})})}makeVoiceStaves(){const e=[];let r=0;return this.pages.forEach((t,i)=>{t.systems.forEach((a,n)=>{a.staves.forEach((l,y)=>{e[y]=e[y]||{voices:[{measures:[]}]},l.measures.forEach((k,d)=>{if(!e[y].voices[0].measures[k.measureIndex]){const b=Object.fromEntries(k.notes.reduce((v,N)=>(N.tick=v.current,N.staff=y,N.system=r+n,{pairs:[...v.pairs,[v.current,N]],current:v.current+N.duration}),{pairs:[],current:0}).pairs);e[y].voices[0].measures[k.measureIndex]={tickMap:b,duration:k.duration,timeSignature:k.timeSignature,keySignature:k.keySignature,break:!1,pageBreak:!1,empty:k.notes.length===0,voiceIndex:y}}})})}),r+=t.systems.length}),e}perform(){this.assemble();const e=this.makeVoiceStaves();if(!e)return null;const r=new Map;let t=0;const i=this.pages.reduce((n,l)=>[...n,...l.systems.reduce((y,k)=>[...y,...k.staves[0].measures],[])],[]).filter(n=>n.notes.length>0).map(n=>{const l=e.map(v=>v.voices.map(N=>N.measures[n.measureIndex])).flat(),y=l[0],k=t;t+=y.duration;const d=l.map((v,N)=>Object.values(v.tickMap).map(E=>{let H=0,V=E.next;for(V!=null&&V.slurEnd&&(H+=V.duration,V=V.next);(V==null?void 0:V.syllable)==="-";)H+=V.duration,V=V.next;const I=Math.round(E.duration+H);return r.set(E.id,{system:E.system,measure:n.measureIndex,x:n.left+E.roundX,endX:n.left+n.right}),{tick:Math.round(E.tick),duration:I,pitches:[{note:E,value:E.toMidiPitch(v.keySignature)}],noteIds:[E.id],part:0,staff:E.staff}}).map(E=>{const H=E.pitches.reduce((I,m)=>(I[m.value]=m,I),{});return Object.values(H).sort((I,m)=>I.note.syllable>m.note.syllable?1:-1).filter(I=>{var m,A;return!(I.note.slurEnd&&((A=(m=I.note)==null?void 0:m.prev)==null?void 0:A.syllable)===I.note.syllable)&&I.note.syllable!=="-"}).map((I,m)=>{const A=E.noteIds&&E.noteIds[m];return{tick:E.tick,pitch:I.value,duration:E.duration,chordPosition:{index:m,count:E.pitches.length},tied:I.note.slurEnd||I.note.syllable==="-",id:A,ids:[A],track:E.part,staff:E.staff,channel:0,subNotes:[{startTick:0,endTick:E.duration,pitch:I.value,velocity:127}]}})}).flat()).flat(),b=[];return{tick:k,duration:n.duration,notes:d,events:b,timeSignature:n.timeSignature,keySignature:n.keySignature}});return i[0].events.push({track:0,ticks:0,data:{type:"meta",subtype:"setTempo",microsecondsPerBeat:5e5}}),{notation:new ht({measures:i}),tokenMap:r}}}class Tt extends se{static className="NumberedPage";imageSize;backgroundImage;accessories;systems;constructor(e){super(),super.assign(e)}get width(){return this.imageSize.width}get height(){return this.imageSize.height}get titles(){const e=this.accessories.filter(i=>i.semantic==="Title").sort((i,a)=>Y(i.box).y-Y(a.box).y).map(i=>i.text);if(e.length===0)return null;const r=e[0],t=e.slice(1).join(`
|
| 7 |
+
`);return{title:r,subtitle:t}}get authors(){return this.accessories.filter(e=>e.semantic==="Author")}get measureCount(){return this.systems.reduce((e,r)=>e+r.measureCount,0)}get syllableSize(){let e=[];return this.systems.forEach(r=>{r.staves.forEach(t=>{t.measures.forEach(i=>{i.noteBboxes.forEach(a=>{e.push(a[3]-a[1])})})})}),e.sort((r,t)=>t-r)[5]}}class $t extends se{static className="NumberedSystem";left;top;right;bottom;bracketsAppearance;staves;constructor(e){super(),super.assign(e)}get width(){return this.right-this.left}get noteRange(){return{top:0,bottom:this.staves.reduce((e,r)=>Math.max(e,Math.max(...r.accessories.map(t=>t.box[3])),r.measures.reduce((t,i)=>Math.max(t,i.bottom),0)),0)}}get measureCount(){return this.staves[0].measures.length}}class Bt extends se{static className="NumberedStaff";baseY;accessories;measures;voice;constructor(e){super(),super.assign(e)}get lyrics(){return this.accessories.filter(e=>e.semantic==="Lyric").reduce((e,r)=>{if(r.text.replace(/[^A-z-]/g,"").length/r.text.length>.5)return[...e,r];const[t,i,a,n]=r.box,l=(a-t)/r.text.length;let y=[];for(let k=0;k<r.text.length;k++){const d=ie(r.toJSON(),{NumberedAccessory:Fe});d.box=[t+k*l,i,t+(k+1)*l,n],d.text=r.text[k],y.push(d)}return[...e,...y]},[])}get slurs(){return this.accessories.filter(e=>e.semantic==="ArcLine")}get slurConnections(){const e=this.slurs.map(n=>[{slur:n,begin:!0,point:{x:n.box[0],y:n.box[3]}},{slur:n,end:!0,point:{x:n.box[2],y:n.box[3]}}]).flat();let r=0;const t=this.measures.map((n,l)=>{const y=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=Y(v.bbox),$={x:n.left+F.x,y:n.top+F.y};return{note:v,slur:d,points:[$,d.point],angle:Me(d.point,$),distance:Math.sqrt(Math.pow(n.left+(v.bbox[2]-v.bbox[0])/2-d.point[0],2)+Math.pow(n.top+v.bbox[1]-d.point[1],2)),measureHeight:n.bottom-n.top,slurIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,y}).flat(1).sort((n,l)=>n.angle-l.angle),i=new Set,a=[];for(let n of t)i.has(n.slur)||(i.add(n.slur),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>(n.note.slurBegin=n.slur.begin,n.note.slurEnd=n.slur.end,[n.note,n.slur.slur,n.points,n.angle]))}get lyricConnections(){const e=this.lyrics;let r=0;const t=this.measures.map((n,l)=>{const y=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=Y(v.bbox),$={x:n.left+F.x,y:n.top+F.y},E=Y(d.box);return{note:v,lyric:d,points:[$,E],angle:Me(E,$),lyricIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,y}).flat(1).sort((n,l)=>n.angle-l.angle),i=[],a=[];for(let n of t.filter(l=>l.angle<36))i.includes(n.lyric)||(i.push(n.lyric),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>[n.note,n.lyric,n.points,n.angle])}}class Ue extends se{static className="NumberedMeasure";left;top;right;bottom;expression;noteBboxes;semantics;measureIndex;keySignature;timeSignature;constructor(e){super(),super.assign(e)}get duration(){return this.notes.reduce((e,r)=>e+r.duration,0)}get notes(){const e=this.expression.replace(/[(())]/g,"").replace(/<\s>/g,"").replace(/<+$/g,"").replace(/^\)$/g,"").replace(/_ { \. }/,",");let r=[];try{r=ve.parse(e)}catch(t){console.error(t)}return r?r.filter(t=>t!=="V").map((t,i)=>{var a,n;return t.syllable==="-"?new de({syllable:"-",accidental:"",octaves:0,dots:0,division:2,bbox:this.noteBboxes[i]||[0,0,0,0]}):new de({syllable:t.syllable,accidental:t.acc||"",octaves:t.octaves||0,dots:t.dots||0,division:t.underline+2,bbox:this.noteBboxes[i]||[0,0,0,0],breath:!!t.breath,timeWarp:t.timeWarp,grace:((a=t.grace)==null?void 0:a.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null,postGrace:((n=t.postGrace)==null?void 0:n.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null})}):[]}validate(){}}At([Vt],Ue.prototype,"notes",1);class Lt extends se{static className="NumberedSemantic";constructor(e){super(),super.assign(e)}}class Fe extends se{static className="NumberedAccessory";box;semantic;text;constructor(e){super(),super.assign(e)}}class de extends se{static className="NumberedNote";static blackKeys=["prev","next"];prev;next;syllable;accidental;octaves=0;dots=0;division;timeWarp;bbox;slurBegin;slurEnd;breath;grace;id;tick;system;staff;constructor(e){super(),super.assign(e)}get duration(){return mt*2**-this.division*(2-2**-this.dots)*(this.timeWarp?this.timeWarp.numerator/this.timeWarp.denominator:1)}get roundX(){return Y(this.bbox||[0,0,0,0]).x}toMidiPitch(e){var t;let r=((t=this.accidental)==null?void 0:t.split("").reduce((i,a)=>i+{b:-1,"#":1,h:0}[a],0))??0;if(["X","0"].includes(this.syllable))return this.syllable;if(this.syllable==="-"){let i=this.prev;for(;!/^[1-7]$/g.test(i.syllable);)i=i.prev;return Oe(e)+Ne[+i.syllable-1]}if(/^[1-7]$/g.test(this.syllable))return Oe(e)+Ne[+this.syllable-1]+this.octaves*12+r}}function Y(s,e){const[r,t,i,a]=s;return{x:((e==null?void 0:e.x)??0)+(r+i)/2,y:((e==null?void 0:e.y)??0)+(t+a)/2}}function Dt(s,e){const{x:r,y:t}=Y(s),{x:i,y:a}=Y(e);return Math.pow(i-r,2)+Math.pow(a-t,2)}function Me(s,e){const{x:r,y:t}=s,{x:i,y:a}=e;return Math.abs(Math.atan((i-r)/(a-t))*180/Math.PI)}function Vt(s,e,r){r.enumerable=!0;const t=r.get;r.get=function(){return this[`__${e}`]||(this[`__${e}`]=t.call(this)),this[`__${e}`]}}function Ut(s,e,r,t,i,a){const n=Math.round(a.x*10),l=Math.round(a.y*10),y=`${s}|${e}|${r}|${t}|${i}|${n}|${l}`,k=dt.array(y).slice(12);return globalThis.btoa(String.fromCharCode(...k)).substring(0,11)}function Oe(s){const r=["C","bD","D","bE","E","F","bG","G","bA","A","bB","B"].findIndex(i=>De[i]===s);let t=r<12-r?r:r-12;return pt+t}function Re(s,e){let r=Number.MAX_SAFE_INTEGER,t=null;for(let i of e){const a=Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2);a<r&&(r=a,t=i)}return t}const me=Object.freeze(Object.defineProperty({__proto__:null,AccessoryType:Le,NumberedAccessory:Fe,NumberedMeasure:Ue,NumberedNote:de,NumberedPage:Tt,NumberedScore:Ve,NumberedSemantic:Lt,NumberedStaff:Bt,NumberedSystem:$t,angleVertical:Me,getBoxCenter:Y,squareDistance:Dt},Symbol.toStringTag,{value:"Module"})),Ft=({score:s,page:e,pageIndex:r,onSeekPosition:t})=>{const[i]=Be(),a=W.useRef(null);let n=0;if(i){let l=0;for(const[y,k]of s.pages.entries()){if(i.system>=l-1&&i.system<l+k.systems.length){n=+y;break}l+=k.systems.length}}return W.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,n]),c.jsx("svg",{className:je("graph"),style:{objectFit:"contain",position:"absolute",top:0,left:0},viewBox:`0 0 ${e==null?void 0:e.width} ${e==null?void 0:e.height}`,children:e.systems.map((l,y)=>{const k=s.pages.slice(0,r).reduce((d,b)=>d+b.systems.length,0)+y;return c.jsxs("g",{className:je("system"),transform:`translate(${l.left}, ${l.top})`,children:[c.jsx("rect",{style:{opacity:0},x:0,y:l.noteRange.top,width:l.width,height:l.noteRange.bottom-l.noteRange.top,onClick:d=>{const b=d.target,v=b.getBoundingClientRect(),N=d.clientX-v.left,F=b.getBBox(),$=N/v.width*F.width;t({system:k,x:$})}}),(i==null?void 0:i.system)===k?c.jsx("line",{ref:a,transform:`translate(${i.x-e.syllableSize/4}, 0)`,x1:0,x2:0,y1:l.noteRange.top,y2:l.noteRange.bottom,style:{stroke:"rgba(173, 216, 230, 0.8)",strokeWidth:e.syllableSize/2}}):null]},y)})})},Wt=W.memo(Ft),Ae=600;function Te(s,e=0,r=0){return{x:e+s[0],y:r+s[1],width:s[2]-s[0],height:s[3]-s[1]}}function Gt(s){return[["root","NumberedPage"],["root.accessories[*]","NumberedAccessory"],["root.systems[*]","NumberedSystem"],["root.systems[*].staves[*]","NumberedStaff"],["root.systems[*].staves[*].accessories[*]","NumberedAccessory"],["root.systems[*].staves[*].measures[*]","NumberedMeasure"]].forEach(([r,t])=>{const a=r.split(/[.\[\]]/).filter(Boolean).reduce((n,l)=>l==="root"?n:Array.isArray(n)?l==="*"?n:[].concat(...n.map(y=>y[l])):n[l],s);a&&(Array.isArray(a)?a.forEach(n=>{n.__prototype=t}):a.__prototype=t)}),s}const $e=({begin:s,end:e,strokeWidth:r=2,stroke:t="#000",perturbation:i=!1})=>{const a=e.y-s.y,n=[s.x+a/6,s.y+a/6],l=[e.x+a/6,e.y-a/6];return c.jsxs("g",{children:[c.jsx("path",{d:`M${s.x} ${s.y} C ${n.join(" ")}, ${l.join(" ")}, ${e.x} ${e.y}`,strokeWidth:r,stroke:t,fill:"none"}),c.jsx("circle",{cx:s.x,cy:s.y,r:r*1.618,fill:t}),c.jsx("circle",{cx:e.x,cy:e.y,r:r*1.618,fill:t})]})},zt=({x:s,y:e,width:r,height:t,note:i,fontSize:a,...n})=>c.jsxs("g",{transform:`translate(${s}, ${e})`,...n,children:[c.jsx("text",{className:"measure-note",fontSize:a,children:i.syllable===null?"-":i.syllable}),new Array(Math.max(i.division-2,0)).fill(null).map((l,y)=>c.jsx("line",{x1:0,x2:r,y1:0,y2:0,transform:`translate(0, ${a*.1+y*a*.12})`,strokeWidth:a*.03,stroke:"#000"},y)),new Array(Math.abs(i.octaves)).fill(null).map((l,y)=>{const k=a*.1*i.division;return c.jsx("circle",{transform:`translate(${r/2}, ${i.octaves>0?-a-y*a*.15:k+y*a*.15})`,cx:0,cy:0,r:a*.07,fill:"#000"},y)}),new Array(Math.abs(i.dots)).fill(null).map((l,y)=>c.jsx("circle",{transform:`translate(${r*2+y*(a/2)}, ${-a*.382})`,cx:0,cy:0,r:a*.08,fill:"#000"},y)),i.accidental&&c.jsx("text",{className:"measure-note",transform:`translate(${-r*.6}, ${-a*.3})`,fontSize:a,children:i.accidental.replace(/b/g,"♭").replace(/#/g,"♯").replace(/h/g,"♮")})]}),os=s=>{var z,Q,J,re;const e=ft(),r=We(),[t,i]=W.useState(new Ve({})),a=W.useRef(null),[n,l]=W.useState(""),[y,k]=W.useState(!1),d=kt(),[b,v]=W.useState(!0),[N,F]=W.useState(!0),[$,E]=W.useState(!0),[H,V]=at(),I=W.useRef(null),m=W.useRef(null),A=W.useRef(new lt(performance)),R=W.useRef(!1),[G,S]=ot(),[u,p]=Be(),[g,{inc:f,dec:j,set:x,reset:ae}]=Ye(90,300,10),[P,pe]=W.useState(null),X=W.useMemo(()=>{var _,C;const o=Ge.parse(window.location.search);return(o==null?void 0:o.type)==="admin"?{type:"admin",env:o.env,id:o.id,edit:o.edit==="1"}:{type:"user",id:(r==null?void 0:r.id)||((C=(_=s==null?void 0:s.match)==null?void 0:_.params)==null?void 0:C.id)||P}},[s,P,r]);Ce(async()=>{var o;try{if(!X.id)return null;l(e.formatMessage({id:"common.loading"}));let _=[],C=null,w;if(X.type==="user"){const O=await ye.get(`/api/musicSets/${X.id}`);C=Ee((o=O==null?void 0:O.content)==null?void 0:o.scoreURL),C&&(w=ie(await(await fetch(C)).text(),me),await w.replaceImageKeys(async L=>/https?:\/\/|data:/.test(L)?Ee(L):L!=null&&L.startsWith("md5:")?Xe((await yt()).omrDomain,L.replace("md5:","")):L),w.assemble())}w?(window.score=w,i(w)):we.error(e.formatMessage({id:"common.scoreNotFound"})),l("")}catch(_){console.error(_)}},[]);const oe=()=>{m.current.play({nextFrame:()=>(I.current&&p(I.current.lookupPosition(m.current.progressTicks)),new Promise(o=>setTimeout(o,0)))})},ke=async o=>{if(!o.pages.length)return;const{notation:_,tokenMap:C}=o.perform(),w=Array(_.measures.length).fill(null).map((M,K)=>K+1),O=_.toPerformingNotationWithEvents(w);O.scaleTempo({headTempo:6e7/g}),I.current=gt.createFromNotation(O,C);const L=m.current?m.current.progressTicks:0;m.current&&m.current.dispose(),m.current=new he.MidiPlayer(O,{cacheSpan:200,onMidi:(M,K)=>{let h=null;switch(M.subtype){case"noteOn":he.MidiAudio.noteOn(M.channel,M.noteNumber,M.velocity,K),h=()=>{var T;return(T=M==null?void 0:M.ids)==null?void 0:T.map(D=>{const B=document.getElementById(D);B&&B.classList.add("notePlayOn")})};break;case"noteOff":he.MidiAudio.noteOff(M.channel,M.noteNumber,K),h=()=>{var T;return(T=M==null?void 0:M.ids)==null?void 0:T.map(D=>{const B=document.getElementById(D);B&&B.classList.remove("notePlayOn")})};break}h&&A.current.appendTask(K,h)},onPlayFinish(){S(!1),m.current&&(m.current.progressTicks=0)},onTurnCursor(){m.current&&I.current&&p(I.current.lookupPosition(m.current.progressTicks))}}),m.current.progressTicks=L,R.current=!1};W.useEffect(()=>{G?(async()=>{var o;(!m.current||R.current)&&(R.current=!1,await ke(t)),(o=m.current)!=null&&o.isPlaying||oe()})():m.current&&m.current.pause()},[G,t]),Ce(()=>he.MidiAudio.WebAudio.empty()?he.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>console.debug("Soundfont loaded.")):Promise.resolve());const U=W.useCallback(async o=>{var C;if(!(I!=null&&I.current)){console.log("scheduler is null:",I==null?void 0:I.current);return}const _=(C=m.current)==null?void 0:C.isPlaying;_&&(m.current.pause(),await new Promise(w=>setTimeout(w,0))),document.querySelectorAll(".notePlayOn").forEach(w=>w.classList.remove("notePlayOn")),m.current.progressTicks=I.current.lookupTick(o),_&&oe()},[]),[q,le]=It(async o=>{l(e.formatMessage({id:"common.savingScore"})),await o.replaceImageKeys(async O=>O&&await ct(O));const _=new Blob([JSON.stringify(o.toJSON())],{type:"application/json"}),C=bt(_,`${Date.now()}.json`),w=await Ie(C);await Pe(C,{key:w.key,uploadUrl:w.uploadUrl});try{let O=o.title;O=O||e.formatMessage({id:"common.untitledNumbered"});const L={name:O,content:{images:o.pages.map(K=>({url:K.backgroundImage})),scoreURL:w.url},tagIdList:[],type:"simple"};let M;X.id?M=await ye.put(`/api/musicSets/${X.id}`,{data:L}):M=await ye.post("/api/musicSets",{data:L}),String(M.id)!==X.id&&(pe(M.id),window.history.replaceState(null,"",`/numbered/${M.id}`)),i(ie(JSON.stringify(o),me)),xt.success({placement:"bottomRight",message:e.formatMessage({id:"common.saveResult"}),description:e.formatMessage({id:"common.saveSuccess"})})}catch(O){console.log(O)}l("")},[P]);qe(()=>{m.current&&m.current.dispose(),l(""),S(!1),V("edit"),p(null),ae()});const ce=Qe({onFiles:async(o,_)=>{var w;const C=_.dataTransfer.items;if(C.length===1&&C[0].webkitGetAsEntry().isDirectory){const L=C[0].webkitGetAsEntry().createReader();async function M(K){const h=await new Promise((T,D)=>{K.readEntries(async B=>{T(await Promise.all(B.map(async Z=>new Promise(te=>Z.file(ne=>te(ne))))))},D)});return h.length>0?[...h,...await M(K)]:h}l(e.formatMessage({id:"common.loading"})),await M(L),l("");return}switch(o[0].type){case"application/zip":case"application/x-zip-compressed":case"application/json":const O=o[0];l(e.formatMessage({id:"common.loading"}));const L=await ut(O);L&&i(L),l("");break;case"application/pdf":await((w=a.current)==null?void 0:w.onReceivePDF(o));break;default:console.debug("drop file type:",o[0].type),o[0].type.startsWith("image")&&await ue(o)}},onUri:o=>console.log("uri",o),onText:o=>console.log("text",o)}),ue=async o=>{l(e.formatMessage({id:"common.uploadingImages"}));const _=Array.from(o).map(async h=>{if(typeof h=="string"){const D=await new Promise(te=>{const ne=document.createElement("img");ne.src=h,ne.onload=()=>{te(ne)}}),B=document.createElement("canvas");B.width=D.naturalWidth,B.height=D.naturalHeight;const Z=vt(B.toDataURL("image/png"),h.slice(h.lastIndexOf("/")+1));return Z.url=h,Z.dimensions={width:D.naturalWidth,height:D.naturalHeight},Z}const T=await Ie(h);return h.url=T.url,t.pages.find(D=>D.backgroundImage===T.url)?(we.warn(e.formatMessage({id:"common.imageExists"},{name:h.name})),null):(await Pe(h,{key:T.key,uploadUrl:T.uploadUrl}),h)}),C=(await Promise.all(_)).filter(Boolean),w=await Promise.all(C.map(h=>new Promise(T=>{const D=new globalThis.Image;D.src=h.url,D.onload=()=>{h.dimensions={width:D.naturalWidth,height:D.naturalHeight},T(D.naturalHeight/D.naturalWidth)}}))),O=t.pageSize.height/t.pageSize.width;typeof O=="number"&&O&&w.push(O);const L=Math.max(...w);t.pageSize={width:794,height:Math.round(794*L)},l(e.formatMessage({id:"common.recognizingImages"}));const M=await ye.post("/api/predict/jianpu",{data:{images:C.map(h=>h.url)}});t.pages.push(...M.map((h,T)=>ie(Gt({...h,backgroundImage:C[T].url}),me))),t.assemble();const K=ie(JSON.stringify(t),me);window.score=K,R.current=!0,i(K),l("")};let ge=0;return c.jsx(Et,{spinning:!!n,tip:n,style:{backgroundColor:ce.over?"red":"initial"},children:c.jsxs(wt,{style:{height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:y?"#efe":"#eee"},onDragOver:o=>{o.preventDefault(),k(y)},onDragLeave:()=>k(!1),onPaste:o=>{const _=o.clipboardData.getData("text/plain");/^https?.*(png|jpe?g|gif|webp)$/.test(_)&&ue([_])},children:[c.jsx(St,{className:"numbered-header",children:c.jsxs(_t,{style:{width:"100%",display:"flex",justifyContent:"space-between"},gutter:16,children:[c.jsxs(Se,{style:{display:"flex",alignItems:"center"},children:[c.jsx(jt,{to:"/",className:"logo",children:"STARRY"}),c.jsx(Ze,{placeholder:e.formatMessage({id:"numbered.titlePlaceholder"}),defaultValue:e.formatMessage({id:"numbered.defaultTitle"}),style:{height:"30px"},value:t==null?void 0:t.title,onChange:o=>{const _=ie(JSON.stringify(t),me);_.title=o.target.value,i(_)}})]}),c.jsxs(Se,{children:[H==="edit"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToPlay"}),disabled:!((z=t==null?void 0:t.pages)!=null&&z.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(Pt,{}),onClick:()=>{if(!t.pages.some(o=>{var _;return((_=o.systems)==null?void 0:_.length)>0})){we.warn(e.formatMessage({id:"numbered.recognizeFirst"}));return}V("play")}}),H==="play"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToEdit"}),disabled:!((Q=t==null?void 0:t.pages)!=null&&Q.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(ze,{}),onClick:()=>{V("edit"),S(!1)}})]}),H==="play"&&c.jsxs(be,{style:{flex:1,paddingLeft:"10px"},children:[c.jsx(et,{title:e.formatMessage({id:"numbered.goToStart"}),className:fe.playControlBtn,onClick:()=>{U({system:0,x:0})}}),G?c.jsx(Ct,{title:e.formatMessage({id:"common.pause"}),className:je(fe.playControlBtn,{[fe.playControlBtnActive]:G}),onClick:()=>{S(!G)}}):c.jsx(tt,{title:e.formatMessage({id:"common.play"}),className:fe.playControlBtn,onClick:()=>{S(!G)}}),c.jsxs("div",{children:["𝅘𝅥 =",c.jsx("input",{value:g,style:{padding:"0 5px",display:"inline",border:"none",width:"50px"},type:"number",step:10,onChange:o=>{x(+o.target.value),R.current=!0}})]})]}),c.jsx(Se,{style:{flex:1},children:c.jsx(st,{ref:a,onChange:ue})}),c.jsxs(be,{style:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[c.jsxs(ee,{icon:c.jsx(nt,{}),loading:q.loading,onClick:()=>le(t),disabled:!((J=t==null?void 0:t.pages)!=null&&J.length)&&(X.type!=="admin"||X.edit),children:[q.loading?e.formatMessage({id:"common.saving"}):e.formatMessage({id:"common.save"})," ",t.modified?"*":""]}),c.jsxs(ee.Group,{size:"small",children:[c.jsx(ee,{type:b?"primary":"ghost",onClick:()=>{v(!b)},children:e.formatMessage({id:"common.originalImage"})}),c.jsx(ee,{type:N?"primary":"ghost",onClick:()=>{F(!N)},children:e.formatMessage({id:"common.symbols"})}),c.jsx(ee,{type:$?"primary":"ghost",onClick:()=>{E(!$)},children:"BBox"})]}),c.jsx(He,{})]})]})}),c.jsx(Mt,{className:"numbered-score",style:{flex:1,flexShrink:0,overflow:"scroll"},onWheel:o=>{},children:(re=t==null?void 0:t.pages)!=null&&re.length?c.jsx(be,{wrap:!0,style:{padding:"8px"},children:t==null?void 0:t.pages.map((o,_)=>{const C={x:0,y:0,width:o.width,height:o.height};return c.jsxs("div",{className:"relative numbered-page bg-white",style:{boxShadow:"0 0 5px rgb(44 44 44 / 20%)"},children:[c.jsxs("svg",{width:o.width,height:o.height,viewBox:`0 0 ${o.width} ${o.height}`,style:{width:`${Ae}px`,height:`${Ae*o.height/o.width}px`},children:[b&&(o==null?void 0:o.backgroundImage)&&c.jsx("image",{className:"background",...C,href:o.backgroundImage}),$&&o.accessories.map((w,O)=>c.jsx(_e,{placement:"top",title:w.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`page-acc-${w.semantic}`,...Te(w.box),fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(w)})},O)),o.systems.map((w,O)=>{const L=ge;return ge+=w.measureCount,c.jsxs("g",{className:"numbered-system","data-system":O,transform:`translate(${w.left}, ${w.top})`,children:[$&&c.jsx("rect",{x:0,y:0,width:w.right-w.left,height:w.bottom-w.top,fill:"rgba(0, 0, 0, 0.2)"}),w.staves.map((M,K)=>c.jsxs("g",{className:"numbered-staff",transform:"translate(0, 0)",children:[$&&M.accessories.map((h,T)=>c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(h)},T)),$&&M.lyrics.map((h,T)=>c.jsx(_e,{placement:"top",title:h.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(0, 0, 255, 0.2)","data-text":h.text,onClick:()=>console.log(h)})},T)),M.measures.map((h,T)=>{const D=h.notes.length===0;return c.jsx(_e,{placement:"top",title:h.expression,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsxs("g",{className:"numbered-measure",transform:`translate(${h.left}, ${h.top})`,onClick:()=>console.log(h),children:[$&&c.jsx("rect",{className:"measure-rect",x:0,y:0,width:h.right-h.left,height:h.bottom-h.top,fill:D?"rgba(255, 0, 0, 0.4)":"rgba(0, 255, 0, 0.2)"}),N&&c.jsx("line",{className:"measure-bar",x1:0,y1:0,x2:0,y2:h.bottom-h.top,stroke:"#000",strokeWidth:"2"}),N&&c.jsx("text",{className:"measure-number",x:0,y:-5,fontSize:o.width/80,children:L+T+1}),$&&h.noteBboxes.map((B,Z)=>{var te;return c.jsx("rect",{className:`syllable-${(te=h.notes[Z])==null?void 0:te.syllable}`,...Te(B),fill:"rgba(255, 0, 0, 0.2)"},Z)}),N&&h.notes.map((B,Z)=>{const te=B.bbox[2]-B.bbox[0],ne=B.bbox[3]-B.bbox[1];return B.bbox?c.jsx(zt,{id:B.id,note:B,x:B.bbox[0],y:M.baseY-h.top-o.syllableSize*.2,width:te,height:ne,fontSize:o.syllableSize},Z):null})]})},T)}),N&&M.slurConnections.map((h,T)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(255, 0, 0, 0.8)",begin:D,end:B},T)}),N&&M.lyricConnections.map((h,T)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(0, 255, 0, 0.8)",begin:D,end:B,perturbation:!0},T)})]},K))]},O)})]}),H==="play"&&c.jsx(Wt,{score:t,page:o,pageIndex:_,onSeekPosition:U}),c.jsxs(be,{size:"small",className:"numbered-page-toolbar",children:[c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveForward"}),disabled:_===0,icon:c.jsx(rt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_-1,0,w[0]),d()}}),c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveBackward"}),disabled:_===t.pages.length-1,icon:c.jsx(it,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_+1,0,w[0]),d()}}),c.jsx(Je,{title:e.formatMessage({id:"numbered.confirmDeletePage"}),okText:e.formatMessage({id:"common.confirm"}),cancelText:e.formatMessage({id:"common.cancel"}),icon:c.jsx(Ke,{}),onConfirm:async()=>{t.pages.splice(_,1),d()},children:c.jsx(ee,{title:e.formatMessage({id:"numbered.deletePage"}),type:"primary",size:"small",children:e.formatMessage({id:"numbered.deletePage"})})},"delete")]})]},_)})}):c.jsx(Nt,{style:{marginTop:"200px"},description:e.formatMessage({id:"numbered.empty"})})})]})})};export{os as default};
|
dist/assets/index-3ac22147.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as x,j as e,a as O}from"./umi-2135699e.js";import{T as E,S as F,a as V,r as Y,s as z,m as I,L as U}from"./index-22b5485d.js";import{S as _}from"./scheduler-a7fa9c3c.js";import{c as S,u as q,r as D,n as W}from"./_setToString-038b76d7.js";import{p as G,S as H}from"./index-61307b6b.js";import{B as J}from"./button-eb671c5b.js";import{S as X}from"./index-54a31b90.js";import{S as K}from"./index-abee73dc.js";import{u as Q}from"./useAsync-6dd4113e.js";import{a as Z,P as ee}from"./PlaySquareOutlined-c471435e.js";import"./jszip.min-f3ba6370.js";import"./useAsyncFn-1ec42995.js";const te=({translateX:h=0,translateY:y,width:m,additionalLines:s,...o})=>e.jsxs("g",{...o,className:"staff-lines",transform:`translate(${h}, ${y})`,children:[new Array(5).fill(null).map((i,n)=>e.jsx("line",{x1:0,x2:m,y1:n-2,y2:n-2},n)),s&&s.map((i,n)=>e.jsx("g",{children:Array(Math.abs(i.n)).fill(null).map((d,r)=>e.jsx("line",{x1:i.left,x2:i.right,y1:i.n>0?3+r:-3-r,y2:i.n>0?3+r:-3-r},r))},n))]}),se=x.memo(te),C=({score:h,page:y,pageIndex:m,system:s,systemIndex:o,staff:i,staffIndex:n})=>{var d;return e.jsx(e.Fragment,{children:e.jsxs("g",{className:S("staff",{moving:!1}),transform:`translate(0, ${i.top})`,children:[e.jsxs("g",{children:[e.jsx(se,{translateY:i.staffY,width:s.width,additionalLines:i.additionalLines}),(d=i==null?void 0:i.measures)==null?void 0:d.map((r,c)=>{var t;return e.jsxs("g",{children:[n===0&&e.jsx("text",{x:r.left,y:Math.min(5,i.staffY-3),fontSize:c===0?1.4:.9,fill:"#e65019",children:s.headMeasureIndex+c+1}),e.jsx("g",{transform:`translate(0, ${i.staffY})`,children:e.jsx("g",{className:"tokens",children:(t=r==null?void 0:r.tokens)==null?void 0:t.filter(a=>E.includes(a.type)).map((a,l)=>e.jsxs("g",{className:S("token",{}),transform:`translate(${a.x}, ${a.y})`,id:a.id,onClick:()=>console.log(a),children:[a.voice?e.jsxs("title",{children:["voice-",a.voiceIndices.join(",")]}):null,e.jsx("use",{xlinkHref:`#score-token-def-${a.typeId}`})]},l))})})]},c)})]}),e.jsx("g",{className:"measure-bars",children:s.measureBars.map((r,c)=>e.jsx("g",{className:S("measure-bar"),transform:`translate(${r}, ${i.staffY-2})`,children:e.jsx("line",{x1:0,x2:0,y1:0,y2:4})},c))})]})})};x.memo(C);const ne=h=>{var n,d;const{score:y,pageIndex:m,system:s,systemIndex:o}=h;if(s.staves.length===0)return e.jsx("g",{},o);const i=G(y.staffLayoutCode);return e.jsxs("g",{className:S("system",{}),transform:`translate(${s.left}, ${s.top})`,children:[s.backgroundImage&&!((n=s.staves[0])!=null&&n.backgroundImage)&&!((d=s.staves[0])!=null&&d.maskImage)&&e.jsx("image",{className:"background",href:s.backgroundImage,...s.imagePosition||{}}),s.staves.length>=2&&e.jsx("line",{className:"connection",x1:0,x2:0,y1:s.connectionLine.top,y2:s.connectionLine.bottom}),s.staves.map((r,c)=>e.jsxs("g",{className:S("staff"),transform:`translate(0, ${r.top})`,children:[!r.maskImage&&r.backgroundImage&&e.jsx("image",{className:"background",href:r.backgroundImage,...r.imagePosition||{}}),r.maskImage&&e.jsx("image",{className:"background",href:r.maskImage,...r.imagePosition||{}})]},"staff-"+c)),s.staves.map((r,c)=>e.jsx(C,{...h,staff:r,staffIndex:c},c)),e.jsx("g",{className:"measure-bars",children:s.measureBars.map((r,c)=>e.jsx("g",{transform:`translate(${r}, 0)`,children:i.mask(s.staffMask).conjunctions.map((t,a)=>{const l=s.staves[a],f=s.staves[a+1];if(l&&f)return e.jsx("g",{transform:`translate(0, ${l.top+l.staffY+2})`,children:e.jsx("line",{className:S("staff-layout-measure-bar",{dashed:t===1,blank:t===0}),x1:"0",x2:"0",y1:0,y2:f.top+f.staffY-(l.top+l.staffY)-4})},a)})},c))}),e.jsx(X,{layout:i.mask(s.staffMask),positions:s.staffPositions,nameDict:(!s.prev||s.staffMask!==s.prev.staffMask)&&y.instrumentDict})]},o)},re=x.memo(ne),ae=({score:h,pageIndex:y,cursorPosition:m,onSeekPosition:s})=>{var d,r,c;const o=h.pages[y],i=x.useRef(null);if(!o)return null;const n=x.useMemo(()=>{let t=0;if(m){let a=0;for(const[l,f]of h.pages.entries()){if(m.system>=a-1&&m.system<a+f.systems.length){t=+l;break}a+=f.systems.length}}return t},[m==null?void 0:m.system]);return x.useEffect(()=>{i.current&&i.current.scrollIntoView({block:"center",behavior:"smooth"})},[i.current,n]),e.jsx("div",{children:e.jsxs("svg",{className:S("graph",{}),style:{objectFit:"contain"},viewBox:`0 0 ${o.width} ${o.height}`,children:[e.jsx(K,{}),(d=o==null?void 0:o.systems)==null?void 0:d.map((t,a)=>e.jsx(re,{score:h,page:o,pageIndex:y,system:t,systemIndex:a},a)),(o==null?void 0:o.semantics)&&e.jsx("g",{children:(r=o==null?void 0:o.semantics)==null?void 0:r.map((t,a)=>{var l,f,j,k,v,g;if(t.semantic===F.rect_Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y}) ${(l=t.extension)!=null&&l.theta?`rotate(${((f=t.extension)==null?void 0:f.theta)*180/Math.PI})`:""}`,color:"rgba(25, 175, 230, 0.6)",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-((j=t.extension)==null?void 0:j.height)/2,textAnchor:"middle",style:{fontSize:(k=t.extension)==null?void 0:k.height},children:[(v=t.extension)==null?void 0:v.text,e.jsx("title",{children:((g=t.extension)==null?void 0:g.type)||t.semantic})]})},a)})}),(o==null?void 0:o.tokens)&&e.jsx("g",{children:(c=o==null?void 0:o.tokens)==null?void 0:c.map((t,a)=>{if(t.type===V.Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y})`,color:"rgba(25, 175, 230, 0.6)",className:"token",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.fontSize/2,textAnchor:"middle",style:{fontSize:t.fontSize},className:S(t.textType),children:[t.text,e.jsx("title",{children:t.textType})]})},a)})}),o.systems.map((t,a)=>{const l=h.pages.slice(0,y).reduce((f,j)=>f+j.systems.length,0)+a;return e.jsxs("g",{className:S("system"),transform:`translate(${t.left}, ${t.top})`,children:[e.jsx("rect",{style:{opacity:0},x:0,y:t.noteRange.top,width:t.width,height:t.noteRange.bottom-t.noteRange.top,onClick:f=>{const j=f.target,k=j.getBoundingClientRect(),v=f.clientX-k.left,g=j.getBBox(),u=v/k.width*g.width;s({system:l,x:u})}}),(m==null?void 0:m.system)===l?e.jsx("line",{ref:i,transform:`translate(${m.x}, 0)`,x1:0,x2:0,y1:t.noteRange.top,y2:t.noteRange.bottom,style:{stroke:"lightblue",strokeWidth:1}}):null]},a)})]})})},oe=x.memo(ae),ie=h=>{var v;const y=q(),m=O(),s=x.useRef(new H(performance)),[o,i]=x.useState(),n=x.useRef(null),d=x.useRef(null),[r,c]=x.useState(!1),[t,a]=x.useState(!1),l=Q(async()=>{var b,L,w,P;const g=(m==null?void 0:m.id)||((L=(b=h==null?void 0:h.match)==null?void 0:b.params)==null?void 0:L.id),u=await D.get(`/api/musicSets/${g}`);if((w=u==null?void 0:u.content)!=null&&w.scoreURL){const R=await(await fetch(W(u.content.scoreURL))).json(),$=Y(R,z);return $.assemble(((P=$.settings)==null?void 0:P.semanticConfidenceThreshold)??1),$}return u},[]);x.useEffect(()=>{I.MidiAudio.WebAudio.empty()&&I.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>{a(!0),console.debug("Soundfont loaded.")}),k()},[]);const f=x.useCallback(async g=>{if(!n.current){console.log("please create midi player first");return}const u=n.current.isPlaying;u&&(n.current.pause(),await new Promise(b=>setTimeout(b,0)),document.querySelectorAll(".notePlayOn").forEach(b=>b.classList.remove("notePlayOn"))),n.current.progressTicks=d.current.lookupTick(g),u&&j()},[]),j=()=>{var g;(g=n.current)!=null&&g.isPlaying?(n.current.pause(),c(!1)):(k(),n.current.play({nextFrame:()=>(d.current&&i(d.current.lookupPosition(n.current.progressTicks)),new Promise(u=>requestAnimationFrame(()=>u())))}),c(!0))},k=()=>{var R,$;if(!(($=(R=l.value)==null?void 0:R.systems)!=null&&$.length))return;const{notation:g,tokenMap:u}=l.value.spartito.perform(),b=l.value.getMeasureLayout(),L=b?b.serialize(U.Full):Array(g.measures.length).fill(null).map((p,N)=>N+1),w=g.toPerformingNotationWithEvents(L);Math.round(6e7/w.tempos[0].tempo),d.current=_.createFromNotation(w,u);const P=n.current?n.current.progressTicks:0;n.current&&n.current.dispose(),n.current=new I.MidiPlayer(w,{cacheSpan:200,onMidi:(p,N)=>{let B=null;switch(p.subtype){case"noteOn":I.MidiAudio.noteOn(p.channel,p.noteNumber,p.velocity,N),B=()=>{var M;return(M=p==null?void 0:p.ids)==null?void 0:M.map(A=>{const T=document.getElementById(A);T&&T.classList.add("notePlayOn")})};break;case"noteOff":I.MidiAudio.noteOff(p.channel,p.noteNumber,N),B=()=>{var M;return(M=p==null?void 0:p.ids)==null?void 0:M.map(A=>{const T=document.getElementById(A);T&&T.classList.remove("notePlayOn")})};break}B&&s.current.appendTask(N,B)},onPlayFinish(){n.current&&(n.current.progressTicks=0),c(!1)},onTurnCursor(){n.current&&d.current&&i(d.current.lookupPosition(n.current.progressTicks))}}),n.current.progressTicks=P};return e.jsxs("div",{className:"viewer",children:[e.jsx(J,{style:{position:"fixed",top:"10px",left:"10px"},icon:r?e.jsx(Z,{}):e.jsx(ee,{}),onClick:j,disabled:!((v=l.value)!=null&&v.spartito)||!t,children:r?y.formatMessage({id:"common.pause"}):y.formatMessage({id:"common.play"})}),!l.loading&&l.value.pages.map((g,u)=>e.jsx(oe,{score:l.value,pageIndex:u,cursorPosition:o,onSeekPosition:f},u))]})},be=x.memo(ie);export{be as default};
|
dist/assets/index-3adfbdb0.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.spartito-page{min-height:100vh;display:flex;flex-direction:column;background-color:#eee}.spartito-header{flex:0 0 4em;box-shadow:0 0 4px #0004;background-color:#fff;position:sticky;z-index:100;width:100%;height:auto!important;display:flex;align-items:center;padding:0 16px}.spartito-logo{font-size:26px;font-weight:700;margin-right:20px;color:#000}.spartito-logo:hover{text-decoration:none}.spartito-content{flex:1;overflow-y:auto;padding:16px}.spartito-stand .spartito-measure-rect{fill:transparent;stroke:none;cursor:pointer}.spartito-stand .spartito-measure-rect:hover{fill:#1890ff1a;stroke:#1890ff;stroke-width:.3}.spartito-stand .spartito-measure-rect.selected{fill:#1890ff26;stroke:#1890ff;stroke-width:.4}
|