@jean-is/render 0.0.0-stage → 0.8.0-ra7be83a699f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/caps/charts/charts.css +12 -0
- package/caps/charts/charts.js +154 -0
- package/caps/charts/option.js +141 -0
- package/caps/interactive/diagram.js +415 -0
- package/caps/interactive/interactive.css +21 -0
- package/caps/interactive/interactive.js +345 -0
- package/caps/interactive/map.js +183 -0
- package/caps/interactive/mode.js +54 -0
- package/caps/layouts/layouts.css +179 -0
- package/caps/layouts/layouts.js +147 -0
- package/caps/layouts/shapes.js +159 -0
- package/caps/math/latex.js +88 -0
- package/caps/math/math.css +24 -0
- package/caps/math/math.js +117 -0
- package/caps/scores/notes.js +30 -0
- package/caps/scores/scores.css +22 -0
- package/caps/scores/scores.js +287 -0
- package/caps/scores/sound-worker.js +12 -0
- package/caps/scores/sound.js +72 -0
- package/caps/share/seal.js +86 -0
- package/caps/share/view.js +153 -0
- package/caps/skills/directory.js +57 -0
- package/caps/skills/sources.js +281 -0
- package/caps/slides/deck.js +69 -0
- package/caps/slides/slides.css +38 -0
- package/caps/slides/slides.js +122 -0
- package/core/anthropic.js +253 -0
- package/core/deferred.js +48 -0
- package/core/events.js +166 -0
- package/core/files.js +277 -0
- package/core/fs.js +186 -0
- package/core/hooks.js +53 -0
- package/core/i18n.js +151 -0
- package/core/llm.js +383 -0
- package/core/loop.js +452 -0
- package/core/rules.js +52 -0
- package/core/search.js +158 -0
- package/core/settings.js +221 -0
- package/core/skills.js +90 -0
- package/core/sse.js +51 -0
- package/core/ulid.js +17 -0
- package/core/zip.js +165 -0
- package/fonts/OFL.txt +94 -0
- package/fonts/display.woff2 +0 -0
- package/locales/am.json +395 -0
- package/locales/ar.json +427 -0
- package/locales/ask/am.json +8 -0
- package/locales/ask/ar.json +8 -0
- package/locales/ask/bn.json +8 -0
- package/locales/ask/de.json +8 -0
- package/locales/ask/en.json +8 -0
- package/locales/ask/es.json +8 -0
- package/locales/ask/fa.json +8 -0
- package/locales/ask/fr.json +8 -0
- package/locales/ask/ha.json +8 -0
- package/locales/ask/he.json +8 -0
- package/locales/ask/hi.json +8 -0
- package/locales/ask/id.json +8 -0
- package/locales/ask/it.json +8 -0
- package/locales/ask/ja.json +8 -0
- package/locales/ask/ko.json +8 -0
- package/locales/ask/mr.json +8 -0
- package/locales/ask/ms.json +8 -0
- package/locales/ask/nl.json +8 -0
- package/locales/ask/pl.json +8 -0
- package/locales/ask/pt.json +8 -0
- package/locales/ask/ru.json +8 -0
- package/locales/ask/sw.json +8 -0
- package/locales/ask/ta.json +8 -0
- package/locales/ask/te.json +8 -0
- package/locales/ask/th.json +8 -0
- package/locales/ask/tl.json +8 -0
- package/locales/ask/tr.json +8 -0
- package/locales/ask/uk.json +8 -0
- package/locales/ask/ur.json +8 -0
- package/locales/ask/vi.json +8 -0
- package/locales/ask/yo.json +8 -0
- package/locales/ask/zh-Hans.json +8 -0
- package/locales/ask/zh-Hant.json +8 -0
- package/locales/backup/am.json +8 -0
- package/locales/backup/ar.json +12 -0
- package/locales/backup/bn.json +8 -0
- package/locales/backup/de.json +8 -0
- package/locales/backup/en.json +8 -0
- package/locales/backup/es.json +9 -0
- package/locales/backup/fa.json +8 -0
- package/locales/backup/fr.json +9 -0
- package/locales/backup/ha.json +8 -0
- package/locales/backup/he.json +10 -0
- package/locales/backup/hi.json +8 -0
- package/locales/backup/id.json +7 -0
- package/locales/backup/it.json +9 -0
- package/locales/backup/ja.json +7 -0
- package/locales/backup/ko.json +7 -0
- package/locales/backup/mr.json +8 -0
- package/locales/backup/ms.json +7 -0
- package/locales/backup/nl.json +8 -0
- package/locales/backup/pl.json +10 -0
- package/locales/backup/pt.json +9 -0
- package/locales/backup/ru.json +10 -0
- package/locales/backup/sw.json +8 -0
- package/locales/backup/ta.json +8 -0
- package/locales/backup/te.json +8 -0
- package/locales/backup/th.json +7 -0
- package/locales/backup/tl.json +8 -0
- package/locales/backup/tr.json +8 -0
- package/locales/backup/uk.json +10 -0
- package/locales/backup/ur.json +8 -0
- package/locales/backup/vi.json +7 -0
- package/locales/backup/yo.json +7 -0
- package/locales/backup/zh-Hans.json +7 -0
- package/locales/backup/zh-Hant.json +7 -0
- package/locales/bn.json +395 -0
- package/locales/brain-local/am.json +13 -0
- package/locales/brain-local/ar.json +13 -0
- package/locales/brain-local/bn.json +13 -0
- package/locales/brain-local/de.json +13 -0
- package/locales/brain-local/en.json +13 -0
- package/locales/brain-local/es.json +13 -0
- package/locales/brain-local/fa.json +13 -0
- package/locales/brain-local/fr.json +13 -0
- package/locales/brain-local/ha.json +13 -0
- package/locales/brain-local/he.json +13 -0
- package/locales/brain-local/hi.json +13 -0
- package/locales/brain-local/id.json +13 -0
- package/locales/brain-local/it.json +13 -0
- package/locales/brain-local/ja.json +13 -0
- package/locales/brain-local/ko.json +13 -0
- package/locales/brain-local/mr.json +13 -0
- package/locales/brain-local/ms.json +13 -0
- package/locales/brain-local/nl.json +13 -0
- package/locales/brain-local/pl.json +13 -0
- package/locales/brain-local/pt.json +13 -0
- package/locales/brain-local/ru.json +13 -0
- package/locales/brain-local/sw.json +13 -0
- package/locales/brain-local/ta.json +13 -0
- package/locales/brain-local/te.json +13 -0
- package/locales/brain-local/th.json +13 -0
- package/locales/brain-local/tl.json +13 -0
- package/locales/brain-local/tr.json +13 -0
- package/locales/brain-local/uk.json +13 -0
- package/locales/brain-local/ur.json +13 -0
- package/locales/brain-local/vi.json +13 -0
- package/locales/brain-local/yo.json +13 -0
- package/locales/brain-local/zh-Hans.json +13 -0
- package/locales/brain-local/zh-Hant.json +13 -0
- package/locales/browser/am.json +29 -0
- package/locales/browser/ar.json +29 -0
- package/locales/browser/bn.json +29 -0
- package/locales/browser/de.json +29 -0
- package/locales/browser/en.json +29 -0
- package/locales/browser/es.json +29 -0
- package/locales/browser/fa.json +29 -0
- package/locales/browser/fr.json +29 -0
- package/locales/browser/ha.json +29 -0
- package/locales/browser/he.json +29 -0
- package/locales/browser/hi.json +29 -0
- package/locales/browser/id.json +29 -0
- package/locales/browser/it.json +29 -0
- package/locales/browser/ja.json +29 -0
- package/locales/browser/ko.json +29 -0
- package/locales/browser/mr.json +29 -0
- package/locales/browser/ms.json +29 -0
- package/locales/browser/nl.json +29 -0
- package/locales/browser/pl.json +29 -0
- package/locales/browser/pt.json +29 -0
- package/locales/browser/ru.json +29 -0
- package/locales/browser/sw.json +29 -0
- package/locales/browser/ta.json +29 -0
- package/locales/browser/te.json +29 -0
- package/locales/browser/th.json +29 -0
- package/locales/browser/tl.json +29 -0
- package/locales/browser/tr.json +29 -0
- package/locales/browser/uk.json +29 -0
- package/locales/browser/ur.json +29 -0
- package/locales/browser/vi.json +29 -0
- package/locales/browser/yo.json +29 -0
- package/locales/browser/zh-Hans.json +29 -0
- package/locales/browser/zh-Hant.json +29 -0
- package/locales/certificates/am.json +54 -0
- package/locales/certificates/ar.json +54 -0
- package/locales/certificates/bn.json +54 -0
- package/locales/certificates/de.json +54 -0
- package/locales/certificates/en.json +54 -0
- package/locales/certificates/es.json +54 -0
- package/locales/certificates/fa.json +54 -0
- package/locales/certificates/fr.json +54 -0
- package/locales/certificates/ha.json +54 -0
- package/locales/certificates/he.json +54 -0
- package/locales/certificates/hi.json +54 -0
- package/locales/certificates/id.json +54 -0
- package/locales/certificates/it.json +54 -0
- package/locales/certificates/ja.json +54 -0
- package/locales/certificates/ko.json +54 -0
- package/locales/certificates/mr.json +54 -0
- package/locales/certificates/ms.json +54 -0
- package/locales/certificates/nl.json +54 -0
- package/locales/certificates/pl.json +54 -0
- package/locales/certificates/pt.json +54 -0
- package/locales/certificates/ru.json +54 -0
- package/locales/certificates/sw.json +54 -0
- package/locales/certificates/ta.json +54 -0
- package/locales/certificates/te.json +54 -0
- package/locales/certificates/th.json +54 -0
- package/locales/certificates/tl.json +54 -0
- package/locales/certificates/tr.json +54 -0
- package/locales/certificates/uk.json +54 -0
- package/locales/certificates/ur.json +54 -0
- package/locales/certificates/vi.json +54 -0
- package/locales/certificates/yo.json +54 -0
- package/locales/certificates/zh-Hans.json +54 -0
- package/locales/certificates/zh-Hant.json +54 -0
- package/locales/charts/am.json +5 -0
- package/locales/charts/ar.json +5 -0
- package/locales/charts/bn.json +5 -0
- package/locales/charts/de.json +5 -0
- package/locales/charts/en.json +5 -0
- package/locales/charts/es.json +5 -0
- package/locales/charts/fa.json +5 -0
- package/locales/charts/fr.json +5 -0
- package/locales/charts/ha.json +5 -0
- package/locales/charts/he.json +5 -0
- package/locales/charts/hi.json +5 -0
- package/locales/charts/id.json +5 -0
- package/locales/charts/it.json +5 -0
- package/locales/charts/ja.json +5 -0
- package/locales/charts/ko.json +5 -0
- package/locales/charts/mr.json +5 -0
- package/locales/charts/ms.json +5 -0
- package/locales/charts/nl.json +5 -0
- package/locales/charts/pl.json +5 -0
- package/locales/charts/pt.json +5 -0
- package/locales/charts/ru.json +5 -0
- package/locales/charts/sw.json +5 -0
- package/locales/charts/ta.json +5 -0
- package/locales/charts/te.json +5 -0
- package/locales/charts/th.json +5 -0
- package/locales/charts/tl.json +5 -0
- package/locales/charts/tr.json +5 -0
- package/locales/charts/uk.json +5 -0
- package/locales/charts/ur.json +5 -0
- package/locales/charts/vi.json +5 -0
- package/locales/charts/yo.json +5 -0
- package/locales/charts/zh-Hans.json +5 -0
- package/locales/charts/zh-Hant.json +5 -0
- package/locales/compact/am.json +7 -0
- package/locales/compact/ar.json +7 -0
- package/locales/compact/bn.json +7 -0
- package/locales/compact/de.json +7 -0
- package/locales/compact/en.json +7 -0
- package/locales/compact/es.json +7 -0
- package/locales/compact/fa.json +7 -0
- package/locales/compact/fr.json +7 -0
- package/locales/compact/ha.json +7 -0
- package/locales/compact/he.json +7 -0
- package/locales/compact/hi.json +7 -0
- package/locales/compact/id.json +7 -0
- package/locales/compact/it.json +7 -0
- package/locales/compact/ja.json +7 -0
- package/locales/compact/ko.json +7 -0
- package/locales/compact/mr.json +7 -0
- package/locales/compact/ms.json +7 -0
- package/locales/compact/nl.json +7 -0
- package/locales/compact/pl.json +7 -0
- package/locales/compact/pt.json +7 -0
- package/locales/compact/ru.json +7 -0
- package/locales/compact/sw.json +7 -0
- package/locales/compact/ta.json +7 -0
- package/locales/compact/te.json +7 -0
- package/locales/compact/th.json +7 -0
- package/locales/compact/tl.json +7 -0
- package/locales/compact/tr.json +7 -0
- package/locales/compact/uk.json +7 -0
- package/locales/compact/ur.json +7 -0
- package/locales/compact/vi.json +7 -0
- package/locales/compact/yo.json +7 -0
- package/locales/compact/zh-Hans.json +7 -0
- package/locales/compact/zh-Hant.json +7 -0
- package/locales/computer/am.json +61 -0
- package/locales/computer/ar.json +69 -0
- package/locales/computer/bn.json +61 -0
- package/locales/computer/de.json +61 -0
- package/locales/computer/en.json +61 -0
- package/locales/computer/es.json +63 -0
- package/locales/computer/fa.json +61 -0
- package/locales/computer/fr.json +63 -0
- package/locales/computer/ha.json +61 -0
- package/locales/computer/he.json +63 -0
- package/locales/computer/hi.json +61 -0
- package/locales/computer/id.json +59 -0
- package/locales/computer/it.json +63 -0
- package/locales/computer/ja.json +59 -0
- package/locales/computer/ko.json +59 -0
- package/locales/computer/mr.json +61 -0
- package/locales/computer/ms.json +59 -0
- package/locales/computer/nl.json +61 -0
- package/locales/computer/pl.json +65 -0
- package/locales/computer/pt.json +63 -0
- package/locales/computer/ru.json +65 -0
- package/locales/computer/sw.json +61 -0
- package/locales/computer/ta.json +61 -0
- package/locales/computer/te.json +61 -0
- package/locales/computer/th.json +59 -0
- package/locales/computer/tl.json +61 -0
- package/locales/computer/tr.json +61 -0
- package/locales/computer/uk.json +65 -0
- package/locales/computer/ur.json +61 -0
- package/locales/computer/vi.json +59 -0
- package/locales/computer/yo.json +59 -0
- package/locales/computer/zh-Hans.json +59 -0
- package/locales/computer/zh-Hant.json +59 -0
- package/locales/connections/am.json +14 -0
- package/locales/connections/ar.json +14 -0
- package/locales/connections/bn.json +14 -0
- package/locales/connections/de.json +14 -0
- package/locales/connections/en.json +14 -0
- package/locales/connections/es.json +14 -0
- package/locales/connections/fa.json +14 -0
- package/locales/connections/fr.json +14 -0
- package/locales/connections/ha.json +14 -0
- package/locales/connections/he.json +14 -0
- package/locales/connections/hi.json +14 -0
- package/locales/connections/id.json +14 -0
- package/locales/connections/it.json +14 -0
- package/locales/connections/ja.json +14 -0
- package/locales/connections/ko.json +14 -0
- package/locales/connections/mr.json +14 -0
- package/locales/connections/ms.json +14 -0
- package/locales/connections/nl.json +14 -0
- package/locales/connections/pl.json +14 -0
- package/locales/connections/pt.json +14 -0
- package/locales/connections/ru.json +14 -0
- package/locales/connections/sw.json +14 -0
- package/locales/connections/ta.json +14 -0
- package/locales/connections/te.json +14 -0
- package/locales/connections/th.json +14 -0
- package/locales/connections/tl.json +14 -0
- package/locales/connections/tr.json +14 -0
- package/locales/connections/uk.json +14 -0
- package/locales/connections/ur.json +14 -0
- package/locales/connections/vi.json +14 -0
- package/locales/connections/yo.json +14 -0
- package/locales/connections/zh-Hans.json +14 -0
- package/locales/connections/zh-Hant.json +14 -0
- package/locales/de.json +395 -0
- package/locales/dialogs/am.json +347 -0
- package/locales/dialogs/ar.json +359 -0
- package/locales/dialogs/bn.json +347 -0
- package/locales/dialogs/de.json +347 -0
- package/locales/dialogs/en.json +347 -0
- package/locales/dialogs/es.json +350 -0
- package/locales/dialogs/fa.json +347 -0
- package/locales/dialogs/fr.json +350 -0
- package/locales/dialogs/ha.json +347 -0
- package/locales/dialogs/he.json +352 -0
- package/locales/dialogs/hi.json +347 -0
- package/locales/dialogs/id.json +344 -0
- package/locales/dialogs/it.json +350 -0
- package/locales/dialogs/ja.json +344 -0
- package/locales/dialogs/ko.json +344 -0
- package/locales/dialogs/mr.json +347 -0
- package/locales/dialogs/ms.json +344 -0
- package/locales/dialogs/nl.json +347 -0
- package/locales/dialogs/pl.json +353 -0
- package/locales/dialogs/pt.json +350 -0
- package/locales/dialogs/ru.json +353 -0
- package/locales/dialogs/sw.json +347 -0
- package/locales/dialogs/ta.json +347 -0
- package/locales/dialogs/te.json +347 -0
- package/locales/dialogs/th.json +344 -0
- package/locales/dialogs/tl.json +347 -0
- package/locales/dialogs/tr.json +347 -0
- package/locales/dialogs/uk.json +353 -0
- package/locales/dialogs/ur.json +347 -0
- package/locales/dialogs/vi.json +344 -0
- package/locales/dialogs/yo.json +344 -0
- package/locales/dialogs/zh-Hans.json +344 -0
- package/locales/dialogs/zh-Hant.json +344 -0
- package/locales/en.json +395 -0
- package/locales/enterprise/am.json +20 -0
- package/locales/enterprise/ar.json +20 -0
- package/locales/enterprise/bn.json +20 -0
- package/locales/enterprise/de.json +20 -0
- package/locales/enterprise/en.json +20 -0
- package/locales/enterprise/es.json +20 -0
- package/locales/enterprise/fa.json +20 -0
- package/locales/enterprise/fr.json +20 -0
- package/locales/enterprise/ha.json +20 -0
- package/locales/enterprise/he.json +20 -0
- package/locales/enterprise/hi.json +20 -0
- package/locales/enterprise/id.json +20 -0
- package/locales/enterprise/it.json +20 -0
- package/locales/enterprise/ja.json +20 -0
- package/locales/enterprise/ko.json +20 -0
- package/locales/enterprise/mr.json +20 -0
- package/locales/enterprise/ms.json +20 -0
- package/locales/enterprise/nl.json +20 -0
- package/locales/enterprise/pl.json +20 -0
- package/locales/enterprise/pt.json +20 -0
- package/locales/enterprise/ru.json +20 -0
- package/locales/enterprise/sw.json +20 -0
- package/locales/enterprise/ta.json +20 -0
- package/locales/enterprise/te.json +20 -0
- package/locales/enterprise/th.json +20 -0
- package/locales/enterprise/tl.json +20 -0
- package/locales/enterprise/tr.json +20 -0
- package/locales/enterprise/uk.json +20 -0
- package/locales/enterprise/ur.json +20 -0
- package/locales/enterprise/vi.json +20 -0
- package/locales/enterprise/yo.json +20 -0
- package/locales/enterprise/zh-Hans.json +20 -0
- package/locales/enterprise/zh-Hant.json +20 -0
- package/locales/es.json +403 -0
- package/locales/fa.json +395 -0
- package/locales/first/am.json +26 -0
- package/locales/first/ar.json +26 -0
- package/locales/first/bn.json +26 -0
- package/locales/first/de.json +26 -0
- package/locales/first/en.json +26 -0
- package/locales/first/es.json +26 -0
- package/locales/first/fa.json +26 -0
- package/locales/first/fr.json +26 -0
- package/locales/first/ha.json +26 -0
- package/locales/first/he.json +26 -0
- package/locales/first/hi.json +26 -0
- package/locales/first/id.json +26 -0
- package/locales/first/it.json +26 -0
- package/locales/first/ja.json +26 -0
- package/locales/first/ko.json +26 -0
- package/locales/first/mr.json +26 -0
- package/locales/first/ms.json +26 -0
- package/locales/first/nl.json +26 -0
- package/locales/first/pl.json +26 -0
- package/locales/first/pt.json +26 -0
- package/locales/first/ru.json +26 -0
- package/locales/first/sw.json +26 -0
- package/locales/first/ta.json +26 -0
- package/locales/first/te.json +26 -0
- package/locales/first/th.json +26 -0
- package/locales/first/tl.json +26 -0
- package/locales/first/tr.json +26 -0
- package/locales/first/uk.json +26 -0
- package/locales/first/ur.json +26 -0
- package/locales/first/vi.json +26 -0
- package/locales/first/yo.json +26 -0
- package/locales/first/zh-Hans.json +26 -0
- package/locales/first/zh-Hant.json +26 -0
- package/locales/flows/am.json +51 -0
- package/locales/flows/ar.json +51 -0
- package/locales/flows/bn.json +51 -0
- package/locales/flows/de.json +51 -0
- package/locales/flows/en.json +51 -0
- package/locales/flows/es.json +51 -0
- package/locales/flows/fa.json +51 -0
- package/locales/flows/fr.json +51 -0
- package/locales/flows/ha.json +51 -0
- package/locales/flows/he.json +51 -0
- package/locales/flows/hi.json +51 -0
- package/locales/flows/id.json +51 -0
- package/locales/flows/it.json +51 -0
- package/locales/flows/ja.json +51 -0
- package/locales/flows/ko.json +51 -0
- package/locales/flows/mr.json +51 -0
- package/locales/flows/ms.json +51 -0
- package/locales/flows/nl.json +51 -0
- package/locales/flows/pl.json +51 -0
- package/locales/flows/pt.json +51 -0
- package/locales/flows/ru.json +51 -0
- package/locales/flows/sw.json +51 -0
- package/locales/flows/ta.json +51 -0
- package/locales/flows/te.json +51 -0
- package/locales/flows/th.json +51 -0
- package/locales/flows/tl.json +51 -0
- package/locales/flows/tr.json +51 -0
- package/locales/flows/uk.json +51 -0
- package/locales/flows/ur.json +51 -0
- package/locales/flows/vi.json +51 -0
- package/locales/flows/yo.json +51 -0
- package/locales/flows/zh-Hans.json +51 -0
- package/locales/flows/zh-Hant.json +51 -0
- package/locales/folders/am.json +40 -0
- package/locales/folders/ar.json +44 -0
- package/locales/folders/bn.json +40 -0
- package/locales/folders/de.json +40 -0
- package/locales/folders/en.json +40 -0
- package/locales/folders/es.json +41 -0
- package/locales/folders/fa.json +40 -0
- package/locales/folders/fr.json +41 -0
- package/locales/folders/ha.json +40 -0
- package/locales/folders/he.json +41 -0
- package/locales/folders/hi.json +40 -0
- package/locales/folders/id.json +39 -0
- package/locales/folders/it.json +41 -0
- package/locales/folders/ja.json +39 -0
- package/locales/folders/ko.json +39 -0
- package/locales/folders/mr.json +40 -0
- package/locales/folders/ms.json +39 -0
- package/locales/folders/nl.json +40 -0
- package/locales/folders/pl.json +42 -0
- package/locales/folders/pt.json +41 -0
- package/locales/folders/ru.json +42 -0
- package/locales/folders/sw.json +40 -0
- package/locales/folders/ta.json +40 -0
- package/locales/folders/te.json +40 -0
- package/locales/folders/th.json +39 -0
- package/locales/folders/tl.json +40 -0
- package/locales/folders/tr.json +40 -0
- package/locales/folders/uk.json +42 -0
- package/locales/folders/ur.json +40 -0
- package/locales/folders/vi.json +39 -0
- package/locales/folders/yo.json +39 -0
- package/locales/folders/zh-Hans.json +39 -0
- package/locales/folders/zh-Hant.json +39 -0
- package/locales/fr.json +403 -0
- package/locales/ha.json +395 -0
- package/locales/he.json +410 -0
- package/locales/hi.json +395 -0
- package/locales/id.json +387 -0
- package/locales/interactive/am.json +7 -0
- package/locales/interactive/ar.json +7 -0
- package/locales/interactive/bn.json +7 -0
- package/locales/interactive/de.json +7 -0
- package/locales/interactive/en.json +7 -0
- package/locales/interactive/es.json +7 -0
- package/locales/interactive/fa.json +7 -0
- package/locales/interactive/fr.json +7 -0
- package/locales/interactive/ha.json +7 -0
- package/locales/interactive/he.json +7 -0
- package/locales/interactive/hi.json +7 -0
- package/locales/interactive/id.json +7 -0
- package/locales/interactive/it.json +7 -0
- package/locales/interactive/ja.json +7 -0
- package/locales/interactive/ko.json +7 -0
- package/locales/interactive/mr.json +7 -0
- package/locales/interactive/ms.json +7 -0
- package/locales/interactive/nl.json +7 -0
- package/locales/interactive/pl.json +7 -0
- package/locales/interactive/pt.json +7 -0
- package/locales/interactive/ru.json +7 -0
- package/locales/interactive/sw.json +7 -0
- package/locales/interactive/ta.json +7 -0
- package/locales/interactive/te.json +7 -0
- package/locales/interactive/th.json +7 -0
- package/locales/interactive/tl.json +7 -0
- package/locales/interactive/tr.json +7 -0
- package/locales/interactive/uk.json +7 -0
- package/locales/interactive/ur.json +7 -0
- package/locales/interactive/vi.json +7 -0
- package/locales/interactive/yo.json +7 -0
- package/locales/interactive/zh-Hans.json +7 -0
- package/locales/interactive/zh-Hant.json +7 -0
- package/locales/it.json +403 -0
- package/locales/ja.json +387 -0
- package/locales/ko.json +387 -0
- package/locales/layouts/am.json +9 -0
- package/locales/layouts/ar.json +9 -0
- package/locales/layouts/bn.json +9 -0
- package/locales/layouts/de.json +9 -0
- package/locales/layouts/en.json +9 -0
- package/locales/layouts/es.json +9 -0
- package/locales/layouts/fa.json +9 -0
- package/locales/layouts/fr.json +9 -0
- package/locales/layouts/ha.json +9 -0
- package/locales/layouts/he.json +9 -0
- package/locales/layouts/hi.json +9 -0
- package/locales/layouts/id.json +9 -0
- package/locales/layouts/it.json +9 -0
- package/locales/layouts/ja.json +9 -0
- package/locales/layouts/ko.json +9 -0
- package/locales/layouts/mr.json +9 -0
- package/locales/layouts/ms.json +9 -0
- package/locales/layouts/nl.json +9 -0
- package/locales/layouts/pl.json +9 -0
- package/locales/layouts/pt.json +9 -0
- package/locales/layouts/ru.json +9 -0
- package/locales/layouts/sw.json +9 -0
- package/locales/layouts/ta.json +9 -0
- package/locales/layouts/te.json +9 -0
- package/locales/layouts/th.json +9 -0
- package/locales/layouts/tl.json +9 -0
- package/locales/layouts/tr.json +9 -0
- package/locales/layouts/uk.json +9 -0
- package/locales/layouts/ur.json +9 -0
- package/locales/layouts/vi.json +9 -0
- package/locales/layouts/yo.json +9 -0
- package/locales/layouts/zh-Hans.json +9 -0
- package/locales/layouts/zh-Hant.json +9 -0
- package/locales/lock/am.json +32 -0
- package/locales/lock/ar.json +32 -0
- package/locales/lock/bn.json +32 -0
- package/locales/lock/de.json +32 -0
- package/locales/lock/en.json +32 -0
- package/locales/lock/es.json +32 -0
- package/locales/lock/fa.json +32 -0
- package/locales/lock/fr.json +32 -0
- package/locales/lock/ha.json +32 -0
- package/locales/lock/he.json +32 -0
- package/locales/lock/hi.json +32 -0
- package/locales/lock/id.json +32 -0
- package/locales/lock/it.json +32 -0
- package/locales/lock/ja.json +32 -0
- package/locales/lock/ko.json +32 -0
- package/locales/lock/mr.json +32 -0
- package/locales/lock/ms.json +32 -0
- package/locales/lock/nl.json +32 -0
- package/locales/lock/pl.json +32 -0
- package/locales/lock/pt.json +32 -0
- package/locales/lock/ru.json +32 -0
- package/locales/lock/sw.json +32 -0
- package/locales/lock/ta.json +32 -0
- package/locales/lock/te.json +32 -0
- package/locales/lock/th.json +32 -0
- package/locales/lock/tl.json +32 -0
- package/locales/lock/tr.json +32 -0
- package/locales/lock/uk.json +32 -0
- package/locales/lock/ur.json +32 -0
- package/locales/lock/vi.json +32 -0
- package/locales/lock/yo.json +32 -0
- package/locales/lock/zh-Hans.json +32 -0
- package/locales/lock/zh-Hant.json +32 -0
- package/locales/machine/am.json +19 -0
- package/locales/machine/ar.json +19 -0
- package/locales/machine/bn.json +19 -0
- package/locales/machine/de.json +19 -0
- package/locales/machine/en.json +19 -0
- package/locales/machine/es.json +19 -0
- package/locales/machine/fa.json +19 -0
- package/locales/machine/fr.json +19 -0
- package/locales/machine/ha.json +19 -0
- package/locales/machine/he.json +19 -0
- package/locales/machine/hi.json +19 -0
- package/locales/machine/id.json +19 -0
- package/locales/machine/it.json +19 -0
- package/locales/machine/ja.json +19 -0
- package/locales/machine/ko.json +19 -0
- package/locales/machine/mr.json +19 -0
- package/locales/machine/ms.json +19 -0
- package/locales/machine/nl.json +19 -0
- package/locales/machine/pl.json +19 -0
- package/locales/machine/pt.json +19 -0
- package/locales/machine/ru.json +19 -0
- package/locales/machine/sw.json +19 -0
- package/locales/machine/ta.json +19 -0
- package/locales/machine/te.json +19 -0
- package/locales/machine/th.json +19 -0
- package/locales/machine/tl.json +19 -0
- package/locales/machine/tr.json +19 -0
- package/locales/machine/uk.json +19 -0
- package/locales/machine/ur.json +19 -0
- package/locales/machine/vi.json +19 -0
- package/locales/machine/yo.json +19 -0
- package/locales/machine/zh-Hans.json +19 -0
- package/locales/machine/zh-Hant.json +19 -0
- package/locales/made/am.json +16 -0
- package/locales/made/ar.json +16 -0
- package/locales/made/bn.json +16 -0
- package/locales/made/de.json +16 -0
- package/locales/made/en.json +16 -0
- package/locales/made/es.json +16 -0
- package/locales/made/fa.json +16 -0
- package/locales/made/fr.json +16 -0
- package/locales/made/ha.json +16 -0
- package/locales/made/he.json +16 -0
- package/locales/made/hi.json +16 -0
- package/locales/made/id.json +16 -0
- package/locales/made/it.json +16 -0
- package/locales/made/ja.json +16 -0
- package/locales/made/ko.json +16 -0
- package/locales/made/mr.json +16 -0
- package/locales/made/ms.json +16 -0
- package/locales/made/nl.json +16 -0
- package/locales/made/pl.json +16 -0
- package/locales/made/pt.json +16 -0
- package/locales/made/ru.json +16 -0
- package/locales/made/sw.json +16 -0
- package/locales/made/ta.json +16 -0
- package/locales/made/te.json +16 -0
- package/locales/made/th.json +16 -0
- package/locales/made/tl.json +16 -0
- package/locales/made/tr.json +16 -0
- package/locales/made/uk.json +16 -0
- package/locales/made/ur.json +16 -0
- package/locales/made/vi.json +16 -0
- package/locales/made/yo.json +16 -0
- package/locales/made/zh-Hans.json +16 -0
- package/locales/made/zh-Hant.json +16 -0
- package/locales/mr.json +395 -0
- package/locales/ms.json +387 -0
- package/locales/nl.json +395 -0
- package/locales/notifications/am.json +6 -0
- package/locales/notifications/ar.json +6 -0
- package/locales/notifications/bn.json +6 -0
- package/locales/notifications/de.json +6 -0
- package/locales/notifications/en.json +6 -0
- package/locales/notifications/es.json +6 -0
- package/locales/notifications/fa.json +6 -0
- package/locales/notifications/fr.json +6 -0
- package/locales/notifications/ha.json +6 -0
- package/locales/notifications/he.json +6 -0
- package/locales/notifications/hi.json +6 -0
- package/locales/notifications/id.json +6 -0
- package/locales/notifications/it.json +6 -0
- package/locales/notifications/ja.json +6 -0
- package/locales/notifications/ko.json +6 -0
- package/locales/notifications/mr.json +6 -0
- package/locales/notifications/ms.json +6 -0
- package/locales/notifications/nl.json +6 -0
- package/locales/notifications/pl.json +6 -0
- package/locales/notifications/pt.json +6 -0
- package/locales/notifications/ru.json +6 -0
- package/locales/notifications/sw.json +6 -0
- package/locales/notifications/ta.json +6 -0
- package/locales/notifications/te.json +6 -0
- package/locales/notifications/th.json +6 -0
- package/locales/notifications/tl.json +6 -0
- package/locales/notifications/tr.json +6 -0
- package/locales/notifications/uk.json +6 -0
- package/locales/notifications/ur.json +6 -0
- package/locales/notifications/vi.json +6 -0
- package/locales/notifications/yo.json +6 -0
- package/locales/notifications/zh-Hans.json +6 -0
- package/locales/notifications/zh-Hant.json +6 -0
- package/locales/pictures/am.json +36 -0
- package/locales/pictures/ar.json +36 -0
- package/locales/pictures/bn.json +36 -0
- package/locales/pictures/de.json +36 -0
- package/locales/pictures/en.json +36 -0
- package/locales/pictures/es.json +36 -0
- package/locales/pictures/fa.json +36 -0
- package/locales/pictures/fr.json +36 -0
- package/locales/pictures/ha.json +36 -0
- package/locales/pictures/he.json +36 -0
- package/locales/pictures/hi.json +36 -0
- package/locales/pictures/id.json +36 -0
- package/locales/pictures/it.json +36 -0
- package/locales/pictures/ja.json +36 -0
- package/locales/pictures/ko.json +36 -0
- package/locales/pictures/mr.json +36 -0
- package/locales/pictures/ms.json +36 -0
- package/locales/pictures/nl.json +36 -0
- package/locales/pictures/pl.json +36 -0
- package/locales/pictures/pt.json +36 -0
- package/locales/pictures/ru.json +36 -0
- package/locales/pictures/sw.json +36 -0
- package/locales/pictures/ta.json +36 -0
- package/locales/pictures/te.json +36 -0
- package/locales/pictures/th.json +36 -0
- package/locales/pictures/tl.json +36 -0
- package/locales/pictures/tr.json +36 -0
- package/locales/pictures/uk.json +36 -0
- package/locales/pictures/ur.json +36 -0
- package/locales/pictures/vi.json +36 -0
- package/locales/pictures/yo.json +36 -0
- package/locales/pictures/zh-Hans.json +36 -0
- package/locales/pictures/zh-Hant.json +36 -0
- package/locales/pl.json +411 -0
- package/locales/plan/am.json +13 -0
- package/locales/plan/ar.json +13 -0
- package/locales/plan/bn.json +13 -0
- package/locales/plan/de.json +13 -0
- package/locales/plan/en.json +13 -0
- package/locales/plan/es.json +13 -0
- package/locales/plan/fa.json +13 -0
- package/locales/plan/fr.json +13 -0
- package/locales/plan/ha.json +13 -0
- package/locales/plan/he.json +13 -0
- package/locales/plan/hi.json +13 -0
- package/locales/plan/id.json +13 -0
- package/locales/plan/it.json +13 -0
- package/locales/plan/ja.json +13 -0
- package/locales/plan/ko.json +13 -0
- package/locales/plan/mr.json +13 -0
- package/locales/plan/ms.json +13 -0
- package/locales/plan/nl.json +13 -0
- package/locales/plan/pl.json +13 -0
- package/locales/plan/pt.json +13 -0
- package/locales/plan/ru.json +13 -0
- package/locales/plan/sw.json +13 -0
- package/locales/plan/ta.json +13 -0
- package/locales/plan/te.json +13 -0
- package/locales/plan/th.json +13 -0
- package/locales/plan/tl.json +13 -0
- package/locales/plan/tr.json +13 -0
- package/locales/plan/uk.json +13 -0
- package/locales/plan/ur.json +13 -0
- package/locales/plan/vi.json +13 -0
- package/locales/plan/yo.json +13 -0
- package/locales/plan/zh-Hans.json +13 -0
- package/locales/plan/zh-Hant.json +13 -0
- package/locales/plugins/am.json +40 -0
- package/locales/plugins/ar.json +40 -0
- package/locales/plugins/bn.json +40 -0
- package/locales/plugins/de.json +40 -0
- package/locales/plugins/en.json +40 -0
- package/locales/plugins/es.json +40 -0
- package/locales/plugins/fa.json +40 -0
- package/locales/plugins/fr.json +40 -0
- package/locales/plugins/ha.json +40 -0
- package/locales/plugins/he.json +40 -0
- package/locales/plugins/hi.json +40 -0
- package/locales/plugins/id.json +40 -0
- package/locales/plugins/it.json +40 -0
- package/locales/plugins/ja.json +40 -0
- package/locales/plugins/ko.json +40 -0
- package/locales/plugins/mr.json +40 -0
- package/locales/plugins/ms.json +40 -0
- package/locales/plugins/nl.json +40 -0
- package/locales/plugins/pl.json +40 -0
- package/locales/plugins/pt.json +40 -0
- package/locales/plugins/ru.json +40 -0
- package/locales/plugins/sw.json +40 -0
- package/locales/plugins/ta.json +40 -0
- package/locales/plugins/te.json +40 -0
- package/locales/plugins/th.json +40 -0
- package/locales/plugins/tl.json +40 -0
- package/locales/plugins/tr.json +40 -0
- package/locales/plugins/uk.json +40 -0
- package/locales/plugins/ur.json +40 -0
- package/locales/plugins/vi.json +40 -0
- package/locales/plugins/yo.json +40 -0
- package/locales/plugins/zh-Hans.json +40 -0
- package/locales/plugins/zh-Hant.json +40 -0
- package/locales/policy/am.json +39 -0
- package/locales/policy/ar.json +39 -0
- package/locales/policy/bn.json +39 -0
- package/locales/policy/de.json +39 -0
- package/locales/policy/en.json +39 -0
- package/locales/policy/es.json +39 -0
- package/locales/policy/fa.json +39 -0
- package/locales/policy/fr.json +39 -0
- package/locales/policy/ha.json +39 -0
- package/locales/policy/he.json +39 -0
- package/locales/policy/hi.json +39 -0
- package/locales/policy/id.json +39 -0
- package/locales/policy/it.json +39 -0
- package/locales/policy/ja.json +39 -0
- package/locales/policy/ko.json +39 -0
- package/locales/policy/mr.json +39 -0
- package/locales/policy/ms.json +39 -0
- package/locales/policy/nl.json +39 -0
- package/locales/policy/pl.json +39 -0
- package/locales/policy/pt.json +39 -0
- package/locales/policy/ru.json +39 -0
- package/locales/policy/sw.json +39 -0
- package/locales/policy/ta.json +39 -0
- package/locales/policy/te.json +39 -0
- package/locales/policy/th.json +39 -0
- package/locales/policy/tl.json +39 -0
- package/locales/policy/tr.json +39 -0
- package/locales/policy/uk.json +39 -0
- package/locales/policy/ur.json +39 -0
- package/locales/policy/vi.json +39 -0
- package/locales/policy/yo.json +39 -0
- package/locales/policy/zh-Hans.json +39 -0
- package/locales/policy/zh-Hant.json +39 -0
- package/locales/profiles/am.json +59 -0
- package/locales/profiles/ar.json +59 -0
- package/locales/profiles/bn.json +59 -0
- package/locales/profiles/de.json +59 -0
- package/locales/profiles/en.json +59 -0
- package/locales/profiles/es.json +59 -0
- package/locales/profiles/fa.json +59 -0
- package/locales/profiles/fr.json +59 -0
- package/locales/profiles/ha.json +59 -0
- package/locales/profiles/he.json +59 -0
- package/locales/profiles/hi.json +59 -0
- package/locales/profiles/id.json +59 -0
- package/locales/profiles/it.json +59 -0
- package/locales/profiles/ja.json +59 -0
- package/locales/profiles/ko.json +59 -0
- package/locales/profiles/mr.json +59 -0
- package/locales/profiles/ms.json +59 -0
- package/locales/profiles/nl.json +59 -0
- package/locales/profiles/pl.json +59 -0
- package/locales/profiles/pt.json +59 -0
- package/locales/profiles/ru.json +59 -0
- package/locales/profiles/sw.json +59 -0
- package/locales/profiles/ta.json +59 -0
- package/locales/profiles/te.json +59 -0
- package/locales/profiles/th.json +59 -0
- package/locales/profiles/tl.json +59 -0
- package/locales/profiles/tr.json +59 -0
- package/locales/profiles/uk.json +59 -0
- package/locales/profiles/ur.json +59 -0
- package/locales/profiles/vi.json +59 -0
- package/locales/profiles/yo.json +59 -0
- package/locales/profiles/zh-Hans.json +59 -0
- package/locales/profiles/zh-Hant.json +59 -0
- package/locales/pt.json +403 -0
- package/locales/receipt/am.json +32 -0
- package/locales/receipt/ar.json +32 -0
- package/locales/receipt/bn.json +32 -0
- package/locales/receipt/de.json +32 -0
- package/locales/receipt/en.json +32 -0
- package/locales/receipt/es.json +32 -0
- package/locales/receipt/fa.json +32 -0
- package/locales/receipt/fr.json +32 -0
- package/locales/receipt/ha.json +32 -0
- package/locales/receipt/he.json +32 -0
- package/locales/receipt/hi.json +32 -0
- package/locales/receipt/id.json +32 -0
- package/locales/receipt/it.json +32 -0
- package/locales/receipt/ja.json +32 -0
- package/locales/receipt/ko.json +32 -0
- package/locales/receipt/mr.json +32 -0
- package/locales/receipt/ms.json +32 -0
- package/locales/receipt/nl.json +32 -0
- package/locales/receipt/pl.json +32 -0
- package/locales/receipt/pt.json +32 -0
- package/locales/receipt/ru.json +32 -0
- package/locales/receipt/sw.json +32 -0
- package/locales/receipt/ta.json +32 -0
- package/locales/receipt/te.json +32 -0
- package/locales/receipt/th.json +32 -0
- package/locales/receipt/tl.json +32 -0
- package/locales/receipt/tr.json +32 -0
- package/locales/receipt/uk.json +32 -0
- package/locales/receipt/ur.json +32 -0
- package/locales/receipt/vi.json +32 -0
- package/locales/receipt/yo.json +32 -0
- package/locales/receipt/zh-Hans.json +32 -0
- package/locales/receipt/zh-Hant.json +32 -0
- package/locales/ru.json +411 -0
- package/locales/scores/am.json +8 -0
- package/locales/scores/ar.json +8 -0
- package/locales/scores/bn.json +8 -0
- package/locales/scores/de.json +8 -0
- package/locales/scores/en.json +8 -0
- package/locales/scores/es.json +8 -0
- package/locales/scores/fa.json +8 -0
- package/locales/scores/fr.json +8 -0
- package/locales/scores/ha.json +8 -0
- package/locales/scores/he.json +8 -0
- package/locales/scores/hi.json +8 -0
- package/locales/scores/id.json +8 -0
- package/locales/scores/it.json +8 -0
- package/locales/scores/ja.json +8 -0
- package/locales/scores/ko.json +8 -0
- package/locales/scores/mr.json +8 -0
- package/locales/scores/ms.json +8 -0
- package/locales/scores/nl.json +8 -0
- package/locales/scores/pl.json +8 -0
- package/locales/scores/pt.json +8 -0
- package/locales/scores/ru.json +8 -0
- package/locales/scores/sw.json +8 -0
- package/locales/scores/ta.json +8 -0
- package/locales/scores/te.json +8 -0
- package/locales/scores/th.json +8 -0
- package/locales/scores/tl.json +8 -0
- package/locales/scores/tr.json +8 -0
- package/locales/scores/uk.json +8 -0
- package/locales/scores/ur.json +8 -0
- package/locales/scores/vi.json +8 -0
- package/locales/scores/yo.json +8 -0
- package/locales/scores/zh-Hans.json +8 -0
- package/locales/scores/zh-Hant.json +8 -0
- package/locales/search/am.json +26 -0
- package/locales/search/ar.json +34 -0
- package/locales/search/bn.json +26 -0
- package/locales/search/de.json +26 -0
- package/locales/search/en.json +26 -0
- package/locales/search/es.json +28 -0
- package/locales/search/fa.json +26 -0
- package/locales/search/fr.json +28 -0
- package/locales/search/ha.json +26 -0
- package/locales/search/he.json +30 -0
- package/locales/search/hi.json +26 -0
- package/locales/search/id.json +24 -0
- package/locales/search/it.json +28 -0
- package/locales/search/ja.json +24 -0
- package/locales/search/ko.json +24 -0
- package/locales/search/mr.json +26 -0
- package/locales/search/ms.json +24 -0
- package/locales/search/nl.json +26 -0
- package/locales/search/pl.json +30 -0
- package/locales/search/pt.json +28 -0
- package/locales/search/ru.json +30 -0
- package/locales/search/sw.json +26 -0
- package/locales/search/ta.json +26 -0
- package/locales/search/te.json +26 -0
- package/locales/search/th.json +24 -0
- package/locales/search/tl.json +26 -0
- package/locales/search/tr.json +26 -0
- package/locales/search/uk.json +30 -0
- package/locales/search/ur.json +26 -0
- package/locales/search/vi.json +24 -0
- package/locales/search/yo.json +24 -0
- package/locales/search/zh-Hans.json +24 -0
- package/locales/search/zh-Hant.json +24 -0
- package/locales/share/am.json +61 -0
- package/locales/share/ar.json +65 -0
- package/locales/share/bn.json +61 -0
- package/locales/share/de.json +61 -0
- package/locales/share/en.json +61 -0
- package/locales/share/es.json +62 -0
- package/locales/share/fa.json +61 -0
- package/locales/share/fr.json +62 -0
- package/locales/share/ha.json +61 -0
- package/locales/share/he.json +62 -0
- package/locales/share/hi.json +61 -0
- package/locales/share/id.json +60 -0
- package/locales/share/it.json +62 -0
- package/locales/share/ja.json +60 -0
- package/locales/share/ko.json +60 -0
- package/locales/share/mr.json +61 -0
- package/locales/share/ms.json +60 -0
- package/locales/share/nl.json +61 -0
- package/locales/share/pl.json +63 -0
- package/locales/share/pt.json +62 -0
- package/locales/share/ru.json +63 -0
- package/locales/share/sw.json +61 -0
- package/locales/share/ta.json +61 -0
- package/locales/share/te.json +61 -0
- package/locales/share/th.json +60 -0
- package/locales/share/tl.json +61 -0
- package/locales/share/tr.json +61 -0
- package/locales/share/uk.json +63 -0
- package/locales/share/ur.json +61 -0
- package/locales/share/vi.json +60 -0
- package/locales/share/yo.json +60 -0
- package/locales/share/zh-Hans.json +60 -0
- package/locales/share/zh-Hant.json +60 -0
- package/locales/signin/am.json +6 -0
- package/locales/signin/ar.json +6 -0
- package/locales/signin/bn.json +6 -0
- package/locales/signin/de.json +6 -0
- package/locales/signin/en.json +6 -0
- package/locales/signin/es.json +6 -0
- package/locales/signin/fa.json +6 -0
- package/locales/signin/fr.json +6 -0
- package/locales/signin/ha.json +6 -0
- package/locales/signin/he.json +6 -0
- package/locales/signin/hi.json +6 -0
- package/locales/signin/id.json +6 -0
- package/locales/signin/it.json +6 -0
- package/locales/signin/ja.json +6 -0
- package/locales/signin/ko.json +6 -0
- package/locales/signin/mr.json +6 -0
- package/locales/signin/ms.json +6 -0
- package/locales/signin/nl.json +6 -0
- package/locales/signin/pl.json +6 -0
- package/locales/signin/pt.json +6 -0
- package/locales/signin/ru.json +6 -0
- package/locales/signin/sw.json +6 -0
- package/locales/signin/ta.json +6 -0
- package/locales/signin/te.json +6 -0
- package/locales/signin/th.json +6 -0
- package/locales/signin/tl.json +6 -0
- package/locales/signin/tr.json +6 -0
- package/locales/signin/uk.json +6 -0
- package/locales/signin/ur.json +6 -0
- package/locales/signin/vi.json +6 -0
- package/locales/signin/yo.json +6 -0
- package/locales/signin/zh-Hans.json +6 -0
- package/locales/signin/zh-Hant.json +6 -0
- package/locales/slides/am.json +10 -0
- package/locales/slides/ar.json +10 -0
- package/locales/slides/bn.json +10 -0
- package/locales/slides/de.json +10 -0
- package/locales/slides/en.json +10 -0
- package/locales/slides/es.json +10 -0
- package/locales/slides/fa.json +10 -0
- package/locales/slides/fr.json +10 -0
- package/locales/slides/ha.json +10 -0
- package/locales/slides/he.json +10 -0
- package/locales/slides/hi.json +10 -0
- package/locales/slides/id.json +10 -0
- package/locales/slides/it.json +10 -0
- package/locales/slides/ja.json +10 -0
- package/locales/slides/ko.json +10 -0
- package/locales/slides/mr.json +10 -0
- package/locales/slides/ms.json +10 -0
- package/locales/slides/nl.json +10 -0
- package/locales/slides/pl.json +10 -0
- package/locales/slides/pt.json +10 -0
- package/locales/slides/ru.json +10 -0
- package/locales/slides/sw.json +10 -0
- package/locales/slides/ta.json +10 -0
- package/locales/slides/te.json +10 -0
- package/locales/slides/th.json +10 -0
- package/locales/slides/tl.json +10 -0
- package/locales/slides/tr.json +10 -0
- package/locales/slides/uk.json +10 -0
- package/locales/slides/ur.json +10 -0
- package/locales/slides/vi.json +10 -0
- package/locales/slides/yo.json +10 -0
- package/locales/slides/zh-Hans.json +10 -0
- package/locales/slides/zh-Hant.json +10 -0
- package/locales/sw.json +395 -0
- package/locales/sync/am.json +13 -0
- package/locales/sync/ar.json +13 -0
- package/locales/sync/bn.json +13 -0
- package/locales/sync/de.json +13 -0
- package/locales/sync/en.json +13 -0
- package/locales/sync/es.json +13 -0
- package/locales/sync/fa.json +13 -0
- package/locales/sync/fr.json +13 -0
- package/locales/sync/ha.json +13 -0
- package/locales/sync/he.json +13 -0
- package/locales/sync/hi.json +13 -0
- package/locales/sync/id.json +13 -0
- package/locales/sync/it.json +13 -0
- package/locales/sync/ja.json +13 -0
- package/locales/sync/ko.json +13 -0
- package/locales/sync/mr.json +13 -0
- package/locales/sync/ms.json +13 -0
- package/locales/sync/nl.json +13 -0
- package/locales/sync/pl.json +13 -0
- package/locales/sync/pt.json +13 -0
- package/locales/sync/ru.json +13 -0
- package/locales/sync/sw.json +13 -0
- package/locales/sync/ta.json +13 -0
- package/locales/sync/te.json +13 -0
- package/locales/sync/th.json +13 -0
- package/locales/sync/tl.json +13 -0
- package/locales/sync/tr.json +13 -0
- package/locales/sync/uk.json +13 -0
- package/locales/sync/ur.json +13 -0
- package/locales/sync/vi.json +13 -0
- package/locales/sync/yo.json +13 -0
- package/locales/sync/zh-Hans.json +13 -0
- package/locales/sync/zh-Hant.json +13 -0
- package/locales/ta.json +395 -0
- package/locales/te.json +395 -0
- package/locales/th.json +387 -0
- package/locales/tl.json +395 -0
- package/locales/tr.json +395 -0
- package/locales/uk.json +411 -0
- package/locales/ur.json +395 -0
- package/locales/vi.json +387 -0
- package/locales/yo.json +387 -0
- package/locales/zh-Hans.json +387 -0
- package/locales/zh-Hant.json +387 -0
- package/package.json +9 -4
- package/preview.html +75 -0
- package/ui/caps.js +148 -0
- package/ui/csp.js +82 -0
- package/ui/export.js +214 -0
- package/ui/icons.js +31 -0
- package/ui/looks/blueprint.css +72 -0
- package/ui/looks/classic.css +105 -0
- package/ui/looks/fjord.css +56 -0
- package/ui/looks/human.css +232 -0
- package/ui/looks/mail.css +61 -0
- package/ui/looks/minimal.css +62 -0
- package/ui/looks/mondrian.css +90 -0
- package/ui/looks/neon.css +100 -0
- package/ui/looks/notebook.css +82 -0
- package/ui/looks/paper.css +51 -0
- package/ui/looks/swiss.css +64 -0
- package/ui/looks/terminal.css +84 -0
- package/ui/looks/tilde.css +61 -0
- package/ui/looks/velvet.css +61 -0
- package/ui/markdown.js +188 -0
- package/ui/menu-icons.js +64 -0
- package/ui/model.js +70 -0
- package/ui/reader-state.js +38 -0
- package/ui/reader.js +68 -0
- package/ui/save.js +53 -0
- package/ui/sheet.js +13 -0
- package/ui/style.css +813 -0
- package/ui/trusted.js +13 -0
- package/ui/weights.js +37 -0
- package/vendor/LICENSES/abcjs.txt +21 -0
- package/vendor/LICENSES/base64-js.txt +21 -0
- package/vendor/LICENSES/buffer.txt +21 -0
- package/vendor/LICENSES/diff.txt +29 -0
- package/vendor/LICENSES/echarts.txt +229 -0
- package/vendor/LICENSES/fflate.txt +21 -0
- package/vendor/LICENSES/huggingface-transformers.txt +202 -0
- package/vendor/LICENSES/ieee754.txt +11 -0
- package/vendor/LICENSES/jean-is-sounds.txt +92 -0
- package/vendor/LICENSES/jitl-quickjs-ffi-types.txt +21 -0
- package/vendor/LICENSES/jitl-quickjs-wasmfile-release-sync.txt +47 -0
- package/vendor/LICENSES/just-bash.txt +201 -0
- package/vendor/LICENSES/lit-html.txt +28 -0
- package/vendor/LICENSES/maplibre-gl.txt +2 -0
- package/vendor/LICENSES/marked.txt +44 -0
- package/vendor/LICENSES/onnxruntime-web.txt +2 -0
- package/vendor/LICENSES/pdfjs-dist.txt +177 -0
- package/vendor/LICENSES/preact-signals-core.txt +21 -0
- package/vendor/LICENSES/pyodide.txt +2 -0
- package/vendor/LICENSES/quickjs-emscripten-core.txt +21 -0
- package/vendor/LICENSES/silurus-ooxml.txt +21 -0
- package/vendor/LICENSES/spessasynth_core.txt +202 -0
- package/vendor/LICENSES/sprintf-js.txt +24 -0
- package/vendor/LICENSES/stb-vorbis.txt +202 -0
- package/vendor/LICENSES/temml.txt +21 -0
- package/vendor/LICENSES/turndown.txt +21 -0
- package/vendor/LICENSES/zrender.txt +29 -0
- package/vendor/abcjs/abcjs.mjs +6 -0
- package/vendor/echarts/echarts.mjs +45 -0
- package/vendor/lit-html/async-directive.js +6 -0
- package/vendor/lit-html/directive-helpers.js +6 -0
- package/vendor/lit-html/directive.js +6 -0
- package/vendor/lit-html/directives/ref.js +6 -0
- package/vendor/lit-html/lit-html.js +6 -0
- package/vendor/maplibre/maplibre-gl-worker.js +9 -0
- package/vendor/maplibre/maplibre-gl.css +1 -0
- package/vendor/maplibre/maplibre-gl.mjs +818 -0
- package/vendor/marked.esm.js +79 -0
- package/vendor/signals-core.mjs +1 -0
- package/vendor/spessasynth/spessasynth.mjs +20764 -0
- package/vendor/spessasynth/stb-vorbis.mjs +1 -0
- package/vendor/temml/Temml.woff2 +0 -0
- package/vendor/temml/temml.css +372 -0
- package/vendor/temml/temml.mjs +2 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Formulas (D185): drawn by the browser as MathML, which Temml writes from the LaTeX brains use, and
|
|
2
|
+
// LaTeX documents laid out with them, their pgf-pie charts drawn too, copied as a widget is (D196), as
|
|
3
|
+
// their source and their picture at once. Unlocked by the first formula or document a message holds, never offered; until
|
|
4
|
+
// then, or if Temml can't read one, its source shows (ui/markdown.js).
|
|
5
|
+
import { html, svg, nothing, render } from 'lit-html'
|
|
6
|
+
import { blocks, lex, withFormulas } from '../../ui/markdown.js'
|
|
7
|
+
import { notify } from '../../ui/state.js'
|
|
8
|
+
import { copyDrawing, pictureOf } from '../../ui/save.js'
|
|
9
|
+
import { icons } from '../../ui/icons.js'
|
|
10
|
+
import { styleSheet } from '../../ui/sheet.js'
|
|
11
|
+
import { t, locale } from '../../core/i18n.js'
|
|
12
|
+
import { latexToMarkdown, wholeSoFar, readPies } from './latex.js'
|
|
13
|
+
|
|
14
|
+
const [{ default: temml }] = await Promise.all([
|
|
15
|
+
import(new URL('../../vendor/temml/temml.mjs', import.meta.url).href),
|
|
16
|
+
styleSheet(new URL('../../vendor/temml/temml.css', import.meta.url)),
|
|
17
|
+
styleSheet(new URL('math.css', import.meta.url)),
|
|
18
|
+
])
|
|
19
|
+
|
|
20
|
+
/** Unicode's bold math letters and digits, which Temml writes \textbf in (that alphabet has no é), as the letters and digits they are. @param {string} text */
|
|
21
|
+
const unbold = (text) => text.replace(/[\u{1D400}-\u{1D433}\u{1D7CE}-\u{1D7D7}]/gu, (letter) => String.fromCodePoint(Number(letter.codePointAt(0)) - (letter >= '\u{1D7CE}' ? 0x1D79E : letter >= '\u{1D41A}' ? 0x1D3B9 : 0x1D3BF)))
|
|
22
|
+
|
|
23
|
+
class AppMath extends HTMLElement {
|
|
24
|
+
static observedAttributes = ['tex', 'block']
|
|
25
|
+
drawn = ''
|
|
26
|
+
|
|
27
|
+
attributeChangedCallback() {
|
|
28
|
+
const tex = this.getAttribute('tex') ?? ''
|
|
29
|
+
const block = this.hasAttribute('block')
|
|
30
|
+
if (this.drawn === `${block} ${tex}`) return
|
|
31
|
+
this.drawn = `${block} ${tex}`
|
|
32
|
+
try {
|
|
33
|
+
temml.render(tex, this, { displayMode: block, throwOnError: true })
|
|
34
|
+
// Bold words in their own letters, set in bold, so that "Théorème" is bold throughout, and copies and reads as itself.
|
|
35
|
+
for (const text of this.querySelectorAll('mtext')) if (unbold(text.textContent ?? '') !== text.textContent) Object.assign(text, { textContent: unbold(text.textContent ?? '') }).classList.add('is-bold')
|
|
36
|
+
} catch {
|
|
37
|
+
// In a block still being written, a formula may not be whole yet: what was drawn stays.
|
|
38
|
+
if (!this.closest('app-latex[open]')) this.replaceChildren(Object.assign(document.createElement('code'), { textContent: tex }))
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** A ```latex block laid out, Copy at its top corner; one formula or one sentence has no frame, its Copy at the end of its line; `open`, still being written, drawn as far as it is whole. */
|
|
44
|
+
class AppLatex extends HTMLElement {
|
|
45
|
+
static observedAttributes = ['source', 'open']
|
|
46
|
+
drawn = ''
|
|
47
|
+
|
|
48
|
+
attributeChangedCallback() {
|
|
49
|
+
const source = this.getAttribute('source') ?? ''
|
|
50
|
+
const open = this.hasAttribute('open')
|
|
51
|
+
const page = latexToMarkdown(open ? wholeSoFar(source) : source)
|
|
52
|
+
if (this.drawn === `${open} ${page}`) return
|
|
53
|
+
// Written: drawn anew, so that a formula Temml can't read shows its source.
|
|
54
|
+
if (!open && this.drawn.startsWith('true')) render(nothing, this)
|
|
55
|
+
this.drawn = `${open} ${page}`
|
|
56
|
+
const tokens = lex(page)
|
|
57
|
+
/** @type {any[]} */
|
|
58
|
+
const [part, ...more] = tokens.filter((token) => token.type !== 'space')
|
|
59
|
+
// One line: a formula with no row breaks, or a sentence.
|
|
60
|
+
this.toggleAttribute('line', !open && !more.length && (part?.type === 'math' ? !part.text.includes('\\\\') : part?.type === 'paragraph' && !part.raw.trim().includes('\n')))
|
|
61
|
+
render(html`<div class="latex-page">${tokens.map(drawn)}</div>
|
|
62
|
+
<div class="drawn-foot">
|
|
63
|
+
<button class="icon-button subtle" aria-label=${t('action.copy')}
|
|
64
|
+
@click=${() => copyDrawing(source, this.picture()).then(() => notify(t('toast.copied')), () => notify(t('made.copyFailed')))}>${icons.copy}</button>
|
|
65
|
+
</div>`, this)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The document as a picture to put in a document, a PNG: a copy of it with each element's style
|
|
70
|
+
* as it is drawn now, in an SVG's foreignObject, in black on white as on light paper. @returns {Promise<Blob>}
|
|
71
|
+
*/
|
|
72
|
+
async picture() {
|
|
73
|
+
const page = /** @type {HTMLElement} */ (this.querySelector('.latex-page'))
|
|
74
|
+
const copy = /** @type {HTMLElement} */ (page.cloneNode(true))
|
|
75
|
+
const copies = [copy, ...copy.querySelectorAll('*')]
|
|
76
|
+
for (const [i, element] of [page, ...page.querySelectorAll('*')].entries()) {
|
|
77
|
+
const style = getComputedStyle(element)
|
|
78
|
+
const into = /** @type {HTMLElement} */ (copies[i])
|
|
79
|
+
// What is drawn in the room's ink takes the paper's.
|
|
80
|
+
for (const name of style) into.style?.setProperty(name, name.endsWith('color') && style.getPropertyValue(name) === style.color ? 'currentcolor' : style.getPropertyValue(name))
|
|
81
|
+
}
|
|
82
|
+
const { width, height } = page.getBoundingClientRect()
|
|
83
|
+
const margin = 16
|
|
84
|
+
Object.assign(copy.style, { color: '#000', margin: `${margin}px` })
|
|
85
|
+
return pictureOf(`<svg xmlns="http://www.w3.org/2000/svg" width="${width + 2 * margin}" height="${height + 2 * margin}"><foreignObject width="100%" height="100%">${new XMLSerializer().serializeToString(copy)}</foreignObject></svg>`, width + 2 * margin, height + 2 * margin)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Slices' colours, ECharts' own, as a chart's (D196). */
|
|
90
|
+
const COLOURS = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']
|
|
91
|
+
|
|
92
|
+
/** A pgf-pie chart: its slices as it turns them, each apart as it says, and beside it their colours, labels and numbers, which say all it shows. @param {import('./latex.js').Pie} pie */
|
|
93
|
+
function pieChart({ slices, whole, start, apart, before, after, hide }) {
|
|
94
|
+
const percent = !before && after === '%'
|
|
95
|
+
const number = new Intl.NumberFormat(locale.peek(), { maximumFractionDigits: 2, ...(percent && { style: 'percent' }) })
|
|
96
|
+
let turned = start / 360
|
|
97
|
+
return html`<figure class="pie">
|
|
98
|
+
<svg viewBox="-1.25 -1.25 2.5 2.5" aria-hidden="true">${slices.map(({ value }, i) => {
|
|
99
|
+
const [from, to] = [turned, (turned += value / whole)].map((turn) => turn * 2 * Math.PI)
|
|
100
|
+
const [x, y] = [Math.cos((from + to) / 2) * apart[i], -Math.sin((from + to) / 2) * apart[i]]
|
|
101
|
+
const at = (/** @type {number} */ angle) => `${x + Math.cos(angle)} ${y - Math.sin(angle)}`
|
|
102
|
+
return to - from > 6.283 ? svg`<circle cx=${x} cy=${y} r="1" fill=${COLOURS[i % 9]}/>`
|
|
103
|
+
: svg`<path fill=${COLOURS[i % 9]} d=${`M${x} ${y}L${at(from)}A1 1 0 ${to - from > Math.PI ? 1 : 0} 0 ${at(to)}Z`}/>`
|
|
104
|
+
})}</svg>
|
|
105
|
+
<ul>${slices.map(({ value, label }, i) => html`<li><svg viewBox="0 0 1 1" aria-hidden="true"><rect width="1" height="1" rx="0.25" fill=${COLOURS[i % 9]}/></svg>
|
|
106
|
+
<span>${withFormulas(label)}</span>${hide ? nothing : html`<span class="pie-number">${percent ? number.format(value / 100) : `${before}${number.format(value)}${after}`}</span>`}</li>`)}</ul>
|
|
107
|
+
</figure>`
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** A block of a LaTeX document as drawn: a TikZ picture as its pie charts, or else its source. @param {any} token */
|
|
111
|
+
function drawn(token) {
|
|
112
|
+
const pies = token.type === 'code' && token.lang === 'tikz' ? readPies(token.text) : []
|
|
113
|
+
return pies.length ? pies.map(pieChart) : blocks([token])
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
customElements.define('app-math', AppMath)
|
|
117
|
+
customElements.define('app-latex', AppLatex)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// A score's notes as sounds (D196, D338): abcjs gives each note's pitch, volume, instrument, start
|
|
2
|
+
// and length in whole notes; here they become seconds, for MS Basic's instruments (sound-worker.js)
|
|
3
|
+
// or, without them, Jean's own small synthesizer, which takes frequencies. Pure, so Node's tests run it.
|
|
4
|
+
|
|
5
|
+
/** @typedef {{ cmd: string, pitch?: number, volume?: number, instrument?: number, start: number, duration: number, gap?: number, cents?: number }} Event */
|
|
6
|
+
/** @typedef {{ at: number, length: number, pitch: number, frequency: number, volume: number, instrument: number, track: number }} Note */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The notes of every track, by when they start. `seconds` is how long a whole note lasts. A note
|
|
10
|
+
* stops a little before the next when the music says so (staccato's gap), never by more than two
|
|
11
|
+
* thirds of it, as abcjs plays it. Its instrument is General MIDI's (128: the drums).
|
|
12
|
+
* @param {{ tracks: Event[][] }} sequence @param {number} seconds @returns {Note[]}
|
|
13
|
+
*/
|
|
14
|
+
export function notesOf(sequence, seconds) {
|
|
15
|
+
return sequence.tracks.flatMap((events, track) => events
|
|
16
|
+
.filter((event) => event.cmd === 'note' && typeof event.pitch === 'number' && event.duration > 0)
|
|
17
|
+
.map((event) => ({
|
|
18
|
+
at: event.start * seconds,
|
|
19
|
+
length: (event.duration - Math.min(event.gap ?? 0, (event.duration * 2) / 3)) * seconds,
|
|
20
|
+
pitch: event.pitch ?? 69,
|
|
21
|
+
frequency: 440 * 2 ** (((event.pitch ?? 69) + (event.cents ?? 0) / 100 - 69) / 12),
|
|
22
|
+
volume: Math.min(1, (event.volume ?? 105) / 127),
|
|
23
|
+
instrument: event.instrument ?? 0,
|
|
24
|
+
track,
|
|
25
|
+
})))
|
|
26
|
+
.sort((a, b) => a.at - b.at)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** How long a whole note lasts: a measure's length over its share of a whole note. @param {number} millisecondsPerMeasure @param {{ num: number, den: number }} meter */
|
|
30
|
+
export const wholeNote = (millisecondsPerMeasure, meter) => millisecondsPerMeasure / 1000 / (meter.den ? meter.num / meter.den : 1)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* Scores (D196): the score in the ink's colour, the notes sounding in the flame's, then the player; Copy at its top corner, shown on hover. */
|
|
2
|
+
app-score { position: relative; }
|
|
3
|
+
app-score .score-sheet { --sounding: var(--flame); color: var(--ink); }
|
|
4
|
+
/* By night on paper (D407): music is read dark on light, so the sheet is a paper in the ink's hue, dimmer than the words, the notes in the room's colour and those sounding in the flame's, deep enough for 4:1; on the print sheet, the paper's own. */
|
|
5
|
+
@media screen { @supports (color: oklch(from red l c h)) { [data-theme='dark'] app-score .score-sheet { --sounding: oklch(from var(--flame) 0.5 min(c, 0.13) h); border-radius: 0.5rem; background: oklch(from var(--ink) 0.87 min(c, 0.03) h); color: var(--room); } } }
|
|
6
|
+
app-score .score-sheet:empty { display: none; }
|
|
7
|
+
app-score .score-sheet .is-sounding { color: var(--sounding); fill: var(--sounding); }
|
|
8
|
+
app-score .score-player { display: flex; align-items: center; gap: 0.6rem; margin-block: 0.4rem 0.2rem; }
|
|
9
|
+
app-score .score-player input { flex: 1; min-inline-size: 0; accent-color: var(--flame); }
|
|
10
|
+
app-score .score-time { color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
11
|
+
/* While its instruments come (D338), Pause breathes, and the time says how much of them has. */
|
|
12
|
+
app-score .score-player[aria-busy='true'] .icon-button { animation: glow 0.8s ease-in-out infinite alternate var(--loops, running); }
|
|
13
|
+
@media print { app-score .score-player { display: none; } }
|
|
14
|
+
app-score .drawn-foot { position: absolute; z-index: 1; inset-block-start: 0.4rem; inset-inline-end: 0.4rem; transition: opacity 0.2s; }
|
|
15
|
+
app-score .drawn-foot .icon-button { background: var(--glass); }
|
|
16
|
+
@media (hover: hover) { app-score:not(:hover, :focus-within) .drawn-foot { opacity: 0; } }
|
|
17
|
+
@media print { app-score .drawn-foot { display: none; } }
|
|
18
|
+
/* While the answer is written, the score's place; once it's written, why there is none. */
|
|
19
|
+
app-score .drawn-status { margin: 0 0 0.6rem; }
|
|
20
|
+
.is-streaming app-score .drawn-status { display: grid; place-items: center; min-block-size: 8rem; margin: 0; }
|
|
21
|
+
app-score .while, .is-streaming app-score :is(.failed, pre) { display: none; }
|
|
22
|
+
.is-streaming app-score .while { display: inline; }
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// Scores (D196): a ```abc block in an answer, music in ABC notation, drawn as a score by abcjs and
|
|
2
|
+
// played on the instruments it names, MS Basic's, made (./sound.js, D338) the first time it plays, in
|
|
3
|
+
// a worker, or on the page in a saved copy, while it waits showing how much of them has come; without
|
|
4
|
+
// them (offline the first time), on Jean's own small synthesizer. Each note is lit as it sounds,
|
|
5
|
+
// with where it is to move, and it is copied as its source and its picture at once. One score plays
|
|
6
|
+
// at a time. Drawn again, at most every quarter second, while the answer is written. Loaded by the
|
|
7
|
+
// first score an answer holds; until then, or when abcjs finds no music in a block, it shows as code.
|
|
8
|
+
import { html, render, svg } from 'lit-html'
|
|
9
|
+
import { app, notify } from '../../ui/state.js'
|
|
10
|
+
import { copyDrawing, pictureOf } from '../../ui/save.js'
|
|
11
|
+
import { drawn } from '../../ui/markdown.js'
|
|
12
|
+
import { drawnActions } from '../../ui/caps.js'
|
|
13
|
+
import { icon, icons } from '../../ui/menu-icons.js'
|
|
14
|
+
import { styleSheet } from '../../ui/sheet.js'
|
|
15
|
+
import { modelWorker } from '../../ui/model.js'
|
|
16
|
+
import { t, locale, useStrings } from '../../core/i18n.js'
|
|
17
|
+
import { notesOf, wholeNote } from './notes.js'
|
|
18
|
+
|
|
19
|
+
/** @typedef {import('./notes.js').Note} Note */
|
|
20
|
+
|
|
21
|
+
const [{ renderAbc }] = await Promise.all([
|
|
22
|
+
import(new URL('../../vendor/abcjs/abcjs.mjs', import.meta.url).href),
|
|
23
|
+
useStrings('scores'),
|
|
24
|
+
styleSheet(new URL('scores.css', import.meta.url)),
|
|
25
|
+
])
|
|
26
|
+
|
|
27
|
+
const PAUSE = icon(svg`<path d="M9 5.5v13M15 5.5v13"/>`)
|
|
28
|
+
|
|
29
|
+
/** The sound, made at the first Play (browsers start it only on a click), and the score playing. */
|
|
30
|
+
let context = /** @type {AudioContext | null} */ (null)
|
|
31
|
+
let playing = /** @type {AppScore | null} */ (null)
|
|
32
|
+
/** Where the music is made: a worker of this Jean's own, or none in a saved copy, whose files come from an address that starts none. */
|
|
33
|
+
const WORKER = new URL('./sound-worker.js', import.meta.url)
|
|
34
|
+
const sounds = WORKER.origin === location.origin ? modelWorker(WORKER, 'The score’s sound stopped') : null
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* One note: a triangle wave and, softer, its octave, struck and fading as a plucked string does,
|
|
38
|
+
* then let go. @param {AudioContext} sound @param {AudioNode} out @param {Note} note @param {number} at @param {number} end
|
|
39
|
+
*/
|
|
40
|
+
function tone(sound, out, note, at, end) {
|
|
41
|
+
const loud = 0.6 * note.volume
|
|
42
|
+
const envelope = sound.createGain()
|
|
43
|
+
envelope.gain.setValueAtTime(0, at)
|
|
44
|
+
envelope.gain.linearRampToValueAtTime(loud, at + 0.008)
|
|
45
|
+
envelope.gain.setTargetAtTime(loud * 0.3, at + 0.008, 0.3)
|
|
46
|
+
envelope.gain.setTargetAtTime(0, Math.max(end, at + 0.03), 0.04)
|
|
47
|
+
envelope.connect(out)
|
|
48
|
+
for (const [type, octave, level] of /** @type {const} */ ([['triangle', 1, 1], ['sine', 2, 0.25]])) {
|
|
49
|
+
const wave = sound.createOscillator()
|
|
50
|
+
const share = sound.createGain()
|
|
51
|
+
wave.type = type
|
|
52
|
+
wave.frequency.value = note.frequency * octave
|
|
53
|
+
share.gain.value = level
|
|
54
|
+
wave.connect(share).connect(envelope)
|
|
55
|
+
wave.start(at)
|
|
56
|
+
wave.stop(Math.max(end, at + 0.03) + 0.3)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class AppScore extends HTMLElement {
|
|
61
|
+
static observedAttributes = ['source']
|
|
62
|
+
/** @type {Note[]} */
|
|
63
|
+
notes = []
|
|
64
|
+
/** abcjs's moments, each with the notes that sound then. @type {{ milliseconds: number, elements?: Element[][] }[]} */
|
|
65
|
+
moments = []
|
|
66
|
+
/** In seconds: how long it lasts, where it is, and when that was 0 on the sound's clock while it plays. */
|
|
67
|
+
length = 0
|
|
68
|
+
at = 0
|
|
69
|
+
started = /** @type {number | null} */ (null)
|
|
70
|
+
/** @type {GainNode | null} */
|
|
71
|
+
out = null
|
|
72
|
+
/** The music as its instruments play it, a second at a time, as they come; false once they can't. @type {{ at: number, buffer: AudioBuffer }[] | false | null} */
|
|
73
|
+
parts = null
|
|
74
|
+
/** What of its instruments has come, while it waits for them to play. @type {number | null} */
|
|
75
|
+
loading = null
|
|
76
|
+
/** @type {AudioBufferSourceNode[]} */
|
|
77
|
+
sources = []
|
|
78
|
+
/** @type {Element[]} */
|
|
79
|
+
lit = []
|
|
80
|
+
label = ''
|
|
81
|
+
drawn = /** @type {string | null} */ (null)
|
|
82
|
+
timer = 0
|
|
83
|
+
frame = 0
|
|
84
|
+
|
|
85
|
+
attributeChangedCallback() {
|
|
86
|
+
clearTimeout(this.timer)
|
|
87
|
+
this.timer = setTimeout(() => this.draw(), this.drawn === null ? 0 : 250)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
disconnectedCallback() {
|
|
91
|
+
this.pause()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
draw() {
|
|
95
|
+
const source = this.getAttribute('source') ?? ''
|
|
96
|
+
if (source === this.drawn) return
|
|
97
|
+
this.drawn = source
|
|
98
|
+
this.pause()
|
|
99
|
+
this.parts = null
|
|
100
|
+
this.paint()
|
|
101
|
+
const sheet = /** @type {HTMLElement} */ (this.querySelector('.score-sheet'))
|
|
102
|
+
/** @type {any} */
|
|
103
|
+
let tune = null
|
|
104
|
+
try {
|
|
105
|
+
// Its lines broken again for the width it has, four bars a line where they fit (abcjs's wrap):
|
|
106
|
+
// as written, a line of several staves could run twice past it, and the whole score shrank.
|
|
107
|
+
const { paddingInlineStart, paddingInlineEnd } = getComputedStyle(this)
|
|
108
|
+
const width = Math.max(400, this.clientWidth ? this.clientWidth - parseFloat(paddingInlineStart) - parseFloat(paddingInlineEnd) : 770)
|
|
109
|
+
tune = renderAbc(sheet, source, { responsive: 'resize', add_classes: true, staffwidth: width - 30, wrap: { minSpacing: 1.8, maxSpacing: 2.7, preferredMeasuresPerLine: 4 } })[0]
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.warn('Score', error)
|
|
112
|
+
}
|
|
113
|
+
const music = tune?.lines?.some((/** @type {any} */ line) => line.staff)
|
|
114
|
+
this.notes = music ? notesOf(tune.setUpAudio(), wholeNote(tune.millisecondsPerMeasure(), tune.getMeterFraction())) : []
|
|
115
|
+
this.moments = music ? tune.setTiming().filter((/** @type {any} */ moment) => moment.type === 'event') : []
|
|
116
|
+
this.length = Math.max(0, ...this.notes.map((note) => note.at + note.length))
|
|
117
|
+
this.at = Math.min(this.at, this.length)
|
|
118
|
+
this.label = music ? String(tune.metaText?.title ?? '') : ''
|
|
119
|
+
if (!music) {
|
|
120
|
+
sheet.replaceChildren()
|
|
121
|
+
sheet.style.cssText = ''
|
|
122
|
+
}
|
|
123
|
+
this.paint()
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
paint() {
|
|
127
|
+
const music = this.moments.length > 0
|
|
128
|
+
const on = this.started !== null || this.loading !== null
|
|
129
|
+
const source = this.getAttribute('source') ?? ''
|
|
130
|
+
render(html`<div class="score-sheet" dir="ltr" role="img" aria-label=${this.label || t('scores.score')}></div>
|
|
131
|
+
${!music ? html`<p class="drawn-status muted small" role="status"><span class="while">${t('scores.drawing')}</span><span class="failed">${t('scores.failed')}</span></p>
|
|
132
|
+
<pre dir="ltr"><code>${source}</code></pre>`
|
|
133
|
+
: html`<div class="score-player" dir="ltr" aria-busy=${this.loading !== null}>${this.notes.length ? html`
|
|
134
|
+
<button class="icon-button" aria-label=${t(on ? 'scores.pause' : 'scores.play')} @click=${() => (on ? this.pause() : this.play())}>${on ? PAUSE : icons.play}</button>
|
|
135
|
+
<input type="range" min="0" max=${this.length} step="0.05" .value=${String(this.at)} aria-label=${t('scores.where')} aria-valuetext=${clock(this.at)}
|
|
136
|
+
@input=${(/** @type {Event} */ e) => this.seek(Number(/** @type {HTMLInputElement} */ (e.target).value))}>
|
|
137
|
+
<span class="score-time">${this.loading ? new Intl.NumberFormat(locale.value, { style: 'percent' }).format(this.loading) : `${clock(this.at)} / ${clock(this.length)}`}</span>` : ''}
|
|
138
|
+
</div>
|
|
139
|
+
<div class="drawn-foot">
|
|
140
|
+
<button class="icon-button subtle" aria-label=${t('action.copy')}
|
|
141
|
+
@click=${() => copyDrawing(source, this.picture()).then(() => notify(t('toast.copied')), () => notify(t('made.copyFailed')))}>${icons.copy}</button>
|
|
142
|
+
${drawnActions('abc', source)}
|
|
143
|
+
</div>`}`, this)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The score as a picture to put in a document, a PNG: its drawing as abcjs made it, in black on
|
|
148
|
+
* white, twice as fine. @returns {Promise<Blob>}
|
|
149
|
+
*/
|
|
150
|
+
async picture() {
|
|
151
|
+
const drawn = /** @type {SVGSVGElement} */ (this.querySelector('.score-sheet svg'))
|
|
152
|
+
const [width, height] = (drawn.getAttribute('viewBox')?.split(/\s+/).slice(2) ?? [drawn.getAttribute('width'), drawn.getAttribute('height')]).map(Number)
|
|
153
|
+
const copy = /** @type {SVGSVGElement} */ (drawn.cloneNode(true))
|
|
154
|
+
copy.removeAttribute('style')
|
|
155
|
+
copy.setAttribute('width', String(width))
|
|
156
|
+
copy.setAttribute('height', String(height))
|
|
157
|
+
return pictureOf(new XMLSerializer().serializeToString(copy), width, height)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
play() {
|
|
161
|
+
if (playing && playing !== this) playing.pause()
|
|
162
|
+
context ??= new AudioContext()
|
|
163
|
+
void context.resume()
|
|
164
|
+
if (this.at >= this.length - 0.05) this.at = 0
|
|
165
|
+
playing = this
|
|
166
|
+
if (this.parts === null) this.load(context)
|
|
167
|
+
else if (this.parts && !this.parts.length) (this.loading = 0), this.paint()
|
|
168
|
+
else this.start(context)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The music as its instruments play it, made in the worker or, in a saved copy, on the page: it
|
|
173
|
+
* starts with its first second, or on the synthesizer when they can't come. @param {AudioContext} sound
|
|
174
|
+
*/
|
|
175
|
+
load(sound) {
|
|
176
|
+
const parts = (this.parts = /** @type {{ at: number, buffer: AudioBuffer }[]} */ ([]))
|
|
177
|
+
this.loading = 0
|
|
178
|
+
this.paint()
|
|
179
|
+
const ready = () => {
|
|
180
|
+
if (this.loading === null) return
|
|
181
|
+
this.loading = null
|
|
182
|
+
this.start(sound)
|
|
183
|
+
}
|
|
184
|
+
const request = { notes: this.notes, rate: sound.sampleRate, base: (/** @type {Record<string, string>} */ (app.settings.peek().urls ?? {})).sounds }
|
|
185
|
+
const made = (/** @type {Record<string, any>} */ message) => {
|
|
186
|
+
if (this.parts !== parts) return
|
|
187
|
+
if (message.type === 'progress') return this.loading !== null && ((this.loading = message.loaded / message.total), this.paint())
|
|
188
|
+
const buffer = sound.createBuffer(2, message.left.length, sound.sampleRate)
|
|
189
|
+
buffer.copyToChannel(message.left, 0)
|
|
190
|
+
buffer.copyToChannel(message.right, 1)
|
|
191
|
+
parts.push({ at: message.at, buffer })
|
|
192
|
+
if (this.started !== null) this.schedule(parts[parts.length - 1])
|
|
193
|
+
ready()
|
|
194
|
+
}
|
|
195
|
+
const making = sounds ? sounds.call(request, { onMessage: made }) : import('./sound.js').then(({ render }) => render(request, made, () => this.parts !== parts))
|
|
196
|
+
making.catch((error) => {
|
|
197
|
+
console.warn('Score', error)
|
|
198
|
+
if (this.parts !== parts || parts.length) return
|
|
199
|
+
this.parts = false
|
|
200
|
+
ready()
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Plays from where it is: its parts as they come, or each note on the synthesizer. @param {AudioContext} sound */
|
|
205
|
+
start(sound) {
|
|
206
|
+
const out = sound.createGain()
|
|
207
|
+
// As loud on either: MS Basic plays at about a third of the synthesizer's level, chords well below clipping.
|
|
208
|
+
out.gain.value = this.parts ? 2.5 : 0.3
|
|
209
|
+
out.connect(sound.destination)
|
|
210
|
+
this.out = out
|
|
211
|
+
this.started = sound.currentTime + 0.05 - this.at
|
|
212
|
+
if (this.parts) for (const part of this.parts) this.schedule(part)
|
|
213
|
+
else for (const note of this.notes) {
|
|
214
|
+
if (note.at + note.length > this.at) tone(sound, out, note, this.started + Math.max(note.at, this.at), this.started + note.at + note.length)
|
|
215
|
+
}
|
|
216
|
+
this.tick()
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** A second of the music, from where it is. @param {{ at: number, buffer: AudioBuffer }} part */
|
|
220
|
+
schedule({ at, buffer }) {
|
|
221
|
+
if (!context || !this.out || this.started === null || at + buffer.duration <= this.at) return
|
|
222
|
+
const source = context.createBufferSource()
|
|
223
|
+
source.buffer = buffer
|
|
224
|
+
source.connect(this.out)
|
|
225
|
+
const offset = Math.max(0, this.at - at)
|
|
226
|
+
source.start(this.started + at + offset, offset)
|
|
227
|
+
this.sources.push(source)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Stops where it is, fading out over a few milliseconds rather than cutting a note; at the end, the last notes ring on. */
|
|
231
|
+
pause(end = false) {
|
|
232
|
+
if (this.loading !== null) this.loading = null
|
|
233
|
+
else if (this.started === null || !context) return
|
|
234
|
+
if (context && this.started !== null) this.at = Math.min(this.length, Math.max(0, context.currentTime - this.started))
|
|
235
|
+
const [out, sources] = [this.out, this.sources]
|
|
236
|
+
out?.gain.setTargetAtTime(0, context?.currentTime ?? 0, end ? 0.5 : 0.015)
|
|
237
|
+
setTimeout(() => (out?.disconnect(), sources.forEach((source) => source.stop())), end ? 3000 : 200)
|
|
238
|
+
this.out = this.started = null
|
|
239
|
+
this.sources = []
|
|
240
|
+
if (playing === this) playing = null
|
|
241
|
+
cancelAnimationFrame(this.frame)
|
|
242
|
+
this.light([])
|
|
243
|
+
this.paint()
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** @param {number} seconds */
|
|
247
|
+
seek(seconds) {
|
|
248
|
+
const on = this.started !== null
|
|
249
|
+
this.pause()
|
|
250
|
+
this.at = seconds
|
|
251
|
+
if (on) this.play()
|
|
252
|
+
else this.paint()
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Where it is now, and the notes sounding, lit; at the end it stops, ready to play again. */
|
|
256
|
+
tick() {
|
|
257
|
+
if (this.started === null || !context) return
|
|
258
|
+
const now = context.currentTime - this.started
|
|
259
|
+
if (now >= this.length) {
|
|
260
|
+
this.pause(true)
|
|
261
|
+
this.at = 0
|
|
262
|
+
return this.paint()
|
|
263
|
+
}
|
|
264
|
+
this.at = Math.max(0, now)
|
|
265
|
+
const moment = this.moments.findLast((candidate) => candidate.milliseconds <= this.at * 1000)
|
|
266
|
+
this.light(moment?.elements?.flat() ?? [])
|
|
267
|
+
this.paint()
|
|
268
|
+
this.frame = requestAnimationFrame(() => this.tick())
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** @param {Element[]} elements */
|
|
272
|
+
light(elements) {
|
|
273
|
+
if (elements.length === this.lit.length && elements.every((element, i) => element === this.lit[i])) return
|
|
274
|
+
for (const element of this.lit) element.classList.remove('is-sounding')
|
|
275
|
+
for (const element of elements) element.classList.add('is-sounding')
|
|
276
|
+
this.lit = elements
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** "1:05", with the language's digits. @param {number} seconds */
|
|
281
|
+
function clock(seconds) {
|
|
282
|
+
const whole = Math.floor(seconds)
|
|
283
|
+
return `${new Intl.NumberFormat(locale.value).format(Math.floor(whole / 60))}:${new Intl.NumberFormat(locale.value, { minimumIntegerDigits: 2 }).format(whole % 60)}`
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
customElements.define('app-score', AppScore)
|
|
287
|
+
drawn.value = { ...drawn.peek(), abc: (source) => html`<app-score source=${source}></app-score>` }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// A score's sound (D338), made in a worker so the page stays smooth while it is (./sound.js). A new
|
|
2
|
+
// request stops the one before.
|
|
3
|
+
import { render } from './sound.js'
|
|
4
|
+
|
|
5
|
+
let latest = 0
|
|
6
|
+
|
|
7
|
+
self.onmessage = ({ data }) => {
|
|
8
|
+
latest = data.id
|
|
9
|
+
const post = (/** @type {Record<string, any>} */ message, /** @type {Transferable[]} */ transfer = []) => self.postMessage({ id: data.id, ...message }, transfer)
|
|
10
|
+
render(data, post, () => latest !== data.id)
|
|
11
|
+
.then(() => post({ type: 'done' }), (error) => post({ type: 'error', message: error instanceof Error ? error.message : String(error) }))
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// A score's sound (D338): the instruments its notes ask for, from MS Basic's files in vendor/sounds/,
|
|
2
|
+
// or where a saved copy names them, each downloaded once, checked against its SHA-256 and kept apart
|
|
3
|
+
// from app versions where the browser keeps caches, then played by spessasynth_core a second at a
|
|
4
|
+
// time, each second handed on as it is made, so that the music starts with the first. In a worker
|
|
5
|
+
// (./sound-worker.js), or on the page of a saved copy, whose files come from an address that starts none.
|
|
6
|
+
import { download } from '../../ui/weights.js'
|
|
7
|
+
|
|
8
|
+
/** @typedef {import('./notes.js').Note} Note */
|
|
9
|
+
/** @typedef {{ files: { path: string, sha256: string, bytes: number }[], programs: number[], drums: number }} Index */
|
|
10
|
+
|
|
11
|
+
/** How long a part handed on lasts, and how long the sound carries on after the last note (its release, the room's echo), in seconds. */
|
|
12
|
+
const PART = 1
|
|
13
|
+
const TAIL = 2
|
|
14
|
+
/** spessasynth_core, loaded with the first sound: awaited at the top, a worker would take its first request before it listens. @type {Promise<any> | null} */
|
|
15
|
+
let library = null
|
|
16
|
+
/** The files read so far, by name (their hash), each with the samples it has decoded. @type {Map<string, any>} */
|
|
17
|
+
const banks = new Map()
|
|
18
|
+
|
|
19
|
+
/** A note's channel: the drums' own, or its track's, General MIDI's tenth left to the drums. @param {Note} note */
|
|
20
|
+
const channelOf = (note) => (note.instrument === 128 ? 9 : (note.track + (note.track >= 9 ? 1 : 0)) % 16)
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The music of `notes` at `rate`, from the instruments at `base` (this Jean's own when none): what of
|
|
24
|
+
* them has come, then each second, handed to `post`, until it is done or `stopped()`.
|
|
25
|
+
* @param {{ notes: Note[], rate: number, base?: string }} request
|
|
26
|
+
* @param {(message: Record<string, any>, transfer?: Transferable[]) => void} post @param {() => boolean} stopped
|
|
27
|
+
*/
|
|
28
|
+
export async function render({ notes, rate, base }, post, stopped) {
|
|
29
|
+
const { SoundBankLoader, SpessaSynthProcessor } = await (library ??= import(new URL('../../vendor/spessasynth/spessasynth.mjs', import.meta.url).href))
|
|
30
|
+
const sounds = new URL(base || '../../vendor/sounds/', import.meta.url)
|
|
31
|
+
const { files, programs, drums } = /** @type {Index} */ (await (await fetch(new URL('sounds.json', sounds))).json())
|
|
32
|
+
const wanted = [...new Set(notes.map((note) => files[note.instrument === 128 ? drums : (programs[note.instrument] ?? programs[0])]))]
|
|
33
|
+
const got = wanted.map((file) => (banks.has(file.path) ? file.bytes : 0))
|
|
34
|
+
const total = wanted.reduce((sum, file) => sum + file.bytes, 0)
|
|
35
|
+
const synth = new SpessaSynthProcessor(rate, { eventsEnabled: false })
|
|
36
|
+
for (const [i, file] of wanted.entries()) {
|
|
37
|
+
if (!banks.has(file.path)) {
|
|
38
|
+
const progress = (/** @type {number} */ bytes) => post({ type: 'progress', loaded: (got[i] = bytes, got.reduce((a, b) => a + b)), total })
|
|
39
|
+
banks.set(file.path, SoundBankLoader.fromArrayBuffer(await download(new URL(file.path, sounds).href, file.sha256, progress, 'app-sounds')))
|
|
40
|
+
}
|
|
41
|
+
synth.soundBankManager.addSoundBank(banks.get(file.path), file.path)
|
|
42
|
+
}
|
|
43
|
+
await synth.processorInitialized
|
|
44
|
+
synth.setSystemParameter('autoAllocateVoices', true)
|
|
45
|
+
// Each note's start and end, at their sample; at the same one, an end before a start.
|
|
46
|
+
const events = notes.flatMap((/** @type {Note} */ note) => [{ frame: Math.round(note.at * rate), note, on: true }, { frame: Math.round((note.at + note.length) * rate), note, on: false }])
|
|
47
|
+
.sort((a, b) => a.frame - b.frame || Number(a.on) - Number(b.on))
|
|
48
|
+
/** @type {number[]} */
|
|
49
|
+
const instruments = []
|
|
50
|
+
const length = Math.ceil((Math.max(0, ...events.map((event) => event.frame / rate)) + TAIL) * rate)
|
|
51
|
+
let next = 0
|
|
52
|
+
for (let start = 0; start < length && !stopped(); start += PART * rate) {
|
|
53
|
+
const size = Math.min(PART * rate, length - start)
|
|
54
|
+
const left = new Float32Array(size)
|
|
55
|
+
const right = new Float32Array(size)
|
|
56
|
+
for (let done = 0; done < size;) {
|
|
57
|
+
for (; next < events.length && events[next].frame <= start + done; next++) {
|
|
58
|
+
const { note, on } = events[next]
|
|
59
|
+
const channel = channelOf(note)
|
|
60
|
+
if (on && note.instrument !== 128 && instruments[channel] !== note.instrument) synth.programChange(channel, (instruments[channel] = note.instrument))
|
|
61
|
+
if (on) synth.noteOn(channel, note.pitch, Math.max(1, Math.round(note.volume * 127)))
|
|
62
|
+
else synth.noteOff(channel, note.pitch)
|
|
63
|
+
}
|
|
64
|
+
// Small steps, as spessasynth_core asks: its modulators and vibratos move between them.
|
|
65
|
+
const until = Math.min(size, done + 128, (events[next]?.frame ?? Infinity) - start)
|
|
66
|
+
synth.process(left, right, done, until - done)
|
|
67
|
+
done = until
|
|
68
|
+
}
|
|
69
|
+
post({ type: 'chunk', at: start / rate, left, right }, [left.buffer, right.buffer])
|
|
70
|
+
await new Promise((resolve) => setTimeout(resolve))
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// A shared copy's seal (D361): sealed in the sharer's browser with AES-256-GCM, under a key drawn
|
|
2
|
+
// from the link's secret, and from a password when there is one, so the host keeps what it can't
|
|
3
|
+
// read. The link's `#` carries the secret, which browsers never send. A password's share also has a
|
|
4
|
+
// proof, drawn from the same, which the host asks for before it hands the copy out, so a password is
|
|
5
|
+
// only ever tried through it, never offline. No DOM: tested with node --test.
|
|
6
|
+
|
|
7
|
+
/** What PBKDF2 asks of a password: OWASP's count for SHA-256. */
|
|
8
|
+
const ITERATIONS = 600_000
|
|
9
|
+
|
|
10
|
+
/** @param {string} text */
|
|
11
|
+
const encode = (text) => new TextEncoder().encode(text)
|
|
12
|
+
/** @param {Uint8Array} bytes */
|
|
13
|
+
export const base64url = (bytes) => btoa(Array.from(bytes, (byte) => String.fromCharCode(byte)).join('')).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
|
|
14
|
+
/** @param {string} text */
|
|
15
|
+
export const bytesOf = (text) => Uint8Array.from(atob(text.replace(/-/g, '+').replace(/_/g, '/')), (char) => char.charCodeAt(0))
|
|
16
|
+
/** @param {number} length */
|
|
17
|
+
export const random = (length) => crypto.getRandomValues(new Uint8Array(length))
|
|
18
|
+
/** The SHA-256 of a text, base64url: what the host keeps of a write token or a proof. @param {string} text */
|
|
19
|
+
export const hashOf = async (text) => base64url(new Uint8Array(await crypto.subtle.digest('SHA-256', encode(text))))
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* What the key is drawn from: the secret, then, with a password, PBKDF2's of it on the share's salt.
|
|
23
|
+
* @param {Uint8Array} secret @param {Uint8Array} salt @param {string} [password]
|
|
24
|
+
*/
|
|
25
|
+
export async function materialOf(secret, salt, password) {
|
|
26
|
+
if (!password) return secret
|
|
27
|
+
const typed = await crypto.subtle.importKey('raw', encode(password.normalize('NFC')), 'PBKDF2', false, ['deriveBits'])
|
|
28
|
+
const bits = await crypto.subtle.deriveBits({ name: 'PBKDF2', hash: 'SHA-256', salt: /** @type {BufferSource} */ (salt), iterations: ITERATIONS }, typed, 256)
|
|
29
|
+
return new Uint8Array([...secret, ...new Uint8Array(bits)])
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The copy's key, and the proof the host asks of a password's share, both drawn from the material by HKDF.
|
|
34
|
+
* @param {Uint8Array} material @param {Uint8Array} salt
|
|
35
|
+
*/
|
|
36
|
+
export async function keysOf(material, salt) {
|
|
37
|
+
const base = await crypto.subtle.importKey('raw', /** @type {BufferSource} */ (material), 'HKDF', false, ['deriveKey', 'deriveBits'])
|
|
38
|
+
/** @param {string} info */
|
|
39
|
+
const as = (info) => ({ name: 'HKDF', hash: 'SHA-256', salt: /** @type {BufferSource} */ (salt), info: encode(info) })
|
|
40
|
+
const key = await crypto.subtle.deriveKey(as('share key'), base, { name: 'AES-GCM', length: 256 }, false, ['encrypt', 'decrypt'])
|
|
41
|
+
return { key, access: base64url(new Uint8Array(await crypto.subtle.deriveBits(as('share access'), base, 256))) }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A value as gzipped JSON. @param {unknown} value */
|
|
45
|
+
export const pack = async (value) => new Uint8Array(await new Response(new Blob([JSON.stringify(value)]).stream().pipeThrough(new CompressionStream('gzip'))).arrayBuffer())
|
|
46
|
+
|
|
47
|
+
/** Gzipped JSON as the value it was. @param {Uint8Array} bytes */
|
|
48
|
+
export const unpack = async (bytes) => JSON.parse(await new Response(new Blob([/** @type {BlobPart} */ (bytes)]).stream().pipeThrough(new DecompressionStream('gzip'))).text())
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A value sealed as the host keeps it: its salt (16 bytes), the nonce (12), then the ciphertext; under
|
|
52
|
+
* the secret and the password, or the material they made, which sealing a share again takes.
|
|
53
|
+
* @param {unknown} value @param {{ salt: Uint8Array, secret?: Uint8Array, password?: string, material?: Uint8Array }} seal
|
|
54
|
+
* @returns {Promise<{ sealed: Uint8Array, access: string }>}
|
|
55
|
+
*/
|
|
56
|
+
export async function sealValue(value, { salt, secret = new Uint8Array(), password, material }) {
|
|
57
|
+
const { key, access } = await keysOf(material ?? await materialOf(secret, salt, password), salt)
|
|
58
|
+
const iv = random(12)
|
|
59
|
+
const ciphertext = new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, /** @type {BufferSource} */ (await pack(value))))
|
|
60
|
+
return { sealed: new Uint8Array([...salt, ...iv, ...ciphertext]), access }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The salt a sealed copy was made with, which a password's needs first. @param {Uint8Array} sealed */
|
|
64
|
+
export const saltOf = (sealed) => sealed.slice(0, 16)
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A sealed copy opened with the material its key is drawn from; an Error when the key isn't its own.
|
|
68
|
+
* @param {Uint8Array} sealed @param {Uint8Array} material
|
|
69
|
+
*/
|
|
70
|
+
export async function openValue(sealed, material) {
|
|
71
|
+
const { key } = await keysOf(material, saltOf(sealed))
|
|
72
|
+
const plain = await crypto.subtle.decrypt({ name: 'AES-GCM', iv: sealed.slice(16, 28) }, key, sealed.slice(28))
|
|
73
|
+
return unpack(new Uint8Array(plain))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A link to a share: the host's address, its id, and the secret after `#`. @param {string} host @param {string} id @param {Uint8Array} secret */
|
|
77
|
+
export const linkOf = (host, id, secret) => `${host.replace(/\/?$/, '/')}${id}#${base64url(secret)}`
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A share's id: the first 128 bits of its write token's SHA-256, so the host lets no other token put a
|
|
81
|
+
* copy there, even once it is no longer shared. @param {string} token
|
|
82
|
+
*/
|
|
83
|
+
export const idOf = async (token) => base64url(new Uint8Array(await crypto.subtle.digest('SHA-256', encode(token))).slice(0, 16))
|
|
84
|
+
|
|
85
|
+
/** Whether a text is an id or a secret of a share's link. @param {string} text */
|
|
86
|
+
export const isPart = (text) => /^[\w-]{22,86}$/.test(text)
|