diff --git a/.gitignore b/.gitignore index 2affa1ad7..8b1cbe643 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .vscode .idea /target -/docs site/dist /uiua-modules diff --git a/Cargo.toml b/Cargo.toml index 0bd28197e..bba41c55f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,3 +139,6 @@ members = ["site", "tests_ffi"] [profile.dev] incremental = true + +[profile.release] +opt-level = 's' diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 000000000..d28c08aa7 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,43 @@ + + + + + + Uiua + + + + + + + \ No newline at end of file diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 000000000..f1fbd587d --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +www.uiua.org \ No newline at end of file diff --git a/docs/DejaVuSansMono.ttf b/docs/DejaVuSansMono.ttf new file mode 100644 index 000000000..22e14bf93 Binary files /dev/null and b/docs/DejaVuSansMono.ttf differ diff --git a/docs/Uiua386.ttf b/docs/Uiua386.ttf new file mode 100644 index 000000000..7925a3352 Binary files /dev/null and b/docs/Uiua386.ttf differ diff --git a/docs/assets/uiua-crayon.jpg b/docs/assets/uiua-crayon.jpg new file mode 100644 index 000000000..4e6831dee Binary files /dev/null and b/docs/assets/uiua-crayon.jpg differ diff --git a/docs/assets/uiua-logo.png b/docs/assets/uiua-logo.png new file mode 100644 index 000000000..e9771bddc Binary files /dev/null and b/docs/assets/uiua-logo.png differ diff --git a/docs/assets/uiua-logo.svg b/docs/assets/uiua-logo.svg new file mode 100644 index 000000000..5b0725437 --- /dev/null +++ b/docs/assets/uiua-logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/assets/wee-wuh.mp3 b/docs/assets/wee-wuh.mp3 new file mode 100644 index 000000000..d74651f3e Binary files /dev/null and b/docs/assets/wee-wuh.mp3 differ diff --git a/docs/assets/you-dont.png b/docs/assets/you-dont.png new file mode 100644 index 000000000..80141dbd5 Binary files /dev/null and b/docs/assets/you-dont.png differ diff --git a/docs/blog/list.txt b/docs/blog/list.txt new file mode 100644 index 000000000..ea5f82a93 --- /dev/null +++ b/docs/blog/list.txt @@ -0,0 +1,3 @@ +uiua-0.10.0: 2024-04-04 - Announcing Uiua 0.10.0 +what-will-1-look-like: 2024-01-19 - What will Uiua 1.0 look like? +second-class-functions: 2023-12-15 - Why doesn't Uiua have first-class functions? diff --git a/docs/blog/second-class-functions-text.md b/docs/blog/second-class-functions-text.md new file mode 100644 index 000000000..fd7739a81 --- /dev/null +++ b/docs/blog/second-class-functions-text.md @@ -0,0 +1,19 @@ +# Why doesn't Uiua have first-class functions? + +2023-12-15 + +People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays. + +In the beginning, functions *were* normal array elements. Modifiers popped their functions from the stack like regular values. Functions could be put in arrays, and lists of functions even had some special uses. There was a `! call` function which called the top function on the stack. Boxes were not even a dedicated type. They were just functions that took no arguments and returned a single value. + +However, as Uiua's development continued, the language began to rely more and more on stack signatures being well-defined. This property catches errors early, enables some optimizations, and allows modifiers to behave differently depending on their function's siganture. That last point lets us avoid having multiple modifiers that work the same way but on different numbers of arguments. For example, [Factor](https://factorcode.org/) has the words `bi`, `2bi`, `3bi`, `tri`, `2tri`, and `3tri`. Uiua can express all of these and more with just [fork](). + +Unfortunately, having first-class functions was at odds with this design. Because functions could be put into arrays and (conditionally) moved around on the stack, the compiler was not able to determine the signature of a function that called a function value. This meant that anywhere the `! call` function was used needed a signature annotation nearby, which you better hope was correct, or the code would break somewhere else. It also incurred additional interpreter overhead to get the functions from arrays and made certain types of optimizations impossible. + +Other than these design and implementation concerns, the ability to move functions around on the stack made code much harder to read when it was used. You had to keep in your mind not only the values, but the functions that worked on them as well. They were another value you had to deal with, and the related stack manipulation could get quite messy. + +And so I settled on a different approach. Functions were removed as an element type and were put elsewhere in the interpreter. Boxes became a type in their own right. The `! call` function was removed, and `!` was repurposed to be part of defining custom modifiers. [Custom modifiers](/docs/custommodifiers) capture the primary use case of first-class functions: injecting some variable code into a function. While they are technically more limited, their uniform structure makes them easier to both read and write. This change also massively simplified the interpreter, as well as the complexity of the language itself. + +Despite the downgrading of functions to second-class status, it should be noted that I do like functional programming languages. I just don't think that first-class functions are a good fit for Uiua. In practice, first-class functions are mostly unnecessary if you have higher-order functions, which array languages have had for decades. APL's operators, J's adverbs and conjunctions, and BQN and Uiua's modifiers are all versions of higher-order functions. They allow the mapping, reduction, and general transformation of data in the same way that first-class functions do in other languages. + +Now if only I could find a way to get rid of boxes... \ No newline at end of file diff --git a/docs/blog/uiua-0.10.0-text.md b/docs/blog/uiua-0.10.0-text.md new file mode 100644 index 000000000..44c55789c --- /dev/null +++ b/docs/blog/uiua-0.10.0-text.md @@ -0,0 +1,97 @@ +# Announcing Uiua 0.10.0 + +2024-04-04 + +Uiua 0.10.0 is now available! + +You can find the full changelog [here](https://uiua.org/docs/changelog#0.10.0---2024-04-04). + +This release contains so many changes, improvements, and new features that I thought it deserved a blog post. +From here on, major releases will be announced in this way. + +While there are many changes, I want to highlight a few of them here. + +## Pattern Matching + +Using [`un`](https://uiua.org/docs/un) on a constant value will now match a pattern. When used with [`try`](https://uiua.org/docs/try), this can be used to conditionally match, extract, and process values. + +```uiua +F ← ⍣( + ×10 °[1⊙3] # Extract and multiply.. +| °(⊂5) # ..or remove leading 5.. +| ⇌ # ..else reverse +) +F [1 2 3] +F [5 6 7] +F "cool!" +``` +You can read more in the [Pattern Matching](https://uiua.org/tutorial/patternmatching) tutorial. + +## Array Macros + +Array macros are a powerful new feature that allow full compile-time metaprogramming. + +They allow Uiua code to directly manipulate other Uiua code, enabling a wide range of new possibilities. + +```uiua +F! ←^ ≡$"_ ← _\n" "ABC" +F!(1|2|3) +[A B C B B] +``` + +You can read more in the updated [Macros](https://uiua.org/tutorial/macros) tutorial. + +## Git Modules + +You can now prefix a module path with `git:` to import a git repository from a URL. +```uiua +~ "git: github.com/uiua-lang/example-module" ~ Upscale +Upscale 3 [1_2 3_4] +``` +In the native interpreter, this automatically creates a Git submodule. + +On the web, it fetches a `lib.ua` file from the repository. + +You can read more in the updated [Modules](https://uiua.org/tutorial/modules) tutorial. + +## [`mask`](https://uiua.org/docs/mask) + +[`mask`](https://uiua.org/docs/mask) is a new function that is similar to [`find`](https://uiua.org/docs/find), but it returns full masks of matches rather than just the first positions. + +```uiua +⦷ " - " "Hey - how-are - you" +``` +```uiua +⊜□¬⦷⊙. " - " "Hey - how-are - you" +``` + +This simplifies a lot of string-processing code in particular. A new [strings](https://uiua.org/tutorial/strings) tutorial has been added as well. + +## Other Changes + +Switch functions now format to use `⟨⟩` brackets. This makes them easier to distinguish from function packs. +```uiua +F ← (×10|↥2)<2. # This.. +F ← ⟨×10|↥2⟩<2. # Formats to this +F 0 +F 5 +``` + +[`map`](https://uiua.org/docs/map) and related functions are no longer experimental! See the [`map`](https://uiua.org/docs/map) docs for an overview. +```uiua +map 1_2_3 4_5_6 +``` + +The new [`&clget`](https://uiua.org/docs/&clget) and [`&clset`](https://uiua.org/docs/&clset) functions provide access to the clipboard. + +The interpreter's built-in language server now supports [many more features](https://marketplace.visualstudio.com/items?itemName=uiua-lang.uiua-vscode). + +There are a ton more! Again, you can read the full changelog [here](https://uiua.org/docs/changelog#0.10.0---2024-04-04). + +## 💖 + +As always, I'd like to thank everyone who contributed to this release, whether by directly contributing code, reporting bugs, or just using Uiua and providing feedback. + +Uiua is in many ways a novel and unique language, and I think it is only through our collective effort that we can properly explore its design space. + +With your help, I hope to continue to improve Uiua to the point of stability. \ No newline at end of file diff --git a/docs/blog/what-will-1-look-like-text.md b/docs/blog/what-will-1-look-like-text.md new file mode 100644 index 000000000..5c2692f47 --- /dev/null +++ b/docs/blog/what-will-1-look-like-text.md @@ -0,0 +1,35 @@ +# What will Uiua 1.0 look like? + +2024-01-19 + +The [Uiua pad](https://uiua.org/pad) page prominently displays the words "Uiua is not yet stable". And so it has been asked: when will Uiua be stable? What features will it have? Is there a roadmap? + +This post is to organize and present my thoughts on the future of Uiua. + +## Stability + +Uiua will be made officially stable only after it has been unofficially stable for some time. That is, not until no breaking changes have been made for a long time. + +The following language features will need to be nailed down before Uiua can ever be stable. + +### Stack manipulation + +I think working with the stack, at least for up to 3 values, has become mostly pretty nice. However, things start to get complicated when working with more values, as is often necessary. There is some design work to be done here, and it's not out of the question that a very small amount of non-tacitness could be introduced to improve this. + +The experimental [`bind`](https://uiua.org/docs/bind) modifier is a potential solution to this problem. + +There is a balance to be struc between Uiua's goal of tacitness and its goal of being ergonomic. While the beauty of fully tacit code is a worthy goal, some problems involve data flows that are inherently complex, and so some kind of labeling system may be necessary to make such problems workable. + +### Box Ergonomics + +While I've explored alternatives, I've come to the conclusion that nested arrays are a necessary pest. The data we work with is often nested or ragged, and while there are ways to represent such data with flat structures, those representations are cumbersome in their own ways. + +And so boxes are likely here to stay. However, I do think some design work can be done to improve their ergonomics. Currently, Uiua's boxes are very similar to J's, but I think it may be worth it to make their usage a bit more implicit in some cases, closer to the nested arrays of APL or BQN. + +### System APIs + +The current [system functions](https://uiua.org/docs/system) are useful and *mostly* work. There are definitely implementation gaps which need to be filled. There are a good number of missing filesystem operations, and some other things like UDP sockets and proper interaction with child processes still need to be implemented. + +### FFI + +An FFI system similar to [BQN's](https://mlochbaum.github.io/BQN/spec/system.html#foreign-function-interface) is planned. This will allow Uiua to call into C libraries and will enable a lot more functionality. \ No newline at end of file diff --git a/docs/combinators/B.svg b/docs/combinators/B.svg new file mode 100644 index 000000000..0d7eb4fa2 --- /dev/null +++ b/docs/combinators/B.svg @@ -0,0 +1,18 @@ + + + F + G + a + + + \ No newline at end of file diff --git a/docs/combinators/B1.svg b/docs/combinators/B1.svg new file mode 100644 index 000000000..2152b64c1 --- /dev/null +++ b/docs/combinators/B1.svg @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + \ No newline at end of file diff --git a/docs/combinators/C.svg b/docs/combinators/C.svg new file mode 100644 index 000000000..e5dce4df6 --- /dev/null +++ b/docs/combinators/C.svg @@ -0,0 +1,18 @@ + + + F + a + b + + + \ No newline at end of file diff --git a/docs/combinators/D.svg b/docs/combinators/D.svg new file mode 100644 index 000000000..2335b694a --- /dev/null +++ b/docs/combinators/D.svg @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + \ No newline at end of file diff --git a/docs/combinators/D2.svg b/docs/combinators/D2.svg new file mode 100644 index 000000000..98dd486b8 --- /dev/null +++ b/docs/combinators/D2.svg @@ -0,0 +1,22 @@ + + + F + G + H + a + b + + + + + \ No newline at end of file diff --git a/docs/combinators/E.svg b/docs/combinators/E.svg new file mode 100644 index 000000000..0c0a7de55 --- /dev/null +++ b/docs/combinators/E.svg @@ -0,0 +1,22 @@ + + + F + G + a + b + c + + + + + \ No newline at end of file diff --git a/docs/combinators/I.svg b/docs/combinators/I.svg new file mode 100644 index 000000000..3a1177c39 --- /dev/null +++ b/docs/combinators/I.svg @@ -0,0 +1,16 @@ + + + a + a + + \ No newline at end of file diff --git a/docs/combinators/K.svg b/docs/combinators/K.svg new file mode 100644 index 000000000..ca782ed81 --- /dev/null +++ b/docs/combinators/K.svg @@ -0,0 +1,17 @@ + + + a + a + b + + \ No newline at end of file diff --git a/docs/combinators/KI.svg b/docs/combinators/KI.svg new file mode 100644 index 000000000..666f1e549 --- /dev/null +++ b/docs/combinators/KI.svg @@ -0,0 +1,17 @@ + + + a + b + b + + \ No newline at end of file diff --git a/docs/combinators/N.svg b/docs/combinators/N.svg new file mode 100644 index 000000000..a9b11ef3a --- /dev/null +++ b/docs/combinators/N.svg @@ -0,0 +1,21 @@ + + + F + G + a + b + + + + + \ No newline at end of file diff --git a/docs/combinators/R.svg b/docs/combinators/R.svg new file mode 100644 index 000000000..27f889f32 --- /dev/null +++ b/docs/combinators/R.svg @@ -0,0 +1,24 @@ + + + F + G + H + a + b + c + + + + + + \ No newline at end of file diff --git a/docs/combinators/S.svg b/docs/combinators/S.svg new file mode 100644 index 000000000..9badea15c --- /dev/null +++ b/docs/combinators/S.svg @@ -0,0 +1,19 @@ + + + F + G + a + + + + \ No newline at end of file diff --git a/docs/combinators/W.svg b/docs/combinators/W.svg new file mode 100644 index 000000000..960a182c8 --- /dev/null +++ b/docs/combinators/W.svg @@ -0,0 +1,17 @@ + + + F + a + + + \ No newline at end of file diff --git a/docs/combinators/X.svg b/docs/combinators/X.svg new file mode 100644 index 000000000..676feb57a --- /dev/null +++ b/docs/combinators/X.svg @@ -0,0 +1,23 @@ + + + F + G + H + a + b + + + + + + \ No newline at end of file diff --git "a/docs/combinators/\303\212.svg" "b/docs/combinators/\303\212.svg" new file mode 100644 index 000000000..6f7c9597d --- /dev/null +++ "b/docs/combinators/\303\212.svg" @@ -0,0 +1,26 @@ + + + F + G + H + a + b + c + d + + + + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\224.svg" "b/docs/combinators/\316\224.svg" new file mode 100644 index 000000000..3915ce76a --- /dev/null +++ "b/docs/combinators/\316\224.svg" @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\243.svg" "b/docs/combinators/\316\243.svg" new file mode 100644 index 000000000..99268df1a --- /dev/null +++ "b/docs/combinators/\316\243.svg" @@ -0,0 +1,19 @@ + + + F + G + a + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\246.svg" "b/docs/combinators/\316\246.svg" new file mode 100644 index 000000000..063350e62 --- /dev/null +++ "b/docs/combinators/\316\246.svg" @@ -0,0 +1,21 @@ + + + F + G + H + a + + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\2461.svg" "b/docs/combinators/\316\2461.svg" new file mode 100644 index 000000000..fee715bf1 --- /dev/null +++ "b/docs/combinators/\316\2461.svg" @@ -0,0 +1,24 @@ + + + F + G + H + a + b + + + + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\250.svg" "b/docs/combinators/\316\250.svg" new file mode 100644 index 000000000..47a049ea2 --- /dev/null +++ "b/docs/combinators/\316\250.svg" @@ -0,0 +1,22 @@ + + + F + G + G + a + b + + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\265.svg" "b/docs/combinators/\316\265.svg" new file mode 100644 index 000000000..742009fa5 --- /dev/null +++ "b/docs/combinators/\316\265.svg" @@ -0,0 +1,22 @@ + + + F + G + a + b + c + + + + + \ No newline at end of file diff --git "a/docs/combinators/\316\275.svg" "b/docs/combinators/\316\275.svg" new file mode 100644 index 000000000..6db07a0bc --- /dev/null +++ "b/docs/combinators/\316\275.svg" @@ -0,0 +1,21 @@ + + + F + G + a + b + + + + + \ No newline at end of file diff --git "a/docs/combinators/\317\201.svg" "b/docs/combinators/\317\201.svg" new file mode 100644 index 000000000..ff771533d --- /dev/null +++ "b/docs/combinators/\317\201.svg" @@ -0,0 +1,24 @@ + + + F + G + H + a + b + c + + + + + + \ No newline at end of file diff --git "a/docs/combinators/\317\207.svg" "b/docs/combinators/\317\207.svg" new file mode 100644 index 000000000..30e8409a9 --- /dev/null +++ "b/docs/combinators/\317\207.svg" @@ -0,0 +1,23 @@ + + + F + G + H + a + b + + + + + + \ No newline at end of file diff --git a/docs/favicon-crayon.ico b/docs/favicon-crayon.ico new file mode 100644 index 000000000..5b372be8d Binary files /dev/null and b/docs/favicon-crayon.ico differ diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 000000000..9d7d73432 Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..6584def8e --- /dev/null +++ b/docs/index.html @@ -0,0 +1,99 @@ + + Uiua + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+

Uiua (wee-wuh) is a general purpose, stack-based, + array-oriented programming language with a focus on simplicity, beauty, and tacit code.

+

Uiua lets you write code that is as short as possible while remaining readable, so you can + focus on problems rather than ceremony.

+

The language is not yet stable, as its design space is still being explored. However, it is + already quite powerful and fun to use!

+ +

Loading...

+
+
+ + + \ No newline at end of file diff --git a/docs/primitives.json b/docs/primitives.json new file mode 100644 index 000000000..76b572e5b --- /dev/null +++ b/docs/primitives.json @@ -0,0 +1,1203 @@ +{ + "&ad": { + "args": 1, + "outputs": 2, + "class": "Audio", + "description": "Decode audio from a byte array", + "deprecated": true + }, + "&ae": { + "args": 2, + "outputs": 1, + "class": "Audio", + "description": "Encode audio into a byte array" + }, + "&ap": { + "args": 1, + "outputs": 0, + "class": "Audio", + "description": "Play some audio" + }, + "&args": { + "args": 0, + "outputs": 1, + "class": "Env", + "description": "Get the command line arguments" + }, + "&asr": { + "args": 0, + "outputs": 1, + "class": "Audio", + "description": "Get the sample rate of the audio output backend" + }, + "&ast": { + "args": 0, + "outputs": 0, + "modifier_args": 1, + "class": "Audio", + "description": "Synthesize and stream audio" + }, + "&cd": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Change the current directory" + }, + "&cl": { + "args": 1, + "outputs": 0, + "class": "Stream", + "description": "Close a stream by its handle" + }, + "&clget": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Get the contents of the clipboard" + }, + "&clset": { + "args": 1, + "outputs": 0, + "class": "Misc", + "description": "Set the contents of the clipboard" + }, + "&fc": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Create a file and return a handle to it" + }, + "&fde": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Delete a file or directory" + }, + "&fe": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Check if a file exists at a path" + }, + "&ffi": { + "args": 2, + "outputs": 1, + "class": "Misc", + "description": "Call a foreign function interface", + "experimental": true + }, + "&fif": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Check if a path is a file" + }, + "&fld": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "List the contents of a directory" + }, + "&fo": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Open a file and return a handle to it" + }, + "&frab": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Read all the contents of a file into a byte array" + }, + "&fras": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Read all the contents of a file into a string" + }, + "&ftr": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Move a file or directory to the trash" + }, + "&fwa": { + "args": 2, + "outputs": 0, + "class": "Filesystem", + "description": "Write the entire contents of an array to a file" + }, + "&gifd": { + "args": 1, + "outputs": 2, + "class": "Gifs", + "description": "Decode a gif from a byte array", + "deprecated": true + }, + "&gife": { + "args": 2, + "outputs": 1, + "class": "Gifs", + "description": "Encode a gif into a byte array" + }, + "&gifs": { + "args": 2, + "outputs": 0, + "class": "Gifs", + "description": "Show a gif" + }, + "&httpsw": { + "args": 2, + "outputs": 1, + "class": "Tcp", + "description": "Make an HTTP(S) request" + }, + "&imd": { + "args": 1, + "outputs": 2, + "class": "Images", + "description": "Decode an image from a byte array", + "deprecated": true + }, + "&ime": { + "args": 2, + "outputs": 1, + "class": "Images", + "description": "Encode an image into a byte array with the specified format" + }, + "&ims": { + "args": 1, + "outputs": 0, + "class": "Images", + "description": "Show an image" + }, + "&invk": { + "args": 1, + "outputs": 1, + "class": "Command", + "description": "Invoke a path with the system's default program" + }, + "&p": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a value to stdout followed by a newline" + }, + "&pf": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a value to stdout" + }, + "&raw": { + "args": 1, + "outputs": 0, + "class": "Env", + "description": "Set the terminal to raw mode" + }, + "&rb": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read at most n bytes from a stream" + }, + "&rs": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read at most n bytes from a stream" + }, + "&ru": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read from a stream until a delimiter is reached" + }, + "&runc": { + "args": 1, + "outputs": 3, + "class": "Command", + "description": "Run a command and wait for it to finish" + }, + "&runi": { + "args": 1, + "outputs": 1, + "class": "Command", + "description": "Run a command and wait for it to finish" + }, + "&runs": { + "args": 1, + "outputs": 1, + "class": "Command", + "description": "Run a command with streaming IO" + }, + "&s": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a nicely formatted representation of a value to stdout" + }, + "&sc": { + "args": 0, + "outputs": 1, + "class": "StdIO", + "description": "Read a line from stdin" + }, + "&sl": { + "args": 1, + "outputs": 0, + "class": "Misc", + "description": "Sleep for n seconds" + }, + "&tcpa": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Accept a connection with a TCP or TLS listener" + }, + "&tcpaddr": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Get the connection address of a TCP socket" + }, + "&tcpc": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP socket and connect it to an address" + }, + "&tcpl": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP listener and bind it to an address" + }, + "&tcpsnb": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Set a TCP socket to non-blocking mode" + }, + "&tcpsrt": { + "args": 2, + "outputs": 0, + "class": "Tcp", + "description": "Set the read timeout of a TCP socket in seconds" + }, + "&tcpswt": { + "args": 2, + "outputs": 0, + "class": "Tcp", + "description": "Set the write timeout of a TCP socket in seconds" + }, + "&tlsc": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP socket with TLS support", + "experimental": true + }, + "&tlsl": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TLS listener and bind it to an address", + "experimental": true + }, + "&ts": { + "args": 0, + "outputs": 1, + "class": "Env", + "description": "Get the size of the terminal" + }, + "&var": { + "args": 1, + "outputs": 1, + "class": "Env", + "description": "Get the value of an environment variable" + }, + "&w": { + "args": 2, + "outputs": 0, + "class": "Stream", + "description": "Write an array to a stream" + }, + "absolute value": { + "glyph": "⌵", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Get the absolute value of a number" + }, + "add": { + "glyph": "+", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Add values" + }, + "assert": { + "glyph": "⍤", + "args": 2, + "outputs": 0, + "class": "Misc", + "description": "Throw an error if a condition is not met" + }, + "atangent": { + "glyph": "∠", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the arctangent of two numbers" + }, + "bits": { + "glyph": "⋯", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Encode an array as bits (LSB-first)" + }, + "both": { + "glyph": "∩", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Call a function on two sets of values" + }, + "box": { + "glyph": "□", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Turn an array into a box" + }, + "bracket": { + "glyph": "⊓", + "outputs": 1, + "modifier_args": 2, + "class": "Planet", + "description": "Call two functions on two distinct sets of values" + }, + "by": { + "glyph": "⊸", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Duplicate a function's last argument before calling it", + "experimental": true + }, + "ceiling": { + "glyph": "⌈", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer towards ∞" + }, + "classify": { + "glyph": "⊛", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Assign a unique index to each unique element in an array" + }, + "complex": { + "glyph": "ℂ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Make a complex number" + }, + "comptime": { + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Run a function at compile time" + }, + "content": { + "glyph": "◇", + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Unbox the arguments to a function before calling it" + }, + "coordinate": { + "glyph": "⟔", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the first deep index of one array in another", + "experimental": true + }, + "couple": { + "glyph": "⊟", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Combine two arrays as rows of a new array" + }, + "csv": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into a CSV string" + }, + "deal": { + "args": 2, + "outputs": 1, + "class": "Misc", + "description": "Randomly reorder the rows of an array with a seed", + "deprecated": true + }, + "deduplicate": { + "glyph": "◴", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Remove duplicate elements from an array" + }, + "deshape": { + "glyph": "♭", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Make an array 1-dimensional" + }, + "dip": { + "glyph": "⊙", + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Temporarily pop the top value off the stack and call a function" + }, + "divide": { + "ascii": "%", + "glyph": "÷", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Divide values" + }, + "do": { + "glyph": "⍢", + "outputs": 1, + "modifier_args": 2, + "class": "IteratingModifier", + "description": "Repeat a function while a condition holds" + }, + "drop": { + "glyph": "↘", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Drop the first n elements of an array" + }, + "dump": { + "args": 0, + "outputs": 0, + "modifier_args": 1, + "class": "Stack", + "description": "Debug print all the values currently on stack without popping them" + }, + "duplicate": { + "glyph": ".", + "args": 1, + "outputs": 2, + "class": "Stack", + "description": "Duplicate the top value on the stack" + }, + "each": { + "glyph": "∵", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each element of an array or arrays." + }, + "equals": { + "ascii": "=", + "glyph": "=", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for equality" + }, + "eta": { + "glyph": "η", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The number of radians in a quarter circle" + }, + "fall": { + "glyph": "⍖", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the indices into an array if it were sorted descending" + }, + "fill": { + "glyph": "⬚", + "outputs": 1, + "modifier_args": 2, + "class": "OtherModifier", + "description": "Set the fill value for a function" + }, + "find": { + "glyph": "⌕", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the occurences of one array in another" + }, + "first": { + "glyph": "⊢", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the first row of an array" + }, + "fix": { + "glyph": "¤", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Add a length-1 axis to an array" + }, + "flip": { + "glyph": ":", + "args": 2, + "outputs": 2, + "class": "Stack", + "description": "Swap the top two values on the stack" + }, + "floor": { + "glyph": "⌊", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer towards ¯∞" + }, + "fold": { + "glyph": "∧", + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Apply a function to aggregate arrays" + }, + "fork": { + "glyph": "⊃", + "outputs": 1, + "modifier_args": 2, + "class": "Planet", + "description": "Call two functions on the same values" + }, + "gap": { + "glyph": "⋅", + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Discard the top stack value then call a function" + }, + "gen": { + "args": 1, + "outputs": 2, + "class": "Misc", + "description": "Generate a random number between 0 and 1 from a seed, as well as the next seed" + }, + "get": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Get the value corresponding to a key in a map array" + }, + "greater or equal": { + "ascii": ">=", + "glyph": "≥", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for greater than or equal" + }, + "greater than": { + "glyph": ">", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for greater than" + }, + "group": { + "glyph": "⊕", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Group elements of an array into buckets by index" + }, + "has": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Check if a map array has a key" + }, + "identity": { + "glyph": "∘", + "args": 1, + "outputs": 1, + "class": "Planet", + "description": "Do nothing with one value" + }, + "indexof": { + "glyph": "⊗", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the first index of each row of one array in another" + }, + "infinity": { + "glyph": "∞", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The biggest number" + }, + "insert": { + "args": 3, + "outputs": 1, + "class": "Map", + "description": "Insert a key-value pair into a map array" + }, + "inventory": { + "glyph": "⍚", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each unboxed item of an array and re-box the results" + }, + "join": { + "glyph": "⊂", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Append two arrays end-to-end" + }, + "json": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into a JSON string" + }, + "keep": { + "glyph": "▽", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Discard or copy some rows of an array" + }, + "length": { + "glyph": "⧻", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the number of rows in an array" + }, + "less or equal": { + "ascii": "<=", + "glyph": "≤", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for less than or equal" + }, + "less than": { + "glyph": "<", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for less than" + }, + "logarithm": { + "glyph": "ₙ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Get the based logarithm of a number" + }, + "map": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Create a hashmap from lists of keys and values" + }, + "mask": { + "glyph": "⦷", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Mask the occurences of one array in another" + }, + "match": { + "glyph": "≍", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Check if two arrays are exactly the same" + }, + "maximum": { + "glyph": "↥", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the maximum of two arrays" + }, + "member": { + "glyph": "∊", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Check if each row of one array exists in another" + }, + "memo": { + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Memoize a function" + }, + "minimum": { + "glyph": "↧", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the minimum of two arrays" + }, + "modulus": { + "glyph": "◿", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Modulo values" + }, + "multiply": { + "ascii": "*", + "glyph": "×", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Multiply values" + }, + "negate": { + "ascii": "`", + "glyph": "¯", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Negate a number" + }, + "not": { + "glyph": "¬", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Logical not" + }, + "not equals": { + "ascii": "!=", + "glyph": "≠", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for inequality" + }, + "now": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Get the current time in seconds" + }, + "on": { + "glyph": "⟜", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Call a function but keep its first argument on the top of the stack" + }, + "over": { + "glyph": ",", + "args": 2, + "outputs": 3, + "class": "Stack", + "description": "Duplicate the second-to-top value to the top of the stack" + }, + "parse": { + "glyph": "⋕", + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Parse a string as a number" + }, + "partition": { + "glyph": "⊜", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Group sequential sections of an array" + }, + "pi": { + "glyph": "π", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The ratio of a circle's circumference to its diameter" + }, + "pick": { + "glyph": "⊡", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Index a row or elements from an array" + }, + "pool": { + "outputs": 1, + "modifier_args": 1, + "class": "Thread", + "description": "Spawn a thread in a thread pool" + }, + "pop": { + "glyph": "◌", + "args": 1, + "outputs": 0, + "class": "Stack", + "description": "Discard the top stack value" + }, + "power": { + "glyph": "ⁿ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Raise a value to a power" + }, + "quote": { + "args": 0, + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Convert a string into code at compile time", + "experimental": true + }, + "random": { + "glyph": "⚂", + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Generate a random number in the range [0, 1)" + }, + "range": { + "glyph": "⇡", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Make an array of all natural numbers less than a number" + }, + "recv": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Receive a value from a thread" + }, + "reduce": { + "glyph": "/", + "args": 1, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Apply a reducing function to an array" + }, + "regex": { + "args": 2, + "outputs": 1, + "class": "Misc", + "description": "Match a regex pattern" + }, + "remove": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Remove the value corresponding to a key from a map array" + }, + "repeat": { + "glyph": "⍥", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Repeat a function a number of times" + }, + "repr": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Convert a value to its code representation", + "experimental": true + }, + "rerank": { + "glyph": "☇", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Change the rank of an array's rows" + }, + "reshape": { + "glyph": "↯", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Change the shape of an array" + }, + "reverse": { + "glyph": "⇌", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Reverse the rows of an array" + }, + "rise": { + "glyph": "⍏", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the indices into an array if it were sorted ascending" + }, + "rotate": { + "glyph": "↻", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Rotate the elements of an array by n" + }, + "round": { + "glyph": "⁅", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer" + }, + "rows": { + "glyph": "≡", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each row of an array or arrays" + }, + "scan": { + "glyph": "\\", + "args": 1, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Reduce, but keep intermediate values" + }, + "select": { + "glyph": "⊏", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Select multiple rows from an array" + }, + "send": { + "args": 2, + "outputs": 0, + "class": "Thread", + "description": "Send a value to a thread" + }, + "setinv": { + "outputs": 1, + "modifier_args": 2, + "class": "InversionModifier", + "description": "Set the un-compatible inverse of a function" + }, + "setund": { + "outputs": 1, + "modifier_args": 3, + "class": "InversionModifier", + "description": "Set the under-compatible inverse of a function" + }, + "shape": { + "glyph": "△", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the dimensions of an array" + }, + "sign": { + "glyph": "±", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Numerical sign (1, ¯1, or 0)" + }, + "signature": { + "args": 0, + "outputs": 2, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Get the signature of a function", + "experimental": true + }, + "sine": { + "glyph": "∿", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Get the sine of a number" + }, + "spawn": { + "outputs": 1, + "modifier_args": 1, + "class": "Thread", + "description": "Spawn a thread" + }, + "sqrt": { + "glyph": "√", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Take the square root of a number" + }, + "stack": { + "glyph": "?", + "args": 0, + "outputs": 0, + "class": "Stack", + "description": "Debug print all stack values without popping them" + }, + "stringify": { + "args": 0, + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Convert code into a string instead of compiling it", + "experimental": true + }, + "subtract": { + "glyph": "-", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Subtract values" + }, + "table": { + "glyph": "⊞", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each combination of rows of two arrays" + }, + "tag": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Generate a unique tag" + }, + "take": { + "glyph": "↙", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Take the first n elements of an array" + }, + "tau": { + "glyph": "τ", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The ratio of a circle's circumference to its radius" + }, + "trace": { + "glyph": "⸮", + "args": 1, + "outputs": 1, + "class": "Stack", + "description": "Debug print the top value on the stack without popping it" + }, + "transpose": { + "glyph": "⍉", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Rotate the shape of an array" + }, + "try": { + "glyph": "⍣", + "outputs": 1, + "modifier_args": 2, + "class": "Misc", + "description": "Call a function and catch errors" + }, + "tryrecv": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Try to receive a value from a thread" + }, + "type": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Check the type of an array" + }, + "un": { + "glyph": "°", + "outputs": 1, + "modifier_args": 1, + "class": "InversionModifier", + "description": "Invert the behavior of a function" + }, + "under": { + "glyph": "⍜", + "outputs": 1, + "modifier_args": 2, + "class": "InversionModifier", + "description": "Operate on a transformed array, then reverse the transformation" + }, + "unique": { + "glyph": "◰", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get a mask of first occurrences of items in an array" + }, + "utf": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Convert a string to UTF-8 bytes" + }, + "wait": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Wait for a thread to finish and push its results to the stack" + }, + "where": { + "glyph": "⊚", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get indices where array values are not equal to zero" + }, + "windows": { + "glyph": "◫", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "The n-wise windows of an array" + }, + "xlsx": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into XLSX bytes" + } +} \ No newline at end of file diff --git a/docs/site-75ef4200748d782e.js b/docs/site-75ef4200748d782e.js new file mode 100644 index 000000000..416eb5e3c --- /dev/null +++ b/docs/site-75ef4200748d782e.js @@ -0,0 +1,1637 @@ +let wasm; + +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8Memory0 = null; + +function getUint8Memory0() { + if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { + cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8Memory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8Memory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let cachedInt32Memory0 = null; + +function getInt32Memory0() { + if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { + cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32Memory0; +} + +let cachedFloat64Memory0 = null; + +function getFloat64Memory0() { + if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { + cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); + } + return cachedFloat64Memory0; +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => { + wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b) +}); + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_2.get(state.dtor)(a, state.b); + CLOSURE_DTORS.unregister(state); + } else { + state.a = a; + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} +function __wbg_adapter_36(arg0, arg1, arg2) { + wasm.wasm_bindgen__convert__closures__invoke1_mut__h67297fa45c58e4e8(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_39(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd6e35d87d02c3275(arg0, arg1); +} + +function __wbg_adapter_42(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h52ecd9fd6fe3cbca(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_45(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf41caf52db426d4d(arg0, arg1); +} + +function __wbg_adapter_48(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hae69bb6b859cfd99(arg0, arg1, addHeapObject(arg2)); +} + +function getCachedStringFromWasm0(ptr, len) { + if (ptr === 0) { + return getObject(len); + } else { + return getStringFromWasm0(ptr, len); + } +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } +} +function __wbg_adapter_435(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures__invoke2_mut__h7d2916789531c630(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); +} + +const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingByteSource { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingByteSourceFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingbytesource_free(ptr); + } + /** + * @returns {string} + */ + get type() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.intounderlyingbytesource_type(retptr, this.__wbg_ptr); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + var v1 = getCachedStringFromWasm0(r0, r1); + if (r0 !== 0) { wasm.__wbindgen_free(r0, r1, 1); } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} +/** +* @returns {number} +*/ +get autoAllocateChunkSize() { + const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr); + return ret >>> 0; +} +/** +* @param {ReadableByteStreamController} controller +*/ +start(controller) { + wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller)); +} +/** +* @param {ReadableByteStreamController} controller +* @returns {Promise} +*/ +pull(controller) { + const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller)); + return takeObject(ret); +} +/** +*/ +cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingbytesource_cancel(ptr); +} +} + +const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingSink { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSinkFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsink_free(ptr); + } + /** + * @param {any} chunk + * @returns {Promise} + */ + write(chunk) { + const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk)); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + close() { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_close(ptr); + return takeObject(ret); + } + /** + * @param {any} reason + * @returns {Promise} + */ + abort(reason) { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason)); + return takeObject(ret); + } +} + +const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingSource { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSourceFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsource_free(ptr); + } + /** + * @param {ReadableStreamDefaultController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller)); + return takeObject(ret); + } + /** + */ + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingsource_cancel(ptr); + } +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1, 1); } + console.error(v0); +}; +imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) { + const ret = getObject(arg0) === getObject(arg1); + return ret; +}; +imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'number' ? obj : undefined; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); +}; +imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = getObject(arg0); + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; +}; +imports.wbg.__wbindgen_is_null = function(arg0) { + const ret = getObject(arg0) === null; + return ret; +}; +imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; +}; +imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; +}; +imports.wbg.__wbg_crypto_d05b68a3572bb8ca = function(arg0) { + const ret = getObject(arg0).crypto; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_object = function(arg0) { + const val = getObject(arg0); + const ret = typeof(val) === 'object' && val !== null; + return ret; +}; +imports.wbg.__wbg_process_b02b3570280d0366 = function(arg0) { + const ret = getObject(arg0).process; + return addHeapObject(ret); +}; +imports.wbg.__wbg_versions_c1cb42213cedf0f5 = function(arg0) { + const ret = getObject(arg0).versions; + return addHeapObject(ret); +}; +imports.wbg.__wbg_node_43b1089f407e4ec2 = function(arg0) { + const ret = getObject(arg0).node; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_string = function(arg0) { + const ret = typeof(getObject(arg0)) === 'string'; + return ret; +}; +imports.wbg.__wbg_require_9a7e0f667ead4995 = function() { return handleError(function () { + const ret = module.require; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_msCrypto_10fc94afee92bd76 = function(arg0) { + const ret = getObject(arg0).msCrypto; + return addHeapObject(ret); +}; +imports.wbg.__wbg_randomFillSync_b70ccbdf4926a99d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_getRandomValues_7e42b4fb8779dc6d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbindgen_is_falsy = function(arg0) { + const ret = !getObject(arg0); + return ret; +}; +imports.wbg.__wbg_instanceof_Window_f401953a2cf86220 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_document_5100775d18896c16 = function(arg0) { + const ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_location_2951b5ee34f19221 = function(arg0) { + const ret = getObject(arg0).location; + return addHeapObject(ret); +}; +imports.wbg.__wbg_history_bc4057de66a2015f = function() { return handleError(function (arg0) { + const ret = getObject(arg0).history; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_navigator_6c8fa55c5cc8796e = function(arg0) { + const ret = getObject(arg0).navigator; + return addHeapObject(ret); +}; +imports.wbg.__wbg_localStorage_e381d34d0c40c761 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).localStorage; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_getSelection_1ba596ac4cddb0f1 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).getSelection(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_open_cc82b8aaf0c296c1 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + const ret = getObject(arg0).open(v0, v1); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_prompt_c80f89a5779f0504 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).prompt(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_scrollTo_4d970c5e1c4b340b = function(arg0, arg1, arg2) { + getObject(arg0).scrollTo(arg1, arg2); +}; +imports.wbg.__wbg_requestAnimationFrame_549258cfa66011f0 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).requestAnimationFrame(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_fetch_c4b6afebdb1f918e = function(arg0, arg1) { + const ret = getObject(arg0).fetch(getObject(arg1)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_setTimeout_c172d5704ef82276 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).setTimeout(getObject(arg1), arg2); + return ret; +}, arguments) }; +imports.wbg.__wbg_settitle_33da3ee844c607ef = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).title = v0; +}; +imports.wbg.__wbg_body_edb1908d3ceff3a1 = function(arg0) { + const ret = getObject(arg0).body; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_head_d7a99d3f407e2291 = function(arg0) { + const ret = getObject(arg0).head; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_createComment_354ccab4fdc521ee = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createComment(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_createDocumentFragment_8c86903bbb0a3c3c = function(arg0) { + const ret = getObject(arg0).createDocumentFragment(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_createElement_8bae7856a4bb7411 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createElement(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_createRange_813c14c34a0f908a = function() { return handleError(function (arg0) { + const ret = getObject(arg0).createRange(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_createTextNode_0c38fd80a5b2284d = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createTextNode(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_getElementById_c369ff43f0db99cf = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).getElementById(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_querySelector_a5f74efc5fa193dd = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).querySelector(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_id_e0c4392b9418f9b0 = function(arg0, arg1) { + const ret = getObject(arg1).id; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setclassName_9fee267eae0d8ddc = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).className = v0; +}; +imports.wbg.__wbg_classList_1f0528ee002e56d4 = function(arg0) { + const ret = getObject(arg0).classList; + return addHeapObject(ret); +}; +imports.wbg.__wbg_setinnerHTML_26d69b59e1af99c7 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).innerHTML = v0; +}; +imports.wbg.__wbg_getAttribute_99bddb29274b29b9 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getAttribute(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}; +imports.wbg.__wbg_getElementsByTagName_ea632875268a272f = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).getElementsByTagName(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_hasAttribute_8340e1a2a46f10f3 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).hasAttribute(v0); + return ret; +}; +imports.wbg.__wbg_removeAttribute_1b10a06ae98ebbd1 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).removeAttribute(v0); +}, arguments) }; +imports.wbg.__wbg_scrollIntoView_0c1a31f3d0dce6ae = function(arg0) { + getObject(arg0).scrollIntoView(); +}; +imports.wbg.__wbg_scrollIntoView_eec424449e6c23da = function(arg0, arg1) { + getObject(arg0).scrollIntoView(getObject(arg1)); +}; +imports.wbg.__wbg_setAttribute_3c9f6c303b696daa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setAttribute(v0, v1); +}, arguments) }; +imports.wbg.__wbg_before_210596e44d88649f = function() { return handleError(function (arg0, arg1) { + getObject(arg0).before(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_remove_49b0a5925a04b955 = function(arg0) { + getObject(arg0).remove(); +}; +imports.wbg.__wbg_name_f35eb93a73d94973 = function(arg0, arg1) { + const ret = getObject(arg1).name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_length_4db38705d5c8ba2f = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_get_58f6d5f6aee3f846 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_now_4e659b3d15f470d9 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; +}; +imports.wbg.__wbg_instanceof_ClipboardEvent_3fd5b713d8add4f0 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ClipboardEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_clipboardData_0427b2003659865a = function(arg0) { + const ret = getObject(arg0).clipboardData; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_DragEvent_329fd02ae838527e = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof DragEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_dataTransfer_cef7816623bd8478 = function(arg0) { + const ret = getObject(arg0).dataTransfer; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_InputEvent_787602aee80bca20 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof InputEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_isComposing_71872de364b1e1b7 = function(arg0) { + const ret = getObject(arg0).isComposing; + return ret; +}; +imports.wbg.__wbg_files_a2848a7a7424820f = function(arg0) { + const ret = getObject(arg0).files; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_getData_35c5974f5cd7e02c = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getData(v0); + const ptr2 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlInputElement_307512fe1252c849 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_47fe6384562f52ab = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setvalue_78cb4f1fef58ae98 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).value = v0; +}; +imports.wbg.__wbg_instanceof_Node_daad148a35d38074 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Node; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_parentNode_6be3abff20e1a5fb = function(arg0) { + const ret = getObject(arg0).parentNode; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_childNodes_118168e8b23bcb9b = function(arg0) { + const ret = getObject(arg0).childNodes; + return addHeapObject(ret); +}; +imports.wbg.__wbg_firstChild_a10db88beca6812e = function(arg0) { + const ret = getObject(arg0).firstChild; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_previousSibling_9708a091a3e6e03b = function(arg0) { + const ret = getObject(arg0).previousSibling; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_nextSibling_709614fdb0fb7a66 = function(arg0) { + const ret = getObject(arg0).nextSibling; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_textContent_8e392d624539e731 = function(arg0, arg1) { + const ret = getObject(arg1).textContent; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_settextContent_d271bab459cbb1ba = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).textContent = v0; +}; +imports.wbg.__wbg_appendChild_580ccb11a660db68 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).appendChild(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_cloneNode_e19c313ea20d5d1d = function() { return handleError(function (arg0) { + const ret = getObject(arg0).cloneNode(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_contains_fdfd1dc667f36695 = function(arg0, arg1) { + const ret = getObject(arg0).contains(getObject(arg1)); + return ret; +}; +imports.wbg.__wbg_removeChild_96bbfefd2f5a0261 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).removeChild(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_byobRequest_72fca99f9c32c193 = function(arg0) { + const ret = getObject(arg0).byobRequest; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_close_184931724d961ccc = function() { return handleError(function (arg0) { + getObject(arg0).close(); +}, arguments) }; +imports.wbg.__wbg_close_a994f9425dab445c = function() { return handleError(function (arg0) { + getObject(arg0).close(); +}, arguments) }; +imports.wbg.__wbg_enqueue_ea194723156c0cc2 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).enqueue(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlBrElement_d610250bbbe930ee = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLBRElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_error_8e3928cfb8a43e2b = function(arg0) { + console.error(getObject(arg0)); +}; +imports.wbg.__wbg_log_5bb5f88f245d7762 = function(arg0) { + console.log(getObject(arg0)); +}; +imports.wbg.__wbg_warn_63bbae1730aead09 = function(arg0) { + console.warn(getObject(arg0)); +}; +imports.wbg.__wbg_add_dcb05a8ba423bdac = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).add(v0); +}, arguments) }; +imports.wbg.__wbg_remove_698118fb25ab8150 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).remove(v0); +}, arguments) }; +imports.wbg.__wbg_addEventListener_53b787075bd5e003 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).addEventListener(v0, getObject(arg3)); +}, arguments) }; +imports.wbg.__wbg_addEventListener_4283b15b4f039eb5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).addEventListener(v0, getObject(arg3), getObject(arg4)); +}, arguments) }; +imports.wbg.__wbg_dispatchEvent_63c0c01600a98fd2 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).dispatchEvent(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_removeEventListener_92cb9b3943463338 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).removeEventListener(v0, getObject(arg3)); +}, arguments) }; +imports.wbg.__wbg_instanceof_FileReader_40a99278a99671fb = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof FileReader; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_result_77ceeec1e3a16df7 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).result; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_new_c1e4a76f0b5c28b8 = function() { return handleError(function () { + const ret = new FileReader(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_readAsArrayBuffer_4f4ed73c7dc0ce42 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).readAsArrayBuffer(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_play_14d1cdf5b2b09482 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).play(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlStyleElement_ec3ba043094b4bea = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLStyleElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_getItem_164e8e5265095b87 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getItem(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_setItem_ba2bb41d73dac079 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setItem(v0, v1); +}, arguments) }; +imports.wbg.__wbg_innerText_f202d7ac8d827e5a = function(arg0, arg1) { + const ret = getObject(arg1).innerText; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setinnerText_087b7e3f90d97466 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).innerText = v0; +}; +imports.wbg.__wbg_style_c3fc3dd146182a2d = function(arg0) { + const ret = getObject(arg0).style; + return addHeapObject(ret); +}; +imports.wbg.__wbg_focus_39d4b8ba8ff9df14 = function() { return handleError(function (arg0) { + getObject(arg0).focus(); +}, arguments) }; +imports.wbg.__wbg_href_7bfb3b2fdc0a6c3f = function(arg0, arg1) { + const ret = getObject(arg1).href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_origin_ea68ac578fa8517a = function(arg0, arg1) { + const ret = getObject(arg1).origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_pathname_c5fe403ef9525ec6 = function(arg0, arg1) { + const ret = getObject(arg1).pathname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_search_c68f506c44be6d1e = function(arg0, arg1) { + const ret = getObject(arg1).search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_searchParams_bc5845fe67587f77 = function(arg0) { + const ret = getObject(arg0).searchParams; + return addHeapObject(ret); +}; +imports.wbg.__wbg_hash_cdea7a9b7e684a42 = function(arg0, arg1) { + const ret = getObject(arg1).hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_newwithbase_6aabbfb1b2e6a1cb = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + var v1 = getCachedStringFromWasm0(arg2, arg3); + const ret = new URL(v0, v1); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_writeText_4f1bf9bc5850bc26 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).writeText(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_removeProperty_fa6d48e2923dcfac = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).removeProperty(v0); + const ptr2 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_setProperty_ea7d15a2b591aa97 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setProperty(v0, v1); +}, arguments) }; +imports.wbg.__wbg_target_2fc177e386c8b7b0 = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_defaultPrevented_cc14a1dd3dd69c38 = function(arg0) { + const ret = getObject(arg0).defaultPrevented; + return ret; +}; +imports.wbg.__wbg_cancelBubble_c0aa3172524eb03c = function(arg0) { + const ret = getObject(arg0).cancelBubble; + return ret; +}; +imports.wbg.__wbg_newwitheventinitdict_079f8f3bd3131f96 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Event(v0, getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_composedPath_58473fd5ae55f2cd = function(arg0) { + const ret = getObject(arg0).composedPath(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_preventDefault_b1a4aafc79409429 = function(arg0) { + getObject(arg0).preventDefault(); +}; +imports.wbg.__wbg_stopPropagation_fa5b666049c9fd02 = function(arg0) { + getObject(arg0).stopPropagation(); +}; +imports.wbg.__wbg_instanceof_KeyboardEvent_d51b1a079e0c6a46 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof KeyboardEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_altKey_2e6c34c37088d8b1 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_ctrlKey_bb5b6fef87339703 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_5911baf439ab232b = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_metaKey_6bf4ae4e83a11278 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_key_dccf9e8aa1315a8e = function(arg0, arg1) { + const ret = getObject(arg1).key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_instanceof_MouseEvent_fdc007d866fdd0df = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof MouseEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_ctrlKey_008695ce60a588f5 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_1e76dbfcdd36a4b4 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_altKey_07da841b54bd3ed6 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_metaKey_86bfd3b0d3a8083f = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_button_367cdc7303e3cf9b = function(arg0) { + const ret = getObject(arg0).button; + return ret; +}; +imports.wbg.__wbg_instanceof_ProgressEvent_a612079592c18661 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ProgressEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_view_7f0ce470793a340f = function(arg0) { + const ret = getObject(arg0).view; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_respond_b1a43b2e3a06d525 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).respond(arg1 >>> 0); +}, arguments) }; +imports.wbg.__wbg_setdata_8c2b43af041cc1b3 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).data = v0; +}; +imports.wbg.__wbg_instanceof_Comment_97550c61a98faf76 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Comment; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_instanceof_HtmlAnchorElement_5fc0eb2fbc8672d8 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLAnchorElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_target_f0876f510847bc60 = function(arg0, arg1) { + const ret = getObject(arg1).target; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_href_40fd5bca11c13133 = function(arg0, arg1) { + const ret = getObject(arg1).href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_newwithsrc_ca8c671638a5c104 = function() { return handleError(function (arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Audio(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_item_4d089d561e1633ef = function(arg0, arg1) { + const ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_HtmlSelectElement_f0e1b0ac7b371ac0 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLSelectElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_47c64189244491be = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_sethref_b94692d1a9f05b53 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).href = v0; +}, arguments) }; +imports.wbg.__wbg_origin_ee93e29ace71f568 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_pathname_5449afe3829f96a1 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).pathname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_search_489f12953342ec1f = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_hash_553098e838e06c1d = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlDivElement_31d3273633f69d96 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLDivElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_clipboard_45ef2514e9ece120 = function(arg0) { + const ret = getObject(arg0).clipboard; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_userAgent_e94c7cbcdac01fea = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_length_d0a802565d17eec4 = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_newwithstrandinit_3fd6fba4083ff2d0 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Request(v0, getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_Response_849eb93e75734b6e = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_status_61a01141acd3cf74 = function(arg0) { + const ret = getObject(arg0).status; + return ret; +}; +imports.wbg.__wbg_text_450a059667fd91fd = function() { return handleError(function (arg0) { + const ret = getObject(arg0).text(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_anchorNode_256de0b9079a83ab = function(arg0) { + const ret = getObject(arg0).anchorNode; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_anchorOffset_541f023b2205d81a = function(arg0) { + const ret = getObject(arg0).anchorOffset; + return ret; +}; +imports.wbg.__wbg_focusNode_5ce87437f1a011c0 = function(arg0) { + const ret = getObject(arg0).focusNode; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_focusOffset_bb541775bdc3df73 = function(arg0) { + const ret = getObject(arg0).focusOffset; + return ret; +}; +imports.wbg.__wbg_addRange_6d29150af91914ba = function() { return handleError(function (arg0, arg1) { + getObject(arg0).addRange(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_removeAllRanges_12d76378cb7b1dcc = function() { return handleError(function (arg0) { + getObject(arg0).removeAllRanges(); +}, arguments) }; +imports.wbg.__wbg_append_7ba9d5c2eb183eea = function() { return handleError(function (arg0, arg1) { + getObject(arg0).append(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_state_9cc3f933b7d50acb = function() { return handleError(function (arg0) { + const ret = getObject(arg0).state; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_pushState_b8e8d346f8bb33fd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).pushState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_replaceState_ec9431bea5108a50 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).replaceState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_setEnd_75cc2dcd41ff5924 = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).setEnd(getObject(arg1), arg2 >>> 0); +}, arguments) }; +imports.wbg.__wbg_setStart_22aff31610d6b121 = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).setStart(getObject(arg1), arg2 >>> 0); +}, arguments) }; +imports.wbg.__wbg_instanceof_ShadowRoot_9db040264422e84a = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ShadowRoot; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_host_c667c7623404d6bf = function(arg0) { + const ret = getObject(arg0).host; + return addHeapObject(ret); +}; +imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) { + queueMicrotask(getObject(arg0)); +}; +imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) { + const ret = getObject(arg0).queueMicrotask; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; +}; +imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return addHeapObject(ret); +}; +imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Function(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) { + const ret = getObject(arg0).next; + return addHeapObject(ret); +}; +imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).next(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) { + const ret = getObject(arg0).done; + return ret; +}; +imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) { + const ret = getObject(arg0).value; + return addHeapObject(ret); +}; +imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() { + const ret = Symbol.iterator; + return addHeapObject(ret); +}; +imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() { + const ret = new Object(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () { + const ret = self.self; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () { + const ret = window.window; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () { + const ret = globalThis.globalThis; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () { + const ret = global.global; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_decodeURI_34e1afc7326c927c = function() { return handleError(function (arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = decodeURI(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) { + const ret = Array.isArray(getObject(arg0)); + return ret; +}; +imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_new_28c511d9baebfa89 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Error(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_is_010fdc0f4ab96916 = function(arg0, arg1) { + const ret = Object.is(getObject(arg0), getObject(arg1)); + return ret; +}; +imports.wbg.__wbg_exec_b9996525463e30df = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).exec(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_new_3c970fa9da0c5794 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + var v1 = getCachedStringFromWasm0(arg2, arg3); + const ret = new RegExp(v0, v1); + return addHeapObject(ret); +}; +imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) { + try { + var state0 = {a: arg0, b: arg1}; + var cb0 = (arg0, arg1) => { + const a = state0.a; + state0.a = 0; + try { + return __wbg_adapter_435(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return addHeapObject(ret); + } finally { + state0.a = state0.b = 0; + } +}; +imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); +}; +imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) { + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); +}; +imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) { + const ret = new Uint8Array(arg0 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_buffer_dd7f74bc60f1faab = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); +}; +imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_byteLength_58f7b4fab1919d44 = function(arg0) { + const ret = getObject(arg0).byteLength; + return ret; +}; +imports.wbg.__wbg_byteOffset_81d60f7392524f62 = function(arg0) { + const ret = getObject(arg0).byteOffset; + return ret; +}; +imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); + return ret; +}, arguments) }; +imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; +imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper1253 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 455, __wbg_adapter_36); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper16382 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3786, __wbg_adapter_39); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper16384 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3786, __wbg_adapter_42); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper16643 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3830, __wbg_adapter_45); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper18258 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 3843, __wbg_adapter_48); + return addHeapObject(ret); +}; + +return imports; +} + +function __wbg_init_memory(imports, maybe_memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedFloat64Memory0 = null; + cachedInt32Memory0 = null; + cachedUint8Memory0 = null; + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(input) { + if (wasm !== undefined) return wasm; + + if (typeof input === 'undefined') { + input = new URL('site-75ef4200748d782e_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) { + input = fetch(input); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await input, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync } +export default __wbg_init; diff --git a/docs/site-75ef4200748d782e_bg.wasm b/docs/site-75ef4200748d782e_bg.wasm new file mode 100644 index 000000000..6b82d4f14 Binary files /dev/null and b/docs/site-75ef4200748d782e_bg.wasm differ diff --git a/docs/styles-cab88d45f105b498.css b/docs/styles-cab88d45f105b498.css new file mode 100644 index 000000000..990d35d71 --- /dev/null +++ b/docs/styles-cab88d45f105b498.css @@ -0,0 +1,1247 @@ +@font-face { + font-family: "Code Font"; + src: url(Uiua386.ttf) format("truetype"); +} + +html * { + font-family: "Segoe UI", "Arial", sans-serif; +} + +html { + font-size: 115%; + font-weight: 500; +} + +body { + margin: 0; +} + +p { + line-height: 1.5em; +} + +h2 { + margin: 1.8em 0 0.5em 0; + padding-bottom: 0.3em; + border-bottom-width: 0.08em; + border-bottom-style: solid; + border-color: #888a; +} + +.header { + position: relative; +} + +a.header, +a:visited.header, +a:link.header { + text-decoration: none; + color: inherit; +} + +a.header::before { + position: absolute; + left: -1.5em; + bottom: 0.4em; + content: "🔗"; + opacity: 0; + font-size: 0.6em; + transition: opacity 0.2s; +} + +a.header:hover::before { + opacity: 0.5; +} + +h1>a>code, +h2>a>code { + font-weight: normal; +} + +button { + border-width: 0; + border-radius: 0.5em; + padding: 0.2em; + display: inline-block; + position: relative; +} + +button:active { + transform: translateY(0.1em); +} + +code { + font-family: "Code Font", monospace; + border-radius: 0.2em; + padding: 0.2em; + position: relative; +} + +th, +td { + padding: 0.3em; + border-radius: 0.5em; +} + +th { + text-align: left; +} + +tr:nth-child(even) { + background-color: #0001; +} + +.bordered-table { + border: 0.2em solid #0005; + border-radius: 0.5em; +} + +.header-centered-table>tr>th { + text-align: center; + +} + +.cell-centered-table>tr>td { + text-align: center; +} + +li { + margin: 0.3em 0; +} + +@media (prefers-color-scheme: dark) { + + body, + #header-uiua, + .spoiler:hover { + color: #d1daec; + } + + body, + .spoiler:hover { + background-color: #141a1f; + } + + #editor { + outline: 0.1em solid #606468; + background-color: #19232d; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #d1daec; + background-color: #1d2c3a; + } + + button { + color: #d1daec; + background-color: #1d2c3a; + } + + button:hover { + background-color: #2d3c4a; + } + + a:link { + color: #6fadea; + } + + a:visited { + color: #947bec; + } + + code { + background-color: #0004; + } + + .important-button { + background-color: #33577b; + } + + .important-button:hover { + background-color: #579; + } + + .tutorial-nav>* { + background-color: #1d2c3a; + } + + tr:nth-child(even) { + background-color: #0001; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #0003; + } + + .code-entry { + caret-color: white; + } + + #subtitle { + color: #d1daecc0; + } +} + +@media (prefers-color-scheme: light) { + + body, + #header-uiua, + .spoiler:hover { + color: #344; + } + + body, + .spoiler:hover { + background-color: #c6e7ec; + } + + #editor { + background-color: #dff2f3; + outline: 0.1em solid #0004; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #344; + background-color: #f4f6f6; + } + + button { + color: #344; + background-color: #f6f8f8; + } + + button:hover { + background-color: #fdffff; + } + + a:link { + color: #0099ad; + } + + a:visited { + color: #6a4bfb; + } + + code { + background-color: #fff8; + } + + .important-button { + background-color: #aadae0; + } + + .important-button:hover { + background-color: #bee2e7; + } + + .tutorial-nav>* { + background-color: #f6f8f8; + } + + tr:nth-child(even) { + background-color: #fff1; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #fffa; + } + + .code-entry { + caret-color: black; + } + + #subtitle { + color: #344c; + } +} + +#top { + margin: 2em auto; + width: max(10em, min(90%, 53em)); +} + +#header { + display: flex; + justify-content: space-between; + align-items: last baseline; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; +} + + +#header-left { + display: flex; + align-items: last baseline; + margin: -1em 0; +} + +#header-uiua { + text-decoration: none; + white-space: nowrap; +} + +#subtitle { + margin-left: 1.5em; + font-size: 1em; + font-weight: bold; + font-style: italic; +} + +.spoiler { + color: #0000; + background-color: #0008; + border-radius: 0.5em; +} + +.long-subtitle { + font-size: 0.9em; +} + +.long-subtitle>div { + display: flex; + gap: 0.5em; + flex-wrap: nowrap; + white-space: nowrap; +} + +#nav { + display: flex; + gap: 1em; + flex-wrap: nowrap; + align-items: baseline; +} + +#links { + font-size: 1.2em; + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; + align-content: flex-start; +} + +#links>* { + display: flex; + gap: 1em; + flex-wrap: wrap; + justify-content: space-between; + align-content: flex-start; +} + +.main-text { + font-size: 120%; + text-align: center; +} + +.wee-wuh-span { + font-size: 70%; + opacity: 0.8; +} + +.features { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + gap: min(3em, 3vw); + width: min(120%, 90vw); + margin-left: calc(-0.5 * (min(120%, 90vw) - 100%)); +} + +.features>* { + flex: 1 1 22em; + width: 0; +} + +#editor { + border-radius: 0.5em; + position: relative; +} + +#drag-message { + position: absolute; + inset: 0; + display: flex; + justify-content: center; + align-items: center; + background-color: #0008; + font-size: 2em; +} + +#editor-wrapper { + margin-bottom: 0.5em; + font-size: min(1em, 3.5vw); +} + +.small-editor { + font-size: 1.2em; +} + +.medium-editor { + font-size: 1.4em; +} + +#settings { + display: flex; + justify-content: space-between; + font-size: 0.82em; + padding: 0.2em; + gap: 0.5em; +} + +#settings>* { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.2em 1em; +} + +#settings-left { + width: 85%; + justify-content: space-between; +} + +#settings-right { + flex-direction: column; + align-items: flex-end; +} + +#settings>*>* { + display: inline-block; + white-space: nowrap; +} + +input[type=number] { + appearance: textfield; + -moz-appearance: textfield; +} + +#settings>*>*>input, +#settings>*>*>select { + border-radius: 0.5em; + border: none; + margin-left: 0.5em; +} + +#settings>*>*>input[type=number] { + width: 3em; +} + +#code-area { + position: relative; +} + +.code { + text-align: left; + border-radius: 0.5em; + width: 100%; + resize: vertical; + box-sizing: border-box; + outline: none; + border: none; + padding: 0.3em; + min-height: 1.8em; + overflow-y: auto; + display: flex; + gap: 0.1em; +} + +.code-block { + display: block; + white-space: pre-wrap; + padding: 0.8em; +} + +.code-entry { + outline: none; + border: none; + width: 100%; + display: inline-block; + white-space: pre; +} + +.code-line { + height: 1.25em; + padding: 0; + margin: 0; +} + +.line-numbers { + min-width: 1.5em; +} + +@media (prefers-color-scheme: dark) { + .line-numbers { + color: #3f4b5d; + } +} + +@media (prefers-color-scheme: light) { + .line-numbers { + color: #bcc9ca; + } +} + +.code-span { + font-size: 1em; + font-family: "Code Font", monospace; + white-space: pre; + text-decoration: none; +} + +.code-hover:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.7em; + color: #eee; + background-color: #000c; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; + margin-top: 1.9em; + margin-left: -2em; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.ctrl-pressed .code-underline:hover { + text-decoration: underline; + cursor: pointer; +} + +.output-frame { + display: flex; + justify-content: space-between; + min-height: 1.9em; +} + +.output-lines { + overflow-x: auto; +} + +.output-diagnostics { + white-space: pre-wrap; + text-align: left; + margin-left: 1.75em; + padding: 0.3em 0; + font-family: "Code Font", monospace; +} + +.output-wrapper { + transform: rotateX(180deg); + overflow-x: auto; +} + +.output { + white-space: pre; + text-align: left; + margin-left: 1.85em; + padding: 0.4em 0; + font-family: "Code Font", monospace; + transform: rotateX(180deg); +} + +.output:empty, +.output-diagnostics:empty { + display: none; +} + +.output-item, +.output-report { + font-family: inherit; +} + +#code-buttons { + margin: 0.2em 0.2em 0.2em 0; + display: flex; + flex-wrap: nowrap; + right: 0; + max-height: 1.5em; +} + +.code-button { + font-size: 0.9em; + margin: 0 0 0 0.2em; + height: auto; + text-align: center; + text-justify: center; +} + +.important-button { + animation: fadeAnimation 2s infinite; +} + +.output-report { + font-size: 0.9em; +} + +.output-error { + color: #f44; +} + +.output-warning { + color: #fb0; +} + +.output-advice { + color: #2af; +} + +.output-style { + color: #0a0; +} + +.output-faint { + opacity: 0.75; +} + +.output-fainter { + opacity: 0.55; +} + +.output-image { + border-radius: 0.5em; + max-width: 50vw; +} + +.output-audio { + border-radius: 0.5em; + max-width: 50vw; +} + +#code-right-side { + display: flex; + position: absolute; + top: 0.1em; + right: 0.2em; + padding-right: 0.3em; + font-size: min(1em, 3vw); + align-items: center; +} + +#glyphs-toggle-button { + font-weight: bolder; + font-size: 0.9em; +} + +#glyphs-toggle-button:hover:after { + font-size: 0.6em; +} + +.editor-right-button { + font-weight: bolder; + opacity: 0.5; +} + +.editor-right-button:hover { + opacity: 1; +} + +.info-button:hover::after, +.editor-right-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 1em; + left: calc(-8em - 50%); + bottom: 1.5em; + color: #eee; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; +} + +.editor-right-button:hover::after { + background-color: #000b; + width: 8em; +} + +.info-button:hover::after { + background-color: #000d; + width: 24em; + white-space: pre-wrap; + text-align: left; +} + +#example-tracker { + margin-left: 0.5em; + font-size: 0.8em; +} + +.glyph-buttons { + padding: 0.1em; + font-size: 1.4em; + display: flex; + flex-wrap: wrap; + justify-content: space-evenly; + align-items: baseline; +} + +.glyph-button { + font-family: "Code Font", monospace; + font-size: 0.91em; + padding: 0.05em; + margin: 0em; + background-color: transparent; +} + +.glyph-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.7em; + bottom: 100%; + color: #eee; + background-color: #000a; + padding: 0.1em; + border-radius: 0.2em; + left: -1em; + width: 7em; + pointer-events: none; + z-index: 1; + white-space: pre-wrap; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.experimental-glyph-button { + display: none; +} + +.prim-code-a { + text-decoration: none; + white-space: nowrap; +} + +.prim-glyph { + font-weight: 400; +} + +.prim-code:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.8em; + bottom: 100%; + color: #eee; + background-color: #000d; + padding: 0.2em; + border-radius: 0.2em; + left: 0; + pointer-events: none; + width: 10em; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + line-height: 1em; + z-index: 1; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.glyph-doc { + position: absolute; + top: min(10%, 1em); + left: 10%; + padding: 0.5em; + font-size: 0.75em; + border-radius: 0.5em; + max-width: 80%; + white-space: pre-wrap; + font-family: "Code Font", monospace; + z-index: 1; +} + +@media (prefers-color-scheme: dark) { + + .glyph-doc { + background-color: #000c; + } + + .glyph-doc-ctrl-click { + color: #aaa; + } +} + +@media (prefers-color-scheme: light) { + + .glyph-doc { + background-color: #fffd; + } + + .glyph-doc-ctrl-click { + color: #777; + } +} + +.glyph-doc-ctrl-click { + font-size: 0.7em; +} + +.code-font { + font-family: "Code Font", monospace; +} + +.combinator-diagram { + border-radius: 0.5em; + height: 8em; +} + +@media (prefers-color-scheme: dark) { + .stack-function { + color: #d1daec; + } +} + +@media (prefers-color-scheme: light) { + .stack-function { + color: #344; + } +} + +.private-binding>* { + opacity: 0.75; +} + +.module { + color: #d7be8c; +} + +.noadic-function { + color: #ed5e6a; +} + +.monadic-function { + color: #95d16a; +} + +.dyadic-function { + color: #54b0fc; +} + +.triadic-function { + color: #8078f1; +} + +.tetradic-function { + color: #f576d8; +} + +.monadic-modifier { + color: #f0c36f; +} + +.dyadic-modifier { + color: #cc6be9; +} + +.triadic-modifier { + color: #F5A9B8 +} + +.space-character { + border-width: 2px; + border-radius: 0.3em; + border-style: dashed; + margin: 0 -2px; +} + +@media (prefers-color-scheme: dark) { + .string-literal-span { + color: #20f9fc; + } + + .space-character { + border-color: #20f9fc80; + } + + .strand-span { + color: #fff8; + } +} + +@media (prefers-color-scheme: light) { + .string-literal-span { + color: #1c9; + } + + .space-character { + border-color: #1c98; + } + + .strand-span { + color: #0008; + } +} + +.number-literal { + color: #f85; +} + + +.comment-span { + color: #888; +} + +@media (prefers-color-scheme: dark) { + .output-a { + color: #cff; + } + + .output-b { + color: #ccf; + } + + .output-c { + color: #fcf; + } + + .output-d { + color: #fcc; + } + + .output-e { + color: #ffc; + } + + .output-f { + color: #cfc; + } +} + +@media (prefers-color-scheme: light) { + + .output-a { + color: #225; + } + + .output-b { + color: #525; + } + + .output-c { + color: #522; + } + + .output-d { + color: #552; + } + + .output-e { + color: #252; + } + + .output-f { + color: #255; + } +} + +#editor-help { + margin: 0.4em 0 0 0; + font-size: 1em; + opacity: 0.5; + display: flex; + justify-content: space-between; + gap: 0.5em; +} + +#editor-help:empty { + display: none; +} + +#editor-help>* { + line-height: 1em; + margin: 0; + white-space: pre-wrap; +} + +.sound-button { + background-color: transparent; +} + +.tutorial-nav { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 1.1em; + gap: 0.5em; +} + +.tutorial-nav>* { + border-radius: 0.5em; + border-color: #0003; + border-radius: 0.5em; + padding: 0.5em; +} + +.tutorial-nav>*:empty { + background-color: #0000; +} + +.primitive-list { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.primitive-list>* { + margin-bottom: 0.5em; +} + +#ascii-glyphs { + display: flex; + justify-content: space-evenly; + flex-wrap: wrap; +} + +.input-div { + display: flex; + align-items: center; + font-size: 1em; + border-radius: 0.5em; + padding: 0.5em; + width: min(100%, max(30%, 22em)); +} + +input[type=text] { + font-size: 1em; + border-radius: 0.5em; + padding: 0 0.5em; + outline: none; + border: none; + width: 100%; +} + +#function-search { + scroll-margin-top: 1em; + scroll-margin-bottom: 1em; +} + +#function-search-wrapper { + display: flex; + justify-content: space-between; + align-items: center; +} + +.running-text { + animation: fadeAnimation 1s infinite; +} + +.slow-pulse { + animation: pulseAnimation 2s infinite; +} + +@keyframes fadeAnimation { + + 0%, + 100% { + opacity: 0.5; + } + + 50% { + opacity: 1; + } +} + + +@keyframes pulseAnimation { + + 0%, + 100% { + transform: scale(1) translate(0); + } + + 50% { + transform: scale(1, 1.1) translate(0, -0.05em); + } +} + +.uiuism-item { + display: flex; + justify-content: space-between; + align-items: center; +} + +.pls-no-block { + font-size: 0.7em; +} + +a.clean { + text-decoration: none; +} + +.experimental { + color: #db2; +} + +.text-gradient { + background-size: 100%; + background-clip: text; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} + +.trans { + background-image: linear-gradient(180deg, + #5BCEFA 34%, + #F5A9B8 34%, + #F5A9B8 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #F5A9B8 56%, + #F5A9B8 67%, + #5BCEFA 67%); +} + +.bi { + background-image: linear-gradient(180deg, + #D60270 45%, + #9B4F96 45%, + #9B4F96 64%, + #0038A8 64%); +} + +.pan { + background-image: linear-gradient(180deg, + #FF218C 45%, + #FFD800 45%, + #FFD800 64%, + #21B1FF 64%); +} + +.gay { + background-image: linear-gradient(180deg, + #E40303 30%, + #FFA52C 30%, + #FFA52C 40%, + #FFFF41 40%, + #FFFF41 50%, + #008018 50%, + #008018 60%, + #0000F9 60%, + #0000F9 70%, + #86007D 70%); +} + +.ace { + background-image: linear-gradient(180deg, + #000000 30%, + #A3A3A3 30%, + #A3A3A3 50%, + #FFFFFF 50%, + #FFFFFF 70%, + #800080 70%); +} + +.aro { + background-image: linear-gradient(180deg, + #000000 36%, + #A9A9A9 36%, + #A9A9A9 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #A7D379 58%, + #A7D379 69%, + #3DA542 69%); + +} + +.aroace { + background-image: linear-gradient(180deg, + #ef9007 36%, + #f6d317 36%, + #f6d317 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #45bcee 58%, + #45bcee 69%, + #1e3f54 69%); + +} + +.nb { + background-image: linear-gradient(180deg, + #FCF434 30%, + #FFFFFF 30%, + #FFFFFF 50%, + #9C59D1 50%, + #9C59D1 70%, + #2C2C2C 70%); +} + +.fluid { + background-image: linear-gradient(180deg, + #FF76A4 36%, + #FFFFFF 36%, + #FFFFFF 47%, + #C011D7 47%, + #C011D7 58%, + #000000 58%, + #000000 69%, + #2F3CBE 69%); +} + +.queer { + background-image: linear-gradient(180deg, + #B57EDC 48%, + #FFFFFF 48%, + #FFFFFF 65%, + #4A8123 65%); +} + +.lesbian { + background-image: linear-gradient(180deg, + #d42c00 34%, + #fd9855 34%, + #fd9855 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #d161a2 56%, + #d161a2 67%, + #a20161 67%); +} + +@media (prefers-color-scheme: light) { + + .trans, + .bi, + .pan, + .ace, + .aro, + .aroace, + .gay, + .nb, + .fluid, + .queer { + -webkit-text-stroke: 0.01em #000; + } +} + +@media (prefers-color-scheme: dark) { + + .bi, + .nb, + .ace, + .aro, + .aroace, + .fluid { + -webkit-text-stroke: 0.01em #fff8; + } +} \ No newline at end of file diff --git a/docs/text/format_config.md b/docs/text/format_config.md new file mode 100644 index 000000000..6b989886d --- /dev/null +++ b/docs/text/format_config.md @@ -0,0 +1,86 @@ + +# Uiua Formatter Configuration + +You can configure Uiua's formatter by creating a file called `.fmt.ua` in the directory from which you run the interpreter. This configuration file is also a Uiua program. + +Configuration options are specified by binding values to specific names. + +Example with default values: +```uiua +TrailingNewline ← 1 +CommentSpaceAfterHash ← 1 +MultilineIndent ← 2 +CompactMultilineMode ← "auto" +MultilineCompactThreshold ← 10 +AlignComments ← 1 +IndentItemImports ← 1 +``` +The following configuration options are available: + +### TrailingNewline +Type: boolean + +Default: `1` + +Whether to add a trailing newline to the output. + +--- + +### CommentSpaceAfterHash +Type: boolean + +Default: `1` + +Whether to add a space after the `#` in comments. + +--- + +### MultilineIndent +Type: natural number + +Default: `2` + +The number of spaces to indent multiline arrays and functions + +--- + +### CompactMultilineMode +Type: `"always"`, `"never"`, or `"auto"` + +Default: `"auto"` + +The mode for formatting multiline arrays and functions. + +- `"always"`: Always format multiline expressions in compact mode. +- `"never"`: Never format multiline expressions in compact mode. +- `"auto"`: Format multiline expressions in compact mode if they exceed `MultilineCompactThreshold`. + +--- + +### MultilineCompactThreshold +Type: natural number + +Default: `10` + +The number of characters on line preceding a multiline array or function, at or before which the multiline will be compact. + +--- + +### AlignComments +Type: boolean + +Default: `1` + +Whether to align consecutive end-of-line comments + +--- + +### IndentItemImports +Type: boolean + +Default: `1` + +Whether to indent item imports + +--- + diff --git a/docs/text/strings.md b/docs/text/strings.md new file mode 100644 index 000000000..97b4e9851 --- /dev/null +++ b/docs/text/strings.md @@ -0,0 +1,137 @@ +# Working with Strings + +There is a common misconception that array languages like Uiua are only really good for mathematical tasks; that rich text processing is better left to more traditional languages. This is not the case! Strings are, after all, just arrays of characters! + +That being said, it may not be immediately clear how to perform common string manipulations in Uiua. This tutorial will cover the basics. + +## Converting numbers with [`parse`]() + +[`parse`]() is the standard way to convert a string to a number. +```uiua +⋕"5.2" +``` +It can also be used on arrays of boxed strings. +```uiua +⋕{"3" "-16" "π" "1e3"} +``` +[`un`]()[`parse`]() will convert numbers to strings. +```uiua +°⋕ 10 +°⋕ [1 2 3] +°⋕ ↯3_4⇡12 +``` + +## Splitting with [`partition`]() + +As discussed in the [Thinking With Arrays](/tutorial/thinkingwitharrays) tutorial, [`partition`]() can be used to split an array by a delimiter. + +First, we create a mask of places where the delimiter is *not* using [`not equals ≠`](). In this case, we'll use the space character. +```uiua +≠@ . "Split this string" +``` +[`partition`]() will then split the strings at the places where the mask changes, ommitting `0`s. +```uiua +⊜□ ≠@ . "Split this string" +``` + +[`partition`]() has an alternate functionality when its function has signature `|2.1` instead of `|1.1`. This will perform a reduction operation, similar to [`reduce`](). + +Using [planet notation](/tutorial/advancedstack#planet-notation), we can select the first or last split section. +```uiua +⊜⊙◌ ≠@ . "Split this string" +``` +```uiua +⊜⋅∘ ≠@ . "Split this string" +``` +For parts of the string that are not the first or last, we can simply [`box`]() and [`select`](). +```uiua +⊏1_3 ⊜□≠@,. "lorem,ipsum,dolor,sit,amet" +``` + +[`partition`]() can be nested to split by multiple delimiters. + +For example, if you were reading from a file that contained rows of numbers separated by spaces, you could use [`partition`]() to create a multi-dimensional array. + +Here, the contents of the file will be represented as a multi-line string. We use [`parse`]() as the inner function to parse the numbers. +```uiua +$ 1 8 4 99 +$ 5 20 0 0 +$ 78 101 1 8 +⊜(⊜⋕≠@ .)≠@\n. +``` + +This assumes that the two delimiters delimit different dimensions of the array. If they delimit the same dimension, we can use [`not`]()[`member`](). +```uiua +$ 1 8 4 99 +$ 5 20 0 0 +$ 78 101 1 8 +⊜⋕¬∊," \n" +``` + +## Finding substrings with [`mask`]() + +What if we want to split by a non-scalar delimiter? Simply dropping a string delimiter into the code above produces an error. +```uiua +⊜□ ≠" - ". "foo - bar - ba-az" +``` +We might try [`find`](). While there may be cases when this output is useful, it is not quite what we want here. +```uiua + ⌕" - " "foo - bar - ba-az" +⊜□ ¬⌕" - ". "foo - bar - ba-az" +``` +This is because [`find`]() only marks the start of each matching substring. + +[`mask`]() marks each substring with an increasing number. +```uiua +⦷" - ". "foo - bar - ba-az" +``` +This works great with [`partition`]() to split the string how we want. +```uiua + ⦷" - " "foo - bar - ba-az" + ¬⦷" - " "foo - bar - ba-az" +⊜□ ¬⦷" - ". "foo - bar - ba-az" +``` +Notice that while [`not`]() leaves parts of the mask negative, [`partition`]() ignores all sections that are not positive. + +## Replacing substrings with [`under`]() + +Because [`under`]() works with [`partition`](), we can use it with [`mask`]() to replace substrings. + +In this example, we replace each row of the [`partition`]()ed array with the string `"orb"`. +```uiua + ⦷ "ab" "abracadabra" + ⊜∘ ⦷ "ab". "abracadabra" +⍜⊜∘≡⋅"orb" ⦷ "ab". "abracadabra" +``` +This can even be used to replace the matches with different strings. +```uiua +⍜⊜□◌ ⦷ "ab". "abracadabra" {"[first]" "[second]"} +``` +Here is how you might replace with a variable number of strings. +```uiua +F ← ⍜⊜□(↙⧻) ⦷ "ab".:°⋕⇡10 +F "abracadabra" +F "abcdefg" +F "ababab|abababab" +``` + +## [`regex`]() + +When a string search operation is especially complicated, you can always fall back to regular expressions using [`regex`](). + +Uiua uses [Rust's regex engine](https://docs.rs/regex) under the hood, so you can use the same syntax as you would in Rust. + +[`regex`]() returns a table of boxed strings. The first element in each row is the match. Subsequent elements are the captures. +```uiua +regex "\\d{3,4}" "(555) 310-1984" +``` +```uiua +regex "a([bc])" "abracadabra" +``` +Optional captures may need [`fill`]() to avoid errors. +```uiua +regex "foo(bar)?(baz)?" "foobar\nfoobaz" +``` +```uiua +⬚""regex "foo(bar)?(baz)?" "foobar\nfoobaz" +``` \ No newline at end of file