* Refactor CSS preloading
- Rename css.ts to preload.ts
- Rename type/function names
- Automatically remove style/link element on load/error event
* Refactor image preloading
- Reuse template element
- Change timeout value from 100ms to 200ms, as it often takes more than
100ms to load even a single small image on a low-spec machine
- Refactor preloadAnswerImages():
- Use 'new Image()' instead of <link rel=preload>
- Stop calculating images that only appear on the answer side as
cached images are resolved immediately
* Update tsconfig.json
es2020.string -> String.matchAll()
es2018.regexp -> RegExprMatchArray.groups
* Implement custom font preloading
Font files for some languages such as Chinese and Japanese can be as
large as 20MB, so we set the timeout value to 800ms for font preloading.
https://forums.ankiweb.net/t/audio-in-back-template-is-played-on-front-template-on-desktop-2-1-46/12399
Unlike when using <template> element, if a DocumentFragment is created
using Range.createContextualFragment(), <audio>/<video> elements
with `aotoplay` will play immediately even before they are inserted into
the actual document, which will cause audio or video on the answer side
to be played on the question side.